Merge pull request #20998 from alalek:update_protobuf_3.19.1
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Wed, 10 Nov 2021 12:03:45 +0000 (15:03 +0300)
committerGitHub <noreply@github.com>
Wed, 10 Nov 2021 12:03:45 +0000 (12:03 +0000)
3rdparty(protobuf): upgrade 3.5.2 => 3.19.1

* 3rdparty(protobuf): upgrade 3.5.2 => 3.19.1

* dnn: update protobuf files (3.19.1)

* 3rdparty(protobuf): re-apply OpenCV patch for custom fields (3.19.1)

* protobuf: suppress new build warnings

* protobuf: remove unused files

247 files changed:
3rdparty/protobuf/CMakeLists.txt
3rdparty/protobuf/LICENSE
3rdparty/protobuf/README.md
3rdparty/protobuf/src/google/protobuf/any.cc
3rdparty/protobuf/src/google/protobuf/any.h
3rdparty/protobuf/src/google/protobuf/any.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/any.pb.h [deleted file]
3rdparty/protobuf/src/google/protobuf/any_lite.cc [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/api.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/api.pb.h [deleted file]
3rdparty/protobuf/src/google/protobuf/arena.cc
3rdparty/protobuf/src/google/protobuf/arena.h
3rdparty/protobuf/src/google/protobuf/arena_impl.h
3rdparty/protobuf/src/google/protobuf/arenastring.cc
3rdparty/protobuf/src/google/protobuf/arenastring.h
3rdparty/protobuf/src/google/protobuf/descriptor.cc
3rdparty/protobuf/src/google/protobuf/descriptor.h
3rdparty/protobuf/src/google/protobuf/descriptor.pb.cc
3rdparty/protobuf/src/google/protobuf/descriptor.pb.h
3rdparty/protobuf/src/google/protobuf/descriptor_database.cc
3rdparty/protobuf/src/google/protobuf/descriptor_database.h
3rdparty/protobuf/src/google/protobuf/duration.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/duration.pb.h [deleted file]
3rdparty/protobuf/src/google/protobuf/dynamic_message.cc
3rdparty/protobuf/src/google/protobuf/dynamic_message.h
3rdparty/protobuf/src/google/protobuf/empty.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/empty.pb.h [deleted file]
3rdparty/protobuf/src/google/protobuf/explicitly_constructed.h [moved from 3rdparty/protobuf/src/google/protobuf/stubs/time.h with 52% similarity]
3rdparty/protobuf/src/google/protobuf/extension_set.cc
3rdparty/protobuf/src/google/protobuf/extension_set.h
3rdparty/protobuf/src/google/protobuf/extension_set_heavy.cc
3rdparty/protobuf/src/google/protobuf/extension_set_inl.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/field_access_listener.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/field_mask.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/field_mask.pb.h
3rdparty/protobuf/src/google/protobuf/generated_enum_reflection.h
3rdparty/protobuf/src/google/protobuf/generated_enum_util.h
3rdparty/protobuf/src/google/protobuf/generated_message_bases.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/generated_message_reflection.cc
3rdparty/protobuf/src/google/protobuf/generated_message_reflection.h
3rdparty/protobuf/src/google/protobuf/generated_message_table_driven.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/generated_message_table_driven.h
3rdparty/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/generated_message_table_driven_lite.h [deleted file]
3rdparty/protobuf/src/google/protobuf/generated_message_tctable_decl.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/generated_message_tctable_impl.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/generated_message_tctable_impl.inc [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/generated_message_util.cc
3rdparty/protobuf/src/google/protobuf/generated_message_util.h
3rdparty/protobuf/src/google/protobuf/has_bits.h
3rdparty/protobuf/src/google/protobuf/implicit_weak_message.cc [moved from 3rdparty/protobuf/src/google/protobuf/stubs/statusor.cc with 64% similarity]
3rdparty/protobuf/src/google/protobuf/implicit_weak_message.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/inlined_string_field.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/io/coded_stream.cc
3rdparty/protobuf/src/google/protobuf/io/coded_stream.h
3rdparty/protobuf/src/google/protobuf/io/coded_stream_inl.h [deleted file]
3rdparty/protobuf/src/google/protobuf/io/gzip_stream.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/io/gzip_stream.h [deleted file]
3rdparty/protobuf/src/google/protobuf/io/io_win32.cc [moved from 3rdparty/protobuf/src/google/protobuf/stubs/io_win32.cc with 79% similarity]
3rdparty/protobuf/src/google/protobuf/io/io_win32.h [moved from 3rdparty/protobuf/src/google/protobuf/stubs/io_win32.h with 58% similarity]
3rdparty/protobuf/src/google/protobuf/io/package_info.h
3rdparty/protobuf/src/google/protobuf/io/printer.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/io/printer.h [deleted file]
3rdparty/protobuf/src/google/protobuf/io/strtod.cc
3rdparty/protobuf/src/google/protobuf/io/strtod.h
3rdparty/protobuf/src/google/protobuf/io/tokenizer.cc
3rdparty/protobuf/src/google/protobuf/io/tokenizer.h
3rdparty/protobuf/src/google/protobuf/io/zero_copy_stream.h
3rdparty/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc
3rdparty/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h
3rdparty/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc
3rdparty/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h
3rdparty/protobuf/src/google/protobuf/map.cc [moved from 3rdparty/protobuf/src/google/protobuf/util/internal/error_listener.cc with 92% similarity]
3rdparty/protobuf/src/google/protobuf/map.h
3rdparty/protobuf/src/google/protobuf/map_entry.h
3rdparty/protobuf/src/google/protobuf/map_entry_lite.h
3rdparty/protobuf/src/google/protobuf/map_field.cc
3rdparty/protobuf/src/google/protobuf/map_field.h
3rdparty/protobuf/src/google/protobuf/map_field_inl.h
3rdparty/protobuf/src/google/protobuf/map_field_lite.h
3rdparty/protobuf/src/google/protobuf/map_type_handler.h
3rdparty/protobuf/src/google/protobuf/message.cc
3rdparty/protobuf/src/google/protobuf/message.h
3rdparty/protobuf/src/google/protobuf/message_lite.cc
3rdparty/protobuf/src/google/protobuf/message_lite.h
3rdparty/protobuf/src/google/protobuf/metadata.h
3rdparty/protobuf/src/google/protobuf/metadata_lite.h
3rdparty/protobuf/src/google/protobuf/package_info.h [deleted file]
3rdparty/protobuf/src/google/protobuf/parse_context.cc [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/parse_context.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/port.h [moved from 3rdparty/protobuf/src/google/protobuf/service.cc with 82% similarity]
3rdparty/protobuf/src/google/protobuf/port_def.inc [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/port_undef.inc [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/reflection.h
3rdparty/protobuf/src/google/protobuf/reflection_internal.h
3rdparty/protobuf/src/google/protobuf/reflection_ops.cc
3rdparty/protobuf/src/google/protobuf/reflection_ops.h
3rdparty/protobuf/src/google/protobuf/repeated_field.cc
3rdparty/protobuf/src/google/protobuf/repeated_field.h
3rdparty/protobuf/src/google/protobuf/repeated_ptr_field.cc [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/repeated_ptr_field.h [new file with mode: 0644]
3rdparty/protobuf/src/google/protobuf/service.h [deleted file]
3rdparty/protobuf/src/google/protobuf/source_context.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/source_context.pb.h [deleted file]
3rdparty/protobuf/src/google/protobuf/struct.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/struct.pb.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomic_sequence_num.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_gcc.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_qnx.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_mips_gcc.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_power.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_ppc_gcc.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_solaris.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_tsan.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/bytestream.cc
3rdparty/protobuf/src/google/protobuf/stubs/bytestream.h
3rdparty/protobuf/src/google/protobuf/stubs/callback.h
3rdparty/protobuf/src/google/protobuf/stubs/casts.h
3rdparty/protobuf/src/google/protobuf/stubs/common.cc
3rdparty/protobuf/src/google/protobuf/stubs/common.h
3rdparty/protobuf/src/google/protobuf/stubs/fastmem.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/hash.h
3rdparty/protobuf/src/google/protobuf/stubs/int128.cc
3rdparty/protobuf/src/google/protobuf/stubs/int128.h
3rdparty/protobuf/src/google/protobuf/stubs/logging.h
3rdparty/protobuf/src/google/protobuf/stubs/macros.h
3rdparty/protobuf/src/google/protobuf/stubs/map_util.h
3rdparty/protobuf/src/google/protobuf/stubs/mathlimits.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/mathlimits.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/mathutil.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/mutex.h
3rdparty/protobuf/src/google/protobuf/stubs/once.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/once.h
3rdparty/protobuf/src/google/protobuf/stubs/platform_macros.h
3rdparty/protobuf/src/google/protobuf/stubs/port.h
3rdparty/protobuf/src/google/protobuf/stubs/scoped_ptr.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/shared_ptr.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/singleton.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/status.cc
3rdparty/protobuf/src/google/protobuf/stubs/status.h
3rdparty/protobuf/src/google/protobuf/stubs/status_macros.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/statusor.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/stl_util.h
3rdparty/protobuf/src/google/protobuf/stubs/stringpiece.cc
3rdparty/protobuf/src/google/protobuf/stubs/stringpiece.h
3rdparty/protobuf/src/google/protobuf/stubs/stringprintf.cc
3rdparty/protobuf/src/google/protobuf/stubs/stringprintf.h
3rdparty/protobuf/src/google/protobuf/stubs/structurally_valid.cc
3rdparty/protobuf/src/google/protobuf/stubs/strutil.cc
3rdparty/protobuf/src/google/protobuf/stubs/strutil.h
3rdparty/protobuf/src/google/protobuf/stubs/substitute.cc
3rdparty/protobuf/src/google/protobuf/stubs/substitute.h
3rdparty/protobuf/src/google/protobuf/stubs/template_util.h [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/time.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/stubs/type_traits.h [deleted file]
3rdparty/protobuf/src/google/protobuf/text_format.cc
3rdparty/protobuf/src/google/protobuf/text_format.h
3rdparty/protobuf/src/google/protobuf/timestamp.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/timestamp.pb.h [deleted file]
3rdparty/protobuf/src/google/protobuf/type.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/type.pb.h [deleted file]
3rdparty/protobuf/src/google/protobuf/unknown_field_set.cc
3rdparty/protobuf/src/google/protobuf/unknown_field_set.h
3rdparty/protobuf/src/google/protobuf/util/delimited_message_util.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/delimited_message_util.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/field_comparator.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/field_comparator.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/field_mask_util.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/field_mask_util.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/constants.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/datapiece.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/datapiece.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/error_listener.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/expecting_objectwriter.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/field_mask_utility.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/json_escaping.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/json_escaping.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/json_objectwriter.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/json_stream_parser.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/location_tracker.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/mock_error_listener.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/object_location_tracker.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/object_source.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/object_writer.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/object_writer.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/proto_writer.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/proto_writer.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/structured_objectwriter.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/type_info.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/type_info.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/utility.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/internal/utility.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/json_util.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/json_util.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/message_differencer.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/message_differencer.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/package_info.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/time_util.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/time_util.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/type_resolver.h [deleted file]
3rdparty/protobuf/src/google/protobuf/util/type_resolver_util.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/util/type_resolver_util.h [deleted file]
3rdparty/protobuf/src/google/protobuf/wire_format.cc
3rdparty/protobuf/src/google/protobuf/wire_format.h
3rdparty/protobuf/src/google/protobuf/wire_format_lite.cc
3rdparty/protobuf/src/google/protobuf/wire_format_lite.h
3rdparty/protobuf/src/google/protobuf/wire_format_lite_inl.h [deleted file]
3rdparty/protobuf/src/google/protobuf/wrappers.pb.cc [deleted file]
3rdparty/protobuf/src/google/protobuf/wrappers.pb.h [deleted file]
modules/dnn/CMakeLists.txt
modules/dnn/misc/caffe/opencv-caffe.pb.cc
modules/dnn/misc/caffe/opencv-caffe.pb.h
modules/dnn/misc/onnx/opencv-onnx.pb.cc
modules/dnn/misc/onnx/opencv-onnx.pb.h
modules/dnn/misc/tensorflow/attr_value.pb.cc
modules/dnn/misc/tensorflow/attr_value.pb.h
modules/dnn/misc/tensorflow/function.pb.cc
modules/dnn/misc/tensorflow/function.pb.h
modules/dnn/misc/tensorflow/graph.pb.cc
modules/dnn/misc/tensorflow/graph.pb.h
modules/dnn/misc/tensorflow/op_def.pb.cc
modules/dnn/misc/tensorflow/op_def.pb.h
modules/dnn/misc/tensorflow/tensor.pb.cc
modules/dnn/misc/tensorflow/tensor.pb.h
modules/dnn/misc/tensorflow/tensor_shape.pb.cc
modules/dnn/misc/tensorflow/tensor_shape.pb.h
modules/dnn/misc/tensorflow/types.pb.cc
modules/dnn/misc/tensorflow/types.pb.h
modules/dnn/misc/tensorflow/versions.pb.cc
modules/dnn/misc/tensorflow/versions.pb.h

index f249d2d..6de8148 100644 (file)
@@ -13,6 +13,9 @@ if(MSVC)
                                        /wd4701 /wd4703     # potentially uninitialized local/pointer variable 'value' used
                                        /wd4505             # unreferenced local function has been removed
   )
+  if(MSVC_VERSION LESS 1910)  # MSVS 2015
+    ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4309)          # 'static_cast': truncation of constant value
+  endif()
 else()
   #NOTE: -Wno-invalid-offsetof was used as solution for invalid offset warning on protobuf #3450
   ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated -Wmissing-prototypes -Wmissing-declarations -Wshadow
@@ -49,98 +52,101 @@ endfunction()
 
 set(PROTOBUF_ROOT "${CMAKE_CURRENT_LIST_DIR}")
 
-if(MSVC)
-  set(ATOMICOPS_INTERNALS ${PROTOBUF_ROOT}/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc)
-else()
-  set(ATOMICOPS_INTERNALS ${PROTOBUF_ROOT}/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc)
-endif()
-
 
 append_if_exist(Protobuf_SRCS
 # libprotobuf-lite
+  ${PROTOBUF_ROOT}/src/google/protobuf/any_lite.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/arena.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/arenastring.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/extension_set.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_table_driven_lite.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/generated_enum_util.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_table_driven_lite.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_tctable_lite.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_util.cc
+  ${PROTOBUF_ROOT}/src/google/protobuf/implicit_weak_message.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/inlined_string_field.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/io/coded_stream.cc
+  ${PROTOBUF_ROOT}/src/google/protobuf/io/io_win32.cc
+  ${PROTOBUF_ROOT}/src/google/protobuf/io/strtod.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/io/zero_copy_stream.cc
+  ${PROTOBUF_ROOT}/src/google/protobuf/io/zero_copy_stream_impl.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc
+  ${PROTOBUF_ROOT}/src/google/protobuf/map.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/message_lite.cc
+  ${PROTOBUF_ROOT}/src/google/protobuf/parse_context.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/repeated_field.cc
-  ${ATOMICOPS_INTERNALS}
+  ${PROTOBUF_ROOT}/src/google/protobuf/repeated_ptr_field.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/bytestream.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/common.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/int128.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/stubs/io_win32.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/stubs/once.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/status.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/stubs/statusor.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/stubs/statusor.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/stringpiece.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/stringprintf.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/structurally_valid.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/strutil.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/stubs/time.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/stubs/time.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/wire_format_lite.cc
+
 # libprotobuf
   ${PROTOBUF_ROOT}/src/google/protobuf/any.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/any.pb.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/api.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/any.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/api.pb.cc
 #  ${PROTOBUF_ROOT}/src/google/protobuf/compiler/importer.cc
 #  ${PROTOBUF_ROOT}/src/google/protobuf/compiler/parser.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/descriptor.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/descriptor.pb.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/descriptor_database.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/duration.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/duration.pb.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/dynamic_message.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/empty.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/empty.pb.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/extension_set_heavy.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/field_mask.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/field_mask.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_bases.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_reflection.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_table_driven.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/io/gzip_stream.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/io/printer.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/io/strtod.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_table_driven.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/generated_message_tctable_full.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/io/gzip_stream.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/io/printer.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/io/tokenizer.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/io/zero_copy_stream_impl.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/map_field.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/message.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/reflection_ops.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/service.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/source_context.pb.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/struct.pb.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/stubs/mathlimits.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/service.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/source_context.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/struct.pb.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/stubs/substitute.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/text_format.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/timestamp.pb.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/type.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/timestamp.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/type.pb.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/unknown_field_set.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/delimited_message_util.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/field_comparator.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/field_mask_util.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/datapiece.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/default_value_objectwriter.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/delimited_message_util.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/field_comparator.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/field_mask_util.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/datapiece.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/default_value_objectwriter.cc
 #  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/error_listener.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/field_mask_utility.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/json_escaping.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/json_objectwriter.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/json_stream_parser.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/object_writer.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/proto_writer.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/protostream_objectsource.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/protostream_objectwriter.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/type_info.cc
-#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/type_info_test_helper.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/utility.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/json_util.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/message_differencer.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/time_util.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/util/type_resolver_util.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/field_mask_utility.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/json_escaping.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/json_objectwriter.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/json_stream_parser.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/object_writer.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/proto_writer.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/protostream_objectsource.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/protostream_objectwriter.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/type_info.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/internal/utility.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/json_util.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/message_differencer.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/time_util.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/util/type_resolver_util.cc
   ${PROTOBUF_ROOT}/src/google/protobuf/wire_format.cc
-  ${PROTOBUF_ROOT}/src/google/protobuf/wrappers.pb.cc
+#  ${PROTOBUF_ROOT}/src/google/protobuf/wrappers.pb.cc
 )
 
-include_directories(BEFORE "${PROTOBUF_ROOT}/src")  # ensure using if own headers: https://github.com/opencv/opencv/issues/13328
+
+include_directories(BEFORE "${PROTOBUF_ROOT}/src")  # ensure using of own headers: https://github.com/opencv/opencv/issues/13328
+
 add_library(libprotobuf STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${Protobuf_SRCS})
 target_include_directories(libprotobuf SYSTEM PUBLIC $<BUILD_INTERFACE:${PROTOBUF_ROOT}/src>)
 set_target_properties(libprotobuf
index f028c82..19b305b 100644 (file)
@@ -1,14 +1,4 @@
-This license applies to all parts of Protocol Buffers except the following:
-
-  - Atomicops support for generic gcc, located in
-    src/google/protobuf/stubs/atomicops_internals_generic_gcc.h.
-    This file is copyrighted by Red Hat Inc.
-
-  - Atomicops support for AIX/POWER, located in
-    src/google/protobuf/stubs/atomicops_internals_power.h.
-    This file is copyrighted by Bloomberg Finance LP.
-
-Copyright 2014, Google Inc.  All rights reserved.
+Copyright 2008 Google Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
index 3040403..32aa03b 100644 (file)
@@ -1,3 +1,3 @@
 Project: Protocol Buffers - Google's data interchange format
 Source code: https://github.com/protocolbuffers/protobuf
-Version: 3.5.2
+Version: 3.19.1
index 83edba5..73c002f 100644 (file)
 
 #include <google/protobuf/any.h>
 
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/message.h>
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
 namespace internal {
 
-namespace {
-string GetTypeUrl(const Descriptor* message,
-                  const string& type_url_prefix) {
-  if (!type_url_prefix.empty() &&
-      type_url_prefix[type_url_prefix.size() - 1] == '/') {
-    return type_url_prefix + message->full_name();
-  } else {
-    return type_url_prefix + "/" + message->full_name();
-  }
-}
-}  // namespace
-
-const char kAnyFullTypeName[] = "google.protobuf.Any";
-const char kTypeGoogleApisComPrefix[] = "type.googleapis.com/";
-const char kTypeGoogleProdComPrefix[] = "type.googleprod.com/";
-
-AnyMetadata::AnyMetadata(UrlType* type_url, ValueType* value)
-    : type_url_(type_url), value_(value) {
+bool AnyMetadata::PackFrom(Arena* arena, const Message& message) {
+  return PackFrom(arena, message, kTypeGoogleApisComPrefix);
 }
 
-void AnyMetadata::PackFrom(const Message& message) {
-  PackFrom(message, kTypeGoogleApisComPrefix);
-}
-
-void AnyMetadata::PackFrom(const Message& message,
-                           const string& type_url_prefix) {
-  type_url_->SetNoArena(&::google::protobuf::internal::GetEmptyString(),
-                        GetTypeUrl(message.GetDescriptor(), type_url_prefix));
-  message.SerializeToString(value_->MutableNoArena(
-      &::google::protobuf::internal::GetEmptyStringAlreadyInited()));
+bool AnyMetadata::PackFrom(Arena* arena, const Message& message,
+                           StringPiece type_url_prefix) {
+  type_url_->Set(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString(),
+      GetTypeUrl(message.GetDescriptor()->full_name(), type_url_prefix), arena);
+  return message.SerializeToString(
+      value_->Mutable(ArenaStringPtr::EmptyDefault{}, arena));
 }
 
 bool AnyMetadata::UnpackTo(Message* message) const {
-  if (!InternalIs(message->GetDescriptor())) {
+  if (!InternalIs(message->GetDescriptor()->full_name())) {
     return false;
   }
-  return message->ParseFromString(value_->GetNoArena());
+  return message->ParseFromString(value_->Get());
 }
 
-bool AnyMetadata::InternalIs(const Descriptor* descriptor) const {
-  const string type_url = type_url_->GetNoArena();
-  string full_name;
-  if (!ParseAnyTypeUrl(type_url, &full_name)) {
-    return false;
-  }
-  return full_name == descriptor->full_name();
-}
-
-bool ParseAnyTypeUrl(const string& type_url, string* full_type_name) {
-  size_t pos = type_url.find_last_of("/");
-  if (pos == string::npos || pos + 1 == type_url.size()) {
-    return false;
-  }
-  *full_type_name = type_url.substr(pos + 1);
-  return true;
-}
-
-
 bool GetAnyFieldDescriptors(const Message& message,
                             const FieldDescriptor** type_url_field,
                             const FieldDescriptor** value_field) {
-    const Descriptor* descriptor = message.GetDescriptor();
-    if (descriptor->full_name() != kAnyFullTypeName) {
-      return false;
-    }
-    *type_url_field = descriptor->FindFieldByNumber(1);
-    *value_field = descriptor->FindFieldByNumber(2);
-    return (*type_url_field != NULL &&
-            (*type_url_field)->type() == FieldDescriptor::TYPE_STRING &&
-            *value_field != NULL &&
-            (*value_field)->type() == FieldDescriptor::TYPE_BYTES);
+  const Descriptor* descriptor = message.GetDescriptor();
+  if (descriptor->full_name() != kAnyFullTypeName) {
+    return false;
+  }
+  *type_url_field = descriptor->FindFieldByNumber(1);
+  *value_field = descriptor->FindFieldByNumber(2);
+  return (*type_url_field != nullptr &&
+          (*type_url_field)->type() == FieldDescriptor::TYPE_STRING &&
+          *value_field != nullptr &&
+          (*value_field)->type() == FieldDescriptor::TYPE_BYTES);
 }
 
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index c2c27ec..e8336fa 100644 (file)
 #include <string>
 
 #include <google/protobuf/stubs/common.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/message.h>
 #include <google/protobuf/arenastring.h>
+#include <google/protobuf/message_lite.h>
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
+
+class FieldDescriptor;
+class Message;
+
 namespace internal {
 
+extern const char kAnyFullTypeName[];          // "google.protobuf.Any".
+extern const char kTypeGoogleApisComPrefix[];  // "type.googleapis.com/".
+extern const char kTypeGoogleProdComPrefix[];  // "type.googleprod.com/".
+
+std::string GetTypeUrl(StringPiece message_name,
+                       StringPiece type_url_prefix);
+
 // Helper class used to implement google::protobuf::Any.
-class LIBPROTOBUF_EXPORT AnyMetadata {
+class PROTOBUF_EXPORT AnyMetadata {
   typedef ArenaStringPtr UrlType;
   typedef ArenaStringPtr ValueType;
  public:
   // AnyMetadata does not take ownership of "type_url" and "value".
-  AnyMetadata(UrlType* type_url, ValueType* value);
+  constexpr AnyMetadata(UrlType* type_url, ValueType* value)
+      : type_url_(type_url), value_(value) {}
 
   // Packs a message using the default type URL prefix: "type.googleapis.com".
   // The resulted type URL will be "type.googleapis.com/<message_full_name>".
-  void PackFrom(const Message& message);
+  // Returns false if serializing the message failed.
+  template <typename T>
+  bool PackFrom(Arena* arena, const T& message) {
+    return InternalPackFrom(arena, message, kTypeGoogleApisComPrefix,
+                            T::FullMessageName());
+  }
+
+  bool PackFrom(Arena* arena, const Message& message);
+
   // Packs a message using the given type URL prefix. The type URL will be
   // constructed by concatenating the message type's full name to the prefix
-  // with an optional "/" separator if the prefix doesn't already end up "/".
+  // with an optional "/" separator if the prefix doesn't already end with "/".
   // For example, both PackFrom(message, "type.googleapis.com") and
   // PackFrom(message, "type.googleapis.com/") yield the same result type
   // URL: "type.googleapis.com/<message_full_name>".
-  void PackFrom(const Message& message, const string& type_url_prefix);
+  // Returns false if serializing the message failed.
+  template <typename T>
+  bool PackFrom(Arena* arena, const T& message,
+                StringPiece type_url_prefix) {
+    return InternalPackFrom(arena, message, type_url_prefix,
+                            T::FullMessageName());
+  }
+
+  bool PackFrom(Arena* arena, const Message& message,
+                StringPiece type_url_prefix);
 
   // Unpacks the payload into the given message. Returns false if the message's
   // type doesn't match the type specified in the type URL (i.e., the full
   // name after the last "/" of the type URL doesn't match the message's actual
   // full name) or parsing the payload has failed.
+  template <typename T>
+  bool UnpackTo(T* message) const {
+    return InternalUnpackTo(T::FullMessageName(), message);
+  }
+
   bool UnpackTo(Message* message) const;
 
   // Checks whether the type specified in the type URL matches the given type.
-  // A type is consdiered matching if its full name matches the full name after
+  // A type is considered matching if its full name matches the full name after
   // the last "/" in the type URL.
-  template<typename T>
+  template <typename T>
   bool Is() const {
-    return InternalIs(T::default_instance().GetDescriptor());
+    return InternalIs(T::FullMessageName());
   }
 
  private:
-  bool InternalIs(const Descriptor* message) const;
+  bool InternalPackFrom(Arena* arena, const MessageLite& message,
+                        StringPiece type_url_prefix,
+                        StringPiece type_name);
+  bool InternalUnpackTo(StringPiece type_name,
+                        MessageLite* message) const;
+  bool InternalIs(StringPiece type_name) const;
 
   UrlType* type_url_;
   ValueType* value_;
@@ -84,15 +124,22 @@ class LIBPROTOBUF_EXPORT AnyMetadata {
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AnyMetadata);
 };
 
-extern const char kAnyFullTypeName[];          // "google.protobuf.Any".
-extern const char kTypeGoogleApisComPrefix[];  // "type.googleapis.com/".
-extern const char kTypeGoogleProdComPrefix[];  // "type.googleprod.com/".
-
 // Get the proto type name from Any::type_url value. For example, passing
 // "type.googleapis.com/rpc.QueryOrigin" will return "rpc.QueryOrigin" in
 // *full_type_name. Returns false if the type_url does not have a "/"
 // in the type url separating the full type name.
-bool ParseAnyTypeUrl(const string& type_url, string* full_type_name);
+//
+// NOTE: this function is available publicly as:
+//   google::protobuf::Any()  // static method on the generated message type.
+bool ParseAnyTypeUrl(StringPiece type_url, std::string* full_type_name);
+
+// Get the proto type name and prefix from Any::type_url value. For example,
+// passing "type.googleapis.com/rpc.QueryOrigin" will return
+// "type.googleapis.com/" in *url_prefix and "rpc.QueryOrigin" in
+// *full_type_name. Returns false if the type_url does not have a "/" in the
+// type url separating the full type name.
+bool ParseAnyTypeUrl(StringPiece type_url, std::string* url_prefix,
+                     std::string* full_type_name);
 
 // See if message is of type google.protobuf.Any, if so, return the descriptors
 // for "type_url" and "value" fields.
@@ -102,6 +149,8 @@ bool GetAnyFieldDescriptors(const Message& message,
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_ANY_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/any.pb.cc b/3rdparty/protobuf/src/google/protobuf/any.pb.cc
deleted file mode 100644 (file)
index 2968747..0000000
+++ /dev/null
@@ -1,440 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/any.proto
-
-#include <google/protobuf/any.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class AnyDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_Any_default_instance_;
-    new (ptr) ::google::protobuf::Any();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::google::protobuf::Any::InitAsDefaultInstance();
-}
-
-void InitDefaultsAny() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsAnyImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[1];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::Any, type_url_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Any, value_),
-};
-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*>(&::google::protobuf::_Any_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/any.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "%github.com/golang/protobuf/ptypes/any\242\002"
-      "\003GPB\252\002\036Google.Protobuf.WellKnownTypesb\006p"
-      "roto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 205);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/any.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_2fany_2eproto
-namespace google {
-namespace protobuf {
-
-// ===================================================================
-
-void Any::InitAsDefaultInstance() {
-}
-void Any::PackFrom(const ::google::protobuf::Message& message) {
-  _any_metadata_.PackFrom(message);
-}
-
-void Any::PackFrom(const ::google::protobuf::Message& message,
-                           const ::std::string& type_url_prefix) {
-  _any_metadata_.PackFrom(message, type_url_prefix);
-}
-
-bool Any::UnpackTo(::google::protobuf::Message* message) const {
-  return _any_metadata_.UnpackTo(message);
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Any::kTypeUrlFieldNumber;
-const int Any::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-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::InitDefaultsAny();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Any)
-}
-Any::Any(const Any& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0),
-      _any_metadata_(&type_url_, &value_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.type_url().size() > 0) {
-    type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_);
-  }
-  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.value().size() > 0) {
-    value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
-  }
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
-}
-
-void Any::SharedCtor() {
-  type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
-}
-
-Any::~Any() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Any)
-  SharedDtor();
-}
-
-void Any::SharedDtor() {
-  type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void Any::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Any& Any::default_instance() {
-  ::protobuf_google_2fprotobuf_2fany_2eproto::InitDefaultsAny();
-  return *internal_default_instance();
-}
-
-Any* Any::New(::google::protobuf::Arena* arena) const {
-  Any* n = new Any;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void Any::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Any)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _internal_metadata_.Clear();
-}
-
-bool Any::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.Any)
-  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)) {
-      // string type_url = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type_url()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->type_url().data(), static_cast<int>(this->type_url().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Any.type_url"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // bytes value = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_value()));
-        } 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.Any)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Any)
-  return false;
-#undef DO_
-}
-
-void Any::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Any)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string type_url = 1;
-  if (this->type_url().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type_url().data(), static_cast<int>(this->type_url().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Any.type_url");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->type_url(), output);
-  }
-
-  // bytes value = 2;
-  if (this->value().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      2, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Any)
-}
-
-::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string type_url = 1;
-  if (this->type_url().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type_url().data(), static_cast<int>(this->type_url().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Any.type_url");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->type_url(), target);
-  }
-
-  // bytes value = 2;
-  if (this->value().size() > 0) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        2, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any)
-  return target;
-}
-
-size_t Any::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // string type_url = 1;
-  if (this->type_url().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->type_url());
-  }
-
-  // bytes value = 2;
-  if (this->value().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::BytesSize(
-        this->value());
-  }
-
-  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 Any::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Any)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Any* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Any>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Any)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Any)
-    MergeFrom(*source);
-  }
-}
-
-void Any::MergeFrom(const Any& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.type_url().size() > 0) {
-
-    type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_);
-  }
-  if (from.value().size() > 0) {
-
-    value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
-  }
-}
-
-void Any::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Any)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Any::CopyFrom(const Any& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Any::IsInitialized() const {
-  return true;
-}
-
-void Any::Swap(Any* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void Any::InternalSwap(Any* other) {
-  using std::swap;
-  type_url_.Swap(&other->type_url_);
-  value_.Swap(&other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Any::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fany_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/any.pb.h b/3rdparty/protobuf/src/google/protobuf/any.pb.h
deleted file mode 100644 (file)
index 3284723..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/any.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2fany_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fany_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/unknown_field_set.h>
-#include <google/protobuf/any.h>
-// @@protoc_insertion_point(includes)
-
-namespace protobuf_google_2fprotobuf_2fany_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[1];
-  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 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 {
-
-// ===================================================================
-
-class LIBPROTOBUF_EXPORT Any : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {
- public:
-  Any();
-  virtual ~Any();
-
-  Any(const Any& from);
-
-  inline Any& operator=(const Any& from) {
-    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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  // implements Any -----------------------------------------------
-
-  void PackFrom(const ::google::protobuf::Message& message);
-  void PackFrom(const ::google::protobuf::Message& message,
-                const ::std::string& type_url_prefix);
-  bool UnpackTo(::google::protobuf::Message* message) const;
-  template<typename T> bool Is() const {
-    return _any_metadata_.Is<T>();
-  }
-
-  void Swap(Any* other);
-  friend void swap(Any& a, Any& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Any* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Any* 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 Any& from);
-  void MergeFrom(const Any& 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(Any* other);
-  private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
-  }
-  public:
-
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
-
-  // nested types ----------------------------------------------------
-
-  // accessors -------------------------------------------------------
-
-  // string type_url = 1;
-  void clear_type_url();
-  static const int kTypeUrlFieldNumber = 1;
-  const ::std::string& type_url() const;
-  void set_type_url(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type_url(::std::string&& value);
-  #endif
-  void set_type_url(const char* value);
-  void set_type_url(const char* value, size_t size);
-  ::std::string* mutable_type_url();
-  ::std::string* release_type_url();
-  void set_allocated_type_url(::std::string* type_url);
-
-  // bytes value = 2;
-  void clear_value();
-  static const int kValueFieldNumber = 2;
-  const ::std::string& value() const;
-  void set_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_value(::std::string&& value);
-  #endif
-  void set_value(const char* value);
-  void set_value(const void* value, size_t size);
-  ::std::string* mutable_value();
-  ::std::string* release_value();
-  void set_allocated_value(::std::string* value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Any)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::ArenaStringPtr type_url_;
-  ::google::protobuf::internal::ArenaStringPtr value_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::AnyMetadata _any_metadata_;
-  friend struct ::protobuf_google_2fprotobuf_2fany_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fany_2eproto::InitDefaultsAnyImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// Any
-
-// string type_url = 1;
-inline void Any::clear_type_url() {
-  type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Any::type_url() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url)
-  return type_url_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Any::mutable_type_url() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url)
-  return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Any::release_type_url() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url)
-  
-  return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline 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;
-inline void Any::clear_value() {
-  value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Any::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Any.value)
-  return value_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Any::mutable_value() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value)
-  return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Any::release_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Any.value)
-  
-  return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline 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)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2fany_2eproto__INCLUDED
diff --git a/3rdparty/protobuf/src/google/protobuf/any_lite.cc b/3rdparty/protobuf/src/google/protobuf/any_lite.cc
new file mode 100644 (file)
index 0000000..a98559d
--- /dev/null
@@ -0,0 +1,99 @@
+// 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/any.h>
+
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/stubs/strutil.h>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+
+std::string GetTypeUrl(StringPiece message_name,
+                       StringPiece type_url_prefix) {
+  if (!type_url_prefix.empty() &&
+      type_url_prefix[type_url_prefix.size() - 1] == '/') {
+    return StrCat(type_url_prefix, message_name);
+  } else {
+    return StrCat(type_url_prefix, "/", message_name);
+  }
+}
+
+const char kAnyFullTypeName[] = "google.protobuf.Any";
+const char kTypeGoogleApisComPrefix[] = "type.googleapis.com/";
+const char kTypeGoogleProdComPrefix[] = "type.googleprod.com/";
+
+bool AnyMetadata::InternalPackFrom(Arena* arena, const MessageLite& message,
+                                   StringPiece type_url_prefix,
+                                   StringPiece type_name) {
+  type_url_->Set(&::google::protobuf::internal::GetEmptyString(),
+                 GetTypeUrl(type_name, type_url_prefix), arena);
+  return message.SerializeToString(
+      value_->Mutable(ArenaStringPtr::EmptyDefault{}, arena));
+}
+
+bool AnyMetadata::InternalUnpackTo(StringPiece type_name,
+                                   MessageLite* message) const {
+  if (!InternalIs(type_name)) {
+    return false;
+  }
+  return message->ParseFromString(value_->Get());
+}
+
+bool AnyMetadata::InternalIs(StringPiece type_name) const {
+  StringPiece type_url = type_url_->Get();
+  return type_url.size() >= type_name.size() + 1 &&
+         type_url[type_url.size() - type_name.size() - 1] == '/' &&
+         HasSuffixString(type_url, type_name);
+}
+
+bool ParseAnyTypeUrl(StringPiece type_url, std::string* url_prefix,
+                     std::string* full_type_name) {
+  size_t pos = type_url.find_last_of('/');
+  if (pos == std::string::npos || pos + 1 == type_url.size()) {
+    return false;
+  }
+  if (url_prefix) {
+    *url_prefix = std::string(type_url.substr(0, pos + 1));
+  }
+  *full_type_name = std::string(type_url.substr(pos + 1));
+  return true;
+}
+
+bool ParseAnyTypeUrl(StringPiece type_url, std::string* full_type_name) {
+  return ParseAnyTypeUrl(type_url, nullptr, full_type_name);
+}
+
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/api.pb.cc b/3rdparty/protobuf/src/google/protobuf/api.pb.cc
deleted file mode 100644 (file)
index 439a47c..0000000
+++ /dev/null
@@ -1,1608 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/api.proto
-
-#include <google/protobuf/api.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class ApiDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Api>
-      _instance;
-} _Api_default_instance_;
-class MethodDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Method>
-      _instance;
-} _Method_default_instance_;
-class MixinDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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();
-}
-
-void InitDefaultsApi() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsApiImpl);
-}
-
-void InitDefaultsMethodImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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();
-}
-
-void InitDefaultsMethod() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMethodImpl);
-}
-
-void InitDefaultsMixinImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_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(::google::protobuf::Api, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  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(::google::protobuf::Method, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  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(::google::protobuf::Mixin, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  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_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*>(&::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_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/api.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "\n\004name\030\001 \001(\t\022(\n\007methods\030\002 \003(\0132\027.google.p"
-      "rotobuf.Method\022(\n\007options\030\003 \003(\0132\027.google"
-      ".protobuf.Option\022\017\n\007version\030\004 \001(\t\0226\n\016sou"
-      "rce_context\030\005 \001(\0132\036.google.protobuf.Sour"
-      "ceContext\022&\n\006mixins\030\006 \003(\0132\026.google.proto"
-      "buf.Mixin\022\'\n\006syntax\030\007 \001(\0162\027.google.proto"
-      "buf.Syntax\"\325\001\n\006Method\022\014\n\004name\030\001 \001(\t\022\030\n\020r"
-      "equest_type_url\030\002 \001(\t\022\031\n\021request_streami"
-      "ng\030\003 \001(\010\022\031\n\021response_type_url\030\004 \001(\t\022\032\n\022r"
-      "esponse_streaming\030\005 \001(\010\022(\n\007options\030\006 \003(\013"
-      "2\027.google.protobuf.Option\022\'\n\006syntax\030\007 \001("
-      "\0162\027.google.protobuf.Syntax\"#\n\005Mixin\022\014\n\004n"
-      "ame\030\001 \001(\t\022\014\n\004root\030\002 \001(\tBu\n\023com.google.pr"
-      "otobufB\010ApiProtoP\001Z+google.golang.org/ge"
-      "nproto/protobuf/api;api\242\002\003GPB\252\002\036Google.P"
-      "rotobuf.WellKnownTypesb\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 750);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/api.proto", &protobuf_RegisterTypes);
-  ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors();
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::AddDescriptors();
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_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());
-}
-void Api::clear_options() {
-  options_.Clear();
-}
-void Api::clear_source_context() {
-  if (GetArenaNoVirtual() == NULL && source_context_ != NULL) {
-    delete source_context_;
-  }
-  source_context_ = NULL;
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Api::kNameFieldNumber;
-const int Api::kMethodsFieldNumber;
-const int Api::kOptionsFieldNumber;
-const int Api::kVersionFieldNumber;
-const int Api::kSourceContextFieldNumber;
-const int Api::kMixinsFieldNumber;
-const int Api::kSyntaxFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Api::Api()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsApi();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Api)
-}
-Api::Api(const Api& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      methods_(from.methods_),
-      options_(from.options_),
-      mixins_(from.mixins_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.version().size() > 0) {
-    version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.version_);
-  }
-  if (from.has_source_context()) {
-    source_context_ = new ::google::protobuf::SourceContext(*from.source_context_);
-  } else {
-    source_context_ = NULL;
-  }
-  syntax_ = from.syntax_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Api)
-}
-
-void Api::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&source_context_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&syntax_) -
-      reinterpret_cast<char*>(&source_context_)) + sizeof(syntax_));
-  _cached_size_ = 0;
-}
-
-Api::~Api() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Api)
-  SharedDtor();
-}
-
-void Api::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (this != internal_default_instance()) delete source_context_;
-}
-
-void Api::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Api& Api::default_instance() {
-  ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsApi();
-  return *internal_default_instance();
-}
-
-Api* Api::New(::google::protobuf::Arena* arena) const {
-  Api* n = new Api;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void Api::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Api)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  methods_.Clear();
-  options_.Clear();
-  mixins_.Clear();
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (GetArenaNoVirtual() == NULL && source_context_ != NULL) {
-    delete source_context_;
-  }
-  source_context_ = NULL;
-  syntax_ = 0;
-  _internal_metadata_.Clear();
-}
-
-bool Api::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.Api)
-  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)) {
-      // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Api.name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Method methods = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_methods()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Option options = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_options()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string version = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_version()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->version().data(), static_cast<int>(this->version().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Api.version"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.SourceContext source_context = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_source_context()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Mixin mixins = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_mixins()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.Syntax syntax = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_syntax(static_cast< ::google::protobuf::Syntax >(value));
-        } 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.Api)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Api)
-  return false;
-#undef DO_
-}
-
-void Api::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Api)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Api.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // repeated .google.protobuf.Method methods = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->methods_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->methods(static_cast<int>(i)), output);
-  }
-
-  // repeated .google.protobuf.Option options = 3;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, this->options(static_cast<int>(i)), output);
-  }
-
-  // string version = 4;
-  if (this->version().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->version().data(), static_cast<int>(this->version().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Api.version");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->version(), output);
-  }
-
-  // .google.protobuf.SourceContext source_context = 5;
-  if (this->has_source_context()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, *this->source_context_, output);
-  }
-
-  // repeated .google.protobuf.Mixin mixins = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->mixins_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, this->mixins(static_cast<int>(i)), output);
-  }
-
-  // .google.protobuf.Syntax syntax = 7;
-  if (this->syntax() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      7, this->syntax(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Api)
-}
-
-::google::protobuf::uint8* Api::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Api)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Api.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // repeated .google.protobuf.Method methods = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->methods_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->methods(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated .google.protobuf.Option options = 3;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, this->options(static_cast<int>(i)), deterministic, target);
-  }
-
-  // string version = 4;
-  if (this->version().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->version().data(), static_cast<int>(this->version().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Api.version");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->version(), target);
-  }
-
-  // .google.protobuf.SourceContext source_context = 5;
-  if (this->has_source_context()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, *this->source_context_, deterministic, target);
-  }
-
-  // repeated .google.protobuf.Mixin mixins = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->mixins_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, this->mixins(static_cast<int>(i)), deterministic, target);
-  }
-
-  // .google.protobuf.Syntax syntax = 7;
-  if (this->syntax() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      7, this->syntax(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Api)
-  return target;
-}
-
-size_t Api::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Api)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // repeated .google.protobuf.Method methods = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->methods_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->methods(static_cast<int>(i)));
-    }
-  }
-
-  // repeated .google.protobuf.Option options = 3;
-  {
-    unsigned int count = static_cast<unsigned int>(this->options_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->options(static_cast<int>(i)));
-    }
-  }
-
-  // repeated .google.protobuf.Mixin mixins = 6;
-  {
-    unsigned int count = static_cast<unsigned int>(this->mixins_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->mixins(static_cast<int>(i)));
-    }
-  }
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
-  }
-
-  // string version = 4;
-  if (this->version().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->version());
-  }
-
-  // .google.protobuf.SourceContext source_context = 5;
-  if (this->has_source_context()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->source_context_);
-  }
-
-  // .google.protobuf.Syntax syntax = 7;
-  if (this->syntax() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->syntax());
-  }
-
-  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 Api::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Api)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Api* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Api>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Api)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Api)
-    MergeFrom(*source);
-  }
-}
-
-void Api::MergeFrom(const Api& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Api)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  methods_.MergeFrom(from.methods_);
-  options_.MergeFrom(from.options_);
-  mixins_.MergeFrom(from.mixins_);
-  if (from.name().size() > 0) {
-
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  if (from.version().size() > 0) {
-
-    version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.version_);
-  }
-  if (from.has_source_context()) {
-    mutable_source_context()->::google::protobuf::SourceContext::MergeFrom(from.source_context());
-  }
-  if (from.syntax() != 0) {
-    set_syntax(from.syntax());
-  }
-}
-
-void Api::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Api)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Api::CopyFrom(const Api& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Api)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Api::IsInitialized() const {
-  return true;
-}
-
-void Api::Swap(Api* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void Api::InternalSwap(Api* other) {
-  using std::swap;
-  methods_.InternalSwap(&other->methods_);
-  options_.InternalSwap(&other->options_);
-  mixins_.InternalSwap(&other->mixins_);
-  name_.Swap(&other->name_);
-  version_.Swap(&other->version_);
-  swap(source_context_, other->source_context_);
-  swap(syntax_, other->syntax_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Api::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void Method::InitAsDefaultInstance() {
-}
-void Method::clear_options() {
-  options_.Clear();
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Method::kNameFieldNumber;
-const int Method::kRequestTypeUrlFieldNumber;
-const int Method::kRequestStreamingFieldNumber;
-const int Method::kResponseTypeUrlFieldNumber;
-const int Method::kResponseStreamingFieldNumber;
-const int Method::kOptionsFieldNumber;
-const int Method::kSyntaxFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Method::Method()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMethod();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Method)
-}
-Method::Method(const Method& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      options_(from.options_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  request_type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.request_type_url().size() > 0) {
-    request_type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.request_type_url_);
-  }
-  response_type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.response_type_url().size() > 0) {
-    response_type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.response_type_url_);
-  }
-  ::memcpy(&request_streaming_, &from.request_streaming_,
-    static_cast<size_t>(reinterpret_cast<char*>(&syntax_) -
-    reinterpret_cast<char*>(&request_streaming_)) + sizeof(syntax_));
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Method)
-}
-
-void Method::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  request_type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  response_type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&request_streaming_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&syntax_) -
-      reinterpret_cast<char*>(&request_streaming_)) + sizeof(syntax_));
-  _cached_size_ = 0;
-}
-
-Method::~Method() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Method)
-  SharedDtor();
-}
-
-void Method::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  request_type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  response_type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void Method::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Method& Method::default_instance() {
-  ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMethod();
-  return *internal_default_instance();
-}
-
-Method* Method::New(::google::protobuf::Arena* arena) const {
-  Method* n = new Method;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void Method::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Method)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  options_.Clear();
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  request_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  response_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&request_streaming_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&syntax_) -
-      reinterpret_cast<char*>(&request_streaming_)) + sizeof(syntax_));
-  _internal_metadata_.Clear();
-}
-
-bool Method::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.Method)
-  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)) {
-      // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Method.name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string request_type_url = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_request_type_url()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->request_type_url().data(), static_cast<int>(this->request_type_url().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Method.request_type_url"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // bool request_streaming = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &request_streaming_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string response_type_url = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_response_type_url()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->response_type_url().data(), static_cast<int>(this->response_type_url().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Method.response_type_url"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // bool response_streaming = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &response_streaming_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Option options = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_options()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.Syntax syntax = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_syntax(static_cast< ::google::protobuf::Syntax >(value));
-        } 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.Method)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Method)
-  return false;
-#undef DO_
-}
-
-void Method::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Method)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Method.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // string request_type_url = 2;
-  if (this->request_type_url().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->request_type_url().data(), static_cast<int>(this->request_type_url().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Method.request_type_url");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->request_type_url(), output);
-  }
-
-  // bool request_streaming = 3;
-  if (this->request_streaming() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->request_streaming(), output);
-  }
-
-  // string response_type_url = 4;
-  if (this->response_type_url().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->response_type_url().data(), static_cast<int>(this->response_type_url().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Method.response_type_url");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->response_type_url(), output);
-  }
-
-  // bool response_streaming = 5;
-  if (this->response_streaming() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->response_streaming(), output);
-  }
-
-  // repeated .google.protobuf.Option options = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, this->options(static_cast<int>(i)), output);
-  }
-
-  // .google.protobuf.Syntax syntax = 7;
-  if (this->syntax() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      7, this->syntax(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Method)
-}
-
-::google::protobuf::uint8* Method::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Method)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Method.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // string request_type_url = 2;
-  if (this->request_type_url().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->request_type_url().data(), static_cast<int>(this->request_type_url().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Method.request_type_url");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->request_type_url(), target);
-  }
-
-  // bool request_streaming = 3;
-  if (this->request_streaming() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->request_streaming(), target);
-  }
-
-  // string response_type_url = 4;
-  if (this->response_type_url().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->response_type_url().data(), static_cast<int>(this->response_type_url().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Method.response_type_url");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->response_type_url(), target);
-  }
-
-  // bool response_streaming = 5;
-  if (this->response_streaming() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->response_streaming(), target);
-  }
-
-  // repeated .google.protobuf.Option options = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, this->options(static_cast<int>(i)), deterministic, target);
-  }
-
-  // .google.protobuf.Syntax syntax = 7;
-  if (this->syntax() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      7, this->syntax(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Method)
-  return target;
-}
-
-size_t Method::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Method)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // repeated .google.protobuf.Option options = 6;
-  {
-    unsigned int count = static_cast<unsigned int>(this->options_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->options(static_cast<int>(i)));
-    }
-  }
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
-  }
-
-  // string request_type_url = 2;
-  if (this->request_type_url().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->request_type_url());
-  }
-
-  // string response_type_url = 4;
-  if (this->response_type_url().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->response_type_url());
-  }
-
-  // bool request_streaming = 3;
-  if (this->request_streaming() != 0) {
-    total_size += 1 + 1;
-  }
-
-  // bool response_streaming = 5;
-  if (this->response_streaming() != 0) {
-    total_size += 1 + 1;
-  }
-
-  // .google.protobuf.Syntax syntax = 7;
-  if (this->syntax() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->syntax());
-  }
-
-  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 Method::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Method)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Method* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Method>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Method)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Method)
-    MergeFrom(*source);
-  }
-}
-
-void Method::MergeFrom(const Method& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Method)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  options_.MergeFrom(from.options_);
-  if (from.name().size() > 0) {
-
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  if (from.request_type_url().size() > 0) {
-
-    request_type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.request_type_url_);
-  }
-  if (from.response_type_url().size() > 0) {
-
-    response_type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.response_type_url_);
-  }
-  if (from.request_streaming() != 0) {
-    set_request_streaming(from.request_streaming());
-  }
-  if (from.response_streaming() != 0) {
-    set_response_streaming(from.response_streaming());
-  }
-  if (from.syntax() != 0) {
-    set_syntax(from.syntax());
-  }
-}
-
-void Method::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Method)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Method::CopyFrom(const Method& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Method)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Method::IsInitialized() const {
-  return true;
-}
-
-void Method::Swap(Method* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void Method::InternalSwap(Method* other) {
-  using std::swap;
-  options_.InternalSwap(&other->options_);
-  name_.Swap(&other->name_);
-  request_type_url_.Swap(&other->request_type_url_);
-  response_type_url_.Swap(&other->response_type_url_);
-  swap(request_streaming_, other->request_streaming_);
-  swap(response_streaming_, other->response_streaming_);
-  swap(syntax_, other->syntax_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Method::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void Mixin::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Mixin::kNameFieldNumber;
-const int Mixin::kRootFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Mixin::Mixin()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMixin();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Mixin)
-}
-Mixin::Mixin(const Mixin& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.root().size() > 0) {
-    root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_);
-  }
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Mixin)
-}
-
-void Mixin::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
-}
-
-Mixin::~Mixin() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Mixin)
-  SharedDtor();
-}
-
-void Mixin::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void Mixin::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Mixin& Mixin::default_instance() {
-  ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMixin();
-  return *internal_default_instance();
-}
-
-Mixin* Mixin::New(::google::protobuf::Arena* arena) const {
-  Mixin* n = new Mixin;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void Mixin::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Mixin)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _internal_metadata_.Clear();
-}
-
-bool Mixin::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.Mixin)
-  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)) {
-      // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Mixin.name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string root = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_root()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->root().data(), static_cast<int>(this->root().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Mixin.root"));
-        } 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.Mixin)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Mixin)
-  return false;
-#undef DO_
-}
-
-void Mixin::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Mixin)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Mixin.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // string root = 2;
-  if (this->root().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->root().data(), static_cast<int>(this->root().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Mixin.root");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->root(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Mixin)
-}
-
-::google::protobuf::uint8* Mixin::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Mixin)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Mixin.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // string root = 2;
-  if (this->root().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->root().data(), static_cast<int>(this->root().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Mixin.root");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->root(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Mixin)
-  return target;
-}
-
-size_t Mixin::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Mixin)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // string name = 1;
-  if (this->name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
-  }
-
-  // string root = 2;
-  if (this->root().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->root());
-  }
-
-  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 Mixin::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Mixin)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Mixin* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Mixin>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Mixin)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Mixin)
-    MergeFrom(*source);
-  }
-}
-
-void Mixin::MergeFrom(const Mixin& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Mixin)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.name().size() > 0) {
-
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  if (from.root().size() > 0) {
-
-    root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_);
-  }
-}
-
-void Mixin::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Mixin)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Mixin::CopyFrom(const Mixin& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Mixin)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Mixin::IsInitialized() const {
-  return true;
-}
-
-void Mixin::Swap(Mixin* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void Mixin::InternalSwap(Mixin* other) {
-  using std::swap;
-  name_.Swap(&other->name_);
-  root_.Swap(&other->root_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Mixin::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/api.pb.h b/3rdparty/protobuf/src/google/protobuf/api.pb.h
deleted file mode 100644 (file)
index 96ff3f1..0000000
+++ /dev/null
@@ -1,1165 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/api.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2fapi_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fapi_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/unknown_field_set.h>
-#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;
-class ApiDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern ApiDefaultTypeInternal _Api_default_instance_;
-class Method;
-class MethodDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern MethodDefaultTypeInternal _Method_default_instance_;
-class Mixin;
-class MixinDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern MixinDefaultTypeInternal _Mixin_default_instance_;
-}  // namespace protobuf
-}  // namespace google
-namespace google {
-namespace protobuf {
-
-// ===================================================================
-
-class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ {
- public:
-  Api();
-  virtual ~Api();
-
-  Api(const Api& from);
-
-  inline Api& operator=(const Api& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Api(Api&& from) noexcept
-    : Api() {
-    *this = ::std::move(from);
-  }
-
-  inline Api& operator=(Api&& 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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void Swap(Api* other);
-  friend void swap(Api& a, Api& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Api* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Api* 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 Api& from);
-  void MergeFrom(const Api& 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(Api* other);
-  private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
-  }
-  public:
-
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
-
-  // nested types ----------------------------------------------------
-
-  // accessors -------------------------------------------------------
-
-  // repeated .google.protobuf.Method methods = 2;
-  int methods_size() const;
-  void clear_methods();
-  static const int kMethodsFieldNumber = 2;
-  const ::google::protobuf::Method& methods(int index) const;
-  ::google::protobuf::Method* mutable_methods(int index);
-  ::google::protobuf::Method* add_methods();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >*
-      mutable_methods();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >&
-      methods() const;
-
-  // repeated .google.protobuf.Option options = 3;
-  int options_size() const;
-  void clear_options();
-  static const int kOptionsFieldNumber = 3;
-  const ::google::protobuf::Option& options(int index) const;
-  ::google::protobuf::Option* mutable_options(int index);
-  ::google::protobuf::Option* add_options();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-      mutable_options();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-      options() const;
-
-  // repeated .google.protobuf.Mixin mixins = 6;
-  int mixins_size() const;
-  void clear_mixins();
-  static const int kMixinsFieldNumber = 6;
-  const ::google::protobuf::Mixin& mixins(int index) const;
-  ::google::protobuf::Mixin* mutable_mixins(int index);
-  ::google::protobuf::Mixin* add_mixins();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >*
-      mutable_mixins();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >&
-      mixins() const;
-
-  // string name = 1;
-  void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-
-  // string version = 4;
-  void clear_version();
-  static const int kVersionFieldNumber = 4;
-  const ::std::string& version() const;
-  void set_version(const ::std::string& value);
-  #if LANG_CXX11
-  void set_version(::std::string&& value);
-  #endif
-  void set_version(const char* value);
-  void set_version(const char* value, size_t size);
-  ::std::string* mutable_version();
-  ::std::string* release_version();
-  void set_allocated_version(::std::string* version);
-
-  // .google.protobuf.SourceContext source_context = 5;
-  bool has_source_context() const;
-  void clear_source_context();
-  static const int kSourceContextFieldNumber = 5;
-  const ::google::protobuf::SourceContext& source_context() const;
-  ::google::protobuf::SourceContext* release_source_context();
-  ::google::protobuf::SourceContext* mutable_source_context();
-  void set_allocated_source_context(::google::protobuf::SourceContext* source_context);
-
-  // .google.protobuf.Syntax syntax = 7;
-  void clear_syntax();
-  static const int kSyntaxFieldNumber = 7;
-  ::google::protobuf::Syntax syntax() const;
-  void set_syntax(::google::protobuf::Syntax value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Api)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method > methods_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin > mixins_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr version_;
-  ::google::protobuf::SourceContext* source_context_;
-  int syntax_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsApiImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ {
- public:
-  Method();
-  virtual ~Method();
-
-  Method(const Method& from);
-
-  inline Method& operator=(const Method& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Method(Method&& from) noexcept
-    : Method() {
-    *this = ::std::move(from);
-  }
-
-  inline Method& operator=(Method&& 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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
-
-  void Swap(Method* other);
-  friend void swap(Method& a, Method& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Method* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Method* 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 Method& from);
-  void MergeFrom(const Method& 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(Method* other);
-  private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
-  }
-  public:
-
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
-
-  // nested types ----------------------------------------------------
-
-  // accessors -------------------------------------------------------
-
-  // repeated .google.protobuf.Option options = 6;
-  int options_size() const;
-  void clear_options();
-  static const int kOptionsFieldNumber = 6;
-  const ::google::protobuf::Option& options(int index) const;
-  ::google::protobuf::Option* mutable_options(int index);
-  ::google::protobuf::Option* add_options();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-      mutable_options();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-      options() const;
-
-  // string name = 1;
-  void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-
-  // string request_type_url = 2;
-  void clear_request_type_url();
-  static const int kRequestTypeUrlFieldNumber = 2;
-  const ::std::string& request_type_url() const;
-  void set_request_type_url(const ::std::string& value);
-  #if LANG_CXX11
-  void set_request_type_url(::std::string&& value);
-  #endif
-  void set_request_type_url(const char* value);
-  void set_request_type_url(const char* value, size_t size);
-  ::std::string* mutable_request_type_url();
-  ::std::string* release_request_type_url();
-  void set_allocated_request_type_url(::std::string* request_type_url);
-
-  // string response_type_url = 4;
-  void clear_response_type_url();
-  static const int kResponseTypeUrlFieldNumber = 4;
-  const ::std::string& response_type_url() const;
-  void set_response_type_url(const ::std::string& value);
-  #if LANG_CXX11
-  void set_response_type_url(::std::string&& value);
-  #endif
-  void set_response_type_url(const char* value);
-  void set_response_type_url(const char* value, size_t size);
-  ::std::string* mutable_response_type_url();
-  ::std::string* release_response_type_url();
-  void set_allocated_response_type_url(::std::string* response_type_url);
-
-  // bool request_streaming = 3;
-  void clear_request_streaming();
-  static const int kRequestStreamingFieldNumber = 3;
-  bool request_streaming() const;
-  void set_request_streaming(bool value);
-
-  // bool response_streaming = 5;
-  void clear_response_streaming();
-  static const int kResponseStreamingFieldNumber = 5;
-  bool response_streaming() const;
-  void set_response_streaming(bool value);
-
-  // .google.protobuf.Syntax syntax = 7;
-  void clear_syntax();
-  static const int kSyntaxFieldNumber = 7;
-  ::google::protobuf::Syntax syntax() const;
-  void set_syntax(::google::protobuf::Syntax value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Method)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr request_type_url_;
-  ::google::protobuf::internal::ArenaStringPtr response_type_url_;
-  bool request_streaming_;
-  bool response_streaming_;
-  int syntax_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMethodImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Mixin : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ {
- public:
-  Mixin();
-  virtual ~Mixin();
-
-  Mixin(const Mixin& from);
-
-  inline Mixin& operator=(const Mixin& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Mixin(Mixin&& from) noexcept
-    : Mixin() {
-    *this = ::std::move(from);
-  }
-
-  inline Mixin& operator=(Mixin&& 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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    2;
-
-  void Swap(Mixin* other);
-  friend void swap(Mixin& a, Mixin& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Mixin* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Mixin* 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 Mixin& from);
-  void MergeFrom(const Mixin& 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(Mixin* other);
-  private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
-  }
-  public:
-
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
-
-  // nested types ----------------------------------------------------
-
-  // accessors -------------------------------------------------------
-
-  // string name = 1;
-  void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-
-  // string root = 2;
-  void clear_root();
-  static const int kRootFieldNumber = 2;
-  const ::std::string& root() const;
-  void set_root(const ::std::string& value);
-  #if LANG_CXX11
-  void set_root(::std::string&& value);
-  #endif
-  void set_root(const char* value);
-  void set_root(const char* value, size_t size);
-  ::std::string* mutable_root();
-  ::std::string* release_root();
-  void set_allocated_root(::std::string* root);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Mixin)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr root_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMixinImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// Api
-
-// string name = 1;
-inline void Api::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Api::name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Api.name)
-  return name_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Api::mutable_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Api::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Api.name)
-  
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline 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;
-inline int Api::methods_size() const {
-  return methods_.size();
-}
-inline void Api::clear_methods() {
-  methods_.Clear();
-}
-inline const ::google::protobuf::Method& Api::methods(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Api.methods)
-  return methods_.Get(index);
-}
-inline ::google::protobuf::Method* Api::mutable_methods(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.methods)
-  return methods_.Mutable(index);
-}
-inline ::google::protobuf::Method* Api::add_methods() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Api.methods)
-  return methods_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >*
-Api::mutable_methods() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.methods)
-  return &methods_;
-}
-inline 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;
-inline int Api::options_size() const {
-  return options_.size();
-}
-inline const ::google::protobuf::Option& Api::options(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Api.options)
-  return options_.Get(index);
-}
-inline ::google::protobuf::Option* Api::mutable_options(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.options)
-  return options_.Mutable(index);
-}
-inline ::google::protobuf::Option* Api::add_options() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Api.options)
-  return options_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-Api::mutable_options() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.options)
-  return &options_;
-}
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-Api::options() const {
-  // @@protoc_insertion_point(field_list:google.protobuf.Api.options)
-  return options_;
-}
-
-// string version = 4;
-inline void Api::clear_version() {
-  version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Api::version() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Api.version)
-  return version_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Api::mutable_version() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.version)
-  return version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Api::release_version() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Api.version)
-  
-  return version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline 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;
-inline bool Api::has_source_context() const {
-  return this != internal_default_instance() && source_context_ != NULL;
-}
-inline 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_);
-}
-inline ::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;
-}
-inline ::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_;
-}
-inline void Api::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_context_);
-  }
-  if (source_context) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      source_context = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, source_context, submessage_arena);
-    }
-    
-  } else {
-    
-  }
-  source_context_ = source_context;
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.source_context)
-}
-
-// repeated .google.protobuf.Mixin mixins = 6;
-inline int Api::mixins_size() const {
-  return mixins_.size();
-}
-inline void Api::clear_mixins() {
-  mixins_.Clear();
-}
-inline const ::google::protobuf::Mixin& Api::mixins(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Api.mixins)
-  return mixins_.Get(index);
-}
-inline ::google::protobuf::Mixin* Api::mutable_mixins(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.mixins)
-  return mixins_.Mutable(index);
-}
-inline ::google::protobuf::Mixin* Api::add_mixins() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Api.mixins)
-  return mixins_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >*
-Api::mutable_mixins() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.mixins)
-  return &mixins_;
-}
-inline 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;
-inline void Api::clear_syntax() {
-  syntax_ = 0;
-}
-inline ::google::protobuf::Syntax Api::syntax() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Api.syntax)
-  return static_cast< ::google::protobuf::Syntax >(syntax_);
-}
-inline void Api::set_syntax(::google::protobuf::Syntax value) {
-  
-  syntax_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Api.syntax)
-}
-
-// -------------------------------------------------------------------
-
-// Method
-
-// string name = 1;
-inline void Method::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Method::name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Method.name)
-  return name_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Method::mutable_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Method.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Method::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Method.name)
-  
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline 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;
-inline void Method::clear_request_type_url() {
-  request_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Method::request_type_url() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Method.request_type_url)
-  return request_type_url_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::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());
-}
-inline ::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());
-}
-inline 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;
-inline void Method::clear_request_streaming() {
-  request_streaming_ = false;
-}
-inline bool Method::request_streaming() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Method.request_streaming)
-  return request_streaming_;
-}
-inline void Method::set_request_streaming(bool value) {
-  
-  request_streaming_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Method.request_streaming)
-}
-
-// string response_type_url = 4;
-inline void Method::clear_response_type_url() {
-  response_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Method::response_type_url() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Method.response_type_url)
-  return response_type_url_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::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());
-}
-inline ::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());
-}
-inline 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;
-inline void Method::clear_response_streaming() {
-  response_streaming_ = false;
-}
-inline bool Method::response_streaming() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Method.response_streaming)
-  return response_streaming_;
-}
-inline 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;
-inline int Method::options_size() const {
-  return options_.size();
-}
-inline const ::google::protobuf::Option& Method::options(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Method.options)
-  return options_.Get(index);
-}
-inline ::google::protobuf::Option* Method::mutable_options(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Method.options)
-  return options_.Mutable(index);
-}
-inline ::google::protobuf::Option* Method::add_options() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Method.options)
-  return options_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-Method::mutable_options() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Method.options)
-  return &options_;
-}
-inline 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;
-inline void Method::clear_syntax() {
-  syntax_ = 0;
-}
-inline ::google::protobuf::Syntax Method::syntax() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Method.syntax)
-  return static_cast< ::google::protobuf::Syntax >(syntax_);
-}
-inline void Method::set_syntax(::google::protobuf::Syntax value) {
-  
-  syntax_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Method.syntax)
-}
-
-// -------------------------------------------------------------------
-
-// Mixin
-
-// string name = 1;
-inline void Mixin::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Mixin::name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Mixin.name)
-  return name_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Mixin::mutable_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Mixin::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Mixin.name)
-  
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline 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;
-inline void Mixin::clear_root() {
-  root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& Mixin::root() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Mixin.root)
-  return root_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Mixin::mutable_root() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.root)
-  return root_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* Mixin::release_root() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Mixin.root)
-  
-  return root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline 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)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2fapi_2eproto__INCLUDED
index e928998..7624e0b 100644 (file)
 #include <google/protobuf/arena.h>
 
 #include <algorithm>
+#include <atomic>
+#include <cstddef>
+#include <cstdint>
 #include <limits>
+#include <typeinfo>
 
+#include <google/protobuf/arena_impl.h>
 
+#include <google/protobuf/stubs/mutex.h>
 #ifdef ADDRESS_SANITIZER
 #include <sanitizer/asan_interface.h>
 #endif  // ADDRESS_SANITIZER
 
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/port_def.inc>
 
 namespace google {
-static const size_t kMinCleanupListElements = 8;
-static const size_t kMaxCleanupListElements = 64;  // 1kB on 64-bit.
-
 namespace protobuf {
 namespace internal {
 
-
-google::protobuf::internal::SequenceNumber ArenaImpl::lifecycle_id_generator_;
-#if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL)
-ArenaImpl::ThreadCache& ArenaImpl::thread_cache() {
-  static internal::ThreadLocalStorage<ThreadCache>* thread_cache_ =
-      new internal::ThreadLocalStorage<ThreadCache>();
-  return *thread_cache_->Get();
-}
-#elif defined(PROTOBUF_USE_DLLS)
-ArenaImpl::ThreadCache& ArenaImpl::thread_cache() {
-  static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_ = { -1, NULL };
-  return thread_cache_;
+static SerialArena::Memory AllocateMemory(const AllocationPolicy* policy_ptr,
+                                          size_t last_size, size_t min_bytes) {
+  AllocationPolicy policy;  // default policy
+  if (policy_ptr) policy = *policy_ptr;
+  size_t size;
+  if (last_size != 0) {
+    // Double the current block size, up to a limit.
+    auto max_size = policy.max_block_size;
+    size = std::min(2 * last_size, max_size);
+  } else {
+    size = policy.start_block_size;
+  }
+  // Verify that min_bytes + kBlockHeaderSize won't overflow.
+  GOOGLE_CHECK_LE(min_bytes,
+           std::numeric_limits<size_t>::max() - SerialArena::kBlockHeaderSize);
+  size = std::max(size, SerialArena::kBlockHeaderSize + min_bytes);
+
+  void* mem;
+  if (policy.block_alloc == nullptr) {
+    mem = ::operator new(size);
+  } else {
+    mem = policy.block_alloc(size);
+  }
+  return {mem, size};
 }
+
+class GetDeallocator {
+ public:
+  GetDeallocator(const AllocationPolicy* policy, size_t* space_allocated)
+      : dealloc_(policy ? policy->block_dealloc : nullptr),
+        space_allocated_(space_allocated) {}
+
+  void operator()(SerialArena::Memory mem) const {
+#ifdef ADDRESS_SANITIZER
+    // This memory was provided by the underlying allocator as unpoisoned,
+    // so return it in an unpoisoned state.
+    ASAN_UNPOISON_MEMORY_REGION(mem.ptr, mem.size);
+#endif  // ADDRESS_SANITIZER
+    if (dealloc_) {
+      dealloc_(mem.ptr, mem.size);
+    } else {
+#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
+      ::operator delete(mem.ptr, mem.size);
 #else
-GOOGLE_THREAD_LOCAL ArenaImpl::ThreadCache ArenaImpl::thread_cache_ = {-1, NULL};
+      ::operator delete(mem.ptr);
 #endif
-
-void ArenaImpl::Init() {
-  lifecycle_id_ = lifecycle_id_generator_.GetNext();
-  google::protobuf::internal::NoBarrier_Store(&hint_, 0);
-  google::protobuf::internal::NoBarrier_Store(&threads_, 0);
-
-  if (initial_block_) {
-    // Thread which calls Init() owns the first block. This allows the
-    // single-threaded case to allocate on the first block without having to
-    // perform atomic operations.
-    InitBlock(initial_block_, &thread_cache(), options_.initial_block_size);
-    ThreadInfo* info = NewThreadInfo(initial_block_);
-    info->next = NULL;
-    google::protobuf::internal::NoBarrier_Store(&threads_,
-                                  reinterpret_cast<google::protobuf::internal::AtomicWord>(info));
-    google::protobuf::internal::NoBarrier_Store(&space_allocated_,
-                                  options_.initial_block_size);
-    CacheBlock(initial_block_);
-  } else {
-    google::protobuf::internal::NoBarrier_Store(&space_allocated_, 0);
+    }
+    *space_allocated_ += mem.size;
   }
-}
 
-ArenaImpl::~ArenaImpl() {
-  // Have to do this in a first pass, because some of the destructors might
-  // refer to memory in other blocks.
-  CleanupList();
-  FreeBlocks();
+ private:
+  void (*dealloc_)(void*, size_t);
+  size_t* space_allocated_;
+};
+
+SerialArena::SerialArena(Block* b, void* owner) : space_allocated_(b->size) {
+  owner_ = owner;
+  head_ = b;
+  ptr_ = b->Pointer(kBlockHeaderSize + ThreadSafeArena::kSerialArenaSize);
+  limit_ = b->Pointer(b->size & static_cast<size_t>(-8));
 }
 
-uint64 ArenaImpl::Reset() {
-  // Have to do this in a first pass, because some of the destructors might
-  // refer to memory in other blocks.
-  CleanupList();
-  uint64 space_allocated = FreeBlocks();
-  Init();
+SerialArena* SerialArena::New(Memory mem, void* owner) {
+  GOOGLE_DCHECK_LE(kBlockHeaderSize + ThreadSafeArena::kSerialArenaSize, mem.size);
 
-  return space_allocated;
+  auto b = new (mem.ptr) Block{nullptr, mem.size};
+  return new (b->Pointer(kBlockHeaderSize)) SerialArena(b, owner);
 }
 
-ArenaImpl::Block* ArenaImpl::NewBlock(void* me, Block* my_last_block,
-                                      size_t min_bytes) {
-  size_t size;
-  if (my_last_block != NULL) {
-    // Double the current block size, up to a limit.
-    size = std::min(2 * my_last_block->size, options_.max_block_size);
-  } else {
-    size = options_.start_block_size;
+template <typename Deallocator>
+SerialArena::Memory SerialArena::Free(Deallocator deallocator) {
+  Block* b = head_;
+  Memory mem = {b, b->size};
+  while (b->next) {
+    b = b->next;  // We must first advance before deleting this block
+    deallocator(mem);
+    mem = {b, b->size};
   }
-  // Verify that min_bytes + kHeaderSize won't overflow.
-  GOOGLE_CHECK_LE(min_bytes, std::numeric_limits<size_t>::max() - kHeaderSize);
-  size = std::max(size, kHeaderSize + min_bytes);
-
-  Block* b = reinterpret_cast<Block*>(options_.block_alloc(size));
-  InitBlock(b, me, size);
-  google::protobuf::internal::NoBarrier_AtomicIncrement(&space_allocated_, size);
-  return b;
+  return mem;
 }
 
-void ArenaImpl::InitBlock(Block* b, void *me, size_t size) {
-  b->pos = kHeaderSize;
-  b->size = size;
-  b->owner = me;
-  b->next = NULL;
-#ifdef ADDRESS_SANITIZER
-  // Poison the rest of the block for ASAN. It was unpoisoned by the underlying
-  // malloc but it's not yet usable until we return it as part of an allocation.
-  ASAN_POISON_MEMORY_REGION(
-      reinterpret_cast<char*>(b) + b->pos, b->size - b->pos);
-#endif  // ADDRESS_SANITIZER
+PROTOBUF_NOINLINE
+std::pair<void*, SerialArena::CleanupNode*>
+SerialArena::AllocateAlignedWithCleanupFallback(
+    size_t n, const AllocationPolicy* policy) {
+  AllocateNewBlock(n + kCleanupSize, policy);
+  return AllocateFromExistingWithCleanupFallback(n);
 }
 
-ArenaImpl::CleanupChunk* ArenaImpl::ExpandCleanupList(CleanupChunk* cleanup,
-                                                      Block* b) {
-  size_t size = cleanup ? cleanup->size * 2 : kMinCleanupListElements;
-  size = std::min(size, kMaxCleanupListElements);
-  size_t bytes = internal::AlignUpTo8(CleanupChunk::SizeOf(size));
-  if (b->avail() < bytes) {
-    b = GetBlock(bytes);
-  }
-  CleanupChunk* list =
-      reinterpret_cast<CleanupChunk*>(AllocFromBlock(b, bytes));
-  list->next = b->thread_info->cleanup;
-  list->size = size;
-  list->len = 0;
-  b->thread_info->cleanup = list;
-  return list;
+PROTOBUF_NOINLINE
+void* SerialArena::AllocateAlignedFallback(size_t n,
+                                           const AllocationPolicy* policy) {
+  AllocateNewBlock(n, policy);
+  return AllocateFromExisting(n);
 }
 
-inline GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-void ArenaImpl::AddCleanupInBlock(
-    Block* b, void* elem, void (*func)(void*)) {
-  CleanupChunk* cleanup = b->thread_info->cleanup;
-  if (cleanup == NULL || cleanup->len == cleanup->size) {
-    cleanup = ExpandCleanupList(cleanup, b);
-  }
+void SerialArena::AllocateNewBlock(size_t n, const AllocationPolicy* policy) {
+  // Sync limit to block
+  head_->start = reinterpret_cast<CleanupNode*>(limit_);
+
+  // Record how much used in this block.
+  space_used_ += ptr_ - head_->Pointer(kBlockHeaderSize);
 
-  CleanupNode* node = &cleanup->nodes[cleanup->len++];
+  auto mem = AllocateMemory(policy, head_->size, n);
+  // We don't want to emit an expensive RMW instruction that requires
+  // exclusive access to a cacheline. Hence we write it in terms of a
+  // regular add.
+  auto relaxed = std::memory_order_relaxed;
+  space_allocated_.store(space_allocated_.load(relaxed) + mem.size, relaxed);
+  head_ = new (mem.ptr) Block{head_, mem.size};
+  ptr_ = head_->Pointer(kBlockHeaderSize);
+  limit_ = head_->Pointer(head_->size);
 
-  node->elem = elem;
-  node->cleanup = func;
+#ifdef ADDRESS_SANITIZER
+  ASAN_POISON_MEMORY_REGION(ptr_, limit_ - ptr_);
+#endif  // ADDRESS_SANITIZER
 }
 
-void ArenaImpl::AddCleanup(void* elem, void (*cleanup)(void*)) {
-  return AddCleanupInBlock(GetBlock(0), elem, cleanup);
+uint64_t SerialArena::SpaceUsed() const {
+  uint64_t space_used = ptr_ - head_->Pointer(kBlockHeaderSize);
+  space_used += space_used_;
+  // Remove the overhead of the SerialArena itself.
+  space_used -= ThreadSafeArena::kSerialArenaSize;
+  return space_used;
+}
+
+void SerialArena::CleanupList() {
+  Block* b = head_;
+  b->start = reinterpret_cast<CleanupNode*>(limit_);
+  do {
+    auto* limit = reinterpret_cast<CleanupNode*>(
+        b->Pointer(b->size & static_cast<size_t>(-8)));
+    auto it = b->start;
+    auto num = limit - it;
+    if (num > 0) {
+      for (; it < limit; it++) {
+        it->cleanup(it->elem);
+      }
+    }
+    b = b->next;
+  } while (b);
 }
 
-void* ArenaImpl::AllocateAligned(size_t n) {
-  GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n);  // Must be already aligned.
 
-  return AllocFromBlock(GetBlock(n), n);
+ThreadSafeArena::CacheAlignedLifecycleIdGenerator
+    ThreadSafeArena::lifecycle_id_generator_;
+#if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL)
+ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() {
+  static internal::ThreadLocalStorage<ThreadCache>* thread_cache_ =
+      new internal::ThreadLocalStorage<ThreadCache>();
+  return *thread_cache_->Get();
+}
+#elif defined(PROTOBUF_USE_DLLS)
+ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() {
+  static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_ = {
+      0, static_cast<LifecycleIdAtomic>(-1), nullptr};
+  return thread_cache_;
 }
+#else
+PROTOBUF_THREAD_LOCAL ThreadSafeArena::ThreadCache
+    ThreadSafeArena::thread_cache_ = {0, static_cast<LifecycleIdAtomic>(-1),
+                                      nullptr};
+#endif
 
-void* ArenaImpl::AllocateAlignedAndAddCleanup(size_t n,
-                                              void (*cleanup)(void*)) {
-  GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n);  // Must be already aligned.
+void ThreadSafeArena::InitializeFrom(void* mem, size_t size) {
+  GOOGLE_DCHECK_EQ(reinterpret_cast<uintptr_t>(mem) & 7, 0u);
+  GOOGLE_DCHECK(!AllocPolicy());  // Reset should call InitializeWithPolicy instead.
+  Init();
 
-  Block* b = GetBlock(n);
-  void* mem = AllocFromBlock(b, n);
-  AddCleanupInBlock(b, mem, cleanup);
-  return mem;
+  // Ignore initial block if it is too small.
+  if (mem != nullptr && size >= kBlockHeaderSize + kSerialArenaSize) {
+    alloc_policy_.set_is_user_owned_initial_block(true);
+    SetInitialBlock(mem, size);
+  }
 }
 
-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.
-  // This fast path optimizes the case where multiple threads allocate from the
-  // same arena.
-  ThreadCache* tc = &thread_cache();
-  if (tc->last_lifecycle_id_seen == lifecycle_id_) {
-    my_block = tc->last_block_used_;
-    if (my_block->avail() >= n) {
-      return my_block;
-    }
+void ThreadSafeArena::InitializeWithPolicy(void* mem, size_t size,
+                                           AllocationPolicy policy) {
+#ifndef NDEBUG
+  const uint64_t old_alloc_policy = alloc_policy_.get_raw();
+  // If there was a policy (e.g., in Reset()), make sure flags were preserved.
+#define GOOGLE_DCHECK_POLICY_FLAGS_() \
+  if (old_alloc_policy > 3)    \
+    GOOGLE_CHECK_EQ(old_alloc_policy & 3, alloc_policy_.get_raw() & 3)
+#else
+#define GOOGLE_DCHECK_POLICY_FLAGS_()
+#endif  // NDEBUG
+
+  if (policy.IsDefault()) {
+    // Legacy code doesn't use the API above, but provides the initial block
+    // through ArenaOptions. I suspect most do not touch the allocation
+    // policy parameters.
+    InitializeFrom(mem, size);
+    GOOGLE_DCHECK_POLICY_FLAGS_();
+    return;
   }
+  GOOGLE_DCHECK_EQ(reinterpret_cast<uintptr_t>(mem) & 7, 0u);
+  Init();
 
-  // Check whether we own the last accessed block on this arena.
-  // This fast path optimizes the case where a single thread uses multiple
-  // arenas.
-  Block* b = reinterpret_cast<Block*>(google::protobuf::internal::Acquire_Load(&hint_));
-  if (b != NULL && b->owner == tc) {
-    my_block = b;
-    if (my_block->avail() >= n) {
-      return my_block;
-    }
+  // Ignore initial block if it is too small. We include an optional
+  // AllocationPolicy in this check, so that this can be allocated on the
+  // first block.
+  constexpr size_t kAPSize = internal::AlignUpTo8(sizeof(AllocationPolicy));
+  constexpr size_t kMinimumSize = kBlockHeaderSize + kSerialArenaSize + kAPSize;
+
+  // The value for alloc_policy_ stores whether or not allocations should be
+  // recorded.
+  alloc_policy_.set_should_record_allocs(
+      policy.metrics_collector != nullptr &&
+      policy.metrics_collector->RecordAllocs());
+  // Make sure we have an initial block to store the AllocationPolicy.
+  if (mem != nullptr && size >= kMinimumSize) {
+    alloc_policy_.set_is_user_owned_initial_block(true);
+  } else {
+    auto tmp = AllocateMemory(&policy, 0, kMinimumSize);
+    mem = tmp.ptr;
+    size = tmp.size;
   }
-  return GetBlockSlow(tc, my_block, n);
-}
+  SetInitialBlock(mem, size);
+
+  auto sa = threads_.load(std::memory_order_relaxed);
+  // We ensured enough space so this cannot fail.
+  void* p;
+  if (!sa || !sa->MaybeAllocateAligned(kAPSize, &p)) {
+    GOOGLE_LOG(FATAL) << "MaybeAllocateAligned cannot fail here.";
+    return;
+  }
+  new (p) AllocationPolicy{policy};
+  // Low bits store flags, so they mustn't be overwritten.
+  GOOGLE_DCHECK_EQ(0, reinterpret_cast<uintptr_t>(p) & 3);
+  alloc_policy_.set_policy(reinterpret_cast<AllocationPolicy*>(p));
+  GOOGLE_DCHECK_POLICY_FLAGS_();
 
-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);
-  size_t p = b->pos;
-  b->pos = p + n;
-#ifdef ADDRESS_SANITIZER
-  ASAN_UNPOISON_MEMORY_REGION(reinterpret_cast<char*>(b) + p, n);
-#endif  // ADDRESS_SANITIZER
-  return reinterpret_cast<char*>(b) + p;
+#undef GOOGLE_DCHECK_POLICY_FLAGS_
 }
 
-ArenaImpl::Block* ArenaImpl::GetBlockSlow(void* me, Block* my_full_block,
-                                          size_t n) {
-  ThreadInfo* info =
-      my_full_block ? my_full_block->thread_info : GetThreadInfo(me, n);
-  GOOGLE_DCHECK(info != NULL);
-  Block* b = info->head;
-  if (b->avail() < n) {
-    Block* new_b = NewBlock(me, b, n);
-    new_b->thread_info = info;
-    new_b->next = b;
-    info->head = new_b;
-    b = new_b;
+void ThreadSafeArena::Init() {
+#ifndef NDEBUG
+  const bool was_message_owned = IsMessageOwned();
+#endif  // NDEBUG
+  ThreadCache& tc = thread_cache();
+  auto id = tc.next_lifecycle_id;
+  // We increment lifecycle_id's by multiples of two so we can use bit 0 as
+  // a tag.
+  constexpr uint64_t kDelta = 2;
+  constexpr uint64_t kInc = ThreadCache::kPerThreadIds * kDelta;
+  if (PROTOBUF_PREDICT_FALSE((id & (kInc - 1)) == 0)) {
+    constexpr auto relaxed = std::memory_order_relaxed;
+    // On platforms that don't support uint64_t atomics we can certainly not
+    // afford to increment by large intervals and expect uniqueness due to
+    // wrapping, hence we only add by 1.
+    id = lifecycle_id_generator_.id.fetch_add(1, relaxed) * kInc;
   }
-  CacheBlock(b);
-  return b;
+  tc.next_lifecycle_id = id + kDelta;
+  // Message ownership is stored in tag_and_id_, and is set in the constructor.
+  // This flag bit must be preserved, even across calls to Reset().
+  tag_and_id_ = id | (tag_and_id_ & kMessageOwnedArena);
+  hint_.store(nullptr, std::memory_order_relaxed);
+  threads_.store(nullptr, std::memory_order_relaxed);
+#ifndef NDEBUG
+  GOOGLE_CHECK_EQ(was_message_owned, IsMessageOwned());
+#endif  // NDEBUG
 }
 
-uint64 ArenaImpl::SpaceAllocated() const {
-  return google::protobuf::internal::NoBarrier_Load(&space_allocated_);
+void ThreadSafeArena::SetInitialBlock(void* mem, size_t size) {
+  SerialArena* serial = SerialArena::New({mem, size}, &thread_cache());
+  serial->set_next(NULL);
+  threads_.store(serial, std::memory_order_relaxed);
+  CacheSerialArena(serial);
 }
 
-uint64 ArenaImpl::SpaceUsed() const {
-  ThreadInfo* info =
-      reinterpret_cast<ThreadInfo*>(google::protobuf::internal::Acquire_Load(&threads_));
-  uint64 space_used = 0;
+ThreadSafeArena::~ThreadSafeArena() {
+  // Have to do this in a first pass, because some of the destructors might
+  // refer to memory in other blocks.
+  CleanupList();
 
-  for ( ; info; info = info->next) {
-    // Remove the overhead of the ThreadInfo itself.
-    space_used -= sizeof(ThreadInfo);
-    for (Block* b = info->head; b; b = b->next) {
-      space_used += (b->pos - kHeaderSize);
-    }
+  size_t space_allocated = 0;
+  auto mem = Free(&space_allocated);
+
+  // Policy is about to get deleted.
+  auto* p = alloc_policy_.get();
+  ArenaMetricsCollector* collector = p ? p->metrics_collector : nullptr;
+
+  if (alloc_policy_.is_user_owned_initial_block()) {
+    space_allocated += mem.size;
+  } else {
+    GetDeallocator(alloc_policy_.get(), &space_allocated)(mem);
   }
 
-  return space_used;
+  if (collector) collector->OnDestroy(space_allocated);
 }
 
-uint64 ArenaImpl::FreeBlocks() {
-  uint64 space_allocated = 0;
-  // By omitting an Acquire barrier we ensure that any user code that doesn't
-  // properly synchronize Reset() or the destructor will throw a TSAN warning.
-  ThreadInfo* info =
-      reinterpret_cast<ThreadInfo*>(google::protobuf::internal::NoBarrier_Load(&threads_));
-
-  while (info) {
-    // This is inside the block we are freeing, so we need to read it now.
-    ThreadInfo* next_info = info->next;
-    for (Block* b = info->head; b; ) {
-      // This is inside the block we are freeing, so we need to read it now.
-      Block* next_block = b->next;
-      space_allocated += (b->size);
-
-#ifdef ADDRESS_SANITIZER
-      // This memory was provided by the underlying allocator as unpoisoned, so
-      // return it in an unpoisoned state.
-      ASAN_UNPOISON_MEMORY_REGION(reinterpret_cast<char*>(b), b->size);
-#endif  // ADDRESS_SANITIZER
+SerialArena::Memory ThreadSafeArena::Free(size_t* space_allocated) {
+  SerialArena::Memory mem = {nullptr, 0};
+  auto deallocator = GetDeallocator(alloc_policy_.get(), space_allocated);
+  PerSerialArena([deallocator, &mem](SerialArena* a) {
+    if (mem.ptr) deallocator(mem);
+    mem = a->Free(deallocator);
+  });
+  return mem;
+}
 
-      if (b != initial_block_) {
-        options_.block_dealloc(b, b->size);
-      }
+uint64_t ThreadSafeArena::Reset() {
+  // Have to do this in a first pass, because some of the destructors might
+  // refer to memory in other blocks.
+  CleanupList();
 
-      b = next_block;
+  // Discard all blocks except the special block (if present).
+  size_t space_allocated = 0;
+  auto mem = Free(&space_allocated);
+
+  AllocationPolicy* policy = alloc_policy_.get();
+  if (policy) {
+    auto saved_policy = *policy;
+    if (alloc_policy_.is_user_owned_initial_block()) {
+      space_allocated += mem.size;
+    } else {
+      GetDeallocator(alloc_policy_.get(), &space_allocated)(mem);
+      mem.ptr = nullptr;
+      mem.size = 0;
+    }
+    ArenaMetricsCollector* collector = saved_policy.metrics_collector;
+    if (collector) collector->OnReset(space_allocated);
+    InitializeWithPolicy(mem.ptr, mem.size, saved_policy);
+  } else {
+    GOOGLE_DCHECK(!alloc_policy_.should_record_allocs());
+    // Nullptr policy
+    if (alloc_policy_.is_user_owned_initial_block()) {
+      space_allocated += mem.size;
+      InitializeFrom(mem.ptr, mem.size);
+    } else {
+      GetDeallocator(alloc_policy_.get(), &space_allocated)(mem);
+      Init();
     }
-    info = next_info;
   }
 
   return space_allocated;
 }
 
-void ArenaImpl::CleanupList() {
-  // By omitting an Acquire barrier we ensure that any user code that doesn't
-  // properly synchronize Reset() or the destructor will throw a TSAN warning.
-  ThreadInfo* info =
-      reinterpret_cast<ThreadInfo*>(google::protobuf::internal::NoBarrier_Load(&threads_));
-
-  for ( ; info; info = info->next) {
-    CleanupChunk* list = info->cleanup;
-    while (list) {
-      size_t n = list->len;
-      CleanupNode* node = &list->nodes[list->len - 1];
-      for (size_t i = 0; i < n; i++, node--) {
-        node->cleanup(node->elem);
-      }
-      list = list->next;
-    }
+std::pair<void*, SerialArena::CleanupNode*>
+ThreadSafeArena::AllocateAlignedWithCleanup(size_t n,
+                                            const std::type_info* type) {
+  SerialArena* arena;
+  if (PROTOBUF_PREDICT_TRUE(!alloc_policy_.should_record_allocs() &&
+                            GetSerialArenaFast(&arena))) {
+    return arena->AllocateAlignedWithCleanup(n, alloc_policy_.get());
+  } else {
+    return AllocateAlignedWithCleanupFallback(n, type);
   }
 }
 
-ArenaImpl::ThreadInfo* ArenaImpl::NewThreadInfo(Block* b) {
-  GOOGLE_DCHECK(FindThreadInfo(b->owner) == NULL);
-  ThreadInfo* info =
-      reinterpret_cast<ThreadInfo*>(AllocFromBlock(b, sizeof(ThreadInfo)));
-  b->thread_info = info;
-  info->owner = b->owner;
-  info->head = b;
-  info->cleanup = NULL;
-  return info;
+void ThreadSafeArena::AddCleanup(void* elem, void (*cleanup)(void*)) {
+  SerialArena* arena;
+  if (PROTOBUF_PREDICT_FALSE(!GetSerialArenaFast(&arena))) {
+    arena = GetSerialArenaFallback(&thread_cache());
+  }
+  arena->AddCleanup(elem, cleanup, AllocPolicy());
 }
 
-ArenaImpl::ThreadInfo* ArenaImpl::FindThreadInfo(void* me) {
-  ThreadInfo* info =
-      reinterpret_cast<ThreadInfo*>(google::protobuf::internal::Acquire_Load(&threads_));
-  for ( ; info; info = info->next) {
-    if (info->owner == me) {
-      return info;
+PROTOBUF_NOINLINE
+void* ThreadSafeArena::AllocateAlignedFallback(size_t n,
+                                               const std::type_info* type) {
+  if (alloc_policy_.should_record_allocs()) {
+    alloc_policy_.RecordAlloc(type, n);
+    SerialArena* arena;
+    if (PROTOBUF_PREDICT_TRUE(GetSerialArenaFast(&arena))) {
+      return arena->AllocateAligned(n, alloc_policy_.get());
     }
   }
+  return GetSerialArenaFallback(&thread_cache())
+      ->AllocateAligned(n, alloc_policy_.get());
+}
 
-  return NULL;
+PROTOBUF_NOINLINE
+std::pair<void*, SerialArena::CleanupNode*>
+ThreadSafeArena::AllocateAlignedWithCleanupFallback(
+    size_t n, const std::type_info* type) {
+  if (alloc_policy_.should_record_allocs()) {
+    alloc_policy_.RecordAlloc(type, n);
+    SerialArena* arena;
+    if (GetSerialArenaFast(&arena)) {
+      return arena->AllocateAlignedWithCleanup(n, alloc_policy_.get());
+    }
+  }
+  return GetSerialArenaFallback(&thread_cache())
+      ->AllocateAlignedWithCleanup(n, alloc_policy_.get());
 }
 
-ArenaImpl::ThreadInfo* ArenaImpl::GetThreadInfo(void* me, size_t n) {
-  ThreadInfo* info = FindThreadInfo(me);
+uint64_t ThreadSafeArena::SpaceAllocated() const {
+  SerialArena* serial = threads_.load(std::memory_order_acquire);
+  uint64_t res = 0;
+  for (; serial; serial = serial->next()) {
+    res += serial->SpaceAllocated();
+  }
+  return res;
+}
 
-  if (!info) {
-    // This thread doesn't have any ThreadInfo, which also means it doesn't have
-    // any blocks yet.  So we'll allocate its first block now.
-    Block* b = NewBlock(me, NULL, sizeof(ThreadInfo) + n);
-    info = NewThreadInfo(b);
+uint64_t ThreadSafeArena::SpaceUsed() const {
+  SerialArena* serial = threads_.load(std::memory_order_acquire);
+  uint64_t space_used = 0;
+  for (; serial; serial = serial->next()) {
+    space_used += serial->SpaceUsed();
+  }
+  return space_used - (alloc_policy_.get() ? sizeof(AllocationPolicy) : 0);
+}
+
+void ThreadSafeArena::CleanupList() {
+  PerSerialArena([](SerialArena* a) { a->CleanupList(); });
+}
+
+PROTOBUF_NOINLINE
+SerialArena* ThreadSafeArena::GetSerialArenaFallback(void* me) {
+  // Look for this SerialArena in our linked list.
+  SerialArena* serial = threads_.load(std::memory_order_acquire);
+  for (; serial; serial = serial->next()) {
+    if (serial->owner() == me) {
+      break;
+    }
+  }
 
-    google::protobuf::internal::AtomicWord head;
+  if (!serial) {
+    // This thread doesn't have any SerialArena, which also means it doesn't
+    // have any blocks yet.  So we'll allocate its first block now.
+    serial = SerialArena::New(
+        AllocateMemory(alloc_policy_.get(), 0, kSerialArenaSize), me);
+
+    SerialArena* head = threads_.load(std::memory_order_relaxed);
     do {
-      head = google::protobuf::internal::NoBarrier_Load(&threads_);
-      info->next = reinterpret_cast<ThreadInfo*>(head);
-    } while (google::protobuf::internal::Release_CompareAndSwap(
-                 &threads_, head, reinterpret_cast<google::protobuf::internal::AtomicWord>(info)) != head);
+      serial->set_next(head);
+    } while (!threads_.compare_exchange_weak(
+        head, serial, std::memory_order_release, std::memory_order_relaxed));
   }
 
-  return info;
+  CacheSerialArena(serial);
+  return serial;
 }
 
 }  // namespace internal
 
-void Arena::CallDestructorHooks() {
-  uint64 space_allocated = impl_.SpaceAllocated();
-  // Call the reset hook
-  if (on_arena_reset_ != NULL) {
-    on_arena_reset_(this, hooks_cookie_, space_allocated);
-  }
+PROTOBUF_FUNC_ALIGN(32)
+void* Arena::AllocateAlignedNoHook(size_t n) {
+  return impl_.AllocateAligned(n, nullptr);
+}
 
-  // Call the destruction hook
-  if (on_arena_destruction_ != NULL) {
-    on_arena_destruction_(this, hooks_cookie_, space_allocated);
-  }
+PROTOBUF_FUNC_ALIGN(32)
+void* Arena::AllocateAlignedWithHook(size_t n, const std::type_info* type) {
+  return impl_.AllocateAligned(n, type);
 }
 
-void Arena::OnArenaAllocation(const std::type_info* allocated_type,
-                              size_t n) const {
-  if (on_arena_allocation_ != NULL) {
-    on_arena_allocation_(allocated_type, n, hooks_cookie_);
-  }
+PROTOBUF_FUNC_ALIGN(32)
+std::pair<void*, internal::SerialArena::CleanupNode*>
+Arena::AllocateAlignedWithCleanup(size_t n, const std::type_info* type) {
+  return impl_.AllocateAlignedWithCleanup(n, type);
 }
 
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 32be9a1..6dd6467 100644 (file)
 #ifndef GOOGLE_PROTOBUF_ARENA_H__
 #define GOOGLE_PROTOBUF_ARENA_H__
 
+
 #include <limits>
+#include <type_traits>
+#include <utility>
 #ifdef max
 #undef max  // Visual Studio defines this macro
 #endif
-#if LANG_CXX11
-#include <google/protobuf/stubs/type_traits.h>
-#endif
-#if defined(_MSC_VER) && !_HAS_EXCEPTIONS
+#if defined(_MSC_VER) && !defined(_LIBCPP_STD_VER) && !_HAS_EXCEPTIONS
 // Work around bugs in MSVC <typeinfo> header when _HAS_EXCEPTIONS=0.
 #include <exception>
 #include <typeinfo>
@@ -51,38 +51,72 @@ using type_info = ::type_info;
 #include <typeinfo>
 #endif
 
+#include <type_traits>
 #include <google/protobuf/arena_impl.h>
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/port.h>
+
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
 
-class Arena;       // defined below
-class Message;     // message.h
+struct ArenaOptions;  // defined below
+class Arena;    // defined below
+class Message;  // defined in message.h
+class MessageLite;
+template <typename Key, typename T>
+class Map;
+
+namespace arena_metrics {
+
+void EnableArenaMetrics(ArenaOptions* options);
+
+}  // namespace arena_metrics
+
+namespace TestUtil {
+class ReflectionTester;  // defined in test_util.h
+}  // namespace TestUtil
 
 namespace internal {
-struct ArenaStringPtr;  // arenastring.h
-class LazyField;   // lazy_field.h
 
-template<typename Type>
-class GenericTypeHandler; // repeated_field.h
+struct ArenaStringPtr;  // defined in arenastring.h
+class InlinedStringField;  // defined in inlined_string_field.h
+class LazyField;        // defined in lazy_field.h
+class EpsCopyInputStream;  // defined in parse_context.h
+
+template <typename Type>
+class GenericTypeHandler;  // defined in repeated_field.h
+
+inline PROTOBUF_ALWAYS_INLINE
+void* AlignTo(void* ptr, size_t align) {
+  return reinterpret_cast<void*>(
+      (reinterpret_cast<uintptr_t>(ptr) + align - 1) & (~align + 1));
+}
 
 // Templated cleanup methods.
-template<typename T> void arena_destruct_object(void* object) {
+template <typename T>
+void arena_destruct_object(void* object) {
   reinterpret_cast<T*>(object)->~T();
 }
-template<typename T> void arena_delete_object(void* object) {
+
+template <bool destructor_skippable, typename T>
+struct ObjectDestructor {
+  constexpr static void (*destructor)(void*) = &arena_destruct_object<T>;
+};
+
+template <typename T>
+struct ObjectDestructor<true, T> {
+  constexpr static void (*destructor)(void*) = nullptr;
+};
+
+template <typename T>
+void arena_delete_object(void* object) {
   delete reinterpret_cast<T*>(object);
 }
-inline void arena_free(void* object, size_t size) {
-#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
-  ::operator delete(object, size);
-#else
-  (void)size;
-  ::operator delete(object);
-#endif
-}
-
 }  // namespace internal
 
 // ArenaOptions provides optional additional parameters to arena construction
@@ -117,49 +151,45 @@ struct ArenaOptions {
   // from the arena. By default, it contains a ptr to a wrapper function that
   // calls free.
   void (*block_dealloc)(void*, size_t);
-  // Hooks for adding external functionality such as user-specific metrics
-  // collection, specific debugging abilities, etc.
-  // Init hook may return a pointer to a cookie to be stored in the arena.
-  // reset and destruction hooks will then be called with the same cookie
-  // pointer. This allows us to save an external object per arena instance and
-  // use it on the other hooks (Note: It is just as legal for init to return
-  // NULL and not use the cookie feature).
-  // on_arena_reset and on_arena_destruction also receive the space used in
-  // the arena just before the reset.
-  void* (*on_arena_init)(Arena* arena);
-  void (*on_arena_reset)(Arena* arena, void* cookie, uint64 space_used);
-  void (*on_arena_destruction)(Arena* arena, void* cookie, uint64 space_used);
-
-  // type_info is promised to be static - its lifetime extends to
-  // match program's lifetime (It is given by typeid operator).
-  // Note: typeid(void) will be passed as allocated_type every time we
-  // intentionally want to avoid monitoring an allocation. (i.e. internal
-  // allocations for managing the arena)
-  void (*on_arena_allocation)(const std::type_info* allocated_type,
-      uint64 alloc_size, void* cookie);
 
   ArenaOptions()
-      : start_block_size(kDefaultStartBlockSize),
-        max_block_size(kDefaultMaxBlockSize),
+      : start_block_size(internal::AllocationPolicy::kDefaultStartBlockSize),
+        max_block_size(internal::AllocationPolicy::kDefaultMaxBlockSize),
         initial_block(NULL),
         initial_block_size(0),
-        block_alloc(&::operator new),
-        block_dealloc(&internal::arena_free),
-        on_arena_init(NULL),
-        on_arena_reset(NULL),
-        on_arena_destruction(NULL),
-        on_arena_allocation(NULL) {}
+        block_alloc(nullptr),
+        block_dealloc(nullptr),
+        make_metrics_collector(nullptr) {}
 
  private:
-  // Constants define default starting block size and max block size for
-  // arena allocator behavior -- see descriptions above.
-  static const size_t kDefaultStartBlockSize = 256;
-  static const size_t kDefaultMaxBlockSize   = 8192;
+  // If make_metrics_collector is not nullptr, it will be called at Arena init
+  // time. It may return a pointer to a collector instance that will be notified
+  // of interesting events related to the arena.
+  internal::ArenaMetricsCollector* (*make_metrics_collector)();
+
+  internal::ArenaMetricsCollector* MetricsCollector() const {
+    return make_metrics_collector ? (*make_metrics_collector)() : nullptr;
+  }
+
+  internal::AllocationPolicy AllocationPolicy() const {
+    internal::AllocationPolicy res;
+    res.start_block_size = start_block_size;
+    res.max_block_size = max_block_size;
+    res.block_alloc = block_alloc;
+    res.block_dealloc = block_dealloc;
+    res.metrics_collector = MetricsCollector();
+    return res;
+  }
+
+  friend void arena_metrics::EnableArenaMetrics(ArenaOptions*);
+
+  friend class Arena;
+  friend class ArenaOptionsTestFriend;
 };
 
 // Support for non-RTTI environments. (The metrics hooks API uses type
 // information.)
-#ifndef GOOGLE_PROTOBUF_NO_RTTI
+#if PROTOBUF_RTTI
 #define RTTI_TYPE_ID(type) (&typeid(type))
 #else
 #define RTTI_TYPE_ID(type) (NULL)
@@ -185,14 +215,15 @@ struct ArenaOptions {
 // any special requirements on the type T, and will invoke the object's
 // destructor when the arena is destroyed.
 //
-// The arena message allocation protocol, required by CreateMessage<T>, is as
-// follows:
+// The arena message allocation protocol, required by
+// CreateMessage<T>(Arena* arena, Args&&... args), is as follows:
 //
-// - The type T must have (at least) two constructors: a constructor with no
-//   arguments, called when a T is allocated on the heap; and a constructor with
-//   a google::protobuf::Arena* argument, called when a T is allocated on an arena. If the
-//   second constructor is called with a NULL arena pointer, it must be
-//   equivalent to invoking the first (no-argument) constructor.
+// - The type T must have (at least) two constructors: a constructor callable
+//   with `args` (without `arena`), called when a T is allocated on the heap;
+//   and a constructor callable with `Arena* arena, Args&&... args`, called when
+//   a T is allocated on an arena. If the second constructor is called with a
+//   NULL arena pointer, it must be equivalent to invoking the first
+//   (`args`-only) constructor.
 //
 // - The type T must have a particular type trait: a nested type
 //   |InternalArenaConstructable_|. This is usually a typedef to |void|. If no
@@ -205,23 +236,28 @@ struct ArenaOptions {
 //   present on the type, then its destructor is always called when the
 //   containing arena is destroyed.
 //
-// - One- and two-user-argument forms of CreateMessage<T>() also exist that
-//   forward these constructor arguments to T's constructor: for example,
-//   CreateMessage<T>(Arena*, arg1, arg2) forwards to a constructor T(Arena*,
-//   arg1, arg2).
-//
 // This protocol is implemented by all arena-enabled proto2 message classes as
-// well as RepeatedPtrField.
-//
-// Do NOT subclass Arena. This class will be marked as final when C++11 is
-// enabled.
-class LIBPROTOBUF_EXPORT Arena {
+// well as protobuf container types like RepeatedPtrField and Map. The protocol
+// is internal to protobuf and is not guaranteed to be stable. Non-proto types
+// should not rely on this protocol.
+class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
  public:
-  // Arena constructor taking custom options. See ArenaOptions below for
+  // Default constructor with sensible default options, tuned for average
+  // use-cases.
+  inline Arena() : impl_() {}
+
+  // Construct an arena with default options, except for the supplied
+  // initial block. It is more efficient to use this constructor
+  // instead of passing ArenaOptions if the only configuration needed
+  // by the caller is supplying an initial block.
+  inline Arena(char* initial_block, size_t initial_block_size)
+      : impl_(initial_block, initial_block_size) {}
+
+  // Arena constructor taking custom options. See ArenaOptions above for
   // descriptions of the options available.
-  explicit Arena(const ArenaOptions& options) : impl_(options) {
-    Init(options);
-  }
+  explicit Arena(const ArenaOptions& options)
+      : impl_(options.initial_block, options.initial_block_size,
+              options.AllocationPolicy()) {}
 
   // Block overhead.  Use this as a guide for how much to over-allocate the
   // initial block if you want an allocation of size N to fit inside it.
@@ -229,29 +265,14 @@ class LIBPROTOBUF_EXPORT Arena {
   // WARNING: if you allocate multiple objects, it is difficult to guarantee
   // that a series of allocations will fit in the initial block, especially if
   // Arena changes its alignment guarantees in the future!
-  static const size_t kBlockOverhead = internal::ArenaImpl::kHeaderSize;
+  static const size_t kBlockOverhead =
+      internal::ThreadSafeArena::kBlockHeaderSize +
+      internal::ThreadSafeArena::kSerialArenaSize;
 
-  // Default constructor with sensible default options, tuned for average
-  // use-cases.
-  Arena() : impl_(ArenaOptions()) { Init(ArenaOptions()); }
+  inline ~Arena() {}
 
-  ~Arena() {
-    if (on_arena_reset_ != NULL || on_arena_destruction_ != NULL) {
-      CallDestructorHooks();
-    }
-  }
-
-  void Init(const ArenaOptions& options) {
-    on_arena_allocation_ = options.on_arena_allocation;
-    on_arena_reset_ = options.on_arena_reset;
-    on_arena_destruction_ = options.on_arena_destruction;
-    // Call the initialization hook
-    if (options.on_arena_init != NULL) {
-      hooks_cookie_ = options.on_arena_init(this);
-    } else {
-      hooks_cookie_ = NULL;
-    }
-  }
+  // TODO(protobuf-team): Fix callers to use constructor and delete this method.
+  void Init(const ArenaOptions&) {}
 
   // API to create proto2 message objects on the arena. If the arena passed in
   // is NULL, then a heap allocated object is returned. Type T must be a message
@@ -263,69 +284,15 @@ class LIBPROTOBUF_EXPORT Arena {
   //
   // This function also accepts any type T that satisfies the arena message
   // allocation protocol, documented above.
-#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(
-        InternalHelper<T>::is_arena_constructable::value,
-        "CreateMessage can only construct types that are ArenaConstructable");
-#endif
-    if (arena == NULL) {
-      return new T;
-    } else {
-      return arena->CreateMessageInternal<T>();
-    }
-  }
-
-  // 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static T* CreateMessage(::google::protobuf::Arena* arena, const Arg& arg) {
-#if LANG_CXX11
+  PROTOBUF_ALWAYS_INLINE static T* CreateMessage(Arena* arena, Args&&... args) {
     static_assert(
         InternalHelper<T>::is_arena_constructable::value,
         "CreateMessage can only construct types that are ArenaConstructable");
-#endif
-    if (arena == NULL) {
-      return new T(NULL, arg);
-    } else {
-      return arena->CreateMessageInternal<T>(arg);
-    }
-  }
-
-  // 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static T* CreateMessage(::google::protobuf::Arena* arena,
-                          const Arg1& arg1,
-                          const Arg2& arg2) {
-#if LANG_CXX11
-    static_assert(
-        InternalHelper<T>::is_arena_constructable::value,
-        "CreateMessage can only construct types that are ArenaConstructable");
-#endif
-    if (arena == NULL) {
-      return new T(NULL, arg1, arg2);
-    } else {
-      return arena->CreateMessageInternal<T>(arg1, arg2);
-    }
+    // We must delegate to CreateMaybeMessage() and NOT CreateMessageInternal()
+    // because protobuf generated classes specialize CreateMaybeMessage() and we
+    // need to use that specialization for code size reasons.
+    return Arena::CreateMaybeMessage<T>(arena, static_cast<Args&&>(args)...);
   }
 
   // API to create any objects on the arena. Note that only the object will
@@ -343,152 +310,10 @@ class LIBPROTOBUF_EXPORT Arena {
   // (unless the destructor is trivial). Hence, from T's point of view, it is as
   // 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static T* Create(::google::protobuf::Arena* arena, Args&&... args) {
-    if (arena == NULL) {
-      return new T(std::forward<Args>(args)...);
-    } else {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value,
-                                      std::forward<Args>(args)...);
-    }
-  }
-#endif
-  template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static T* Create(::google::protobuf::Arena* arena) {
-    if (arena == NULL) {
-      return new T();
-    } else {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value);
-    }
-  }
-
-  // Version of the above with one constructor argument for the created object.
-  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);
-    } else {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value,
-                                      arg);
-    }
-  }
-
-  // Version of the above with two constructor arguments for the created object.
-  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);
-    } else {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value,
-                                      arg1, arg2);
-    }
-  }
-
-  // Version of the above with three constructor arguments for the created
-  // object.
-  template <typename T, typename Arg1, typename Arg2, typename 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 {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value,
-                                      arg1, arg2, arg3);
-    }
-  }
-
-  // Version of the above with four constructor arguments for the created
-  // object.
-  template <typename T, typename Arg1, typename Arg2, typename Arg3,
-            typename 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 {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value,
-                                      arg1, arg2, arg3, arg4);
-    }
-  }
-
-  // Version of the above with five constructor arguments for the created
-  // object.
-  template <typename T, typename Arg1, typename Arg2, typename Arg3,
-            typename Arg4, typename 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 {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value,
-                                      arg1, arg2, arg3, arg4, arg5);
-    }
-  }
-
-  // Version of the above with six constructor arguments for the created
-  // object.
-  template <typename T, typename Arg1, typename Arg2, typename Arg3,
-            typename Arg4, typename Arg5, typename 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 {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value,
-                                      arg1, arg2, arg3, arg4, arg5, arg6);
-    }
-  }
-
-  // Version of the above with seven constructor arguments for the created
-  // object.
-  template <typename T, typename Arg1, typename Arg2, typename Arg3,
-            typename Arg4, typename Arg5, typename Arg6, typename 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 {
-      return arena->CreateInternal<T>(google::protobuf::internal::has_trivial_destructor<T>::value,
-                                      arg1, arg2, arg3, arg4, arg5, arg6, arg7);
-    }
-  }
-
-  // Version of the above with eight constructor arguments for the created
-  // object.
-  template <typename T, typename Arg1, typename Arg2, typename Arg3,
-            typename Arg4, typename Arg5, typename Arg6, typename Arg7,
-            typename 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 {
-      return arena->CreateInternal<T>(
-          google::protobuf::internal::has_trivial_destructor<T>::value,
-          arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-    }
+  PROTOBUF_NDEBUG_INLINE static T* Create(Arena* arena, Args&&... args) {
+    return CreateInternal<T>(arena, std::is_convertible<T*, MessageLite*>(),
+                             static_cast<Args&&>(args)...);
   }
 
   // Create an array of object type T on the arena *without* invoking the
@@ -497,10 +322,14 @@ 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_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))
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE static T* CreateArray(Arena* arena,
+                                               size_t num_elements) {
+    static_assert(std::is_trivial<T>::value,
+                  "CreateArray requires a trivially constructible type");
+    static_assert(std::is_trivially_destructible<T>::value,
+                  "CreateArray requires a trivially destructible type");
+    GOOGLE_CHECK_LE(num_elements, std::numeric_limits<size_t>::max() / sizeof(T))
         << "Requested size is too large to fit into size_t.";
     if (arena == NULL) {
       return static_cast<T*>(::operator new[](num_elements * sizeof(T)));
@@ -509,41 +338,31 @@ class LIBPROTOBUF_EXPORT Arena {
     }
   }
 
+  // The following are routines are for monitoring. They will approximate the
+  // total sum allocated and used memory, but the exact value is an
+  // implementation deal. For instance allocated space depends on growth
+  // policies. Do not use these in unit tests.
   // Returns the total space allocated by the arena, which is the sum of the
-  // sizes of the underlying blocks. This method is relatively fast; a counter
-  // is kept as blocks are allocated.
-  uint64 SpaceAllocated() const { return impl_.SpaceAllocated(); }
+  // sizes of the underlying blocks.
+  uint64_t SpaceAllocated() const { return impl_.SpaceAllocated(); }
   // Returns the total space used by the arena. Similar to SpaceAllocated but
   // does not include free space and block overhead. The total space returned
   // may not include space used by other threads executing concurrently with
   // the call to this method.
-  uint64 SpaceUsed() const { return impl_.SpaceUsed(); }
-  // DEPRECATED. Please use SpaceAllocated() and SpaceUsed().
-  //
-  // Combines SpaceAllocated and SpaceUsed. Returns a pair of
-  // <space_allocated, space_used>.
-  std::pair<uint64, uint64> SpaceAllocatedAndUsed() const {
-    return std::make_pair(SpaceAllocated(), SpaceUsed());
-  }
+  uint64_t SpaceUsed() const { return impl_.SpaceUsed(); }
 
   // Frees all storage allocated by this arena after calling destructors
   // registered with OwnDestructor() and freeing objects registered with Own().
   // 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_PROTOBUF_ATTRIBUTE_NOINLINE uint64 Reset() {
-    // Call the reset hook
-    if (on_arena_reset_ != NULL) {
-      on_arena_reset_(this, hooks_cookie_, impl_.SpaceAllocated());
-    }
-    return impl_.Reset();
-  }
+  uint64_t Reset() { return impl_.Reset(); }
 
   // 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_PROTOBUF_ATTRIBUTE_NOINLINE
-  void Own(T* object) {
-    OwnInternal(object, google::protobuf::internal::is_convertible<T*, ::google::protobuf::Message*>());
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE void Own(T* object) {
+    OwnInternal(object, std::is_convertible<T*, MessageLite*>());
   }
 
   // Adds |object| to a list of objects whose destructors will be manually
@@ -551,8 +370,8 @@ 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_PROTOBUF_ATTRIBUTE_NOINLINE
-  void OwnDestructor(T* object) {
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE void OwnDestructor(T* object) {
     if (object != NULL) {
       impl_.AddCleanup(object, &internal::arena_destruct_object<T>);
     }
@@ -562,102 +381,208 @@ 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_PROTOBUF_ATTRIBUTE_NOINLINE void OwnCustomDestructor(
-      void* object, void (*destruct)(void*)) {
+  PROTOBUF_ALWAYS_INLINE void OwnCustomDestructor(void* object,
+                                                  void (*destruct)(void*)) {
     impl_.AddCleanup(object, destruct);
   }
 
   // Retrieves the arena associated with |value| if |value| is an arena-capable
-  // 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static ::google::protobuf::Arena* GetArena(const T* value) {
-    return GetArenaInternal(value, is_arena_constructable<T>());
+  // message, or NULL otherwise. If possible, the call resolves at compile time.
+  // Note that we can often devirtualize calls to `value->GetArena()` so usually
+  // calling this method is unnecessary.
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE static Arena* GetArena(const T* value) {
+    return GetArenaInternal(value);
   }
 
   template <typename T>
   class InternalHelper {
+   public:
+    // Provides access to protected GetOwningArena to generated messages.
+    static Arena* GetOwningArena(const T* p) { return p->GetOwningArena(); }
+
+    // Provides access to protected GetArenaForAllocation to generated messages.
+    static Arena* GetArenaForAllocation(const T* p) {
+      return GetArenaForAllocationInternal(
+          p, std::is_convertible<T*, MessageLite*>());
+    }
+
+    // Creates message-owned arena.
+    static Arena* CreateMessageOwnedArena() {
+      return new Arena(internal::MessageOwned{});
+    }
+
+    // Checks whether the given arena is message-owned.
+    static bool IsMessageOwnedArena(Arena* arena) {
+      return arena->IsMessageOwned();
+    }
+
+   private:
+    static Arena* GetArenaForAllocationInternal(
+        const T* p, std::true_type /*is_derived_from<MessageLite>*/) {
+      return p->GetArenaForAllocation();
+    }
+
+    static Arena* GetArenaForAllocationInternal(
+        const T* p, std::false_type /*is_derived_from<MessageLite>*/) {
+      return GetArenaForAllocationForNonMessage(
+          p, typename is_arena_constructable::type());
+    }
+
+    static Arena* GetArenaForAllocationForNonMessage(
+        const T* p, std::true_type /*is_arena_constructible*/) {
+      return p->GetArena();
+    }
+
+    static Arena* GetArenaForAllocationForNonMessage(
+        const T* p, std::false_type /*is_arena_constructible*/) {
+      return GetArenaForAllocationForNonMessageNonArenaConstructible(
+          p, typename has_get_arena::type());
+    }
+
+    static Arena* GetArenaForAllocationForNonMessageNonArenaConstructible(
+        const T* p, std::true_type /*has_get_arena*/) {
+      return p->GetArena();
+    }
+
+    static Arena* GetArenaForAllocationForNonMessageNonArenaConstructible(
+        const T* /* p */, std::false_type /*has_get_arena*/) {
+      return nullptr;
+    }
+
     template <typename U>
     static char DestructorSkippable(const typename U::DestructorSkippable_*);
     template <typename U>
     static double DestructorSkippable(...);
 
-    typedef google::protobuf::internal::integral_constant<
+    typedef std::integral_constant<
         bool, sizeof(DestructorSkippable<T>(static_cast<const T*>(0))) ==
                       sizeof(char) ||
-                  google::protobuf::internal::has_trivial_destructor<T>::value>
+                  std::is_trivially_destructible<T>::value>
         is_destructor_skippable;
 
-    template<typename U>
+    template <typename U>
     static char ArenaConstructable(
         const typename U::InternalArenaConstructable_*);
-    template<typename U>
+    template <typename U>
     static double ArenaConstructable(...);
 
-    typedef google::protobuf::internal::integral_constant<bool, sizeof(ArenaConstructable<T>(
-                                              static_cast<const T*>(0))) ==
-                                              sizeof(char)>
+    typedef std::integral_constant<bool, sizeof(ArenaConstructable<T>(
+                                             static_cast<const T*>(0))) ==
+                                             sizeof(char)>
         is_arena_constructable;
 
-#if LANG_CXX11
+    template <typename U,
+              typename std::enable_if<
+                  std::is_same<Arena*, decltype(std::declval<const U>()
+                                                    .GetArena())>::value,
+                  int>::type = 0>
+    static char HasGetArena(decltype(&U::GetArena));
+    template <typename U>
+    static double HasGetArena(...);
+
+    typedef std::integral_constant<bool, sizeof(HasGetArena<T>(nullptr)) ==
+                                             sizeof(char)>
+        has_get_arena;
+
     template <typename... Args>
     static T* Construct(void* ptr, Args&&... args) {
-      return new (ptr) T(std::forward<Args>(args)...);
+      return new (ptr) T(static_cast<Args&&>(args)...);
     }
-#else
-    template <typename Arg1>
-    static T* Construct(void* ptr, const Arg1& arg1) {
-      return new (ptr) T(arg1);
-    }
-    template <typename Arg1, typename Arg2>
-    static T* Construct(void* ptr, const Arg1& arg1, const Arg2& arg2) {
-      return new (ptr) T(arg1, arg2);
-    }
-    template <typename Arg1, typename Arg2, typename Arg3>
-    static T* Construct(void* ptr, const Arg1& arg1,
-                        const Arg2& arg2, const Arg3& arg3) {
-      return new (ptr) T(arg1, arg2, arg3);
+
+    static inline PROTOBUF_ALWAYS_INLINE T* New() {
+      return new T(nullptr);
     }
-#endif  // LANG_CXX11
 
-    static Arena* GetArena(const T* p) { return p->GetArenaNoVirtual(); }
+    static Arena* GetArena(const T* p) { return p->GetArena(); }
 
     friend class Arena;
+    friend class TestUtil::ReflectionTester;
   };
 
-  // Helper typetrait that indicates support for arenas in a type T at compile
+  // Helper typetraits that indicates support for arenas in a type T at compile
   // time. This is public only to allow construction of higher-level templated
-  // utilities. is_arena_constructable<T>::value is true if the message type T
-  // has arena support enabled, and false otherwise.
+  // utilities.
+  //
+  // is_arena_constructable<T>::value is true if the message type T has arena
+  // support enabled, and false otherwise.
+  //
+  // is_destructor_skippable<T>::value is true if the message type T has told
+  // the arena that it is safe to skip the destructor, and false otherwise.
   //
   // This is inside Arena because only Arena has the friend relationships
   // necessary to see the underlying generated code traits.
   template <typename T>
   struct is_arena_constructable : InternalHelper<T>::is_arena_constructable {};
+  template <typename T>
+  struct is_destructor_skippable : InternalHelper<T>::is_destructor_skippable {
+  };
 
  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)) {
-      OnArenaAllocation(allocated_type, n);
+  internal::ThreadSafeArena impl_;
+
+  template <typename T>
+  struct has_get_arena : InternalHelper<T>::has_get_arena {};
+
+  // Constructor solely used by message-owned arena.
+  inline Arena(internal::MessageOwned) : impl_(internal::MessageOwned{}) {}
+
+  // Checks whether this arena is message-owned.
+  PROTOBUF_ALWAYS_INLINE bool IsMessageOwned() const {
+    return impl_.IsMessageOwned();
+  }
+
+  template <typename T, typename... Args>
+  PROTOBUF_NDEBUG_INLINE static T* CreateMessageInternal(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(nullptr, static_cast<Args&&>(args)...);
+    } else {
+      return arena->DoCreateMessage<T>(static_cast<Args&&>(args)...);
+    }
+  }
+
+  // This specialization for no arguments is necessary, because its behavior is
+  // slightly different.  When the arena pointer is nullptr, it calls T()
+  // instead of T(nullptr).
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE static T* CreateMessageInternal(Arena* arena) {
+    static_assert(
+        InternalHelper<T>::is_arena_constructable::value,
+        "CreateMessage can only construct types that are ArenaConstructable");
+    if (arena == NULL) {
+      // Generated arena constructor T(Arena*) is protected. Call via
+      // InternalHelper.
+      return InternalHelper<T>::New();
+    } else {
+      return arena->DoCreateMessage<T>();
     }
   }
 
-  // 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  void* AllocateInternal(bool skip_explicit_ownership) {
-    const size_t n = internal::AlignUpTo8(sizeof(T));
-    AllocHook(RTTI_TYPE_ID(T), n);
+  // Allocate and also optionally call collector with the allocated type info
+  // when allocation recording is enabled.
+  PROTOBUF_NDEBUG_INLINE void* AllocateInternal(size_t size, size_t align,
+                                                void (*destructor)(void*),
+                                                const std::type_info* type) {
     // Monitor allocation if needed.
-    if (skip_explicit_ownership) {
-      return impl_.AllocateAligned(n);
+    if (destructor == nullptr) {
+      return AllocateAlignedWithHook(size, align, type);
     } else {
-      return impl_.AllocateAlignedAndAddCleanup(
-          n, &internal::arena_destruct_object<T>);
+      if (align <= 8) {
+        auto res = AllocateAlignedWithCleanup(internal::AlignUpTo8(size), type);
+        res.second->elem = res.first;
+        res.second->cleanup = destructor;
+        return res.first;
+      } else {
+        auto res = AllocateAlignedWithCleanup(size + align - 8, type);
+        auto ptr = internal::AlignTo(res.first, align);
+        res.second->elem = ptr;
+        res.second->cleanup = destructor;
+        return ptr;
+      }
     }
   }
 
@@ -666,218 +591,132 @@ 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static Msg* CreateMaybeMessage(Arena* arena, google::protobuf::internal::true_type) {
-    return CreateMessage<Msg>(arena);
+  template <typename Msg, typename... Args>
+  PROTOBUF_ALWAYS_INLINE static Msg* DoCreateMaybeMessage(Arena* arena,
+                                                          std::true_type,
+                                                          Args&&... args) {
+    return CreateMessageInternal<Msg>(arena, std::forward<Args>(args)...);
   }
 
-  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, typename... Args>
+  PROTOBUF_ALWAYS_INLINE static T* DoCreateMaybeMessage(Arena* arena,
+                                                        std::false_type,
+                                                        Args&&... args) {
+    return Create<T>(arena, std::forward<Args>(args)...);
   }
 
-  template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static T* CreateMaybeMessage(Arena* arena) {
-    return CreateMaybeMessage<T>(arena, is_arena_constructable<T>());
+  template <typename T, typename... Args>
+  PROTOBUF_ALWAYS_INLINE static T* CreateMaybeMessage(Arena* arena,
+                                                      Args&&... args) {
+    return DoCreateMaybeMessage<T>(arena, is_arena_constructable<T>(),
+                                   std::forward<Args>(args)...);
   }
 
   // Just allocate the required size for the given type assuming the
   // type has a trivial constructor.
-  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))
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE T* CreateInternalRawArray(size_t num_elements) {
+    GOOGLE_CHECK_LE(num_elements, std::numeric_limits<size_t>::max() / sizeof(T))
         << "Requested size is too large to fit into size_t.";
-    const size_t n = internal::AlignUpTo8(sizeof(T) * num_elements);
-    // Monitor allocation if needed.
-    AllocHook(RTTI_TYPE_ID(T), n);
-    return static_cast<T*>(impl_.AllocateAligned(n));
+    // We count on compiler to realize that if sizeof(T) is a multiple of
+    // 8 AlignUpTo can be elided.
+    const size_t n = sizeof(T) * num_elements;
+    return static_cast<T*>(
+        AllocateAlignedWithHook(n, alignof(T), RTTI_TYPE_ID(T)));
   }
 
-#if LANG_CXX11
   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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  T* CreateInternal(bool skip_explicit_ownership) {
-    return new (AllocateInternal<T>(skip_explicit_ownership)) T();
-  }
-
-  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_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_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_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_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_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_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);
-  }
-
-  template <typename T, typename Arg1, typename Arg2, typename Arg3,
-            typename Arg4, typename Arg5, typename Arg6, typename Arg7,
-            typename 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) {
+  PROTOBUF_NDEBUG_INLINE T* DoCreateMessage(Args&&... args) {
     return InternalHelper<T>::Construct(
-        AllocateInternal<T>(InternalHelper<T>::is_destructor_skippable::value),
+        AllocateInternal(sizeof(T), alignof(T),
+                         internal::ObjectDestructor<
+                             InternalHelper<T>::is_destructor_skippable::value,
+                             T>::destructor,
+                         RTTI_TYPE_ID(T)),
         this, std::forward<Args>(args)...);
   }
-#endif
-  template <typename T>
-  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_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_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);
-  }
 
   // CreateInArenaStorage is used to implement map field. Without it,
-  // google::protobuf::Map need to call generated message's protected arena constructor,
-  // which needs to declare google::protobuf::Map as friend of generated message.
-  template <typename T>
-  static void CreateInArenaStorage(T* ptr, Arena* arena) {
+  // Map need to call generated message's protected arena constructor,
+  // which needs to declare Map as friend of generated message.
+  template <typename T, typename... Args>
+  static void CreateInArenaStorage(T* ptr, Arena* arena, Args&&... args) {
     CreateInArenaStorageInternal(ptr, arena,
-                                 typename is_arena_constructable<T>::type());
-    RegisterDestructorInternal(
-        ptr, arena,
-        typename InternalHelper<T>::is_destructor_skippable::type());
+                                 typename is_arena_constructable<T>::type(),
+                                 std::forward<Args>(args)...);
+    if (arena != nullptr) {
+      RegisterDestructorInternal(
+          ptr, arena,
+          typename InternalHelper<T>::is_destructor_skippable::type());
+    }
   }
 
-  template <typename T>
-  static void CreateInArenaStorageInternal(
-      T* ptr, Arena* arena, google::protobuf::internal::true_type) {
-    InternalHelper<T>::Construct(ptr, arena);
+  template <typename T, typename... Args>
+  static void CreateInArenaStorageInternal(T* ptr, Arena* arena,
+                                           std::true_type, Args&&... args) {
+    InternalHelper<T>::Construct(ptr, arena, std::forward<Args>(args)...);
   }
-  template <typename T>
-  static void CreateInArenaStorageInternal(
-      T* ptr, Arena* /* arena */, google::protobuf::internal::false_type) {
-    new (ptr) T();
+  template <typename T, typename... Args>
+  static void CreateInArenaStorageInternal(T* ptr, Arena* /* arena */,
+                                           std::false_type, Args&&... args) {
+    new (ptr) T(std::forward<Args>(args)...);
   }
 
   template <typename T>
-  static void RegisterDestructorInternal(
-      T* /* ptr */, Arena* /* arena */, google::protobuf::internal::true_type) {}
+  static void RegisterDestructorInternal(T* /* ptr */, Arena* /* arena */,
+                                         std::true_type) {}
   template <typename T>
-  static void RegisterDestructorInternal(
-      T* ptr, Arena* arena, google::protobuf::internal::false_type) {
+  static void RegisterDestructorInternal(T* ptr, Arena* arena,
+                                         std::false_type) {
     arena->OwnDestructor(ptr);
   }
 
+  // These implement Create(). The second parameter has type 'true_type' if T is
+  // a subtype of Message and 'false_type' otherwise.
+  template <typename T, typename... Args>
+  PROTOBUF_ALWAYS_INLINE static T* CreateInternal(Arena* arena, std::true_type,
+                                                  Args&&... args) {
+    if (arena == nullptr) {
+      return new T(std::forward<Args>(args)...);
+    } else {
+      auto destructor =
+          internal::ObjectDestructor<std::is_trivially_destructible<T>::value,
+                                     T>::destructor;
+      T* result =
+          new (arena->AllocateInternal(sizeof(T), alignof(T), destructor,
+                                       RTTI_TYPE_ID(T)))
+          T(std::forward<Args>(args)...);
+      return result;
+    }
+  }
+  template <typename T, typename... Args>
+  PROTOBUF_ALWAYS_INLINE static T* CreateInternal(Arena* arena, std::false_type,
+                                                  Args&&... args) {
+    if (arena == nullptr) {
+      return new T(std::forward<Args>(args)...);
+    } else {
+      auto destructor =
+          internal::ObjectDestructor<std::is_trivially_destructible<T>::value,
+                                     T>::destructor;
+      return new (arena->AllocateInternal(sizeof(T), alignof(T), destructor,
+                                          RTTI_TYPE_ID(T)))
+          T(std::forward<Args>(args)...);
+    }
+  }
+
   // These implement Own(), which registers an object for deletion (destructor
   // call and operator delete()). The second parameter has type 'true_type' if T
-  // is a subtype of ::google::protobuf::Message and 'false_type' otherwise. Collapsing
+  // is a subtype of 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  void OwnInternal(T* object, google::protobuf::internal::true_type) {
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE void OwnInternal(T* object, std::true_type) {
     if (object != NULL) {
-      impl_.AddCleanup(object,
-                       &internal::arena_delete_object< ::google::protobuf::Message>);
+      impl_.AddCleanup(object, &internal::arena_delete_object<MessageLite>);
     }
   }
-  template<typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  void OwnInternal(T* object, google::protobuf::internal::false_type) {
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE void OwnInternal(T* object, std::false_type) {
     if (object != NULL) {
       impl_.AddCleanup(object, &internal::arena_delete_object<T>);
     }
@@ -885,42 +724,88 @@ 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static ::google::protobuf::Arena* GetArenaInternal(
-      const T* value, google::protobuf::internal::true_type) {
+  // objects must implement a GetArena() method.
+  template <typename T, typename std::enable_if<
+                            is_arena_constructable<T>::value, int>::type = 0>
+  PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal(const T* value) {
     return InternalHelper<T>::GetArena(value);
   }
+  template <typename T,
+            typename std::enable_if<!is_arena_constructable<T>::value &&
+                                        has_get_arena<T>::value,
+                                    int>::type = 0>
+  PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal(const T* value) {
+    return value->GetArena();
+  }
+  template <typename T,
+            typename std::enable_if<!is_arena_constructable<T>::value &&
+                                        !has_get_arena<T>::value,
+                                    int>::type = 0>
+  PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal(const T* value) {
+    (void)value;
+    return nullptr;
+  }
 
   template <typename T>
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static ::google::protobuf::Arena* GetArenaInternal(
-      const T* /* value */, google::protobuf::internal::false_type) {
-    return NULL;
+  PROTOBUF_ALWAYS_INLINE static Arena* GetOwningArena(const T* value) {
+    return GetOwningArenaInternal(
+        value, std::is_convertible<T*, MessageLite*>());
   }
 
-  // For friends of arena.
-  void* AllocateAligned(size_t n) {
-    AllocHook(NULL, n);
-    return impl_.AllocateAligned(internal::AlignUpTo8(n));
+  // Implementation for GetOwningArena(). All and only message objects have
+  // GetOwningArena() method.
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE static Arena* GetOwningArenaInternal(
+      const T* value, std::true_type) {
+    return InternalHelper<T>::GetOwningArena(value);
+  }
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE static Arena* GetOwningArenaInternal(
+      const T* /* value */, std::false_type) {
+    return nullptr;
   }
 
-  internal::ArenaImpl impl_;
+  // For friends of arena.
+  void* AllocateAligned(size_t n, size_t align = 8) {
+    if (align <= 8) {
+      return AllocateAlignedNoHook(internal::AlignUpTo8(n));
+    } else {
+      // We are wasting space by over allocating align - 8 bytes. Compared
+      // to a dedicated function that takes current alignment in consideration.
+      // Such a scheme would only waste (align - 8)/2 bytes on average, but
+      // requires a dedicated function in the outline arena allocation
+      // functions. Possibly re-evaluate tradeoffs later.
+      return internal::AlignTo(AllocateAlignedNoHook(n + align - 8), align);
+    }
+  }
 
-  void* (*on_arena_init_)(Arena* arena);
-  void (*on_arena_allocation_)(const std::type_info* allocated_type,
-                               uint64 alloc_size, void* cookie);
-  void (*on_arena_reset_)(Arena* arena, void* cookie, uint64 space_used);
-  void (*on_arena_destruction_)(Arena* arena, void* cookie, uint64 space_used);
+  void* AllocateAlignedWithHook(size_t n, size_t align,
+                                const std::type_info* type) {
+    if (align <= 8) {
+      return AllocateAlignedWithHook(internal::AlignUpTo8(n), type);
+    } else {
+      // We are wasting space by over allocating align - 8 bytes. Compared
+      // to a dedicated function that takes current alignment in consideration.
+      // Such a schemee would only waste (align - 8)/2 bytes on average, but
+      // requires a dedicated function in the outline arena allocation
+      // functions. Possibly re-evaluate tradeoffs later.
+      return internal::AlignTo(AllocateAlignedWithHook(n + align - 8, type),
+                               align);
+    }
+  }
 
-  // The arena may save a cookie it receives from the external on_init hook
-  // and then use it when calling the on_reset and on_destruction hooks.
-  void* hooks_cookie_;
+  void* AllocateAlignedNoHook(size_t n);
+  void* AllocateAlignedWithHook(size_t n, const std::type_info* type);
+  std::pair<void*, internal::SerialArena::CleanupNode*>
+  AllocateAlignedWithCleanup(size_t n, const std::type_info* type);
 
   template <typename Type>
-  friend class ::google::protobuf::internal::GenericTypeHandler;
+  friend class internal::GenericTypeHandler;
   friend struct internal::ArenaStringPtr;  // For AllocateAligned.
-  friend class internal::LazyField;    // For CreateMaybeMessage.
+  friend class internal::InlinedStringField;  // For AllocateAligned.
+  friend class internal::LazyField;        // For CreateMaybeMessage.
+  friend class internal::EpsCopyInputStream;  // For parser performance
+  friend class MessageLite;
   template <typename Key, typename T>
   friend class Map;
 };
@@ -929,6 +814,8 @@ class LIBPROTOBUF_EXPORT Arena {
 #undef RTTI_TYPE_ID
 
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_ARENA_H__
index 6cc7096..2ffac31 100644 (file)
 #ifndef GOOGLE_PROTOBUF_ARENA_IMPL_H__
 #define GOOGLE_PROTOBUF_ARENA_IMPL_H__
 
+#include <atomic>
 #include <limits>
+#include <typeinfo>
 
-#include <google/protobuf/stubs/atomic_sequence_num.h>
-#include <google/protobuf/stubs/atomicops.h>
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/mutex.h>
-#include <google/protobuf/stubs/type_traits.h>
 
-#include <google/protobuf/stubs/port.h>
+#ifdef ADDRESS_SANITIZER
+#include <sanitizer/asan_interface.h>
+#endif  // ADDRESS_SANITIZER
+
+#include <google/protobuf/port_def.inc>
 
-namespace google {
 
+namespace google {
 namespace protobuf {
 namespace internal {
 
-inline size_t AlignUpTo8(size_t n) {
+inline constexpr size_t AlignUpTo8(size_t n) {
   // Align n to next multiple of 8 (from Hacker's Delight, Chapter 3.)
-  return (n + 7) & -8;
+  return (n + 7) & static_cast<size_t>(-8);
 }
 
+using LifecycleIdAtomic = uint64_t;
+
+// MetricsCollector collects stats for a particular arena.
+class PROTOBUF_EXPORT ArenaMetricsCollector {
+ public:
+  ArenaMetricsCollector(bool record_allocs) : record_allocs_(record_allocs) {}
+
+  // Invoked when the arena is about to be destroyed. This method will
+  // typically finalize any metric collection and delete the collector.
+  // space_allocated is the space used by the arena.
+  virtual void OnDestroy(uint64_t space_allocated) = 0;
+
+  // OnReset() is called when the associated arena is reset.
+  // space_allocated is the space used by the arena just before the reset.
+  virtual void OnReset(uint64_t space_allocated) = 0;
+
+  // OnAlloc is called when an allocation happens.
+  // type_info is promised to be static - its lifetime extends to
+  // match program's lifetime (It is given by typeid operator).
+  // Note: typeid(void) will be passed as allocated_type every time we
+  // intentionally want to avoid monitoring an allocation. (i.e. internal
+  // allocations for managing the arena)
+  virtual void OnAlloc(const std::type_info* allocated_type,
+                       uint64_t alloc_size) = 0;
+
+  // Does OnAlloc() need to be called?  If false, metric collection overhead
+  // will be reduced since we will not do extra work per allocation.
+  bool RecordAllocs() { return record_allocs_; }
+
+ protected:
+  // This class is destructed by the call to OnDestroy().
+  ~ArenaMetricsCollector() = default;
+  const bool record_allocs_;
+};
+
+struct AllocationPolicy {
+  static constexpr size_t kDefaultStartBlockSize = 256;
+  static constexpr size_t kDefaultMaxBlockSize = 8192;
+
+  size_t start_block_size = kDefaultStartBlockSize;
+  size_t max_block_size = kDefaultMaxBlockSize;
+  void* (*block_alloc)(size_t) = nullptr;
+  void (*block_dealloc)(void*, size_t) = nullptr;
+  ArenaMetricsCollector* metrics_collector = nullptr;
+
+  bool IsDefault() const {
+    return start_block_size == kDefaultMaxBlockSize &&
+           max_block_size == kDefaultMaxBlockSize && block_alloc == nullptr &&
+           block_dealloc == nullptr && metrics_collector == nullptr;
+  }
+};
+
+// Tagged pointer to an AllocationPolicy.
+class TaggedAllocationPolicyPtr {
+ public:
+  constexpr TaggedAllocationPolicyPtr() : policy_(0) {}
+
+  explicit TaggedAllocationPolicyPtr(AllocationPolicy* policy)
+      : policy_(reinterpret_cast<uintptr_t>(policy)) {}
+
+  void set_policy(AllocationPolicy* policy) {
+    auto bits = policy_ & kTagsMask;
+    policy_ = reinterpret_cast<uintptr_t>(policy) | bits;
+  }
+
+  AllocationPolicy* get() {
+    return reinterpret_cast<AllocationPolicy*>(policy_ & kPtrMask);
+  }
+  const AllocationPolicy* get() const {
+    return reinterpret_cast<const AllocationPolicy*>(policy_ & kPtrMask);
+  }
+
+  AllocationPolicy& operator*() { return *get(); }
+  const AllocationPolicy& operator*() const { return *get(); }
+
+  AllocationPolicy* operator->() { return get(); }
+  const AllocationPolicy* operator->() const { return get(); }
+
+  bool is_user_owned_initial_block() const {
+    return static_cast<bool>(get_mask<kUserOwnedInitialBlock>());
+  }
+  void set_is_user_owned_initial_block(bool v) {
+    set_mask<kUserOwnedInitialBlock>(v);
+  }
+
+  bool should_record_allocs() const {
+    return static_cast<bool>(get_mask<kRecordAllocs>());
+  }
+  void set_should_record_allocs(bool v) { set_mask<kRecordAllocs>(v); }
+
+  uintptr_t get_raw() const { return policy_; }
+
+  inline void RecordAlloc(const std::type_info* allocated_type,
+                          size_t n) const {
+    get()->metrics_collector->OnAlloc(allocated_type, n);
+  }
+
+ private:
+  enum : uintptr_t {
+    kUserOwnedInitialBlock = 1,
+    kRecordAllocs = 2,
+  };
+
+  static constexpr uintptr_t kTagsMask = 7;
+  static constexpr uintptr_t kPtrMask = ~kTagsMask;
+
+  template <uintptr_t kMask>
+  uintptr_t get_mask() const {
+    return policy_ & kMask;
+  }
+  template <uintptr_t kMask>
+  void set_mask(bool v) {
+    if (v) {
+      policy_ |= kMask;
+    } else {
+      policy_ &= ~kMask;
+    }
+  }
+  uintptr_t policy_;
+};
+
+// A simple arena allocator. Calls to allocate functions must be properly
+// serialized by the caller, hence this class cannot be used as a general
+// purpose allocator in a multi-threaded program. It serves as a building block
+// for ThreadSafeArena, which provides a thread-safe arena allocator.
+//
+// This class manages
+// 1) Arena bump allocation + owning memory blocks.
+// 2) Maintaining a cleanup list.
+// It delagetes the actual memory allocation back to ThreadSafeArena, which
+// contains the information on block growth policy and backing memory allocation
+// used.
+class PROTOBUF_EXPORT SerialArena {
+ public:
+  struct Memory {
+    void* ptr;
+    size_t size;
+  };
+
+  // Node contains the ptr of the object to be cleaned up and the associated
+  // cleanup function ptr.
+  struct CleanupNode {
+    void* elem;              // Pointer to the object to be cleaned up.
+    void (*cleanup)(void*);  // Function pointer to the destructor or deleter.
+  };
+
+  void CleanupList();
+  uint64_t SpaceAllocated() const {
+    return space_allocated_.load(std::memory_order_relaxed);
+  }
+  uint64_t SpaceUsed() const;
+
+  bool HasSpace(size_t n) { return n <= static_cast<size_t>(limit_ - ptr_); }
+
+  void* AllocateAligned(size_t n, const AllocationPolicy* policy) {
+    GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n);  // Must be already aligned.
+    GOOGLE_DCHECK_GE(limit_, ptr_);
+    if (PROTOBUF_PREDICT_FALSE(!HasSpace(n))) {
+      return AllocateAlignedFallback(n, policy);
+    }
+    return AllocateFromExisting(n);
+  }
+
+ private:
+  void* AllocateFromExisting(size_t n) {
+    void* ret = ptr_;
+    ptr_ += n;
+#ifdef ADDRESS_SANITIZER
+    ASAN_UNPOISON_MEMORY_REGION(ret, n);
+#endif  // ADDRESS_SANITIZER
+    return ret;
+  }
+
+ public:
+  // Allocate space if the current region provides enough space.
+  bool MaybeAllocateAligned(size_t n, void** out) {
+    GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n);  // Must be already aligned.
+    GOOGLE_DCHECK_GE(limit_, ptr_);
+    if (PROTOBUF_PREDICT_FALSE(!HasSpace(n))) return false;
+    *out = AllocateFromExisting(n);
+    return true;
+  }
+
+  std::pair<void*, CleanupNode*> AllocateAlignedWithCleanup(
+      size_t n, const AllocationPolicy* policy) {
+    GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n);  // Must be already aligned.
+    if (PROTOBUF_PREDICT_FALSE(!HasSpace(n + kCleanupSize))) {
+      return AllocateAlignedWithCleanupFallback(n, policy);
+    }
+    return AllocateFromExistingWithCleanupFallback(n);
+  }
+
+ private:
+  std::pair<void*, CleanupNode*> AllocateFromExistingWithCleanupFallback(
+      size_t n) {
+    void* ret = ptr_;
+    ptr_ += n;
+    limit_ -= kCleanupSize;
+#ifdef ADDRESS_SANITIZER
+    ASAN_UNPOISON_MEMORY_REGION(ret, n);
+    ASAN_UNPOISON_MEMORY_REGION(limit_, kCleanupSize);
+#endif  // ADDRESS_SANITIZER
+    return CreatePair(ret, reinterpret_cast<CleanupNode*>(limit_));
+  }
+
+ public:
+  void AddCleanup(void* elem, void (*cleanup)(void*),
+                  const AllocationPolicy* policy) {
+    auto res = AllocateAlignedWithCleanup(0, policy);
+    res.second->elem = elem;
+    res.second->cleanup = cleanup;
+  }
+
+  void* owner() const { return owner_; }
+  SerialArena* next() const { return next_; }
+  void set_next(SerialArena* next) { next_ = next; }
+
+ private:
+  friend class ThreadSafeArena;
+  friend class ArenaBenchmark;
+
+  // Creates a new SerialArena inside mem using the remaining memory as for
+  // future allocations.
+  static SerialArena* New(SerialArena::Memory mem, void* owner);
+  // Free SerialArena returning the memory passed in to New
+  template <typename Deallocator>
+  Memory Free(Deallocator deallocator);
+
+  // Blocks are variable length malloc-ed objects.  The following structure
+  // describes the common header for all blocks.
+  struct Block {
+    Block(Block* next, size_t size) : next(next), size(size), start(nullptr) {}
+
+    char* Pointer(size_t n) {
+      GOOGLE_DCHECK(n <= size);
+      return reinterpret_cast<char*>(this) + n;
+    }
+
+    Block* const next;
+    const size_t size;
+    CleanupNode* start;
+    // data follows
+  };
+
+  void* owner_;            // &ThreadCache of this thread;
+  Block* head_;            // Head of linked list of blocks.
+  SerialArena* next_;      // Next SerialArena in this linked list.
+  size_t space_used_ = 0;  // Necessary for metrics.
+  std::atomic<size_t> space_allocated_;
+
+  // Next pointer to allocate from.  Always 8-byte aligned.  Points inside
+  // head_ (and head_->pos will always be non-canonical).  We keep these
+  // here to reduce indirection.
+  char* ptr_;
+  char* limit_;
+
+  // Constructor is private as only New() should be used.
+  inline SerialArena(Block* b, void* owner);
+  void* AllocateAlignedFallback(size_t n, const AllocationPolicy* policy);
+  std::pair<void*, CleanupNode*> AllocateAlignedWithCleanupFallback(
+      size_t n, const AllocationPolicy* policy);
+  void AllocateNewBlock(size_t n, const AllocationPolicy* policy);
+
+  std::pair<void*, CleanupNode*> CreatePair(void* ptr, CleanupNode* node) {
+    return {ptr, node};
+  }
+
+ public:
+  static constexpr size_t kBlockHeaderSize = AlignUpTo8(sizeof(Block));
+  static constexpr size_t kCleanupSize = AlignUpTo8(sizeof(CleanupNode));
+};
+
+// Tag type used to invoke the constructor of message-owned arena.
+// Only message-owned arenas use this constructor for creation.
+// Such constructors are internal implementation details of the library.
+struct MessageOwned {
+  explicit MessageOwned() = default;
+};
+
 // This class provides the core Arena memory allocation library. Different
 // implementations only need to implement the public interface below.
 // Arena is not a template type as that would only be useful if all protos
 // in turn would be templates, which will/cannot happen. However separating
 // the memory allocation part from the cruft of the API users expect we can
 // use #ifdef the select the best implementation based on hardware / OS.
-class LIBPROTOBUF_EXPORT ArenaImpl {
+class PROTOBUF_EXPORT ThreadSafeArena {
  public:
-  struct Options {
-    size_t start_block_size;
-    size_t max_block_size;
-    char* initial_block;
-    size_t initial_block_size;
-    void* (*block_alloc)(size_t);
-    void (*block_dealloc)(void*, size_t);
-
-    template <typename O>
-    explicit Options(const O& options)
-      : start_block_size(options.start_block_size),
-        max_block_size(options.max_block_size),
-        initial_block(options.initial_block),
-        initial_block_size(options.initial_block_size),
-        block_alloc(options.block_alloc),
-        block_dealloc(options.block_dealloc) {}
-  };
-
-  template <typename O>
-  explicit ArenaImpl(const O& options) : options_(options) {
-    if (options_.initial_block != NULL && options_.initial_block_size > 0) {
-      GOOGLE_CHECK_GE(options_.initial_block_size, sizeof(Block))
-          << ": Initial block size too small for header.";
-      initial_block_ = reinterpret_cast<Block*>(options_.initial_block);
-    } else {
-      initial_block_ = NULL;
-    }
+  ThreadSafeArena() { Init(); }
 
+  // Constructor solely used by message-owned arena.
+  ThreadSafeArena(internal::MessageOwned) : tag_and_id_(kMessageOwnedArena) {
     Init();
   }
 
+  ThreadSafeArena(char* mem, size_t size) { InitializeFrom(mem, size); }
+
+  explicit ThreadSafeArena(void* mem, size_t size,
+                           const AllocationPolicy& policy) {
+    InitializeWithPolicy(mem, size, policy);
+  }
+
   // Destructor deletes all owned heap allocated objects, and destructs objects
   // that have non-trivial destructors, except for proto2 message objects whose
   // destructors can be skipped. Also, frees all blocks except the initial block
   // if it was passed in.
-  ~ArenaImpl();
+  ~ThreadSafeArena();
 
-  uint64 Reset();
+  uint64_t Reset();
 
-  uint64 SpaceAllocated() const;
-  uint64 SpaceUsed() const;
+  uint64_t SpaceAllocated() const;
+  uint64_t SpaceUsed() const;
 
-  void* AllocateAligned(size_t n);
+  void* AllocateAligned(size_t n, const std::type_info* type) {
+    SerialArena* arena;
+    if (PROTOBUF_PREDICT_TRUE(!alloc_policy_.should_record_allocs() &&
+                              GetSerialArenaFast(&arena))) {
+      return arena->AllocateAligned(n, AllocPolicy());
+    } else {
+      return AllocateAlignedFallback(n, type);
+    }
+  }
 
-  void* AllocateAlignedAndAddCleanup(size_t n, void (*cleanup)(void*));
+  // This function allocates n bytes if the common happy case is true and
+  // returns true. Otherwise does nothing and returns false. This strange
+  // semantics is necessary to allow callers to program functions that only
+  // have fallback function calls in tail position. This substantially improves
+  // code for the happy path.
+  PROTOBUF_NDEBUG_INLINE bool MaybeAllocateAligned(size_t n, void** out) {
+    SerialArena* a;
+    if (PROTOBUF_PREDICT_TRUE(!alloc_policy_.should_record_allocs() &&
+                              GetSerialArenaFromThreadCache(&a))) {
+      return a->MaybeAllocateAligned(n, out);
+    }
+    return false;
+  }
+
+  std::pair<void*, SerialArena::CleanupNode*> AllocateAlignedWithCleanup(
+      size_t n, const std::type_info* type);
 
   // Add object pointer and cleanup function pointer to the list.
   void AddCleanup(void* elem, void (*cleanup)(void*));
 
+  // Checks whether this arena is message-owned.
+  PROTOBUF_ALWAYS_INLINE bool IsMessageOwned() const {
+    return tag_and_id_ & kMessageOwnedArena;
+  }
+
  private:
-  // Node contains the ptr of the object to be cleaned up and the associated
-  // cleanup function ptr.
-  struct CleanupNode {
-    void* elem;              // Pointer to the object to be cleaned up.
-    void (*cleanup)(void*);  // Function pointer to the destructor or deleter.
-  };
+  // Unique for each arena. Changes on Reset().
+  uint64_t tag_and_id_ = 0;
+  // The LSB of tag_and_id_ indicates if the arena is message-owned.
+  enum : uint64_t { kMessageOwnedArena = 1 };
+
+  TaggedAllocationPolicyPtr alloc_policy_;  // Tagged pointer to AllocPolicy.
+
+  // Pointer to a linked list of SerialArena.
+  std::atomic<SerialArena*> threads_;
+  std::atomic<SerialArena*> hint_;  // Fast thread-local block access
+
+  const AllocationPolicy* AllocPolicy() const { return alloc_policy_.get(); }
+  void InitializeFrom(void* mem, size_t size);
+  void InitializeWithPolicy(void* mem, size_t size, AllocationPolicy policy);
+  void* AllocateAlignedFallback(size_t n, const std::type_info* type);
+  std::pair<void*, SerialArena::CleanupNode*>
+  AllocateAlignedWithCleanupFallback(size_t n, const std::type_info* type);
+
+  void Init();
+  void SetInitialBlock(void* mem, size_t size);
 
-  // Cleanup uses a chunked linked list, to reduce pointer chasing.
-  struct CleanupChunk {
-    static size_t SizeOf(size_t i) {
-      return sizeof(CleanupChunk) + (sizeof(CleanupNode) * (i - 1));
+  // Delete or Destruct all objects owned by the arena.
+  void CleanupList();
+
+  inline uint64_t LifeCycleId() const {
+    return tag_and_id_ & ~kMessageOwnedArena;
+  }
+
+  inline void CacheSerialArena(SerialArena* serial) {
+    thread_cache().last_serial_arena = serial;
+    thread_cache().last_lifecycle_id_seen = tag_and_id_;
+    // TODO(haberman): evaluate whether we would gain efficiency by getting rid
+    // of hint_.  It's the only write we do to ThreadSafeArena in the allocation
+    // path, which will dirty the cache line.
+
+    hint_.store(serial, std::memory_order_release);
+  }
+
+  PROTOBUF_NDEBUG_INLINE bool GetSerialArenaFast(SerialArena** arena) {
+    if (GetSerialArenaFromThreadCache(arena)) return true;
+
+    // Check whether we own the last accessed SerialArena on this arena.  This
+    // fast path optimizes the case where a single thread uses multiple arenas.
+    ThreadCache* tc = &thread_cache();
+    SerialArena* serial = hint_.load(std::memory_order_acquire);
+    if (PROTOBUF_PREDICT_TRUE(serial != NULL && serial->owner() == tc)) {
+      *arena = serial;
+      return true;
     }
-    size_t len;            // Number of elements currently present.
-    size_t size;           // Total elements in the list.
-    CleanupChunk* next;    // Next node in the list.
-    CleanupNode nodes[1];  // True length is |size|.
-  };
+    return false;
+  }
+
+  PROTOBUF_NDEBUG_INLINE bool GetSerialArenaFromThreadCache(
+      SerialArena** arena) {
+    // If this thread already owns a block in this arena then try to use that.
+    // This fast path optimizes the case where multiple threads allocate from
+    // the same arena.
+    ThreadCache* tc = &thread_cache();
+    if (PROTOBUF_PREDICT_TRUE(tc->last_lifecycle_id_seen == tag_and_id_)) {
+      *arena = tc->last_serial_arena;
+      return true;
+    }
+    return false;
+  }
+  SerialArena* GetSerialArenaFallback(void* me);
 
-  struct Block;
+  template <typename Functor>
+  void PerSerialArena(Functor fn) {
+    // By omitting an Acquire barrier we ensure that any user code that doesn't
+    // properly synchronize Reset() or the destructor will throw a TSAN warning.
+    SerialArena* serial = threads_.load(std::memory_order_relaxed);
 
-  // Tracks per-thread info.  ThreadInfos are kept in a linked list.
-  struct ThreadInfo {
-    void *owner;             // &ThreadCache of this thread;
-    Block* head;             // Head of linked list of blocks.
-    CleanupChunk* cleanup;   // Head of cleanup list.
-    ThreadInfo* next;        // Next ThreadInfo in this linked list.
-  };
+    for (; serial; serial = serial->next()) fn(serial);
+  }
 
-  // Blocks are variable length malloc-ed objects.  The following structure
-  // describes the common header for all blocks.
-  struct Block {
-    void* owner;              // &ThreadCache of thread that owns this block.
-    ThreadInfo* thread_info;  // ThreadInfo of thread that owns this block.
-    Block* next;              // Next block in arena (may have different owner)
-    // ((char*) &block) + pos is next available byte. It is always
-    // aligned at a multiple of 8 bytes.
-    size_t pos;
-    size_t size;  // total size of the block.
-    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-    size_t avail() const { return size - pos; }
-    // data follows
-  };
+  // Releases all memory except the first block which it returns. The first
+  // block might be owned by the user and thus need some extra checks before
+  // deleting.
+  SerialArena::Memory Free(size_t* space_allocated);
 
-  struct ThreadCache {
+#ifdef _MSC_VER
+#pragma warning(disable : 4324)
+#endif
+  struct alignas(64) ThreadCache {
 #if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL)
     // If we are using the ThreadLocalStorage class to store the ThreadCache,
     // then the ThreadCache's default constructor has to be responsible for
     // initializing it.
-    ThreadCache() : last_lifecycle_id_seen(-1), last_block_used_(NULL) {}
+    ThreadCache()
+        : next_lifecycle_id(0),
+          last_lifecycle_id_seen(-1),
+          last_serial_arena(NULL) {}
 #endif
 
+    // Number of per-thread lifecycle IDs to reserve. Must be power of two.
+    // To reduce contention on a global atomic, each thread reserves a batch of
+    // IDs.  The following number is calculated based on a stress test with
+    // ~6500 threads all frequently allocating a new arena.
+    static constexpr size_t kPerThreadIds = 256;
+    // Next lifecycle ID available to this thread. We need to reserve a new
+    // batch, if `next_lifecycle_id & (kPerThreadIds - 1) == 0`.
+    uint64_t next_lifecycle_id;
     // The ThreadCache is considered valid as long as this matches the
     // lifecycle_id of the arena being used.
-    int64 last_lifecycle_id_seen;
-    Block* last_block_used_;
+    uint64_t last_lifecycle_id_seen;
+    SerialArena* last_serial_arena;
+  };
+
+  // Lifecycle_id can be highly contended variable in a situation of lots of
+  // arena creation. Make sure that other global variables are not sharing the
+  // cacheline.
+#ifdef _MSC_VER
+#pragma warning(disable : 4324)
+#endif
+  struct alignas(64) CacheAlignedLifecycleIdGenerator {
+    std::atomic<LifecycleIdAtomic> id;
   };
-  static google::protobuf::internal::SequenceNumber lifecycle_id_generator_;
+  static CacheAlignedLifecycleIdGenerator lifecycle_id_generator_;
 #if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL)
-  // Android ndk does not support GOOGLE_THREAD_LOCAL keyword so we use a custom thread
-  // local storage class we implemented.
-  // iOS also does not support the GOOGLE_THREAD_LOCAL keyword.
+  // iOS does not support __thread keyword so we use a custom thread local
+  // storage class we implemented.
   static ThreadCache& thread_cache();
 #elif defined(PROTOBUF_USE_DLLS)
   // Thread local variables cannot be exposed through DLL interface but we can
   // wrap them in static functions.
   static ThreadCache& thread_cache();
 #else
-  static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_;
+  static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_;
   static ThreadCache& thread_cache() { return thread_cache_; }
 #endif
 
-  void Init();
-
-  // Free all blocks and return the total space used which is the sums of sizes
-  // of the all the allocated blocks.
-  uint64 FreeBlocks();
-
-  void AddCleanupInBlock(Block* b, void* elem, void (*func)(void*));
-  CleanupChunk* ExpandCleanupList(CleanupChunk* cleanup, Block* b);
-  // Delete or Destruct all objects owned by the arena.
-  void CleanupList();
-
-  inline void CacheBlock(Block* block) {
-    thread_cache().last_block_used_ = block;
-    thread_cache().last_lifecycle_id_seen = lifecycle_id_;
-    // TODO(haberman): evaluate whether we would gain efficiency by getting rid
-    // of hint_.  It's the only write we do to ArenaImpl in the allocation path,
-    // which will dirty the cache line.
-    google::protobuf::internal::Release_Store(&hint_, reinterpret_cast<google::protobuf::internal::AtomicWord>(block));
-  }
-
-  google::protobuf::internal::AtomicWord threads_;          // Pointer to a linked list of ThreadInfo.
-  google::protobuf::internal::AtomicWord hint_;             // Fast thread-local block access
-  google::protobuf::internal::AtomicWord space_allocated_;  // Sum of sizes of all allocated blocks.
-
-  Block *initial_block_;     // If non-NULL, points to the block that came from
-                             // user data.
-
-  // Returns a block owned by this thread.
-  Block* GetBlock(size_t n);
-  Block* GetBlockSlow(void* me, Block* my_full_block, size_t n);
-  Block* NewBlock(void* me, Block* my_last_block, size_t min_bytes);
-  void InitBlock(Block* b, void *me, size_t size);
-  static void* AllocFromBlock(Block* b, size_t n);
-  ThreadInfo* NewThreadInfo(Block* b);
-  ThreadInfo* FindThreadInfo(void* me);
-  ThreadInfo* GetThreadInfo(void* me, size_t n);
-
-  int64 lifecycle_id_;  // Unique for each arena. Changes on Reset().
-
-  Options options_;
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ArenaImpl);
+  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ThreadSafeArena);
+  // All protos have pointers back to the arena hence Arena must have
+  // pointer stability.
+  ThreadSafeArena(ThreadSafeArena&&) = delete;
+  ThreadSafeArena& operator=(ThreadSafeArena&&) = delete;
 
  public:
-  // kHeaderSize is sizeof(Block), aligned up to the nearest multiple of 8 to
-  // protect the invariant that pos is always at a multiple of 8.
-  static const size_t kHeaderSize = (sizeof(Block) + 7) & -8;
-#if LANG_CXX11
-  static_assert(kHeaderSize % 8 == 0, "kHeaderSize must be a multiple of 8.");
-#endif
+  // kBlockHeaderSize is sizeof(Block), aligned up to the nearest multiple of 8
+  // to protect the invariant that pos is always at a multiple of 8.
+  static constexpr size_t kBlockHeaderSize = SerialArena::kBlockHeaderSize;
+  static constexpr size_t kSerialArenaSize =
+      (sizeof(SerialArena) + 7) & static_cast<size_t>(-8);
+  static_assert(kBlockHeaderSize % 8 == 0,
+                "kBlockHeaderSize must be a multiple of 8.");
+  static_assert(kSerialArenaSize % 8 == 0,
+                "kSerialArenaSize must be a multiple of 8.");
 };
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_ARENA_IMPL_H__
index 7f33a0c..169f527 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// The ArenaString implementation is not included in the open-source release. Do
-// not include this file in the distribution.
-
 #include <google/protobuf/arenastring.h>
 
+#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/stubs/mutex.h>
+#include <google/protobuf/stubs/strutil.h>
+#include <google/protobuf/stubs/stl_util.h>
+
+// clang-format off
+#include <google/protobuf/port_def.inc>
+// clang-format on
+
 namespace google {
 namespace protobuf {
 namespace internal {
 
+const std::string& LazyString::Init() const {
+  static WrappedMutex mu{GOOGLE_PROTOBUF_LINKER_INITIALIZED};
+  mu.Lock();
+  const std::string* res = inited_.load(std::memory_order_acquire);
+  if (res == nullptr) {
+    auto init_value = init_value_;
+    res = ::new (static_cast<void*>(string_buf_))
+        std::string(init_value.ptr, init_value.size);
+    inited_.store(res, std::memory_order_release);
+  }
+  mu.Unlock();
+  return *res;
+}
+
+
+std::string* ArenaStringPtr::SetAndReturnNewString() {
+  std::string* new_string = new std::string();
+  tagged_ptr_.Set(new_string);
+  return new_string;
+}
+
+void ArenaStringPtr::DestroyNoArenaSlowPath() { delete UnsafeMutablePointer(); }
+
+void ArenaStringPtr::Set(const std::string* default_value,
+                         ConstStringParam value, ::google::protobuf::Arena* arena) {
+  if (IsDefault(default_value)) {
+    tagged_ptr_.Set(Arena::Create<std::string>(arena, value));
+  } else {
+    UnsafeMutablePointer()->assign(value.data(), value.length());
+  }
+}
+
+void ArenaStringPtr::Set(const std::string* default_value, std::string&& value,
+                         ::google::protobuf::Arena* arena) {
+  if (IsDefault(default_value)) {
+    if (arena == nullptr) {
+      tagged_ptr_.Set(new std::string(std::move(value)));
+    } else {
+      tagged_ptr_.Set(Arena::Create<std::string>(arena, std::move(value)));
+    }
+  } else if (IsDonatedString()) {
+    std::string* current = tagged_ptr_.Get();
+    auto* s = new (current) std::string(std::move(value));
+    arena->OwnDestructor(s);
+    tagged_ptr_.Set(s);
+  } else /* !IsDonatedString() */ {
+    *UnsafeMutablePointer() = std::move(value);
+  }
+}
+
+void ArenaStringPtr::Set(EmptyDefault, ConstStringParam value,
+                         ::google::protobuf::Arena* arena) {
+  Set(&GetEmptyStringAlreadyInited(), value, arena);
+}
+
+void ArenaStringPtr::Set(EmptyDefault, std::string&& value,
+                         ::google::protobuf::Arena* arena) {
+  Set(&GetEmptyStringAlreadyInited(), std::move(value), arena);
+}
+
+void ArenaStringPtr::Set(NonEmptyDefault, ConstStringParam value,
+                         ::google::protobuf::Arena* arena) {
+  Set(nullptr, value, arena);
+}
+
+void ArenaStringPtr::Set(NonEmptyDefault, std::string&& value,
+                         ::google::protobuf::Arena* arena) {
+  Set(nullptr, std::move(value), arena);
+}
+
+std::string* ArenaStringPtr::Mutable(EmptyDefault, ::google::protobuf::Arena* arena) {
+  if (!IsDonatedString() && !IsDefault(&GetEmptyStringAlreadyInited())) {
+    return UnsafeMutablePointer();
+  } else {
+    return MutableSlow(arena);
+  }
+}
+
+std::string* ArenaStringPtr::Mutable(const LazyString& default_value,
+                                     ::google::protobuf::Arena* arena) {
+  if (!IsDonatedString() && !IsDefault(nullptr)) {
+    return UnsafeMutablePointer();
+  } else {
+    return MutableSlow(arena, default_value);
+  }
+}
+
+std::string* ArenaStringPtr::MutableNoCopy(const std::string* default_value,
+                                           ::google::protobuf::Arena* arena) {
+  if (!IsDonatedString() && !IsDefault(default_value)) {
+    return UnsafeMutablePointer();
+  } else {
+    GOOGLE_DCHECK(IsDefault(default_value));
+    // Allocate empty. The contents are not relevant.
+    std::string* new_string = Arena::Create<std::string>(arena);
+    tagged_ptr_.Set(new_string);
+    return new_string;
+  }
+}
+
+template <typename... Lazy>
+std::string* ArenaStringPtr::MutableSlow(::google::protobuf::Arena* arena,
+                                         const Lazy&... lazy_default) {
+  const std::string* const default_value =
+      sizeof...(Lazy) == 0 ? &GetEmptyStringAlreadyInited() : nullptr;
+  GOOGLE_DCHECK(IsDefault(default_value));
+  std::string* new_string =
+      Arena::Create<std::string>(arena, lazy_default.get()...);
+  tagged_ptr_.Set(new_string);
+  return new_string;
+}
+
+std::string* ArenaStringPtr::Release(const std::string* default_value,
+                                     ::google::protobuf::Arena* arena) {
+  if (IsDefault(default_value)) {
+    return nullptr;
+  } else {
+    return ReleaseNonDefault(default_value, arena);
+  }
+}
+
+std::string* ArenaStringPtr::ReleaseNonDefault(const std::string* default_value,
+                                               ::google::protobuf::Arena* arena) {
+  GOOGLE_DCHECK(!IsDefault(default_value));
+
+  if (!IsDonatedString()) {
+    std::string* released;
+    if (arena != nullptr) {
+      released = new std::string;
+      released->swap(*UnsafeMutablePointer());
+    } else {
+      released = UnsafeMutablePointer();
+    }
+    tagged_ptr_.Set(const_cast<std::string*>(default_value));
+    return released;
+  } else /* IsDonatedString() */ {
+    GOOGLE_DCHECK(arena != nullptr);
+    std::string* released = new std::string(Get());
+    tagged_ptr_.Set(const_cast<std::string*>(default_value));
+    return released;
+  }
+}
+
+void ArenaStringPtr::SetAllocated(const std::string* default_value,
+                                  std::string* value, ::google::protobuf::Arena* arena) {
+  // Release what we have first.
+  if (arena == nullptr && !IsDefault(default_value)) {
+    delete UnsafeMutablePointer();
+  }
+  if (value == nullptr) {
+    tagged_ptr_.Set(const_cast<std::string*>(default_value));
+  } else {
+#ifdef NDEBUG
+    tagged_ptr_.Set(value);
+    if (arena != nullptr) {
+      arena->Own(value);
+    }
+#else
+    // On debug builds, copy the string so the address differs.  delete will
+    // fail if value was a stack-allocated temporary/etc., which would have
+    // failed when arena ran its cleanup list.
+    std::string* new_value = Arena::Create<std::string>(arena, *value);
+    delete value;
+    tagged_ptr_.Set(new_value);
+#endif
+  }
+}
+
+void ArenaStringPtr::Destroy(const std::string* default_value,
+                             ::google::protobuf::Arena* arena) {
+  if (arena == nullptr) {
+    GOOGLE_DCHECK(!IsDonatedString());
+    if (!IsDefault(default_value)) {
+      delete UnsafeMutablePointer();
+    }
+  }
+}
+
+void ArenaStringPtr::Destroy(EmptyDefault, ::google::protobuf::Arena* arena) {
+  Destroy(&GetEmptyStringAlreadyInited(), arena);
+}
+
+void ArenaStringPtr::Destroy(NonEmptyDefault, ::google::protobuf::Arena* arena) {
+  Destroy(nullptr, arena);
+}
+
+void ArenaStringPtr::ClearToEmpty() {
+  if (IsDefault(&GetEmptyStringAlreadyInited())) {
+    // Already set to default -- do nothing.
+  } else {
+    // Unconditionally mask away the tag.
+    //
+    // UpdateDonatedString uses assign when capacity is larger than the new
+    // value, which is trivially true in the donated string case.
+    // const_cast<std::string*>(PtrValue<std::string>())->clear();
+    tagged_ptr_.Get()->clear();
+  }
+}
+
+void ArenaStringPtr::ClearToDefault(const LazyString& default_value,
+                                    ::google::protobuf::Arena* arena) {
+  (void)arena;
+  if (IsDefault(nullptr)) {
+    // Already set to default -- do nothing.
+  } else if (!IsDonatedString()) {
+    UnsafeMutablePointer()->assign(default_value.get());
+  }
+}
+
+inline void SetStrWithHeapBuffer(std::string* str, ArenaStringPtr* s) {
+  TaggedPtr<std::string> res;
+  res.Set(str);
+  s->UnsafeSetTaggedPointer(res);
+}
+
+const char* EpsCopyInputStream::ReadArenaString(const char* ptr,
+                                                ArenaStringPtr* s,
+                                                Arena* arena) {
+  GOOGLE_DCHECK(arena != nullptr);
+
+  int size = ReadSize(&ptr);
+  if (!ptr) return nullptr;
+
+  auto* str = Arena::Create<std::string>(arena);
+  ptr = ReadString(ptr, size, str);
+  GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+
+  SetStrWithHeapBuffer(str, s);
+
+  return ptr;
+}
 
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index c9d045a..38c3637 100644 (file)
 #define GOOGLE_PROTOBUF_ARENASTRING_H__
 
 #include <string>
+#include <type_traits>
+#include <utility>
 
-#include <google/protobuf/arena.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/fastmem.h>
 #include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/port.h>
+
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
-// This is the implementation of arena string fields written for the open-source
-// release. The ArenaStringPtr struct below is an internal implementation class
-// and *should not be used* by user code. It is used to collect string
-// operations together into one place and abstract away the underlying
-// string-field pointer representation, so that (for example) an alternate
-// implementation that knew more about ::std::string's internals could integrate more
-// closely with the arena allocator.
 
 namespace google {
 namespace protobuf {
 namespace internal {
 
-struct LIBPROTOBUF_EXPORT ArenaStringPtr {
-  inline void Set(const ::std::string* default_value,
-                  const ::std::string& value, ::google::protobuf::Arena* arena) {
-    if (ptr_ == default_value) {
-      CreateInstance(arena, &value);
-    } else {
-      *ptr_ = value;
-    }
+template <typename T>
+class ExplicitlyConstructed;
+
+class SwapFieldHelper;
+
+// Lazy string instance to support string fields with non-empty default.
+// These are initialized on the first call to .get().
+class PROTOBUF_EXPORT LazyString {
+ public:
+  // We explicitly make LazyString an aggregate so that MSVC can do constant
+  // initialization on it without marking it `constexpr`.
+  // We do not want to use `constexpr` because it makes it harder to have extern
+  // storage for it and causes library bloat.
+  struct InitValue {
+    const char* ptr;
+    size_t size;
+  };
+  // We keep a union of the initialization value and the std::string to save on
+  // space. We don't need the string array after Init() is done.
+  union {
+    mutable InitValue init_value_;
+    alignas(std::string) mutable char string_buf_[sizeof(std::string)];
+  };
+  mutable std::atomic<const std::string*> inited_;
+
+  const std::string& get() const {
+    // This check generates less code than a call-once invocation.
+    auto* res = inited_.load(std::memory_order_acquire);
+    if (PROTOBUF_PREDICT_FALSE(res == nullptr)) return Init();
+    return *res;
   }
 
-  inline void SetLite(const ::std::string* default_value,
-                      const ::std::string& value,
-                      ::google::protobuf::Arena* arena) {
-    Set(default_value, value, arena);
-  }
+ private:
+  // Initialize the string in `string_buf_`, update `inited_` and return it.
+  // We return it here to avoid having to read it again in the inlined code.
+  const std::string& Init() const;
+};
 
-  // Basic accessors.
-  inline const ::std::string& Get() const { return *ptr_; }
-
-  inline ::std::string* Mutable(const ::std::string* default_value,
-                           ::google::protobuf::Arena* arena) {
-    if (ptr_ == default_value) {
-      CreateInstance(arena, default_value);
-    }
-    return ptr_;
-  }
+template <typename T>
+class TaggedPtr {
+ public:
+  TaggedPtr() = default;
+  explicit constexpr TaggedPtr(const ExplicitlyConstructed<std::string>* ptr)
+      : ptr_(const_cast<ExplicitlyConstructed<std::string>*>(ptr)) {}
 
-  // Release returns a ::std::string* instance that is heap-allocated and is not
-  // Own()'d by any arena. If the field was not set, it returns NULL. The caller
-  // retains ownership. Clears this field back to NULL state. Used to implement
-  // release_<field>() methods on generated classes.
-  inline ::std::string* Release(const ::std::string* default_value,
-                           ::google::protobuf::Arena* arena) {
-    if (ptr_ == default_value) {
-      return NULL;
-    }
-    ::std::string* released = NULL;
-    if (arena != NULL) {
-      // ptr_ is owned by the arena.
-      released = new ::std::string;
-      released->swap(*ptr_);
-    } else {
-      released = ptr_;
-    }
-    ptr_ = const_cast< ::std::string* >(default_value);
-    return released;
+  void SetTagged(T* p) {
+    Set(p);
+    ptr_ = reinterpret_cast<void*>(as_int() | 1);
   }
+  void Set(T* p) { ptr_ = p; }
+  T* Get() const { return reinterpret_cast<T*>(as_int() & -2); }
+  bool IsTagged() const { return as_int() & 1; }
+
+  // Returned value is only safe to dereference if IsTagged() == false.
+  // It is safe to compare.
+  T* UnsafeGet() const { return static_cast<T*>(ptr_); }
 
-  // UnsafeArenaRelease returns a ::std::string*, but it may be arena-owned (i.e.
-  // have its destructor already registered) if arena != NULL. If the field was
-  // not set, this returns NULL. This method clears this field back to NULL
-  // state. Used to implement unsafe_arena_release_<field>() methods on
-  // generated classes.
-  inline ::std::string* UnsafeArenaRelease(const ::std::string* default_value,
-                                      ::google::protobuf::Arena* /* arena */) {
-    if (ptr_ == default_value) {
-      return NULL;
-    }
-    ::std::string* released = ptr_;
-    ptr_ = const_cast< ::std::string* >(default_value);
-    return released;
+  bool IsNull() { return ptr_ == nullptr; }
+
+ private:
+  uintptr_t as_int() const { return reinterpret_cast<uintptr_t>(ptr_); }
+  void* ptr_;
+};
+
+static_assert(std::is_trivial<TaggedPtr<std::string>>::value,
+              "TaggedPtr must be trivial");
+
+// This class encapsulates a pointer to a std::string with or without a donated
+// buffer, tagged by bottom bit. It is a high-level wrapper that almost directly
+// corresponds to the interface required by string fields in generated
+// code. It replaces the old std::string* pointer in such cases.
+//
+// The object has different but similar code paths for when the default value is
+// the empty string and when it is a non-empty string.
+// The empty string is handled different throughout the library and there is a
+// single global instance of it we can share.
+//
+// For fields with an empty string default value, there are three distinct
+// states:
+//
+// - Pointer set to 'String' tag (LSB is 0), equal to
+//   &GetEmptyStringAlreadyInited(): field is set to its default value. Points
+//   to a true std::string*, but we do not own that std::string* (it's a
+//   globally shared instance).
+//
+// - Pointer set to 'String' tag (LSB is 0), but not equal to the global empty
+//   string: field points to a true std::string* instance that we own. This
+//   instance is either on the heap or on the arena (i.e. registered on
+//   free()/destructor-call list) as appropriate.
+//
+// - Pointer set to 'DonatedString' tag (LSB is 1): points to a std::string
+//   instance with a buffer on the arena (arena is never nullptr in this case).
+//
+// For fields with a non-empty string default value, there are three distinct
+// states:
+//
+// - Pointer set to 'String' tag (LSB is 0), equal to `nullptr`:
+//   Field is in "default" mode and does not point to any actual instance.
+//   Methods that might need to create an instance of the object will pass a
+//   `const LazyString&` for it.
+//
+// - Pointer set to 'String' tag (LSB is 0), but not equal to `nullptr`:
+//   field points to a true std::string* instance that we own. This instance is
+//   either on the heap or on the arena (i.e. registered on
+//   free()/destructor-call list) as appropriate.
+//
+// - Pointer set to 'DonatedString' tag (LSB is 1): points to a std::string
+//   instance with a buffer on the arena (arena is never nullptr in this case).
+//
+// Generated code and reflection code both ensure that ptr_ is never null for
+// fields with an empty default.
+// Because ArenaStringPtr is used in oneof unions, its constructor is a NOP and
+// so the field is always manually initialized via method calls.
+//
+// Side-note: why pass information about the default on every API call? Because
+// we don't want to hold it in a member variable, or else this would go into
+// every proto message instance. This would be a huge waste of space, since the
+// default instance pointer is typically a global (static class field). We want
+// the generated code to be as efficient as possible, and if we take
+// the default value information as a parameter that's in practice taken from a
+// static class field, and compare ptr_ to the default value, we end up with a
+// single "cmp %reg, GLOBAL" in the resulting machine code. (Note that this also
+// requires the String tag to be 0 so we can avoid the mask before comparing.)
+struct PROTOBUF_EXPORT ArenaStringPtr {
+  ArenaStringPtr() = default;
+  explicit constexpr ArenaStringPtr(
+      const ExplicitlyConstructed<std::string>* default_value)
+      : tagged_ptr_(default_value) {}
+
+  // Some methods below are overloaded on a `default_value` and on tags.
+  // The tagged overloads help reduce code size in the callers in generated
+  // code, while the `default_value` overloads are useful from reflection.
+  // By-value empty struct arguments are elided in the ABI.
+  struct EmptyDefault {};
+  struct NonEmptyDefault {};
+
+  void Set(const std::string* default_value, ConstStringParam value,
+           ::google::protobuf::Arena* arena);
+  void Set(const std::string* default_value, std::string&& value,
+           ::google::protobuf::Arena* arena);
+  void Set(EmptyDefault, ConstStringParam value, ::google::protobuf::Arena* arena);
+  void Set(EmptyDefault, std::string&& value, ::google::protobuf::Arena* arena);
+  void Set(NonEmptyDefault, ConstStringParam value, ::google::protobuf::Arena* arena);
+  void Set(NonEmptyDefault, std::string&& value, ::google::protobuf::Arena* arena);
+  template <typename FirstParam>
+  void Set(FirstParam p1, const char* str, ::google::protobuf::Arena* arena) {
+    Set(p1, ConstStringParam(str), arena);
+  }
+  template <typename FirstParam>
+  void Set(FirstParam p1, const char* str, size_t size,
+           ::google::protobuf::Arena* arena) {
+    ConstStringParam sp{str, size};  // for string_view and `const string &`
+    Set(p1, sp, arena);
+  }
+  template <typename FirstParam, typename RefWrappedType>
+  void Set(FirstParam p1,
+           std::reference_wrapper<RefWrappedType> const_string_ref,
+           ::google::protobuf::Arena* arena) {
+    Set(p1, const_string_ref.get(), arena);
   }
 
-  // Takes a string that is heap-allocated, and takes ownership. The string's
-  // destructor is registered with the arena. Used to implement
-  // set_allocated_<field> in generated classes.
-  inline void SetAllocated(const ::std::string* default_value,
-                           ::std::string* value, ::google::protobuf::Arena* arena) {
-    if (arena == NULL && ptr_ != default_value) {
-      Destroy(default_value, arena);
-    }
-    if (value != NULL) {
-      ptr_ = value;
-      if (arena != NULL) {
-        arena->Own(value);
-      }
-    } else {
-      ptr_ = const_cast< ::std::string* >(default_value);
-    }
+  template <typename FirstParam, typename SecondParam>
+  void SetBytes(FirstParam p1, SecondParam&& p2, ::google::protobuf::Arena* arena) {
+    Set(p1, static_cast<SecondParam&&>(p2), arena);
+  }
+  template <typename FirstParam>
+  void SetBytes(FirstParam p1, const void* str, size_t size,
+                ::google::protobuf::Arena* arena) {
+    // must work whether ConstStringParam is string_view or `const string &`
+    ConstStringParam sp{static_cast<const char*>(str), size};
+    Set(p1, sp, arena);
   }
 
-  // Takes a string that has lifetime equal to the arena's lifetime. The arena
-  // must be non-null. It is safe only to pass this method a value returned by
-  // UnsafeArenaRelease() on another field of a message in the same arena. Used
-  // to implement unsafe_arena_set_allocated_<field> in generated classes.
-  inline void UnsafeArenaSetAllocated(const ::std::string* default_value,
-                                      ::std::string* value,
-                                      ::google::protobuf::Arena* /* arena */) {
-    if (value != NULL) {
-      ptr_ = value;
-    } else {
-      ptr_ = const_cast< ::std::string* >(default_value);
-    }
+  // Basic accessors.
+  PROTOBUF_NDEBUG_INLINE const std::string& Get() const {
+    // Unconditionally mask away the tag.
+    return *tagged_ptr_.Get();
+  }
+  PROTOBUF_NDEBUG_INLINE const std::string* GetPointer() const {
+    // Unconditionally mask away the tag.
+    return tagged_ptr_.Get();
   }
 
+  // For fields with an empty default value.
+  std::string* Mutable(EmptyDefault, ::google::protobuf::Arena* arena);
+  // For fields with a non-empty default value.
+  std::string* Mutable(const LazyString& default_value, ::google::protobuf::Arena* arena);
+
+  // Release returns a std::string* instance that is heap-allocated and is not
+  // Own()'d by any arena. If the field is not set, this returns nullptr. The
+  // caller retains ownership. Clears this field back to nullptr state. Used to
+  // implement release_<field>() methods on generated classes.
+  PROTOBUF_NODISCARD std::string* Release(const std::string* default_value,
+                                          ::google::protobuf::Arena* arena);
+  PROTOBUF_NODISCARD std::string* ReleaseNonDefault(
+      const std::string* default_value, ::google::protobuf::Arena* arena);
+
+  // Takes a std::string that is heap-allocated, and takes ownership. The
+  // std::string's destructor is registered with the arena. Used to implement
+  // set_allocated_<field> in generated classes.
+  void SetAllocated(const std::string* default_value, std::string* value,
+                    ::google::protobuf::Arena* arena);
+
   // Swaps internal pointers. Arena-safety semantics: this is guarded by the
   // logic in Swap()/UnsafeArenaSwap() at the message level, so this method is
   // 'unsafe' if called directly.
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Swap(ArenaStringPtr* other) {
-    std::swap(ptr_, other->ptr_);
-  }
+  inline PROTOBUF_NDEBUG_INLINE static void InternalSwap(
+      const std::string* default_value, ArenaStringPtr* rhs, Arena* rhs_arena,
+      ArenaStringPtr* lhs, Arena* lhs_arena);
 
   // Frees storage (if not on an arena).
-  inline void Destroy(const ::std::string* default_value,
-                      ::google::protobuf::Arena* arena) {
-    if (arena == NULL && ptr_ != default_value) {
-      delete ptr_;
-    }
-  }
+  void Destroy(const std::string* default_value, ::google::protobuf::Arena* arena);
+  void Destroy(EmptyDefault, ::google::protobuf::Arena* arena);
+  void Destroy(NonEmptyDefault, ::google::protobuf::Arena* arena);
 
-  // Clears content, but keeps allocated string if arena != NULL, to avoid the
-  // overhead of heap operations. After this returns, the content (as seen by
-  // the user) will always be the empty string. Assumes that |default_value|
-  // is an empty string.
-  inline void ClearToEmpty(const ::std::string* default_value,
-                           ::google::protobuf::Arena* /* arena */) {
-    if (ptr_ == default_value) {
-      // Already set to default (which is empty) -- do nothing.
-    } else {
-      ptr_->clear();
-    }
-  }
+  // Clears content, but keeps allocated std::string, to avoid the overhead of
+  // heap operations. After this returns, the content (as seen by the user) will
+  // always be the empty std::string. Assumes that |default_value| is an empty
+  // std::string.
+  void ClearToEmpty();
 
-  // Clears content, but keeps allocated string if arena != NULL, to avoid the
-  // overhead of heap operations. After this returns, the content (as seen by
-  // the user) will always be equal to |default_value|.
-  inline void ClearToDefault(const ::std::string* default_value,
-                             ::google::protobuf::Arena* /* arena */) {
-    if (ptr_ == default_value) {
-      // Already set to default -- do nothing.
-    } else {
-      // Have another allocated string -- rather than throwing this away and
-      // resetting ptr_ to the canonical default string instance, we just reuse
-      // this instance.
-      *ptr_ = *default_value;
-    }
-  }
+  // Clears content, assuming that the current value is not the empty
+  // string default.
+  void ClearNonDefaultToEmpty();
 
-  // Called from generated code / reflection runtime only. Resets value to point
-  // to a default string pointer, with the semantics that this ArenaStringPtr
-  // does not own the pointed-to memory. Disregards initial value of ptr_ (so
-  // this is the *ONLY* safe method to call after construction or when
-  // reinitializing after becoming the active field in a oneof union).
-  inline void UnsafeSetDefault(const ::std::string* default_value) {
-    // Casting away 'const' is safe here: accessors ensure that ptr_ is only
-    // returned as a const if it is equal to default_value.
-    ptr_ = const_cast< ::std::string* >(default_value);
-  }
+  // Clears content, but keeps allocated std::string if arena != nullptr, to
+  // avoid the overhead of heap operations. After this returns, the content
+  // (as seen by the user) will always be equal to |default_value|.
+  void ClearToDefault(const LazyString& default_value, ::google::protobuf::Arena* arena);
 
-  // The 'NoArena' variants of methods below assume arena == NULL and are
-  // optimized to provide very little overhead relative to a raw string pointer
-  // (while still being in-memory compatible with other code that assumes
-  // ArenaStringPtr). Note the invariant that a class instance that has only
-  // ever been mutated by NoArena methods must *only* be in the String state
-  // (i.e., tag bits are not used), *NEVER* ArenaString. This allows all
-  // tagged-pointer manipulations to be avoided.
-  inline void SetNoArena(const ::std::string* default_value,
-                         const ::std::string& value) {
-    if (ptr_ == default_value) {
-      CreateInstanceNoArena(&value);
-    } else {
-      *ptr_ = value;
-    }
+  // Called from generated code / reflection runtime only. Resets value to point
+  // to a default string pointer, with the semantics that this
+  // ArenaStringPtr does not own the pointed-to memory. Disregards initial value
+  // of ptr_ (so this is the *ONLY* safe method to call after construction or
+  // when reinitializing after becoming the active field in a oneof union).
+  inline void UnsafeSetDefault(const std::string* default_value);
+
+  // Returns a mutable pointer, but doesn't initialize the string to the
+  // default value.
+  std::string* MutableNoArenaNoDefault(const std::string* default_value);
+
+  // Get a mutable pointer with unspecified contents.
+  // Similar to `MutableNoArenaNoDefault`, but also handles the arena case.
+  // If the value was donated, the contents are discarded.
+  std::string* MutableNoCopy(const std::string* default_value,
+                             ::google::protobuf::Arena* arena);
+
+  // Destroy the string. Assumes `arena == nullptr`.
+  void DestroyNoArena(const std::string* default_value);
+
+  // Internal setter used only at parse time to directly set a donated string
+  // value.
+  void UnsafeSetTaggedPointer(TaggedPtr<std::string> value) {
+    tagged_ptr_ = value;
   }
-
-#if LANG_CXX11
-  void SetNoArena(const ::std::string* default_value, ::std::string&& value) {
-    if (IsDefault(default_value)) {
-      ptr_ = new ::std::string(std::move(value));
-    } else {
-      *ptr_ = std::move(value);
-    }
+  // Generated code only! An optimization, in certain cases the generated
+  // code is certain we can obtain a std::string with no default checks and
+  // tag tests.
+  std::string* UnsafeMutablePointer() PROTOBUF_RETURNS_NONNULL;
+
+  inline bool IsDefault(const std::string* default_value) const {
+    // Relies on the fact that kPtrTagString == 0, so if IsString(), ptr_ is the
+    // actual std::string pointer (and if !IsString(), ptr_ will never be equal
+    // to any aligned |default_value| pointer). The key is that we want to avoid
+    // masking in the fastpath const-pointer Get() case for non-arena code.
+    return tagged_ptr_.UnsafeGet() == default_value;
   }
-#endif
-
-  void AssignWithDefault(const ::std::string* default_value, ArenaStringPtr value);
 
-  inline const ::std::string& GetNoArena() const { return *ptr_; }
+ private:
+  TaggedPtr<std::string> tagged_ptr_;
 
-  inline ::std::string* MutableNoArena(const ::std::string* default_value) {
-    if (ptr_ == default_value) {
-      CreateInstanceNoArena(default_value);
-    }
-    return ptr_;
-  }
+  bool IsDonatedString() const { return false; }
 
-  inline ::std::string* ReleaseNoArena(const ::std::string* default_value) {
-    if (ptr_ == default_value) {
-      return NULL;
-    } else {
-      ::std::string* released = ptr_;
-      ptr_ = const_cast< ::std::string* >(default_value);
-      return released;
-    }
+  // Swaps tagged pointer without debug hardening. This is to allow python
+  // protobuf to maintain pointer stability even in DEBUG builds.
+  inline PROTOBUF_NDEBUG_INLINE static void UnsafeShallowSwap(
+      ArenaStringPtr* rhs, ArenaStringPtr* lhs) {
+    std::swap(lhs->tagged_ptr_, rhs->tagged_ptr_);
   }
 
-  inline void SetAllocatedNoArena(const ::std::string* default_value,
-                                  ::std::string* value) {
-    if (ptr_ != default_value) {
-      delete ptr_;
-    }
-    if (value != NULL) {
-      ptr_ = value;
-    } else {
-      ptr_ = const_cast< ::std::string* >(default_value);
-    }
-  }
+  friend class ::google::protobuf::internal::SwapFieldHelper;
 
-  inline void DestroyNoArena(const ::std::string* default_value) {
-    if (ptr_ != default_value) {
-      delete ptr_;
-    }
-  }
+  // Slow paths.
 
-  inline void ClearToEmptyNoArena(const ::std::string* default_value) {
-    if (ptr_ == default_value) {
-      // Nothing: already equal to default (which is the empty string).
-    } else {
-      ptr_->clear();
-    }
-  }
+  // MutableSlow requires that !IsString() || IsDefault
+  // Variadic to support 0 args for EmptyDefault and 1 arg for LazyString.
+  template <typename... Lazy>
+  std::string* MutableSlow(::google::protobuf::Arena* arena, const Lazy&... lazy_default);
 
-  inline void ClearToDefaultNoArena(const ::std::string* default_value) {
-    if (ptr_ == default_value) {
-      // Nothing: already set to default.
-    } else {
-      // Reuse existing allocated instance.
-      *ptr_ = *default_value;
-    }
-  }
-
-  // Internal accessor used only at parse time to provide direct access to the
-  // raw pointer from the shared parse routine (in the non-arenas case). The
-  // parse routine does the string allocation in order to save code size in the
-  // generated parsing code.
-  inline ::std::string** UnsafeRawStringPointer() {
-    return &ptr_;
-  }
+  // Sets value to a newly allocated string and returns it
+  std::string* SetAndReturnNewString();
 
-  inline bool IsDefault(const ::std::string* default_value) const {
-    return ptr_ == default_value;
-  }
+  // Destroys the non-default string value out-of-line
+  void DestroyNoArenaSlowPath();
 
- private:
-  ::std::string* ptr_;
-
-  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_PROTOBUF_ATTRIBUTE_NOINLINE
-  void CreateInstanceNoArena(const ::std::string* initial_value) {
-    GOOGLE_DCHECK(initial_value != NULL);
-    ptr_ = new ::std::string(*initial_value);
-  }
 };
 
-}  // namespace internal
-}  // namespace protobuf
+inline void ArenaStringPtr::UnsafeSetDefault(const std::string* value) {
+  tagged_ptr_.Set(const_cast<std::string*>(value));
+}
 
+// Make sure rhs_arena allocated rhs, and lhs_arena allocated lhs.
+inline PROTOBUF_NDEBUG_INLINE void ArenaStringPtr::InternalSwap(  //
+    const std::string* default_value,                             //
+    ArenaStringPtr* rhs, Arena* rhs_arena,                        //
+    ArenaStringPtr* lhs, Arena* lhs_arena) {
+  // Silence unused variable warnings in release buildls.
+  (void)default_value;
+  (void)rhs_arena;
+  (void)lhs_arena;
+  std::swap(lhs->tagged_ptr_, rhs->tagged_ptr_);
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+  auto force_realloc = [default_value](ArenaStringPtr* p, Arena* arena) {
+    if (p->IsDefault(default_value)) return;
+    std::string* old_value = p->tagged_ptr_.Get();
+    std::string* new_value =
+        p->IsDonatedString()
+            ? Arena::Create<std::string>(arena, *old_value)
+            : Arena::Create<std::string>(arena, std::move(*old_value));
+    if (arena == nullptr) delete old_value;
+    p->tagged_ptr_.Set(new_value);
+  };
+  // Because, at this point, tagged_ptr_ has been swapped, arena should also be
+  // swapped.
+  force_realloc(lhs, rhs_arena);
+  force_realloc(rhs, lhs_arena);
+#endif  // PROTOBUF_FORCE_COPY_IN_SWAP
+}
 
+inline void ArenaStringPtr::ClearNonDefaultToEmpty() {
+  // Unconditionally mask away the tag.
+  tagged_ptr_.Get()->clear();
+}
 
-namespace protobuf {
-namespace internal {
+inline std::string* ArenaStringPtr::MutableNoArenaNoDefault(
+    const std::string* default_value) {
+  // VERY IMPORTANT for performance and code size: this will reduce to a member
+  // variable load, a pointer check (against |default_value|, in practice a
+  // static global) and a branch to the slowpath (which calls operator new and
+  // the ctor). DO NOT add any tagged-pointer operations here.
+  if (IsDefault(default_value)) {
+    return SetAndReturnNewString();
+  } else {
+    return UnsafeMutablePointer();
+  }
+}
 
-inline void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value,
-                                       ArenaStringPtr value) {
-  const ::std::string* me = *UnsafeRawStringPointer();
-  const ::std::string* other = *value.UnsafeRawStringPointer();
-  // If the pointers are the same then do nothing.
-  if (me != other) {
-    SetNoArena(default_value, value.GetNoArena());
+inline void ArenaStringPtr::DestroyNoArena(const std::string* default_value) {
+  if (!IsDefault(default_value)) {
+    DestroyNoArenaSlowPath();
   }
 }
 
+inline std::string* ArenaStringPtr::UnsafeMutablePointer() {
+  GOOGLE_DCHECK(!tagged_ptr_.IsTagged());
+  GOOGLE_DCHECK(tagged_ptr_.UnsafeGet() != nullptr);
+  return tagged_ptr_.UnsafeGet();
+}
+
+
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_ARENASTRING_H__
index 3f54b84..c8ce218 100644 (file)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
-#include <google/protobuf/stubs/hash.h>
+#include <google/protobuf/descriptor.h>
+
+#include <algorithm>
+#include <array>
+#include <functional>
+#include <limits>
 #include <map>
 #include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
 #include <set>
 #include <string>
+#include <unordered_map>
+#include <unordered_set>
 #include <vector>
-#include <algorithm>
-#include <limits>
 
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/mutex.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/stubs/stringprintf.h>
 #include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/io/strtod.h>
+#include <google/protobuf/any.h>
+#include <google/protobuf/descriptor.pb.h>
+#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/io/tokenizer.h>
 #include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/descriptor.pb.h>
-#include <google/protobuf/descriptor.h>
 #include <google/protobuf/descriptor_database.h>
 #include <google/protobuf/dynamic_message.h>
 #include <google/protobuf/generated_message_util.h>
 #include <google/protobuf/text_format.h>
 #include <google/protobuf/unknown_field_set.h>
 #include <google/protobuf/wire_format.h>
+#include <google/protobuf/stubs/casts.h>
 #include <google/protobuf/stubs/substitute.h>
-
+#include <google/protobuf/io/strtod.h>
 #include <google/protobuf/stubs/map_util.h>
 #include <google/protobuf/stubs/stl_util.h>
+#include <google/protobuf/stubs/hash.h>
 
 #undef PACKAGE  // autoheader #defines this.  :(
 
-namespace google {
 
+#include <google/protobuf/port_def.inc>
+
+namespace google {
 namespace protobuf {
 
-struct Symbol {
+class Symbol {
+ public:
   enum Type {
     NULL_SYMBOL,
     MESSAGE,
@@ -81,139 +86,264 @@ struct Symbol {
     ONEOF,
     ENUM,
     ENUM_VALUE,
+    ENUM_VALUE_OTHER_PARENT,
     SERVICE,
     METHOD,
-    PACKAGE
+    PACKAGE,
+    QUERY_KEY
   };
-  Type type;
-  union {
-    const Descriptor* descriptor;
-    const FieldDescriptor* field_descriptor;
-    const OneofDescriptor* oneof_descriptor;
-    const EnumDescriptor* enum_descriptor;
-    const EnumValueDescriptor* enum_value_descriptor;
-    const ServiceDescriptor* service_descriptor;
-    const MethodDescriptor* method_descriptor;
-    const FileDescriptor* package_file_descriptor;
+
+  Symbol() : ptr_(nullptr) {}
+
+  // Every object we store derives from internal::SymbolBase, where we store the
+  // symbol type enum.
+  // Storing in the object can be done without using more space in most cases,
+  // while storing it in the Symbol type would require 8 bytes.
+#define DEFINE_MEMBERS(TYPE, TYPE_CONSTANT, FIELD)                             \
+  explicit Symbol(TYPE* value) : ptr_(value) {                                 \
+    value->symbol_type_ = TYPE_CONSTANT;                                       \
+  }                                                                            \
+  const TYPE* FIELD() const {                                                  \
+    return type() == TYPE_CONSTANT ? static_cast<const TYPE*>(ptr_) : nullptr; \
+  }
+
+  DEFINE_MEMBERS(Descriptor, MESSAGE, descriptor)
+  DEFINE_MEMBERS(FieldDescriptor, FIELD, field_descriptor)
+  DEFINE_MEMBERS(OneofDescriptor, ONEOF, oneof_descriptor)
+  DEFINE_MEMBERS(EnumDescriptor, ENUM, enum_descriptor)
+  DEFINE_MEMBERS(ServiceDescriptor, SERVICE, service_descriptor)
+  DEFINE_MEMBERS(MethodDescriptor, METHOD, method_descriptor)
+
+  // We use a special node for FileDescriptor.
+  // It is potentially added to the table with multiple different names, so we
+  // need a separate place to put the name.
+  struct Package : internal::SymbolBase {
+    const std::string* name;
+    const FileDescriptor* file;
+  };
+  DEFINE_MEMBERS(Package, PACKAGE, package_file_descriptor)
+
+  // Enum values have two different parents.
+  // We use two different identitied for the same object to determine the two
+  // different insertions in the map.
+  static Symbol EnumValue(EnumValueDescriptor* value, int n) {
+    Symbol s;
+    internal::SymbolBase* ptr;
+    if (n == 0) {
+      ptr = static_cast<internal::SymbolBaseN<0>*>(value);
+      ptr->symbol_type_ = ENUM_VALUE;
+    } else {
+      ptr = static_cast<internal::SymbolBaseN<1>*>(value);
+      ptr->symbol_type_ = ENUM_VALUE_OTHER_PARENT;
+    }
+    s.ptr_ = ptr;
+    return s;
+  }
+
+  const EnumValueDescriptor* enum_value_descriptor() const {
+    return type() == ENUM_VALUE
+               ? static_cast<const EnumValueDescriptor*>(
+                     static_cast<const internal::SymbolBaseN<0>*>(ptr_))
+           : type() == ENUM_VALUE_OTHER_PARENT
+               ? static_cast<const EnumValueDescriptor*>(
+                     static_cast<const internal::SymbolBaseN<1>*>(ptr_))
+               : nullptr;
+  }
+
+  // Not a real symbol.
+  // Only used for heterogeneous lookups and never actually inserted in the
+  // tables.
+  struct QueryKey : internal::SymbolBase {
+    StringPiece name;
+    const void* parent;
+    int field_number;
   };
+  DEFINE_MEMBERS(QueryKey, QUERY_KEY, query_key);
+#undef DEFINE_MEMBERS
 
-  inline Symbol() : type(NULL_SYMBOL) { descriptor = NULL; }
-  inline bool IsNull() const { return type == NULL_SYMBOL; }
-  inline bool IsType() const { return type == MESSAGE || type == ENUM; }
-  inline bool IsAggregate() const {
-    return type == MESSAGE || type == PACKAGE || type == ENUM ||
-           type == SERVICE;
+  Type type() const {
+    return ptr_ == nullptr ? NULL_SYMBOL
+                           : static_cast<Type>(ptr_->symbol_type_);
   }
-
-#define CONSTRUCTOR(TYPE, TYPE_CONSTANT, FIELD) \
-  inline explicit Symbol(const TYPE* value) {   \
-    type = TYPE_CONSTANT;                       \
-    this->FIELD = value;                        \
+  bool IsNull() const { return type() == NULL_SYMBOL; }
+  bool IsType() const { return type() == MESSAGE || type() == ENUM; }
+  bool IsAggregate() const {
+    return type() == MESSAGE || type() == PACKAGE || type() == ENUM ||
+           type() == SERVICE;
   }
 
-  CONSTRUCTOR(Descriptor, MESSAGE, descriptor)
-  CONSTRUCTOR(FieldDescriptor, FIELD, field_descriptor)
-  CONSTRUCTOR(OneofDescriptor, ONEOF, oneof_descriptor)
-  CONSTRUCTOR(EnumDescriptor, ENUM, enum_descriptor)
-  CONSTRUCTOR(EnumValueDescriptor, ENUM_VALUE, enum_value_descriptor)
-  CONSTRUCTOR(ServiceDescriptor, SERVICE, service_descriptor)
-  CONSTRUCTOR(MethodDescriptor, METHOD, method_descriptor)
-  CONSTRUCTOR(FileDescriptor, PACKAGE, package_file_descriptor)
-#undef CONSTRUCTOR
-
   const FileDescriptor* GetFile() const {
-    switch (type) {
-      case NULL_SYMBOL:
-        return NULL;
+    switch (type()) {
       case MESSAGE:
-        return descriptor->file();
+        return descriptor()->file();
       case FIELD:
-        return field_descriptor->file();
+        return field_descriptor()->file();
       case ONEOF:
-        return oneof_descriptor->containing_type()->file();
+        return oneof_descriptor()->containing_type()->file();
       case ENUM:
-        return enum_descriptor->file();
+        return enum_descriptor()->file();
       case ENUM_VALUE:
-        return enum_value_descriptor->type()->file();
+        return enum_value_descriptor()->type()->file();
       case SERVICE:
-        return service_descriptor->file();
+        return service_descriptor()->file();
       case METHOD:
-        return method_descriptor->service()->file();
+        return method_descriptor()->service()->file();
       case PACKAGE:
-        return package_file_descriptor;
+        return package_file_descriptor()->file;
+      default:
+        return nullptr;
+    }
+  }
+
+  StringPiece full_name() const {
+    switch (type()) {
+      case MESSAGE:
+        return descriptor()->full_name();
+      case FIELD:
+        return field_descriptor()->full_name();
+      case ONEOF:
+        return oneof_descriptor()->full_name();
+      case ENUM:
+        return enum_descriptor()->full_name();
+      case ENUM_VALUE:
+        return enum_value_descriptor()->full_name();
+      case SERVICE:
+        return service_descriptor()->full_name();
+      case METHOD:
+        return method_descriptor()->full_name();
+      case PACKAGE:
+        return *package_file_descriptor()->name;
+      case QUERY_KEY:
+        return query_key()->name;
+      default:
+        GOOGLE_CHECK(false);
+    }
+    return "";
+  }
+
+  std::pair<const void*, StringPiece> parent_name_key() const {
+    const auto or_file = [&](const void* p) { return p ? p : GetFile(); };
+    switch (type()) {
+      case MESSAGE:
+        return {or_file(descriptor()->containing_type()), descriptor()->name()};
+      case FIELD: {
+        auto* field = field_descriptor();
+        return {or_file(field->is_extension() ? field->extension_scope()
+                                              : field->containing_type()),
+                field->name()};
+      }
+      case ONEOF:
+        return {oneof_descriptor()->containing_type(),
+                oneof_descriptor()->name()};
+      case ENUM:
+        return {or_file(enum_descriptor()->containing_type()),
+                enum_descriptor()->name()};
+      case ENUM_VALUE:
+        return {or_file(enum_value_descriptor()->type()->containing_type()),
+                enum_value_descriptor()->name()};
+      case ENUM_VALUE_OTHER_PARENT:
+        return {enum_value_descriptor()->type(),
+                enum_value_descriptor()->name()};
+      case SERVICE:
+        return {GetFile(), service_descriptor()->name()};
+      case METHOD:
+        return {method_descriptor()->service(), method_descriptor()->name()};
+      case QUERY_KEY:
+        return {query_key()->parent, query_key()->name};
+      default:
+        GOOGLE_CHECK(false);
+    }
+    return {};
+  }
+
+  std::pair<const void*, int> parent_number_key() const {
+    switch (type()) {
+      case FIELD:
+        return {field_descriptor()->containing_type(),
+                field_descriptor()->number()};
+      case ENUM_VALUE:
+        return {enum_value_descriptor()->type(),
+                enum_value_descriptor()->number()};
+      case QUERY_KEY:
+        return {query_key()->parent, query_key()->field_number};
+      default:
+        GOOGLE_CHECK(false);
     }
-    return NULL;
+    return {};
   }
+
+ private:
+  const internal::SymbolBase* ptr_;
 };
 
 const FieldDescriptor::CppType
-FieldDescriptor::kTypeToCppTypeMap[MAX_TYPE + 1] = {
-  static_cast<CppType>(0),  // 0 is reserved for errors
-
-  CPPTYPE_DOUBLE,   // TYPE_DOUBLE
-  CPPTYPE_FLOAT,    // TYPE_FLOAT
-  CPPTYPE_INT64,    // TYPE_INT64
-  CPPTYPE_UINT64,   // TYPE_UINT64
-  CPPTYPE_INT32,    // TYPE_INT32
-  CPPTYPE_UINT64,   // TYPE_FIXED64
-  CPPTYPE_UINT32,   // TYPE_FIXED32
-  CPPTYPE_BOOL,     // TYPE_BOOL
-  CPPTYPE_STRING,   // TYPE_STRING
-  CPPTYPE_MESSAGE,  // TYPE_GROUP
-  CPPTYPE_MESSAGE,  // TYPE_MESSAGE
-  CPPTYPE_STRING,   // TYPE_BYTES
-  CPPTYPE_UINT32,   // TYPE_UINT32
-  CPPTYPE_ENUM,     // TYPE_ENUM
-  CPPTYPE_INT32,    // TYPE_SFIXED32
-  CPPTYPE_INT64,    // TYPE_SFIXED64
-  CPPTYPE_INT32,    // TYPE_SINT32
-  CPPTYPE_INT64,    // TYPE_SINT64
+    FieldDescriptor::kTypeToCppTypeMap[MAX_TYPE + 1] = {
+        static_cast<CppType>(0),  // 0 is reserved for errors
+
+        CPPTYPE_DOUBLE,   // TYPE_DOUBLE
+        CPPTYPE_FLOAT,    // TYPE_FLOAT
+        CPPTYPE_INT64,    // TYPE_INT64
+        CPPTYPE_UINT64,   // TYPE_UINT64
+        CPPTYPE_INT32,    // TYPE_INT32
+        CPPTYPE_UINT64,   // TYPE_FIXED64
+        CPPTYPE_UINT32,   // TYPE_FIXED32
+        CPPTYPE_BOOL,     // TYPE_BOOL
+        CPPTYPE_STRING,   // TYPE_STRING
+        CPPTYPE_MESSAGE,  // TYPE_GROUP
+        CPPTYPE_MESSAGE,  // TYPE_MESSAGE
+        CPPTYPE_STRING,   // TYPE_BYTES
+        CPPTYPE_UINT32,   // TYPE_UINT32
+        CPPTYPE_ENUM,     // TYPE_ENUM
+        CPPTYPE_INT32,    // TYPE_SFIXED32
+        CPPTYPE_INT64,    // TYPE_SFIXED64
+        CPPTYPE_INT32,    // TYPE_SINT32
+        CPPTYPE_INT64,    // TYPE_SINT64
 };
 
-const char * const FieldDescriptor::kTypeToName[MAX_TYPE + 1] = {
-  "ERROR",     // 0 is reserved for errors
-
-  "double",    // TYPE_DOUBLE
-  "float",     // TYPE_FLOAT
-  "int64",     // TYPE_INT64
-  "uint64",    // TYPE_UINT64
-  "int32",     // TYPE_INT32
-  "fixed64",   // TYPE_FIXED64
-  "fixed32",   // TYPE_FIXED32
-  "bool",      // TYPE_BOOL
-  "string",    // TYPE_STRING
-  "group",     // TYPE_GROUP
-  "message",   // TYPE_MESSAGE
-  "bytes",     // TYPE_BYTES
-  "uint32",    // TYPE_UINT32
-  "enum",      // TYPE_ENUM
-  "sfixed32",  // TYPE_SFIXED32
-  "sfixed64",  // TYPE_SFIXED64
-  "sint32",    // TYPE_SINT32
-  "sint64",    // TYPE_SINT64
+const char* const FieldDescriptor::kTypeToName[MAX_TYPE + 1] = {
+    "ERROR",  // 0 is reserved for errors
+
+    "double",    // TYPE_DOUBLE
+    "float",     // TYPE_FLOAT
+    "int64",     // TYPE_INT64
+    "uint64",    // TYPE_UINT64
+    "int32",     // TYPE_INT32
+    "fixed64",   // TYPE_FIXED64
+    "fixed32",   // TYPE_FIXED32
+    "bool",      // TYPE_BOOL
+    "string",    // TYPE_STRING
+    "group",     // TYPE_GROUP
+    "message",   // TYPE_MESSAGE
+    "bytes",     // TYPE_BYTES
+    "uint32",    // TYPE_UINT32
+    "enum",      // TYPE_ENUM
+    "sfixed32",  // TYPE_SFIXED32
+    "sfixed64",  // TYPE_SFIXED64
+    "sint32",    // TYPE_SINT32
+    "sint64",    // TYPE_SINT64
 };
 
-const char * const FieldDescriptor::kCppTypeToName[MAX_CPPTYPE + 1] = {
-  "ERROR",     // 0 is reserved for errors
-
-  "int32",     // CPPTYPE_INT32
-  "int64",     // CPPTYPE_INT64
-  "uint32",    // CPPTYPE_UINT32
-  "uint64",    // CPPTYPE_UINT64
-  "double",    // CPPTYPE_DOUBLE
-  "float",     // CPPTYPE_FLOAT
-  "bool",      // CPPTYPE_BOOL
-  "enum",      // CPPTYPE_ENUM
-  "string",    // CPPTYPE_STRING
-  "message",   // CPPTYPE_MESSAGE
+const char* const FieldDescriptor::kCppTypeToName[MAX_CPPTYPE + 1] = {
+    "ERROR",  // 0 is reserved for errors
+
+    "int32",    // CPPTYPE_INT32
+    "int64",    // CPPTYPE_INT64
+    "uint32",   // CPPTYPE_UINT32
+    "uint64",   // CPPTYPE_UINT64
+    "double",   // CPPTYPE_DOUBLE
+    "float",    // CPPTYPE_FLOAT
+    "bool",     // CPPTYPE_BOOL
+    "enum",     // CPPTYPE_ENUM
+    "string",   // CPPTYPE_STRING
+    "message",  // CPPTYPE_MESSAGE
 };
 
-const char * const FieldDescriptor::kLabelToName[MAX_LABEL + 1] = {
-  "ERROR",     // 0 is reserved for errors
+const char* const FieldDescriptor::kLabelToName[MAX_LABEL + 1] = {
+    "ERROR",  // 0 is reserved for errors
 
-  "optional",  // LABEL_OPTIONAL
-  "required",  // LABEL_REQUIRED
-  "repeated",  // LABEL_REPEATED
+    "optional",  // LABEL_OPTIONAL
+    "required",  // LABEL_REQUIRED
+    "repeated",  // LABEL_REPEATED
 };
 
 const char* FileDescriptor::SyntaxName(FileDescriptor::Syntax syntax) {
@@ -226,12 +356,12 @@ const char* FileDescriptor::SyntaxName(FileDescriptor::Syntax syntax) {
       return "unknown";
   }
   GOOGLE_LOG(FATAL) << "can't reach here.";
-  return NULL;
+  return nullptr;
 }
 
-static const char * const kNonLinkedWeakMessageReplacementName = "google.protobuf.Empty";
+static const char* const kNonLinkedWeakMessageReplacementName = "google.protobuf.Empty";
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
+#if !defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)
 const int FieldDescriptor::kMaxNumber;
 const int FieldDescriptor::kFirstReservedNumber;
 const int FieldDescriptor::kLastReservedNumber;
@@ -248,19 +378,19 @@ char ToLower(char ch) {
   return (ch >= 'A' && ch <= 'Z') ? (ch - 'A' + 'a') : ch;
 }
 
-string ToCamelCase(const string& input, bool lower_first) {
+std::string ToCamelCase(const std::string& input, bool lower_first) {
   bool capitalize_next = !lower_first;
-  string result;
+  std::string result;
   result.reserve(input.size());
 
-  for (int i = 0; i < input.size(); i++) {
-    if (input[i] == '_') {
+  for (char character : input) {
+    if (character == '_') {
       capitalize_next = true;
     } else if (capitalize_next) {
-      result.push_back(ToUpper(input[i]));
+      result.push_back(ToUpper(character));
       capitalize_next = false;
     } else {
-      result.push_back(input[i]);
+      result.push_back(character);
     }
   }
 
@@ -272,38 +402,38 @@ string ToCamelCase(const string& input, bool lower_first) {
   return result;
 }
 
-string ToJsonName(const string& input) {
+std::string ToJsonName(const std::string& input) {
   bool capitalize_next = false;
-  string result;
+  std::string result;
   result.reserve(input.size());
 
-  for (int i = 0; i < input.size(); i++) {
-    if (input[i] == '_') {
+  for (char character : input) {
+    if (character == '_') {
       capitalize_next = true;
     } else if (capitalize_next) {
-      result.push_back(ToUpper(input[i]));
+      result.push_back(ToUpper(character));
       capitalize_next = false;
     } else {
-      result.push_back(input[i]);
+      result.push_back(character);
     }
   }
 
   return result;
 }
 
-string EnumValueToPascalCase(const string& input) {
+std::string EnumValueToPascalCase(const std::string& input) {
   bool next_upper = true;
-  string result;
+  std::string result;
   result.reserve(input.size());
 
-  for (int i = 0; i < input.size(); i++) {
-    if (input[i] == '_') {
+  for (char character : input) {
+    if (character == '_') {
       next_upper = true;
     } else {
       if (next_upper) {
-        result.push_back(ToUpper(input[i]));
+        result.push_back(ToUpper(character));
       } else {
-        result.push_back(ToLower(input[i]));
+        result.push_back(ToLower(character));
       }
       next_upper = false;
     }
@@ -317,16 +447,16 @@ class PrefixRemover {
  public:
   PrefixRemover(StringPiece prefix) {
     // Strip underscores and lower-case the prefix.
-    for (int i = 0; i < prefix.size(); i++) {
-      if (prefix[i] != '_') {
-        prefix_ += ascii_tolower(prefix[i]);
+    for (char character : prefix) {
+      if (character != '_') {
+        prefix_ += ascii_tolower(character);
       }
     }
   }
 
   // Tries to remove the enum prefix from this enum value.
   // If this is not possible, returns the input verbatim.
-  string MaybeRemove(StringPiece str) {
+  std::string MaybeRemove(StringPiece str) {
     // We can't just lowercase and strip str and look for a prefix.
     // We need to properly recognize the difference between:
     //
@@ -346,14 +476,14 @@ class PrefixRemover {
       }
 
       if (ascii_tolower(str[i]) != prefix_[j++]) {
-        return str.as_string();
+        return std::string(str);
       }
     }
 
     // If we didn't make it through the prefix, we've failed to strip the
     // prefix.
     if (j < prefix_.size()) {
-      return str.as_string();
+      return std::string(str);
     }
 
     // Skip underscores between prefix and further characters.
@@ -363,47 +493,41 @@ class PrefixRemover {
 
     // Enum label can't be the empty string.
     if (i == str.size()) {
-      return str.as_string();
+      return std::string(str);
     }
 
     // We successfully stripped the prefix.
     str.remove_prefix(i);
-    return str.as_string();
+    return std::string(str);
   }
 
  private:
-  string prefix_;
+  std::string prefix_;
 };
 
-// A DescriptorPool contains a bunch of hash_maps to implement the
+// A DescriptorPool contains a bunch of hash-maps to implement the
 // various Find*By*() methods.  Since hashtable lookups are O(1), it's
-// most efficient to construct a fixed set of large hash_maps used by
+// most efficient to construct a fixed set of large hash-maps used by
 // all objects in the pool rather than construct one or more small
-// hash_maps for each object.
-//
-// The keys to these hash_maps are (parent, name) or (parent, number)
-// pairs.  Unfortunately STL doesn't provide hash functions for pair<>,
-// so we must invent our own.
+// hash-maps for each object.
 //
-// TODO(kenton):  Use StringPiece rather than const char* in keys?  It would
-//   be a lot cleaner but we'd just have to convert it back to const char*
-//   for the open source release.
+// The keys to these hash-maps are (parent, name) or (parent, number) pairs.
 
-typedef std::pair<const void*, const char*> PointerStringPair;
+typedef std::pair<const void*, StringPiece> PointerStringPair;
 
-struct PointerStringPairEqual {
-  inline bool operator()(const PointerStringPair& a,
-                         const PointerStringPair& b) const {
-    return a.first == b.first && strcmp(a.second, b.second) == 0;
-  }
-};
+typedef std::pair<const Descriptor*, int> DescriptorIntPair;
 
-template<typename PairType>
+#define HASH_MAP std::unordered_map
+#define HASH_SET std::unordered_set
+#define HASH_FXN hash
+
+template <typename PairType>
 struct PointerIntegerPairHash {
   size_t operator()(const PairType& p) const {
-    // FIXME(kenton):  What is the best way to compute this hash?  I have
-    // no idea!  This seems a bit better than an XOR.
-    return reinterpret_cast<intptr_t>(p.first) * ((1 << 16) - 1) + p.second;
+    static const size_t prime1 = 16777499;
+    static const size_t prime2 = 16777619;
+    return reinterpret_cast<size_t>(p.first) * prime1 ^
+           static_cast<size_t>(p.second) * prime2;
   }
 
 #ifdef _MSC_VER
@@ -412,21 +536,16 @@ struct PointerIntegerPairHash {
   static const size_t min_buckets = 8;
 #endif
   inline bool operator()(const PairType& a, const PairType& b) const {
-    return a.first < b.first ||
-          (a.first == b.first && a.second < b.second);
+    return a < b;
   }
 };
 
-typedef std::pair<const Descriptor*, int> DescriptorIntPair;
-typedef std::pair<const EnumDescriptor*, int> EnumIntPair;
-
 struct PointerStringPairHash {
   size_t operator()(const PointerStringPair& p) const {
-    // FIXME(kenton):  What is the best way to compute this hash?  I have
-    // no idea!  This seems a bit better than an XOR.
-    hash<const char*> cstring_hash;
-    return reinterpret_cast<intptr_t>(p.first) * ((1 << 16) - 1) +
-           cstring_hash(p.second);
+    static const size_t prime = 16777619;
+    hash<StringPiece> string_hash;
+    return reinterpret_cast<size_t>(p.first) * prime ^
+           static_cast<size_t>(string_hash(p.second));
   }
 
 #ifdef _MSC_VER
@@ -436,77 +555,497 @@ struct PointerStringPairHash {
 #endif
   inline bool operator()(const PointerStringPair& a,
                          const PointerStringPair& b) const {
-    if (a.first < b.first) return true;
-    if (a.first > b.first) return false;
-    return strcmp(a.second, b.second) < 0;
+    return a < b;
   }
 };
 
 
 const Symbol kNullSymbol;
 
-typedef hash_map<const char*, Symbol,
-                 hash<const char*>, streq>
-  SymbolsByNameMap;
-typedef hash_map<PointerStringPair, Symbol,
-                 PointerStringPairHash, PointerStringPairEqual>
-  SymbolsByParentMap;
-typedef hash_map<const char*, const FileDescriptor*,
-                 hash<const char*>, streq>
-  FilesByNameMap;
-typedef hash_map<PointerStringPair, const FieldDescriptor*,
-                 PointerStringPairHash, PointerStringPairEqual>
-  FieldsByNameMap;
-typedef hash_map<DescriptorIntPair, const FieldDescriptor*,
-                 PointerIntegerPairHash<DescriptorIntPair> >
-  FieldsByNumberMap;
-typedef hash_map<EnumIntPair, const EnumValueDescriptor*,
-                 PointerIntegerPairHash<EnumIntPair> >
-  EnumValuesByNumberMap;
-// This is a map rather than a hash_map, since we use it to iterate
+struct SymbolByFullNameHash {
+  size_t operator()(Symbol s) const {
+    return HASH_FXN<StringPiece>{}(s.full_name());
+  }
+};
+struct SymbolByFullNameEq {
+  bool operator()(Symbol a, Symbol b) const {
+    return a.full_name() == b.full_name();
+  }
+};
+using SymbolsByNameSet =
+    HASH_SET<Symbol, SymbolByFullNameHash, SymbolByFullNameEq>;
+
+struct SymbolByParentHash {
+  size_t operator()(Symbol s) const {
+    return PointerStringPairHash{}(s.parent_name_key());
+  }
+};
+struct SymbolByParentEq {
+  bool operator()(Symbol a, Symbol b) const {
+    return a.parent_name_key() == b.parent_name_key();
+  }
+};
+using SymbolsByParentSet =
+    HASH_SET<Symbol, SymbolByParentHash, SymbolByParentEq>;
+
+typedef HASH_MAP<StringPiece, const FileDescriptor*,
+                 HASH_FXN<StringPiece>>
+    FilesByNameMap;
+
+typedef HASH_MAP<PointerStringPair, const FieldDescriptor*,
+                 PointerStringPairHash>
+    FieldsByNameMap;
+
+struct FieldsByNumberHash {
+  size_t operator()(Symbol s) const {
+    return PointerIntegerPairHash<std::pair<const void*, int>>{}(
+        s.parent_number_key());
+  }
+};
+struct FieldsByNumberEq {
+  bool operator()(Symbol a, Symbol b) const {
+    return a.parent_number_key() == b.parent_number_key();
+  }
+};
+using FieldsByNumberSet =
+    HASH_SET<Symbol, FieldsByNumberHash, FieldsByNumberEq>;
+using EnumValuesByNumberSet = FieldsByNumberSet;
+
+// This is a map rather than a hash-map, since we use it to iterate
 // through all the extensions that extend a given Descriptor, and an
 // ordered data structure that implements lower_bound is convenient
 // for that.
 typedef std::map<DescriptorIntPair, const FieldDescriptor*>
-  ExtensionsGroupedByDescriptorMap;
-typedef hash_map<string, const SourceCodeInfo_Location*> LocationsByPathMap;
-
-std::set<string>* allowed_proto3_extendees_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(allowed_proto3_extendees_init_);
-
-void DeleteAllowedProto3Extendee() {
-  delete allowed_proto3_extendees_;
-}
+    ExtensionsGroupedByDescriptorMap;
+typedef HASH_MAP<std::string, const SourceCodeInfo_Location*>
+    LocationsByPathMap;
 
-void InitAllowedProto3Extendee() {
-  allowed_proto3_extendees_ = new std::set<string>;
+std::set<std::string>* NewAllowedProto3Extendee() {
+  auto allowed_proto3_extendees = new std::set<std::string>;
   const char* kOptionNames[] = {
-      "FileOptions",      "MessageOptions", "FieldOptions", "EnumOptions",
+      "FileOptions",      "MessageOptions", "FieldOptions",  "EnumOptions",
       "EnumValueOptions", "ServiceOptions", "MethodOptions", "OneofOptions"};
-  for (int i = 0; i < GOOGLE_ARRAYSIZE(kOptionNames); ++i) {
+  for (const char* option_name : kOptionNames) {
     // descriptor.proto has a different package name in opensource. We allow
     // both so the opensource protocol compiler can also compile internal
     // proto3 files with custom options. See: b/27567912
-    allowed_proto3_extendees_->insert(string("google.protobuf.") +
-                                      kOptionNames[i]);
+    allowed_proto3_extendees->insert(std::string("google.protobuf.") +
+                                     option_name);
     // Split the word to trick the opensource processing scripts so they
-    // will keep the origial package name.
-    allowed_proto3_extendees_->insert(string("proto") + "2." + kOptionNames[i]);
+    // will keep the original package name.
+    allowed_proto3_extendees->insert(std::string("proto") + "2." + option_name);
   }
-
-  google::protobuf::internal::OnShutdown(&DeleteAllowedProto3Extendee);
+  return allowed_proto3_extendees;
 }
 
 // Checks whether the extendee type is allowed in proto3.
 // Only extensions to descriptor options are allowed. We use name comparison
 // instead of comparing the descriptor directly because the extensions may be
 // defined in a different pool.
-bool AllowedExtendeeInProto3(const string& name) {
-  ::google::protobuf::GoogleOnceInit(&allowed_proto3_extendees_init_, &InitAllowedProto3Extendee);
-  return allowed_proto3_extendees_->find(name) !=
-         allowed_proto3_extendees_->end();
+bool AllowedExtendeeInProto3(const std::string& name) {
+  static auto allowed_proto3_extendees =
+      internal::OnShutdownDelete(NewAllowedProto3Extendee());
+  return allowed_proto3_extendees->find(name) !=
+         allowed_proto3_extendees->end();
 }
 
+// This bump allocator arena is optimized for the use case of this file. It is
+// mostly optimized for memory usage, since these objects are expected to live
+// for the entirety of the program.
+//
+// Some differences from other arenas:
+//  - It has a fixed number of non-trivial types it can hold. This allows
+//    tracking the allocations with a single byte. In contrast, google::protobuf::Arena
+//    uses 16 bytes per non-trivial object created.
+//  - It has some extra metadata for rollbacks. This is necessary for
+//    implementing the API below. This metadata is flushed at the end and would
+//    not cause persistent memory usage.
+//  - It tries to squeeze every byte of out the blocks. If an allocation is too
+//    large for the current block we move the block to a secondary area where we
+//    can still use it for smaller objects. This complicates rollback logic but
+//    makes it much more memory efficient.
+//
+//  The allocation strategy is as follows:
+//   - Memory is allocated from the front, with a forced 8 byte alignment.
+//   - Metadata is allocated from the back, one byte per element.
+//   - The metadata encodes one of two things:
+//     * For types we want to track, the index into KnownTypes.
+//     * For raw memory blocks, the size of the block (in 8 byte increments
+//       to allow for a larger limit).
+//   - When the raw data is too large to represent in the metadata byte, we
+//     allocate this memory separately in the heap and store an OutOfLineAlloc
+//     object instead. These come from large array allocations and alike.
+//
+//  Blocks are kept in 3 areas:
+//   - `current_` is the one we are currently allocating from. When we need to
+//     allocate a block that doesn't fit there, we make a new block and move the
+//     old `current_` to one of the areas below.
+//   - Blocks that have no more usable space left (ie less than 9 bytes) are
+//     stored in `full_blocks_`.
+//   - Blocks that have some usable space are categorized in
+//     `small_size_blocks_` depending on how much space they have left.
+//     See `kSmallSizes` to see which sizes we track.
+//
+class TableArena {
+ public:
+  // Allocate a block on `n` bytes, with no destructor information saved.
+  void* AllocateMemory(uint32_t n) {
+    uint32_t tag = SizeToRawTag(n) + kFirstRawTag;
+    if (tag > 255) {
+      // We can't fit the size, use an OutOfLineAlloc.
+      return Create<OutOfLineAlloc>(OutOfLineAlloc{::operator new(n), n})->ptr;
+    }
+
+    return AllocRawInternal(n, static_cast<Tag>(tag));
+  }
+
+  // Allocate and construct an element of type `T` as if by
+  // `T(std::forward<Args>(args...))`.
+  // The object is registered for destruction, if its destructor is not trivial.
+  template <typename T, typename... Args>
+  T* Create(Args&&... args) {
+    static_assert(alignof(T) <= 8, "");
+    return ::new (AllocRawInternal(sizeof(T), TypeTag<T>(KnownTypes{})))
+        T(std::forward<Args>(args)...);
+  }
+
+  TableArena() {}
+
+  TableArena(const TableArena&) = delete;
+  TableArena& operator=(const TableArena&) = delete;
+
+  ~TableArena() {
+    // Uncomment this to debug usage statistics of the arena blocks.
+    // PrintUsageInfo();
+
+    for (Block* list : GetLists()) {
+      while (list != nullptr) {
+        Block* b = list;
+        list = list->next;
+        b->VisitBlock(DestroyVisitor{});
+        b->Destroy();
+      }
+    }
+  }
+
+
+  // This function exists for debugging only.
+  // It can be called from the destructor to dump some info in the tests to
+  // inspect the usage of the arena.
+  void PrintUsageInfo() const {
+    const auto print_histogram = [](Block* b, int size) {
+      std::map<uint32_t, uint32_t> unused_space_count;
+      int count = 0;
+      for (; b != nullptr; b = b->next) {
+        ++unused_space_count[b->space_left()];
+        ++count;
+      }
+      if (size > 0) {
+        fprintf(stderr, "  Blocks `At least %d`", size);
+      } else {
+        fprintf(stderr, "  Blocks `full`");
+      }
+      fprintf(stderr, ": %d blocks.\n", count);
+      for (auto p : unused_space_count) {
+        fprintf(stderr, "    space=%4u, count=%3u\n", p.first, p.second);
+      }
+    };
+
+    fprintf(stderr, "TableArena unused space histogram:\n");
+    fprintf(stderr, "  Current: %u\n",
+            current_ != nullptr ? current_->space_left() : 0);
+    print_histogram(full_blocks_, 0);
+    for (size_t i = 0; i < kSmallSizes.size(); ++i) {
+      print_histogram(small_size_blocks_[i], kSmallSizes[i]);
+    }
+  }
+
+  // Current allocation count.
+  // This can be used for checkpointing.
+  size_t num_allocations() const { return num_allocations_; }
+
+  // Rollback the latest allocations until we reach back to `checkpoint`
+  // num_allocations.
+  void RollbackTo(size_t checkpoint) {
+    while (num_allocations_ > checkpoint) {
+      GOOGLE_DCHECK(!rollback_info_.empty());
+      auto& info = rollback_info_.back();
+      Block* b = info.block;
+
+      VisitAlloc(b->data(), &b->start_offset, &b->end_offset, DestroyVisitor{},
+                 KnownTypes{});
+      if (--info.count == 0) {
+        rollback_info_.pop_back();
+      }
+      --num_allocations_;
+    }
+
+    // Reconstruct the lists and destroy empty blocks.
+    auto lists = GetLists();
+    current_ = full_blocks_ = nullptr;
+    small_size_blocks_.fill(nullptr);
+
+    for (Block* list : lists) {
+      while (list != nullptr) {
+        Block* b = list;
+        list = list->next;
+
+        if (b->start_offset == 0) {
+          // This is empty, free it.
+          b->Destroy();
+        } else {
+          RelocateToUsedList(b);
+        }
+      }
+    }
+  }
+
+  // Clear all rollback information. Reduces memory usage.
+  // Trying to rollback past num_allocations() is now impossible.
+  void ClearRollbackData() {
+    rollback_info_.clear();
+    rollback_info_.shrink_to_fit();
+  }
+
+ private:
+  static constexpr size_t RoundUp(size_t n) { return (n + 7) & ~7; }
+
+  using Tag = unsigned char;
+
+  void* AllocRawInternal(uint32_t size, Tag tag) {
+    GOOGLE_DCHECK_GT(size, 0);
+    size = RoundUp(size);
+
+    Block* to_relocate = nullptr;
+    Block* to_use = nullptr;
+
+    for (size_t i = 0; i < kSmallSizes.size(); ++i) {
+      if (small_size_blocks_[i] != nullptr && size <= kSmallSizes[i]) {
+        to_use = to_relocate = PopBlock(small_size_blocks_[i]);
+        break;
+      }
+    }
+
+    if (to_relocate != nullptr) {
+      // We found one in the loop.
+    } else if (current_ != nullptr && size + 1 <= current_->space_left()) {
+      to_use = current_;
+    } else {
+      // No space left anywhere, make a new block.
+      to_relocate = current_;
+      // For now we hardcode the size to one page. Note that the maximum we can
+      // allocate in the block according to the limits of Tag is less than 2k,
+      // so this can fit anything that Tag can represent.
+      constexpr size_t kBlockSize = 4096;
+      to_use = current_ = ::new (::operator new(kBlockSize)) Block(kBlockSize);
+      GOOGLE_DCHECK_GE(current_->space_left(), size + 1);
+    }
+
+    ++num_allocations_;
+    if (!rollback_info_.empty() && rollback_info_.back().block == to_use) {
+      ++rollback_info_.back().count;
+    } else {
+      rollback_info_.push_back({to_use, 1});
+    }
+
+    void* p = to_use->Allocate(size, tag);
+    if (to_relocate != nullptr) {
+      RelocateToUsedList(to_relocate);
+    }
+    return p;
+  }
+
+  static void OperatorDelete(void* p, size_t s) {
+#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
+    ::operator delete(p, s);
+#else
+    ::operator delete(p);
+#endif
+  }
+
+  struct OutOfLineAlloc {
+    void* ptr;
+    uint32_t size;
+  };
+
+  template <typename... T>
+  struct TypeList {
+    static constexpr Tag kSize = static_cast<Tag>(sizeof...(T));
+  };
+
+  template <typename T, typename Visitor>
+  static void RunVisitor(char* p, uint16_t* start, Visitor visit) {
+    *start -= RoundUp(sizeof(T));
+    visit(reinterpret_cast<T*>(p + *start));
+  }
+
+  // Visit the allocation at the passed location.
+  // It updates start/end to be after the visited object.
+  // This allows visiting a whole block by calling the function in a loop.
+  template <typename Visitor, typename... T>
+  static void VisitAlloc(char* p, uint16_t* start, uint16_t* end, Visitor visit,
+                         TypeList<T...>) {
+    const Tag tag = static_cast<Tag>(p[*end]);
+    if (tag >= kFirstRawTag) {
+      // Raw memory. Skip it.
+      *start -= TagToSize(tag);
+    } else {
+      using F = void (*)(char*, uint16_t*, Visitor);
+      static constexpr F kFuncs[] = {&RunVisitor<T, Visitor>...};
+      kFuncs[tag](p, start, visit);
+    }
+    ++*end;
+  }
+
+  template <typename U, typename... Ts>
+  static constexpr Tag TypeTag(TypeList<U, Ts...>) {
+    return 0;
+  }
+
+  template <
+      typename U, typename T, typename... Ts,
+      typename = typename std::enable_if<!std::is_same<U, T>::value>::type>
+  static constexpr Tag TypeTag(TypeList<T, Ts...>) {
+    return 1 + TypeTag<U>(TypeList<Ts...>{});
+  }
+
+  template <typename U>
+  static constexpr Tag TypeTag(TypeList<>) {
+    static_assert(std::is_trivially_destructible<U>::value, "");
+    return SizeToRawTag(sizeof(U));
+  }
+
+  using KnownTypes =
+      TypeList<OutOfLineAlloc, std::string,
+               // For name arrays
+               std::array<std::string, 2>, std::array<std::string, 3>,
+               std::array<std::string, 4>, std::array<std::string, 5>,
+               FileDescriptorTables, SourceCodeInfo, FileOptions,
+               MessageOptions, FieldOptions, ExtensionRangeOptions,
+               OneofOptions, EnumOptions, EnumValueOptions, ServiceOptions,
+               MethodOptions>;
+  static constexpr Tag kFirstRawTag = KnownTypes::kSize;
+
+
+  struct DestroyVisitor {
+    template <typename T>
+    void operator()(T* p) {
+      p->~T();
+    }
+    void operator()(OutOfLineAlloc* p) { OperatorDelete(p->ptr, p->size); }
+  };
+
+  static uint32_t SizeToRawTag(size_t n) { return (RoundUp(n) / 8) - 1; }
+
+  static uint32_t TagToSize(Tag tag) {
+    GOOGLE_DCHECK_GE(tag, kFirstRawTag);
+    return static_cast<uint32_t>(tag - kFirstRawTag + 1) * 8;
+  }
+
+  struct Block {
+    uint16_t start_offset;
+    uint16_t end_offset;
+    uint16_t capacity;
+    Block* next;
+
+    // `allocated_size` is the total size of the memory block allocated.
+    // The `Block` structure is constructed at the start and the rest of the
+    // memory is used as the payload of the `Block`.
+    explicit Block(uint32_t allocated_size) {
+      start_offset = 0;
+      end_offset = capacity =
+          reinterpret_cast<char*>(this) + allocated_size - data();
+      next = nullptr;
+    }
+
+    char* data() {
+      return reinterpret_cast<char*>(this) + RoundUp(sizeof(Block));
+    }
+
+    uint32_t memory_used() {
+      return data() + capacity - reinterpret_cast<char*>(this);
+    }
+    uint32_t space_left() const { return end_offset - start_offset; }
+
+    void* Allocate(uint32_t n, Tag tag) {
+      GOOGLE_DCHECK_LE(n + 1, space_left());
+      void* p = data() + start_offset;
+      start_offset += n;
+      data()[--end_offset] = tag;
+      return p;
+    }
+
+    void Destroy() { OperatorDelete(this, memory_used()); }
+
+    void PrependTo(Block*& list) {
+      next = list;
+      list = this;
+    }
+
+    template <typename Visitor>
+    void VisitBlock(Visitor visit) {
+      for (uint16_t s = start_offset, e = end_offset; s != 0;) {
+        VisitAlloc(data(), &s, &e, visit, KnownTypes{});
+      }
+    }
+  };
+
+  Block* PopBlock(Block*& list) {
+    Block* res = list;
+    list = list->next;
+    return res;
+  }
+
+  void RelocateToUsedList(Block* to_relocate) {
+    if (current_ == nullptr) {
+      current_ = to_relocate;
+      current_->next = nullptr;
+      return;
+    } else if (current_->space_left() < to_relocate->space_left()) {
+      std::swap(current_, to_relocate);
+      current_->next = nullptr;
+    }
+
+    for (int i = kSmallSizes.size(); --i >= 0;) {
+      if (to_relocate->space_left() >= 1 + kSmallSizes[i]) {
+        to_relocate->PrependTo(small_size_blocks_[i]);
+        return;
+      }
+    }
+
+    to_relocate->PrependTo(full_blocks_);
+  }
+
+  static constexpr std::array<uint8_t, 6> kSmallSizes = {
+      {// Sizes for pointer arrays.
+       8, 16, 24, 32,
+       // Sizes for string arrays (for descriptor names).
+       // The most common array sizes are 2 and 3.
+       2 * sizeof(std::string), 3 * sizeof(std::string)}};
+
+  // Helper function to iterate all lists.
+  std::array<Block*, 2 + kSmallSizes.size()> GetLists() const {
+    std::array<Block*, 2 + kSmallSizes.size()> res;
+    res[0] = current_;
+    res[1] = full_blocks_;
+    std::copy(small_size_blocks_.begin(), small_size_blocks_.end(), &res[2]);
+    return res;
+  }
+
+  Block* current_ = nullptr;
+  std::array<Block*, kSmallSizes.size()> small_size_blocks_ = {{}};
+  Block* full_blocks_ = nullptr;
+
+  size_t num_allocations_ = 0;
+  struct RollbackInfo {
+    Block* block;
+    size_t count;
+  };
+  std::vector<RollbackInfo> rollback_info_;
+};
+
+constexpr std::array<uint8_t, 6> TableArena::kSmallSizes;
+
 }  // anonymous namespace
 
 // ===================================================================
@@ -556,42 +1095,47 @@ class DescriptorPool::Tables {
 
   // The stack of files which are currently being built.  Used to detect
   // cyclic dependencies when loading files from a DescriptorDatabase.  Not
-  // used when fallback_database_ == NULL.
-  std::vector<string> pending_files_;
+  // used when fallback_database_ == nullptr.
+  std::vector<std::string> pending_files_;
 
   // A set of files which we have tried to load from the fallback database
   // and encountered errors.  We will not attempt to load them again during
   // execution of the current public API call, but for compatibility with
   // legacy clients, this is cleared at the beginning of each public API call.
-  // Not used when fallback_database_ == NULL.
-  hash_set<string> known_bad_files_;
+  // Not used when fallback_database_ == nullptr.
+  HASH_SET<std::string> known_bad_files_;
 
   // A set of symbols which we have tried to load from the fallback database
   // and encountered errors. We will not attempt to load them again during
   // execution of the current public API call, but for compatibility with
   // legacy clients, this is cleared at the beginning of each public API call.
-  hash_set<string> known_bad_symbols_;
+  HASH_SET<std::string> known_bad_symbols_;
 
   // The set of descriptors for which we've already loaded the full
   // set of extensions numbers from fallback_database_.
-  hash_set<const Descriptor*> extensions_loaded_from_db_;
+  HASH_SET<const Descriptor*> extensions_loaded_from_db_;
+
+  // Maps type name to Descriptor::WellKnownType.  This is logically global
+  // and const, but we make it a member here to simplify its construction and
+  // destruction.  This only has 20-ish entries and is one per DescriptorPool,
+  // so the overhead is small.
+  HASH_MAP<std::string, Descriptor::WellKnownType> well_known_types_;
 
   // -----------------------------------------------------------------
   // Finding items.
 
   // Find symbols.  This returns a null Symbol (symbol.IsNull() is true)
   // if not found.
-  inline Symbol FindSymbol(const string& key) const;
+  inline Symbol FindSymbol(StringPiece key) const;
 
   // This implements the body of DescriptorPool::Find*ByName().  It should
   // really be a private method of DescriptorPool, but that would require
   // declaring Symbol in descriptor.h, which would drag all kinds of other
   // stuff into the header.  Yay C++.
-  Symbol FindByNameHelper(
-    const DescriptorPool* pool, const string& name);
+  Symbol FindByNameHelper(const DescriptorPool* pool, StringPiece name);
 
-  // These return NULL if not found.
-  inline const FileDescriptor* FindFile(const string& key) const;
+  // These return nullptr if not found.
+  inline const FileDescriptor* FindFile(StringPiece key) const;
   inline const FieldDescriptor* FindExtension(const Descriptor* extendee,
                                               int number) const;
   inline void FindAllExtensions(const Descriptor* extendee,
@@ -604,7 +1148,7 @@ class DescriptorPool::Tables {
   // the key already exists in the table.  For AddSymbol(), the string passed
   // in must be one that was constructed using AllocateString(), as it will
   // be used as a key in the symbols_by_name_ map without copying.
-  bool AddSymbol(const string& full_name, Symbol symbol);
+  bool AddSymbol(const std::string& full_name, Symbol symbol);
   bool AddFile(const FileDescriptor* file);
   bool AddExtension(const FieldDescriptor* field);
 
@@ -615,67 +1159,84 @@ class DescriptorPool::Tables {
   // destroyed.  Note that the object's destructor will never be called,
   // so its fields must be plain old data (primitive data types and
   // pointers).  All of the descriptor types are such objects.
-  template<typename Type> Type* Allocate();
+  template <typename Type>
+  Type* Allocate();
 
   // Allocate an array of objects which will be reclaimed when the
   // pool in destroyed.  Again, destructors are never called.
-  template<typename Type> Type* AllocateArray(int count);
+  template <typename Type>
+  Type* AllocateArray(int count);
 
   // Allocate a string which will be destroyed when the pool is destroyed.
   // The string is initialized to the given value for convenience.
-  string* AllocateString(const string& value);
-
-  // Allocate a GoogleOnceDynamic which will be destroyed when the pool is
-  // destroyed.
-  GoogleOnceDynamic* AllocateOnceDynamic();
+  const std::string* AllocateString(StringPiece value);
+
+  // Copy the input into a NUL terminated string whose lifetime is managed by
+  // the pool.
+  const char* Strdup(StringPiece value);
+
+  // Allocates an array of strings which will be destroyed when the pool is
+  // destroyed. The array is initialized with the input values.
+  template <typename... In>
+  const std::string* AllocateStringArray(In&&... values);
+
+  struct FieldNamesResult {
+    std::string* array;
+    int lowercase_index;
+    int camelcase_index;
+    int json_index;
+  };
+  // Allocate all 5 names of the field:
+  // name, full name, lowercase, camelcase and json.
+  // This function will dedup the strings when possible.
+  // The resulting array contains `name` at index 0, `full_name` at index 1 and
+  // the other 3 indices are specified in the result.
+  FieldNamesResult AllocateFieldNames(const std::string& name,
+                                      const std::string& scope,
+                                      const std::string* opt_json_name);
+
+  // Create an object that will be deleted when the pool is destroyed.
+  // The object is value initialized, and its destructor will be called if
+  // non-trivial.
+  template <typename Type>
+  Type* Create();
 
   // Allocate a protocol message object.  Some older versions of GCC have
   // trouble understanding explicit template instantiations in some cases, so
   // in those cases we have to pass a dummy pointer of the right type as the
   // parameter instead of specifying the type explicitly.
-  template<typename Type> Type* AllocateMessage(Type* dummy = NULL);
+  template <typename Type>
+  Type* AllocateMessage(Type* dummy = nullptr);
 
   // Allocate a FileDescriptorTables object.
   FileDescriptorTables* AllocateFileTables();
 
  private:
-  std::vector<string*> strings_;    // All strings in the pool.
-  std::vector<Message*> messages_;  // All messages in the pool.
-  std::vector<GoogleOnceDynamic*>
-      once_dynamics_;  // All GoogleOnceDynamics in the pool.
-  std::vector<FileDescriptorTables*>
-      file_tables_;                 // All file tables in the pool.
-  std::vector<void*> allocations_;  // All other memory allocated in the pool.
-
-  SymbolsByNameMap      symbols_by_name_;
-  FilesByNameMap        files_by_name_;
+  // All other memory allocated in the pool.  Must be first as other objects can
+  // point into these.
+  TableArena arena_;
+
+  SymbolsByNameSet symbols_by_name_;
+  FilesByNameMap files_by_name_;
   ExtensionsGroupedByDescriptorMap extensions_;
 
   struct CheckPoint {
     explicit CheckPoint(const Tables* tables)
-        : strings_before_checkpoint(tables->strings_.size()),
-          messages_before_checkpoint(tables->messages_.size()),
-          once_dynamics_before_checkpoint(tables->once_dynamics_.size()),
-          file_tables_before_checkpoint(tables->file_tables_.size()),
-          allocations_before_checkpoint(tables->allocations_.size()),
+        : arena_before_checkpoint(tables->arena_.num_allocations()),
           pending_symbols_before_checkpoint(
               tables->symbols_after_checkpoint_.size()),
           pending_files_before_checkpoint(
               tables->files_after_checkpoint_.size()),
           pending_extensions_before_checkpoint(
               tables->extensions_after_checkpoint_.size()) {}
-    int strings_before_checkpoint;
-    int messages_before_checkpoint;
-    int once_dynamics_before_checkpoint;
-    int file_tables_before_checkpoint;
-    int allocations_before_checkpoint;
+    int arena_before_checkpoint;
     int pending_symbols_before_checkpoint;
     int pending_files_before_checkpoint;
     int pending_extensions_before_checkpoint;
   };
   std::vector<CheckPoint> checkpoints_;
-  std::vector<const char*      > symbols_after_checkpoint_;
-  std::vector<const char*      > files_after_checkpoint_;
+  std::vector<const char*> symbols_after_checkpoint_;
+  std::vector<const char*> files_after_checkpoint_;
   std::vector<DescriptorIntPair> extensions_after_checkpoint_;
 
   // Allocate some bytes which will be reclaimed when the pool is
@@ -703,23 +1264,19 @@ class FileDescriptorTables {
   // -----------------------------------------------------------------
   // Finding items.
 
-  // Find symbols.  These return a null Symbol (symbol.IsNull() is true)
-  // if not found.
+  // Returns a null Symbol (symbol.IsNull() is true) if not found.
   inline Symbol FindNestedSymbol(const void* parent,
-                                 const string& name) const;
-  inline Symbol FindNestedSymbolOfType(const void* parent,
-                                       const string& name,
-                                       const Symbol::Type type) const;
-
-  // These return NULL if not found.
-  inline const FieldDescriptor* FindFieldByNumber(
-    const Descriptor* parent, int number) const;
+                                 StringPiece name) const;
+
+  // These return nullptr if not found.
+  inline const FieldDescriptor* FindFieldByNumber(const Descriptor* parent,
+                                                  int number) const;
   inline const FieldDescriptor* FindFieldByLowercaseName(
-    const void* parent, const string& lowercase_name) const;
+      const void* parent, StringPiece lowercase_name) const;
   inline const FieldDescriptor* FindFieldByCamelcaseName(
-    const void* parent, const string& camelcase_name) const;
+      const void* parent, StringPiece camelcase_name) const;
   inline const EnumValueDescriptor* FindEnumValueByNumber(
-    const EnumDescriptor* parent, int number) const;
+      const EnumDescriptor* parent, int number) const;
   // This creates a new EnumValueDescriptor if not found, in a thread-safe way.
   inline const EnumValueDescriptor* FindEnumValueByNumberCreatingIfUnknown(
       const EnumDescriptor* parent, int number) const;
@@ -731,22 +1288,22 @@ class FileDescriptorTables {
   // the key already exists in the table.  For AddAliasUnderParent(), the
   // string passed in must be one that was constructed using AllocateString(),
   // as it will be used as a key in the symbols_by_parent_ map without copying.
-  bool AddAliasUnderParent(const void* parent, const string& name,
+  bool AddAliasUnderParent(const void* parent, const std::string& name,
                            Symbol symbol);
-  bool AddFieldByNumber(const FieldDescriptor* field);
-  bool AddEnumValueByNumber(const EnumValueDescriptor* value);
+  bool AddFieldByNumber(FieldDescriptor* field);
+  bool AddEnumValueByNumber(EnumValueDescriptor* value);
 
   // Adds the field to the lowercase_name and camelcase_name maps.  Never
   // fails because we allow duplicates; the first field by the name wins.
   void AddFieldByStylizedNames(const FieldDescriptor* field);
 
   // Populates p->first->locations_by_path_ from p->second.
-  // Unusual signature dictated by GoogleOnceDynamic.
+  // Unusual signature dictated by internal::call_once.
   static void BuildLocationsByPath(
       std::pair<const FileDescriptorTables*, const SourceCodeInfo*>* p);
 
   // Returns the location denoted by the specified path through info,
-  // or NULL if not found.
+  // or nullptr if not found.
   // The value of info must be that of the corresponding FileDescriptor.
   // (Conceptually a pure function, but stateful as an optimisation.)
   const SourceCodeInfo_Location* GetSourceLocation(
@@ -765,88 +1322,60 @@ class FileDescriptorTables {
       const FileDescriptorTables* tables);
   void FieldsByCamelcaseNamesLazyInitInternal() const;
 
-  SymbolsByParentMap symbols_by_parent_;
+  SymbolsByParentSet symbols_by_parent_;
   mutable FieldsByNameMap fields_by_lowercase_name_;
-  mutable FieldsByNameMap* fields_by_lowercase_name_tmp_;
-  mutable GoogleOnceDynamic fields_by_lowercase_name_once_;
+  std::unique_ptr<FieldsByNameMap> fields_by_lowercase_name_tmp_;
+  mutable internal::once_flag 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_);
+  std::unique_ptr<FieldsByNameMap> fields_by_camelcase_name_tmp_;
+  mutable internal::once_flag fields_by_camelcase_name_once_;
+  FieldsByNumberSet fields_by_number_;  // Not including extensions.
+  EnumValuesByNumberSet enum_values_by_number_;
+  mutable EnumValuesByNumberSet unknown_enum_values_by_number_
+      PROTOBUF_GUARDED_BY(unknown_enum_values_mu_);
 
   // Populated on first request to save space, hence constness games.
-  mutable GoogleOnceDynamic locations_by_path_once_;
+  mutable internal::once_flag locations_by_path_once_;
   mutable LocationsByPathMap locations_by_path_;
 
   // Mutex to protect the unknown-enum-value map due to dynamic
   // EnumValueDescriptor creation on unknown values.
-  mutable Mutex unknown_enum_values_mu_;
+  mutable internal::WrappedMutex unknown_enum_values_mu_;
 };
 
-DescriptorPool::Tables::Tables()
-    // Start some hash_map and hash_set objects with a small # of buckets
-    : known_bad_files_(3),
-      known_bad_symbols_(3),
-      extensions_loaded_from_db_(3),
-      symbols_by_name_(3),
-      files_by_name_(3) {}
-
-
-DescriptorPool::Tables::~Tables() {
-  GOOGLE_DCHECK(checkpoints_.empty());
-  // Note that the deletion order is important, since the destructors of some
-  // messages may refer to objects in allocations_.
-  STLDeleteElements(&messages_);
-  for (int i = 0; i < allocations_.size(); i++) {
-    operator delete(allocations_[i]);
-  }
-  STLDeleteElements(&strings_);
-  STLDeleteElements(&file_tables_);
-  STLDeleteElements(&once_dynamics_);
-}
+DescriptorPool::Tables::Tables() {
+  well_known_types_.insert({
+      {"google.protobuf.DoubleValue", Descriptor::WELLKNOWNTYPE_DOUBLEVALUE},
+      {"google.protobuf.FloatValue", Descriptor::WELLKNOWNTYPE_FLOATVALUE},
+      {"google.protobuf.Int64Value", Descriptor::WELLKNOWNTYPE_INT64VALUE},
+      {"google.protobuf.UInt64Value", Descriptor::WELLKNOWNTYPE_UINT64VALUE},
+      {"google.protobuf.Int32Value", Descriptor::WELLKNOWNTYPE_INT32VALUE},
+      {"google.protobuf.UInt32Value", Descriptor::WELLKNOWNTYPE_UINT32VALUE},
+      {"google.protobuf.StringValue", Descriptor::WELLKNOWNTYPE_STRINGVALUE},
+      {"google.protobuf.BytesValue", Descriptor::WELLKNOWNTYPE_BYTESVALUE},
+      {"google.protobuf.BoolValue", Descriptor::WELLKNOWNTYPE_BOOLVALUE},
+      {"google.protobuf.Any", Descriptor::WELLKNOWNTYPE_ANY},
+      {"google.protobuf.FieldMask", Descriptor::WELLKNOWNTYPE_FIELDMASK},
+      {"google.protobuf.Duration", Descriptor::WELLKNOWNTYPE_DURATION},
+      {"google.protobuf.Timestamp", Descriptor::WELLKNOWNTYPE_TIMESTAMP},
+      {"google.protobuf.Value", Descriptor::WELLKNOWNTYPE_VALUE},
+      {"google.protobuf.ListValue", Descriptor::WELLKNOWNTYPE_LISTVALUE},
+      {"google.protobuf.Struct", Descriptor::WELLKNOWNTYPE_STRUCT},
+  });
+}
+
+DescriptorPool::Tables::~Tables() { GOOGLE_DCHECK(checkpoints_.empty()); }
 
 FileDescriptorTables::FileDescriptorTables()
-    // 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),
-      locations_by_path_(3) {}
+    : fields_by_lowercase_name_tmp_(new FieldsByNameMap()),
+      fields_by_camelcase_name_tmp_(new FieldsByNameMap()) {}
 
 FileDescriptorTables::~FileDescriptorTables() {}
 
-namespace {
-
-FileDescriptorTables* file_descriptor_tables_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(file_descriptor_tables_once_init_);
-
-void DeleteFileDescriptorTables() {
-  delete file_descriptor_tables_;
-  file_descriptor_tables_ = NULL;
-}
-
-void InitFileDescriptorTables() {
-  file_descriptor_tables_ = new FileDescriptorTables();
-  internal::OnShutdown(&DeleteFileDescriptorTables);
-}
-
-inline void InitFileDescriptorTablesOnce() {
-  ::google::protobuf::GoogleOnceInit(
-      &file_descriptor_tables_once_init_, &InitFileDescriptorTables);
-}
-
-}  // anonymous namespace
-
 inline const FileDescriptorTables& FileDescriptorTables::GetEmptyInstance() {
-  InitFileDescriptorTablesOnce();
-  return *file_descriptor_tables_;
+  static auto file_descriptor_tables =
+      internal::OnShutdownDelete(new FileDescriptorTables());
+  return *file_descriptor_tables;
 }
 
 void DescriptorPool::Tables::AddCheckpoint() {
@@ -862,6 +1391,7 @@ void DescriptorPool::Tables::ClearLastCheckpoint() {
     symbols_after_checkpoint_.clear();
     files_after_checkpoint_.clear();
     extensions_after_checkpoint_.clear();
+    arena_.ClearRollbackData();
   }
 }
 
@@ -869,19 +1399,18 @@ void DescriptorPool::Tables::RollbackToLastCheckpoint() {
   GOOGLE_DCHECK(!checkpoints_.empty());
   const CheckPoint& checkpoint = checkpoints_.back();
 
-  for (int i = checkpoint.pending_symbols_before_checkpoint;
-       i < symbols_after_checkpoint_.size();
-       i++) {
-    symbols_by_name_.erase(symbols_after_checkpoint_[i]);
+  for (size_t i = checkpoint.pending_symbols_before_checkpoint;
+       i < symbols_after_checkpoint_.size(); i++) {
+    Symbol::QueryKey name;
+    name.name = symbols_after_checkpoint_[i];
+    symbols_by_name_.erase(Symbol(&name));
   }
-  for (int i = checkpoint.pending_files_before_checkpoint;
-       i < files_after_checkpoint_.size();
-       i++) {
+  for (size_t i = checkpoint.pending_files_before_checkpoint;
+       i < files_after_checkpoint_.size(); i++) {
     files_by_name_.erase(files_after_checkpoint_[i]);
   }
-  for (int i = checkpoint.pending_extensions_before_checkpoint;
-       i < extensions_after_checkpoint_.size();
-       i++) {
+  for (size_t i = checkpoint.pending_extensions_before_checkpoint;
+       i < extensions_after_checkpoint_.size(); i++) {
     extensions_.erase(extensions_after_checkpoint_[i]);
   }
 
@@ -891,71 +1420,48 @@ void DescriptorPool::Tables::RollbackToLastCheckpoint() {
   extensions_after_checkpoint_.resize(
       checkpoint.pending_extensions_before_checkpoint);
 
-  STLDeleteContainerPointers(
-      strings_.begin() + checkpoint.strings_before_checkpoint, strings_.end());
-  STLDeleteContainerPointers(
-      messages_.begin() + checkpoint.messages_before_checkpoint,
-      messages_.end());
-  STLDeleteContainerPointers(
-      once_dynamics_.begin() + checkpoint.once_dynamics_before_checkpoint,
-      once_dynamics_.end());
-  STLDeleteContainerPointers(
-      file_tables_.begin() + checkpoint.file_tables_before_checkpoint,
-      file_tables_.end());
-  for (int i = checkpoint.allocations_before_checkpoint;
-       i < allocations_.size();
-       i++) {
-    operator delete(allocations_[i]);
-  }
-
-  strings_.resize(checkpoint.strings_before_checkpoint);
-  messages_.resize(checkpoint.messages_before_checkpoint);
-  once_dynamics_.resize(checkpoint.once_dynamics_before_checkpoint);
-  file_tables_.resize(checkpoint.file_tables_before_checkpoint);
-  allocations_.resize(checkpoint.allocations_before_checkpoint);
+  arena_.RollbackTo(checkpoint.arena_before_checkpoint);
   checkpoints_.pop_back();
 }
 
 // -------------------------------------------------------------------
 
-inline Symbol DescriptorPool::Tables::FindSymbol(const string& key) const {
-  const Symbol* result = FindOrNull(symbols_by_name_, key.c_str());
-  if (result == NULL) {
-    return kNullSymbol;
-  } else {
-    return *result;
-  }
+inline Symbol DescriptorPool::Tables::FindSymbol(StringPiece key) const {
+  Symbol::QueryKey name;
+  name.name = key;
+  auto it = symbols_by_name_.find(Symbol(&name));
+  return it == symbols_by_name_.end() ? kNullSymbol : *it;
 }
 
 inline Symbol FileDescriptorTables::FindNestedSymbol(
-    const void* parent, const string& name) const {
-  const Symbol* result =
-    FindOrNull(symbols_by_parent_, PointerStringPair(parent, name.c_str()));
-  if (result == NULL) {
-    return kNullSymbol;
-  } else {
-    return *result;
-  }
-}
-
-inline Symbol FileDescriptorTables::FindNestedSymbolOfType(
-    const void* parent, const string& name, const Symbol::Type type) const {
-  Symbol result = FindNestedSymbol(parent, name);
-  if (result.type != type) return kNullSymbol;
-  return result;
+    const void* parent, StringPiece name) const {
+  Symbol::QueryKey query;
+  query.name = name;
+  query.parent = parent;
+  auto it = symbols_by_parent_.find(Symbol(&query));
+  return it == symbols_by_parent_.end() ? kNullSymbol : *it;
 }
 
-Symbol DescriptorPool::Tables::FindByNameHelper(
-    const DescriptorPool* pool, const string& name) {
+Symbol DescriptorPool::Tables::FindByNameHelper(const DescriptorPool* pool,
+                                                StringPiece name) {
+  if (pool->mutex_ != nullptr) {
+    // Fast path: the Symbol is already cached.  This is just a hash lookup.
+    ReaderMutexLock lock(pool->mutex_);
+    if (known_bad_symbols_.empty() && known_bad_files_.empty()) {
+      Symbol result = FindSymbol(name);
+      if (!result.IsNull()) return result;
+    }
+  }
   MutexLockMaybe lock(pool->mutex_);
-  known_bad_symbols_.clear();
-  known_bad_files_.clear();
+  if (pool->fallback_database_ != nullptr) {
+    known_bad_symbols_.clear();
+    known_bad_files_.clear();
+  }
   Symbol result = FindSymbol(name);
 
-  if (result.IsNull() && pool->underlay_ != NULL) {
+  if (result.IsNull() && pool->underlay_ != nullptr) {
     // Symbol not found; check the underlay.
-    result =
-      pool->underlay_->tables_->FindByNameHelper(pool->underlay_, name);
+    result = pool->underlay_->tables_->FindByNameHelper(pool->underlay_, name);
   }
 
   if (result.IsNull()) {
@@ -969,19 +1475,31 @@ Symbol DescriptorPool::Tables::FindByNameHelper(
 }
 
 inline const FileDescriptor* DescriptorPool::Tables::FindFile(
-    const string& key) const {
-  return FindPtrOrNull(files_by_name_, key.c_str());
+    StringPiece key) const {
+  return FindPtrOrNull(files_by_name_, key);
 }
 
 inline const FieldDescriptor* FileDescriptorTables::FindFieldByNumber(
     const Descriptor* parent, int number) const {
-  return FindPtrOrNull(fields_by_number_, std::make_pair(parent, number));
+  // If `number` is within the sequential range, just index into the parent
+  // without doing a table lookup.
+  if (parent != nullptr &&  //
+      1 <= number && number <= parent->sequential_field_limit_) {
+    return parent->field(number - 1);
+  }
+
+  Symbol::QueryKey query;
+  query.parent = parent;
+  query.field_number = number;
+
+  auto it = fields_by_number_.find(Symbol(&query));
+  return it == fields_by_number_.end() ? nullptr : it->field_descriptor();
 }
 
 const void* FileDescriptorTables::FindParentForFieldsByMap(
     const FieldDescriptor* field) const {
   if (field->is_extension()) {
-    if (field->extension_scope() == NULL) {
+    if (field->extension_scope() == nullptr) {
       return field->file();
     } else {
       return field->extension_scope();
@@ -997,20 +1515,22 @@ void FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic(
 }
 
 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);
+  for (Symbol symbol : symbols_by_parent_) {
+    const FieldDescriptor* field = symbol.field_descriptor();
+    if (!field) continue;
+    PointerStringPair lowercase_key(FindParentForFieldsByMap(field),
+                                    field->lowercase_name().c_str());
+    InsertIfNotPresent(&fields_by_lowercase_name_, lowercase_key, field);
   }
 }
 
 inline const FieldDescriptor* FileDescriptorTables::FindFieldByLowercaseName(
-    const void* parent, const string& lowercase_name) const {
-  fields_by_lowercase_name_once_.Init(
+    const void* parent, StringPiece lowercase_name) const {
+  internal::call_once(
+      fields_by_lowercase_name_once_,
       &FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic, this);
   return FindPtrOrNull(fields_by_lowercase_name_,
-                       PointerStringPair(parent, lowercase_name.c_str()));
+                            PointerStringPair(parent, lowercase_name));
 }
 
 void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic(
@@ -1019,25 +1539,41 @@ void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic(
 }
 
 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);
+  for (Symbol symbol : symbols_by_parent_) {
+    const FieldDescriptor* field = symbol.field_descriptor();
+    if (!field) continue;
+    PointerStringPair camelcase_key(FindParentForFieldsByMap(field),
+                                    field->camelcase_name().c_str());
+    InsertIfNotPresent(&fields_by_camelcase_name_, camelcase_key, field);
   }
 }
 
 inline const FieldDescriptor* FileDescriptorTables::FindFieldByCamelcaseName(
-    const void* parent, const string& camelcase_name) const {
-  fields_by_camelcase_name_once_.Init(
-      &FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic, this);
+    const void* parent, StringPiece camelcase_name) const {
+  internal::call_once(
+      fields_by_camelcase_name_once_,
+      FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic, this);
   return FindPtrOrNull(fields_by_camelcase_name_,
-                       PointerStringPair(parent, camelcase_name.c_str()));
+                            PointerStringPair(parent, camelcase_name));
 }
 
 inline const EnumValueDescriptor* FileDescriptorTables::FindEnumValueByNumber(
     const EnumDescriptor* parent, int number) const {
-  return FindPtrOrNull(enum_values_by_number_, std::make_pair(parent, number));
+  // If `number` is within the sequential range, just index into the parent
+  // without doing a table lookup.
+  const int base = parent->value(0)->number();
+  if (base <= number &&
+      number <= static_cast<int64_t>(base) + parent->sequential_value_limit_) {
+    return parent->value(number - base);
+  }
+
+  Symbol::QueryKey query;
+  query.parent = parent;
+  query.field_number = number;
+
+  auto it = enum_values_by_number_.find(Symbol(&query));
+  return it == enum_values_by_number_.end() ? nullptr
+                                            : it->enum_value_descriptor();
 }
 
 inline const EnumValueDescriptor*
@@ -1045,54 +1581,60 @@ FileDescriptorTables::FindEnumValueByNumberCreatingIfUnknown(
     const EnumDescriptor* parent, int number) const {
   // First try, with map of compiled-in values.
   {
-    const EnumValueDescriptor* desc =
-        FindPtrOrNull(enum_values_by_number_, std::make_pair(parent, number));
-    if (desc != NULL) {
-      return desc;
+    const auto* value = FindEnumValueByNumber(parent, number);
+    if (value != nullptr) {
+      return value;
     }
   }
+
+  Symbol::QueryKey query;
+  query.parent = parent;
+  query.field_number = number;
+
   // Second try, with reader lock held on unknown enum values: common case.
   {
     ReaderMutexLock l(&unknown_enum_values_mu_);
-    const EnumValueDescriptor* desc = FindPtrOrNull(
-        unknown_enum_values_by_number_, std::make_pair(parent, number));
-    if (desc != NULL) {
-      return desc;
+    auto it = unknown_enum_values_by_number_.find(Symbol(&query));
+    if (it != unknown_enum_values_by_number_.end() &&
+        it->enum_value_descriptor() != nullptr) {
+      return it->enum_value_descriptor();
     }
   }
   // If not found, try again with writer lock held, and create new descriptor if
   // necessary.
   {
     WriterMutexLock l(&unknown_enum_values_mu_);
-    const EnumValueDescriptor* desc = FindPtrOrNull(
-        unknown_enum_values_by_number_, std::make_pair(parent, number));
-    if (desc != NULL) {
-      return desc;
+    auto it = unknown_enum_values_by_number_.find(Symbol(&query));
+    if (it != unknown_enum_values_by_number_.end() &&
+        it->enum_value_descriptor() != nullptr) {
+      return it->enum_value_descriptor();
     }
 
     // Create an EnumValueDescriptor dynamically. We don't insert it into the
     // EnumDescriptor (it's not a part of the enum as originally defined), but
     // we do insert it into the table so that we can return the same pointer
     // later.
-    string enum_value_name = StringPrintf(
-        "UNKNOWN_ENUM_VALUE_%s_%d", parent->name().c_str(), number);
-    DescriptorPool::Tables* tables =
-        const_cast<DescriptorPool::Tables*>(DescriptorPool::generated_pool()->
-                                            tables_.get());
-    EnumValueDescriptor* result = tables->Allocate<EnumValueDescriptor>();
-    result->name_ = tables->AllocateString(enum_value_name);
-    result->full_name_ = tables->AllocateString(parent->full_name() +
-                                                "." + enum_value_name);
+    std::string enum_value_name = StringPrintf("UNKNOWN_ENUM_VALUE_%s_%d",
+                                               parent->name().c_str(), number);
+    auto* pool = DescriptorPool::generated_pool();
+    auto* tables = const_cast<DescriptorPool::Tables*>(pool->tables_.get());
+    EnumValueDescriptor* result;
+    {
+      // Must lock the pool because we will do allocations in the shared arena.
+      MutexLockMaybe l2(pool->mutex_);
+      result = tables->Allocate<EnumValueDescriptor>();
+      result->all_names_ = tables->AllocateStringArray(
+          enum_value_name,
+          StrCat(parent->full_name(), ".", enum_value_name));
+    }
     result->number_ = number;
     result->type_ = parent;
     result->options_ = &EnumValueOptions::default_instance();
-    InsertIfNotPresent(&unknown_enum_values_by_number_,
-                       std::make_pair(parent, number), result);
+    unknown_enum_values_by_number_.insert(Symbol::EnumValue(result, 0));
     return result;
   }
 }
 
-
 inline const FieldDescriptor* DescriptorPool::Tables::FindExtension(
     const Descriptor* extendee, int number) const {
   return FindPtrOrNull(extensions_, std::make_pair(extendee, number));
@@ -1110,9 +1652,10 @@ inline void DescriptorPool::Tables::FindAllExtensions(
 
 // -------------------------------------------------------------------
 
-bool DescriptorPool::Tables::AddSymbol(
-    const string& full_name, Symbol symbol) {
-  if (InsertIfNotPresent(&symbols_by_name_, full_name.c_str(), symbol)) {
+bool DescriptorPool::Tables::AddSymbol(const std::string& full_name,
+                                       Symbol symbol) {
+  GOOGLE_DCHECK_EQ(full_name, symbol.full_name());
+  if (symbols_by_name_.insert(symbol).second) {
     symbols_after_checkpoint_.push_back(full_name.c_str());
     return true;
   } else {
@@ -1120,14 +1663,16 @@ bool DescriptorPool::Tables::AddSymbol(
   }
 }
 
-bool FileDescriptorTables::AddAliasUnderParent(
-    const void* parent, const string& name, Symbol symbol) {
-  PointerStringPair by_parent_key(parent, name.c_str());
-  return InsertIfNotPresent(&symbols_by_parent_, by_parent_key, symbol);
+bool FileDescriptorTables::AddAliasUnderParent(const void* parent,
+                                               const std::string& name,
+                                               Symbol symbol) {
+  GOOGLE_DCHECK_EQ(name, symbol.parent_name_key().second);
+  GOOGLE_DCHECK_EQ(parent, symbol.parent_name_key().first);
+  return symbols_by_parent_.insert(symbol).second;
 }
 
 bool DescriptorPool::Tables::AddFile(const FileDescriptor* file) {
-  if (InsertIfNotPresent(&files_by_name_, file->name().c_str(), file)) {
+  if (InsertIfNotPresent(&files_by_name_, file->name(), file)) {
     files_after_checkpoint_.push_back(file->name().c_str());
     return true;
   } else {
@@ -1137,10 +1682,8 @@ 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;
+  fields_by_lowercase_name_tmp_ = nullptr;
+  fields_by_camelcase_name_tmp_ = nullptr;
 }
 
 void FileDescriptorTables::AddFieldByStylizedNames(
@@ -1155,31 +1698,46 @@ void FileDescriptorTables::AddFieldByStylizedNames(
   // entries from fields_by_number_.
 
   PointerStringPair lowercase_key(parent, field->lowercase_name().c_str());
-  if (!InsertIfNotPresent(fields_by_lowercase_name_tmp_, lowercase_key,
-                          field)) {
+  if (!InsertIfNotPresent(fields_by_lowercase_name_tmp_.get(),
+                               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());
-  if (!InsertIfNotPresent(fields_by_camelcase_name_tmp_, camelcase_key,
-                          field)) {
+  if (!InsertIfNotPresent(fields_by_camelcase_name_tmp_.get(),
+                               camelcase_key, field)) {
     InsertIfNotPresent(
         &fields_by_camelcase_name_, camelcase_key,
         FindPtrOrNull(*fields_by_camelcase_name_tmp_, camelcase_key));
   }
 }
 
-bool FileDescriptorTables::AddFieldByNumber(const FieldDescriptor* field) {
-  DescriptorIntPair key(field->containing_type(), field->number());
-  return InsertIfNotPresent(&fields_by_number_, key, field);
+bool FileDescriptorTables::AddFieldByNumber(FieldDescriptor* field) {
+  // Skip fields that are at the start of the sequence.
+  if (field->containing_type() != nullptr && field->number() >= 1 &&
+      field->number() <= field->containing_type()->sequential_field_limit_) {
+    if (field->is_extension()) {
+      // Conflicts with the field that already exists in the sequential range.
+      return false;
+    }
+    // Only return true if the field at that index matches. Otherwise it
+    // conflicts with the existing field in the sequential range.
+    return field->containing_type()->field(field->number() - 1) == field;
+  }
+
+  return fields_by_number_.insert(Symbol(field)).second;
 }
 
-bool FileDescriptorTables::AddEnumValueByNumber(
-    const EnumValueDescriptor* value) {
-  EnumIntPair key(value->type(), value->number());
-  return InsertIfNotPresent(&enum_values_by_number_, key, value);
+bool FileDescriptorTables::AddEnumValueByNumber(EnumValueDescriptor* value) {
+  // Skip values that are at the start of the sequence.
+  const int base = value->type()->value(0)->number();
+  if (base <= value->number() &&
+      value->number() <=
+          static_cast<int64_t>(base) + value->type()->sequential_value_limit_)
+    return true;
+  return enum_values_by_number_.insert(Symbol::EnumValue(value, 0)).second;
 }
 
 bool DescriptorPool::Tables::AddExtension(const FieldDescriptor* field) {
@@ -1194,51 +1752,125 @@ bool DescriptorPool::Tables::AddExtension(const FieldDescriptor* field) {
 
 // -------------------------------------------------------------------
 
-template<typename Type>
+template <typename Type>
 Type* DescriptorPool::Tables::Allocate() {
   return reinterpret_cast<Type*>(AllocateBytes(sizeof(Type)));
 }
 
-template<typename Type>
+template <typename Type>
 Type* DescriptorPool::Tables::AllocateArray(int count) {
   return reinterpret_cast<Type*>(AllocateBytes(sizeof(Type) * count));
 }
 
-string* DescriptorPool::Tables::AllocateString(const string& value) {
-  string* result = new string(value);
-  strings_.push_back(result);
-  return result;
+const std::string* DescriptorPool::Tables::AllocateString(
+    StringPiece value) {
+  return arena_.Create<std::string>(value);
 }
 
-GoogleOnceDynamic* DescriptorPool::Tables::AllocateOnceDynamic() {
-  GoogleOnceDynamic* result = new GoogleOnceDynamic();
-  once_dynamics_.push_back(result);
+const char* DescriptorPool::Tables::Strdup(StringPiece value) {
+  char* p = AllocateArray<char>(static_cast<int>(value.size() + 1));
+  memcpy(p, value.data(), value.size());
+  p[value.size()] = 0;
+  return p;
+}
+
+template <typename... In>
+const std::string* DescriptorPool::Tables::AllocateStringArray(In&&... values) {
+  auto& array = *arena_.Create<std::array<std::string, sizeof...(In)>>();
+  array = {{std::string(std::forward<In>(values))...}};
+  return array.data();
+}
+
+DescriptorPool::Tables::FieldNamesResult
+DescriptorPool::Tables::AllocateFieldNames(const std::string& name,
+                                           const std::string& scope,
+                                           const std::string* opt_json_name) {
+  std::string lowercase_name = name;
+  LowerString(&lowercase_name);
+
+  std::string camelcase_name = ToCamelCase(name, /* lower_first = */ true);
+  std::string json_name;
+  if (opt_json_name != nullptr) {
+    json_name = *opt_json_name;
+  } else {
+    json_name = ToJsonName(name);
+  }
+
+  const bool lower_eq_name = lowercase_name == name;
+  const bool camel_eq_name = camelcase_name == name;
+  const bool json_eq_name = json_name == name;
+  const bool json_eq_camel = json_name == camelcase_name;
+
+  const int total_count = 2 + (lower_eq_name ? 0 : 1) +
+                          (camel_eq_name ? 0 : 1) +
+                          (json_eq_name || json_eq_camel ? 0 : 1);
+  FieldNamesResult result{nullptr, 0, 0, 0};
+  // We use std::array to allow handling of the destruction of the strings.
+  switch (total_count) {
+    case 2:
+      result.array = arena_.Create<std::array<std::string, 2>>()->data();
+      break;
+    case 3:
+      result.array = arena_.Create<std::array<std::string, 3>>()->data();
+      break;
+    case 4:
+      result.array = arena_.Create<std::array<std::string, 4>>()->data();
+      break;
+    case 5:
+      result.array = arena_.Create<std::array<std::string, 5>>()->data();
+      break;
+  }
+
+  result.array[0] = name;
+  if (scope.empty()) {
+    result.array[1] = name;
+  } else {
+    result.array[1] = StrCat(scope, ".", name);
+  }
+  int index = 2;
+  if (lower_eq_name) {
+    result.lowercase_index = 0;
+  } else {
+    result.lowercase_index = index;
+    result.array[index++] = std::move(lowercase_name);
+  }
+
+  if (camel_eq_name) {
+    result.camelcase_index = 0;
+  } else {
+    result.camelcase_index = index;
+    result.array[index++] = std::move(camelcase_name);
+  }
+
+  if (json_eq_name) {
+    result.json_index = 0;
+  } else if (json_eq_camel) {
+    result.json_index = result.camelcase_index;
+  } else {
+    result.json_index = index;
+    result.array[index] = std::move(json_name);
+  }
+
   return result;
 }
 
-template<typename Type>
+template <typename Type>
+Type* DescriptorPool::Tables::Create() {
+  return arena_.Create<Type>();
+}
+
+template <typename Type>
 Type* DescriptorPool::Tables::AllocateMessage(Type* /* dummy */) {
-  Type* result = new Type;
-  messages_.push_back(result);
-  return result;
+  return arena_.Create<Type>();
 }
 
 FileDescriptorTables* DescriptorPool::Tables::AllocateFileTables() {
-  FileDescriptorTables* result = new FileDescriptorTables;
-  file_tables_.push_back(result);
-  return result;
+  return arena_.Create<FileDescriptorTables>();
 }
 
 void* DescriptorPool::Tables::AllocateBytes(int size) {
-  // TODO(kenton):  Would it be worthwhile to implement this in some more
-  // sophisticated way?  Probably not for the open source release, but for
-  // internal use we could easily plug in one of our existing memory pool
-  // allocators...
-  if (size == 0) return NULL;
-
-  void* result = operator new(size);
-  allocations_.push_back(result);
-  return result;
+  if (size == 0) return nullptr;
+  return arena_.AllocateMemory(size);
 }
 
 void FileDescriptorTables::BuildLocationsByPath(
@@ -1253,7 +1885,8 @@ const SourceCodeInfo_Location* FileDescriptorTables::GetSourceLocation(
     const std::vector<int>& path, const SourceCodeInfo* info) const {
   std::pair<const FileDescriptorTables*, const SourceCodeInfo*> p(
       std::make_pair(this, info));
-  locations_by_path_once_.Init(&FileDescriptorTables::BuildLocationsByPath, &p);
+  internal::call_once(locations_by_path_once_,
+                      FileDescriptorTables::BuildLocationsByPath, &p);
   return FindPtrOrNull(locations_by_path_, Join(path, ","));
 }
 
@@ -1263,45 +1896,44 @@ const SourceCodeInfo_Location* FileDescriptorTables::GetSourceLocation(
 DescriptorPool::ErrorCollector::~ErrorCollector() {}
 
 DescriptorPool::DescriptorPool()
-  : mutex_(NULL),
-    fallback_database_(NULL),
-    default_error_collector_(NULL),
-    underlay_(NULL),
-    tables_(new Tables),
-    enforce_dependencies_(true),
-    lazily_build_dependencies_(false),
-    allow_unknown_(false),
-    enforce_weak_(false),
-    disallow_enforce_utf8_(false) {}
+    : mutex_(nullptr),
+      fallback_database_(nullptr),
+      default_error_collector_(nullptr),
+      underlay_(nullptr),
+      tables_(new Tables),
+      enforce_dependencies_(true),
+      lazily_build_dependencies_(false),
+      allow_unknown_(false),
+      enforce_weak_(false),
+      disallow_enforce_utf8_(false) {}
 
 DescriptorPool::DescriptorPool(DescriptorDatabase* fallback_database,
                                ErrorCollector* error_collector)
-  : mutex_(new Mutex),
-    fallback_database_(fallback_database),
-    default_error_collector_(error_collector),
-    underlay_(NULL),
-    tables_(new Tables),
-    enforce_dependencies_(true),
-    lazily_build_dependencies_(false),
-    allow_unknown_(false),
-    enforce_weak_(false),
-    disallow_enforce_utf8_(false) {
-}
+    : mutex_(new internal::WrappedMutex),
+      fallback_database_(fallback_database),
+      default_error_collector_(error_collector),
+      underlay_(nullptr),
+      tables_(new Tables),
+      enforce_dependencies_(true),
+      lazily_build_dependencies_(false),
+      allow_unknown_(false),
+      enforce_weak_(false),
+      disallow_enforce_utf8_(false) {}
 
 DescriptorPool::DescriptorPool(const DescriptorPool* underlay)
-  : mutex_(NULL),
-    fallback_database_(NULL),
-    default_error_collector_(NULL),
-    underlay_(underlay),
-    tables_(new Tables),
-    enforce_dependencies_(true),
-    lazily_build_dependencies_(false),
-    allow_unknown_(false),
-    enforce_weak_(false),
-    disallow_enforce_utf8_(false) {}
+    : mutex_(nullptr),
+      fallback_database_(nullptr),
+      default_error_collector_(nullptr),
+      underlay_(underlay),
+      tables_(new Tables),
+      enforce_dependencies_(true),
+      lazily_build_dependencies_(false),
+      allow_unknown_(false),
+      enforce_weak_(false),
+      disallow_enforce_utf8_(false) {}
 
 DescriptorPool::~DescriptorPool() {
-  if (mutex_ != NULL) delete mutex_;
+  if (mutex_ != nullptr) delete mutex_;
 }
 
 // DescriptorPool::BuildFile() defined later.
@@ -1311,17 +1943,18 @@ void DescriptorPool::InternalDontEnforceDependencies() {
   enforce_dependencies_ = false;
 }
 
-void DescriptorPool::AddUnusedImportTrackFile(const string& file_name) {
-  unused_import_track_files_.insert(file_name);
+void DescriptorPool::AddUnusedImportTrackFile(ConstStringParam file_name,
+                                              bool is_error) {
+  unused_import_track_files_[std::string(file_name)] = is_error;
 }
 
 void DescriptorPool::ClearUnusedImportTrackFiles() {
   unused_import_track_files_.clear();
 }
 
-bool DescriptorPool::InternalIsFileLoaded(const string& filename) const {
+bool DescriptorPool::InternalIsFileLoaded(ConstStringParam filename) const {
   MutexLockMaybe lock(mutex_);
-  return tables_->FindFile(filename) != NULL;
+  return tables_->FindFile(filename) != nullptr;
 }
 
 // generated_pool ====================================================
@@ -1329,43 +1962,38 @@ bool DescriptorPool::InternalIsFileLoaded(const string& filename) const {
 namespace {
 
 
-EncodedDescriptorDatabase* generated_database_ = NULL;
-DescriptorPool* generated_pool_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(generated_pool_init_);
+EncodedDescriptorDatabase* GeneratedDatabase() {
+  static auto generated_database =
+      internal::OnShutdownDelete(new EncodedDescriptorDatabase());
+  return generated_database;
+}
 
-void DeleteGeneratedPool() {
-  delete generated_database_;
-  generated_database_ = NULL;
-  delete generated_pool_;
-  generated_pool_ = NULL;
+DescriptorPool* NewGeneratedPool() {
+  auto generated_pool = new DescriptorPool(GeneratedDatabase());
+  generated_pool->InternalSetLazilyBuildDependencies();
+  return generated_pool;
 }
 
-static void InitGeneratedPool() {
-  generated_database_ = new EncodedDescriptorDatabase;
-  generated_pool_ = new DescriptorPool(generated_database_);
-  generated_pool_->InternalSetLazilyBuildDependencies();
+}  // anonymous namespace
 
-  internal::OnShutdown(&DeleteGeneratedPool);
+DescriptorDatabase* DescriptorPool::internal_generated_database() {
+  return GeneratedDatabase();
 }
 
-inline void InitGeneratedPoolOnce() {
-  ::google::protobuf::GoogleOnceInit(&generated_pool_init_, &InitGeneratedPool);
+DescriptorPool* DescriptorPool::internal_generated_pool() {
+  static DescriptorPool* generated_pool =
+      internal::OnShutdownDelete(NewGeneratedPool());
+  return generated_pool;
 }
 
-}  // anonymous namespace
-
 const DescriptorPool* DescriptorPool::generated_pool() {
-  InitGeneratedPoolOnce();
-  return generated_pool_;
+  const DescriptorPool* pool = internal_generated_pool();
+  // Ensure that descriptor.proto has been registered in the generated pool.
+  DescriptorProto::descriptor();
+  return pool;
 }
 
 
-
-DescriptorPool* DescriptorPool::internal_generated_pool() {
-  InitGeneratedPoolOnce();
-  return generated_pool_;
-}
-
 void DescriptorPool::InternalAddGeneratedFile(
     const void* encoded_file_descriptor, int size) {
   // So, this function is called in the process of initializing the
@@ -1390,8 +2018,7 @@ void DescriptorPool::InternalAddGeneratedFile(
   // Therefore, when we parse one, we have to be very careful to avoid using
   // any descriptor-based operations, since this might cause infinite recursion
   // or deadlock.
-  InitGeneratedPoolOnce();
-  GOOGLE_CHECK(generated_database_->Add(encoded_file_descriptor, size));
+  GOOGLE_CHECK(GeneratedDatabase()->Add(encoded_file_descriptor, size));
 }
 
 
@@ -1401,149 +2028,195 @@ void DescriptorPool::InternalAddGeneratedFile(
 //   there's any good way to factor it out.  Think about this some time when
 //   there's nothing more important to do (read: never).
 
-const FileDescriptor* DescriptorPool::FindFileByName(const string& name) const {
+const FileDescriptor* DescriptorPool::FindFileByName(
+    ConstStringParam name) const {
   MutexLockMaybe lock(mutex_);
-  tables_->known_bad_symbols_.clear();
-  tables_->known_bad_files_.clear();
+  if (fallback_database_ != nullptr) {
+    tables_->known_bad_symbols_.clear();
+    tables_->known_bad_files_.clear();
+  }
   const FileDescriptor* result = tables_->FindFile(name);
-  if (result != NULL) return result;
-  if (underlay_ != NULL) {
+  if (result != nullptr) return result;
+  if (underlay_ != nullptr) {
     result = underlay_->FindFileByName(name);
-    if (result != NULL) return result;
+    if (result != nullptr) return result;
   }
   if (TryFindFileInFallbackDatabase(name)) {
     result = tables_->FindFile(name);
-    if (result != NULL) return result;
+    if (result != nullptr) return result;
   }
-  return NULL;
+  return nullptr;
 }
 
 const FileDescriptor* DescriptorPool::FindFileContainingSymbol(
-    const string& symbol_name) const {
+    ConstStringParam symbol_name) const {
   MutexLockMaybe lock(mutex_);
-  tables_->known_bad_symbols_.clear();
-  tables_->known_bad_files_.clear();
+  if (fallback_database_ != nullptr) {
+    tables_->known_bad_symbols_.clear();
+    tables_->known_bad_files_.clear();
+  }
   Symbol result = tables_->FindSymbol(symbol_name);
   if (!result.IsNull()) return result.GetFile();
-  if (underlay_ != NULL) {
+  if (underlay_ != nullptr) {
     const FileDescriptor* file_result =
-      underlay_->FindFileContainingSymbol(symbol_name);
-    if (file_result != NULL) return file_result;
+        underlay_->FindFileContainingSymbol(symbol_name);
+    if (file_result != nullptr) return file_result;
   }
   if (TryFindSymbolInFallbackDatabase(symbol_name)) {
     result = tables_->FindSymbol(symbol_name);
     if (!result.IsNull()) return result.GetFile();
   }
-  return NULL;
+  return nullptr;
 }
 
 const Descriptor* DescriptorPool::FindMessageTypeByName(
-    const string& name) const {
-  Symbol result = tables_->FindByNameHelper(this, name);
-  return (result.type == Symbol::MESSAGE) ? result.descriptor : NULL;
+    ConstStringParam name) const {
+  return tables_->FindByNameHelper(this, name).descriptor();
 }
 
 const FieldDescriptor* DescriptorPool::FindFieldByName(
-    const string& name) const {
-  Symbol result = tables_->FindByNameHelper(this, name);
-  if (result.type == Symbol::FIELD &&
-      !result.field_descriptor->is_extension()) {
-    return result.field_descriptor;
-  } else {
-    return NULL;
+    ConstStringParam name) const {
+  if (const FieldDescriptor* field =
+          tables_->FindByNameHelper(this, name).field_descriptor()) {
+    if (!field->is_extension()) {
+      return field;
+    }
   }
+  return nullptr;
 }
 
 const FieldDescriptor* DescriptorPool::FindExtensionByName(
-    const string& name) const {
-  Symbol result = tables_->FindByNameHelper(this, name);
-  if (result.type == Symbol::FIELD &&
-      result.field_descriptor->is_extension()) {
-    return result.field_descriptor;
-  } else {
-    return NULL;
+    ConstStringParam name) const {
+  if (const FieldDescriptor* field =
+          tables_->FindByNameHelper(this, name).field_descriptor()) {
+    if (field->is_extension()) {
+      return field;
+    }
   }
+  return nullptr;
 }
 
 const OneofDescriptor* DescriptorPool::FindOneofByName(
-    const string& name) const {
-  Symbol result = tables_->FindByNameHelper(this, name);
-  return (result.type == Symbol::ONEOF) ? result.oneof_descriptor : NULL;
+    ConstStringParam name) const {
+  return tables_->FindByNameHelper(this, name).oneof_descriptor();
 }
 
 const EnumDescriptor* DescriptorPool::FindEnumTypeByName(
-    const string& name) const {
-  Symbol result = tables_->FindByNameHelper(this, name);
-  return (result.type == Symbol::ENUM) ? result.enum_descriptor : NULL;
+    ConstStringParam name) const {
+  return tables_->FindByNameHelper(this, name).enum_descriptor();
 }
 
 const EnumValueDescriptor* DescriptorPool::FindEnumValueByName(
-    const string& name) const {
-  Symbol result = tables_->FindByNameHelper(this, name);
-  return (result.type == Symbol::ENUM_VALUE) ?
-    result.enum_value_descriptor : NULL;
+    ConstStringParam name) const {
+  return tables_->FindByNameHelper(this, name).enum_value_descriptor();
 }
 
 const ServiceDescriptor* DescriptorPool::FindServiceByName(
-    const string& name) const {
-  Symbol result = tables_->FindByNameHelper(this, name);
-  return (result.type == Symbol::SERVICE) ? result.service_descriptor : NULL;
+    ConstStringParam name) const {
+  return tables_->FindByNameHelper(this, name).service_descriptor();
 }
 
 const MethodDescriptor* DescriptorPool::FindMethodByName(
-    const string& name) const {
-  Symbol result = tables_->FindByNameHelper(this, name);
-  return (result.type == Symbol::METHOD) ? result.method_descriptor : NULL;
+    ConstStringParam name) const {
+  return tables_->FindByNameHelper(this, name).method_descriptor();
 }
 
 const FieldDescriptor* DescriptorPool::FindExtensionByNumber(
     const Descriptor* extendee, int number) const {
+  if (extendee->extension_range_count() == 0) return nullptr;
   // A faster path to reduce lock contention in finding extensions, assuming
   // most extensions will be cache hit.
-  if (mutex_ != NULL) {
+  if (mutex_ != nullptr) {
     ReaderMutexLock lock(mutex_);
     const FieldDescriptor* result = tables_->FindExtension(extendee, number);
-    if (result != NULL) {
+    if (result != nullptr) {
       return result;
     }
   }
   MutexLockMaybe lock(mutex_);
-  tables_->known_bad_symbols_.clear();
-  tables_->known_bad_files_.clear();
+  if (fallback_database_ != nullptr) {
+    tables_->known_bad_symbols_.clear();
+    tables_->known_bad_files_.clear();
+  }
   const FieldDescriptor* result = tables_->FindExtension(extendee, number);
-  if (result != NULL) {
+  if (result != nullptr) {
     return result;
   }
-  if (underlay_ != NULL) {
+  if (underlay_ != nullptr) {
     result = underlay_->FindExtensionByNumber(extendee, number);
-    if (result != NULL) return result;
+    if (result != nullptr) return result;
   }
   if (TryFindExtensionInFallbackDatabase(extendee, number)) {
     result = tables_->FindExtension(extendee, number);
-    if (result != NULL) {
+    if (result != nullptr) {
       return result;
     }
   }
-  return NULL;
+  return nullptr;
+}
+
+const FieldDescriptor* DescriptorPool::InternalFindExtensionByNumberNoLock(
+    const Descriptor* extendee, int number) const {
+  if (extendee->extension_range_count() == 0) return nullptr;
+
+  const FieldDescriptor* result = tables_->FindExtension(extendee, number);
+  if (result != nullptr) {
+    return result;
+  }
+
+  if (underlay_ != nullptr) {
+    result = underlay_->InternalFindExtensionByNumberNoLock(extendee, number);
+    if (result != nullptr) return result;
+  }
+
+  return nullptr;
+}
+
+const FieldDescriptor* DescriptorPool::FindExtensionByPrintableName(
+    const Descriptor* extendee, ConstStringParam printable_name) const {
+  if (extendee->extension_range_count() == 0) return nullptr;
+  const FieldDescriptor* result = FindExtensionByName(printable_name);
+  if (result != nullptr && result->containing_type() == extendee) {
+    return result;
+  }
+  if (extendee->options().message_set_wire_format()) {
+    // MessageSet extensions may be identified by type name.
+    const Descriptor* type = FindMessageTypeByName(printable_name);
+    if (type != nullptr) {
+      // Look for a matching extension in the foreign type's scope.
+      const int type_extension_count = type->extension_count();
+      for (int i = 0; i < type_extension_count; i++) {
+        const FieldDescriptor* extension = type->extension(i);
+        if (extension->containing_type() == extendee &&
+            extension->type() == FieldDescriptor::TYPE_MESSAGE &&
+            extension->is_optional() && extension->message_type() == type) {
+          // Found it.
+          return extension;
+        }
+      }
+    }
+  }
+  return nullptr;
 }
 
 void DescriptorPool::FindAllExtensions(
     const Descriptor* extendee,
     std::vector<const FieldDescriptor*>* out) const {
   MutexLockMaybe lock(mutex_);
-  tables_->known_bad_symbols_.clear();
-  tables_->known_bad_files_.clear();
+  if (fallback_database_ != nullptr) {
+    tables_->known_bad_symbols_.clear();
+    tables_->known_bad_files_.clear();
+  }
 
   // Initialize tables_->extensions_ from the fallback database first
   // (but do this only once per descriptor).
-  if (fallback_database_ != NULL &&
+  if (fallback_database_ != nullptr &&
       tables_->extensions_loaded_from_db_.count(extendee) == 0) {
     std::vector<int> numbers;
     if (fallback_database_->FindAllExtensionNumbers(extendee->full_name(),
                                                     &numbers)) {
-      for (int i = 0; i < numbers.size(); ++i) {
-        int number = numbers[i];
-        if (tables_->FindExtension(extendee, number) == NULL) {
+      for (int number : numbers) {
+        if (tables_->FindExtension(extendee, number) == nullptr) {
           TryFindExtensionInFallbackDatabase(extendee, number);
         }
       }
@@ -1552,7 +2225,7 @@ void DescriptorPool::FindAllExtensions(
   }
 
   tables_->FindAllExtensions(extendee, out);
-  if (underlay_ != NULL) {
+  if (underlay_ != nullptr) {
     underlay_->FindAllExtensions(extendee, out);
   }
 }
@@ -1560,253 +2233,199 @@ void DescriptorPool::FindAllExtensions(
 
 // -------------------------------------------------------------------
 
-const FieldDescriptor*
-Descriptor::FindFieldByNumber(int key) const {
-  const FieldDescriptor* result =
-    file()->tables_->FindFieldByNumber(this, key);
-  if (result == NULL || result->is_extension()) {
-    return NULL;
+const FieldDescriptor* Descriptor::FindFieldByNumber(int key) const {
+  const FieldDescriptor* result = file()->tables_->FindFieldByNumber(this, key);
+  if (result == nullptr || result->is_extension()) {
+    return nullptr;
   } else {
     return result;
   }
 }
 
-const FieldDescriptor*
-Descriptor::FindFieldByLowercaseName(const string& key) const {
+const FieldDescriptor* Descriptor::FindFieldByLowercaseName(
+    ConstStringParam key) const {
   const FieldDescriptor* result =
-    file()->tables_->FindFieldByLowercaseName(this, key);
-  if (result == NULL || result->is_extension()) {
-    return NULL;
+      file()->tables_->FindFieldByLowercaseName(this, key);
+  if (result == nullptr || result->is_extension()) {
+    return nullptr;
   } else {
     return result;
   }
 }
 
-const FieldDescriptor*
-Descriptor::FindFieldByCamelcaseName(const string& key) const {
+const FieldDescriptor* Descriptor::FindFieldByCamelcaseName(
+    ConstStringParam key) const {
   const FieldDescriptor* result =
-    file()->tables_->FindFieldByCamelcaseName(this, key);
-  if (result == NULL || result->is_extension()) {
-    return NULL;
+      file()->tables_->FindFieldByCamelcaseName(this, key);
+  if (result == nullptr || result->is_extension()) {
+    return nullptr;
   } else {
     return result;
   }
 }
 
-const FieldDescriptor*
-Descriptor::FindFieldByName(const string& key) const {
-  Symbol result =
-    file()->tables_->FindNestedSymbolOfType(this, key, Symbol::FIELD);
-  if (!result.IsNull() && !result.field_descriptor->is_extension()) {
-    return result.field_descriptor;
-  } else {
-    return NULL;
-  }
+const FieldDescriptor* Descriptor::FindFieldByName(ConstStringParam key) const {
+  const FieldDescriptor* field =
+      file()->tables_->FindNestedSymbol(this, key).field_descriptor();
+  return field != nullptr && !field->is_extension() ? field : nullptr;
 }
 
-const OneofDescriptor*
-Descriptor::FindOneofByName(const string& key) const {
-  Symbol result =
-    file()->tables_->FindNestedSymbolOfType(this, key, Symbol::ONEOF);
-  if (!result.IsNull()) {
-    return result.oneof_descriptor;
-  } else {
-    return NULL;
-  }
+const OneofDescriptor* Descriptor::FindOneofByName(ConstStringParam key) const {
+  return file()->tables_->FindNestedSymbol(this, key).oneof_descriptor();
 }
 
-const FieldDescriptor*
-Descriptor::FindExtensionByName(const string& key) const {
-  Symbol result =
-    file()->tables_->FindNestedSymbolOfType(this, key, Symbol::FIELD);
-  if (!result.IsNull() && result.field_descriptor->is_extension()) {
-    return result.field_descriptor;
-  } else {
-    return NULL;
-  }
+const FieldDescriptor* Descriptor::FindExtensionByName(
+    ConstStringParam key) const {
+  const FieldDescriptor* field =
+      file()->tables_->FindNestedSymbol(this, key).field_descriptor();
+  return field != nullptr && field->is_extension() ? field : nullptr;
 }
 
-const FieldDescriptor*
-Descriptor::FindExtensionByLowercaseName(const string& key) const {
+const FieldDescriptor* Descriptor::FindExtensionByLowercaseName(
+    ConstStringParam key) const {
   const FieldDescriptor* result =
-    file()->tables_->FindFieldByLowercaseName(this, key);
-  if (result == NULL || !result->is_extension()) {
-    return NULL;
+      file()->tables_->FindFieldByLowercaseName(this, key);
+  if (result == nullptr || !result->is_extension()) {
+    return nullptr;
   } else {
     return result;
   }
 }
 
-const FieldDescriptor*
-Descriptor::FindExtensionByCamelcaseName(const string& key) const {
+const FieldDescriptor* Descriptor::FindExtensionByCamelcaseName(
+    ConstStringParam key) const {
   const FieldDescriptor* result =
-    file()->tables_->FindFieldByCamelcaseName(this, key);
-  if (result == NULL || !result->is_extension()) {
-    return NULL;
+      file()->tables_->FindFieldByCamelcaseName(this, key);
+  if (result == nullptr || !result->is_extension()) {
+    return nullptr;
   } else {
     return result;
   }
 }
 
-const Descriptor*
-Descriptor::FindNestedTypeByName(const string& key) const {
-  Symbol result =
-    file()->tables_->FindNestedSymbolOfType(this, key, Symbol::MESSAGE);
-  if (!result.IsNull()) {
-    return result.descriptor;
-  } else {
-    return NULL;
-  }
+const Descriptor* Descriptor::FindNestedTypeByName(ConstStringParam key) const {
+  return file()->tables_->FindNestedSymbol(this, key).descriptor();
 }
 
-const EnumDescriptor*
-Descriptor::FindEnumTypeByName(const string& key) const {
-  Symbol result =
-    file()->tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM);
-  if (!result.IsNull()) {
-    return result.enum_descriptor;
-  } else {
-    return NULL;
-  }
+const EnumDescriptor* Descriptor::FindEnumTypeByName(
+    ConstStringParam key) const {
+  return file()->tables_->FindNestedSymbol(this, key).enum_descriptor();
 }
 
-const EnumValueDescriptor*
-Descriptor::FindEnumValueByName(const string& key) const {
-  Symbol result =
-    file()->tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM_VALUE);
-  if (!result.IsNull()) {
-    return result.enum_value_descriptor;
-  } else {
-    return NULL;
-  }
+const EnumValueDescriptor* Descriptor::FindEnumValueByName(
+    ConstStringParam key) const {
+  return file()->tables_->FindNestedSymbol(this, key).enum_value_descriptor();
 }
 
-const EnumValueDescriptor*
-EnumDescriptor::FindValueByName(const string& key) const {
-  Symbol result =
-    file()->tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM_VALUE);
-  if (!result.IsNull()) {
-    return result.enum_value_descriptor;
-  } else {
-    return NULL;
-  }
+const FieldDescriptor* Descriptor::map_key() const {
+  if (!options().map_entry()) return nullptr;
+  GOOGLE_DCHECK_EQ(field_count(), 2);
+  return field(0);
+}
+
+const FieldDescriptor* Descriptor::map_value() const {
+  if (!options().map_entry()) return nullptr;
+  GOOGLE_DCHECK_EQ(field_count(), 2);
+  return field(1);
 }
 
-const EnumValueDescriptor*
-EnumDescriptor::FindValueByNumber(int key) const {
+const EnumValueDescriptor* EnumDescriptor::FindValueByName(
+    ConstStringParam key) const {
+  return file()->tables_->FindNestedSymbol(this, key).enum_value_descriptor();
+}
+
+const EnumValueDescriptor* EnumDescriptor::FindValueByNumber(int key) const {
   return file()->tables_->FindEnumValueByNumber(this, key);
 }
 
-const EnumValueDescriptor*
-EnumDescriptor::FindValueByNumberCreatingIfUnknown(int key) const {
+const EnumValueDescriptor* EnumDescriptor::FindValueByNumberCreatingIfUnknown(
+    int key) const {
   return file()->tables_->FindEnumValueByNumberCreatingIfUnknown(this, key);
 }
 
-const MethodDescriptor*
-ServiceDescriptor::FindMethodByName(const string& key) const {
-  Symbol result =
-    file()->tables_->FindNestedSymbolOfType(this, key, Symbol::METHOD);
-  if (!result.IsNull()) {
-    return result.method_descriptor;
-  } else {
-    return NULL;
-  }
+const MethodDescriptor* ServiceDescriptor::FindMethodByName(
+    ConstStringParam key) const {
+  return file()->tables_->FindNestedSymbol(this, key).method_descriptor();
 }
 
-const Descriptor*
-FileDescriptor::FindMessageTypeByName(const string& key) const {
-  Symbol result = tables_->FindNestedSymbolOfType(this, key, Symbol::MESSAGE);
-  if (!result.IsNull()) {
-    return result.descriptor;
-  } else {
-    return NULL;
-  }
+const Descriptor* FileDescriptor::FindMessageTypeByName(
+    ConstStringParam key) const {
+  return tables_->FindNestedSymbol(this, key).descriptor();
 }
 
-const EnumDescriptor*
-FileDescriptor::FindEnumTypeByName(const string& key) const {
-  Symbol result = tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM);
-  if (!result.IsNull()) {
-    return result.enum_descriptor;
-  } else {
-    return NULL;
-  }
+const EnumDescriptor* FileDescriptor::FindEnumTypeByName(
+    ConstStringParam key) const {
+  return tables_->FindNestedSymbol(this, key).enum_descriptor();
 }
 
-const EnumValueDescriptor*
-FileDescriptor::FindEnumValueByName(const string& key) const {
-  Symbol result =
-    tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM_VALUE);
-  if (!result.IsNull()) {
-    return result.enum_value_descriptor;
-  } else {
-    return NULL;
-  }
+const EnumValueDescriptor* FileDescriptor::FindEnumValueByName(
+    ConstStringParam key) const {
+  return tables_->FindNestedSymbol(this, key).enum_value_descriptor();
 }
 
-const ServiceDescriptor*
-FileDescriptor::FindServiceByName(const string& key) const {
-  Symbol result = tables_->FindNestedSymbolOfType(this, key, Symbol::SERVICE);
-  if (!result.IsNull()) {
-    return result.service_descriptor;
-  } else {
-    return NULL;
-  }
+const ServiceDescriptor* FileDescriptor::FindServiceByName(
+    ConstStringParam key) const {
+  return tables_->FindNestedSymbol(this, key).service_descriptor();
 }
 
-const FieldDescriptor*
-FileDescriptor::FindExtensionByName(const string& key) const {
-  Symbol result = tables_->FindNestedSymbolOfType(this, key, Symbol::FIELD);
-  if (!result.IsNull() && result.field_descriptor->is_extension()) {
-    return result.field_descriptor;
-  } else {
-    return NULL;
-  }
+const FieldDescriptor* FileDescriptor::FindExtensionByName(
+    ConstStringParam key) const {
+  const FieldDescriptor* field =
+      tables_->FindNestedSymbol(this, key).field_descriptor();
+  return field != nullptr && field->is_extension() ? field : nullptr;
 }
 
-const FieldDescriptor*
-FileDescriptor::FindExtensionByLowercaseName(const string& key) const {
+const FieldDescriptor* FileDescriptor::FindExtensionByLowercaseName(
+    ConstStringParam key) const {
   const FieldDescriptor* result = tables_->FindFieldByLowercaseName(this, key);
-  if (result == NULL || !result->is_extension()) {
-    return NULL;
+  if (result == nullptr || !result->is_extension()) {
+    return nullptr;
   } else {
     return result;
   }
 }
 
-const FieldDescriptor*
-FileDescriptor::FindExtensionByCamelcaseName(const string& key) const {
+const FieldDescriptor* FileDescriptor::FindExtensionByCamelcaseName(
+    ConstStringParam key) const {
   const FieldDescriptor* result = tables_->FindFieldByCamelcaseName(this, key);
-  if (result == NULL || !result->is_extension()) {
-    return NULL;
+  if (result == nullptr || !result->is_extension()) {
+    return nullptr;
   } else {
     return result;
   }
 }
 
+void Descriptor::ExtensionRange::CopyTo(
+    DescriptorProto_ExtensionRange* proto) const {
+  proto->set_start(this->start);
+  proto->set_end(this->end);
+  if (options_ != &ExtensionRangeOptions::default_instance()) {
+    *proto->mutable_options() = *options_;
+  }
+}
+
 const Descriptor::ExtensionRange*
 Descriptor::FindExtensionRangeContainingNumber(int number) const {
   // Linear search should be fine because we don't expect a message to have
   // more than a couple extension ranges.
   for (int i = 0; i < extension_range_count(); i++) {
     if (number >= extension_range(i)->start &&
-        number <  extension_range(i)->end) {
+        number < extension_range(i)->end) {
       return extension_range(i);
     }
   }
-  return NULL;
+  return nullptr;
 }
 
-const Descriptor::ReservedRange*
-Descriptor::FindReservedRangeContainingNumber(int number) const {
+const Descriptor::ReservedRange* Descriptor::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) {
+    if (number >= reserved_range(i)->start && number < reserved_range(i)->end) {
       return reserved_range(i);
     }
   }
-  return NULL;
+  return nullptr;
 }
 
 const EnumDescriptor::ReservedRange*
@@ -1818,82 +2437,86 @@ EnumDescriptor::FindReservedRangeContainingNumber(int number) const {
       return reserved_range(i);
     }
   }
-  return NULL;
+  return nullptr;
 }
 
 // -------------------------------------------------------------------
 
-bool DescriptorPool::TryFindFileInFallbackDatabase(const string& name) const {
-  if (fallback_database_ == NULL) return false;
+bool DescriptorPool::TryFindFileInFallbackDatabase(
+    StringPiece name) const {
+  if (fallback_database_ == nullptr) return false;
 
-  if (tables_->known_bad_files_.count(name) > 0) return false;
+  auto name_string = std::string(name);
+  if (tables_->known_bad_files_.count(name_string) > 0) return false;
 
   FileDescriptorProto file_proto;
-  if (!fallback_database_->FindFileByName(name, &file_proto) ||
-      BuildFileFromDatabase(file_proto) == NULL) {
-    tables_->known_bad_files_.insert(name);
+  if (!fallback_database_->FindFileByName(name_string, &file_proto) ||
+      BuildFileFromDatabase(file_proto) == nullptr) {
+    tables_->known_bad_files_.insert(std::move(name_string));
     return false;
   }
   return true;
 }
 
-bool DescriptorPool::IsSubSymbolOfBuiltType(const string& name) const {
-  string prefix = name;
+bool DescriptorPool::IsSubSymbolOfBuiltType(StringPiece name) const {
+  auto prefix = std::string(name);
   for (;;) {
-    string::size_type dot_pos = prefix.find_last_of('.');
-    if (dot_pos == string::npos) {
+    std::string::size_type dot_pos = prefix.find_last_of('.');
+    if (dot_pos == std::string::npos) {
       break;
     }
     prefix = prefix.substr(0, dot_pos);
     Symbol symbol = tables_->FindSymbol(prefix);
     // If the symbol type is anything other than PACKAGE, then its complete
     // definition is already known.
-    if (!symbol.IsNull() && symbol.type != Symbol::PACKAGE) {
+    if (!symbol.IsNull() && symbol.type() != Symbol::PACKAGE) {
       return true;
     }
   }
-  if (underlay_ != NULL) {
+  if (underlay_ != nullptr) {
     // Check to see if any prefix of this symbol exists in the underlay.
     return underlay_->IsSubSymbolOfBuiltType(name);
   }
   return false;
 }
 
-bool DescriptorPool::TryFindSymbolInFallbackDatabase(const string& name) const {
-  if (fallback_database_ == NULL) return false;
+bool DescriptorPool::TryFindSymbolInFallbackDatabase(
+    StringPiece name) const {
+  if (fallback_database_ == nullptr) return false;
 
-  if (tables_->known_bad_symbols_.count(name) > 0) return false;
+  auto name_string = std::string(name);
+  if (tables_->known_bad_symbols_.count(name_string) > 0) return false;
 
   FileDescriptorProto file_proto;
-  if (// We skip looking in the fallback database if the name is a sub-symbol
-      // of any descriptor that already exists in the descriptor pool (except
-      // for package descriptors).  This is valid because all symbols except
-      // for packages are defined in a single file, so if the symbol exists
-      // then we should already have its definition.
-      //
-      // The other reason to do this is to support "overriding" type
-      // definitions by merging two databases that define the same type.  (Yes,
-      // people do this.)  The main difficulty with making this work is that
-      // FindFileContainingSymbol() is allowed to return both false positives
-      // (e.g., SimpleDescriptorDatabase, UpgradedDescriptorDatabase) and false
-      // negatives (e.g. ProtoFileParser, SourceTreeDescriptorDatabase).
-      // When two such databases are merged, looking up a non-existent
-      // sub-symbol of a type that already exists in the descriptor pool can
-      // result in an attempt to load multiple definitions of the same type.
-      // The check below avoids this.
+  if (  // We skip looking in the fallback database if the name is a sub-symbol
+        // of any descriptor that already exists in the descriptor pool (except
+        // for package descriptors).  This is valid because all symbols except
+        // for packages are defined in a single file, so if the symbol exists
+        // then we should already have its definition.
+        //
+        // The other reason to do this is to support "overriding" type
+        // definitions by merging two databases that define the same type. (Yes,
+        // people do this.)  The main difficulty with making this work is that
+        // FindFileContainingSymbol() is allowed to return both false positives
+        // (e.g., SimpleDescriptorDatabase, UpgradedDescriptorDatabase) and
+        // false negatives (e.g. ProtoFileParser, SourceTreeDescriptorDatabase).
+        // When two such databases are merged, looking up a non-existent
+        // sub-symbol of a type that already exists in the descriptor pool can
+        // result in an attempt to load multiple definitions of the same type.
+        // The check below avoids this.
       IsSubSymbolOfBuiltType(name)
 
       // Look up file containing this symbol in fallback database.
-      || !fallback_database_->FindFileContainingSymbol(name, &file_proto)
+      || !fallback_database_->FindFileContainingSymbol(name_string, &file_proto)
 
       // Check if we've already built this file. If so, it apparently doesn't
       // contain the symbol we're looking for.  Some DescriptorDatabases
       // return false positives.
-      || tables_->FindFile(file_proto.name()) != NULL
+      || tables_->FindFile(file_proto.name()) != nullptr
 
       // Build the file.
-      || BuildFileFromDatabase(file_proto) == NULL) {
-    tables_->known_bad_symbols_.insert(name);
+      || BuildFileFromDatabase(file_proto) == nullptr) {
+    tables_->known_bad_symbols_.insert(std::move(name_string));
     return false;
   }
 
@@ -1902,22 +2525,22 @@ bool DescriptorPool::TryFindSymbolInFallbackDatabase(const string& name) const {
 
 bool DescriptorPool::TryFindExtensionInFallbackDatabase(
     const Descriptor* containing_type, int field_number) const {
-  if (fallback_database_ == NULL) return false;
+  if (fallback_database_ == nullptr) return false;
 
   FileDescriptorProto file_proto;
   if (!fallback_database_->FindFileContainingExtension(
-        containing_type->full_name(), field_number, &file_proto)) {
+          containing_type->full_name(), field_number, &file_proto)) {
     return false;
   }
 
-  if (tables_->FindFile(file_proto.name()) != NULL) {
+  if (tables_->FindFile(file_proto.name()) != nullptr) {
     // We've already loaded this file, and it apparently doesn't contain the
     // extension we're looking for.  Some DescriptorDatabases return false
     // positives.
     return false;
   }
 
-  if (BuildFileFromDatabase(file_proto) == NULL) {
+  if (BuildFileFromDatabase(file_proto) == nullptr) {
     return false;
   }
 
@@ -1927,33 +2550,27 @@ bool DescriptorPool::TryFindExtensionInFallbackDatabase(
 // ===================================================================
 
 bool FieldDescriptor::is_map_message_type() const {
-  return message_type_->options().map_entry();
+  return type_descriptor_.message_type->options().map_entry();
 }
 
-string FieldDescriptor::DefaultValueAsString(bool quote_string_type) const {
+std::string FieldDescriptor::DefaultValueAsString(
+    bool quote_string_type) const {
   GOOGLE_CHECK(has_default_value()) << "No default value";
   switch (cpp_type()) {
     case CPPTYPE_INT32:
-      return SimpleItoa(default_value_int32());
-      break;
+      return StrCat(default_value_int32_t());
     case CPPTYPE_INT64:
-      return SimpleItoa(default_value_int64());
-      break;
+      return StrCat(default_value_int64_t());
     case CPPTYPE_UINT32:
-      return SimpleItoa(default_value_uint32());
-      break;
+      return StrCat(default_value_uint32_t());
     case CPPTYPE_UINT64:
-      return SimpleItoa(default_value_uint64());
-      break;
+      return StrCat(default_value_uint64_t());
     case CPPTYPE_FLOAT:
       return SimpleFtoa(default_value_float());
-      break;
     case CPPTYPE_DOUBLE:
       return SimpleDtoa(default_value_double());
-      break;
     case CPPTYPE_BOOL:
       return default_value_bool() ? "true" : "false";
-      break;
     case CPPTYPE_STRING:
       if (quote_string_type) {
         return "\"" + CEscape(default_value_string()) + "\"";
@@ -1964,10 +2581,8 @@ string FieldDescriptor::DefaultValueAsString(bool quote_string_type) const {
           return default_value_string();
         }
       }
-      break;
     case CPPTYPE_ENUM:
       return default_value_enum()->name();
-      break;
     case CPPTYPE_MESSAGE:
       GOOGLE_LOG(DFATAL) << "Messages can't have default values!";
       break;
@@ -2051,13 +2666,7 @@ void Descriptor::CopyTo(DescriptorProto* proto) const {
     enum_type(i)->CopyTo(proto->add_enum_type());
   }
   for (int i = 0; i < extension_range_count(); i++) {
-    DescriptorProto::ExtensionRange* range = proto->add_extension_range();
-    range->set_start(extension_range(i)->start);
-    range->set_end(extension_range(i)->end);
-    const ExtensionRangeOptions* options = extension_range(i)->options_;
-    if (options != &ExtensionRangeOptions::default_instance()) {
-      range->mutable_options()->CopyFrom(*options);
-    }
+    extension_range(i)->CopyTo(proto->add_extension_range());
   }
   for (int i = 0; i < extension_count(); i++) {
     extension(i)->CopyTo(proto->add_extension());
@@ -2100,13 +2709,15 @@ void FieldDescriptor::CopyTo(FieldDescriptorProto* proto) const {
   if (has_json_name_) {
     proto->set_json_name(json_name());
   }
-
+  if (proto3_optional_) {
+    proto->set_proto3_optional(true);
+  }
   // Some compilers do not allow static_cast directly between two enum types,
   // so we must cast to int first.
   proto->set_label(static_cast<FieldDescriptorProto::Label>(
-                     implicit_cast<int>(label())));
+      implicit_cast<int>(label())));
   proto->set_type(static_cast<FieldDescriptorProto::Type>(
-                    implicit_cast<int>(type())));
+      implicit_cast<int>(type())));
 
   if (is_extension()) {
     if (!containing_type()->is_unqualified_placeholder_) {
@@ -2137,7 +2748,7 @@ void FieldDescriptor::CopyTo(FieldDescriptorProto* proto) const {
     proto->set_default_value(DefaultValueAsString(false));
   }
 
-  if (containing_oneof() != NULL && !is_extension()) {
+  if (containing_oneof() != nullptr && !is_extension()) {
     proto->set_oneof_index(containing_oneof()->index());
   }
 
@@ -2227,40 +2838,42 @@ void MethodDescriptor::CopyTo(MethodDescriptorProto* proto) const {
 
 namespace {
 
-bool RetrieveOptionsAssumingRightPool(int depth, const Message& options,
-                                      std::vector<string>* option_entries) {
+bool RetrieveOptionsAssumingRightPool(
+    int depth, const Message& options,
+    std::vector<std::string>* option_entries) {
   option_entries->clear();
   const Reflection* reflection = options.GetReflection();
   std::vector<const FieldDescriptor*> fields;
   reflection->ListFields(options, &fields);
-  for (int i = 0; i < fields.size(); i++) {
+  for (const FieldDescriptor* field : fields) {
     int count = 1;
     bool repeated = false;
-    if (fields[i]->is_repeated()) {
-      count = reflection->FieldSize(options, fields[i]);
+    if (field->is_repeated()) {
+      count = reflection->FieldSize(options, field);
       repeated = true;
     }
     for (int j = 0; j < count; j++) {
-      string fieldval;
-      if (fields[i]->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-        string tmp;
+      std::string fieldval;
+      if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
+        std::string tmp;
         TextFormat::Printer printer;
+        printer.SetExpandAny(true);
         printer.SetInitialIndentLevel(depth + 1);
-        printer.PrintFieldValueToString(options, fields[i],
-                                        repeated ? j : -1, &tmp);
+        printer.PrintFieldValueToString(options, field, repeated ? j : -1,
+                                        &tmp);
         fieldval.append("{\n");
         fieldval.append(tmp);
         fieldval.append(depth * 2, ' ');
         fieldval.append("}");
       } else {
-        TextFormat::PrintFieldValueToString(options, fields[i],
-                                            repeated ? j : -1, &fieldval);
+        TextFormat::PrintFieldValueToString(options, field, repeated ? j : -1,
+                                            &fieldval);
       }
-      string name;
-      if (fields[i]->is_extension()) {
-        name = "(." + fields[i]->full_name() + ")";
+      std::string name;
+      if (field->is_extension()) {
+        name = "(." + field->full_name() + ")";
       } else {
-        name = fields[i]->name();
+        name = field->name();
       }
       option_entries->push_back(name + " = " + fieldval);
     }
@@ -2271,7 +2884,7 @@ bool RetrieveOptionsAssumingRightPool(int depth, const Message& options,
 // Used by each of the option formatters.
 bool RetrieveOptions(int depth, const Message& options,
                      const DescriptorPool* pool,
-                     std::vector<string>* option_entries) {
+                     std::vector<std::string>* option_entries) {
   // When printing custom options for a descriptor, we must use an options
   // message built on top of the same DescriptorPool where the descriptor
   // is coming from. This is to ensure we are interpreting custom options
@@ -2281,16 +2894,20 @@ bool RetrieveOptions(int depth, const Message& options,
   } else {
     const Descriptor* option_descriptor =
         pool->FindMessageTypeByName(options.GetDescriptor()->full_name());
-    if (option_descriptor == NULL) {
-      // google/protobuf/descriptor.proto is not in the pool. This means no
-      // custom options are used so we are safe to proceed with the compiled
-      // options message type.
+    if (option_descriptor == nullptr) {
+      // descriptor.proto is not in the pool. This means no custom options are
+      // used so we are safe to proceed with the compiled options message type.
       return RetrieveOptionsAssumingRightPool(depth, options, option_entries);
     }
     DynamicMessageFactory factory;
-    google::protobuf::scoped_ptr<Message> dynamic_options(
+    std::unique_ptr<Message> dynamic_options(
         factory.GetPrototype(option_descriptor)->New());
-    if (dynamic_options->ParseFromString(options.SerializeAsString())) {
+    std::string serialized = options.SerializeAsString();
+    io::CodedInputStream input(
+        reinterpret_cast<const uint8_t*>(serialized.c_str()),
+        serialized.size());
+    input.SetExtensionRegistry(pool, &factory);
+    if (dynamic_options->ParseFromCodedStream(&input)) {
       return RetrieveOptionsAssumingRightPool(depth, *dynamic_options,
                                               option_entries);
     } else {
@@ -2304,8 +2921,8 @@ bool RetrieveOptions(int depth, const Message& options,
 // Formats options that all appear together in brackets. Does not include
 // brackets.
 bool FormatBracketedOptions(int depth, const Message& options,
-                            const DescriptorPool* pool, string* output) {
-  std::vector<string> all_options;
+                            const DescriptorPool* pool, std::string* output) {
+  std::vector<std::string> all_options;
   if (RetrieveOptions(depth, options, pool, &all_options)) {
     output->append(Join(all_options, ", "));
   }
@@ -2314,13 +2931,12 @@ bool FormatBracketedOptions(int depth, const Message& options,
 
 // Formats options one per line
 bool FormatLineOptions(int depth, const Message& options,
-                       const DescriptorPool* pool, string* output) {
-  string prefix(depth * 2, ' ');
-  std::vector<string> all_options;
+                       const DescriptorPool* pool, std::string* output) {
+  std::string prefix(depth * 2, ' ');
+  std::vector<std::string> all_options;
   if (RetrieveOptions(depth, options, pool, &all_options)) {
-    for (int i = 0; i < all_options.size(); i++) {
-      strings::SubstituteAndAppend(output, "$0option $1;\n",
-                                   prefix, all_options[i]);
+    for (const std::string& option : all_options) {
+      strings::SubstituteAndAppend(output, "$0option $1;\n", prefix, option);
     }
   }
   return !all_options.empty();
@@ -2328,31 +2944,31 @@ bool FormatLineOptions(int depth, const Message& options,
 
 class SourceLocationCommentPrinter {
  public:
-  template<typename DescType>
-  SourceLocationCommentPrinter(const DescType* desc,
-                               const string& prefix,
+  template <typename DescType>
+  SourceLocationCommentPrinter(const DescType* desc, const std::string& prefix,
                                const DebugStringOptions& options)
       : options_(options), prefix_(prefix) {
     // Perform the SourceLocation lookup only if we're including user comments,
     // because the lookup is fairly expensive.
-    have_source_loc_ = options.include_comments &&
-        desc->GetSourceLocation(&source_loc_);
+    have_source_loc_ =
+        options.include_comments && desc->GetSourceLocation(&source_loc_);
   }
   SourceLocationCommentPrinter(const FileDescriptor* file,
                                const std::vector<int>& path,
-                               const string& prefix,
+                               const std::string& prefix,
                                const DebugStringOptions& options)
       : options_(options), prefix_(prefix) {
     // Perform the SourceLocation lookup only if we're including user comments,
     // because the lookup is fairly expensive.
-    have_source_loc_ = options.include_comments &&
-        file->GetSourceLocation(path, &source_loc_);
+    have_source_loc_ =
+        options.include_comments && file->GetSourceLocation(path, &source_loc_);
   }
-  void AddPreComment(string* output) {
+  void AddPreComment(std::string* output) {
     if (have_source_loc_) {
       // Detached leading comments.
-      for (int i = 0 ; i < source_loc_.leading_detached_comments.size(); ++i) {
-        *output += FormatComment(source_loc_.leading_detached_comments[i]);
+      for (const std::string& leading_detached_comment :
+           source_loc_.leading_detached_comments) {
+        *output += FormatComment(leading_detached_comment);
         *output += "\n";
       }
       // Attached leading comments.
@@ -2361,7 +2977,7 @@ class SourceLocationCommentPrinter {
       }
     }
   }
-  void AddPostComment(string* output) {
+  void AddPostComment(std::string* output) {
     if (have_source_loc_ && source_loc_.trailing_comments.size() > 0) {
       *output += FormatComment(source_loc_.trailing_comments);
     }
@@ -2369,13 +2985,12 @@ class SourceLocationCommentPrinter {
 
   // Format comment such that each line becomes a full-line C++-style comment in
   // the DebugString() output.
-  string FormatComment(const string& comment_text) {
-    string stripped_comment = comment_text;
+  std::string FormatComment(const std::string& comment_text) {
+    std::string stripped_comment = comment_text;
     StripWhitespace(&stripped_comment);
-    std::vector<string> lines = Split(stripped_comment, "\n");
-    string output;
-    for (int i = 0; i < lines.size(); ++i) {
-      const string& line = lines[i];
+    std::vector<std::string> lines = Split(stripped_comment, "\n");
+    std::string output;
+    for (const std::string& line : lines) {
       strings::SubstituteAndAppend(&output, "$0// $1\n", prefix_, line);
     }
     return output;
@@ -2386,32 +3001,31 @@ class SourceLocationCommentPrinter {
   bool have_source_loc_;
   SourceLocation source_loc_;
   DebugStringOptions options_;
-  string prefix_;
+  std::string prefix_;
 };
 
 }  // anonymous namespace
 
-string FileDescriptor::DebugString() const {
+std::string FileDescriptor::DebugString() const {
   DebugStringOptions options;  // default options
   return DebugStringWithOptions(options);
 }
 
-string FileDescriptor::DebugStringWithOptions(
+std::string FileDescriptor::DebugStringWithOptions(
     const DebugStringOptions& debug_string_options) const {
-  string contents;
+  std::string contents;
   {
     std::vector<int> path;
     path.push_back(FileDescriptorProto::kSyntaxFieldNumber);
-    SourceLocationCommentPrinter syntax_comment(
-        this, path, "", debug_string_options);
+    SourceLocationCommentPrinter syntax_comment(this, path, "",
+                                                debug_string_options);
     syntax_comment.AddPreComment(&contents);
     strings::SubstituteAndAppend(&contents, "syntax = \"$0\";\n\n",
-                                 SyntaxName(syntax()));
+                              SyntaxName(syntax()));
     syntax_comment.AddPostComment(&contents);
   }
 
-  SourceLocationCommentPrinter
-      comment_printer(this, "", debug_string_options);
+  SourceLocationCommentPrinter comment_printer(this, "", debug_string_options);
   comment_printer.AddPreComment(&contents);
 
   std::set<int> public_dependencies;
@@ -2424,21 +3038,21 @@ string FileDescriptor::DebugStringWithOptions(
   for (int i = 0; i < dependency_count(); i++) {
     if (public_dependencies.count(i) > 0) {
       strings::SubstituteAndAppend(&contents, "import public \"$0\";\n",
-                                   dependency(i)->name());
+                                dependency(i)->name());
     } else if (weak_dependencies.count(i) > 0) {
       strings::SubstituteAndAppend(&contents, "import weak \"$0\";\n",
-                                   dependency(i)->name());
+                                dependency(i)->name());
     } else {
       strings::SubstituteAndAppend(&contents, "import \"$0\";\n",
-                                   dependency(i)->name());
+                                dependency(i)->name());
     }
   }
 
   if (!package().empty()) {
     std::vector<int> path;
     path.push_back(FileDescriptorProto::kPackageFieldNumber);
-    SourceLocationCommentPrinter package_comment(
-        this, path, "", debug_string_options);
+    SourceLocationCommentPrinter package_comment(this, path, "",
+                                                 debug_string_options);
     package_comment.AddPreComment(&contents);
     strings::SubstituteAndAppend(&contents, "package $0;\n\n", package());
     package_comment.AddPostComment(&contents);
@@ -2475,16 +3089,15 @@ string FileDescriptor::DebugStringWithOptions(
     contents.append("\n");
   }
 
-  const Descriptor* containing_type = NULL;
+  const Descriptor* containing_type = nullptr;
   for (int i = 0; i < extension_count(); i++) {
     if (extension(i)->containing_type() != containing_type) {
       if (i > 0) contents.append("}\n\n");
       containing_type = extension(i)->containing_type();
       strings::SubstituteAndAppend(&contents, "extend .$0 {\n",
-                                   containing_type->full_name());
+                                containing_type->full_name());
     }
-    extension(i)->DebugString(1, FieldDescriptor::PRINT_LABEL, &contents,
-                              debug_string_options);
+    extension(i)->DebugString(1, &contents, debug_string_options);
   }
   if (extension_count() > 0) contents.append("}\n\n");
 
@@ -2493,31 +3106,30 @@ string FileDescriptor::DebugStringWithOptions(
   return contents;
 }
 
-string Descriptor::DebugString() const {
+std::string Descriptor::DebugString() const {
   DebugStringOptions options;  // default options
   return DebugStringWithOptions(options);
 }
 
-string Descriptor::DebugStringWithOptions(
+std::string Descriptor::DebugStringWithOptions(
     const DebugStringOptions& options) const {
-  string contents;
+  std::string contents;
   DebugString(0, &contents, options, /* include_opening_clause */ true);
   return contents;
 }
 
-void Descriptor::DebugString(int depth, string *contents,
-                             const DebugStringOptions&
-                             debug_string_options,
+void Descriptor::DebugString(int depth, std::string* contents,
+                             const DebugStringOptions& debug_string_options,
                              bool include_opening_clause) const {
   if (options().map_entry()) {
     // Do not generate debug string for auto-generated map-entry type.
     return;
   }
-  string prefix(depth * 2, ' ');
+  std::string prefix(depth * 2, ' ');
   ++depth;
 
-  SourceLocationCommentPrinter
-      comment_printer(this, prefix, debug_string_options);
+  SourceLocationCommentPrinter comment_printer(this, prefix,
+                                               debug_string_options);
   comment_printer.AddPreComment(contents);
 
   if (include_opening_clause) {
@@ -2552,9 +3164,8 @@ void Descriptor::DebugString(int depth, string *contents,
     enum_type(i)->DebugString(depth, contents, debug_string_options);
   }
   for (int i = 0; i < field_count(); i++) {
-    if (field(i)->containing_oneof() == NULL) {
-      field(i)->DebugString(depth, FieldDescriptor::PRINT_LABEL, contents,
-                            debug_string_options);
+    if (field(i)->real_containing_oneof() == nullptr) {
+      field(i)->DebugString(depth, contents, debug_string_options);
     } else if (field(i)->containing_oneof()->field(0) == field(i)) {
       // This is the first field in this oneof, so print the whole oneof.
       field(i)->containing_oneof()->DebugString(depth, contents,
@@ -2563,24 +3174,21 @@ void Descriptor::DebugString(int depth, string *contents,
   }
 
   for (int i = 0; i < extension_range_count(); i++) {
-    strings::SubstituteAndAppend(contents, "$0  extensions $1 to $2;\n",
-                                 prefix,
-                                 extension_range(i)->start,
-                                 extension_range(i)->end - 1);
+    strings::SubstituteAndAppend(contents, "$0  extensions $1 to $2;\n", prefix,
+                              extension_range(i)->start,
+                              extension_range(i)->end - 1);
   }
 
   // Group extensions by what they extend, so they can be printed out together.
-  const Descriptor* containing_type = NULL;
+  const Descriptor* containing_type = nullptr;
   for (int i = 0; i < extension_count(); i++) {
     if (extension(i)->containing_type() != containing_type) {
       if (i > 0) strings::SubstituteAndAppend(contents, "$0  }\n", prefix);
       containing_type = extension(i)->containing_type();
-      strings::SubstituteAndAppend(contents, "$0  extend .$1 {\n",
-                                   prefix, containing_type->full_name());
+      strings::SubstituteAndAppend(contents, "$0  extend .$1 {\n", prefix,
+                                containing_type->full_name());
     }
-    extension(i)->DebugString(
-        depth + 1, FieldDescriptor::PRINT_LABEL, contents,
-        debug_string_options);
+    extension(i)->DebugString(depth + 1, contents, debug_string_options);
   }
   if (extension_count() > 0)
     strings::SubstituteAndAppend(contents, "$0  }\n", prefix);
@@ -2591,9 +3199,11 @@ void Descriptor::DebugString(int depth, string *contents,
       const Descriptor::ReservedRange* range = reserved_range(i);
       if (range->end == range->start + 1) {
         strings::SubstituteAndAppend(contents, "$0, ", range->start);
+      } else if (range->end > FieldDescriptor::kMaxNumber) {
+        strings::SubstituteAndAppend(contents, "$0 to max, ", range->start);
       } else {
-        strings::SubstituteAndAppend(contents, "$0 to $1, ",
-                                     range->start, range->end - 1);
+        strings::SubstituteAndAppend(contents, "$0 to $1, ", range->start,
+                                  range->end - 1);
       }
     }
     contents->replace(contents->size() - 2, 2, ";\n");
@@ -2603,7 +3213,7 @@ void Descriptor::DebugString(int depth, string *contents,
     strings::SubstituteAndAppend(contents, "$0  reserved ", prefix);
     for (int i = 0; i < reserved_name_count(); i++) {
       strings::SubstituteAndAppend(contents, "\"$0\", ",
-                                   CEscape(reserved_name(i)));
+                                CEscape(reserved_name(i)));
     }
     contents->replace(contents->size() - 2, 2, ";\n");
   }
@@ -2612,21 +3222,21 @@ void Descriptor::DebugString(int depth, string *contents,
   comment_printer.AddPostComment(contents);
 }
 
-string FieldDescriptor::DebugString() const {
+std::string FieldDescriptor::DebugString() const {
   DebugStringOptions options;  // default options
   return DebugStringWithOptions(options);
 }
 
-string FieldDescriptor::DebugStringWithOptions(
+std::string FieldDescriptor::DebugStringWithOptions(
     const DebugStringOptions& debug_string_options) const {
-  string contents;
+  std::string contents;
   int depth = 0;
   if (is_extension()) {
     strings::SubstituteAndAppend(&contents, "extend .$0 {\n",
-                                 containing_type()->full_name());
+                              containing_type()->full_name());
     depth = 1;
   }
-  DebugString(depth, PRINT_LABEL, &contents, debug_string_options);
+  DebugString(depth, &contents, debug_string_options);
   if (is_extension()) {
     contents.append("}\n");
   }
@@ -2634,8 +3244,8 @@ string FieldDescriptor::DebugStringWithOptions(
 }
 
 // The field type string used in FieldDescriptor::DebugString()
-string FieldDescriptor::FieldTypeNameDebugString() const {
-  switch(type()) {
+std::string FieldDescriptor::FieldTypeNameDebugString() const {
+  switch (type()) {
     case TYPE_MESSAGE:
       return "." + message_type()->full_name();
     case TYPE_ENUM:
@@ -2645,13 +3255,11 @@ string FieldDescriptor::FieldTypeNameDebugString() const {
   }
 }
 
-void FieldDescriptor::DebugString(int depth,
-                                  PrintLabelFlag print_label_flag,
-                                  string *contents,
-                                  const DebugStringOptions&
-                                  debug_string_options) const {
-  string prefix(depth * 2, ' ');
-  string field_type;
+void FieldDescriptor::DebugString(
+    int depth, std::string* contents,
+    const DebugStringOptions& debug_string_options) const {
+  std::string prefix(depth * 2, ' ');
+  std::string field_type;
 
   // Special case map fields.
   if (is_map()) {
@@ -2663,44 +3271,32 @@ void FieldDescriptor::DebugString(int depth,
     field_type = FieldTypeNameDebugString();
   }
 
-  bool print_label = true;
-  // Determine whether to omit label:
-  //   1. For an optional field, omit label if it's in oneof or in proto3.
-  //   2. For a repeated field, omit label if it's a map.
-  if (is_optional() && (print_label_flag == OMIT_LABEL ||
-                        file()->syntax() == FileDescriptor::SYNTAX_PROTO3)) {
-    print_label = false;
-  } else if (is_map()) {
-    print_label = false;
-  }
-  string label;
-  if (print_label) {
-    label = kLabelToName[this->label()];
-    label.push_back(' ');
+  std::string label = StrCat(kLabelToName[this->label()], " ");
+
+  // Label is omitted for maps, oneof, and plain proto3 fields.
+  if (is_map() || real_containing_oneof() ||
+      (is_optional() && !has_optional_keyword())) {
+    label.clear();
   }
 
-  SourceLocationCommentPrinter
-      comment_printer(this, prefix, debug_string_options);
+  SourceLocationCommentPrinter comment_printer(this, prefix,
+                                               debug_string_options);
   comment_printer.AddPreComment(contents);
 
-  strings::SubstituteAndAppend(contents, "$0$1$2 $3 = $4",
-                               prefix,
-                               label,
-                               field_type,
-                               type() == TYPE_GROUP ? message_type()->name() :
-                                                      name(),
-                               number());
+  strings::SubstituteAndAppend(
+      contents, "$0$1$2 $3 = $4", prefix, label, field_type,
+      type() == TYPE_GROUP ? message_type()->name() : name(), number());
 
   bool bracketed = false;
   if (has_default_value()) {
     bracketed = true;
     strings::SubstituteAndAppend(contents, " [default = $0",
-                                 DefaultValueAsString(true));
+                              DefaultValueAsString(true));
   }
   if (has_json_name_) {
     if (!bracketed) {
       bracketed = true;
-      contents->append("[");
+      contents->append(" [");
     } else {
       contents->append(", ");
     }
@@ -2709,7 +3305,7 @@ void FieldDescriptor::DebugString(int depth,
     contents->append("\"");
   }
 
-  string formatted_options;
+  std::string formatted_options;
   if (FormatBracketedOptions(depth, options(), file()->pool(),
                              &formatted_options)) {
     contents->append(bracketed ? ", " : " [");
@@ -2735,25 +3331,25 @@ void FieldDescriptor::DebugString(int depth,
   comment_printer.AddPostComment(contents);
 }
 
-string OneofDescriptor::DebugString() const {
+std::string OneofDescriptor::DebugString() const {
   DebugStringOptions options;  // default values
   return DebugStringWithOptions(options);
 }
 
-string OneofDescriptor::DebugStringWithOptions(
+std::string OneofDescriptor::DebugStringWithOptions(
     const DebugStringOptions& options) const {
-  string contents;
+  std::string contents;
   DebugString(0, &contents, options);
   return contents;
 }
 
-void OneofDescriptor::DebugString(int depth, string* contents,
-                                  const DebugStringOptions&
-                                  debug_string_options) const {
-  string prefix(depth * 2, ' ');
+void OneofDescriptor::DebugString(
+    int depth, std::string* contents,
+    const DebugStringOptions& debug_string_options) const {
+  std::string prefix(depth * 2, ' ');
   ++depth;
-  SourceLocationCommentPrinter
-      comment_printer(this, prefix, debug_string_options);
+  SourceLocationCommentPrinter comment_printer(this, prefix,
+                                               debug_string_options);
   comment_printer.AddPreComment(contents);
   strings::SubstituteAndAppend(contents, "$0oneof $1 {", prefix, name());
 
@@ -2765,38 +3361,36 @@ void OneofDescriptor::DebugString(int depth, string* contents,
   } else {
     contents->append("\n");
     for (int i = 0; i < field_count(); i++) {
-      field(i)->DebugString(depth, FieldDescriptor::OMIT_LABEL, contents,
-                            debug_string_options);
+      field(i)->DebugString(depth, contents, debug_string_options);
     }
     strings::SubstituteAndAppend(contents, "$0}\n", prefix);
   }
   comment_printer.AddPostComment(contents);
 }
 
-string EnumDescriptor::DebugString() const {
+std::string EnumDescriptor::DebugString() const {
   DebugStringOptions options;  // default values
   return DebugStringWithOptions(options);
 }
 
-string EnumDescriptor::DebugStringWithOptions(
+std::string EnumDescriptor::DebugStringWithOptions(
     const DebugStringOptions& options) const {
-  string contents;
+  std::string contents;
   DebugString(0, &contents, options);
   return contents;
 }
 
-void EnumDescriptor::DebugString(int depth, string *contents,
-                                 const DebugStringOptions&
-                                 debug_string_options) const {
-  string prefix(depth * 2, ' ');
+void EnumDescriptor::DebugString(
+    int depth, std::string* contents,
+    const DebugStringOptions& debug_string_options) const {
+  std::string prefix(depth * 2, ' ');
   ++depth;
 
-  SourceLocationCommentPrinter
-      comment_printer(this, prefix, debug_string_options);
+  SourceLocationCommentPrinter comment_printer(this, prefix,
+                                               debug_string_options);
   comment_printer.AddPreComment(contents);
 
-  strings::SubstituteAndAppend(contents, "$0enum $1 {\n",
-                               prefix, name());
+  strings::SubstituteAndAppend(contents, "$0enum $1 {\n", prefix, name());
 
   FormatLineOptions(depth, options(), file()->pool(), contents);
 
@@ -2810,9 +3404,11 @@ void EnumDescriptor::DebugString(int depth, string *contents,
       const EnumDescriptor::ReservedRange* range = reserved_range(i);
       if (range->end == range->start) {
         strings::SubstituteAndAppend(contents, "$0, ", range->start);
+      } else if (range->end == INT_MAX) {
+        strings::SubstituteAndAppend(contents, "$0 to max, ", range->start);
       } else {
-        strings::SubstituteAndAppend(contents, "$0 to $1, ",
-                                     range->start, range->end);
+        strings::SubstituteAndAppend(contents, "$0 to $1, ", range->start,
+                                  range->end);
       }
     }
     contents->replace(contents->size() - 2, 2, ";\n");
@@ -2822,7 +3418,7 @@ void EnumDescriptor::DebugString(int depth, string *contents,
     strings::SubstituteAndAppend(contents, "$0  reserved ", prefix);
     for (int i = 0; i < reserved_name_count(); i++) {
       strings::SubstituteAndAppend(contents, "\"$0\", ",
-                                   CEscape(reserved_name(i)));
+                                CEscape(reserved_name(i)));
     }
     contents->replace(contents->size() - 2, 2, ";\n");
   }
@@ -2832,31 +3428,30 @@ void EnumDescriptor::DebugString(int depth, string *contents,
   comment_printer.AddPostComment(contents);
 }
 
-string EnumValueDescriptor::DebugString() const {
+std::string EnumValueDescriptor::DebugString() const {
   DebugStringOptions options;  // default values
   return DebugStringWithOptions(options);
 }
 
-string EnumValueDescriptor::DebugStringWithOptions(
+std::string EnumValueDescriptor::DebugStringWithOptions(
     const DebugStringOptions& options) const {
-  string contents;
+  std::string contents;
   DebugString(0, &contents, options);
   return contents;
 }
 
-void EnumValueDescriptor::DebugString(int depth, string *contents,
-                                      const DebugStringOptions&
-                                      debug_string_options) const {
-  string prefix(depth * 2, ' ');
+void EnumValueDescriptor::DebugString(
+    int depth, std::string* contents,
+    const DebugStringOptions& debug_string_options) const {
+  std::string prefix(depth * 2, ' ');
 
-  SourceLocationCommentPrinter
-      comment_printer(this, prefix, debug_string_options);
+  SourceLocationCommentPrinter comment_printer(this, prefix,
+                                               debug_string_options);
   comment_printer.AddPreComment(contents);
 
-  strings::SubstituteAndAppend(contents, "$0$1 = $2",
-                               prefix, name(), number());
+  strings::SubstituteAndAppend(contents, "$0$1 = $2", prefix, name(), number());
 
-  string formatted_options;
+  std::string formatted_options;
   if (FormatBracketedOptions(depth, options(), type()->file()->pool(),
                              &formatted_options)) {
     strings::SubstituteAndAppend(contents, " [$0]", formatted_options);
@@ -2866,23 +3461,23 @@ void EnumValueDescriptor::DebugString(int depth, string *contents,
   comment_printer.AddPostComment(contents);
 }
 
-string ServiceDescriptor::DebugString() const {
+std::string ServiceDescriptor::DebugString() const {
   DebugStringOptions options;  // default values
   return DebugStringWithOptions(options);
 }
 
-string ServiceDescriptor::DebugStringWithOptions(
+std::string ServiceDescriptor::DebugStringWithOptions(
     const DebugStringOptions& options) const {
-  string contents;
+  std::string contents;
   DebugString(&contents, options);
   return contents;
 }
 
-void ServiceDescriptor::DebugString(string *contents,
-                                    const DebugStringOptions&
-                                    debug_string_options) const {
-  SourceLocationCommentPrinter
-      comment_printer(this, /* prefix */ "", debug_string_options);
+void ServiceDescriptor::DebugString(
+    std::string* contents,
+    const DebugStringOptions& debug_string_options) const {
+  SourceLocationCommentPrinter comment_printer(this, /* prefix */ "",
+                                               debug_string_options);
   comment_printer.AddPreComment(contents);
 
   strings::SubstituteAndAppend(contents, "service $0 {\n", name());
@@ -2898,40 +3493,38 @@ void ServiceDescriptor::DebugString(string *contents,
   comment_printer.AddPostComment(contents);
 }
 
-string MethodDescriptor::DebugString() const {
+std::string MethodDescriptor::DebugString() const {
   DebugStringOptions options;  // default values
   return DebugStringWithOptions(options);
 }
 
-string MethodDescriptor::DebugStringWithOptions(
+std::string MethodDescriptor::DebugStringWithOptions(
     const DebugStringOptions& options) const {
-  string contents;
+  std::string contents;
   DebugString(0, &contents, options);
   return contents;
 }
 
-void MethodDescriptor::DebugString(int depth, string *contents,
-                                   const DebugStringOptions&
-                                   debug_string_options) const {
-  string prefix(depth * 2, ' ');
+void MethodDescriptor::DebugString(
+    int depth, std::string* contents,
+    const DebugStringOptions& debug_string_options) const {
+  std::string prefix(depth * 2, ' ');
   ++depth;
 
-  SourceLocationCommentPrinter
-      comment_printer(this, prefix, debug_string_options);
+  SourceLocationCommentPrinter comment_printer(this, prefix,
+                                               debug_string_options);
   comment_printer.AddPreComment(contents);
 
-  strings::SubstituteAndAppend(contents, "$0rpc $1($4.$2) returns ($5.$3)",
-                               prefix, name(),
-                               input_type()->full_name(),
-                               output_type()->full_name(),
-                               client_streaming() ? "stream " : "",
-                               server_streaming() ? "stream " : "");
+  strings::SubstituteAndAppend(
+      contents, "$0rpc $1($4.$2) returns ($5.$3)", prefix, name(),
+      input_type()->full_name(), output_type()->full_name(),
+      client_streaming() ? "stream " : "", server_streaming() ? "stream " : "");
 
-  string formatted_options;
+  std::string formatted_options;
   if (FormatLineOptions(depth, options(), service()->file()->pool(),
                         &formatted_options)) {
-    strings::SubstituteAndAppend(contents, " {\n$0$1}\n",
-                                 formatted_options, prefix);
+    strings::SubstituteAndAppend(contents, " {\n$0$1}\n", formatted_options,
+                              prefix);
   } else {
     contents->append(";\n");
   }
@@ -2944,16 +3537,16 @@ void MethodDescriptor::DebugString(int depth, string *contents,
 
 bool FileDescriptor::GetSourceLocation(const std::vector<int>& path,
                                        SourceLocation* out_location) const {
-  GOOGLE_CHECK_NOTNULL(out_location);
+  GOOGLE_CHECK(out_location != nullptr);
   if (source_code_info_) {
     if (const SourceCodeInfo_Location* loc =
-        tables_->GetSourceLocation(path, source_code_info_)) {
-      const RepeatedField<int32>& span = loc->span();
+            tables_->GetSourceLocation(path, source_code_info_)) {
+      const RepeatedField<int32_t>& span = loc->span();
       if (span.size() == 3 || span.size() == 4) {
-        out_location->start_line   = span.Get(0);
+        out_location->start_line = span.Get(0);
         out_location->start_column = span.Get(1);
-        out_location->end_line     = span.Get(span.size() == 3 ? 0 : 2);
-        out_location->end_column   = span.Get(span.size() - 1);
+        out_location->end_line = span.Get(span.size() == 3 ? 0 : 2);
+        out_location->end_column = span.Get(span.size() - 1);
 
         out_location->leading_comments = loc->leading_comments();
         out_location->trailing_comments = loc->trailing_comments();
@@ -2975,9 +3568,9 @@ bool FileDescriptor::GetSourceLocation(SourceLocation* out_location) const {
 bool FieldDescriptor::is_packed() const {
   if (!is_packable()) return false;
   if (file_->syntax() == FileDescriptor::SYNTAX_PROTO2) {
-    return (options_ != NULL) && options_->packed();
+    return (options_ != nullptr) && options_->packed();
   } else {
-    return options_ == NULL || !options_->has_packed() || options_->packed();
+    return options_ == nullptr || !options_->has_packed() || options_->packed();
   }
 }
 
@@ -3037,7 +3630,7 @@ void Descriptor::GetLocationPath(std::vector<int>* output) const {
 
 void FieldDescriptor::GetLocationPath(std::vector<int>* output) const {
   if (is_extension()) {
-    if (extension_scope() == NULL) {
+    if (extension_scope() == nullptr) {
       output->push_back(FileDescriptorProto::kExtensionFieldNumber);
       output->push_back(index());
     } else {
@@ -3096,17 +3689,17 @@ namespace {
 // pointers in the original options, not the mutable copy). The Message must be
 // one of the Options messages in descriptor.proto.
 struct OptionsToInterpret {
-  OptionsToInterpret(const string& ns,
-                     const string& el,
-                     const Message* orig_opt,
+  OptionsToInterpret(const std::string& ns, const std::string& el,
+                     const std::vector<int>& path, const Message* orig_opt,
                      Message* opt)
       : name_scope(ns),
         element_name(el),
+        element_path(path),
         original_options(orig_opt),
-        options(opt) {
-  }
-  string name_scope;
-  string element_name;
+        options(opt) {}
+  std::string name_scope;
+  std::string element_name;
+  std::vector<int> element_path;
   const Message* original_options;
   Message* options;
 };
@@ -3115,8 +3708,7 @@ struct OptionsToInterpret {
 
 class DescriptorBuilder {
  public:
-  DescriptorBuilder(const DescriptorPool* pool,
-                    DescriptorPool::Tables* tables,
+  DescriptorBuilder(const DescriptorPool* pool, DescriptorPool::Tables* tables,
                     DescriptorPool::ErrorCollector* error_collector);
   ~DescriptorBuilder();
 
@@ -3138,7 +3730,7 @@ class DescriptorBuilder {
   std::vector<OptionsToInterpret> options_to_interpret_;
 
   bool had_errors_;
-  string filename_;
+  std::string filename_;
   FileDescriptor* file_;
   FileDescriptorTables* file_tables_;
   std::set<const FileDescriptor*> dependencies_;
@@ -3155,19 +3747,17 @@ class DescriptorBuilder {
   // actually found in possible_undeclared_dependency_, which may be a parent
   // of the symbol actually looked for.
   const FileDescriptor* possible_undeclared_dependency_;
-  string possible_undeclared_dependency_name_;
+  std::string possible_undeclared_dependency_name_;
 
   // If LookupSymbol() could resolve a symbol which is not defined,
   // record the resolved name.  This is only used by AddNotDefinedError()
   // to report a more useful error message.
-  string undefine_resolved_name_;
+  std::string undefine_resolved_name_;
 
-  void AddError(const string& element_name,
-                const Message& descriptor,
+  void AddError(const std::string& element_name, const Message& descriptor,
                 DescriptorPool::ErrorCollector::ErrorLocation location,
-                const string& error);
-  void AddError(const string& element_name,
-                const Message& descriptor,
+                const std::string& error);
+  void AddError(const std::string& element_name, const Message& descriptor,
                 DescriptorPool::ErrorCollector::ErrorLocation location,
                 const char* error);
   void AddRecursiveImportError(const FileDescriptorProto& proto, int from_here);
@@ -3177,19 +3767,18 @@ class DescriptorBuilder {
   // Adds an error indicating that undefined_symbol was not defined.  Must
   // only be called after LookupSymbol() fails.
   void AddNotDefinedError(
-    const string& element_name,
-    const Message& descriptor,
-    DescriptorPool::ErrorCollector::ErrorLocation location,
-    const string& undefined_symbol);
+      const std::string& element_name, const Message& descriptor,
+      DescriptorPool::ErrorCollector::ErrorLocation location,
+      const std::string& undefined_symbol);
 
-  void AddWarning(const string& element_name, const Message& descriptor,
+  void AddWarning(const std::string& element_name, const Message& descriptor,
                   DescriptorPool::ErrorCollector::ErrorLocation location,
-                  const string& error);
+                  const std::string& error);
 
   // Silly helper which determines if the given file is in the given package.
   // I.e., either file->package() == package_name or file->package() is a
   // nested package within package_name.
-  bool IsInPackage(const FileDescriptor* file, const string& package_name);
+  bool IsInPackage(const FileDescriptor* file, const std::string& package_name);
 
   // Helper function which finds all public dependencies of the given file, and
   // stores the them in the dependencies_ set in the builder.
@@ -3199,15 +3788,16 @@ class DescriptorBuilder {
   // - Search the pool's underlay if not found in tables_.
   // - Insure that the resulting Symbol is from one of the file's declared
   //   dependencies.
-  Symbol FindSymbol(const string& name, bool build_it = true);
+  Symbol FindSymbol(const std::string& name, bool build_it = true);
 
   // Like FindSymbol() but does not require that the symbol is in one of the
   // file's declared dependencies.
-  Symbol FindSymbolNotEnforcingDeps(const string& name, bool build_it = true);
+  Symbol FindSymbolNotEnforcingDeps(const std::string& name,
+                                    bool build_it = true);
 
   // This implements the body of FindSymbolNotEnforcingDeps().
   Symbol FindSymbolNotEnforcingDepsHelper(const DescriptorPool* pool,
-                                          const string& name,
+                                          const std::string& name,
                                           bool build_it = true);
 
   // Like FindSymbol(), but looks up the name relative to some other symbol
@@ -3224,10 +3814,8 @@ class DescriptorBuilder {
   // that LookupSymbol may still return a non-type symbol in LOOKUP_TYPES mode,
   // if it believes that's all it could refer to.  The caller should always
   // check that it receives the type of symbol it was expecting.
-  enum ResolveMode {
-    LOOKUP_ALL, LOOKUP_TYPES
-  };
-  Symbol LookupSymbol(const string& name, const string& relative_to,
+  enum ResolveMode { LOOKUP_ALL, LOOKUP_TYPES };
+  Symbol LookupSymbol(const std::string& name, const std::string& relative_to,
                       DescriptorPool::PlaceholderType placeholder_type =
                           DescriptorPool::PLACEHOLDER_MESSAGE,
                       ResolveMode resolve_mode = LOOKUP_ALL,
@@ -3235,29 +3823,28 @@ class DescriptorBuilder {
 
   // Like LookupSymbol() but will not return a placeholder even if
   // AllowUnknownDependencies() has been used.
-  Symbol LookupSymbolNoPlaceholder(const string& name,
-                                   const string& relative_to,
+  Symbol LookupSymbolNoPlaceholder(const std::string& name,
+                                   const std::string& relative_to,
                                    ResolveMode resolve_mode = LOOKUP_ALL,
                                    bool build_it = true);
 
   // Calls tables_->AddSymbol() and records an error if it fails.  Returns
   // true if successful or false if failed, though most callers can ignore
   // the return value since an error has already been recorded.
-  bool AddSymbol(const string& full_name,
-                 const void* parent, const string& name,
-                 const Message& proto, Symbol symbol);
+  bool AddSymbol(const std::string& full_name, const void* parent,
+                 const std::string& name, const Message& proto, Symbol symbol);
 
   // Like AddSymbol(), but succeeds if the symbol is already defined as long
   // as the existing definition is also a package (because it's OK to define
   // the same package in two different files).  Also adds all parents of the
-  // packgae to the symbol table (e.g. AddPackage("foo.bar", ...) will add
+  // package to the symbol table (e.g. AddPackage("foo.bar", ...) will add
   // "foo.bar" and "foo" to the table).
-  void AddPackage(const string& name, const Message& proto,
-                  const FileDescriptor* file);
+  void AddPackage(const std::string& name, const Message& proto,
+                  FileDescriptor* file);
 
   // Checks that the symbol name contains only alphanumeric characters and
   // underscores.  Records an error otherwise.
-  void ValidateSymbolName(const string& name, const string& full_name,
+  void ValidateSymbolName(const std::string& name, const std::string& full_name,
                           const Message& proto);
 
   // Used by BUILD_ARRAY macro (below) to avoid having to have the type
@@ -3271,36 +3858,41 @@ class DescriptorBuilder {
   // descriptor. Remembers its uninterpreted options, to be interpreted
   // later. DescriptorT must be one of the Descriptor messages from
   // descriptor.proto.
-  template<class DescriptorT> void AllocateOptions(
-      const typename DescriptorT::OptionsType& orig_options,
-      DescriptorT* descriptor);
+  template <class DescriptorT>
+  void AllocateOptions(const typename DescriptorT::OptionsType& orig_options,
+                       DescriptorT* descriptor, int options_field_tag,
+                       const std::string& option_name);
   // Specialization for FileOptions.
   void AllocateOptions(const FileOptions& orig_options,
                        FileDescriptor* descriptor);
 
   // Implementation for AllocateOptions(). Don't call this directly.
-  template<class DescriptorT> void AllocateOptionsImpl(
-      const string& name_scope,
-      const string& element_name,
+  template <class DescriptorT>
+  void AllocateOptionsImpl(
+      const std::string& name_scope, const std::string& element_name,
       const typename DescriptorT::OptionsType& orig_options,
-      DescriptorT* descriptor);
+      DescriptorT* descriptor, const std::vector<int>& options_path,
+      const std::string& option_name);
+
+  // Allocates an array of two strings, the first one is a copy of `proto_name`,
+  // and the second one is the full name.
+  // Full proto name is "scope.proto_name" if scope is non-empty and
+  // "proto_name" otherwise.
+  const std::string* AllocateNameStrings(const std::string& scope,
+                                         const std::string& proto_name);
 
   // These methods all have the same signature for the sake of the BUILD_ARRAY
   // macro, below.
-  void BuildMessage(const DescriptorProto& proto,
-                    const Descriptor* parent,
+  void BuildMessage(const DescriptorProto& proto, const Descriptor* parent,
                     Descriptor* result);
   void BuildFieldOrExtension(const FieldDescriptorProto& proto,
-                             const Descriptor* parent,
-                             FieldDescriptor* result,
+                             Descriptor* parent, FieldDescriptor* result,
                              bool is_extension);
-  void BuildField(const FieldDescriptorProto& proto,
-                  const Descriptor* parent,
+  void BuildField(const FieldDescriptorProto& proto, Descriptor* parent,
                   FieldDescriptor* result) {
     BuildFieldOrExtension(proto, parent, result, false);
   }
-  void BuildExtension(const FieldDescriptorProto& proto,
-                      const Descriptor* parent,
+  void BuildExtension(const FieldDescriptorProto& proto, Descriptor* parent,
                       FieldDescriptor* result) {
     BuildFieldOrExtension(proto, parent, result, true);
   }
@@ -3308,28 +3900,24 @@ class DescriptorBuilder {
                            const Descriptor* parent,
                            Descriptor::ExtensionRange* result);
   void BuildReservedRange(const DescriptorProto::ReservedRange& proto,
-                           const Descriptor* parent,
-                           Descriptor::ReservedRange* result);
+                          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,
+  void BuildOneof(const OneofDescriptorProto& proto, Descriptor* parent,
                   OneofDescriptor* result);
   void CheckEnumValueUniqueness(const EnumDescriptorProto& proto,
                                 const EnumDescriptor* result);
-  void BuildEnum(const EnumDescriptorProto& proto,
-                 const Descriptor* parent,
+  void BuildEnum(const EnumDescriptorProto& proto, const Descriptor* parent,
                  EnumDescriptor* result);
   void BuildEnumValue(const EnumValueDescriptorProto& proto,
                       const EnumDescriptor* parent,
                       EnumValueDescriptor* result);
-  void BuildService(const ServiceDescriptorProto& proto,
-                    const void* dummy,
+  void BuildService(const ServiceDescriptorProto& proto, const void* dummy,
                     ServiceDescriptor* result);
   void BuildMethod(const MethodDescriptorProto& proto,
-                   const ServiceDescriptor* parent,
-                   MethodDescriptor* result);
+                   const ServiceDescriptor* parent, MethodDescriptor* result);
 
   void LogUnusedDependency(const FileDescriptorProto& proto,
                            const FileDescriptor* result);
@@ -3361,8 +3949,8 @@ class DescriptorBuilder {
   class OptionInterpreter {
    public:
     // Creates an interpreter that operates in the context of the pool of the
-    // specified builder, which must not be NULL. We don't take ownership of the
-    // builder.
+    // specified builder, which must not be nullptr. We don't take ownership of
+    // the builder.
     explicit OptionInterpreter(DescriptorBuilder* builder);
 
     ~OptionInterpreter();
@@ -3372,13 +3960,22 @@ class DescriptorBuilder {
     // Otherwise returns true.
     bool InterpretOptions(OptionsToInterpret* options_to_interpret);
 
+    // Updates the given source code info by re-writing uninterpreted option
+    // locations to refer to the corresponding interpreted option.
+    void UpdateSourceCodeInfo(SourceCodeInfo* info);
+
     class AggregateOptionFinder;
 
    private:
     // Interprets uninterpreted_option_ on the specified message, which
     // must be the mutable copy of the original options message to which
-    // uninterpreted_option_ belongs.
-    bool InterpretSingleOption(Message* options);
+    // uninterpreted_option_ belongs. The given src_path is the source
+    // location path to the uninterpreted option, and options_path is the
+    // source location path to the options message. The location paths are
+    // recorded and then used in UpdateSourceCodeInfo.
+    bool InterpretSingleOption(Message* options,
+                               const std::vector<int>& src_path,
+                               const std::vector<int>& options_path);
 
     // Adds the uninterpreted_option to the given options message verbatim.
     // Used when AllowUnknownDependencies() is in effect and we can't find
@@ -3394,7 +3991,8 @@ class DescriptorBuilder {
             intermediate_fields_iter,
         std::vector<const FieldDescriptor*>::const_iterator
             intermediate_fields_end,
-        const FieldDescriptor* innermost_field, const string& debug_msg_name,
+        const FieldDescriptor* innermost_field,
+        const std::string& debug_msg_name,
         const UnknownFieldSet& unknown_fields);
 
     // Validates the value for the option field of the currently interpreted
@@ -3409,19 +4007,19 @@ class DescriptorBuilder {
 
     // Convenience functions to set an int field the right way, depending on
     // its wire type (a single int CppType can represent multiple wire types).
-    void SetInt32(int number, int32 value, FieldDescriptor::Type type,
+    void SetInt32(int number, int32_t value, FieldDescriptor::Type type,
                   UnknownFieldSet* unknown_fields);
-    void SetInt64(int number, int64 value, FieldDescriptor::Type type,
+    void SetInt64(int number, int64_t value, FieldDescriptor::Type type,
                   UnknownFieldSet* unknown_fields);
-    void SetUInt32(int number, uint32 value, FieldDescriptor::Type type,
+    void SetUInt32(int number, uint32_t value, FieldDescriptor::Type type,
                    UnknownFieldSet* unknown_fields);
-    void SetUInt64(int number, uint64 value, FieldDescriptor::Type type,
+    void SetUInt64(int number, uint64_t value, FieldDescriptor::Type type,
                    UnknownFieldSet* unknown_fields);
 
     // A helper function that adds an error at the specified location of the
     // option we're currently interpreting, and returns false.
     bool AddOptionError(DescriptorPool::ErrorCollector::ErrorLocation location,
-                        const string& msg) {
+                        const std::string& msg) {
       builder_->AddError(options_to_interpret_->element_name,
                          *uninterpreted_option_, location, msg);
       return false;
@@ -3429,30 +4027,44 @@ class DescriptorBuilder {
 
     // A helper function that adds an error at the location of the option name
     // and returns false.
-    bool AddNameError(const string& msg) {
+    bool AddNameError(const std::string& msg) {
+#ifdef PROTOBUF_INTERNAL_IGNORE_FIELD_NAME_ERRORS_
+      return true;
+#else   // PROTOBUF_INTERNAL_IGNORE_FIELD_NAME_ERRORS_
       return AddOptionError(DescriptorPool::ErrorCollector::OPTION_NAME, msg);
+#endif  // PROTOBUF_INTERNAL_IGNORE_FIELD_NAME_ERRORS_
     }
 
     // A helper function that adds an error at the location of the option name
     // and returns false.
-    bool AddValueError(const string& msg) {
+    bool AddValueError(const std::string& msg) {
       return AddOptionError(DescriptorPool::ErrorCollector::OPTION_VALUE, msg);
     }
 
-    // We interpret against this builder's pool. Is never NULL. We don't own
+    // We interpret against this builder's pool. Is never nullptr. We don't own
     // this pointer.
     DescriptorBuilder* builder_;
 
-    // The options we're currently interpreting, or NULL if we're not in a call
-    // to InterpretOptions.
+    // The options we're currently interpreting, or nullptr if we're not in a
+    // call to InterpretOptions.
     const OptionsToInterpret* options_to_interpret_;
 
     // The option we're currently interpreting within options_to_interpret_, or
-    // NULL if we're not in a call to InterpretOptions(). This points to a
+    // nullptr if we're not in a call to InterpretOptions(). This points to a
     // submessage of the original option, not the mutable copy. Therefore we
     // can use it to find locations recorded by the parser.
     const UninterpretedOption* uninterpreted_option_;
 
+    // This maps the element path of uninterpreted options to the element path
+    // of the resulting interpreted option. This is used to modify a file's
+    // source code info to account for option interpretation.
+    std::map<std::vector<int>, std::vector<int>> interpreted_paths_;
+
+    // This maps the path to a repeated option field to the known number of
+    // elements the field contains. This is used to track the compute the
+    // index portion of the element path when interpreting a single option.
+    std::map<std::vector<int>, int> repeated_option_counts_;
+
     // Factory used to create the dynamic messages we need to parse
     // any aggregate option values we encounter.
     DynamicMessageFactory dynamic_factory_;
@@ -3477,10 +4089,10 @@ class DescriptorBuilder {
     return pool->enforce_weak_;
   }
   static inline bool get_is_placeholder(const Descriptor* descriptor) {
-    return descriptor->is_placeholder_;
+    return descriptor != nullptr && descriptor->is_placeholder_;
   }
   static inline void assert_mutex_held(const DescriptorPool* pool) {
-    if (pool->mutex_ != NULL) {
+    if (pool->mutex_ != nullptr) {
       pool->mutex_->AssertHeld();
     }
   }
@@ -3501,14 +4113,15 @@ class DescriptorBuilder {
                            const EnumDescriptorProto& proto);
   void ValidateEnumValueOptions(EnumValueDescriptor* enum_value,
                                 const EnumValueDescriptorProto& proto);
+  void ValidateExtensionRangeOptions(
+      const std::string& full_name, Descriptor::ExtensionRange* extension_range,
+      const DescriptorProto_ExtensionRange& proto);
   void ValidateServiceOptions(ServiceDescriptor* service,
                               const ServiceDescriptorProto& proto);
   void ValidateMethodOptions(MethodDescriptor* method,
                              const MethodDescriptorProto& proto);
-  void ValidateProto3(FileDescriptor* file,
-                      const FileDescriptorProto& proto);
-  void ValidateProto3Message(Descriptor* message,
-                             const DescriptorProto& proto);
+  void ValidateProto3(FileDescriptor* file, const FileDescriptorProto& proto);
+  void ValidateProto3Message(Descriptor* message, const DescriptorProto& proto);
   void ValidateProto3Field(FieldDescriptor* field,
                            const FieldDescriptorProto& proto);
   void ValidateProto3Enum(EnumDescriptor* enm,
@@ -3530,119 +4143,116 @@ class DescriptorBuilder {
 
 const FileDescriptor* DescriptorPool::BuildFile(
     const FileDescriptorProto& proto) {
-  GOOGLE_CHECK(fallback_database_ == NULL)
-    << "Cannot call BuildFile on a DescriptorPool that uses a "
-       "DescriptorDatabase.  You must instead find a way to get your file "
-       "into the underlying database.";
-  GOOGLE_CHECK(mutex_ == NULL);   // Implied by the above GOOGLE_CHECK.
+  GOOGLE_CHECK(fallback_database_ == nullptr)
+      << "Cannot call BuildFile on a DescriptorPool that uses a "
+         "DescriptorDatabase.  You must instead find a way to get your file "
+         "into the underlying database.";
+  GOOGLE_CHECK(mutex_ == nullptr);  // Implied by the above GOOGLE_CHECK.
   tables_->known_bad_symbols_.clear();
   tables_->known_bad_files_.clear();
-  return DescriptorBuilder(this, tables_.get(), NULL).BuildFile(proto);
+  return DescriptorBuilder(this, tables_.get(), nullptr).BuildFile(proto);
 }
 
 const FileDescriptor* DescriptorPool::BuildFileCollectingErrors(
-    const FileDescriptorProto& proto,
-    ErrorCollector* error_collector) {
-  GOOGLE_CHECK(fallback_database_ == NULL)
-    << "Cannot call BuildFile on a DescriptorPool that uses a "
-       "DescriptorDatabase.  You must instead find a way to get your file "
-       "into the underlying database.";
-  GOOGLE_CHECK(mutex_ == NULL);   // Implied by the above GOOGLE_CHECK.
+    const FileDescriptorProto& proto, ErrorCollector* error_collector) {
+  GOOGLE_CHECK(fallback_database_ == nullptr)
+      << "Cannot call BuildFile on a DescriptorPool that uses a "
+         "DescriptorDatabase.  You must instead find a way to get your file "
+         "into the underlying database.";
+  GOOGLE_CHECK(mutex_ == nullptr);  // Implied by the above GOOGLE_CHECK.
   tables_->known_bad_symbols_.clear();
   tables_->known_bad_files_.clear();
-  return DescriptorBuilder(this, tables_.get(),
-                           error_collector).BuildFile(proto);
+  return DescriptorBuilder(this, tables_.get(), error_collector)
+      .BuildFile(proto);
 }
 
 const FileDescriptor* DescriptorPool::BuildFileFromDatabase(
     const FileDescriptorProto& proto) const {
   mutex_->AssertHeld();
   if (tables_->known_bad_files_.count(proto.name()) > 0) {
-    return NULL;
+    return nullptr;
   }
   const FileDescriptor* result =
-      DescriptorBuilder(this, tables_.get(),
-                        default_error_collector_).BuildFile(proto);
-  if (result == NULL) {
+      DescriptorBuilder(this, tables_.get(), default_error_collector_)
+          .BuildFile(proto);
+  if (result == nullptr) {
     tables_->known_bad_files_.insert(proto.name());
   }
   return result;
 }
 
 DescriptorBuilder::DescriptorBuilder(
-    const DescriptorPool* pool,
-    DescriptorPool::Tables* tables,
+    const DescriptorPool* pool, DescriptorPool::Tables* tables,
     DescriptorPool::ErrorCollector* error_collector)
-  : pool_(pool),
-    tables_(tables),
-    error_collector_(error_collector),
-    had_errors_(false),
-    possible_undeclared_dependency_(NULL),
-    undefine_resolved_name_("") {}
+    : pool_(pool),
+      tables_(tables),
+      error_collector_(error_collector),
+      had_errors_(false),
+      possible_undeclared_dependency_(nullptr),
+      undefine_resolved_name_("") {}
 
 DescriptorBuilder::~DescriptorBuilder() {}
 
 void DescriptorBuilder::AddError(
-    const string& element_name,
-    const Message& descriptor,
+    const std::string& element_name, const Message& descriptor,
     DescriptorPool::ErrorCollector::ErrorLocation location,
-    const string& error) {
-  if (error_collector_ == NULL) {
+    const std::string& error) {
+  if (error_collector_ == nullptr) {
     if (!had_errors_) {
       GOOGLE_LOG(ERROR) << "Invalid proto descriptor for file \"" << filename_
                  << "\":";
     }
     GOOGLE_LOG(ERROR) << "  " << element_name << ": " << error;
   } else {
-    error_collector_->AddError(filename_, element_name,
-                               &descriptor, location, error);
+    error_collector_->AddError(filename_, element_name, &descriptor, location,
+                               error);
   }
   had_errors_ = true;
 }
 
 void DescriptorBuilder::AddError(
-    const string& element_name,
-    const Message& descriptor,
-    DescriptorPool::ErrorCollector::ErrorLocation location,
-    const char* error) {
-  AddError(element_name, descriptor, location, string(error));
+    const std::string& element_name, const Message& descriptor,
+    DescriptorPool::ErrorCollector::ErrorLocation location, const char* error) {
+  AddError(element_name, descriptor, location, std::string(error));
 }
 
 void DescriptorBuilder::AddNotDefinedError(
-    const string& element_name,
-    const Message& descriptor,
+    const std::string& element_name, const Message& descriptor,
     DescriptorPool::ErrorCollector::ErrorLocation location,
-    const string& undefined_symbol) {
-  if (possible_undeclared_dependency_ == NULL &&
+    const std::string& undefined_symbol) {
+  if (possible_undeclared_dependency_ == nullptr &&
       undefine_resolved_name_.empty()) {
     AddError(element_name, descriptor, location,
              "\"" + undefined_symbol + "\" is not defined.");
   } else {
-    if (possible_undeclared_dependency_ != NULL) {
+    if (possible_undeclared_dependency_ != nullptr) {
       AddError(element_name, descriptor, location,
                "\"" + possible_undeclared_dependency_name_ +
-               "\" seems to be defined in \"" +
-               possible_undeclared_dependency_->name() + "\", which is not "
-               "imported by \"" + filename_ + "\".  To use it here, please "
-               "add the necessary import.");
+                   "\" seems to be defined in \"" +
+                   possible_undeclared_dependency_->name() +
+                   "\", which is not "
+                   "imported by \"" +
+                   filename_ +
+                   "\".  To use it here, please "
+                   "add the necessary import.");
     }
     if (!undefine_resolved_name_.empty()) {
       AddError(element_name, descriptor, location,
                "\"" + undefined_symbol + "\" is resolved to \"" +
-               undefine_resolved_name_ + "\", which is not defined. "
-               "The innermost scope is searched first in name resolution. "
-               "Consider using a leading '.'(i.e., \"."
-               + undefined_symbol +
-               "\") to start from the outermost scope.");
+                   undefine_resolved_name_ +
+                   "\", which is not defined. "
+                   "The innermost scope is searched first in name resolution. "
+                   "Consider using a leading '.'(i.e., \"." +
+                   undefined_symbol + "\") to start from the outermost scope.");
     }
   }
 }
 
 void DescriptorBuilder::AddWarning(
-    const string& element_name, const Message& descriptor,
+    const std::string& element_name, const Message& descriptor,
     DescriptorPool::ErrorCollector::ErrorLocation location,
-    const string& error) {
-  if (error_collector_ == NULL) {
+    const std::string& error) {
+  if (error_collector_ == nullptr) {
     GOOGLE_LOG(WARNING) << filename_ << " " << element_name << ": " << error;
   } else {
     error_collector_->AddWarning(filename_, element_name, &descriptor, location,
@@ -3651,27 +4261,27 @@ void DescriptorBuilder::AddWarning(
 }
 
 bool DescriptorBuilder::IsInPackage(const FileDescriptor* file,
-                                    const string& package_name) {
+                                    const std::string& package_name) {
   return HasPrefixString(file->package(), package_name) &&
          (file->package().size() == package_name.size() ||
           file->package()[package_name.size()] == '.');
 }
 
 void DescriptorBuilder::RecordPublicDependencies(const FileDescriptor* file) {
-  if (file == NULL || !dependencies_.insert(file).second) return;
-  for (int i = 0; file != NULL && i < file->public_dependency_count(); i++) {
+  if (file == nullptr || !dependencies_.insert(file).second) return;
+  for (int i = 0; file != nullptr && i < file->public_dependency_count(); i++) {
     RecordPublicDependencies(file->public_dependency(i));
   }
 }
 
 Symbol DescriptorBuilder::FindSymbolNotEnforcingDepsHelper(
-    const DescriptorPool* pool, const string& name, bool build_it) {
+    const DescriptorPool* pool, const std::string& name, bool build_it) {
   // If we are looking at an underlay, we must lock its mutex_, since we are
   // accessing the underlay's tables_ directly.
-  MutexLockMaybe lock((pool == pool_) ? NULL : pool->mutex_);
+  MutexLockMaybe lock((pool == pool_) ? nullptr : pool->mutex_);
 
   Symbol result = pool->tables_->FindSymbol(name);
-  if (result.IsNull() && pool->underlay_ != NULL) {
+  if (result.IsNull() && pool->underlay_ != nullptr) {
     // Symbol not found; check the underlay.
     result = FindSymbolNotEnforcingDepsHelper(pool->underlay_, name);
   }
@@ -3692,12 +4302,19 @@ Symbol DescriptorBuilder::FindSymbolNotEnforcingDepsHelper(
   return result;
 }
 
-Symbol DescriptorBuilder::FindSymbolNotEnforcingDeps(const string& name,
+Symbol DescriptorBuilder::FindSymbolNotEnforcingDeps(const std::string& name,
                                                      bool build_it) {
-  return FindSymbolNotEnforcingDepsHelper(pool_, name, build_it);
+  Symbol result = FindSymbolNotEnforcingDepsHelper(pool_, name, build_it);
+  // Only find symbols which were defined in this file or one of its
+  // dependencies.
+  const FileDescriptor* file = result.GetFile();
+  if (file == file_ || dependencies_.count(file) > 0) {
+    unused_dependency_.erase(file);
+  }
+  return result;
 }
 
-Symbol DescriptorBuilder::FindSymbol(const string& name, bool build_it) {
+Symbol DescriptorBuilder::FindSymbol(const std::string& name, bool build_it) {
   Symbol result = FindSymbolNotEnforcingDeps(name, build_it);
 
   if (result.IsNull()) return result;
@@ -3711,11 +4328,10 @@ Symbol DescriptorBuilder::FindSymbol(const string& name, bool build_it) {
   // dependencies.
   const FileDescriptor* file = result.GetFile();
   if (file == file_ || dependencies_.count(file) > 0) {
-    unused_dependency_.erase(file);
     return result;
   }
 
-  if (result.type == Symbol::PACKAGE) {
+  if (result.type() == Symbol::PACKAGE) {
     // Arg, this is overcomplicated.  The symbol is a package name.  It could
     // be that the package was defined in multiple files.  result.GetFile()
     // returns the first file we saw that used this package.  We've determined
@@ -3727,8 +4343,8 @@ Symbol DescriptorBuilder::FindSymbol(const string& name, bool build_it) {
     for (std::set<const FileDescriptor*>::const_iterator it =
              dependencies_.begin();
          it != dependencies_.end(); ++it) {
-      // Note:  A dependency may be NULL if it was not found or had errors.
-      if (*it != NULL && IsInPackage(*it, name)) return result;
+      // Note:  A dependency may be nullptr if it was not found or had errors.
+      if (*it != nullptr && IsInPackage(*it, name)) return result;
     }
   }
 
@@ -3737,11 +4353,10 @@ Symbol DescriptorBuilder::FindSymbol(const string& name, bool build_it) {
   return kNullSymbol;
 }
 
-Symbol DescriptorBuilder::LookupSymbolNoPlaceholder(const string& name,
-                                                    const string& relative_to,
-                                                    ResolveMode resolve_mode,
-                                                    bool build_it) {
-  possible_undeclared_dependency_ = NULL;
+Symbol DescriptorBuilder::LookupSymbolNoPlaceholder(
+    const std::string& name, const std::string& relative_to,
+    ResolveMode resolve_mode, bool build_it) {
+  possible_undeclared_dependency_ = nullptr;
   undefine_resolved_name_.clear();
 
   if (!name.empty() && name[0] == '.') {
@@ -3760,27 +4375,27 @@ Symbol DescriptorBuilder::LookupSymbolNoPlaceholder(const string& name,
   //   }
   // So, we look for just "Foo" first, then look for "Bar.baz" within it if
   // found.
-  string::size_type name_dot_pos = name.find_first_of('.');
-  string first_part_of_name;
-  if (name_dot_pos == string::npos) {
+  std::string::size_type name_dot_pos = name.find_first_of('.');
+  std::string first_part_of_name;
+  if (name_dot_pos == std::string::npos) {
     first_part_of_name = name;
   } else {
     first_part_of_name = name.substr(0, name_dot_pos);
   }
 
-  string scope_to_try(relative_to);
+  std::string scope_to_try(relative_to);
 
   while (true) {
     // Chop off the last component of the scope.
-    string::size_type dot_pos = scope_to_try.find_last_of('.');
-    if (dot_pos == string::npos) {
+    std::string::size_type dot_pos = scope_to_try.find_last_of('.');
+    if (dot_pos == std::string::npos) {
       return FindSymbol(name, build_it);
     } else {
       scope_to_try.erase(dot_pos);
     }
 
     // Append ".first_part_of_name" and try to find.
-    string::size_type old_size = scope_to_try.size();
+    std::string::size_type old_size = scope_to_try.size();
     scope_to_try.append(1, '.');
     scope_to_try.append(first_part_of_name);
     Symbol result = FindSymbol(scope_to_try, build_it);
@@ -3814,7 +4429,7 @@ Symbol DescriptorBuilder::LookupSymbolNoPlaceholder(const string& name,
 }
 
 Symbol DescriptorBuilder::LookupSymbol(
-    const string& name, const string& relative_to,
+    const std::string& name, const std::string& relative_to,
     DescriptorPool::PlaceholderType placeholder_type, ResolveMode resolve_mode,
     bool build_it) {
   Symbol result =
@@ -3827,16 +4442,16 @@ Symbol DescriptorBuilder::LookupSymbol(
   return result;
 }
 
-static bool ValidateQualifiedName(const string& name) {
+static bool ValidateQualifiedName(StringPiece name) {
   bool last_was_period = false;
 
-  for (int i = 0; i < name.size(); i++) {
+  for (char character : name) {
     // I don't trust isalnum() due to locales.  :(
-    if (('a' <= name[i] && name[i] <= 'z') ||
-        ('A' <= name[i] && name[i] <= 'Z') ||
-        ('0' <= name[i] && name[i] <= '9') || (name[i] == '_')) {
+    if (('a' <= character && character <= 'z') ||
+        ('A' <= character && character <= 'Z') ||
+        ('0' <= character && character <= '9') || (character == '_')) {
       last_was_period = false;
-    } else if (name[i] == '.') {
+    } else if (character == '.') {
       if (last_was_period) return false;
       last_was_period = true;
     } else {
@@ -3847,36 +4462,35 @@ static bool ValidateQualifiedName(const string& name) {
   return !name.empty() && !last_was_period;
 }
 
-Symbol DescriptorPool::NewPlaceholder(const string& name,
+Symbol DescriptorPool::NewPlaceholder(StringPiece name,
                                       PlaceholderType placeholder_type) const {
   MutexLockMaybe lock(mutex_);
   return NewPlaceholderWithMutexHeld(name, placeholder_type);
 }
 
 Symbol DescriptorPool::NewPlaceholderWithMutexHeld(
-    const string& name, PlaceholderType placeholder_type) const {
+    StringPiece name, PlaceholderType placeholder_type) const {
   if (mutex_) {
     mutex_->AssertHeld();
   }
   // Compute names.
-  const string* placeholder_full_name;
-  const string* placeholder_name;
-  const string* placeholder_package;
+  StringPiece placeholder_full_name;
+  StringPiece placeholder_name;
+  const std::string* placeholder_package;
 
   if (!ValidateQualifiedName(name)) return kNullSymbol;
   if (name[0] == '.') {
     // Fully-qualified.
-    placeholder_full_name = tables_->AllocateString(name.substr(1));
+    placeholder_full_name = name.substr(1);
   } else {
-    placeholder_full_name = tables_->AllocateString(name);
+    placeholder_full_name = name;
   }
 
-  string::size_type dotpos = placeholder_full_name->find_last_of('.');
-  if (dotpos != string::npos) {
-    placeholder_package = tables_->AllocateString(
-      placeholder_full_name->substr(0, dotpos));
-    placeholder_name = tables_->AllocateString(
-      placeholder_full_name->substr(dotpos + 1));
+  std::string::size_type dotpos = placeholder_full_name.find_last_of('.');
+  if (dotpos != std::string::npos) {
+    placeholder_package =
+        tables_->AllocateString(placeholder_full_name.substr(0, dotpos));
+    placeholder_name = placeholder_full_name.substr(dotpos + 1);
   } else {
     placeholder_package = &internal::GetEmptyString();
     placeholder_name = placeholder_full_name;
@@ -3884,19 +4498,18 @@ Symbol DescriptorPool::NewPlaceholderWithMutexHeld(
 
   // Create the placeholders.
   FileDescriptor* placeholder_file = NewPlaceholderFileWithMutexHeld(
-      *placeholder_full_name + ".placeholder.proto");
+      StrCat(placeholder_full_name, ".placeholder.proto"));
   placeholder_file->package_ = placeholder_package;
 
   if (placeholder_type == PLACEHOLDER_ENUM) {
     placeholder_file->enum_type_count_ = 1;
-    placeholder_file->enum_types_ =
-      tables_->AllocateArray<EnumDescriptor>(1);
+    placeholder_file->enum_types_ = tables_->AllocateArray<EnumDescriptor>(1);
 
     EnumDescriptor* placeholder_enum = &placeholder_file->enum_types_[0];
-    memset(placeholder_enum, 0, sizeof(*placeholder_enum));
+    memset(static_cast<void*>(placeholder_enum), 0, sizeof(*placeholder_enum));
 
-    placeholder_enum->full_name_ = placeholder_full_name;
-    placeholder_enum->name_ = placeholder_name;
+    placeholder_enum->all_names_ =
+        tables_->AllocateStringArray(placeholder_name, placeholder_full_name);
     placeholder_enum->file_ = placeholder_file;
     placeholder_enum->options_ = &EnumOptions::default_instance();
     placeholder_enum->is_placeholder_ = true;
@@ -3905,15 +4518,18 @@ Symbol DescriptorPool::NewPlaceholderWithMutexHeld(
     // Enums must have at least one value.
     placeholder_enum->value_count_ = 1;
     placeholder_enum->values_ = tables_->AllocateArray<EnumValueDescriptor>(1);
+    // Disable fast-path lookup for this enum.
+    placeholder_enum->sequential_value_limit_ = -1;
 
     EnumValueDescriptor* placeholder_value = &placeholder_enum->values_[0];
-    memset(placeholder_value, 0, sizeof(*placeholder_value));
+    memset(static_cast<void*>(placeholder_value), 0,
+           sizeof(*placeholder_value));
 
-    placeholder_value->name_ = tables_->AllocateString("PLACEHOLDER_VALUE");
     // Note that enum value names are siblings of their type, not children.
-    placeholder_value->full_name_ =
-      placeholder_package->empty() ? placeholder_value->name_ :
-        tables_->AllocateString(*placeholder_package + ".PLACEHOLDER_VALUE");
+    placeholder_value->all_names_ = tables_->AllocateStringArray(
+        "PLACEHOLDER_VALUE", placeholder_package->empty()
+                                 ? "PLACEHOLDER_VALUE"
+                                 : *placeholder_package + ".PLACEHOLDER_VALUE");
 
     placeholder_value->number_ = 0;
     placeholder_value->type_ = placeholder_enum;
@@ -3922,14 +4538,14 @@ Symbol DescriptorPool::NewPlaceholderWithMutexHeld(
     return Symbol(placeholder_enum);
   } else {
     placeholder_file->message_type_count_ = 1;
-    placeholder_file->message_types_ =
-      tables_->AllocateArray<Descriptor>(1);
+    placeholder_file->message_types_ = tables_->AllocateArray<Descriptor>(1);
 
     Descriptor* placeholder_message = &placeholder_file->message_types_[0];
-    memset(placeholder_message, 0, sizeof(*placeholder_message));
+    memset(static_cast<void*>(placeholder_message), 0,
+           sizeof(*placeholder_message));
 
-    placeholder_message->full_name_ = placeholder_full_name;
-    placeholder_message->name_ = placeholder_name;
+    placeholder_message->all_names_ =
+        tables_->AllocateStringArray(placeholder_name, placeholder_full_name);
     placeholder_message->file_ = placeholder_file;
     placeholder_message->options_ = &MessageOptions::default_instance();
     placeholder_message->is_placeholder_ = true;
@@ -3938,29 +4554,31 @@ Symbol DescriptorPool::NewPlaceholderWithMutexHeld(
     if (placeholder_type == PLACEHOLDER_EXTENDABLE_MESSAGE) {
       placeholder_message->extension_range_count_ = 1;
       placeholder_message->extension_ranges_ =
-        tables_->AllocateArray<Descriptor::ExtensionRange>(1);
+          tables_->AllocateArray<Descriptor::ExtensionRange>(1);
       placeholder_message->extension_ranges_->start = 1;
       // kMaxNumber + 1 because ExtensionRange::end is exclusive.
       placeholder_message->extension_ranges_->end =
-        FieldDescriptor::kMaxNumber + 1;
+          FieldDescriptor::kMaxNumber + 1;
+      placeholder_message->extension_ranges_->options_ = nullptr;
     }
 
     return Symbol(placeholder_message);
   }
 }
 
-FileDescriptor* DescriptorPool::NewPlaceholderFile(const string& name) const {
+FileDescriptor* DescriptorPool::NewPlaceholderFile(
+    StringPiece name) const {
   MutexLockMaybe lock(mutex_);
   return NewPlaceholderFileWithMutexHeld(name);
 }
 
 FileDescriptor* DescriptorPool::NewPlaceholderFileWithMutexHeld(
-    const string& name) const {
+    StringPiece name) const {
   if (mutex_) {
     mutex_->AssertHeld();
   }
   FileDescriptor* placeholder = tables_->Allocate<FileDescriptor>();
-  memset(placeholder, 0, sizeof(*placeholder));
+  memset(static_cast<void*>(placeholder), 0, sizeof(*placeholder));
 
   placeholder->name_ = tables_->AllocateString(name);
   placeholder->package_ = &internal::GetEmptyString();
@@ -3969,26 +4587,32 @@ FileDescriptor* DescriptorPool::NewPlaceholderFileWithMutexHeld(
   placeholder->tables_ = &FileDescriptorTables::GetEmptyInstance();
   placeholder->source_code_info_ = &SourceCodeInfo::default_instance();
   placeholder->is_placeholder_ = true;
-  placeholder->syntax_ = FileDescriptor::SYNTAX_PROTO2;
+  placeholder->syntax_ = FileDescriptor::SYNTAX_UNKNOWN;
   placeholder->finished_building_ = true;
-  // All other fields are zero or NULL.
+  // All other fields are zero or nullptr.
 
   return placeholder;
 }
 
-bool DescriptorBuilder::AddSymbol(
-    const string& full_name, const void* parent, const string& name,
-    const Message& proto, Symbol symbol) {
-  // If the caller passed NULL for the parent, the symbol is at file scope.
+bool DescriptorBuilder::AddSymbol(const std::string& full_name,
+                                  const void* parent, const std::string& name,
+                                  const Message& proto, Symbol symbol) {
+  // If the caller passed nullptr for the parent, the symbol is at file scope.
   // Use its file as the parent instead.
-  if (parent == NULL) parent = file_;
+  if (parent == nullptr) parent = file_;
 
+  if (full_name.find('\0') != std::string::npos) {
+    AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME,
+             "\"" + full_name + "\" contains null character.");
+    return false;
+  }
   if (tables_->AddSymbol(full_name, symbol)) {
     if (!file_tables_->AddAliasUnderParent(parent, name, symbol)) {
       // This is only possible if there was already an error adding something of
       // the same name.
       if (!had_errors_) {
-        GOOGLE_LOG(DFATAL) << "\"" << full_name << "\" not previously defined in "
+        GOOGLE_LOG(DFATAL) << "\"" << full_name
+                    << "\" not previously defined in "
                        "symbols_by_name_, but was defined in "
                        "symbols_by_parent_; this shouldn't be possible.";
       }
@@ -3998,65 +4622,77 @@ bool DescriptorBuilder::AddSymbol(
   } else {
     const FileDescriptor* other_file = tables_->FindSymbol(full_name).GetFile();
     if (other_file == file_) {
-      string::size_type dot_pos = full_name.find_last_of('.');
-      if (dot_pos == string::npos) {
+      std::string::size_type dot_pos = full_name.find_last_of('.');
+      if (dot_pos == std::string::npos) {
         AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME,
                  "\"" + full_name + "\" is already defined.");
       } else {
         AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME,
                  "\"" + full_name.substr(dot_pos + 1) +
-                 "\" is already defined in \"" +
-                 full_name.substr(0, dot_pos) + "\".");
+                     "\" is already defined in \"" +
+                     full_name.substr(0, dot_pos) + "\".");
       }
     } else {
       // Symbol seems to have been defined in a different file.
       AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME,
                "\"" + full_name + "\" is already defined in file \"" +
-               other_file->name() + "\".");
+                   (other_file == nullptr ? "null" : other_file->name()) +
+                   "\".");
     }
     return false;
   }
 }
 
-void DescriptorBuilder::AddPackage(
-    const string& name, const Message& proto, const FileDescriptor* file) {
-  if (tables_->AddSymbol(name, Symbol(file))) {
-    // Success.  Also add parent package, if any.
-    string::size_type dot_pos = name.find_last_of('.');
-    if (dot_pos == string::npos) {
+void DescriptorBuilder::AddPackage(const std::string& name,
+                                   const Message& proto, FileDescriptor* file) {
+  if (name.find('\0') != std::string::npos) {
+    AddError(name, proto, DescriptorPool::ErrorCollector::NAME,
+             "\"" + name + "\" contains null character.");
+    return;
+  }
+
+  Symbol existing_symbol = tables_->FindSymbol(name);
+  // It's OK to redefine a package.
+  if (existing_symbol.IsNull()) {
+    auto* package = tables_->AllocateArray<Symbol::Package>(1);
+    // If the name is the package name, then it is already in the arena.
+    // If not, copy it there. It came from the call to AddPackage below.
+    package->name =
+        &name == &file->package() ? &name : tables_->AllocateString(name);
+    package->file = file;
+    tables_->AddSymbol(*package->name, Symbol(package));
+    // Also add parent package, if any.
+    std::string::size_type dot_pos = name.find_last_of('.');
+    if (dot_pos == std::string::npos) {
       // No parents.
       ValidateSymbolName(name, name, proto);
     } else {
-      // Has parent.
-      string* parent_name = tables_->AllocateString(name.substr(0, dot_pos));
-      AddPackage(*parent_name, proto, file);
-      ValidateSymbolName(name.substr(dot_pos + 1), name, proto);
-    }
-  } else {
-    Symbol existing_symbol = tables_->FindSymbol(name);
-    // It's OK to redefine a package.
-    if (existing_symbol.type != Symbol::PACKAGE) {
-      // Symbol seems to have been defined in a different file.
-      AddError(name, proto, DescriptorPool::ErrorCollector::NAME,
-               "\"" + name + "\" is already defined (as something other than "
-               "a package) in file \"" + existing_symbol.GetFile()->name() +
-               "\".");
+      // Has parent.
+      AddPackage(name.substr(0, dot_pos), proto, file);
+      ValidateSymbolName(name.substr(dot_pos + 1), name, proto);
     }
+  } else if (existing_symbol.type() != Symbol::PACKAGE) {
+    // Symbol seems to have been defined in a different file.
+    AddError(name, proto, DescriptorPool::ErrorCollector::NAME,
+             "\"" + name +
+                 "\" is already defined (as something other than "
+                 "a package) in file \"" +
+                 existing_symbol.GetFile()->name() + "\".");
   }
 }
 
-void DescriptorBuilder::ValidateSymbolName(
-    const string& name, const string& full_name, const Message& proto) {
+void DescriptorBuilder::ValidateSymbolName(const std::string& name,
+                                           const std::string& full_name,
+                                           const Message& proto) {
   if (name.empty()) {
     AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME,
              "Missing name.");
   } else {
-    for (int i = 0; i < name.size(); i++) {
+    for (char character : name) {
       // I don't trust isalnum() due to locales.  :(
-      if ((name[i] < 'a' || 'z' < name[i]) &&
-          (name[i] < 'A' || 'Z' < name[i]) &&
-          (name[i] < '0' || '9' < name[i]) &&
-          (name[i] != '_')) {
+      if ((character < 'a' || 'z' < character) &&
+          (character < 'A' || 'Z' < character) &&
+          (character < '0' || '9' < character) && (character != '_')) {
         AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME,
                  "\"" + name + "\" is not a valid identifier.");
       }
@@ -4068,32 +4704,49 @@ void DescriptorBuilder::ValidateSymbolName(
 
 // This generic implementation is good for all descriptors except
 // FileDescriptor.
-template<class DescriptorT> void DescriptorBuilder::AllocateOptions(
+template <class DescriptorT>
+void DescriptorBuilder::AllocateOptions(
     const typename DescriptorT::OptionsType& orig_options,
-    DescriptorT* descriptor) {
+    DescriptorT* descriptor, int options_field_tag,
+    const std::string& option_name) {
+  std::vector<int> options_path;
+  descriptor->GetLocationPath(&options_path);
+  options_path.push_back(options_field_tag);
   AllocateOptionsImpl(descriptor->full_name(), descriptor->full_name(),
-                      orig_options, descriptor);
+                      orig_options, descriptor, options_path, option_name);
 }
 
 // We specialize for FileDescriptor.
 void DescriptorBuilder::AllocateOptions(const FileOptions& orig_options,
                                         FileDescriptor* descriptor) {
+  std::vector<int> options_path;
+  options_path.push_back(FileDescriptorProto::kOptionsFieldNumber);
   // We add the dummy token so that LookupSymbol does the right thing.
   AllocateOptionsImpl(descriptor->package() + ".dummy", descriptor->name(),
-                      orig_options, descriptor);
+                      orig_options, descriptor, options_path,
+                      "google.protobuf.FileOptions");
 }
 
-template<class DescriptorT> void DescriptorBuilder::AllocateOptionsImpl(
-    const string& name_scope,
-    const string& element_name,
+template <class DescriptorT>
+void DescriptorBuilder::AllocateOptionsImpl(
+    const std::string& name_scope, const std::string& element_name,
     const typename DescriptorT::OptionsType& orig_options,
-    DescriptorT* descriptor) {
+    DescriptorT* descriptor, const std::vector<int>& options_path,
+    const std::string& option_name) {
   // We need to use a dummy pointer to work around a bug in older versions of
   // GCC.  Otherwise, the following two lines could be replaced with:
   //   typename DescriptorT::OptionsType* options =
   //       tables_->AllocateMessage<typename DescriptorT::OptionsType>();
-  typename DescriptorT::OptionsType* const dummy = NULL;
+  typename DescriptorT::OptionsType* const dummy = nullptr;
   typename DescriptorT::OptionsType* options = tables_->AllocateMessage(dummy);
+
+  if (!orig_options.IsInitialized()) {
+    AddError(name_scope + "." + element_name, orig_options,
+             DescriptorPool::ErrorCollector::OPTION_NAME,
+             "Uninterpreted option is missing name or value.");
+    return;
+  }
+
   // Avoid using MergeFrom()/CopyFrom() in this class to make it -fno-rtti
   // friendly. Without RTTI, MergeFrom() and CopyFrom() will fallback to the
   // reflection based method, which requires the Descriptor. However, we are in
@@ -4109,51 +4762,75 @@ template<class DescriptorT> void DescriptorBuilder::AllocateOptionsImpl(
   // OptionsType::GetDescriptor() to be called which may then deadlock since
   // we're still trying to build it.
   if (options->uninterpreted_option_size() > 0) {
-    options_to_interpret_.push_back(
-        OptionsToInterpret(name_scope, element_name, &orig_options, options));
+    options_to_interpret_.push_back(OptionsToInterpret(
+        name_scope, element_name, options_path, &orig_options, options));
+  }
+
+  // If the custom option is in unknown fields, no need to interpret it.
+  // Remove the dependency file from unused_dependency.
+  const UnknownFieldSet& unknown_fields = orig_options.unknown_fields();
+  if (!unknown_fields.empty()) {
+    // Can not use options->GetDescriptor() which may case deadlock.
+    Symbol msg_symbol = tables_->FindSymbol(option_name);
+    if (msg_symbol.type() == Symbol::MESSAGE) {
+      for (int i = 0; i < unknown_fields.field_count(); ++i) {
+        assert_mutex_held(pool_);
+        const FieldDescriptor* field =
+            pool_->InternalFindExtensionByNumberNoLock(
+                msg_symbol.descriptor(), unknown_fields.field(i).number());
+        if (field) {
+          unused_dependency_.erase(field->file());
+        }
+      }
+    }
   }
 }
 
-
 // A common pattern:  We want to convert a repeated field in the descriptor
 // to an array of values, calling some method to build each value.
-#define BUILD_ARRAY(INPUT, OUTPUT, NAME, METHOD, PARENT)             \
-  OUTPUT->NAME##_count_ = INPUT.NAME##_size();                       \
-  AllocateArray(INPUT.NAME##_size(), &OUTPUT->NAME##s_);             \
-  for (int i = 0; i < INPUT.NAME##_size(); i++) {                    \
-    METHOD(INPUT.NAME(i), PARENT, OUTPUT->NAME##s_ + i);             \
+#define BUILD_ARRAY(INPUT, OUTPUT, NAME, METHOD, PARENT) \
+  OUTPUT->NAME##_count_ = INPUT.NAME##_size();           \
+  AllocateArray(INPUT.NAME##_size(), &OUTPUT->NAME##s_); \
+  for (int i = 0; i < INPUT.NAME##_size(); i++) {        \
+    METHOD(INPUT.NAME(i), PARENT, OUTPUT->NAME##s_ + i); \
   }
 
 void DescriptorBuilder::AddRecursiveImportError(
     const FileDescriptorProto& proto, int from_here) {
-  string error_message("File recursively imports itself: ");
-  for (int i = from_here; i < tables_->pending_files_.size(); i++) {
+  std::string error_message("File recursively imports itself: ");
+  for (size_t i = from_here; i < tables_->pending_files_.size(); i++) {
     error_message.append(tables_->pending_files_[i]);
     error_message.append(" -> ");
   }
   error_message.append(proto.name());
 
-  AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER,
-           error_message);
+  if (static_cast<size_t>(from_here) < tables_->pending_files_.size() - 1) {
+    AddError(tables_->pending_files_[from_here + 1], proto,
+             DescriptorPool::ErrorCollector::IMPORT, error_message);
+  } else {
+    AddError(proto.name(), proto, DescriptorPool::ErrorCollector::IMPORT,
+             error_message);
+  }
 }
 
 void DescriptorBuilder::AddTwiceListedError(const FileDescriptorProto& proto,
                                             int index) {
-  AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER,
+  AddError(proto.dependency(index), proto,
+           DescriptorPool::ErrorCollector::IMPORT,
            "Import \"" + proto.dependency(index) + "\" was listed twice.");
 }
 
 void DescriptorBuilder::AddImportError(const FileDescriptorProto& proto,
                                        int index) {
-  string message;
-  if (pool_->fallback_database_ == NULL) {
-    message = "Import \"" + proto.dependency(index) +
-              "\" has not been loaded.";
+  std::string message;
+  if (pool_->fallback_database_ == nullptr) {
+    message = "Import \"" + proto.dependency(index) + "\" has not been loaded.";
   } else {
     message = "Import \"" + proto.dependency(index) +
               "\" was not found or had errors.";
   }
-  AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER, message);
+  AddError(proto.dependency(index), proto,
+           DescriptorPool::ErrorCollector::IMPORT, message);
 }
 
 static bool ExistingFileMatchesProto(const FileDescriptor* existing_file,
@@ -4181,7 +4858,7 @@ const FileDescriptor* DescriptorBuilder::BuildFile(
   //   This is fine, because this idempotency "feature" really only exists to
   //   accommodate one hack in the proto1->proto2 migration layer.
   const FileDescriptor* existing_file = tables_->FindFile(filename_);
-  if (existing_file != NULL) {
+  if (existing_file != nullptr) {
     // File already in pool.  Compare the existing one to the input.
     if (ExistingFileMatchesProto(existing_file, proto)) {
       // They're identical.  Return the existing descriptor.
@@ -4200,10 +4877,10 @@ const FileDescriptor* DescriptorBuilder::BuildFile(
   //   mid-file, but that's pretty ugly, and I'm pretty sure there are
   //   some languages out there that do not allow recursive dependencies
   //   at all.
-  for (int i = 0; i < tables_->pending_files_.size(); i++) {
+  for (size_t i = 0; i < tables_->pending_files_.size(); i++) {
     if (tables_->pending_files_[i] == proto.name()) {
       AddRecursiveImportError(proto, i);
-      return NULL;
+      return nullptr;
     }
   }
 
@@ -4211,12 +4888,13 @@ const FileDescriptor* DescriptorBuilder::BuildFile(
   // attempt to load all dependencies now, before checkpointing tables_.  This
   // avoids confusion with recursive checkpoints.
   if (!pool_->lazily_build_dependencies_) {
-    if (pool_->fallback_database_ != NULL) {
+    if (pool_->fallback_database_ != nullptr) {
       tables_->pending_files_.push_back(proto.name());
       for (int i = 0; i < proto.dependency_size(); i++) {
-        if (tables_->FindFile(proto.dependency(i)) == NULL &&
-            (pool_->underlay_ == NULL ||
-             pool_->underlay_->FindFileByName(proto.dependency(i)) == NULL)) {
+        if (tables_->FindFile(proto.dependency(i)) == nullptr &&
+            (pool_->underlay_ == nullptr ||
+             pool_->underlay_->FindFileByName(proto.dependency(i)) ==
+                 nullptr)) {
           // We don't care what this returns since we'll find out below anyway.
           pool_->TryFindFileInFallbackDatabase(proto.dependency(i));
         }
@@ -4248,8 +4926,9 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl(
 
   result->is_placeholder_ = false;
   result->finished_building_ = false;
+  SourceCodeInfo* info = nullptr;
   if (proto.has_source_code_info()) {
-    SourceCodeInfo *info = tables_->AllocateMessage<SourceCodeInfo>();
+    info = tables_->AllocateMessage<SourceCodeInfo>();
     info->CopyFrom(proto.source_code_info());
     result->source_code_info_ = info;
   } else {
@@ -4288,35 +4967,30 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl(
   }
   result->pool_ = pool_;
 
+  if (result->name().find('\0') != std::string::npos) {
+    AddError(result->name(), proto, DescriptorPool::ErrorCollector::NAME,
+             "\"" + result->name() + "\" contains null character.");
+    return nullptr;
+  }
+
   // Add to tables.
   if (!tables_->AddFile(result)) {
     AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER,
              "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.
-    return NULL;
+    return nullptr;
   }
   if (!result->package().empty()) {
     AddPackage(result->package(), proto, result);
   }
 
   // Make sure all dependencies are loaded.
-  std::set<string> seen_dependencies;
+  std::set<std::string> seen_dependencies;
   result->dependency_count_ = proto.dependency_size();
   result->dependencies_ =
       tables_->AllocateArray<const FileDescriptor*>(proto.dependency_size());
-  if (pool_->lazily_build_dependencies_) {
-    result->dependencies_once_ = tables_->AllocateOnceDynamic();
-    result->dependencies_names_ =
-        tables_->AllocateArray<const string*>(proto.dependency_size());
-    if (proto.dependency_size() > 0) {
-      memset(result->dependencies_names_, 0,
-             sizeof(*result->dependencies_names_) * proto.dependency_size());
-    }
-  } else {
-    result->dependencies_once_ = NULL;
-    result->dependencies_names_ = NULL;
-  }
+  result->dependencies_once_ = nullptr;
   unused_dependency_.clear();
   std::set<int> weak_deps;
   for (int i = 0; i < proto.weak_dependency_size(); ++i) {
@@ -4328,7 +5002,7 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl(
     }
 
     const FileDescriptor* dependency = tables_->FindFile(proto.dependency(i));
-    if (dependency == NULL && pool_->underlay_ != NULL) {
+    if (dependency == nullptr && pool_->underlay_ != nullptr) {
       dependency = pool_->underlay_->FindFileByName(proto.dependency(i));
     }
 
@@ -4336,10 +5010,10 @@ 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().
-      return NULL;
+      return nullptr;
     }
 
-    if (dependency == NULL) {
+    if (dependency == nullptr) {
       if (!pool_->lazily_build_dependencies_) {
         if (pool_->allow_unknown_ ||
             (!pool_->enforce_weak_ && weak_deps.find(i) != weak_deps.end())) {
@@ -4362,15 +5036,26 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl(
 
     result->dependencies_[i] = dependency;
     if (pool_->lazily_build_dependencies_ && !dependency) {
-      result->dependencies_names_[i] =
-          tables_->AllocateString(proto.dependency(i));
+      if (result->dependencies_once_ == nullptr) {
+        result->dependencies_once_ =
+            tables_->Create<FileDescriptor::LazyInitData>();
+        result->dependencies_once_->dependencies_names =
+            tables_->AllocateArray<const char*>(proto.dependency_size());
+        if (proto.dependency_size() > 0) {
+          std::fill_n(result->dependencies_once_->dependencies_names,
+                      proto.dependency_size(), nullptr);
+        }
+      }
+
+      result->dependencies_once_->dependencies_names[i] =
+          tables_->Strdup(proto.dependency(i));
     }
   }
 
   // Check public dependencies.
   int public_dependency_count = 0;
-  result->public_dependencies_ = tables_->AllocateArray<int>(
-      proto.public_dependency_size());
+  result->public_dependencies_ =
+      tables_->AllocateArray<int>(proto.public_dependency_size());
   for (int i = 0; i < proto.public_dependency_size(); i++) {
     // Only put valid public dependency indexes.
     int index = proto.public_dependency(i);
@@ -4384,8 +5069,7 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl(
         unused_dependency_.erase(result->dependency(index));
       }
     } else {
-      AddError(proto.name(), proto,
-               DescriptorPool::ErrorCollector::OTHER,
+      AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER,
                "Invalid public dependency index.");
     }
   }
@@ -4404,30 +5088,28 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl(
 
   // Check weak dependencies.
   int weak_dependency_count = 0;
-  result->weak_dependencies_ = tables_->AllocateArray<int>(
-      proto.weak_dependency_size());
+  result->weak_dependencies_ =
+      tables_->AllocateArray<int>(proto.weak_dependency_size());
   for (int i = 0; i < proto.weak_dependency_size(); i++) {
     int index = proto.weak_dependency(i);
     if (index >= 0 && index < proto.dependency_size()) {
       result->weak_dependencies_[weak_dependency_count++] = index;
     } else {
-      AddError(proto.name(), proto,
-               DescriptorPool::ErrorCollector::OTHER,
+      AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER,
                "Invalid weak dependency index.");
     }
   }
   result->weak_dependency_count_ = weak_dependency_count;
 
   // Convert children.
-  BUILD_ARRAY(proto, result, message_type, BuildMessage  , NULL);
-  BUILD_ARRAY(proto, result, enum_type   , BuildEnum     , NULL);
-  BUILD_ARRAY(proto, result, service     , BuildService  , NULL);
-  BUILD_ARRAY(proto, result, extension   , BuildExtension, NULL);
+  BUILD_ARRAY(proto, result, message_type, BuildMessage, nullptr);
+  BUILD_ARRAY(proto, result, enum_type, BuildEnum, nullptr);
+  BUILD_ARRAY(proto, result, service, BuildService, nullptr);
+  BUILD_ARRAY(proto, result, extension, BuildExtension, nullptr);
 
   // Copy options.
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
+  result->options_ = nullptr;  // Set to default_instance later if necessary.
+  if (proto.has_options()) {
     AllocateOptions(proto.options(), result);
   }
 
@@ -4447,6 +5129,9 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl(
       option_interpreter.InterpretOptions(&(*iter));
     }
     options_to_interpret_.clear();
+    if (info != nullptr) {
+      option_interpreter.UpdateSourceCodeInfo(info);
+    }
   }
 
   // Validate options. See comments at InternalSetLazilyBuildDependencies about
@@ -4465,64 +5150,91 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl(
 
 
   // Again, see comments at InternalSetLazilyBuildDependencies about error
-  // checking.
-  if (!unused_dependency_.empty() && !pool_->lazily_build_dependencies_) {
+  // checking. Also, don't log unused dependencies if there were previous
+  // errors, since the results might be inaccurate.
+  if (!had_errors_ && !unused_dependency_.empty() &&
+      !pool_->lazily_build_dependencies_) {
     LogUnusedDependency(proto, result);
   }
 
   if (had_errors_) {
-    return NULL;
+    return nullptr;
   } else {
     return result;
   }
 }
 
+
+const std::string* DescriptorBuilder::AllocateNameStrings(
+    const std::string& scope, const std::string& proto_name) {
+  if (scope.empty()) {
+    return tables_->AllocateStringArray(proto_name, proto_name);
+  } else {
+    return tables_->AllocateStringArray(proto_name,
+                                        StrCat(scope, ".", proto_name));
+  }
+}
+
 void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
                                      const Descriptor* parent,
                                      Descriptor* result) {
-  const string& scope = (parent == NULL) ?
-    file_->package() : parent->full_name();
-  string* full_name = tables_->AllocateString(scope);
-  if (!full_name->empty()) full_name->append(1, '.');
-  full_name->append(proto.name());
+  const std::string& scope =
+      (parent == nullptr) ? file_->package() : parent->full_name();
+  result->all_names_ = AllocateNameStrings(scope, proto.name());
+  ValidateSymbolName(proto.name(), result->full_name(), proto);
 
-  ValidateSymbolName(proto.name(), *full_name, proto);
-
-  result->name_            = tables_->AllocateString(proto.name());
-  result->full_name_       = full_name;
-  result->file_            = file_;
+  result->file_ = file_;
   result->containing_type_ = parent;
-  result->is_placeholder_  = false;
+  result->is_placeholder_ = false;
   result->is_unqualified_placeholder_ = false;
+  result->well_known_type_ = Descriptor::WELLKNOWNTYPE_UNSPECIFIED;
+
+  auto it = pool_->tables_->well_known_types_.find(result->full_name());
+  if (it != pool_->tables_->well_known_types_.end()) {
+    result->well_known_type_ = it->second;
+  }
+
+  // Calculate the continuous sequence of fields.
+  // These can be fast-path'd during lookup and don't need to be added to the
+  // tables.
+  // We use uint16_t to save space for sequential_field_limit_, so stop before
+  // overflowing it. Worst case, we are not taking full advantage on huge
+  // messages, but it is unlikely.
+  result->sequential_field_limit_ = 0;
+  for (int i = 0; i < std::numeric_limits<uint16_t>::max() &&
+                  i < proto.field_size() && proto.field(i).number() == i + 1;
+       ++i) {
+    result->sequential_field_limit_ = i + 1;
+  }
 
   // Build oneofs first so that fields and extension ranges can refer to them.
-  BUILD_ARRAY(proto, result, oneof_decl     , BuildOneof         , result);
-  BUILD_ARRAY(proto, result, field          , BuildField         , result);
-  BUILD_ARRAY(proto, result, nested_type    , BuildMessage       , result);
-  BUILD_ARRAY(proto, result, enum_type      , BuildEnum          , result);
+  BUILD_ARRAY(proto, result, oneof_decl, BuildOneof, result);
+  BUILD_ARRAY(proto, result, field, BuildField, result);
+  BUILD_ARRAY(proto, result, nested_type, BuildMessage, result);
+  BUILD_ARRAY(proto, result, enum_type, BuildEnum, result);
   BUILD_ARRAY(proto, result, extension_range, BuildExtensionRange, result);
-  BUILD_ARRAY(proto, result, extension      , BuildExtension     , result);
-  BUILD_ARRAY(proto, result, reserved_range , BuildReservedRange , result);
+  BUILD_ARRAY(proto, result, extension, BuildExtension, 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);
+      tables_->AllocateArray<const std::string*>(reserved_name_count);
   for (int i = 0; i < reserved_name_count; ++i) {
     result->reserved_names_[i] =
         tables_->AllocateString(proto.reserved_name(i));
   }
 
   // Copy options.
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
-    AllocateOptions(proto.options(), result);
+  result->options_ = nullptr;  // Set to default_instance later if necessary.
+  if (proto.has_options()) {
+    AllocateOptions(proto.options(), result,
+                    DescriptorProto::kOptionsFieldNumber,
+                    "google.protobuf.MessageOptions");
   }
 
-  AddSymbol(result->full_name(), parent, result->name(),
-            proto, Symbol(result));
+  AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result));
 
   for (int i = 0; i < proto.reserved_range_size(); i++) {
     const DescriptorProto_ReservedRange& range1 = proto.reserved_range(i);
@@ -4532,37 +5244,37 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
         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));
+                                  "already-defined range $2 to $3.",
+                                  range2.start(), range2.end() - 1,
+                                  range1.start(), range1.end() - 1));
       }
     }
   }
 
-  hash_set<string> reserved_name_set;
+  HASH_SET<std::string> reserved_name_set;
   for (int i = 0; i < proto.reserved_name_size(); i++) {
-    const string& name = proto.reserved_name(i);
+    const std::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(
-                 "Field name \"$0\" is reserved multiple times.",
-                 name));
+               strings::Substitute("Field name \"$0\" is reserved multiple times.",
+                                name));
     }
   }
 
+
   for (int i = 0; i < result->field_count(); i++) {
     const FieldDescriptor* field = result->field(i);
     for (int j = 0; j < result->extension_range_count(); j++) {
       const Descriptor::ExtensionRange* range = result->extension_range(j);
       if (range->start <= field->number() && field->number() < range->end) {
-        AddError(field->full_name(), proto.extension_range(j),
-                 DescriptorPool::ErrorCollector::NUMBER,
-                 strings::Substitute(
-                   "Extension range $0 to $1 includes field \"$2\" ($3).",
-                   range->start, range->end - 1,
-                   field->name(), field->number()));
+        AddError(
+            field->full_name(), proto.extension_range(j),
+            DescriptorPool::ErrorCollector::NUMBER,
+            strings::Substitute(
+                "Extension range $0 to $1 includes field \"$2\" ($3).",
+                range->start, range->end - 1, field->name(), field->number()));
       }
     }
     for (int j = 0; j < result->reserved_range_count(); j++) {
@@ -4570,21 +5282,21 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
       if (range->start <= field->number() && field->number() < range->end) {
         AddError(field->full_name(), proto.reserved_range(j),
                  DescriptorPool::ErrorCollector::NUMBER,
-                 strings::Substitute(
-                   "Field \"$0\" uses reserved number $1.",
-                   field->name(), field->number()));
+                 strings::Substitute("Field \"$0\" uses reserved number $1.",
+                                  field->name(), field->number()));
       }
     }
     if (reserved_name_set.find(field->name()) != reserved_name_set.end()) {
-      AddError(field->full_name(), proto.field(i),
-               DescriptorPool::ErrorCollector::NAME,
-               strings::Substitute(
-                 "Field name \"$0\" is reserved.", field->name()));
+      AddError(
+          field->full_name(), proto.field(i),
+          DescriptorPool::ErrorCollector::NAME,
+          strings::Substitute("Field name \"$0\" is reserved.", field->name()));
     }
+
   }
 
   // Check that extension ranges don't overlap and don't include
-  // reserved field numbers.
+  // reserved field numbers or names.
   for (int i = 0; i < result->extension_range_count(); i++) {
     const Descriptor::ExtensionRange* range1 = result->extension_range(i);
     for (int j = 0; j < result->reserved_range_count(); j++) {
@@ -4593,9 +5305,9 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
         AddError(result->full_name(), proto.extension_range(i),
                  DescriptorPool::ErrorCollector::NUMBER,
                  strings::Substitute("Extension range $0 to $1 overlaps with "
-                                     "reserved range $2 to $3.",
-                                     range1->start, range1->end - 1,
-                                     range2->start, range2->end - 1));
+                                  "reserved range $2 to $3.",
+                                  range1->start, range1->end - 1, range2->start,
+                                  range2->end - 1));
       }
     }
     for (int j = i + 1; j < result->extension_range_count(); j++) {
@@ -4604,88 +5316,74 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
         AddError(result->full_name(), proto.extension_range(i),
                  DescriptorPool::ErrorCollector::NUMBER,
                  strings::Substitute("Extension range $0 to $1 overlaps with "
-                                     "already-defined range $2 to $3.",
-                                     range2->start, range2->end - 1,
-                                     range1->start, range1->end - 1));
+                                  "already-defined range $2 to $3.",
+                                  range2->start, range2->end - 1, range1->start,
+                                  range1->end - 1));
       }
     }
   }
 }
 
-
 void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
-                                              const Descriptor* parent,
+                                              Descriptor* parent,
                                               FieldDescriptor* result,
                                               bool is_extension) {
-  const string& scope = (parent == NULL) ?
-    file_->package() : parent->full_name();
-  string* full_name = tables_->AllocateString(scope);
-  if (!full_name->empty()) full_name->append(1, '.');
-  full_name->append(proto.name());
-
-  ValidateSymbolName(proto.name(), *full_name, proto);
-
-  result->name_         = tables_->AllocateString(proto.name());
-  result->full_name_    = full_name;
-  result->file_         = file_;
-  result->number_       = proto.number();
+  const std::string& scope =
+      (parent == nullptr) ? file_->package() : parent->full_name();
+
+  // We allocate all names in a single array, and dedup them.
+  // We remember the indices for the potentially deduped values.
+  auto all_names = tables_->AllocateFieldNames(
+      proto.name(), scope,
+      proto.has_json_name() ? &proto.json_name() : nullptr);
+  result->all_names_ = all_names.array;
+  result->lowercase_name_index_ = all_names.lowercase_index;
+  result->camelcase_name_index_ = all_names.camelcase_index;
+  result->json_name_index_ = all_names.json_index;
+
+  ValidateSymbolName(proto.name(), result->full_name(), proto);
+
+  result->file_ = file_;
+  result->number_ = proto.number();
   result->is_extension_ = is_extension;
+  result->is_oneof_ = false;
+  result->proto3_optional_ = proto.proto3_optional();
 
-  // If .proto files follow the style guide then the name should already be
-  // lower-cased.  If that's the case we can just reuse the string we already
-  // allocated rather than allocate a new one.
-  string lowercase_name(proto.name());
-  LowerString(&lowercase_name);
-  if (lowercase_name == proto.name()) {
-    result->lowercase_name_ = result->name_;
-  } else {
-    result->lowercase_name_ = tables_->AllocateString(lowercase_name);
+  if (proto.proto3_optional() &&
+      file_->syntax() != FileDescriptor::SYNTAX_PROTO3) {
+    AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
+             "The [proto3_optional=true] option may only be set on proto3"
+             "fields, not " +
+                 result->full_name());
   }
 
-  // Don't bother with the above optimization for camel-case names since
-  // .proto files that follow the guide shouldn't be using names in this
-  // format, so the optimization wouldn't help much.
-  result->camelcase_name_ =
-      tables_->AllocateString(ToCamelCase(proto.name(),
-                                          /* lower_first = */ true));
-
-  if (proto.has_json_name()) {
-    result->has_json_name_ = true;
-    result->json_name_ = tables_->AllocateString(proto.json_name());
-  } else {
-    result->has_json_name_ = false;
-    result->json_name_ = tables_->AllocateString(ToJsonName(proto.name()));
-  }
+  result->has_json_name_ = proto.has_json_name();
 
   // Some compilers do not allow static_cast directly between two enum types,
   // so we must cast to int first.
-  result->type_  = static_cast<FieldDescriptor::Type>(
-                     implicit_cast<int>(proto.type()));
+  result->type_ = static_cast<FieldDescriptor::Type>(
+      implicit_cast<int>(proto.type()));
   result->label_ = static_cast<FieldDescriptor::Label>(
-                     implicit_cast<int>(proto.label()));
+      implicit_cast<int>(proto.label()));
 
-  // An extension cannot have a required field (b/13365836).
-  if (result->is_extension_ &&
-      result->label_ == FieldDescriptor::LABEL_REQUIRED) {
-    AddError(result->full_name(), proto,
-             // Error location `TYPE`: we would really like to indicate
-             // `LABEL`, but the `ErrorLocation` enum has no entry for this, and
-             // we don't necessarily know about all implementations of the
-             // `ErrorCollector` interface to extend them to handle the new
-             // error location type properly.
-             DescriptorPool::ErrorCollector::TYPE,
-             "Message extensions cannot have required fields.");
+  if (result->label_ == FieldDescriptor::LABEL_REQUIRED) {
+    // An extension cannot have a required field (b/13365836).
+    if (result->is_extension_) {
+      AddError(result->full_name(), proto,
+               // Error location `TYPE`: we would really like to indicate
+               // `LABEL`, but the `ErrorLocation` enum has no entry for this,
+               // and we don't necessarily know about all implementations of the
+               // `ErrorCollector` interface to extend them to handle the new
+               // error location type properly.
+               DescriptorPool::ErrorCollector::TYPE,
+               "The extension " + result->full_name() + " cannot be required.");
+    }
   }
 
   // Some of these may be filled in when cross-linking.
-  result->containing_type_ = NULL;
-  result->extension_scope_ = NULL;
-  result->message_type_ = NULL;
-  result->enum_type_ = NULL;
-  result->type_name_ = NULL;
-  result->type_once_ = NULL;
-  result->default_value_enum_ = NULL;
-  result->default_value_enum_name_ = NULL;
+  result->containing_type_ = nullptr;
+  result->type_once_ = nullptr;
+  result->default_value_enum_ = nullptr;
 
   result->has_default_value_ = proto.has_default_value();
   if (proto.has_default_value() && result->is_repeated()) {
@@ -4696,23 +5394,23 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
 
   if (proto.has_type()) {
     if (proto.has_default_value()) {
-      char* end_pos = NULL;
+      char* end_pos = nullptr;
       switch (result->cpp_type()) {
         case FieldDescriptor::CPPTYPE_INT32:
-          result->default_value_int32_ =
-            strtol(proto.default_value().c_str(), &end_pos, 0);
+          result->default_value_int32_t_ =
+              strtol(proto.default_value().c_str(), &end_pos, 0);
           break;
         case FieldDescriptor::CPPTYPE_INT64:
-          result->default_value_int64_ =
-            strto64(proto.default_value().c_str(), &end_pos, 0);
+          result->default_value_int64_t_ =
+              strto64(proto.default_value().c_str(), &end_pos, 0);
           break;
         case FieldDescriptor::CPPTYPE_UINT32:
-          result->default_value_uint32_ =
-            strtoul(proto.default_value().c_str(), &end_pos, 0);
+          result->default_value_uint32_t_ =
+              strtoul(proto.default_value().c_str(), &end_pos, 0);
           break;
         case FieldDescriptor::CPPTYPE_UINT64:
-          result->default_value_uint64_ =
-            strtou64(proto.default_value().c_str(), &end_pos, 0);
+          result->default_value_uint64_t_ =
+              strtou64(proto.default_value().c_str(), &end_pos, 0);
           break;
         case FieldDescriptor::CPPTYPE_FLOAT:
           if (proto.default_value() == "inf") {
@@ -4724,7 +5422,7 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
           } else if (proto.default_value() == "nan") {
             result->default_value_float_ =
                 std::numeric_limits<float>::quiet_NaN();
-          } else  {
+          } else {
             result->default_value_float_ = io::SafeDoubleToFloat(
                 io::NoLocaleStrtod(proto.default_value().c_str(), &end_pos));
           }
@@ -4739,7 +5437,7 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
           } else if (proto.default_value() == "nan") {
             result->default_value_double_ =
                 std::numeric_limits<double>::quiet_NaN();
-          } else  {
+          } else {
             result->default_value_double_ =
                 io::NoLocaleStrtod(proto.default_value().c_str(), &end_pos);
           }
@@ -4757,12 +5455,12 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
           break;
         case FieldDescriptor::CPPTYPE_ENUM:
           // This will be filled in when cross-linking.
-          result->default_value_enum_ = NULL;
+          result->default_value_enum_ = nullptr;
           break;
         case FieldDescriptor::CPPTYPE_STRING:
           if (result->type() == FieldDescriptor::TYPE_BYTES) {
             result->default_value_string_ = tables_->AllocateString(
-              UnescapeCEscapeString(proto.default_value()));
+                UnescapeCEscapeString(proto.default_value()));
           } else {
             result->default_value_string_ =
                 tables_->AllocateString(proto.default_value());
@@ -4773,34 +5471,35 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
                    DescriptorPool::ErrorCollector::DEFAULT_VALUE,
                    "Messages can't have default values.");
           result->has_default_value_ = false;
+          result->default_generated_instance_ = nullptr;
           break;
       }
 
-      if (end_pos != NULL) {
-        // end_pos is only set non-NULL by the parsers for numeric types, above.
-        // This checks that the default was non-empty and had no extra junk
-        // after the end of the number.
+      if (end_pos != nullptr) {
+        // end_pos is only set non-null by the parsers for numeric types,
+        // above. This checks that the default was non-empty and had no extra
+        // junk after the end of the number.
         if (proto.default_value().empty() || *end_pos != '\0') {
           AddError(result->full_name(), proto,
                    DescriptorPool::ErrorCollector::DEFAULT_VALUE,
                    "Couldn't parse default value \"" + proto.default_value() +
-                   "\".");
+                       "\".");
         }
       }
     } else {
       // No explicit default value
       switch (result->cpp_type()) {
         case FieldDescriptor::CPPTYPE_INT32:
-          result->default_value_int32_ = 0;
+          result->default_value_int32_t_ = 0;
           break;
         case FieldDescriptor::CPPTYPE_INT64:
-          result->default_value_int64_ = 0;
+          result->default_value_int64_t_ = 0;
           break;
         case FieldDescriptor::CPPTYPE_UINT32:
-          result->default_value_uint32_ = 0;
+          result->default_value_uint32_t_ = 0;
           break;
         case FieldDescriptor::CPPTYPE_UINT64:
-          result->default_value_uint64_ = 0;
+          result->default_value_uint64_t_ = 0;
           break;
         case FieldDescriptor::CPPTYPE_FLOAT:
           result->default_value_float_ = 0.0f;
@@ -4813,12 +5512,13 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
           break;
         case FieldDescriptor::CPPTYPE_ENUM:
           // This will be filled in when cross-linking.
-          result->default_value_enum_ = NULL;
+          result->default_value_enum_ = nullptr;
           break;
         case FieldDescriptor::CPPTYPE_STRING:
           result->default_value_string_ = &internal::GetEmptyString();
           break;
         case FieldDescriptor::CPPTYPE_MESSAGE:
+          result->default_generated_instance_ = nullptr;
           break;
       }
     }
@@ -4838,15 +5538,15 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
     // on extension numbers.
     AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER,
              strings::Substitute("Field numbers cannot be greater than $0.",
-                                 FieldDescriptor::kMaxNumber));
+                              FieldDescriptor::kMaxNumber));
   } else if (result->number() >= FieldDescriptor::kFirstReservedNumber &&
              result->number() <= FieldDescriptor::kLastReservedNumber) {
     AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER,
              strings::Substitute(
-               "Field numbers $0 through $1 are reserved for the protocol "
-               "buffer library implementation.",
-               FieldDescriptor::kFirstReservedNumber,
-               FieldDescriptor::kLastReservedNumber));
+                 "Field numbers $0 through $1 are reserved for the protocol "
+                 "buffer library implementation.",
+                 FieldDescriptor::kFirstReservedNumber,
+                 FieldDescriptor::kLastReservedNumber));
   }
 
   if (is_extension) {
@@ -4856,17 +5556,13 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
                "FieldDescriptorProto.extendee not set for extension field.");
     }
 
-    result->extension_scope_ = parent;
+    result->scope_.extension_scope = parent;
 
     if (proto.has_oneof_index()) {
-      AddError(result->full_name(), proto,
-               DescriptorPool::ErrorCollector::OTHER,
+      AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
                "FieldDescriptorProto.oneof_index should not be set for "
                "extensions.");
     }
-
-    // Fill in later (maybe).
-    result->containing_oneof_ = NULL;
   } else {
     if (proto.has_extendee()) {
       AddError(result->full_name(), proto,
@@ -4880,41 +5576,37 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto,
       if (proto.oneof_index() < 0 ||
           proto.oneof_index() >= parent->oneof_decl_count()) {
         AddError(result->full_name(), proto,
-                 DescriptorPool::ErrorCollector::OTHER,
+                 DescriptorPool::ErrorCollector::TYPE,
                  strings::Substitute("FieldDescriptorProto.oneof_index $0 is "
-                                     "out of range for type \"$1\".",
-                                     proto.oneof_index(),
-                                     parent->name()));
-        result->containing_oneof_ = NULL;
+                                  "out of range for type \"$1\".",
+                                  proto.oneof_index(), parent->name()));
       } else {
-        result->containing_oneof_ = parent->oneof_decl(proto.oneof_index());
+        result->is_oneof_ = true;
+        result->scope_.containing_oneof =
+            parent->oneof_decl(proto.oneof_index());
       }
-    } else {
-      result->containing_oneof_ = NULL;
     }
   }
 
   // Copy options.
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
-    AllocateOptions(proto.options(), result);
+  result->options_ = nullptr;  // Set to default_instance later if necessary.
+  if (proto.has_options()) {
+    AllocateOptions(proto.options(), result,
+                    FieldDescriptorProto::kOptionsFieldNumber,
+                    "google.protobuf.FieldOptions");
   }
 
 
-  AddSymbol(result->full_name(), parent, result->name(),
-            proto, Symbol(result));
+  AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result));
 }
 
 void DescriptorBuilder::BuildExtensionRange(
-    const DescriptorProto::ExtensionRange& proto,
-    const Descriptor* parent,
+    const DescriptorProto::ExtensionRange& proto, const Descriptor* parent,
     Descriptor::ExtensionRange* result) {
   result->start = proto.start();
   result->end = proto.end();
   if (result->start <= 0) {
-    AddError(parent->full_name(), proto,
-             DescriptorPool::ErrorCollector::NUMBER,
+    AddError(parent->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER,
              "Extension numbers must be positive integers.");
   }
 
@@ -4924,28 +5616,34 @@ void DescriptorBuilder::BuildExtensionRange(
   // numbers are actually used as int32s in the message_set_wire_format.
 
   if (result->start >= result->end) {
-    AddError(parent->full_name(), proto,
-             DescriptorPool::ErrorCollector::NUMBER,
+    AddError(parent->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER,
              "Extension range end number must be greater than start number.");
   }
 
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
+  result->options_ = nullptr;  // Set to default_instance later if necessary.
+  if (proto.has_options()) {
+    std::vector<int> options_path;
+    parent->GetLocationPath(&options_path);
+    options_path.push_back(DescriptorProto::kExtensionRangeFieldNumber);
+    // find index of this extension range in order to compute path
+    int index;
+    for (index = 0; parent->extension_ranges_ + index != result; index++) {
+    }
+    options_path.push_back(index);
+    options_path.push_back(DescriptorProto_ExtensionRange::kOptionsFieldNumber);
     AllocateOptionsImpl(parent->full_name(), parent->full_name(),
-                        proto.options(), result);
+                        proto.options(), result, options_path,
+                        "google.protobuf.ExtensionRangeOptions");
   }
 }
 
 void DescriptorBuilder::BuildReservedRange(
-    const DescriptorProto::ReservedRange& proto,
-    const Descriptor* parent,
+    const DescriptorProto::ReservedRange& proto, const Descriptor* parent,
     Descriptor::ReservedRange* result) {
   result->start = proto.start();
   result->end = proto.end();
   if (result->start <= 0) {
-    AddError(parent->full_name(), proto,
-             DescriptorPool::ErrorCollector::NUMBER,
+    AddError(parent->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER,
              "Reserved numbers must be positive integers.");
   }
 }
@@ -4957,8 +5655,7 @@ void DescriptorBuilder::BuildReservedRange(
   result->end = proto.end();
 
   if (result->start > result->end) {
-    AddError(parent->full_name(), proto,
-             DescriptorPool::ErrorCollector::NUMBER,
+    AddError(parent->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER,
              "Reserved range end number must be greater than start number.");
   }
 }
@@ -4966,30 +5663,24 @@ void DescriptorBuilder::BuildReservedRange(
 void DescriptorBuilder::BuildOneof(const OneofDescriptorProto& proto,
                                    Descriptor* parent,
                                    OneofDescriptor* result) {
-  string* full_name = tables_->AllocateString(parent->full_name());
-  full_name->append(1, '.');
-  full_name->append(proto.name());
-
-  ValidateSymbolName(proto.name(), *full_name, proto);
-
-  result->name_ = tables_->AllocateString(proto.name());
-  result->full_name_ = full_name;
+  result->all_names_ = AllocateNameStrings(parent->full_name(), proto.name());
+  ValidateSymbolName(proto.name(), result->full_name(), proto);
 
   result->containing_type_ = parent;
 
   // We need to fill these in later.
   result->field_count_ = 0;
-  result->fields_ = NULL;
+  result->fields_ = nullptr;
+  result->options_ = nullptr;
 
   // Copy options.
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
-    AllocateOptions(proto.options(), result);
+  if (proto.has_options()) {
+    AllocateOptions(proto.options(), result,
+                    OneofDescriptorProto::kOptionsFieldNumber,
+                    "google.protobuf.OneofOptions");
   }
 
-  AddSymbol(result->full_name(), parent, result->name(),
-            proto, Symbol(result));
+  AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result));
 }
 
 void DescriptorBuilder::CheckEnumValueUniqueness(
@@ -5021,13 +5712,12 @@ void DescriptorBuilder::CheckEnumValueUniqueness(
   //     NAME_TYPE_LAST_NAME = 2,
   //   }
   PrefixRemover remover(result->name());
-  std::map<string, const google::protobuf::EnumValueDescriptor*> values;
+  std::map<std::string, const EnumValueDescriptor*> values;
   for (int i = 0; i < result->value_count(); i++) {
-    const google::protobuf::EnumValueDescriptor* value = result->value(i);
-    string stripped =
+    const EnumValueDescriptor* value = result->value(i);
+    std::string stripped =
         EnumValueToPascalCase(remover.MaybeRemove(value->name()));
-    std::pair<std::map<string, const google::protobuf::EnumValueDescriptor*>::iterator,
-              bool>
+    std::pair<std::map<std::string, const EnumValueDescriptor*>::iterator, bool>
         insert_result = values.insert(std::make_pair(stripped, value));
     bool inserted = insert_result.second;
 
@@ -5039,11 +5729,13 @@ void DescriptorBuilder::CheckEnumValueUniqueness(
     // stripping should de-dup the labels in this case).
     if (!inserted && insert_result.first->second->name() != value->name() &&
         insert_result.first->second->number() != value->number()) {
-      string error_message =
-          "When enum name is stripped and label is PascalCased (" + stripped +
-          "), this value label conflicts with " + values[stripped]->name() +
-          ". This will make the proto fail to compile for some languages, such "
-          "as C#.";
+      std::string error_message =
+          "Enum name " + value->name() + " has the same name as " +
+          values[stripped]->name() +
+          " if you ignore case and strip out the enum name prefix (if any). "
+          "This is error-prone and can lead to undefined behavior. "
+          "Please avoid doing this. If you are using allow_alias, please "
+          "assign the same numeric value to both enums.";
       // There are proto2 enums out there with conflicting names, so to preserve
       // compatibility we issue only a warning for proto2.
       if (result->file()->syntax() == FileDescriptor::SYNTAX_PROTO2) {
@@ -5060,29 +5752,38 @@ void DescriptorBuilder::CheckEnumValueUniqueness(
 void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto,
                                   const Descriptor* parent,
                                   EnumDescriptor* result) {
-  const string& scope = (parent == NULL) ?
-    file_->package() : parent->full_name();
-  string* full_name = tables_->AllocateString(scope);
-  if (!full_name->empty()) full_name->append(1, '.');
-  full_name->append(proto.name());
-
-  ValidateSymbolName(proto.name(), *full_name, proto);
+  const std::string& scope =
+      (parent == nullptr) ? file_->package() : parent->full_name();
 
-  result->name_            = tables_->AllocateString(proto.name());
-  result->full_name_       = full_name;
-  result->file_            = file_;
+  result->all_names_ = AllocateNameStrings(scope, proto.name());
+  ValidateSymbolName(proto.name(), result->full_name(), proto);
+  result->file_ = file_;
   result->containing_type_ = parent;
-  result->is_placeholder_  = false;
+  result->is_placeholder_ = false;
   result->is_unqualified_placeholder_ = false;
 
   if (proto.value_size() == 0) {
     // We cannot allow enums with no values because this would mean there
     // would be no valid default value for fields of this type.
-    AddError(result->full_name(), proto,
-             DescriptorPool::ErrorCollector::NAME,
+    AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NAME,
              "Enums must contain at least one value.");
   }
 
+  // Calculate the continuous sequence of the labels.
+  // These can be fast-path'd during lookup and don't need to be added to the
+  // tables.
+  // We use uint16_t to save space for sequential_value_limit_, so stop before
+  // overflowing it. Worst case, we are not taking full advantage on huge
+  // enums, but it is unlikely.
+  for (int i = 0;
+       i < std::numeric_limits<uint16_t>::max() && i < proto.value_size() &&
+       // We do the math in int64_t to avoid overflows.
+       proto.value(i).number() ==
+           static_cast<int64_t>(i) + proto.value(0).number();
+       ++i) {
+    result->sequential_value_limit_ = i;
+  }
+
   BUILD_ARRAY(proto, result, value, BuildEnumValue, result);
   BUILD_ARRAY(proto, result, reserved_range, BuildReservedRange, result);
 
@@ -5090,7 +5791,7 @@ void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto,
   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);
+      tables_->AllocateArray<const std::string*>(reserved_name_count);
   for (int i = 0; i < reserved_name_count; ++i) {
     result->reserved_names_[i] =
         tables_->AllocateString(proto.reserved_name(i));
@@ -5099,14 +5800,14 @@ void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto,
   CheckEnumValueUniqueness(proto, result);
 
   // Copy options.
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
-    AllocateOptions(proto.options(), result);
+  result->options_ = nullptr;  // Set to default_instance later if necessary.
+  if (proto.has_options()) {
+    AllocateOptions(proto.options(), result,
+                    EnumDescriptorProto::kOptionsFieldNumber,
+                    "google.protobuf.EnumOptions");
   }
 
-  AddSymbol(result->full_name(), parent, result->name(),
-            proto, Symbol(result));
+  AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result));
 
   for (int i = 0; i < proto.reserved_range_size(); i++) {
     const EnumDescriptorProto_EnumReservedRange& range1 =
@@ -5114,27 +5815,26 @@ void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto,
     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()) {
+      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));
+                                  "already-defined range $2 to $3.",
+                                  range2.start(), range2.end(), range1.start(),
+                                  range1.end()));
       }
     }
   }
 
-  hash_set<string> reserved_name_set;
+  HASH_SET<std::string> reserved_name_set;
   for (int i = 0; i < proto.reserved_name_size(); i++) {
-    const string& name = proto.reserved_name(i);
+    const std::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));
+               strings::Substitute("Enum value \"$0\" is reserved multiple times.",
+                                name));
     }
   }
 
@@ -5145,16 +5845,15 @@ void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto,
       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()));
+                 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()));
+      AddError(
+          value->full_name(), proto.value(i),
+          DescriptorPool::ErrorCollector::NAME,
+          strings::Substitute("Enum value \"$0\" is reserved.", value->name()));
     }
   }
 }
@@ -5162,46 +5861,49 @@ void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto,
 void DescriptorBuilder::BuildEnumValue(const EnumValueDescriptorProto& proto,
                                        const EnumDescriptor* parent,
                                        EnumValueDescriptor* result) {
-  result->name_   = tables_->AllocateString(proto.name());
-  result->number_ = proto.number();
-  result->type_   = parent;
-
   // Note:  full_name for enum values is a sibling to the parent's name, not a
   //   child of it.
-  string* full_name = tables_->AllocateString(*parent->full_name_);
-  full_name->resize(full_name->size() - parent->name_->size());
-  full_name->append(*result->name_);
-  result->full_name_ = full_name;
+  std::string full_name;
+  size_t scope_len = parent->full_name().size() - parent->name().size();
+  full_name.reserve(scope_len + proto.name().size());
+  full_name.append(parent->full_name().data(), scope_len);
+  full_name.append(proto.name());
+
+  result->all_names_ =
+      tables_->AllocateStringArray(proto.name(), std::move(full_name));
+  result->number_ = proto.number();
+  result->type_ = parent;
 
-  ValidateSymbolName(proto.name(), *full_name, proto);
+  ValidateSymbolName(proto.name(), result->full_name(), proto);
 
   // Copy options.
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
-    AllocateOptions(proto.options(), result);
+  result->options_ = nullptr;  // Set to default_instance later if necessary.
+  if (proto.has_options()) {
+    AllocateOptions(proto.options(), result,
+                    EnumValueDescriptorProto::kOptionsFieldNumber,
+                    "google.protobuf.EnumValueOptions");
   }
 
   // Again, enum values are weird because we makes them appear as siblings
   // of the enum type instead of children of it.  So, we use
   // parent->containing_type() as the value's parent.
   bool added_to_outer_scope =
-    AddSymbol(result->full_name(), parent->containing_type(), result->name(),
-              proto, Symbol(result));
+      AddSymbol(result->full_name(), parent->containing_type(), result->name(),
+                proto, Symbol::EnumValue(result, 0));
 
   // However, we also want to be able to search for values within a single
   // enum type, so we add it as a child of the enum type itself, too.
   // Note:  This could fail, but if it does, the error has already been
   //   reported by the above AddSymbol() call, so we ignore the return code.
-  bool added_to_inner_scope =
-    file_tables_->AddAliasUnderParent(parent, result->name(), Symbol(result));
+  bool added_to_inner_scope = file_tables_->AddAliasUnderParent(
+      parent, result->name(), Symbol::EnumValue(result, 1));
 
   if (added_to_inner_scope && !added_to_outer_scope) {
     // This value did not conflict with any values defined in the same enum,
     // but it did conflict with some other symbol defined in the enum type's
     // scope.  Let's print an additional error to explain this.
-    string outer_scope;
-    if (parent->containing_type() == NULL) {
+    std::string outer_scope;
+    if (parent->containing_type() == nullptr) {
       outer_scope = file_->package();
     } else {
       outer_scope = parent->containing_type()->full_name();
@@ -5213,12 +5915,12 @@ void DescriptorBuilder::BuildEnumValue(const EnumValueDescriptorProto& proto,
       outer_scope = "\"" + outer_scope + "\"";
     }
 
-    AddError(result->full_name(), proto,
-             DescriptorPool::ErrorCollector::NAME,
+    AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NAME,
              "Note that enum values use C++ scoping rules, meaning that "
              "enum values are siblings of their type, not children of it.  "
-             "Therefore, \"" + result->name() + "\" must be unique within "
-             + outer_scope + ", not just within \"" + parent->name() + "\".");
+             "Therefore, \"" +
+                 result->name() + "\" must be unique within " + outer_scope +
+                 ", not just within \"" + parent->name() + "\".");
   }
 
   // An enum is allowed to define two numbers that refer to the same value.
@@ -5230,67 +5932,57 @@ void DescriptorBuilder::BuildEnumValue(const EnumValueDescriptorProto& proto,
 void DescriptorBuilder::BuildService(const ServiceDescriptorProto& proto,
                                      const void* /* dummy */,
                                      ServiceDescriptor* result) {
-  string* full_name = tables_->AllocateString(file_->package());
-  if (!full_name->empty()) full_name->append(1, '.');
-  full_name->append(proto.name());
-
-  ValidateSymbolName(proto.name(), *full_name, proto);
-
-  result->name_      = tables_->AllocateString(proto.name());
-  result->full_name_ = full_name;
-  result->file_      = file_;
+  result->all_names_ = AllocateNameStrings(file_->package(), proto.name());
+  result->file_ = file_;
+  ValidateSymbolName(proto.name(), result->full_name(), proto);
 
   BUILD_ARRAY(proto, result, method, BuildMethod, result);
 
   // Copy options.
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
-    AllocateOptions(proto.options(), result);
+  result->options_ = nullptr;  // Set to default_instance later if necessary.
+  if (proto.has_options()) {
+    AllocateOptions(proto.options(), result,
+                    ServiceDescriptorProto::kOptionsFieldNumber,
+                    "google.protobuf.ServiceOptions");
   }
 
-  AddSymbol(result->full_name(), NULL, result->name(),
-            proto, Symbol(result));
+  AddSymbol(result->full_name(), nullptr, result->name(), proto,
+            Symbol(result));
 }
 
 void DescriptorBuilder::BuildMethod(const MethodDescriptorProto& proto,
                                     const ServiceDescriptor* parent,
                                     MethodDescriptor* result) {
-  result->name_    = tables_->AllocateString(proto.name());
   result->service_ = parent;
+  result->all_names_ = AllocateNameStrings(parent->full_name(), proto.name());
 
-  string* full_name = tables_->AllocateString(parent->full_name());
-  full_name->append(1, '.');
-  full_name->append(*result->name_);
-  result->full_name_ = full_name;
-
-  ValidateSymbolName(proto.name(), *full_name, proto);
+  ValidateSymbolName(proto.name(), result->full_name(), proto);
 
   // These will be filled in when cross-linking.
   result->input_type_.Init();
   result->output_type_.Init();
 
   // Copy options.
-  if (!proto.has_options()) {
-    result->options_ = NULL;  // Will set to default_instance later.
-  } else {
-    AllocateOptions(proto.options(), result);
+  result->options_ = nullptr;  // Set to default_instance later if necessary.
+  if (proto.has_options()) {
+    AllocateOptions(proto.options(), result,
+                    MethodDescriptorProto::kOptionsFieldNumber,
+                    "google.protobuf.MethodOptions");
   }
 
   result->client_streaming_ = proto.client_streaming();
   result->server_streaming_ = proto.server_streaming();
 
-  AddSymbol(result->full_name(), parent, result->name(),
-            proto, Symbol(result));
+  AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result));
 }
 
 #undef BUILD_ARRAY
 
 // -------------------------------------------------------------------
 
-void DescriptorBuilder::CrossLinkFile(
-    FileDescriptor* file, const FileDescriptorProto& proto) {
-  if (file->options_ == NULL) {
+void DescriptorBuilder::CrossLinkFile(FileDescriptor* file,
+                                      const FileDescriptorProto& proto) {
+  if (file->options_ == nullptr) {
     file->options_ = &FileOptions::default_instance();
   }
 
@@ -5311,9 +6003,9 @@ void DescriptorBuilder::CrossLinkFile(
   }
 }
 
-void DescriptorBuilder::CrossLinkMessage(
-    Descriptor* message, const DescriptorProto& proto) {
-  if (message->options_ == NULL) {
+void DescriptorBuilder::CrossLinkMessage(Descriptor* message,
+                                         const DescriptorProto& proto) {
+  if (message->options_ == nullptr) {
     message->options_ = &MessageOptions::default_instance();
   }
 
@@ -5343,7 +6035,7 @@ void DescriptorBuilder::CrossLinkMessage(
   // First count the number of fields per oneof.
   for (int i = 0; i < message->field_count(); i++) {
     const OneofDescriptor* oneof_decl = message->field(i)->containing_oneof();
-    if (oneof_decl != NULL) {
+    if (oneof_decl != nullptr) {
       // Make sure fields belonging to the same oneof are defined consecutively.
       // This enables optimizations in codegens and reflection libraries to
       // skip fields in the oneof group, as only one of the field can be set.
@@ -5352,65 +6044,95 @@ void DescriptorBuilder::CrossLinkMessage(
       // safe.
       if (oneof_decl->field_count() > 0 &&
           message->field(i - 1)->containing_oneof() != oneof_decl) {
-        AddError(
-            message->full_name() + "." + message->field(i - 1)->name(),
-            proto.field(i - 1), DescriptorPool::ErrorCollector::OTHER,
-            strings::Substitute(
-                "Fields in the same oneof must be defined consecutively. "
-                "\"$0\" cannot be defined before the completion of the "
-                "\"$1\" oneof definition.",
-                message->field(i - 1)->name(), oneof_decl->name()));
+        AddError(message->full_name() + "." + message->field(i - 1)->name(),
+                 proto.field(i - 1), DescriptorPool::ErrorCollector::TYPE,
+                 strings::Substitute(
+                     "Fields in the same oneof must be defined consecutively. "
+                     "\"$0\" cannot be defined before the completion of the "
+                     "\"$1\" oneof definition.",
+                     message->field(i - 1)->name(), oneof_decl->name()));
       }
       // Must go through oneof_decls_ array to get a non-const version of the
       // OneofDescriptor.
-      ++message->oneof_decls_[oneof_decl->index()].field_count_;
+      auto& out_oneof_decl = message->oneof_decls_[oneof_decl->index()];
+      if (out_oneof_decl.field_count_ == 0) {
+        out_oneof_decl.fields_ = message->field(i);
+      }
+
+      if (!had_errors_) {
+        // Verify that they are contiguous.
+        // This is assumed by OneofDescriptor::field(i).
+        // But only if there are no errors.
+        GOOGLE_CHECK_EQ(out_oneof_decl.fields_ + out_oneof_decl.field_count_,
+                 message->field(i));
+      }
+      ++out_oneof_decl.field_count_;
     }
   }
 
-  // Then allocate the arrays.
+  // Then verify the sizes.
   for (int i = 0; i < message->oneof_decl_count(); i++) {
     OneofDescriptor* oneof_decl = &message->oneof_decls_[i];
 
     if (oneof_decl->field_count() == 0) {
       AddError(message->full_name() + "." + oneof_decl->name(),
-               proto.oneof_decl(i),
-               DescriptorPool::ErrorCollector::NAME,
+               proto.oneof_decl(i), DescriptorPool::ErrorCollector::NAME,
                "Oneof must have at least one field.");
     }
 
-    oneof_decl->fields_ =
-      tables_->AllocateArray<const FieldDescriptor*>(oneof_decl->field_count_);
-    oneof_decl->field_count_ = 0;
-
-    if (oneof_decl->options_ == NULL) {
+    if (oneof_decl->options_ == nullptr) {
       oneof_decl->options_ = &OneofOptions::default_instance();
     }
   }
 
-  // Then fill them in.
   for (int i = 0; i < message->field_count(); i++) {
-    const OneofDescriptor* oneof_decl = message->field(i)->containing_oneof();
-    if (oneof_decl != NULL) {
-      OneofDescriptor* mutable_oneof_decl =
-          &message->oneof_decls_[oneof_decl->index()];
-      message->fields_[i].index_in_oneof_ = mutable_oneof_decl->field_count_;
-      mutable_oneof_decl->fields_[mutable_oneof_decl->field_count_++] =
-          message->field(i);
+    const FieldDescriptor* field = message->field(i);
+    if (field->proto3_optional_) {
+      if (!field->containing_oneof() ||
+          !field->containing_oneof()->is_synthetic()) {
+        AddError(message->full_name(), proto.field(i),
+                 DescriptorPool::ErrorCollector::OTHER,
+                 "Fields with proto3_optional set must be "
+                 "a member of a one-field oneof");
+      }
+    }
+  }
+
+  // Synthetic oneofs must be last.
+  int first_synthetic = -1;
+  for (int i = 0; i < message->oneof_decl_count(); i++) {
+    const OneofDescriptor* oneof = message->oneof_decl(i);
+    if (oneof->is_synthetic()) {
+      if (first_synthetic == -1) {
+        first_synthetic = i;
+      }
+    } else {
+      if (first_synthetic != -1) {
+        AddError(message->full_name(), proto.oneof_decl(i),
+                 DescriptorPool::ErrorCollector::OTHER,
+                 "Synthetic oneofs must be after all other oneofs");
+      }
     }
   }
+
+  if (first_synthetic == -1) {
+    message->real_oneof_decl_count_ = message->oneof_decl_count_;
+  } else {
+    message->real_oneof_decl_count_ = first_synthetic;
+  }
 }
 
 void DescriptorBuilder::CrossLinkExtensionRange(
     Descriptor::ExtensionRange* range,
-    const DescriptorProto::ExtensionRange& proto) {
-  if (range->options_ == NULL) {
+    const DescriptorProto::ExtensionRange& /*proto*/) {
+  if (range->options_ == nullptr) {
     range->options_ = &ExtensionRangeOptions::default_instance();
   }
 }
 
-void DescriptorBuilder::CrossLinkField(
-    FieldDescriptor* field, const FieldDescriptorProto& proto) {
-  if (field->options_ == NULL) {
+void DescriptorBuilder::CrossLinkField(FieldDescriptor* field,
+                                       const FieldDescriptorProto& proto) {
+  if (field->options_ == nullptr) {
     field->options_ = &FieldOptions::default_instance();
   }
 
@@ -5426,34 +6148,41 @@ void DescriptorBuilder::CrossLinkField(
                          DescriptorPool::ErrorCollector::EXTENDEE,
                          proto.extendee());
       return;
-    } else if (extendee.type != Symbol::MESSAGE) {
+    } else if (extendee.type() != Symbol::MESSAGE) {
       AddError(field->full_name(), proto,
                DescriptorPool::ErrorCollector::EXTENDEE,
                "\"" + proto.extendee() + "\" is not a message type.");
       return;
     }
-    field->containing_type_ = extendee.descriptor;
+    field->containing_type_ = extendee.descriptor();
 
-    const Descriptor::ExtensionRange* extension_range = field->containing_type()
-        ->FindExtensionRangeContainingNumber(field->number());
+    const Descriptor::ExtensionRange* extension_range =
+        field->containing_type()->FindExtensionRangeContainingNumber(
+            field->number());
 
-    if (extension_range == NULL) {
-      AddError(field->full_name(), proto,
-               DescriptorPool::ErrorCollector::NUMBER,
-               strings::Substitute("\"$0\" does not declare $1 as an "
-                                   "extension number.",
-                                   field->containing_type()->full_name(),
-                                   field->number()));
+    if (extension_range == nullptr) {
+      // Set of valid extension numbers for MessageSet is different (< 2^32)
+      // from other extendees (< 2^29). If unknown deps are allowed, we may not
+      // have that information, and wrongly deem the extension as invalid.
+      auto skip_check = get_allow_unknown(pool_) &&
+                        proto.extendee() == "google.protobuf.bridge.MessageSet";
+      if (!skip_check) {
+        AddError(field->full_name(), proto,
+                 DescriptorPool::ErrorCollector::NUMBER,
+                 strings::Substitute("\"$0\" does not declare $1 as an "
+                                  "extension number.",
+                                  field->containing_type()->full_name(),
+                                  field->number()));
+      }
     }
   }
 
-  if (field->containing_oneof() != NULL) {
+  if (field->containing_oneof() != nullptr) {
     if (field->label() != FieldDescriptor::LABEL_OPTIONAL) {
       // Note that this error will never happen when parsing .proto files.
       // It can only happen if you manually construct a FileDescriptorProto
       // that is incorrect.
-      AddError(field->full_name(), proto,
-               DescriptorPool::ErrorCollector::NAME,
+      AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME,
                "Fields of oneofs must themselves have label LABEL_OPTIONAL.");
     }
   }
@@ -5466,7 +6195,7 @@ void DescriptorBuilder::CrossLinkField(
                           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
+    // if the type exist or not. If it doesn't 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
@@ -5485,13 +6214,13 @@ void DescriptorBuilder::CrossLinkField(
       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();
-        field->type_once_ = tables_->AllocateOnceDynamic();
-        field->type_name_ = tables_->AllocateString(name);
-        if (proto.has_default_value()) {
-          field->default_value_enum_name_ =
-              tables_->AllocateString(proto.default_value());
-        }
+        std::string name = proto.type_name();
+        field->type_once_ = tables_->Create<internal::once_flag>();
+        field->type_descriptor_.lazy_type_name = tables_->Strdup(name);
+        field->lazy_default_value_enum_name_ =
+            proto.has_default_value() ? tables_->Strdup(proto.default_value())
+                                      : nullptr;
+
         // AddFieldByNumber and AddExtension are done later in this function,
         // and can/must be done if the field type was not found. The related
         // error checking is not necessary when in lazily_build_dependencies_
@@ -5519,9 +6248,9 @@ void DescriptorBuilder::CrossLinkField(
 
     if (!proto.has_type()) {
       // Choose field type based on symbol.
-      if (type.type == Symbol::MESSAGE) {
+      if (type.type() == Symbol::MESSAGE) {
         field->type_ = FieldDescriptor::TYPE_MESSAGE;
-      } else if (type.type == Symbol::ENUM) {
+      } else if (type.type() == Symbol::ENUM) {
         field->type_ = FieldDescriptor::TYPE_ENUM;
       } else {
         AddError(field->full_name(), proto,
@@ -5532,13 +6261,13 @@ void DescriptorBuilder::CrossLinkField(
     }
 
     if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-      if (type.type != Symbol::MESSAGE) {
+      field->type_descriptor_.message_type = type.descriptor();
+      if (field->type_descriptor_.message_type == nullptr) {
         AddError(field->full_name(), proto,
                  DescriptorPool::ErrorCollector::TYPE,
                  "\"" + proto.type_name() + "\" is not a message type.");
         return;
       }
-      field->message_type_ = type.descriptor;
 
       if (field->has_default_value()) {
         AddError(field->full_name(), proto,
@@ -5546,13 +6275,13 @@ void DescriptorBuilder::CrossLinkField(
                  "Messages can't have default values.");
       }
     } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
-      if (type.type != Symbol::ENUM) {
+      field->type_descriptor_.enum_type = type.enum_descriptor();
+      if (field->type_descriptor_.enum_type == nullptr) {
         AddError(field->full_name(), proto,
                  DescriptorPool::ErrorCollector::TYPE,
                  "\"" + proto.type_name() + "\" is not an enum type.");
         return;
       }
-      field->enum_type_ = type.enum_descriptor;
 
       if (field->enum_type()->is_placeholder_) {
         // We can't look up default values for placeholder types.  We'll have
@@ -5574,20 +6303,20 @@ void DescriptorBuilder::CrossLinkField(
           // We can't just use field->enum_type()->FindValueByName() here
           // because that locks the pool's mutex, which we have already locked
           // at this point.
-          Symbol default_value =
-            LookupSymbolNoPlaceholder(proto.default_value(),
-                                      field->enum_type()->full_name());
-
-          if (default_value.type == Symbol::ENUM_VALUE &&
-              default_value.enum_value_descriptor->type() ==
-              field->enum_type()) {
-            field->default_value_enum_ = default_value.enum_value_descriptor;
+          const EnumValueDescriptor* default_value =
+              LookupSymbolNoPlaceholder(proto.default_value(),
+                                        field->enum_type()->full_name())
+                  .enum_value_descriptor();
+
+          if (default_value != nullptr &&
+              default_value->type() == field->enum_type()) {
+            field->default_value_enum_ = default_value;
           } else {
             AddError(field->full_name(), proto,
                      DescriptorPool::ErrorCollector::DEFAULT_VALUE,
                      "Enum type \"" + field->enum_type()->full_name() +
-                     "\" has no value named \"" + proto.default_value() +
-                     "\".");
+                         "\" has no value named \"" + proto.default_value() +
+                         "\".");
           }
         }
       } else if (field->enum_type()->value_count() > 0) {
@@ -5615,41 +6344,41 @@ void DescriptorBuilder::CrossLinkField(
   // risk to calling containing_type() or other accessors that will build
   // dependencies.
   if (!file_tables_->AddFieldByNumber(field)) {
-    const FieldDescriptor* conflicting_field =
-      file_tables_->FindFieldByNumber(field->containing_type(),
-                                      field->number());
-    string containing_type_name = field->containing_type() == NULL
-                                      ? "unknown"
-                                      : field->containing_type()->full_name();
+    const FieldDescriptor* conflicting_field = file_tables_->FindFieldByNumber(
+        field->containing_type(), field->number());
+    std::string containing_type_name =
+        field->containing_type() == nullptr
+            ? "unknown"
+            : field->containing_type()->full_name();
     if (field->is_extension()) {
       AddError(field->full_name(), proto,
                DescriptorPool::ErrorCollector::NUMBER,
                strings::Substitute("Extension number $0 has already been used "
-                                   "in \"$1\" by extension \"$2\".",
-                                   field->number(),
-                                   containing_type_name,
-                                   conflicting_field->full_name()));
+                                "in \"$1\" by extension \"$2\".",
+                                field->number(), containing_type_name,
+                                conflicting_field->full_name()));
     } else {
       AddError(field->full_name(), proto,
                DescriptorPool::ErrorCollector::NUMBER,
                strings::Substitute("Field number $0 has already been used in "
-                                   "\"$1\" by field \"$2\".",
-                                   field->number(),
-                                   containing_type_name,
-                                   conflicting_field->name()));
+                                "\"$1\" by field \"$2\".",
+                                field->number(), containing_type_name,
+                                conflicting_field->name()));
     }
   } else {
     if (field->is_extension()) {
       if (!tables_->AddExtension(field)) {
         const FieldDescriptor* conflicting_field =
             tables_->FindExtension(field->containing_type(), field->number());
-        string error_msg = strings::Substitute(
+        std::string containing_type_name =
+            field->containing_type() == nullptr
+                ? "unknown"
+                : field->containing_type()->full_name();
+        std::string error_msg = strings::Substitute(
             "Extension number $0 has already been used in \"$1\" by extension "
             "\"$2\" defined in $3.",
-            field->number(),
-            field->containing_type()->full_name(),
-            conflicting_field->full_name(),
-            conflicting_field->file()->name());
+            field->number(), containing_type_name,
+            conflicting_field->full_name(), conflicting_field->file()->name());
         // Conflicting extension numbers should be an error. However, before
         // turning this into an error we need to fix all existing broken
         // protos first.
@@ -5661,9 +6390,9 @@ void DescriptorBuilder::CrossLinkField(
   }
 }
 
-void DescriptorBuilder::CrossLinkEnum(
-    EnumDescriptor* enum_type, const EnumDescriptorProto& proto) {
-  if (enum_type->options_ == NULL) {
+void DescriptorBuilder::CrossLinkEnum(EnumDescriptor* enum_type,
+                                      const EnumDescriptorProto& proto) {
+  if (enum_type->options_ == nullptr) {
     enum_type->options_ = &EnumOptions::default_instance();
   }
 
@@ -5675,14 +6404,14 @@ void DescriptorBuilder::CrossLinkEnum(
 void DescriptorBuilder::CrossLinkEnumValue(
     EnumValueDescriptor* enum_value,
     const EnumValueDescriptorProto& /* proto */) {
-  if (enum_value->options_ == NULL) {
+  if (enum_value->options_ == nullptr) {
     enum_value->options_ = &EnumValueOptions::default_instance();
   }
 }
 
-void DescriptorBuilder::CrossLinkService(
-    ServiceDescriptor* service, const ServiceDescriptorProto& proto) {
-  if (service->options_ == NULL) {
+void DescriptorBuilder::CrossLinkService(ServiceDescriptor* service,
+                                         const ServiceDescriptorProto& proto) {
+  if (service->options_ == nullptr) {
     service->options_ = &ServiceOptions::default_instance();
   }
 
@@ -5691,9 +6420,9 @@ void DescriptorBuilder::CrossLinkService(
   }
 }
 
-void DescriptorBuilder::CrossLinkMethod(
-    MethodDescriptor* method, const MethodDescriptorProto& proto) {
-  if (method->options_ == NULL) {
+void DescriptorBuilder::CrossLinkMethod(MethodDescriptor* method,
+                                        const MethodDescriptorProto& proto) {
+  if (method->options_ == nullptr) {
     method->options_ = &MethodOptions::default_instance();
   }
 
@@ -5709,12 +6438,12 @@ void DescriptorBuilder::CrossLinkMethod(
     } else {
       method->input_type_.SetLazy(proto.input_type(), file_);
     }
-  } else if (input_type.type != Symbol::MESSAGE) {
+  } else if (input_type.type() != Symbol::MESSAGE) {
     AddError(method->full_name(), proto,
              DescriptorPool::ErrorCollector::INPUT_TYPE,
              "\"" + proto.input_type() + "\" is not a message type.");
   } else {
-    method->input_type_.Set(input_type.descriptor);
+    method->input_type_.Set(input_type.descriptor());
   }
 
   Symbol output_type =
@@ -5729,21 +6458,21 @@ void DescriptorBuilder::CrossLinkMethod(
     } else {
       method->output_type_.SetLazy(proto.output_type(), file_);
     }
-  } else if (output_type.type != Symbol::MESSAGE) {
+  } else if (output_type.type() != Symbol::MESSAGE) {
     AddError(method->full_name(), proto,
              DescriptorPool::ErrorCollector::OUTPUT_TYPE,
              "\"" + proto.output_type() + "\" is not a message type.");
   } else {
-    method->output_type_.Set(output_type.descriptor);
+    method->output_type_.Set(output_type.descriptor());
   }
 }
 
 // -------------------------------------------------------------------
 
-#define VALIDATE_OPTIONS_FROM_ARRAY(descriptor, array_name, type)  \
-  for (int i = 0; i < descriptor->array_name##_count(); ++i) {     \
-    Validate##type##Options(descriptor->array_name##s_ + i,        \
-                            proto.array_name(i));                  \
+#define VALIDATE_OPTIONS_FROM_ARRAY(descriptor, array_name, type) \
+  for (int i = 0; i < descriptor->array_name##_count(); ++i) {    \
+    Validate##type##Options(descriptor->array_name##s_ + i,       \
+                            proto.array_name(i));                 \
   }
 
 // Determine if the file uses optimize_for = LITE_RUNTIME, being careful to
@@ -5751,7 +6480,7 @@ void DescriptorBuilder::CrossLinkMethod(
 static bool IsLite(const FileDescriptor* file) {
   // TODO(kenton):  I don't even remember how many of these conditions are
   //   actually possible.  I'm just being super-safe.
-  return file != NULL &&
+  return file != nullptr &&
          &file->options() != &FileOptions::default_instance() &&
          file->options().optimize_for() == FileOptions::LITE_RUNTIME;
 }
@@ -5768,11 +6497,12 @@ void DescriptorBuilder::ValidateFileOptions(FileDescriptor* file,
     for (int i = 0; i < file->dependency_count(); i++) {
       if (IsLite(file->dependency(i))) {
         AddError(
-          file->name(), proto,
-          DescriptorPool::ErrorCollector::OTHER,
-          "Files that do not use optimize_for = LITE_RUNTIME cannot import "
-          "files which do use this option.  This file is not lite, but it "
-          "imports \"" + file->dependency(i)->name() + "\" which is.");
+            file->dependency(i)->name(), proto,
+            DescriptorPool::ErrorCollector::IMPORT,
+            "Files that do not use optimize_for = LITE_RUNTIME cannot import "
+            "files which do use this option.  This file is not lite, but it "
+            "imports \"" +
+                file->dependency(i)->name() + "\" which is.");
         break;
       }
     }
@@ -5782,8 +6512,8 @@ void DescriptorBuilder::ValidateFileOptions(FileDescriptor* file,
   }
 }
 
-void DescriptorBuilder::ValidateProto3(
-    FileDescriptor* file, const FileDescriptorProto& proto) {
+void DescriptorBuilder::ValidateProto3(FileDescriptor* file,
+                                       const FileDescriptorProto& proto) {
   for (int i = 0; i < file->extension_count(); ++i) {
     ValidateProto3Field(file->extensions_ + i, proto.extension(i));
   }
@@ -5795,111 +6525,106 @@ void DescriptorBuilder::ValidateProto3(
   }
 }
 
-static string ToLowercaseWithoutUnderscores(const string& name) {
-  string result;
-  for (int i = 0; i < name.size(); ++i) {
-    if (name[i] != '_') {
-      if (name[i] >= 'A' && name[i] <= 'Z') {
-        result.push_back(name[i] - 'A' + 'a');
+static std::string ToLowercaseWithoutUnderscores(const std::string& name) {
+  std::string result;
+  for (char character : name) {
+    if (character != '_') {
+      if (character >= 'A' && character <= 'Z') {
+        result.push_back(character - 'A' + 'a');
       } else {
-        result.push_back(name[i]);
+        result.push_back(character);
       }
     }
   }
   return result;
 }
 
-void DescriptorBuilder::ValidateProto3Message(
-    Descriptor* message, const DescriptorProto& proto) {
+void DescriptorBuilder::ValidateProto3Message(Descriptor* message,
+                                              const DescriptorProto& proto) {
   for (int i = 0; i < message->nested_type_count(); ++i) {
-    ValidateProto3Message(message->nested_types_ + i,
-                                 proto.nested_type(i));
+    ValidateProto3Message(message->nested_types_ + i, proto.nested_type(i));
   }
   for (int i = 0; i < message->enum_type_count(); ++i) {
-    ValidateProto3Enum(message->enum_types_ + i,
-                              proto.enum_type(i));
+    ValidateProto3Enum(message->enum_types_ + i, proto.enum_type(i));
   }
   for (int i = 0; i < message->field_count(); ++i) {
     ValidateProto3Field(message->fields_ + i, proto.field(i));
   }
   for (int i = 0; i < message->extension_count(); ++i) {
-    ValidateProto3Field(message->extensions_ +i, proto.extension(i));
+    ValidateProto3Field(message->extensions_ + i, proto.extension(i));
   }
   if (message->extension_range_count() > 0) {
-    AddError(message->full_name(), proto,
-             DescriptorPool::ErrorCollector::OTHER,
+    AddError(message->full_name(), proto.extension_range(0),
+             DescriptorPool::ErrorCollector::NUMBER,
              "Extension ranges are not allowed in proto3.");
   }
   if (message->options().message_set_wire_format()) {
     // Using MessageSet doesn't make sense since we disallow extensions.
-    AddError(message->full_name(), proto,
-             DescriptorPool::ErrorCollector::OTHER,
+    AddError(message->full_name(), proto, DescriptorPool::ErrorCollector::NAME,
              "MessageSet is not supported in proto3.");
   }
 
   // In proto3, we reject field names if they conflict in camelCase.
   // Note that we currently enforce a stricter rule: Field names must be
   // unique after being converted to lowercase with underscores removed.
-  std::map<string, const FieldDescriptor*> name_to_field;
+  std::map<std::string, const FieldDescriptor*> name_to_field;
   for (int i = 0; i < message->field_count(); ++i) {
-    string lowercase_name = ToLowercaseWithoutUnderscores(
-        message->field(i)->name());
+    std::string lowercase_name =
+        ToLowercaseWithoutUnderscores(message->field(i)->name());
     if (name_to_field.find(lowercase_name) != name_to_field.end()) {
-      AddError(message->full_name(), proto,
-               DescriptorPool::ErrorCollector::OTHER,
+      AddError(message->full_name(), proto.field(i),
+               DescriptorPool::ErrorCollector::NAME,
                "The JSON camel-case name of field \"" +
-               message->field(i)->name() + "\" conflicts with field \"" +
-               name_to_field[lowercase_name]->name() + "\". This is not " +
-               "allowed in proto3.");
+                   message->field(i)->name() + "\" conflicts with field \"" +
+                   name_to_field[lowercase_name]->name() + "\". This is not " +
+                   "allowed in proto3.");
     } else {
       name_to_field[lowercase_name] = message->field(i);
     }
   }
 }
 
-void DescriptorBuilder::ValidateProto3Field(
-    FieldDescriptor* field, const FieldDescriptorProto& proto) {
+void DescriptorBuilder::ValidateProto3Field(FieldDescriptor* field,
+                                            const FieldDescriptorProto& proto) {
   if (field->is_extension() &&
       !AllowedExtendeeInProto3(field->containing_type()->full_name())) {
     AddError(field->full_name(), proto,
-             DescriptorPool::ErrorCollector::OTHER,
+             DescriptorPool::ErrorCollector::EXTENDEE,
              "Extensions in proto3 are only allowed for defining options.");
   }
   if (field->is_required()) {
-    AddError(field->full_name(), proto,
-             DescriptorPool::ErrorCollector::OTHER,
+    AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
              "Required fields are not allowed in proto3.");
   }
   if (field->has_default_value()) {
-    AddError(
-        field->full_name(), proto, DescriptorPool::ErrorCollector::OTHER,
-        "Explicit default values are not allowed in proto3.");
+    AddError(field->full_name(), proto,
+             DescriptorPool::ErrorCollector::DEFAULT_VALUE,
+             "Explicit default values are not allowed in proto3.");
   }
   if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM &&
       field->enum_type() &&
-      field->enum_type()->file()->syntax() != FileDescriptor::SYNTAX_PROTO3) {
+      field->enum_type()->file()->syntax() != FileDescriptor::SYNTAX_PROTO3 &&
+      field->enum_type()->file()->syntax() != FileDescriptor::SYNTAX_UNKNOWN) {
     // Proto3 messages can only use Proto3 enum types; otherwise we can't
     // guarantee that the default value is zero.
-    AddError(field->full_name(), proto,
-             DescriptorPool::ErrorCollector::TYPE,
+    AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
              "Enum type \"" + field->enum_type()->full_name() +
-             "\" is not a proto3 enum, but is used in \"" +
-             field->containing_type()->full_name() +
-             "\" which is a proto3 message type.");
+                 "\" is not a proto3 enum, but is used in \"" +
+                 field->containing_type()->full_name() +
+                 "\" which is a proto3 message type.");
   }
   if (field->type() == FieldDescriptor::TYPE_GROUP) {
-    AddError(field->full_name(), proto,
-             DescriptorPool::ErrorCollector::TYPE,
+    AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
              "Groups are not supported in proto3 syntax.");
   }
 }
 
-void DescriptorBuilder::ValidateProto3Enum(
-    EnumDescriptor* enm, const EnumDescriptorProto& proto) {
+void DescriptorBuilder::ValidateProto3Enum(EnumDescriptor* enm,
+                                           const EnumDescriptorProto& proto) {
   if (enm->value_count() > 0 && enm->value(0)->number() != 0) {
-    AddError(
-        enm->full_name(), proto, DescriptorPool::ErrorCollector::OTHER,
-        "The first enum value must be zero in proto3.");
+    AddError(enm->full_name(), proto.value(0),
+             DescriptorPool::ErrorCollector::NUMBER,
+             "The first enum value must be zero in proto3.");
   }
 }
 
@@ -5910,32 +6635,34 @@ void DescriptorBuilder::ValidateMessageOptions(Descriptor* message,
   VALIDATE_OPTIONS_FROM_ARRAY(message, enum_type, Enum);
   VALIDATE_OPTIONS_FROM_ARRAY(message, extension, Field);
 
-  const int64 max_extension_range =
-      static_cast<int64>(message->options().message_set_wire_format() ?
-                         kint32max :
-                         FieldDescriptor::kMaxNumber);
+  const int64_t max_extension_range =
+      static_cast<int64_t>(message->options().message_set_wire_format()
+                               ? std::numeric_limits<int32_t>::max()
+                               : FieldDescriptor::kMaxNumber);
   for (int i = 0; i < message->extension_range_count(); ++i) {
     if (message->extension_range(i)->end > max_extension_range + 1) {
-      AddError(
-          message->full_name(), proto.extension_range(i),
-          DescriptorPool::ErrorCollector::NUMBER,
-          strings::Substitute("Extension numbers cannot be greater than $0.",
-                              max_extension_range));
+      AddError(message->full_name(), proto.extension_range(i),
+               DescriptorPool::ErrorCollector::NUMBER,
+               strings::Substitute("Extension numbers cannot be greater than $0.",
+                                max_extension_range));
     }
+
+    ValidateExtensionRangeOptions(message->full_name(),
+                                  message->extension_ranges_ + i,
+                                  proto.extension_range(i));
   }
 }
 
 
-void DescriptorBuilder::ValidateFieldOptions(FieldDescriptor* field,
-    const FieldDescriptorProto& proto) {
+void DescriptorBuilder::ValidateFieldOptions(
+    FieldDescriptor* field, const FieldDescriptorProto& proto) {
   if (pool_->lazily_build_dependencies_ && (!field || !field->message_type())) {
     return;
   }
   // Only message type fields may be lazy.
   if (field->options().lazy()) {
     if (field->type() != FieldDescriptor::TYPE_MESSAGE) {
-      AddError(field->full_name(), proto,
-               DescriptorPool::ErrorCollector::TYPE,
+      AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
                "[lazy = true] can only be specified for submessage fields.");
     }
   }
@@ -5943,16 +6670,15 @@ void DescriptorBuilder::ValidateFieldOptions(FieldDescriptor* field,
   // Only repeated primitive fields may be packed.
   if (field->options().packed() && !field->is_packable()) {
     AddError(
-      field->full_name(), proto,
-      DescriptorPool::ErrorCollector::TYPE,
-      "[packed = true] can only be specified for repeated primitive fields.");
+        field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
+        "[packed = true] can only be specified for repeated primitive fields.");
   }
 
   // Note:  Default instance may not yet be initialized here, so we have to
   //   avoid reading from it.
-  if (field->containing_type_ != NULL &&
+  if (field->containing_type_ != nullptr &&
       &field->containing_type()->options() !=
-      &MessageOptions::default_instance() &&
+          &MessageOptions::default_instance() &&
       field->containing_type()->options().message_set_wire_format()) {
     if (field->is_extension()) {
       if (!field->is_optional() ||
@@ -5962,15 +6688,13 @@ void DescriptorBuilder::ValidateFieldOptions(FieldDescriptor* field,
                  "Extensions of MessageSets must be optional messages.");
       }
     } else {
-      AddError(field->full_name(), proto,
-               DescriptorPool::ErrorCollector::NAME,
+      AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME,
                "MessageSets cannot have fields, only extensions.");
     }
   }
 
   // Lite extensions can only be of Lite types.
-  if (IsLite(field->file()) &&
-      field->containing_type_ != NULL &&
+  if (IsLite(field->file()) && field->containing_type_ != nullptr &&
       !IsLite(field->containing_type()->file())) {
     AddError(field->full_name(), proto,
              DescriptorPool::ErrorCollector::EXTENDEE,
@@ -5982,8 +6706,7 @@ void DescriptorBuilder::ValidateFieldOptions(FieldDescriptor* field,
   // Validate map types.
   if (field->is_map()) {
     if (!ValidateMapEntry(field, proto)) {
-      AddError(field->full_name(), proto,
-               DescriptorPool::ErrorCollector::OTHER,
+      AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
                "map_entry should not be set explicitly. Use map<KeyType, "
                "ValueType> instead.");
     }
@@ -5991,30 +6714,43 @@ void DescriptorBuilder::ValidateFieldOptions(FieldDescriptor* field,
 
   ValidateJSType(field, proto);
 
+  // json_name option is not allowed on extension fields. Note that the
+  // json_name field in FieldDescriptorProto is always populated by protoc
+  // when it sends descriptor data to plugins (calculated from field name if
+  // the option is not explicitly set) so we can't rely on its presence to
+  // determine whether the json_name option is set on the field. Here we
+  // compare it against the default calculated json_name value and consider
+  // the option set if they are different. This won't catch the case when
+  // an user explicitly sets json_name to the default value, but should be
+  // good enough to catch common misuses.
+  if (field->is_extension() &&
+      (field->has_json_name() &&
+       field->json_name() != ToJsonName(field->name()))) {
+    AddError(field->full_name(), proto,
+             DescriptorPool::ErrorCollector::OPTION_NAME,
+             "option json_name is not allowed on extension fields.");
+  }
+
 }
 
 void DescriptorBuilder::ValidateEnumOptions(EnumDescriptor* enm,
                                             const EnumDescriptorProto& proto) {
   VALIDATE_OPTIONS_FROM_ARRAY(enm, value, EnumValue);
   if (!enm->options().has_allow_alias() || !enm->options().allow_alias()) {
-    std::map<int, string> used_values;
+    std::map<int, std::string> used_values;
     for (int i = 0; i < enm->value_count(); ++i) {
       const EnumValueDescriptor* enum_value = enm->value(i);
       if (used_values.find(enum_value->number()) != used_values.end()) {
-        string error =
+        std::string error =
             "\"" + enum_value->full_name() +
             "\" uses the same enum value as \"" +
-            used_values[enum_value->number()] + "\". If this is intended, set "
+            used_values[enum_value->number()] +
+            "\". If this is intended, set "
             "'option allow_alias = true;' to the enum definition.";
         if (!enm->options().allow_alias()) {
           // Generate error if duplicated enum values are explicitly disallowed.
-          AddError(enm->full_name(), proto,
-                   DescriptorPool::ErrorCollector::NUMBER,
-                   error);
-        } else {
-          // Generate warning if duplicated values are found but the option
-          // isn't set.
-          GOOGLE_LOG(ERROR) << error;
+          AddError(enm->full_name(), proto.value(i),
+                   DescriptorPool::ErrorCollector::NUMBER, error);
         }
       } else {
         used_values[enum_value->number()] = enum_value->full_name();
@@ -6028,31 +6764,38 @@ void DescriptorBuilder::ValidateEnumValueOptions(
     const EnumValueDescriptorProto& /* proto */) {
   // Nothing to do so far.
 }
-void DescriptorBuilder::ValidateServiceOptions(ServiceDescriptor* service,
-    const ServiceDescriptorProto& proto) {
+
+void DescriptorBuilder::ValidateExtensionRangeOptions(
+    const std::string& full_name, Descriptor::ExtensionRange* extension_range,
+    const DescriptorProto_ExtensionRange& proto) {
+  (void)full_name;        // Parameter is used by Google-internal code.
+  (void)extension_range;  // Parameter is used by Google-internal code.
+}
+
+void DescriptorBuilder::ValidateServiceOptions(
+    ServiceDescriptor* service, const ServiceDescriptorProto& proto) {
   if (IsLite(service->file()) &&
       (service->file()->options().cc_generic_services() ||
        service->file()->options().java_generic_services())) {
-    AddError(service->full_name(), proto,
-             DescriptorPool::ErrorCollector::NAME,
+    AddError(service->full_name(), proto, DescriptorPool::ErrorCollector::NAME,
              "Files with optimize_for = LITE_RUNTIME cannot define services "
              "unless you set both options cc_generic_services and "
-             "java_generic_sevices to false.");
+             "java_generic_services to false.");
   }
 
   VALIDATE_OPTIONS_FROM_ARRAY(service, method, Method);
 }
 
-void DescriptorBuilder::ValidateMethodOptions(MethodDescriptor* /* method */,
-    const MethodDescriptorProto& /* proto */) {
+void DescriptorBuilder::ValidateMethodOptions(
+    MethodDescriptor* /* method */, const MethodDescriptorProto& /* proto */) {
   // Nothing to do so far.
 }
 
 bool DescriptorBuilder::ValidateMapEntry(FieldDescriptor* field,
                                          const FieldDescriptorProto& proto) {
   const Descriptor* message = field->message_type();
-  if (// Must not contain extensions, extension range or nested message or
-      // enums
+  if (  // Must not contain extensions, extension range or nested message or
+        // enums
       message->extension_count() != 0 ||
       field->label() != FieldDescriptor::LABEL_REPEATED ||
       message->extension_range_count() != 0 ||
@@ -6066,8 +6809,8 @@ bool DescriptorBuilder::ValidateMapEntry(FieldDescriptor* field,
     return false;
   }
 
-  const FieldDescriptor* key = message->field(0);
-  const FieldDescriptor* value = message->field(1);
+  const FieldDescriptor* key = message->map_key();
+  const FieldDescriptor* value = message->map_value();
   if (key->label() != FieldDescriptor::LABEL_OPTIONAL || key->number() != 1 ||
       key->name() != "key") {
     return false;
@@ -6080,9 +6823,8 @@ bool DescriptorBuilder::ValidateMapEntry(FieldDescriptor* field,
   // Check key types are legal.
   switch (key->type()) {
     case FieldDescriptor::TYPE_ENUM:
-      AddError(
-          field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
-          "Key in map fields cannot be enum types.");
+      AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
+               "Key in map fields cannot be enum types.");
       break;
     case FieldDescriptor::TYPE_FLOAT:
     case FieldDescriptor::TYPE_DOUBLE:
@@ -6107,15 +6849,14 @@ bool DescriptorBuilder::ValidateMapEntry(FieldDescriptor* field,
     case FieldDescriptor::TYPE_SFIXED64:
       // Legal cases
       break;
-    // Do not add a default, so that the compiler will complain when new types
-    // are added.
+      // Do not add a default, so that the compiler will complain when new types
+      // are added.
   }
 
   if (value->type() == FieldDescriptor::TYPE_ENUM) {
     if (value->enum_type()->value(0)->number() != 0) {
-      AddError(
-          field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
-          "Enum value in map must define 0 as the first value.");
+      AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
+               "Enum value in map must define 0 as the first value.");
     }
   }
 
@@ -6124,10 +6865,10 @@ bool DescriptorBuilder::ValidateMapEntry(FieldDescriptor* field,
 
 void DescriptorBuilder::DetectMapConflicts(const Descriptor* message,
                                            const DescriptorProto& proto) {
-  std::map<string, const Descriptor*> seen_types;
+  std::map<std::string, const Descriptor*> seen_types;
   for (int i = 0; i < message->nested_type_count(); ++i) {
     const Descriptor* nested = message->nested_type(i);
-    std::pair<std::map<string, const Descriptor*>::iterator, bool> result =
+    std::pair<std::map<std::string, const Descriptor*>::iterator, bool> result =
         seen_types.insert(std::make_pair(nested->name(), nested));
     if (!result.second) {
       if (result.first->second->options().map_entry() ||
@@ -6135,7 +6876,7 @@ void DescriptorBuilder::DetectMapConflicts(const Descriptor* message,
         AddError(message->full_name(), proto,
                  DescriptorPool::ErrorCollector::NAME,
                  "Expanded map entry type " + nested->name() +
-                 " conflicts with an existing nested message type.");
+                     " conflicts with an existing nested message type.");
       }
     }
     // Recursively test on the nested types.
@@ -6144,37 +6885,37 @@ void DescriptorBuilder::DetectMapConflicts(const Descriptor* message,
   // Check for conflicted field names.
   for (int i = 0; i < message->field_count(); ++i) {
     const FieldDescriptor* field = message->field(i);
-    std::map<string, const Descriptor*>::iterator iter =
+    std::map<std::string, const Descriptor*>::iterator iter =
         seen_types.find(field->name());
     if (iter != seen_types.end() && iter->second->options().map_entry()) {
       AddError(message->full_name(), proto,
                DescriptorPool::ErrorCollector::NAME,
                "Expanded map entry type " + iter->second->name() +
-               " conflicts with an existing field.");
+                   " conflicts with an existing field.");
     }
   }
   // Check for conflicted enum names.
   for (int i = 0; i < message->enum_type_count(); ++i) {
     const EnumDescriptor* enum_desc = message->enum_type(i);
-    std::map<string, const Descriptor*>::iterator iter =
+    std::map<std::string, const Descriptor*>::iterator iter =
         seen_types.find(enum_desc->name());
     if (iter != seen_types.end() && iter->second->options().map_entry()) {
       AddError(message->full_name(), proto,
                DescriptorPool::ErrorCollector::NAME,
                "Expanded map entry type " + iter->second->name() +
-               " conflicts with an existing enum type.");
+                   " conflicts with an existing enum type.");
     }
   }
   // Check for conflicted oneof names.
   for (int i = 0; i < message->oneof_decl_count(); ++i) {
     const OneofDescriptor* oneof_desc = message->oneof_decl(i);
-    std::map<string, const Descriptor*>::iterator iter =
+    std::map<std::string, const Descriptor*>::iterator iter =
         seen_types.find(oneof_desc->name());
     if (iter != seen_types.end() && iter->second->options().map_entry()) {
       AddError(message->full_name(), proto,
                DescriptorPool::ErrorCollector::NAME,
                "Expanded map entry type " + iter->second->name() +
-               " conflicts with an existing oneof type.");
+                   " conflicts with an existing oneof type.");
     }
   }
 }
@@ -6202,7 +6943,7 @@ void DescriptorBuilder::ValidateJSType(FieldDescriptor* field,
       AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE,
                "Illegal jstype for int64, uint64, sint64, fixed64 "
                "or sfixed64 field: " +
-               FieldOptions_JSType_descriptor()->value(jstype)->name());
+                   FieldOptions_JSType_descriptor()->value(jstype)->name());
       break;
 
     // No other types permit a jstype option.
@@ -6219,12 +6960,12 @@ void DescriptorBuilder::ValidateJSType(FieldDescriptor* field,
 // -------------------------------------------------------------------
 
 DescriptorBuilder::OptionInterpreter::OptionInterpreter(
-    DescriptorBuilder* builder) : builder_(builder) {
+    DescriptorBuilder* builder)
+    : builder_(builder) {
   GOOGLE_CHECK(builder_);
 }
 
-DescriptorBuilder::OptionInterpreter::~OptionInterpreter() {
-}
+DescriptorBuilder::OptionInterpreter::~OptionInterpreter() {}
 
 bool DescriptorBuilder::OptionInterpreter::InterpretOptions(
     OptionsToInterpret* options_to_interpret) {
@@ -6240,32 +6981,39 @@ bool DescriptorBuilder::OptionInterpreter::InterpretOptions(
   // and clear them, since we're about to interpret them.
   const FieldDescriptor* uninterpreted_options_field =
       options->GetDescriptor()->FindFieldByName("uninterpreted_option");
-  GOOGLE_CHECK(uninterpreted_options_field != NULL)
+  GOOGLE_CHECK(uninterpreted_options_field != nullptr)
       << "No field named \"uninterpreted_option\" in the Options proto.";
   options->GetReflection()->ClearField(options, uninterpreted_options_field);
 
+  std::vector<int> src_path = options_to_interpret->element_path;
+  src_path.push_back(uninterpreted_options_field->number());
+
   // Find the uninterpreted_option field in the original options.
   const FieldDescriptor* original_uninterpreted_options_field =
-      original_options->GetDescriptor()->
-          FindFieldByName("uninterpreted_option");
-  GOOGLE_CHECK(original_uninterpreted_options_field != NULL)
+      original_options->GetDescriptor()->FindFieldByName(
+          "uninterpreted_option");
+  GOOGLE_CHECK(original_uninterpreted_options_field != nullptr)
       << "No field named \"uninterpreted_option\" in the Options proto.";
 
-  const int num_uninterpreted_options = original_options->GetReflection()->
-      FieldSize(*original_options, original_uninterpreted_options_field);
+  const int num_uninterpreted_options =
+      original_options->GetReflection()->FieldSize(
+          *original_options, original_uninterpreted_options_field);
   for (int i = 0; i < num_uninterpreted_options; ++i) {
+    src_path.push_back(i);
     uninterpreted_option_ = down_cast<const UninterpretedOption*>(
         &original_options->GetReflection()->GetRepeatedMessage(
             *original_options, original_uninterpreted_options_field, i));
-    if (!InterpretSingleOption(options)) {
+    if (!InterpretSingleOption(options, src_path,
+                               options_to_interpret->element_path)) {
       // Error already added by InterpretSingleOption().
       failed = true;
       break;
     }
+    src_path.pop_back();
   }
   // Reset these, so we don't have any dangling pointers.
-  uninterpreted_option_ = NULL;
-  options_to_interpret_ = NULL;
+  uninterpreted_option_ = nullptr;
+  options_to_interpret_ = nullptr;
 
   if (!failed) {
     // InterpretSingleOption() added the interpreted options in the
@@ -6276,25 +7024,35 @@ bool DescriptorBuilder::OptionInterpreter::InterpretOptions(
     // If they are not known, that's OK too. They will get reparsed into the
     // UnknownFieldSet and wait there until the message is parsed by something
     // that does know about the options.
-    string buf;
-    GOOGLE_CHECK(options->AppendPartialToString(&buf))
-        << "Protocol message could not be serialized.";
-    GOOGLE_CHECK(options->ParsePartialFromString(buf))
-        << "Protocol message serialized itself in invalid fashion.";
-    if (!options->IsInitialized()) {
-      builder_->AddWarning(
+
+    // Keep the unparsed options around in case the reparsing fails.
+    std::unique_ptr<Message> unparsed_options(options->New());
+    options->GetReflection()->Swap(unparsed_options.get(), options);
+
+    std::string buf;
+    if (!unparsed_options->AppendToString(&buf) ||
+        !options->ParseFromString(buf)) {
+      builder_->AddError(
           options_to_interpret->element_name, *original_options,
           DescriptorPool::ErrorCollector::OTHER,
-          "Options could not be fully parsed using the proto descriptors "
-          "compiled into this binary. Missing required fields: " +
-          options->InitializationErrorString());
+          "Some options could not be correctly parsed using the proto "
+          "descriptors compiled into this binary.\n"
+          "Unparsed options: " +
+              unparsed_options->ShortDebugString() +
+              "\n"
+              "Parsing attempt:  " +
+              options->ShortDebugString());
+      // Restore the unparsed options.
+      options->GetReflection()->Swap(unparsed_options.get(), options);
     }
   }
+
   return !failed;
 }
 
 bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
-    Message* options) {
+    Message* options, const std::vector<int>& src_path,
+    const std::vector<int>& options_path) {
   // First do some basic validation.
   if (uninterpreted_option_->name_size() == 0) {
     // This should never happen unless the parser has gone seriously awry or
@@ -6302,15 +7060,16 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
     return AddNameError("Option must have a name.");
   }
   if (uninterpreted_option_->name(0).name_part() == "uninterpreted_option") {
-    return AddNameError("Option must not use reserved name "
-                        "\"uninterpreted_option\".");
+    return AddNameError(
+        "Option must not use reserved name "
+        "\"uninterpreted_option\".");
   }
 
-  const Descriptor* options_descriptor = NULL;
+  const Descriptor* options_descriptor = nullptr;
   // Get the options message's descriptor from the builder's pool, so that we
-  // get the version that knows about any extension options declared in the
-  // file we're currently building. The descriptor should be there as long as
-  // the file we're building imported "google/protobuf/descriptors.proto".
+  // get the version that knows about any extension options declared in the file
+  // we're currently building. The descriptor should be there as long as the
+  // file we're building imported descriptor.proto.
 
   // Note that we use DescriptorBuilder::FindSymbolNotEnforcingDeps(), not
   // DescriptorPool::FindMessageTypeByName() because we're already holding the
@@ -6318,10 +7077,9 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
   // FindSymbol() because files that use custom options only need to depend on
   // the file that defines the option, not descriptor.proto itself.
   Symbol symbol = builder_->FindSymbolNotEnforcingDeps(
-    options->GetDescriptor()->full_name());
-  if (!symbol.IsNull() && symbol.type == Symbol::MESSAGE) {
-    options_descriptor = symbol.descriptor;
-  } else {
+      options->GetDescriptor()->full_name());
+  options_descriptor = symbol.descriptor();
+  if (options_descriptor == nullptr) {
     // The options message's descriptor was not in the builder's pool, so use
     // the standard version from the generated pool. We're not holding the
     // generated pool's mutex, so we can search it the straightforward way.
@@ -6336,12 +7094,15 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
   // through in |intermediate_fields|. As we go, we reconstruct the full option
   // name in |debug_msg_name|, for use in error messages.
   const Descriptor* descriptor = options_descriptor;
-  const FieldDescriptor* field = NULL;
+  const FieldDescriptor* field = nullptr;
   std::vector<const FieldDescriptor*> intermediate_fields;
-  string debug_msg_name = "";
+  std::string debug_msg_name = "";
+
+  std::vector<int> dest_path = options_path;
 
   for (int i = 0; i < uninterpreted_option_->name_size(); ++i) {
-    const string& name_part = uninterpreted_option_->name(i).name_part();
+    builder_->undefine_resolved_name_.clear();
+    const std::string& name_part = uninterpreted_option_->name(i).name_part();
     if (debug_msg_name.size() > 0) {
       debug_msg_name += ".";
     }
@@ -6352,11 +7113,9 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
       // DescriptorPool::FindExtensionByName(), for two reasons: 1) It allows
       // relative lookups, and 2) because we're already holding the pool's
       // mutex, and the latter method locks it again.
-      symbol = builder_->LookupSymbol(name_part,
-                                      options_to_interpret_->name_scope);
-      if (!symbol.IsNull() && symbol.type == Symbol::FIELD) {
-        field = symbol.field_descriptor;
-      }
+      symbol =
+          builder_->LookupSymbol(name_part, options_to_interpret_->name_scope);
+      field = symbol.field_descriptor();
       // If we don't find the field then the field's descriptor was not in the
       // builder's pool, but there's no point in looking in the generated
       // pool. We require that you import the file that defines any extensions
@@ -6367,7 +7126,7 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
       field = descriptor->FindFieldByName(name_part);
     }
 
-    if (field == NULL) {
+    if (field == nullptr) {
       if (get_allow_unknown(builder_->pool_)) {
         // We can't find the option, but AllowUnknownDependencies() is enabled,
         // so we will just leave it as uninterpreted.
@@ -6383,7 +7142,10 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
             debug_msg_name.substr(1) +
             "\") to start from the outermost scope.");
       } else {
-        return AddNameError("Option \"" + debug_msg_name + "\" unknown.");
+        return AddNameError(
+            "Option \"" + debug_msg_name +
+            "\" unknown. Ensure that your proto" +
+            " definition file imports the proto which defines the option.");
       }
     } else if (field->containing_type() != descriptor) {
       if (get_is_placeholder(field->containing_type())) {
@@ -6402,19 +7164,24 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
                             "\" is not a field or extension of message \"" +
                             descriptor->name() + "\".");
       }
-    } else if (i < uninterpreted_option_->name_size() - 1) {
-      if (field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) {
-        return AddNameError("Option \"" +  debug_msg_name +
-                            "\" is an atomic type, not a message.");
-      } else if (field->is_repeated()) {
-        return AddNameError("Option field \"" + debug_msg_name +
-                            "\" is a repeated message. Repeated message "
-                            "options must be initialized using an "
-                            "aggregate value.");
-      } else {
-        // Drill down into the submessage.
-        intermediate_fields.push_back(field);
-        descriptor = field->message_type();
+    } else {
+      // accumulate field numbers to form path to interpreted option
+      dest_path.push_back(field->number());
+
+      if (i < uninterpreted_option_->name_size() - 1) {
+        if (field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) {
+          return AddNameError("Option \"" + debug_msg_name +
+                              "\" is an atomic type, not a message.");
+        } else if (field->is_repeated()) {
+          return AddNameError("Option field \"" + debug_msg_name +
+                              "\" is a repeated message. Repeated message "
+                              "options must be initialized using an "
+                              "aggregate value.");
+        } else {
+          // Drill down into the submessage.
+          intermediate_fields.push_back(field);
+          descriptor = field->message_type();
+        }
       }
     }
   }
@@ -6427,18 +7194,17 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
   // known will populate them correctly.
 
   // First see if the option is already set.
-  if (!field->is_repeated() && !ExamineIfOptionIsSet(
-          intermediate_fields.begin(),
-          intermediate_fields.end(),
-          field, debug_msg_name,
+  if (!field->is_repeated() &&
+      !ExamineIfOptionIsSet(
+          intermediate_fields.begin(), intermediate_fields.end(), field,
+          debug_msg_name,
           options->GetReflection()->GetUnknownFields(*options))) {
     return false;  // ExamineIfOptionIsSet() already added the error.
   }
 
-
   // First set the value on the UnknownFieldSet corresponding to the
   // innermost message.
-  google::protobuf::scoped_ptr<UnknownFieldSet> unknown_fields(new UnknownFieldSet());
+  std::unique_ptr<UnknownFieldSet> unknown_fields(new UnknownFieldSet());
   if (!SetOptionValue(field, unknown_fields.get())) {
     return false;  // SetOptionValue() already added the error.
   }
@@ -6448,7 +7214,7 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
   for (std::vector<const FieldDescriptor*>::reverse_iterator iter =
            intermediate_fields.rbegin();
        iter != intermediate_fields.rend(); ++iter) {
-    google::protobuf::scoped_ptr<UnknownFieldSet> parent_unknown_fields(
+    std::unique_ptr<UnknownFieldSet> parent_unknown_fields(
         new UnknownFieldSet());
     switch ((*iter)->type()) {
       case FieldDescriptor::TYPE_MESSAGE: {
@@ -6463,8 +7229,8 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
       }
 
       case FieldDescriptor::TYPE_GROUP: {
-         parent_unknown_fields->AddGroup((*iter)->number())
-                              ->MergeFrom(*unknown_fields);
+        parent_unknown_fields->AddGroup((*iter)->number())
+            ->MergeFrom(*unknown_fields);
         break;
       }
 
@@ -6481,24 +7247,125 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption(
   options->GetReflection()->MutableUnknownFields(options)->MergeFrom(
       *unknown_fields);
 
+  // record the element path of the interpreted option
+  if (field->is_repeated()) {
+    int index = repeated_option_counts_[dest_path]++;
+    dest_path.push_back(index);
+  }
+  interpreted_paths_[src_path] = dest_path;
+
   return true;
 }
 
+void DescriptorBuilder::OptionInterpreter::UpdateSourceCodeInfo(
+    SourceCodeInfo* info) {
+  if (interpreted_paths_.empty()) {
+    // nothing to do!
+    return;
+  }
+
+  // We find locations that match keys in interpreted_paths_ and
+  // 1) replace the path with the corresponding value in interpreted_paths_
+  // 2) remove any subsequent sub-locations (sub-location is one whose path
+  //    has the parent path as a prefix)
+  //
+  // To avoid quadratic behavior of removing interior rows as we go,
+  // we keep a copy. But we don't actually copy anything until we've
+  // found the first match (so if the source code info has no locations
+  // that need to be changed, there is zero copy overhead).
+
+  RepeatedPtrField<SourceCodeInfo_Location>* locs = info->mutable_location();
+  RepeatedPtrField<SourceCodeInfo_Location> new_locs;
+  bool copying = false;
+
+  std::vector<int> pathv;
+  bool matched = false;
+
+  for (RepeatedPtrField<SourceCodeInfo_Location>::iterator loc = locs->begin();
+       loc != locs->end(); loc++) {
+    if (matched) {
+      // see if this location is in the range to remove
+      bool loc_matches = true;
+      if (loc->path_size() < static_cast<int64_t>(pathv.size())) {
+        loc_matches = false;
+      } else {
+        for (size_t j = 0; j < pathv.size(); j++) {
+          if (loc->path(j) != pathv[j]) {
+            loc_matches = false;
+            break;
+          }
+        }
+      }
+
+      if (loc_matches) {
+        // don't copy this row since it is a sub-location that we're removing
+        continue;
+      }
+
+      matched = false;
+    }
+
+    pathv.clear();
+    for (int j = 0; j < loc->path_size(); j++) {
+      pathv.push_back(loc->path(j));
+    }
+
+    std::map<std::vector<int>, std::vector<int>>::iterator entry =
+        interpreted_paths_.find(pathv);
+
+    if (entry == interpreted_paths_.end()) {
+      // not a match
+      if (copying) {
+        *new_locs.Add() = *loc;
+      }
+      continue;
+    }
+
+    matched = true;
+
+    if (!copying) {
+      // initialize the copy we are building
+      copying = true;
+      new_locs.Reserve(locs->size());
+      for (RepeatedPtrField<SourceCodeInfo_Location>::iterator it =
+               locs->begin();
+           it != loc; it++) {
+        *new_locs.Add() = *it;
+      }
+    }
+
+    // add replacement and update its path
+    SourceCodeInfo_Location* replacement = new_locs.Add();
+    *replacement = *loc;
+    replacement->clear_path();
+    for (std::vector<int>::iterator rit = entry->second.begin();
+         rit != entry->second.end(); rit++) {
+      replacement->add_path(*rit);
+    }
+  }
+
+  // if we made a changed copy, put it in place
+  if (copying) {
+    *locs = new_locs;
+  }
+}
+
 void DescriptorBuilder::OptionInterpreter::AddWithoutInterpreting(
     const UninterpretedOption& uninterpreted_option, Message* options) {
   const FieldDescriptor* field =
-    options->GetDescriptor()->FindFieldByName("uninterpreted_option");
-  GOOGLE_CHECK(field != NULL);
+      options->GetDescriptor()->FindFieldByName("uninterpreted_option");
+  GOOGLE_CHECK(field != nullptr);
 
-  options->GetReflection()->AddMessage(options, field)
-    ->CopyFrom(uninterpreted_option);
+  options->GetReflection()
+      ->AddMessage(options, field)
+      ->CopyFrom(uninterpreted_option);
 }
 
 bool DescriptorBuilder::OptionInterpreter::ExamineIfOptionIsSet(
     std::vector<const FieldDescriptor*>::const_iterator
         intermediate_fields_iter,
     std::vector<const FieldDescriptor*>::const_iterator intermediate_fields_end,
-    const FieldDescriptor* innermost_field, const string& debug_msg_name,
+    const FieldDescriptor* innermost_field, const std::string& debug_msg_name,
     const UnknownFieldSet& unknown_fields) {
   // We do linear searches of the UnknownFieldSet and its sub-groups.  This
   // should be fine since it's unlikely that any one options structure will
@@ -6528,8 +7395,8 @@ bool DescriptorBuilder::OptionInterpreter::ExamineIfOptionIsSet(
             if (intermediate_unknown_fields.ParseFromString(
                     unknown_field->length_delimited()) &&
                 !ExamineIfOptionIsSet(intermediate_fields_iter + 1,
-                                      intermediate_fields_end,
-                                      innermost_field, debug_msg_name,
+                                      intermediate_fields_end, innermost_field,
+                                      debug_msg_name,
                                       intermediate_unknown_fields)) {
               return false;  // Error already added.
             }
@@ -6539,9 +7406,8 @@ bool DescriptorBuilder::OptionInterpreter::ExamineIfOptionIsSet(
         case FieldDescriptor::TYPE_GROUP:
           if (unknown_field->type() == UnknownField::TYPE_GROUP) {
             if (!ExamineIfOptionIsSet(intermediate_fields_iter + 1,
-                                      intermediate_fields_end,
-                                      innermost_field, debug_msg_name,
-                                      unknown_field->group())) {
+                                      intermediate_fields_end, innermost_field,
+                                      debug_msg_name, unknown_field->group())) {
               return false;  // Error already added.
             }
           }
@@ -6557,15 +7423,13 @@ bool DescriptorBuilder::OptionInterpreter::ExamineIfOptionIsSet(
 }
 
 bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
-    const FieldDescriptor* option_field,
-    UnknownFieldSet* unknown_fields) {
+    const FieldDescriptor* option_field, UnknownFieldSet* unknown_fields) {
   // We switch on the CppType to validate.
   switch (option_field->cpp_type()) {
-
     case FieldDescriptor::CPPTYPE_INT32:
       if (uninterpreted_option_->has_positive_int_value()) {
         if (uninterpreted_option_->positive_int_value() >
-            static_cast<uint64>(kint32max)) {
+            static_cast<uint64_t>(std::numeric_limits<int32_t>::max())) {
           return AddValueError("Value out of range for int32 option \"" +
                                option_field->full_name() + "\".");
         } else {
@@ -6575,7 +7439,7 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
         }
       } else if (uninterpreted_option_->has_negative_int_value()) {
         if (uninterpreted_option_->negative_int_value() <
-            static_cast<int64>(kint32min)) {
+            static_cast<int64_t>(std::numeric_limits<int32_t>::min())) {
           return AddValueError("Value out of range for int32 option \"" +
                                option_field->full_name() + "\".");
         } else {
@@ -6592,7 +7456,7 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
     case FieldDescriptor::CPPTYPE_INT64:
       if (uninterpreted_option_->has_positive_int_value()) {
         if (uninterpreted_option_->positive_int_value() >
-            static_cast<uint64>(kint64max)) {
+            static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) {
           return AddValueError("Value out of range for int64 option \"" +
                                option_field->full_name() + "\".");
         } else {
@@ -6612,7 +7476,8 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
 
     case FieldDescriptor::CPPTYPE_UINT32:
       if (uninterpreted_option_->has_positive_int_value()) {
-        if (uninterpreted_option_->positive_int_value() > kuint32max) {
+        if (uninterpreted_option_->positive_int_value() >
+            std::numeric_limits<uint32_t>::max()) {
           return AddValueError("Value out of range for uint32 option \"" +
                                option_field->name() + "\".");
         } else {
@@ -6621,8 +7486,10 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
                     option_field->type(), unknown_fields);
         }
       } else {
-        return AddValueError("Value must be non-negative integer for uint32 "
-                             "option \"" + option_field->full_name() + "\".");
+        return AddValueError(
+            "Value must be non-negative integer for uint32 "
+            "option \"" +
+            option_field->full_name() + "\".");
       }
       break;
 
@@ -6632,8 +7499,10 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
                   uninterpreted_option_->positive_int_value(),
                   option_field->type(), unknown_fields);
       } else {
-        return AddValueError("Value must be non-negative integer for uint64 "
-                             "option \"" + option_field->full_name() + "\".");
+        return AddValueError(
+            "Value must be non-negative integer for uint64 "
+            "option \"" +
+            option_field->full_name() + "\".");
       }
       break;
 
@@ -6650,7 +7519,7 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
                              option_field->full_name() + "\".");
       }
       unknown_fields->AddFixed32(option_field->number(),
-          google::protobuf::internal::WireFormatLite::EncodeFloat(value));
+                                 internal::WireFormatLite::EncodeFloat(value));
       break;
     }
 
@@ -6667,40 +7536,46 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
                              option_field->full_name() + "\".");
       }
       unknown_fields->AddFixed64(option_field->number(),
-          google::protobuf::internal::WireFormatLite::EncodeDouble(value));
+                                 internal::WireFormatLite::EncodeDouble(value));
       break;
     }
 
     case FieldDescriptor::CPPTYPE_BOOL:
-      uint64 value;
+      uint64_t value;
       if (!uninterpreted_option_->has_identifier_value()) {
-        return AddValueError("Value must be identifier for boolean option "
-                             "\"" + option_field->full_name() + "\".");
+        return AddValueError(
+            "Value must be identifier for boolean option "
+            "\"" +
+            option_field->full_name() + "\".");
       }
       if (uninterpreted_option_->identifier_value() == "true") {
         value = 1;
       } else if (uninterpreted_option_->identifier_value() == "false") {
         value = 0;
       } else {
-        return AddValueError("Value must be \"true\" or \"false\" for boolean "
-                             "option \"" + option_field->full_name() + "\".");
+        return AddValueError(
+            "Value must be \"true\" or \"false\" for boolean "
+            "option \"" +
+            option_field->full_name() + "\".");
       }
       unknown_fields->AddVarint(option_field->number(), value);
       break;
 
     case FieldDescriptor::CPPTYPE_ENUM: {
       if (!uninterpreted_option_->has_identifier_value()) {
-        return AddValueError("Value must be identifier for enum-valued option "
-                             "\"" + option_field->full_name() + "\".");
+        return AddValueError(
+            "Value must be identifier for enum-valued option "
+            "\"" +
+            option_field->full_name() + "\".");
       }
       const EnumDescriptor* enum_type = option_field->enum_type();
-      const string& value_name = uninterpreted_option_->identifier_value();
-      const EnumValueDescriptor* enum_value = NULL;
+      const std::string& value_name = uninterpreted_option_->identifier_value();
+      const EnumValueDescriptor* enum_value = nullptr;
 
       if (enum_type->file()->pool() != DescriptorPool::generated_pool()) {
         // Note that the enum value's fully-qualified name is a sibling of the
         // enum's name, not a child of it.
-        string fully_qualified_name = enum_type->full_name();
+        std::string fully_qualified_name = enum_type->full_name();
         fully_qualified_name.resize(fully_qualified_name.size() -
                                     enum_type->name().size());
         fully_qualified_name += value_name;
@@ -6710,15 +7585,16 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
         // DescriptorPool::FindEnumValueByName() because we're already holding
         // the pool's mutex, and the latter method locks it again.
         Symbol symbol =
-          builder_->FindSymbolNotEnforcingDeps(fully_qualified_name);
-        if (!symbol.IsNull() && symbol.type == Symbol::ENUM_VALUE) {
-          if (symbol.enum_value_descriptor->type() != enum_type) {
-            return AddValueError("Enum type \"" + enum_type->full_name() +
+            builder_->FindSymbolNotEnforcingDeps(fully_qualified_name);
+        if (auto* candicate_descriptor = symbol.enum_value_descriptor()) {
+          if (candicate_descriptor->type() != enum_type) {
+            return AddValueError(
+                "Enum type \"" + enum_type->full_name() +
                 "\" has no value named \"" + value_name + "\" for option \"" +
                 option_field->full_name() +
                 "\". This appears to be a value from a sibling type.");
           } else {
-            enum_value = symbol.enum_value_descriptor;
+            enum_value = candicate_descriptor;
           }
         }
       } else {
@@ -6727,28 +7603,33 @@ bool DescriptorBuilder::OptionInterpreter::SetOptionValue(
         enum_value = enum_type->FindValueByName(value_name);
       }
 
-      if (enum_value == NULL) {
+      if (enum_value == nullptr) {
         return AddValueError("Enum type \"" +
                              option_field->enum_type()->full_name() +
-                             "\" has no value named \"" + value_name + "\" for "
-                             "option \"" + option_field->full_name() + "\".");
+                             "\" has no value named \"" + value_name +
+                             "\" for "
+                             "option \"" +
+                             option_field->full_name() + "\".");
       } else {
-        // Sign-extension is not a problem, since we cast directly from int32 to
-        // uint64, without first going through uint32.
-        unknown_fields->AddVarint(option_field->number(),
-          static_cast<uint64>(static_cast<int64>(enum_value->number())));
+        // Sign-extension is not a problem, since we cast directly from int32_t
+        // to uint64_t, without first going through uint32_t.
+        unknown_fields->AddVarint(
+            option_field->number(),
+            static_cast<uint64_t>(static_cast<int64_t>(enum_value->number())));
       }
       break;
     }
 
     case FieldDescriptor::CPPTYPE_STRING:
       if (!uninterpreted_option_->has_string_value()) {
-        return AddValueError("Value must be quoted string for string option "
-                             "\"" + option_field->full_name() + "\".");
+        return AddValueError(
+            "Value must be quoted string for string option "
+            "\"" +
+            option_field->full_name() + "\".");
       }
       // The string has already been unquoted and unescaped by the parser.
       unknown_fields->AddLengthDelimited(option_field->number(),
-          uninterpreted_option_->string_value());
+                                         uninterpreted_option_->string_value());
       break;
 
     case FieldDescriptor::CPPTYPE_MESSAGE:
@@ -6766,18 +7647,28 @@ class DescriptorBuilder::OptionInterpreter::AggregateOptionFinder
  public:
   DescriptorBuilder* builder_;
 
-  virtual const FieldDescriptor* FindExtension(
-      Message* message, const string& name) const {
+  const Descriptor* FindAnyType(const Message& /*message*/,
+                                const std::string& prefix,
+                                const std::string& name) const override {
+    if (prefix != internal::kTypeGoogleApisComPrefix &&
+        prefix != internal::kTypeGoogleProdComPrefix) {
+      return nullptr;
+    }
+    assert_mutex_held(builder_->pool_);
+    return builder_->FindSymbol(name).descriptor();
+  }
+
+  const FieldDescriptor* FindExtension(Message* message,
+                                       const std::string& name) const override {
     assert_mutex_held(builder_->pool_);
     const Descriptor* descriptor = message->GetDescriptor();
-    Symbol result = builder_->LookupSymbolNoPlaceholder(
-        name, descriptor->full_name());
-    if (result.type == Symbol::FIELD &&
-        result.field_descriptor->is_extension()) {
-      return result.field_descriptor;
-    } else if (result.type == Symbol::MESSAGE &&
+    Symbol result =
+        builder_->LookupSymbolNoPlaceholder(name, descriptor->full_name());
+    if (auto* field = result.field_descriptor()) {
+      return field;
+    } else if (result.type() == Symbol::MESSAGE &&
                descriptor->options().message_set_wire_format()) {
-      const Descriptor* foreign_type = result.descriptor;
+      const Descriptor* foreign_type = result.descriptor();
       // The text format allows MessageSet items to be specified using
       // the type name, rather than the extension identifier. If the symbol
       // lookup returned a Message, and the enclosing Message has
@@ -6794,7 +7685,7 @@ class DescriptorBuilder::OptionInterpreter::AggregateOptionFinder
         }
       }
     }
-    return NULL;
+    return nullptr;
   }
 };
 
@@ -6802,42 +7693,42 @@ class DescriptorBuilder::OptionInterpreter::AggregateOptionFinder
 namespace {
 class AggregateErrorCollector : public io::ErrorCollector {
  public:
-  string error_;
+  std::string error_;
 
-  virtual void AddError(int /* line */, int /* column */,
-                        const string& message) {
+  void AddError(int /* line */, int /* column */,
+                const std::string& message) override {
     if (!error_.empty()) {
       error_ += "; ";
     }
     error_ += message;
   }
 
-  virtual void AddWarning(int /* line */, int /* column */,
-                          const string& /* message */) {
+  void AddWarning(int /* line */, int /* column */,
+                  const std::string& /* message */) override {
     // Ignore warnings
   }
 };
-}
+}  // namespace
 
 // We construct a dynamic message of the type corresponding to
 // option_field, parse the supplied text-format string into this
 // message, and serialize the resulting message to produce the value.
 bool DescriptorBuilder::OptionInterpreter::SetAggregateOption(
-    const FieldDescriptor* option_field,
-    UnknownFieldSet* unknown_fields) {
+    const FieldDescriptor* option_field, UnknownFieldSet* unknown_fields) {
   if (!uninterpreted_option_->has_aggregate_value()) {
     return AddValueError("Option \"" + option_field->full_name() +
                          "\" is a message. To set the entire message, use "
-                         "syntax like \"" + option_field->name() +
+                         "syntax like \"" +
+                         option_field->name() +
                          " = { <proto text format> }\". "
                          "To set fields within it, use "
-                         "syntax like \"" + option_field->name() +
-                         ".foo = value\".");
+                         "syntax like \"" +
+                         option_field->name() + ".foo = value\".");
   }
 
   const Descriptor* type = option_field->message_type();
-  google::protobuf::scoped_ptr<Message> dynamic(dynamic_factory_.GetPrototype(type)->New());
-  GOOGLE_CHECK(dynamic.get() != NULL)
+  std::unique_ptr<Message> dynamic(dynamic_factory_.GetPrototype(type)->New());
+  GOOGLE_CHECK(dynamic.get() != nullptr)
       << "Could not create an instance of " << option_field->DebugString();
 
   AggregateErrorCollector collector;
@@ -6852,12 +7743,12 @@ bool DescriptorBuilder::OptionInterpreter::SetAggregateOption(
                   option_field->name() + "\": " + collector.error_);
     return false;
   } else {
-    string serial;
+    std::string serial;
     dynamic->SerializeToString(&serial);  // Never fails
     if (option_field->type() == FieldDescriptor::TYPE_MESSAGE) {
       unknown_fields->AddLengthDelimited(option_field->number(), serial);
     } else {
-      GOOGLE_CHECK_EQ(option_field->type(),  FieldDescriptor::TYPE_GROUP);
+      GOOGLE_CHECK_EQ(option_field->type(), FieldDescriptor::TYPE_GROUP);
       UnknownFieldSet* group = unknown_fields->AddGroup(option_field->number());
       group->ParseFromString(serial);
     }
@@ -6865,21 +7756,22 @@ bool DescriptorBuilder::OptionInterpreter::SetAggregateOption(
   }
 }
 
-void DescriptorBuilder::OptionInterpreter::SetInt32(int number, int32 value,
-    FieldDescriptor::Type type, UnknownFieldSet* unknown_fields) {
+void DescriptorBuilder::OptionInterpreter::SetInt32(
+    int number, int32_t value, FieldDescriptor::Type type,
+    UnknownFieldSet* unknown_fields) {
   switch (type) {
     case FieldDescriptor::TYPE_INT32:
-      unknown_fields->AddVarint(number,
-        static_cast<uint64>(static_cast<int64>(value)));
+      unknown_fields->AddVarint(
+          number, static_cast<uint64_t>(static_cast<int64_t>(value)));
       break;
 
     case FieldDescriptor::TYPE_SFIXED32:
-      unknown_fields->AddFixed32(number, static_cast<uint32>(value));
+      unknown_fields->AddFixed32(number, static_cast<uint32_t>(value));
       break;
 
     case FieldDescriptor::TYPE_SINT32:
-      unknown_fields->AddVarint(number,
-          google::protobuf::internal::WireFormatLite::ZigZagEncode32(value));
+      unknown_fields->AddVarint(
+          number, internal::WireFormatLite::ZigZagEncode32(value));
       break;
 
     default:
@@ -6888,20 +7780,21 @@ void DescriptorBuilder::OptionInterpreter::SetInt32(int number, int32 value,
   }
 }
 
-void DescriptorBuilder::OptionInterpreter::SetInt64(int number, int64 value,
-    FieldDescriptor::Type type, UnknownFieldSet* unknown_fields) {
+void DescriptorBuilder::OptionInterpreter::SetInt64(
+    int number, int64_t value, FieldDescriptor::Type type,
+    UnknownFieldSet* unknown_fields) {
   switch (type) {
     case FieldDescriptor::TYPE_INT64:
-      unknown_fields->AddVarint(number, static_cast<uint64>(value));
+      unknown_fields->AddVarint(number, static_cast<uint64_t>(value));
       break;
 
     case FieldDescriptor::TYPE_SFIXED64:
-      unknown_fields->AddFixed64(number, static_cast<uint64>(value));
+      unknown_fields->AddFixed64(number, static_cast<uint64_t>(value));
       break;
 
     case FieldDescriptor::TYPE_SINT64:
-      unknown_fields->AddVarint(number,
-          google::protobuf::internal::WireFormatLite::ZigZagEncode64(value));
+      unknown_fields->AddVarint(
+          number, internal::WireFormatLite::ZigZagEncode64(value));
       break;
 
     default:
@@ -6910,15 +7803,16 @@ void DescriptorBuilder::OptionInterpreter::SetInt64(int number, int64 value,
   }
 }
 
-void DescriptorBuilder::OptionInterpreter::SetUInt32(int number, uint32 value,
-    FieldDescriptor::Type type, UnknownFieldSet* unknown_fields) {
+void DescriptorBuilder::OptionInterpreter::SetUInt32(
+    int number, uint32_t value, FieldDescriptor::Type type,
+    UnknownFieldSet* unknown_fields) {
   switch (type) {
     case FieldDescriptor::TYPE_UINT32:
-      unknown_fields->AddVarint(number, static_cast<uint64>(value));
+      unknown_fields->AddVarint(number, static_cast<uint64_t>(value));
       break;
 
     case FieldDescriptor::TYPE_FIXED32:
-      unknown_fields->AddFixed32(number, static_cast<uint32>(value));
+      unknown_fields->AddFixed32(number, static_cast<uint32_t>(value));
       break;
 
     default:
@@ -6927,8 +7821,9 @@ void DescriptorBuilder::OptionInterpreter::SetUInt32(int number, uint32 value,
   }
 }
 
-void DescriptorBuilder::OptionInterpreter::SetUInt64(int number, uint64 value,
-    FieldDescriptor::Type type, UnknownFieldSet* unknown_fields) {
+void DescriptorBuilder::OptionInterpreter::SetUInt64(
+    int number, uint64_t value, FieldDescriptor::Type type,
+    UnknownFieldSet* unknown_fields) {
   switch (type) {
     case FieldDescriptor::TYPE_UINT64:
       unknown_fields->AddVarint(number, value);
@@ -6946,43 +7841,31 @@ void DescriptorBuilder::OptionInterpreter::SetUInt64(int number, uint64 value,
 
 void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto,
                                             const FileDescriptor* result) {
+  (void)result;  // Parameter is used by Google-internal code.
 
   if (!unused_dependency_.empty()) {
-    std::set<string> annotation_extensions;
-    annotation_extensions.insert("google.protobuf.MessageOptions");
-    annotation_extensions.insert("google.protobuf.FileOptions");
-    annotation_extensions.insert("google.protobuf.FieldOptions");
-    annotation_extensions.insert("google.protobuf.EnumOptions");
-    annotation_extensions.insert("google.protobuf.EnumValueOptions");
-    annotation_extensions.insert("google.protobuf.EnumValueOptions");
-    annotation_extensions.insert("google.protobuf.ServiceOptions");
-    annotation_extensions.insert("google.protobuf.MethodOptions");
-    annotation_extensions.insert("google.protobuf.StreamOptions");
-    for (std::set<const FileDescriptor*>::const_iterator
-             it = unused_dependency_.begin();
+    auto itr = pool_->unused_import_track_files_.find(proto.name());
+    bool is_error =
+        itr != pool_->unused_import_track_files_.end() && itr->second;
+    for (std::set<const FileDescriptor*>::const_iterator it =
+             unused_dependency_.begin();
          it != unused_dependency_.end(); ++it) {
-      // Do not log warnings for proto files which extend annotations.
-      int i;
-      for (i = 0 ; i < (*it)->extension_count(); ++i) {
-        if (annotation_extensions.find(
-                (*it)->extension(i)->containing_type()->full_name())
-            != annotation_extensions.end()) {
-          break;
-        }
-      }
-      // Log warnings for unused imported files.
-      if (i == (*it)->extension_count()) {
-        string error_message = "Import " + (*it)->name() + " but not used.";
-        AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::OTHER,
+      std::string error_message = "Import " + (*it)->name() + " is unused.";
+      if (is_error) {
+        AddError((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
+                 error_message);
+      } else {
+        AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT,
                    error_message);
       }
     }
   }
 }
 
-Symbol DescriptorPool::CrossLinkOnDemandHelper(const string& name,
+Symbol DescriptorPool::CrossLinkOnDemandHelper(StringPiece name,
                                                bool expecting_enum) const {
-  string lookup_name = name;
+  (void)expecting_enum;  // Parameter is used by Google-internal code.
+  auto lookup_name = std::string(name);
   if (!lookup_name.empty() && lookup_name[0] == '.') {
     lookup_name = lookup_name.substr(1);
   }
@@ -6996,39 +7879,39 @@ Symbol DescriptorPool::CrossLinkOnDemandHelper(const string& name,
 // enum_type_, message_type_, and default_value_enum_ appropriately.
 void FieldDescriptor::InternalTypeOnceInit() const {
   GOOGLE_CHECK(file()->finished_building_ == true);
-  if (type_name_) {
-    Symbol result = file()->pool()->CrossLinkOnDemandHelper(
-        *type_name_, type_ == FieldDescriptor::TYPE_ENUM);
-    if (result.type == Symbol::MESSAGE) {
-      type_ = FieldDescriptor::TYPE_MESSAGE;
-      message_type_ = result.descriptor;
-    } else if (result.type == Symbol::ENUM) {
-      type_ = FieldDescriptor::TYPE_ENUM;
-      enum_type_ = result.enum_descriptor;
-    }
-  }
-  if (enum_type_ && !default_value_enum_) {
-    if (default_value_enum_name_) {
+  const EnumDescriptor* enum_type = nullptr;
+  Symbol result = file()->pool()->CrossLinkOnDemandHelper(
+      type_descriptor_.lazy_type_name, type_ == FieldDescriptor::TYPE_ENUM);
+  if (result.type() == Symbol::MESSAGE) {
+    type_ = FieldDescriptor::TYPE_MESSAGE;
+    type_descriptor_.message_type = result.descriptor();
+  } else if (result.type() == Symbol::ENUM) {
+    type_ = FieldDescriptor::TYPE_ENUM;
+    enum_type = type_descriptor_.enum_type = result.enum_descriptor();
+  }
+
+  if (enum_type) {
+    if (lazy_default_value_enum_name_) {
       // Have to build the full name now instead of at CrossLink time,
-      // because enum_type_ may not be known at the time.
-      string name = enum_type_->full_name();
+      // because enum_type may not be known at the time.
+      std::string name = enum_type->full_name();
       // Enum values reside in the same scope as the enum type.
-      string::size_type last_dot = name.find_last_of('.');
-      if (last_dot != string::npos) {
-        name = name.substr(0, last_dot) + "." + *default_value_enum_name_;
+      std::string::size_type last_dot = name.find_last_of('.');
+      if (last_dot != std::string::npos) {
+        name = name.substr(0, last_dot) + "." + lazy_default_value_enum_name_;
       } else {
-        name = *default_value_enum_name_;
+        name = lazy_default_value_enum_name_;
       }
       Symbol result = file()->pool()->CrossLinkOnDemandHelper(name, true);
-      if (result.type == Symbol::ENUM_VALUE) {
-        default_value_enum_ = result.enum_value_descriptor;
-      }
+      default_value_enum_ = result.enum_value_descriptor();
+    } else {
+      default_value_enum_ = nullptr;
     }
     if (!default_value_enum_) {
       // We use the first defined value as the default
       // if a default is not explicitly defined.
-      GOOGLE_CHECK(enum_type_->value_count());
-      default_value_enum_ = enum_type_->value(0);
+      GOOGLE_CHECK(enum_type->value_count());
+      default_value_enum_ = enum_type->value(0);
     }
   }
 }
@@ -7038,34 +7921,46 @@ void FieldDescriptor::TypeOnceInit(const FieldDescriptor* to_init) {
 }
 
 // message_type(), enum_type(), default_value_enum(), and type()
-// all share the same GoogleOnceDynamic init path to do lazy
+// all share the same internal::call_once init path to do lazy
 // import building and cross linking of a field of a message.
 const Descriptor* FieldDescriptor::message_type() const {
   if (type_once_) {
-    type_once_->Init(&FieldDescriptor::TypeOnceInit, this);
+    internal::call_once(*type_once_, FieldDescriptor::TypeOnceInit, this);
   }
-  return message_type_;
+  return type_ == TYPE_MESSAGE || type_ == TYPE_GROUP
+             ? type_descriptor_.message_type
+             : nullptr;
 }
 
 const EnumDescriptor* FieldDescriptor::enum_type() const {
   if (type_once_) {
-    type_once_->Init(&FieldDescriptor::TypeOnceInit, this);
+    internal::call_once(*type_once_, FieldDescriptor::TypeOnceInit, this);
   }
-  return enum_type_;
+  return type_ == TYPE_ENUM ? type_descriptor_.enum_type : nullptr;
 }
 
 const EnumValueDescriptor* FieldDescriptor::default_value_enum() const {
   if (type_once_) {
-    type_once_->Init(&FieldDescriptor::TypeOnceInit, this);
+    internal::call_once(*type_once_, FieldDescriptor::TypeOnceInit, this);
   }
   return default_value_enum_;
 }
 
+const std::string& FieldDescriptor::PrintableNameForExtension() const {
+  const bool is_message_set_extension =
+      is_extension() &&
+      containing_type()->options().message_set_wire_format() &&
+      type() == FieldDescriptor::TYPE_MESSAGE && is_optional() &&
+      extension_scope() == message_type();
+  return is_message_set_extension ? message_type()->full_name() : full_name();
+}
+
 void FileDescriptor::InternalDependenciesOnceInit() const {
   GOOGLE_CHECK(finished_building_ == true);
+  auto* names = dependencies_once_->dependencies_names;
   for (int i = 0; i < dependency_count(); i++) {
-    if (dependencies_names_[i]) {
-      dependencies_[i] = pool_->FindFileByName(*dependencies_names_[i]);
+    if (names[i]) {
+      dependencies_[i] = pool_->FindFileByName(names[i]);
     }
   }
 }
@@ -7076,62 +7971,55 @@ void FileDescriptor::DependenciesOnceInit(const FileDescriptor* to_init) {
 
 const FileDescriptor* FileDescriptor::dependency(int index) const {
   if (dependencies_once_) {
-    // Do once init for all indicies, as it's unlikely only a single index would
-    // be called, and saves on GoogleOnceDynamic allocations.
-    dependencies_once_->Init(&FileDescriptor::DependenciesOnceInit, this);
+    // Do once init for all indices, as it's unlikely only a single index would
+    // be called, and saves on internal::call_once allocations.
+    internal::call_once(dependencies_once_->once,
+                        FileDescriptor::DependenciesOnceInit, this);
   }
   return dependencies_[index];
 }
 
 const Descriptor* MethodDescriptor::input_type() const {
-  return input_type_.Get();
+  return input_type_.Get(service());
 }
 
 const Descriptor* MethodDescriptor::output_type() const {
-  return output_type_.Get();
+  return output_type_.Get(service());
 }
 
 
 namespace internal {
 void LazyDescriptor::Set(const Descriptor* descriptor) {
-  GOOGLE_CHECK(!name_);
   GOOGLE_CHECK(!once_);
-  GOOGLE_CHECK(!file_);
   descriptor_ = descriptor;
 }
 
-void LazyDescriptor::SetLazy(const string& name, const FileDescriptor* file) {
+void LazyDescriptor::SetLazy(StringPiece name,
+                             const FileDescriptor* file) {
   // verify Init() has been called and Set hasn't been called yet.
   GOOGLE_CHECK(!descriptor_);
-  GOOGLE_CHECK(!file_);
-  GOOGLE_CHECK(!name_);
   GOOGLE_CHECK(!once_);
   GOOGLE_CHECK(file && file->pool_);
   GOOGLE_CHECK(file->pool_->lazily_build_dependencies_);
   GOOGLE_CHECK(!file->finished_building_);
-  file_ = file;
-  name_ = file->pool_->tables_->AllocateString(name);
-  once_ = file->pool_->tables_->AllocateOnceDynamic();
+  once_ = file->pool_->tables_->Create<internal::once_flag>();
+  lazy_name_ = file->pool_->tables_->Strdup(name);
 }
 
-void LazyDescriptor::Once() {
+void LazyDescriptor::Once(const ServiceDescriptor* service) {
   if (once_) {
-    once_->Init(&LazyDescriptor::OnceStatic, this);
+    internal::call_once(*once_, [&] {
+      auto* file = service->file();
+      GOOGLE_CHECK(file->finished_building_);
+      descriptor_ =
+          file->pool_->CrossLinkOnDemandHelper(lazy_name_, false).descriptor();
+    });
   }
 }
 
-void LazyDescriptor::OnceStatic(LazyDescriptor* lazy) { lazy->OnceInternal(); }
-
-void LazyDescriptor::OnceInternal() {
-  GOOGLE_CHECK(file_->finished_building_);
-  if (!descriptor_ && name_) {
-    Symbol result = file_->pool_->CrossLinkOnDemandHelper(*name_, false);
-    if (!result.IsNull() && result.type == Symbol::MESSAGE) {
-      descriptor_ = result.descriptor;
-    }
-  }
-}
 }  // namespace internal
 
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 5f5159a..e74e355 100644 (file)
 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_H__
 #define GOOGLE_PROTOBUF_DESCRIPTOR_H__
 
+#include <atomic>
+#include <map>
 #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>
+#include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/mutex.h>
 #include <google/protobuf/stubs/once.h>
+#include <google/protobuf/port.h>
+#include <google/protobuf/port_def.inc>
 
 // TYPE_BOOL is defined in the MacOS's ConditionalMacros.h.
 #ifdef TYPE_BOOL
 #undef TYPE_BOOL
 #endif  // TYPE_BOOL
 
+#ifdef SWIG
+#define PROTOBUF_EXPORT
+#endif
+
+
 namespace google {
 namespace protobuf {
 
@@ -87,6 +95,7 @@ class DescriptorPool;
 
 // Defined in descriptor.proto
 class DescriptorProto;
+class DescriptorProto_ExtensionRange;
 class FieldDescriptorProto;
 class OneofDescriptorProto;
 class EnumDescriptorProto;
@@ -108,23 +117,23 @@ class SourceCodeInfo;
 
 // Defined in message.h
 class Message;
+class Reflection;
 
 // Defined in descriptor.cc
 class DescriptorBuilder;
 class FileDescriptorTables;
-struct Symbol;
+class Symbol;
 
 // Defined in unknown_field_set.h.
 class UnknownField;
 
-// Defined in generated_message_reflection.h.
-namespace internal {
-class GeneratedMessageReflection;
-}  // namespace internal
-
 // Defined in command_line_interface.cc
 namespace compiler {
 class CommandLineInterface;
+namespace cpp {
+// Defined in helpers.h
+class Formatter;
+}  // namespace cpp
 }  // namespace compiler
 
 namespace descriptor_unittest {
@@ -145,9 +154,9 @@ struct SourceLocation {
 
   // Doc comments found at the source location.
   // See the comments in SourceCodeInfo.Location (descriptor.proto) for details.
-  string leading_comments;
-  string trailing_comments;
-  std::vector<string> leading_detached_comments;
+  std::string leading_comments;
+  std::string trailing_comments;
+  std::vector<std::string> leading_detached_comments;
 };
 
 // Options when generating machine-parsable output from a descriptor with
@@ -165,7 +174,8 @@ struct DebugStringOptions {
   DebugStringOptions()
       : include_comments(false),
         elide_group_body(false),
-        elide_oneof_body(false) {}
+        elide_oneof_body(false) {
+  }
 };
 
 // A class to handle the simplest cases of a lazily linked descriptor
@@ -173,15 +183,14 @@ struct DebugStringOptions {
 // which is needed when a pool has lazily_build_dependencies_ set.
 // Must be instantiated as mutable in a descriptor.
 namespace internal {
-class LIBPROTOBUF_EXPORT LazyDescriptor {
+
+class PROTOBUF_EXPORT LazyDescriptor {
  public:
   // Init function to be called at init time of a descriptor containing
   // a LazyDescriptor.
   void Init() {
-    descriptor_ = NULL;
-    name_ = NULL;
-    once_ = NULL;
-    file_ = NULL;
+    descriptor_ = nullptr;
+    once_ = nullptr;
   }
 
   // Sets the value of the descriptor if it is known during the descriptor
@@ -195,26 +204,39 @@ class LIBPROTOBUF_EXPORT LazyDescriptor {
   // build time if the symbol wasn't found and building of the file containing
   // that type is delayed because lazily_build_dependencies_ is set on the pool.
   // Should not be called after Set() has been called.
-  void SetLazy(const string& name, const FileDescriptor* file);
+  void SetLazy(StringPiece name, const FileDescriptor* file);
 
   // Returns the current value of the descriptor, thread-safe. If SetLazy(...)
   // has been called, will do a one-time cross link of the type specified,
   // building the descriptor file that contains the type if necessary.
-  inline const Descriptor* Get() {
-    Once();
+  inline const Descriptor* Get(const ServiceDescriptor* service) {
+    Once(service);
     return descriptor_;
   }
 
  private:
-  static void OnceStatic(LazyDescriptor* lazy);
-  void OnceInternal();
-  void Once();
+  void Once(const ServiceDescriptor* service);
 
-  const Descriptor* descriptor_;
-  const string* name_;
-  GoogleOnceDynamic* once_;
-  const FileDescriptor* file_;
+  union {
+    const Descriptor* descriptor_;
+    const char* lazy_name_;
+  };
+  internal::once_flag* once_;
 };
+
+class PROTOBUF_EXPORT SymbolBase {
+ private:
+  friend class google::protobuf::Symbol;
+  uint8_t symbol_type_;
+};
+
+// Some types have more than one SymbolBase because they have multiple
+// identities in the table. We can't have duplicate direct bases, so we use this
+// intermediate base to do so.
+// See BuildEnumValue for details.
+template <int N>
+class PROTOBUF_EXPORT SymbolBaseN : public SymbolBase {};
+
 }  // namespace internal
 
 // Describes a type of protocol message, or a particular group within a
@@ -222,34 +244,35 @@ class LIBPROTOBUF_EXPORT LazyDescriptor {
 // Message::GetDescriptor().  Generated message classes also have a
 // static method called descriptor() which returns the type's descriptor.
 // Use DescriptorPool to construct your own descriptors.
-class LIBPROTOBUF_EXPORT Descriptor {
+class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase {
  public:
+  typedef DescriptorProto Proto;
+
   // The name of the message type, not including its scope.
-  const string& name() const;
+  const std::string& name() const;
 
   // The fully-qualified name of the message type, scope delimited by
   // periods.  For example, message type "Foo" which is declared in package
   // "bar" has full name "bar.Foo".  If a type "Baz" is nested within
   // Foo, Baz's full_name is "bar.Foo.Baz".  To get only the part that
   // comes after the last '.', use name().
-  const string& full_name() const;
+  const std::string& full_name() const;
 
   // Index of this descriptor within the file or containing type's message
   // type array.
   int index() const;
 
-  // The .proto file in which this message type was defined.  Never NULL.
+  // The .proto file in which this message type was defined.  Never nullptr.
   const FileDescriptor* file() const;
 
   // If this Descriptor describes a nested type, this returns the type
-  // in which it is nested.  Otherwise, returns NULL.
+  // in which it is nested.  Otherwise, returns nullptr.
   const Descriptor* containing_type() const;
 
   // Get options for this message type.  These are specified in the .proto file
   // by placing lines like "option foo = 1234;" in the message definition.
-  // Allowed options are defined by MessageOptions in
-  // google/protobuf/descriptor.proto, and any available extensions of that
-  // message.
+  // Allowed options are defined by MessageOptions in descriptor.proto, and any
+  // available extensions of that message.
   const MessageOptions& options() const;
 
   // Write the contents of this Descriptor into the given DescriptorProto.
@@ -257,19 +280,49 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // isn't, the result may be garbage.
   void CopyTo(DescriptorProto* proto) const;
 
-  // Write the contents of this decriptor in a human-readable form. Output
+  // Write the contents of this descriptor in a human-readable form. Output
   // will be suitable for re-parsing.
-  string DebugString() const;
+  std::string DebugString() const;
 
   // Similar to DebugString(), but additionally takes options (e.g.,
   // include original user comments in output).
-  string DebugStringWithOptions(const DebugStringOptions& options) const;
+  std::string DebugStringWithOptions(const DebugStringOptions& options) const;
 
   // Returns true if this is a placeholder for an unknown type. This will
   // only be the case if this descriptor comes from a DescriptorPool
   // with AllowUnknownDependencies() set.
   bool is_placeholder() const;
 
+  enum WellKnownType {
+    WELLKNOWNTYPE_UNSPECIFIED,  // Not a well-known type.
+
+    // Wrapper types.
+    WELLKNOWNTYPE_DOUBLEVALUE,  // google.protobuf.DoubleValue
+    WELLKNOWNTYPE_FLOATVALUE,   // google.protobuf.FloatValue
+    WELLKNOWNTYPE_INT64VALUE,   // google.protobuf.Int64Value
+    WELLKNOWNTYPE_UINT64VALUE,  // google.protobuf.UInt64Value
+    WELLKNOWNTYPE_INT32VALUE,   // google.protobuf.Int32Value
+    WELLKNOWNTYPE_UINT32VALUE,  // google.protobuf.UInt32Value
+    WELLKNOWNTYPE_STRINGVALUE,  // google.protobuf.StringValue
+    WELLKNOWNTYPE_BYTESVALUE,   // google.protobuf.BytesValue
+    WELLKNOWNTYPE_BOOLVALUE,    // google.protobuf.BoolValue
+
+    // Other well known types.
+    WELLKNOWNTYPE_ANY,        // google.protobuf.Any
+    WELLKNOWNTYPE_FIELDMASK,  // google.protobuf.FieldMask
+    WELLKNOWNTYPE_DURATION,   // google.protobuf.Duration
+    WELLKNOWNTYPE_TIMESTAMP,  // google.protobuf.Timestamp
+    WELLKNOWNTYPE_VALUE,      // google.protobuf.Value
+    WELLKNOWNTYPE_LISTVALUE,  // google.protobuf.ListValue
+    WELLKNOWNTYPE_STRUCT,     // google.protobuf.Struct
+
+    // New well-known types may be added in the future.
+    // Please make sure any switch() statements have a 'default' case.
+    __WELLKNOWNTYPE__DO_NOT_USE__ADD_DEFAULT_INSTEAD__,
+  };
+
+  WellKnownType well_known_type() const;
+
   // Field stuff -----------------------------------------------------
 
   // The number of fields in this message type.
@@ -278,33 +331,37 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // These are returned in the order they were defined in the .proto file.
   const FieldDescriptor* field(int index) const;
 
-  // Looks up a field by declared tag number.  Returns NULL if no such field
+  // Looks up a field by declared tag number.  Returns nullptr if no such field
   // exists.
   const FieldDescriptor* FindFieldByNumber(int number) const;
-  // Looks up a field by name.  Returns NULL if no such field exists.
-  const FieldDescriptor* FindFieldByName(const string& name) const;
+  // Looks up a field by name.  Returns nullptr if no such field exists.
+  const FieldDescriptor* FindFieldByName(ConstStringParam name) const;
 
   // Looks up a field by lowercased name (as returned by lowercase_name()).
   // This lookup may be ambiguous if multiple field names differ only by case,
   // in which case the field returned is chosen arbitrarily from the matches.
   const FieldDescriptor* FindFieldByLowercaseName(
-      const string& lowercase_name) const;
+      ConstStringParam lowercase_name) const;
 
   // Looks up a field by camel-case name (as returned by camelcase_name()).
   // This lookup may be ambiguous if multiple field names differ in a way that
   // leads them to have identical camel-case names, in which case the field
   // returned is chosen arbitrarily from the matches.
   const FieldDescriptor* FindFieldByCamelcaseName(
-      const string& camelcase_name) const;
+      ConstStringParam camelcase_name) const;
 
   // The number of oneofs in this message type.
   int oneof_decl_count() const;
+  // The number of oneofs in this message type, excluding synthetic oneofs.
+  // Real oneofs always come first, so iterating up to real_oneof_decl_cout()
+  // will yield all real oneofs.
+  int real_oneof_decl_count() const;
   // Get a oneof by index, where 0 <= index < oneof_decl_count().
   // These are returned in the order they were defined in the .proto file.
   const OneofDescriptor* oneof_decl(int index) const;
 
-  // Looks up a oneof by name.  Returns NULL if no such oneof exists.
-  const OneofDescriptor* FindOneofByName(const string& name) const;
+  // Looks up a oneof by name.  Returns nullptr if no such oneof exists.
+  const OneofDescriptor* FindOneofByName(ConstStringParam name) const;
 
   // Nested type stuff -----------------------------------------------
 
@@ -314,9 +371,9 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // These are returned in the order they were defined in the .proto file.
   const Descriptor* nested_type(int index) const;
 
-  // Looks up a nested type by name.  Returns NULL if no such nested type
+  // Looks up a nested type by name.  Returns nullptr if no such nested type
   // exists.
-  const Descriptor* FindNestedTypeByName(const string& name) const;
+  const Descriptor* FindNestedTypeByName(ConstStringParam name) const;
 
   // Enum stuff ------------------------------------------------------
 
@@ -326,20 +383,26 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // These are returned in the order they were defined in the .proto file.
   const EnumDescriptor* enum_type(int index) const;
 
-  // Looks up an enum type by name.  Returns NULL if no such enum type exists.
-  const EnumDescriptor* FindEnumTypeByName(const string& name) const;
+  // Looks up an enum type by name.  Returns nullptr if no such enum type
+  // exists.
+  const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const;
 
   // Looks up an enum value by name, among all enum types in this message.
-  // Returns NULL if no such value exists.
-  const EnumValueDescriptor* FindEnumValueByName(const string& name) const;
+  // Returns nullptr if no such value exists.
+  const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const;
 
   // Extensions ------------------------------------------------------
 
   // A range of field numbers which are designated for third-party
   // extensions.
   struct ExtensionRange {
+    typedef DescriptorProto_ExtensionRange Proto;
+
     typedef ExtensionRangeOptions OptionsType;
 
+    // See Descriptor::CopyTo().
+    void CopyTo(DescriptorProto_ExtensionRange* proto) const;
+
     int start;  // inclusive
     int end;    // exclusive
 
@@ -356,11 +419,33 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // Returns true if the number is in one of the extension ranges.
   bool IsExtensionNumber(int number) const;
 
-  // Returns NULL if no extension range contains the given number.
+  // Returns nullptr if no extension range contains the given number.
   const ExtensionRange* FindExtensionRangeContainingNumber(int number) const;
 
-  // The number of extensions -- extending *other* messages -- that were
-  // defined nested within this message type's scope.
+  // The number of extensions defined nested within this message type's scope.
+  // See doc:
+  // https://developers.google.com/protocol-buffers/docs/proto#nested-extensions
+  //
+  // Note that the extensions may be extending *other* messages.
+  //
+  // For example:
+  // message M1 {
+  //   extensions 1 to max;
+  // }
+  //
+  // message M2 {
+  //   extend M1 {
+  //     optional int32 foo = 1;
+  //   }
+  // }
+  //
+  // In this case,
+  // DescriptorPool::generated_pool()
+  //     ->FindMessageTypeByName("M2")
+  //     ->extension(0)
+  // will return "foo", even though "foo" is an extension of M1.
+  // To find all known extensions of a given message, instead use
+  // DescriptorPool::FindAllExtensions.
   int extension_count() const;
   // Get an extension by index, where 0 <= index < extension_count().
   // These are returned in the order they were defined in the .proto file.
@@ -368,15 +453,17 @@ class LIBPROTOBUF_EXPORT Descriptor {
 
   // Looks up a named extension (which extends some *other* message type)
   // defined within this message type's scope.
-  const FieldDescriptor* FindExtensionByName(const string& name) const;
+  const FieldDescriptor* FindExtensionByName(ConstStringParam name) const;
 
   // Similar to FindFieldByLowercaseName(), but finds extensions defined within
   // this message type's scope.
-  const FieldDescriptor* FindExtensionByLowercaseName(const string& name) const;
+  const FieldDescriptor* FindExtensionByLowercaseName(
+      ConstStringParam name) const;
 
   // Similar to FindFieldByCamelcaseName(), but finds extensions defined within
   // this message type's scope.
-  const FieldDescriptor* FindExtensionByCamelcaseName(const string& name) const;
+  const FieldDescriptor* FindExtensionByCamelcaseName(
+      ConstStringParam name) const;
 
   // Reserved fields -------------------------------------------------
 
@@ -396,17 +483,17 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // 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.
+  // Returns nullptr if no reserved range contains the given number.
   const 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;
+  const std::string& reserved_name(int index) const;
 
   // Returns true if the field name is reserved.
-  bool IsReservedName(const string& name) const;
+  bool IsReservedName(ConstStringParam name) const;
 
   // Source Location ---------------------------------------------------
 
@@ -415,14 +502,26 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // |*out_location| unchanged iff location information was not available.
   bool GetSourceLocation(SourceLocation* out_location) const;
 
+  // Maps --------------------------------------------------------------
+
+  // Returns the FieldDescriptor for the "key" field. If this isn't a map entry
+  // field, returns nullptr.
+  const FieldDescriptor* map_key() const;
+
+  // Returns the FieldDescriptor for the "value" field. If this isn't a map
+  // entry field, returns nullptr.
+  const FieldDescriptor* map_value() const;
+
  private:
+  friend class Symbol;
   typedef MessageOptions OptionsType;
 
   // Allows tests to test CopyTo(proto, true).
-  friend class ::google::protobuf::descriptor_unittest::DescriptorTest;
+  friend class descriptor_unittest::DescriptorTest;
 
   // Allows access to GetLocationPath for annotations.
-  friend class ::google::protobuf::io::Printer;
+  friend class io::Printer;
+  friend class compiler::cpp::Formatter;
 
   // Fill the json_name field of FieldDescriptorProto.
   void CopyJsonNameTo(DescriptorProto* proto) const;
@@ -431,7 +530,7 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // correct depth. Takes |options| to control debug-string options, and
   // |include_opening_clause| to indicate whether the "message ... " part of the
   // clause has already been generated (this varies depending on context).
-  void DebugString(int depth, string *contents,
+  void DebugString(int depth, std::string* contents,
                    const DebugStringOptions& options,
                    bool include_opening_clause) const;
 
@@ -439,8 +538,26 @@ class LIBPROTOBUF_EXPORT Descriptor {
   // to this descriptor from the file root.
   void GetLocationPath(std::vector<int>* output) const;
 
-  const string* name_;
-  const string* full_name_;
+  // True if this is a placeholder for an unknown type.
+  bool is_placeholder_ : 1;
+  // True if this is a placeholder and the type name wasn't fully-qualified.
+  bool is_unqualified_placeholder_ : 1;
+  // Well known type.  Stored like this to conserve space.
+  uint8_t well_known_type_ : 5;
+
+  // This points to the last field _number_ that is part of the sequence
+  // starting at 1, where
+  //     `desc->field(i)->number() == i + 1`
+  // A value of `0` means no field matches. That is, there are no fields or the
+  // first field is not field `1`.
+  // Uses 16-bit to avoid extra padding. Unlikely to have more than 2^16
+  // sequentially numbered fields in a message.
+  uint16_t sequential_field_limit_;
+
+  int field_count_;
+
+  // all_names_ = [name, full_name]
+  const std::string* all_names_;
   const FileDescriptor* file_;
   const Descriptor* containing_type_;
   const MessageOptions* options_;
@@ -453,10 +570,10 @@ class LIBPROTOBUF_EXPORT Descriptor {
   ExtensionRange* extension_ranges_;
   FieldDescriptor* extensions_;
   ReservedRange* reserved_ranges_;
-  const string** reserved_names_;
+  const std::string** reserved_names_;
 
-  int field_count_;
   int oneof_decl_count_;
+  int real_oneof_decl_count_;
   int nested_type_count_;
   int enum_type_count_;
   int extension_range_count_;
@@ -464,11 +581,6 @@ class LIBPROTOBUF_EXPORT Descriptor {
   int reserved_range_count_;
   int reserved_name_count_;
 
-  // True if this is a placeholder for an unknown type.
-  bool is_placeholder_;
-  // True if this is a placeholder and the type name wasn't fully-qualified.
-  bool is_unqualified_placeholder_;
-
   // IMPORTANT:  If you add a new field, make sure to search for all instances
   // of Allocate<Descriptor>() and AllocateArray<Descriptor>() in descriptor.cc
   // and update them to initialize the field.
@@ -479,6 +591,7 @@ class LIBPROTOBUF_EXPORT Descriptor {
   friend class DescriptorPool;
   friend class EnumDescriptor;
   friend class FieldDescriptor;
+  friend class FileDescriptorTables;
   friend class OneofDescriptor;
   friend class MethodDescriptor;
   friend class FileDescriptor;
@@ -493,72 +606,72 @@ class LIBPROTOBUF_EXPORT Descriptor {
 // - Get the Descriptor or FileDescriptor for its containing scope, then
 //   call Descriptor::FindExtensionByName() or
 //   FileDescriptor::FindExtensionByName().
-// - Given a DescriptorPool, call DescriptorPool::FindExtensionByNumber().
-// - Given a Reflection for a message object, call
-//   Reflection::FindKnownExtensionByName() or
-//   Reflection::FindKnownExtensionByNumber().
+// - Given a DescriptorPool, call DescriptorPool::FindExtensionByNumber() or
+//   DescriptorPool::FindExtensionByPrintableName().
 // Use DescriptorPool to construct your own descriptors.
-class LIBPROTOBUF_EXPORT FieldDescriptor {
+class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase {
  public:
+  typedef FieldDescriptorProto Proto;
+
   // Identifies a field type.  0 is reserved for errors.  The order is weird
   // for historical reasons.  Types 12 and up are new in proto2.
   enum Type {
-    TYPE_DOUBLE         = 1,   // double, exactly eight bytes on the wire.
-    TYPE_FLOAT          = 2,   // float, exactly four bytes on the wire.
-    TYPE_INT64          = 3,   // int64, varint on the wire.  Negative numbers
-                               // take 10 bytes.  Use TYPE_SINT64 if negative
-                               // values are likely.
-    TYPE_UINT64         = 4,   // uint64, varint on the wire.
-    TYPE_INT32          = 5,   // int32, varint on the wire.  Negative numbers
-                               // take 10 bytes.  Use TYPE_SINT32 if negative
-                               // values are likely.
-    TYPE_FIXED64        = 6,   // uint64, exactly eight bytes on the wire.
-    TYPE_FIXED32        = 7,   // uint32, exactly four bytes on the wire.
-    TYPE_BOOL           = 8,   // bool, varint on the wire.
-    TYPE_STRING         = 9,   // UTF-8 text.
-    TYPE_GROUP          = 10,  // Tag-delimited message.  Deprecated.
-    TYPE_MESSAGE        = 11,  // Length-delimited message.
-
-    TYPE_BYTES          = 12,  // Arbitrary byte array.
-    TYPE_UINT32         = 13,  // uint32, varint on the wire
-    TYPE_ENUM           = 14,  // Enum, varint on the wire
-    TYPE_SFIXED32       = 15,  // int32, exactly four bytes on the wire
-    TYPE_SFIXED64       = 16,  // int64, exactly eight bytes on the wire
-    TYPE_SINT32         = 17,  // int32, ZigZag-encoded varint on the wire
-    TYPE_SINT64         = 18,  // int64, ZigZag-encoded varint on the wire
-
-    MAX_TYPE            = 18,  // Constant useful for defining lookup tables
-                               // indexed by Type.
+    TYPE_DOUBLE = 1,    // double, exactly eight bytes on the wire.
+    TYPE_FLOAT = 2,     // float, exactly four bytes on the wire.
+    TYPE_INT64 = 3,     // int64, varint on the wire.  Negative numbers
+                        // take 10 bytes.  Use TYPE_SINT64 if negative
+                        // values are likely.
+    TYPE_UINT64 = 4,    // uint64, varint on the wire.
+    TYPE_INT32 = 5,     // int32, varint on the wire.  Negative numbers
+                        // take 10 bytes.  Use TYPE_SINT32 if negative
+                        // values are likely.
+    TYPE_FIXED64 = 6,   // uint64, exactly eight bytes on the wire.
+    TYPE_FIXED32 = 7,   // uint32, exactly four bytes on the wire.
+    TYPE_BOOL = 8,      // bool, varint on the wire.
+    TYPE_STRING = 9,    // UTF-8 text.
+    TYPE_GROUP = 10,    // Tag-delimited message.  Deprecated.
+    TYPE_MESSAGE = 11,  // Length-delimited message.
+
+    TYPE_BYTES = 12,     // Arbitrary byte array.
+    TYPE_UINT32 = 13,    // uint32, varint on the wire
+    TYPE_ENUM = 14,      // Enum, varint on the wire
+    TYPE_SFIXED32 = 15,  // int32, exactly four bytes on the wire
+    TYPE_SFIXED64 = 16,  // int64, exactly eight bytes on the wire
+    TYPE_SINT32 = 17,    // int32, ZigZag-encoded varint on the wire
+    TYPE_SINT64 = 18,    // int64, ZigZag-encoded varint on the wire
+
+    MAX_TYPE = 18,  // Constant useful for defining lookup tables
+                    // indexed by Type.
   };
 
   // Specifies the C++ data type used to represent the field.  There is a
   // fixed mapping from Type to CppType where each Type maps to exactly one
   // CppType.  0 is reserved for errors.
   enum CppType {
-    CPPTYPE_INT32       = 1,     // TYPE_INT32, TYPE_SINT32, TYPE_SFIXED32
-    CPPTYPE_INT64       = 2,     // TYPE_INT64, TYPE_SINT64, TYPE_SFIXED64
-    CPPTYPE_UINT32      = 3,     // TYPE_UINT32, TYPE_FIXED32
-    CPPTYPE_UINT64      = 4,     // TYPE_UINT64, TYPE_FIXED64
-    CPPTYPE_DOUBLE      = 5,     // TYPE_DOUBLE
-    CPPTYPE_FLOAT       = 6,     // TYPE_FLOAT
-    CPPTYPE_BOOL        = 7,     // TYPE_BOOL
-    CPPTYPE_ENUM        = 8,     // TYPE_ENUM
-    CPPTYPE_STRING      = 9,     // TYPE_STRING, TYPE_BYTES
-    CPPTYPE_MESSAGE     = 10,    // TYPE_MESSAGE, TYPE_GROUP
-
-    MAX_CPPTYPE         = 10,    // Constant useful for defining lookup tables
-                                 // indexed by CppType.
+    CPPTYPE_INT32 = 1,     // TYPE_INT32, TYPE_SINT32, TYPE_SFIXED32
+    CPPTYPE_INT64 = 2,     // TYPE_INT64, TYPE_SINT64, TYPE_SFIXED64
+    CPPTYPE_UINT32 = 3,    // TYPE_UINT32, TYPE_FIXED32
+    CPPTYPE_UINT64 = 4,    // TYPE_UINT64, TYPE_FIXED64
+    CPPTYPE_DOUBLE = 5,    // TYPE_DOUBLE
+    CPPTYPE_FLOAT = 6,     // TYPE_FLOAT
+    CPPTYPE_BOOL = 7,      // TYPE_BOOL
+    CPPTYPE_ENUM = 8,      // TYPE_ENUM
+    CPPTYPE_STRING = 9,    // TYPE_STRING, TYPE_BYTES
+    CPPTYPE_MESSAGE = 10,  // TYPE_MESSAGE, TYPE_GROUP
+
+    MAX_CPPTYPE = 10,  // Constant useful for defining lookup tables
+                       // indexed by CppType.
   };
 
   // Identifies whether the field is optional, required, or repeated.  0 is
   // reserved for errors.
   enum Label {
-    LABEL_OPTIONAL      = 1,    // optional
-    LABEL_REQUIRED      = 2,    // required
-    LABEL_REPEATED      = 3,    // repeated
+    LABEL_OPTIONAL = 1,  // optional
+    LABEL_REQUIRED = 2,  // required
+    LABEL_REPEATED = 3,  // repeated
 
-    MAX_LABEL           = 3,    // Constant useful for defining lookup tables
-                                // indexed by Label.
+    MAX_LABEL = 3,  // Constant useful for defining lookup tables
+                    // indexed by Label.
   };
 
   // Valid field numbers are positive integers up to kMaxNumber.
@@ -569,14 +682,14 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   static const int kFirstReservedNumber = 19000;
   // Last field number reserved for the protocol buffer library implementation.
   // Users may not declare fields that use reserved numbers.
-  static const int kLastReservedNumber  = 19999;
+  static const int kLastReservedNumber = 19999;
 
-  const string& name() const;        // Name of this field within the message.
-  const string& full_name() const;   // Fully-qualified name of the field.
-  const string& json_name() const;   // JSON name of this field.
-  const FileDescriptor* file() const;// File in which this field was defined.
-  bool is_extension() const;         // Is this an extension field?
-  int number() const;                // Declared tag number.
+  const std::string& name() const;  // Name of this field within the message.
+  const std::string& full_name() const;  // Fully-qualified name of the field.
+  const std::string& json_name() const;  // JSON name of this field.
+  const FileDescriptor* file() const;  // File in which this field was defined.
+  bool is_extension() const;           // Is this an extension field?
+  int number() const;                  // Declared tag number.
 
   // Same as name() except converted to lower-case.  This (and especially the
   // FindFieldByLowercaseName() method) can be useful when parsing formats
@@ -584,7 +697,7 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   // field names should be lowercased anyway according to the protobuf style
   // guide, so this only makes a difference when dealing with old .proto files
   // which do not follow the guide.)
-  const string& lowercase_name() const;
+  const std::string& lowercase_name() const;
 
   // Same as name() except converted to camel-case.  In this conversion, any
   // time an underscore appears in the name, it is removed and the next
@@ -595,7 +708,7 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   //   fooBar -> fooBar
   // This (and especially the FindFieldByCamelcaseName() method) can be useful
   // when parsing formats which prefer to use camel-case naming style.
-  const string& camelcase_name() const;
+  const std::string& camelcase_name() const;
 
   Type type() const;                  // Declared type of this field.
   const char* type_name() const;      // Name of the declared type.
@@ -603,15 +716,28 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   const char* cpp_type_name() const;  // Name of the C++ type.
   Label label() const;                // optional/required/repeated
 
-  bool is_required() const;      // shorthand for label() == LABEL_REQUIRED
-  bool is_optional() const;      // shorthand for label() == LABEL_OPTIONAL
-  bool is_repeated() const;      // shorthand for label() == LABEL_REPEATED
-  bool is_packable() const;      // shorthand for is_repeated() &&
-                                 //               IsTypePackable(type())
-  bool is_packed() const;        // shorthand for is_packable() &&
-                                 //               options().packed()
-  bool is_map() const;           // shorthand for type() == TYPE_MESSAGE &&
-                                 // message_type()->options().map_entry()
+  bool is_required() const;  // shorthand for label() == LABEL_REQUIRED
+  bool is_optional() const;  // shorthand for label() == LABEL_OPTIONAL
+  bool is_repeated() const;  // shorthand for label() == LABEL_REPEATED
+  bool is_packable() const;  // shorthand for is_repeated() &&
+                             //               IsTypePackable(type())
+  bool is_packed() const;    // shorthand for is_packable() &&
+                             //               options().packed()
+  bool is_map() const;       // shorthand for type() == TYPE_MESSAGE &&
+                             // message_type()->options().map_entry()
+
+  // Returns true if this field was syntactically written with "optional" in the
+  // .proto file. Excludes singular proto3 fields that do not have a label.
+  bool has_optional_keyword() const;
+
+  // Returns true if this field tracks presence, ie. does the field
+  // distinguish between "unset" and "present with default value."
+  // This includes required, optional, and oneof fields. It excludes maps,
+  // repeated fields, and singular proto3 fields without "optional".
+  //
+  // For fields where has_presence() == true, the return value of
+  // Reflection::HasField() is semantically meaningful.
+  bool has_presence() const;
 
   // Index of this field within the message's field array, or the file or
   // extension scope's extensions array.
@@ -626,16 +752,20 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
 
   // Get the field default value if cpp_type() == CPPTYPE_INT32.  If no
   // explicit default was defined, the default is 0.
-  int32 default_value_int32() const;
+  int32_t default_value_int32_t() const;
+  int32_t default_value_int32() const { return default_value_int32_t(); }
   // Get the field default value if cpp_type() == CPPTYPE_INT64.  If no
   // explicit default was defined, the default is 0.
-  int64 default_value_int64() const;
+  int64_t default_value_int64_t() const;
+  int64_t default_value_int64() const { return default_value_int64_t(); }
   // Get the field default value if cpp_type() == CPPTYPE_UINT32.  If no
   // explicit default was defined, the default is 0.
-  uint32 default_value_uint32() const;
+  uint32_t default_value_uint32_t() const;
+  uint32_t default_value_uint32() const { return default_value_uint32_t(); }
   // Get the field default value if cpp_type() == CPPTYPE_UINT64.  If no
   // explicit default was defined, the default is 0.
-  uint64 default_value_uint64() const;
+  uint64_t default_value_uint64_t() const;
+  uint64_t default_value_uint64() const { return default_value_uint64_t(); }
   // Get the field default value if cpp_type() == CPPTYPE_FLOAT.  If no
   // explicit default was defined, the default is 0.0.
   float default_value_float() const;
@@ -648,26 +778,30 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   // Get the field default value if cpp_type() == CPPTYPE_ENUM.  If no
   // explicit default was defined, the default is the first value defined
   // in the enum type (all enum types are required to have at least one value).
-  // This never returns NULL.
+  // This never returns nullptr.
   const EnumValueDescriptor* default_value_enum() const;
   // Get the field default value if cpp_type() == CPPTYPE_STRING.  If no
   // explicit default was defined, the default is the empty string.
-  const string& default_value_string() const;
+  const std::string& default_value_string() const;
 
   // The Descriptor for the message of which this is a field.  For extensions,
-  // this is the extended type.  Never NULL.
+  // this is the extended type.  Never nullptr.
   const Descriptor* containing_type() const;
 
   // If the field is a member of a oneof, this is the one, otherwise this is
-  // NULL.
+  // nullptr.
   const OneofDescriptor* containing_oneof() const;
 
+  // If the field is a member of a non-synthetic oneof, returns the descriptor
+  // for the oneof, otherwise returns nullptr.
+  const OneofDescriptor* real_containing_oneof() const;
+
   // If the field is a member of a oneof, returns the index in that oneof.
   int index_in_oneof() const;
 
   // An extension may be declared within the scope of another message.  If this
   // field is an extension (is_extension() is true), then extension_scope()
-  // returns that message, or NULL if the extension was declared at global
+  // returns that message, or nullptr if the extension was declared at global
   // scope.  If this is not an extension, extension_scope() is undefined (may
   // assert-fail).
   const Descriptor* extension_scope() const;
@@ -682,19 +816,18 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   // Get the FieldOptions for this field.  This includes things listed in
   // square brackets after the field definition.  E.g., the field:
   //   optional string text = 1 [ctype=CORD];
-  // has the "ctype" option set.  Allowed options are defined by FieldOptions
-  // in google/protobuf/descriptor.proto, and any available extensions of that
-  // message.
+  // has the "ctype" option set.  Allowed options are defined by FieldOptions in
+  // descriptor.proto, and any available extensions of that message.
   const FieldOptions& options() const;
 
   // See Descriptor::CopyTo().
   void CopyTo(FieldDescriptorProto* proto) const;
 
   // See Descriptor::DebugString().
-  string DebugString() const;
+  std::string DebugString() const;
 
   // See Descriptor::DebugStringWithOptions().
-  string DebugStringWithOptions(const DebugStringOptions& options) const;
+  std::string DebugStringWithOptions(const DebugStringOptions& options) const;
 
   // Helper method to get the CppType for a particular Type.
   static CppType TypeToCppType(Type type);
@@ -708,6 +841,21 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   // Return true iff [packed = true] is valid for fields of this type.
   static inline bool IsTypePackable(Type field_type);
 
+  // Returns full_name() except if the field is a MessageSet extension,
+  // in which case it returns the full_name() of the containing message type
+  // for backwards compatibility with proto1.
+  //
+  // A MessageSet extension is defined as an optional message extension
+  // whose containing type has the message_set_wire_format option set.
+  // This should be true of extensions of google.protobuf.bridge.MessageSet;
+  // by convention, such extensions are named "message_set_extension".
+  //
+  // The opposite operation (looking up an extension's FieldDescriptor given
+  // its printable name) can be accomplished with
+  //     message->file()->pool()->FindExtensionByPrintableName(message, name)
+  // where the extension extends "message".
+  const std::string& PrintableNameForExtension() const;
+
   // Source Location ---------------------------------------------------
 
   // Updates |*out_location| to the source location of the complete
@@ -716,26 +864,28 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   bool GetSourceLocation(SourceLocation* out_location) const;
 
  private:
+  friend class Symbol;
   typedef FieldOptions OptionsType;
 
   // Allows access to GetLocationPath for annotations.
-  friend class ::google::protobuf::io::Printer;
+  friend class io::Printer;
+  friend class compiler::cpp::Formatter;
+  friend class Reflection;
 
   // Fill the json_name field of FieldDescriptorProto.
   void CopyJsonNameTo(FieldDescriptorProto* proto) const;
 
   // See Descriptor::DebugString().
-  enum PrintLabelFlag { PRINT_LABEL, OMIT_LABEL };
-  void DebugString(int depth, PrintLabelFlag print_label_flag,
-                   string* contents, const DebugStringOptions& options) const;
+  void DebugString(int depth, std::string* contents,
+                   const DebugStringOptions& options) const;
 
   // formats the default value appropriately and returns it as a string.
   // Must have a default value to call this. If quote_string_type is true, then
   // types of CPPTYPE_STRING whill be surrounded by quotes and CEscaped.
-  string DefaultValueAsString(bool quote_string_type) const;
+  std::string DefaultValueAsString(bool quote_string_type) const;
 
   // Helper function that returns the field type name for DebugString.
-  string FieldTypeNameDebugString() const;
+  std::string FieldTypeNameDebugString() const;
 
   // Walks up the descriptor tree to generate the source location path
   // to this descriptor from the file root.
@@ -744,58 +894,76 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
   // 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_;
-  const string* camelcase_name_;
-  // If has_json_name_ is true, it's the value specified by the user.
-  // Otherwise, it has the same value as camelcase_name_.
-  const string* json_name_;
-  const FileDescriptor* file_;
-  GoogleOnceDynamic* type_once_;
-  static void TypeOnceInit(const FieldDescriptor* to_init);
-  void InternalTypeOnceInit() const;
-  mutable Type type_;
-  Label label_;
-  bool has_default_value_;
+  bool has_default_value_ : 1;
+  bool proto3_optional_ : 1;
   // Whether the user has specified the json_name field option in the .proto
   // file.
-  bool has_json_name_;
-  bool is_extension_;
+  bool has_json_name_ : 1;
+  bool is_extension_ : 1;
+  bool is_oneof_ : 1;
+
+  // Actually a `Label` but stored as uint8_t to save space.
+  uint8_t label_ : 2;
+
+  // Actually a `Type`, but stored as uint8_t to save space.
+  mutable uint8_t type_;
+
+  // Logically:
+  //   all_names_ = [name, full_name, lower, camel, json]
+  // However:
+  //   duplicates will be omitted, so lower/camel/json might be in the same
+  //   position.
+  // We store the true offset for each name here, and the bit width must be
+  // large enough to account for the worst case where all names are present.
+  uint8_t lowercase_name_index_ : 2;
+  uint8_t camelcase_name_index_ : 2;
+  uint8_t json_name_index_ : 3;
+  // Sadly, `number_` located here to reduce padding. Unrelated to all_names_
+  // and its indices above.
   int number_;
-  int index_in_oneof_;
+  const std::string* all_names_;
+  const FileDescriptor* file_;
+
+  internal::once_flag* type_once_;
+  static void TypeOnceInit(const FieldDescriptor* to_init);
+  void InternalTypeOnceInit() const;
   const Descriptor* containing_type_;
-  const OneofDescriptor* containing_oneof_;
-  const Descriptor* extension_scope_;
-  mutable const Descriptor* message_type_;
-  mutable const EnumDescriptor* enum_type_;
+  union {
+    const OneofDescriptor* containing_oneof;
+    const Descriptor* extension_scope;
+  } scope_;
+  union {
+    mutable const Descriptor* message_type;
+    mutable const EnumDescriptor* enum_type;
+    const char* lazy_type_name;
+  } type_descriptor_;
   const FieldOptions* options_;
-  const string* type_name_;
-  const string* default_value_enum_name_;
   // IMPORTANT:  If you add a new field, make sure to search for all instances
   // of Allocate<FieldDescriptor>() and AllocateArray<FieldDescriptor>() in
   // descriptor.cc and update them to initialize the field.
 
   union {
-    int32  default_value_int32_;
-    int64  default_value_int64_;
-    uint32 default_value_uint32_;
-    uint64 default_value_uint64_;
-    float  default_value_float_;
+    int32_t default_value_int32_t_;
+    int64_t default_value_int64_t_;
+    uint32_t default_value_uint32_t_;
+    uint64_t default_value_uint64_t_;
+    float default_value_float_;
     double default_value_double_;
-    bool   default_value_bool_;
+    bool default_value_bool_;
 
     mutable const EnumValueDescriptor* default_value_enum_;
-    const string* default_value_string_;
+    const char* lazy_default_value_enum_name_;
+    const std::string* default_value_string_;
+    mutable std::atomic<const Message*> default_generated_instance_;
   };
 
   static const CppType kTypeToCppTypeMap[MAX_TYPE + 1];
 
-  static const char * const kTypeToName[MAX_TYPE + 1];
+  static const char* const kTypeToName[MAX_TYPE + 1];
 
-  static const char * const kCppTypeToName[MAX_CPPTYPE + 1];
+  static const char* const kCppTypeToName[MAX_CPPTYPE + 1];
 
-  static const char * const kLabelToName[MAX_LABEL + 1];
+  static const char* const kLabelToName[MAX_LABEL + 1];
 
   // Must be constructed using DescriptorPool.
   FieldDescriptor() {}
@@ -808,15 +976,21 @@ class LIBPROTOBUF_EXPORT FieldDescriptor {
 
 
 // Describes a oneof defined in a message type.
-class LIBPROTOBUF_EXPORT OneofDescriptor {
+class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase {
  public:
-  const string& name() const;       // Name of this oneof.
-  const string& full_name() const;  // Fully-qualified name of the oneof.
+  typedef OneofDescriptorProto Proto;
+
+  const std::string& name() const;       // Name of this oneof.
+  const std::string& full_name() const;  // Fully-qualified name of the oneof.
 
   // Index of this oneof within the message's oneof array.
   int index() const;
 
-  // The .proto file in which this oneof was defined.  Never NULL.
+  // Returns whether this oneof was inserted by the compiler to wrap a proto3
+  // optional field. If this returns true, code generators should *not* emit it.
+  bool is_synthetic() const;
+
+  // The .proto file in which this oneof was defined.  Never nullptr.
   const FileDescriptor* file() const;
   // The Descriptor for the message containing this oneof.
   const Descriptor* containing_type() const;
@@ -833,10 +1007,10 @@ class LIBPROTOBUF_EXPORT OneofDescriptor {
   void CopyTo(OneofDescriptorProto* proto) const;
 
   // See Descriptor::DebugString().
-  string DebugString() const;
+  std::string DebugString() const;
 
   // See Descriptor::DebugStringWithOptions().
-  string DebugStringWithOptions(const DebugStringOptions& options) const;
+  std::string DebugStringWithOptions(const DebugStringOptions& options) const;
 
   // Source Location ---------------------------------------------------
 
@@ -846,26 +1020,28 @@ class LIBPROTOBUF_EXPORT OneofDescriptor {
   bool GetSourceLocation(SourceLocation* out_location) const;
 
  private:
+  friend class Symbol;
   typedef OneofOptions OptionsType;
 
   // Allows access to GetLocationPath for annotations.
-  friend class ::google::protobuf::io::Printer;
+  friend class io::Printer;
+  friend class compiler::cpp::Formatter;
 
   // See Descriptor::DebugString().
-  void DebugString(int depth, string* contents,
+  void DebugString(int depth, std::string* contents,
                    const DebugStringOptions& options) const;
 
   // Walks up the descriptor tree to generate the source location path
   // to this descriptor from the file root.
   void GetLocationPath(std::vector<int>* output) const;
 
-  const string* name_;
-  const string* full_name_;
-  const Descriptor* containing_type_;
-  bool is_extendable_;
   int field_count_;
-  const FieldDescriptor** fields_;
+
+  // all_names_ = [name, full_name]
+  const std::string* all_names_;
+  const Descriptor* containing_type_;
   const OneofOptions* options_;
+  const FieldDescriptor* fields_;
 
   // IMPORTANT:  If you add a new field, make sure to search for all instances
   // of Allocate<OneofDescriptor>() and AllocateArray<OneofDescriptor>()
@@ -881,18 +1057,20 @@ class LIBPROTOBUF_EXPORT OneofDescriptor {
 // Describes an enum type defined in a .proto file.  To get the EnumDescriptor
 // for a generated enum type, call TypeName_descriptor().  Use DescriptorPool
 // to construct your own descriptors.
-class LIBPROTOBUF_EXPORT EnumDescriptor {
+class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase {
  public:
+  typedef EnumDescriptorProto Proto;
+
   // The name of this enum type in the containing scope.
-  const string& name() const;
+  const std::string& name() const;
 
   // The fully-qualified name of the enum type, scope delimited by periods.
-  const string& full_name() const;
+  const std::string& full_name() const;
 
   // Index of this enum within the file or containing message's enum array.
   int index() const;
 
-  // The .proto file in which this enum type was defined.  Never NULL.
+  // The .proto file in which this enum type was defined.  Never nullptr.
   const FileDescriptor* file() const;
 
   // The number of values for this EnumDescriptor.  Guaranteed to be greater
@@ -902,30 +1080,30 @@ class LIBPROTOBUF_EXPORT EnumDescriptor {
   // These are returned in the order they were defined in the .proto file.
   const EnumValueDescriptor* value(int index) const;
 
-  // Looks up a value by name.  Returns NULL if no such value exists.
-  const EnumValueDescriptor* FindValueByName(const string& name) const;
-  // Looks up a value by number.  Returns NULL if no such value exists.  If
+  // Looks up a value by name.  Returns nullptr if no such value exists.
+  const EnumValueDescriptor* FindValueByName(ConstStringParam name) const;
+  // Looks up a value by number.  Returns nullptr if no such value exists.  If
   // multiple values have this number, the first one defined is returned.
   const EnumValueDescriptor* FindValueByNumber(int number) const;
 
   // If this enum type is nested in a message type, this is that message type.
-  // Otherwise, NULL.
+  // Otherwise, nullptr.
   const Descriptor* containing_type() const;
 
   // Get options for this enum type.  These are specified in the .proto file by
   // placing lines like "option foo = 1234;" in the enum definition.  Allowed
-  // options are defined by EnumOptions in google/protobuf/descriptor.proto,
-  // and any available extensions of that message.
+  // options are defined by EnumOptions in descriptor.proto, and any available
+  // extensions of that message.
   const EnumOptions& options() const;
 
   // See Descriptor::CopyTo().
   void CopyTo(EnumDescriptorProto* proto) const;
 
   // See Descriptor::DebugString().
-  string DebugString() const;
+  std::string DebugString() const;
 
   // See Descriptor::DebugStringWithOptions().
-  string DebugStringWithOptions(const DebugStringOptions& options) const;
+  std::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
@@ -950,18 +1128,18 @@ class LIBPROTOBUF_EXPORT EnumDescriptor {
   // 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;
+  // Returns nullptr 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;
+  const std::string& reserved_name(int index) const;
 
   // Returns true if the field name is reserved.
-  bool IsReservedName(const string& name) const;
+  bool IsReservedName(ConstStringParam name) const;
 
   // Source Location ---------------------------------------------------
 
@@ -971,49 +1149,62 @@ class LIBPROTOBUF_EXPORT EnumDescriptor {
   bool GetSourceLocation(SourceLocation* out_location) const;
 
  private:
+  friend class Symbol;
   typedef EnumOptions OptionsType;
 
   // Allows access to GetLocationPath for annotations.
-  friend class ::google::protobuf::io::Printer;
+  friend class io::Printer;
+  friend class compiler::cpp::Formatter;
+
+  // Allow access to FindValueByNumberCreatingIfUnknown.
+  friend class descriptor_unittest::DescriptorTest;
 
   // Looks up a value by number.  If the value does not exist, dynamically
   // creates a new EnumValueDescriptor for that value, assuming that it was
   // unknown. If a new descriptor is created, this is done in a thread-safe way,
   // and future calls will return the same value descriptor pointer.
   //
-  // This is private but is used by GeneratedMessageReflection (which is
-  // friended below) to return a valid EnumValueDescriptor from GetEnum() when
-  // this feature is enabled.
-  const EnumValueDescriptor*
-      FindValueByNumberCreatingIfUnknown(int number) const;
-
+  // This is private but is used by Reflection (which is friended below) to
+  // return a valid EnumValueDescriptor from GetEnum() when this feature is
+  // enabled.
+  const EnumValueDescriptor* FindValueByNumberCreatingIfUnknown(
+      int number) const;
 
   // See Descriptor::DebugString().
-  void DebugString(int depth, string *contents,
+  void DebugString(int depth, std::string* contents,
                    const DebugStringOptions& options) const;
 
   // Walks up the descriptor tree to generate the source location path
   // to this descriptor from the file root.
   void GetLocationPath(std::vector<int>* output) const;
 
-  const string* name_;
-  const string* full_name_;
-  const FileDescriptor* file_;
-  const Descriptor* containing_type_;
-  const EnumOptions* options_;
-
   // True if this is a placeholder for an unknown type.
-  bool is_placeholder_;
+  bool is_placeholder_ : 1;
   // True if this is a placeholder and the type name wasn't fully-qualified.
-  bool is_unqualified_placeholder_;
+  bool is_unqualified_placeholder_ : 1;
+
+  // This points to the last value _index_ that is part of the sequence starting
+  // with the first label, where
+  //   `enum->value(i)->number() == enum->value(0)->number() + i`
+  // We measure relative to the first label to adapt to enum labels starting at
+  // 0 or 1.
+  // Uses 16-bit to avoid extra padding. Unlikely to have more than 2^15
+  // sequentially numbered labels in an enum.
+  int16_t sequential_value_limit_;
 
   int value_count_;
+
+  // all_names_ = [name, full_name]
+  const std::string* all_names_;
+  const FileDescriptor* file_;
+  const Descriptor* containing_type_;
+  const EnumOptions* options_;
   EnumValueDescriptor* values_;
 
   int reserved_range_count_;
   int reserved_name_count_;
   EnumDescriptor::ReservedRange* reserved_ranges_;
-  const string** reserved_names_;
+  const std::string** reserved_names_;
 
   // IMPORTANT:  If you add a new field, make sure to search for all instances
   // of Allocate<EnumDescriptor>() and AllocateArray<EnumDescriptor>() in
@@ -1024,10 +1215,11 @@ class LIBPROTOBUF_EXPORT EnumDescriptor {
   friend class DescriptorBuilder;
   friend class Descriptor;
   friend class FieldDescriptor;
+  friend class FileDescriptorTables;
   friend class EnumValueDescriptor;
   friend class FileDescriptor;
   friend class DescriptorPool;
-  friend class internal::GeneratedMessageReflection;
+  friend class Reflection;
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumDescriptor);
 };
 
@@ -1036,40 +1228,41 @@ class LIBPROTOBUF_EXPORT EnumDescriptor {
 // for its type, then use EnumDescriptor::FindValueByName() or
 // EnumDescriptor::FindValueByNumber().  Use DescriptorPool to construct
 // your own descriptors.
-class LIBPROTOBUF_EXPORT EnumValueDescriptor {
+class PROTOBUF_EXPORT EnumValueDescriptor : private internal::SymbolBaseN<0>,
+                                            private internal::SymbolBaseN<1> {
  public:
-  const string& name() const;  // Name of this enum constant.
-  int index() const;           // Index within the enums's Descriptor.
-  int number() const;          // Numeric value of this enum constant.
+  typedef EnumValueDescriptorProto Proto;
+
+  const std::string& name() const;  // Name of this enum constant.
+  int index() const;                // Index within the enums's Descriptor.
+  int number() const;               // Numeric value of this enum constant.
 
   // The full_name of an enum value is a sibling symbol of the enum type.
   // e.g. the full name of FieldDescriptorProto::TYPE_INT32 is actually
   // "google.protobuf.FieldDescriptorProto.TYPE_INT32", NOT
   // "google.protobuf.FieldDescriptorProto.Type.TYPE_INT32".  This is to conform
   // with C++ scoping rules for enums.
-  const string& full_name() const;
+  const std::string& full_name() const;
 
-  // The .proto file in which this value was defined.  Never NULL.
+  // The .proto file in which this value was defined.  Never nullptr.
   const FileDescriptor* file() const;
-  // The type of this value.  Never NULL.
+  // The type of this value.  Never nullptr.
   const EnumDescriptor* type() const;
 
-  // Get options for this enum value.  These are specified in the .proto file
-  // by adding text like "[foo = 1234]" after an enum value definition.
-  // Allowed options are defined by EnumValueOptions in
-  // google/protobuf/descriptor.proto, and any available extensions of that
-  // message.
+  // Get options for this enum value.  These are specified in the .proto file by
+  // adding text like "[foo = 1234]" after an enum value definition.  Allowed
+  // options are defined by EnumValueOptions in descriptor.proto, and any
+  // available extensions of that message.
   const EnumValueOptions& options() const;
 
   // See Descriptor::CopyTo().
   void CopyTo(EnumValueDescriptorProto* proto) const;
 
   // See Descriptor::DebugString().
-  string DebugString() const;
+  std::string DebugString() const;
 
   // See Descriptor::DebugStringWithOptions().
-  string DebugStringWithOptions(const DebugStringOptions& options) const;
-
+  std::string DebugStringWithOptions(const DebugStringOptions& options) const;
 
   // Source Location ---------------------------------------------------
 
@@ -1079,22 +1272,24 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptor {
   bool GetSourceLocation(SourceLocation* out_location) const;
 
  private:
+  friend class Symbol;
   typedef EnumValueOptions OptionsType;
 
   // Allows access to GetLocationPath for annotations.
-  friend class ::google::protobuf::io::Printer;
+  friend class io::Printer;
+  friend class compiler::cpp::Formatter;
 
   // See Descriptor::DebugString().
-  void DebugString(int depth, string *contents,
+  void DebugString(int depth, std::string* contents,
                    const DebugStringOptions& options) const;
 
   // Walks up the descriptor tree to generate the source location path
   // to this descriptor from the file root.
   void GetLocationPath(std::vector<int>* output) const;
 
-  const string* name_;
-  const string* full_name_;
   int number_;
+  // all_names_ = [name, full_name]
+  const std::string* all_names_;
   const EnumDescriptor* type_;
   const EnumValueOptions* options_;
   // IMPORTANT:  If you add a new field, make sure to search for all instances
@@ -1107,30 +1302,30 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptor {
   friend class EnumDescriptor;
   friend class DescriptorPool;
   friend class FileDescriptorTables;
+  friend class Reflection;
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumValueDescriptor);
 };
 
-// Describes an RPC service.  To get the ServiceDescriptor for a service,
-// call Service::GetDescriptor().  Generated service classes also have a
-// static method called descriptor() which returns the type's
-// ServiceDescriptor.  Use DescriptorPool to construct your own descriptors.
-class LIBPROTOBUF_EXPORT ServiceDescriptor {
+// Describes an RPC service. Use DescriptorPool to construct your own
+// descriptors.
+class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase {
  public:
+  typedef ServiceDescriptorProto Proto;
+
   // The name of the service, not including its containing scope.
-  const string& name() const;
+  const std::string& name() const;
   // The fully-qualified name of the service, scope delimited by periods.
-  const string& full_name() const;
+  const std::string& full_name() const;
   // Index of this service within the file's services array.
   int index() const;
 
-  // The .proto file in which this service was defined.  Never NULL.
+  // The .proto file in which this service was defined.  Never nullptr.
   const FileDescriptor* file() const;
 
   // Get options for this service type.  These are specified in the .proto file
   // by placing lines like "option foo = 1234;" in the service definition.
-  // Allowed options are defined by ServiceOptions in
-  // google/protobuf/descriptor.proto, and any available extensions of that
-  // message.
+  // Allowed options are defined by ServiceOptions in descriptor.proto, and any
+  // available extensions of that message.
   const ServiceOptions& options() const;
 
   // The number of methods this service defines.
@@ -1140,16 +1335,15 @@ class LIBPROTOBUF_EXPORT ServiceDescriptor {
   const MethodDescriptor* method(int index) const;
 
   // Look up a MethodDescriptor by name.
-  const MethodDescriptor* FindMethodByName(const string& name) const;
+  const MethodDescriptor* FindMethodByName(ConstStringParam name) const;
   // See Descriptor::CopyTo().
   void CopyTo(ServiceDescriptorProto* proto) const;
 
   // See Descriptor::DebugString().
-  string DebugString() const;
+  std::string DebugString() const;
 
   // See Descriptor::DebugStringWithOptions().
-  string DebugStringWithOptions(const DebugStringOptions& options) const;
-
+  std::string DebugStringWithOptions(const DebugStringOptions& options) const;
 
   // Source Location ---------------------------------------------------
 
@@ -1159,20 +1353,23 @@ class LIBPROTOBUF_EXPORT ServiceDescriptor {
   bool GetSourceLocation(SourceLocation* out_location) const;
 
  private:
+  friend class Symbol;
   typedef ServiceOptions OptionsType;
 
   // Allows access to GetLocationPath for annotations.
-  friend class ::google::protobuf::io::Printer;
+  friend class io::Printer;
+  friend class compiler::cpp::Formatter;
 
   // See Descriptor::DebugString().
-  void DebugString(string *contents, const DebugStringOptions& options) const;
+  void DebugString(std::string* contents,
+                   const DebugStringOptions& options) const;
 
   // Walks up the descriptor tree to generate the source location path
   // to this descriptor from the file root.
   void GetLocationPath(std::vector<int>* output) const;
 
-  const string* name_;
-  const string* full_name_;
+  // all_names_ = [name, full_name]
+  const std::string* all_names_;
   const FileDescriptor* file_;
   const ServiceOptions* options_;
   MethodDescriptor* methods_;
@@ -1194,18 +1391,20 @@ class LIBPROTOBUF_EXPORT ServiceDescriptor {
 // a service, first get its ServiceDescriptor, then call
 // ServiceDescriptor::FindMethodByName().  Use DescriptorPool to construct your
 // own descriptors.
-class LIBPROTOBUF_EXPORT MethodDescriptor {
+class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase {
  public:
+  typedef MethodDescriptorProto Proto;
+
   // Name of this method, not including containing scope.
-  const string& name() const;
+  const std::string& name() const;
   // The fully-qualified name of the method, scope delimited by periods.
-  const string& full_name() const;
+  const std::string& full_name() const;
   // Index within the service's Descriptor.
   int index() const;
 
-  // The .proto file in which this method was defined.  Never NULL.
+  // The .proto file in which this method was defined.  Never nullptr.
   const FileDescriptor* file() const;
-  // Gets the service to which this method belongs.  Never NULL.
+  // Gets the service to which this method belongs.  Never nullptr.
   const ServiceDescriptor* service() const;
 
   // Gets the type of protocol message which this method accepts as input.
@@ -1221,19 +1420,17 @@ class LIBPROTOBUF_EXPORT MethodDescriptor {
   // Get options for this method.  These are specified in the .proto file by
   // placing lines like "option foo = 1234;" in curly-braces after a method
   // declaration.  Allowed options are defined by MethodOptions in
-  // google/protobuf/descriptor.proto, and any available extensions of that
-  // message.
+  // descriptor.proto, and any available extensions of that message.
   const MethodOptions& options() const;
 
   // See Descriptor::CopyTo().
   void CopyTo(MethodDescriptorProto* proto) const;
 
   // See Descriptor::DebugString().
-  string DebugString() const;
+  std::string DebugString() const;
 
   // See Descriptor::DebugStringWithOptions().
-  string DebugStringWithOptions(const DebugStringOptions& options) const;
-
+  std::string DebugStringWithOptions(const DebugStringOptions& options) const;
 
   // Source Location ---------------------------------------------------
 
@@ -1243,27 +1440,29 @@ class LIBPROTOBUF_EXPORT MethodDescriptor {
   bool GetSourceLocation(SourceLocation* out_location) const;
 
  private:
+  friend class Symbol;
   typedef MethodOptions OptionsType;
 
   // Allows access to GetLocationPath for annotations.
-  friend class ::google::protobuf::io::Printer;
+  friend class io::Printer;
+  friend class compiler::cpp::Formatter;
 
   // See Descriptor::DebugString().
-  void DebugString(int depth, string *contents,
+  void DebugString(int depth, std::string* contents,
                    const DebugStringOptions& options) const;
 
   // Walks up the descriptor tree to generate the source location path
   // to this descriptor from the file root.
   void GetLocationPath(std::vector<int>* output) const;
 
-  const string* name_;
-  const string* full_name_;
+  bool client_streaming_;
+  bool server_streaming_;
+  // all_names_ = [name, full_name]
+  const std::string* all_names_;
   const ServiceDescriptor* service_;
   mutable internal::LazyDescriptor input_type_;
   mutable internal::LazyDescriptor output_type_;
   const MethodOptions* options_;
-  bool client_streaming_;
-  bool server_streaming_;
   // IMPORTANT:  If you add a new field, make sure to search for all instances
   // of Allocate<MethodDescriptor>() and AllocateArray<MethodDescriptor>() in
   // descriptor.cc and update them to initialize the field.
@@ -1279,17 +1478,19 @@ class LIBPROTOBUF_EXPORT MethodDescriptor {
 // Describes a whole .proto file.  To get the FileDescriptor for a compiled-in
 // file, get the descriptor for something defined in that file and call
 // descriptor->file().  Use DescriptorPool to construct your own descriptors.
-class LIBPROTOBUF_EXPORT FileDescriptor {
+class PROTOBUF_EXPORT FileDescriptor {
  public:
+  typedef FileDescriptorProto Proto;
+
   // The filename, relative to the source tree.
-  // e.g. "google/protobuf/descriptor.proto"
-  const string& name() const;
+  // e.g. "foo/bar/baz.proto"
+  const std::string& name() const;
 
   // The package, e.g. "google.protobuf.compiler".
-  const string& package() const;
+  const std::string& package() const;
 
   // The DescriptorPool in which this FileDescriptor and all its contents were
-  // allocated.  Never NULL.
+  // allocated.  Never nullptr.
   const DescriptorPool* pool() const;
 
   // The number of files imported by this one.
@@ -1344,36 +1545,39 @@ class LIBPROTOBUF_EXPORT FileDescriptor {
   // Get options for this file.  These are specified in the .proto file by
   // placing lines like "option foo = 1234;" at the top level, outside of any
   // other definitions.  Allowed options are defined by FileOptions in
-  // google/protobuf/descriptor.proto, and any available extensions of that
-  // message.
+  // descriptor.proto, and any available extensions of that message.
   const FileOptions& options() const;
 
   // Syntax of this file.
   enum Syntax {
     SYNTAX_UNKNOWN = 0,
-    SYNTAX_PROTO2  = 2,
-    SYNTAX_PROTO3  = 3,
+    SYNTAX_PROTO2 = 2,
+    SYNTAX_PROTO3 = 3,
   };
   Syntax syntax() const;
   static const char* SyntaxName(Syntax syntax);
 
-  // Find a top-level message type by name.  Returns NULL if not found.
-  const Descriptor* FindMessageTypeByName(const string& name) const;
-  // Find a top-level enum type by name.  Returns NULL if not found.
-  const EnumDescriptor* FindEnumTypeByName(const string& name) const;
-  // Find an enum value defined in any top-level enum by name.  Returns NULL if
+  // Find a top-level message type by name (not full_name).  Returns nullptr if
   // not found.
-  const EnumValueDescriptor* FindEnumValueByName(const string& name) const;
-  // Find a service definition by name.  Returns NULL if not found.
-  const ServiceDescriptor* FindServiceByName(const string& name) const;
-  // Find a top-level extension definition by name.  Returns NULL if not found.
-  const FieldDescriptor* FindExtensionByName(const string& name) const;
+  const Descriptor* FindMessageTypeByName(ConstStringParam name) const;
+  // Find a top-level enum type by name.  Returns nullptr if not found.
+  const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const;
+  // Find an enum value defined in any top-level enum by name.  Returns nullptr
+  // if not found.
+  const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const;
+  // Find a service definition by name.  Returns nullptr if not found.
+  const ServiceDescriptor* FindServiceByName(ConstStringParam name) const;
+  // Find a top-level extension definition by name.  Returns nullptr if not
+  // found.
+  const FieldDescriptor* FindExtensionByName(ConstStringParam name) const;
   // Similar to FindExtensionByName(), but searches by lowercased-name.  See
   // Descriptor::FindFieldByLowercaseName().
-  const FieldDescriptor* FindExtensionByLowercaseName(const string& name) const;
+  const FieldDescriptor* FindExtensionByLowercaseName(
+      ConstStringParam name) const;
   // Similar to FindExtensionByName(), but searches by camelcased-name.  See
   // Descriptor::FindFieldByCamelcaseName().
-  const FieldDescriptor* FindExtensionByCamelcaseName(const string& name) const;
+  const FieldDescriptor* FindExtensionByCamelcaseName(
+      ConstStringParam name) const;
 
   // See Descriptor::CopyTo().
   // Notes:
@@ -1388,10 +1592,10 @@ class LIBPROTOBUF_EXPORT FileDescriptor {
   void CopyJsonNameTo(FileDescriptorProto* proto) const;
 
   // See Descriptor::DebugString().
-  string DebugString() const;
+  std::string DebugString() const;
 
   // See Descriptor::DebugStringWithOptions().
-  string DebugStringWithOptions(const DebugStringOptions& options) const;
+  std::string DebugStringWithOptions(const DebugStringOptions& options) const;
 
   // Returns true if this is a placeholder for an unknown file. This will
   // only be the case if this descriptor comes from a DescriptorPool
@@ -1413,31 +1617,41 @@ class LIBPROTOBUF_EXPORT FileDescriptor {
  private:
   typedef FileOptions OptionsType;
 
-  const string* name_;
-  const string* package_;
+  const std::string* name_;
+  const std::string* package_;
   const DescriptorPool* pool_;
-  GoogleOnceDynamic* dependencies_once_;
+
+  // Data required to do lazy initialization.
+  struct PROTOBUF_EXPORT LazyInitData {
+#ifndef SWIG
+    internal::once_flag once;
+#endif
+    const char** dependencies_names;
+  };
+
+  LazyInitData* dependencies_once_;
   static void DependenciesOnceInit(const FileDescriptor* to_init);
   void InternalDependenciesOnceInit() const;
 
-  // These are arranged to minimze padding on 64-bit.
+  // These are arranged to minimize padding on 64-bit.
   int dependency_count_;
   int public_dependency_count_;
   int weak_dependency_count_;
   int message_type_count_;
   int enum_type_count_;
   int service_count_;
-  int extension_count_;
-  Syntax syntax_;
-  bool is_placeholder_;
 
+  bool is_placeholder_;
   // Indicates the FileDescriptor is completed building. Used to verify
   // that type accessor functions that can possibly build a dependent file
   // aren't called during the process of building the file.
   bool finished_building_;
+  // Actually a `Syntax` but stored as uint8_t to save space.
+  uint8_t syntax_;
+  // This one is here to fill the padding.
+  int extension_count_;
 
   mutable const FileDescriptor** dependencies_;
-  const string** dependencies_names_;
   int* public_dependencies_;
   int* weak_dependencies_;
   Descriptor* message_types_;
@@ -1494,7 +1708,7 @@ class LIBPROTOBUF_EXPORT FileDescriptor {
 //
 // You can also search for descriptors within a DescriptorPool by name, and
 // extensions by number.
-class LIBPROTOBUF_EXPORT DescriptorPool {
+class PROTOBUF_EXPORT DescriptorPool {
  public:
   // Create a normal, empty DescriptorPool.
   DescriptorPool();
@@ -1524,7 +1738,7 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   //   in subsequent lookups in the DescriptorPool.
   class ErrorCollector;
   explicit DescriptorPool(DescriptorDatabase* fallback_database,
-                          ErrorCollector* error_collector = NULL);
+                          ErrorCollector* error_collector = nullptr);
 
   ~DescriptorPool();
 
@@ -1534,36 +1748,44 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   static const DescriptorPool* generated_pool();
 
 
-  // Find a FileDescriptor in the pool by file name.  Returns NULL if not
+  // Find a FileDescriptor in the pool by file name.  Returns nullptr if not
   // found.
-  const FileDescriptor* FindFileByName(const string& name) const;
+  const FileDescriptor* FindFileByName(ConstStringParam name) const;
 
   // Find the FileDescriptor in the pool which defines the given symbol.
   // If any of the Find*ByName() methods below would succeed, then this is
   // equivalent to calling that method and calling the result's file() method.
-  // Otherwise this returns NULL.
+  // Otherwise this returns nullptr.
   const FileDescriptor* FindFileContainingSymbol(
-      const string& symbol_name) const;
+      ConstStringParam symbol_name) const;
 
   // Looking up descriptors ------------------------------------------
   // These find descriptors by fully-qualified name.  These will find both
-  // top-level descriptors and nested descriptors.  They return NULL if not
+  // top-level descriptors and nested descriptors.  They return nullptr if not
   // found.
 
-  const Descriptor* FindMessageTypeByName(const string& name) const;
-  const FieldDescriptor* FindFieldByName(const string& name) const;
-  const FieldDescriptor* FindExtensionByName(const string& name) const;
-  const OneofDescriptor* FindOneofByName(const string& name) const;
-  const EnumDescriptor* FindEnumTypeByName(const string& name) const;
-  const EnumValueDescriptor* FindEnumValueByName(const string& name) const;
-  const ServiceDescriptor* FindServiceByName(const string& name) const;
-  const MethodDescriptor* FindMethodByName(const string& name) const;
+  const Descriptor* FindMessageTypeByName(ConstStringParam name) const;
+  const FieldDescriptor* FindFieldByName(ConstStringParam name) const;
+  const FieldDescriptor* FindExtensionByName(ConstStringParam name) const;
+  const OneofDescriptor* FindOneofByName(ConstStringParam name) const;
+  const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const;
+  const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const;
+  const ServiceDescriptor* FindServiceByName(ConstStringParam name) const;
+  const MethodDescriptor* FindMethodByName(ConstStringParam name) const;
 
   // Finds an extension of the given type by number.  The extendee must be
   // a member of this DescriptorPool or one of its underlays.
   const FieldDescriptor* FindExtensionByNumber(const Descriptor* extendee,
                                                int number) const;
 
+  // Finds an extension of the given type by its printable name.
+  // See comments above PrintableNameForExtension() for the definition of
+  // "printable name".  The extendee must be a member of this DescriptorPool
+  // or one of its underlays.  Returns nullptr if there is no known message
+  // extension with the given printable name.
+  const FieldDescriptor* FindExtensionByPrintableName(
+      const Descriptor* extendee, ConstStringParam printable_name) const;
+
   // Finds extensions of extendee. The extensions will be appended to
   // out in an undefined order. Only extensions defined directly in
   // this DescriptorPool or one of its underlays are guaranteed to be
@@ -1577,7 +1799,7 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   // When converting a FileDescriptorProto to a FileDescriptor, various
   // errors might be detected in the input.  The caller may handle these
   // programmatically by implementing an ErrorCollector.
-  class LIBPROTOBUF_EXPORT ErrorCollector {
+  class PROTOBUF_EXPORT ErrorCollector {
    public:
     inline ErrorCollector() {}
     virtual ~ErrorCollector();
@@ -1586,37 +1808,40 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
     // This is useful e.g. for mapping the error back to an exact location
     // in a .proto file.
     enum ErrorLocation {
-      NAME,              // the symbol name, or the package name for files
-      NUMBER,            // field or extension range number
-      TYPE,              // field type
-      EXTENDEE,          // field extendee
-      DEFAULT_VALUE,     // field default value
-      INPUT_TYPE,        // method input type
-      OUTPUT_TYPE,       // method output type
-      OPTION_NAME,       // name in assignment
-      OPTION_VALUE,      // value in option assignment
-      OTHER              // some other problem
+      NAME,           // the symbol name, or the package name for files
+      NUMBER,         // field or extension range number
+      TYPE,           // field type
+      EXTENDEE,       // field extendee
+      DEFAULT_VALUE,  // field default value
+      INPUT_TYPE,     // method input type
+      OUTPUT_TYPE,    // method output type
+      OPTION_NAME,    // name in assignment
+      OPTION_VALUE,   // value in option assignment
+      IMPORT,         // import error
+      OTHER           // some other problem
     };
 
     // Reports an error in the FileDescriptorProto. Use this function if the
     // problem occurred should interrupt building the FileDescriptorProto.
     virtual void AddError(
-      const string& filename,      // File name in which the error occurred.
-      const string& element_name,  // Full name of the erroneous element.
-      const Message* descriptor,   // Descriptor of the erroneous element.
-      ErrorLocation location,      // One of the location constants, above.
-      const string& message        // Human-readable error message.
-      ) = 0;
+        const std::string& filename,  // File name in which the error occurred.
+        const std::string& element_name,  // Full name of the erroneous element.
+        const Message* descriptor,  // Descriptor of the erroneous element.
+        ErrorLocation location,     // One of the location constants, above.
+        const std::string& message  // Human-readable error message.
+        ) = 0;
 
     // Reports a warning in the FileDescriptorProto. Use this function if the
     // problem occurred should NOT interrupt building the FileDescriptorProto.
     virtual void AddWarning(
-      const string& /*filename*/,      // File name in which the error occurred.
-      const string& /*element_name*/,  // Full name of the erroneous element.
-      const Message* /*descriptor*/,   // Descriptor of the erroneous element.
-      ErrorLocation /*location*/,      // One of the location constants, above.
-      const string& /*message*/        // Human-readable error message.
-      ) {}
+        const std::string& /*filename*/,      // File name in which the error
+                                              // occurred.
+        const std::string& /*element_name*/,  // Full name of the erroneous
+                                              // element.
+        const Message* /*descriptor*/,  // Descriptor of the erroneous element.
+        ErrorLocation /*location*/,     // One of the location constants, above.
+        const std::string& /*message*/  // Human-readable error message.
+    ) {}
 
    private:
     GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorCollector);
@@ -1624,15 +1849,14 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
 
   // Convert the FileDescriptorProto to real descriptors and place them in
   // this DescriptorPool.  All dependencies of the file must already be in
-  // the pool.  Returns the resulting FileDescriptor, or NULL if there were
+  // the pool.  Returns the resulting FileDescriptor, or nullptr if there were
   // problems with the input (e.g. the message was invalid, or dependencies
   // were missing).  Details about the errors are written to GOOGLE_LOG(ERROR).
   const FileDescriptor* BuildFile(const FileDescriptorProto& proto);
 
   // Same as BuildFile() except errors are sent to the given ErrorCollector.
   const FileDescriptor* BuildFileCollectingErrors(
-    const FileDescriptorProto& proto,
-    ErrorCollector* error_collector);
+      const FileDescriptorProto& proto, ErrorCollector* error_collector);
 
   // By default, it is an error if a FileDescriptorProto contains references
   // to types or other files that are not found in the DescriptorPool (or its
@@ -1687,8 +1911,8 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   // Called by generated classes at init time to add their descriptors to
   // generated_pool.  Do NOT call this in your own code!  filename must be a
   // permanent string (e.g. a string literal).
-  static void InternalAddGeneratedFile(
-      const void* encoded_file_descriptor, int size);
+  static void InternalAddGeneratedFile(const void* encoded_file_descriptor,
+                                       int size);
 
   // Disallow [enforce_utf8 = false] in .proto files.
   void DisallowEnforceUtf8() { disallow_enforce_utf8_ = true; }
@@ -1700,6 +1924,11 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   // the underlay takes precedence.
   static DescriptorPool* internal_generated_pool();
 
+  // For internal use only:  Gets a non-const pointer to the generated
+  // descriptor database.
+  // Only used for testing.
+  static DescriptorDatabase* internal_generated_database();
+
   // For internal use only:  Changes the behavior of BuildFile() such that it
   // allows the file to make reference to message types declared in other files
   // which it did not officially declare as dependencies.
@@ -1709,7 +1938,7 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   // Delay the building of dependencies of a file descriptor until absolutely
   // necessary, like when message_type() is called on a field that is defined
   // in that dependency's file. This will cause functional issues if a proto
-  // or one of it's dependencies has errors. Should only be enabled for the
+  // or one of its dependencies has errors. Should only be enabled for the
   // generated_pool_ (because no descriptor build errors are guaranteed by
   // the compilation generation process), testing, or if a lack of descriptor
   // build errors can be guaranteed for a pool.
@@ -1728,12 +1957,12 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   // For internal (unit test) use only:  Returns true if a FileDescriptor has
   // been constructed for the given file, false otherwise.  Useful for testing
   // lazy descriptor initialization behavior.
-  bool InternalIsFileLoaded(const string& filename) const;
-
+  bool InternalIsFileLoaded(ConstStringParam filename) const;
 
   // Add a file to unused_import_track_files_. DescriptorBuilder will log
-  // warnings for those files if there is any unused import.
-  void AddUnusedImportTrackFile(const string& file_name);
+  // warnings or errors for those files if there is any unused import.
+  void AddUnusedImportTrackFile(ConstStringParam file_name,
+                                bool is_error = false);
   void ClearUnusedImportTrackFiles();
 
  private:
@@ -1751,33 +1980,40 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   // Return true if the given name is a sub-symbol of any non-package
   // descriptor that already exists in the descriptor pool.  (The full
   // definition of such types is already known.)
-  bool IsSubSymbolOfBuiltType(const string& name) const;
+  bool IsSubSymbolOfBuiltType(StringPiece name) const;
 
   // Tries to find something in the fallback database and link in the
   // corresponding proto file.  Returns true if successful, in which case
   // the caller should search for the thing again.  These are declared
   // const because they are called by (semantically) const methods.
-  bool TryFindFileInFallbackDatabase(const string& name) const;
-  bool TryFindSymbolInFallbackDatabase(const string& name) const;
+  bool TryFindFileInFallbackDatabase(StringPiece name) const;
+  bool TryFindSymbolInFallbackDatabase(StringPiece name) const;
   bool TryFindExtensionInFallbackDatabase(const Descriptor* containing_type,
                                           int field_number) const;
 
+  // This internal find extension method only check with its table and underlay
+  // descriptor_pool's table. It does not check with fallback DB and no
+  // additional proto file will be build in this method.
+  const FieldDescriptor* InternalFindExtensionByNumberNoLock(
+      const Descriptor* extendee, int number) const;
+
   // Like BuildFile() but called internally when the file has been loaded from
   // fallback_database_.  Declared const because it is called by (semantically)
   // const methods.
   const FileDescriptor* BuildFileFromDatabase(
-    const FileDescriptorProto& proto) const;
+      const FileDescriptorProto& proto) const;
 
   // Helper for when lazily_build_dependencies_ is set, can look up a symbol
   // after the file's descriptor is built, and can build the file where that
   // symbol is defined if necessary. Will create a placeholder if the type
   // doesn't exist in the fallback database, or the file doesn't build
   // successfully.
-  Symbol CrossLinkOnDemandHelper(const string& name, bool expecting_enum) const;
+  Symbol CrossLinkOnDemandHelper(StringPiece name,
+                                 bool expecting_enum) const;
 
   // Create a placeholder FileDescriptor of the specified name
-  FileDescriptor* NewPlaceholderFile(const string& name) const;
-  FileDescriptor* NewPlaceholderFileWithMutexHeld(const string& name) const;
+  FileDescriptor* NewPlaceholderFile(StringPiece name) const;
+  FileDescriptor* NewPlaceholderFileWithMutexHeld(StringPiece name) const;
 
   enum PlaceholderType {
     PLACEHOLDER_MESSAGE,
@@ -1785,14 +2021,14 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
     PLACEHOLDER_EXTENDABLE_MESSAGE
   };
   // Create a placeholder Descriptor of the specified name
-  Symbol NewPlaceholder(const string& name,
+  Symbol NewPlaceholder(StringPiece name,
                         PlaceholderType placeholder_type) const;
-  Symbol NewPlaceholderWithMutexHeld(const string& name,
+  Symbol NewPlaceholderWithMutexHeld(StringPiece name,
                                      PlaceholderType placeholder_type) const;
 
-  // If fallback_database_ is NULL, this is NULL.  Otherwise, this is a mutex
-  // which must be locked while accessing tables_.
-  Mutex* mutex_;
+  // If fallback_database_ is nullptr, this is nullptr.  Otherwise, this is a
+  // mutex which must be locked while accessing tables_.
+  internal::WrappedMutex* mutex_;
 
   // See constructor.
   DescriptorDatabase* fallback_database_;
@@ -1802,14 +2038,17 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
   // This class contains a lot of hash maps with complicated types that
   // we'd like to keep out of the header.
   class Tables;
-  google::protobuf::scoped_ptr<Tables> tables_;
+  std::unique_ptr<Tables> tables_;
 
   bool enforce_dependencies_;
   bool lazily_build_dependencies_;
   bool allow_unknown_;
   bool enforce_weak_;
   bool disallow_enforce_utf8_;
-  std::set<string> unused_import_track_files_;
+
+  // Set of files to track for unused imports. The bool value when true means
+  // unused imports are treated as errors (and as warnings when false).
+  std::map<std::string, bool> unused_import_track_files_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DescriptorPool);
 };
@@ -1823,7 +2062,12 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
 
 // Strings fields are stored as pointers but returned as const references.
 #define PROTOBUF_DEFINE_STRING_ACCESSOR(CLASS, FIELD) \
-  inline const string& CLASS::FIELD() const { return *FIELD##_; }
+  inline const std::string& CLASS::FIELD() const { return *FIELD##_; }
+
+// Name and full name are stored in a single array to save space.
+#define PROTOBUF_DEFINE_NAME_ACCESSOR(CLASS)                              \
+  inline const std::string& CLASS::name() const { return all_names_[0]; } \
+  inline const std::string& CLASS::full_name() const { return all_names_[1]; }
 
 // Arrays take an index parameter, obviously.
 #define PROTOBUF_DEFINE_ARRAY_ACCESSOR(CLASS, FIELD, TYPE) \
@@ -1832,13 +2076,13 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
 #define PROTOBUF_DEFINE_OPTIONS_ACCESSOR(CLASS, TYPE) \
   inline const TYPE& CLASS::options() const { return *options_; }
 
-PROTOBUF_DEFINE_STRING_ACCESSOR(Descriptor, name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(Descriptor, full_name)
+PROTOBUF_DEFINE_NAME_ACCESSOR(Descriptor)
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, file, const FileDescriptor*)
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, containing_type, const Descriptor*)
 
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, field_count, int)
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, oneof_decl_count, int)
+PROTOBUF_DEFINE_ACCESSOR(Descriptor, real_oneof_decl_count, int)
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, nested_type_count, int)
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, enum_type_count, int)
 
@@ -1851,8 +2095,7 @@ PROTOBUF_DEFINE_ACCESSOR(Descriptor, extension_range_count, int)
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, extension_count, int)
 PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension_range,
                                const Descriptor::ExtensionRange*)
-PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension,
-                               const FieldDescriptor*)
+PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension, const FieldDescriptor*)
 
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, reserved_range_count, int)
 PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, reserved_range,
@@ -1862,40 +2105,30 @@ PROTOBUF_DEFINE_ACCESSOR(Descriptor, reserved_name_count, int)
 PROTOBUF_DEFINE_OPTIONS_ACCESSOR(Descriptor, MessageOptions)
 PROTOBUF_DEFINE_ACCESSOR(Descriptor, is_placeholder, bool)
 
-PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, full_name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, json_name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, lowercase_name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, camelcase_name)
+PROTOBUF_DEFINE_NAME_ACCESSOR(FieldDescriptor)
 PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, file, const FileDescriptor*)
 PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, number, int)
 PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, is_extension, bool)
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, label, FieldDescriptor::Label)
 PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, containing_type, const Descriptor*)
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, containing_oneof,
-                         const OneofDescriptor*)
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, index_in_oneof, int)
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, extension_scope, const Descriptor*)
 PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FieldDescriptor, FieldOptions)
 PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_default_value, bool)
 PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_json_name, bool)
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int32 , int32 )
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int64 , int64 )
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint32, uint32)
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint64, uint64)
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_float , float )
+PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int32_t, int32_t)
+PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int64_t, int64_t)
+PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint32_t, uint32_t)
+PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint64_t, uint64_t)
+PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_float, float)
 PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_double, double)
-PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_bool  , bool  )
+PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_bool, bool)
 PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, default_value_string)
 
-PROTOBUF_DEFINE_STRING_ACCESSOR(OneofDescriptor, name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(OneofDescriptor, full_name)
+PROTOBUF_DEFINE_NAME_ACCESSOR(OneofDescriptor)
 PROTOBUF_DEFINE_ACCESSOR(OneofDescriptor, containing_type, const Descriptor*)
 PROTOBUF_DEFINE_ACCESSOR(OneofDescriptor, field_count, int)
+PROTOBUF_DEFINE_ARRAY_ACCESSOR(OneofDescriptor, field, const FieldDescriptor*)
 PROTOBUF_DEFINE_OPTIONS_ACCESSOR(OneofDescriptor, OneofOptions)
 
-PROTOBUF_DEFINE_STRING_ACCESSOR(EnumDescriptor, name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(EnumDescriptor, full_name)
+PROTOBUF_DEFINE_NAME_ACCESSOR(EnumDescriptor)
 PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, file, const FileDescriptor*)
 PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, containing_type, const Descriptor*)
 PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, value_count, int)
@@ -1908,22 +2141,19 @@ 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)
+PROTOBUF_DEFINE_NAME_ACCESSOR(EnumValueDescriptor)
 PROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, number, int)
 PROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, type, const EnumDescriptor*)
 PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumValueDescriptor, EnumValueOptions)
 
-PROTOBUF_DEFINE_STRING_ACCESSOR(ServiceDescriptor, name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(ServiceDescriptor, full_name)
+PROTOBUF_DEFINE_NAME_ACCESSOR(ServiceDescriptor)
 PROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, file, const FileDescriptor*)
 PROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, method_count, int)
 PROTOBUF_DEFINE_ARRAY_ACCESSOR(ServiceDescriptor, method,
                                const MethodDescriptor*)
 PROTOBUF_DEFINE_OPTIONS_ACCESSOR(ServiceDescriptor, ServiceOptions)
 
-PROTOBUF_DEFINE_STRING_ACCESSOR(MethodDescriptor, name)
-PROTOBUF_DEFINE_STRING_ACCESSOR(MethodDescriptor, full_name)
+PROTOBUF_DEFINE_NAME_ACCESSOR(MethodDescriptor)
 PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, service, const ServiceDescriptor*)
 PROTOBUF_DEFINE_OPTIONS_ACCESSOR(MethodDescriptor, MethodOptions)
 PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, client_streaming, bool)
@@ -1955,17 +2185,21 @@ PROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, extension,
 
 // A few accessors differ from the macros...
 
+inline Descriptor::WellKnownType Descriptor::well_known_type() const {
+  return static_cast<Descriptor::WellKnownType>(well_known_type_);
+}
+
 inline bool Descriptor::IsExtensionNumber(int number) const {
-  return FindExtensionRangeContainingNumber(number) != NULL;
+  return FindExtensionRangeContainingNumber(number) != nullptr;
 }
 
 inline bool Descriptor::IsReservedNumber(int number) const {
-  return FindReservedRangeContainingNumber(number) != NULL;
+  return FindReservedRangeContainingNumber(number) != nullptr;
 }
 
-inline bool Descriptor::IsReservedName(const string& name) const {
+inline bool Descriptor::IsReservedName(ConstStringParam name) const {
   for (int i = 0; i < reserved_name_count(); i++) {
-    if (name == reserved_name(i)) {
+    if (name == static_cast<ConstStringParam>(reserved_name(i))) {
       return true;
     }
   }
@@ -1974,17 +2208,17 @@ inline bool Descriptor::IsReservedName(const string& name) const {
 
 // 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& Descriptor::reserved_name(int index) const {
+inline const std::string& Descriptor::reserved_name(int index) const {
   return *reserved_names_[index];
 }
 
 inline bool EnumDescriptor::IsReservedNumber(int number) const {
-  return FindReservedRangeContainingNumber(number) != NULL;
+  return FindReservedRangeContainingNumber(number) != nullptr;
 }
 
-inline bool EnumDescriptor::IsReservedName(const string& name) const {
+inline bool EnumDescriptor::IsReservedName(ConstStringParam name) const {
   for (int i = 0; i < reserved_name_count(); i++) {
-    if (name == reserved_name(i)) {
+    if (name == static_cast<ConstStringParam>(reserved_name(i))) {
       return true;
     }
   }
@@ -1993,15 +2227,45 @@ inline bool EnumDescriptor::IsReservedName(const string& name) const {
 
 // 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 {
+inline const std::string& EnumDescriptor::reserved_name(int index) const {
   return *reserved_names_[index];
 }
 
+inline const std::string& FieldDescriptor::lowercase_name() const {
+  return all_names_[lowercase_name_index_];
+}
+
+inline const std::string& FieldDescriptor::camelcase_name() const {
+  return all_names_[camelcase_name_index_];
+}
+
+inline const std::string& FieldDescriptor::json_name() const {
+  return all_names_[json_name_index_];
+}
+
+inline const OneofDescriptor* FieldDescriptor::containing_oneof() const {
+  return is_oneof_ ? scope_.containing_oneof : nullptr;
+}
+
+inline int FieldDescriptor::index_in_oneof() const {
+  GOOGLE_DCHECK(is_oneof_);
+  return static_cast<int>(this - scope_.containing_oneof->field(0));
+}
+
+inline const Descriptor* FieldDescriptor::extension_scope() const {
+  GOOGLE_CHECK(is_extension_);
+  return scope_.extension_scope;
+}
+
+inline FieldDescriptor::Label FieldDescriptor::label() const {
+  return static_cast<Label>(label_);
+}
+
 inline FieldDescriptor::Type FieldDescriptor::type() const {
   if (type_once_) {
-    type_once_->Init(&FieldDescriptor::TypeOnceInit, this);
+    internal::call_once(*type_once_, &FieldDescriptor::TypeOnceInit, this);
   }
-  return type_;
+  return static_cast<Type>(type_);
 }
 
 inline bool FieldDescriptor::is_required() const {
@@ -2024,20 +2288,37 @@ inline bool FieldDescriptor::is_map() const {
   return type() == TYPE_MESSAGE && is_map_message_type();
 }
 
+inline bool FieldDescriptor::has_optional_keyword() const {
+  return proto3_optional_ ||
+         (file()->syntax() == FileDescriptor::SYNTAX_PROTO2 && is_optional() &&
+          !containing_oneof());
+}
+
+inline const OneofDescriptor* FieldDescriptor::real_containing_oneof() const {
+  auto* oneof = containing_oneof();
+  return oneof && !oneof->is_synthetic() ? oneof : nullptr;
+}
+
+inline bool FieldDescriptor::has_presence() const {
+  if (is_repeated()) return false;
+  return cpp_type() == CPPTYPE_MESSAGE || containing_oneof() ||
+         file()->syntax() == FileDescriptor::SYNTAX_PROTO2;
+}
+
 // 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 {
   if (!is_extension_) {
     return static_cast<int>(this - containing_type()->fields_);
-  } else if (extension_scope_ != NULL) {
-    return static_cast<int>(this - extension_scope_->extensions_);
+  } else if (extension_scope() != nullptr) {
+    return static_cast<int>(this - extension_scope()->extensions_);
   } else {
     return static_cast<int>(this - file_->extensions_);
   }
 }
 
 inline int Descriptor::index() const {
-  if (containing_type_ == NULL) {
+  if (containing_type_ == nullptr) {
     return static_cast<int>(this - file_->message_types_);
   } else {
     return static_cast<int>(this - containing_type_->nested_types_);
@@ -2052,8 +2333,12 @@ inline int OneofDescriptor::index() const {
   return static_cast<int>(this - containing_type_->oneof_decls_);
 }
 
+inline bool OneofDescriptor::is_synthetic() const {
+  return field_count() == 1 && field(0)->proto3_optional_;
+}
+
 inline int EnumDescriptor::index() const {
-  if (containing_type_ == NULL) {
+  if (containing_type_ == nullptr) {
     return static_cast<int>(this - file_->enum_types_);
   } else {
     return static_cast<int>(this - containing_type_->enum_types_);
@@ -2116,22 +2401,17 @@ inline const FileDescriptor* FileDescriptor::public_dependency(
   return dependency(public_dependencies_[index]);
 }
 
-inline const FileDescriptor* FileDescriptor::weak_dependency(
-    int index) const {
+inline const FileDescriptor* FileDescriptor::weak_dependency(int index) const {
   return dependency(weak_dependencies_[index]);
 }
 
 inline FileDescriptor::Syntax FileDescriptor::syntax() const {
-  return syntax_;
-}
-
-// Can't use PROTOBUF_DEFINE_ARRAY_ACCESSOR because fields_ is actually an array
-// of pointers rather than the usual array of objects.
-inline const FieldDescriptor* OneofDescriptor::field(int index) const {
-  return fields_[index];
+  return static_cast<Syntax>(syntax_);
 }
 
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_DESCRIPTOR_H__
index ab1b499..5229e77 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class FileDescriptorSetDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorSet>
-      _instance;
-} _FileDescriptorSet_default_instance_;
-class FileDescriptorProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorProto>
-      _instance;
-} _FileDescriptorProto_default_instance_;
-class DescriptorProto_ExtensionRangeDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ExtensionRange>
-      _instance;
-} _DescriptorProto_ExtensionRange_default_instance_;
-class DescriptorProto_ReservedRangeDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ReservedRange>
-      _instance;
-} _DescriptorProto_ReservedRange_default_instance_;
-class DescriptorProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto>
-      _instance;
-} _DescriptorProto_default_instance_;
-class ExtensionRangeOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ExtensionRangeOptions>
-      _instance;
-} _ExtensionRangeOptions_default_instance_;
-class FieldDescriptorProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FieldDescriptorProto>
-      _instance;
-} _FieldDescriptorProto_default_instance_;
-class OneofDescriptorProtoDefaultTypeInternal {
- 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;
-} _EnumDescriptorProto_default_instance_;
-class EnumValueDescriptorProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<EnumValueDescriptorProto>
-      _instance;
-} _EnumValueDescriptorProto_default_instance_;
-class ServiceDescriptorProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ServiceDescriptorProto>
-      _instance;
-} _ServiceDescriptorProto_default_instance_;
-class MethodDescriptorProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<MethodDescriptorProto>
-      _instance;
-} _MethodDescriptorProto_default_instance_;
-class FileOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FileOptions>
-      _instance;
-} _FileOptions_default_instance_;
-class MessageOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<MessageOptions>
-      _instance;
-} _MessageOptions_default_instance_;
-class FieldOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FieldOptions>
-      _instance;
-} _FieldOptions_default_instance_;
-class OneofOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<OneofOptions>
-      _instance;
-} _OneofOptions_default_instance_;
-class EnumOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<EnumOptions>
-      _instance;
-} _EnumOptions_default_instance_;
-class EnumValueOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<EnumValueOptions>
-      _instance;
-} _EnumValueOptions_default_instance_;
-class ServiceOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ServiceOptions>
-      _instance;
-} _ServiceOptions_default_instance_;
-class MethodOptionsDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<MethodOptions>
-      _instance;
-} _MethodOptions_default_instance_;
-class UninterpretedOption_NamePartDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption_NamePart>
-      _instance;
-} _UninterpretedOption_NamePart_default_instance_;
-class UninterpretedOptionDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption>
-      _instance;
-} _UninterpretedOption_default_instance_;
-class SourceCodeInfo_LocationDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo_Location>
-      _instance;
-} _SourceCodeInfo_Location_default_instance_;
-class SourceCodeInfoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo>
-      _instance;
-} _SourceCodeInfo_default_instance_;
-class GeneratedCodeInfo_AnnotationDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo_Annotation>
-      _instance;
-} _GeneratedCodeInfo_Annotation_default_instance_;
-class GeneratedCodeInfoDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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();
-}
-
-void InitDefaultsFileDescriptorSet() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFileDescriptorSetImpl);
-}
-
-void InitDefaultsFileDescriptorProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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();
-}
-
-void InitDefaultsFileDescriptorProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFileDescriptorProtoImpl);
-}
-
-void InitDefaultsDescriptorProto_ExtensionRangeImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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();
-}
-
-void InitDefaultsEnumDescriptorProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumDescriptorProtoImpl);
-}
-
-void InitDefaultsEnumValueDescriptorProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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_),
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
+PROTOBUF_NAMESPACE_OPEN
+constexpr FileDescriptorSet::FileDescriptorSet(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : file_(){}
+struct FileDescriptorSetDefaultTypeInternal {
+  constexpr FileDescriptorSetDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FileDescriptorSetDefaultTypeInternal() {}
+  union {
+    FileDescriptorSet _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FileDescriptorSetDefaultTypeInternal _FileDescriptorSet_default_instance_;
+constexpr FileDescriptorProto::FileDescriptorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : dependency_()
+  , message_type_()
+  , enum_type_()
+  , service_()
+  , extension_()
+  , public_dependency_()
+  , weak_dependency_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , package_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , syntax_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , options_(nullptr)
+  , source_code_info_(nullptr){}
+struct FileDescriptorProtoDefaultTypeInternal {
+  constexpr FileDescriptorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FileDescriptorProtoDefaultTypeInternal() {}
+  union {
+    FileDescriptorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FileDescriptorProtoDefaultTypeInternal _FileDescriptorProto_default_instance_;
+constexpr DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : options_(nullptr)
+  , start_(0)
+  , end_(0){}
+struct DescriptorProto_ExtensionRangeDefaultTypeInternal {
+  constexpr DescriptorProto_ExtensionRangeDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~DescriptorProto_ExtensionRangeDefaultTypeInternal() {}
+  union {
+    DescriptorProto_ExtensionRange _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DescriptorProto_ExtensionRangeDefaultTypeInternal _DescriptorProto_ExtensionRange_default_instance_;
+constexpr DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : start_(0)
+  , end_(0){}
+struct DescriptorProto_ReservedRangeDefaultTypeInternal {
+  constexpr DescriptorProto_ReservedRangeDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~DescriptorProto_ReservedRangeDefaultTypeInternal() {}
+  union {
+    DescriptorProto_ReservedRange _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DescriptorProto_ReservedRangeDefaultTypeInternal _DescriptorProto_ReservedRange_default_instance_;
+constexpr DescriptorProto::DescriptorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : field_()
+  , nested_type_()
+  , enum_type_()
+  , extension_range_()
+  , extension_()
+  , oneof_decl_()
+  , reserved_range_()
+  , reserved_name_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , options_(nullptr){}
+struct DescriptorProtoDefaultTypeInternal {
+  constexpr DescriptorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~DescriptorProtoDefaultTypeInternal() {}
+  union {
+    DescriptorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DescriptorProtoDefaultTypeInternal _DescriptorProto_default_instance_;
+constexpr ExtensionRangeOptions::ExtensionRangeOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_(){}
+struct ExtensionRangeOptionsDefaultTypeInternal {
+  constexpr ExtensionRangeOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ExtensionRangeOptionsDefaultTypeInternal() {}
+  union {
+    ExtensionRangeOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExtensionRangeOptionsDefaultTypeInternal _ExtensionRangeOptions_default_instance_;
+constexpr FieldDescriptorProto::FieldDescriptorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , extendee_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , type_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , default_value_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , json_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , options_(nullptr)
+  , number_(0)
+  , oneof_index_(0)
+  , proto3_optional_(false)
+  , label_(1)
+
+  , type_(1)
+{}
+struct FieldDescriptorProtoDefaultTypeInternal {
+  constexpr FieldDescriptorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FieldDescriptorProtoDefaultTypeInternal() {}
+  union {
+    FieldDescriptorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FieldDescriptorProtoDefaultTypeInternal _FieldDescriptorProto_default_instance_;
+constexpr OneofDescriptorProto::OneofDescriptorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , options_(nullptr){}
+struct OneofDescriptorProtoDefaultTypeInternal {
+  constexpr OneofDescriptorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~OneofDescriptorProtoDefaultTypeInternal() {}
+  union {
+    OneofDescriptorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OneofDescriptorProtoDefaultTypeInternal _OneofDescriptorProto_default_instance_;
+constexpr EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : start_(0)
+  , end_(0){}
+struct EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal {
+  constexpr EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal() {}
+  union {
+    EnumDescriptorProto_EnumReservedRange _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal _EnumDescriptorProto_EnumReservedRange_default_instance_;
+constexpr EnumDescriptorProto::EnumDescriptorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : value_()
+  , reserved_range_()
+  , reserved_name_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , options_(nullptr){}
+struct EnumDescriptorProtoDefaultTypeInternal {
+  constexpr EnumDescriptorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~EnumDescriptorProtoDefaultTypeInternal() {}
+  union {
+    EnumDescriptorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EnumDescriptorProtoDefaultTypeInternal _EnumDescriptorProto_default_instance_;
+constexpr EnumValueDescriptorProto::EnumValueDescriptorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , options_(nullptr)
+  , number_(0){}
+struct EnumValueDescriptorProtoDefaultTypeInternal {
+  constexpr EnumValueDescriptorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~EnumValueDescriptorProtoDefaultTypeInternal() {}
+  union {
+    EnumValueDescriptorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EnumValueDescriptorProtoDefaultTypeInternal _EnumValueDescriptorProto_default_instance_;
+constexpr ServiceDescriptorProto::ServiceDescriptorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : method_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , options_(nullptr){}
+struct ServiceDescriptorProtoDefaultTypeInternal {
+  constexpr ServiceDescriptorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ServiceDescriptorProtoDefaultTypeInternal() {}
+  union {
+    ServiceDescriptorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ServiceDescriptorProtoDefaultTypeInternal _ServiceDescriptorProto_default_instance_;
+constexpr MethodDescriptorProto::MethodDescriptorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , input_type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , output_type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , options_(nullptr)
+  , client_streaming_(false)
+  , server_streaming_(false){}
+struct MethodDescriptorProtoDefaultTypeInternal {
+  constexpr MethodDescriptorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~MethodDescriptorProtoDefaultTypeInternal() {}
+  union {
+    MethodDescriptorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MethodDescriptorProtoDefaultTypeInternal _MethodDescriptorProto_default_instance_;
+constexpr FileOptions::FileOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_()
+  , java_package_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , java_outer_classname_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , go_package_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , objc_class_prefix_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , csharp_namespace_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , swift_prefix_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , php_class_prefix_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , php_namespace_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , php_metadata_namespace_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , ruby_package_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , java_multiple_files_(false)
+  , java_generate_equals_and_hash_(false)
+  , java_string_check_utf8_(false)
+  , cc_generic_services_(false)
+  , java_generic_services_(false)
+  , py_generic_services_(false)
+  , php_generic_services_(false)
+  , deprecated_(false)
+  , optimize_for_(1)
+
+  , cc_enable_arenas_(true){}
+struct FileOptionsDefaultTypeInternal {
+  constexpr FileOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FileOptionsDefaultTypeInternal() {}
+  union {
+    FileOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FileOptionsDefaultTypeInternal _FileOptions_default_instance_;
+constexpr MessageOptions::MessageOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_()
+  , message_set_wire_format_(false)
+  , no_standard_descriptor_accessor_(false)
+  , deprecated_(false)
+  , map_entry_(false){}
+struct MessageOptionsDefaultTypeInternal {
+  constexpr MessageOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~MessageOptionsDefaultTypeInternal() {}
+  union {
+    MessageOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MessageOptionsDefaultTypeInternal _MessageOptions_default_instance_;
+constexpr FieldOptions::FieldOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_()
+  , ctype_(0)
+
+  , packed_(false)
+  , lazy_(false)
+  , deprecated_(false)
+  , weak_(false)
+  , jstype_(0)
+{}
+struct FieldOptionsDefaultTypeInternal {
+  constexpr FieldOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FieldOptionsDefaultTypeInternal() {}
+  union {
+    FieldOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FieldOptionsDefaultTypeInternal _FieldOptions_default_instance_;
+constexpr OneofOptions::OneofOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_(){}
+struct OneofOptionsDefaultTypeInternal {
+  constexpr OneofOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~OneofOptionsDefaultTypeInternal() {}
+  union {
+    OneofOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OneofOptionsDefaultTypeInternal _OneofOptions_default_instance_;
+constexpr EnumOptions::EnumOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_()
+  , allow_alias_(false)
+  , deprecated_(false){}
+struct EnumOptionsDefaultTypeInternal {
+  constexpr EnumOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~EnumOptionsDefaultTypeInternal() {}
+  union {
+    EnumOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EnumOptionsDefaultTypeInternal _EnumOptions_default_instance_;
+constexpr EnumValueOptions::EnumValueOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_()
+  , deprecated_(false){}
+struct EnumValueOptionsDefaultTypeInternal {
+  constexpr EnumValueOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~EnumValueOptionsDefaultTypeInternal() {}
+  union {
+    EnumValueOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EnumValueOptionsDefaultTypeInternal _EnumValueOptions_default_instance_;
+constexpr ServiceOptions::ServiceOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_()
+  , deprecated_(false){}
+struct ServiceOptionsDefaultTypeInternal {
+  constexpr ServiceOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ServiceOptionsDefaultTypeInternal() {}
+  union {
+    ServiceOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ServiceOptionsDefaultTypeInternal _ServiceOptions_default_instance_;
+constexpr MethodOptions::MethodOptions(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : uninterpreted_option_()
+  , deprecated_(false)
+  , idempotency_level_(0)
+{}
+struct MethodOptionsDefaultTypeInternal {
+  constexpr MethodOptionsDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~MethodOptionsDefaultTypeInternal() {}
+  union {
+    MethodOptions _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MethodOptionsDefaultTypeInternal _MethodOptions_default_instance_;
+constexpr UninterpretedOption_NamePart::UninterpretedOption_NamePart(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_part_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , is_extension_(false){}
+struct UninterpretedOption_NamePartDefaultTypeInternal {
+  constexpr UninterpretedOption_NamePartDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~UninterpretedOption_NamePartDefaultTypeInternal() {}
+  union {
+    UninterpretedOption_NamePart _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT UninterpretedOption_NamePartDefaultTypeInternal _UninterpretedOption_NamePart_default_instance_;
+constexpr UninterpretedOption::UninterpretedOption(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_()
+  , identifier_value_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , string_value_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , aggregate_value_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , positive_int_value_(uint64_t{0u})
+  , negative_int_value_(int64_t{0})
+  , double_value_(0){}
+struct UninterpretedOptionDefaultTypeInternal {
+  constexpr UninterpretedOptionDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~UninterpretedOptionDefaultTypeInternal() {}
+  union {
+    UninterpretedOption _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT UninterpretedOptionDefaultTypeInternal _UninterpretedOption_default_instance_;
+constexpr SourceCodeInfo_Location::SourceCodeInfo_Location(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : path_()
+  , _path_cached_byte_size_(0)
+  , span_()
+  , _span_cached_byte_size_(0)
+  , leading_detached_comments_()
+  , leading_comments_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , trailing_comments_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct SourceCodeInfo_LocationDefaultTypeInternal {
+  constexpr SourceCodeInfo_LocationDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SourceCodeInfo_LocationDefaultTypeInternal() {}
+  union {
+    SourceCodeInfo_Location _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SourceCodeInfo_LocationDefaultTypeInternal _SourceCodeInfo_Location_default_instance_;
+constexpr SourceCodeInfo::SourceCodeInfo(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : location_(){}
+struct SourceCodeInfoDefaultTypeInternal {
+  constexpr SourceCodeInfoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SourceCodeInfoDefaultTypeInternal() {}
+  union {
+    SourceCodeInfo _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SourceCodeInfoDefaultTypeInternal _SourceCodeInfo_default_instance_;
+constexpr GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : path_()
+  , _path_cached_byte_size_(0)
+  , source_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , begin_(0)
+  , end_(0){}
+struct GeneratedCodeInfo_AnnotationDefaultTypeInternal {
+  constexpr GeneratedCodeInfo_AnnotationDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~GeneratedCodeInfo_AnnotationDefaultTypeInternal() {}
+  union {
+    GeneratedCodeInfo_Annotation _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GeneratedCodeInfo_AnnotationDefaultTypeInternal _GeneratedCodeInfo_Annotation_default_instance_;
+constexpr GeneratedCodeInfo::GeneratedCodeInfo(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : annotation_(){}
+struct GeneratedCodeInfoDefaultTypeInternal {
+  constexpr GeneratedCodeInfoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~GeneratedCodeInfoDefaultTypeInternal() {}
+  union {
+    GeneratedCodeInfo _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GeneratedCodeInfoDefaultTypeInternal _GeneratedCodeInfo_default_instance_;
+PROTOBUF_NAMESPACE_CLOSE
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[27];
+static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[6];
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fdescriptor_2eproto = nullptr;
+
+const uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorSet, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorSet, file_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, _internal_metadata_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorSet, file_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, package_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, dependency_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, public_dependency_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, weak_dependency_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, message_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, enum_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, service_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, extension_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, options_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, source_code_info_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, syntax_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, package_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, dependency_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, public_dependency_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, weak_dependency_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, message_type_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, enum_type_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, service_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, extension_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, options_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, source_code_info_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto, syntax_),
   0,
   1,
   ~0u,
@@ -801,41 +491,44 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   3,
   4,
   2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, start_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, end_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, options_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange, start_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange, end_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange, options_),
   1,
   2,
   0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ReservedRange, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ReservedRange, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ReservedRange, start_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ReservedRange, end_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange, start_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange, end_),
   0,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, field_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, extension_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, nested_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, enum_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, extension_range_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, oneof_decl_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, options_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, reserved_range_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, reserved_name_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, field_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, extension_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, nested_type_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, enum_type_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, extension_range_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, oneof_decl_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, options_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, reserved_range_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::DescriptorProto, reserved_name_),
   0,
   ~0u,
   ~0u,
@@ -846,180 +539,196 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   1,
   ~0u,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _extensions_),
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, uninterpreted_option_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, _internal_metadata_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions, uninterpreted_option_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, number_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, label_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, type_name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, extendee_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, default_value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, oneof_index_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, json_name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, options_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, number_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, label_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, type_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, type_name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, extendee_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, default_value_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, oneof_index_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, json_name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, options_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto, proto3_optional_),
   0,
   6,
-  8,
   9,
+  10,
   2,
   1,
   3,
   7,
   4,
   5,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofDescriptorProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofDescriptorProto, _internal_metadata_),
+  8,
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofDescriptorProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofDescriptorProto, options_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto, options_),
   0,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto_EnumReservedRange, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto_EnumReservedRange, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto_EnumReservedRange, start_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto_EnumReservedRange, end_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange, start_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::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_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::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_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto, value_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto, options_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto, reserved_range_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto, reserved_name_),
   0,
   ~0u,
   1,
   ~0u,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, number_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, options_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto, number_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto, options_),
   0,
   2,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, method_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, options_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto, method_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto, options_),
   0,
   ~0u,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, input_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, output_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, options_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, client_streaming_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, server_streaming_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto, input_type_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto, output_type_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto, options_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto, client_streaming_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto, server_streaming_),
   0,
   1,
   2,
   3,
   4,
   5,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, _extensions_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_package_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_outer_classname_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_multiple_files_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_generate_equals_and_hash_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_string_check_utf8_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, optimize_for_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, go_package_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, cc_generic_services_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_generic_services_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, py_generic_services_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_generic_services_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, deprecated_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, cc_enable_arenas_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, objc_class_prefix_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, csharp_namespace_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, swift_prefix_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_class_prefix_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_namespace_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, uninterpreted_option_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, java_package_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, java_outer_classname_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, java_multiple_files_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, java_generate_equals_and_hash_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, java_string_check_utf8_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, optimize_for_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, go_package_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, cc_generic_services_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, java_generic_services_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, py_generic_services_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, php_generic_services_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, deprecated_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, cc_enable_arenas_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, objc_class_prefix_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, csharp_namespace_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, swift_prefix_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, php_class_prefix_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, php_namespace_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, php_metadata_namespace_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, ruby_package_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FileOptions, uninterpreted_option_),
   0,
   1,
-  9,
   10,
   11,
-  17,
-  2,
   12,
+  18,
+  2,
   13,
   14,
   15,
   16,
-  8,
+  17,
+  19,
   3,
   4,
   5,
   6,
   7,
+  8,
+  9,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, _extensions_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MessageOptions, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MessageOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MessageOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, message_set_wire_format_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, no_standard_descriptor_accessor_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, deprecated_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, map_entry_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, uninterpreted_option_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MessageOptions, message_set_wire_format_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MessageOptions, no_standard_descriptor_accessor_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MessageOptions, deprecated_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MessageOptions, map_entry_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MessageOptions, uninterpreted_option_),
   0,
   1,
   2,
   3,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, _extensions_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, ctype_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, packed_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, jstype_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, lazy_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, deprecated_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, weak_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, uninterpreted_option_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, ctype_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, packed_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, jstype_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, lazy_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, deprecated_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, weak_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::FieldOptions, uninterpreted_option_),
   0,
   1,
   5,
@@ -1027,74 +736,80 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   3,
   4,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofOptions, _extensions_),
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::OneofOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::OneofOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofOptions, uninterpreted_option_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, _extensions_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::OneofOptions, uninterpreted_option_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumOptions, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, allow_alias_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, deprecated_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, uninterpreted_option_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumOptions, allow_alias_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumOptions, deprecated_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumOptions, uninterpreted_option_),
   0,
   1,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _extensions_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueOptions, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, deprecated_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, uninterpreted_option_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueOptions, deprecated_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::EnumValueOptions, uninterpreted_option_),
   0,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, _extensions_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceOptions, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, deprecated_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, uninterpreted_option_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceOptions, deprecated_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::ServiceOptions, uninterpreted_option_),
   0,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, _internal_metadata_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, _extensions_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodOptions, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodOptions, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodOptions, _extensions_),
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, deprecated_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, idempotency_level_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, uninterpreted_option_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodOptions, deprecated_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodOptions, idempotency_level_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::MethodOptions, uninterpreted_option_),
   0,
   1,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, name_part_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, is_extension_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart, name_part_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart, is_extension_),
   0,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, identifier_value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, positive_int_value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, negative_int_value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, double_value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, string_value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, aggregate_value_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, name_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, identifier_value_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, positive_int_value_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, negative_int_value_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, double_value_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, string_value_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::UninterpretedOption, aggregate_value_),
   ~0u,
   0,
   3,
@@ -1102,304 +817,282 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   5,
   1,
   2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, path_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, span_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, leading_comments_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, trailing_comments_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, leading_detached_comments_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location, path_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location, span_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location, leading_comments_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location, trailing_comments_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location, leading_detached_comments_),
   ~0u,
   ~0u,
   0,
   1,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo, _internal_metadata_),
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo, location_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, _internal_metadata_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo, location_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, path_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, source_file_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, begin_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, end_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation, path_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation, source_file_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation, begin_),
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation, end_),
   ~0u,
   0,
   1,
   2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo, _internal_metadata_),
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo, annotation_),
-  ~0u,
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo, annotation_),
 };
-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 const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::FileDescriptorSet)},
+  { 7, 25, -1, sizeof(::PROTOBUF_NAMESPACE_ID::FileDescriptorProto)},
+  { 37, 46, -1, sizeof(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange)},
+  { 49, 57, -1, sizeof(::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange)},
+  { 59, 75, -1, sizeof(::PROTOBUF_NAMESPACE_ID::DescriptorProto)},
+  { 85, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions)},
+  { 92, 109, -1, sizeof(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto)},
+  { 120, 128, -1, sizeof(::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto)},
+  { 130, 138, -1, sizeof(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange)},
+  { 140, 151, -1, sizeof(::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto)},
+  { 156, 165, -1, sizeof(::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto)},
+  { 168, 177, -1, sizeof(::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto)},
+  { 180, 192, -1, sizeof(::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto)},
+  { 198, 225, -1, sizeof(::PROTOBUF_NAMESPACE_ID::FileOptions)},
+  { 246, 257, -1, sizeof(::PROTOBUF_NAMESPACE_ID::MessageOptions)},
+  { 262, 275, -1, sizeof(::PROTOBUF_NAMESPACE_ID::FieldOptions)},
+  { 282, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::OneofOptions)},
+  { 289, 298, -1, sizeof(::PROTOBUF_NAMESPACE_ID::EnumOptions)},
+  { 301, 309, -1, sizeof(::PROTOBUF_NAMESPACE_ID::EnumValueOptions)},
+  { 311, 319, -1, sizeof(::PROTOBUF_NAMESPACE_ID::ServiceOptions)},
+  { 321, 330, -1, sizeof(::PROTOBUF_NAMESPACE_ID::MethodOptions)},
+  { 333, 341, -1, sizeof(::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart)},
+  { 343, 356, -1, sizeof(::PROTOBUF_NAMESPACE_ID::UninterpretedOption)},
+  { 363, 374, -1, sizeof(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location)},
+  { 379, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo)},
+  { 386, 396, -1, sizeof(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation)},
+  { 400, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  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_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_FileDescriptorSet_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_FileDescriptorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_DescriptorProto_ExtensionRange_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_DescriptorProto_ReservedRange_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_DescriptorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_ExtensionRangeOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_FieldDescriptorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_OneofDescriptorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_EnumDescriptorProto_EnumReservedRange_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_EnumDescriptorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_EnumValueDescriptorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_ServiceDescriptorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_MethodDescriptorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_FileOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_MessageOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_FieldOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_OneofOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_EnumOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_EnumValueOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_ServiceOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_MethodOptions_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_UninterpretedOption_NamePart_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_UninterpretedOption_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_SourceCodeInfo_Location_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_SourceCodeInfo_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_GeneratedCodeInfo_Annotation_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::PROTOBUF_NAMESPACE_ID::_GeneratedCodeInfo_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/descriptor.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, file_level_enum_descriptors, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 27);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n google/protobuf/descriptor.proto\022\017goog"
-      "le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file"
-      "\030\001 \003(\0132$.google.protobuf.FileDescriptorP"
-      "roto\"\333\003\n\023FileDescriptorProto\022\014\n\004name\030\001 \001"
-      "(\t\022\017\n\007package\030\002 \001(\t\022\022\n\ndependency\030\003 \003(\t\022"
-      "\031\n\021public_dependency\030\n \003(\005\022\027\n\017weak_depen"
-      "dency\030\013 \003(\005\0226\n\014message_type\030\004 \003(\0132 .goog"
-      "le.protobuf.DescriptorProto\0227\n\tenum_type"
-      "\030\005 \003(\0132$.google.protobuf.EnumDescriptorP"
-      "roto\0228\n\007service\030\006 \003(\0132\'.google.protobuf."
-      "ServiceDescriptorProto\0228\n\textension\030\007 \003("
-      "\0132%.google.protobuf.FieldDescriptorProto"
-      "\022-\n\007options\030\010 \001(\0132\034.google.protobuf.File"
-      "Options\0229\n\020source_code_info\030\t \001(\0132\037.goog"
-      "le.protobuf.SourceCodeInfo\022\016\n\006syntax\030\014 \001"
-      "(\t\"\251\005\n\017DescriptorProto\022\014\n\004name\030\001 \001(\t\0224\n\005"
-      "field\030\002 \003(\0132%.google.protobuf.FieldDescr"
-      "iptorProto\0228\n\textension\030\006 \003(\0132%.google.p"
-      "rotobuf.FieldDescriptorProto\0225\n\013nested_t"
-      "ype\030\003 \003(\0132 .google.protobuf.DescriptorPr"
-      "oto\0227\n\tenum_type\030\004 \003(\0132$.google.protobuf"
-      ".EnumDescriptorProto\022H\n\017extension_range\030"
-      "\005 \003(\0132/.google.protobuf.DescriptorProto."
-      "ExtensionRange\0229\n\noneof_decl\030\010 \003(\0132%.goo"
-      "gle.protobuf.OneofDescriptorProto\0220\n\007opt"
-      "ions\030\007 \001(\0132\037.google.protobuf.MessageOpti"
-      "ons\022F\n\016reserved_range\030\t \003(\0132..google.pro"
-      "tobuf.DescriptorProto.ReservedRange\022\025\n\rr"
-      "eserved_name\030\n \003(\t\032e\n\016ExtensionRange\022\r\n\005"
-      "start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\0227\n\007options\030\003 \001("
-      "\0132&.google.protobuf.ExtensionRangeOption"
-      "s\032+\n\rReservedRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end"
-      "\030\002 \001(\005\"g\n\025ExtensionRangeOptions\022C\n\024unint"
-      "erpreted_option\030\347\007 \003(\0132$.google.protobuf"
-      ".UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\274\005\n\024Fiel"
-      "dDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n\006number"
-      "\030\003 \001(\005\022:\n\005label\030\004 \001(\0162+.google.protobuf."
-      "FieldDescriptorProto.Label\0228\n\004type\030\005 \001(\016"
-      "2*.google.protobuf.FieldDescriptorProto."
-      "Type\022\021\n\ttype_name\030\006 \001(\t\022\020\n\010extendee\030\002 \001("
-      "\t\022\025\n\rdefault_value\030\007 \001(\t\022\023\n\013oneof_index\030"
-      "\t \001(\005\022\021\n\tjson_name\030\n \001(\t\022.\n\007options\030\010 \001("
-      "\0132\035.google.protobuf.FieldOptions\"\266\002\n\004Typ"
-      "e\022\017\n\013TYPE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTY"
-      "PE_INT64\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT3"
-      "2\020\005\022\020\n\014TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022"
-      "\r\n\tTYPE_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_"
-      "GROUP\020\n\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020"
-      "\014\022\017\n\013TYPE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYP"
-      "E_SFIXED32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_"
-      "SINT32\020\021\022\017\n\013TYPE_SINT64\020\022\"C\n\005Label\022\022\n\016LA"
-      "BEL_OPTIONAL\020\001\022\022\n\016LABEL_REQUIRED\020\002\022\022\n\016LA"
-      "BEL_REPEATED\020\003\"T\n\024OneofDescriptorProto\022\014"
-      "\n\004name\030\001 \001(\t\022.\n\007options\030\002 \001(\0132\035.google.p"
-      "rotobuf.OneofOptions\"\244\002\n\023EnumDescriptorP"
-      "roto\022\014\n\004name\030\001 \001(\t\0228\n\005value\030\002 \003(\0132).goog"
-      "le.protobuf.EnumValueDescriptorProto\022-\n\007"
-      "options\030\003 \001(\0132\034.google.protobuf.EnumOpti"
-      "ons\022N\n\016reserved_range\030\004 \003(\01326.google.pro"
-      "tobuf.EnumDescriptorProto.EnumReservedRa"
-      "nge\022\025\n\rreserved_name\030\005 \003(\t\032/\n\021EnumReserv"
-      "edRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\"l\n\030E"
-      "numValueDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n"
-      "\006number\030\002 \001(\005\0222\n\007options\030\003 \001(\0132!.google."
-      "protobuf.EnumValueOptions\"\220\001\n\026ServiceDes"
-      "criptorProto\022\014\n\004name\030\001 \001(\t\0226\n\006method\030\002 \003"
-      "(\0132&.google.protobuf.MethodDescriptorPro"
-      "to\0220\n\007options\030\003 \001(\0132\037.google.protobuf.Se"
-      "rviceOptions\"\301\001\n\025MethodDescriptorProto\022\014"
-      "\n\004name\030\001 \001(\t\022\022\n\ninput_type\030\002 \001(\t\022\023\n\013outp"
-      "ut_type\030\003 \001(\t\022/\n\007options\030\004 \001(\0132\036.google."
-      "protobuf.MethodOptions\022\037\n\020client_streami"
-      "ng\030\005 \001(\010:\005false\022\037\n\020server_streaming\030\006 \001("
-      "\010:\005false\"\360\005\n\013FileOptions\022\024\n\014java_package"
-      "\030\001 \001(\t\022\034\n\024java_outer_classname\030\010 \001(\t\022\"\n\023"
-      "java_multiple_files\030\n \001(\010:\005false\022)\n\035java"
-      "_generate_equals_and_hash\030\024 \001(\010B\002\030\001\022%\n\026j"
-      "ava_string_check_utf8\030\033 \001(\010:\005false\022F\n\014op"
-      "timize_for\030\t \001(\0162).google.protobuf.FileO"
-      "ptions.OptimizeMode:\005SPEED\022\022\n\ngo_package"
-      "\030\013 \001(\t\022\"\n\023cc_generic_services\030\020 \001(\010:\005fal"
-      "se\022$\n\025java_generic_services\030\021 \001(\010:\005false"
-      "\022\"\n\023py_generic_services\030\022 \001(\010:\005false\022#\n\024"
-      "php_generic_services\030* \001(\010:\005false\022\031\n\ndep"
-      "recated\030\027 \001(\010:\005false\022\037\n\020cc_enable_arenas"
-      "\030\037 \001(\010:\005false\022\031\n\021objc_class_prefix\030$ \001(\t"
-      "\022\030\n\020csharp_namespace\030% \001(\t\022\024\n\014swift_pref"
-      "ix\030\' \001(\t\022\030\n\020php_class_prefix\030( \001(\t\022\025\n\rph"
-      "p_namespace\030) \001(\t\022C\n\024uninterpreted_optio"
-      "n\030\347\007 \003(\0132$.google.protobuf.Uninterpreted"
-      "Option\":\n\014OptimizeMode\022\t\n\005SPEED\020\001\022\r\n\tCOD"
-      "E_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007\020\200\200\200\200\002J\004\010"
-      "&\020\'\"\362\001\n\016MessageOptions\022&\n\027message_set_wi"
-      "re_format\030\001 \001(\010:\005false\022.\n\037no_standard_de"
-      "scriptor_accessor\030\002 \001(\010:\005false\022\031\n\ndeprec"
-      "ated\030\003 \001(\010:\005false\022\021\n\tmap_entry\030\007 \001(\010\022C\n\024"
-      "uninterpreted_option\030\347\007 \003(\0132$.google.pro"
-      "tobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\010"
-      "\020\tJ\004\010\t\020\n\"\236\003\n\014FieldOptions\022:\n\005ctype\030\001 \001(\016"
-      "2#.google.protobuf.FieldOptions.CType:\006S"
-      "TRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006jstype\030\006 \001(\0162$."
-      "google.protobuf.FieldOptions.JSType:\tJS_"
-      "NORMAL\022\023\n\004lazy\030\005 \001(\010:\005false\022\031\n\ndeprecate"
-      "d\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001(\010:\005false\022C\n\024u"
-      "ninterpreted_option\030\347\007 \003(\0132$.google.prot"
-      "obuf.UninterpretedOption\"/\n\005CType\022\n\n\006STR"
-      "ING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE\020\002\"5\n\006JST"
-      "ype\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_STRING\020\001\022\r\n\tJS_"
-      "NUMBER\020\002*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005\"^\n\014OneofOption"
-      "s\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.googl"
-      "e.protobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200"
-      "\002\"\223\001\n\013EnumOptions\022\023\n\013allow_alias\030\002 \001(\010\022\031"
-      "\n\ndeprecated\030\003 \001(\010:\005false\022C\n\024uninterpret"
-      "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint"
-      "erpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006\"}\n\020EnumV"
-      "alueOptions\022\031\n\ndeprecated\030\001 \001(\010:\005false\022C"
-      "\n\024uninterpreted_option\030\347\007 \003(\0132$.google.p"
-      "rotobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"{"
-      "\n\016ServiceOptions\022\031\n\ndeprecated\030! \001(\010:\005fa"
-      "lse\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goo"
-      "gle.protobuf.UninterpretedOption*\t\010\350\007\020\200\200"
-      "\200\200\002\"\255\002\n\rMethodOptions\022\031\n\ndeprecated\030! \001("
-      "\010:\005false\022_\n\021idempotency_level\030\" \001(\0162/.go"
-      "ogle.protobuf.MethodOptions.IdempotencyL"
-      "evel:\023IDEMPOTENCY_UNKNOWN\022C\n\024uninterpret"
-      "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint"
-      "erpretedOption\"P\n\020IdempotencyLevel\022\027\n\023ID"
-      "EMPOTENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_EFFECTS\020\001"
-      "\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023Uninterp"
-      "retedOption\022;\n\004name\030\002 \003(\0132-.google.proto"
-      "buf.UninterpretedOption.NamePart\022\030\n\020iden"
-      "tifier_value\030\003 \001(\t\022\032\n\022positive_int_value"
-      "\030\004 \001(\004\022\032\n\022negative_int_value\030\005 \001(\003\022\024\n\014do"
-      "uble_value\030\006 \001(\001\022\024\n\014string_value\030\007 \001(\014\022\027"
-      "\n\017aggregate_value\030\010 \001(\t\0323\n\010NamePart\022\021\n\tn"
-      "ame_part\030\001 \002(\t\022\024\n\014is_extension\030\002 \002(\010\"\325\001\n"
-      "\016SourceCodeInfo\022:\n\010location\030\001 \003(\0132(.goog"
-      "le.protobuf.SourceCodeInfo.Location\032\206\001\n\010"
-      "Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005"
-      "B\002\020\001\022\030\n\020leading_comments\030\003 \001(\t\022\031\n\021traili"
-      "ng_comments\030\004 \001(\t\022!\n\031leading_detached_co"
-      "mments\030\006 \003(\t\"\247\001\n\021GeneratedCodeInfo\022A\n\nan"
-      "notation\030\001 \003(\0132-.google.protobuf.Generat"
-      "edCodeInfo.Annotation\032O\n\nAnnotation\022\020\n\004p"
-      "ath\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005be"
-      "gin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005B\217\001\n\023com.google.pr"
-      "otobufB\020DescriptorProtosH\001Z>github.com/g"
-      "olang/protobuf/protoc-gen-go/descriptor;"
-      "descriptor\370\001\001\242\002\003GPB\252\002\032Google.Protobuf.Re"
-      "flection"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 5968);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/descriptor.proto", &protobuf_RegisterTypes);
+const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n google/protobuf/descriptor.proto\022\017goog"
+  "le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file"
+  "\030\001 \003(\0132$.google.protobuf.FileDescriptorP"
+  "roto\"\333\003\n\023FileDescriptorProto\022\014\n\004name\030\001 \001"
+  "(\t\022\017\n\007package\030\002 \001(\t\022\022\n\ndependency\030\003 \003(\t\022"
+  "\031\n\021public_dependency\030\n \003(\005\022\027\n\017weak_depen"
+  "dency\030\013 \003(\005\0226\n\014message_type\030\004 \003(\0132 .goog"
+  "le.protobuf.DescriptorProto\0227\n\tenum_type"
+  "\030\005 \003(\0132$.google.protobuf.EnumDescriptorP"
+  "roto\0228\n\007service\030\006 \003(\0132\'.google.protobuf."
+  "ServiceDescriptorProto\0228\n\textension\030\007 \003("
+  "\0132%.google.protobuf.FieldDescriptorProto"
+  "\022-\n\007options\030\010 \001(\0132\034.google.protobuf.File"
+  "Options\0229\n\020source_code_info\030\t \001(\0132\037.goog"
+  "le.protobuf.SourceCodeInfo\022\016\n\006syntax\030\014 \001"
+  "(\t\"\251\005\n\017DescriptorProto\022\014\n\004name\030\001 \001(\t\0224\n\005"
+  "field\030\002 \003(\0132%.google.protobuf.FieldDescr"
+  "iptorProto\0228\n\textension\030\006 \003(\0132%.google.p"
+  "rotobuf.FieldDescriptorProto\0225\n\013nested_t"
+  "ype\030\003 \003(\0132 .google.protobuf.DescriptorPr"
+  "oto\0227\n\tenum_type\030\004 \003(\0132$.google.protobuf"
+  ".EnumDescriptorProto\022H\n\017extension_range\030"
+  "\005 \003(\0132/.google.protobuf.DescriptorProto."
+  "ExtensionRange\0229\n\noneof_decl\030\010 \003(\0132%.goo"
+  "gle.protobuf.OneofDescriptorProto\0220\n\007opt"
+  "ions\030\007 \001(\0132\037.google.protobuf.MessageOpti"
+  "ons\022F\n\016reserved_range\030\t \003(\0132..google.pro"
+  "tobuf.DescriptorProto.ReservedRange\022\025\n\rr"
+  "eserved_name\030\n \003(\t\032e\n\016ExtensionRange\022\r\n\005"
+  "start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\0227\n\007options\030\003 \001("
+  "\0132&.google.protobuf.ExtensionRangeOption"
+  "s\032+\n\rReservedRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end"
+  "\030\002 \001(\005\"g\n\025ExtensionRangeOptions\022C\n\024unint"
+  "erpreted_option\030\347\007 \003(\0132$.google.protobuf"
+  ".UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\325\005\n\024Fiel"
+  "dDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n\006number"
+  "\030\003 \001(\005\022:\n\005label\030\004 \001(\0162+.google.protobuf."
+  "FieldDescriptorProto.Label\0228\n\004type\030\005 \001(\016"
+  "2*.google.protobuf.FieldDescriptorProto."
+  "Type\022\021\n\ttype_name\030\006 \001(\t\022\020\n\010extendee\030\002 \001("
+  "\t\022\025\n\rdefault_value\030\007 \001(\t\022\023\n\013oneof_index\030"
+  "\t \001(\005\022\021\n\tjson_name\030\n \001(\t\022.\n\007options\030\010 \001("
+  "\0132\035.google.protobuf.FieldOptions\022\027\n\017prot"
+  "o3_optional\030\021 \001(\010\"\266\002\n\004Type\022\017\n\013TYPE_DOUBL"
+  "E\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTYPE_INT64\020\003\022\017\n\013T"
+  "YPE_UINT64\020\004\022\016\n\nTYPE_INT32\020\005\022\020\n\014TYPE_FIX"
+  "ED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022\r\n\tTYPE_BOOL\020\010\022"
+  "\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_GROUP\020\n\022\020\n\014TYPE"
+  "_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020\014\022\017\n\013TYPE_UINT3"
+  "2\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYPE_SFIXED32\020\017\022\021\n"
+  "\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_SINT32\020\021\022\017\n\013TYP"
+  "E_SINT64\020\022\"C\n\005Label\022\022\n\016LABEL_OPTIONAL\020\001\022"
+  "\022\n\016LABEL_REQUIRED\020\002\022\022\n\016LABEL_REPEATED\020\003\""
+  "T\n\024OneofDescriptorProto\022\014\n\004name\030\001 \001(\t\022.\n"
+  "\007options\030\002 \001(\0132\035.google.protobuf.OneofOp"
+  "tions\"\244\002\n\023EnumDescriptorProto\022\014\n\004name\030\001 "
+  "\001(\t\0228\n\005value\030\002 \003(\0132).google.protobuf.Enu"
+  "mValueDescriptorProto\022-\n\007options\030\003 \001(\0132\034"
+  ".google.protobuf.EnumOptions\022N\n\016reserved"
+  "_range\030\004 \003(\01326.google.protobuf.EnumDescr"
+  "iptorProto.EnumReservedRange\022\025\n\rreserved"
+  "_name\030\005 \003(\t\032/\n\021EnumReservedRange\022\r\n\005star"
+  "t\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\"l\n\030EnumValueDescrip"
+  "torProto\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.EnumVa"
+  "lueOptions\"\220\001\n\026ServiceDescriptorProto\022\014\n"
+  "\004name\030\001 \001(\t\0226\n\006method\030\002 \003(\0132&.google.pro"
+  "tobuf.MethodDescriptorProto\0220\n\007options\030\003"
+  " \001(\0132\037.google.protobuf.ServiceOptions\"\301\001"
+  "\n\025MethodDescriptorProto\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.Method"
+  "Options\022\037\n\020client_streaming\030\005 \001(\010:\005false"
+  "\022\037\n\020server_streaming\030\006 \001(\010:\005false\"\245\006\n\013Fi"
+  "leOptions\022\024\n\014java_package\030\001 \001(\t\022\034\n\024java_"
+  "outer_classname\030\010 \001(\t\022\"\n\023java_multiple_f"
+  "iles\030\n \001(\010:\005false\022)\n\035java_generate_equal"
+  "s_and_hash\030\024 \001(\010B\002\030\001\022%\n\026java_string_chec"
+  "k_utf8\030\033 \001(\010:\005false\022F\n\014optimize_for\030\t \001("
+  "\0162).google.protobuf.FileOptions.Optimize"
+  "Mode:\005SPEED\022\022\n\ngo_package\030\013 \001(\t\022\"\n\023cc_ge"
+  "neric_services\030\020 \001(\010:\005false\022$\n\025java_gene"
+  "ric_services\030\021 \001(\010:\005false\022\"\n\023py_generic_"
+  "services\030\022 \001(\010:\005false\022#\n\024php_generic_ser"
+  "vices\030* \001(\010:\005false\022\031\n\ndeprecated\030\027 \001(\010:\005"
+  "false\022\036\n\020cc_enable_arenas\030\037 \001(\010:\004true\022\031\n"
+  "\021objc_class_prefix\030$ \001(\t\022\030\n\020csharp_names"
+  "pace\030% \001(\t\022\024\n\014swift_prefix\030\' \001(\t\022\030\n\020php_"
+  "class_prefix\030( \001(\t\022\025\n\rphp_namespace\030) \001("
+  "\t\022\036\n\026php_metadata_namespace\030, \001(\t\022\024\n\014rub"
+  "y_package\030- \001(\t\022C\n\024uninterpreted_option\030"
+  "\347\007 \003(\0132$.google.protobuf.UninterpretedOp"
+  "tion\":\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"
+  "\'\"\204\002\n\016MessageOptions\022&\n\027message_set_wire"
+  "_format\030\001 \001(\010:\005false\022.\n\037no_standard_desc"
+  "riptor_accessor\030\002 \001(\010:\005false\022\031\n\ndeprecat"
+  "ed\030\003 \001(\010:\005false\022\021\n\tmap_entry\030\007 \001(\010\022C\n\024un"
+  "interpreted_option\030\347\007 \003(\0132$.google.proto"
+  "buf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005"
+  "J\004\010\005\020\006J\004\010\006\020\007J\004\010\010\020\tJ\004\010\t\020\n\"\236\003\n\014FieldOption"
+  "s\022:\n\005ctype\030\001 \001(\0162#.google.protobuf.Field"
+  "Options.CType:\006STRING\022\016\n\006packed\030\002 \001(\010\022\?\n"
+  "\006jstype\030\006 \001(\0162$.google.protobuf.FieldOpt"
+  "ions.JSType:\tJS_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005fa"
+  "lse\022\031\n\ndeprecated\030\003 \001(\010:\005false\022\023\n\004weak\030\n"
+  " \001(\010:\005false\022C\n\024uninterpreted_option\030\347\007 \003"
+  "(\0132$.google.protobuf.UninterpretedOption"
+  "\"/\n\005CType\022\n\n\006STRING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRIN"
+  "G_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\014OneofOptions\022C\n\024uninterpreted_optio"
+  "n\030\347\007 \003(\0132$.google.protobuf.Uninterpreted"
+  "Option*\t\010\350\007\020\200\200\200\200\002\"\223\001\n\013EnumOptions\022\023\n\013all"
+  "ow_alias\030\002 \001(\010\022\031\n\ndeprecated\030\003 \001(\010:\005fals"
+  "e\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.googl"
+  "e.protobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200"
+  "\002J\004\010\005\020\006\"}\n\020EnumValueOptions\022\031\n\ndeprecate"
+  "d\030\001 \001(\010:\005false\022C\n\024uninterpreted_option\030\347"
+  "\007 \003(\0132$.google.protobuf.UninterpretedOpt"
+  "ion*\t\010\350\007\020\200\200\200\200\002\"{\n\016ServiceOptions\022\031\n\ndepr"
+  "ecated\030! \001(\010:\005false\022C\n\024uninterpreted_opt"
+  "ion\030\347\007 \003(\0132$.google.protobuf.Uninterpret"
+  "edOption*\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/.google.protobuf.MethodOpti"
+  "ons.IdempotencyLevel:\023IDEMPOTENCY_UNKNOW"
+  "N\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.googl"
+  "e.protobuf.UninterpretedOption\"P\n\020Idempo"
+  "tencyLevel\022\027\n\023IDEMPOTENCY_UNKNOWN\020\000\022\023\n\017N"
+  "O_SIDE_EFFECTS\020\001\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200"
+  "\200\200\002\"\236\002\n\023UninterpretedOption\022;\n\004name\030\002 \003("
+  "\0132-.google.protobuf.UninterpretedOption."
+  "NamePart\022\030\n\020identifier_value\030\003 \001(\t\022\032\n\022po"
+  "sitive_int_value\030\004 \001(\004\022\032\n\022negative_int_v"
+  "alue\030\005 \001(\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014stri"
+  "ng_value\030\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\032"
+  "3\n\010NamePart\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_ext"
+  "ension\030\002 \002(\010\"\325\001\n\016SourceCodeInfo\022:\n\010locat"
+  "ion\030\001 \003(\0132(.google.protobuf.SourceCodeIn"
+  "fo.Location\032\206\001\n\010Location\022\020\n\004path\030\001 \003(\005B\002"
+  "\020\001\022\020\n\004span\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\031lea"
+  "ding_detached_comments\030\006 \003(\t\"\247\001\n\021Generat"
+  "edCodeInfo\022A\n\nannotation\030\001 \003(\0132-.google."
+  "protobuf.GeneratedCodeInfo.Annotation\032O\n"
+  "\nAnnotation\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~"
+  "\n\023com.google.protobufB\020DescriptorProtosH"
+  "\001Z-google.golang.org/protobuf/types/desc"
+  "riptorpb\370\001\001\242\002\003GPB\252\002\032Google.Protobuf.Refl"
+  "ection"
+  ;
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto = {
+  false, false, 6046, descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto, "google/protobuf/descriptor.proto", 
+  &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, nullptr, 0, 27,
+  schemas, file_default_instances, TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets,
+  file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto, file_level_service_descriptors_google_2fprotobuf_2fdescriptor_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter() {
+  return &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto;
 }
 
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto
-namespace google {
-namespace protobuf {
-const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor() {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[0];
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fdescriptor_2eproto(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto);
+PROTOBUF_NAMESPACE_OPEN
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldDescriptorProto_Type_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto);
+  return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[0];
 }
 bool FieldDescriptorProto_Type_IsValid(int value) {
   switch (value) {
@@ -1427,32 +1120,32 @@ bool FieldDescriptorProto_Type_IsValid(int value) {
   }
 }
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_DOUBLE;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FLOAT;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT64;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT64;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT32;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED64;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED32;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BOOL;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_STRING;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_GROUP;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_MESSAGE;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BYTES;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT32;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_ENUM;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED32;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED64;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT32;
-const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT64;
-const FieldDescriptorProto_Type FieldDescriptorProto::Type_MIN;
-const FieldDescriptorProto_Type FieldDescriptorProto::Type_MAX;
-const int FieldDescriptorProto::Type_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor() {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[1];
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_DOUBLE;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FLOAT;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT64;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT64;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT32;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED64;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED32;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BOOL;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_STRING;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_GROUP;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_MESSAGE;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BYTES;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT32;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_ENUM;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED32;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED64;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT32;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT64;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::Type_MIN;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto::Type_MAX;
+constexpr int FieldDescriptorProto::Type_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldDescriptorProto_Label_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto);
+  return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[1];
 }
 bool FieldDescriptorProto_Label_IsValid(int value) {
   switch (value) {
@@ -1465,17 +1158,17 @@ bool FieldDescriptorProto_Label_IsValid(int value) {
   }
 }
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_OPTIONAL;
-const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REQUIRED;
-const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REPEATED;
-const FieldDescriptorProto_Label FieldDescriptorProto::Label_MIN;
-const FieldDescriptorProto_Label FieldDescriptorProto::Label_MAX;
-const int FieldDescriptorProto::Label_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor() {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[2];
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr FieldDescriptorProto_Label FieldDescriptorProto::LABEL_OPTIONAL;
+constexpr FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REQUIRED;
+constexpr FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REPEATED;
+constexpr FieldDescriptorProto_Label FieldDescriptorProto::Label_MIN;
+constexpr FieldDescriptorProto_Label FieldDescriptorProto::Label_MAX;
+constexpr int FieldDescriptorProto::Label_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FileOptions_OptimizeMode_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto);
+  return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[2];
 }
 bool FileOptions_OptimizeMode_IsValid(int value) {
   switch (value) {
@@ -1488,17 +1181,17 @@ bool FileOptions_OptimizeMode_IsValid(int value) {
   }
 }
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const FileOptions_OptimizeMode FileOptions::SPEED;
-const FileOptions_OptimizeMode FileOptions::CODE_SIZE;
-const FileOptions_OptimizeMode FileOptions::LITE_RUNTIME;
-const FileOptions_OptimizeMode FileOptions::OptimizeMode_MIN;
-const FileOptions_OptimizeMode FileOptions::OptimizeMode_MAX;
-const int FileOptions::OptimizeMode_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor() {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[3];
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr FileOptions_OptimizeMode FileOptions::SPEED;
+constexpr FileOptions_OptimizeMode FileOptions::CODE_SIZE;
+constexpr FileOptions_OptimizeMode FileOptions::LITE_RUNTIME;
+constexpr FileOptions_OptimizeMode FileOptions::OptimizeMode_MIN;
+constexpr FileOptions_OptimizeMode FileOptions::OptimizeMode_MAX;
+constexpr int FileOptions::OptimizeMode_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldOptions_CType_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto);
+  return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[3];
 }
 bool FieldOptions_CType_IsValid(int value) {
   switch (value) {
@@ -1511,17 +1204,17 @@ bool FieldOptions_CType_IsValid(int value) {
   }
 }
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const FieldOptions_CType FieldOptions::STRING;
-const FieldOptions_CType FieldOptions::CORD;
-const FieldOptions_CType FieldOptions::STRING_PIECE;
-const FieldOptions_CType FieldOptions::CType_MIN;
-const FieldOptions_CType FieldOptions::CType_MAX;
-const int FieldOptions::CType_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor() {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[4];
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr FieldOptions_CType FieldOptions::STRING;
+constexpr FieldOptions_CType FieldOptions::CORD;
+constexpr FieldOptions_CType FieldOptions::STRING_PIECE;
+constexpr FieldOptions_CType FieldOptions::CType_MIN;
+constexpr FieldOptions_CType FieldOptions::CType_MAX;
+constexpr int FieldOptions::CType_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldOptions_JSType_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto);
+  return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[4];
 }
 bool FieldOptions_JSType_IsValid(int value) {
   switch (value) {
@@ -1534,17 +1227,17 @@ bool FieldOptions_JSType_IsValid(int value) {
   }
 }
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const FieldOptions_JSType FieldOptions::JS_NORMAL;
-const FieldOptions_JSType FieldOptions::JS_STRING;
-const FieldOptions_JSType FieldOptions::JS_NUMBER;
-const FieldOptions_JSType FieldOptions::JSType_MIN;
-const FieldOptions_JSType FieldOptions::JSType_MAX;
-const int FieldOptions::JSType_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor() {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[5];
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr FieldOptions_JSType FieldOptions::JS_NORMAL;
+constexpr FieldOptions_JSType FieldOptions::JS_STRING;
+constexpr FieldOptions_JSType FieldOptions::JS_NUMBER;
+constexpr FieldOptions_JSType FieldOptions::JSType_MIN;
+constexpr FieldOptions_JSType FieldOptions::JSType_MAX;
+constexpr int FieldOptions::JSType_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto);
+  return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[5];
 }
 bool MethodOptions_IdempotencyLevel_IsValid(int value) {
   switch (value) {
@@ -1557,178 +1250,131 @@ bool MethodOptions_IdempotencyLevel_IsValid(int value) {
   }
 }
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const MethodOptions_IdempotencyLevel MethodOptions::IDEMPOTENCY_UNKNOWN;
-const MethodOptions_IdempotencyLevel MethodOptions::NO_SIDE_EFFECTS;
-const MethodOptions_IdempotencyLevel MethodOptions::IDEMPOTENT;
-const MethodOptions_IdempotencyLevel MethodOptions::IdempotencyLevel_MIN;
-const MethodOptions_IdempotencyLevel MethodOptions::IdempotencyLevel_MAX;
-const int MethodOptions::IdempotencyLevel_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr MethodOptions_IdempotencyLevel MethodOptions::IDEMPOTENCY_UNKNOWN;
+constexpr MethodOptions_IdempotencyLevel MethodOptions::NO_SIDE_EFFECTS;
+constexpr MethodOptions_IdempotencyLevel MethodOptions::IDEMPOTENT;
+constexpr MethodOptions_IdempotencyLevel MethodOptions::IdempotencyLevel_MIN;
+constexpr MethodOptions_IdempotencyLevel MethodOptions::IdempotencyLevel_MAX;
+constexpr int MethodOptions::IdempotencyLevel_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
 
 // ===================================================================
 
-void FileDescriptorSet::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FileDescriptorSet::kFileFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class FileDescriptorSet::_Internal {
+ public:
+};
 
-FileDescriptorSet::FileDescriptorSet()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSet();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorSet)
-}
-FileDescriptorSet::FileDescriptorSet(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+FileDescriptorSet::FileDescriptorSet(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   file_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSet();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.FileDescriptorSet)
 }
 FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       file_(from.file_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorSet)
 }
 
-void FileDescriptorSet::SharedCtor() {
-  _cached_size_ = 0;
+inline void FileDescriptorSet::SharedCtor() {
 }
 
 FileDescriptorSet::~FileDescriptorSet() {
   // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorSet)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FileDescriptorSet::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void FileDescriptorSet::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void FileDescriptorSet::ArenaDtor(void* object) {
   FileDescriptorSet* _this = reinterpret_cast< FileDescriptorSet* >(object);
   (void)_this;
 }
-void FileDescriptorSet::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void FileDescriptorSet::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void FileDescriptorSet::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* FileDescriptorSet::descriptor() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const FileDescriptorSet& FileDescriptorSet::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSet();
-  return *internal_default_instance();
-}
-
-FileDescriptorSet* FileDescriptorSet::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FileDescriptorSet>(arena);
+  _cached_size_.Set(size);
 }
 
 void FileDescriptorSet::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.FileDescriptorSet)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   file_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FileDescriptorSet::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:google.protobuf.FileDescriptorSet)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* FileDescriptorSet::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .google.protobuf.FileDescriptorProto file = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_file()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_file(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.FileDescriptorSet)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.FileDescriptorSet)
-  return false;
-#undef DO_
-}
-
-void FileDescriptorSet::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.FileDescriptorSet)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .google.protobuf.FileDescriptorProto file = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->file_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->file(static_cast<int>(i)), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorSet)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* FileDescriptorSet::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* FileDescriptorSet::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorSet)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .google.protobuf.FileDescriptorProto file = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->file_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->file(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_file_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_file(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescriptorSet)
   return target;
@@ -1738,59 +1384,41 @@ size_t FileDescriptorSet::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileDescriptorSet)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.FileDescriptorProto file = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->file_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->file(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_file_size();
+  for (const auto& msg : this->file_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FileDescriptorSet::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileDescriptorSet)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FileDescriptorSet* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FileDescriptorSet>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorSet)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileDescriptorSet)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FileDescriptorSet::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FileDescriptorSet::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FileDescriptorSet::GetClassData() const { return &_class_data_; }
+
+void FileDescriptorSet::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FileDescriptorSet *>(to)->MergeFrom(
+      static_cast<const FileDescriptorSet &>(from));
 }
 
+
 void FileDescriptorSet::MergeFrom(const FileDescriptorSet& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileDescriptorSet)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   file_.MergeFrom(from.file_);
-}
-
-void FileDescriptorSet::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileDescriptorSet)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FileDescriptorSet::CopyFrom(const FileDescriptorSet& from) {
@@ -1801,111 +1429,58 @@ void FileDescriptorSet::CopyFrom(const FileDescriptorSet& from) {
 }
 
 bool FileDescriptorSet::IsInitialized() const {
-  if (!::google::protobuf::internal::AllAreInitialized(this->file())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(file_))
+    return false;
   return true;
 }
 
-void FileDescriptorSet::Swap(FileDescriptorSet* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    FileDescriptorSet* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void FileDescriptorSet::UnsafeArenaSwap(FileDescriptorSet* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void FileDescriptorSet::InternalSwap(FileDescriptorSet* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   file_.InternalSwap(&other->file_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata FileDescriptorSet::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FileDescriptorSet::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[0]);
 }
 
-
 // ===================================================================
 
-void FileDescriptorProto::InitAsDefaultInstance() {
-  ::google::protobuf::_FileDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::FileOptions*>(
-      ::google::protobuf::FileOptions::internal_default_instance());
-  ::google::protobuf::_FileDescriptorProto_default_instance_._instance.get_mutable()->source_code_info_ = const_cast< ::google::protobuf::SourceCodeInfo*>(
-      ::google::protobuf::SourceCodeInfo::internal_default_instance());
-}
-void FileDescriptorProto::_slow_mutable_options() {
-  options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::FileOptions >(
-      GetArenaNoVirtual());
-}
-void FileDescriptorProto::unsafe_arena_set_allocated_options(
-    ::google::protobuf::FileOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class FileDescriptorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<FileDescriptorProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
+  static void set_has_package(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.options)
-}
-void FileDescriptorProto::_slow_mutable_source_code_info() {
-  source_code_info_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::SourceCodeInfo >(
-      GetArenaNoVirtual());
-}
-void FileDescriptorProto::unsafe_arena_set_allocated_source_code_info(
-    ::google::protobuf::SourceCodeInfo* source_code_info) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete source_code_info_;
+  static const ::PROTOBUF_NAMESPACE_ID::FileOptions& options(const FileDescriptorProto* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
-  source_code_info_ = source_code_info;
-  if (source_code_info) {
-    set_has_source_code_info();
-  } else {
-    clear_has_source_code_info();
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.source_code_info)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FileDescriptorProto::kNameFieldNumber;
-const int FileDescriptorProto::kPackageFieldNumber;
-const int FileDescriptorProto::kDependencyFieldNumber;
-const int FileDescriptorProto::kPublicDependencyFieldNumber;
-const int FileDescriptorProto::kWeakDependencyFieldNumber;
-const int FileDescriptorProto::kMessageTypeFieldNumber;
-const int FileDescriptorProto::kEnumTypeFieldNumber;
-const int FileDescriptorProto::kServiceFieldNumber;
-const int FileDescriptorProto::kExtensionFieldNumber;
-const int FileDescriptorProto::kOptionsFieldNumber;
-const int FileDescriptorProto::kSourceCodeInfoFieldNumber;
-const int FileDescriptorProto::kSyntaxFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FileDescriptorProto::FileDescriptorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto();
+  static const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo& source_code_info(const FileDescriptorProto* msg);
+  static void set_has_source_code_info(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorProto)
+  static void set_has_syntax(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+const ::PROTOBUF_NAMESPACE_ID::FileOptions&
+FileDescriptorProto::_Internal::options(const FileDescriptorProto* msg) {
+  return *msg->options_;
+}
+const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo&
+FileDescriptorProto::_Internal::source_code_info(const FileDescriptorProto* msg) {
+  return *msg->source_code_info_;
 }
-FileDescriptorProto::FileDescriptorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+FileDescriptorProto::FileDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   dependency_(arena),
   message_type_(arena),
   enum_type_(arena),
@@ -1913,16 +1488,15 @@ FileDescriptorProto::FileDescriptorProto(::google::protobuf::Arena* arena)
   extension_(arena),
   public_dependency_(arena),
   weak_dependency_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.FileDescriptorProto)
 }
 FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       dependency_(from.dependency_),
       message_type_(from.message_type_),
       enum_type_(from.enum_type_),
@@ -1930,55 +1504,75 @@ FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from)
       extension_(from.extension_),
       public_dependency_(from.public_dependency_),
       weak_dependency_(from.weak_dependency_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_package()) {
-    package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.package(),
-      GetArenaNoVirtual());
-  }
-  syntax_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_syntax()) {
-    syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.syntax(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::FileOptions(*from.options_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
+      GetArenaForAllocation());
+  }
+  package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_package()) {
+    package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_package(), 
+      GetArenaForAllocation());
+  }
+  syntax_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    syntax_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_syntax()) {
+    syntax_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_syntax(), 
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::FileOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
-  if (from.has_source_code_info()) {
-    source_code_info_ = new ::google::protobuf::SourceCodeInfo(*from.source_code_info_);
+  if (from._internal_has_source_code_info()) {
+    source_code_info_ = new ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo(*from.source_code_info_);
   } else {
-    source_code_info_ = NULL;
+    source_code_info_ = nullptr;
   }
   // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorProto)
 }
 
-void FileDescriptorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  syntax_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&options_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&source_code_info_) -
-      reinterpret_cast<char*>(&options_)) + sizeof(source_code_info_));
+inline void FileDescriptorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+syntax_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  syntax_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&options_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&source_code_info_) -
+    reinterpret_cast<char*>(&options_)) + sizeof(source_code_info_));
 }
 
 FileDescriptorProto::~FileDescriptorProto() {
   // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FileDescriptorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  syntax_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void FileDescriptorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  package_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  syntax_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete options_;
   if (this != internal_default_instance()) delete source_code_info_;
 }
@@ -1987,30 +1581,15 @@ void FileDescriptorProto::ArenaDtor(void* object) {
   FileDescriptorProto* _this = reinterpret_cast< FileDescriptorProto* >(object);
   (void)_this;
 }
-void FileDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void FileDescriptorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void FileDescriptorProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* FileDescriptorProto::descriptor() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const FileDescriptorProto& FileDescriptorProto::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto();
-  return *internal_default_instance();
-}
-
-FileDescriptorProto* FileDescriptorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FileDescriptorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void FileDescriptorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.FileDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2022,447 +1601,323 @@ void FileDescriptorProto::Clear() {
   public_dependency_.Clear();
   weak_dependency_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 31u) {
+  if (cached_has_bits & 0x0000001fu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      package_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!syntax_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      syntax_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      syntax_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(options_ != NULL);
+      GOOGLE_DCHECK(options_ != nullptr);
       options_->Clear();
     }
     if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(source_code_info_ != NULL);
+      GOOGLE_DCHECK(source_code_info_ != nullptr);
       source_code_info_->Clear();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FileDescriptorProto::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:google.protobuf.FileDescriptorProto)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* FileDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileDescriptorProto.name");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileDescriptorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string package = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_package()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->package().data(), static_cast<int>(this->package().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileDescriptorProto.package");
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_package();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileDescriptorProto.package");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated string dependency = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_dependency()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->dependency(this->dependency_size() - 1).data(),
-            static_cast<int>(this->dependency(this->dependency_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileDescriptorProto.dependency");
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_dependency();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileDescriptorProto.dependency");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.DescriptorProto message_type = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_message_type()));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_message_type(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_enum_type()));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_enum_type(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.ServiceDescriptorProto service = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_service()));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_service(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.FieldDescriptorProto extension = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_extension()));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_extension(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.FileOptions options = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.SourceCodeInfo source_code_info = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_source_code_info()));
-        } else {
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ctx->ParseMessage(_internal_mutable_source_code_info(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int32 public_dependency = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 80u, input, this->mutable_public_dependency())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_public_dependency())));
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_public_dependency(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<80>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 82) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_public_dependency(), ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int32 weak_dependency = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 88u, input, this->mutable_weak_dependency())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_weak_dependency())));
-        } else {
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_weak_dependency(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<88>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 90) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_weak_dependency(), ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string syntax = 12;
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_syntax()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->syntax().data(), static_cast<int>(this->syntax().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileDescriptorProto.syntax");
-        } else {
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          auto str = _internal_mutable_syntax();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileDescriptorProto.syntax");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.FileDescriptorProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.FileDescriptorProto)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void FileDescriptorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.FileDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* FileDescriptorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileDescriptorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional string package = 2;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->package().data(), static_cast<int>(this->package().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_package().data(), static_cast<int>(this->_internal_package().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileDescriptorProto.package");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->package(), output);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_package(), target);
   }
 
   // repeated string dependency = 3;
-  for (int i = 0, n = this->dependency_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->dependency(i).data(), static_cast<int>(this->dependency(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_dependency_size(); i < n; i++) {
+    const auto& s = this->_internal_dependency(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileDescriptorProto.dependency");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      3, this->dependency(i), output);
+    target = stream->WriteString(3, s, target);
   }
 
   // repeated .google.protobuf.DescriptorProto message_type = 4;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->message_type_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, this->message_type(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_message_type_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(4, this->_internal_message_type(i), target, stream);
   }
 
   // repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->enum_type_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, this->enum_type(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_enum_type_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(5, this->_internal_enum_type(i), target, stream);
   }
 
   // repeated .google.protobuf.ServiceDescriptorProto service = 6;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->service_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, this->service(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_service_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(6, this->_internal_service(i), target, stream);
   }
 
   // repeated .google.protobuf.FieldDescriptorProto extension = 7;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->extension_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, this->extension(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_extension_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(7, this->_internal_extension(i), target, stream);
   }
 
   // optional .google.protobuf.FileOptions options = 8;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, *this->options_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        8, _Internal::options(this), target, stream);
   }
 
   // optional .google.protobuf.SourceCodeInfo source_code_info = 9;
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      9, *this->source_code_info_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        9, _Internal::source_code_info(this), target, stream);
   }
 
   // repeated int32 public_dependency = 10;
-  for (int i = 0, n = this->public_dependency_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(
-      10, this->public_dependency(i), output);
+  for (int i = 0, n = this->_internal_public_dependency_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(10, this->_internal_public_dependency(i), target);
   }
 
   // repeated int32 weak_dependency = 11;
-  for (int i = 0, n = this->weak_dependency_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(
-      11, this->weak_dependency(i), output);
-  }
-
-  // optional string syntax = 12;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->syntax().data(), static_cast<int>(this->syntax().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileDescriptorProto.syntax");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      12, this->syntax(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorProto)
-}
-
-::google::protobuf::uint8* FileDescriptorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileDescriptorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // optional string package = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->package().data(), static_cast<int>(this->package().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileDescriptorProto.package");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->package(), target);
-  }
-
-  // repeated string dependency = 3;
-  for (int i = 0, n = this->dependency_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->dependency(i).data(), static_cast<int>(this->dependency(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileDescriptorProto.dependency");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(3, this->dependency(i), target);
-  }
-
-  // repeated .google.protobuf.DescriptorProto message_type = 4;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->message_type_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, this->message_type(static_cast<int>(i)), deterministic, target);
+  for (int i = 0, n = this->_internal_weak_dependency_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(11, this->_internal_weak_dependency(i), target);
   }
 
-  // repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->enum_type_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, this->enum_type(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated .google.protobuf.ServiceDescriptorProto service = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->service_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, this->service(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated .google.protobuf.FieldDescriptorProto extension = 7;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->extension_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, this->extension(static_cast<int>(i)), deterministic, target);
-  }
-
-  // optional .google.protobuf.FileOptions options = 8;
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, *this->options_, deterministic, target);
-  }
-
-  // optional .google.protobuf.SourceCodeInfo source_code_info = 9;
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        9, *this->source_code_info_, deterministic, target);
-  }
-
-  // repeated int32 public_dependency = 10;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteInt32ToArray(10, this->public_dependency_, target);
-
-  // repeated int32 weak_dependency = 11;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteInt32ToArray(11, this->weak_dependency_, target);
-
   // optional string syntax = 12;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->syntax().data(), static_cast<int>(this->syntax().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_syntax().data(), static_cast<int>(this->_internal_syntax().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileDescriptorProto.syntax");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        12, this->syntax(), target);
+    target = stream->WriteStringMaybeAliased(
+        12, this->_internal_syntax(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescriptorProto)
   return target;
@@ -2472,145 +1927,122 @@ size_t FileDescriptorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileDescriptorProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated string dependency = 3;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->dependency_size());
-  for (int i = 0, n = this->dependency_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->dependency(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(dependency_.size());
+  for (int i = 0, n = dependency_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      dependency_.Get(i));
   }
 
   // repeated .google.protobuf.DescriptorProto message_type = 4;
-  {
-    unsigned int count = static_cast<unsigned int>(this->message_type_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->message_type(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_message_type_size();
+  for (const auto& msg : this->message_type_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
-  {
-    unsigned int count = static_cast<unsigned int>(this->enum_type_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->enum_type(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_enum_type_size();
+  for (const auto& msg : this->enum_type_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.ServiceDescriptorProto service = 6;
-  {
-    unsigned int count = static_cast<unsigned int>(this->service_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->service(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_service_size();
+  for (const auto& msg : this->service_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.FieldDescriptorProto extension = 7;
-  {
-    unsigned int count = static_cast<unsigned int>(this->extension_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->extension(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_extension_size();
+  for (const auto& msg : this->extension_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated int32 public_dependency = 10;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->public_dependency_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->public_dependency_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_public_dependency_size());
     total_size += data_size;
   }
 
   // repeated int32 weak_dependency = 11;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->weak_dependency_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->weak_dependency_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_weak_dependency_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 31u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000001fu) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional string package = 2;
-    if (has_package()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->package());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_package());
     }
 
     // optional string syntax = 12;
-    if (has_syntax()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->syntax());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_syntax());
     }
 
     // optional .google.protobuf.FileOptions options = 8;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
     // optional .google.protobuf.SourceCodeInfo source_code_info = 9;
-    if (has_source_code_info()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->source_code_info_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *source_code_info_);
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FileDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileDescriptorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FileDescriptorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FileDescriptorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileDescriptorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FileDescriptorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FileDescriptorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FileDescriptorProto::GetClassData() const { return &_class_data_; }
+
+void FileDescriptorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FileDescriptorProto *>(to)->MergeFrom(
+      static_cast<const FileDescriptorProto &>(from));
 }
 
+
 void FileDescriptorProto::MergeFrom(const FileDescriptorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileDescriptorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   dependency_.MergeFrom(from.dependency_);
@@ -2621,30 +2053,24 @@ void FileDescriptorProto::MergeFrom(const FileDescriptorProto& from) {
   public_dependency_.MergeFrom(from.public_dependency_);
   weak_dependency_.MergeFrom(from.weak_dependency_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 31u) {
+  if (cached_has_bits & 0x0000001fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_name(from.name());
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_package(from.package());
+      _internal_set_package(from._internal_package());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_syntax(from.syntax());
+      _internal_set_syntax(from._internal_syntax());
     }
     if (cached_has_bits & 0x00000008u) {
-      mutable_options()->::google::protobuf::FileOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::FileOptions::MergeFrom(from._internal_options());
     }
     if (cached_has_bits & 0x00000010u) {
-      mutable_source_code_info()->::google::protobuf::SourceCodeInfo::MergeFrom(from.source_code_info());
+      _internal_mutable_source_code_info()->::PROTOBUF_NAMESPACE_ID::SourceCodeInfo::MergeFrom(from._internal_source_code_info());
     }
   }
-}
-
-void FileDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileDescriptorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FileDescriptorProto::CopyFrom(const FileDescriptorProto& from) {
@@ -2655,37 +2081,26 @@ void FileDescriptorProto::CopyFrom(const FileDescriptorProto& from) {
 }
 
 bool FileDescriptorProto::IsInitialized() const {
-  if (!::google::protobuf::internal::AllAreInitialized(this->message_type())) return false;
-  if (!::google::protobuf::internal::AllAreInitialized(this->enum_type())) return false;
-  if (!::google::protobuf::internal::AllAreInitialized(this->service())) return false;
-  if (!::google::protobuf::internal::AllAreInitialized(this->extension())) return false;
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(message_type_))
+    return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(enum_type_))
+    return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(service_))
+    return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(extension_))
+    return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   dependency_.InternalSwap(&other->dependency_);
   message_type_.InternalSwap(&other->message_type_);
   enum_type_.InternalSwap(&other->enum_type_);
@@ -2693,77 +2108,73 @@ void FileDescriptorProto::InternalSwap(FileDescriptorProto* other) {
   extension_.InternalSwap(&other->extension_);
   public_dependency_.InternalSwap(&other->public_dependency_);
   weak_dependency_.InternalSwap(&other->weak_dependency_);
-  name_.Swap(&other->name_);
-  package_.Swap(&other->package_);
-  syntax_.Swap(&other->syntax_);
-  swap(options_, other->options_);
-  swap(source_code_info_, other->source_code_info_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &package_, lhs_arena,
+      &other->package_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &syntax_, lhs_arena,
+      &other->syntax_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(FileDescriptorProto, source_code_info_)
+      + sizeof(FileDescriptorProto::source_code_info_)
+      - PROTOBUF_FIELD_OFFSET(FileDescriptorProto, options_)>(
+          reinterpret_cast<char*>(&options_),
+          reinterpret_cast<char*>(&other->options_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata FileDescriptorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[1]);
 }
 
-::google::protobuf::Metadata FileDescriptorProto::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
 // ===================================================================
 
-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());
-}
-void DescriptorProto_ExtensionRange::_slow_mutable_options() {
-  options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ExtensionRangeOptions >(
-      GetArenaNoVirtual());
-}
-void DescriptorProto_ExtensionRange::unsafe_arena_set_allocated_options(
-    ::google::protobuf::ExtensionRangeOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class DescriptorProto_ExtensionRange::_Internal {
+ public:
+  using HasBits = decltype(std::declval<DescriptorProto_ExtensionRange>()._has_bits_);
+  static void set_has_start(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
+  static void set_has_end(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int DescriptorProto_ExtensionRange::kStartFieldNumber;
-const int DescriptorProto_ExtensionRange::kEndFieldNumber;
-const int DescriptorProto_ExtensionRange::kOptionsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRange();
+  static const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions& options(const DescriptorProto_ExtensionRange* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ExtensionRange)
+};
+
+const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions&
+DescriptorProto_ExtensionRange::_Internal::options(const DescriptorProto_ExtensionRange* msg) {
+  return *msg->options_;
 }
-DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRange();
+DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.DescriptorProto.ExtensionRange)
 }
 DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::ExtensionRangeOptions(*from.options_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
   ::memcpy(&start_, &from.start_,
     static_cast<size_t>(reinterpret_cast<char*>(&end_) -
@@ -2771,20 +2182,22 @@ DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorP
   // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto.ExtensionRange)
 }
 
-void DescriptorProto_ExtensionRange::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&options_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&end_) -
-      reinterpret_cast<char*>(&options_)) + sizeof(end_));
+inline void DescriptorProto_ExtensionRange::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&options_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&end_) -
+    reinterpret_cast<char*>(&options_)) + sizeof(end_));
 }
 
 DescriptorProto_ExtensionRange::~DescriptorProto_ExtensionRange() {
   // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ExtensionRange)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void DescriptorProto_ExtensionRange::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void DescriptorProto_ExtensionRange::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete options_;
 }
 
@@ -2792,175 +2205,119 @@ 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::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const DescriptorProto_ExtensionRange& DescriptorProto_ExtensionRange::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRange();
-  return *internal_default_instance();
-}
-
-DescriptorProto_ExtensionRange* DescriptorProto_ExtensionRange::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<DescriptorProto_ExtensionRange>(arena);
+  _cached_size_.Set(size);
 }
 
 void DescriptorProto_ExtensionRange::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto.ExtensionRange)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(options_ != NULL);
+    GOOGLE_DCHECK(options_ != nullptr);
     options_->Clear();
   }
-  if (cached_has_bits & 6u) {
+  if (cached_has_bits & 0x00000006u) {
     ::memset(&start_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&end_) -
         reinterpret_cast<char*>(&start_)) + sizeof(end_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto.ExtensionRange)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* DescriptorProto_ExtensionRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // 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 {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_start(&has_bits);
+          start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // 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 {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_end(&has_bits);
+          end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.ExtensionRangeOptions options = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } 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.DescriptorProto.ExtensionRange)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto.ExtensionRange)
-  return false;
-#undef DO_
-}
-
-void DescriptorProto_ExtensionRange::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto.ExtensionRange)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 start = 1;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output);
-  }
-
-  // optional int32 end = 2;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end(), output);
-  }
-
-  // optional .google.protobuf.ExtensionRangeOptions options = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->options_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.ExtensionRange)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* DescriptorProto_ExtensionRange::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* DescriptorProto_ExtensionRange::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ExtensionRange)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int32 start = 1;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_start(), target);
   }
 
   // optional int32 end = 2;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_end(), target);
   }
 
   // optional .google.protobuf.ExtensionRangeOptions options = 3;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->options_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::options(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto.ExtensionRange)
   return target;
@@ -2970,67 +2327,56 @@ size_t DescriptorProto_ExtensionRange::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto.ExtensionRange)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  if (_has_bits_[0 / 32] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional .google.protobuf.ExtensionRangeOptions options = 3;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
     // optional int32 start = 1;
-    if (has_start()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->start());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_start());
     }
 
     // optional int32 end = 2;
-    if (has_end()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->end());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void DescriptorProto_ExtensionRange::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto.ExtensionRange)
-  GOOGLE_DCHECK_NE(&from, this);
-  const DescriptorProto_ExtensionRange* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const DescriptorProto_ExtensionRange>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ExtensionRange)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto.ExtensionRange)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DescriptorProto_ExtensionRange::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    DescriptorProto_ExtensionRange::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DescriptorProto_ExtensionRange::GetClassData() const { return &_class_data_; }
+
+void DescriptorProto_ExtensionRange::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<DescriptorProto_ExtensionRange *>(to)->MergeFrom(
+      static_cast<const DescriptorProto_ExtensionRange &>(from));
 }
 
+
 void DescriptorProto_ExtensionRange::MergeFrom(const DescriptorProto_ExtensionRange& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto.ExtensionRange)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_options()->::google::protobuf::ExtensionRangeOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions::MergeFrom(from._internal_options());
     }
     if (cached_has_bits & 0x00000002u) {
       start_ = from.start_;
@@ -3040,13 +2386,7 @@ void DescriptorProto_ExtensionRange::MergeFrom(const DescriptorProto_ExtensionRa
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void DescriptorProto_ExtensionRange::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto.ExtensionRange)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void DescriptorProto_ExtensionRange::CopyFrom(const DescriptorProto_ExtensionRange& from) {
@@ -3057,244 +2397,177 @@ void DescriptorProto_ExtensionRange::CopyFrom(const DescriptorProto_ExtensionRan
 }
 
 bool DescriptorProto_ExtensionRange::IsInitialized() const {
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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) {
   using std::swap;
-  swap(options_, other->options_);
-  swap(start_, other->start_);
-  swap(end_, other->end_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_)
+      + sizeof(DescriptorProto_ExtensionRange::end_)
+      - PROTOBUF_FIELD_OFFSET(DescriptorProto_ExtensionRange, options_)>(
+          reinterpret_cast<char*>(&options_),
+          reinterpret_cast<char*>(&other->options_));
 }
 
-::google::protobuf::Metadata DescriptorProto_ExtensionRange::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata DescriptorProto_ExtensionRange::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[2]);
 }
 
-
 // ===================================================================
 
-void DescriptorProto_ReservedRange::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int DescriptorProto_ReservedRange::kStartFieldNumber;
-const int DescriptorProto_ReservedRange::kEndFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-DescriptorProto_ReservedRange::DescriptorProto_ReservedRange()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ReservedRange();
+class DescriptorProto_ReservedRange::_Internal {
+ public:
+  using HasBits = decltype(std::declval<DescriptorProto_ReservedRange>()._has_bits_);
+  static void set_has_start(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_end(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   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);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.DescriptorProto.ReservedRange)
 }
 DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(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.DescriptorProto.ReservedRange)
 }
 
-void DescriptorProto_ReservedRange::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&start_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&end_) -
-      reinterpret_cast<char*>(&start_)) + sizeof(end_));
+inline void DescriptorProto_ReservedRange::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&start_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&end_) -
+    reinterpret_cast<char*>(&start_)) + sizeof(end_));
 }
 
 DescriptorProto_ReservedRange::~DescriptorProto_ReservedRange() {
   // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ReservedRange)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void DescriptorProto_ReservedRange::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void DescriptorProto_ReservedRange::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 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::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ReservedRange();
-  return *internal_default_instance();
-}
-
-DescriptorProto_ReservedRange* DescriptorProto_ReservedRange::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<DescriptorProto_ReservedRange>(arena);
+  _cached_size_.Set(size);
 }
 
 void DescriptorProto_ReservedRange::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto.ReservedRange)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     ::memset(&start_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&end_) -
         reinterpret_cast<char*>(&start_)) + sizeof(end_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool DescriptorProto_ReservedRange::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto.ReservedRange)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* DescriptorProto_ReservedRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // 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 {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_start(&has_bits);
+          start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // 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 {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_end(&has_bits);
+          end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } 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.DescriptorProto.ReservedRange)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto.ReservedRange)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void DescriptorProto_ReservedRange::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto.ReservedRange)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 start = 1;
-  if (cached_has_bits & 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.DescriptorProto.ReservedRange)
-}
-
-::google::protobuf::uint8* DescriptorProto_ReservedRange::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* DescriptorProto_ReservedRange::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ReservedRange)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_start(), target);
   }
 
   // optional int32 end = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_end(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto.ReservedRange)
   return target;
@@ -3304,58 +2577,47 @@ size_t DescriptorProto_ReservedRange::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto.ReservedRange)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  if (_has_bits_[0 / 32] & 3u) {
+  uint32_t 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 & 0x00000003u) {
     // optional int32 start = 1;
-    if (has_start()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->start());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_start());
     }
 
     // optional int32 end = 2;
-    if (has_end()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->end());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void DescriptorProto_ReservedRange::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto.ReservedRange)
-  GOOGLE_DCHECK_NE(&from, this);
-  const DescriptorProto_ReservedRange* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const DescriptorProto_ReservedRange>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ReservedRange)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto.ReservedRange)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DescriptorProto_ReservedRange::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    DescriptorProto_ReservedRange::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DescriptorProto_ReservedRange::GetClassData() const { return &_class_data_; }
+
+void DescriptorProto_ReservedRange::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<DescriptorProto_ReservedRange *>(to)->MergeFrom(
+      static_cast<const DescriptorProto_ReservedRange &>(from));
 }
 
+
 void DescriptorProto_ReservedRange::MergeFrom(const DescriptorProto_ReservedRange& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto.ReservedRange)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       start_ = from.start_;
     }
@@ -3364,13 +2626,7 @@ void DescriptorProto_ReservedRange::MergeFrom(const DescriptorProto_ReservedRang
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void DescriptorProto_ReservedRange::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto.ReservedRange)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void DescriptorProto_ReservedRange::CopyFrom(const DescriptorProto_ReservedRange& from) {
@@ -3384,87 +2640,45 @@ bool DescriptorProto_ReservedRange::IsInitialized() const {
   return true;
 }
 
-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) {
   using std::swap;
-  swap(start_, other->start_);
-  swap(end_, other->end_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(DescriptorProto_ReservedRange, end_)
+      + sizeof(DescriptorProto_ReservedRange::end_)
+      - PROTOBUF_FIELD_OFFSET(DescriptorProto_ReservedRange, start_)>(
+          reinterpret_cast<char*>(&start_),
+          reinterpret_cast<char*>(&other->start_));
 }
 
-::google::protobuf::Metadata DescriptorProto_ReservedRange::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata DescriptorProto_ReservedRange::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[3]);
 }
 
-
 // ===================================================================
 
-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::_slow_mutable_options() {
-  options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::MessageOptions >(
-      GetArenaNoVirtual());
-}
-void DescriptorProto::unsafe_arena_set_allocated_options(
-    ::google::protobuf::MessageOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class DescriptorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<DescriptorProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.options)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int DescriptorProto::kNameFieldNumber;
-const int DescriptorProto::kFieldFieldNumber;
-const int DescriptorProto::kExtensionFieldNumber;
-const int DescriptorProto::kNestedTypeFieldNumber;
-const int DescriptorProto::kEnumTypeFieldNumber;
-const int DescriptorProto::kExtensionRangeFieldNumber;
-const int DescriptorProto::kOneofDeclFieldNumber;
-const int DescriptorProto::kOptionsFieldNumber;
-const int DescriptorProto::kReservedRangeFieldNumber;
-const int DescriptorProto::kReservedNameFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-DescriptorProto::DescriptorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto();
+  static const ::PROTOBUF_NAMESPACE_ID::MessageOptions& options(const DescriptorProto* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto)
+};
+
+const ::PROTOBUF_NAMESPACE_ID::MessageOptions&
+DescriptorProto::_Internal::options(const DescriptorProto* msg) {
+  return *msg->options_;
 }
-DescriptorProto::DescriptorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+DescriptorProto::DescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   field_(arena),
   nested_type_(arena),
   enum_type_(arena),
@@ -3473,16 +2687,15 @@ DescriptorProto::DescriptorProto(::google::protobuf::Arena* arena)
   oneof_decl_(arena),
   reserved_range_(arena),
   reserved_name_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.DescriptorProto)
 }
 DescriptorProto::DescriptorProto(const DescriptorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       field_(from.field_),
       nested_type_(from.nested_type_),
       enum_type_(from.enum_type_),
@@ -3491,34 +2704,41 @@ DescriptorProto::DescriptorProto(const DescriptorProto& from)
       oneof_decl_(from.oneof_decl_),
       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_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::MessageOptions(*from.options_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::MessageOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
   // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto)
 }
 
-void DescriptorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  options_ = NULL;
+inline void DescriptorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+options_ = nullptr;
 }
 
 DescriptorProto::~DescriptorProto() {
   // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void DescriptorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void DescriptorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete options_;
 }
 
@@ -3526,392 +2746,293 @@ void DescriptorProto::ArenaDtor(void* object) {
   DescriptorProto* _this = reinterpret_cast< DescriptorProto* >(object);
   (void)_this;
 }
-void DescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void DescriptorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const DescriptorProto& DescriptorProto::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto();
-  return *internal_default_instance();
-}
-
-DescriptorProto* DescriptorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<DescriptorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void DescriptorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   field_.Clear();
   nested_type_.Clear();
-  enum_type_.Clear();
-  extension_range_.Clear();
-  extension_.Clear();
-  oneof_decl_.Clear();
-  reserved_range_.Clear();
-  reserved_name_.Clear();
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(options_ != NULL);
-      options_->Clear();
-    }
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool DescriptorProto::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.DescriptorProto.name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.FieldDescriptorProto field = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_field()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.DescriptorProto nested_type = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_nested_type()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.EnumDescriptorProto enum_type = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_enum_type()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_extension_range()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.FieldDescriptorProto extension = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_extension()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .google.protobuf.MessageOptions options = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_oneof_decl()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_reserved_range()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated string reserved_name = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_reserved_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->reserved_name(this->reserved_name_size() - 1).data(),
-            static_cast<int>(this->reserved_name(this->reserved_name_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.DescriptorProto.reserved_name");
-        } 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.DescriptorProto)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto)
-  return false;
-#undef DO_
-}
-
-void DescriptorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.DescriptorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // repeated .google.protobuf.FieldDescriptorProto field = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->field_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->field(static_cast<int>(i)), output);
-  }
-
-  // repeated .google.protobuf.DescriptorProto nested_type = 3;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->nested_type_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, this->nested_type(static_cast<int>(i)), output);
-  }
-
-  // repeated .google.protobuf.EnumDescriptorProto enum_type = 4;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->enum_type_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, this->enum_type(static_cast<int>(i)), output);
-  }
-
-  // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->extension_range_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, this->extension_range(static_cast<int>(i)), output);
-  }
-
-  // repeated .google.protobuf.FieldDescriptorProto extension = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->extension_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, this->extension(static_cast<int>(i)), output);
-  }
-
-  // optional .google.protobuf.MessageOptions options = 7;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, *this->options_, output);
-  }
-
-  // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->oneof_decl_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, this->oneof_decl(static_cast<int>(i)), output);
-  }
-
-  // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->reserved_range_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      9, this->reserved_range(static_cast<int>(i)), output);
-  }
-
-  // repeated string reserved_name = 10;
-  for (int i = 0, n = this->reserved_name_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->reserved_name(i).data(), static_cast<int>(this->reserved_name(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.DescriptorProto.reserved_name");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      10, this->reserved_name(i), output);
+  enum_type_.Clear();
+  extension_range_.Clear();
+  extension_.Clear();
+  oneof_decl_.Clear();
+  reserved_range_.Clear();
+  reserved_name_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
+    if (cached_has_bits & 0x00000001u) {
+      name_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(options_ != nullptr);
+      options_->Clear();
+    }
   }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto)
+const char* DescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string name = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.DescriptorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.FieldDescriptorProto field = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_field(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.DescriptorProto nested_type = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_nested_type(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.EnumDescriptorProto enum_type = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_enum_type(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_extension_range(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.FieldDescriptorProto extension = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_extension(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .google.protobuf.MessageOptions options = 7;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_oneof_decl(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_reserved_range(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string reserved_name = 10;
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_reserved_name();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.DescriptorProto.reserved_name");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* DescriptorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* DescriptorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.DescriptorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // repeated .google.protobuf.FieldDescriptorProto field = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->field_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->field(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_field_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_field(i), target, stream);
   }
 
   // repeated .google.protobuf.DescriptorProto nested_type = 3;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->nested_type_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, this->nested_type(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_nested_type_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(3, this->_internal_nested_type(i), target, stream);
   }
 
   // repeated .google.protobuf.EnumDescriptorProto enum_type = 4;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->enum_type_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, this->enum_type(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_enum_type_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(4, this->_internal_enum_type(i), target, stream);
   }
 
   // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->extension_range_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, this->extension_range(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_extension_range_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(5, this->_internal_extension_range(i), target, stream);
   }
 
   // repeated .google.protobuf.FieldDescriptorProto extension = 6;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->extension_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, this->extension(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_extension_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(6, this->_internal_extension(i), target, stream);
   }
 
   // optional .google.protobuf.MessageOptions options = 7;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, *this->options_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        7, _Internal::options(this), target, stream);
   }
 
   // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->oneof_decl_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, this->oneof_decl(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_oneof_decl_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(8, this->_internal_oneof_decl(i), target, stream);
   }
 
   // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->reserved_range_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        9, this->reserved_range(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_reserved_range_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(9, this->_internal_reserved_range(i), target, stream);
   }
 
   // repeated string reserved_name = 10;
-  for (int i = 0, n = this->reserved_name_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->reserved_name(i).data(), static_cast<int>(this->reserved_name(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_reserved_name_size(); i < n; i++) {
+    const auto& s = this->_internal_reserved_name(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.DescriptorProto.reserved_name");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(10, this->reserved_name(i), target);
+    target = stream->WriteString(10, s, target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto)
   return target;
@@ -3921,139 +3042,104 @@ size_t DescriptorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.FieldDescriptorProto field = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->field_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->field(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_field_size();
+  for (const auto& msg : this->field_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.DescriptorProto nested_type = 3;
-  {
-    unsigned int count = static_cast<unsigned int>(this->nested_type_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->nested_type(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_nested_type_size();
+  for (const auto& msg : this->nested_type_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.EnumDescriptorProto enum_type = 4;
-  {
-    unsigned int count = static_cast<unsigned int>(this->enum_type_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->enum_type(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_enum_type_size();
+  for (const auto& msg : this->enum_type_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;
-  {
-    unsigned int count = static_cast<unsigned int>(this->extension_range_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->extension_range(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_extension_range_size();
+  for (const auto& msg : this->extension_range_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.FieldDescriptorProto extension = 6;
-  {
-    unsigned int count = static_cast<unsigned int>(this->extension_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->extension(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_extension_size();
+  for (const auto& msg : this->extension_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
-  {
-    unsigned int count = static_cast<unsigned int>(this->oneof_decl_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->oneof_decl(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_oneof_decl_size();
+  for (const auto& msg : this->oneof_decl_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;
-  {
-    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::MessageSize(
-          this->reserved_range(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_reserved_range_size();
+  for (const auto& msg : this->reserved_range_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated string reserved_name = 10;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->reserved_name_size());
-  for (int i = 0, n = this->reserved_name_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->reserved_name(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(reserved_name_.size());
+  for (int i = 0, n = reserved_name_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      reserved_name_.Get(i));
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional .google.protobuf.MessageOptions options = 7;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void DescriptorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const DescriptorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const DescriptorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DescriptorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    DescriptorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DescriptorProto::GetClassData() const { return &_class_data_; }
+
+void DescriptorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<DescriptorProto *>(to)->MergeFrom(
+      static_cast<const DescriptorProto &>(from));
 }
 
+
 void DescriptorProto::MergeFrom(const DescriptorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   field_.MergeFrom(from.field_);
@@ -4065,21 +3151,15 @@ void DescriptorProto::MergeFrom(const DescriptorProto& from) {
   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 & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_name(from.name());
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_options()->::google::protobuf::MessageOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::MessageOptions::MergeFrom(from._internal_options());
     }
   }
-}
-
-void DescriptorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void DescriptorProto::CopyFrom(const DescriptorProto& from) {
@@ -4090,39 +3170,30 @@ void DescriptorProto::CopyFrom(const DescriptorProto& from) {
 }
 
 bool DescriptorProto::IsInitialized() const {
-  if (!::google::protobuf::internal::AllAreInitialized(this->field())) return false;
-  if (!::google::protobuf::internal::AllAreInitialized(this->nested_type())) return false;
-  if (!::google::protobuf::internal::AllAreInitialized(this->enum_type())) return false;
-  if (!::google::protobuf::internal::AllAreInitialized(this->extension_range())) return false;
-  if (!::google::protobuf::internal::AllAreInitialized(this->extension())) return false;
-  if (!::google::protobuf::internal::AllAreInitialized(this->oneof_decl())) return false;
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(field_))
+    return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(nested_type_))
+    return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(enum_type_))
+    return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(extension_range_))
+    return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(extension_))
+    return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(oneof_decl_))
+    return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   field_.InternalSwap(&other->field_);
   nested_type_.InternalSwap(&other->nested_type_);
   enum_type_.InternalSwap(&other->enum_type_);
@@ -4131,199 +3202,148 @@ void DescriptorProto::InternalSwap(DescriptorProto* other) {
   oneof_decl_.InternalSwap(&other->oneof_decl_);
   reserved_range_.InternalSwap(&other->reserved_range_);
   reserved_name_.InternalSwap(&other->reserved_name_);
-  name_.Swap(&other->name_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
   swap(options_, other->options_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata DescriptorProto::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata DescriptorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[4]);
 }
 
-
 // ===================================================================
 
-void ExtensionRangeOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ExtensionRangeOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class ExtensionRangeOptions::_Internal {
+ public:
+};
 
-ExtensionRangeOptions::ExtensionRangeOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptions();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.ExtensionRangeOptions)
-}
-ExtensionRangeOptions::ExtensionRangeOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+ExtensionRangeOptions::ExtensionRangeOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.ExtensionRangeOptions)
 }
 ExtensionRangeOptions::ExtensionRangeOptions(const ExtensionRangeOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   // @@protoc_insertion_point(copy_constructor:google.protobuf.ExtensionRangeOptions)
 }
 
-void ExtensionRangeOptions::SharedCtor() {
-  _cached_size_ = 0;
+inline void ExtensionRangeOptions::SharedCtor() {
 }
 
 ExtensionRangeOptions::~ExtensionRangeOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.ExtensionRangeOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ExtensionRangeOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void ExtensionRangeOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void ExtensionRangeOptions::ArenaDtor(void* object) {
   ExtensionRangeOptions* _this = reinterpret_cast< ExtensionRangeOptions* >(object);
   (void)_this;
 }
-void ExtensionRangeOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void ExtensionRangeOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const ExtensionRangeOptions& ExtensionRangeOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptions();
-  return *internal_default_instance();
-}
-
-ExtensionRangeOptions* ExtensionRangeOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<ExtensionRangeOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void ExtensionRangeOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.ExtensionRangeOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   _extensions_.Clear();
   uninterpreted_option_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ExtensionRangeOptions::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:google.protobuf.ExtensionRangeOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* ExtensionRangeOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.ExtensionRangeOptions)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.ExtensionRangeOptions)
-  return false;
-#undef DO_
-}
-
-void ExtensionRangeOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.ExtensionRangeOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->uninterpreted_option_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.ExtensionRangeOptions)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ExtensionRangeOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ExtensionRangeOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ExtensionRangeOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->uninterpreted_option_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ExtensionRangeOptions)
   return target;
@@ -4335,60 +3355,42 @@ size_t ExtensionRangeOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ExtensionRangeOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ExtensionRangeOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ExtensionRangeOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ExtensionRangeOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ExtensionRangeOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ExtensionRangeOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ExtensionRangeOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ExtensionRangeOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ExtensionRangeOptions::GetClassData() const { return &_class_data_; }
+
+void ExtensionRangeOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ExtensionRangeOptions *>(to)->MergeFrom(
+      static_cast<const ExtensionRangeOptions &>(from));
 }
 
+
 void ExtensionRangeOptions::MergeFrom(const ExtensionRangeOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ExtensionRangeOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
-}
-
-void ExtensionRangeOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ExtensionRangeOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ExtensionRangeOptions::CopyFrom(const ExtensionRangeOptions& from) {
@@ -4403,131 +3405,126 @@ bool ExtensionRangeOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
 }
 
-::google::protobuf::Metadata ExtensionRangeOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ExtensionRangeOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[5]);
 }
 
-
 // ===================================================================
 
-void FieldDescriptorProto::InitAsDefaultInstance() {
-  ::google::protobuf::_FieldDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::FieldOptions*>(
-      ::google::protobuf::FieldOptions::internal_default_instance());
-}
-void FieldDescriptorProto::_slow_mutable_options() {
-  options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::FieldOptions >(
-      GetArenaNoVirtual());
-}
-void FieldDescriptorProto::unsafe_arena_set_allocated_options(
-    ::google::protobuf::FieldOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class FieldDescriptorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<FieldDescriptorProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.options)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FieldDescriptorProto::kNameFieldNumber;
-const int FieldDescriptorProto::kNumberFieldNumber;
-const int FieldDescriptorProto::kLabelFieldNumber;
-const int FieldDescriptorProto::kTypeFieldNumber;
-const int FieldDescriptorProto::kTypeNameFieldNumber;
-const int FieldDescriptorProto::kExtendeeFieldNumber;
-const int FieldDescriptorProto::kDefaultValueFieldNumber;
-const int FieldDescriptorProto::kOneofIndexFieldNumber;
-const int FieldDescriptorProto::kJsonNameFieldNumber;
-const int FieldDescriptorProto::kOptionsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FieldDescriptorProto::FieldDescriptorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto();
+  static void set_has_number(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.FieldDescriptorProto)
+  static void set_has_label(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+  static void set_has_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
+  }
+  static void set_has_type_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_extendee(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_default_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_oneof_index(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static void set_has_json_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::FieldOptions& options(const FieldDescriptorProto* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_proto3_optional(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+};
+
+const ::PROTOBUF_NAMESPACE_ID::FieldOptions&
+FieldDescriptorProto::_Internal::options(const FieldDescriptorProto* msg) {
+  return *msg->options_;
 }
-FieldDescriptorProto::FieldDescriptorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto();
+FieldDescriptorProto::FieldDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.FieldDescriptorProto)
 }
 FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  extendee_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_extendee()) {
-    extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.extendee(),
-      GetArenaNoVirtual());
-  }
-  type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_type_name()) {
-    type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_name(),
-      GetArenaNoVirtual());
-  }
-  default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_default_value()) {
-    default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.default_value(),
-      GetArenaNoVirtual());
-  }
-  json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_json_name()) {
-    json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::FieldOptions(*from.options_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
+      GetArenaForAllocation());
+  }
+  extendee_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    extendee_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_extendee()) {
+    extendee_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_extendee(), 
+      GetArenaForAllocation());
+  }
+  type_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_type_name()) {
+    type_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type_name(), 
+      GetArenaForAllocation());
+  }
+  default_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_default_value()) {
+    default_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_default_value(), 
+      GetArenaForAllocation());
+  }
+  json_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_json_name()) {
+    json_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_json_name(), 
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::FieldOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
   ::memcpy(&number_, &from.number_,
     static_cast<size_t>(reinterpret_cast<char*>(&type_) -
@@ -4535,32 +3532,49 @@ FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from)
   // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldDescriptorProto)
 }
 
-void FieldDescriptorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  extendee_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&options_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&oneof_index_) -
-      reinterpret_cast<char*>(&options_)) + sizeof(oneof_index_));
-  label_ = 1;
-  type_ = 1;
+inline void FieldDescriptorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+extendee_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  extendee_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+type_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+default_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+json_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&options_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&proto3_optional_) -
+    reinterpret_cast<char*>(&options_)) + sizeof(proto3_optional_));
+label_ = 1;
+type_ = 1;
 }
 
 FieldDescriptorProto::~FieldDescriptorProto() {
   // @@protoc_insertion_point(destructor:google.protobuf.FieldDescriptorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FieldDescriptorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  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());
+inline void FieldDescriptorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  extendee_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  type_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  default_value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  json_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete options_;
 }
 
@@ -4568,450 +3582,306 @@ void FieldDescriptorProto::ArenaDtor(void* object) {
   FieldDescriptorProto* _this = reinterpret_cast< FieldDescriptorProto* >(object);
   (void)_this;
 }
-void FieldDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void FieldDescriptorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const FieldDescriptorProto& FieldDescriptorProto::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto();
-  return *internal_default_instance();
-}
-
-FieldDescriptorProto* FieldDescriptorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FieldDescriptorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void FieldDescriptorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.FieldDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!extendee_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      extendee_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      extendee_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!type_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      type_name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!default_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      default_value_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(!json_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      json_name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000020u) {
-      GOOGLE_DCHECK(options_ != NULL);
+      GOOGLE_DCHECK(options_ != nullptr);
       options_->Clear();
     }
   }
-  if (cached_has_bits & 192u) {
+  if (cached_has_bits & 0x000000c0u) {
     ::memset(&number_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&oneof_index_) -
         reinterpret_cast<char*>(&number_)) + sizeof(oneof_index_));
   }
-  if (cached_has_bits & 768u) {
+  if (cached_has_bits & 0x00000700u) {
+    proto3_optional_ = false;
     label_ = 1;
     type_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FieldDescriptorProto::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:google.protobuf.FieldDescriptorProto)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FieldDescriptorProto.name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string extendee = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_extendee()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->extendee().data(), static_cast<int>(this->extendee().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FieldDescriptorProto.extendee");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 number = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_number();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &number_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .google.protobuf.FieldDescriptorProto.Label label = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::google::protobuf::FieldDescriptorProto_Label_IsValid(value)) {
-            set_label(static_cast< ::google::protobuf::FieldDescriptorProto_Label >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                4, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .google.protobuf.FieldDescriptorProto.Type type = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::google::protobuf::FieldDescriptorProto_Type_IsValid(value)) {
-            set_type(static_cast< ::google::protobuf::FieldDescriptorProto_Type >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                5, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string type_name = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->type_name().data(), static_cast<int>(this->type_name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FieldDescriptorProto.type_name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string default_value = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_default_value()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->default_value().data(), static_cast<int>(this->default_value().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FieldDescriptorProto.default_value");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .google.protobuf.FieldOptions options = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 oneof_index = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
-          set_has_oneof_index();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &oneof_index_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string json_name = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_json_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->json_name().data(), static_cast<int>(this->json_name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FieldDescriptorProto.json_name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.FieldDescriptorProto)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.FieldDescriptorProto)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FieldDescriptorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.FieldDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FieldDescriptorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // optional string extendee = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->extendee().data(), static_cast<int>(this->extendee().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FieldDescriptorProto.extendee");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->extendee(), output);
-  }
-
-  // optional int32 number = 3;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->number(), output);
-  }
-
-  // optional .google.protobuf.FieldDescriptorProto.Label label = 4;
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      4, this->label(), output);
-  }
-
-  // optional .google.protobuf.FieldDescriptorProto.Type type = 5;
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      5, this->type(), output);
-  }
-
-  // optional string type_name = 6;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type_name().data(), static_cast<int>(this->type_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FieldDescriptorProto.type_name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      6, this->type_name(), output);
-  }
-
-  // optional string default_value = 7;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->default_value().data(), static_cast<int>(this->default_value().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FieldDescriptorProto.default_value");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      7, this->default_value(), output);
-  }
-
-  // optional .google.protobuf.FieldOptions options = 8;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, *this->options_, output);
-  }
-
-  // optional int32 oneof_index = 9;
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->oneof_index(), output);
-  }
-
-  // optional string json_name = 10;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->json_name().data(), static_cast<int>(this->json_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FieldDescriptorProto.json_name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      10, this->json_name(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.FieldDescriptorProto)
+const char* FieldDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string name = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FieldDescriptorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string extendee = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_extendee();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FieldDescriptorProto.extendee");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 number = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_number(&has_bits);
+          number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .google.protobuf.FieldDescriptorProto.Label label = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label_IsValid(val))) {
+            _internal_set_label(static_cast<::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .google.protobuf.FieldDescriptorProto.Type type = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type_IsValid(val))) {
+            _internal_set_type(static_cast<::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string type_name = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          auto str = _internal_mutable_type_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FieldDescriptorProto.type_name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string default_value = 7;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          auto str = _internal_mutable_default_value();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FieldDescriptorProto.default_value");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .google.protobuf.FieldOptions options = 8;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 oneof_index = 9;
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+          _Internal::set_has_oneof_index(&has_bits);
+          oneof_index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string json_name = 10;
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          auto str = _internal_mutable_json_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FieldDescriptorProto.json_name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool proto3_optional = 17;
+      case 17:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
+          _Internal::set_has_proto3_optional(&has_bits);
+          proto3_optional_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* FieldDescriptorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* FieldDescriptorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FieldDescriptorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional string extendee = 2;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->extendee().data(), static_cast<int>(this->extendee().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_extendee().data(), static_cast<int>(this->_internal_extendee().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FieldDescriptorProto.extendee");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->extendee(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_extendee(), target);
   }
 
   // optional int32 number = 3;
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->number(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_number(), target);
   }
 
   // optional .google.protobuf.FieldDescriptorProto.Label label = 4;
-  if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      4, this->label(), target);
+  if (cached_has_bits & 0x00000200u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      4, this->_internal_label(), target);
   }
 
   // optional .google.protobuf.FieldDescriptorProto.Type type = 5;
-  if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      5, this->type(), target);
+  if (cached_has_bits & 0x00000400u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      5, this->_internal_type(), target);
   }
 
   // optional string type_name = 6;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type_name().data(), static_cast<int>(this->type_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_type_name().data(), static_cast<int>(this->_internal_type_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FieldDescriptorProto.type_name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        6, this->type_name(), target);
+    target = stream->WriteStringMaybeAliased(
+        6, this->_internal_type_name(), target);
   }
 
   // optional string default_value = 7;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->default_value().data(), static_cast<int>(this->default_value().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_default_value().data(), static_cast<int>(this->_internal_default_value().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FieldDescriptorProto.default_value");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        7, this->default_value(), target);
+    target = stream->WriteStringMaybeAliased(
+        7, this->_internal_default_value(), target);
   }
 
   // optional .google.protobuf.FieldOptions options = 8;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, *this->options_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        8, _Internal::options(this), target, stream);
   }
 
   // optional int32 oneof_index = 9;
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->oneof_index(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(9, this->_internal_oneof_index(), target);
   }
 
   // optional string json_name = 10;
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->json_name().data(), static_cast<int>(this->json_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_json_name().data(), static_cast<int>(this->_internal_json_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FieldDescriptorProto.json_name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        10, this->json_name(), target);
+    target = stream->WriteStringMaybeAliased(
+        10, this->_internal_json_name(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  // optional bool proto3_optional = 17;
+  if (cached_has_bits & 0x00000100u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(17, this->_internal_proto3_optional(), target);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldDescriptorProto)
   return target;
@@ -5021,131 +3891,125 @@ size_t FieldDescriptorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldDescriptorProto)
   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] & 255u) {
+  uint32_t 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 & 0x000000ffu) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional string extendee = 2;
-    if (has_extendee()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->extendee());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_extendee());
     }
 
     // optional string type_name = 6;
-    if (has_type_name()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->type_name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_type_name());
     }
 
     // optional string default_value = 7;
-    if (has_default_value()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->default_value());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_default_value());
     }
 
     // optional string json_name = 10;
-    if (has_json_name()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->json_name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_json_name());
     }
 
     // optional .google.protobuf.FieldOptions options = 8;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
     // optional int32 number = 3;
-    if (has_number()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->number());
+    if (cached_has_bits & 0x00000040u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_number());
     }
 
     // optional int32 oneof_index = 9;
-    if (has_oneof_index()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->oneof_index());
+    if (cached_has_bits & 0x00000080u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_oneof_index());
     }
 
   }
-  if (_has_bits_[8 / 32] & 768u) {
+  if (cached_has_bits & 0x00000700u) {
+    // optional bool proto3_optional = 17;
+    if (cached_has_bits & 0x00000100u) {
+      total_size += 2 + 1;
+    }
+
     // optional .google.protobuf.FieldDescriptorProto.Label label = 4;
-    if (has_label()) {
+    if (cached_has_bits & 0x00000200u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->label());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_label());
     }
 
     // optional .google.protobuf.FieldDescriptorProto.Type type = 5;
-    if (has_type()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FieldDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldDescriptorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FieldDescriptorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FieldDescriptorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldDescriptorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldDescriptorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FieldDescriptorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FieldDescriptorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FieldDescriptorProto::GetClassData() const { return &_class_data_; }
+
+void FieldDescriptorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FieldDescriptorProto *>(to)->MergeFrom(
+      static_cast<const FieldDescriptorProto &>(from));
 }
 
+
 void FieldDescriptorProto::MergeFrom(const FieldDescriptorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldDescriptorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_name(from.name());
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_extendee(from.extendee());
+      _internal_set_extendee(from._internal_extendee());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_type_name(from.type_name());
+      _internal_set_type_name(from._internal_type_name());
     }
     if (cached_has_bits & 0x00000008u) {
-      set_default_value(from.default_value());
+      _internal_set_default_value(from._internal_default_value());
     }
     if (cached_has_bits & 0x00000010u) {
-      set_json_name(from.json_name());
+      _internal_set_json_name(from._internal_json_name());
     }
     if (cached_has_bits & 0x00000020u) {
-      mutable_options()->::google::protobuf::FieldOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::FieldOptions::MergeFrom(from._internal_options());
     }
     if (cached_has_bits & 0x00000040u) {
       number_ = from.number_;
@@ -5155,22 +4019,19 @@ void FieldDescriptorProto::MergeFrom(const FieldDescriptorProto& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 768u) {
+  if (cached_has_bits & 0x00000700u) {
     if (cached_has_bits & 0x00000100u) {
-      label_ = from.label_;
+      proto3_optional_ = from.proto3_optional_;
     }
     if (cached_has_bits & 0x00000200u) {
+      label_ = from.label_;
+    }
+    if (cached_has_bits & 0x00000400u) {
       type_ = from.type_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void FieldDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FieldDescriptorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FieldDescriptorProto::CopyFrom(const FieldDescriptorProto& from) {
@@ -5181,131 +4042,124 @@ void FieldDescriptorProto::CopyFrom(const FieldDescriptorProto& from) {
 }
 
 bool FieldDescriptorProto::IsInitialized() const {
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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) {
   using std::swap;
-  name_.Swap(&other->name_);
-  extendee_.Swap(&other->extendee_);
-  type_name_.Swap(&other->type_name_);
-  default_value_.Swap(&other->default_value_);
-  json_name_.Swap(&other->json_name_);
-  swap(options_, other->options_);
-  swap(number_, other->number_);
-  swap(oneof_index_, other->oneof_index_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &extendee_, lhs_arena,
+      &other->extendee_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &type_name_, lhs_arena,
+      &other->type_name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &default_value_, lhs_arena,
+      &other->default_value_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &json_name_, lhs_arena,
+      &other->json_name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(FieldDescriptorProto, proto3_optional_)
+      + sizeof(FieldDescriptorProto::proto3_optional_)
+      - PROTOBUF_FIELD_OFFSET(FieldDescriptorProto, options_)>(
+          reinterpret_cast<char*>(&options_),
+          reinterpret_cast<char*>(&other->options_));
   swap(label_, other->label_);
   swap(type_, other->type_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata FieldDescriptorProto::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FieldDescriptorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[6]);
 }
 
-
 // ===================================================================
 
-void OneofDescriptorProto::InitAsDefaultInstance() {
-  ::google::protobuf::_OneofDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::OneofOptions*>(
-      ::google::protobuf::OneofOptions::internal_default_instance());
-}
-void OneofDescriptorProto::_slow_mutable_options() {
-  options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::OneofOptions >(
-      GetArenaNoVirtual());
-}
-void OneofDescriptorProto::unsafe_arena_set_allocated_options(
-    ::google::protobuf::OneofOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class OneofDescriptorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<OneofDescriptorProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
+  static const ::PROTOBUF_NAMESPACE_ID::OneofOptions& options(const OneofDescriptorProto* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofDescriptorProto.options)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int OneofDescriptorProto::kNameFieldNumber;
-const int OneofDescriptorProto::kOptionsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+};
 
-OneofDescriptorProto::OneofDescriptorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProto();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.OneofDescriptorProto)
+const ::PROTOBUF_NAMESPACE_ID::OneofOptions&
+OneofDescriptorProto::_Internal::options(const OneofDescriptorProto* msg) {
+  return *msg->options_;
 }
-OneofDescriptorProto::OneofDescriptorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProto();
+OneofDescriptorProto::OneofDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.OneofDescriptorProto)
 }
 OneofDescriptorProto::OneofDescriptorProto(const OneofDescriptorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::OneofOptions(*from.options_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::OneofOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
   // @@protoc_insertion_point(copy_constructor:google.protobuf.OneofDescriptorProto)
 }
 
-void OneofDescriptorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  options_ = NULL;
+inline void OneofDescriptorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+options_ = nullptr;
 }
 
 OneofDescriptorProto::~OneofDescriptorProto() {
   // @@protoc_insertion_point(destructor:google.protobuf.OneofDescriptorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void OneofDescriptorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void OneofDescriptorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete options_;
 }
 
@@ -5313,165 +4167,111 @@ void OneofDescriptorProto::ArenaDtor(void* object) {
   OneofDescriptorProto* _this = reinterpret_cast< OneofDescriptorProto* >(object);
   (void)_this;
 }
-void OneofDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void OneofDescriptorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const OneofDescriptorProto& OneofDescriptorProto::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProto();
-  return *internal_default_instance();
-}
-
-OneofDescriptorProto* OneofDescriptorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<OneofDescriptorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void OneofDescriptorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.OneofDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(options_ != NULL);
+      GOOGLE_DCHECK(options_ != nullptr);
       options_->Clear();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool OneofDescriptorProto::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
-  ::google::protobuf::uint32 tag;
-  // @@protoc_insertion_point(parse_start:google.protobuf.OneofDescriptorProto)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* OneofDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.OneofDescriptorProto.name");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.OneofDescriptorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.OneofOptions options = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } 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.OneofDescriptorProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.OneofDescriptorProto)
-  return false;
-#undef DO_
-}
-
-void OneofDescriptorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.OneofDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.OneofDescriptorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // optional .google.protobuf.OneofOptions options = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->options_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.OneofDescriptorProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* OneofDescriptorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* OneofDescriptorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.OneofDescriptorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional .google.protobuf.OneofOptions options = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, *this->options_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        2, _Internal::options(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.OneofDescriptorProto)
   return target;
@@ -5481,72 +4281,59 @@ size_t OneofDescriptorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.OneofDescriptorProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  if (_has_bits_[0 / 32] & 3u) {
+  uint32_t 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 & 0x00000003u) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional .google.protobuf.OneofOptions options = 2;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void OneofDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.OneofDescriptorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const OneofDescriptorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const OneofDescriptorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.OneofDescriptorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.OneofDescriptorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData OneofDescriptorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    OneofDescriptorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*OneofDescriptorProto::GetClassData() const { return &_class_data_; }
+
+void OneofDescriptorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<OneofDescriptorProto *>(to)->MergeFrom(
+      static_cast<const OneofDescriptorProto &>(from));
 }
 
+
 void OneofDescriptorProto::MergeFrom(const OneofDescriptorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.OneofDescriptorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_name(from.name());
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_options()->::google::protobuf::OneofOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::OneofOptions::MergeFrom(from._internal_options());
     }
   }
-}
-
-void OneofDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.OneofDescriptorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void OneofDescriptorProto::CopyFrom(const OneofDescriptorProto& from) {
@@ -5557,243 +4344,179 @@ void OneofDescriptorProto::CopyFrom(const OneofDescriptorProto& from) {
 }
 
 bool OneofDescriptorProto::IsInitialized() const {
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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) {
   using std::swap;
-  name_.Swap(&other->name_);
-  swap(options_, other->options_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  swap(options_, other->options_);
 }
 
-::google::protobuf::Metadata OneofDescriptorProto::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata OneofDescriptorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[7]);
 }
 
-
 // ===================================================================
 
-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();
+class EnumDescriptorProto_EnumReservedRange::_Internal {
+ public:
+  using HasBits = decltype(std::declval<EnumDescriptorProto_EnumReservedRange>()._has_bits_);
+  static void set_has_start(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_end(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   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);
+  if (!is_message_owned) {
+    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_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(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_));
+inline void EnumDescriptorProto_EnumReservedRange::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&start_) - reinterpret_cast<char*>(this)),
+    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)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void EnumDescriptorProto_EnumReservedRange::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void EnumDescriptorProto_EnumReservedRange::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 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::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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);
+  _cached_size_.Set(size);
 }
 
 void EnumDescriptorProto_EnumReservedRange::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.EnumDescriptorProto.EnumReservedRange)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     ::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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* EnumDescriptorProto_EnumReservedRange::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // 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 {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_start(&has_bits);
+          start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // 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 {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_end(&has_bits);
+          end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } 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;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.EnumDescriptorProto.EnumReservedRange)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-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
+uint8_t* EnumDescriptorProto_EnumReservedRange::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumDescriptorProto.EnumReservedRange)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_start(), target);
   }
 
   // optional int32 end = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_end(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumDescriptorProto.EnumReservedRange)
   return target;
@@ -5803,58 +4526,47 @@ 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) {
+  uint32_t 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 & 0x00000003u) {
     // optional int32 start = 1;
-    if (has_start()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->start());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_start());
     }
 
     // optional int32 end = 2;
-    if (has_end()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->end());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_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 {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumDescriptorProto.EnumReservedRange)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EnumDescriptorProto_EnumReservedRange::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    EnumDescriptorProto_EnumReservedRange::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EnumDescriptorProto_EnumReservedRange::GetClassData() const { return &_class_data_; }
+
+void EnumDescriptorProto_EnumReservedRange::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<EnumDescriptorProto_EnumReservedRange *>(to)->MergeFrom(
+      static_cast<const EnumDescriptorProto_EnumReservedRange &>(from));
 }
 
+
 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;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       start_ = from.start_;
     }
@@ -5863,13 +4575,7 @@ void EnumDescriptorProto_EnumReservedRange::MergeFrom(const EnumDescriptorProto_
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-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);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void EnumDescriptorProto_EnumReservedRange::CopyFrom(const EnumDescriptorProto_EnumReservedRange& from) {
@@ -5883,126 +4589,95 @@ bool EnumDescriptorProto_EnumReservedRange::IsInitialized() const {
   return true;
 }
 
-void EnumDescriptorProto_EnumReservedRange::Swap(EnumDescriptorProto_EnumReservedRange* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    EnumDescriptorProto_EnumReservedRange* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void EnumDescriptorProto_EnumReservedRange::UnsafeArenaSwap(EnumDescriptorProto_EnumReservedRange* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void EnumDescriptorProto_EnumReservedRange::InternalSwap(EnumDescriptorProto_EnumReservedRange* other) {
   using std::swap;
-  swap(start_, other->start_);
-  swap(end_, other->end_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(EnumDescriptorProto_EnumReservedRange, end_)
+      + sizeof(EnumDescriptorProto_EnumReservedRange::end_)
+      - PROTOBUF_FIELD_OFFSET(EnumDescriptorProto_EnumReservedRange, start_)>(
+          reinterpret_cast<char*>(&start_),
+          reinterpret_cast<char*>(&other->start_));
 }
 
-::google::protobuf::Metadata EnumDescriptorProto_EnumReservedRange::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata EnumDescriptorProto_EnumReservedRange::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[8]);
 }
 
-
 // ===================================================================
 
-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());
-}
-void EnumDescriptorProto::unsafe_arena_set_allocated_options(
-    ::google::protobuf::EnumOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class EnumDescriptorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<EnumDescriptorProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
+  static const ::PROTOBUF_NAMESPACE_ID::EnumOptions& options(const EnumDescriptorProto* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumDescriptorProto.options)
-}
-#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::InitDefaultsEnumDescriptorProto();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.EnumDescriptorProto)
+const ::PROTOBUF_NAMESPACE_ID::EnumOptions&
+EnumDescriptorProto::_Internal::options(const EnumDescriptorProto* msg) {
+  return *msg->options_;
 }
-EnumDescriptorProto::EnumDescriptorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+EnumDescriptorProto::EnumDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   value_(arena),
   reserved_range_(arena),
   reserved_name_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumDescriptorProto)
 }
 EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       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_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::EnumOptions(*from.options_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::EnumOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
   // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumDescriptorProto)
 }
 
-void EnumDescriptorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  options_ = NULL;
+inline void EnumDescriptorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+options_ = nullptr;
 }
 
 EnumDescriptorProto::~EnumDescriptorProto() {
   // @@protoc_insertion_point(destructor:google.protobuf.EnumDescriptorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void EnumDescriptorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void EnumDescriptorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete options_;
 }
 
@@ -6010,30 +4685,15 @@ void EnumDescriptorProto::ArenaDtor(void* object) {
   EnumDescriptorProto* _this = reinterpret_cast< EnumDescriptorProto* >(object);
   (void)_this;
 }
-void EnumDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void EnumDescriptorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const EnumDescriptorProto& EnumDescriptorProto::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto();
-  return *internal_default_instance();
-}
-
-EnumDescriptorProto* EnumDescriptorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<EnumDescriptorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void EnumDescriptorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.EnumDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -6041,226 +4701,167 @@ void EnumDescriptorProto::Clear() {
   reserved_range_.Clear();
   reserved_name_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(options_ != NULL);
+      GOOGLE_DCHECK(options_ != nullptr);
       options_->Clear();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool EnumDescriptorProto::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)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.EnumDescriptorProto.name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.EnumValueDescriptorProto value = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_value()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .google.protobuf.EnumOptions options = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(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) {
-          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)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.EnumDescriptorProto)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void EnumDescriptorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.EnumDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.EnumDescriptorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // repeated .google.protobuf.EnumValueDescriptorProto value = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->value_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->value(static_cast<int>(i)), output);
-  }
-
-  // optional .google.protobuf.EnumOptions options = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      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);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.EnumDescriptorProto)
+const char* EnumDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string name = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.EnumDescriptorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.EnumValueDescriptorProto value = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_value(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .google.protobuf.EnumOptions options = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_reserved_range(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string reserved_name = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_reserved_name();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.EnumDescriptorProto.reserved_name");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* EnumDescriptorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* EnumDescriptorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.EnumDescriptorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // repeated .google.protobuf.EnumValueDescriptorProto value = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->value_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->value(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_value_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_value(i), target, stream);
   }
 
   // optional .google.protobuf.EnumOptions options = 3;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->options_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::options(this), target, stream);
   }
 
   // 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::
-      InternalWriteMessageToArray(
-        4, this->reserved_range(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_reserved_range_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(4, this->_internal_reserved_range(i), target, stream);
   }
 
   // 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,
+  for (int i = 0, n = this->_internal_reserved_name_size(); i < n; i++) {
+    const auto& s = this->_internal_reserved_name(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.EnumDescriptorProto.reserved_name");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(5, this->reserved_name(i), target);
+    target = stream->WriteString(5, s, target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumDescriptorProto)
   return target;
@@ -6270,105 +4871,84 @@ size_t EnumDescriptorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumDescriptorProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.EnumValueDescriptorProto value = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->value_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->value(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_value_size();
+  for (const auto& msg : this->value_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // 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::MessageSize(
-          this->reserved_range(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_reserved_range_size();
+  for (const auto& msg : this->reserved_range_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // 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));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(reserved_name_.size());
+  for (int i = 0, n = reserved_name_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      reserved_name_.Get(i));
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional .google.protobuf.EnumOptions options = 3;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void EnumDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumDescriptorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const EnumDescriptorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const EnumDescriptorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumDescriptorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumDescriptorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EnumDescriptorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    EnumDescriptorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EnumDescriptorProto::GetClassData() const { return &_class_data_; }
+
+void EnumDescriptorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<EnumDescriptorProto *>(to)->MergeFrom(
+      static_cast<const EnumDescriptorProto &>(from));
 }
 
+
 void EnumDescriptorProto::MergeFrom(const EnumDescriptorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumDescriptorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (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 & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_name(from.name());
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_options()->::google::protobuf::EnumOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::EnumOptions::MergeFrom(from._internal_options());
     }
   }
-}
-
-void EnumDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumDescriptorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void EnumDescriptorProto::CopyFrom(const EnumDescriptorProto& from) {
@@ -6379,131 +4959,109 @@ void EnumDescriptorProto::CopyFrom(const EnumDescriptorProto& from) {
 }
 
 bool EnumDescriptorProto::IsInitialized() const {
-  if (!::google::protobuf::internal::AllAreInitialized(this->value())) return false;
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(value_))
+    return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   value_.InternalSwap(&other->value_);
   reserved_range_.InternalSwap(&other->reserved_range_);
   reserved_name_.InternalSwap(&other->reserved_name_);
-  name_.Swap(&other->name_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
   swap(options_, other->options_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata EnumDescriptorProto::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata EnumDescriptorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[9]);
 }
 
-
 // ===================================================================
 
-void EnumValueDescriptorProto::InitAsDefaultInstance() {
-  ::google::protobuf::_EnumValueDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::EnumValueOptions*>(
-      ::google::protobuf::EnumValueOptions::internal_default_instance());
-}
-void EnumValueDescriptorProto::_slow_mutable_options() {
-  options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::EnumValueOptions >(
-      GetArenaNoVirtual());
-}
-void EnumValueDescriptorProto::unsafe_arena_set_allocated_options(
-    ::google::protobuf::EnumValueOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class EnumValueDescriptorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<EnumValueDescriptorProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
+  static void set_has_number(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueDescriptorProto.options)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int EnumValueDescriptorProto::kNameFieldNumber;
-const int EnumValueDescriptorProto::kNumberFieldNumber;
-const int EnumValueDescriptorProto::kOptionsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-EnumValueDescriptorProto::EnumValueDescriptorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProto();
+  static const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions& options(const EnumValueDescriptorProto* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.EnumValueDescriptorProto)
+};
+
+const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions&
+EnumValueDescriptorProto::_Internal::options(const EnumValueDescriptorProto* msg) {
+  return *msg->options_;
 }
-EnumValueDescriptorProto::EnumValueDescriptorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProto();
+EnumValueDescriptorProto::EnumValueDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValueDescriptorProto)
 }
 EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::EnumValueOptions(*from.options_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::EnumValueOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
   number_ = from.number_;
   // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumValueDescriptorProto)
 }
 
-void EnumValueDescriptorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&options_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&number_) -
-      reinterpret_cast<char*>(&options_)) + sizeof(number_));
+inline void EnumValueDescriptorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&options_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&number_) -
+    reinterpret_cast<char*>(&options_)) + sizeof(number_));
 }
 
 EnumValueDescriptorProto::~EnumValueDescriptorProto() {
   // @@protoc_insertion_point(destructor:google.protobuf.EnumValueDescriptorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void EnumValueDescriptorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void EnumValueDescriptorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete options_;
 }
 
@@ -6511,190 +5069,127 @@ void EnumValueDescriptorProto::ArenaDtor(void* object) {
   EnumValueDescriptorProto* _this = reinterpret_cast< EnumValueDescriptorProto* >(object);
   (void)_this;
 }
-void EnumValueDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void EnumValueDescriptorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const EnumValueDescriptorProto& EnumValueDescriptorProto::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProto();
-  return *internal_default_instance();
-}
-
-EnumValueDescriptorProto* EnumValueDescriptorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<EnumValueDescriptorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void EnumValueDescriptorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.EnumValueDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(options_ != NULL);
+      GOOGLE_DCHECK(options_ != nullptr);
       options_->Clear();
     }
   }
   number_ = 0;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool EnumValueDescriptorProto::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.EnumValueDescriptorProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* EnumValueDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.EnumValueDescriptorProto.name");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.EnumValueDescriptorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int32 number = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_number();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &number_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_number(&has_bits);
+          number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.EnumValueOptions options = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } 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.EnumValueDescriptorProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.EnumValueDescriptorProto)
-  return false;
-#undef DO_
-}
-
-void EnumValueDescriptorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.EnumValueDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.EnumValueDescriptorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // optional int32 number = 2;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->number(), output);
-  }
-
-  // optional .google.protobuf.EnumValueOptions options = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->options_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValueDescriptorProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* EnumValueDescriptorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* EnumValueDescriptorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.EnumValueDescriptorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional int32 number = 2;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->number(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_number(), target);
   }
 
   // optional .google.protobuf.EnumValueOptions options = 3;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->options_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::options(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValueDescriptorProto)
   return target;
@@ -6704,83 +5199,68 @@ size_t EnumValueDescriptorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumValueDescriptorProto)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional .google.protobuf.EnumValueOptions options = 3;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
     // optional int32 number = 2;
-    if (has_number()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->number());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_number());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void EnumValueDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumValueDescriptorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const EnumValueDescriptorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const EnumValueDescriptorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValueDescriptorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumValueDescriptorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EnumValueDescriptorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    EnumValueDescriptorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EnumValueDescriptorProto::GetClassData() const { return &_class_data_; }
+
+void EnumValueDescriptorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<EnumValueDescriptorProto *>(to)->MergeFrom(
+      static_cast<const EnumValueDescriptorProto &>(from));
 }
 
+
 void EnumValueDescriptorProto::MergeFrom(const EnumValueDescriptorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumValueDescriptorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      set_name(from.name());
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_options()->::google::protobuf::EnumValueOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::EnumValueOptions::MergeFrom(from._internal_options());
     }
     if (cached_has_bits & 0x00000004u) {
       number_ = from.number_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void EnumValueDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumValueDescriptorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void EnumValueDescriptorProto::CopyFrom(const EnumValueDescriptorProto& from) {
@@ -6791,127 +5271,104 @@ void EnumValueDescriptorProto::CopyFrom(const EnumValueDescriptorProto& from) {
 }
 
 bool EnumValueDescriptorProto::IsInitialized() const {
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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) {
   using std::swap;
-  name_.Swap(&other->name_);
-  swap(options_, other->options_);
-  swap(number_, other->number_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(EnumValueDescriptorProto, number_)
+      + sizeof(EnumValueDescriptorProto::number_)
+      - PROTOBUF_FIELD_OFFSET(EnumValueDescriptorProto, options_)>(
+          reinterpret_cast<char*>(&options_),
+          reinterpret_cast<char*>(&other->options_));
 }
 
-::google::protobuf::Metadata EnumValueDescriptorProto::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata EnumValueDescriptorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[10]);
 }
 
-
 // ===================================================================
 
-void ServiceDescriptorProto::InitAsDefaultInstance() {
-  ::google::protobuf::_ServiceDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::ServiceOptions*>(
-      ::google::protobuf::ServiceOptions::internal_default_instance());
-}
-void ServiceDescriptorProto::_slow_mutable_options() {
-  options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ServiceOptions >(
-      GetArenaNoVirtual());
-}
-void ServiceDescriptorProto::unsafe_arena_set_allocated_options(
-    ::google::protobuf::ServiceOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class ServiceDescriptorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ServiceDescriptorProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
+  static const ::PROTOBUF_NAMESPACE_ID::ServiceOptions& options(const ServiceDescriptorProto* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceDescriptorProto.options)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ServiceDescriptorProto::kNameFieldNumber;
-const int ServiceDescriptorProto::kMethodFieldNumber;
-const int ServiceDescriptorProto::kOptionsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+};
 
-ServiceDescriptorProto::ServiceDescriptorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProto();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.ServiceDescriptorProto)
+const ::PROTOBUF_NAMESPACE_ID::ServiceOptions&
+ServiceDescriptorProto::_Internal::options(const ServiceDescriptorProto* msg) {
+  return *msg->options_;
 }
-ServiceDescriptorProto::ServiceDescriptorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+ServiceDescriptorProto::ServiceDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   method_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProto();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.ServiceDescriptorProto)
 }
 ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       method_(from.method_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::ServiceOptions(*from.options_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::ServiceOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
   // @@protoc_insertion_point(copy_constructor:google.protobuf.ServiceDescriptorProto)
 }
 
-void ServiceDescriptorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  options_ = NULL;
+inline void ServiceDescriptorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+options_ = nullptr;
 }
 
 ServiceDescriptorProto::~ServiceDescriptorProto() {
   // @@protoc_insertion_point(destructor:google.protobuf.ServiceDescriptorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ServiceDescriptorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void ServiceDescriptorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete options_;
 }
 
@@ -6919,192 +5376,133 @@ void ServiceDescriptorProto::ArenaDtor(void* object) {
   ServiceDescriptorProto* _this = reinterpret_cast< ServiceDescriptorProto* >(object);
   (void)_this;
 }
-void ServiceDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void ServiceDescriptorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const ServiceDescriptorProto& ServiceDescriptorProto::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProto();
-  return *internal_default_instance();
-}
-
-ServiceDescriptorProto* ServiceDescriptorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<ServiceDescriptorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void ServiceDescriptorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.ServiceDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   method_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(options_ != NULL);
+      GOOGLE_DCHECK(options_ != nullptr);
       options_->Clear();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ServiceDescriptorProto::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.ServiceDescriptorProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* ServiceDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.ServiceDescriptorProto.name");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.ServiceDescriptorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.MethodDescriptorProto method = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_method()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_method(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.ServiceOptions options = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } 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.ServiceDescriptorProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.ServiceDescriptorProto)
-  return false;
-#undef DO_
-}
-
-void ServiceDescriptorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.ServiceDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.ServiceDescriptorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // repeated .google.protobuf.MethodDescriptorProto method = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->method_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->method(static_cast<int>(i)), output);
-  }
-
-  // optional .google.protobuf.ServiceOptions options = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->options_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.ServiceDescriptorProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ServiceDescriptorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ServiceDescriptorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.ServiceDescriptorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // repeated .google.protobuf.MethodDescriptorProto method = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->method_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->method(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_method_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_method(i), target, stream);
   }
 
   // optional .google.protobuf.ServiceOptions options = 3;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->options_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::options(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ServiceDescriptorProto)
   return target;
@@ -7114,84 +5512,67 @@ size_t ServiceDescriptorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.ServiceDescriptorProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.MethodDescriptorProto method = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->method_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->method(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_method_size();
+  for (const auto& msg : this->method_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional .google.protobuf.ServiceOptions options = 3;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ServiceDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ServiceDescriptorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ServiceDescriptorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ServiceDescriptorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ServiceDescriptorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ServiceDescriptorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ServiceDescriptorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ServiceDescriptorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ServiceDescriptorProto::GetClassData() const { return &_class_data_; }
+
+void ServiceDescriptorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ServiceDescriptorProto *>(to)->MergeFrom(
+      static_cast<const ServiceDescriptorProto &>(from));
 }
 
+
 void ServiceDescriptorProto::MergeFrom(const ServiceDescriptorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ServiceDescriptorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   method_.MergeFrom(from.method_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_name(from.name());
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_options()->::google::protobuf::ServiceOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::ServiceOptions::MergeFrom(from._internal_options());
     }
   }
-}
-
-void ServiceDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ServiceDescriptorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ServiceDescriptorProto::CopyFrom(const ServiceDescriptorProto& from) {
@@ -7202,121 +5583,106 @@ void ServiceDescriptorProto::CopyFrom(const ServiceDescriptorProto& from) {
 }
 
 bool ServiceDescriptorProto::IsInitialized() const {
-  if (!::google::protobuf::internal::AllAreInitialized(this->method())) return false;
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(method_))
+    return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   method_.InternalSwap(&other->method_);
-  name_.Swap(&other->name_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
   swap(options_, other->options_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ServiceDescriptorProto::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ServiceDescriptorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[11]);
 }
 
-
 // ===================================================================
 
-void MethodDescriptorProto::InitAsDefaultInstance() {
-  ::google::protobuf::_MethodDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::MethodOptions*>(
-      ::google::protobuf::MethodOptions::internal_default_instance());
-}
-void MethodDescriptorProto::_slow_mutable_options() {
-  options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::MethodOptions >(
-      GetArenaNoVirtual());
-}
-void MethodDescriptorProto::unsafe_arena_set_allocated_options(
-    ::google::protobuf::MethodOptions* options) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete options_;
+class MethodDescriptorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<MethodDescriptorProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  options_ = options;
-  if (options) {
-    set_has_options();
-  } else {
-    clear_has_options();
+  static void set_has_input_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.options)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int MethodDescriptorProto::kNameFieldNumber;
-const int MethodDescriptorProto::kInputTypeFieldNumber;
-const int MethodDescriptorProto::kOutputTypeFieldNumber;
-const int MethodDescriptorProto::kOptionsFieldNumber;
-const int MethodDescriptorProto::kClientStreamingFieldNumber;
-const int MethodDescriptorProto::kServerStreamingFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-MethodDescriptorProto::MethodDescriptorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProto();
+  static void set_has_output_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.MethodDescriptorProto)
+  static const ::PROTOBUF_NAMESPACE_ID::MethodOptions& options(const MethodDescriptorProto* msg);
+  static void set_has_options(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_client_streaming(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_server_streaming(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+};
+
+const ::PROTOBUF_NAMESPACE_ID::MethodOptions&
+MethodDescriptorProto::_Internal::options(const MethodDescriptorProto* msg) {
+  return *msg->options_;
 }
-MethodDescriptorProto::MethodDescriptorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProto();
+MethodDescriptorProto::MethodDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.MethodDescriptorProto)
 }
 MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  input_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_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_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_type(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_options()) {
-    options_ = new ::google::protobuf::MethodOptions(*from.options_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
+      GetArenaForAllocation());
+  }
+  input_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    input_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_input_type()) {
+    input_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_input_type(), 
+      GetArenaForAllocation());
+  }
+  output_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    output_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_output_type()) {
+    output_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_output_type(), 
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_options()) {
+    options_ = new ::PROTOBUF_NAMESPACE_ID::MethodOptions(*from.options_);
   } else {
-    options_ = NULL;
+    options_ = nullptr;
   }
   ::memcpy(&client_streaming_, &from.client_streaming_,
     static_cast<size_t>(reinterpret_cast<char*>(&server_streaming_) -
@@ -7324,26 +5690,37 @@ MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from)
   // @@protoc_insertion_point(copy_constructor:google.protobuf.MethodDescriptorProto)
 }
 
-void MethodDescriptorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  input_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  output_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&options_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&server_streaming_) -
-      reinterpret_cast<char*>(&options_)) + sizeof(server_streaming_));
+inline void MethodDescriptorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+input_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  input_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+output_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  output_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&options_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&server_streaming_) -
+    reinterpret_cast<char*>(&options_)) + sizeof(server_streaming_));
 }
 
 MethodDescriptorProto::~MethodDescriptorProto() {
   // @@protoc_insertion_point(destructor:google.protobuf.MethodDescriptorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void MethodDescriptorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  input_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  output_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void MethodDescriptorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  input_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  output_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete options_;
 }
 
@@ -7351,49 +5728,31 @@ void MethodDescriptorProto::ArenaDtor(void* object) {
   MethodDescriptorProto* _this = reinterpret_cast< MethodDescriptorProto* >(object);
   (void)_this;
 }
-void MethodDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void MethodDescriptorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const MethodDescriptorProto& MethodDescriptorProto::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProto();
-  return *internal_default_instance();
-}
-
-MethodDescriptorProto* MethodDescriptorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<MethodDescriptorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void MethodDescriptorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.MethodDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!input_type_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      input_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      input_type_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!output_type_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      output_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      output_type_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(options_ != NULL);
+      GOOGLE_DCHECK(options_ != nullptr);
       options_->Clear();
     }
   }
@@ -7401,248 +5760,162 @@ void MethodDescriptorProto::Clear() {
       reinterpret_cast<char*>(&server_streaming_) -
       reinterpret_cast<char*>(&client_streaming_)) + sizeof(server_streaming_));
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool MethodDescriptorProto::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.MethodDescriptorProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* MethodDescriptorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.MethodDescriptorProto.name");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.MethodDescriptorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string input_type = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_input_type()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->input_type().data(), static_cast<int>(this->input_type().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.MethodDescriptorProto.input_type");
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_input_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.MethodDescriptorProto.input_type");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string output_type = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_output_type()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->output_type().data(), static_cast<int>(this->output_type().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.MethodDescriptorProto.output_type");
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_output_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.MethodDescriptorProto.output_type");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.MethodOptions options = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_options()));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_options(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool client_streaming = 5 [default = false];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_client_streaming();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &client_streaming_)));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_client_streaming(&has_bits);
+          client_streaming_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool server_streaming = 6 [default = false];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_server_streaming();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &server_streaming_)));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_server_streaming(&has_bits);
+          server_streaming_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } 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.MethodDescriptorProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.MethodDescriptorProto)
-  return false;
-#undef DO_
-}
-
-void MethodDescriptorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.MethodDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.MethodDescriptorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // optional string input_type = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->input_type().data(), static_cast<int>(this->input_type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.MethodDescriptorProto.input_type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->input_type(), output);
-  }
-
-  // optional string output_type = 3;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output_type().data(), static_cast<int>(this->output_type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.MethodDescriptorProto.output_type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->output_type(), output);
-  }
-
-  // optional .google.protobuf.MethodOptions options = 4;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, *this->options_, output);
-  }
-
-  // optional bool client_streaming = 5 [default = false];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->client_streaming(), output);
-  }
-
-  // optional bool server_streaming = 6 [default = false];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->server_streaming(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.MethodDescriptorProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* MethodDescriptorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* MethodDescriptorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodDescriptorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.MethodDescriptorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional string input_type = 2;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->input_type().data(), static_cast<int>(this->input_type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_input_type().data(), static_cast<int>(this->_internal_input_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.MethodDescriptorProto.input_type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->input_type(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_input_type(), target);
   }
 
   // optional string output_type = 3;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output_type().data(), static_cast<int>(this->output_type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_output_type().data(), static_cast<int>(this->_internal_output_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.MethodDescriptorProto.output_type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->output_type(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_output_type(), target);
   }
 
   // optional .google.protobuf.MethodOptions options = 4;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, *this->options_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        4, _Internal::options(this), target, stream);
   }
 
   // optional bool client_streaming = 5 [default = false];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->client_streaming(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_client_streaming(), target);
   }
 
   // optional bool server_streaming = 6 [default = false];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->server_streaming(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_server_streaming(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MethodDescriptorProto)
   return target;
@@ -7652,93 +5925,86 @@ size_t MethodDescriptorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.MethodDescriptorProto)
   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] & 63u) {
+  uint32_t 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 & 0x0000003fu) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional string input_type = 2;
-    if (has_input_type()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->input_type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_input_type());
     }
 
     // optional string output_type = 3;
-    if (has_output_type()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->output_type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_output_type());
     }
 
     // optional .google.protobuf.MethodOptions options = 4;
-    if (has_options()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->options_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *options_);
     }
 
     // optional bool client_streaming = 5 [default = false];
-    if (has_client_streaming()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 + 1;
     }
 
     // optional bool server_streaming = 6 [default = false];
-    if (has_server_streaming()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void MethodDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.MethodDescriptorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const MethodDescriptorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const MethodDescriptorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MethodDescriptorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.MethodDescriptorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MethodDescriptorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    MethodDescriptorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MethodDescriptorProto::GetClassData() const { return &_class_data_; }
+
+void MethodDescriptorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<MethodDescriptorProto *>(to)->MergeFrom(
+      static_cast<const MethodDescriptorProto &>(from));
 }
 
+
 void MethodDescriptorProto::MergeFrom(const MethodDescriptorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.MethodDescriptorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_name(from.name());
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_input_type(from.input_type());
+      _internal_set_input_type(from._internal_input_type());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_output_type(from.output_type());
+      _internal_set_output_type(from._internal_output_type());
     }
     if (cached_has_bits & 0x00000008u) {
-      mutable_options()->::google::protobuf::MethodOptions::MergeFrom(from.options());
+      _internal_mutable_options()->::PROTOBUF_NAMESPACE_ID::MethodOptions::MergeFrom(from._internal_options());
     }
     if (cached_has_bits & 0x00000010u) {
       client_streaming_ = from.client_streaming_;
@@ -7748,13 +6014,7 @@ void MethodDescriptorProto::MergeFrom(const MethodDescriptorProto& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void MethodDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.MethodDescriptorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void MethodDescriptorProto::CopyFrom(const MethodDescriptorProto& from) {
@@ -7765,901 +6025,802 @@ void MethodDescriptorProto::CopyFrom(const MethodDescriptorProto& from) {
 }
 
 bool MethodDescriptorProto::IsInitialized() const {
-  if (has_options()) {
-    if (!this->options_->IsInitialized()) return false;
+  if (_internal_has_options()) {
+    if (!options_->IsInitialized()) return false;
   }
   return true;
 }
 
-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) {
   using std::swap;
-  name_.Swap(&other->name_);
-  input_type_.Swap(&other->input_type_);
-  output_type_.Swap(&other->output_type_);
-  swap(options_, other->options_);
-  swap(client_streaming_, other->client_streaming_);
-  swap(server_streaming_, other->server_streaming_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata MethodDescriptorProto::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &input_type_, lhs_arena,
+      &other->input_type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &output_type_, lhs_arena,
+      &other->output_type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(MethodDescriptorProto, server_streaming_)
+      + sizeof(MethodDescriptorProto::server_streaming_)
+      - PROTOBUF_FIELD_OFFSET(MethodDescriptorProto, options_)>(
+          reinterpret_cast<char*>(&options_),
+          reinterpret_cast<char*>(&other->options_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata MethodDescriptorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[12]);
 }
 
-
 // ===================================================================
 
-void FileOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FileOptions::kJavaPackageFieldNumber;
-const int FileOptions::kJavaOuterClassnameFieldNumber;
-const int FileOptions::kJavaMultipleFilesFieldNumber;
-const int FileOptions::kJavaGenerateEqualsAndHashFieldNumber;
-const int FileOptions::kJavaStringCheckUtf8FieldNumber;
-const int FileOptions::kOptimizeForFieldNumber;
-const int FileOptions::kGoPackageFieldNumber;
-const int FileOptions::kCcGenericServicesFieldNumber;
-const int FileOptions::kJavaGenericServicesFieldNumber;
-const int FileOptions::kPyGenericServicesFieldNumber;
-const int FileOptions::kPhpGenericServicesFieldNumber;
-const int FileOptions::kDeprecatedFieldNumber;
-const int FileOptions::kCcEnableArenasFieldNumber;
-const int FileOptions::kObjcClassPrefixFieldNumber;
-const int FileOptions::kCsharpNamespaceFieldNumber;
-const int FileOptions::kSwiftPrefixFieldNumber;
-const int FileOptions::kPhpClassPrefixFieldNumber;
-const int FileOptions::kPhpNamespaceFieldNumber;
-const int FileOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FileOptions::FileOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptions();
+class FileOptions::_Internal {
+ public:
+  using HasBits = decltype(std::declval<FileOptions>()._has_bits_);
+  static void set_has_java_package(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.FileOptions)
-}
-FileOptions::FileOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+  static void set_has_java_outer_classname(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_java_multiple_files(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
+  }
+  static void set_has_java_generate_equals_and_hash(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
+  }
+  static void set_has_java_string_check_utf8(HasBits* has_bits) {
+    (*has_bits)[0] |= 4096u;
+  }
+  static void set_has_optimize_for(HasBits* has_bits) {
+    (*has_bits)[0] |= 262144u;
+  }
+  static void set_has_go_package(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_cc_generic_services(HasBits* has_bits) {
+    (*has_bits)[0] |= 8192u;
+  }
+  static void set_has_java_generic_services(HasBits* has_bits) {
+    (*has_bits)[0] |= 16384u;
+  }
+  static void set_has_py_generic_services(HasBits* has_bits) {
+    (*has_bits)[0] |= 32768u;
+  }
+  static void set_has_php_generic_services(HasBits* has_bits) {
+    (*has_bits)[0] |= 65536u;
+  }
+  static void set_has_deprecated(HasBits* has_bits) {
+    (*has_bits)[0] |= 131072u;
+  }
+  static void set_has_cc_enable_arenas(HasBits* has_bits) {
+    (*has_bits)[0] |= 524288u;
+  }
+  static void set_has_objc_class_prefix(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_csharp_namespace(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_swift_prefix(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_php_class_prefix(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_php_namespace(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static void set_has_php_metadata_namespace(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static void set_has_ruby_package(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+};
+
+FileOptions::FileOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.FileOptions)
 }
 FileOptions::FileOptions(const FileOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
-  java_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_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_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_outer_classname(),
-      GetArenaNoVirtual());
-  }
-  go_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_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_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.objc_class_prefix(),
-      GetArenaNoVirtual());
-  }
-  csharp_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_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_.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_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_class_prefix(),
-      GetArenaNoVirtual());
-  }
-  php_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_php_namespace()) {
-    php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_namespace(),
-      GetArenaNoVirtual());
-  }
-  ::memcpy(&cc_enable_arenas_, &from.cc_enable_arenas_,
-    static_cast<size_t>(reinterpret_cast<char*>(&optimize_for_) -
-    reinterpret_cast<char*>(&cc_enable_arenas_)) + sizeof(optimize_for_));
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  java_package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    java_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_java_package()) {
+    java_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_java_package(), 
+      GetArenaForAllocation());
+  }
+  java_outer_classname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    java_outer_classname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_java_outer_classname()) {
+    java_outer_classname_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_java_outer_classname(), 
+      GetArenaForAllocation());
+  }
+  go_package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    go_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_go_package()) {
+    go_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_go_package(), 
+      GetArenaForAllocation());
+  }
+  objc_class_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    objc_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_objc_class_prefix()) {
+    objc_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_objc_class_prefix(), 
+      GetArenaForAllocation());
+  }
+  csharp_namespace_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    csharp_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_csharp_namespace()) {
+    csharp_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_csharp_namespace(), 
+      GetArenaForAllocation());
+  }
+  swift_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    swift_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_swift_prefix()) {
+    swift_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_swift_prefix(), 
+      GetArenaForAllocation());
+  }
+  php_class_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    php_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_php_class_prefix()) {
+    php_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_php_class_prefix(), 
+      GetArenaForAllocation());
+  }
+  php_namespace_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    php_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_php_namespace()) {
+    php_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_php_namespace(), 
+      GetArenaForAllocation());
+  }
+  php_metadata_namespace_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    php_metadata_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_php_metadata_namespace()) {
+    php_metadata_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_php_metadata_namespace(), 
+      GetArenaForAllocation());
+  }
+  ruby_package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    ruby_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_ruby_package()) {
+    ruby_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_ruby_package(), 
+      GetArenaForAllocation());
+  }
+  ::memcpy(&java_multiple_files_, &from.java_multiple_files_,
+    static_cast<size_t>(reinterpret_cast<char*>(&cc_enable_arenas_) -
+    reinterpret_cast<char*>(&java_multiple_files_)) + sizeof(cc_enable_arenas_));
   // @@protoc_insertion_point(copy_constructor:google.protobuf.FileOptions)
 }
 
-void FileOptions::SharedCtor() {
-  _cached_size_ = 0;
-  java_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  java_outer_classname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  go_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  objc_class_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  csharp_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  swift_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  php_class_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  php_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&cc_enable_arenas_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&deprecated_) -
-      reinterpret_cast<char*>(&cc_enable_arenas_)) + sizeof(deprecated_));
-  optimize_for_ = 1;
+inline void FileOptions::SharedCtor() {
+java_package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  java_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+java_outer_classname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  java_outer_classname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+go_package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  go_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+objc_class_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  objc_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+csharp_namespace_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  csharp_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+swift_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  swift_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+php_class_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  php_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+php_namespace_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  php_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+php_metadata_namespace_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  php_metadata_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ruby_package_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  ruby_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&java_multiple_files_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&deprecated_) -
+    reinterpret_cast<char*>(&java_multiple_files_)) + sizeof(deprecated_));
+optimize_for_ = 1;
+cc_enable_arenas_ = true;
 }
 
 FileOptions::~FileOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.FileOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FileOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  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());
+inline void FileOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  java_package_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  java_outer_classname_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  go_package_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  objc_class_prefix_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  csharp_namespace_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  swift_prefix_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  php_class_prefix_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  php_namespace_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  php_metadata_namespace_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  ruby_package_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void FileOptions::ArenaDtor(void* object) {
   FileOptions* _this = reinterpret_cast< FileOptions* >(object);
   (void)_this;
 }
-void FileOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void FileOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const FileOptions& FileOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptions();
-  return *internal_default_instance();
-}
-
-FileOptions* FileOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FileOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void FileOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.FileOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   _extensions_.Clear();
   uninterpreted_option_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!java_package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      java_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      java_package_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!java_outer_classname_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      java_outer_classname_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      java_outer_classname_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!go_package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      go_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      go_package_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!objc_class_prefix_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      objc_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      objc_class_prefix_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(!csharp_namespace_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      csharp_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      csharp_namespace_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000020u) {
-      GOOGLE_DCHECK(!swift_prefix_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      swift_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      swift_prefix_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000040u) {
-      GOOGLE_DCHECK(!php_class_prefix_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      php_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      php_class_prefix_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000080u) {
-      GOOGLE_DCHECK(!php_namespace_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      php_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      php_namespace_.ClearNonDefaultToEmpty();
+    }
+  }
+  if (cached_has_bits & 0x00000300u) {
+    if (cached_has_bits & 0x00000100u) {
+      php_metadata_namespace_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000200u) {
+      ruby_package_.ClearNonDefaultToEmpty();
     }
   }
-  if (cached_has_bits & 65280u) {
-    ::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 & 0x0000fc00u) {
+    ::memset(&java_multiple_files_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&py_generic_services_) -
+        reinterpret_cast<char*>(&java_multiple_files_)) + sizeof(py_generic_services_));
   }
-  if (cached_has_bits & 196608u) {
-    deprecated_ = false;
+  if (cached_has_bits & 0x000f0000u) {
+    ::memset(&php_generic_services_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&deprecated_) -
+        reinterpret_cast<char*>(&php_generic_services_)) + sizeof(deprecated_));
     optimize_for_ = 1;
+    cc_enable_arenas_ = true;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FileOptions::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.FileOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* FileOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string java_package = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_java_package()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->java_package().data(), static_cast<int>(this->java_package().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileOptions.java_package");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_java_package();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.java_package");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string java_outer_classname = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_java_outer_classname()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->java_outer_classname().data(), static_cast<int>(this->java_outer_classname().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileOptions.java_outer_classname");
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          auto str = _internal_mutable_java_outer_classname();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.java_outer_classname");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::google::protobuf::FileOptions_OptimizeMode_IsValid(value)) {
-            set_optimize_for(static_cast< ::google::protobuf::FileOptions_OptimizeMode >(value));
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode_IsValid(val))) {
+            _internal_set_optimize_for(static_cast<::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                9, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(9, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool java_multiple_files = 10 [default = false];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_java_multiple_files();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &java_multiple_files_)));
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_java_multiple_files(&has_bits);
+          java_multiple_files_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string go_package = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_go_package()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->go_package().data(), static_cast<int>(this->go_package().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileOptions.go_package");
-        } else {
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          auto str = _internal_mutable_go_package();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.go_package");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool cc_generic_services = 16 [default = false];
-      case 16: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) {
-          set_has_cc_generic_services();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &cc_generic_services_)));
-        } else {
+      case 16:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
+          _Internal::set_has_cc_generic_services(&has_bits);
+          cc_generic_services_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool java_generic_services = 17 [default = false];
-      case 17: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) {
-          set_has_java_generic_services();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &java_generic_services_)));
-        } else {
+      case 17:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
+          _Internal::set_has_java_generic_services(&has_bits);
+          java_generic_services_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool py_generic_services = 18 [default = false];
-      case 18: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(144u /* 144 & 0xFF */)) {
-          set_has_py_generic_services();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &py_generic_services_)));
-        } else {
+      case 18:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
+          _Internal::set_has_py_generic_services(&has_bits);
+          py_generic_services_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool java_generate_equals_and_hash = 20 [deprecated = true];
-      case 20: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(160u /* 160 & 0xFF */)) {
-          set_has_java_generate_equals_and_hash();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &java_generate_equals_and_hash_)));
-        } else {
+      case 20:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
+          _Internal::set_has_java_generate_equals_and_hash(&has_bits);
+          java_generate_equals_and_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool deprecated = 23 [default = false];
-      case 23: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(184u /* 184 & 0xFF */)) {
-          set_has_deprecated();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &deprecated_)));
-        } else {
+      case 23:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 184)) {
+          _Internal::set_has_deprecated(&has_bits);
+          deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool java_string_check_utf8 = 27 [default = false];
-      case 27: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(216u /* 216 & 0xFF */)) {
-          set_has_java_string_check_utf8();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &java_string_check_utf8_)));
-        } else {
+      case 27:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 216)) {
+          _Internal::set_has_java_string_check_utf8(&has_bits);
+          java_string_check_utf8_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool cc_enable_arenas = 31 [default = false];
-      case 31: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(248u /* 248 & 0xFF */)) {
-          set_has_cc_enable_arenas();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &cc_enable_arenas_)));
-        } else {
+        continue;
+      // optional bool cc_enable_arenas = 31 [default = true];
+      case 31:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 248)) {
+          _Internal::set_has_cc_enable_arenas(&has_bits);
+          cc_enable_arenas_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string objc_class_prefix = 36;
-      case 36: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 290 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_objc_class_prefix()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->objc_class_prefix().data(), static_cast<int>(this->objc_class_prefix().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileOptions.objc_class_prefix");
-        } else {
+      case 36:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_objc_class_prefix();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.objc_class_prefix");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string csharp_namespace = 37;
-      case 37: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 298 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_csharp_namespace()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->csharp_namespace().data(), static_cast<int>(this->csharp_namespace().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileOptions.csharp_namespace");
-        } else {
+      case 37:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          auto str = _internal_mutable_csharp_namespace();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.csharp_namespace");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string swift_prefix = 39;
-      case 39: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 314 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_swift_prefix()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->swift_prefix().data(), static_cast<int>(this->swift_prefix().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileOptions.swift_prefix");
-        } else {
+      case 39:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          auto str = _internal_mutable_swift_prefix();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.swift_prefix");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string php_class_prefix = 40;
-      case 40: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 322 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_php_class_prefix()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->php_class_prefix().data(), static_cast<int>(this->php_class_prefix().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileOptions.php_class_prefix");
-        } else {
+      case 40:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          auto str = _internal_mutable_php_class_prefix();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.php_class_prefix");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string php_namespace = 41;
-      case 41: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 330 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_php_namespace()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->php_namespace().data(), static_cast<int>(this->php_namespace().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.FileOptions.php_namespace");
-        } else {
+      case 41:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          auto str = _internal_mutable_php_namespace();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.php_namespace");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // 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 {
+      case 42:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_php_generic_services(&has_bits);
+          php_generic_services_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
+      // optional string php_metadata_namespace = 44;
+      case 44:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          auto str = _internal_mutable_php_metadata_namespace();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.php_metadata_namespace");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string ruby_package = 45;
+      case 45:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
+          auto str = _internal_mutable_ruby_package();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.FileOptions.ruby_package");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.FileOptions)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.FileOptions)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void FileOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.FileOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* FileOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileOptions)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string java_package = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->java_package().data(), static_cast<int>(this->java_package().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_java_package().data(), static_cast<int>(this->_internal_java_package().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileOptions.java_package");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->java_package(), output);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_java_package(), target);
   }
 
   // optional string java_outer_classname = 8;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->java_outer_classname().data(), static_cast<int>(this->java_outer_classname().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_java_outer_classname().data(), static_cast<int>(this->_internal_java_outer_classname().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileOptions.java_outer_classname");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      8, this->java_outer_classname(), output);
+    target = stream->WriteStringMaybeAliased(
+        8, this->_internal_java_outer_classname(), target);
   }
 
   // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
-  if (cached_has_bits & 0x00020000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      9, this->optimize_for(), output);
+  if (cached_has_bits & 0x00040000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      9, this->_internal_optimize_for(), target);
   }
 
   // optional bool java_multiple_files = 10 [default = false];
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->java_multiple_files(), output);
+  if (cached_has_bits & 0x00000400u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->_internal_java_multiple_files(), target);
   }
 
   // optional string go_package = 11;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->go_package().data(), static_cast<int>(this->go_package().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_go_package().data(), static_cast<int>(this->_internal_go_package().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileOptions.go_package");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      11, this->go_package(), output);
+    target = stream->WriteStringMaybeAliased(
+        11, this->_internal_go_package(), target);
   }
 
   // optional bool cc_generic_services = 16 [default = false];
-  if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->cc_generic_services(), output);
+  if (cached_has_bits & 0x00002000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(16, this->_internal_cc_generic_services(), target);
   }
 
   // optional bool java_generic_services = 17 [default = false];
-  if (cached_has_bits & 0x00002000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->java_generic_services(), output);
+  if (cached_has_bits & 0x00004000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(17, this->_internal_java_generic_services(), target);
   }
 
   // optional bool py_generic_services = 18 [default = false];
-  if (cached_has_bits & 0x00004000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->py_generic_services(), output);
+  if (cached_has_bits & 0x00008000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(18, this->_internal_py_generic_services(), target);
   }
 
   // optional bool java_generate_equals_and_hash = 20 [deprecated = true];
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(20, this->java_generate_equals_and_hash(), output);
+  if (cached_has_bits & 0x00000800u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(20, this->_internal_java_generate_equals_and_hash(), target);
   }
 
   // optional bool deprecated = 23 [default = false];
-  if (cached_has_bits & 0x00010000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(23, this->deprecated(), output);
+  if (cached_has_bits & 0x00020000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(23, this->_internal_deprecated(), target);
   }
 
   // optional bool java_string_check_utf8 = 27 [default = false];
-  if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(27, this->java_string_check_utf8(), output);
+  if (cached_has_bits & 0x00001000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(27, this->_internal_java_string_check_utf8(), target);
   }
 
-  // optional bool cc_enable_arenas = 31 [default = false];
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(31, this->cc_enable_arenas(), output);
+  // optional bool cc_enable_arenas = 31 [default = true];
+  if (cached_has_bits & 0x00080000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(31, this->_internal_cc_enable_arenas(), target);
   }
 
   // optional string objc_class_prefix = 36;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->objc_class_prefix().data(), static_cast<int>(this->objc_class_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_objc_class_prefix().data(), static_cast<int>(this->_internal_objc_class_prefix().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileOptions.objc_class_prefix");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      36, this->objc_class_prefix(), output);
+    target = stream->WriteStringMaybeAliased(
+        36, this->_internal_objc_class_prefix(), target);
   }
 
   // optional string csharp_namespace = 37;
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->csharp_namespace().data(), static_cast<int>(this->csharp_namespace().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_csharp_namespace().data(), static_cast<int>(this->_internal_csharp_namespace().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileOptions.csharp_namespace");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      37, this->csharp_namespace(), output);
+    target = stream->WriteStringMaybeAliased(
+        37, this->_internal_csharp_namespace(), target);
   }
 
   // optional string swift_prefix = 39;
   if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->swift_prefix().data(), static_cast<int>(this->swift_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_swift_prefix().data(), static_cast<int>(this->_internal_swift_prefix().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileOptions.swift_prefix");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      39, this->swift_prefix(), output);
+    target = stream->WriteStringMaybeAliased(
+        39, this->_internal_swift_prefix(), target);
   }
 
   // optional string php_class_prefix = 40;
   if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->php_class_prefix().data(), static_cast<int>(this->php_class_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_php_class_prefix().data(), static_cast<int>(this->_internal_php_class_prefix().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileOptions.php_class_prefix");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      40, this->php_class_prefix(), output);
+    target = stream->WriteStringMaybeAliased(
+        40, this->_internal_php_class_prefix(), target);
   }
 
   // optional string php_namespace = 41;
   if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->php_namespace().data(), static_cast<int>(this->php_namespace().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_php_namespace().data(), static_cast<int>(this->_internal_php_namespace().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.FileOptions.php_namespace");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      41, this->php_namespace(), output);
+    target = stream->WriteStringMaybeAliased(
+        41, this->_internal_php_namespace(), target);
   }
 
   // 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++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.FileOptions)
-}
-
-::google::protobuf::uint8* FileOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string java_package = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->java_package().data(), static_cast<int>(this->java_package().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileOptions.java_package");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->java_package(), target);
-  }
-
-  // optional string java_outer_classname = 8;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->java_outer_classname().data(), static_cast<int>(this->java_outer_classname().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileOptions.java_outer_classname");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        8, this->java_outer_classname(), target);
-  }
-
-  // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
-  if (cached_has_bits & 0x00020000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      9, this->optimize_for(), target);
-  }
-
-  // optional bool java_multiple_files = 10 [default = false];
-  if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->java_multiple_files(), target);
-  }
-
-  // optional string go_package = 11;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->go_package().data(), static_cast<int>(this->go_package().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileOptions.go_package");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        11, this->go_package(), target);
-  }
-
-  // optional bool cc_generic_services = 16 [default = false];
-  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 & 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 & 0x00004000u) {
-    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 & 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 & 0x00010000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(23, this->deprecated(), target);
-  }
-
-  // optional bool java_string_check_utf8 = 27 [default = false];
-  if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(27, this->java_string_check_utf8(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(42, this->_internal_php_generic_services(), target);
   }
 
-  // optional bool cc_enable_arenas = 31 [default = false];
+  // optional string php_metadata_namespace = 44;
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(31, this->cc_enable_arenas(), target);
-  }
-
-  // optional string objc_class_prefix = 36;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->objc_class_prefix().data(), static_cast<int>(this->objc_class_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileOptions.objc_class_prefix");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        36, this->objc_class_prefix(), target);
-  }
-
-  // optional string csharp_namespace = 37;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->csharp_namespace().data(), static_cast<int>(this->csharp_namespace().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileOptions.csharp_namespace");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        37, this->csharp_namespace(), target);
-  }
-
-  // optional string swift_prefix = 39;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->swift_prefix().data(), static_cast<int>(this->swift_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileOptions.swift_prefix");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        39, this->swift_prefix(), target);
-  }
-
-  // optional string php_class_prefix = 40;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->php_class_prefix().data(), static_cast<int>(this->php_class_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileOptions.php_class_prefix");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        40, this->php_class_prefix(), target);
-  }
-
-  // optional string php_namespace = 41;
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->php_namespace().data(), static_cast<int>(this->php_namespace().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.FileOptions.php_namespace");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        41, this->php_namespace(), target);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_php_metadata_namespace().data(), static_cast<int>(this->_internal_php_metadata_namespace().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "google.protobuf.FileOptions.php_metadata_namespace");
+    target = stream->WriteStringMaybeAliased(
+        44, this->_internal_php_metadata_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);
+  // optional string ruby_package = 45;
+  if (cached_has_bits & 0x00000200u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_ruby_package().data(), static_cast<int>(this->_internal_ruby_package().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "google.protobuf.FileOptions.ruby_package");
+    target = stream->WriteStringMaybeAliased(
+        45, this->_internal_ruby_package(), 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++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileOptions)
   return target;
@@ -8671,236 +6832,239 @@ size_t FileOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 255u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
     // optional string java_package = 1;
-    if (has_java_package()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->java_package());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_java_package());
     }
 
     // optional string java_outer_classname = 8;
-    if (has_java_outer_classname()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->java_outer_classname());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_java_outer_classname());
     }
 
     // optional string go_package = 11;
-    if (has_go_package()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->go_package());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_go_package());
     }
 
     // optional string objc_class_prefix = 36;
-    if (has_objc_class_prefix()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->objc_class_prefix());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_objc_class_prefix());
     }
 
     // optional string csharp_namespace = 37;
-    if (has_csharp_namespace()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->csharp_namespace());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_csharp_namespace());
     }
 
     // optional string swift_prefix = 39;
-    if (has_swift_prefix()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->swift_prefix());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_swift_prefix());
     }
 
     // optional string php_class_prefix = 40;
-    if (has_php_class_prefix()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->php_class_prefix());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_php_class_prefix());
     }
 
     // optional string php_namespace = 41;
-    if (has_php_namespace()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->php_namespace());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_php_namespace());
     }
 
   }
-  if (_has_bits_[8 / 32] & 65280u) {
-    // optional bool cc_enable_arenas = 31 [default = false];
-    if (has_cc_enable_arenas()) {
-      total_size += 2 + 1;
+  if (cached_has_bits & 0x0000ff00u) {
+    // optional string php_metadata_namespace = 44;
+    if (cached_has_bits & 0x00000100u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_php_metadata_namespace());
+    }
+
+    // optional string ruby_package = 45;
+    if (cached_has_bits & 0x00000200u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_ruby_package());
     }
 
     // optional bool java_multiple_files = 10 [default = false];
-    if (has_java_multiple_files()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 1 + 1;
     }
 
     // optional bool java_generate_equals_and_hash = 20 [deprecated = true];
-    if (has_java_generate_equals_and_hash()) {
+    if (cached_has_bits & 0x00000800u) {
       total_size += 2 + 1;
     }
 
     // optional bool java_string_check_utf8 = 27 [default = false];
-    if (has_java_string_check_utf8()) {
+    if (cached_has_bits & 0x00001000u) {
       total_size += 2 + 1;
     }
 
     // optional bool cc_generic_services = 16 [default = false];
-    if (has_cc_generic_services()) {
+    if (cached_has_bits & 0x00002000u) {
       total_size += 2 + 1;
     }
 
     // optional bool java_generic_services = 17 [default = false];
-    if (has_java_generic_services()) {
+    if (cached_has_bits & 0x00004000u) {
       total_size += 2 + 1;
     }
 
     // optional bool py_generic_services = 18 [default = false];
-    if (has_py_generic_services()) {
+    if (cached_has_bits & 0x00008000u) {
       total_size += 2 + 1;
     }
 
+  }
+  if (cached_has_bits & 0x000f0000u) {
     // optional bool php_generic_services = 42 [default = false];
-    if (has_php_generic_services()) {
+    if (cached_has_bits & 0x00010000u) {
       total_size += 2 + 1;
     }
 
-  }
-  if (_has_bits_[16 / 32] & 196608u) {
     // optional bool deprecated = 23 [default = false];
-    if (has_deprecated()) {
+    if (cached_has_bits & 0x00020000u) {
       total_size += 2 + 1;
     }
 
     // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
-    if (has_optimize_for()) {
+    if (cached_has_bits & 0x00040000u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->optimize_for());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_optimize_for());
+    }
+
+    // optional bool cc_enable_arenas = 31 [default = true];
+    if (cached_has_bits & 0x00080000u) {
+      total_size += 2 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FileOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FileOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FileOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FileOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FileOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FileOptions::GetClassData() const { return &_class_data_; }
+
+void FileOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FileOptions *>(to)->MergeFrom(
+      static_cast<const FileOptions &>(from));
 }
 
+
 void FileOptions::MergeFrom(const FileOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_java_package(from.java_package());
+      _internal_set_java_package(from._internal_java_package());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_java_outer_classname(from.java_outer_classname());
+      _internal_set_java_outer_classname(from._internal_java_outer_classname());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_go_package(from.go_package());
+      _internal_set_go_package(from._internal_go_package());
     }
     if (cached_has_bits & 0x00000008u) {
-      set_objc_class_prefix(from.objc_class_prefix());
+      _internal_set_objc_class_prefix(from._internal_objc_class_prefix());
     }
     if (cached_has_bits & 0x00000010u) {
-      set_csharp_namespace(from.csharp_namespace());
+      _internal_set_csharp_namespace(from._internal_csharp_namespace());
     }
     if (cached_has_bits & 0x00000020u) {
-      set_swift_prefix(from.swift_prefix());
+      _internal_set_swift_prefix(from._internal_swift_prefix());
     }
     if (cached_has_bits & 0x00000040u) {
-      set_php_class_prefix(from.php_class_prefix());
+      _internal_set_php_class_prefix(from._internal_php_class_prefix());
     }
     if (cached_has_bits & 0x00000080u) {
-      set_php_namespace(from.php_namespace());
+      _internal_set_php_namespace(from._internal_php_namespace());
     }
   }
-  if (cached_has_bits & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     if (cached_has_bits & 0x00000100u) {
-      cc_enable_arenas_ = from.cc_enable_arenas_;
+      _internal_set_php_metadata_namespace(from._internal_php_metadata_namespace());
     }
     if (cached_has_bits & 0x00000200u) {
-      java_multiple_files_ = from.java_multiple_files_;
+      _internal_set_ruby_package(from._internal_ruby_package());
     }
     if (cached_has_bits & 0x00000400u) {
-      java_generate_equals_and_hash_ = from.java_generate_equals_and_hash_;
+      java_multiple_files_ = from.java_multiple_files_;
     }
     if (cached_has_bits & 0x00000800u) {
-      java_string_check_utf8_ = from.java_string_check_utf8_;
+      java_generate_equals_and_hash_ = from.java_generate_equals_and_hash_;
     }
     if (cached_has_bits & 0x00001000u) {
-      cc_generic_services_ = from.cc_generic_services_;
+      java_string_check_utf8_ = from.java_string_check_utf8_;
     }
     if (cached_has_bits & 0x00002000u) {
-      java_generic_services_ = from.java_generic_services_;
+      cc_generic_services_ = from.cc_generic_services_;
     }
     if (cached_has_bits & 0x00004000u) {
-      py_generic_services_ = from.py_generic_services_;
+      java_generic_services_ = from.java_generic_services_;
     }
     if (cached_has_bits & 0x00008000u) {
-      php_generic_services_ = from.php_generic_services_;
+      py_generic_services_ = from.py_generic_services_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 196608u) {
+  if (cached_has_bits & 0x000f0000u) {
     if (cached_has_bits & 0x00010000u) {
-      deprecated_ = from.deprecated_;
+      php_generic_services_ = from.php_generic_services_;
     }
     if (cached_has_bits & 0x00020000u) {
+      deprecated_ = from.deprecated_;
+    }
+    if (cached_has_bits & 0x00040000u) {
       optimize_for_ = from.optimize_for_;
     }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void FileOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+    if (cached_has_bits & 0x00080000u) {
+      cc_enable_arenas_ = from.cc_enable_arenas_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FileOptions::CopyFrom(const FileOptions& from) {
@@ -8915,150 +7079,158 @@ bool FileOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
+  _extensions_.InternalSwap(&other->_extensions_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
-  java_package_.Swap(&other->java_package_);
-  java_outer_classname_.Swap(&other->java_outer_classname_);
-  go_package_.Swap(&other->go_package_);
-  objc_class_prefix_.Swap(&other->objc_class_prefix_);
-  csharp_namespace_.Swap(&other->csharp_namespace_);
-  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_);
-  swap(cc_generic_services_, other->cc_generic_services_);
-  swap(java_generic_services_, other->java_generic_services_);
-  swap(py_generic_services_, other->py_generic_services_);
-  swap(php_generic_services_, other->php_generic_services_);
-  swap(deprecated_, other->deprecated_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &java_package_, lhs_arena,
+      &other->java_package_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &java_outer_classname_, lhs_arena,
+      &other->java_outer_classname_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &go_package_, lhs_arena,
+      &other->go_package_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &objc_class_prefix_, lhs_arena,
+      &other->objc_class_prefix_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &csharp_namespace_, lhs_arena,
+      &other->csharp_namespace_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &swift_prefix_, lhs_arena,
+      &other->swift_prefix_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &php_class_prefix_, lhs_arena,
+      &other->php_class_prefix_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &php_namespace_, lhs_arena,
+      &other->php_namespace_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &php_metadata_namespace_, lhs_arena,
+      &other->php_metadata_namespace_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &ruby_package_, lhs_arena,
+      &other->ruby_package_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(FileOptions, deprecated_)
+      + sizeof(FileOptions::deprecated_)
+      - PROTOBUF_FIELD_OFFSET(FileOptions, java_multiple_files_)>(
+          reinterpret_cast<char*>(&java_multiple_files_),
+          reinterpret_cast<char*>(&other->java_multiple_files_));
   swap(optimize_for_, other->optimize_for_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
+  swap(cc_enable_arenas_, other->cc_enable_arenas_);
 }
 
-::google::protobuf::Metadata FileOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FileOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[13]);
 }
 
-
 // ===================================================================
 
-void MessageOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int MessageOptions::kMessageSetWireFormatFieldNumber;
-const int MessageOptions::kNoStandardDescriptorAccessorFieldNumber;
-const int MessageOptions::kDeprecatedFieldNumber;
-const int MessageOptions::kMapEntryFieldNumber;
-const int MessageOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-MessageOptions::MessageOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptions();
+class MessageOptions::_Internal {
+ public:
+  using HasBits = decltype(std::declval<MessageOptions>()._has_bits_);
+  static void set_has_message_set_wire_format(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.MessageOptions)
-}
-MessageOptions::MessageOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+  static void set_has_no_standard_descriptor_accessor(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_deprecated(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_map_entry(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+};
+
+MessageOptions::MessageOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.MessageOptions)
 }
 MessageOptions::MessageOptions(const MessageOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   ::memcpy(&message_set_wire_format_, &from.message_set_wire_format_,
     static_cast<size_t>(reinterpret_cast<char*>(&map_entry_) -
     reinterpret_cast<char*>(&message_set_wire_format_)) + sizeof(map_entry_));
   // @@protoc_insertion_point(copy_constructor:google.protobuf.MessageOptions)
 }
 
-void MessageOptions::SharedCtor() {
-  _cached_size_ = 0;
-  ::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_));
+inline void MessageOptions::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&message_set_wire_format_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&map_entry_) -
+    reinterpret_cast<char*>(&message_set_wire_format_)) + sizeof(map_entry_));
 }
 
 MessageOptions::~MessageOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.MessageOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void MessageOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void MessageOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void MessageOptions::ArenaDtor(void* object) {
   MessageOptions* _this = reinterpret_cast< MessageOptions* >(object);
   (void)_this;
 }
-void MessageOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void MessageOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const MessageOptions& MessageOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptions();
-  return *internal_default_instance();
-}
-
-MessageOptions* MessageOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<MessageOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void MessageOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.MessageOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -9068,200 +7240,140 @@ void MessageOptions::Clear() {
       reinterpret_cast<char*>(&map_entry_) -
       reinterpret_cast<char*>(&message_set_wire_format_)) + sizeof(map_entry_));
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool MessageOptions::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.MessageOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* MessageOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional bool message_set_wire_format = 1 [default = false];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_message_set_wire_format();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &message_set_wire_format_)));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_message_set_wire_format(&has_bits);
+          message_set_wire_format_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool no_standard_descriptor_accessor = 2 [default = false];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_no_standard_descriptor_accessor();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &no_standard_descriptor_accessor_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_no_standard_descriptor_accessor(&has_bits);
+          no_standard_descriptor_accessor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool deprecated = 3 [default = false];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_deprecated();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &deprecated_)));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_deprecated(&has_bits);
+          deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool map_entry = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_map_entry();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &map_entry_)));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_map_entry(&has_bits);
+          map_entry_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.MessageOptions)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.MessageOptions)
-  return false;
-#undef DO_
-}
-
-void MessageOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.MessageOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool message_set_wire_format = 1 [default = false];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->message_set_wire_format(), output);
-  }
-
-  // optional bool no_standard_descriptor_accessor = 2 [default = false];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->no_standard_descriptor_accessor(), output);
-  }
-
-  // optional bool deprecated = 3 [default = false];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->deprecated(), output);
-  }
-
-  // optional bool map_entry = 7;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->map_entry(), 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++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.MessageOptions)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* MessageOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* MessageOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MessageOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional bool message_set_wire_format = 1 [default = false];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->message_set_wire_format(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_message_set_wire_format(), target);
   }
 
   // optional bool no_standard_descriptor_accessor = 2 [default = false];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->no_standard_descriptor_accessor(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_no_standard_descriptor_accessor(), target);
   }
 
   // optional bool deprecated = 3 [default = false];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->deprecated(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_deprecated(), target);
   }
 
   // optional bool map_entry = 7;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->map_entry(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_map_entry(), 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++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MessageOptions)
   return target;
@@ -9273,77 +7385,65 @@ size_t MessageOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 15u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
     // optional bool message_set_wire_format = 1 [default = false];
-    if (has_message_set_wire_format()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 1;
     }
 
     // optional bool no_standard_descriptor_accessor = 2 [default = false];
-    if (has_no_standard_descriptor_accessor()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
     // optional bool deprecated = 3 [default = false];
-    if (has_deprecated()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 1;
     }
 
     // optional bool map_entry = 7;
-    if (has_map_entry()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void MessageOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.MessageOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const MessageOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const MessageOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MessageOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.MessageOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    MessageOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MessageOptions::GetClassData() const { return &_class_data_; }
+
+void MessageOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<MessageOptions *>(to)->MergeFrom(
+      static_cast<const MessageOptions &>(from));
 }
 
+
 void MessageOptions::MergeFrom(const MessageOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.MessageOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
       message_set_wire_format_ = from.message_set_wire_format_;
     }
@@ -9358,13 +7458,8 @@ void MessageOptions::MergeFrom(const MessageOptions& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void MessageOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.MessageOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void MessageOptions::CopyFrom(const MessageOptions& from) {
@@ -9379,408 +7474,296 @@ bool MessageOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
-  uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
-  swap(message_set_wire_format_, other->message_set_wire_format_);
-  swap(no_standard_descriptor_accessor_, other->no_standard_descriptor_accessor_);
-  swap(deprecated_, other->deprecated_);
-  swap(map_entry_, other->map_entry_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
+  uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(MessageOptions, map_entry_)
+      + sizeof(MessageOptions::map_entry_)
+      - PROTOBUF_FIELD_OFFSET(MessageOptions, message_set_wire_format_)>(
+          reinterpret_cast<char*>(&message_set_wire_format_),
+          reinterpret_cast<char*>(&other->message_set_wire_format_));
 }
 
-::google::protobuf::Metadata MessageOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata MessageOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[14]);
 }
 
-
 // ===================================================================
 
-void FieldOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FieldOptions::kCtypeFieldNumber;
-const int FieldOptions::kPackedFieldNumber;
-const int FieldOptions::kJstypeFieldNumber;
-const int FieldOptions::kLazyFieldNumber;
-const int FieldOptions::kDeprecatedFieldNumber;
-const int FieldOptions::kWeakFieldNumber;
-const int FieldOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FieldOptions::FieldOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptions();
+class FieldOptions::_Internal {
+ public:
+  using HasBits = decltype(std::declval<FieldOptions>()._has_bits_);
+  static void set_has_ctype(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.FieldOptions)
-}
-FieldOptions::FieldOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+  static void set_has_packed(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_jstype(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_lazy(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_deprecated(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_weak(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+};
+
+FieldOptions::FieldOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.FieldOptions)
 }
 FieldOptions::FieldOptions(const FieldOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   ::memcpy(&ctype_, &from.ctype_,
     static_cast<size_t>(reinterpret_cast<char*>(&jstype_) -
     reinterpret_cast<char*>(&ctype_)) + sizeof(jstype_));
   // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldOptions)
 }
 
-void FieldOptions::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&ctype_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&jstype_) -
-      reinterpret_cast<char*>(&ctype_)) + sizeof(jstype_));
+inline void FieldOptions::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&ctype_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&jstype_) -
+    reinterpret_cast<char*>(&ctype_)) + sizeof(jstype_));
 }
 
 FieldOptions::~FieldOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.FieldOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FieldOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void FieldOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void FieldOptions::ArenaDtor(void* object) {
   FieldOptions* _this = reinterpret_cast< FieldOptions* >(object);
   (void)_this;
 }
-void FieldOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void FieldOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const FieldOptions& FieldOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptions();
-  return *internal_default_instance();
-}
-
-FieldOptions* FieldOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FieldOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void FieldOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.FieldOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   _extensions_.Clear();
   uninterpreted_option_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     ::memset(&ctype_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&jstype_) -
         reinterpret_cast<char*>(&ctype_)) + sizeof(jstype_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FieldOptions::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.FieldOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* FieldOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::google::protobuf::FieldOptions_CType_IsValid(value)) {
-            set_ctype(static_cast< ::google::protobuf::FieldOptions_CType >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType_IsValid(val))) {
+            _internal_set_ctype(static_cast<::PROTOBUF_NAMESPACE_ID::FieldOptions_CType>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool packed = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_packed();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &packed_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_packed(&has_bits);
+          packed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool deprecated = 3 [default = false];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_deprecated();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &deprecated_)));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_deprecated(&has_bits);
+          deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool lazy = 5 [default = false];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_lazy();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &lazy_)));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_lazy(&has_bits);
+          lazy_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::google::protobuf::FieldOptions_JSType_IsValid(value)) {
-            set_jstype(static_cast< ::google::protobuf::FieldOptions_JSType >(value));
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType_IsValid(val))) {
+            _internal_set_jstype(static_cast<::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                6, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(6, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool weak = 10 [default = false];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_weak();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &weak_)));
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_weak(&has_bits);
+          weak_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.FieldOptions)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.FieldOptions)
-  return false;
-#undef DO_
-}
-
-void FieldOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.FieldOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->ctype(), output);
-  }
-
-  // optional bool packed = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->packed(), output);
-  }
-
-  // optional bool deprecated = 3 [default = false];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->deprecated(), output);
-  }
-
-  // optional bool lazy = 5 [default = false];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->lazy(), output);
-  }
-
-  // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      6, this->jstype(), output);
-  }
-
-  // optional bool weak = 10 [default = false];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->weak(), 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++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.FieldOptions)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* FieldOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* FieldOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->ctype(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_ctype(), target);
   }
 
   // optional bool packed = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->packed(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_packed(), target);
   }
 
   // optional bool deprecated = 3 [default = false];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->deprecated(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_deprecated(), target);
   }
 
   // optional bool lazy = 5 [default = false];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->lazy(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_lazy(), target);
   }
 
   // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      6, this->jstype(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      6, this->_internal_jstype(), target);
   }
 
   // optional bool weak = 10 [default = false];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->weak(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->_internal_weak(), 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++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldOptions)
   return target;
@@ -9792,89 +7775,77 @@ size_t FieldOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 63u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000003fu) {
     // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
-    if (has_ctype()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->ctype());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_ctype());
     }
 
     // optional bool packed = 2;
-    if (has_packed()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
     // optional bool lazy = 5 [default = false];
-    if (has_lazy()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 1;
     }
 
     // optional bool deprecated = 3 [default = false];
-    if (has_deprecated()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 1;
     }
 
     // optional bool weak = 10 [default = false];
-    if (has_weak()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 + 1;
     }
 
     // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
-    if (has_jstype()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->jstype());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_jstype());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FieldOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FieldOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FieldOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FieldOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FieldOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FieldOptions::GetClassData() const { return &_class_data_; }
+
+void FieldOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FieldOptions *>(to)->MergeFrom(
+      static_cast<const FieldOptions &>(from));
 }
 
+
 void FieldOptions::MergeFrom(const FieldOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
       ctype_ = from.ctype_;
     }
@@ -9895,13 +7866,8 @@ void FieldOptions::MergeFrom(const FieldOptions& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void FieldOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FieldOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FieldOptions::CopyFrom(const FieldOptions& from) {
@@ -9916,230 +7882,159 @@ bool FieldOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
-  uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
-  swap(ctype_, other->ctype_);
-  swap(packed_, other->packed_);
-  swap(lazy_, other->lazy_);
-  swap(deprecated_, other->deprecated_);
-  swap(weak_, other->weak_);
-  swap(jstype_, other->jstype_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
+  uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(FieldOptions, jstype_)
+      + sizeof(FieldOptions::jstype_)
+      - PROTOBUF_FIELD_OFFSET(FieldOptions, ctype_)>(
+          reinterpret_cast<char*>(&ctype_),
+          reinterpret_cast<char*>(&other->ctype_));
 }
 
-::google::protobuf::Metadata FieldOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FieldOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[15]);
 }
 
-
 // ===================================================================
 
-void OneofOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int OneofOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class OneofOptions::_Internal {
+ public:
+};
 
-OneofOptions::OneofOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptions();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.OneofOptions)
-}
-OneofOptions::OneofOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+OneofOptions::OneofOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.OneofOptions)
 }
 OneofOptions::OneofOptions(const OneofOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   // @@protoc_insertion_point(copy_constructor:google.protobuf.OneofOptions)
 }
 
-void OneofOptions::SharedCtor() {
-  _cached_size_ = 0;
+inline void OneofOptions::SharedCtor() {
 }
 
 OneofOptions::~OneofOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.OneofOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void OneofOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void OneofOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void OneofOptions::ArenaDtor(void* object) {
   OneofOptions* _this = reinterpret_cast< OneofOptions* >(object);
   (void)_this;
 }
-void OneofOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void OneofOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const OneofOptions& OneofOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptions();
-  return *internal_default_instance();
-}
-
-OneofOptions* OneofOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<OneofOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void OneofOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.OneofOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   _extensions_.Clear();
   uninterpreted_option_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool OneofOptions::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.OneofOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* OneofOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.OneofOptions)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.OneofOptions)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void OneofOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.OneofOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->uninterpreted_option_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.OneofOptions)
-}
-
-::google::protobuf::uint8* OneofOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* OneofOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->uninterpreted_option_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.OneofOptions)
   return target;
@@ -10151,60 +8046,42 @@ size_t OneofOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void OneofOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.OneofOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const OneofOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const OneofOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.OneofOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.OneofOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData OneofOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    OneofOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*OneofOptions::GetClassData() const { return &_class_data_; }
+
+void OneofOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<OneofOptions *>(to)->MergeFrom(
+      static_cast<const OneofOptions &>(from));
 }
 
+
 void OneofOptions::MergeFrom(const OneofOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.OneofOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
-}
-
-void OneofOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.OneofOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void OneofOptions::CopyFrom(const OneofOptions& from) {
@@ -10219,130 +8096,91 @@ bool OneofOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
 }
 
-::google::protobuf::Metadata OneofOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata OneofOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[16]);
 }
 
-
 // ===================================================================
 
-void EnumOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int EnumOptions::kAllowAliasFieldNumber;
-const int EnumOptions::kDeprecatedFieldNumber;
-const int EnumOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-EnumOptions::EnumOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptions();
+class EnumOptions::_Internal {
+ public:
+  using HasBits = decltype(std::declval<EnumOptions>()._has_bits_);
+  static void set_has_allow_alias(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.EnumOptions)
-}
-EnumOptions::EnumOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+  static void set_has_deprecated(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+EnumOptions::EnumOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumOptions)
 }
 EnumOptions::EnumOptions(const EnumOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   ::memcpy(&allow_alias_, &from.allow_alias_,
     static_cast<size_t>(reinterpret_cast<char*>(&deprecated_) -
     reinterpret_cast<char*>(&allow_alias_)) + sizeof(deprecated_));
   // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumOptions)
 }
 
-void EnumOptions::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&allow_alias_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&deprecated_) -
-      reinterpret_cast<char*>(&allow_alias_)) + sizeof(deprecated_));
+inline void EnumOptions::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&allow_alias_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&deprecated_) -
+    reinterpret_cast<char*>(&allow_alias_)) + sizeof(deprecated_));
 }
 
 EnumOptions::~EnumOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.EnumOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void EnumOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void EnumOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void EnumOptions::ArenaDtor(void* object) {
   EnumOptions* _this = reinterpret_cast< EnumOptions* >(object);
   (void)_this;
 }
-void EnumOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void EnumOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const EnumOptions& EnumOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptions();
-  return *internal_default_instance();
-}
-
-EnumOptions* EnumOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<EnumOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void EnumOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.EnumOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -10352,152 +8190,110 @@ void EnumOptions::Clear() {
       reinterpret_cast<char*>(&deprecated_) -
       reinterpret_cast<char*>(&allow_alias_)) + sizeof(deprecated_));
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool EnumOptions::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.EnumOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* EnumOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional bool allow_alias = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_allow_alias();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &allow_alias_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_allow_alias(&has_bits);
+          allow_alias_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool deprecated = 3 [default = false];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_deprecated();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &deprecated_)));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_deprecated(&has_bits);
+          deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.EnumOptions)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.EnumOptions)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void EnumOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.EnumOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool allow_alias = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->allow_alias(), output);
-  }
-
-  // optional bool deprecated = 3 [default = false];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->deprecated(), 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++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.EnumOptions)
-}
-
-::google::protobuf::uint8* EnumOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* EnumOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional bool allow_alias = 2;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->allow_alias(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_allow_alias(), target);
   }
 
   // optional bool deprecated = 3 [default = false];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->deprecated(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_deprecated(), 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++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumOptions)
   return target;
@@ -10509,67 +8305,55 @@ size_t EnumOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional bool allow_alias = 2;
-    if (has_allow_alias()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 1;
     }
 
     // optional bool deprecated = 3 [default = false];
-    if (has_deprecated()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void EnumOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const EnumOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const EnumOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EnumOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    EnumOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EnumOptions::GetClassData() const { return &_class_data_; }
+
+void EnumOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<EnumOptions *>(to)->MergeFrom(
+      static_cast<const EnumOptions &>(from));
 }
 
+
 void EnumOptions::MergeFrom(const EnumOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       allow_alias_ = from.allow_alias_;
     }
@@ -10578,13 +8362,8 @@ void EnumOptions::MergeFrom(const EnumOptions& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void EnumOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void EnumOptions::CopyFrom(const EnumOptions& from) {
@@ -10599,127 +8378,90 @@ bool EnumOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
-  uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
-  swap(allow_alias_, other->allow_alias_);
-  swap(deprecated_, other->deprecated_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
+  uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(EnumOptions, deprecated_)
+      + sizeof(EnumOptions::deprecated_)
+      - PROTOBUF_FIELD_OFFSET(EnumOptions, allow_alias_)>(
+          reinterpret_cast<char*>(&allow_alias_),
+          reinterpret_cast<char*>(&other->allow_alias_));
 }
 
-::google::protobuf::Metadata EnumOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata EnumOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[17]);
 }
 
-
 // ===================================================================
 
-void EnumValueOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int EnumValueOptions::kDeprecatedFieldNumber;
-const int EnumValueOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-EnumValueOptions::EnumValueOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptions();
+class EnumValueOptions::_Internal {
+ public:
+  using HasBits = decltype(std::declval<EnumValueOptions>()._has_bits_);
+  static void set_has_deprecated(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.EnumValueOptions)
-}
-EnumValueOptions::EnumValueOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+};
+
+EnumValueOptions::EnumValueOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValueOptions)
 }
 EnumValueOptions::EnumValueOptions(const EnumValueOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   deprecated_ = from.deprecated_;
   // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumValueOptions)
 }
 
-void EnumValueOptions::SharedCtor() {
-  _cached_size_ = 0;
-  deprecated_ = false;
+inline void EnumValueOptions::SharedCtor() {
+deprecated_ = false;
 }
 
 EnumValueOptions::~EnumValueOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.EnumValueOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void EnumValueOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void EnumValueOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void EnumValueOptions::ArenaDtor(void* object) {
   EnumValueOptions* _this = reinterpret_cast< EnumValueOptions* >(object);
   (void)_this;
 }
-void EnumValueOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void EnumValueOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const EnumValueOptions& EnumValueOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptions();
-  return *internal_default_instance();
-}
-
-EnumValueOptions* EnumValueOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<EnumValueOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void EnumValueOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.EnumValueOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -10727,128 +8469,95 @@ void EnumValueOptions::Clear() {
   uninterpreted_option_.Clear();
   deprecated_ = false;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool EnumValueOptions::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.EnumValueOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* EnumValueOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional bool deprecated = 1 [default = false];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_deprecated();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &deprecated_)));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_deprecated(&has_bits);
+          deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.EnumValueOptions)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.EnumValueOptions)
-  return false;
-#undef DO_
-}
-
-void EnumValueOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.EnumValueOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool deprecated = 1 [default = false];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->deprecated(), 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++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValueOptions)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* EnumValueOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* EnumValueOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional bool deprecated = 1 [default = false];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->deprecated(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_deprecated(), 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++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValueOptions)
   return target;
@@ -10860,68 +8569,51 @@ size_t EnumValueOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // optional bool deprecated = 1 [default = false];
-  if (has_deprecated()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 + 1;
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void EnumValueOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumValueOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const EnumValueOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const EnumValueOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValueOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumValueOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EnumValueOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    EnumValueOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EnumValueOptions::GetClassData() const { return &_class_data_; }
+
+void EnumValueOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<EnumValueOptions *>(to)->MergeFrom(
+      static_cast<const EnumValueOptions &>(from));
 }
 
+
 void EnumValueOptions::MergeFrom(const EnumValueOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumValueOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
-  if (from.has_deprecated()) {
-    set_deprecated(from.deprecated());
+  if (from._internal_has_deprecated()) {
+    _internal_set_deprecated(from._internal_deprecated());
   }
-}
-
-void EnumValueOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumValueOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void EnumValueOptions::CopyFrom(const EnumValueOptions& from) {
@@ -10936,126 +8628,85 @@ bool EnumValueOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
   swap(deprecated_, other->deprecated_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
 }
 
-::google::protobuf::Metadata EnumValueOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata EnumValueOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[18]);
 }
 
-
 // ===================================================================
 
-void ServiceOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ServiceOptions::kDeprecatedFieldNumber;
-const int ServiceOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ServiceOptions::ServiceOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptions();
+class ServiceOptions::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ServiceOptions>()._has_bits_);
+  static void set_has_deprecated(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.ServiceOptions)
-}
-ServiceOptions::ServiceOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+};
+
+ServiceOptions::ServiceOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.ServiceOptions)
 }
 ServiceOptions::ServiceOptions(const ServiceOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   deprecated_ = from.deprecated_;
   // @@protoc_insertion_point(copy_constructor:google.protobuf.ServiceOptions)
 }
 
-void ServiceOptions::SharedCtor() {
-  _cached_size_ = 0;
-  deprecated_ = false;
+inline void ServiceOptions::SharedCtor() {
+deprecated_ = false;
 }
 
 ServiceOptions::~ServiceOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.ServiceOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ServiceOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void ServiceOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void ServiceOptions::ArenaDtor(void* object) {
   ServiceOptions* _this = reinterpret_cast< ServiceOptions* >(object);
   (void)_this;
 }
-void ServiceOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void ServiceOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const ServiceOptions& ServiceOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptions();
-  return *internal_default_instance();
-}
-
-ServiceOptions* ServiceOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<ServiceOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void ServiceOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.ServiceOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -11063,128 +8714,95 @@ void ServiceOptions::Clear() {
   uninterpreted_option_.Clear();
   deprecated_ = false;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ServiceOptions::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.ServiceOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* ServiceOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional bool deprecated = 33 [default = false];
-      case 33: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 264 & 0xFF */)) {
-          set_has_deprecated();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &deprecated_)));
-        } else {
+      case 33:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_deprecated(&has_bits);
+          deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.ServiceOptions)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.ServiceOptions)
-  return false;
-#undef DO_
-}
-
-void ServiceOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.ServiceOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool deprecated = 33 [default = false];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(33, this->deprecated(), 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++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.ServiceOptions)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ServiceOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ServiceOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional bool deprecated = 33 [default = false];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(33, this->deprecated(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(33, this->_internal_deprecated(), 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++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ServiceOptions)
   return target;
@@ -11196,68 +8814,51 @@ size_t ServiceOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // optional bool deprecated = 33 [default = false];
-  if (has_deprecated()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 2 + 1;
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ServiceOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ServiceOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ServiceOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ServiceOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ServiceOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ServiceOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ServiceOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ServiceOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ServiceOptions::GetClassData() const { return &_class_data_; }
+
+void ServiceOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ServiceOptions *>(to)->MergeFrom(
+      static_cast<const ServiceOptions &>(from));
 }
 
+
 void ServiceOptions::MergeFrom(const ServiceOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ServiceOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
-  if (from.has_deprecated()) {
-    set_deprecated(from.deprecated());
+  if (from._internal_has_deprecated()) {
+    _internal_set_deprecated(from._internal_deprecated());
   }
-}
-
-void ServiceOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ServiceOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ServiceOptions::CopyFrom(const ServiceOptions& from) {
@@ -11272,297 +8873,214 @@ bool ServiceOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
   swap(deprecated_, other->deprecated_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
 }
 
-::google::protobuf::Metadata ServiceOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ServiceOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[19]);
 }
 
-
 // ===================================================================
 
-void MethodOptions::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int MethodOptions::kDeprecatedFieldNumber;
-const int MethodOptions::kIdempotencyLevelFieldNumber;
-const int MethodOptions::kUninterpretedOptionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-MethodOptions::MethodOptions()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptions();
+class MethodOptions::_Internal {
+ public:
+  using HasBits = decltype(std::declval<MethodOptions>()._has_bits_);
+  static void set_has_deprecated(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.MethodOptions)
-}
-MethodOptions::MethodOptions(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
+  static void set_has_idempotency_level(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+MethodOptions::MethodOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   _extensions_(arena),
-  _internal_metadata_(arena),
   uninterpreted_option_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptions();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.MethodOptions)
 }
 MethodOptions::MethodOptions(const MethodOptions& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       uninterpreted_option_(from.uninterpreted_option_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   ::memcpy(&deprecated_, &from.deprecated_,
     static_cast<size_t>(reinterpret_cast<char*>(&idempotency_level_) -
     reinterpret_cast<char*>(&deprecated_)) + sizeof(idempotency_level_));
   // @@protoc_insertion_point(copy_constructor:google.protobuf.MethodOptions)
 }
 
-void MethodOptions::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&deprecated_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&idempotency_level_) -
-      reinterpret_cast<char*>(&deprecated_)) + sizeof(idempotency_level_));
+inline void MethodOptions::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&deprecated_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&idempotency_level_) -
+    reinterpret_cast<char*>(&deprecated_)) + sizeof(idempotency_level_));
 }
 
 MethodOptions::~MethodOptions() {
   // @@protoc_insertion_point(destructor:google.protobuf.MethodOptions)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void MethodOptions::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void MethodOptions::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void MethodOptions::ArenaDtor(void* object) {
   MethodOptions* _this = reinterpret_cast< MethodOptions* >(object);
   (void)_this;
 }
-void MethodOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void MethodOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const MethodOptions& MethodOptions::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptions();
-  return *internal_default_instance();
-}
-
-MethodOptions* MethodOptions::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<MethodOptions>(arena);
+  _cached_size_.Set(size);
 }
 
 void MethodOptions::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.MethodOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   _extensions_.Clear();
   uninterpreted_option_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     ::memset(&deprecated_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&idempotency_level_) -
         reinterpret_cast<char*>(&deprecated_)) + sizeof(idempotency_level_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool MethodOptions::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.MethodOptions)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* MethodOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional bool deprecated = 33 [default = false];
-      case 33: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 264 & 0xFF */)) {
-          set_has_deprecated();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &deprecated_)));
-        } else {
+      case 33:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_deprecated(&has_bits);
+          deprecated_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];
-      case 34: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 272 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::google::protobuf::MethodOptions_IdempotencyLevel_IsValid(value)) {
-            set_idempotency_level(static_cast< ::google::protobuf::MethodOptions_IdempotencyLevel >(value));
+      case 34:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel_IsValid(val))) {
+            _internal_set_idempotency_level(static_cast<::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                34, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(34, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-      case 999: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_uninterpreted_option()));
-        } else {
+      case 999:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_uninterpreted_option(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<7994>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      default: {
-      handle_unusual:
-        if (tag == 0) {
-          goto success;
-        }
-        if ((8000u <= tag)) {
-          DO_(_extensions_.ParseField(tag, input,
-              internal_default_instance(),
-              _internal_metadata_.mutable_unknown_fields()));
-          continue;
-        }
-        DO_(::google::protobuf::internal::WireFormat::SkipField(
-              input, tag, _internal_metadata_.mutable_unknown_fields()));
-        break;
-      }
-    }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.MethodOptions)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.MethodOptions)
-  return false;
-#undef DO_
-}
-
-void MethodOptions::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.MethodOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool deprecated = 33 [default = false];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(33, this->deprecated(), output);
-  }
-
-  // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      34, this->idempotency_level(), 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++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      999, this->uninterpreted_option(static_cast<int>(i)), output);
-  }
-
-  // Extension range [1000, 536870912)
-  _extensions_.SerializeWithCachedSizes(
-      1000, 536870912, output);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.MethodOptions)
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((8000u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* MethodOptions::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* MethodOptions::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodOptions)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional bool deprecated = 33 [default = false];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(33, this->deprecated(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(33, this->_internal_deprecated(), target);
   }
 
   // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      34, this->idempotency_level(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      34, this->_internal_idempotency_level(), 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++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        999, this->uninterpreted_option(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_uninterpreted_option_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(999, this->_internal_uninterpreted_option(i), target, stream);
   }
 
   // Extension range [1000, 536870912)
-  target = _extensions_.InternalSerializeWithCachedSizesToArray(
-      1000, 536870912, deterministic, target);
+  target = _extensions_._InternalSerialize(
+  internal_default_instance(), 1000, 536870912, target, stream);
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MethodOptions)
   return target;
@@ -11574,68 +9092,56 @@ size_t MethodOptions::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-  {
-    unsigned int count = static_cast<unsigned int>(this->uninterpreted_option_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->uninterpreted_option(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_uninterpreted_option_size();
+  for (const auto& msg : this->uninterpreted_option_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional bool deprecated = 33 [default = false];
-    if (has_deprecated()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 2 + 1;
     }
 
     // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];
-    if (has_idempotency_level()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->idempotency_level());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_idempotency_level());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void MethodOptions::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.MethodOptions)
-  GOOGLE_DCHECK_NE(&from, this);
-  const MethodOptions* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const MethodOptions>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MethodOptions)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.MethodOptions)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MethodOptions::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    MethodOptions::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MethodOptions::GetClassData() const { return &_class_data_; }
+
+void MethodOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<MethodOptions *>(to)->MergeFrom(
+      static_cast<const MethodOptions &>(from));
 }
 
+
 void MethodOptions::MergeFrom(const MethodOptions& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.MethodOptions)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   uninterpreted_option_.MergeFrom(from.uninterpreted_option_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       deprecated_ = from.deprecated_;
     }
@@ -11644,13 +9150,8 @@ void MethodOptions::MergeFrom(const MethodOptions& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void MethodOptions::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.MethodOptions)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void MethodOptions::CopyFrom(const MethodOptions& from) {
@@ -11665,259 +9166,195 @@ bool MethodOptions::IsInitialized() const {
     return false;
   }
 
-  if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(uninterpreted_option_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
-  uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
-  swap(deprecated_, other->deprecated_);
-  swap(idempotency_level_, other->idempotency_level_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-  _extensions_.Swap(&other->_extensions_);
+  uninterpreted_option_.InternalSwap(&other->uninterpreted_option_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(MethodOptions, idempotency_level_)
+      + sizeof(MethodOptions::idempotency_level_)
+      - PROTOBUF_FIELD_OFFSET(MethodOptions, deprecated_)>(
+          reinterpret_cast<char*>(&deprecated_),
+          reinterpret_cast<char*>(&other->deprecated_));
 }
 
-::google::protobuf::Metadata MethodOptions::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata MethodOptions::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[20]);
 }
 
-
 // ===================================================================
 
-void UninterpretedOption_NamePart::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int UninterpretedOption_NamePart::kNamePartFieldNumber;
-const int UninterpretedOption_NamePart::kIsExtensionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-UninterpretedOption_NamePart::UninterpretedOption_NamePart()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption_NamePart();
+class UninterpretedOption_NamePart::_Internal {
+ public:
+  using HasBits = decltype(std::declval<UninterpretedOption_NamePart>()._has_bits_);
+  static void set_has_name_part(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_is_extension(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static bool MissingRequiredFields(const HasBits& has_bits) {
+    return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
+  }
+};
+
+UninterpretedOption_NamePart::UninterpretedOption_NamePart(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   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);
+  if (!is_message_owned) {
+    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),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_part_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name_part()) {
-    name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_part(),
-      GetArenaNoVirtual());
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_part_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_part_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name_part()) {
+    name_part_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name_part(), 
+      GetArenaForAllocation());
   }
   is_extension_ = from.is_extension_;
   // @@protoc_insertion_point(copy_constructor:google.protobuf.UninterpretedOption.NamePart)
 }
 
-void UninterpretedOption_NamePart::SharedCtor() {
-  _cached_size_ = 0;
-  name_part_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  is_extension_ = false;
+inline void UninterpretedOption_NamePart::SharedCtor() {
+name_part_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_part_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+is_extension_ = false;
 }
 
 UninterpretedOption_NamePart::~UninterpretedOption_NamePart() {
   // @@protoc_insertion_point(destructor:google.protobuf.UninterpretedOption.NamePart)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void UninterpretedOption_NamePart::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_part_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void UninterpretedOption_NamePart::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_part_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 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::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const UninterpretedOption_NamePart& UninterpretedOption_NamePart::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption_NamePart();
-  return *internal_default_instance();
-}
-
-UninterpretedOption_NamePart* UninterpretedOption_NamePart::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<UninterpretedOption_NamePart>(arena);
+  _cached_size_.Set(size);
 }
 
 void UninterpretedOption_NamePart::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.UninterpretedOption.NamePart)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(!name_part_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    name_part_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+    name_part_.ClearNonDefaultToEmpty();
   }
   is_extension_ = false;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool UninterpretedOption_NamePart::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.UninterpretedOption.NamePart)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* UninterpretedOption_NamePart::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // required string name_part = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name_part()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name_part().data(), static_cast<int>(this->name_part().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.UninterpretedOption.NamePart.name_part");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name_part();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.UninterpretedOption.NamePart.name_part");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // required bool is_extension = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_is_extension();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &is_extension_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_is_extension(&has_bits);
+          is_extension_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } 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.UninterpretedOption.NamePart)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.UninterpretedOption.NamePart)
-  return false;
-#undef DO_
-}
-
-void UninterpretedOption_NamePart::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.UninterpretedOption.NamePart)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required string name_part = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name_part().data(), static_cast<int>(this->name_part().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.UninterpretedOption.NamePart.name_part");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name_part(), output);
-  }
-
-  // required bool is_extension = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->is_extension(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.UninterpretedOption.NamePart)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* UninterpretedOption_NamePart::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* UninterpretedOption_NamePart::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption.NamePart)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // required string name_part = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name_part().data(), static_cast<int>(this->name_part().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name_part().data(), static_cast<int>(this->_internal_name_part().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.UninterpretedOption.NamePart.name_part");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name_part(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name_part(), target);
   }
 
   // required bool is_extension = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->is_extension(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_is_extension(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.UninterpretedOption.NamePart)
   return target;
@@ -11927,14 +9364,14 @@ size_t UninterpretedOption_NamePart::RequiredFieldsByteSizeFallback() const {
 // @@protoc_insertion_point(required_fields_byte_size_fallback_start:google.protobuf.UninterpretedOption.NamePart)
   size_t total_size = 0;
 
-  if (has_name_part()) {
+  if (_internal_has_name_part()) {
     // required string name_part = 1;
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name_part());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_name_part());
   }
 
-  if (has_is_extension()) {
+  if (_internal_has_is_extension()) {
     // required bool is_extension = 2;
     total_size += 1 + 1;
   }
@@ -11945,16 +9382,11 @@ size_t UninterpretedOption_NamePart::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.UninterpretedOption.NamePart)
   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] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
     // required string name_part = 1;
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name_part());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_name_part());
 
     // required bool is_extension = 2;
     total_size += 1 + 1;
@@ -11962,52 +9394,43 @@ size_t UninterpretedOption_NamePart::ByteSizeLong() const {
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
-  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;
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void UninterpretedOption_NamePart::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.UninterpretedOption.NamePart)
-  GOOGLE_DCHECK_NE(&from, this);
-  const UninterpretedOption_NamePart* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const UninterpretedOption_NamePart>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.UninterpretedOption.NamePart)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.UninterpretedOption.NamePart)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData UninterpretedOption_NamePart::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    UninterpretedOption_NamePart::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*UninterpretedOption_NamePart::GetClassData() const { return &_class_data_; }
+
+void UninterpretedOption_NamePart::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<UninterpretedOption_NamePart *>(to)->MergeFrom(
+      static_cast<const UninterpretedOption_NamePart &>(from));
 }
 
+
 void UninterpretedOption_NamePart::MergeFrom(const UninterpretedOption_NamePart& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.UninterpretedOption.NamePart)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_name_part(from.name_part());
+      _internal_set_name_part(from._internal_name_part());
     }
     if (cached_has_bits & 0x00000002u) {
       is_extension_ = from.is_extension_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void UninterpretedOption_NamePart::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.UninterpretedOption.NamePart)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void UninterpretedOption_NamePart::CopyFrom(const UninterpretedOption_NamePart& from) {
@@ -12018,96 +9441,93 @@ void UninterpretedOption_NamePart::CopyFrom(const UninterpretedOption_NamePart&
 }
 
 bool UninterpretedOption_NamePart::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
+  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
   return true;
 }
 
-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) {
   using std::swap;
-  name_part_.Swap(&other->name_part_);
-  swap(is_extension_, other->is_extension_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_part_, lhs_arena,
+      &other->name_part_, rhs_arena
+  );
+  swap(is_extension_, other->is_extension_);
 }
 
-::google::protobuf::Metadata UninterpretedOption_NamePart::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata UninterpretedOption_NamePart::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[21]);
 }
 
-
 // ===================================================================
 
-void UninterpretedOption::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int UninterpretedOption::kNameFieldNumber;
-const int UninterpretedOption::kIdentifierValueFieldNumber;
-const int UninterpretedOption::kPositiveIntValueFieldNumber;
-const int UninterpretedOption::kNegativeIntValueFieldNumber;
-const int UninterpretedOption::kDoubleValueFieldNumber;
-const int UninterpretedOption::kStringValueFieldNumber;
-const int UninterpretedOption::kAggregateValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-UninterpretedOption::UninterpretedOption()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption();
+class UninterpretedOption::_Internal {
+ public:
+  using HasBits = decltype(std::declval<UninterpretedOption>()._has_bits_);
+  static void set_has_identifier_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption)
-}
-UninterpretedOption::UninterpretedOption(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+  static void set_has_positive_int_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_negative_int_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_double_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_string_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_aggregate_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+UninterpretedOption::UninterpretedOption(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   name_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.UninterpretedOption)
 }
 UninterpretedOption::UninterpretedOption(const UninterpretedOption& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       name_(from.name_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  identifier_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_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_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_value(),
-      GetArenaNoVirtual());
-  }
-  aggregate_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_aggregate_value()) {
-    aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.aggregate_value(),
-      GetArenaNoVirtual());
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  identifier_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    identifier_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_identifier_value()) {
+    identifier_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_identifier_value(), 
+      GetArenaForAllocation());
+  }
+  string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    string_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_string_value()) {
+    string_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_string_value(), 
+      GetArenaForAllocation());
+  }
+  aggregate_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    aggregate_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_aggregate_value()) {
+    aggregate_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_aggregate_value(), 
+      GetArenaForAllocation());
   }
   ::memcpy(&positive_int_value_, &from.positive_int_value_,
     static_cast<size_t>(reinterpret_cast<char*>(&double_value_) -
@@ -12115,336 +9535,243 @@ UninterpretedOption::UninterpretedOption(const UninterpretedOption& from)
   // @@protoc_insertion_point(copy_constructor:google.protobuf.UninterpretedOption)
 }
 
-void UninterpretedOption::SharedCtor() {
-  _cached_size_ = 0;
-  identifier_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  aggregate_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&positive_int_value_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&double_value_) -
-      reinterpret_cast<char*>(&positive_int_value_)) + sizeof(double_value_));
+inline void UninterpretedOption::SharedCtor() {
+identifier_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  identifier_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  string_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+aggregate_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  aggregate_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&positive_int_value_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&double_value_) -
+    reinterpret_cast<char*>(&positive_int_value_)) + sizeof(double_value_));
 }
 
 UninterpretedOption::~UninterpretedOption() {
   // @@protoc_insertion_point(destructor:google.protobuf.UninterpretedOption)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void UninterpretedOption::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  identifier_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  aggregate_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void UninterpretedOption::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  identifier_value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  string_value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  aggregate_value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void UninterpretedOption::ArenaDtor(void* object) {
   UninterpretedOption* _this = reinterpret_cast< UninterpretedOption* >(object);
   (void)_this;
 }
-void UninterpretedOption::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void UninterpretedOption::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const UninterpretedOption& UninterpretedOption::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption();
-  return *internal_default_instance();
-}
-
-UninterpretedOption* UninterpretedOption::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<UninterpretedOption>(arena);
+  _cached_size_.Set(size);
 }
 
 void UninterpretedOption::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.UninterpretedOption)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   name_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!identifier_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      identifier_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      identifier_value_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!string_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      string_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      string_value_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!aggregate_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      aggregate_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      aggregate_value_.ClearNonDefaultToEmpty();
     }
   }
-  if (cached_has_bits & 56u) {
+  if (cached_has_bits & 0x00000038u) {
     ::memset(&positive_int_value_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&double_value_) -
         reinterpret_cast<char*>(&positive_int_value_)) + sizeof(double_value_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool UninterpretedOption::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.UninterpretedOption)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* UninterpretedOption::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .google.protobuf.UninterpretedOption.NamePart name = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_name()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_name(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string identifier_value = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_identifier_value()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->identifier_value().data(), static_cast<int>(this->identifier_value().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.UninterpretedOption.identifier_value");
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_identifier_value();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.UninterpretedOption.identifier_value");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional uint64 positive_int_value = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_positive_int_value();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
-                 input, &positive_int_value_)));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_positive_int_value(&has_bits);
+          positive_int_value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int64 negative_int_value = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_negative_int_value();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &negative_int_value_)));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_negative_int_value(&has_bits);
+          negative_int_value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional double double_value = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(49u /* 49 & 0xFF */)) {
-          set_has_double_value();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 input, &double_value_)));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 49)) {
+          _Internal::set_has_double_value(&has_bits);
+          double_value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
+          ptr += sizeof(double);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bytes string_value = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_string_value()));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          auto str = _internal_mutable_string_value();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string aggregate_value = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_aggregate_value()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->aggregate_value().data(), static_cast<int>(this->aggregate_value().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.UninterpretedOption.aggregate_value");
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          auto str = _internal_mutable_aggregate_value();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.UninterpretedOption.aggregate_value");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } 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.UninterpretedOption)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.UninterpretedOption)
-  return false;
-#undef DO_
-}
-
-void UninterpretedOption::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.UninterpretedOption)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .google.protobuf.UninterpretedOption.NamePart name = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->name_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->name(static_cast<int>(i)), output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional string identifier_value = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->identifier_value().data(), static_cast<int>(this->identifier_value().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.UninterpretedOption.identifier_value");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->identifier_value(), output);
-  }
-
-  // optional uint64 positive_int_value = 4;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->positive_int_value(), output);
-  }
-
-  // optional int64 negative_int_value = 5;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->negative_int_value(), output);
-  }
-
-  // optional double double_value = 6;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteDouble(6, this->double_value(), output);
-  }
-
-  // optional bytes string_value = 7;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      7, this->string_value(), output);
-  }
-
-  // optional string aggregate_value = 8;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->aggregate_value().data(), static_cast<int>(this->aggregate_value().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.UninterpretedOption.aggregate_value");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      8, this->aggregate_value(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.UninterpretedOption)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* UninterpretedOption::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* UninterpretedOption::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .google.protobuf.UninterpretedOption.NamePart name = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->name_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->name(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_name_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_name(i), target, stream);
   }
 
   cached_has_bits = _has_bits_[0];
   // optional string identifier_value = 3;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->identifier_value().data(), static_cast<int>(this->identifier_value().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_identifier_value().data(), static_cast<int>(this->_internal_identifier_value().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.UninterpretedOption.identifier_value");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->identifier_value(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_identifier_value(), target);
   }
 
   // optional uint64 positive_int_value = 4;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->positive_int_value(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(4, this->_internal_positive_int_value(), target);
   }
 
   // optional int64 negative_int_value = 5;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->negative_int_value(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->_internal_negative_int_value(), target);
   }
 
   // optional double double_value = 6;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(6, this->double_value(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(6, this->_internal_double_value(), target);
   }
 
   // optional bytes string_value = 7;
   if (cached_has_bits & 0x00000002u) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        7, this->string_value(), target);
+    target = stream->WriteBytesMaybeAliased(
+        7, this->_internal_string_value(), target);
   }
 
   // optional string aggregate_value = 8;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->aggregate_value().data(), static_cast<int>(this->aggregate_value().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_aggregate_value().data(), static_cast<int>(this->_internal_aggregate_value().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.UninterpretedOption.aggregate_value");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        8, this->aggregate_value(), target);
+    target = stream->WriteStringMaybeAliased(
+        8, this->_internal_aggregate_value(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.UninterpretedOption)
   return target;
@@ -12454,104 +9781,89 @@ size_t UninterpretedOption::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.UninterpretedOption)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.UninterpretedOption.NamePart name = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->name_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->name(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_name_size();
+  for (const auto& msg : this->name_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 63u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000003fu) {
     // optional string identifier_value = 3;
-    if (has_identifier_value()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->identifier_value());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_identifier_value());
     }
 
     // optional bytes string_value = 7;
-    if (has_string_value()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::BytesSize(
-          this->string_value());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+          this->_internal_string_value());
     }
 
     // optional string aggregate_value = 8;
-    if (has_aggregate_value()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->aggregate_value());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_aggregate_value());
     }
 
     // optional uint64 positive_int_value = 4;
-    if (has_positive_int_value()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt64Size(
-          this->positive_int_value());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64SizePlusOne(this->_internal_positive_int_value());
     }
 
     // optional int64 negative_int_value = 5;
-    if (has_negative_int_value()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->negative_int_value());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_negative_int_value());
     }
 
     // optional double double_value = 6;
-    if (has_double_value()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 + 8;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void UninterpretedOption::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.UninterpretedOption)
-  GOOGLE_DCHECK_NE(&from, this);
-  const UninterpretedOption* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const UninterpretedOption>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.UninterpretedOption)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.UninterpretedOption)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData UninterpretedOption::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    UninterpretedOption::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*UninterpretedOption::GetClassData() const { return &_class_data_; }
+
+void UninterpretedOption::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<UninterpretedOption *>(to)->MergeFrom(
+      static_cast<const UninterpretedOption &>(from));
 }
 
+
 void UninterpretedOption::MergeFrom(const UninterpretedOption& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.UninterpretedOption)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   name_.MergeFrom(from.name_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_identifier_value(from.identifier_value());
+      _internal_set_identifier_value(from._internal_identifier_value());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_string_value(from.string_value());
+      _internal_set_string_value(from._internal_string_value());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_aggregate_value(from.aggregate_value());
+      _internal_set_aggregate_value(from._internal_aggregate_value());
     }
     if (cached_has_bits & 0x00000008u) {
       positive_int_value_ = from.positive_int_value_;
@@ -12564,13 +9876,7 @@ void UninterpretedOption::MergeFrom(const UninterpretedOption& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void UninterpretedOption::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.UninterpretedOption)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void UninterpretedOption::CopyFrom(const UninterpretedOption& from) {
@@ -12581,147 +9887,135 @@ void UninterpretedOption::CopyFrom(const UninterpretedOption& from) {
 }
 
 bool UninterpretedOption::IsInitialized() const {
-  if (!::google::protobuf::internal::AllAreInitialized(this->name())) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(name_))
+    return false;
   return true;
 }
 
-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) {
   using std::swap;
-  name_.InternalSwap(&other->name_);
-  identifier_value_.Swap(&other->identifier_value_);
-  string_value_.Swap(&other->string_value_);
-  aggregate_value_.Swap(&other->aggregate_value_);
-  swap(positive_int_value_, other->positive_int_value_);
-  swap(negative_int_value_, other->negative_int_value_);
-  swap(double_value_, other->double_value_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata UninterpretedOption::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+  name_.InternalSwap(&other->name_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &identifier_value_, lhs_arena,
+      &other->identifier_value_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &string_value_, lhs_arena,
+      &other->string_value_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &aggregate_value_, lhs_arena,
+      &other->aggregate_value_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(UninterpretedOption, double_value_)
+      + sizeof(UninterpretedOption::double_value_)
+      - PROTOBUF_FIELD_OFFSET(UninterpretedOption, positive_int_value_)>(
+          reinterpret_cast<char*>(&positive_int_value_),
+          reinterpret_cast<char*>(&other->positive_int_value_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata UninterpretedOption::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[22]);
 }
 
-
 // ===================================================================
 
-void SourceCodeInfo_Location::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SourceCodeInfo_Location::kPathFieldNumber;
-const int SourceCodeInfo_Location::kSpanFieldNumber;
-const int SourceCodeInfo_Location::kLeadingCommentsFieldNumber;
-const int SourceCodeInfo_Location::kTrailingCommentsFieldNumber;
-const int SourceCodeInfo_Location::kLeadingDetachedCommentsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-SourceCodeInfo_Location::SourceCodeInfo_Location()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_Location();
+class SourceCodeInfo_Location::_Internal {
+ public:
+  using HasBits = decltype(std::declval<SourceCodeInfo_Location>()._has_bits_);
+  static void set_has_leading_comments(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo.Location)
-}
-SourceCodeInfo_Location::SourceCodeInfo_Location(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+  static void set_has_trailing_comments(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+SourceCodeInfo_Location::SourceCodeInfo_Location(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   path_(arena),
   span_(arena),
   leading_detached_comments_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_Location();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    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),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       path_(from.path_),
       span_(from.span_),
       leading_detached_comments_(from.leading_detached_comments_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  leading_comments_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_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_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.trailing_comments(),
-      GetArenaNoVirtual());
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  leading_comments_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    leading_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_leading_comments()) {
+    leading_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_leading_comments(), 
+      GetArenaForAllocation());
+  }
+  trailing_comments_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    trailing_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_trailing_comments()) {
+    trailing_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_trailing_comments(), 
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceCodeInfo.Location)
 }
 
-void SourceCodeInfo_Location::SharedCtor() {
-  _cached_size_ = 0;
-  leading_comments_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  trailing_comments_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void SourceCodeInfo_Location::SharedCtor() {
+leading_comments_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  leading_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+trailing_comments_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  trailing_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 SourceCodeInfo_Location::~SourceCodeInfo_Location() {
   // @@protoc_insertion_point(destructor:google.protobuf.SourceCodeInfo.Location)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SourceCodeInfo_Location::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  leading_comments_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  trailing_comments_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void SourceCodeInfo_Location::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  leading_comments_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  trailing_comments_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 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::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const SourceCodeInfo_Location& SourceCodeInfo_Location::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_Location();
-  return *internal_default_instance();
-}
-
-SourceCodeInfo_Location* SourceCodeInfo_Location::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<SourceCodeInfo_Location>(arena);
+  _cached_size_.Set(size);
 }
 
 void SourceCodeInfo_Location::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.SourceCodeInfo.Location)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -12729,272 +10023,170 @@ void SourceCodeInfo_Location::Clear() {
   span_.Clear();
   leading_detached_comments_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!leading_comments_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      leading_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      leading_comments_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!trailing_comments_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      trailing_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+      trailing_comments_.ClearNonDefaultToEmpty();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SourceCodeInfo_Location::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.SourceCodeInfo.Location)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated int32 path = 1 [packed = true];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_path())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 10u, input, this->mutable_path())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated int32 span = 2 [packed = true];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_span())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 18u, input, this->mutable_span())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string leading_comments = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_leading_comments()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->leading_comments().data(), static_cast<int>(this->leading_comments().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.SourceCodeInfo.Location.leading_comments");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string trailing_comments = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_trailing_comments()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->trailing_comments().data(), static_cast<int>(this->trailing_comments().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.SourceCodeInfo.Location.trailing_comments");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated string leading_detached_comments = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_leading_detached_comments()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->leading_detached_comments(this->leading_detached_comments_size() - 1).data(),
-            static_cast<int>(this->leading_detached_comments(this->leading_detached_comments_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.SourceCodeInfo.Location.leading_detached_comments");
-        } 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.SourceCodeInfo.Location)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.SourceCodeInfo.Location)
-  return false;
-#undef DO_
-}
-
-void SourceCodeInfo_Location::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.SourceCodeInfo.Location)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated int32 path = 1 [packed = true];
-  if (this->path_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _path_cached_byte_size_));
-  }
-  for (int i = 0, n = this->path_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
-      this->path(i), output);
-  }
-
-  // repeated int32 span = 2 [packed = true];
-  if (this->span_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _span_cached_byte_size_));
-  }
-  for (int i = 0, n = this->span_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
-      this->span(i), output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional string leading_comments = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->leading_comments().data(), static_cast<int>(this->leading_comments().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.SourceCodeInfo.Location.leading_comments");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->leading_comments(), output);
-  }
-
-  // optional string trailing_comments = 4;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->trailing_comments().data(), static_cast<int>(this->trailing_comments().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.SourceCodeInfo.Location.trailing_comments");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->trailing_comments(), output);
-  }
-
-  // repeated string leading_detached_comments = 6;
-  for (int i = 0, n = this->leading_detached_comments_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->leading_detached_comments(i).data(), static_cast<int>(this->leading_detached_comments(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.SourceCodeInfo.Location.leading_detached_comments");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      6, this->leading_detached_comments(i), output);
-  }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.SourceCodeInfo.Location)
+const char* SourceCodeInfo_Location::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // repeated int32 path = 1 [packed = true];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_path(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 8) {
+          _internal_add_path(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated int32 span = 2 [packed = true];
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_span(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 16) {
+          _internal_add_span(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string leading_comments = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_leading_comments();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.SourceCodeInfo.Location.leading_comments");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string trailing_comments = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_trailing_comments();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.SourceCodeInfo.Location.trailing_comments");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string leading_detached_comments = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_leading_detached_comments();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.SourceCodeInfo.Location.leading_detached_comments");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* SourceCodeInfo_Location::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* SourceCodeInfo_Location::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo.Location)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated int32 path = 1 [packed = true];
-  if (this->path_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      1,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _path_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt32NoTagToArray(this->path_, target);
+  {
+    int byte_size = _path_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt32Packed(
+          1, _internal_path(), byte_size, target);
+    }
   }
 
   // repeated int32 span = 2 [packed = true];
-  if (this->span_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      2,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _span_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt32NoTagToArray(this->span_, target);
+  {
+    int byte_size = _span_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt32Packed(
+          2, _internal_span(), byte_size, target);
+    }
   }
 
   cached_has_bits = _has_bits_[0];
   // optional string leading_comments = 3;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->leading_comments().data(), static_cast<int>(this->leading_comments().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_leading_comments().data(), static_cast<int>(this->_internal_leading_comments().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.SourceCodeInfo.Location.leading_comments");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->leading_comments(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_leading_comments(), target);
   }
 
   // optional string trailing_comments = 4;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->trailing_comments().data(), static_cast<int>(this->trailing_comments().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_trailing_comments().data(), static_cast<int>(this->_internal_trailing_comments().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.SourceCodeInfo.Location.trailing_comments");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->trailing_comments(), target);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_trailing_comments(), target);
   }
 
   // repeated string leading_detached_comments = 6;
-  for (int i = 0, n = this->leading_detached_comments_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->leading_detached_comments(i).data(), static_cast<int>(this->leading_detached_comments(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_leading_detached_comments_size(); i < n; i++) {
+    const auto& s = this->_internal_leading_detached_comments(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.SourceCodeInfo.Location.leading_detached_comments");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(6, this->leading_detached_comments(i), target);
+    target = stream->WriteString(6, s, target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceCodeInfo.Location)
   return target;
@@ -13004,115 +10196,100 @@ size_t SourceCodeInfo_Location::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.SourceCodeInfo.Location)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated int32 path = 1 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->path_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _path_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _path_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // repeated int32 span = 2 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->span_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _span_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _span_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // repeated string leading_detached_comments = 6;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->leading_detached_comments_size());
-  for (int i = 0, n = this->leading_detached_comments_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->leading_detached_comments(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(leading_detached_comments_.size());
+  for (int i = 0, n = leading_detached_comments_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      leading_detached_comments_.Get(i));
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional string leading_comments = 3;
-    if (has_leading_comments()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->leading_comments());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_leading_comments());
     }
 
     // optional string trailing_comments = 4;
-    if (has_trailing_comments()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->trailing_comments());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_trailing_comments());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SourceCodeInfo_Location::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.SourceCodeInfo.Location)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SourceCodeInfo_Location* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SourceCodeInfo_Location>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceCodeInfo.Location)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.SourceCodeInfo.Location)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SourceCodeInfo_Location::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SourceCodeInfo_Location::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SourceCodeInfo_Location::GetClassData() const { return &_class_data_; }
+
+void SourceCodeInfo_Location::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SourceCodeInfo_Location *>(to)->MergeFrom(
+      static_cast<const SourceCodeInfo_Location &>(from));
 }
 
+
 void SourceCodeInfo_Location::MergeFrom(const SourceCodeInfo_Location& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.SourceCodeInfo.Location)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   path_.MergeFrom(from.path_);
   span_.MergeFrom(from.span_);
   leading_detached_comments_.MergeFrom(from.leading_detached_comments_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_leading_comments(from.leading_comments());
+      _internal_set_leading_comments(from._internal_leading_comments());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_trailing_comments(from.trailing_comments());
+      _internal_set_trailing_comments(from._internal_trailing_comments());
     }
   }
-}
-
-void SourceCodeInfo_Location::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.SourceCodeInfo.Location)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void SourceCodeInfo_Location::CopyFrom(const SourceCodeInfo_Location& from) {
@@ -13126,206 +10303,149 @@ bool SourceCodeInfo_Location::IsInitialized() const {
   return true;
 }
 
-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) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   path_.InternalSwap(&other->path_);
   span_.InternalSwap(&other->span_);
   leading_detached_comments_.InternalSwap(&other->leading_detached_comments_);
-  leading_comments_.Swap(&other->leading_comments_);
-  trailing_comments_.Swap(&other->trailing_comments_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &leading_comments_, lhs_arena,
+      &other->leading_comments_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &trailing_comments_, lhs_arena,
+      &other->trailing_comments_, rhs_arena
+  );
 }
 
-::google::protobuf::Metadata SourceCodeInfo_Location::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SourceCodeInfo_Location::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[23]);
 }
 
-
 // ===================================================================
 
-void SourceCodeInfo::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SourceCodeInfo::kLocationFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class SourceCodeInfo::_Internal {
+ public:
+};
 
-SourceCodeInfo::SourceCodeInfo()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::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),
+SourceCodeInfo::SourceCodeInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   location_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.SourceCodeInfo)
 }
 SourceCodeInfo::SourceCodeInfo(const SourceCodeInfo& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       location_(from.location_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceCodeInfo)
 }
 
-void SourceCodeInfo::SharedCtor() {
-  _cached_size_ = 0;
+inline void SourceCodeInfo::SharedCtor() {
 }
 
 SourceCodeInfo::~SourceCodeInfo() {
   // @@protoc_insertion_point(destructor:google.protobuf.SourceCodeInfo)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SourceCodeInfo::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void SourceCodeInfo::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void SourceCodeInfo::ArenaDtor(void* object) {
   SourceCodeInfo* _this = reinterpret_cast< SourceCodeInfo* >(object);
   (void)_this;
 }
-void SourceCodeInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void SourceCodeInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const SourceCodeInfo& SourceCodeInfo::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo();
-  return *internal_default_instance();
-}
-
-SourceCodeInfo* SourceCodeInfo::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<SourceCodeInfo>(arena);
+  _cached_size_.Set(size);
 }
 
 void SourceCodeInfo::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.SourceCodeInfo)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   location_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SourceCodeInfo::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.SourceCodeInfo)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* SourceCodeInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .google.protobuf.SourceCodeInfo.Location location = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_location()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_location(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } 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.SourceCodeInfo)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.SourceCodeInfo)
-  return false;
-#undef DO_
-}
-
-void SourceCodeInfo::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.SourceCodeInfo)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .google.protobuf.SourceCodeInfo.Location location = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->location_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->location(static_cast<int>(i)), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.SourceCodeInfo)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* SourceCodeInfo::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* SourceCodeInfo::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .google.protobuf.SourceCodeInfo.Location location = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->location_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->location(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_location_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_location(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceCodeInfo)
   return target;
@@ -13335,59 +10455,41 @@ size_t SourceCodeInfo::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.SourceCodeInfo)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.SourceCodeInfo.Location location = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->location_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->location(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_location_size();
+  for (const auto& msg : this->location_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SourceCodeInfo::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.SourceCodeInfo)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SourceCodeInfo* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SourceCodeInfo>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceCodeInfo)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.SourceCodeInfo)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SourceCodeInfo::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SourceCodeInfo::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SourceCodeInfo::GetClassData() const { return &_class_data_; }
+
+void SourceCodeInfo::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SourceCodeInfo *>(to)->MergeFrom(
+      static_cast<const SourceCodeInfo &>(from));
 }
 
+
 void SourceCodeInfo::MergeFrom(const SourceCodeInfo& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.SourceCodeInfo)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   location_.MergeFrom(from.location_);
-}
-
-void SourceCodeInfo::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.SourceCodeInfo)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void SourceCodeInfo::CopyFrom(const SourceCodeInfo& from) {
@@ -13401,78 +10503,56 @@ bool SourceCodeInfo::IsInitialized() const {
   return true;
 }
 
-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) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   location_.InternalSwap(&other->location_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata SourceCodeInfo::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SourceCodeInfo::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[24]);
 }
 
-
 // ===================================================================
 
-void GeneratedCodeInfo_Annotation::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int GeneratedCodeInfo_Annotation::kPathFieldNumber;
-const int GeneratedCodeInfo_Annotation::kSourceFileFieldNumber;
-const int GeneratedCodeInfo_Annotation::kBeginFieldNumber;
-const int GeneratedCodeInfo_Annotation::kEndFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_Annotation();
+class GeneratedCodeInfo_Annotation::_Internal {
+ public:
+  using HasBits = decltype(std::declval<GeneratedCodeInfo_Annotation>()._has_bits_);
+  static void set_has_source_file(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo.Annotation)
-}
-GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+  static void set_has_begin(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_end(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   path_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_Annotation();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    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),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       path_(from.path_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  source_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_source_file()) {
-    source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_file(),
-      GetArenaNoVirtual());
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  source_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    source_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_source_file()) {
+    source_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_source_file(), 
+      GetArenaForAllocation());
   }
   ::memcpy(&begin_, &from.begin_,
     static_cast<size_t>(reinterpret_cast<char*>(&end_) -
@@ -13480,253 +10560,172 @@ GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(const GeneratedCodeIn
   // @@protoc_insertion_point(copy_constructor:google.protobuf.GeneratedCodeInfo.Annotation)
 }
 
-void GeneratedCodeInfo_Annotation::SharedCtor() {
-  _cached_size_ = 0;
-  source_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&begin_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&end_) -
-      reinterpret_cast<char*>(&begin_)) + sizeof(end_));
+inline void GeneratedCodeInfo_Annotation::SharedCtor() {
+source_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  source_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&begin_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&end_) -
+    reinterpret_cast<char*>(&begin_)) + sizeof(end_));
 }
 
 GeneratedCodeInfo_Annotation::~GeneratedCodeInfo_Annotation() {
   // @@protoc_insertion_point(destructor:google.protobuf.GeneratedCodeInfo.Annotation)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void GeneratedCodeInfo_Annotation::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  source_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void GeneratedCodeInfo_Annotation::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  source_file_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 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::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const GeneratedCodeInfo_Annotation& GeneratedCodeInfo_Annotation::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_Annotation();
-  return *internal_default_instance();
-}
-
-GeneratedCodeInfo_Annotation* GeneratedCodeInfo_Annotation::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<GeneratedCodeInfo_Annotation>(arena);
+  _cached_size_.Set(size);
 }
 
 void GeneratedCodeInfo_Annotation::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.GeneratedCodeInfo.Annotation)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   path_.Clear();
   cached_has_bits = _has_bits_[0];
   if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(!source_file_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    source_file_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+    source_file_.ClearNonDefaultToEmpty();
   }
-  if (cached_has_bits & 6u) {
+  if (cached_has_bits & 0x00000006u) {
     ::memset(&begin_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&end_) -
         reinterpret_cast<char*>(&begin_)) + sizeof(end_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool GeneratedCodeInfo_Annotation::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.GeneratedCodeInfo.Annotation)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* GeneratedCodeInfo_Annotation::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated int32 path = 1 [packed = true];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_path())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 10u, input, this->mutable_path())));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_path(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 8) {
+          _internal_add_path(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string source_file = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_source_file()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->source_file().data(), static_cast<int>(this->source_file().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "google.protobuf.GeneratedCodeInfo.Annotation.source_file");
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_source_file();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.GeneratedCodeInfo.Annotation.source_file");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int32 begin = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_begin();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &begin_)));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_begin(&has_bits);
+          begin_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int32 end = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_end();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &end_)));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_end(&has_bits);
+          end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } 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.GeneratedCodeInfo.Annotation)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.GeneratedCodeInfo.Annotation)
-  return false;
-#undef DO_
-}
-
-void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.GeneratedCodeInfo.Annotation)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated int32 path = 1 [packed = true];
-  if (this->path_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _path_cached_byte_size_));
-  }
-  for (int i = 0, n = this->path_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
-      this->path(i), output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional string source_file = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source_file().data(), static_cast<int>(this->source_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "google.protobuf.GeneratedCodeInfo.Annotation.source_file");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->source_file(), output);
-  }
-
-  // optional int32 begin = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->begin(), output);
-  }
-
-  // optional int32 end = 4;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, 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.GeneratedCodeInfo.Annotation)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* GeneratedCodeInfo_Annotation::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* GeneratedCodeInfo_Annotation::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo.Annotation)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated int32 path = 1 [packed = true];
-  if (this->path_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      1,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _path_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt32NoTagToArray(this->path_, target);
+  {
+    int byte_size = _path_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt32Packed(
+          1, _internal_path(), byte_size, target);
+    }
   }
 
   cached_has_bits = _has_bits_[0];
   // optional string source_file = 2;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source_file().data(), static_cast<int>(this->source_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_source_file().data(), static_cast<int>(this->_internal_source_file().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "google.protobuf.GeneratedCodeInfo.Annotation.source_file");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->source_file(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_source_file(), target);
   }
 
   // optional int32 begin = 3;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->begin(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_begin(), target);
   }
 
   // optional int32 end = 4;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->end(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_end(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.GeneratedCodeInfo.Annotation)
   return target;
@@ -13736,84 +10735,72 @@ size_t GeneratedCodeInfo_Annotation::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.GeneratedCodeInfo.Annotation)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated int32 path = 1 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->path_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _path_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _path_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 7u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000007u) {
     // optional string source_file = 2;
-    if (has_source_file()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->source_file());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_source_file());
     }
 
     // optional int32 begin = 3;
-    if (has_begin()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->begin());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_begin());
     }
 
     // optional int32 end = 4;
-    if (has_end()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->end());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void GeneratedCodeInfo_Annotation::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.GeneratedCodeInfo.Annotation)
-  GOOGLE_DCHECK_NE(&from, this);
-  const GeneratedCodeInfo_Annotation* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const GeneratedCodeInfo_Annotation>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.GeneratedCodeInfo.Annotation)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.GeneratedCodeInfo.Annotation)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GeneratedCodeInfo_Annotation::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    GeneratedCodeInfo_Annotation::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GeneratedCodeInfo_Annotation::GetClassData() const { return &_class_data_; }
+
+void GeneratedCodeInfo_Annotation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<GeneratedCodeInfo_Annotation *>(to)->MergeFrom(
+      static_cast<const GeneratedCodeInfo_Annotation &>(from));
 }
 
+
 void GeneratedCodeInfo_Annotation::MergeFrom(const GeneratedCodeInfo_Annotation& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.GeneratedCodeInfo.Annotation)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   path_.MergeFrom(from.path_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      set_source_file(from.source_file());
+      _internal_set_source_file(from._internal_source_file());
     }
     if (cached_has_bits & 0x00000002u) {
       begin_ = from.begin_;
@@ -13823,13 +10810,7 @@ void GeneratedCodeInfo_Annotation::MergeFrom(const GeneratedCodeInfo_Annotation&
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void GeneratedCodeInfo_Annotation::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.GeneratedCodeInfo.Annotation)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void GeneratedCodeInfo_Annotation::CopyFrom(const GeneratedCodeInfo_Annotation& from) {
@@ -13843,205 +10824,148 @@ bool GeneratedCodeInfo_Annotation::IsInitialized() const {
   return true;
 }
 
-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) {
   using std::swap;
-  path_.InternalSwap(&other->path_);
-  source_file_.Swap(&other->source_file_);
-  swap(begin_, other->begin_);
-  swap(end_, other->end_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  path_.InternalSwap(&other->path_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &source_file_, lhs_arena,
+      &other->source_file_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(GeneratedCodeInfo_Annotation, end_)
+      + sizeof(GeneratedCodeInfo_Annotation::end_)
+      - PROTOBUF_FIELD_OFFSET(GeneratedCodeInfo_Annotation, begin_)>(
+          reinterpret_cast<char*>(&begin_),
+          reinterpret_cast<char*>(&other->begin_));
 }
 
-::google::protobuf::Metadata GeneratedCodeInfo_Annotation::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata GeneratedCodeInfo_Annotation::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[25]);
 }
 
-
 // ===================================================================
 
-void GeneratedCodeInfo::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int GeneratedCodeInfo::kAnnotationFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class GeneratedCodeInfo::_Internal {
+ public:
+};
 
-GeneratedCodeInfo::GeneratedCodeInfo()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::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),
+GeneratedCodeInfo::GeneratedCodeInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   annotation_(arena) {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:google.protobuf.GeneratedCodeInfo)
 }
 GeneratedCodeInfo::GeneratedCodeInfo(const GeneratedCodeInfo& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       annotation_(from.annotation_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:google.protobuf.GeneratedCodeInfo)
 }
 
-void GeneratedCodeInfo::SharedCtor() {
-  _cached_size_ = 0;
+inline void GeneratedCodeInfo::SharedCtor() {
 }
 
 GeneratedCodeInfo::~GeneratedCodeInfo() {
   // @@protoc_insertion_point(destructor:google.protobuf.GeneratedCodeInfo)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void GeneratedCodeInfo::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void GeneratedCodeInfo::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void GeneratedCodeInfo::ArenaDtor(void* object) {
   GeneratedCodeInfo* _this = reinterpret_cast< GeneratedCodeInfo* >(object);
   (void)_this;
 }
-void GeneratedCodeInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void GeneratedCodeInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::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;
-}
-
-const GeneratedCodeInfo& GeneratedCodeInfo::default_instance() {
-  ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo();
-  return *internal_default_instance();
-}
-
-GeneratedCodeInfo* GeneratedCodeInfo::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<GeneratedCodeInfo>(arena);
+  _cached_size_.Set(size);
 }
 
 void GeneratedCodeInfo::Clear() {
 // @@protoc_insertion_point(message_clear_start:google.protobuf.GeneratedCodeInfo)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   annotation_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool GeneratedCodeInfo::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.GeneratedCodeInfo)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* GeneratedCodeInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_annotation()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_annotation(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } 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.GeneratedCodeInfo)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.GeneratedCodeInfo)
-  return false;
-#undef DO_
-}
-
-void GeneratedCodeInfo::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.GeneratedCodeInfo)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->annotation_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->annotation(static_cast<int>(i)), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.GeneratedCodeInfo)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* GeneratedCodeInfo::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* GeneratedCodeInfo::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->annotation_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->annotation(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_annotation_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_annotation(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.GeneratedCodeInfo)
   return target;
@@ -14051,59 +10975,41 @@ size_t GeneratedCodeInfo::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.GeneratedCodeInfo)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->annotation_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->annotation(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_annotation_size();
+  for (const auto& msg : this->annotation_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void GeneratedCodeInfo::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.GeneratedCodeInfo)
-  GOOGLE_DCHECK_NE(&from, this);
-  const GeneratedCodeInfo* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const GeneratedCodeInfo>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.GeneratedCodeInfo)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.GeneratedCodeInfo)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GeneratedCodeInfo::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    GeneratedCodeInfo::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GeneratedCodeInfo::GetClassData() const { return &_class_data_; }
+
+void GeneratedCodeInfo::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<GeneratedCodeInfo *>(to)->MergeFrom(
+      static_cast<const GeneratedCodeInfo &>(from));
 }
 
+
 void GeneratedCodeInfo::MergeFrom(const GeneratedCodeInfo& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.GeneratedCodeInfo)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   annotation_.MergeFrom(from.annotation_);
-}
-
-void GeneratedCodeInfo::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.GeneratedCodeInfo)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void GeneratedCodeInfo::CopyFrom(const GeneratedCodeInfo& from) {
@@ -14117,41 +11023,103 @@ bool GeneratedCodeInfo::IsInitialized() const {
   return true;
 }
 
-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) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   annotation_.InternalSwap(&other->annotation_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata GeneratedCodeInfo::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata GeneratedCodeInfo::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
+      file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[26]);
 }
 
-
 // @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::FileDescriptorSet* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::FileDescriptorSet >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::FileDescriptorSet >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::DescriptorProto* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::FileOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::FileOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::FileOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::MessageOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::MessageOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::MessageOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::FieldOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::FieldOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::FieldOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::OneofOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::OneofOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::OneofOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::EnumOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::EnumOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::EnumOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::EnumValueOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::EnumValueOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::ServiceOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::ServiceOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::ServiceOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::MethodOptions* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::MethodOptions >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::MethodOptions >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation >(arena);
+}
+template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index 4ed5cac..66d7e26 100644 (file)
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: google/protobuf/descriptor.proto
 
-#ifndef PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include <google/protobuf/generated_enum_reflection.h>
 #include <google/protobuf/unknown_field_set.h>
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fdescriptor_2eproto PROTOBUF_EXPORT
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-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[];
+struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fdescriptor_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[27]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-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 {
+PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto;
+PROTOBUF_NAMESPACE_OPEN
 class DescriptorProto;
-class DescriptorProtoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern DescriptorProtoDefaultTypeInternal _DescriptorProto_default_instance_;
+struct DescriptorProtoDefaultTypeInternal;
+PROTOBUF_EXPORT extern DescriptorProtoDefaultTypeInternal _DescriptorProto_default_instance_;
 class DescriptorProto_ExtensionRange;
-class DescriptorProto_ExtensionRangeDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern DescriptorProto_ExtensionRangeDefaultTypeInternal _DescriptorProto_ExtensionRange_default_instance_;
+struct DescriptorProto_ExtensionRangeDefaultTypeInternal;
+PROTOBUF_EXPORT extern DescriptorProto_ExtensionRangeDefaultTypeInternal _DescriptorProto_ExtensionRange_default_instance_;
 class DescriptorProto_ReservedRange;
-class DescriptorProto_ReservedRangeDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern DescriptorProto_ReservedRangeDefaultTypeInternal _DescriptorProto_ReservedRange_default_instance_;
+struct DescriptorProto_ReservedRangeDefaultTypeInternal;
+PROTOBUF_EXPORT extern DescriptorProto_ReservedRangeDefaultTypeInternal _DescriptorProto_ReservedRange_default_instance_;
 class EnumDescriptorProto;
-class EnumDescriptorProtoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern EnumDescriptorProtoDefaultTypeInternal _EnumDescriptorProto_default_instance_;
+struct EnumDescriptorProtoDefaultTypeInternal;
+PROTOBUF_EXPORT extern EnumDescriptorProtoDefaultTypeInternal _EnumDescriptorProto_default_instance_;
 class EnumDescriptorProto_EnumReservedRange;
-class EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal _EnumDescriptorProto_EnumReservedRange_default_instance_;
+struct EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal;
+PROTOBUF_EXPORT extern EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal _EnumDescriptorProto_EnumReservedRange_default_instance_;
 class EnumOptions;
-class EnumOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern EnumOptionsDefaultTypeInternal _EnumOptions_default_instance_;
+struct EnumOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern EnumOptionsDefaultTypeInternal _EnumOptions_default_instance_;
 class EnumValueDescriptorProto;
-class EnumValueDescriptorProtoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern EnumValueDescriptorProtoDefaultTypeInternal _EnumValueDescriptorProto_default_instance_;
+struct EnumValueDescriptorProtoDefaultTypeInternal;
+PROTOBUF_EXPORT extern EnumValueDescriptorProtoDefaultTypeInternal _EnumValueDescriptorProto_default_instance_;
 class EnumValueOptions;
-class EnumValueOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern EnumValueOptionsDefaultTypeInternal _EnumValueOptions_default_instance_;
+struct EnumValueOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern EnumValueOptionsDefaultTypeInternal _EnumValueOptions_default_instance_;
 class ExtensionRangeOptions;
-class ExtensionRangeOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern ExtensionRangeOptionsDefaultTypeInternal _ExtensionRangeOptions_default_instance_;
+struct ExtensionRangeOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern ExtensionRangeOptionsDefaultTypeInternal _ExtensionRangeOptions_default_instance_;
 class FieldDescriptorProto;
-class FieldDescriptorProtoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern FieldDescriptorProtoDefaultTypeInternal _FieldDescriptorProto_default_instance_;
+struct FieldDescriptorProtoDefaultTypeInternal;
+PROTOBUF_EXPORT extern FieldDescriptorProtoDefaultTypeInternal _FieldDescriptorProto_default_instance_;
 class FieldOptions;
-class FieldOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern FieldOptionsDefaultTypeInternal _FieldOptions_default_instance_;
+struct FieldOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern FieldOptionsDefaultTypeInternal _FieldOptions_default_instance_;
 class FileDescriptorProto;
-class FileDescriptorProtoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern FileDescriptorProtoDefaultTypeInternal _FileDescriptorProto_default_instance_;
+struct FileDescriptorProtoDefaultTypeInternal;
+PROTOBUF_EXPORT extern FileDescriptorProtoDefaultTypeInternal _FileDescriptorProto_default_instance_;
 class FileDescriptorSet;
-class FileDescriptorSetDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern FileDescriptorSetDefaultTypeInternal _FileDescriptorSet_default_instance_;
+struct FileDescriptorSetDefaultTypeInternal;
+PROTOBUF_EXPORT extern FileDescriptorSetDefaultTypeInternal _FileDescriptorSet_default_instance_;
 class FileOptions;
-class FileOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern FileOptionsDefaultTypeInternal _FileOptions_default_instance_;
+struct FileOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern FileOptionsDefaultTypeInternal _FileOptions_default_instance_;
 class GeneratedCodeInfo;
-class GeneratedCodeInfoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern GeneratedCodeInfoDefaultTypeInternal _GeneratedCodeInfo_default_instance_;
+struct GeneratedCodeInfoDefaultTypeInternal;
+PROTOBUF_EXPORT extern GeneratedCodeInfoDefaultTypeInternal _GeneratedCodeInfo_default_instance_;
 class GeneratedCodeInfo_Annotation;
-class GeneratedCodeInfo_AnnotationDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern GeneratedCodeInfo_AnnotationDefaultTypeInternal _GeneratedCodeInfo_Annotation_default_instance_;
+struct GeneratedCodeInfo_AnnotationDefaultTypeInternal;
+PROTOBUF_EXPORT extern GeneratedCodeInfo_AnnotationDefaultTypeInternal _GeneratedCodeInfo_Annotation_default_instance_;
 class MessageOptions;
-class MessageOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern MessageOptionsDefaultTypeInternal _MessageOptions_default_instance_;
+struct MessageOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern MessageOptionsDefaultTypeInternal _MessageOptions_default_instance_;
 class MethodDescriptorProto;
-class MethodDescriptorProtoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern MethodDescriptorProtoDefaultTypeInternal _MethodDescriptorProto_default_instance_;
+struct MethodDescriptorProtoDefaultTypeInternal;
+PROTOBUF_EXPORT extern MethodDescriptorProtoDefaultTypeInternal _MethodDescriptorProto_default_instance_;
 class MethodOptions;
-class MethodOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern MethodOptionsDefaultTypeInternal _MethodOptions_default_instance_;
+struct MethodOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern MethodOptionsDefaultTypeInternal _MethodOptions_default_instance_;
 class OneofDescriptorProto;
-class OneofDescriptorProtoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern OneofDescriptorProtoDefaultTypeInternal _OneofDescriptorProto_default_instance_;
+struct OneofDescriptorProtoDefaultTypeInternal;
+PROTOBUF_EXPORT extern OneofDescriptorProtoDefaultTypeInternal _OneofDescriptorProto_default_instance_;
 class OneofOptions;
-class OneofOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern OneofOptionsDefaultTypeInternal _OneofOptions_default_instance_;
+struct OneofOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern OneofOptionsDefaultTypeInternal _OneofOptions_default_instance_;
 class ServiceDescriptorProto;
-class ServiceDescriptorProtoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern ServiceDescriptorProtoDefaultTypeInternal _ServiceDescriptorProto_default_instance_;
+struct ServiceDescriptorProtoDefaultTypeInternal;
+PROTOBUF_EXPORT extern ServiceDescriptorProtoDefaultTypeInternal _ServiceDescriptorProto_default_instance_;
 class ServiceOptions;
-class ServiceOptionsDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern ServiceOptionsDefaultTypeInternal _ServiceOptions_default_instance_;
+struct ServiceOptionsDefaultTypeInternal;
+PROTOBUF_EXPORT extern ServiceOptionsDefaultTypeInternal _ServiceOptions_default_instance_;
 class SourceCodeInfo;
-class SourceCodeInfoDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern SourceCodeInfoDefaultTypeInternal _SourceCodeInfo_default_instance_;
+struct SourceCodeInfoDefaultTypeInternal;
+PROTOBUF_EXPORT extern SourceCodeInfoDefaultTypeInternal _SourceCodeInfo_default_instance_;
 class SourceCodeInfo_Location;
-class SourceCodeInfo_LocationDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern SourceCodeInfo_LocationDefaultTypeInternal _SourceCodeInfo_Location_default_instance_;
+struct SourceCodeInfo_LocationDefaultTypeInternal;
+PROTOBUF_EXPORT extern SourceCodeInfo_LocationDefaultTypeInternal _SourceCodeInfo_Location_default_instance_;
 class UninterpretedOption;
-class UninterpretedOptionDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern UninterpretedOptionDefaultTypeInternal _UninterpretedOption_default_instance_;
+struct UninterpretedOptionDefaultTypeInternal;
+PROTOBUF_EXPORT extern UninterpretedOptionDefaultTypeInternal _UninterpretedOption_default_instance_;
 class UninterpretedOption_NamePart;
-class UninterpretedOption_NamePartDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern UninterpretedOption_NamePartDefaultTypeInternal _UninterpretedOption_NamePart_default_instance_;
-}  // namespace protobuf
-}  // namespace google
-namespace google {
-namespace protobuf {
-
-enum FieldDescriptorProto_Type {
+struct UninterpretedOption_NamePartDefaultTypeInternal;
+PROTOBUF_EXPORT extern UninterpretedOption_NamePartDefaultTypeInternal _UninterpretedOption_NamePart_default_instance_;
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValueOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileDescriptorProto>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileDescriptorSet* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileDescriptorSet>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FileOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MessageOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MessageOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::MethodOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MethodOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::OneofOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::OneofOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::ServiceOptions* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ServiceOptions>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::UninterpretedOption>(Arena*);
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
+
+enum FieldDescriptorProto_Type : int {
   FieldDescriptorProto_Type_TYPE_DOUBLE = 1,
   FieldDescriptorProto_Type_TYPE_FLOAT = 2,
   FieldDescriptorProto_Type_TYPE_INT64 = 3,
@@ -235,968 +188,1195 @@ enum FieldDescriptorProto_Type {
   FieldDescriptorProto_Type_TYPE_SINT32 = 17,
   FieldDescriptorProto_Type_TYPE_SINT64 = 18
 };
-LIBPROTOBUF_EXPORT bool FieldDescriptorProto_Type_IsValid(int value);
-const FieldDescriptorProto_Type FieldDescriptorProto_Type_Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE;
-const FieldDescriptorProto_Type FieldDescriptorProto_Type_Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64;
-const int FieldDescriptorProto_Type_Type_ARRAYSIZE = FieldDescriptorProto_Type_Type_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor();
-inline const ::std::string& FieldDescriptorProto_Type_Name(FieldDescriptorProto_Type value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    FieldDescriptorProto_Type_descriptor(), value);
+PROTOBUF_EXPORT bool FieldDescriptorProto_Type_IsValid(int value);
+constexpr FieldDescriptorProto_Type FieldDescriptorProto_Type_Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE;
+constexpr FieldDescriptorProto_Type FieldDescriptorProto_Type_Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64;
+constexpr int FieldDescriptorProto_Type_Type_ARRAYSIZE = FieldDescriptorProto_Type_Type_MAX + 1;
+
+PROTOBUF_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldDescriptorProto_Type_descriptor();
+template<typename T>
+inline const std::string& FieldDescriptorProto_Type_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, FieldDescriptorProto_Type>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function FieldDescriptorProto_Type_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    FieldDescriptorProto_Type_descriptor(), enum_t_value);
 }
 inline bool FieldDescriptorProto_Type_Parse(
-    const ::std::string& name, FieldDescriptorProto_Type* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<FieldDescriptorProto_Type>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, FieldDescriptorProto_Type* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<FieldDescriptorProto_Type>(
     FieldDescriptorProto_Type_descriptor(), name, value);
 }
-enum FieldDescriptorProto_Label {
+enum FieldDescriptorProto_Label : int {
   FieldDescriptorProto_Label_LABEL_OPTIONAL = 1,
   FieldDescriptorProto_Label_LABEL_REQUIRED = 2,
   FieldDescriptorProto_Label_LABEL_REPEATED = 3
 };
-LIBPROTOBUF_EXPORT bool FieldDescriptorProto_Label_IsValid(int value);
-const FieldDescriptorProto_Label FieldDescriptorProto_Label_Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL;
-const FieldDescriptorProto_Label FieldDescriptorProto_Label_Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED;
-const int FieldDescriptorProto_Label_Label_ARRAYSIZE = FieldDescriptorProto_Label_Label_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor();
-inline const ::std::string& FieldDescriptorProto_Label_Name(FieldDescriptorProto_Label value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    FieldDescriptorProto_Label_descriptor(), value);
+PROTOBUF_EXPORT bool FieldDescriptorProto_Label_IsValid(int value);
+constexpr FieldDescriptorProto_Label FieldDescriptorProto_Label_Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL;
+constexpr FieldDescriptorProto_Label FieldDescriptorProto_Label_Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED;
+constexpr int FieldDescriptorProto_Label_Label_ARRAYSIZE = FieldDescriptorProto_Label_Label_MAX + 1;
+
+PROTOBUF_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldDescriptorProto_Label_descriptor();
+template<typename T>
+inline const std::string& FieldDescriptorProto_Label_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, FieldDescriptorProto_Label>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function FieldDescriptorProto_Label_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    FieldDescriptorProto_Label_descriptor(), enum_t_value);
 }
 inline bool FieldDescriptorProto_Label_Parse(
-    const ::std::string& name, FieldDescriptorProto_Label* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<FieldDescriptorProto_Label>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, FieldDescriptorProto_Label* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<FieldDescriptorProto_Label>(
     FieldDescriptorProto_Label_descriptor(), name, value);
 }
-enum FileOptions_OptimizeMode {
+enum FileOptions_OptimizeMode : int {
   FileOptions_OptimizeMode_SPEED = 1,
   FileOptions_OptimizeMode_CODE_SIZE = 2,
   FileOptions_OptimizeMode_LITE_RUNTIME = 3
 };
-LIBPROTOBUF_EXPORT bool FileOptions_OptimizeMode_IsValid(int value);
-const FileOptions_OptimizeMode FileOptions_OptimizeMode_OptimizeMode_MIN = FileOptions_OptimizeMode_SPEED;
-const FileOptions_OptimizeMode FileOptions_OptimizeMode_OptimizeMode_MAX = FileOptions_OptimizeMode_LITE_RUNTIME;
-const int FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE = FileOptions_OptimizeMode_OptimizeMode_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor();
-inline const ::std::string& FileOptions_OptimizeMode_Name(FileOptions_OptimizeMode value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    FileOptions_OptimizeMode_descriptor(), value);
+PROTOBUF_EXPORT bool FileOptions_OptimizeMode_IsValid(int value);
+constexpr FileOptions_OptimizeMode FileOptions_OptimizeMode_OptimizeMode_MIN = FileOptions_OptimizeMode_SPEED;
+constexpr FileOptions_OptimizeMode FileOptions_OptimizeMode_OptimizeMode_MAX = FileOptions_OptimizeMode_LITE_RUNTIME;
+constexpr int FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE = FileOptions_OptimizeMode_OptimizeMode_MAX + 1;
+
+PROTOBUF_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FileOptions_OptimizeMode_descriptor();
+template<typename T>
+inline const std::string& FileOptions_OptimizeMode_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, FileOptions_OptimizeMode>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function FileOptions_OptimizeMode_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    FileOptions_OptimizeMode_descriptor(), enum_t_value);
 }
 inline bool FileOptions_OptimizeMode_Parse(
-    const ::std::string& name, FileOptions_OptimizeMode* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<FileOptions_OptimizeMode>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, FileOptions_OptimizeMode* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<FileOptions_OptimizeMode>(
     FileOptions_OptimizeMode_descriptor(), name, value);
 }
-enum FieldOptions_CType {
+enum FieldOptions_CType : int {
   FieldOptions_CType_STRING = 0,
   FieldOptions_CType_CORD = 1,
   FieldOptions_CType_STRING_PIECE = 2
 };
-LIBPROTOBUF_EXPORT bool FieldOptions_CType_IsValid(int value);
-const FieldOptions_CType FieldOptions_CType_CType_MIN = FieldOptions_CType_STRING;
-const FieldOptions_CType FieldOptions_CType_CType_MAX = FieldOptions_CType_STRING_PIECE;
-const int FieldOptions_CType_CType_ARRAYSIZE = FieldOptions_CType_CType_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor();
-inline const ::std::string& FieldOptions_CType_Name(FieldOptions_CType value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    FieldOptions_CType_descriptor(), value);
+PROTOBUF_EXPORT bool FieldOptions_CType_IsValid(int value);
+constexpr FieldOptions_CType FieldOptions_CType_CType_MIN = FieldOptions_CType_STRING;
+constexpr FieldOptions_CType FieldOptions_CType_CType_MAX = FieldOptions_CType_STRING_PIECE;
+constexpr int FieldOptions_CType_CType_ARRAYSIZE = FieldOptions_CType_CType_MAX + 1;
+
+PROTOBUF_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldOptions_CType_descriptor();
+template<typename T>
+inline const std::string& FieldOptions_CType_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, FieldOptions_CType>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function FieldOptions_CType_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    FieldOptions_CType_descriptor(), enum_t_value);
 }
 inline bool FieldOptions_CType_Parse(
-    const ::std::string& name, FieldOptions_CType* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<FieldOptions_CType>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, FieldOptions_CType* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<FieldOptions_CType>(
     FieldOptions_CType_descriptor(), name, value);
 }
-enum FieldOptions_JSType {
+enum FieldOptions_JSType : int {
   FieldOptions_JSType_JS_NORMAL = 0,
   FieldOptions_JSType_JS_STRING = 1,
   FieldOptions_JSType_JS_NUMBER = 2
 };
-LIBPROTOBUF_EXPORT bool FieldOptions_JSType_IsValid(int value);
-const FieldOptions_JSType FieldOptions_JSType_JSType_MIN = FieldOptions_JSType_JS_NORMAL;
-const FieldOptions_JSType FieldOptions_JSType_JSType_MAX = FieldOptions_JSType_JS_NUMBER;
-const int FieldOptions_JSType_JSType_ARRAYSIZE = FieldOptions_JSType_JSType_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor();
-inline const ::std::string& FieldOptions_JSType_Name(FieldOptions_JSType value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    FieldOptions_JSType_descriptor(), value);
+PROTOBUF_EXPORT bool FieldOptions_JSType_IsValid(int value);
+constexpr FieldOptions_JSType FieldOptions_JSType_JSType_MIN = FieldOptions_JSType_JS_NORMAL;
+constexpr FieldOptions_JSType FieldOptions_JSType_JSType_MAX = FieldOptions_JSType_JS_NUMBER;
+constexpr int FieldOptions_JSType_JSType_ARRAYSIZE = FieldOptions_JSType_JSType_MAX + 1;
+
+PROTOBUF_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FieldOptions_JSType_descriptor();
+template<typename T>
+inline const std::string& FieldOptions_JSType_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, FieldOptions_JSType>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function FieldOptions_JSType_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    FieldOptions_JSType_descriptor(), enum_t_value);
 }
 inline bool FieldOptions_JSType_Parse(
-    const ::std::string& name, FieldOptions_JSType* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<FieldOptions_JSType>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, FieldOptions_JSType* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<FieldOptions_JSType>(
     FieldOptions_JSType_descriptor(), name, value);
 }
-enum MethodOptions_IdempotencyLevel {
+enum MethodOptions_IdempotencyLevel : int {
   MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN = 0,
   MethodOptions_IdempotencyLevel_NO_SIDE_EFFECTS = 1,
   MethodOptions_IdempotencyLevel_IDEMPOTENT = 2
 };
-LIBPROTOBUF_EXPORT bool MethodOptions_IdempotencyLevel_IsValid(int value);
-const MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel_IdempotencyLevel_MIN = MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN;
-const MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX = MethodOptions_IdempotencyLevel_IDEMPOTENT;
-const int MethodOptions_IdempotencyLevel_IdempotencyLevel_ARRAYSIZE = MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor();
-inline const ::std::string& MethodOptions_IdempotencyLevel_Name(MethodOptions_IdempotencyLevel value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    MethodOptions_IdempotencyLevel_descriptor(), value);
+PROTOBUF_EXPORT bool MethodOptions_IdempotencyLevel_IsValid(int value);
+constexpr MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel_IdempotencyLevel_MIN = MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN;
+constexpr MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX = MethodOptions_IdempotencyLevel_IDEMPOTENT;
+constexpr int MethodOptions_IdempotencyLevel_IdempotencyLevel_ARRAYSIZE = MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX + 1;
+
+PROTOBUF_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor();
+template<typename T>
+inline const std::string& MethodOptions_IdempotencyLevel_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, MethodOptions_IdempotencyLevel>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function MethodOptions_IdempotencyLevel_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    MethodOptions_IdempotencyLevel_descriptor(), enum_t_value);
 }
 inline bool MethodOptions_IdempotencyLevel_Parse(
-    const ::std::string& name, MethodOptions_IdempotencyLevel* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<MethodOptions_IdempotencyLevel>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, MethodOptions_IdempotencyLevel* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<MethodOptions_IdempotencyLevel>(
     MethodOptions_IdempotencyLevel_descriptor(), name, value);
 }
 // ===================================================================
 
-class LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorSet) */ {
+class PROTOBUF_EXPORT FileDescriptorSet final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorSet) */ {
  public:
-  FileDescriptorSet();
-  virtual ~FileDescriptorSet();
+  inline FileDescriptorSet() : FileDescriptorSet(nullptr) {}
+  ~FileDescriptorSet() override;
+  explicit constexpr FileDescriptorSet(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FileDescriptorSet(const FileDescriptorSet& from);
-
-  inline FileDescriptorSet& operator=(const FileDescriptorSet& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FileDescriptorSet(FileDescriptorSet&& from) noexcept
     : FileDescriptorSet() {
     *this = ::std::move(from);
   }
 
+  inline FileDescriptorSet& operator=(const FileDescriptorSet& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FileDescriptorSet& operator=(FileDescriptorSet&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FileDescriptorSet& default_instance() {
+    return *internal_default_instance();
   }
-  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_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void UnsafeArenaSwap(FileDescriptorSet* other);
-  void Swap(FileDescriptorSet* other);
   friend void swap(FileDescriptorSet& a, FileDescriptorSet& b) {
     a.Swap(&b);
   }
+  inline void Swap(FileDescriptorSet* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FileDescriptorSet* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FileDescriptorSet* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FileDescriptorSet* 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;
+  FileDescriptorSet* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FileDescriptorSet>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FileDescriptorSet& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FileDescriptorSet& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FileDescriptorSet* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.FileDescriptorSet";
+  }
   protected:
-  explicit FileDescriptorSet(::google::protobuf::Arena* arena);
+  explicit FileDescriptorSet(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFileFieldNumber = 1,
+  };
   // repeated .google.protobuf.FileDescriptorProto file = 1;
   int file_size() const;
+  private:
+  int _internal_file_size() const;
+  public:
   void clear_file();
-  static const int kFileFieldNumber = 1;
-  const ::google::protobuf::FileDescriptorProto& file(int index) const;
-  ::google::protobuf::FileDescriptorProto* mutable_file(int index);
-  ::google::protobuf::FileDescriptorProto* add_file();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* mutable_file(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >*
       mutable_file();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& _internal_file(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* _internal_add_file();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& file(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* add_file();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >&
       file() const;
 
   // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorSet)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSetImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto > file_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorProto) */ {
+class PROTOBUF_EXPORT FileDescriptorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorProto) */ {
  public:
-  FileDescriptorProto();
-  virtual ~FileDescriptorProto();
+  inline FileDescriptorProto() : FileDescriptorProto(nullptr) {}
+  ~FileDescriptorProto() override;
+  explicit constexpr FileDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FileDescriptorProto(const FileDescriptorProto& from);
-
-  inline FileDescriptorProto& operator=(const FileDescriptorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FileDescriptorProto(FileDescriptorProto&& from) noexcept
     : FileDescriptorProto() {
     *this = ::std::move(from);
   }
 
+  inline FileDescriptorProto& operator=(const FileDescriptorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FileDescriptorProto& operator=(FileDescriptorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FileDescriptorProto& default_instance() {
+    return *internal_default_instance();
   }
-  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_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     1;
 
-  void UnsafeArenaSwap(FileDescriptorProto* other);
-  void Swap(FileDescriptorProto* other);
   friend void swap(FileDescriptorProto& a, FileDescriptorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(FileDescriptorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FileDescriptorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FileDescriptorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FileDescriptorProto* 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;
+  FileDescriptorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FileDescriptorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FileDescriptorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FileDescriptorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FileDescriptorProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.FileDescriptorProto";
+  }
   protected:
-  explicit FileDescriptorProto(::google::protobuf::Arena* arena);
+  explicit FileDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDependencyFieldNumber = 3,
+    kMessageTypeFieldNumber = 4,
+    kEnumTypeFieldNumber = 5,
+    kServiceFieldNumber = 6,
+    kExtensionFieldNumber = 7,
+    kPublicDependencyFieldNumber = 10,
+    kWeakDependencyFieldNumber = 11,
+    kNameFieldNumber = 1,
+    kPackageFieldNumber = 2,
+    kSyntaxFieldNumber = 12,
+    kOptionsFieldNumber = 8,
+    kSourceCodeInfoFieldNumber = 9,
+  };
   // repeated string dependency = 3;
   int dependency_size() const;
+  private:
+  int _internal_dependency_size() const;
+  public:
   void clear_dependency();
-  static const int kDependencyFieldNumber = 3;
-  const ::std::string& dependency(int index) const;
-  ::std::string* mutable_dependency(int index);
-  void set_dependency(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_dependency(int index, ::std::string&& value);
-  #endif
+  const std::string& dependency(int index) const;
+  std::string* mutable_dependency(int index);
+  void set_dependency(int index, const std::string& value);
+  void set_dependency(int index, std::string&& value);
   void set_dependency(int index, const char* value);
   void set_dependency(int index, const char* value, size_t size);
-  ::std::string* add_dependency();
-  void add_dependency(const ::std::string& value);
-  #if LANG_CXX11
-  void add_dependency(::std::string&& value);
-  #endif
+  std::string* add_dependency();
+  void add_dependency(const std::string& value);
+  void add_dependency(std::string&& value);
   void add_dependency(const char* value);
   void add_dependency(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& dependency() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_dependency();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& dependency() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_dependency();
+  private:
+  const std::string& _internal_dependency(int index) const;
+  std::string* _internal_add_dependency();
+  public:
 
   // repeated .google.protobuf.DescriptorProto message_type = 4;
   int message_type_size() const;
+  private:
+  int _internal_message_type_size() const;
+  public:
   void clear_message_type();
-  static const int kMessageTypeFieldNumber = 4;
-  const ::google::protobuf::DescriptorProto& message_type(int index) const;
-  ::google::protobuf::DescriptorProto* mutable_message_type(int index);
-  ::google::protobuf::DescriptorProto* add_message_type();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto* mutable_message_type(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >*
       mutable_message_type();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& _internal_message_type(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto* _internal_add_message_type();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& message_type(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto* add_message_type();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >&
       message_type() const;
 
   // repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
   int enum_type_size() const;
+  private:
+  int _internal_enum_type_size() const;
+  public:
   void clear_enum_type();
-  static const int kEnumTypeFieldNumber = 5;
-  const ::google::protobuf::EnumDescriptorProto& enum_type(int index) const;
-  ::google::protobuf::EnumDescriptorProto* mutable_enum_type(int index);
-  ::google::protobuf::EnumDescriptorProto* add_enum_type();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* mutable_enum_type(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >*
       mutable_enum_type();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& _internal_enum_type(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* _internal_add_enum_type();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& enum_type(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* add_enum_type();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >&
       enum_type() const;
 
   // repeated .google.protobuf.ServiceDescriptorProto service = 6;
   int service_size() const;
+  private:
+  int _internal_service_size() const;
+  public:
   void clear_service();
-  static const int kServiceFieldNumber = 6;
-  const ::google::protobuf::ServiceDescriptorProto& service(int index) const;
-  ::google::protobuf::ServiceDescriptorProto* mutable_service(int index);
-  ::google::protobuf::ServiceDescriptorProto* add_service();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* mutable_service(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto >*
       mutable_service();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto& _internal_service(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* _internal_add_service();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto& service(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* add_service();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto >&
       service() const;
 
   // repeated .google.protobuf.FieldDescriptorProto extension = 7;
   int extension_size() const;
+  private:
+  int _internal_extension_size() const;
+  public:
   void clear_extension();
-  static const int kExtensionFieldNumber = 7;
-  const ::google::protobuf::FieldDescriptorProto& extension(int index) const;
-  ::google::protobuf::FieldDescriptorProto* mutable_extension(int index);
-  ::google::protobuf::FieldDescriptorProto* add_extension();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* mutable_extension(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >*
       mutable_extension();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& _internal_extension(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _internal_add_extension();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& extension(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* add_extension();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >&
       extension() const;
 
   // repeated int32 public_dependency = 10;
   int public_dependency_size() const;
+  private:
+  int _internal_public_dependency_size() const;
+  public:
   void clear_public_dependency();
-  static const int kPublicDependencyFieldNumber = 10;
-  ::google::protobuf::int32 public_dependency(int index) const;
-  void set_public_dependency(int index, ::google::protobuf::int32 value);
-  void add_public_dependency(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_public_dependency(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_public_dependency() const;
+  void _internal_add_public_dependency(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_public_dependency();
+  public:
+  int32_t public_dependency(int index) const;
+  void set_public_dependency(int index, int32_t value);
+  void add_public_dependency(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       public_dependency() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_public_dependency();
 
   // repeated int32 weak_dependency = 11;
   int weak_dependency_size() const;
+  private:
+  int _internal_weak_dependency_size() const;
+  public:
   void clear_weak_dependency();
-  static const int kWeakDependencyFieldNumber = 11;
-  ::google::protobuf::int32 weak_dependency(int index) const;
-  void set_weak_dependency(int index, ::google::protobuf::int32 value);
-  void add_weak_dependency(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_weak_dependency(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_weak_dependency() const;
+  void _internal_add_weak_dependency(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_weak_dependency();
+  public:
+  int32_t weak_dependency(int index) const;
+  void set_weak_dependency(int index, int32_t value);
+  void add_weak_dependency(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       weak_dependency() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_weak_dependency();
 
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional string package = 2;
   bool has_package() const;
+  private:
+  bool _internal_has_package() const;
+  public:
   void clear_package();
-  static const int kPackageFieldNumber = 2;
-  const ::std::string& package() const;
-  void set_package(const ::std::string& value);
-  #if LANG_CXX11
-  void set_package(::std::string&& value);
-  #endif
-  void set_package(const char* value);
-  void set_package(const char* value, size_t size);
-  ::std::string* mutable_package();
-  ::std::string* release_package();
-  void set_allocated_package(::std::string* package);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_package();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_package(
-      ::std::string* package);
+  const std::string& package() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_package(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_package();
+  PROTOBUF_NODISCARD std::string* release_package();
+  void set_allocated_package(std::string* package);
+  private:
+  const std::string& _internal_package() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_package(const std::string& value);
+  std::string* _internal_mutable_package();
+  public:
 
   // optional string syntax = 12;
   bool has_syntax() const;
+  private:
+  bool _internal_has_syntax() const;
+  public:
   void clear_syntax();
-  static const int kSyntaxFieldNumber = 12;
-  const ::std::string& syntax() const;
-  void set_syntax(const ::std::string& value);
-  #if LANG_CXX11
-  void set_syntax(::std::string&& value);
-  #endif
-  void set_syntax(const char* value);
-  void set_syntax(const char* value, size_t size);
-  ::std::string* mutable_syntax();
-  ::std::string* release_syntax();
-  void set_allocated_syntax(::std::string* syntax);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_syntax();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_syntax(
-      ::std::string* syntax);
+  const std::string& syntax() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_syntax(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_syntax();
+  PROTOBUF_NODISCARD std::string* release_syntax();
+  void set_allocated_syntax(std::string* syntax);
+  private:
+  const std::string& _internal_syntax() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_syntax(const std::string& value);
+  std::string* _internal_mutable_syntax();
+  public:
 
   // optional .google.protobuf.FileOptions options = 8;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 8;
+  const ::PROTOBUF_NAMESPACE_ID::FileOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::FileOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::FileOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::FileOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::FileOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::FileOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::FileOptions& options() const;
-  ::google::protobuf::FileOptions* release_options();
-  ::google::protobuf::FileOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::FileOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::FileOptions* options);
-  ::google::protobuf::FileOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::FileOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::FileOptions* unsafe_arena_release_options();
 
   // optional .google.protobuf.SourceCodeInfo source_code_info = 9;
   bool has_source_code_info() const;
+  private:
+  bool _internal_has_source_code_info() const;
+  public:
   void clear_source_code_info();
-  static const int kSourceCodeInfoFieldNumber = 9;
+  const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo& source_code_info() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* release_source_code_info();
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* mutable_source_code_info();
+  void set_allocated_source_code_info(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info);
   private:
-  void _slow_mutable_source_code_info();
+  const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo& _internal_source_code_info() const;
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* _internal_mutable_source_code_info();
   public:
-  const ::google::protobuf::SourceCodeInfo& source_code_info() const;
-  ::google::protobuf::SourceCodeInfo* release_source_code_info();
-  ::google::protobuf::SourceCodeInfo* mutable_source_code_info();
-  void set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info);
   void unsafe_arena_set_allocated_source_code_info(
-      ::google::protobuf::SourceCodeInfo* source_code_info);
-  ::google::protobuf::SourceCodeInfo* unsafe_arena_release_source_code_info();
+      ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info);
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* unsafe_arena_release_source_code_info();
 
   // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_package();
-  void clear_has_package();
-  void set_has_options();
-  void clear_has_options();
-  void set_has_source_code_info();
-  void clear_has_source_code_info();
-  void set_has_syntax();
-  void clear_has_syntax();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto > message_type_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto > enum_type_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto > service_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > extension_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > public_dependency_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > weak_dependency_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr package_;
-  ::google::protobuf::internal::ArenaStringPtr syntax_;
-  ::google::protobuf::FileOptions* options_;
-  ::google::protobuf::SourceCodeInfo* source_code_info_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProtoImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> dependency_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto > message_type_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto > enum_type_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto > service_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > extension_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > public_dependency_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > weak_dependency_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr package_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr syntax_;
+  ::PROTOBUF_NAMESPACE_ID::FileOptions* options_;
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ExtensionRange) */ {
+class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ExtensionRange) */ {
  public:
-  DescriptorProto_ExtensionRange();
-  virtual ~DescriptorProto_ExtensionRange();
+  inline DescriptorProto_ExtensionRange() : DescriptorProto_ExtensionRange(nullptr) {}
+  ~DescriptorProto_ExtensionRange() override;
+  explicit constexpr DescriptorProto_ExtensionRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from);
-
-  inline DescriptorProto_ExtensionRange& operator=(const DescriptorProto_ExtensionRange& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   DescriptorProto_ExtensionRange(DescriptorProto_ExtensionRange&& from) noexcept
     : DescriptorProto_ExtensionRange() {
     *this = ::std::move(from);
   }
 
+  inline DescriptorProto_ExtensionRange& operator=(const DescriptorProto_ExtensionRange& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline DescriptorProto_ExtensionRange& operator=(DescriptorProto_ExtensionRange&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const DescriptorProto_ExtensionRange& default_instance() {
+    return *internal_default_instance();
   }
-  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_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     2;
 
-  void UnsafeArenaSwap(DescriptorProto_ExtensionRange* other);
-  void Swap(DescriptorProto_ExtensionRange* other);
   friend void swap(DescriptorProto_ExtensionRange& a, DescriptorProto_ExtensionRange& b) {
     a.Swap(&b);
   }
+  inline void Swap(DescriptorProto_ExtensionRange* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(DescriptorProto_ExtensionRange* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline DescriptorProto_ExtensionRange* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  DescriptorProto_ExtensionRange* 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;
+  DescriptorProto_ExtensionRange* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<DescriptorProto_ExtensionRange>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const DescriptorProto_ExtensionRange& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const DescriptorProto_ExtensionRange& from);
-  void 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(DescriptorProto_ExtensionRange* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.DescriptorProto.ExtensionRange";
+  }
   protected:
-  explicit DescriptorProto_ExtensionRange(::google::protobuf::Arena* arena);
+  explicit DescriptorProto_ExtensionRange(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kOptionsFieldNumber = 3,
+    kStartFieldNumber = 1,
+    kEndFieldNumber = 2,
+  };
   // optional .google.protobuf.ExtensionRangeOptions options = 3;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 3;
+  const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::ExtensionRangeOptions& options() const;
-  ::google::protobuf::ExtensionRangeOptions* release_options();
-  ::google::protobuf::ExtensionRangeOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::ExtensionRangeOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::ExtensionRangeOptions* options);
-  ::google::protobuf::ExtensionRangeOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* unsafe_arena_release_options();
 
   // optional int32 start = 1;
   bool has_start() const;
+  private:
+  bool _internal_has_start() const;
+  public:
   void clear_start();
-  static const int kStartFieldNumber = 1;
-  ::google::protobuf::int32 start() const;
-  void set_start(::google::protobuf::int32 value);
+  int32_t start() const;
+  void set_start(int32_t value);
+  private:
+  int32_t _internal_start() const;
+  void _internal_set_start(int32_t value);
+  public:
 
   // optional int32 end = 2;
   bool has_end() const;
+  private:
+  bool _internal_has_end() const;
+  public:
   void clear_end();
-  static const int kEndFieldNumber = 2;
-  ::google::protobuf::int32 end() const;
-  void set_end(::google::protobuf::int32 value);
+  int32_t end() const;
+  void set_end(int32_t value);
+  private:
+  int32_t _internal_end() const;
+  void _internal_set_end(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ExtensionRange)
  private:
-  void set_has_start();
-  void clear_has_start();
-  void set_has_end();
-  void clear_has_end();
-  void set_has_options();
-  void clear_has_options();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRangeImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options_;
+  int32_t start_;
+  int32_t end_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ReservedRange) */ {
+class PROTOBUF_EXPORT DescriptorProto_ReservedRange final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ReservedRange) */ {
  public:
-  DescriptorProto_ReservedRange();
-  virtual ~DescriptorProto_ReservedRange();
+  inline DescriptorProto_ReservedRange() : DescriptorProto_ReservedRange(nullptr) {}
+  ~DescriptorProto_ReservedRange() override;
+  explicit constexpr DescriptorProto_ReservedRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from);
-
-  inline DescriptorProto_ReservedRange& operator=(const DescriptorProto_ReservedRange& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   DescriptorProto_ReservedRange(DescriptorProto_ReservedRange&& from) noexcept
     : DescriptorProto_ReservedRange() {
     *this = ::std::move(from);
   }
 
+  inline DescriptorProto_ReservedRange& operator=(const DescriptorProto_ReservedRange& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline DescriptorProto_ReservedRange& operator=(DescriptorProto_ReservedRange&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const DescriptorProto_ReservedRange& default_instance() {
+    return *internal_default_instance();
   }
-  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_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     3;
 
-  void UnsafeArenaSwap(DescriptorProto_ReservedRange* other);
-  void Swap(DescriptorProto_ReservedRange* other);
   friend void swap(DescriptorProto_ReservedRange& a, DescriptorProto_ReservedRange& b) {
     a.Swap(&b);
   }
+  inline void Swap(DescriptorProto_ReservedRange* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(DescriptorProto_ReservedRange* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline DescriptorProto_ReservedRange* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  DescriptorProto_ReservedRange* 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;
+  DescriptorProto_ReservedRange* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<DescriptorProto_ReservedRange>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const DescriptorProto_ReservedRange& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const DescriptorProto_ReservedRange& from);
-  void 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(DescriptorProto_ReservedRange* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.DescriptorProto.ReservedRange";
+  }
   protected:
-  explicit DescriptorProto_ReservedRange(::google::protobuf::Arena* arena);
+  explicit DescriptorProto_ReservedRange(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kStartFieldNumber = 1,
+    kEndFieldNumber = 2,
+  };
   // optional int32 start = 1;
   bool has_start() const;
+  private:
+  bool _internal_has_start() const;
+  public:
   void clear_start();
-  static const int kStartFieldNumber = 1;
-  ::google::protobuf::int32 start() const;
-  void set_start(::google::protobuf::int32 value);
+  int32_t start() const;
+  void set_start(int32_t value);
+  private:
+  int32_t _internal_start() const;
+  void _internal_set_start(int32_t value);
+  public:
 
   // optional int32 end = 2;
   bool has_end() const;
+  private:
+  bool _internal_has_end() const;
+  public:
   void clear_end();
-  static const int kEndFieldNumber = 2;
-  ::google::protobuf::int32 end() const;
-  void set_end(::google::protobuf::int32 value);
+  int32_t end() const;
+  void set_end(int32_t value);
+  private:
+  int32_t _internal_end() const;
+  void _internal_set_end(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ReservedRange)
  private:
-  void set_has_start();
-  void clear_has_start();
-  void set_has_end();
-  void clear_has_end();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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::InitDefaultsDescriptorProto_ReservedRangeImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int32_t start_;
+  int32_t end_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto) */ {
+class PROTOBUF_EXPORT DescriptorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto) */ {
  public:
-  DescriptorProto();
-  virtual ~DescriptorProto();
+  inline DescriptorProto() : DescriptorProto(nullptr) {}
+  ~DescriptorProto() override;
+  explicit constexpr DescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   DescriptorProto(const DescriptorProto& from);
-
-  inline DescriptorProto& operator=(const DescriptorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   DescriptorProto(DescriptorProto&& from) noexcept
     : DescriptorProto() {
     *this = ::std::move(from);
   }
 
+  inline DescriptorProto& operator=(const DescriptorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline DescriptorProto& operator=(DescriptorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const DescriptorProto& default_instance() {
+    return *internal_default_instance();
   }
-  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_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     4;
 
-  void UnsafeArenaSwap(DescriptorProto* other);
-  void Swap(DescriptorProto* other);
   friend void swap(DescriptorProto& a, DescriptorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(DescriptorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(DescriptorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline DescriptorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  DescriptorProto* 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;
+  DescriptorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<DescriptorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const DescriptorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const DescriptorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(DescriptorProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.DescriptorProto";
+  }
   protected:
-  explicit DescriptorProto(::google::protobuf::Arena* arena);
+  explicit DescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -1205,1095 +1385,1492 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /*
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFieldFieldNumber = 2,
+    kNestedTypeFieldNumber = 3,
+    kEnumTypeFieldNumber = 4,
+    kExtensionRangeFieldNumber = 5,
+    kExtensionFieldNumber = 6,
+    kOneofDeclFieldNumber = 8,
+    kReservedRangeFieldNumber = 9,
+    kReservedNameFieldNumber = 10,
+    kNameFieldNumber = 1,
+    kOptionsFieldNumber = 7,
+  };
   // repeated .google.protobuf.FieldDescriptorProto field = 2;
   int field_size() const;
+  private:
+  int _internal_field_size() const;
+  public:
   void clear_field();
-  static const int kFieldFieldNumber = 2;
-  const ::google::protobuf::FieldDescriptorProto& field(int index) const;
-  ::google::protobuf::FieldDescriptorProto* mutable_field(int index);
-  ::google::protobuf::FieldDescriptorProto* add_field();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* mutable_field(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >*
       mutable_field();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& _internal_field(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _internal_add_field();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& field(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* add_field();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >&
       field() const;
 
   // repeated .google.protobuf.DescriptorProto nested_type = 3;
   int nested_type_size() const;
+  private:
+  int _internal_nested_type_size() const;
+  public:
   void clear_nested_type();
-  static const int kNestedTypeFieldNumber = 3;
-  const ::google::protobuf::DescriptorProto& nested_type(int index) const;
-  ::google::protobuf::DescriptorProto* mutable_nested_type(int index);
-  ::google::protobuf::DescriptorProto* add_nested_type();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto* mutable_nested_type(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >*
       mutable_nested_type();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& _internal_nested_type(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto* _internal_add_nested_type();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& nested_type(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto* add_nested_type();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >&
       nested_type() const;
 
   // repeated .google.protobuf.EnumDescriptorProto enum_type = 4;
   int enum_type_size() const;
+  private:
+  int _internal_enum_type_size() const;
+  public:
   void clear_enum_type();
-  static const int kEnumTypeFieldNumber = 4;
-  const ::google::protobuf::EnumDescriptorProto& enum_type(int index) const;
-  ::google::protobuf::EnumDescriptorProto* mutable_enum_type(int index);
-  ::google::protobuf::EnumDescriptorProto* add_enum_type();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* mutable_enum_type(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >*
       mutable_enum_type();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& _internal_enum_type(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* _internal_add_enum_type();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& enum_type(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* add_enum_type();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >&
       enum_type() const;
 
   // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;
   int extension_range_size() const;
+  private:
+  int _internal_extension_range_size() const;
+  public:
   void clear_extension_range();
-  static const int kExtensionRangeFieldNumber = 5;
-  const ::google::protobuf::DescriptorProto_ExtensionRange& extension_range(int index) const;
-  ::google::protobuf::DescriptorProto_ExtensionRange* mutable_extension_range(int index);
-  ::google::protobuf::DescriptorProto_ExtensionRange* add_extension_range();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >*
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* mutable_extension_range(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange >*
       mutable_extension_range();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange& _internal_extension_range(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* _internal_add_extension_range();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange& extension_range(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* add_extension_range();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange >&
       extension_range() const;
 
   // repeated .google.protobuf.FieldDescriptorProto extension = 6;
   int extension_size() const;
+  private:
+  int _internal_extension_size() const;
+  public:
   void clear_extension();
-  static const int kExtensionFieldNumber = 6;
-  const ::google::protobuf::FieldDescriptorProto& extension(int index) const;
-  ::google::protobuf::FieldDescriptorProto* mutable_extension(int index);
-  ::google::protobuf::FieldDescriptorProto* add_extension();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* mutable_extension(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >*
       mutable_extension();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& _internal_extension(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _internal_add_extension();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& extension(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* add_extension();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >&
       extension() const;
 
   // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
   int oneof_decl_size() const;
+  private:
+  int _internal_oneof_decl_size() const;
+  public:
   void clear_oneof_decl();
-  static const int kOneofDeclFieldNumber = 8;
-  const ::google::protobuf::OneofDescriptorProto& oneof_decl(int index) const;
-  ::google::protobuf::OneofDescriptorProto* mutable_oneof_decl(int index);
-  ::google::protobuf::OneofDescriptorProto* add_oneof_decl();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* mutable_oneof_decl(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto >*
       mutable_oneof_decl();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto& _internal_oneof_decl(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* _internal_add_oneof_decl();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto& oneof_decl(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* add_oneof_decl();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto >&
       oneof_decl() const;
 
   // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;
   int reserved_range_size() const;
+  private:
+  int _internal_reserved_range_size() const;
+  public:
   void clear_reserved_range();
-  static const int kReservedRangeFieldNumber = 9;
-  const ::google::protobuf::DescriptorProto_ReservedRange& reserved_range(int index) const;
-  ::google::protobuf::DescriptorProto_ReservedRange* mutable_reserved_range(int index);
-  ::google::protobuf::DescriptorProto_ReservedRange* add_reserved_range();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >*
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* mutable_reserved_range(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange >*
       mutable_reserved_range();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange& _internal_reserved_range(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* _internal_add_reserved_range();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange& reserved_range(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* add_reserved_range();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange >&
       reserved_range() const;
 
   // repeated string reserved_name = 10;
   int reserved_name_size() const;
+  private:
+  int _internal_reserved_name_size() const;
+  public:
   void clear_reserved_name();
-  static const int kReservedNameFieldNumber = 10;
-  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
+  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);
+  void set_reserved_name(int index, std::string&& value);
   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
+  std::string* add_reserved_name();
+  void add_reserved_name(const std::string& value);
+  void add_reserved_name(std::string&& value);
   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();
-
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& reserved_name() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_reserved_name();
+  private:
+  const std::string& _internal_reserved_name(int index) const;
+  std::string* _internal_add_reserved_name();
+  public:
+
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional .google.protobuf.MessageOptions options = 7;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 7;
+  const ::PROTOBUF_NAMESPACE_ID::MessageOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::MessageOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::MessageOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::MessageOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::MessageOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::MessageOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::MessageOptions& options() const;
-  ::google::protobuf::MessageOptions* release_options();
-  ::google::protobuf::MessageOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::MessageOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::MessageOptions* options);
-  ::google::protobuf::MessageOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::MessageOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::MessageOptions* unsafe_arena_release_options();
 
   // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_options();
-  void clear_has_options();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto > nested_type_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto > enum_type_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange > extension_range_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > extension_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto > oneof_decl_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange > reserved_range_;
-  ::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProtoImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > field_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto > nested_type_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto > enum_type_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange > extension_range_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > extension_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto > oneof_decl_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange > reserved_range_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> reserved_name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::MessageOptions* options_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT ExtensionRangeOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ExtensionRangeOptions) */ {
+class PROTOBUF_EXPORT ExtensionRangeOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ExtensionRangeOptions) */ {
  public:
-  ExtensionRangeOptions();
-  virtual ~ExtensionRangeOptions();
+  inline ExtensionRangeOptions() : ExtensionRangeOptions(nullptr) {}
+  ~ExtensionRangeOptions() override;
+  explicit constexpr ExtensionRangeOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ExtensionRangeOptions(const ExtensionRangeOptions& from);
-
-  inline ExtensionRangeOptions& operator=(const ExtensionRangeOptions& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ExtensionRangeOptions(ExtensionRangeOptions&& from) noexcept
     : ExtensionRangeOptions() {
     *this = ::std::move(from);
   }
 
+  inline ExtensionRangeOptions& operator=(const ExtensionRangeOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ExtensionRangeOptions& operator=(ExtensionRangeOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ExtensionRangeOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     5;
 
-  void UnsafeArenaSwap(ExtensionRangeOptions* other);
-  void Swap(ExtensionRangeOptions* other);
   friend void swap(ExtensionRangeOptions& a, ExtensionRangeOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(ExtensionRangeOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ExtensionRangeOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ExtensionRangeOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ExtensionRangeOptions* 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;
+  ExtensionRangeOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ExtensionRangeOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ExtensionRangeOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ExtensionRangeOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ExtensionRangeOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.ExtensionRangeOptions";
+  }
   protected:
-  explicit ExtensionRangeOptions(::google::protobuf::Arena* arena);
+  explicit ExtensionRangeOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ExtensionRangeOptions)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:google.protobuf.ExtensionRangeOptions)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::ExtensionSet _extensions_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptionsImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldDescriptorProto) */ {
+class PROTOBUF_EXPORT FieldDescriptorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldDescriptorProto) */ {
  public:
-  FieldDescriptorProto();
-  virtual ~FieldDescriptorProto();
+  inline FieldDescriptorProto() : FieldDescriptorProto(nullptr) {}
+  ~FieldDescriptorProto() override;
+  explicit constexpr FieldDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FieldDescriptorProto(const FieldDescriptorProto& from);
-
-  inline FieldDescriptorProto& operator=(const FieldDescriptorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FieldDescriptorProto(FieldDescriptorProto&& from) noexcept
     : FieldDescriptorProto() {
     *this = ::std::move(from);
   }
 
+  inline FieldDescriptorProto& operator=(const FieldDescriptorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FieldDescriptorProto& operator=(FieldDescriptorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FieldDescriptorProto& default_instance() {
+    return *internal_default_instance();
   }
-  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_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     6;
 
-  void UnsafeArenaSwap(FieldDescriptorProto* other);
-  void Swap(FieldDescriptorProto* other);
   friend void swap(FieldDescriptorProto& a, FieldDescriptorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(FieldDescriptorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FieldDescriptorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FieldDescriptorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FieldDescriptorProto* 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;
+  FieldDescriptorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FieldDescriptorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FieldDescriptorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FieldDescriptorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FieldDescriptorProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.FieldDescriptorProto";
+  }
   protected:
-  explicit FieldDescriptorProto(::google::protobuf::Arena* arena);
+  explicit FieldDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef FieldDescriptorProto_Type Type;
-  static const Type TYPE_DOUBLE =
+  static constexpr Type TYPE_DOUBLE =
     FieldDescriptorProto_Type_TYPE_DOUBLE;
-  static const Type TYPE_FLOAT =
+  static constexpr Type TYPE_FLOAT =
     FieldDescriptorProto_Type_TYPE_FLOAT;
-  static const Type TYPE_INT64 =
+  static constexpr Type TYPE_INT64 =
     FieldDescriptorProto_Type_TYPE_INT64;
-  static const Type TYPE_UINT64 =
+  static constexpr Type TYPE_UINT64 =
     FieldDescriptorProto_Type_TYPE_UINT64;
-  static const Type TYPE_INT32 =
+  static constexpr Type TYPE_INT32 =
     FieldDescriptorProto_Type_TYPE_INT32;
-  static const Type TYPE_FIXED64 =
+  static constexpr Type TYPE_FIXED64 =
     FieldDescriptorProto_Type_TYPE_FIXED64;
-  static const Type TYPE_FIXED32 =
+  static constexpr Type TYPE_FIXED32 =
     FieldDescriptorProto_Type_TYPE_FIXED32;
-  static const Type TYPE_BOOL =
+  static constexpr Type TYPE_BOOL =
     FieldDescriptorProto_Type_TYPE_BOOL;
-  static const Type TYPE_STRING =
+  static constexpr Type TYPE_STRING =
     FieldDescriptorProto_Type_TYPE_STRING;
-  static const Type TYPE_GROUP =
+  static constexpr Type TYPE_GROUP =
     FieldDescriptorProto_Type_TYPE_GROUP;
-  static const Type TYPE_MESSAGE =
+  static constexpr Type TYPE_MESSAGE =
     FieldDescriptorProto_Type_TYPE_MESSAGE;
-  static const Type TYPE_BYTES =
+  static constexpr Type TYPE_BYTES =
     FieldDescriptorProto_Type_TYPE_BYTES;
-  static const Type TYPE_UINT32 =
+  static constexpr Type TYPE_UINT32 =
     FieldDescriptorProto_Type_TYPE_UINT32;
-  static const Type TYPE_ENUM =
+  static constexpr Type TYPE_ENUM =
     FieldDescriptorProto_Type_TYPE_ENUM;
-  static const Type TYPE_SFIXED32 =
+  static constexpr Type TYPE_SFIXED32 =
     FieldDescriptorProto_Type_TYPE_SFIXED32;
-  static const Type TYPE_SFIXED64 =
+  static constexpr Type TYPE_SFIXED64 =
     FieldDescriptorProto_Type_TYPE_SFIXED64;
-  static const Type TYPE_SINT32 =
+  static constexpr Type TYPE_SINT32 =
     FieldDescriptorProto_Type_TYPE_SINT32;
-  static const Type TYPE_SINT64 =
+  static constexpr Type TYPE_SINT64 =
     FieldDescriptorProto_Type_TYPE_SINT64;
   static inline bool Type_IsValid(int value) {
     return FieldDescriptorProto_Type_IsValid(value);
   }
-  static const Type Type_MIN =
+  static constexpr Type Type_MIN =
     FieldDescriptorProto_Type_Type_MIN;
-  static const Type Type_MAX =
+  static constexpr Type Type_MAX =
     FieldDescriptorProto_Type_Type_MAX;
-  static const int Type_ARRAYSIZE =
+  static constexpr int Type_ARRAYSIZE =
     FieldDescriptorProto_Type_Type_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Type_descriptor() {
     return FieldDescriptorProto_Type_descriptor();
   }
-  static inline const ::std::string& Type_Name(Type value) {
-    return FieldDescriptorProto_Type_Name(value);
+  template<typename T>
+  static inline const std::string& Type_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Type>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Type_Name.");
+    return FieldDescriptorProto_Type_Name(enum_t_value);
   }
-  static inline bool Type_Parse(const ::std::string& name,
+  static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Type* value) {
     return FieldDescriptorProto_Type_Parse(name, value);
   }
 
   typedef FieldDescriptorProto_Label Label;
-  static const Label LABEL_OPTIONAL =
+  static constexpr Label LABEL_OPTIONAL =
     FieldDescriptorProto_Label_LABEL_OPTIONAL;
-  static const Label LABEL_REQUIRED =
+  static constexpr Label LABEL_REQUIRED =
     FieldDescriptorProto_Label_LABEL_REQUIRED;
-  static const Label LABEL_REPEATED =
+  static constexpr Label LABEL_REPEATED =
     FieldDescriptorProto_Label_LABEL_REPEATED;
   static inline bool Label_IsValid(int value) {
     return FieldDescriptorProto_Label_IsValid(value);
   }
-  static const Label Label_MIN =
+  static constexpr Label Label_MIN =
     FieldDescriptorProto_Label_Label_MIN;
-  static const Label Label_MAX =
+  static constexpr Label Label_MAX =
     FieldDescriptorProto_Label_Label_MAX;
-  static const int Label_ARRAYSIZE =
+  static constexpr int Label_ARRAYSIZE =
     FieldDescriptorProto_Label_Label_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Label_descriptor() {
     return FieldDescriptorProto_Label_descriptor();
   }
-  static inline const ::std::string& Label_Name(Label value) {
-    return FieldDescriptorProto_Label_Name(value);
+  template<typename T>
+  static inline const std::string& Label_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Label>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Label_Name.");
+    return FieldDescriptorProto_Label_Name(enum_t_value);
   }
-  static inline bool Label_Parse(const ::std::string& name,
+  static inline bool Label_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Label* value) {
     return FieldDescriptorProto_Label_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 1,
+    kExtendeeFieldNumber = 2,
+    kTypeNameFieldNumber = 6,
+    kDefaultValueFieldNumber = 7,
+    kJsonNameFieldNumber = 10,
+    kOptionsFieldNumber = 8,
+    kNumberFieldNumber = 3,
+    kOneofIndexFieldNumber = 9,
+    kProto3OptionalFieldNumber = 17,
+    kLabelFieldNumber = 4,
+    kTypeFieldNumber = 5,
+  };
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional string extendee = 2;
   bool has_extendee() const;
+  private:
+  bool _internal_has_extendee() const;
+  public:
   void clear_extendee();
-  static const int kExtendeeFieldNumber = 2;
-  const ::std::string& extendee() const;
-  void set_extendee(const ::std::string& value);
-  #if LANG_CXX11
-  void set_extendee(::std::string&& value);
-  #endif
-  void set_extendee(const char* value);
-  void set_extendee(const char* value, size_t size);
-  ::std::string* mutable_extendee();
-  ::std::string* release_extendee();
-  void set_allocated_extendee(::std::string* extendee);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_extendee();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_extendee(
-      ::std::string* extendee);
+  const std::string& extendee() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_extendee(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_extendee();
+  PROTOBUF_NODISCARD std::string* release_extendee();
+  void set_allocated_extendee(std::string* extendee);
+  private:
+  const std::string& _internal_extendee() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_extendee(const std::string& value);
+  std::string* _internal_mutable_extendee();
+  public:
 
   // optional string type_name = 6;
   bool has_type_name() const;
+  private:
+  bool _internal_has_type_name() const;
+  public:
   void clear_type_name();
-  static const int kTypeNameFieldNumber = 6;
-  const ::std::string& type_name() const;
-  void set_type_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type_name(::std::string&& value);
-  #endif
-  void set_type_name(const char* value);
-  void set_type_name(const char* value, size_t size);
-  ::std::string* mutable_type_name();
-  ::std::string* release_type_name();
-  void set_allocated_type_name(::std::string* type_name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_type_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_type_name(
-      ::std::string* type_name);
+  const std::string& type_name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_type_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_type_name();
+  PROTOBUF_NODISCARD std::string* release_type_name();
+  void set_allocated_type_name(std::string* type_name);
+  private:
+  const std::string& _internal_type_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_type_name(const std::string& value);
+  std::string* _internal_mutable_type_name();
+  public:
 
   // optional string default_value = 7;
   bool has_default_value() const;
+  private:
+  bool _internal_has_default_value() const;
+  public:
   void clear_default_value();
-  static const int kDefaultValueFieldNumber = 7;
-  const ::std::string& default_value() const;
-  void set_default_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_default_value(::std::string&& value);
-  #endif
-  void set_default_value(const char* value);
-  void set_default_value(const char* value, size_t size);
-  ::std::string* mutable_default_value();
-  ::std::string* release_default_value();
-  void set_allocated_default_value(::std::string* default_value);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_default_value();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_default_value(
-      ::std::string* default_value);
+  const std::string& default_value() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_default_value(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_default_value();
+  PROTOBUF_NODISCARD std::string* release_default_value();
+  void set_allocated_default_value(std::string* default_value);
+  private:
+  const std::string& _internal_default_value() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_default_value(const std::string& value);
+  std::string* _internal_mutable_default_value();
+  public:
 
   // optional string json_name = 10;
   bool has_json_name() const;
+  private:
+  bool _internal_has_json_name() const;
+  public:
   void clear_json_name();
-  static const int kJsonNameFieldNumber = 10;
-  const ::std::string& json_name() const;
-  void set_json_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_json_name(::std::string&& value);
-  #endif
-  void set_json_name(const char* value);
-  void set_json_name(const char* value, size_t size);
-  ::std::string* mutable_json_name();
-  ::std::string* release_json_name();
-  void set_allocated_json_name(::std::string* json_name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_json_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_json_name(
-      ::std::string* json_name);
+  const std::string& json_name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_json_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_json_name();
+  PROTOBUF_NODISCARD std::string* release_json_name();
+  void set_allocated_json_name(std::string* json_name);
+  private:
+  const std::string& _internal_json_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_json_name(const std::string& value);
+  std::string* _internal_mutable_json_name();
+  public:
 
   // optional .google.protobuf.FieldOptions options = 8;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 8;
+  const ::PROTOBUF_NAMESPACE_ID::FieldOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::FieldOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::FieldOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::FieldOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::FieldOptions& options() const;
-  ::google::protobuf::FieldOptions* release_options();
-  ::google::protobuf::FieldOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::FieldOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::FieldOptions* options);
-  ::google::protobuf::FieldOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::FieldOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions* unsafe_arena_release_options();
 
   // optional int32 number = 3;
   bool has_number() const;
+  private:
+  bool _internal_has_number() const;
+  public:
   void clear_number();
-  static const int kNumberFieldNumber = 3;
-  ::google::protobuf::int32 number() const;
-  void set_number(::google::protobuf::int32 value);
+  int32_t number() const;
+  void set_number(int32_t value);
+  private:
+  int32_t _internal_number() const;
+  void _internal_set_number(int32_t value);
+  public:
 
   // optional int32 oneof_index = 9;
   bool has_oneof_index() const;
+  private:
+  bool _internal_has_oneof_index() const;
+  public:
   void clear_oneof_index();
-  static const int kOneofIndexFieldNumber = 9;
-  ::google::protobuf::int32 oneof_index() const;
-  void set_oneof_index(::google::protobuf::int32 value);
+  int32_t oneof_index() const;
+  void set_oneof_index(int32_t value);
+  private:
+  int32_t _internal_oneof_index() const;
+  void _internal_set_oneof_index(int32_t value);
+  public:
+
+  // optional bool proto3_optional = 17;
+  bool has_proto3_optional() const;
+  private:
+  bool _internal_has_proto3_optional() const;
+  public:
+  void clear_proto3_optional();
+  bool proto3_optional() const;
+  void set_proto3_optional(bool value);
+  private:
+  bool _internal_proto3_optional() const;
+  void _internal_set_proto3_optional(bool value);
+  public:
 
   // optional .google.protobuf.FieldDescriptorProto.Label label = 4;
   bool has_label() const;
+  private:
+  bool _internal_has_label() const;
+  public:
   void clear_label();
-  static const int kLabelFieldNumber = 4;
-  ::google::protobuf::FieldDescriptorProto_Label label() const;
-  void set_label(::google::protobuf::FieldDescriptorProto_Label value);
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label label() const;
+  void set_label(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label _internal_label() const;
+  void _internal_set_label(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label value);
+  public:
 
   // optional .google.protobuf.FieldDescriptorProto.Type type = 5;
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 5;
-  ::google::protobuf::FieldDescriptorProto_Type type() const;
-  void set_type(::google::protobuf::FieldDescriptorProto_Type value);
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type type() const;
+  void set_type(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type _internal_type() const;
+  void _internal_set_type(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type value);
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.FieldDescriptorProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_number();
-  void clear_has_number();
-  void set_has_label();
-  void clear_has_label();
-  void set_has_type();
-  void clear_has_type();
-  void set_has_type_name();
-  void clear_has_type_name();
-  void set_has_extendee();
-  void clear_has_extendee();
-  void set_has_default_value();
-  void clear_has_default_value();
-  void set_has_oneof_index();
-  void clear_has_oneof_index();
-  void set_has_json_name();
-  void clear_has_json_name();
-  void set_has_options();
-  void clear_has_options();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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::internal::ArenaStringPtr extendee_;
-  ::google::protobuf::internal::ArenaStringPtr type_name_;
-  ::google::protobuf::internal::ArenaStringPtr default_value_;
-  ::google::protobuf::internal::ArenaStringPtr json_name_;
-  ::google::protobuf::FieldOptions* options_;
-  ::google::protobuf::int32 number_;
-  ::google::protobuf::int32 oneof_index_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr extendee_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr default_value_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr json_name_;
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions* options_;
+  int32_t number_;
+  int32_t oneof_index_;
+  bool proto3_optional_;
   int label_;
   int type_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProtoImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofDescriptorProto) */ {
+class PROTOBUF_EXPORT OneofDescriptorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofDescriptorProto) */ {
  public:
-  OneofDescriptorProto();
-  virtual ~OneofDescriptorProto();
+  inline OneofDescriptorProto() : OneofDescriptorProto(nullptr) {}
+  ~OneofDescriptorProto() override;
+  explicit constexpr OneofDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   OneofDescriptorProto(const OneofDescriptorProto& from);
-
-  inline OneofDescriptorProto& operator=(const OneofDescriptorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   OneofDescriptorProto(OneofDescriptorProto&& from) noexcept
     : OneofDescriptorProto() {
     *this = ::std::move(from);
   }
 
+  inline OneofDescriptorProto& operator=(const OneofDescriptorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline OneofDescriptorProto& operator=(OneofDescriptorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const OneofDescriptorProto& default_instance() {
+    return *internal_default_instance();
   }
-  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_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     7;
 
-  void UnsafeArenaSwap(OneofDescriptorProto* other);
-  void Swap(OneofDescriptorProto* other);
   friend void swap(OneofDescriptorProto& a, OneofDescriptorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(OneofDescriptorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(OneofDescriptorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline OneofDescriptorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  OneofDescriptorProto* 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;
+  OneofDescriptorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<OneofDescriptorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const OneofDescriptorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const OneofDescriptorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(OneofDescriptorProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.OneofDescriptorProto";
+  }
   protected:
-  explicit OneofDescriptorProto(::google::protobuf::Arena* arena);
+  explicit OneofDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 1,
+    kOptionsFieldNumber = 2,
+  };
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional .google.protobuf.OneofOptions options = 2;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 2;
+  const ::PROTOBUF_NAMESPACE_ID::OneofOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::OneofOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::OneofOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::OneofOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::OneofOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::OneofOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::OneofOptions& options() const;
-  ::google::protobuf::OneofOptions* release_options();
-  ::google::protobuf::OneofOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::OneofOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::OneofOptions* options);
-  ::google::protobuf::OneofOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::OneofOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::OneofOptions* unsafe_arena_release_options();
 
   // @@protoc_insertion_point(class_scope:google.protobuf.OneofDescriptorProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_options();
-  void clear_has_options();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProtoImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::OneofOptions* options_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto.EnumReservedRange) */ {
+class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto.EnumReservedRange) */ {
  public:
-  EnumDescriptorProto_EnumReservedRange();
-  virtual ~EnumDescriptorProto_EnumReservedRange();
+  inline EnumDescriptorProto_EnumReservedRange() : EnumDescriptorProto_EnumReservedRange(nullptr) {}
+  ~EnumDescriptorProto_EnumReservedRange() override;
+  explicit constexpr EnumDescriptorProto_EnumReservedRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   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=(const EnumDescriptorProto_EnumReservedRange& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline EnumDescriptorProto_EnumReservedRange& operator=(EnumDescriptorProto_EnumReservedRange&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const EnumDescriptorProto_EnumReservedRange& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     8;
 
-  void UnsafeArenaSwap(EnumDescriptorProto_EnumReservedRange* other);
-  void Swap(EnumDescriptorProto_EnumReservedRange* other);
   friend void swap(EnumDescriptorProto_EnumReservedRange& a, EnumDescriptorProto_EnumReservedRange& b) {
     a.Swap(&b);
   }
+  inline void Swap(EnumDescriptorProto_EnumReservedRange* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(EnumDescriptorProto_EnumReservedRange* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // 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;
+  EnumDescriptorProto_EnumReservedRange* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<EnumDescriptorProto_EnumReservedRange>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const EnumDescriptorProto_EnumReservedRange& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const EnumDescriptorProto_EnumReservedRange& from);
-  void 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(EnumDescriptorProto_EnumReservedRange* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.EnumDescriptorProto.EnumReservedRange";
+  }
   protected:
-  explicit EnumDescriptorProto_EnumReservedRange(::google::protobuf::Arena* arena);
+  explicit EnumDescriptorProto_EnumReservedRange(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kStartFieldNumber = 1,
+    kEndFieldNumber = 2,
+  };
   // optional int32 start = 1;
   bool has_start() const;
+  private:
+  bool _internal_has_start() const;
+  public:
   void clear_start();
-  static const int kStartFieldNumber = 1;
-  ::google::protobuf::int32 start() const;
-  void set_start(::google::protobuf::int32 value);
+  int32_t start() const;
+  void set_start(int32_t value);
+  private:
+  int32_t _internal_start() const;
+  void _internal_set_start(int32_t value);
+  public:
 
   // optional int32 end = 2;
   bool has_end() const;
+  private:
+  bool _internal_has_end() const;
+  public:
   void clear_end();
-  static const int kEndFieldNumber = 2;
-  ::google::protobuf::int32 end() const;
-  void set_end(::google::protobuf::int32 value);
+  int32_t end() const;
+  void set_end(int32_t value);
+  private:
+  int32_t _internal_end() const;
+  void _internal_set_end(int32_t value);
+  public:
 
   // @@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();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int32_t start_;
+  int32_t end_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto) */ {
+class PROTOBUF_EXPORT EnumDescriptorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto) */ {
  public:
-  EnumDescriptorProto();
-  virtual ~EnumDescriptorProto();
+  inline EnumDescriptorProto() : EnumDescriptorProto(nullptr) {}
+  ~EnumDescriptorProto() override;
+  explicit constexpr EnumDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   EnumDescriptorProto(const EnumDescriptorProto& from);
-
-  inline EnumDescriptorProto& operator=(const EnumDescriptorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   EnumDescriptorProto(EnumDescriptorProto&& from) noexcept
     : EnumDescriptorProto() {
     *this = ::std::move(from);
   }
 
+  inline EnumDescriptorProto& operator=(const EnumDescriptorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline EnumDescriptorProto& operator=(EnumDescriptorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const EnumDescriptorProto& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     9;
 
-  void UnsafeArenaSwap(EnumDescriptorProto* other);
-  void Swap(EnumDescriptorProto* other);
   friend void swap(EnumDescriptorProto& a, EnumDescriptorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(EnumDescriptorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(EnumDescriptorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline EnumDescriptorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  EnumDescriptorProto* 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;
+  EnumDescriptorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<EnumDescriptorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const EnumDescriptorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const EnumDescriptorProto& 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* other);
-  protected:
-  explicit EnumDescriptorProto(::google::protobuf::Arena* arena);
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const final;
+  void InternalSwap(EnumDescriptorProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return _internal_metadata_.arena();
-  }
-  inline void* MaybeArenaPtr() const {
-    return _internal_metadata_.raw_arena_ptr();
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.EnumDescriptorProto";
   }
+  protected:
+  explicit EnumDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -2301,1152 +2878,1504 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kValueFieldNumber = 2,
+    kReservedRangeFieldNumber = 4,
+    kReservedNameFieldNumber = 5,
+    kNameFieldNumber = 1,
+    kOptionsFieldNumber = 3,
+  };
   // repeated .google.protobuf.EnumValueDescriptorProto value = 2;
   int value_size() const;
+  private:
+  int _internal_value_size() const;
+  public:
   void clear_value();
-  static const int kValueFieldNumber = 2;
-  const ::google::protobuf::EnumValueDescriptorProto& value(int index) const;
-  ::google::protobuf::EnumValueDescriptorProto* mutable_value(int index);
-  ::google::protobuf::EnumValueDescriptorProto* add_value();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* mutable_value(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto >*
       mutable_value();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto& _internal_value(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* _internal_add_value();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto& value(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* add_value();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto >&
       value() const;
 
   // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;
   int reserved_range_size() const;
+  private:
+  int _internal_reserved_range_size() const;
+  public:
   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 >*
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* mutable_reserved_range(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange >*
       mutable_reserved_range();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange& _internal_reserved_range(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* _internal_add_reserved_range();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange& reserved_range(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* add_reserved_range();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange >&
       reserved_range() const;
 
   // repeated string reserved_name = 5;
   int reserved_name_size() const;
+  private:
+  int _internal_reserved_name_size() const;
+  public:
   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
+  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);
+  void set_reserved_name(int index, std::string&& value);
   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
+  std::string* add_reserved_name();
+  void add_reserved_name(const std::string& value);
+  void add_reserved_name(std::string&& value);
   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();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& reserved_name() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_reserved_name();
+  private:
+  const std::string& _internal_reserved_name(int index) const;
+  std::string* _internal_add_reserved_name();
+  public:
 
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional .google.protobuf.EnumOptions options = 3;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 3;
+  const ::PROTOBUF_NAMESPACE_ID::EnumOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::EnumOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::EnumOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::EnumOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::EnumOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::EnumOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::EnumOptions& options() const;
-  ::google::protobuf::EnumOptions* release_options();
-  ::google::protobuf::EnumOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::EnumOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::EnumOptions* options);
-  ::google::protobuf::EnumOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::EnumOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::EnumOptions* unsafe_arena_release_options();
 
   // @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_options();
-  void clear_has_options();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProtoImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto > value_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange > reserved_range_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> reserved_name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::EnumOptions* options_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueDescriptorProto) */ {
+class PROTOBUF_EXPORT EnumValueDescriptorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueDescriptorProto) */ {
  public:
-  EnumValueDescriptorProto();
-  virtual ~EnumValueDescriptorProto();
+  inline EnumValueDescriptorProto() : EnumValueDescriptorProto(nullptr) {}
+  ~EnumValueDescriptorProto() override;
+  explicit constexpr EnumValueDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   EnumValueDescriptorProto(const EnumValueDescriptorProto& from);
-
-  inline EnumValueDescriptorProto& operator=(const EnumValueDescriptorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   EnumValueDescriptorProto(EnumValueDescriptorProto&& from) noexcept
     : EnumValueDescriptorProto() {
     *this = ::std::move(from);
   }
 
+  inline EnumValueDescriptorProto& operator=(const EnumValueDescriptorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline EnumValueDescriptorProto& operator=(EnumValueDescriptorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const EnumValueDescriptorProto& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     10;
 
-  void UnsafeArenaSwap(EnumValueDescriptorProto* other);
-  void Swap(EnumValueDescriptorProto* other);
   friend void swap(EnumValueDescriptorProto& a, EnumValueDescriptorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(EnumValueDescriptorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(EnumValueDescriptorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline EnumValueDescriptorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  EnumValueDescriptorProto* 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;
+  EnumValueDescriptorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<EnumValueDescriptorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const EnumValueDescriptorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const EnumValueDescriptorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(EnumValueDescriptorProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.EnumValueDescriptorProto";
+  }
   protected:
-  explicit EnumValueDescriptorProto(::google::protobuf::Arena* arena);
+  explicit EnumValueDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 1,
+    kOptionsFieldNumber = 3,
+    kNumberFieldNumber = 2,
+  };
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional .google.protobuf.EnumValueOptions options = 3;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 3;
+  const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::EnumValueOptions& options() const;
-  ::google::protobuf::EnumValueOptions* release_options();
-  ::google::protobuf::EnumValueOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::EnumValueOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::EnumValueOptions* options);
-  ::google::protobuf::EnumValueOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* unsafe_arena_release_options();
 
   // optional int32 number = 2;
   bool has_number() const;
+  private:
+  bool _internal_has_number() const;
+  public:
   void clear_number();
-  static const int kNumberFieldNumber = 2;
-  ::google::protobuf::int32 number() const;
-  void set_number(::google::protobuf::int32 value);
+  int32_t number() const;
+  void set_number(int32_t value);
+  private:
+  int32_t _internal_number() const;
+  void _internal_set_number(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueDescriptorProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_number();
-  void clear_has_number();
-  void set_has_options();
-  void clear_has_options();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProtoImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options_;
+  int32_t number_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceDescriptorProto) */ {
+class PROTOBUF_EXPORT ServiceDescriptorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceDescriptorProto) */ {
  public:
-  ServiceDescriptorProto();
-  virtual ~ServiceDescriptorProto();
+  inline ServiceDescriptorProto() : ServiceDescriptorProto(nullptr) {}
+  ~ServiceDescriptorProto() override;
+  explicit constexpr ServiceDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ServiceDescriptorProto(const ServiceDescriptorProto& from);
-
-  inline ServiceDescriptorProto& operator=(const ServiceDescriptorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ServiceDescriptorProto(ServiceDescriptorProto&& from) noexcept
     : ServiceDescriptorProto() {
     *this = ::std::move(from);
   }
 
+  inline ServiceDescriptorProto& operator=(const ServiceDescriptorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ServiceDescriptorProto& operator=(ServiceDescriptorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ServiceDescriptorProto& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     11;
 
-  void UnsafeArenaSwap(ServiceDescriptorProto* other);
-  void Swap(ServiceDescriptorProto* other);
   friend void swap(ServiceDescriptorProto& a, ServiceDescriptorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(ServiceDescriptorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ServiceDescriptorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ServiceDescriptorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ServiceDescriptorProto* 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;
+  ServiceDescriptorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ServiceDescriptorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ServiceDescriptorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ServiceDescriptorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ServiceDescriptorProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.ServiceDescriptorProto";
+  }
   protected:
-  explicit ServiceDescriptorProto(::google::protobuf::Arena* arena);
+  explicit ServiceDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kMethodFieldNumber = 2,
+    kNameFieldNumber = 1,
+    kOptionsFieldNumber = 3,
+  };
   // repeated .google.protobuf.MethodDescriptorProto method = 2;
   int method_size() const;
+  private:
+  int _internal_method_size() const;
+  public:
   void clear_method();
-  static const int kMethodFieldNumber = 2;
-  const ::google::protobuf::MethodDescriptorProto& method(int index) const;
-  ::google::protobuf::MethodDescriptorProto* mutable_method(int index);
-  ::google::protobuf::MethodDescriptorProto* add_method();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >*
+  ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* mutable_method(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto >*
       mutable_method();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto& _internal_method(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* _internal_add_method();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto& method(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* add_method();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto >&
       method() const;
 
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional .google.protobuf.ServiceOptions options = 3;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 3;
+  const ::PROTOBUF_NAMESPACE_ID::ServiceOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::ServiceOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::ServiceOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::ServiceOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::ServiceOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::ServiceOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::ServiceOptions& options() const;
-  ::google::protobuf::ServiceOptions* release_options();
-  ::google::protobuf::ServiceOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::ServiceOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::ServiceOptions* options);
-  ::google::protobuf::ServiceOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::ServiceOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::ServiceOptions* unsafe_arena_release_options();
 
   // @@protoc_insertion_point(class_scope:google.protobuf.ServiceDescriptorProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_options();
-  void clear_has_options();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProtoImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto > method_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::ServiceOptions* options_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodDescriptorProto) */ {
+class PROTOBUF_EXPORT MethodDescriptorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodDescriptorProto) */ {
  public:
-  MethodDescriptorProto();
-  virtual ~MethodDescriptorProto();
+  inline MethodDescriptorProto() : MethodDescriptorProto(nullptr) {}
+  ~MethodDescriptorProto() override;
+  explicit constexpr MethodDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   MethodDescriptorProto(const MethodDescriptorProto& from);
-
-  inline MethodDescriptorProto& operator=(const MethodDescriptorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   MethodDescriptorProto(MethodDescriptorProto&& from) noexcept
     : MethodDescriptorProto() {
     *this = ::std::move(from);
   }
 
+  inline MethodDescriptorProto& operator=(const MethodDescriptorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline MethodDescriptorProto& operator=(MethodDescriptorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const MethodDescriptorProto& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     12;
 
-  void UnsafeArenaSwap(MethodDescriptorProto* other);
-  void Swap(MethodDescriptorProto* other);
   friend void swap(MethodDescriptorProto& a, MethodDescriptorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(MethodDescriptorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(MethodDescriptorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline MethodDescriptorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  MethodDescriptorProto* 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;
+  MethodDescriptorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<MethodDescriptorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const MethodDescriptorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const MethodDescriptorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(MethodDescriptorProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.MethodDescriptorProto";
+  }
   protected:
-  explicit MethodDescriptorProto(::google::protobuf::Arena* arena);
+  explicit MethodDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 1,
+    kInputTypeFieldNumber = 2,
+    kOutputTypeFieldNumber = 3,
+    kOptionsFieldNumber = 4,
+    kClientStreamingFieldNumber = 5,
+    kServerStreamingFieldNumber = 6,
+  };
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional string input_type = 2;
   bool has_input_type() const;
+  private:
+  bool _internal_has_input_type() const;
+  public:
   void clear_input_type();
-  static const int kInputTypeFieldNumber = 2;
-  const ::std::string& input_type() const;
-  void set_input_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_input_type(::std::string&& value);
-  #endif
-  void set_input_type(const char* value);
-  void set_input_type(const char* value, size_t size);
-  ::std::string* mutable_input_type();
-  ::std::string* release_input_type();
-  void set_allocated_input_type(::std::string* input_type);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_input_type();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_input_type(
-      ::std::string* input_type);
+  const std::string& input_type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_input_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_input_type();
+  PROTOBUF_NODISCARD std::string* release_input_type();
+  void set_allocated_input_type(std::string* input_type);
+  private:
+  const std::string& _internal_input_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_input_type(const std::string& value);
+  std::string* _internal_mutable_input_type();
+  public:
 
   // optional string output_type = 3;
   bool has_output_type() const;
+  private:
+  bool _internal_has_output_type() const;
+  public:
   void clear_output_type();
-  static const int kOutputTypeFieldNumber = 3;
-  const ::std::string& output_type() const;
-  void set_output_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_output_type(::std::string&& value);
-  #endif
-  void set_output_type(const char* value);
-  void set_output_type(const char* value, size_t size);
-  ::std::string* mutable_output_type();
-  ::std::string* release_output_type();
-  void set_allocated_output_type(::std::string* output_type);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_output_type();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_output_type(
-      ::std::string* output_type);
+  const std::string& output_type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_output_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_output_type();
+  PROTOBUF_NODISCARD std::string* release_output_type();
+  void set_allocated_output_type(std::string* output_type);
+  private:
+  const std::string& _internal_output_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_output_type(const std::string& value);
+  std::string* _internal_mutable_output_type();
+  public:
 
   // optional .google.protobuf.MethodOptions options = 4;
   bool has_options() const;
+  private:
+  bool _internal_has_options() const;
+  public:
   void clear_options();
-  static const int kOptionsFieldNumber = 4;
+  const ::PROTOBUF_NAMESPACE_ID::MethodOptions& options() const;
+  PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::MethodOptions* release_options();
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions* mutable_options();
+  void set_allocated_options(::PROTOBUF_NAMESPACE_ID::MethodOptions* options);
   private:
-  void _slow_mutable_options();
+  const ::PROTOBUF_NAMESPACE_ID::MethodOptions& _internal_options() const;
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions* _internal_mutable_options();
   public:
-  const ::google::protobuf::MethodOptions& options() const;
-  ::google::protobuf::MethodOptions* release_options();
-  ::google::protobuf::MethodOptions* mutable_options();
-  void set_allocated_options(::google::protobuf::MethodOptions* options);
   void unsafe_arena_set_allocated_options(
-      ::google::protobuf::MethodOptions* options);
-  ::google::protobuf::MethodOptions* unsafe_arena_release_options();
+      ::PROTOBUF_NAMESPACE_ID::MethodOptions* options);
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions* unsafe_arena_release_options();
 
   // optional bool client_streaming = 5 [default = false];
   bool has_client_streaming() const;
+  private:
+  bool _internal_has_client_streaming() const;
+  public:
   void clear_client_streaming();
-  static const int kClientStreamingFieldNumber = 5;
   bool client_streaming() const;
   void set_client_streaming(bool value);
+  private:
+  bool _internal_client_streaming() const;
+  void _internal_set_client_streaming(bool value);
+  public:
 
   // optional bool server_streaming = 6 [default = false];
   bool has_server_streaming() const;
+  private:
+  bool _internal_has_server_streaming() const;
+  public:
   void clear_server_streaming();
-  static const int kServerStreamingFieldNumber = 6;
   bool server_streaming() const;
   void set_server_streaming(bool value);
+  private:
+  bool _internal_server_streaming() const;
+  void _internal_set_server_streaming(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.MethodDescriptorProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_input_type();
-  void clear_has_input_type();
-  void set_has_output_type();
-  void clear_has_output_type();
-  void set_has_options();
-  void clear_has_options();
-  void set_has_client_streaming();
-  void clear_has_client_streaming();
-  void set_has_server_streaming();
-  void clear_has_server_streaming();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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::internal::ArenaStringPtr input_type_;
-  ::google::protobuf::internal::ArenaStringPtr output_type_;
-  ::google::protobuf::MethodOptions* options_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr input_type_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr output_type_;
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions* options_;
   bool client_streaming_;
   bool server_streaming_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProtoImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileOptions) */ {
+class PROTOBUF_EXPORT FileOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileOptions) */ {
  public:
-  FileOptions();
-  virtual ~FileOptions();
+  inline FileOptions() : FileOptions(nullptr) {}
+  ~FileOptions() override;
+  explicit constexpr FileOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FileOptions(const FileOptions& from);
-
-  inline FileOptions& operator=(const FileOptions& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FileOptions(FileOptions&& from) noexcept
     : FileOptions() {
     *this = ::std::move(from);
   }
 
+  inline FileOptions& operator=(const FileOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FileOptions& operator=(FileOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FileOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     13;
 
-  void UnsafeArenaSwap(FileOptions* other);
-  void Swap(FileOptions* other);
   friend void swap(FileOptions& a, FileOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(FileOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FileOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FileOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FileOptions* 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;
+  FileOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FileOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FileOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FileOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FileOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.FileOptions";
+  }
   protected:
-  explicit FileOptions(::google::protobuf::Arena* arena);
+  explicit FileOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef FileOptions_OptimizeMode OptimizeMode;
-  static const OptimizeMode SPEED =
+  static constexpr OptimizeMode SPEED =
     FileOptions_OptimizeMode_SPEED;
-  static const OptimizeMode CODE_SIZE =
+  static constexpr OptimizeMode CODE_SIZE =
     FileOptions_OptimizeMode_CODE_SIZE;
-  static const OptimizeMode LITE_RUNTIME =
+  static constexpr OptimizeMode LITE_RUNTIME =
     FileOptions_OptimizeMode_LITE_RUNTIME;
   static inline bool OptimizeMode_IsValid(int value) {
     return FileOptions_OptimizeMode_IsValid(value);
   }
-  static const OptimizeMode OptimizeMode_MIN =
+  static constexpr OptimizeMode OptimizeMode_MIN =
     FileOptions_OptimizeMode_OptimizeMode_MIN;
-  static const OptimizeMode OptimizeMode_MAX =
+  static constexpr OptimizeMode OptimizeMode_MAX =
     FileOptions_OptimizeMode_OptimizeMode_MAX;
-  static const int OptimizeMode_ARRAYSIZE =
+  static constexpr int OptimizeMode_ARRAYSIZE =
     FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   OptimizeMode_descriptor() {
     return FileOptions_OptimizeMode_descriptor();
   }
-  static inline const ::std::string& OptimizeMode_Name(OptimizeMode value) {
-    return FileOptions_OptimizeMode_Name(value);
+  template<typename T>
+  static inline const std::string& OptimizeMode_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, OptimizeMode>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function OptimizeMode_Name.");
+    return FileOptions_OptimizeMode_Name(enum_t_value);
   }
-  static inline bool OptimizeMode_Parse(const ::std::string& name,
+  static inline bool OptimizeMode_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       OptimizeMode* value) {
     return FileOptions_OptimizeMode_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+    kJavaPackageFieldNumber = 1,
+    kJavaOuterClassnameFieldNumber = 8,
+    kGoPackageFieldNumber = 11,
+    kObjcClassPrefixFieldNumber = 36,
+    kCsharpNamespaceFieldNumber = 37,
+    kSwiftPrefixFieldNumber = 39,
+    kPhpClassPrefixFieldNumber = 40,
+    kPhpNamespaceFieldNumber = 41,
+    kPhpMetadataNamespaceFieldNumber = 44,
+    kRubyPackageFieldNumber = 45,
+    kJavaMultipleFilesFieldNumber = 10,
+    kJavaGenerateEqualsAndHashFieldNumber = 20,
+    kJavaStringCheckUtf8FieldNumber = 27,
+    kCcGenericServicesFieldNumber = 16,
+    kJavaGenericServicesFieldNumber = 17,
+    kPyGenericServicesFieldNumber = 18,
+    kPhpGenericServicesFieldNumber = 42,
+    kDeprecatedFieldNumber = 23,
+    kOptimizeForFieldNumber = 9,
+    kCcEnableArenasFieldNumber = 31,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
   // optional string java_package = 1;
   bool has_java_package() const;
+  private:
+  bool _internal_has_java_package() const;
+  public:
   void clear_java_package();
-  static const int kJavaPackageFieldNumber = 1;
-  const ::std::string& java_package() const;
-  void set_java_package(const ::std::string& value);
-  #if LANG_CXX11
-  void set_java_package(::std::string&& value);
-  #endif
-  void set_java_package(const char* value);
-  void set_java_package(const char* value, size_t size);
-  ::std::string* mutable_java_package();
-  ::std::string* release_java_package();
-  void set_allocated_java_package(::std::string* java_package);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_java_package();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_java_package(
-      ::std::string* java_package);
+  const std::string& java_package() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_java_package(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_java_package();
+  PROTOBUF_NODISCARD std::string* release_java_package();
+  void set_allocated_java_package(std::string* java_package);
+  private:
+  const std::string& _internal_java_package() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_java_package(const std::string& value);
+  std::string* _internal_mutable_java_package();
+  public:
 
   // optional string java_outer_classname = 8;
   bool has_java_outer_classname() const;
+  private:
+  bool _internal_has_java_outer_classname() const;
+  public:
   void clear_java_outer_classname();
-  static const int kJavaOuterClassnameFieldNumber = 8;
-  const ::std::string& java_outer_classname() const;
-  void set_java_outer_classname(const ::std::string& value);
-  #if LANG_CXX11
-  void set_java_outer_classname(::std::string&& value);
-  #endif
-  void set_java_outer_classname(const char* value);
-  void set_java_outer_classname(const char* value, size_t size);
-  ::std::string* mutable_java_outer_classname();
-  ::std::string* release_java_outer_classname();
-  void set_allocated_java_outer_classname(::std::string* java_outer_classname);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_java_outer_classname();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_java_outer_classname(
-      ::std::string* java_outer_classname);
+  const std::string& java_outer_classname() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_java_outer_classname(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_java_outer_classname();
+  PROTOBUF_NODISCARD std::string* release_java_outer_classname();
+  void set_allocated_java_outer_classname(std::string* java_outer_classname);
+  private:
+  const std::string& _internal_java_outer_classname() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_java_outer_classname(const std::string& value);
+  std::string* _internal_mutable_java_outer_classname();
+  public:
 
   // optional string go_package = 11;
   bool has_go_package() const;
+  private:
+  bool _internal_has_go_package() const;
+  public:
   void clear_go_package();
-  static const int kGoPackageFieldNumber = 11;
-  const ::std::string& go_package() const;
-  void set_go_package(const ::std::string& value);
-  #if LANG_CXX11
-  void set_go_package(::std::string&& value);
-  #endif
-  void set_go_package(const char* value);
-  void set_go_package(const char* value, size_t size);
-  ::std::string* mutable_go_package();
-  ::std::string* release_go_package();
-  void set_allocated_go_package(::std::string* go_package);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_go_package();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_go_package(
-      ::std::string* go_package);
+  const std::string& go_package() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_go_package(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_go_package();
+  PROTOBUF_NODISCARD std::string* release_go_package();
+  void set_allocated_go_package(std::string* go_package);
+  private:
+  const std::string& _internal_go_package() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_go_package(const std::string& value);
+  std::string* _internal_mutable_go_package();
+  public:
 
   // optional string objc_class_prefix = 36;
   bool has_objc_class_prefix() const;
+  private:
+  bool _internal_has_objc_class_prefix() const;
+  public:
   void clear_objc_class_prefix();
-  static const int kObjcClassPrefixFieldNumber = 36;
-  const ::std::string& objc_class_prefix() const;
-  void set_objc_class_prefix(const ::std::string& value);
-  #if LANG_CXX11
-  void set_objc_class_prefix(::std::string&& value);
-  #endif
-  void set_objc_class_prefix(const char* value);
-  void set_objc_class_prefix(const char* value, size_t size);
-  ::std::string* mutable_objc_class_prefix();
-  ::std::string* release_objc_class_prefix();
-  void set_allocated_objc_class_prefix(::std::string* objc_class_prefix);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_objc_class_prefix();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_objc_class_prefix(
-      ::std::string* objc_class_prefix);
+  const std::string& objc_class_prefix() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_objc_class_prefix(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_objc_class_prefix();
+  PROTOBUF_NODISCARD std::string* release_objc_class_prefix();
+  void set_allocated_objc_class_prefix(std::string* objc_class_prefix);
+  private:
+  const std::string& _internal_objc_class_prefix() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_objc_class_prefix(const std::string& value);
+  std::string* _internal_mutable_objc_class_prefix();
+  public:
 
   // optional string csharp_namespace = 37;
   bool has_csharp_namespace() const;
+  private:
+  bool _internal_has_csharp_namespace() const;
+  public:
   void clear_csharp_namespace();
-  static const int kCsharpNamespaceFieldNumber = 37;
-  const ::std::string& csharp_namespace() const;
-  void set_csharp_namespace(const ::std::string& value);
-  #if LANG_CXX11
-  void set_csharp_namespace(::std::string&& value);
-  #endif
-  void set_csharp_namespace(const char* value);
-  void set_csharp_namespace(const char* value, size_t size);
-  ::std::string* mutable_csharp_namespace();
-  ::std::string* release_csharp_namespace();
-  void set_allocated_csharp_namespace(::std::string* csharp_namespace);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_csharp_namespace();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_csharp_namespace(
-      ::std::string* csharp_namespace);
+  const std::string& csharp_namespace() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_csharp_namespace(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_csharp_namespace();
+  PROTOBUF_NODISCARD std::string* release_csharp_namespace();
+  void set_allocated_csharp_namespace(std::string* csharp_namespace);
+  private:
+  const std::string& _internal_csharp_namespace() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_csharp_namespace(const std::string& value);
+  std::string* _internal_mutable_csharp_namespace();
+  public:
 
   // optional string swift_prefix = 39;
   bool has_swift_prefix() const;
+  private:
+  bool _internal_has_swift_prefix() const;
+  public:
   void clear_swift_prefix();
-  static const int kSwiftPrefixFieldNumber = 39;
-  const ::std::string& swift_prefix() const;
-  void set_swift_prefix(const ::std::string& value);
-  #if LANG_CXX11
-  void set_swift_prefix(::std::string&& value);
-  #endif
-  void set_swift_prefix(const char* value);
-  void set_swift_prefix(const char* value, size_t size);
-  ::std::string* mutable_swift_prefix();
-  ::std::string* release_swift_prefix();
-  void set_allocated_swift_prefix(::std::string* swift_prefix);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_swift_prefix();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_swift_prefix(
-      ::std::string* swift_prefix);
+  const std::string& swift_prefix() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_swift_prefix(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_swift_prefix();
+  PROTOBUF_NODISCARD std::string* release_swift_prefix();
+  void set_allocated_swift_prefix(std::string* swift_prefix);
+  private:
+  const std::string& _internal_swift_prefix() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_swift_prefix(const std::string& value);
+  std::string* _internal_mutable_swift_prefix();
+  public:
 
   // optional string php_class_prefix = 40;
   bool has_php_class_prefix() const;
+  private:
+  bool _internal_has_php_class_prefix() const;
+  public:
   void clear_php_class_prefix();
-  static const int kPhpClassPrefixFieldNumber = 40;
-  const ::std::string& php_class_prefix() const;
-  void set_php_class_prefix(const ::std::string& value);
-  #if LANG_CXX11
-  void set_php_class_prefix(::std::string&& value);
-  #endif
-  void set_php_class_prefix(const char* value);
-  void set_php_class_prefix(const char* value, size_t size);
-  ::std::string* mutable_php_class_prefix();
-  ::std::string* release_php_class_prefix();
-  void set_allocated_php_class_prefix(::std::string* php_class_prefix);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_php_class_prefix();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_php_class_prefix(
-      ::std::string* php_class_prefix);
+  const std::string& php_class_prefix() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_php_class_prefix(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_php_class_prefix();
+  PROTOBUF_NODISCARD std::string* release_php_class_prefix();
+  void set_allocated_php_class_prefix(std::string* php_class_prefix);
+  private:
+  const std::string& _internal_php_class_prefix() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_php_class_prefix(const std::string& value);
+  std::string* _internal_mutable_php_class_prefix();
+  public:
 
   // optional string php_namespace = 41;
   bool has_php_namespace() const;
+  private:
+  bool _internal_has_php_namespace() const;
+  public:
   void clear_php_namespace();
-  static const int kPhpNamespaceFieldNumber = 41;
-  const ::std::string& php_namespace() const;
-  void set_php_namespace(const ::std::string& value);
-  #if LANG_CXX11
-  void set_php_namespace(::std::string&& value);
-  #endif
-  void set_php_namespace(const char* value);
-  void set_php_namespace(const char* value, size_t size);
-  ::std::string* mutable_php_namespace();
-  ::std::string* release_php_namespace();
-  void set_allocated_php_namespace(::std::string* php_namespace);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_php_namespace();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  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);
+  const std::string& php_namespace() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_php_namespace(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_php_namespace();
+  PROTOBUF_NODISCARD std::string* release_php_namespace();
+  void set_allocated_php_namespace(std::string* php_namespace);
+  private:
+  const std::string& _internal_php_namespace() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_php_namespace(const std::string& value);
+  std::string* _internal_mutable_php_namespace();
+  public:
+
+  // optional string php_metadata_namespace = 44;
+  bool has_php_metadata_namespace() const;
+  private:
+  bool _internal_has_php_metadata_namespace() const;
+  public:
+  void clear_php_metadata_namespace();
+  const std::string& php_metadata_namespace() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_php_metadata_namespace(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_php_metadata_namespace();
+  PROTOBUF_NODISCARD std::string* release_php_metadata_namespace();
+  void set_allocated_php_metadata_namespace(std::string* php_metadata_namespace);
+  private:
+  const std::string& _internal_php_metadata_namespace() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_php_metadata_namespace(const std::string& value);
+  std::string* _internal_mutable_php_metadata_namespace();
+  public:
+
+  // optional string ruby_package = 45;
+  bool has_ruby_package() const;
+  private:
+  bool _internal_has_ruby_package() const;
+  public:
+  void clear_ruby_package();
+  const std::string& ruby_package() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_ruby_package(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_ruby_package();
+  PROTOBUF_NODISCARD std::string* release_ruby_package();
+  void set_allocated_ruby_package(std::string* ruby_package);
+  private:
+  const std::string& _internal_ruby_package() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_ruby_package(const std::string& value);
+  std::string* _internal_mutable_ruby_package();
+  public:
 
   // optional bool java_multiple_files = 10 [default = false];
   bool has_java_multiple_files() const;
+  private:
+  bool _internal_has_java_multiple_files() const;
+  public:
   void clear_java_multiple_files();
-  static const int kJavaMultipleFilesFieldNumber = 10;
   bool java_multiple_files() const;
   void set_java_multiple_files(bool value);
+  private:
+  bool _internal_java_multiple_files() const;
+  void _internal_set_java_multiple_files(bool value);
+  public:
 
   // optional bool java_generate_equals_and_hash = 20 [deprecated = true];
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR bool has_java_generate_equals_and_hash() const;
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_java_generate_equals_and_hash();
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kJavaGenerateEqualsAndHashFieldNumber = 20;
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR bool java_generate_equals_and_hash() const;
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_java_generate_equals_and_hash(bool value);
+  PROTOBUF_DEPRECATED bool has_java_generate_equals_and_hash() const;
+  private:
+  bool _internal_has_java_generate_equals_and_hash() const;
+  public:
+  PROTOBUF_DEPRECATED void clear_java_generate_equals_and_hash();
+  PROTOBUF_DEPRECATED bool java_generate_equals_and_hash() const;
+  PROTOBUF_DEPRECATED void set_java_generate_equals_and_hash(bool value);
+  private:
+  bool _internal_java_generate_equals_and_hash() const;
+  void _internal_set_java_generate_equals_and_hash(bool value);
+  public:
 
   // optional bool java_string_check_utf8 = 27 [default = false];
   bool has_java_string_check_utf8() const;
+  private:
+  bool _internal_has_java_string_check_utf8() const;
+  public:
   void clear_java_string_check_utf8();
-  static const int kJavaStringCheckUtf8FieldNumber = 27;
   bool java_string_check_utf8() const;
   void set_java_string_check_utf8(bool value);
+  private:
+  bool _internal_java_string_check_utf8() const;
+  void _internal_set_java_string_check_utf8(bool value);
+  public:
 
   // optional bool cc_generic_services = 16 [default = false];
   bool has_cc_generic_services() const;
+  private:
+  bool _internal_has_cc_generic_services() const;
+  public:
   void clear_cc_generic_services();
-  static const int kCcGenericServicesFieldNumber = 16;
   bool cc_generic_services() const;
   void set_cc_generic_services(bool value);
+  private:
+  bool _internal_cc_generic_services() const;
+  void _internal_set_cc_generic_services(bool value);
+  public:
 
   // optional bool java_generic_services = 17 [default = false];
   bool has_java_generic_services() const;
+  private:
+  bool _internal_has_java_generic_services() const;
+  public:
   void clear_java_generic_services();
-  static const int kJavaGenericServicesFieldNumber = 17;
   bool java_generic_services() const;
   void set_java_generic_services(bool value);
+  private:
+  bool _internal_java_generic_services() const;
+  void _internal_set_java_generic_services(bool value);
+  public:
 
   // optional bool py_generic_services = 18 [default = false];
   bool has_py_generic_services() const;
+  private:
+  bool _internal_has_py_generic_services() const;
+  public:
   void clear_py_generic_services();
-  static const int kPyGenericServicesFieldNumber = 18;
   bool py_generic_services() const;
   void set_py_generic_services(bool value);
+  private:
+  bool _internal_py_generic_services() const;
+  void _internal_set_py_generic_services(bool value);
+  public:
 
   // optional bool php_generic_services = 42 [default = false];
   bool has_php_generic_services() const;
+  private:
+  bool _internal_has_php_generic_services() const;
+  public:
   void clear_php_generic_services();
-  static const int kPhpGenericServicesFieldNumber = 42;
   bool php_generic_services() const;
   void set_php_generic_services(bool value);
+  private:
+  bool _internal_php_generic_services() const;
+  void _internal_set_php_generic_services(bool value);
+  public:
 
   // optional bool deprecated = 23 [default = false];
   bool has_deprecated() const;
+  private:
+  bool _internal_has_deprecated() const;
+  public:
   void clear_deprecated();
-  static const int kDeprecatedFieldNumber = 23;
   bool deprecated() const;
   void set_deprecated(bool value);
+  private:
+  bool _internal_deprecated() const;
+  void _internal_set_deprecated(bool value);
+  public:
 
   // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
   bool has_optimize_for() const;
+  private:
+  bool _internal_has_optimize_for() const;
+  public:
   void clear_optimize_for();
-  static const int kOptimizeForFieldNumber = 9;
-  ::google::protobuf::FileOptions_OptimizeMode optimize_for() const;
-  void set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value);
+  ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode optimize_for() const;
+  void set_optimize_for(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode _internal_optimize_for() const;
+  void _internal_set_optimize_for(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode value);
+  public:
+
+  // optional bool cc_enable_arenas = 31 [default = true];
+  bool has_cc_enable_arenas() const;
+  private:
+  bool _internal_has_cc_enable_arenas() const;
+  public:
+  void clear_cc_enable_arenas();
+  bool cc_enable_arenas() const;
+  void set_cc_enable_arenas(bool value);
+  private:
+  bool _internal_cc_enable_arenas() const;
+  void _internal_set_cc_enable_arenas(bool value);
+  public:
+
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FileOptions)
   // @@protoc_insertion_point(class_scope:google.protobuf.FileOptions)
  private:
-  void set_has_java_package();
-  void clear_has_java_package();
-  void set_has_java_outer_classname();
-  void clear_has_java_outer_classname();
-  void set_has_java_multiple_files();
-  void clear_has_java_multiple_files();
-  void set_has_java_generate_equals_and_hash();
-  void clear_has_java_generate_equals_and_hash();
-  void set_has_java_string_check_utf8();
-  void clear_has_java_string_check_utf8();
-  void set_has_optimize_for();
-  void clear_has_optimize_for();
-  void set_has_go_package();
-  void clear_has_go_package();
-  void set_has_cc_generic_services();
-  void clear_has_cc_generic_services();
-  void set_has_java_generic_services();
-  void clear_has_java_generic_services();
-  void set_has_py_generic_services();
-  void clear_has_py_generic_services();
-  void set_has_php_generic_services();
-  void clear_has_php_generic_services();
-  void set_has_deprecated();
-  void clear_has_deprecated();
-  void set_has_cc_enable_arenas();
-  void clear_has_cc_enable_arenas();
-  void set_has_objc_class_prefix();
-  void clear_has_objc_class_prefix();
-  void set_has_csharp_namespace();
-  void clear_has_csharp_namespace();
-  void set_has_swift_prefix();
-  void clear_has_swift_prefix();
-  void set_has_php_class_prefix();
-  void clear_has_php_class_prefix();
-  void set_has_php_namespace();
-  void clear_has_php_namespace();
-
-  ::google::protobuf::internal::ExtensionSet _extensions_;
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
-  ::google::protobuf::internal::ArenaStringPtr java_package_;
-  ::google::protobuf::internal::ArenaStringPtr java_outer_classname_;
-  ::google::protobuf::internal::ArenaStringPtr go_package_;
-  ::google::protobuf::internal::ArenaStringPtr objc_class_prefix_;
-  ::google::protobuf::internal::ArenaStringPtr csharp_namespace_;
-  ::google::protobuf::internal::ArenaStringPtr swift_prefix_;
-  ::google::protobuf::internal::ArenaStringPtr php_class_prefix_;
-  ::google::protobuf::internal::ArenaStringPtr php_namespace_;
-  bool cc_enable_arenas_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr java_package_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr java_outer_classname_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr go_package_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr objc_class_prefix_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr csharp_namespace_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr swift_prefix_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_class_prefix_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_namespace_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_metadata_namespace_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr ruby_package_;
   bool java_multiple_files_;
   bool java_generate_equals_and_hash_;
   bool java_string_check_utf8_;
@@ -3456,1423 +4385,3135 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p
   bool php_generic_services_;
   bool deprecated_;
   int optimize_for_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptionsImpl();
+  bool cc_enable_arenas_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MessageOptions) */ {
+class PROTOBUF_EXPORT MessageOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MessageOptions) */ {
  public:
-  MessageOptions();
-  virtual ~MessageOptions();
+  inline MessageOptions() : MessageOptions(nullptr) {}
+  ~MessageOptions() override;
+  explicit constexpr MessageOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   MessageOptions(const MessageOptions& from);
-
-  inline MessageOptions& operator=(const MessageOptions& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   MessageOptions(MessageOptions&& from) noexcept
     : MessageOptions() {
     *this = ::std::move(from);
   }
 
+  inline MessageOptions& operator=(const MessageOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline MessageOptions& operator=(MessageOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const MessageOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     14;
 
-  void UnsafeArenaSwap(MessageOptions* other);
-  void Swap(MessageOptions* other);
   friend void swap(MessageOptions& a, MessageOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(MessageOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(MessageOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline MessageOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  MessageOptions* 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;
+  MessageOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<MessageOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const MessageOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const MessageOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(MessageOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.MessageOptions";
+  }
   protected:
-  explicit MessageOptions(::google::protobuf::Arena* arena);
+  explicit MessageOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+    kMessageSetWireFormatFieldNumber = 1,
+    kNoStandardDescriptorAccessorFieldNumber = 2,
+    kDeprecatedFieldNumber = 3,
+    kMapEntryFieldNumber = 7,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
   // optional bool message_set_wire_format = 1 [default = false];
   bool has_message_set_wire_format() const;
+  private:
+  bool _internal_has_message_set_wire_format() const;
+  public:
   void clear_message_set_wire_format();
-  static const int kMessageSetWireFormatFieldNumber = 1;
   bool message_set_wire_format() const;
   void set_message_set_wire_format(bool value);
+  private:
+  bool _internal_message_set_wire_format() const;
+  void _internal_set_message_set_wire_format(bool value);
+  public:
 
   // optional bool no_standard_descriptor_accessor = 2 [default = false];
   bool has_no_standard_descriptor_accessor() const;
+  private:
+  bool _internal_has_no_standard_descriptor_accessor() const;
+  public:
   void clear_no_standard_descriptor_accessor();
-  static const int kNoStandardDescriptorAccessorFieldNumber = 2;
   bool no_standard_descriptor_accessor() const;
   void set_no_standard_descriptor_accessor(bool value);
+  private:
+  bool _internal_no_standard_descriptor_accessor() const;
+  void _internal_set_no_standard_descriptor_accessor(bool value);
+  public:
 
   // optional bool deprecated = 3 [default = false];
   bool has_deprecated() const;
+  private:
+  bool _internal_has_deprecated() const;
+  public:
   void clear_deprecated();
-  static const int kDeprecatedFieldNumber = 3;
   bool deprecated() const;
   void set_deprecated(bool value);
+  private:
+  bool _internal_deprecated() const;
+  void _internal_set_deprecated(bool value);
+  public:
 
   // optional bool map_entry = 7;
   bool has_map_entry() const;
+  private:
+  bool _internal_has_map_entry() const;
+  public:
   void clear_map_entry();
-  static const int kMapEntryFieldNumber = 7;
   bool map_entry() const;
   void set_map_entry(bool value);
+  private:
+  bool _internal_map_entry() const;
+  void _internal_set_map_entry(bool value);
+  public:
+
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MessageOptions)
   // @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions)
  private:
-  void set_has_message_set_wire_format();
-  void clear_has_message_set_wire_format();
-  void set_has_no_standard_descriptor_accessor();
-  void clear_has_no_standard_descriptor_accessor();
-  void set_has_deprecated();
-  void clear_has_deprecated();
-  void set_has_map_entry();
-  void clear_has_map_entry();
-
-  ::google::protobuf::internal::ExtensionSet _extensions_;
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
   bool message_set_wire_format_;
   bool no_standard_descriptor_accessor_;
   bool deprecated_;
   bool map_entry_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptionsImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldOptions) */ {
+class PROTOBUF_EXPORT FieldOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldOptions) */ {
  public:
-  FieldOptions();
-  virtual ~FieldOptions();
+  inline FieldOptions() : FieldOptions(nullptr) {}
+  ~FieldOptions() override;
+  explicit constexpr FieldOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FieldOptions(const FieldOptions& from);
-
-  inline FieldOptions& operator=(const FieldOptions& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FieldOptions(FieldOptions&& from) noexcept
     : FieldOptions() {
     *this = ::std::move(from);
   }
 
+  inline FieldOptions& operator=(const FieldOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FieldOptions& operator=(FieldOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FieldOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     15;
 
-  void UnsafeArenaSwap(FieldOptions* other);
-  void Swap(FieldOptions* other);
   friend void swap(FieldOptions& a, FieldOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(FieldOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FieldOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FieldOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FieldOptions* 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;
+  FieldOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FieldOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FieldOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FieldOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FieldOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.FieldOptions";
+  }
   protected:
-  explicit FieldOptions(::google::protobuf::Arena* arena);
+  explicit FieldOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef FieldOptions_CType CType;
-  static const CType STRING =
+  static constexpr CType STRING =
     FieldOptions_CType_STRING;
-  static const CType CORD =
+  static constexpr CType CORD =
     FieldOptions_CType_CORD;
-  static const CType STRING_PIECE =
+  static constexpr CType STRING_PIECE =
     FieldOptions_CType_STRING_PIECE;
   static inline bool CType_IsValid(int value) {
     return FieldOptions_CType_IsValid(value);
   }
-  static const CType CType_MIN =
+  static constexpr CType CType_MIN =
     FieldOptions_CType_CType_MIN;
-  static const CType CType_MAX =
+  static constexpr CType CType_MAX =
     FieldOptions_CType_CType_MAX;
-  static const int CType_ARRAYSIZE =
+  static constexpr int CType_ARRAYSIZE =
     FieldOptions_CType_CType_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   CType_descriptor() {
     return FieldOptions_CType_descriptor();
   }
-  static inline const ::std::string& CType_Name(CType value) {
-    return FieldOptions_CType_Name(value);
+  template<typename T>
+  static inline const std::string& CType_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, CType>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function CType_Name.");
+    return FieldOptions_CType_Name(enum_t_value);
   }
-  static inline bool CType_Parse(const ::std::string& name,
+  static inline bool CType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       CType* value) {
     return FieldOptions_CType_Parse(name, value);
   }
 
   typedef FieldOptions_JSType JSType;
-  static const JSType JS_NORMAL =
+  static constexpr JSType JS_NORMAL =
     FieldOptions_JSType_JS_NORMAL;
-  static const JSType JS_STRING =
+  static constexpr JSType JS_STRING =
     FieldOptions_JSType_JS_STRING;
-  static const JSType JS_NUMBER =
+  static constexpr JSType JS_NUMBER =
     FieldOptions_JSType_JS_NUMBER;
   static inline bool JSType_IsValid(int value) {
     return FieldOptions_JSType_IsValid(value);
   }
-  static const JSType JSType_MIN =
+  static constexpr JSType JSType_MIN =
     FieldOptions_JSType_JSType_MIN;
-  static const JSType JSType_MAX =
+  static constexpr JSType JSType_MAX =
     FieldOptions_JSType_JSType_MAX;
-  static const int JSType_ARRAYSIZE =
+  static constexpr int JSType_ARRAYSIZE =
     FieldOptions_JSType_JSType_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   JSType_descriptor() {
     return FieldOptions_JSType_descriptor();
   }
-  static inline const ::std::string& JSType_Name(JSType value) {
-    return FieldOptions_JSType_Name(value);
+  template<typename T>
+  static inline const std::string& JSType_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, JSType>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function JSType_Name.");
+    return FieldOptions_JSType_Name(enum_t_value);
   }
-  static inline bool JSType_Parse(const ::std::string& name,
+  static inline bool JSType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       JSType* value) {
     return FieldOptions_JSType_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+    kCtypeFieldNumber = 1,
+    kPackedFieldNumber = 2,
+    kLazyFieldNumber = 5,
+    kDeprecatedFieldNumber = 3,
+    kWeakFieldNumber = 10,
+    kJstypeFieldNumber = 6,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
   // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
   bool has_ctype() const;
+  private:
+  bool _internal_has_ctype() const;
+  public:
   void clear_ctype();
-  static const int kCtypeFieldNumber = 1;
-  ::google::protobuf::FieldOptions_CType ctype() const;
-  void set_ctype(::google::protobuf::FieldOptions_CType value);
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType ctype() const;
+  void set_ctype(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType _internal_ctype() const;
+  void _internal_set_ctype(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType value);
+  public:
 
   // optional bool packed = 2;
   bool has_packed() const;
+  private:
+  bool _internal_has_packed() const;
+  public:
   void clear_packed();
-  static const int kPackedFieldNumber = 2;
   bool packed() const;
   void set_packed(bool value);
+  private:
+  bool _internal_packed() const;
+  void _internal_set_packed(bool value);
+  public:
 
   // optional bool lazy = 5 [default = false];
   bool has_lazy() const;
+  private:
+  bool _internal_has_lazy() const;
+  public:
   void clear_lazy();
-  static const int kLazyFieldNumber = 5;
   bool lazy() const;
   void set_lazy(bool value);
+  private:
+  bool _internal_lazy() const;
+  void _internal_set_lazy(bool value);
+  public:
 
   // optional bool deprecated = 3 [default = false];
   bool has_deprecated() const;
+  private:
+  bool _internal_has_deprecated() const;
+  public:
   void clear_deprecated();
-  static const int kDeprecatedFieldNumber = 3;
   bool deprecated() const;
   void set_deprecated(bool value);
+  private:
+  bool _internal_deprecated() const;
+  void _internal_set_deprecated(bool value);
+  public:
 
   // optional bool weak = 10 [default = false];
   bool has_weak() const;
+  private:
+  bool _internal_has_weak() const;
+  public:
   void clear_weak();
-  static const int kWeakFieldNumber = 10;
   bool weak() const;
   void set_weak(bool value);
+  private:
+  bool _internal_weak() const;
+  void _internal_set_weak(bool value);
+  public:
 
   // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
   bool has_jstype() const;
+  private:
+  bool _internal_has_jstype() const;
+  public:
   void clear_jstype();
-  static const int kJstypeFieldNumber = 6;
-  ::google::protobuf::FieldOptions_JSType jstype() const;
-  void set_jstype(::google::protobuf::FieldOptions_JSType value);
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType jstype() const;
+  void set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType _internal_jstype() const;
+  void _internal_set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value);
+  public:
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FieldOptions)
-  // @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions)
- private:
-  void set_has_ctype();
-  void clear_has_ctype();
-  void set_has_packed();
-  void clear_has_packed();
-  void set_has_jstype();
-  void clear_has_jstype();
-  void set_has_lazy();
-  void clear_has_lazy();
-  void set_has_deprecated();
-  void clear_has_deprecated();
-  void set_has_weak();
-  void clear_has_weak();
-
-  ::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_;
-  int ctype_;
-  bool packed_;
-  bool lazy_;
-  bool deprecated_;
-  bool weak_;
-  int jstype_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptionsImpl();
-};
-// -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT OneofOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofOptions) */ {
- public:
-  OneofOptions();
-  virtual ~OneofOptions();
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
 
-  OneofOptions(const OneofOptions& from);
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
 
-  inline OneofOptions& operator=(const OneofOptions& from) {
-    CopyFrom(from);
-    return *this;
   }
-  #if LANG_CXX11
-  OneofOptions(OneofOptions&& from) noexcept
-    : OneofOptions() {
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
+  // @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions)
+ private:
+  class _Internal;
+
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
+  int ctype_;
+  bool packed_;
+  bool lazy_;
+  bool deprecated_;
+  bool weak_;
+  int jstype_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
+};
+// -------------------------------------------------------------------
+
+class PROTOBUF_EXPORT OneofOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofOptions) */ {
+ public:
+  inline OneofOptions() : OneofOptions(nullptr) {}
+  ~OneofOptions() override;
+  explicit constexpr OneofOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
+
+  OneofOptions(const OneofOptions& from);
+  OneofOptions(OneofOptions&& from) noexcept
+    : OneofOptions() {
     *this = ::std::move(from);
   }
 
+  inline OneofOptions& operator=(const OneofOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline OneofOptions& operator=(OneofOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const OneofOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     16;
 
-  void UnsafeArenaSwap(OneofOptions* other);
-  void Swap(OneofOptions* other);
   friend void swap(OneofOptions& a, OneofOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(OneofOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(OneofOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline OneofOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  OneofOptions* 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;
+  OneofOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<OneofOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const OneofOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const OneofOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(OneofOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.OneofOptions";
+  }
   protected:
-  explicit OneofOptions(::google::protobuf::Arena* arena);
+  explicit OneofOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(OneofOptions)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:google.protobuf.OneofOptions)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::ExtensionSet _extensions_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptionsImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumOptions) */ {
+class PROTOBUF_EXPORT EnumOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumOptions) */ {
  public:
-  EnumOptions();
-  virtual ~EnumOptions();
+  inline EnumOptions() : EnumOptions(nullptr) {}
+  ~EnumOptions() override;
+  explicit constexpr EnumOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   EnumOptions(const EnumOptions& from);
-
-  inline EnumOptions& operator=(const EnumOptions& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   EnumOptions(EnumOptions&& from) noexcept
     : EnumOptions() {
     *this = ::std::move(from);
   }
 
+  inline EnumOptions& operator=(const EnumOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline EnumOptions& operator=(EnumOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const EnumOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     17;
 
-  void UnsafeArenaSwap(EnumOptions* other);
-  void Swap(EnumOptions* other);
   friend void swap(EnumOptions& a, EnumOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(EnumOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(EnumOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline EnumOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  EnumOptions* 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;
+  EnumOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<EnumOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const EnumOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const EnumOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(EnumOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.EnumOptions";
+  }
   protected:
-  explicit EnumOptions(::google::protobuf::Arena* arena);
+  explicit EnumOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+    kAllowAliasFieldNumber = 2,
+    kDeprecatedFieldNumber = 3,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
   // optional bool allow_alias = 2;
   bool has_allow_alias() const;
+  private:
+  bool _internal_has_allow_alias() const;
+  public:
   void clear_allow_alias();
-  static const int kAllowAliasFieldNumber = 2;
   bool allow_alias() const;
   void set_allow_alias(bool value);
+  private:
+  bool _internal_allow_alias() const;
+  void _internal_set_allow_alias(bool value);
+  public:
 
   // optional bool deprecated = 3 [default = false];
   bool has_deprecated() const;
+  private:
+  bool _internal_has_deprecated() const;
+  public:
   void clear_deprecated();
-  static const int kDeprecatedFieldNumber = 3;
   bool deprecated() const;
   void set_deprecated(bool value);
+  private:
+  bool _internal_deprecated() const;
+  void _internal_set_deprecated(bool value);
+  public:
+
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumOptions)
   // @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions)
  private:
-  void set_has_allow_alias();
-  void clear_has_allow_alias();
-  void set_has_deprecated();
-  void clear_has_deprecated();
+  class _Internal;
 
-  ::google::protobuf::internal::ExtensionSet _extensions_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
   bool allow_alias_;
   bool deprecated_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptionsImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueOptions) */ {
+class PROTOBUF_EXPORT EnumValueOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueOptions) */ {
  public:
-  EnumValueOptions();
-  virtual ~EnumValueOptions();
+  inline EnumValueOptions() : EnumValueOptions(nullptr) {}
+  ~EnumValueOptions() override;
+  explicit constexpr EnumValueOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   EnumValueOptions(const EnumValueOptions& from);
-
-  inline EnumValueOptions& operator=(const EnumValueOptions& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   EnumValueOptions(EnumValueOptions&& from) noexcept
     : EnumValueOptions() {
     *this = ::std::move(from);
   }
 
+  inline EnumValueOptions& operator=(const EnumValueOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline EnumValueOptions& operator=(EnumValueOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const EnumValueOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     18;
 
-  void UnsafeArenaSwap(EnumValueOptions* other);
-  void Swap(EnumValueOptions* other);
   friend void swap(EnumValueOptions& a, EnumValueOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(EnumValueOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(EnumValueOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline EnumValueOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  EnumValueOptions* 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;
+  EnumValueOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<EnumValueOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const EnumValueOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const EnumValueOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(EnumValueOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.EnumValueOptions";
+  }
   protected:
-  explicit EnumValueOptions(::google::protobuf::Arena* arena);
+  explicit EnumValueOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+    kDeprecatedFieldNumber = 1,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
   // optional bool deprecated = 1 [default = false];
   bool has_deprecated() const;
+  private:
+  bool _internal_has_deprecated() const;
+  public:
   void clear_deprecated();
-  static const int kDeprecatedFieldNumber = 1;
   bool deprecated() const;
   void set_deprecated(bool value);
+  private:
+  bool _internal_deprecated() const;
+  void _internal_set_deprecated(bool value);
+  public:
+
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumValueOptions)
   // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions)
  private:
-  void set_has_deprecated();
-  void clear_has_deprecated();
+  class _Internal;
 
-  ::google::protobuf::internal::ExtensionSet _extensions_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
   bool deprecated_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptionsImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceOptions) */ {
+class PROTOBUF_EXPORT ServiceOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceOptions) */ {
  public:
-  ServiceOptions();
-  virtual ~ServiceOptions();
+  inline ServiceOptions() : ServiceOptions(nullptr) {}
+  ~ServiceOptions() override;
+  explicit constexpr ServiceOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ServiceOptions(const ServiceOptions& from);
-
-  inline ServiceOptions& operator=(const ServiceOptions& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ServiceOptions(ServiceOptions&& from) noexcept
     : ServiceOptions() {
     *this = ::std::move(from);
   }
 
+  inline ServiceOptions& operator=(const ServiceOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ServiceOptions& operator=(ServiceOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ServiceOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     19;
 
-  void UnsafeArenaSwap(ServiceOptions* other);
-  void Swap(ServiceOptions* other);
   friend void swap(ServiceOptions& a, ServiceOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(ServiceOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ServiceOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ServiceOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ServiceOptions* 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;
+  ServiceOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ServiceOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ServiceOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ServiceOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ServiceOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.ServiceOptions";
+  }
   protected:
-  explicit ServiceOptions(::google::protobuf::Arena* arena);
+  explicit ServiceOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+    kDeprecatedFieldNumber = 33,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
   // optional bool deprecated = 33 [default = false];
   bool has_deprecated() const;
+  private:
+  bool _internal_has_deprecated() const;
+  public:
   void clear_deprecated();
-  static const int kDeprecatedFieldNumber = 33;
   bool deprecated() const;
   void set_deprecated(bool value);
+  private:
+  bool _internal_deprecated() const;
+  void _internal_set_deprecated(bool value);
+  public:
+
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ServiceOptions)
   // @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions)
  private:
-  void set_has_deprecated();
-  void clear_has_deprecated();
+  class _Internal;
 
-  ::google::protobuf::internal::ExtensionSet _extensions_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
   bool deprecated_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptionsImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodOptions) */ {
+class PROTOBUF_EXPORT MethodOptions final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodOptions) */ {
  public:
-  MethodOptions();
-  virtual ~MethodOptions();
+  inline MethodOptions() : MethodOptions(nullptr) {}
+  ~MethodOptions() override;
+  explicit constexpr MethodOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   MethodOptions(const MethodOptions& from);
-
-  inline MethodOptions& operator=(const MethodOptions& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   MethodOptions(MethodOptions&& from) noexcept
     : MethodOptions() {
     *this = ::std::move(from);
   }
 
+  inline MethodOptions& operator=(const MethodOptions& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline MethodOptions& operator=(MethodOptions&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const MethodOptions& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     20;
 
-  void UnsafeArenaSwap(MethodOptions* other);
-  void Swap(MethodOptions* other);
   friend void swap(MethodOptions& a, MethodOptions& b) {
     a.Swap(&b);
   }
+  inline void Swap(MethodOptions* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(MethodOptions* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline MethodOptions* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  MethodOptions* 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;
+  MethodOptions* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<MethodOptions>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const MethodOptions& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const MethodOptions& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(MethodOptions* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.MethodOptions";
+  }
   protected:
-  explicit MethodOptions(::google::protobuf::Arena* arena);
+  explicit MethodOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef MethodOptions_IdempotencyLevel IdempotencyLevel;
-  static const IdempotencyLevel IDEMPOTENCY_UNKNOWN =
+  static constexpr IdempotencyLevel IDEMPOTENCY_UNKNOWN =
     MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN;
-  static const IdempotencyLevel NO_SIDE_EFFECTS =
+  static constexpr IdempotencyLevel NO_SIDE_EFFECTS =
     MethodOptions_IdempotencyLevel_NO_SIDE_EFFECTS;
-  static const IdempotencyLevel IDEMPOTENT =
+  static constexpr IdempotencyLevel IDEMPOTENT =
     MethodOptions_IdempotencyLevel_IDEMPOTENT;
   static inline bool IdempotencyLevel_IsValid(int value) {
     return MethodOptions_IdempotencyLevel_IsValid(value);
   }
-  static const IdempotencyLevel IdempotencyLevel_MIN =
+  static constexpr IdempotencyLevel IdempotencyLevel_MIN =
     MethodOptions_IdempotencyLevel_IdempotencyLevel_MIN;
-  static const IdempotencyLevel IdempotencyLevel_MAX =
+  static constexpr IdempotencyLevel IdempotencyLevel_MAX =
     MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX;
-  static const int IdempotencyLevel_ARRAYSIZE =
+  static constexpr int IdempotencyLevel_ARRAYSIZE =
     MethodOptions_IdempotencyLevel_IdempotencyLevel_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   IdempotencyLevel_descriptor() {
     return MethodOptions_IdempotencyLevel_descriptor();
   }
-  static inline const ::std::string& IdempotencyLevel_Name(IdempotencyLevel value) {
-    return MethodOptions_IdempotencyLevel_Name(value);
+  template<typename T>
+  static inline const std::string& IdempotencyLevel_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, IdempotencyLevel>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function IdempotencyLevel_Name.");
+    return MethodOptions_IdempotencyLevel_Name(enum_t_value);
   }
-  static inline bool IdempotencyLevel_Parse(const ::std::string& name,
+  static inline bool IdempotencyLevel_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       IdempotencyLevel* value) {
     return MethodOptions_IdempotencyLevel_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUninterpretedOptionFieldNumber = 999,
+    kDeprecatedFieldNumber = 33,
+    kIdempotencyLevelFieldNumber = 34,
+  };
   // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
   int uninterpreted_option_size() const;
+  private:
+  int _internal_uninterpreted_option_size() const;
+  public:
   void clear_uninterpreted_option();
-  static const int kUninterpretedOptionFieldNumber = 999;
-  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;
-  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);
-  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* mutable_uninterpreted_option(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
       mutable_uninterpreted_option();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& _internal_uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _internal_add_uninterpreted_option();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& uninterpreted_option(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* add_uninterpreted_option();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
       uninterpreted_option() const;
 
   // optional bool deprecated = 33 [default = false];
   bool has_deprecated() const;
+  private:
+  bool _internal_has_deprecated() const;
+  public:
   void clear_deprecated();
-  static const int kDeprecatedFieldNumber = 33;
   bool deprecated() const;
   void set_deprecated(bool value);
+  private:
+  bool _internal_deprecated() const;
+  void _internal_set_deprecated(bool value);
+  public:
 
   // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];
   bool has_idempotency_level() const;
+  private:
+  bool _internal_has_idempotency_level() const;
+  public:
   void clear_idempotency_level();
-  static const int kIdempotencyLevelFieldNumber = 34;
-  ::google::protobuf::MethodOptions_IdempotencyLevel idempotency_level() const;
-  void set_idempotency_level(::google::protobuf::MethodOptions_IdempotencyLevel value);
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel idempotency_level() const;
+  void set_idempotency_level(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel _internal_idempotency_level() const;
+  void _internal_set_idempotency_level(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel value);
+  public:
+
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MethodOptions)
   // @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions)
  private:
-  void set_has_deprecated();
-  void clear_has_deprecated();
-  void set_has_idempotency_level();
-  void clear_has_idempotency_level();
+  class _Internal;
 
-  ::google::protobuf::internal::ExtensionSet _extensions_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_;
   bool deprecated_;
   int idempotency_level_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptionsImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption.NamePart) */ {
+class PROTOBUF_EXPORT UninterpretedOption_NamePart final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption.NamePart) */ {
  public:
-  UninterpretedOption_NamePart();
-  virtual ~UninterpretedOption_NamePart();
+  inline UninterpretedOption_NamePart() : UninterpretedOption_NamePart(nullptr) {}
+  ~UninterpretedOption_NamePart() override;
+  explicit constexpr UninterpretedOption_NamePart(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   UninterpretedOption_NamePart(const UninterpretedOption_NamePart& from);
-
-  inline UninterpretedOption_NamePart& operator=(const UninterpretedOption_NamePart& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   UninterpretedOption_NamePart(UninterpretedOption_NamePart&& from) noexcept
     : UninterpretedOption_NamePart() {
     *this = ::std::move(from);
   }
-
+
+  inline UninterpretedOption_NamePart& operator=(const UninterpretedOption_NamePart& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline UninterpretedOption_NamePart& operator=(UninterpretedOption_NamePart&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const UninterpretedOption_NamePart& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     21;
 
-  void UnsafeArenaSwap(UninterpretedOption_NamePart* other);
-  void Swap(UninterpretedOption_NamePart* other);
   friend void swap(UninterpretedOption_NamePart& a, UninterpretedOption_NamePart& b) {
     a.Swap(&b);
   }
+  inline void Swap(UninterpretedOption_NamePart* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(UninterpretedOption_NamePart* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline UninterpretedOption_NamePart* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  UninterpretedOption_NamePart* 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;
+  UninterpretedOption_NamePart* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<UninterpretedOption_NamePart>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const UninterpretedOption_NamePart& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const UninterpretedOption_NamePart& from);
-  void 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(UninterpretedOption_NamePart* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.UninterpretedOption.NamePart";
+  }
   protected:
-  explicit UninterpretedOption_NamePart(::google::protobuf::Arena* arena);
+  explicit UninterpretedOption_NamePart(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNamePartFieldNumber = 1,
+    kIsExtensionFieldNumber = 2,
+  };
   // required string name_part = 1;
   bool has_name_part() const;
+  private:
+  bool _internal_has_name_part() const;
+  public:
   void clear_name_part();
-  static const int kNamePartFieldNumber = 1;
-  const ::std::string& name_part() const;
-  void set_name_part(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name_part(::std::string&& value);
-  #endif
-  void set_name_part(const char* value);
-  void set_name_part(const char* value, size_t size);
-  ::std::string* mutable_name_part();
-  ::std::string* release_name_part();
-  void set_allocated_name_part(::std::string* name_part);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name_part();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name_part(
-      ::std::string* name_part);
+  const std::string& name_part() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name_part(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name_part();
+  PROTOBUF_NODISCARD std::string* release_name_part();
+  void set_allocated_name_part(std::string* name_part);
+  private:
+  const std::string& _internal_name_part() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name_part(const std::string& value);
+  std::string* _internal_mutable_name_part();
+  public:
 
   // required bool is_extension = 2;
   bool has_is_extension() const;
+  private:
+  bool _internal_has_is_extension() const;
+  public:
   void clear_is_extension();
-  static const int kIsExtensionFieldNumber = 2;
   bool is_extension() const;
   void set_is_extension(bool value);
+  private:
+  bool _internal_is_extension() const;
+  void _internal_set_is_extension(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption.NamePart)
  private:
-  void set_has_name_part();
-  void clear_has_name_part();
-  void set_has_is_extension();
-  void clear_has_is_extension();
+  class _Internal;
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_part_;
   bool is_extension_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption_NamePartImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption) */ {
+class PROTOBUF_EXPORT UninterpretedOption final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption) */ {
  public:
-  UninterpretedOption();
-  virtual ~UninterpretedOption();
+  inline UninterpretedOption() : UninterpretedOption(nullptr) {}
+  ~UninterpretedOption() override;
+  explicit constexpr UninterpretedOption(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   UninterpretedOption(const UninterpretedOption& from);
-
-  inline UninterpretedOption& operator=(const UninterpretedOption& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   UninterpretedOption(UninterpretedOption&& from) noexcept
     : UninterpretedOption() {
     *this = ::std::move(from);
   }
 
+  inline UninterpretedOption& operator=(const UninterpretedOption& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline UninterpretedOption& operator=(UninterpretedOption&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const UninterpretedOption& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     22;
 
-  void UnsafeArenaSwap(UninterpretedOption* other);
-  void Swap(UninterpretedOption* other);
   friend void swap(UninterpretedOption& a, UninterpretedOption& b) {
     a.Swap(&b);
   }
+  inline void Swap(UninterpretedOption* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(UninterpretedOption* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline UninterpretedOption* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  UninterpretedOption* 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;
+  UninterpretedOption* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<UninterpretedOption>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const UninterpretedOption& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const UninterpretedOption& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(UninterpretedOption* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.UninterpretedOption";
+  }
   protected:
-  explicit UninterpretedOption(::google::protobuf::Arena* arena);
+  explicit UninterpretedOption(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -4880,460 +7521,528 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 2,
+    kIdentifierValueFieldNumber = 3,
+    kStringValueFieldNumber = 7,
+    kAggregateValueFieldNumber = 8,
+    kPositiveIntValueFieldNumber = 4,
+    kNegativeIntValueFieldNumber = 5,
+    kDoubleValueFieldNumber = 6,
+  };
   // repeated .google.protobuf.UninterpretedOption.NamePart name = 2;
   int name_size() const;
+  private:
+  int _internal_name_size() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 2;
-  const ::google::protobuf::UninterpretedOption_NamePart& name(int index) const;
-  ::google::protobuf::UninterpretedOption_NamePart* mutable_name(int index);
-  ::google::protobuf::UninterpretedOption_NamePart* add_name();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >*
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* mutable_name(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart >*
       mutable_name();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart& _internal_name(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* _internal_add_name();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart& name(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* add_name();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart >&
       name() const;
 
   // optional string identifier_value = 3;
   bool has_identifier_value() const;
+  private:
+  bool _internal_has_identifier_value() const;
+  public:
   void clear_identifier_value();
-  static const int kIdentifierValueFieldNumber = 3;
-  const ::std::string& identifier_value() const;
-  void set_identifier_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_identifier_value(::std::string&& value);
-  #endif
-  void set_identifier_value(const char* value);
-  void set_identifier_value(const char* value, size_t size);
-  ::std::string* mutable_identifier_value();
-  ::std::string* release_identifier_value();
-  void set_allocated_identifier_value(::std::string* identifier_value);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_identifier_value();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_identifier_value(
-      ::std::string* identifier_value);
+  const std::string& identifier_value() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_identifier_value(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_identifier_value();
+  PROTOBUF_NODISCARD std::string* release_identifier_value();
+  void set_allocated_identifier_value(std::string* identifier_value);
+  private:
+  const std::string& _internal_identifier_value() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_identifier_value(const std::string& value);
+  std::string* _internal_mutable_identifier_value();
+  public:
 
   // optional bytes string_value = 7;
   bool has_string_value() const;
+  private:
+  bool _internal_has_string_value() const;
+  public:
   void clear_string_value();
-  static const int kStringValueFieldNumber = 7;
-  const ::std::string& string_value() const;
-  void set_string_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_string_value(::std::string&& value);
-  #endif
-  void set_string_value(const char* value);
-  void set_string_value(const void* value, size_t size);
-  ::std::string* mutable_string_value();
-  ::std::string* release_string_value();
-  void set_allocated_string_value(::std::string* string_value);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_string_value();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_string_value(
-      ::std::string* string_value);
+  const std::string& string_value() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_string_value(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_string_value();
+  PROTOBUF_NODISCARD std::string* release_string_value();
+  void set_allocated_string_value(std::string* string_value);
+  private:
+  const std::string& _internal_string_value() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_string_value(const std::string& value);
+  std::string* _internal_mutable_string_value();
+  public:
 
   // optional string aggregate_value = 8;
   bool has_aggregate_value() const;
+  private:
+  bool _internal_has_aggregate_value() const;
+  public:
   void clear_aggregate_value();
-  static const int kAggregateValueFieldNumber = 8;
-  const ::std::string& aggregate_value() const;
-  void set_aggregate_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_aggregate_value(::std::string&& value);
-  #endif
-  void set_aggregate_value(const char* value);
-  void set_aggregate_value(const char* value, size_t size);
-  ::std::string* mutable_aggregate_value();
-  ::std::string* release_aggregate_value();
-  void set_allocated_aggregate_value(::std::string* aggregate_value);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_aggregate_value();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_aggregate_value(
-      ::std::string* aggregate_value);
+  const std::string& aggregate_value() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_aggregate_value(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_aggregate_value();
+  PROTOBUF_NODISCARD std::string* release_aggregate_value();
+  void set_allocated_aggregate_value(std::string* aggregate_value);
+  private:
+  const std::string& _internal_aggregate_value() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_aggregate_value(const std::string& value);
+  std::string* _internal_mutable_aggregate_value();
+  public:
 
   // optional uint64 positive_int_value = 4;
   bool has_positive_int_value() const;
+  private:
+  bool _internal_has_positive_int_value() const;
+  public:
   void clear_positive_int_value();
-  static const int kPositiveIntValueFieldNumber = 4;
-  ::google::protobuf::uint64 positive_int_value() const;
-  void set_positive_int_value(::google::protobuf::uint64 value);
+  uint64_t positive_int_value() const;
+  void set_positive_int_value(uint64_t value);
+  private:
+  uint64_t _internal_positive_int_value() const;
+  void _internal_set_positive_int_value(uint64_t value);
+  public:
 
   // optional int64 negative_int_value = 5;
   bool has_negative_int_value() const;
+  private:
+  bool _internal_has_negative_int_value() const;
+  public:
   void clear_negative_int_value();
-  static const int kNegativeIntValueFieldNumber = 5;
-  ::google::protobuf::int64 negative_int_value() const;
-  void set_negative_int_value(::google::protobuf::int64 value);
+  int64_t negative_int_value() const;
+  void set_negative_int_value(int64_t value);
+  private:
+  int64_t _internal_negative_int_value() const;
+  void _internal_set_negative_int_value(int64_t value);
+  public:
 
   // optional double double_value = 6;
   bool has_double_value() const;
+  private:
+  bool _internal_has_double_value() const;
+  public:
   void clear_double_value();
-  static const int kDoubleValueFieldNumber = 6;
   double double_value() const;
   void set_double_value(double value);
+  private:
+  double _internal_double_value() const;
+  void _internal_set_double_value(double value);
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption)
  private:
-  void set_has_identifier_value();
-  void clear_has_identifier_value();
-  void set_has_positive_int_value();
-  void clear_has_positive_int_value();
-  void set_has_negative_int_value();
-  void clear_has_negative_int_value();
-  void set_has_double_value();
-  void clear_has_double_value();
-  void set_has_string_value();
-  void clear_has_string_value();
-  void set_has_aggregate_value();
-  void clear_has_aggregate_value();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
-  ::google::protobuf::internal::ArenaStringPtr identifier_value_;
-  ::google::protobuf::internal::ArenaStringPtr string_value_;
-  ::google::protobuf::internal::ArenaStringPtr aggregate_value_;
-  ::google::protobuf::uint64 positive_int_value_;
-  ::google::protobuf::int64 negative_int_value_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart > name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr identifier_value_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr string_value_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr aggregate_value_;
+  uint64_t positive_int_value_;
+  int64_t negative_int_value_;
   double double_value_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOptionImpl();
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo.Location) */ {
+class PROTOBUF_EXPORT SourceCodeInfo_Location final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo.Location) */ {
  public:
-  SourceCodeInfo_Location();
-  virtual ~SourceCodeInfo_Location();
+  inline SourceCodeInfo_Location() : SourceCodeInfo_Location(nullptr) {}
+  ~SourceCodeInfo_Location() override;
+  explicit constexpr SourceCodeInfo_Location(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SourceCodeInfo_Location(const SourceCodeInfo_Location& from);
-
-  inline SourceCodeInfo_Location& operator=(const SourceCodeInfo_Location& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SourceCodeInfo_Location(SourceCodeInfo_Location&& from) noexcept
     : SourceCodeInfo_Location() {
     *this = ::std::move(from);
   }
 
+  inline SourceCodeInfo_Location& operator=(const SourceCodeInfo_Location& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SourceCodeInfo_Location& operator=(SourceCodeInfo_Location&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SourceCodeInfo_Location& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     23;
 
-  void UnsafeArenaSwap(SourceCodeInfo_Location* other);
-  void Swap(SourceCodeInfo_Location* other);
   friend void swap(SourceCodeInfo_Location& a, SourceCodeInfo_Location& b) {
     a.Swap(&b);
   }
+  inline void Swap(SourceCodeInfo_Location* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SourceCodeInfo_Location* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SourceCodeInfo_Location* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SourceCodeInfo_Location* 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;
+  SourceCodeInfo_Location* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SourceCodeInfo_Location>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SourceCodeInfo_Location& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SourceCodeInfo_Location& from);
-  void 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SourceCodeInfo_Location* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.SourceCodeInfo.Location";
+  }
   protected:
-  explicit SourceCodeInfo_Location(::google::protobuf::Arena* arena);
+  explicit SourceCodeInfo_Location(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kPathFieldNumber = 1,
+    kSpanFieldNumber = 2,
+    kLeadingDetachedCommentsFieldNumber = 6,
+    kLeadingCommentsFieldNumber = 3,
+    kTrailingCommentsFieldNumber = 4,
+  };
   // repeated int32 path = 1 [packed = true];
   int path_size() const;
+  private:
+  int _internal_path_size() const;
+  public:
   void clear_path();
-  static const int kPathFieldNumber = 1;
-  ::google::protobuf::int32 path(int index) const;
-  void set_path(int index, ::google::protobuf::int32 value);
-  void add_path(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_path(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_path() const;
+  void _internal_add_path(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_path();
+  public:
+  int32_t path(int index) const;
+  void set_path(int index, int32_t value);
+  void add_path(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       path() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_path();
 
   // repeated int32 span = 2 [packed = true];
   int span_size() const;
+  private:
+  int _internal_span_size() const;
+  public:
   void clear_span();
-  static const int kSpanFieldNumber = 2;
-  ::google::protobuf::int32 span(int index) const;
-  void set_span(int index, ::google::protobuf::int32 value);
-  void add_span(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_span(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_span() const;
+  void _internal_add_span(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_span();
+  public:
+  int32_t span(int index) const;
+  void set_span(int index, int32_t value);
+  void add_span(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       span() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_span();
 
   // repeated string leading_detached_comments = 6;
   int leading_detached_comments_size() const;
+  private:
+  int _internal_leading_detached_comments_size() const;
+  public:
   void clear_leading_detached_comments();
-  static const int kLeadingDetachedCommentsFieldNumber = 6;
-  const ::std::string& leading_detached_comments(int index) const;
-  ::std::string* mutable_leading_detached_comments(int index);
-  void set_leading_detached_comments(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_leading_detached_comments(int index, ::std::string&& value);
-  #endif
+  const std::string& leading_detached_comments(int index) const;
+  std::string* mutable_leading_detached_comments(int index);
+  void set_leading_detached_comments(int index, const std::string& value);
+  void set_leading_detached_comments(int index, std::string&& value);
   void set_leading_detached_comments(int index, const char* value);
   void set_leading_detached_comments(int index, const char* value, size_t size);
-  ::std::string* add_leading_detached_comments();
-  void add_leading_detached_comments(const ::std::string& value);
-  #if LANG_CXX11
-  void add_leading_detached_comments(::std::string&& value);
-  #endif
+  std::string* add_leading_detached_comments();
+  void add_leading_detached_comments(const std::string& value);
+  void add_leading_detached_comments(std::string&& value);
   void add_leading_detached_comments(const char* value);
   void add_leading_detached_comments(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& leading_detached_comments() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_leading_detached_comments();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& leading_detached_comments() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_leading_detached_comments();
+  private:
+  const std::string& _internal_leading_detached_comments(int index) const;
+  std::string* _internal_add_leading_detached_comments();
+  public:
 
   // optional string leading_comments = 3;
   bool has_leading_comments() const;
+  private:
+  bool _internal_has_leading_comments() const;
+  public:
   void clear_leading_comments();
-  static const int kLeadingCommentsFieldNumber = 3;
-  const ::std::string& leading_comments() const;
-  void set_leading_comments(const ::std::string& value);
-  #if LANG_CXX11
-  void set_leading_comments(::std::string&& value);
-  #endif
-  void set_leading_comments(const char* value);
-  void set_leading_comments(const char* value, size_t size);
-  ::std::string* mutable_leading_comments();
-  ::std::string* release_leading_comments();
-  void set_allocated_leading_comments(::std::string* leading_comments);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_leading_comments();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_leading_comments(
-      ::std::string* leading_comments);
+  const std::string& leading_comments() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_leading_comments(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_leading_comments();
+  PROTOBUF_NODISCARD std::string* release_leading_comments();
+  void set_allocated_leading_comments(std::string* leading_comments);
+  private:
+  const std::string& _internal_leading_comments() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_leading_comments(const std::string& value);
+  std::string* _internal_mutable_leading_comments();
+  public:
 
   // optional string trailing_comments = 4;
   bool has_trailing_comments() const;
+  private:
+  bool _internal_has_trailing_comments() const;
+  public:
   void clear_trailing_comments();
-  static const int kTrailingCommentsFieldNumber = 4;
-  const ::std::string& trailing_comments() const;
-  void set_trailing_comments(const ::std::string& value);
-  #if LANG_CXX11
-  void set_trailing_comments(::std::string&& value);
-  #endif
-  void set_trailing_comments(const char* value);
-  void set_trailing_comments(const char* value, size_t size);
-  ::std::string* mutable_trailing_comments();
-  ::std::string* release_trailing_comments();
-  void set_allocated_trailing_comments(::std::string* trailing_comments);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_trailing_comments();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_trailing_comments(
-      ::std::string* trailing_comments);
+  const std::string& trailing_comments() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_trailing_comments(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_trailing_comments();
+  PROTOBUF_NODISCARD std::string* release_trailing_comments();
+  void set_allocated_trailing_comments(std::string* trailing_comments);
+  private:
+  const std::string& _internal_trailing_comments() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_trailing_comments(const std::string& value);
+  std::string* _internal_mutable_trailing_comments();
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location)
  private:
-  void set_has_leading_comments();
-  void clear_has_leading_comments();
-  void set_has_trailing_comments();
-  void clear_has_trailing_comments();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
-  mutable int _path_cached_byte_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > span_;
-  mutable int _span_cached_byte_size_;
-  ::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_LocationImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > path_;
+  mutable std::atomic<int> _path_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > span_;
+  mutable std::atomic<int> _span_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> leading_detached_comments_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr leading_comments_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr trailing_comments_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo) */ {
+class PROTOBUF_EXPORT SourceCodeInfo final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo) */ {
  public:
-  SourceCodeInfo();
-  virtual ~SourceCodeInfo();
+  inline SourceCodeInfo() : SourceCodeInfo(nullptr) {}
+  ~SourceCodeInfo() override;
+  explicit constexpr SourceCodeInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SourceCodeInfo(const SourceCodeInfo& from);
-
-  inline SourceCodeInfo& operator=(const SourceCodeInfo& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SourceCodeInfo(SourceCodeInfo&& from) noexcept
     : SourceCodeInfo() {
     *this = ::std::move(from);
   }
 
+  inline SourceCodeInfo& operator=(const SourceCodeInfo& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SourceCodeInfo& operator=(SourceCodeInfo&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SourceCodeInfo& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     24;
 
-  void UnsafeArenaSwap(SourceCodeInfo* other);
-  void Swap(SourceCodeInfo* other);
   friend void swap(SourceCodeInfo& a, SourceCodeInfo& b) {
     a.Swap(&b);
   }
+  inline void Swap(SourceCodeInfo* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SourceCodeInfo* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SourceCodeInfo* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SourceCodeInfo* 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;
+  SourceCodeInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SourceCodeInfo>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SourceCodeInfo& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SourceCodeInfo& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SourceCodeInfo* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.SourceCodeInfo";
+  }
   protected:
-  explicit SourceCodeInfo(::google::protobuf::Arena* arena);
+  explicit SourceCodeInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -5341,305 +8050,381 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /*
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kLocationFieldNumber = 1,
+  };
   // repeated .google.protobuf.SourceCodeInfo.Location location = 1;
   int location_size() const;
+  private:
+  int _internal_location_size() const;
+  public:
   void clear_location();
-  static const int kLocationFieldNumber = 1;
-  const ::google::protobuf::SourceCodeInfo_Location& location(int index) const;
-  ::google::protobuf::SourceCodeInfo_Location* mutable_location(int index);
-  ::google::protobuf::SourceCodeInfo_Location* add_location();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >*
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* mutable_location(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location >*
       mutable_location();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location& _internal_location(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* _internal_add_location();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location& location(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* add_location();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location >&
       location() const;
 
   // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfoImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location > location_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo.Annotation) */ {
+class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo.Annotation) */ {
  public:
-  GeneratedCodeInfo_Annotation();
-  virtual ~GeneratedCodeInfo_Annotation();
+  inline GeneratedCodeInfo_Annotation() : GeneratedCodeInfo_Annotation(nullptr) {}
+  ~GeneratedCodeInfo_Annotation() override;
+  explicit constexpr GeneratedCodeInfo_Annotation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   GeneratedCodeInfo_Annotation(const GeneratedCodeInfo_Annotation& from);
-
-  inline GeneratedCodeInfo_Annotation& operator=(const GeneratedCodeInfo_Annotation& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   GeneratedCodeInfo_Annotation(GeneratedCodeInfo_Annotation&& from) noexcept
     : GeneratedCodeInfo_Annotation() {
     *this = ::std::move(from);
   }
 
+  inline GeneratedCodeInfo_Annotation& operator=(const GeneratedCodeInfo_Annotation& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline GeneratedCodeInfo_Annotation& operator=(GeneratedCodeInfo_Annotation&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const GeneratedCodeInfo_Annotation& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     25;
 
-  void UnsafeArenaSwap(GeneratedCodeInfo_Annotation* other);
-  void Swap(GeneratedCodeInfo_Annotation* other);
   friend void swap(GeneratedCodeInfo_Annotation& a, GeneratedCodeInfo_Annotation& b) {
     a.Swap(&b);
   }
+  inline void Swap(GeneratedCodeInfo_Annotation* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(GeneratedCodeInfo_Annotation* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline GeneratedCodeInfo_Annotation* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  GeneratedCodeInfo_Annotation* 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;
+  GeneratedCodeInfo_Annotation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<GeneratedCodeInfo_Annotation>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const GeneratedCodeInfo_Annotation& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const GeneratedCodeInfo_Annotation& from);
-  void 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(GeneratedCodeInfo_Annotation* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.GeneratedCodeInfo.Annotation";
+  }
   protected:
-  explicit GeneratedCodeInfo_Annotation(::google::protobuf::Arena* arena);
+  explicit GeneratedCodeInfo_Annotation(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kPathFieldNumber = 1,
+    kSourceFileFieldNumber = 2,
+    kBeginFieldNumber = 3,
+    kEndFieldNumber = 4,
+  };
   // repeated int32 path = 1 [packed = true];
   int path_size() const;
+  private:
+  int _internal_path_size() const;
+  public:
   void clear_path();
-  static const int kPathFieldNumber = 1;
-  ::google::protobuf::int32 path(int index) const;
-  void set_path(int index, ::google::protobuf::int32 value);
-  void add_path(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_path(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_path() const;
+  void _internal_add_path(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_path();
+  public:
+  int32_t path(int index) const;
+  void set_path(int index, int32_t value);
+  void add_path(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       path() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_path();
 
   // optional string source_file = 2;
   bool has_source_file() const;
+  private:
+  bool _internal_has_source_file() const;
+  public:
   void clear_source_file();
-  static const int kSourceFileFieldNumber = 2;
-  const ::std::string& source_file() const;
-  void set_source_file(const ::std::string& value);
-  #if LANG_CXX11
-  void set_source_file(::std::string&& value);
-  #endif
-  void set_source_file(const char* value);
-  void set_source_file(const char* value, size_t size);
-  ::std::string* mutable_source_file();
-  ::std::string* release_source_file();
-  void set_allocated_source_file(::std::string* source_file);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_source_file();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_source_file(
-      ::std::string* source_file);
+  const std::string& source_file() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_source_file(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_source_file();
+  PROTOBUF_NODISCARD std::string* release_source_file();
+  void set_allocated_source_file(std::string* source_file);
+  private:
+  const std::string& _internal_source_file() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_source_file(const std::string& value);
+  std::string* _internal_mutable_source_file();
+  public:
 
   // optional int32 begin = 3;
   bool has_begin() const;
+  private:
+  bool _internal_has_begin() const;
+  public:
   void clear_begin();
-  static const int kBeginFieldNumber = 3;
-  ::google::protobuf::int32 begin() const;
-  void set_begin(::google::protobuf::int32 value);
+  int32_t begin() const;
+  void set_begin(int32_t value);
+  private:
+  int32_t _internal_begin() const;
+  void _internal_set_begin(int32_t value);
+  public:
 
   // optional int32 end = 4;
   bool has_end() const;
+  private:
+  bool _internal_has_end() const;
+  public:
   void clear_end();
-  static const int kEndFieldNumber = 4;
-  ::google::protobuf::int32 end() const;
-  void set_end(::google::protobuf::int32 value);
+  int32_t end() const;
+  void set_end(int32_t value);
+  private:
+  int32_t _internal_end() const;
+  void _internal_set_end(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo.Annotation)
  private:
-  void set_has_source_file();
-  void clear_has_source_file();
-  void set_has_begin();
-  void clear_has_begin();
-  void set_has_end();
-  void clear_has_end();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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_;
-  mutable int _path_cached_byte_size_;
-  ::google::protobuf::internal::ArenaStringPtr source_file_;
-  ::google::protobuf::int32 begin_;
-  ::google::protobuf::int32 end_;
-  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_AnnotationImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > path_;
+  mutable std::atomic<int> _path_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_file_;
+  int32_t begin_;
+  int32_t end_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo) */ {
+class PROTOBUF_EXPORT GeneratedCodeInfo final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo) */ {
  public:
-  GeneratedCodeInfo();
-  virtual ~GeneratedCodeInfo();
+  inline GeneratedCodeInfo() : GeneratedCodeInfo(nullptr) {}
+  ~GeneratedCodeInfo() override;
+  explicit constexpr GeneratedCodeInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   GeneratedCodeInfo(const GeneratedCodeInfo& from);
-
-  inline GeneratedCodeInfo& operator=(const GeneratedCodeInfo& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   GeneratedCodeInfo(GeneratedCodeInfo&& from) noexcept
     : GeneratedCodeInfo() {
     *this = ::std::move(from);
   }
 
+  inline GeneratedCodeInfo& operator=(const GeneratedCodeInfo& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline GeneratedCodeInfo& operator=(GeneratedCodeInfo&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const GeneratedCodeInfo& default_instance() {
+    return *internal_default_instance();
   }
-  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 =
+  static constexpr int kIndexInFileMessages =
     26;
 
-  void UnsafeArenaSwap(GeneratedCodeInfo* other);
-  void Swap(GeneratedCodeInfo* other);
   friend void swap(GeneratedCodeInfo& a, GeneratedCodeInfo& b) {
     a.Swap(&b);
   }
+  inline void Swap(GeneratedCodeInfo* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(GeneratedCodeInfo* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline GeneratedCodeInfo* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  GeneratedCodeInfo* 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;
+  GeneratedCodeInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<GeneratedCodeInfo>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const GeneratedCodeInfo& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const GeneratedCodeInfo& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(GeneratedCodeInfo* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.GeneratedCodeInfo";
+  }
   protected:
-  explicit GeneratedCodeInfo(::google::protobuf::Arena* arena);
+  explicit GeneratedCodeInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -5647,30 +8432,37 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kAnnotationFieldNumber = 1,
+  };
   // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;
   int annotation_size() const;
+  private:
+  int _internal_annotation_size() const;
+  public:
   void clear_annotation();
-  static const int kAnnotationFieldNumber = 1;
-  const ::google::protobuf::GeneratedCodeInfo_Annotation& annotation(int index) const;
-  ::google::protobuf::GeneratedCodeInfo_Annotation* mutable_annotation(int index);
-  ::google::protobuf::GeneratedCodeInfo_Annotation* add_annotation();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >*
+  ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* mutable_annotation(int index);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation >*
       mutable_annotation();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation& _internal_annotation(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* _internal_add_annotation();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation& annotation(int index) const;
+  ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* add_annotation();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation >&
       annotation() const;
 
   // @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::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 void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfoImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation > annotation_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto;
 };
 // ===================================================================
 
@@ -5684,30 +8476,40 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message
 // FileDescriptorSet
 
 // repeated .google.protobuf.FileDescriptorProto file = 1;
-inline int FileDescriptorSet::file_size() const {
+inline int FileDescriptorSet::_internal_file_size() const {
   return file_.size();
 }
+inline int FileDescriptorSet::file_size() const {
+  return _internal_file_size();
+}
 inline void FileDescriptorSet::clear_file() {
   file_.Clear();
 }
-inline const ::google::protobuf::FileDescriptorProto& FileDescriptorSet::file(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorSet.file)
-  return file_.Get(index);
-}
-inline ::google::protobuf::FileDescriptorProto* FileDescriptorSet::mutable_file(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* FileDescriptorSet::mutable_file(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorSet.file)
   return file_.Mutable(index);
 }
-inline ::google::protobuf::FileDescriptorProto* FileDescriptorSet::add_file() {
-  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorSet.file)
-  return file_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >*
 FileDescriptorSet::mutable_file() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorSet.file)
   return &file_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& FileDescriptorSet::_internal_file(int index) const {
+  return file_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& FileDescriptorSet::file(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorSet.file)
+  return _internal_file(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* FileDescriptorSet::_internal_add_file() {
+  return file_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* FileDescriptorSet::add_file() {
+  ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* _add = _internal_add_file();
+  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorSet.file)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >&
 FileDescriptorSet::file() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorSet.file)
   return file_;
@@ -5718,202 +8520,179 @@ FileDescriptorSet::file() const {
 // FileDescriptorProto
 
 // optional string name = 1;
-inline bool FileDescriptorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void FileDescriptorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool FileDescriptorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void FileDescriptorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool FileDescriptorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void FileDescriptorProto::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& FileDescriptorProto::name() const {
+inline const std::string& FileDescriptorProto::name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void FileDescriptorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.name)
 }
-#if LANG_CXX11
-inline void FileDescriptorProto::set_name(::std::string&& value) {
-  set_has_name();
-  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_.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) {
-  set_has_name();
-  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();
+inline std::string* FileDescriptorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FileDescriptorProto::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name)
-  clear_has_name();
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FileDescriptorProto::_internal_name() const {
+  return name_.Get();
 }
-inline void FileDescriptorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
-  } else {
-    clear_has_name();
+inline void FileDescriptorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FileDescriptorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FileDescriptorProto::release_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name)
+  if (!_internal_has_name()) {
+    return nullptr;
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-    set_has_name();
+inline void FileDescriptorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.name)
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name)
 }
 
 // optional string package = 2;
-inline bool FileDescriptorProto::has_package() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void FileDescriptorProto::set_has_package() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool FileDescriptorProto::_internal_has_package() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void FileDescriptorProto::clear_has_package() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool FileDescriptorProto::has_package() const {
+  return _internal_has_package();
 }
 inline void FileDescriptorProto::clear_package() {
-  package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_package();
+  package_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& FileDescriptorProto::package() const {
+inline const std::string& FileDescriptorProto::package() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.package)
-  return package_.Get();
+  return _internal_package();
 }
-inline void FileDescriptorProto::set_package(const ::std::string& value) {
-  set_has_package();
-  package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileDescriptorProto::set_package(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.package)
 }
-#if LANG_CXX11
-inline void FileDescriptorProto::set_package(::std::string&& value) {
-  set_has_package();
-  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_.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) {
-  set_has_package();
-  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();
+inline std::string* FileDescriptorProto::mutable_package() {
+  std::string* _s = _internal_mutable_package();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.package)
-  return package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FileDescriptorProto::release_package() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package)
-  clear_has_package();
-  return package_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FileDescriptorProto::_internal_package() const {
+  return package_.Get();
 }
-inline void FileDescriptorProto::set_allocated_package(::std::string* package) {
-  if (package != NULL) {
-    set_has_package();
-  } else {
-    clear_has_package();
+inline void FileDescriptorProto::_internal_set_package(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FileDescriptorProto::_internal_mutable_package() {
+  _has_bits_[0] |= 0x00000002u;
+  return package_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FileDescriptorProto::release_package() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package)
+  if (!_internal_has_package()) {
+    return nullptr;
   }
-  package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), package,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package)
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = package_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_package(
-    ::std::string* package) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (package != NULL) {
-    set_has_package();
+inline void FileDescriptorProto::set_allocated_package(std::string* package) {
+  if (package != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_package();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      package, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.package)
+  package_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), package,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package)
 }
 
 // repeated string dependency = 3;
-inline int FileDescriptorProto::dependency_size() const {
+inline int FileDescriptorProto::_internal_dependency_size() const {
   return dependency_.size();
 }
+inline int FileDescriptorProto::dependency_size() const {
+  return _internal_dependency_size();
+}
 inline void FileDescriptorProto::clear_dependency() {
   dependency_.Clear();
 }
-inline const ::std::string& FileDescriptorProto::dependency(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.dependency)
+inline std::string* FileDescriptorProto::add_dependency() {
+  std::string* _s = _internal_add_dependency();
+  // @@protoc_insertion_point(field_add_mutable:google.protobuf.FileDescriptorProto.dependency)
+  return _s;
+}
+inline const std::string& FileDescriptorProto::_internal_dependency(int index) const {
   return dependency_.Get(index);
 }
-inline ::std::string* FileDescriptorProto::mutable_dependency(int index) {
+inline const std::string& FileDescriptorProto::dependency(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.dependency)
+  return _internal_dependency(index);
+}
+inline std::string* FileDescriptorProto::mutable_dependency(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.dependency)
   return dependency_.Mutable(index);
 }
-inline void FileDescriptorProto::set_dependency(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency)
+inline void FileDescriptorProto::set_dependency(int index, const std::string& value) {
   dependency_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void FileDescriptorProto::set_dependency(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency)
+}
+inline void FileDescriptorProto::set_dependency(int index, std::string&& value) {
   dependency_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency)
 }
-#endif
 inline void FileDescriptorProto::set_dependency(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   dependency_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency)
 }
@@ -5922,22 +8701,19 @@ inline void FileDescriptorProto::set_dependency(int index, const char* value, si
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.dependency)
 }
-inline ::std::string* FileDescriptorProto::add_dependency() {
-  // @@protoc_insertion_point(field_add_mutable:google.protobuf.FileDescriptorProto.dependency)
+inline std::string* FileDescriptorProto::_internal_add_dependency() {
   return dependency_.Add();
 }
-inline void FileDescriptorProto::add_dependency(const ::std::string& value) {
+inline void FileDescriptorProto::add_dependency(const std::string& value) {
   dependency_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency)
 }
-#if LANG_CXX11
-inline void FileDescriptorProto::add_dependency(::std::string&& value) {
+inline void FileDescriptorProto::add_dependency(std::string&& value) {
   dependency_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency)
 }
-#endif
 inline void FileDescriptorProto::add_dependency(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   dependency_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency)
 }
@@ -5945,410 +8721,518 @@ inline 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)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 FileDescriptorProto::dependency() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.dependency)
   return dependency_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 FileDescriptorProto::mutable_dependency() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.dependency)
   return &dependency_;
 }
 
 // repeated int32 public_dependency = 10;
-inline int FileDescriptorProto::public_dependency_size() const {
+inline int FileDescriptorProto::_internal_public_dependency_size() const {
   return public_dependency_.size();
 }
+inline int FileDescriptorProto::public_dependency_size() const {
+  return _internal_public_dependency_size();
+}
 inline void FileDescriptorProto::clear_public_dependency() {
   public_dependency_.Clear();
 }
-inline ::google::protobuf::int32 FileDescriptorProto::public_dependency(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.public_dependency)
+inline int32_t FileDescriptorProto::_internal_public_dependency(int index) const {
   return public_dependency_.Get(index);
 }
-inline void FileDescriptorProto::set_public_dependency(int index, ::google::protobuf::int32 value) {
+inline int32_t FileDescriptorProto::public_dependency(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.public_dependency)
+  return _internal_public_dependency(index);
+}
+inline void FileDescriptorProto::set_public_dependency(int index, int32_t value) {
   public_dependency_.Set(index, value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.public_dependency)
 }
-inline void FileDescriptorProto::add_public_dependency(::google::protobuf::int32 value) {
+inline void FileDescriptorProto::_internal_add_public_dependency(int32_t value) {
   public_dependency_.Add(value);
+}
+inline void FileDescriptorProto::add_public_dependency(int32_t value) {
+  _internal_add_public_dependency(value);
   // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.public_dependency)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+FileDescriptorProto::_internal_public_dependency() const {
+  return public_dependency_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 FileDescriptorProto::public_dependency() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.public_dependency)
-  return public_dependency_;
+  return _internal_public_dependency();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+FileDescriptorProto::_internal_mutable_public_dependency() {
+  return &public_dependency_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 FileDescriptorProto::mutable_public_dependency() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.public_dependency)
-  return &public_dependency_;
+  return _internal_mutable_public_dependency();
 }
 
 // repeated int32 weak_dependency = 11;
-inline int FileDescriptorProto::weak_dependency_size() const {
+inline int FileDescriptorProto::_internal_weak_dependency_size() const {
   return weak_dependency_.size();
 }
+inline int FileDescriptorProto::weak_dependency_size() const {
+  return _internal_weak_dependency_size();
+}
 inline void FileDescriptorProto::clear_weak_dependency() {
   weak_dependency_.Clear();
 }
-inline ::google::protobuf::int32 FileDescriptorProto::weak_dependency(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.weak_dependency)
+inline int32_t FileDescriptorProto::_internal_weak_dependency(int index) const {
   return weak_dependency_.Get(index);
 }
-inline void FileDescriptorProto::set_weak_dependency(int index, ::google::protobuf::int32 value) {
+inline int32_t FileDescriptorProto::weak_dependency(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.weak_dependency)
+  return _internal_weak_dependency(index);
+}
+inline void FileDescriptorProto::set_weak_dependency(int index, int32_t value) {
   weak_dependency_.Set(index, value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.weak_dependency)
 }
-inline void FileDescriptorProto::add_weak_dependency(::google::protobuf::int32 value) {
+inline void FileDescriptorProto::_internal_add_weak_dependency(int32_t value) {
   weak_dependency_.Add(value);
+}
+inline void FileDescriptorProto::add_weak_dependency(int32_t value) {
+  _internal_add_weak_dependency(value);
   // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.weak_dependency)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+FileDescriptorProto::_internal_weak_dependency() const {
+  return weak_dependency_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 FileDescriptorProto::weak_dependency() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.weak_dependency)
-  return weak_dependency_;
+  return _internal_weak_dependency();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+FileDescriptorProto::_internal_mutable_weak_dependency() {
+  return &weak_dependency_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 FileDescriptorProto::mutable_weak_dependency() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.weak_dependency)
-  return &weak_dependency_;
+  return _internal_mutable_weak_dependency();
 }
 
 // repeated .google.protobuf.DescriptorProto message_type = 4;
-inline int FileDescriptorProto::message_type_size() const {
+inline int FileDescriptorProto::_internal_message_type_size() const {
   return message_type_.size();
 }
+inline int FileDescriptorProto::message_type_size() const {
+  return _internal_message_type_size();
+}
 inline void FileDescriptorProto::clear_message_type() {
   message_type_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::DescriptorProto* FileDescriptorProto::mutable_message_type(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* FileDescriptorProto::mutable_message_type(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.message_type)
   return message_type_.Mutable(index);
 }
-inline ::google::protobuf::DescriptorProto* FileDescriptorProto::add_message_type() {
-  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.message_type)
-  return message_type_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >*
 FileDescriptorProto::mutable_message_type() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.message_type)
   return &message_type_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& FileDescriptorProto::_internal_message_type(int index) const {
+  return message_type_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& FileDescriptorProto::message_type(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.message_type)
+  return _internal_message_type(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* FileDescriptorProto::_internal_add_message_type() {
+  return message_type_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* FileDescriptorProto::add_message_type() {
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto* _add = _internal_add_message_type();
+  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.message_type)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >&
 FileDescriptorProto::message_type() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.message_type)
   return message_type_;
 }
 
 // repeated .google.protobuf.EnumDescriptorProto enum_type = 5;
-inline int FileDescriptorProto::enum_type_size() const {
+inline int FileDescriptorProto::_internal_enum_type_size() const {
   return enum_type_.size();
 }
+inline int FileDescriptorProto::enum_type_size() const {
+  return _internal_enum_type_size();
+}
 inline void FileDescriptorProto::clear_enum_type() {
   enum_type_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::EnumDescriptorProto* FileDescriptorProto::mutable_enum_type(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* FileDescriptorProto::mutable_enum_type(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.enum_type)
   return enum_type_.Mutable(index);
 }
-inline ::google::protobuf::EnumDescriptorProto* FileDescriptorProto::add_enum_type() {
-  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.enum_type)
-  return enum_type_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >*
 FileDescriptorProto::mutable_enum_type() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.enum_type)
   return &enum_type_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& FileDescriptorProto::_internal_enum_type(int index) const {
+  return enum_type_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& FileDescriptorProto::enum_type(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.enum_type)
+  return _internal_enum_type(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* FileDescriptorProto::_internal_add_enum_type() {
+  return enum_type_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* FileDescriptorProto::add_enum_type() {
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* _add = _internal_add_enum_type();
+  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.enum_type)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >&
 FileDescriptorProto::enum_type() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.enum_type)
   return enum_type_;
 }
 
 // repeated .google.protobuf.ServiceDescriptorProto service = 6;
-inline int FileDescriptorProto::service_size() const {
+inline int FileDescriptorProto::_internal_service_size() const {
   return service_.size();
 }
+inline int FileDescriptorProto::service_size() const {
+  return _internal_service_size();
+}
 inline void FileDescriptorProto::clear_service() {
   service_.Clear();
 }
-inline const ::google::protobuf::ServiceDescriptorProto& FileDescriptorProto::service(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.service)
-  return service_.Get(index);
-}
-inline ::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::mutable_service(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* FileDescriptorProto::mutable_service(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.service)
   return service_.Mutable(index);
 }
-inline ::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::add_service() {
-  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.service)
-  return service_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto >*
 FileDescriptorProto::mutable_service() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.service)
   return &service_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto& FileDescriptorProto::_internal_service(int index) const {
+  return service_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto& FileDescriptorProto::service(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.service)
+  return _internal_service(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* FileDescriptorProto::_internal_add_service() {
+  return service_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* FileDescriptorProto::add_service() {
+  ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* _add = _internal_add_service();
+  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.service)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto >&
 FileDescriptorProto::service() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.service)
   return service_;
 }
 
 // repeated .google.protobuf.FieldDescriptorProto extension = 7;
-inline int FileDescriptorProto::extension_size() const {
+inline int FileDescriptorProto::_internal_extension_size() const {
   return extension_.size();
 }
+inline int FileDescriptorProto::extension_size() const {
+  return _internal_extension_size();
+}
 inline void FileDescriptorProto::clear_extension() {
   extension_.Clear();
 }
-inline const ::google::protobuf::FieldDescriptorProto& FileDescriptorProto::extension(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.extension)
-  return extension_.Get(index);
-}
-inline ::google::protobuf::FieldDescriptorProto* FileDescriptorProto::mutable_extension(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* FileDescriptorProto::mutable_extension(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.extension)
   return extension_.Mutable(index);
 }
-inline ::google::protobuf::FieldDescriptorProto* FileDescriptorProto::add_extension() {
-  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.extension)
-  return extension_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >*
 FileDescriptorProto::mutable_extension() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.extension)
   return &extension_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& FileDescriptorProto::_internal_extension(int index) const {
+  return extension_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& FileDescriptorProto::extension(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.extension)
+  return _internal_extension(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* FileDescriptorProto::_internal_add_extension() {
+  return extension_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* FileDescriptorProto::add_extension() {
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _add = _internal_add_extension();
+  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.extension)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >&
 FileDescriptorProto::extension() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.extension)
   return extension_;
 }
 
 // optional .google.protobuf.FileOptions options = 8;
-inline bool FileDescriptorProto::has_options() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool FileDescriptorProto::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void FileDescriptorProto::set_has_options() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool FileDescriptorProto::has_options() const {
+  return _internal_has_options();
 }
-inline void FileDescriptorProto::clear_has_options() {
+inline void FileDescriptorProto::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void FileDescriptorProto::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::FileOptions& FileDescriptorProto::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::FileOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::FileOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_FileOptions_default_instance_);
 }
-inline const ::google::protobuf::FileOptions& FileDescriptorProto::options() const {
-  const ::google::protobuf::FileOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::FileOptions& FileDescriptorProto::options() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.options)
-  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::FileOptions*>(
-      &::google::protobuf::_FileOptions_default_instance_);
+  return _internal_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_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void FileDescriptorProto::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::FileOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
+  }
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000008u;
+  } else {
+    _has_bits_[0] &= ~0x00000008u;
   }
-  options_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::release_options() {
+  _has_bits_[0] &= ~0x00000008u;
+  ::PROTOBUF_NAMESPACE_ID::FileOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.options)
+  _has_bits_[0] &= ~0x00000008u;
+  ::PROTOBUF_NAMESPACE_ID::FileOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000008u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.options)
   return options_;
 }
-inline void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::FileOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.options)
+  return _msg;
+}
+inline void FileDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::FileOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::FileOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000008u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.options)
 }
 
 // optional .google.protobuf.SourceCodeInfo source_code_info = 9;
-inline bool FileDescriptorProto::has_source_code_info() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+inline bool FileDescriptorProto::_internal_has_source_code_info() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  PROTOBUF_ASSUME(!value || source_code_info_ != nullptr);
+  return value;
 }
-inline void FileDescriptorProto::set_has_source_code_info() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool FileDescriptorProto::has_source_code_info() const {
+  return _internal_has_source_code_info();
 }
-inline void FileDescriptorProto::clear_has_source_code_info() {
+inline void FileDescriptorProto::clear_source_code_info() {
+  if (source_code_info_ != nullptr) source_code_info_->Clear();
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void FileDescriptorProto::clear_source_code_info() {
-  if (source_code_info_ != NULL) source_code_info_->Clear();
-  clear_has_source_code_info();
+inline const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo& FileDescriptorProto::_internal_source_code_info() const {
+  const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* p = source_code_info_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo&>(
+      ::PROTOBUF_NAMESPACE_ID::_SourceCodeInfo_default_instance_);
 }
-inline const ::google::protobuf::SourceCodeInfo& FileDescriptorProto::source_code_info() const {
-  const ::google::protobuf::SourceCodeInfo* p = source_code_info_;
+inline const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo& FileDescriptorProto::source_code_info() const {
   // @@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_);
+  return _internal_source_code_info();
 }
-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_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void FileDescriptorProto::unsafe_arena_set_allocated_source_code_info(
+    ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_code_info_);
+  }
+  source_code_info_ = source_code_info;
+  if (source_code_info) {
+    _has_bits_[0] |= 0x00000010u;
+  } else {
+    _has_bits_[0] &= ~0x00000010u;
   }
-  source_code_info_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.source_code_info)
+}
+inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::release_source_code_info() {
+  _has_bits_[0] &= ~0x00000010u;
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* temp = source_code_info_;
+  source_code_info_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::unsafe_arena_release_source_code_info() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.source_code_info)
+  _has_bits_[0] &= ~0x00000010u;
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* temp = source_code_info_;
+  source_code_info_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() {
-  set_has_source_code_info();
-  if (source_code_info_ == NULL) {
-    _slow_mutable_source_code_info();
+inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::_internal_mutable_source_code_info() {
+  _has_bits_[0] |= 0x00000010u;
+  if (source_code_info_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo>(GetArenaForAllocation());
+    source_code_info_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.source_code_info)
   return 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) {
+inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() {
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* _msg = _internal_mutable_source_code_info();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.source_code_info)
+  return _msg;
+}
+inline void FileDescriptorProto::set_allocated_source_code_info(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete source_code_info_;
   }
   if (source_code_info) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(source_code_info);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo>::GetOwningArena(source_code_info);
     if (message_arena != submessage_arena) {
-      source_code_info = ::google::protobuf::internal::GetOwnedMessage(
+      source_code_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, source_code_info, submessage_arena);
     }
-    set_has_source_code_info();
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_source_code_info();
+    _has_bits_[0] &= ~0x00000010u;
   }
   source_code_info_ = source_code_info;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.source_code_info)
 }
 
 // optional string syntax = 12;
-inline bool FileDescriptorProto::has_syntax() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void FileDescriptorProto::set_has_syntax() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool FileDescriptorProto::_internal_has_syntax() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void FileDescriptorProto::clear_has_syntax() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool FileDescriptorProto::has_syntax() const {
+  return _internal_has_syntax();
 }
 inline void FileDescriptorProto::clear_syntax() {
-  syntax_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_syntax();
+  syntax_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& FileDescriptorProto::syntax() const {
+inline const std::string& FileDescriptorProto::syntax() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.syntax)
-  return syntax_.Get();
+  return _internal_syntax();
 }
-inline void FileDescriptorProto::set_syntax(const ::std::string& value) {
-  set_has_syntax();
-  syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileDescriptorProto::set_syntax(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ syntax_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.syntax)
 }
-#if LANG_CXX11
-inline void FileDescriptorProto::set_syntax(::std::string&& value) {
-  set_has_syntax();
-  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_.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) {
-  set_has_syntax();
-  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();
+inline std::string* FileDescriptorProto::mutable_syntax() {
+  std::string* _s = _internal_mutable_syntax();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.syntax)
-  return syntax_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FileDescriptorProto::release_syntax() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax)
-  clear_has_syntax();
-  return syntax_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FileDescriptorProto::_internal_syntax() const {
+  return syntax_.Get();
 }
-inline void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) {
-  if (syntax != NULL) {
-    set_has_syntax();
-  } else {
-    clear_has_syntax();
+inline void FileDescriptorProto::_internal_set_syntax(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  syntax_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FileDescriptorProto::_internal_mutable_syntax() {
+  _has_bits_[0] |= 0x00000004u;
+  return syntax_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FileDescriptorProto::release_syntax() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax)
+  if (!_internal_has_syntax()) {
+    return nullptr;
   }
-  syntax_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), syntax,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax)
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = syntax_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (syntax_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    syntax_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_syntax(
-    ::std::string* syntax) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (syntax != NULL) {
-    set_has_syntax();
+inline void FileDescriptorProto::set_allocated_syntax(std::string* syntax) {
+  if (syntax != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_syntax();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  syntax_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), syntax,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (syntax_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    syntax_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  syntax_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      syntax, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.syntax)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax)
 }
 
 // -------------------------------------------------------------------
@@ -6356,113 +9240,146 @@ inline void FileDescriptorProto::unsafe_arena_set_allocated_syntax(
 // DescriptorProto_ExtensionRange
 
 // optional int32 start = 1;
-inline bool DescriptorProto_ExtensionRange::has_start() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool DescriptorProto_ExtensionRange::_internal_has_start() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void DescriptorProto_ExtensionRange::set_has_start() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void DescriptorProto_ExtensionRange::clear_has_start() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool DescriptorProto_ExtensionRange::has_start() const {
+  return _internal_has_start();
 }
 inline void DescriptorProto_ExtensionRange::clear_start() {
   start_ = 0;
-  clear_has_start();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 DescriptorProto_ExtensionRange::start() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.start)
+inline int32_t DescriptorProto_ExtensionRange::_internal_start() const {
   return start_;
 }
-inline void DescriptorProto_ExtensionRange::set_start(::google::protobuf::int32 value) {
-  set_has_start();
+inline int32_t DescriptorProto_ExtensionRange::start() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.start)
+  return _internal_start();
+}
+inline void DescriptorProto_ExtensionRange::_internal_set_start(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   start_ = value;
+}
+inline void DescriptorProto_ExtensionRange::set_start(int32_t value) {
+  _internal_set_start(value);
   // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.start)
 }
 
 // optional int32 end = 2;
-inline bool DescriptorProto_ExtensionRange::has_end() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void DescriptorProto_ExtensionRange::set_has_end() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool DescriptorProto_ExtensionRange::_internal_has_end() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void DescriptorProto_ExtensionRange::clear_has_end() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool DescriptorProto_ExtensionRange::has_end() const {
+  return _internal_has_end();
 }
 inline void DescriptorProto_ExtensionRange::clear_end() {
   end_ = 0;
-  clear_has_end();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 DescriptorProto_ExtensionRange::end() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.end)
+inline int32_t DescriptorProto_ExtensionRange::_internal_end() const {
   return end_;
 }
-inline void DescriptorProto_ExtensionRange::set_end(::google::protobuf::int32 value) {
-  set_has_end();
+inline int32_t DescriptorProto_ExtensionRange::end() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.end)
+  return _internal_end();
+}
+inline void DescriptorProto_ExtensionRange::_internal_set_end(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   end_ = value;
+}
+inline void DescriptorProto_ExtensionRange::set_end(int32_t value) {
+  _internal_set_end(value);
   // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.end)
 }
 
 // optional .google.protobuf.ExtensionRangeOptions options = 3;
-inline bool DescriptorProto_ExtensionRange::has_options() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool DescriptorProto_ExtensionRange::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void DescriptorProto_ExtensionRange::set_has_options() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool DescriptorProto_ExtensionRange::has_options() const {
+  return _internal_has_options();
 }
-inline void DescriptorProto_ExtensionRange::clear_has_options() {
+inline void DescriptorProto_ExtensionRange::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void DescriptorProto_ExtensionRange::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions& DescriptorProto_ExtensionRange::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_ExtensionRangeOptions_default_instance_);
 }
-inline const ::google::protobuf::ExtensionRangeOptions& DescriptorProto_ExtensionRange::options() const {
-  const ::google::protobuf::ExtensionRangeOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions& DescriptorProto_ExtensionRange::options() const {
   // @@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_);
+  return _internal_options();
 }
-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_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void DescriptorProto_ExtensionRange::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
+  }
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
   }
-  options_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_ExtensionRange::release_options() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_ExtensionRange::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.ExtensionRange.options)
+  _has_bits_[0] &= ~0x00000001u;
+  ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_ExtensionRange::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000001u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.ExtensionRange.options)
   return options_;
 }
-inline void DescriptorProto_ExtensionRange::set_allocated_options(::google::protobuf::ExtensionRangeOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_ExtensionRange::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.ExtensionRange.options)
+  return _msg;
+}
+inline void DescriptorProto_ExtensionRange::set_allocated_options(::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000001u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options)
@@ -6473,50 +9390,58 @@ inline void DescriptorProto_ExtensionRange::set_allocated_options(::google::prot
 // DescriptorProto_ReservedRange
 
 // optional int32 start = 1;
-inline bool DescriptorProto_ReservedRange::has_start() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool DescriptorProto_ReservedRange::_internal_has_start() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void DescriptorProto_ReservedRange::set_has_start() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void DescriptorProto_ReservedRange::clear_has_start() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool DescriptorProto_ReservedRange::has_start() const {
+  return _internal_has_start();
 }
 inline void DescriptorProto_ReservedRange::clear_start() {
   start_ = 0;
-  clear_has_start();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 DescriptorProto_ReservedRange::start() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.start)
+inline int32_t DescriptorProto_ReservedRange::_internal_start() const {
   return start_;
 }
-inline void DescriptorProto_ReservedRange::set_start(::google::protobuf::int32 value) {
-  set_has_start();
+inline int32_t DescriptorProto_ReservedRange::start() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.start)
+  return _internal_start();
+}
+inline void DescriptorProto_ReservedRange::_internal_set_start(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   start_ = value;
+}
+inline void DescriptorProto_ReservedRange::set_start(int32_t value) {
+  _internal_set_start(value);
   // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.start)
 }
 
 // optional int32 end = 2;
-inline bool DescriptorProto_ReservedRange::has_end() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void DescriptorProto_ReservedRange::set_has_end() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool DescriptorProto_ReservedRange::_internal_has_end() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void DescriptorProto_ReservedRange::clear_has_end() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool DescriptorProto_ReservedRange::has_end() const {
+  return _internal_has_end();
 }
 inline void DescriptorProto_ReservedRange::clear_end() {
   end_ = 0;
-  clear_has_end();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 DescriptorProto_ReservedRange::end() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.end)
+inline int32_t DescriptorProto_ReservedRange::_internal_end() const {
   return end_;
 }
-inline void DescriptorProto_ReservedRange::set_end(::google::protobuf::int32 value) {
-  set_has_end();
+inline int32_t DescriptorProto_ReservedRange::end() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.end)
+  return _internal_end();
+}
+inline void DescriptorProto_ReservedRange::_internal_set_end(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   end_ = value;
+}
+inline void DescriptorProto_ReservedRange::set_end(int32_t value) {
+  _internal_set_end(value);
   // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.end)
 }
 
@@ -6525,392 +9450,480 @@ inline void DescriptorProto_ReservedRange::set_end(::google::protobuf::int32 val
 // DescriptorProto
 
 // optional string name = 1;
-inline bool DescriptorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void DescriptorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool DescriptorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void DescriptorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool DescriptorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void DescriptorProto::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& DescriptorProto::name() const {
+inline const std::string& DescriptorProto::name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void DescriptorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void DescriptorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.name)
 }
-#if LANG_CXX11
-inline void DescriptorProto::set_name(::std::string&& value) {
-  set_has_name();
-  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_.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) {
-  set_has_name();
-  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();
+inline std::string* DescriptorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* DescriptorProto::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name)
-  clear_has_name();
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& DescriptorProto::_internal_name() const {
+  return name_.Get();
 }
-inline void DescriptorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
-  } else {
-    clear_has_name();
+inline void DescriptorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* DescriptorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* DescriptorProto::release_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name)
+  if (!_internal_has_name()) {
+    return nullptr;
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-    set_has_name();
+inline void DescriptorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name)
 }
 
 // repeated .google.protobuf.FieldDescriptorProto field = 2;
-inline int DescriptorProto::field_size() const {
+inline int DescriptorProto::_internal_field_size() const {
   return field_.size();
 }
+inline int DescriptorProto::field_size() const {
+  return _internal_field_size();
+}
 inline void DescriptorProto::clear_field() {
   field_.Clear();
 }
-inline const ::google::protobuf::FieldDescriptorProto& DescriptorProto::field(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.field)
-  return field_.Get(index);
-}
-inline ::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_field(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::mutable_field(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.field)
   return field_.Mutable(index);
 }
-inline ::google::protobuf::FieldDescriptorProto* DescriptorProto::add_field() {
-  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.field)
-  return field_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >*
 DescriptorProto::mutable_field() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.field)
   return &field_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& DescriptorProto::_internal_field(int index) const {
+  return field_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& DescriptorProto::field(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.field)
+  return _internal_field(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::_internal_add_field() {
+  return field_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::add_field() {
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _add = _internal_add_field();
+  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.field)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >&
 DescriptorProto::field() const {
   // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.field)
   return field_;
 }
 
 // repeated .google.protobuf.FieldDescriptorProto extension = 6;
-inline int DescriptorProto::extension_size() const {
+inline int DescriptorProto::_internal_extension_size() const {
   return extension_.size();
 }
+inline int DescriptorProto::extension_size() const {
+  return _internal_extension_size();
+}
 inline void DescriptorProto::clear_extension() {
   extension_.Clear();
 }
-inline const ::google::protobuf::FieldDescriptorProto& DescriptorProto::extension(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension)
-  return extension_.Get(index);
-}
-inline ::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_extension(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::mutable_extension(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension)
   return extension_.Mutable(index);
 }
-inline ::google::protobuf::FieldDescriptorProto* DescriptorProto::add_extension() {
-  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension)
-  return extension_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >*
 DescriptorProto::mutable_extension() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension)
   return &extension_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& DescriptorProto::_internal_extension(int index) const {
+  return extension_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& DescriptorProto::extension(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension)
+  return _internal_extension(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::_internal_add_extension() {
+  return extension_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::add_extension() {
+  ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _add = _internal_add_extension();
+  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >&
 DescriptorProto::extension() const {
   // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension)
   return extension_;
 }
 
 // repeated .google.protobuf.DescriptorProto nested_type = 3;
-inline int DescriptorProto::nested_type_size() const {
+inline int DescriptorProto::_internal_nested_type_size() const {
   return nested_type_.size();
 }
+inline int DescriptorProto::nested_type_size() const {
+  return _internal_nested_type_size();
+}
 inline void DescriptorProto::clear_nested_type() {
   nested_type_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::DescriptorProto* DescriptorProto::mutable_nested_type(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* DescriptorProto::mutable_nested_type(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.nested_type)
   return nested_type_.Mutable(index);
 }
-inline ::google::protobuf::DescriptorProto* DescriptorProto::add_nested_type() {
-  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.nested_type)
-  return nested_type_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >*
 DescriptorProto::mutable_nested_type() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.nested_type)
   return &nested_type_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& DescriptorProto::_internal_nested_type(int index) const {
+  return nested_type_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& DescriptorProto::nested_type(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.nested_type)
+  return _internal_nested_type(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* DescriptorProto::_internal_add_nested_type() {
+  return nested_type_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* DescriptorProto::add_nested_type() {
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto* _add = _internal_add_nested_type();
+  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.nested_type)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >&
 DescriptorProto::nested_type() const {
   // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.nested_type)
   return nested_type_;
 }
 
 // repeated .google.protobuf.EnumDescriptorProto enum_type = 4;
-inline int DescriptorProto::enum_type_size() const {
+inline int DescriptorProto::_internal_enum_type_size() const {
   return enum_type_.size();
 }
+inline int DescriptorProto::enum_type_size() const {
+  return _internal_enum_type_size();
+}
 inline void DescriptorProto::clear_enum_type() {
   enum_type_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::EnumDescriptorProto* DescriptorProto::mutable_enum_type(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* DescriptorProto::mutable_enum_type(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.enum_type)
   return enum_type_.Mutable(index);
 }
-inline ::google::protobuf::EnumDescriptorProto* DescriptorProto::add_enum_type() {
-  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.enum_type)
-  return enum_type_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >*
 DescriptorProto::mutable_enum_type() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.enum_type)
   return &enum_type_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& DescriptorProto::_internal_enum_type(int index) const {
+  return enum_type_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& DescriptorProto::enum_type(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.enum_type)
+  return _internal_enum_type(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* DescriptorProto::_internal_add_enum_type() {
+  return enum_type_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* DescriptorProto::add_enum_type() {
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* _add = _internal_add_enum_type();
+  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.enum_type)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >&
 DescriptorProto::enum_type() const {
   // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.enum_type)
   return enum_type_;
 }
 
 // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;
-inline int DescriptorProto::extension_range_size() const {
+inline int DescriptorProto::_internal_extension_range_size() const {
   return extension_range_.size();
 }
+inline int DescriptorProto::extension_range_size() const {
+  return _internal_extension_range_size();
+}
 inline void DescriptorProto::clear_extension_range() {
   extension_range_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::mutable_extension_range(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* DescriptorProto::mutable_extension_range(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension_range)
   return extension_range_.Mutable(index);
 }
-inline ::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::add_extension_range() {
-  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension_range)
-  return extension_range_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange >*
 DescriptorProto::mutable_extension_range() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension_range)
   return &extension_range_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >&
+inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange& DescriptorProto::_internal_extension_range(int index) const {
+  return extension_range_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange& DescriptorProto::extension_range(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension_range)
+  return _internal_extension_range(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* DescriptorProto::_internal_add_extension_range() {
+  return extension_range_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* DescriptorProto::add_extension_range() {
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* _add = _internal_add_extension_range();
+  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension_range)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange >&
 DescriptorProto::extension_range() const {
   // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension_range)
   return extension_range_;
 }
 
 // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;
-inline int DescriptorProto::oneof_decl_size() const {
+inline int DescriptorProto::_internal_oneof_decl_size() const {
   return oneof_decl_.size();
 }
+inline int DescriptorProto::oneof_decl_size() const {
+  return _internal_oneof_decl_size();
+}
 inline void DescriptorProto::clear_oneof_decl() {
   oneof_decl_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::OneofDescriptorProto* DescriptorProto::mutable_oneof_decl(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* DescriptorProto::mutable_oneof_decl(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.oneof_decl)
   return oneof_decl_.Mutable(index);
 }
-inline ::google::protobuf::OneofDescriptorProto* DescriptorProto::add_oneof_decl() {
-  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.oneof_decl)
-  return oneof_decl_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto >*
 DescriptorProto::mutable_oneof_decl() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.oneof_decl)
   return &oneof_decl_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto& DescriptorProto::_internal_oneof_decl(int index) const {
+  return oneof_decl_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto& DescriptorProto::oneof_decl(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.oneof_decl)
+  return _internal_oneof_decl(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* DescriptorProto::_internal_add_oneof_decl() {
+  return oneof_decl_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* DescriptorProto::add_oneof_decl() {
+  ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* _add = _internal_add_oneof_decl();
+  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.oneof_decl)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto >&
 DescriptorProto::oneof_decl() const {
   // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.oneof_decl)
   return oneof_decl_;
 }
 
 // optional .google.protobuf.MessageOptions options = 7;
-inline bool DescriptorProto::has_options() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool DescriptorProto::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void DescriptorProto::set_has_options() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool DescriptorProto::has_options() const {
+  return _internal_has_options();
 }
-inline void DescriptorProto::clear_has_options() {
+inline void DescriptorProto::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void DescriptorProto::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::MessageOptions& DescriptorProto::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::MessageOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::MessageOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_MessageOptions_default_instance_);
 }
-inline const ::google::protobuf::MessageOptions& DescriptorProto::options() const {
-  const ::google::protobuf::MessageOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::MessageOptions& DescriptorProto::options() const {
   // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.options)
-  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::MessageOptions*>(
-      &::google::protobuf::_MessageOptions_default_instance_);
+  return _internal_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_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void DescriptorProto::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::MessageOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
+  }
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
   }
-  options_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::release_options() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::MessageOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.options)
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::MessageOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::MessageOptions* DescriptorProto::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000002u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MessageOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.options)
   return options_;
 }
-inline void DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::MessageOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.options)
+  return _msg;
+}
+inline void DescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::MessageOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::MessageOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000002u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.options)
 }
 
 // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;
-inline int DescriptorProto::reserved_range_size() const {
+inline int DescriptorProto::_internal_reserved_range_size() const {
   return reserved_range_.size();
 }
+inline int DescriptorProto::reserved_range_size() const {
+  return _internal_reserved_range_size();
+}
 inline void DescriptorProto::clear_reserved_range() {
   reserved_range_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::mutable_reserved_range(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* DescriptorProto::mutable_reserved_range(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_range)
   return reserved_range_.Mutable(index);
 }
-inline ::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::add_reserved_range() {
-  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_range)
-  return reserved_range_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange >*
 DescriptorProto::mutable_reserved_range() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_range)
   return &reserved_range_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >&
+inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange& DescriptorProto::_internal_reserved_range(int index) const {
+  return reserved_range_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange& DescriptorProto::reserved_range(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_range)
+  return _internal_reserved_range(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* DescriptorProto::_internal_add_reserved_range() {
+  return reserved_range_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* DescriptorProto::add_reserved_range() {
+  ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* _add = _internal_add_reserved_range();
+  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_range)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange >&
 DescriptorProto::reserved_range() const {
   // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_range)
   return reserved_range_;
 }
 
 // repeated string reserved_name = 10;
-inline int DescriptorProto::reserved_name_size() const {
+inline int DescriptorProto::_internal_reserved_name_size() const {
   return reserved_name_.size();
 }
+inline int DescriptorProto::reserved_name_size() const {
+  return _internal_reserved_name_size();
+}
 inline void DescriptorProto::clear_reserved_name() {
   reserved_name_.Clear();
 }
-inline const ::std::string& DescriptorProto::reserved_name(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_name)
+inline std::string* DescriptorProto::add_reserved_name() {
+  std::string* _s = _internal_add_reserved_name();
+  // @@protoc_insertion_point(field_add_mutable:google.protobuf.DescriptorProto.reserved_name)
+  return _s;
+}
+inline const std::string& DescriptorProto::_internal_reserved_name(int index) const {
   return reserved_name_.Get(index);
 }
-inline ::std::string* DescriptorProto::mutable_reserved_name(int index) {
+inline const std::string& DescriptorProto::reserved_name(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_name)
+  return _internal_reserved_name(index);
+}
+inline std::string* DescriptorProto::mutable_reserved_name(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_name)
   return reserved_name_.Mutable(index);
 }
-inline void DescriptorProto::set_reserved_name(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name)
+inline void DescriptorProto::set_reserved_name(int index, const std::string& value) {
   reserved_name_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void DescriptorProto::set_reserved_name(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name)
+}
+inline void DescriptorProto::set_reserved_name(int index, std::string&& value) {
   reserved_name_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name)
 }
-#endif
 inline void DescriptorProto::set_reserved_name(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   reserved_name_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name)
 }
@@ -6919,22 +9932,19 @@ inline void DescriptorProto::set_reserved_name(int index, const char* value, siz
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.reserved_name)
 }
-inline ::std::string* DescriptorProto::add_reserved_name() {
-  // @@protoc_insertion_point(field_add_mutable:google.protobuf.DescriptorProto.reserved_name)
+inline std::string* DescriptorProto::_internal_add_reserved_name() {
   return reserved_name_.Add();
 }
-inline void DescriptorProto::add_reserved_name(const ::std::string& value) {
+inline 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
-inline void DescriptorProto::add_reserved_name(::std::string&& value) {
+inline 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
 inline void DescriptorProto::add_reserved_name(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   reserved_name_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name)
 }
@@ -6942,12 +9952,12 @@ inline 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)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 DescriptorProto::reserved_name() const {
   // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_name)
   return reserved_name_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 DescriptorProto::mutable_reserved_name() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_name)
   return &reserved_name_;
@@ -6958,30 +9968,40 @@ DescriptorProto::mutable_reserved_name() {
 // ExtensionRangeOptions
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int ExtensionRangeOptions::uninterpreted_option_size() const {
+inline int ExtensionRangeOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int ExtensionRangeOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void ExtensionRangeOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* ExtensionRangeOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ExtensionRangeOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.ExtensionRangeOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* ExtensionRangeOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.ExtensionRangeOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 ExtensionRangeOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.ExtensionRangeOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& ExtensionRangeOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& ExtensionRangeOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.ExtensionRangeOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ExtensionRangeOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ExtensionRangeOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.ExtensionRangeOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 ExtensionRangeOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.ExtensionRangeOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -6992,742 +10012,740 @@ ExtensionRangeOptions::uninterpreted_option() const {
 // FieldDescriptorProto
 
 // optional string name = 1;
-inline bool FieldDescriptorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void FieldDescriptorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool FieldDescriptorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool FieldDescriptorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void FieldDescriptorProto::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& FieldDescriptorProto::name() const {
+inline const std::string& FieldDescriptorProto::name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void FieldDescriptorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FieldDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.name)
 }
-#if LANG_CXX11
-inline void FieldDescriptorProto::set_name(::std::string&& value) {
-  set_has_name();
-  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_.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) {
-  set_has_name();
-  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();
+inline std::string* FieldDescriptorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FieldDescriptorProto::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name)
-  clear_has_name();
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FieldDescriptorProto::_internal_name() const {
+  return name_.Get();
 }
-inline void FieldDescriptorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
-  } else {
-    clear_has_name();
+inline void FieldDescriptorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::release_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name)
+  if (!_internal_has_name()) {
+    return nullptr;
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-    set_has_name();
+inline void FieldDescriptorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.name)
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name)
 }
 
 // optional int32 number = 3;
-inline bool FieldDescriptorProto::has_number() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void FieldDescriptorProto::set_has_number() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool FieldDescriptorProto::_internal_has_number() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::clear_has_number() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool FieldDescriptorProto::has_number() const {
+  return _internal_has_number();
 }
 inline void FieldDescriptorProto::clear_number() {
   number_ = 0;
-  clear_has_number();
+  _has_bits_[0] &= ~0x00000040u;
 }
-inline ::google::protobuf::int32 FieldDescriptorProto::number() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.number)
+inline int32_t FieldDescriptorProto::_internal_number() const {
   return number_;
 }
-inline void FieldDescriptorProto::set_number(::google::protobuf::int32 value) {
-  set_has_number();
+inline int32_t FieldDescriptorProto::number() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.number)
+  return _internal_number();
+}
+inline void FieldDescriptorProto::_internal_set_number(int32_t value) {
+  _has_bits_[0] |= 0x00000040u;
   number_ = value;
+}
+inline void FieldDescriptorProto::set_number(int32_t value) {
+  _internal_set_number(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.number)
 }
 
 // optional .google.protobuf.FieldDescriptorProto.Label label = 4;
-inline bool FieldDescriptorProto::has_label() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void FieldDescriptorProto::set_has_label() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool FieldDescriptorProto::_internal_has_label() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::clear_has_label() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool FieldDescriptorProto::has_label() const {
+  return _internal_has_label();
 }
 inline void FieldDescriptorProto::clear_label() {
   label_ = 1;
-  clear_has_label();
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label FieldDescriptorProto::_internal_label() const {
+  return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label >(label_);
 }
-inline ::google::protobuf::FieldDescriptorProto_Label FieldDescriptorProto::label() const {
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label FieldDescriptorProto::label() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.label)
-  return static_cast< ::google::protobuf::FieldDescriptorProto_Label >(label_);
+  return _internal_label();
 }
-inline void FieldDescriptorProto::set_label(::google::protobuf::FieldDescriptorProto_Label value) {
-  assert(::google::protobuf::FieldDescriptorProto_Label_IsValid(value));
-  set_has_label();
+inline void FieldDescriptorProto::_internal_set_label(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label value) {
+  assert(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label_IsValid(value));
+  _has_bits_[0] |= 0x00000200u;
   label_ = value;
+}
+inline void FieldDescriptorProto::set_label(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label value) {
+  _internal_set_label(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.label)
 }
 
 // optional .google.protobuf.FieldDescriptorProto.Type type = 5;
-inline bool FieldDescriptorProto::has_type() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
-}
-inline void FieldDescriptorProto::set_has_type() {
-  _has_bits_[0] |= 0x00000200u;
+inline bool FieldDescriptorProto::_internal_has_type() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::clear_has_type() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool FieldDescriptorProto::has_type() const {
+  return _internal_has_type();
 }
 inline void FieldDescriptorProto::clear_type() {
   type_ = 1;
-  clear_has_type();
+  _has_bits_[0] &= ~0x00000400u;
 }
-inline ::google::protobuf::FieldDescriptorProto_Type FieldDescriptorProto::type() const {
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type FieldDescriptorProto::_internal_type() const {
+  return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type >(type_);
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type FieldDescriptorProto::type() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type)
-  return static_cast< ::google::protobuf::FieldDescriptorProto_Type >(type_);
+  return _internal_type();
 }
-inline void FieldDescriptorProto::set_type(::google::protobuf::FieldDescriptorProto_Type value) {
-  assert(::google::protobuf::FieldDescriptorProto_Type_IsValid(value));
-  set_has_type();
+inline void FieldDescriptorProto::_internal_set_type(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type value) {
+  assert(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type_IsValid(value));
+  _has_bits_[0] |= 0x00000400u;
   type_ = value;
+}
+inline void FieldDescriptorProto::set_type(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type value) {
+  _internal_set_type(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type)
 }
 
 // optional string type_name = 6;
-inline bool FieldDescriptorProto::has_type_name() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool FieldDescriptorProto::_internal_has_type_name() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::set_has_type_name() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void FieldDescriptorProto::clear_has_type_name() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool FieldDescriptorProto::has_type_name() const {
+  return _internal_has_type_name();
 }
 inline void FieldDescriptorProto::clear_type_name() {
-  type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_type_name();
+  type_name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& FieldDescriptorProto::type_name() const {
+inline const std::string& FieldDescriptorProto::type_name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type_name)
-  return type_name_.Get();
+  return _internal_type_name();
 }
-inline void FieldDescriptorProto::set_type_name(const ::std::string& value) {
-  set_has_type_name();
-  type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FieldDescriptorProto::set_type_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ type_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_type_name();
-  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();
+inline std::string* FieldDescriptorProto::mutable_type_name() {
+  std::string* _s = _internal_mutable_type_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.type_name)
-  return type_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FieldDescriptorProto::release_type_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name)
-  clear_has_type_name();
-  return type_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FieldDescriptorProto::_internal_type_name() const {
+  return type_name_.Get();
 }
-inline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_name) {
-  if (type_name != NULL) {
-    set_has_type_name();
-  } else {
-    clear_has_type_name();
+inline void FieldDescriptorProto::_internal_set_type_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  type_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::_internal_mutable_type_name() {
+  _has_bits_[0] |= 0x00000004u;
+  return type_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::release_type_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name)
+  if (!_internal_has_type_name()) {
+    return nullptr;
   }
-  type_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name)
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = type_name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_type_name(
-    ::std::string* type_name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (type_name != NULL) {
-    set_has_type_name();
+inline void FieldDescriptorProto::set_allocated_type_name(std::string* type_name) {
+  if (type_name != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_type_name();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  type_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type_name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  type_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      type_name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.type_name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name)
 }
 
 // optional string extendee = 2;
-inline bool FieldDescriptorProto::has_extendee() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void FieldDescriptorProto::set_has_extendee() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool FieldDescriptorProto::_internal_has_extendee() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::clear_has_extendee() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool FieldDescriptorProto::has_extendee() const {
+  return _internal_has_extendee();
 }
 inline void FieldDescriptorProto::clear_extendee() {
-  extendee_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_extendee();
+  extendee_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& FieldDescriptorProto::extendee() const {
+inline const std::string& FieldDescriptorProto::extendee() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.extendee)
-  return extendee_.Get();
+  return _internal_extendee();
 }
-inline void FieldDescriptorProto::set_extendee(const ::std::string& value) {
-  set_has_extendee();
-  extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FieldDescriptorProto::set_extendee(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ extendee_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.extendee)
 }
-#if LANG_CXX11
-inline void FieldDescriptorProto::set_extendee(::std::string&& value) {
-  set_has_extendee();
-  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_.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) {
-  set_has_extendee();
-  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();
+inline std::string* FieldDescriptorProto::mutable_extendee() {
+  std::string* _s = _internal_mutable_extendee();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.extendee)
-  return extendee_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FieldDescriptorProto::release_extendee() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee)
-  clear_has_extendee();
-  return extendee_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FieldDescriptorProto::_internal_extendee() const {
+  return extendee_.Get();
 }
-inline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee) {
-  if (extendee != NULL) {
-    set_has_extendee();
-  } else {
-    clear_has_extendee();
+inline void FieldDescriptorProto::_internal_set_extendee(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  extendee_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::_internal_mutable_extendee() {
+  _has_bits_[0] |= 0x00000002u;
+  return extendee_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::release_extendee() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee)
+  if (!_internal_has_extendee()) {
+    return nullptr;
   }
-  extendee_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), extendee,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee)
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = extendee_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (extendee_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    extendee_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_extendee(
-    ::std::string* extendee) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (extendee != NULL) {
-    set_has_extendee();
+inline void FieldDescriptorProto::set_allocated_extendee(std::string* extendee) {
+  if (extendee != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_extendee();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  extendee_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), extendee,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (extendee_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    extendee_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  extendee_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      extendee, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.extendee)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee)
 }
 
 // optional string default_value = 7;
-inline bool FieldDescriptorProto::has_default_value() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool FieldDescriptorProto::_internal_has_default_value() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::set_has_default_value() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void FieldDescriptorProto::clear_has_default_value() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool FieldDescriptorProto::has_default_value() const {
+  return _internal_has_default_value();
 }
 inline void FieldDescriptorProto::clear_default_value() {
-  default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_default_value();
+  default_value_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::std::string& FieldDescriptorProto::default_value() const {
+inline const std::string& FieldDescriptorProto::default_value() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.default_value)
-  return default_value_.Get();
+  return _internal_default_value();
 }
-inline void FieldDescriptorProto::set_default_value(const ::std::string& value) {
-  set_has_default_value();
-  default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FieldDescriptorProto::set_default_value(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ default_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_default_value();
-  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();
+inline std::string* FieldDescriptorProto::mutable_default_value() {
+  std::string* _s = _internal_mutable_default_value();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.default_value)
-  return default_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FieldDescriptorProto::release_default_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value)
-  clear_has_default_value();
-  return default_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FieldDescriptorProto::_internal_default_value() const {
+  return default_value_.Get();
 }
-inline void FieldDescriptorProto::set_allocated_default_value(::std::string* default_value) {
-  if (default_value != NULL) {
-    set_has_default_value();
-  } else {
-    clear_has_default_value();
+inline void FieldDescriptorProto::_internal_set_default_value(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  default_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::_internal_mutable_default_value() {
+  _has_bits_[0] |= 0x00000008u;
+  return default_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::release_default_value() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value)
+  if (!_internal_has_default_value()) {
+    return nullptr;
   }
-  default_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value)
+  _has_bits_[0] &= ~0x00000008u;
+  auto* p = default_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (default_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_default_value(
-    ::std::string* default_value) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (default_value != NULL) {
-    set_has_default_value();
+inline void FieldDescriptorProto::set_allocated_default_value(std::string* default_value) {
+  if (default_value != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_default_value();
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  default_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), default_value,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (default_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  default_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      default_value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.default_value)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value)
 }
 
 // optional int32 oneof_index = 9;
-inline bool FieldDescriptorProto::has_oneof_index() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void FieldDescriptorProto::set_has_oneof_index() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool FieldDescriptorProto::_internal_has_oneof_index() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::clear_has_oneof_index() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool FieldDescriptorProto::has_oneof_index() const {
+  return _internal_has_oneof_index();
 }
 inline void FieldDescriptorProto::clear_oneof_index() {
   oneof_index_ = 0;
-  clear_has_oneof_index();
+  _has_bits_[0] &= ~0x00000080u;
 }
-inline ::google::protobuf::int32 FieldDescriptorProto::oneof_index() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.oneof_index)
+inline int32_t FieldDescriptorProto::_internal_oneof_index() const {
   return oneof_index_;
 }
-inline void FieldDescriptorProto::set_oneof_index(::google::protobuf::int32 value) {
-  set_has_oneof_index();
+inline int32_t FieldDescriptorProto::oneof_index() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.oneof_index)
+  return _internal_oneof_index();
+}
+inline void FieldDescriptorProto::_internal_set_oneof_index(int32_t value) {
+  _has_bits_[0] |= 0x00000080u;
   oneof_index_ = value;
+}
+inline void FieldDescriptorProto::set_oneof_index(int32_t value) {
+  _internal_set_oneof_index(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.oneof_index)
 }
 
 // optional string json_name = 10;
-inline bool FieldDescriptorProto::has_json_name() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void FieldDescriptorProto::set_has_json_name() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool FieldDescriptorProto::_internal_has_json_name() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void FieldDescriptorProto::clear_has_json_name() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool FieldDescriptorProto::has_json_name() const {
+  return _internal_has_json_name();
 }
 inline void FieldDescriptorProto::clear_json_name() {
-  json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_json_name();
+  json_name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline const ::std::string& FieldDescriptorProto::json_name() const {
+inline const std::string& FieldDescriptorProto::json_name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.json_name)
-  return json_name_.Get();
+  return _internal_json_name();
 }
-inline void FieldDescriptorProto::set_json_name(const ::std::string& value) {
-  set_has_json_name();
-  json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FieldDescriptorProto::set_json_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000010u;
+ json_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_json_name();
-  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();
+inline std::string* FieldDescriptorProto::mutable_json_name() {
+  std::string* _s = _internal_mutable_json_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.json_name)
-  return json_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FieldDescriptorProto::release_json_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name)
-  clear_has_json_name();
-  return json_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FieldDescriptorProto::_internal_json_name() const {
+  return json_name_.Get();
 }
-inline void FieldDescriptorProto::set_allocated_json_name(::std::string* json_name) {
-  if (json_name != NULL) {
-    set_has_json_name();
-  } else {
-    clear_has_json_name();
+inline void FieldDescriptorProto::_internal_set_json_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000010u;
+  json_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::_internal_mutable_json_name() {
+  _has_bits_[0] |= 0x00000010u;
+  return json_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FieldDescriptorProto::release_json_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name)
+  if (!_internal_has_json_name()) {
+    return nullptr;
   }
-  json_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name)
+  _has_bits_[0] &= ~0x00000010u;
+  auto* p = json_name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (json_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_json_name(
-    ::std::string* json_name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (json_name != NULL) {
-    set_has_json_name();
+inline void FieldDescriptorProto::set_allocated_json_name(std::string* json_name) {
+  if (json_name != nullptr) {
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_json_name();
+    _has_bits_[0] &= ~0x00000010u;
   }
-  json_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      json_name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.json_name)
+  json_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), json_name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (json_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name)
 }
 
 // optional .google.protobuf.FieldOptions options = 8;
-inline bool FieldDescriptorProto::has_options() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool FieldDescriptorProto::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void FieldDescriptorProto::set_has_options() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool FieldDescriptorProto::has_options() const {
+  return _internal_has_options();
 }
-inline void FieldDescriptorProto::clear_has_options() {
+inline void FieldDescriptorProto::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000020u;
 }
-inline void FieldDescriptorProto::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::FieldOptions& FieldDescriptorProto::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::FieldOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::FieldOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_FieldOptions_default_instance_);
 }
-inline const ::google::protobuf::FieldOptions& FieldDescriptorProto::options() const {
-  const ::google::protobuf::FieldOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::FieldOptions& FieldDescriptorProto::options() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.options)
-  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::FieldOptions*>(
-      &::google::protobuf::_FieldOptions_default_instance_);
+  return _internal_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_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void FieldDescriptorProto::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::FieldOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
+  }
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000020u;
+  } else {
+    _has_bits_[0] &= ~0x00000020u;
   }
-  options_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::release_options() {
+  _has_bits_[0] &= ~0x00000020u;
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.options)
+  _has_bits_[0] &= ~0x00000020u;
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000020u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.options)
   return options_;
 }
-inline void FieldDescriptorProto::set_allocated_options(::google::protobuf::FieldOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::FieldOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.options)
+  return _msg;
+}
+inline void FieldDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::FieldOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::FieldOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000020u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000020u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.options)
 }
 
+// optional bool proto3_optional = 17;
+inline bool FieldDescriptorProto::_internal_has_proto3_optional() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
+}
+inline bool FieldDescriptorProto::has_proto3_optional() const {
+  return _internal_has_proto3_optional();
+}
+inline void FieldDescriptorProto::clear_proto3_optional() {
+  proto3_optional_ = false;
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline bool FieldDescriptorProto::_internal_proto3_optional() const {
+  return proto3_optional_;
+}
+inline bool FieldDescriptorProto::proto3_optional() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.proto3_optional)
+  return _internal_proto3_optional();
+}
+inline void FieldDescriptorProto::_internal_set_proto3_optional(bool value) {
+  _has_bits_[0] |= 0x00000100u;
+  proto3_optional_ = value;
+}
+inline void FieldDescriptorProto::set_proto3_optional(bool value) {
+  _internal_set_proto3_optional(value);
+  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.proto3_optional)
+}
+
 // -------------------------------------------------------------------
 
 // OneofDescriptorProto
 
 // optional string name = 1;
-inline bool OneofDescriptorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void OneofDescriptorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool OneofDescriptorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void OneofDescriptorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool OneofDescriptorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void OneofDescriptorProto::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& OneofDescriptorProto::name() const {
+inline const std::string& OneofDescriptorProto::name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void OneofDescriptorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OneofDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.OneofDescriptorProto.name)
 }
-#if LANG_CXX11
-inline void OneofDescriptorProto::set_name(::std::string&& value) {
-  set_has_name();
-  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_.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) {
-  set_has_name();
-  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();
+inline std::string* OneofDescriptorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* OneofDescriptorProto::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name)
-  clear_has_name();
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& OneofDescriptorProto::_internal_name() const {
+  return name_.Get();
 }
-inline void OneofDescriptorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
-  } else {
-    clear_has_name();
+inline void OneofDescriptorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* OneofDescriptorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* OneofDescriptorProto::release_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name)
+  if (!_internal_has_name()) {
+    return nullptr;
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-    set_has_name();
+inline void OneofDescriptorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofDescriptorProto.name)
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name)
 }
 
 // optional .google.protobuf.OneofOptions options = 2;
-inline bool OneofDescriptorProto::has_options() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool OneofDescriptorProto::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void OneofDescriptorProto::set_has_options() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool OneofDescriptorProto::has_options() const {
+  return _internal_has_options();
 }
-inline void OneofDescriptorProto::clear_has_options() {
+inline void OneofDescriptorProto::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void OneofDescriptorProto::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::OneofOptions& OneofDescriptorProto::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::OneofOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::OneofOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_OneofOptions_default_instance_);
 }
-inline const ::google::protobuf::OneofOptions& OneofDescriptorProto::options() const {
-  const ::google::protobuf::OneofOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::OneofOptions& OneofDescriptorProto::options() const {
   // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.options)
-  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::OneofOptions*>(
-      &::google::protobuf::_OneofOptions_default_instance_);
+  return _internal_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_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void OneofDescriptorProto::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::OneofOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
+  }
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
   }
-  options_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofDescriptorProto.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::release_options() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::OneofOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.options)
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::OneofOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::OneofOptions* OneofDescriptorProto::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000002u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::OneofOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.options)
   return options_;
 }
-inline void OneofDescriptorProto::set_allocated_options(::google::protobuf::OneofOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::OneofOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.options)
+  return _msg;
+}
+inline void OneofDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::OneofOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::OneofOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000002u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.options)
@@ -7738,50 +10756,58 @@ inline void OneofDescriptorProto::set_allocated_options(::google::protobuf::Oneo
 // 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 bool EnumDescriptorProto_EnumReservedRange::_internal_has_start() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void EnumDescriptorProto_EnumReservedRange::clear_has_start() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool EnumDescriptorProto_EnumReservedRange::has_start() const {
+  return _internal_has_start();
 }
 inline void EnumDescriptorProto_EnumReservedRange::clear_start() {
   start_ = 0;
-  clear_has_start();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 EnumDescriptorProto_EnumReservedRange::start() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.start)
+inline int32_t EnumDescriptorProto_EnumReservedRange::_internal_start() const {
   return start_;
 }
-inline void EnumDescriptorProto_EnumReservedRange::set_start(::google::protobuf::int32 value) {
-  set_has_start();
+inline int32_t EnumDescriptorProto_EnumReservedRange::start() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.start)
+  return _internal_start();
+}
+inline void EnumDescriptorProto_EnumReservedRange::_internal_set_start(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   start_ = value;
+}
+inline void EnumDescriptorProto_EnumReservedRange::set_start(int32_t value) {
+  _internal_set_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 bool EnumDescriptorProto_EnumReservedRange::_internal_has_end() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void EnumDescriptorProto_EnumReservedRange::clear_has_end() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool EnumDescriptorProto_EnumReservedRange::has_end() const {
+  return _internal_has_end();
 }
 inline void EnumDescriptorProto_EnumReservedRange::clear_end() {
   end_ = 0;
-  clear_has_end();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 EnumDescriptorProto_EnumReservedRange::end() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.end)
+inline int32_t EnumDescriptorProto_EnumReservedRange::_internal_end() const {
   return end_;
 }
-inline void EnumDescriptorProto_EnumReservedRange::set_end(::google::protobuf::int32 value) {
-  set_has_end();
+inline int32_t EnumDescriptorProto_EnumReservedRange::end() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.end)
+  return _internal_end();
+}
+inline void EnumDescriptorProto_EnumReservedRange::_internal_set_end(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   end_ = value;
+}
+inline void EnumDescriptorProto_EnumReservedRange::set_end(int32_t value) {
+  _internal_set_end(value);
   // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.EnumReservedRange.end)
 }
 
@@ -7790,242 +10816,280 @@ inline void EnumDescriptorProto_EnumReservedRange::set_end(::google::protobuf::i
 // EnumDescriptorProto
 
 // optional string name = 1;
-inline bool EnumDescriptorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void EnumDescriptorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool EnumDescriptorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void EnumDescriptorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool EnumDescriptorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void EnumDescriptorProto::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& EnumDescriptorProto::name() const {
+inline const std::string& EnumDescriptorProto::name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void EnumDescriptorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void EnumDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.name)
 }
-#if LANG_CXX11
-inline void EnumDescriptorProto::set_name(::std::string&& value) {
-  set_has_name();
-  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_.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) {
-  set_has_name();
-  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();
+inline std::string* EnumDescriptorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* EnumDescriptorProto::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name)
-  clear_has_name();
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& EnumDescriptorProto::_internal_name() const {
+  return name_.Get();
 }
-inline void EnumDescriptorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
-  } else {
-    clear_has_name();
+inline void EnumDescriptorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* EnumDescriptorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* EnumDescriptorProto::release_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name)
+  if (!_internal_has_name()) {
+    return nullptr;
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-    set_has_name();
+inline void EnumDescriptorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumDescriptorProto.name)
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name)
 }
 
 // repeated .google.protobuf.EnumValueDescriptorProto value = 2;
-inline int EnumDescriptorProto::value_size() const {
+inline int EnumDescriptorProto::_internal_value_size() const {
   return value_.size();
 }
+inline int EnumDescriptorProto::value_size() const {
+  return _internal_value_size();
+}
 inline void EnumDescriptorProto::clear_value() {
   value_.Clear();
 }
-inline const ::google::protobuf::EnumValueDescriptorProto& EnumDescriptorProto::value(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.value)
-  return value_.Get(index);
-}
-inline ::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::mutable_value(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* EnumDescriptorProto::mutable_value(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.value)
   return value_.Mutable(index);
 }
-inline ::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::add_value() {
-  // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.value)
-  return value_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto >*
 EnumDescriptorProto::mutable_value() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.value)
   return &value_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto& EnumDescriptorProto::_internal_value(int index) const {
+  return value_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto& EnumDescriptorProto::value(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.value)
+  return _internal_value(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* EnumDescriptorProto::_internal_add_value() {
+  return value_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* EnumDescriptorProto::add_value() {
+  ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* _add = _internal_add_value();
+  // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.value)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto >&
 EnumDescriptorProto::value() const {
   // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.value)
   return value_;
 }
 
 // optional .google.protobuf.EnumOptions options = 3;
-inline bool EnumDescriptorProto::has_options() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool EnumDescriptorProto::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void EnumDescriptorProto::set_has_options() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool EnumDescriptorProto::has_options() const {
+  return _internal_has_options();
 }
-inline void EnumDescriptorProto::clear_has_options() {
+inline void EnumDescriptorProto::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void EnumDescriptorProto::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::EnumOptions& EnumDescriptorProto::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::EnumOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::EnumOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_EnumOptions_default_instance_);
 }
-inline const ::google::protobuf::EnumOptions& EnumDescriptorProto::options() const {
-  const ::google::protobuf::EnumOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::EnumOptions& EnumDescriptorProto::options() const {
   // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.options)
-  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::EnumOptions*>(
-      &::google::protobuf::_EnumOptions_default_instance_);
+  return _internal_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_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void EnumDescriptorProto::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::EnumOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
+  }
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
   }
-  options_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumDescriptorProto.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::release_options() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::EnumOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.options)
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::EnumOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000002u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.options)
   return options_;
 }
-inline void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::EnumOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.options)
+  return _msg;
+}
+inline void EnumDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::EnumOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::EnumOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000002u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.options)
 }
 
 // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;
-inline int EnumDescriptorProto::reserved_range_size() const {
+inline int EnumDescriptorProto::_internal_reserved_range_size() const {
   return reserved_range_.size();
 }
+inline int EnumDescriptorProto::reserved_range_size() const {
+  return _internal_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) {
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::mutable_reserved_range(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.reserved_range)
   return reserved_range_.Mutable(index);
 }
-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 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange >*
 EnumDescriptorProto::mutable_reserved_range() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.reserved_range)
   return &reserved_range_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >&
+inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange& EnumDescriptorProto::_internal_reserved_range(int index) const {
+  return reserved_range_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange& EnumDescriptorProto::reserved_range(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.reserved_range)
+  return _internal_reserved_range(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::_internal_add_reserved_range() {
+  return reserved_range_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::add_reserved_range() {
+  ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* _add = _internal_add_reserved_range();
+  // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_range)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange >&
 EnumDescriptorProto::reserved_range() const {
   // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.reserved_range)
   return reserved_range_;
 }
 
 // repeated string reserved_name = 5;
-inline int EnumDescriptorProto::reserved_name_size() const {
+inline int EnumDescriptorProto::_internal_reserved_name_size() const {
   return reserved_name_.size();
 }
+inline int EnumDescriptorProto::reserved_name_size() const {
+  return _internal_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)
+inline std::string* EnumDescriptorProto::add_reserved_name() {
+  std::string* _s = _internal_add_reserved_name();
+  // @@protoc_insertion_point(field_add_mutable:google.protobuf.EnumDescriptorProto.reserved_name)
+  return _s;
+}
+inline const std::string& EnumDescriptorProto::_internal_reserved_name(int index) const {
   return reserved_name_.Get(index);
 }
-inline ::std::string* EnumDescriptorProto::mutable_reserved_name(int index) {
+inline const std::string& EnumDescriptorProto::reserved_name(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.reserved_name)
+  return _internal_reserved_name(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)
+inline void EnumDescriptorProto::set_reserved_name(int index, const std::string& value) {
   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)
+}
+inline void EnumDescriptorProto::set_reserved_name(int index, std::string&& value) {
   reserved_name_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.reserved_name)
 }
-#endif
 inline void EnumDescriptorProto::set_reserved_name(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   reserved_name_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.reserved_name)
 }
@@ -8034,22 +11098,19 @@ inline void EnumDescriptorProto::set_reserved_name(int index, const char* value,
     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)
+inline std::string* EnumDescriptorProto::_internal_add_reserved_name() {
   return reserved_name_.Add();
 }
-inline void EnumDescriptorProto::add_reserved_name(const ::std::string& value) {
+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) {
+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);
+  GOOGLE_DCHECK(value != nullptr);
   reserved_name_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:google.protobuf.EnumDescriptorProto.reserved_name)
 }
@@ -8057,12 +11118,12 @@ inline void EnumDescriptorProto::add_reserved_name(const char* value, size_t siz
   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>&
+inline const ::PROTOBUF_NAMESPACE_ID::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>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 EnumDescriptorProto::mutable_reserved_name() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.reserved_name)
   return &reserved_name_;
@@ -8073,174 +11134,187 @@ EnumDescriptorProto::mutable_reserved_name() {
 // EnumValueDescriptorProto
 
 // optional string name = 1;
-inline bool EnumValueDescriptorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void EnumValueDescriptorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool EnumValueDescriptorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void EnumValueDescriptorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool EnumValueDescriptorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void EnumValueDescriptorProto::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& EnumValueDescriptorProto::name() const {
+inline const std::string& EnumValueDescriptorProto::name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void EnumValueDescriptorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void EnumValueDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.name)
 }
-#if LANG_CXX11
-inline void EnumValueDescriptorProto::set_name(::std::string&& value) {
-  set_has_name();
-  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_.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) {
-  set_has_name();
-  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();
+inline std::string* EnumValueDescriptorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* EnumValueDescriptorProto::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name)
-  clear_has_name();
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& EnumValueDescriptorProto::_internal_name() const {
+  return name_.Get();
 }
-inline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
-  } else {
-    clear_has_name();
+inline void EnumValueDescriptorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* EnumValueDescriptorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* EnumValueDescriptorProto::release_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name)
+  if (!_internal_has_name()) {
+    return nullptr;
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-    set_has_name();
+inline void EnumValueDescriptorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueDescriptorProto.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name)
 }
 
 // optional int32 number = 2;
-inline bool EnumValueDescriptorProto::has_number() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool EnumValueDescriptorProto::_internal_has_number() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void EnumValueDescriptorProto::set_has_number() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void EnumValueDescriptorProto::clear_has_number() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool EnumValueDescriptorProto::has_number() const {
+  return _internal_has_number();
 }
 inline void EnumValueDescriptorProto::clear_number() {
   number_ = 0;
-  clear_has_number();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 EnumValueDescriptorProto::number() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.number)
+inline int32_t EnumValueDescriptorProto::_internal_number() const {
   return number_;
 }
-inline void EnumValueDescriptorProto::set_number(::google::protobuf::int32 value) {
-  set_has_number();
+inline int32_t EnumValueDescriptorProto::number() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.number)
+  return _internal_number();
+}
+inline void EnumValueDescriptorProto::_internal_set_number(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   number_ = value;
+}
+inline void EnumValueDescriptorProto::set_number(int32_t value) {
+  _internal_set_number(value);
   // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.number)
 }
 
 // optional .google.protobuf.EnumValueOptions options = 3;
-inline bool EnumValueDescriptorProto::has_options() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool EnumValueDescriptorProto::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void EnumValueDescriptorProto::set_has_options() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool EnumValueDescriptorProto::has_options() const {
+  return _internal_has_options();
 }
-inline void EnumValueDescriptorProto::clear_has_options() {
+inline void EnumValueDescriptorProto::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void EnumValueDescriptorProto::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions& EnumValueDescriptorProto::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_EnumValueOptions_default_instance_);
 }
-inline const ::google::protobuf::EnumValueOptions& EnumValueDescriptorProto::options() const {
-  const ::google::protobuf::EnumValueOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions& EnumValueDescriptorProto::options() const {
   // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.options)
-  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::EnumValueOptions*>(
-      &::google::protobuf::_EnumValueOptions_default_instance_);
+  return _internal_options();
 }
-inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::release_options() {
-  // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options)
-  clear_has_options();
-  ::google::protobuf::EnumValueOptions* temp = options_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void EnumValueDescriptorProto::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
   }
-  options_ = NULL;
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueDescriptorProto.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::release_options() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options)
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000002u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValueOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.options)
   return options_;
 }
-inline void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::EnumValueOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.options)
+  return _msg;
+}
+inline void EnumValueDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::EnumValueOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000002u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.options)
@@ -8251,180 +11325,199 @@ inline void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::
 // ServiceDescriptorProto
 
 // optional string name = 1;
-inline bool ServiceDescriptorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ServiceDescriptorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ServiceDescriptorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ServiceDescriptorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ServiceDescriptorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void ServiceDescriptorProto::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& ServiceDescriptorProto::name() const {
+inline const std::string& ServiceDescriptorProto::name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void ServiceDescriptorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ServiceDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.ServiceDescriptorProto.name)
 }
-#if LANG_CXX11
-inline void ServiceDescriptorProto::set_name(::std::string&& value) {
-  set_has_name();
-  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_.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) {
-  set_has_name();
-  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();
+inline std::string* ServiceDescriptorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* ServiceDescriptorProto::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name)
-  clear_has_name();
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& ServiceDescriptorProto::_internal_name() const {
+  return name_.Get();
 }
-inline void ServiceDescriptorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
-  } else {
-    clear_has_name();
+inline void ServiceDescriptorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* ServiceDescriptorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* ServiceDescriptorProto::release_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name)
+  if (!_internal_has_name()) {
+    return nullptr;
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-    set_has_name();
+inline void ServiceDescriptorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceDescriptorProto.name)
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name)
 }
 
 // repeated .google.protobuf.MethodDescriptorProto method = 2;
-inline int ServiceDescriptorProto::method_size() const {
+inline int ServiceDescriptorProto::_internal_method_size() const {
   return method_.size();
 }
+inline int ServiceDescriptorProto::method_size() const {
+  return _internal_method_size();
+}
 inline void ServiceDescriptorProto::clear_method() {
   method_.Clear();
 }
-inline const ::google::protobuf::MethodDescriptorProto& ServiceDescriptorProto::method(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.method)
-  return method_.Get(index);
-}
-inline ::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::mutable_method(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* ServiceDescriptorProto::mutable_method(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.method)
   return method_.Mutable(index);
 }
-inline ::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::add_method() {
-  // @@protoc_insertion_point(field_add:google.protobuf.ServiceDescriptorProto.method)
-  return method_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto >*
 ServiceDescriptorProto::mutable_method() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceDescriptorProto.method)
   return &method_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >&
+inline const ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto& ServiceDescriptorProto::_internal_method(int index) const {
+  return method_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto& ServiceDescriptorProto::method(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.method)
+  return _internal_method(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* ServiceDescriptorProto::_internal_add_method() {
+  return method_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* ServiceDescriptorProto::add_method() {
+  ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* _add = _internal_add_method();
+  // @@protoc_insertion_point(field_add:google.protobuf.ServiceDescriptorProto.method)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto >&
 ServiceDescriptorProto::method() const {
   // @@protoc_insertion_point(field_list:google.protobuf.ServiceDescriptorProto.method)
   return method_;
 }
 
 // optional .google.protobuf.ServiceOptions options = 3;
-inline bool ServiceDescriptorProto::has_options() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool ServiceDescriptorProto::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void ServiceDescriptorProto::set_has_options() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ServiceDescriptorProto::has_options() const {
+  return _internal_has_options();
 }
-inline void ServiceDescriptorProto::clear_has_options() {
+inline void ServiceDescriptorProto::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void ServiceDescriptorProto::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::ServiceOptions& ServiceDescriptorProto::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::ServiceOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::ServiceOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_ServiceOptions_default_instance_);
 }
-inline const ::google::protobuf::ServiceOptions& ServiceDescriptorProto::options() const {
-  const ::google::protobuf::ServiceOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::ServiceOptions& ServiceDescriptorProto::options() const {
   // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.options)
-  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::ServiceOptions*>(
-      &::google::protobuf::_ServiceOptions_default_instance_);
+  return _internal_options();
 }
-inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::release_options() {
-  // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options)
-  clear_has_options();
-  ::google::protobuf::ServiceOptions* temp = options_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void ServiceDescriptorProto::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::ServiceOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
+  }
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
   }
-  options_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceDescriptorProto.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::release_options() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::ServiceOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options)
+  _has_bits_[0] &= ~0x00000002u;
+  ::PROTOBUF_NAMESPACE_ID::ServiceOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000002u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ServiceOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.options)
   return options_;
 }
-inline void ServiceDescriptorProto::set_allocated_options(::google::protobuf::ServiceOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::ServiceOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.options)
+  return _msg;
+}
+inline void ServiceDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::ServiceOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::ServiceOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000002u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.options)
@@ -8435,370 +11528,355 @@ inline void ServiceDescriptorProto::set_allocated_options(::google::protobuf::Se
 // MethodDescriptorProto
 
 // optional string name = 1;
-inline bool MethodDescriptorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void MethodDescriptorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool MethodDescriptorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void MethodDescriptorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool MethodDescriptorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void MethodDescriptorProto::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& MethodDescriptorProto::name() const {
+inline const std::string& MethodDescriptorProto::name() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void MethodDescriptorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void MethodDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.name)
 }
-#if LANG_CXX11
-inline void MethodDescriptorProto::set_name(::std::string&& value) {
-  set_has_name();
-  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_.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) {
-  set_has_name();
-  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();
+inline std::string* MethodDescriptorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* MethodDescriptorProto::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name)
-  clear_has_name();
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& MethodDescriptorProto::_internal_name() const {
+  return name_.Get();
 }
-inline void MethodDescriptorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
-  } else {
-    clear_has_name();
+inline void MethodDescriptorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* MethodDescriptorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* MethodDescriptorProto::release_name() {
+  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name)
+  if (!_internal_has_name()) {
+    return nullptr;
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-    set_has_name();
+inline void MethodDescriptorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name)
 }
 
 // optional string input_type = 2;
-inline bool MethodDescriptorProto::has_input_type() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool MethodDescriptorProto::_internal_has_input_type() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void MethodDescriptorProto::set_has_input_type() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void MethodDescriptorProto::clear_has_input_type() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool MethodDescriptorProto::has_input_type() const {
+  return _internal_has_input_type();
 }
 inline void MethodDescriptorProto::clear_input_type() {
-  input_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_input_type();
+  input_type_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& MethodDescriptorProto::input_type() const {
+inline const std::string& MethodDescriptorProto::input_type() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.input_type)
-  return input_type_.Get();
+  return _internal_input_type();
 }
-inline void MethodDescriptorProto::set_input_type(const ::std::string& value) {
-  set_has_input_type();
-  input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void MethodDescriptorProto::set_input_type(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ input_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_input_type();
-  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();
+inline std::string* MethodDescriptorProto::mutable_input_type() {
+  std::string* _s = _internal_mutable_input_type();
   // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.input_type)
-  return input_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* MethodDescriptorProto::release_input_type() {
-  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type)
-  clear_has_input_type();
-  return input_type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& MethodDescriptorProto::_internal_input_type() const {
+  return input_type_.Get();
 }
-inline void MethodDescriptorProto::set_allocated_input_type(::std::string* input_type) {
-  if (input_type != NULL) {
-    set_has_input_type();
-  } else {
-    clear_has_input_type();
+inline void MethodDescriptorProto::_internal_set_input_type(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  input_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* MethodDescriptorProto::_internal_mutable_input_type() {
+  _has_bits_[0] |= 0x00000002u;
+  return input_type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* MethodDescriptorProto::release_input_type() {
+  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type)
+  if (!_internal_has_input_type()) {
+    return nullptr;
   }
-  input_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), input_type,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type)
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = input_type_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (input_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    input_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_input_type(
-    ::std::string* input_type) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (input_type != NULL) {
-    set_has_input_type();
+inline void MethodDescriptorProto::set_allocated_input_type(std::string* input_type) {
+  if (input_type != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_input_type();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  input_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), input_type,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (input_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    input_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  input_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      input_type, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.input_type)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type)
 }
 
 // optional string output_type = 3;
-inline bool MethodDescriptorProto::has_output_type() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void MethodDescriptorProto::set_has_output_type() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool MethodDescriptorProto::_internal_has_output_type() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void MethodDescriptorProto::clear_has_output_type() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool MethodDescriptorProto::has_output_type() const {
+  return _internal_has_output_type();
 }
 inline void MethodDescriptorProto::clear_output_type() {
-  output_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_output_type();
+  output_type_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& MethodDescriptorProto::output_type() const {
+inline const std::string& MethodDescriptorProto::output_type() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.output_type)
-  return output_type_.Get();
+  return _internal_output_type();
 }
-inline void MethodDescriptorProto::set_output_type(const ::std::string& value) {
-  set_has_output_type();
-  output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void MethodDescriptorProto::set_output_type(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ output_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_output_type();
-  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();
+inline std::string* MethodDescriptorProto::mutable_output_type() {
+  std::string* _s = _internal_mutable_output_type();
   // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.output_type)
-  return output_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* MethodDescriptorProto::release_output_type() {
-  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type)
-  clear_has_output_type();
-  return output_type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& MethodDescriptorProto::_internal_output_type() const {
+  return output_type_.Get();
 }
-inline void MethodDescriptorProto::set_allocated_output_type(::std::string* output_type) {
-  if (output_type != NULL) {
-    set_has_output_type();
-  } else {
-    clear_has_output_type();
+inline void MethodDescriptorProto::_internal_set_output_type(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  output_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* MethodDescriptorProto::_internal_mutable_output_type() {
+  _has_bits_[0] |= 0x00000004u;
+  return output_type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* MethodDescriptorProto::release_output_type() {
+  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type)
+  if (!_internal_has_output_type()) {
+    return nullptr;
   }
-  output_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_type,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type)
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = output_type_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (output_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    output_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_output_type(
-    ::std::string* output_type) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (output_type != NULL) {
-    set_has_output_type();
+inline void MethodDescriptorProto::set_allocated_output_type(std::string* output_type) {
+  if (output_type != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_output_type();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  output_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), output_type,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (output_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    output_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  output_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      output_type, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.output_type)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type)
 }
 
 // optional .google.protobuf.MethodOptions options = 4;
-inline bool MethodDescriptorProto::has_options() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool MethodDescriptorProto::_internal_has_options() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  PROTOBUF_ASSUME(!value || options_ != nullptr);
+  return value;
 }
-inline void MethodDescriptorProto::set_has_options() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool MethodDescriptorProto::has_options() const {
+  return _internal_has_options();
 }
-inline void MethodDescriptorProto::clear_has_options() {
+inline void MethodDescriptorProto::clear_options() {
+  if (options_ != nullptr) options_->Clear();
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void MethodDescriptorProto::clear_options() {
-  if (options_ != NULL) options_->Clear();
-  clear_has_options();
+inline const ::PROTOBUF_NAMESPACE_ID::MethodOptions& MethodDescriptorProto::_internal_options() const {
+  const ::PROTOBUF_NAMESPACE_ID::MethodOptions* p = options_;
+  return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::MethodOptions&>(
+      ::PROTOBUF_NAMESPACE_ID::_MethodOptions_default_instance_);
 }
-inline const ::google::protobuf::MethodOptions& MethodDescriptorProto::options() const {
-  const ::google::protobuf::MethodOptions* p = options_;
+inline const ::PROTOBUF_NAMESPACE_ID::MethodOptions& MethodDescriptorProto::options() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.options)
-  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::MethodOptions*>(
-      &::google::protobuf::_MethodOptions_default_instance_);
+  return _internal_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_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+inline void MethodDescriptorProto::unsafe_arena_set_allocated_options(
+    ::PROTOBUF_NAMESPACE_ID::MethodOptions* options) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_);
+  }
+  options_ = options;
+  if (options) {
+    _has_bits_[0] |= 0x00000008u;
+  } else {
+    _has_bits_[0] &= ~0x00000008u;
   }
-  options_ = NULL;
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.options)
+}
+inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::release_options() {
+  _has_bits_[0] &= ~0x00000008u;
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions* temp = options_;
+  options_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
-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;
+inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::unsafe_arena_release_options() {
+  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.options)
+  _has_bits_[0] &= ~0x00000008u;
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions* temp = options_;
+  options_ = nullptr;
   return temp;
 }
-inline ::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options() {
-  set_has_options();
-  if (options_ == NULL) {
-    _slow_mutable_options();
+inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::_internal_mutable_options() {
+  _has_bits_[0] |= 0x00000008u;
+  if (options_ == nullptr) {
+    auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MethodOptions>(GetArenaForAllocation());
+    options_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.options)
   return options_;
 }
-inline void MethodDescriptorProto::set_allocated_options(::google::protobuf::MethodOptions* options) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::mutable_options() {
+  ::PROTOBUF_NAMESPACE_ID::MethodOptions* _msg = _internal_mutable_options();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.options)
+  return _msg;
+}
+inline void MethodDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::MethodOptions* options) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete options_;
   }
   if (options) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(options);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::MethodOptions>::GetOwningArena(options);
     if (message_arena != submessage_arena) {
-      options = ::google::protobuf::internal::GetOwnedMessage(
+      options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, options, submessage_arena);
     }
-    set_has_options();
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_options();
+    _has_bits_[0] &= ~0x00000008u;
   }
   options_ = options;
   // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.options)
 }
 
 // optional bool client_streaming = 5 [default = false];
-inline bool MethodDescriptorProto::has_client_streaming() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void MethodDescriptorProto::set_has_client_streaming() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool MethodDescriptorProto::_internal_has_client_streaming() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void MethodDescriptorProto::clear_has_client_streaming() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool MethodDescriptorProto::has_client_streaming() const {
+  return _internal_has_client_streaming();
 }
 inline void MethodDescriptorProto::clear_client_streaming() {
   client_streaming_ = false;
-  clear_has_client_streaming();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline bool MethodDescriptorProto::_internal_client_streaming() const {
+  return client_streaming_;
 }
 inline bool MethodDescriptorProto::client_streaming() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.client_streaming)
-  return client_streaming_;
+  return _internal_client_streaming();
 }
-inline void MethodDescriptorProto::set_client_streaming(bool value) {
-  set_has_client_streaming();
+inline void MethodDescriptorProto::_internal_set_client_streaming(bool value) {
+  _has_bits_[0] |= 0x00000010u;
   client_streaming_ = value;
+}
+inline void MethodDescriptorProto::set_client_streaming(bool value) {
+  _internal_set_client_streaming(value);
   // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.client_streaming)
 }
 
 // optional bool server_streaming = 6 [default = false];
-inline bool MethodDescriptorProto::has_server_streaming() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void MethodDescriptorProto::set_has_server_streaming() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool MethodDescriptorProto::_internal_has_server_streaming() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void MethodDescriptorProto::clear_has_server_streaming() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool MethodDescriptorProto::has_server_streaming() const {
+  return _internal_has_server_streaming();
 }
 inline void MethodDescriptorProto::clear_server_streaming() {
   server_streaming_ = false;
-  clear_has_server_streaming();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline bool MethodDescriptorProto::_internal_server_streaming() const {
+  return server_streaming_;
 }
 inline bool MethodDescriptorProto::server_streaming() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.server_streaming)
-  return server_streaming_;
+  return _internal_server_streaming();
+}
+inline void MethodDescriptorProto::_internal_set_server_streaming(bool value) {
+  _has_bits_[0] |= 0x00000020u;
+  server_streaming_ = value;
 }
 inline void MethodDescriptorProto::set_server_streaming(bool value) {
-  set_has_server_streaming();
-  server_streaming_ = value;
+  _internal_set_server_streaming(value);
   // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.server_streaming)
 }
 
@@ -8807,951 +11885,1011 @@ inline void MethodDescriptorProto::set_server_streaming(bool value) {
 // FileOptions
 
 // optional string java_package = 1;
-inline bool FileOptions::has_java_package() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool FileOptions::_internal_has_java_package() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void FileOptions::set_has_java_package() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void FileOptions::clear_has_java_package() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool FileOptions::has_java_package() const {
+  return _internal_has_java_package();
 }
 inline void FileOptions::clear_java_package() {
-  java_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_java_package();
+  java_package_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& FileOptions::java_package() const {
+inline const std::string& FileOptions::java_package() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_package)
-  return java_package_.Get();
+  return _internal_java_package();
 }
-inline void FileOptions::set_java_package(const ::std::string& value) {
-  set_has_java_package();
-  java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_java_package(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ java_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_java_package();
-  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();
+inline std::string* FileOptions::mutable_java_package() {
+  std::string* _s = _internal_mutable_java_package();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_package)
-  return java_package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FileOptions::release_java_package() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package)
-  clear_has_java_package();
-  return java_package_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FileOptions::_internal_java_package() const {
+  return java_package_.Get();
 }
-inline void FileOptions::set_allocated_java_package(::std::string* java_package) {
-  if (java_package != NULL) {
-    set_has_java_package();
-  } else {
-    clear_has_java_package();
+inline void FileOptions::_internal_set_java_package(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  java_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FileOptions::_internal_mutable_java_package() {
+  _has_bits_[0] |= 0x00000001u;
+  return java_package_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FileOptions::release_java_package() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package)
+  if (!_internal_has_java_package()) {
+    return nullptr;
   }
-  java_package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_package,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = java_package_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (java_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    java_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_java_package(
-    ::std::string* java_package) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (java_package != NULL) {
-    set_has_java_package();
+inline void FileOptions::set_allocated_java_package(std::string* java_package) {
+  if (java_package != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_java_package();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  java_package_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), java_package,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (java_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    java_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  java_package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      java_package, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.java_package)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package)
 }
 
 // optional string java_outer_classname = 8;
-inline bool FileOptions::has_java_outer_classname() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void FileOptions::set_has_java_outer_classname() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool FileOptions::_internal_has_java_outer_classname() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_java_outer_classname() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool FileOptions::has_java_outer_classname() const {
+  return _internal_has_java_outer_classname();
 }
 inline void FileOptions::clear_java_outer_classname() {
-  java_outer_classname_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_java_outer_classname();
+  java_outer_classname_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& FileOptions::java_outer_classname() const {
+inline const std::string& FileOptions::java_outer_classname() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_outer_classname)
-  return java_outer_classname_.Get();
+  return _internal_java_outer_classname();
 }
-inline void FileOptions::set_java_outer_classname(const ::std::string& value) {
-  set_has_java_outer_classname();
-  java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_java_outer_classname(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ java_outer_classname_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_java_outer_classname();
-  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();
+inline std::string* FileOptions::mutable_java_outer_classname() {
+  std::string* _s = _internal_mutable_java_outer_classname();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_outer_classname)
-  return java_outer_classname_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-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_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FileOptions::_internal_java_outer_classname() const {
+  return java_outer_classname_.Get();
 }
-inline 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();
+inline void FileOptions::_internal_set_java_outer_classname(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  java_outer_classname_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FileOptions::_internal_mutable_java_outer_classname() {
+  _has_bits_[0] |= 0x00000002u;
+  return java_outer_classname_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FileOptions::release_java_outer_classname() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_outer_classname)
+  if (!_internal_has_java_outer_classname()) {
+    return nullptr;
   }
-  java_outer_classname_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_outer_classname,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_outer_classname)
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = java_outer_classname_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (java_outer_classname_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    java_outer_classname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::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();
+inline void FileOptions::set_allocated_java_outer_classname(std::string* java_outer_classname) {
+  if (java_outer_classname != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_java_outer_classname();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  java_outer_classname_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), java_outer_classname,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (java_outer_classname_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    java_outer_classname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  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)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_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] & 0x00000200u) != 0;
+inline bool FileOptions::_internal_has_java_multiple_files() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void FileOptions::set_has_java_multiple_files() {
-  _has_bits_[0] |= 0x00000200u;
-}
-inline void FileOptions::clear_has_java_multiple_files() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool FileOptions::has_java_multiple_files() const {
+  return _internal_has_java_multiple_files();
 }
 inline void FileOptions::clear_java_multiple_files() {
   java_multiple_files_ = false;
-  clear_has_java_multiple_files();
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline bool FileOptions::_internal_java_multiple_files() const {
+  return java_multiple_files_;
 }
 inline bool FileOptions::java_multiple_files() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_multiple_files)
-  return java_multiple_files_;
+  return _internal_java_multiple_files();
 }
-inline void FileOptions::set_java_multiple_files(bool value) {
-  set_has_java_multiple_files();
+inline void FileOptions::_internal_set_java_multiple_files(bool value) {
+  _has_bits_[0] |= 0x00000400u;
   java_multiple_files_ = value;
+}
+inline void FileOptions::set_java_multiple_files(bool value) {
+  _internal_set_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];
-inline bool FileOptions::has_java_generate_equals_and_hash() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
-}
-inline void FileOptions::set_has_java_generate_equals_and_hash() {
-  _has_bits_[0] |= 0x00000400u;
+inline bool FileOptions::_internal_has_java_generate_equals_and_hash() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_java_generate_equals_and_hash() {
-  _has_bits_[0] &= ~0x00000400u;
+inline bool FileOptions::has_java_generate_equals_and_hash() const {
+  return _internal_has_java_generate_equals_and_hash();
 }
 inline void FileOptions::clear_java_generate_equals_and_hash() {
   java_generate_equals_and_hash_ = false;
-  clear_has_java_generate_equals_and_hash();
+  _has_bits_[0] &= ~0x00000800u;
+}
+inline bool FileOptions::_internal_java_generate_equals_and_hash() const {
+  return java_generate_equals_and_hash_;
 }
 inline bool FileOptions::java_generate_equals_and_hash() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generate_equals_and_hash)
-  return java_generate_equals_and_hash_;
+  return _internal_java_generate_equals_and_hash();
 }
-inline void FileOptions::set_java_generate_equals_and_hash(bool value) {
-  set_has_java_generate_equals_and_hash();
+inline void FileOptions::_internal_set_java_generate_equals_and_hash(bool value) {
+  _has_bits_[0] |= 0x00000800u;
   java_generate_equals_and_hash_ = value;
+}
+inline void FileOptions::set_java_generate_equals_and_hash(bool value) {
+  _internal_set_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];
-inline bool FileOptions::has_java_string_check_utf8() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
-}
-inline void FileOptions::set_has_java_string_check_utf8() {
-  _has_bits_[0] |= 0x00000800u;
+inline bool FileOptions::_internal_has_java_string_check_utf8() const {
+  bool value = (_has_bits_[0] & 0x00001000u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_java_string_check_utf8() {
-  _has_bits_[0] &= ~0x00000800u;
+inline bool FileOptions::has_java_string_check_utf8() const {
+  return _internal_has_java_string_check_utf8();
 }
 inline void FileOptions::clear_java_string_check_utf8() {
   java_string_check_utf8_ = false;
-  clear_has_java_string_check_utf8();
+  _has_bits_[0] &= ~0x00001000u;
+}
+inline bool FileOptions::_internal_java_string_check_utf8() const {
+  return java_string_check_utf8_;
 }
 inline bool FileOptions::java_string_check_utf8() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_string_check_utf8)
-  return java_string_check_utf8_;
+  return _internal_java_string_check_utf8();
 }
-inline void FileOptions::set_java_string_check_utf8(bool value) {
-  set_has_java_string_check_utf8();
+inline void FileOptions::_internal_set_java_string_check_utf8(bool value) {
+  _has_bits_[0] |= 0x00001000u;
   java_string_check_utf8_ = value;
+}
+inline void FileOptions::set_java_string_check_utf8(bool value) {
+  _internal_set_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];
-inline bool FileOptions::has_optimize_for() const {
-  return (_has_bits_[0] & 0x00020000u) != 0;
-}
-inline void FileOptions::set_has_optimize_for() {
-  _has_bits_[0] |= 0x00020000u;
+inline bool FileOptions::_internal_has_optimize_for() const {
+  bool value = (_has_bits_[0] & 0x00040000u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_optimize_for() {
-  _has_bits_[0] &= ~0x00020000u;
+inline bool FileOptions::has_optimize_for() const {
+  return _internal_has_optimize_for();
 }
 inline void FileOptions::clear_optimize_for() {
   optimize_for_ = 1;
-  clear_has_optimize_for();
+  _has_bits_[0] &= ~0x00040000u;
+}
+inline ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode FileOptions::_internal_optimize_for() const {
+  return static_cast< ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode >(optimize_for_);
 }
-inline ::google::protobuf::FileOptions_OptimizeMode FileOptions::optimize_for() const {
+inline ::PROTOBUF_NAMESPACE_ID::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_);
+  return _internal_optimize_for();
 }
-inline void FileOptions::set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value) {
-  assert(::google::protobuf::FileOptions_OptimizeMode_IsValid(value));
-  set_has_optimize_for();
+inline void FileOptions::_internal_set_optimize_for(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode value) {
+  assert(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode_IsValid(value));
+  _has_bits_[0] |= 0x00040000u;
   optimize_for_ = value;
+}
+inline void FileOptions::set_optimize_for(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode value) {
+  _internal_set_optimize_for(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.optimize_for)
 }
 
 // optional string go_package = 11;
-inline bool FileOptions::has_go_package() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void FileOptions::set_has_go_package() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool FileOptions::_internal_has_go_package() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_go_package() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool FileOptions::has_go_package() const {
+  return _internal_has_go_package();
 }
 inline void FileOptions::clear_go_package() {
-  go_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_go_package();
+  go_package_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& FileOptions::go_package() const {
+inline const std::string& FileOptions::go_package() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.go_package)
-  return go_package_.Get();
+  return _internal_go_package();
 }
-inline void FileOptions::set_go_package(const ::std::string& value) {
-  set_has_go_package();
-  go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_go_package(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ go_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_go_package();
-  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();
+inline std::string* FileOptions::mutable_go_package() {
+  std::string* _s = _internal_mutable_go_package();
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.go_package)
-  return go_package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* FileOptions::release_go_package() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package)
-  clear_has_go_package();
-  return go_package_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& FileOptions::_internal_go_package() const {
+  return go_package_.Get();
 }
-inline void FileOptions::set_allocated_go_package(::std::string* go_package) {
-  if (go_package != NULL) {
-    set_has_go_package();
-  } else {
-    clear_has_go_package();
+inline void FileOptions::_internal_set_go_package(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  go_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FileOptions::_internal_mutable_go_package() {
+  _has_bits_[0] |= 0x00000004u;
+  return go_package_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FileOptions::release_go_package() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package)
+  if (!_internal_has_go_package()) {
+    return nullptr;
   }
-  go_package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), go_package,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.go_package)
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = go_package_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (go_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    go_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_go_package(
-    ::std::string* go_package) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (go_package != NULL) {
-    set_has_go_package();
+inline void FileOptions::set_allocated_go_package(std::string* go_package) {
+  if (go_package != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_go_package();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  go_package_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), go_package,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (go_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    go_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  go_package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      go_package, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.go_package)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_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] & 0x00001000u) != 0;
+inline bool FileOptions::_internal_has_cc_generic_services() const {
+  bool value = (_has_bits_[0] & 0x00002000u) != 0;
+  return value;
 }
-inline void FileOptions::set_has_cc_generic_services() {
-  _has_bits_[0] |= 0x00001000u;
-}
-inline void FileOptions::clear_has_cc_generic_services() {
-  _has_bits_[0] &= ~0x00001000u;
+inline bool FileOptions::has_cc_generic_services() const {
+  return _internal_has_cc_generic_services();
 }
 inline void FileOptions::clear_cc_generic_services() {
   cc_generic_services_ = false;
-  clear_has_cc_generic_services();
+  _has_bits_[0] &= ~0x00002000u;
+}
+inline bool FileOptions::_internal_cc_generic_services() const {
+  return cc_generic_services_;
 }
 inline bool FileOptions::cc_generic_services() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_generic_services)
-  return cc_generic_services_;
+  return _internal_cc_generic_services();
 }
-inline void FileOptions::set_cc_generic_services(bool value) {
-  set_has_cc_generic_services();
+inline void FileOptions::_internal_set_cc_generic_services(bool value) {
+  _has_bits_[0] |= 0x00002000u;
   cc_generic_services_ = value;
+}
+inline void FileOptions::set_cc_generic_services(bool value) {
+  _internal_set_cc_generic_services(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_generic_services)
 }
 
 // optional bool java_generic_services = 17 [default = false];
-inline bool FileOptions::has_java_generic_services() const {
-  return (_has_bits_[0] & 0x00002000u) != 0;
-}
-inline void FileOptions::set_has_java_generic_services() {
-  _has_bits_[0] |= 0x00002000u;
+inline bool FileOptions::_internal_has_java_generic_services() const {
+  bool value = (_has_bits_[0] & 0x00004000u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_java_generic_services() {
-  _has_bits_[0] &= ~0x00002000u;
+inline bool FileOptions::has_java_generic_services() const {
+  return _internal_has_java_generic_services();
 }
 inline void FileOptions::clear_java_generic_services() {
   java_generic_services_ = false;
-  clear_has_java_generic_services();
+  _has_bits_[0] &= ~0x00004000u;
+}
+inline bool FileOptions::_internal_java_generic_services() const {
+  return java_generic_services_;
 }
 inline bool FileOptions::java_generic_services() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generic_services)
-  return java_generic_services_;
+  return _internal_java_generic_services();
 }
-inline void FileOptions::set_java_generic_services(bool value) {
-  set_has_java_generic_services();
+inline void FileOptions::_internal_set_java_generic_services(bool value) {
+  _has_bits_[0] |= 0x00004000u;
   java_generic_services_ = value;
+}
+inline void FileOptions::set_java_generic_services(bool value) {
+  _internal_set_java_generic_services(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generic_services)
 }
 
 // optional bool py_generic_services = 18 [default = false];
-inline bool FileOptions::has_py_generic_services() const {
-  return (_has_bits_[0] & 0x00004000u) != 0;
-}
-inline void FileOptions::set_has_py_generic_services() {
-  _has_bits_[0] |= 0x00004000u;
+inline bool FileOptions::_internal_has_py_generic_services() const {
+  bool value = (_has_bits_[0] & 0x00008000u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_py_generic_services() {
-  _has_bits_[0] &= ~0x00004000u;
+inline bool FileOptions::has_py_generic_services() const {
+  return _internal_has_py_generic_services();
 }
 inline void FileOptions::clear_py_generic_services() {
   py_generic_services_ = false;
-  clear_has_py_generic_services();
+  _has_bits_[0] &= ~0x00008000u;
+}
+inline bool FileOptions::_internal_py_generic_services() const {
+  return py_generic_services_;
 }
 inline bool FileOptions::py_generic_services() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.py_generic_services)
-  return py_generic_services_;
+  return _internal_py_generic_services();
 }
-inline void FileOptions::set_py_generic_services(bool value) {
-  set_has_py_generic_services();
+inline void FileOptions::_internal_set_py_generic_services(bool value) {
+  _has_bits_[0] |= 0x00008000u;
   py_generic_services_ = value;
+}
+inline void FileOptions::set_py_generic_services(bool value) {
+  _internal_set_py_generic_services(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.py_generic_services)
 }
 
 // optional bool php_generic_services = 42 [default = false];
-inline bool FileOptions::has_php_generic_services() const {
-  return (_has_bits_[0] & 0x00008000u) != 0;
-}
-inline void FileOptions::set_has_php_generic_services() {
-  _has_bits_[0] |= 0x00008000u;
+inline bool FileOptions::_internal_has_php_generic_services() const {
+  bool value = (_has_bits_[0] & 0x00010000u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_php_generic_services() {
-  _has_bits_[0] &= ~0x00008000u;
+inline bool FileOptions::has_php_generic_services() const {
+  return _internal_has_php_generic_services();
 }
 inline void FileOptions::clear_php_generic_services() {
   php_generic_services_ = false;
-  clear_has_php_generic_services();
+  _has_bits_[0] &= ~0x00010000u;
+}
+inline bool FileOptions::_internal_php_generic_services() const {
+  return php_generic_services_;
 }
 inline bool FileOptions::php_generic_services() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_generic_services)
-  return php_generic_services_;
+  return _internal_php_generic_services();
 }
-inline void FileOptions::set_php_generic_services(bool value) {
-  set_has_php_generic_services();
+inline void FileOptions::_internal_set_php_generic_services(bool value) {
+  _has_bits_[0] |= 0x00010000u;
   php_generic_services_ = value;
+}
+inline void FileOptions::set_php_generic_services(bool value) {
+  _internal_set_php_generic_services(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_generic_services)
 }
 
 // optional bool deprecated = 23 [default = false];
-inline bool FileOptions::has_deprecated() const {
-  return (_has_bits_[0] & 0x00010000u) != 0;
+inline bool FileOptions::_internal_has_deprecated() const {
+  bool value = (_has_bits_[0] & 0x00020000u) != 0;
+  return value;
 }
-inline void FileOptions::set_has_deprecated() {
-  _has_bits_[0] |= 0x00010000u;
-}
-inline void FileOptions::clear_has_deprecated() {
-  _has_bits_[0] &= ~0x00010000u;
+inline bool FileOptions::has_deprecated() const {
+  return _internal_has_deprecated();
 }
 inline void FileOptions::clear_deprecated() {
   deprecated_ = false;
-  clear_has_deprecated();
+  _has_bits_[0] &= ~0x00020000u;
+}
+inline bool FileOptions::_internal_deprecated() const {
+  return deprecated_;
 }
 inline bool FileOptions::deprecated() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.deprecated)
-  return deprecated_;
+  return _internal_deprecated();
 }
-inline void FileOptions::set_deprecated(bool value) {
-  set_has_deprecated();
+inline void FileOptions::_internal_set_deprecated(bool value) {
+  _has_bits_[0] |= 0x00020000u;
   deprecated_ = value;
+}
+inline void FileOptions::set_deprecated(bool value) {
+  _internal_set_deprecated(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.deprecated)
 }
 
-// optional bool cc_enable_arenas = 31 [default = false];
-inline bool FileOptions::has_cc_enable_arenas() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void FileOptions::set_has_cc_enable_arenas() {
-  _has_bits_[0] |= 0x00000100u;
+// optional bool cc_enable_arenas = 31 [default = true];
+inline bool FileOptions::_internal_has_cc_enable_arenas() const {
+  bool value = (_has_bits_[0] & 0x00080000u) != 0;
+  return value;
 }
-inline void FileOptions::clear_has_cc_enable_arenas() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool FileOptions::has_cc_enable_arenas() const {
+  return _internal_has_cc_enable_arenas();
 }
 inline void FileOptions::clear_cc_enable_arenas() {
-  cc_enable_arenas_ = false;
-  clear_has_cc_enable_arenas();
+  cc_enable_arenas_ = true;
+  _has_bits_[0] &= ~0x00080000u;
+}
+inline bool FileOptions::_internal_cc_enable_arenas() const {
+  return cc_enable_arenas_;
 }
 inline bool FileOptions::cc_enable_arenas() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_enable_arenas)
-  return cc_enable_arenas_;
+  return _internal_cc_enable_arenas();
 }
-inline void FileOptions::set_cc_enable_arenas(bool value) {
-  set_has_cc_enable_arenas();
+inline void FileOptions::_internal_set_cc_enable_arenas(bool value) {
+  _has_bits_[0] |= 0x00080000u;
   cc_enable_arenas_ = value;
+}
+inline void FileOptions::set_cc_enable_arenas(bool value) {
+  _internal_set_cc_enable_arenas(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_enable_arenas)
 }
 
 // optional string objc_class_prefix = 36;
+inline bool FileOptions::_internal_has_objc_class_prefix() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
+}
 inline bool FileOptions::has_objc_class_prefix() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return _internal_has_objc_class_prefix();
 }
-inline void FileOptions::set_has_objc_class_prefix() {
+inline void FileOptions::clear_objc_class_prefix() {
+  objc_class_prefix_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline const std::string& FileOptions::objc_class_prefix() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.objc_class_prefix)
+  return _internal_objc_class_prefix();
+}
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_objc_class_prefix(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ objc_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
+  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.objc_class_prefix)
+}
+inline std::string* FileOptions::mutable_objc_class_prefix() {
+  std::string* _s = _internal_mutable_objc_class_prefix();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.objc_class_prefix)
+  return _s;
+}
+inline const std::string& FileOptions::_internal_objc_class_prefix() const {
+  return objc_class_prefix_.Get();
+}
+inline void FileOptions::_internal_set_objc_class_prefix(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  objc_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FileOptions::_internal_mutable_objc_class_prefix() {
   _has_bits_[0] |= 0x00000008u;
+  return objc_class_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline void FileOptions::clear_has_objc_class_prefix() {
+inline std::string* FileOptions::release_objc_class_prefix() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.objc_class_prefix)
+  if (!_internal_has_objc_class_prefix()) {
+    return nullptr;
+  }
   _has_bits_[0] &= ~0x00000008u;
+  auto* p = objc_class_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (objc_class_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    objc_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void FileOptions::clear_objc_class_prefix() {
-  objc_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_objc_class_prefix();
+inline void FileOptions::set_allocated_objc_class_prefix(std::string* objc_class_prefix) {
+  if (objc_class_prefix != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
+  } else {
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  objc_class_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), objc_class_prefix,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (objc_class_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    objc_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.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_.Get();
+
+// optional string csharp_namespace = 37;
+inline bool FileOptions::_internal_has_csharp_namespace() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
+}
+inline bool FileOptions::has_csharp_namespace() const {
+  return _internal_has_csharp_namespace();
+}
+inline void FileOptions::clear_csharp_namespace() {
+  csharp_namespace_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline const std::string& FileOptions::csharp_namespace() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.csharp_namespace)
+  return _internal_csharp_namespace();
+}
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_csharp_namespace(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000010u;
+ csharp_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
+  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.csharp_namespace)
+}
+inline std::string* FileOptions::mutable_csharp_namespace() {
+  std::string* _s = _internal_mutable_csharp_namespace();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.csharp_namespace)
+  return _s;
+}
+inline const std::string& FileOptions::_internal_csharp_namespace() const {
+  return csharp_namespace_.Get();
+}
+inline void FileOptions::_internal_set_csharp_namespace(const std::string& value) {
+  _has_bits_[0] |= 0x00000010u;
+  csharp_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* FileOptions::_internal_mutable_csharp_namespace() {
+  _has_bits_[0] |= 0x00000010u;
+  return csharp_namespace_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* FileOptions::release_csharp_namespace() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace)
+  if (!_internal_has_csharp_namespace()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000010u;
+  auto* p = csharp_namespace_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (csharp_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    csharp_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
+}
+inline void FileOptions::set_allocated_csharp_namespace(std::string* csharp_namespace) {
+  if (csharp_namespace != nullptr) {
+    _has_bits_[0] |= 0x00000010u;
+  } else {
+    _has_bits_[0] &= ~0x00000010u;
+  }
+  csharp_namespace_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), csharp_namespace,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (csharp_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    csharp_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace)
+}
+
+// optional string swift_prefix = 39;
+inline bool FileOptions::_internal_has_swift_prefix() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
+}
+inline bool FileOptions::has_swift_prefix() const {
+  return _internal_has_swift_prefix();
+}
+inline void FileOptions::clear_swift_prefix() {
+  swift_prefix_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline const std::string& FileOptions::swift_prefix() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.swift_prefix)
+  return _internal_swift_prefix();
+}
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_swift_prefix(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000020u;
+ swift_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
+  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.swift_prefix)
 }
-inline void FileOptions::set_objc_class_prefix(const ::std::string& value) {
-  set_has_objc_class_prefix();
-  objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.objc_class_prefix)
+inline std::string* FileOptions::mutable_swift_prefix() {
+  std::string* _s = _internal_mutable_swift_prefix();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.swift_prefix)
+  return _s;
 }
-#if LANG_CXX11
-inline void FileOptions::set_objc_class_prefix(::std::string&& value) {
-  set_has_objc_class_prefix();
-  objc_class_prefix_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.objc_class_prefix)
+inline const std::string& FileOptions::_internal_swift_prefix() const {
+  return swift_prefix_.Get();
 }
-#endif
-inline void FileOptions::set_objc_class_prefix(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_objc_class_prefix();
-  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) {
-  set_has_objc_class_prefix();
-  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_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline void FileOptions::_internal_set_swift_prefix(const std::string& value) {
+  _has_bits_[0] |= 0x00000020u;
+  swift_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-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_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline std::string* FileOptions::_internal_mutable_swift_prefix() {
+  _has_bits_[0] |= 0x00000020u;
+  return swift_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline 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();
+inline std::string* FileOptions::release_swift_prefix() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.swift_prefix)
+  if (!_internal_has_swift_prefix()) {
+    return nullptr;
   }
-  objc_class_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), objc_class_prefix,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.objc_class_prefix)
+  _has_bits_[0] &= ~0x00000020u;
+  auto* p = swift_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (swift_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    swift_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::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();
+inline void FileOptions::set_allocated_swift_prefix(std::string* swift_prefix) {
+  if (swift_prefix != nullptr) {
+    _has_bits_[0] |= 0x00000020u;
   } else {
-    clear_has_objc_class_prefix();
+    _has_bits_[0] &= ~0x00000020u;
+  }
+  swift_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), swift_prefix,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (swift_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    swift_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  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)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.swift_prefix)
 }
 
-// optional string csharp_namespace = 37;
-inline bool FileOptions::has_csharp_namespace() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+// optional string php_class_prefix = 40;
+inline bool FileOptions::_internal_has_php_class_prefix() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void FileOptions::set_has_csharp_namespace() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool FileOptions::has_php_class_prefix() const {
+  return _internal_has_php_class_prefix();
 }
-inline void FileOptions::clear_has_csharp_namespace() {
-  _has_bits_[0] &= ~0x00000010u;
+inline void FileOptions::clear_php_class_prefix() {
+  php_class_prefix_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000040u;
 }
-inline void FileOptions::clear_csharp_namespace() {
-  csharp_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_csharp_namespace();
+inline const std::string& FileOptions::php_class_prefix() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_class_prefix)
+  return _internal_php_class_prefix();
 }
-inline const ::std::string& FileOptions::csharp_namespace() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.csharp_namespace)
-  return csharp_namespace_.Get();
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_php_class_prefix(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000040u;
+ php_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
+  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_class_prefix)
 }
-inline void FileOptions::set_csharp_namespace(const ::std::string& value) {
-  set_has_csharp_namespace();
-  csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.csharp_namespace)
+inline std::string* FileOptions::mutable_php_class_prefix() {
+  std::string* _s = _internal_mutable_php_class_prefix();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_class_prefix)
+  return _s;
 }
-#if LANG_CXX11
-inline void FileOptions::set_csharp_namespace(::std::string&& value) {
-  set_has_csharp_namespace();
-  csharp_namespace_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.csharp_namespace)
+inline const std::string& FileOptions::_internal_php_class_prefix() const {
+  return php_class_prefix_.Get();
 }
-#endif
-inline void FileOptions::set_csharp_namespace(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_csharp_namespace();
-  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) {
-  set_has_csharp_namespace();
-  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_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline void FileOptions::_internal_set_php_class_prefix(const std::string& value) {
+  _has_bits_[0] |= 0x00000040u;
+  php_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* FileOptions::release_csharp_namespace() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace)
-  clear_has_csharp_namespace();
-  return csharp_namespace_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline std::string* FileOptions::_internal_mutable_php_class_prefix() {
+  _has_bits_[0] |= 0x00000040u;
+  return php_class_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_namespace) {
-  if (csharp_namespace != NULL) {
-    set_has_csharp_namespace();
-  } else {
-    clear_has_csharp_namespace();
+inline std::string* FileOptions::release_php_class_prefix() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_class_prefix)
+  if (!_internal_has_php_class_prefix()) {
+    return nullptr;
   }
-  csharp_namespace_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), csharp_namespace,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace)
+  _has_bits_[0] &= ~0x00000040u;
+  auto* p = php_class_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (php_class_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    php_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_csharp_namespace(
-    ::std::string* csharp_namespace) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (csharp_namespace != NULL) {
-    set_has_csharp_namespace();
+inline void FileOptions::set_allocated_php_class_prefix(std::string* php_class_prefix) {
+  if (php_class_prefix != nullptr) {
+    _has_bits_[0] |= 0x00000040u;
   } else {
-    clear_has_csharp_namespace();
+    _has_bits_[0] &= ~0x00000040u;
+  }
+  php_class_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), php_class_prefix,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (php_class_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    php_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  csharp_namespace_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      csharp_namespace, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.csharp_namespace)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_class_prefix)
 }
 
-// optional string swift_prefix = 39;
-inline bool FileOptions::has_swift_prefix() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+// optional string php_namespace = 41;
+inline bool FileOptions::_internal_has_php_namespace() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void FileOptions::set_has_swift_prefix() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool FileOptions::has_php_namespace() const {
+  return _internal_has_php_namespace();
 }
-inline void FileOptions::clear_has_swift_prefix() {
-  _has_bits_[0] &= ~0x00000020u;
+inline void FileOptions::clear_php_namespace() {
+  php_namespace_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000080u;
 }
-inline void FileOptions::clear_swift_prefix() {
-  swift_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_swift_prefix();
+inline const std::string& FileOptions::php_namespace() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_namespace)
+  return _internal_php_namespace();
 }
-inline const ::std::string& FileOptions::swift_prefix() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.swift_prefix)
-  return swift_prefix_.Get();
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_php_namespace(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000080u;
+ php_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
+  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_namespace)
 }
-inline void FileOptions::set_swift_prefix(const ::std::string& value) {
-  set_has_swift_prefix();
-  swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.swift_prefix)
+inline std::string* FileOptions::mutable_php_namespace() {
+  std::string* _s = _internal_mutable_php_namespace();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_namespace)
+  return _s;
 }
-#if LANG_CXX11
-inline void FileOptions::set_swift_prefix(::std::string&& value) {
-  set_has_swift_prefix();
-  swift_prefix_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.swift_prefix)
+inline const std::string& FileOptions::_internal_php_namespace() const {
+  return php_namespace_.Get();
 }
-#endif
-inline void FileOptions::set_swift_prefix(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_swift_prefix();
-  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) {
-  set_has_swift_prefix();
-  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_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline void FileOptions::_internal_set_php_namespace(const std::string& value) {
+  _has_bits_[0] |= 0x00000080u;
+  php_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* FileOptions::release_swift_prefix() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.swift_prefix)
-  clear_has_swift_prefix();
-  return swift_prefix_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline std::string* FileOptions::_internal_mutable_php_namespace() {
+  _has_bits_[0] |= 0x00000080u;
+  return php_namespace_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline void FileOptions::set_allocated_swift_prefix(::std::string* swift_prefix) {
-  if (swift_prefix != NULL) {
-    set_has_swift_prefix();
-  } else {
-    clear_has_swift_prefix();
+inline std::string* FileOptions::release_php_namespace() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_namespace)
+  if (!_internal_has_php_namespace()) {
+    return nullptr;
   }
-  swift_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), swift_prefix,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.swift_prefix)
+  _has_bits_[0] &= ~0x00000080u;
+  auto* p = php_namespace_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (php_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    php_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_swift_prefix(
-    ::std::string* swift_prefix) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (swift_prefix != NULL) {
-    set_has_swift_prefix();
+inline void FileOptions::set_allocated_php_namespace(std::string* php_namespace) {
+  if (php_namespace != nullptr) {
+    _has_bits_[0] |= 0x00000080u;
   } else {
-    clear_has_swift_prefix();
+    _has_bits_[0] &= ~0x00000080u;
+  }
+  php_namespace_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), php_namespace,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (php_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    php_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  swift_prefix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      swift_prefix, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.swift_prefix)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_namespace)
 }
 
-// optional string php_class_prefix = 40;
-inline bool FileOptions::has_php_class_prefix() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+// optional string php_metadata_namespace = 44;
+inline bool FileOptions::_internal_has_php_metadata_namespace() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void FileOptions::set_has_php_class_prefix() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool FileOptions::has_php_metadata_namespace() const {
+  return _internal_has_php_metadata_namespace();
 }
-inline void FileOptions::clear_has_php_class_prefix() {
-  _has_bits_[0] &= ~0x00000040u;
+inline void FileOptions::clear_php_metadata_namespace() {
+  php_metadata_namespace_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000100u;
 }
-inline void FileOptions::clear_php_class_prefix() {
-  php_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_php_class_prefix();
+inline const std::string& FileOptions::php_metadata_namespace() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_metadata_namespace)
+  return _internal_php_metadata_namespace();
 }
-inline const ::std::string& FileOptions::php_class_prefix() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_class_prefix)
-  return php_class_prefix_.Get();
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_php_metadata_namespace(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000100u;
+ php_metadata_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
+  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_metadata_namespace)
 }
-inline void FileOptions::set_php_class_prefix(const ::std::string& value) {
-  set_has_php_class_prefix();
-  php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_class_prefix)
+inline std::string* FileOptions::mutable_php_metadata_namespace() {
+  std::string* _s = _internal_mutable_php_metadata_namespace();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_metadata_namespace)
+  return _s;
 }
-#if LANG_CXX11
-inline void FileOptions::set_php_class_prefix(::std::string&& value) {
-  set_has_php_class_prefix();
-  php_class_prefix_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_class_prefix)
+inline const std::string& FileOptions::_internal_php_metadata_namespace() const {
+  return php_metadata_namespace_.Get();
 }
-#endif
-inline void FileOptions::set_php_class_prefix(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_php_class_prefix();
-  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) {
-  set_has_php_class_prefix();
-  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_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline void FileOptions::_internal_set_php_metadata_namespace(const std::string& value) {
+  _has_bits_[0] |= 0x00000100u;
+  php_metadata_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-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_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline std::string* FileOptions::_internal_mutable_php_metadata_namespace() {
+  _has_bits_[0] |= 0x00000100u;
+  return php_metadata_namespace_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline 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();
+inline std::string* FileOptions::release_php_metadata_namespace() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_metadata_namespace)
+  if (!_internal_has_php_metadata_namespace()) {
+    return nullptr;
   }
-  php_class_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_class_prefix,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_class_prefix)
+  _has_bits_[0] &= ~0x00000100u;
+  auto* p = php_metadata_namespace_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (php_metadata_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    php_metadata_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::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();
+inline void FileOptions::set_allocated_php_metadata_namespace(std::string* php_metadata_namespace) {
+  if (php_metadata_namespace != nullptr) {
+    _has_bits_[0] |= 0x00000100u;
   } else {
-    clear_has_php_class_prefix();
+    _has_bits_[0] &= ~0x00000100u;
+  }
+  php_metadata_namespace_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), php_metadata_namespace,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (php_metadata_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    php_metadata_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  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)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_metadata_namespace)
 }
 
-// optional string php_namespace = 41;
-inline bool FileOptions::has_php_namespace() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
+// optional string ruby_package = 45;
+inline bool FileOptions::_internal_has_ruby_package() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void FileOptions::set_has_php_namespace() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool FileOptions::has_ruby_package() const {
+  return _internal_has_ruby_package();
 }
-inline void FileOptions::clear_has_php_namespace() {
-  _has_bits_[0] &= ~0x00000080u;
+inline void FileOptions::clear_ruby_package() {
+  ruby_package_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000200u;
 }
-inline void FileOptions::clear_php_namespace() {
-  php_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_php_namespace();
+inline const std::string& FileOptions::ruby_package() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.ruby_package)
+  return _internal_ruby_package();
 }
-inline const ::std::string& FileOptions::php_namespace() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_namespace)
-  return php_namespace_.Get();
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FileOptions::set_ruby_package(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000200u;
+ ruby_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
+  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.ruby_package)
 }
-inline void FileOptions::set_php_namespace(const ::std::string& value) {
-  set_has_php_namespace();
-  php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_namespace)
+inline std::string* FileOptions::mutable_ruby_package() {
+  std::string* _s = _internal_mutable_ruby_package();
+  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.ruby_package)
+  return _s;
 }
-#if LANG_CXX11
-inline void FileOptions::set_php_namespace(::std::string&& value) {
-  set_has_php_namespace();
-  php_namespace_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_namespace)
+inline const std::string& FileOptions::_internal_ruby_package() const {
+  return ruby_package_.Get();
 }
-#endif
-inline void FileOptions::set_php_namespace(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_php_namespace();
-  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) {
-  set_has_php_namespace();
-  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_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline void FileOptions::_internal_set_ruby_package(const std::string& value) {
+  _has_bits_[0] |= 0x00000200u;
+  ruby_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* FileOptions::release_php_namespace() {
-  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_namespace)
-  clear_has_php_namespace();
-  return php_namespace_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline std::string* FileOptions::_internal_mutable_ruby_package() {
+  _has_bits_[0] |= 0x00000200u;
+  return ruby_package_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline void FileOptions::set_allocated_php_namespace(::std::string* php_namespace) {
-  if (php_namespace != NULL) {
-    set_has_php_namespace();
-  } else {
-    clear_has_php_namespace();
+inline std::string* FileOptions::release_ruby_package() {
+  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.ruby_package)
+  if (!_internal_has_ruby_package()) {
+    return nullptr;
   }
-  php_namespace_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_namespace,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_namespace)
+  _has_bits_[0] &= ~0x00000200u;
+  auto* p = ruby_package_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (ruby_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    ruby_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_php_namespace(
-    ::std::string* php_namespace) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (php_namespace != NULL) {
-    set_has_php_namespace();
+inline void FileOptions::set_allocated_ruby_package(std::string* ruby_package) {
+  if (ruby_package != nullptr) {
+    _has_bits_[0] |= 0x00000200u;
   } else {
-    clear_has_php_namespace();
+    _has_bits_[0] &= ~0x00000200u;
   }
-  php_namespace_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      php_namespace, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_namespace)
+  ruby_package_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ruby_package,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (ruby_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    ruby_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.ruby_package)
 }
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int FileOptions::uninterpreted_option_size() const {
+inline int FileOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int FileOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void FileOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* FileOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FileOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* FileOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.FileOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 FileOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& FileOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& FileOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FileOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FileOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.FileOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 FileOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FileOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -9762,126 +12900,152 @@ FileOptions::uninterpreted_option() const {
 // MessageOptions
 
 // optional bool message_set_wire_format = 1 [default = false];
-inline bool MessageOptions::has_message_set_wire_format() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void MessageOptions::set_has_message_set_wire_format() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool MessageOptions::_internal_has_message_set_wire_format() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void MessageOptions::clear_has_message_set_wire_format() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool MessageOptions::has_message_set_wire_format() const {
+  return _internal_has_message_set_wire_format();
 }
 inline void MessageOptions::clear_message_set_wire_format() {
   message_set_wire_format_ = false;
-  clear_has_message_set_wire_format();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool MessageOptions::_internal_message_set_wire_format() const {
+  return message_set_wire_format_;
 }
 inline bool MessageOptions::message_set_wire_format() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.message_set_wire_format)
-  return message_set_wire_format_;
+  return _internal_message_set_wire_format();
 }
-inline void MessageOptions::set_message_set_wire_format(bool value) {
-  set_has_message_set_wire_format();
+inline void MessageOptions::_internal_set_message_set_wire_format(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   message_set_wire_format_ = value;
+}
+inline void MessageOptions::set_message_set_wire_format(bool value) {
+  _internal_set_message_set_wire_format(value);
   // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.message_set_wire_format)
 }
 
 // optional bool no_standard_descriptor_accessor = 2 [default = false];
-inline bool MessageOptions::has_no_standard_descriptor_accessor() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool MessageOptions::_internal_has_no_standard_descriptor_accessor() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void MessageOptions::set_has_no_standard_descriptor_accessor() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void MessageOptions::clear_has_no_standard_descriptor_accessor() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool MessageOptions::has_no_standard_descriptor_accessor() const {
+  return _internal_has_no_standard_descriptor_accessor();
 }
 inline void MessageOptions::clear_no_standard_descriptor_accessor() {
   no_standard_descriptor_accessor_ = false;
-  clear_has_no_standard_descriptor_accessor();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool MessageOptions::_internal_no_standard_descriptor_accessor() const {
+  return no_standard_descriptor_accessor_;
 }
 inline bool MessageOptions::no_standard_descriptor_accessor() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.no_standard_descriptor_accessor)
-  return no_standard_descriptor_accessor_;
+  return _internal_no_standard_descriptor_accessor();
 }
-inline void MessageOptions::set_no_standard_descriptor_accessor(bool value) {
-  set_has_no_standard_descriptor_accessor();
+inline void MessageOptions::_internal_set_no_standard_descriptor_accessor(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   no_standard_descriptor_accessor_ = value;
+}
+inline void MessageOptions::set_no_standard_descriptor_accessor(bool value) {
+  _internal_set_no_standard_descriptor_accessor(value);
   // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.no_standard_descriptor_accessor)
 }
 
 // optional bool deprecated = 3 [default = false];
-inline bool MessageOptions::has_deprecated() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void MessageOptions::set_has_deprecated() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool MessageOptions::_internal_has_deprecated() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void MessageOptions::clear_has_deprecated() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool MessageOptions::has_deprecated() const {
+  return _internal_has_deprecated();
 }
 inline void MessageOptions::clear_deprecated() {
   deprecated_ = false;
-  clear_has_deprecated();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline bool MessageOptions::_internal_deprecated() const {
+  return deprecated_;
 }
 inline bool MessageOptions::deprecated() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.deprecated)
-  return deprecated_;
+  return _internal_deprecated();
 }
-inline void MessageOptions::set_deprecated(bool value) {
-  set_has_deprecated();
+inline void MessageOptions::_internal_set_deprecated(bool value) {
+  _has_bits_[0] |= 0x00000004u;
   deprecated_ = value;
+}
+inline void MessageOptions::set_deprecated(bool value) {
+  _internal_set_deprecated(value);
   // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.deprecated)
 }
 
 // optional bool map_entry = 7;
-inline bool MessageOptions::has_map_entry() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void MessageOptions::set_has_map_entry() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool MessageOptions::_internal_has_map_entry() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void MessageOptions::clear_has_map_entry() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool MessageOptions::has_map_entry() const {
+  return _internal_has_map_entry();
 }
 inline void MessageOptions::clear_map_entry() {
   map_entry_ = false;
-  clear_has_map_entry();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline bool MessageOptions::_internal_map_entry() const {
+  return map_entry_;
 }
 inline bool MessageOptions::map_entry() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.map_entry)
-  return map_entry_;
+  return _internal_map_entry();
 }
-inline void MessageOptions::set_map_entry(bool value) {
-  set_has_map_entry();
+inline void MessageOptions::_internal_set_map_entry(bool value) {
+  _has_bits_[0] |= 0x00000008u;
   map_entry_ = value;
+}
+inline void MessageOptions::set_map_entry(bool value) {
+  _internal_set_map_entry(value);
   // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.map_entry)
 }
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int MessageOptions::uninterpreted_option_size() const {
+inline int MessageOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int MessageOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void MessageOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* MessageOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MessageOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.MessageOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* MessageOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.MessageOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 MessageOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.MessageOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& MessageOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& MessageOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MessageOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MessageOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.MessageOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 MessageOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.MessageOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -9892,176 +13056,210 @@ MessageOptions::uninterpreted_option() const {
 // FieldOptions
 
 // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
-inline bool FieldOptions::has_ctype() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool FieldOptions::_internal_has_ctype() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void FieldOptions::set_has_ctype() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void FieldOptions::clear_has_ctype() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool FieldOptions::has_ctype() const {
+  return _internal_has_ctype();
 }
 inline void FieldOptions::clear_ctype() {
   ctype_ = 0;
-  clear_has_ctype();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType FieldOptions::_internal_ctype() const {
+  return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType >(ctype_);
 }
-inline ::google::protobuf::FieldOptions_CType FieldOptions::ctype() const {
+inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType FieldOptions::ctype() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.ctype)
-  return static_cast< ::google::protobuf::FieldOptions_CType >(ctype_);
+  return _internal_ctype();
 }
-inline void FieldOptions::set_ctype(::google::protobuf::FieldOptions_CType value) {
-  assert(::google::protobuf::FieldOptions_CType_IsValid(value));
-  set_has_ctype();
+inline void FieldOptions::_internal_set_ctype(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType value) {
+  assert(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType_IsValid(value));
+  _has_bits_[0] |= 0x00000001u;
   ctype_ = value;
+}
+inline void FieldOptions::set_ctype(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType value) {
+  _internal_set_ctype(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.ctype)
 }
 
 // optional bool packed = 2;
-inline bool FieldOptions::has_packed() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void FieldOptions::set_has_packed() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool FieldOptions::_internal_has_packed() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void FieldOptions::clear_has_packed() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool FieldOptions::has_packed() const {
+  return _internal_has_packed();
 }
 inline void FieldOptions::clear_packed() {
   packed_ = false;
-  clear_has_packed();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool FieldOptions::_internal_packed() const {
+  return packed_;
 }
 inline bool FieldOptions::packed() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.packed)
-  return packed_;
+  return _internal_packed();
 }
-inline void FieldOptions::set_packed(bool value) {
-  set_has_packed();
+inline void FieldOptions::_internal_set_packed(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   packed_ = value;
+}
+inline void FieldOptions::set_packed(bool value) {
+  _internal_set_packed(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.packed)
 }
 
 // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
-inline bool FieldOptions::has_jstype() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void FieldOptions::set_has_jstype() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool FieldOptions::_internal_has_jstype() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void FieldOptions::clear_has_jstype() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool FieldOptions::has_jstype() const {
+  return _internal_has_jstype();
 }
 inline void FieldOptions::clear_jstype() {
   jstype_ = 0;
-  clear_has_jstype();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType FieldOptions::_internal_jstype() const {
+  return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType >(jstype_);
 }
-inline ::google::protobuf::FieldOptions_JSType FieldOptions::jstype() const {
+inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType FieldOptions::jstype() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.jstype)
-  return static_cast< ::google::protobuf::FieldOptions_JSType >(jstype_);
+  return _internal_jstype();
 }
-inline void FieldOptions::set_jstype(::google::protobuf::FieldOptions_JSType value) {
-  assert(::google::protobuf::FieldOptions_JSType_IsValid(value));
-  set_has_jstype();
+inline void FieldOptions::_internal_set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value) {
+  assert(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType_IsValid(value));
+  _has_bits_[0] |= 0x00000020u;
   jstype_ = value;
+}
+inline void FieldOptions::set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value) {
+  _internal_set_jstype(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.jstype)
 }
 
 // optional bool lazy = 5 [default = false];
-inline bool FieldOptions::has_lazy() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void FieldOptions::set_has_lazy() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool FieldOptions::_internal_has_lazy() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void FieldOptions::clear_has_lazy() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool FieldOptions::has_lazy() const {
+  return _internal_has_lazy();
 }
 inline void FieldOptions::clear_lazy() {
   lazy_ = false;
-  clear_has_lazy();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline bool FieldOptions::_internal_lazy() const {
+  return lazy_;
 }
 inline bool FieldOptions::lazy() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.lazy)
-  return lazy_;
+  return _internal_lazy();
 }
-inline void FieldOptions::set_lazy(bool value) {
-  set_has_lazy();
+inline void FieldOptions::_internal_set_lazy(bool value) {
+  _has_bits_[0] |= 0x00000004u;
   lazy_ = value;
+}
+inline void FieldOptions::set_lazy(bool value) {
+  _internal_set_lazy(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.lazy)
 }
 
 // optional bool deprecated = 3 [default = false];
-inline bool FieldOptions::has_deprecated() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool FieldOptions::_internal_has_deprecated() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void FieldOptions::set_has_deprecated() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void FieldOptions::clear_has_deprecated() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool FieldOptions::has_deprecated() const {
+  return _internal_has_deprecated();
 }
 inline void FieldOptions::clear_deprecated() {
   deprecated_ = false;
-  clear_has_deprecated();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline bool FieldOptions::_internal_deprecated() const {
+  return deprecated_;
 }
 inline bool FieldOptions::deprecated() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.deprecated)
-  return deprecated_;
+  return _internal_deprecated();
 }
-inline void FieldOptions::set_deprecated(bool value) {
-  set_has_deprecated();
+inline void FieldOptions::_internal_set_deprecated(bool value) {
+  _has_bits_[0] |= 0x00000008u;
   deprecated_ = value;
+}
+inline void FieldOptions::set_deprecated(bool value) {
+  _internal_set_deprecated(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.deprecated)
 }
 
-// optional bool weak = 10 [default = false];
-inline bool FieldOptions::has_weak() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void FieldOptions::set_has_weak() {
-  _has_bits_[0] |= 0x00000010u;
+// optional bool weak = 10 [default = false];
+inline bool FieldOptions::_internal_has_weak() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void FieldOptions::clear_has_weak() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool FieldOptions::has_weak() const {
+  return _internal_has_weak();
 }
 inline void FieldOptions::clear_weak() {
   weak_ = false;
-  clear_has_weak();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline bool FieldOptions::_internal_weak() const {
+  return weak_;
 }
 inline bool FieldOptions::weak() const {
   // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.weak)
-  return weak_;
+  return _internal_weak();
 }
-inline void FieldOptions::set_weak(bool value) {
-  set_has_weak();
+inline void FieldOptions::_internal_set_weak(bool value) {
+  _has_bits_[0] |= 0x00000010u;
   weak_ = value;
+}
+inline void FieldOptions::set_weak(bool value) {
+  _internal_set_weak(value);
   // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.weak)
 }
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int FieldOptions::uninterpreted_option_size() const {
+inline int FieldOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int FieldOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void FieldOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* FieldOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FieldOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* FieldOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.FieldOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 FieldOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& FieldOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& FieldOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FieldOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FieldOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.FieldOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 FieldOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FieldOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -10072,30 +13270,40 @@ FieldOptions::uninterpreted_option() const {
 // OneofOptions
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int OneofOptions::uninterpreted_option_size() const {
+inline int OneofOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int OneofOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void OneofOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* OneofOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* OneofOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.OneofOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* OneofOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.OneofOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 OneofOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.OneofOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& OneofOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& OneofOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.OneofOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* OneofOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* OneofOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.OneofOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 OneofOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.OneofOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -10106,78 +13314,96 @@ OneofOptions::uninterpreted_option() const {
 // EnumOptions
 
 // optional bool allow_alias = 2;
-inline bool EnumOptions::has_allow_alias() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void EnumOptions::set_has_allow_alias() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool EnumOptions::_internal_has_allow_alias() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void EnumOptions::clear_has_allow_alias() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool EnumOptions::has_allow_alias() const {
+  return _internal_has_allow_alias();
 }
 inline void EnumOptions::clear_allow_alias() {
   allow_alias_ = false;
-  clear_has_allow_alias();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool EnumOptions::_internal_allow_alias() const {
+  return allow_alias_;
 }
 inline bool EnumOptions::allow_alias() const {
   // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.allow_alias)
-  return allow_alias_;
+  return _internal_allow_alias();
 }
-inline void EnumOptions::set_allow_alias(bool value) {
-  set_has_allow_alias();
+inline void EnumOptions::_internal_set_allow_alias(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   allow_alias_ = value;
+}
+inline void EnumOptions::set_allow_alias(bool value) {
+  _internal_set_allow_alias(value);
   // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.allow_alias)
 }
 
 // optional bool deprecated = 3 [default = false];
-inline bool EnumOptions::has_deprecated() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void EnumOptions::set_has_deprecated() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool EnumOptions::_internal_has_deprecated() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void EnumOptions::clear_has_deprecated() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool EnumOptions::has_deprecated() const {
+  return _internal_has_deprecated();
 }
 inline void EnumOptions::clear_deprecated() {
   deprecated_ = false;
-  clear_has_deprecated();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool EnumOptions::_internal_deprecated() const {
+  return deprecated_;
 }
 inline bool EnumOptions::deprecated() const {
   // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.deprecated)
-  return deprecated_;
+  return _internal_deprecated();
 }
-inline void EnumOptions::set_deprecated(bool value) {
-  set_has_deprecated();
+inline void EnumOptions::_internal_set_deprecated(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   deprecated_ = value;
+}
+inline void EnumOptions::set_deprecated(bool value) {
+  _internal_set_deprecated(value);
   // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.deprecated)
 }
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int EnumOptions::uninterpreted_option_size() const {
+inline int EnumOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int EnumOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void EnumOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* EnumOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.EnumOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* EnumOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.EnumOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 EnumOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& EnumOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& EnumOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.EnumOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 EnumOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.EnumOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -10188,54 +13414,68 @@ EnumOptions::uninterpreted_option() const {
 // EnumValueOptions
 
 // optional bool deprecated = 1 [default = false];
-inline bool EnumValueOptions::has_deprecated() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void EnumValueOptions::set_has_deprecated() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool EnumValueOptions::_internal_has_deprecated() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void EnumValueOptions::clear_has_deprecated() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool EnumValueOptions::has_deprecated() const {
+  return _internal_has_deprecated();
 }
 inline void EnumValueOptions::clear_deprecated() {
   deprecated_ = false;
-  clear_has_deprecated();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool EnumValueOptions::_internal_deprecated() const {
+  return deprecated_;
 }
 inline bool EnumValueOptions::deprecated() const {
   // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated)
-  return deprecated_;
+  return _internal_deprecated();
 }
-inline void EnumValueOptions::set_deprecated(bool value) {
-  set_has_deprecated();
+inline void EnumValueOptions::_internal_set_deprecated(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   deprecated_ = value;
+}
+inline void EnumValueOptions::set_deprecated(bool value) {
+  _internal_set_deprecated(value);
   // @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.deprecated)
 }
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int EnumValueOptions::uninterpreted_option_size() const {
+inline int EnumValueOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int EnumValueOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void EnumValueOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* EnumValueOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumValueOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* EnumValueOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.EnumValueOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 EnumValueOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValueOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& EnumValueOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& EnumValueOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumValueOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumValueOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.EnumValueOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 EnumValueOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.EnumValueOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -10246,54 +13486,68 @@ EnumValueOptions::uninterpreted_option() const {
 // ServiceOptions
 
 // optional bool deprecated = 33 [default = false];
-inline bool ServiceOptions::has_deprecated() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ServiceOptions::set_has_deprecated() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ServiceOptions::_internal_has_deprecated() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ServiceOptions::clear_has_deprecated() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ServiceOptions::has_deprecated() const {
+  return _internal_has_deprecated();
 }
 inline void ServiceOptions::clear_deprecated() {
   deprecated_ = false;
-  clear_has_deprecated();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool ServiceOptions::_internal_deprecated() const {
+  return deprecated_;
 }
 inline bool ServiceOptions::deprecated() const {
   // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.deprecated)
-  return deprecated_;
+  return _internal_deprecated();
 }
-inline void ServiceOptions::set_deprecated(bool value) {
-  set_has_deprecated();
+inline void ServiceOptions::_internal_set_deprecated(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   deprecated_ = value;
+}
+inline void ServiceOptions::set_deprecated(bool value) {
+  _internal_set_deprecated(value);
   // @@protoc_insertion_point(field_set:google.protobuf.ServiceOptions.deprecated)
 }
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int ServiceOptions::uninterpreted_option_size() const {
+inline int ServiceOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int ServiceOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void ServiceOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* ServiceOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ServiceOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* ServiceOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.ServiceOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 ServiceOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& ServiceOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& ServiceOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ServiceOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ServiceOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.ServiceOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 ServiceOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.ServiceOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -10304,79 +13558,97 @@ ServiceOptions::uninterpreted_option() const {
 // MethodOptions
 
 // optional bool deprecated = 33 [default = false];
-inline bool MethodOptions::has_deprecated() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void MethodOptions::set_has_deprecated() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool MethodOptions::_internal_has_deprecated() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void MethodOptions::clear_has_deprecated() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool MethodOptions::has_deprecated() const {
+  return _internal_has_deprecated();
 }
 inline void MethodOptions::clear_deprecated() {
   deprecated_ = false;
-  clear_has_deprecated();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool MethodOptions::_internal_deprecated() const {
+  return deprecated_;
 }
 inline bool MethodOptions::deprecated() const {
   // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.deprecated)
-  return deprecated_;
+  return _internal_deprecated();
 }
-inline void MethodOptions::set_deprecated(bool value) {
-  set_has_deprecated();
+inline void MethodOptions::_internal_set_deprecated(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   deprecated_ = value;
+}
+inline void MethodOptions::set_deprecated(bool value) {
+  _internal_set_deprecated(value);
   // @@protoc_insertion_point(field_set:google.protobuf.MethodOptions.deprecated)
 }
 
 // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];
-inline bool MethodOptions::has_idempotency_level() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void MethodOptions::set_has_idempotency_level() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool MethodOptions::_internal_has_idempotency_level() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void MethodOptions::clear_has_idempotency_level() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool MethodOptions::has_idempotency_level() const {
+  return _internal_has_idempotency_level();
 }
 inline void MethodOptions::clear_idempotency_level() {
   idempotency_level_ = 0;
-  clear_has_idempotency_level();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel MethodOptions::_internal_idempotency_level() const {
+  return static_cast< ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel >(idempotency_level_);
 }
-inline ::google::protobuf::MethodOptions_IdempotencyLevel MethodOptions::idempotency_level() const {
+inline ::PROTOBUF_NAMESPACE_ID::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_);
+  return _internal_idempotency_level();
 }
-inline void MethodOptions::set_idempotency_level(::google::protobuf::MethodOptions_IdempotencyLevel value) {
-  assert(::google::protobuf::MethodOptions_IdempotencyLevel_IsValid(value));
-  set_has_idempotency_level();
+inline void MethodOptions::_internal_set_idempotency_level(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel value) {
+  assert(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel_IsValid(value));
+  _has_bits_[0] |= 0x00000002u;
   idempotency_level_ = value;
+}
+inline void MethodOptions::set_idempotency_level(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel value) {
+  _internal_set_idempotency_level(value);
   // @@protoc_insertion_point(field_set:google.protobuf.MethodOptions.idempotency_level)
 }
 
 // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
-inline int MethodOptions::uninterpreted_option_size() const {
+inline int MethodOptions::_internal_uninterpreted_option_size() const {
   return uninterpreted_option_.size();
 }
+inline int MethodOptions::uninterpreted_option_size() const {
+  return _internal_uninterpreted_option_size();
+}
 inline void MethodOptions::clear_uninterpreted_option() {
   uninterpreted_option_.Clear();
 }
-inline 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);
-}
-inline ::google::protobuf::UninterpretedOption* MethodOptions::mutable_uninterpreted_option(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MethodOptions::mutable_uninterpreted_option(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.MethodOptions.uninterpreted_option)
   return uninterpreted_option_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption* MethodOptions::add_uninterpreted_option() {
-  // @@protoc_insertion_point(field_add:google.protobuf.MethodOptions.uninterpreted_option)
-  return uninterpreted_option_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >*
 MethodOptions::mutable_uninterpreted_option() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.MethodOptions.uninterpreted_option)
   return &uninterpreted_option_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& MethodOptions::_internal_uninterpreted_option(int index) const {
+  return uninterpreted_option_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& MethodOptions::uninterpreted_option(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.uninterpreted_option)
+  return _internal_uninterpreted_option(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MethodOptions::_internal_add_uninterpreted_option() {
+  return uninterpreted_option_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MethodOptions::add_uninterpreted_option() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option();
+  // @@protoc_insertion_point(field_add:google.protobuf.MethodOptions.uninterpreted_option)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >&
 MethodOptions::uninterpreted_option() const {
   // @@protoc_insertion_point(field_list:google.protobuf.MethodOptions.uninterpreted_option)
   return uninterpreted_option_;
@@ -10387,111 +13659,99 @@ MethodOptions::uninterpreted_option() const {
 // UninterpretedOption_NamePart
 
 // required string name_part = 1;
-inline bool UninterpretedOption_NamePart::has_name_part() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool UninterpretedOption_NamePart::_internal_has_name_part() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void UninterpretedOption_NamePart::set_has_name_part() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void UninterpretedOption_NamePart::clear_has_name_part() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool UninterpretedOption_NamePart::has_name_part() const {
+  return _internal_has_name_part();
 }
 inline void UninterpretedOption_NamePart::clear_name_part() {
-  name_part_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_name_part();
+  name_part_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& UninterpretedOption_NamePart::name_part() const {
+inline const std::string& UninterpretedOption_NamePart::name_part() const {
   // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.name_part)
-  return name_part_.Get();
+  return _internal_name_part();
 }
-inline void UninterpretedOption_NamePart::set_name_part(const ::std::string& value) {
-  set_has_name_part();
-  name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void UninterpretedOption_NamePart::set_name_part(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_part_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_name_part();
-  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();
+inline std::string* UninterpretedOption_NamePart::mutable_name_part() {
+  std::string* _s = _internal_mutable_name_part();
   // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.NamePart.name_part)
-  return name_part_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-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_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& UninterpretedOption_NamePart::_internal_name_part() const {
+  return name_part_.Get();
 }
-inline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part) {
-  if (name_part != NULL) {
-    set_has_name_part();
-  } else {
-    clear_has_name_part();
+inline void UninterpretedOption_NamePart::_internal_set_name_part(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_part_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* UninterpretedOption_NamePart::_internal_mutable_name_part() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_part_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* UninterpretedOption_NamePart::release_name_part() {
+  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.NamePart.name_part)
+  if (!_internal_has_name_part()) {
+    return nullptr;
   }
-  name_part_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_part,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_part_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_part_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_part_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_name_part(
-    ::std::string* name_part) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name_part != NULL) {
-    set_has_name_part();
+inline void UninterpretedOption_NamePart::set_allocated_name_part(std::string* name_part) {
+  if (name_part != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name_part();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_part_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name_part,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_part_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_part_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_part_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name_part, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part)
 }
 
 // required bool is_extension = 2;
-inline bool UninterpretedOption_NamePart::has_is_extension() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void UninterpretedOption_NamePart::set_has_is_extension() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool UninterpretedOption_NamePart::_internal_has_is_extension() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void UninterpretedOption_NamePart::clear_has_is_extension() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool UninterpretedOption_NamePart::has_is_extension() const {
+  return _internal_has_is_extension();
 }
 inline void UninterpretedOption_NamePart::clear_is_extension() {
   is_extension_ = false;
-  clear_has_is_extension();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool UninterpretedOption_NamePart::_internal_is_extension() const {
+  return is_extension_;
 }
 inline bool UninterpretedOption_NamePart::is_extension() const {
   // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.is_extension)
-  return is_extension_;
+  return _internal_is_extension();
 }
-inline void UninterpretedOption_NamePart::set_is_extension(bool value) {
-  set_has_is_extension();
+inline void UninterpretedOption_NamePart::_internal_set_is_extension(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   is_extension_ = value;
+}
+inline void UninterpretedOption_NamePart::set_is_extension(bool value) {
+  _internal_set_is_extension(value);
   // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.is_extension)
 }
 
@@ -10500,360 +13760,334 @@ inline void UninterpretedOption_NamePart::set_is_extension(bool value) {
 // UninterpretedOption
 
 // repeated .google.protobuf.UninterpretedOption.NamePart name = 2;
-inline int UninterpretedOption::name_size() const {
+inline int UninterpretedOption::_internal_name_size() const {
   return name_.size();
 }
+inline int UninterpretedOption::name_size() const {
+  return _internal_name_size();
+}
 inline void UninterpretedOption::clear_name() {
   name_.Clear();
 }
-inline const ::google::protobuf::UninterpretedOption_NamePart& UninterpretedOption::name(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.name)
-  return name_.Get(index);
-}
-inline ::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::mutable_name(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* UninterpretedOption::mutable_name(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.name)
   return name_.Mutable(index);
 }
-inline ::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::add_name() {
-  // @@protoc_insertion_point(field_add:google.protobuf.UninterpretedOption.name)
-  return name_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart >*
 UninterpretedOption::mutable_name() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.UninterpretedOption.name)
   return &name_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >&
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart& UninterpretedOption::_internal_name(int index) const {
+  return name_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart& UninterpretedOption::name(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.name)
+  return _internal_name(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* UninterpretedOption::_internal_add_name() {
+  return name_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* UninterpretedOption::add_name() {
+  ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* _add = _internal_add_name();
+  // @@protoc_insertion_point(field_add:google.protobuf.UninterpretedOption.name)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart >&
 UninterpretedOption::name() const {
   // @@protoc_insertion_point(field_list:google.protobuf.UninterpretedOption.name)
   return name_;
 }
 
 // optional string identifier_value = 3;
-inline bool UninterpretedOption::has_identifier_value() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool UninterpretedOption::_internal_has_identifier_value() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void UninterpretedOption::set_has_identifier_value() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void UninterpretedOption::clear_has_identifier_value() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool UninterpretedOption::has_identifier_value() const {
+  return _internal_has_identifier_value();
 }
 inline void UninterpretedOption::clear_identifier_value() {
-  identifier_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_identifier_value();
+  identifier_value_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& UninterpretedOption::identifier_value() const {
+inline const std::string& UninterpretedOption::identifier_value() const {
   // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.identifier_value)
-  return identifier_value_.Get();
+  return _internal_identifier_value();
 }
-inline void UninterpretedOption::set_identifier_value(const ::std::string& value) {
-  set_has_identifier_value();
-  identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void UninterpretedOption::set_identifier_value(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ identifier_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_identifier_value();
-  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();
+inline std::string* UninterpretedOption::mutable_identifier_value() {
+  std::string* _s = _internal_mutable_identifier_value();
   // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.identifier_value)
-  return identifier_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* UninterpretedOption::release_identifier_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value)
-  clear_has_identifier_value();
-  return identifier_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& UninterpretedOption::_internal_identifier_value() const {
+  return identifier_value_.Get();
 }
-inline void UninterpretedOption::set_allocated_identifier_value(::std::string* identifier_value) {
-  if (identifier_value != NULL) {
-    set_has_identifier_value();
-  } else {
-    clear_has_identifier_value();
+inline void UninterpretedOption::_internal_set_identifier_value(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  identifier_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* UninterpretedOption::_internal_mutable_identifier_value() {
+  _has_bits_[0] |= 0x00000001u;
+  return identifier_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* UninterpretedOption::release_identifier_value() {
+  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value)
+  if (!_internal_has_identifier_value()) {
+    return nullptr;
   }
-  identifier_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), identifier_value,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = identifier_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (identifier_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    identifier_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_identifier_value(
-    ::std::string* identifier_value) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (identifier_value != NULL) {
-    set_has_identifier_value();
+inline void UninterpretedOption::set_allocated_identifier_value(std::string* identifier_value) {
+  if (identifier_value != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_identifier_value();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  identifier_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), identifier_value,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (identifier_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    identifier_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  identifier_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      identifier_value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.identifier_value)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value)
 }
 
 // optional uint64 positive_int_value = 4;
-inline bool UninterpretedOption::has_positive_int_value() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool UninterpretedOption::_internal_has_positive_int_value() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void UninterpretedOption::set_has_positive_int_value() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool UninterpretedOption::has_positive_int_value() const {
+  return _internal_has_positive_int_value();
 }
-inline void UninterpretedOption::clear_has_positive_int_value() {
+inline void UninterpretedOption::clear_positive_int_value() {
+  positive_int_value_ = uint64_t{0u};
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void UninterpretedOption::clear_positive_int_value() {
-  positive_int_value_ = GOOGLE_ULONGLONG(0);
-  clear_has_positive_int_value();
+inline uint64_t UninterpretedOption::_internal_positive_int_value() const {
+  return positive_int_value_;
 }
-inline ::google::protobuf::uint64 UninterpretedOption::positive_int_value() const {
+inline uint64_t UninterpretedOption::positive_int_value() const {
   // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.positive_int_value)
-  return positive_int_value_;
+  return _internal_positive_int_value();
 }
-inline void UninterpretedOption::set_positive_int_value(::google::protobuf::uint64 value) {
-  set_has_positive_int_value();
+inline void UninterpretedOption::_internal_set_positive_int_value(uint64_t value) {
+  _has_bits_[0] |= 0x00000008u;
   positive_int_value_ = value;
+}
+inline void UninterpretedOption::set_positive_int_value(uint64_t value) {
+  _internal_set_positive_int_value(value);
   // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.positive_int_value)
 }
 
 // optional int64 negative_int_value = 5;
-inline bool UninterpretedOption::has_negative_int_value() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+inline bool UninterpretedOption::_internal_has_negative_int_value() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void UninterpretedOption::set_has_negative_int_value() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool UninterpretedOption::has_negative_int_value() const {
+  return _internal_has_negative_int_value();
 }
-inline void UninterpretedOption::clear_has_negative_int_value() {
+inline void UninterpretedOption::clear_negative_int_value() {
+  negative_int_value_ = int64_t{0};
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void UninterpretedOption::clear_negative_int_value() {
-  negative_int_value_ = GOOGLE_LONGLONG(0);
-  clear_has_negative_int_value();
+inline int64_t UninterpretedOption::_internal_negative_int_value() const {
+  return negative_int_value_;
 }
-inline ::google::protobuf::int64 UninterpretedOption::negative_int_value() const {
+inline int64_t UninterpretedOption::negative_int_value() const {
   // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.negative_int_value)
-  return negative_int_value_;
+  return _internal_negative_int_value();
 }
-inline void UninterpretedOption::set_negative_int_value(::google::protobuf::int64 value) {
-  set_has_negative_int_value();
+inline void UninterpretedOption::_internal_set_negative_int_value(int64_t value) {
+  _has_bits_[0] |= 0x00000010u;
   negative_int_value_ = value;
+}
+inline void UninterpretedOption::set_negative_int_value(int64_t value) {
+  _internal_set_negative_int_value(value);
   // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.negative_int_value)
 }
 
 // optional double double_value = 6;
-inline bool UninterpretedOption::has_double_value() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool UninterpretedOption::_internal_has_double_value() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void UninterpretedOption::set_has_double_value() {
-  _has_bits_[0] |= 0x00000020u;
-}
-inline void UninterpretedOption::clear_has_double_value() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool UninterpretedOption::has_double_value() const {
+  return _internal_has_double_value();
 }
 inline void UninterpretedOption::clear_double_value() {
   double_value_ = 0;
-  clear_has_double_value();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline double UninterpretedOption::_internal_double_value() const {
+  return double_value_;
 }
 inline double UninterpretedOption::double_value() const {
   // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.double_value)
-  return double_value_;
+  return _internal_double_value();
 }
-inline void UninterpretedOption::set_double_value(double value) {
-  set_has_double_value();
+inline void UninterpretedOption::_internal_set_double_value(double value) {
+  _has_bits_[0] |= 0x00000020u;
   double_value_ = value;
+}
+inline void UninterpretedOption::set_double_value(double value) {
+  _internal_set_double_value(value);
   // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.double_value)
 }
 
 // optional bytes string_value = 7;
-inline bool UninterpretedOption::has_string_value() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void UninterpretedOption::set_has_string_value() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool UninterpretedOption::_internal_has_string_value() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void UninterpretedOption::clear_has_string_value() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool UninterpretedOption::has_string_value() const {
+  return _internal_has_string_value();
 }
 inline void UninterpretedOption::clear_string_value() {
-  string_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_string_value();
+  string_value_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& UninterpretedOption::string_value() const {
+inline const std::string& UninterpretedOption::string_value() const {
   // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.string_value)
-  return string_value_.Get();
+  return _internal_string_value();
 }
-inline void UninterpretedOption::set_string_value(const ::std::string& value) {
-  set_has_string_value();
-  string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void UninterpretedOption::set_string_value(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ string_value_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_string_value();
-  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();
+inline std::string* UninterpretedOption::mutable_string_value() {
+  std::string* _s = _internal_mutable_string_value();
   // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.string_value)
-  return string_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* UninterpretedOption::release_string_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value)
-  clear_has_string_value();
-  return string_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& UninterpretedOption::_internal_string_value() const {
+  return string_value_.Get();
 }
-inline void UninterpretedOption::set_allocated_string_value(::std::string* string_value) {
-  if (string_value != NULL) {
-    set_has_string_value();
-  } else {
-    clear_has_string_value();
+inline void UninterpretedOption::_internal_set_string_value(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  string_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* UninterpretedOption::_internal_mutable_string_value() {
+  _has_bits_[0] |= 0x00000002u;
+  return string_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* UninterpretedOption::release_string_value() {
+  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value)
+  if (!_internal_has_string_value()) {
+    return nullptr;
   }
-  string_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value)
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = string_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (string_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    string_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_string_value(
-    ::std::string* string_value) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (string_value != NULL) {
-    set_has_string_value();
+inline void UninterpretedOption::set_allocated_string_value(std::string* string_value) {
+  if (string_value != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_string_value();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  string_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      string_value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.string_value)
+  string_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), string_value,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (string_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    string_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value)
 }
 
 // optional string aggregate_value = 8;
-inline bool UninterpretedOption::has_aggregate_value() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void UninterpretedOption::set_has_aggregate_value() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool UninterpretedOption::_internal_has_aggregate_value() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void UninterpretedOption::clear_has_aggregate_value() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool UninterpretedOption::has_aggregate_value() const {
+  return _internal_has_aggregate_value();
 }
 inline void UninterpretedOption::clear_aggregate_value() {
-  aggregate_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_aggregate_value();
+  aggregate_value_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& UninterpretedOption::aggregate_value() const {
+inline const std::string& UninterpretedOption::aggregate_value() const {
   // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.aggregate_value)
-  return aggregate_value_.Get();
+  return _internal_aggregate_value();
 }
-inline void UninterpretedOption::set_aggregate_value(const ::std::string& value) {
-  set_has_aggregate_value();
-  aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void UninterpretedOption::set_aggregate_value(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ aggregate_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_aggregate_value();
-  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();
+inline std::string* UninterpretedOption::mutable_aggregate_value() {
+  std::string* _s = _internal_mutable_aggregate_value();
   // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.aggregate_value)
-  return aggregate_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-inline ::std::string* UninterpretedOption::release_aggregate_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value)
-  clear_has_aggregate_value();
-  return aggregate_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& UninterpretedOption::_internal_aggregate_value() const {
+  return aggregate_value_.Get();
 }
-inline void UninterpretedOption::set_allocated_aggregate_value(::std::string* aggregate_value) {
-  if (aggregate_value != NULL) {
-    set_has_aggregate_value();
-  } else {
-    clear_has_aggregate_value();
+inline void UninterpretedOption::_internal_set_aggregate_value(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  aggregate_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* UninterpretedOption::_internal_mutable_aggregate_value() {
+  _has_bits_[0] |= 0x00000004u;
+  return aggregate_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* UninterpretedOption::release_aggregate_value() {
+  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value)
+  if (!_internal_has_aggregate_value()) {
+    return nullptr;
   }
-  aggregate_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aggregate_value,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value)
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = aggregate_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (aggregate_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    aggregate_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_aggregate_value(
-    ::std::string* aggregate_value) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (aggregate_value != NULL) {
-    set_has_aggregate_value();
+inline void UninterpretedOption::set_allocated_aggregate_value(std::string* aggregate_value) {
+  if (aggregate_value != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_aggregate_value();
+    _has_bits_[0] &= ~0x00000004u;
   }
-  aggregate_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      aggregate_value, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.aggregate_value)
+  aggregate_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), aggregate_value,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (aggregate_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    aggregate_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value)
 }
 
 // -------------------------------------------------------------------
@@ -10861,262 +14095,273 @@ inline void UninterpretedOption::unsafe_arena_set_allocated_aggregate_value(
 // SourceCodeInfo_Location
 
 // repeated int32 path = 1 [packed = true];
-inline int SourceCodeInfo_Location::path_size() const {
+inline int SourceCodeInfo_Location::_internal_path_size() const {
   return path_.size();
 }
+inline int SourceCodeInfo_Location::path_size() const {
+  return _internal_path_size();
+}
 inline void SourceCodeInfo_Location::clear_path() {
   path_.Clear();
 }
-inline ::google::protobuf::int32 SourceCodeInfo_Location::path(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.path)
+inline int32_t SourceCodeInfo_Location::_internal_path(int index) const {
   return path_.Get(index);
 }
-inline void SourceCodeInfo_Location::set_path(int index, ::google::protobuf::int32 value) {
+inline int32_t SourceCodeInfo_Location::path(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.path)
+  return _internal_path(index);
+}
+inline void SourceCodeInfo_Location::set_path(int index, int32_t value) {
   path_.Set(index, value);
   // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.path)
 }
-inline void SourceCodeInfo_Location::add_path(::google::protobuf::int32 value) {
+inline void SourceCodeInfo_Location::_internal_add_path(int32_t value) {
   path_.Add(value);
+}
+inline void SourceCodeInfo_Location::add_path(int32_t value) {
+  _internal_add_path(value);
   // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.path)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+SourceCodeInfo_Location::_internal_path() const {
+  return path_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 SourceCodeInfo_Location::path() const {
   // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.path)
-  return path_;
+  return _internal_path();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+SourceCodeInfo_Location::_internal_mutable_path() {
+  return &path_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 SourceCodeInfo_Location::mutable_path() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.path)
-  return &path_;
+  return _internal_mutable_path();
 }
 
 // repeated int32 span = 2 [packed = true];
-inline int SourceCodeInfo_Location::span_size() const {
+inline int SourceCodeInfo_Location::_internal_span_size() const {
   return span_.size();
 }
+inline int SourceCodeInfo_Location::span_size() const {
+  return _internal_span_size();
+}
 inline void SourceCodeInfo_Location::clear_span() {
   span_.Clear();
 }
-inline ::google::protobuf::int32 SourceCodeInfo_Location::span(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.span)
+inline int32_t SourceCodeInfo_Location::_internal_span(int index) const {
   return span_.Get(index);
 }
-inline void SourceCodeInfo_Location::set_span(int index, ::google::protobuf::int32 value) {
+inline int32_t SourceCodeInfo_Location::span(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.span)
+  return _internal_span(index);
+}
+inline void SourceCodeInfo_Location::set_span(int index, int32_t value) {
   span_.Set(index, value);
   // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.span)
 }
-inline void SourceCodeInfo_Location::add_span(::google::protobuf::int32 value) {
+inline void SourceCodeInfo_Location::_internal_add_span(int32_t value) {
   span_.Add(value);
+}
+inline void SourceCodeInfo_Location::add_span(int32_t value) {
+  _internal_add_span(value);
   // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.span)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+SourceCodeInfo_Location::_internal_span() const {
+  return span_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 SourceCodeInfo_Location::span() const {
   // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.span)
-  return span_;
+  return _internal_span();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+SourceCodeInfo_Location::_internal_mutable_span() {
+  return &span_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 SourceCodeInfo_Location::mutable_span() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.span)
-  return &span_;
+  return _internal_mutable_span();
 }
 
 // optional string leading_comments = 3;
-inline bool SourceCodeInfo_Location::has_leading_comments() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void SourceCodeInfo_Location::set_has_leading_comments() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool SourceCodeInfo_Location::_internal_has_leading_comments() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void SourceCodeInfo_Location::clear_has_leading_comments() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool SourceCodeInfo_Location::has_leading_comments() const {
+  return _internal_has_leading_comments();
 }
 inline void SourceCodeInfo_Location::clear_leading_comments() {
-  leading_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_leading_comments();
+  leading_comments_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& SourceCodeInfo_Location::leading_comments() const {
+inline const std::string& SourceCodeInfo_Location::leading_comments() const {
   // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_comments)
-  return leading_comments_.Get();
+  return _internal_leading_comments();
 }
-inline void SourceCodeInfo_Location::set_leading_comments(const ::std::string& value) {
-  set_has_leading_comments();
-  leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SourceCodeInfo_Location::set_leading_comments(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ leading_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_leading_comments();
-  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();
+inline std::string* SourceCodeInfo_Location::mutable_leading_comments() {
+  std::string* _s = _internal_mutable_leading_comments();
   // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_comments)
-  return leading_comments_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-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_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& SourceCodeInfo_Location::_internal_leading_comments() const {
+  return leading_comments_.Get();
 }
-inline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::string* leading_comments) {
-  if (leading_comments != NULL) {
-    set_has_leading_comments();
-  } else {
-    clear_has_leading_comments();
+inline void SourceCodeInfo_Location::_internal_set_leading_comments(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  leading_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SourceCodeInfo_Location::_internal_mutable_leading_comments() {
+  _has_bits_[0] |= 0x00000001u;
+  return leading_comments_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SourceCodeInfo_Location::release_leading_comments() {
+  // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.leading_comments)
+  if (!_internal_has_leading_comments()) {
+    return nullptr;
   }
-  leading_comments_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), leading_comments,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = leading_comments_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (leading_comments_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    leading_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_leading_comments(
-    ::std::string* leading_comments) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (leading_comments != NULL) {
-    set_has_leading_comments();
+inline void SourceCodeInfo_Location::set_allocated_leading_comments(std::string* leading_comments) {
+  if (leading_comments != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_leading_comments();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  leading_comments_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      leading_comments, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments)
+  leading_comments_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), leading_comments,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (leading_comments_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    leading_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments)
 }
 
 // optional string trailing_comments = 4;
-inline bool SourceCodeInfo_Location::has_trailing_comments() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void SourceCodeInfo_Location::set_has_trailing_comments() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool SourceCodeInfo_Location::_internal_has_trailing_comments() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void SourceCodeInfo_Location::clear_has_trailing_comments() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool SourceCodeInfo_Location::has_trailing_comments() const {
+  return _internal_has_trailing_comments();
 }
 inline void SourceCodeInfo_Location::clear_trailing_comments() {
-  trailing_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_trailing_comments();
+  trailing_comments_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& SourceCodeInfo_Location::trailing_comments() const {
+inline const std::string& SourceCodeInfo_Location::trailing_comments() const {
   // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.trailing_comments)
-  return trailing_comments_.Get();
+  return _internal_trailing_comments();
 }
-inline void SourceCodeInfo_Location::set_trailing_comments(const ::std::string& value) {
-  set_has_trailing_comments();
-  trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SourceCodeInfo_Location::set_trailing_comments(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ trailing_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_trailing_comments();
-  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();
+inline std::string* SourceCodeInfo_Location::mutable_trailing_comments() {
+  std::string* _s = _internal_mutable_trailing_comments();
   // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.trailing_comments)
-  return trailing_comments_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-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_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& SourceCodeInfo_Location::_internal_trailing_comments() const {
+  return trailing_comments_.Get();
 }
-inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::string* trailing_comments) {
-  if (trailing_comments != NULL) {
-    set_has_trailing_comments();
-  } else {
-    clear_has_trailing_comments();
+inline void SourceCodeInfo_Location::_internal_set_trailing_comments(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  trailing_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SourceCodeInfo_Location::_internal_mutable_trailing_comments() {
+  _has_bits_[0] |= 0x00000002u;
+  return trailing_comments_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SourceCodeInfo_Location::release_trailing_comments() {
+  // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.trailing_comments)
+  if (!_internal_has_trailing_comments()) {
+    return nullptr;
   }
-  trailing_comments_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), trailing_comments,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments)
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = trailing_comments_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (trailing_comments_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    trailing_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_trailing_comments(
-    ::std::string* trailing_comments) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (trailing_comments != NULL) {
-    set_has_trailing_comments();
+inline void SourceCodeInfo_Location::set_allocated_trailing_comments(std::string* trailing_comments) {
+  if (trailing_comments != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_trailing_comments();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  trailing_comments_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      trailing_comments, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments)
+  trailing_comments_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), trailing_comments,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (trailing_comments_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    trailing_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments)
 }
 
 // repeated string leading_detached_comments = 6;
-inline int SourceCodeInfo_Location::leading_detached_comments_size() const {
+inline int SourceCodeInfo_Location::_internal_leading_detached_comments_size() const {
   return leading_detached_comments_.size();
 }
+inline int SourceCodeInfo_Location::leading_detached_comments_size() const {
+  return _internal_leading_detached_comments_size();
+}
 inline void SourceCodeInfo_Location::clear_leading_detached_comments() {
   leading_detached_comments_.Clear();
 }
-inline const ::std::string& SourceCodeInfo_Location::leading_detached_comments(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
+inline std::string* SourceCodeInfo_Location::add_leading_detached_comments() {
+  std::string* _s = _internal_add_leading_detached_comments();
+  // @@protoc_insertion_point(field_add_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
+  return _s;
+}
+inline const std::string& SourceCodeInfo_Location::_internal_leading_detached_comments(int index) const {
   return leading_detached_comments_.Get(index);
 }
-inline ::std::string* SourceCodeInfo_Location::mutable_leading_detached_comments(int index) {
+inline const std::string& SourceCodeInfo_Location::leading_detached_comments(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
+  return _internal_leading_detached_comments(index);
+}
+inline std::string* SourceCodeInfo_Location::mutable_leading_detached_comments(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
   return leading_detached_comments_.Mutable(index);
 }
-inline 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)
+inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const std::string& value) {
   leading_detached_comments_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
+}
+inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, std::string&& value) {
   leading_detached_comments_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
 }
-#endif
 inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   leading_detached_comments_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
 }
@@ -11125,22 +14370,19 @@ inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, co
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
 }
-inline ::std::string* SourceCodeInfo_Location::add_leading_detached_comments() {
-  // @@protoc_insertion_point(field_add_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
+inline std::string* SourceCodeInfo_Location::_internal_add_leading_detached_comments() {
   return leading_detached_comments_.Add();
 }
-inline void SourceCodeInfo_Location::add_leading_detached_comments(const ::std::string& value) {
+inline 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
-inline void SourceCodeInfo_Location::add_leading_detached_comments(::std::string&& value) {
+inline 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
 inline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   leading_detached_comments_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
 }
@@ -11148,12 +14390,12 @@ inline void SourceCodeInfo_Location::add_leading_detached_comments(const char* v
   leading_detached_comments_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::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_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::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_;
@@ -11164,30 +14406,40 @@ SourceCodeInfo_Location::mutable_leading_detached_comments() {
 // SourceCodeInfo
 
 // repeated .google.protobuf.SourceCodeInfo.Location location = 1;
-inline int SourceCodeInfo::location_size() const {
+inline int SourceCodeInfo::_internal_location_size() const {
   return location_.size();
 }
+inline int SourceCodeInfo::location_size() const {
+  return _internal_location_size();
+}
 inline void SourceCodeInfo::clear_location() {
   location_.Clear();
 }
-inline const ::google::protobuf::SourceCodeInfo_Location& SourceCodeInfo::location(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.location)
-  return location_.Get(index);
-}
-inline ::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::mutable_location(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* SourceCodeInfo::mutable_location(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.location)
   return location_.Mutable(index);
 }
-inline ::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::add_location() {
-  // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.location)
-  return location_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location >*
 SourceCodeInfo::mutable_location() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.location)
   return &location_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >&
+inline const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location& SourceCodeInfo::_internal_location(int index) const {
+  return location_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location& SourceCodeInfo::location(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.location)
+  return _internal_location(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* SourceCodeInfo::_internal_add_location() {
+  return location_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* SourceCodeInfo::add_location() {
+  ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* _add = _internal_add_location();
+  // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.location)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location >&
 SourceCodeInfo::location() const {
   // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.location)
   return location_;
@@ -11198,165 +14450,174 @@ SourceCodeInfo::location() const {
 // GeneratedCodeInfo_Annotation
 
 // repeated int32 path = 1 [packed = true];
-inline int GeneratedCodeInfo_Annotation::path_size() const {
+inline int GeneratedCodeInfo_Annotation::_internal_path_size() const {
   return path_.size();
 }
+inline int GeneratedCodeInfo_Annotation::path_size() const {
+  return _internal_path_size();
+}
 inline void GeneratedCodeInfo_Annotation::clear_path() {
   path_.Clear();
 }
-inline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::path(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.path)
+inline int32_t GeneratedCodeInfo_Annotation::_internal_path(int index) const {
   return path_.Get(index);
 }
-inline void GeneratedCodeInfo_Annotation::set_path(int index, ::google::protobuf::int32 value) {
+inline int32_t GeneratedCodeInfo_Annotation::path(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.path)
+  return _internal_path(index);
+}
+inline void GeneratedCodeInfo_Annotation::set_path(int index, int32_t value) {
   path_.Set(index, value);
   // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.path)
 }
-inline void GeneratedCodeInfo_Annotation::add_path(::google::protobuf::int32 value) {
+inline void GeneratedCodeInfo_Annotation::_internal_add_path(int32_t value) {
   path_.Add(value);
+}
+inline void GeneratedCodeInfo_Annotation::add_path(int32_t value) {
+  _internal_add_path(value);
   // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.Annotation.path)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+GeneratedCodeInfo_Annotation::_internal_path() const {
+  return path_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 GeneratedCodeInfo_Annotation::path() const {
   // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.Annotation.path)
-  return path_;
+  return _internal_path();
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+GeneratedCodeInfo_Annotation::_internal_mutable_path() {
+  return &path_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 GeneratedCodeInfo_Annotation::mutable_path() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.Annotation.path)
-  return &path_;
+  return _internal_mutable_path();
 }
 
 // optional string source_file = 2;
-inline bool GeneratedCodeInfo_Annotation::has_source_file() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool GeneratedCodeInfo_Annotation::_internal_has_source_file() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void GeneratedCodeInfo_Annotation::set_has_source_file() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void GeneratedCodeInfo_Annotation::clear_has_source_file() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool GeneratedCodeInfo_Annotation::has_source_file() const {
+  return _internal_has_source_file();
 }
 inline void GeneratedCodeInfo_Annotation::clear_source_file() {
-  source_file_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  clear_has_source_file();
+  source_file_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& GeneratedCodeInfo_Annotation::source_file() const {
+inline const std::string& GeneratedCodeInfo_Annotation::source_file() const {
   // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
-  return source_file_.Get();
+  return _internal_source_file();
 }
-inline void GeneratedCodeInfo_Annotation::set_source_file(const ::std::string& value) {
-  set_has_source_file();
-  source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void GeneratedCodeInfo_Annotation::set_source_file(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ source_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@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_.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_.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) {
-  set_has_source_file();
-  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();
+inline std::string* GeneratedCodeInfo_Annotation::mutable_source_file() {
+  std::string* _s = _internal_mutable_source_file();
   // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
-  return source_file_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return _s;
 }
-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_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+inline const std::string& GeneratedCodeInfo_Annotation::_internal_source_file() const {
+  return source_file_.Get();
 }
-inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::string* source_file) {
-  if (source_file != NULL) {
-    set_has_source_file();
-  } else {
-    clear_has_source_file();
+inline void GeneratedCodeInfo_Annotation::_internal_set_source_file(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  source_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* GeneratedCodeInfo_Annotation::_internal_mutable_source_file() {
+  _has_bits_[0] |= 0x00000001u;
+  return source_file_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* GeneratedCodeInfo_Annotation::release_source_file() {
+  // @@protoc_insertion_point(field_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
+  if (!_internal_has_source_file()) {
+    return nullptr;
   }
-  source_file_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source_file,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = source_file_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-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::unsafe_arena_set_allocated_source_file(
-    ::std::string* source_file) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (source_file != NULL) {
-    set_has_source_file();
+inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(std::string* source_file) {
+  if (source_file != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_source_file();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  source_file_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), source_file,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  source_file_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      source_file, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
 }
 
 // optional int32 begin = 3;
-inline bool GeneratedCodeInfo_Annotation::has_begin() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void GeneratedCodeInfo_Annotation::set_has_begin() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool GeneratedCodeInfo_Annotation::_internal_has_begin() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void GeneratedCodeInfo_Annotation::clear_has_begin() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool GeneratedCodeInfo_Annotation::has_begin() const {
+  return _internal_has_begin();
 }
 inline void GeneratedCodeInfo_Annotation::clear_begin() {
   begin_ = 0;
-  clear_has_begin();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::begin() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.begin)
+inline int32_t GeneratedCodeInfo_Annotation::_internal_begin() const {
   return begin_;
 }
-inline void GeneratedCodeInfo_Annotation::set_begin(::google::protobuf::int32 value) {
-  set_has_begin();
+inline int32_t GeneratedCodeInfo_Annotation::begin() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.begin)
+  return _internal_begin();
+}
+inline void GeneratedCodeInfo_Annotation::_internal_set_begin(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   begin_ = value;
+}
+inline void GeneratedCodeInfo_Annotation::set_begin(int32_t value) {
+  _internal_set_begin(value);
   // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.begin)
 }
 
 // optional int32 end = 4;
-inline bool GeneratedCodeInfo_Annotation::has_end() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void GeneratedCodeInfo_Annotation::set_has_end() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool GeneratedCodeInfo_Annotation::_internal_has_end() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void GeneratedCodeInfo_Annotation::clear_has_end() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool GeneratedCodeInfo_Annotation::has_end() const {
+  return _internal_has_end();
 }
 inline void GeneratedCodeInfo_Annotation::clear_end() {
   end_ = 0;
-  clear_has_end();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::end() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.end)
+inline int32_t GeneratedCodeInfo_Annotation::_internal_end() const {
   return end_;
 }
-inline void GeneratedCodeInfo_Annotation::set_end(::google::protobuf::int32 value) {
-  set_has_end();
+inline int32_t GeneratedCodeInfo_Annotation::end() const {
+  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.end)
+  return _internal_end();
+}
+inline void GeneratedCodeInfo_Annotation::_internal_set_end(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   end_ = value;
+}
+inline void GeneratedCodeInfo_Annotation::set_end(int32_t value) {
+  _internal_set_end(value);
   // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.end)
 }
 
@@ -11365,30 +14626,40 @@ inline void GeneratedCodeInfo_Annotation::set_end(::google::protobuf::int32 valu
 // GeneratedCodeInfo
 
 // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;
-inline int GeneratedCodeInfo::annotation_size() const {
+inline int GeneratedCodeInfo::_internal_annotation_size() const {
   return annotation_.size();
 }
+inline int GeneratedCodeInfo::annotation_size() const {
+  return _internal_annotation_size();
+}
 inline void GeneratedCodeInfo::clear_annotation() {
   annotation_.Clear();
 }
-inline const ::google::protobuf::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::annotation(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.annotation)
-  return annotation_.Get(index);
-}
-inline ::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::mutable_annotation(int index) {
+inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::mutable_annotation(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.annotation)
   return annotation_.Mutable(index);
 }
-inline ::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::add_annotation() {
-  // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.annotation)
-  return annotation_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation >*
 GeneratedCodeInfo::mutable_annotation() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.annotation)
   return &annotation_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >&
+inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::_internal_annotation(int index) const {
+  return annotation_.Get(index);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::annotation(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.annotation)
+  return _internal_annotation(index);
+}
+inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::_internal_add_annotation() {
+  return annotation_.Add();
+}
+inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::add_annotation() {
+  ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* _add = _internal_add_annotation();
+  // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.annotation)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation >&
 GeneratedCodeInfo::annotation() const {
   // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.annotation)
   return annotation_;
@@ -11452,46 +14723,44 @@ GeneratedCodeInfo::annotation() const {
 
 // @@protoc_insertion_point(namespace_scope)
 
-}  // namespace protobuf
-}  // namespace google
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
 
-template <> struct is_proto_enum< ::google::protobuf::FieldDescriptorProto_Type> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type> : ::std::true_type {};
 template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldDescriptorProto_Type>() {
-  return ::google::protobuf::FieldDescriptorProto_Type_descriptor();
+inline const EnumDescriptor* GetEnumDescriptor< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type>() {
+  return ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type_descriptor();
 }
-template <> struct is_proto_enum< ::google::protobuf::FieldDescriptorProto_Label> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label> : ::std::true_type {};
 template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldDescriptorProto_Label>() {
-  return ::google::protobuf::FieldDescriptorProto_Label_descriptor();
+inline const EnumDescriptor* GetEnumDescriptor< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label>() {
+  return ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label_descriptor();
 }
-template <> struct is_proto_enum< ::google::protobuf::FileOptions_OptimizeMode> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode> : ::std::true_type {};
 template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FileOptions_OptimizeMode>() {
-  return ::google::protobuf::FileOptions_OptimizeMode_descriptor();
+inline const EnumDescriptor* GetEnumDescriptor< ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode>() {
+  return ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode_descriptor();
 }
-template <> struct is_proto_enum< ::google::protobuf::FieldOptions_CType> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType> : ::std::true_type {};
 template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldOptions_CType>() {
-  return ::google::protobuf::FieldOptions_CType_descriptor();
+inline const EnumDescriptor* GetEnumDescriptor< ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType>() {
+  return ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType_descriptor();
 }
-template <> struct is_proto_enum< ::google::protobuf::FieldOptions_JSType> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType> : ::std::true_type {};
 template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldOptions_JSType>() {
-  return ::google::protobuf::FieldOptions_JSType_descriptor();
+inline const EnumDescriptor* GetEnumDescriptor< ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType>() {
+  return ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType_descriptor();
 }
-template <> struct is_proto_enum< ::google::protobuf::MethodOptions_IdempotencyLevel> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel> : ::std::true_type {};
 template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::MethodOptions_IdempotencyLevel>() {
-  return ::google::protobuf::MethodOptions_IdempotencyLevel_descriptor();
+inline const EnumDescriptor* GetEnumDescriptor< ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel>() {
+  return ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel_descriptor();
 }
 
-}  // namespace protobuf
-}  // namespace google
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto
index ba85ef1..be1afcb 100644 (file)
 #include <set>
 
 #include <google/protobuf/descriptor.pb.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/stubs/strutil.h>
-
 #include <google/protobuf/stubs/map_util.h>
 #include <google/protobuf/stubs/stl_util.h>
 
+
 namespace google {
 namespace protobuf {
 
+namespace {
+void RecordMessageNames(const DescriptorProto& desc_proto,
+                        const std::string& prefix,
+                        std::set<std::string>* output) {
+  GOOGLE_CHECK(desc_proto.has_name());
+  std::string full_name = prefix.empty()
+                              ? desc_proto.name()
+                              : StrCat(prefix, ".", desc_proto.name());
+  output->insert(full_name);
+
+  for (const auto& d : desc_proto.nested_type()) {
+    RecordMessageNames(d, full_name, output);
+  }
+}
+
+void RecordMessageNames(const FileDescriptorProto& file_proto,
+                        std::set<std::string>* output) {
+  for (const auto& d : file_proto.message_type()) {
+    RecordMessageNames(d, file_proto.package(), output);
+  }
+}
+
+template <typename Fn>
+bool ForAllFileProtos(DescriptorDatabase* db, Fn callback,
+                      std::vector<std::string>* output) {
+  std::vector<std::string> file_names;
+  if (!db->FindAllFileNames(&file_names)) {
+    return false;
+  }
+  std::set<std::string> set;
+  FileDescriptorProto file_proto;
+  for (const auto& f : file_names) {
+    file_proto.Clear();
+    if (!db->FindFileByName(f, &file_proto)) {
+      GOOGLE_LOG(ERROR) << "File not found in database (unexpected): " << f;
+      return false;
+    }
+    callback(file_proto, &set);
+  }
+  output->insert(output->end(), set.begin(), set.end());
+  return true;
+}
+}  // namespace
+
 DescriptorDatabase::~DescriptorDatabase() {}
 
+bool DescriptorDatabase::FindAllPackageNames(std::vector<std::string>* output) {
+  return ForAllFileProtos(
+      this,
+      [](const FileDescriptorProto& file_proto, std::set<std::string>* set) {
+        set->insert(file_proto.package());
+      },
+      output);
+}
+
+bool DescriptorDatabase::FindAllMessageNames(std::vector<std::string>* output) {
+  return ForAllFileProtos(
+      this,
+      [](const FileDescriptorProto& file_proto, std::set<std::string>* set) {
+        RecordMessageNames(file_proto, set);
+      },
+      output);
+}
+
 // ===================================================================
 
+SimpleDescriptorDatabase::SimpleDescriptorDatabase() {}
+SimpleDescriptorDatabase::~SimpleDescriptorDatabase() {}
+
 template <typename Value>
 bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddFile(
-    const FileDescriptorProto& file,
-    Value value) {
+    const FileDescriptorProto& file, Value value) {
   if (!InsertIfNotPresent(&by_name_, file.name(), value)) {
     GOOGLE_LOG(ERROR) << "File already exists in database: " << file.name();
     return false;
@@ -62,19 +124,20 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddFile(
   // We must be careful here -- calling file.package() if file.has_package() is
   // false could access an uninitialized static-storage variable if we are being
   // run at startup time.
-  string path = file.has_package() ? file.package() : string();
+  std::string path = file.has_package() ? file.package() : std::string();
   if (!path.empty()) path += '.';
 
   for (int i = 0; i < file.message_type_size(); i++) {
     if (!AddSymbol(path + file.message_type(i).name(), value)) return false;
-    if (!AddNestedExtensions(file.message_type(i), value)) return false;
+    if (!AddNestedExtensions(file.name(), file.message_type(i), value))
+      return false;
   }
   for (int i = 0; i < file.enum_type_size(); i++) {
     if (!AddSymbol(path + file.enum_type(i).name(), value)) return false;
   }
   for (int i = 0; i < file.extension_size(); i++) {
     if (!AddSymbol(path + file.extension(i).name(), value)) return false;
-    if (!AddExtension(file.extension(i), value)) return false;
+    if (!AddExtension(file.name(), file.extension(i), value)) return false;
   }
   for (int i = 0; i < file.service_size(); i++) {
     if (!AddSymbol(path + file.service(i).name(), value)) return false;
@@ -83,9 +146,55 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddFile(
   return true;
 }
 
+namespace {
+
+// Returns true if and only if all characters in the name are alphanumerics,
+// underscores, or periods.
+bool ValidateSymbolName(StringPiece name) {
+  for (char c : name) {
+    // I don't trust ctype.h due to locales.  :(
+    if (c != '.' && c != '_' && (c < '0' || c > '9') && (c < 'A' || c > 'Z') &&
+        (c < 'a' || c > 'z')) {
+      return false;
+    }
+  }
+  return true;
+}
+
+// Find the last key in the container which sorts less than or equal to the
+// symbol name.  Since upper_bound() returns the *first* key that sorts
+// *greater* than the input, we want the element immediately before that.
+template <typename Container, typename Key>
+typename Container::const_iterator FindLastLessOrEqual(
+    const Container* container, const Key& key) {
+  auto iter = container->upper_bound(key);
+  if (iter != container->begin()) --iter;
+  return iter;
+}
+
+// As above, but using std::upper_bound instead.
+template <typename Container, typename Key, typename Cmp>
+typename Container::const_iterator FindLastLessOrEqual(
+    const Container* container, const Key& key, const Cmp& cmp) {
+  auto iter = std::upper_bound(container->begin(), container->end(), key, cmp);
+  if (iter != container->begin()) --iter;
+  return iter;
+}
+
+// True if either the arguments are equal or super_symbol identifies a
+// parent symbol of sub_symbol (e.g. "foo.bar" is a parent of
+// "foo.bar.baz", but not a parent of "foo.barbaz").
+bool IsSubSymbol(StringPiece sub_symbol, StringPiece super_symbol) {
+  return sub_symbol == super_symbol ||
+         (HasPrefixString(super_symbol, sub_symbol) &&
+          super_symbol[sub_symbol.size()] == '.');
+}
+
+}  // namespace
+
 template <typename Value>
 bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddSymbol(
-    const string& name, Value value) {
+    const std::string& name, Value value) {
   // We need to make sure not to violate our map invariant.
 
   // If the symbol name is invalid it could break our lookup algorithm (which
@@ -98,18 +207,20 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddSymbol(
 
   // Try to look up the symbol to make sure a super-symbol doesn't already
   // exist.
-  typename std::map<string, Value>::iterator iter = FindLastLessOrEqual(name);
+  auto iter = FindLastLessOrEqual(&by_symbol_, name);
 
   if (iter == by_symbol_.end()) {
     // Apparently the map is currently empty.  Just insert and be done with it.
     by_symbol_.insert(
-        typename std::map<string, Value>::value_type(name, value));
+        typename std::map<std::string, Value>::value_type(name, value));
     return true;
   }
 
   if (IsSubSymbol(iter->first, name)) {
-    GOOGLE_LOG(ERROR) << "Symbol name \"" << name << "\" conflicts with the existing "
-                  "symbol \"" << iter->first << "\".";
+    GOOGLE_LOG(ERROR) << "Symbol name \"" << name
+               << "\" conflicts with the existing "
+                  "symbol \""
+               << iter->first << "\".";
     return false;
   }
 
@@ -121,8 +232,10 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddSymbol(
   ++iter;
 
   if (iter != by_symbol_.end() && IsSubSymbol(name, iter->first)) {
-    GOOGLE_LOG(ERROR) << "Symbol name \"" << name << "\" conflicts with the existing "
-                  "symbol \"" << iter->first << "\".";
+    GOOGLE_LOG(ERROR) << "Symbol name \"" << name
+               << "\" conflicts with the existing "
+                  "symbol \""
+               << iter->first << "\".";
     return false;
   }
 
@@ -130,28 +243,29 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddSymbol(
 
   // Insert the new symbol using the iterator as a hint, the new entry will
   // appear immediately before the one the iterator is pointing at.
-  by_symbol_.insert(iter,
-                    typename std::map<string, Value>::value_type(name, value));
+  by_symbol_.insert(
+      iter, typename std::map<std::string, Value>::value_type(name, value));
 
   return true;
 }
 
 template <typename Value>
 bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddNestedExtensions(
-    const DescriptorProto& message_type,
+    const std::string& filename, const DescriptorProto& message_type,
     Value value) {
   for (int i = 0; i < message_type.nested_type_size(); i++) {
-    if (!AddNestedExtensions(message_type.nested_type(i), value)) return false;
+    if (!AddNestedExtensions(filename, message_type.nested_type(i), value))
+      return false;
   }
   for (int i = 0; i < message_type.extension_size(); i++) {
-    if (!AddExtension(message_type.extension(i), value)) return false;
+    if (!AddExtension(filename, message_type.extension(i), value)) return false;
   }
   return true;
 }
 
 template <typename Value>
 bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddExtension(
-    const FieldDescriptorProto& field,
+    const std::string& filename, const FieldDescriptorProto& field,
     Value value) {
   if (!field.extendee().empty() && field.extendee()[0] == '.') {
     // The extension is fully-qualified.  We can use it as a lookup key in
@@ -161,8 +275,9 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddExtension(
             std::make_pair(field.extendee().substr(1), field.number()),
             value)) {
       GOOGLE_LOG(ERROR) << "Extension conflicts with extension already in database: "
-                    "extend " << field.extendee() << " { "
-                 << field.name() << " = " << field.number() << " }";
+                    "extend "
+                 << field.extendee() << " { " << field.name() << " = "
+                 << field.number() << " } from:" << filename;
       return false;
     }
   } else {
@@ -175,32 +290,31 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddExtension(
 
 template <typename Value>
 Value SimpleDescriptorDatabase::DescriptorIndex<Value>::FindFile(
-    const string& filename) {
+    const std::string& filename) {
   return FindWithDefault(by_name_, filename, Value());
 }
 
 template <typename Value>
 Value SimpleDescriptorDatabase::DescriptorIndex<Value>::FindSymbol(
-    const string& name) {
-  typename std::map<string, Value>::iterator iter = FindLastLessOrEqual(name);
+    const std::string& name) {
+  auto iter = FindLastLessOrEqual(&by_symbol_, name);
 
-  return (iter != by_symbol_.end() && IsSubSymbol(iter->first, name)) ?
-         iter->second : Value();
+  return (iter != by_symbol_.end() && IsSubSymbol(iter->first, name))
+             ? iter->second
+             : Value();
 }
 
 template <typename Value>
 Value SimpleDescriptorDatabase::DescriptorIndex<Value>::FindExtension(
-    const string& containing_type,
-    int field_number) {
+    const std::string& containing_type, int field_number) {
   return FindWithDefault(
       by_extension_, std::make_pair(containing_type, field_number), Value());
 }
 
 template <typename Value>
 bool SimpleDescriptorDatabase::DescriptorIndex<Value>::FindAllExtensionNumbers(
-    const string& containing_type,
-    std::vector<int>* output) {
-  typename std::map<std::pair<string, int>, Value>::const_iterator it =
+    const std::string& containing_type, std::vector<int>* output) {
+  typename std::map<std::pair<std::string, int>, Value>::const_iterator it =
       by_extension_.lower_bound(std::make_pair(containing_type, 0));
   bool success = false;
 
@@ -214,48 +328,18 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::FindAllExtensionNumbers(
 }
 
 template <typename Value>
-typename std::map<string, Value>::iterator
-SimpleDescriptorDatabase::DescriptorIndex<Value>::FindLastLessOrEqual(
-    const string& name) {
-  // Find the last key in the map which sorts less than or equal to the
-  // symbol name.  Since upper_bound() returns the *first* key that sorts
-  // *greater* than the input, we want the element immediately before that.
-  typename std::map<string, Value>::iterator iter =
-      by_symbol_.upper_bound(name);
-  if (iter != by_symbol_.begin()) --iter;
-  return iter;
-}
-
-template <typename Value>
-bool SimpleDescriptorDatabase::DescriptorIndex<Value>::IsSubSymbol(
-    const string& sub_symbol, const string& super_symbol) {
-  return sub_symbol == super_symbol ||
-         (HasPrefixString(super_symbol, sub_symbol) &&
-          super_symbol[sub_symbol.size()] == '.');
-}
-
-template <typename Value>
-bool SimpleDescriptorDatabase::DescriptorIndex<Value>::ValidateSymbolName(
-    const string& name) {
-  for (int i = 0; i < name.size(); i++) {
-    // I don't trust ctype.h due to locales.  :(
-    if (name[i] != '.' && name[i] != '_' &&
-        (name[i] < '0' || name[i] > '9') &&
-        (name[i] < 'A' || name[i] > 'Z') &&
-        (name[i] < 'a' || name[i] > 'z')) {
-      return false;
-    }
+void SimpleDescriptorDatabase::DescriptorIndex<Value>::FindAllFileNames(
+    std::vector<std::string>* output) {
+  output->resize(by_name_.size());
+  int i = 0;
+  for (const auto& kv : by_name_) {
+    (*output)[i] = kv.first;
+    i++;
   }
-  return true;
 }
 
 // -------------------------------------------------------------------
 
-SimpleDescriptorDatabase::SimpleDescriptorDatabase() {}
-SimpleDescriptorDatabase::~SimpleDescriptorDatabase() {
-  STLDeleteElements(&files_to_delete_);
-}
-
 bool SimpleDescriptorDatabase::Add(const FileDescriptorProto& file) {
   FileDescriptorProto* new_file = new FileDescriptorProto;
   new_file->CopyFrom(file);
@@ -263,57 +347,214 @@ bool SimpleDescriptorDatabase::Add(const FileDescriptorProto& file) {
 }
 
 bool SimpleDescriptorDatabase::AddAndOwn(const FileDescriptorProto* file) {
-  files_to_delete_.push_back(file);
+  files_to_delete_.emplace_back(file);
   return index_.AddFile(*file, file);
 }
 
-bool SimpleDescriptorDatabase::FindFileByName(
-    const string& filename,
-    FileDescriptorProto* output) {
+bool SimpleDescriptorDatabase::FindFileByName(const std::string& filename,
+                                              FileDescriptorProto* output) {
   return MaybeCopy(index_.FindFile(filename), output);
 }
 
 bool SimpleDescriptorDatabase::FindFileContainingSymbol(
-    const string& symbol_name,
-    FileDescriptorProto* output) {
+    const std::string& symbol_name, FileDescriptorProto* output) {
   return MaybeCopy(index_.FindSymbol(symbol_name), output);
 }
 
 bool SimpleDescriptorDatabase::FindFileContainingExtension(
-    const string& containing_type,
-    int field_number,
+    const std::string& containing_type, int field_number,
     FileDescriptorProto* output) {
   return MaybeCopy(index_.FindExtension(containing_type, field_number), output);
 }
 
 bool SimpleDescriptorDatabase::FindAllExtensionNumbers(
-    const string& extendee_type,
-    std::vector<int>* output) {
+    const std::string& extendee_type, std::vector<int>* output) {
   return index_.FindAllExtensionNumbers(extendee_type, output);
 }
 
 
+bool SimpleDescriptorDatabase::FindAllFileNames(
+    std::vector<std::string>* output) {
+  index_.FindAllFileNames(output);
+  return true;
+}
+
 bool SimpleDescriptorDatabase::MaybeCopy(const FileDescriptorProto* file,
                                          FileDescriptorProto* output) {
-  if (file == NULL) return false;
+  if (file == nullptr) return false;
   output->CopyFrom(*file);
   return true;
 }
 
 // -------------------------------------------------------------------
 
-EncodedDescriptorDatabase::EncodedDescriptorDatabase() {}
-EncodedDescriptorDatabase::~EncodedDescriptorDatabase() {
-  for (int i = 0; i < files_to_delete_.size(); i++) {
-    operator delete(files_to_delete_[i]);
-  }
-}
+class EncodedDescriptorDatabase::DescriptorIndex {
+ public:
+  using Value = std::pair<const void*, int>;
+  // Helpers to recursively add particular descriptors and all their contents
+  // to the index.
+  template <typename FileProto>
+  bool AddFile(const FileProto& file, Value value);
+
+  Value FindFile(StringPiece filename);
+  Value FindSymbol(StringPiece name);
+  Value FindSymbolOnlyFlat(StringPiece name) const;
+  Value FindExtension(StringPiece containing_type, int field_number);
+  bool FindAllExtensionNumbers(StringPiece containing_type,
+                               std::vector<int>* output);
+  void FindAllFileNames(std::vector<std::string>* output) const;
+
+ private:
+  friend class EncodedDescriptorDatabase;
+
+  bool AddSymbol(StringPiece symbol);
+
+  template <typename DescProto>
+  bool AddNestedExtensions(StringPiece filename,
+                           const DescProto& message_type);
+  template <typename FieldProto>
+  bool AddExtension(StringPiece filename, const FieldProto& field);
+
+  // All the maps below have two representations:
+  //  - a std::set<> where we insert initially.
+  //  - a std::vector<> where we flatten the structure on demand.
+  // The initial tree helps avoid O(N) behavior of inserting into a sorted
+  // vector, while the vector reduces the heap requirements of the data
+  // structure.
+
+  void EnsureFlat();
+
+  using String = std::string;
+
+  String EncodeString(StringPiece str) const { return String(str); }
+  StringPiece DecodeString(const String& str, int) const { return str; }
+
+  struct EncodedEntry {
+    // Do not use `Value` here to avoid the padding of that object.
+    const void* data;
+    int size;
+    // Keep the package here instead of each SymbolEntry to save space.
+    String encoded_package;
+
+    Value value() const { return {data, size}; }
+  };
+  std::vector<EncodedEntry> all_values_;
+
+  struct FileEntry {
+    int data_offset;
+    String encoded_name;
+
+    StringPiece name(const DescriptorIndex& index) const {
+      return index.DecodeString(encoded_name, data_offset);
+    }
+  };
+  struct FileCompare {
+    const DescriptorIndex& index;
+
+    bool operator()(const FileEntry& a, const FileEntry& b) const {
+      return a.name(index) < b.name(index);
+    }
+    bool operator()(const FileEntry& a, StringPiece b) const {
+      return a.name(index) < b;
+    }
+    bool operator()(StringPiece a, const FileEntry& b) const {
+      return a < b.name(index);
+    }
+  };
+  std::set<FileEntry, FileCompare> by_name_{FileCompare{*this}};
+  std::vector<FileEntry> by_name_flat_;
+
+  struct SymbolEntry {
+    int data_offset;
+    String encoded_symbol;
+
+    StringPiece package(const DescriptorIndex& index) const {
+      return index.DecodeString(index.all_values_[data_offset].encoded_package,
+                                data_offset);
+    }
+    StringPiece symbol(const DescriptorIndex& index) const {
+      return index.DecodeString(encoded_symbol, data_offset);
+    }
+
+    std::string AsString(const DescriptorIndex& index) const {
+      auto p = package(index);
+      return StrCat(p, p.empty() ? "" : ".", symbol(index));
+    }
+  };
+
+  struct SymbolCompare {
+    const DescriptorIndex& index;
 
-bool EncodedDescriptorDatabase::Add(
-    const void* encoded_file_descriptor, int size) {
+    std::string AsString(const SymbolEntry& entry) const {
+      return entry.AsString(index);
+    }
+    static StringPiece AsString(StringPiece str) { return str; }
+
+    std::pair<StringPiece, StringPiece> GetParts(
+        const SymbolEntry& entry) const {
+      auto package = entry.package(index);
+      if (package.empty()) return {entry.symbol(index), StringPiece{}};
+      return {package, entry.symbol(index)};
+    }
+    std::pair<StringPiece, StringPiece> GetParts(
+        StringPiece str) const {
+      return {str, {}};
+    }
+
+    template <typename T, typename U>
+    bool operator()(const T& lhs, const U& rhs) const {
+      auto lhs_parts = GetParts(lhs);
+      auto rhs_parts = GetParts(rhs);
+
+      // Fast path to avoid making the whole string for common cases.
+      if (int res =
+              lhs_parts.first.substr(0, rhs_parts.first.size())
+                  .compare(rhs_parts.first.substr(0, lhs_parts.first.size()))) {
+        // If the packages already differ, exit early.
+        return res < 0;
+      } else if (lhs_parts.first.size() == rhs_parts.first.size()) {
+        return lhs_parts.second < rhs_parts.second;
+      }
+      return AsString(lhs) < AsString(rhs);
+    }
+  };
+  std::set<SymbolEntry, SymbolCompare> by_symbol_{SymbolCompare{*this}};
+  std::vector<SymbolEntry> by_symbol_flat_;
+
+  struct ExtensionEntry {
+    int data_offset;
+    String encoded_extendee;
+    StringPiece extendee(const DescriptorIndex& index) const {
+      return index.DecodeString(encoded_extendee, data_offset).substr(1);
+    }
+    int extension_number;
+  };
+  struct ExtensionCompare {
+    const DescriptorIndex& index;
+
+    bool operator()(const ExtensionEntry& a, const ExtensionEntry& b) const {
+      return std::make_tuple(a.extendee(index), a.extension_number) <
+             std::make_tuple(b.extendee(index), b.extension_number);
+    }
+    bool operator()(const ExtensionEntry& a,
+                    std::tuple<StringPiece, int> b) const {
+      return std::make_tuple(a.extendee(index), a.extension_number) < b;
+    }
+    bool operator()(std::tuple<StringPiece, int> a,
+                    const ExtensionEntry& b) const {
+      return a < std::make_tuple(b.extendee(index), b.extension_number);
+    }
+  };
+  std::set<ExtensionEntry, ExtensionCompare> by_extension_{
+      ExtensionCompare{*this}};
+  std::vector<ExtensionEntry> by_extension_flat_;
+};
+
+bool EncodedDescriptorDatabase::Add(const void* encoded_file_descriptor,
+                                    int size) {
   FileDescriptorProto file;
   if (file.ParseFromArray(encoded_file_descriptor, size)) {
-    return index_.AddFile(file, std::make_pair(encoded_file_descriptor, size));
+    return index_->AddFile(file, std::make_pair(encoded_file_descriptor, size));
   } else {
     GOOGLE_LOG(ERROR) << "Invalid file descriptor data passed to "
                   "EncodedDescriptorDatabase::Add().";
@@ -321,38 +562,35 @@ bool EncodedDescriptorDatabase::Add(
   }
 }
 
-bool EncodedDescriptorDatabase::AddCopy(
-    const void* encoded_file_descriptor, int size) {
+bool EncodedDescriptorDatabase::AddCopy(const void* encoded_file_descriptor,
+                                        int size) {
   void* copy = operator new(size);
   memcpy(copy, encoded_file_descriptor, size);
   files_to_delete_.push_back(copy);
   return Add(copy, size);
 }
 
-bool EncodedDescriptorDatabase::FindFileByName(
-    const string& filename,
-    FileDescriptorProto* output) {
-  return MaybeParse(index_.FindFile(filename), output);
+bool EncodedDescriptorDatabase::FindFileByName(const std::string& filename,
+                                               FileDescriptorProto* output) {
+  return MaybeParse(index_->FindFile(filename), output);
 }
 
 bool EncodedDescriptorDatabase::FindFileContainingSymbol(
-    const string& symbol_name,
-    FileDescriptorProto* output) {
-  return MaybeParse(index_.FindSymbol(symbol_name), output);
+    const std::string& symbol_name, FileDescriptorProto* output) {
+  return MaybeParse(index_->FindSymbol(symbol_name), output);
 }
 
 bool EncodedDescriptorDatabase::FindNameOfFileContainingSymbol(
-    const string& symbol_name,
-    string* output) {
-  std::pair<const void*, int> encoded_file = index_.FindSymbol(symbol_name);
-  if (encoded_file.first == NULL) return false;
+    const std::string& symbol_name, std::string* output) {
+  auto encoded_file = index_->FindSymbol(symbol_name);
+  if (encoded_file.first == nullptr) return false;
 
   // Optimization:  The name should be the first field in the encoded message.
   //   Try to just read it directly.
-  io::CodedInputStream input(reinterpret_cast<const uint8*>(encoded_file.first),
+  io::CodedInputStream input(static_cast<const uint8_t*>(encoded_file.first),
                              encoded_file.second);
 
-  const uint32 kNameTag = internal::WireFormatLite::MakeTag(
+  const uint32_t kNameTag = internal::WireFormatLite::MakeTag(
       FileDescriptorProto::kNameFieldNumber,
       internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED);
 
@@ -371,62 +609,314 @@ bool EncodedDescriptorDatabase::FindNameOfFileContainingSymbol(
 }
 
 bool EncodedDescriptorDatabase::FindFileContainingExtension(
-    const string& containing_type,
-    int field_number,
+    const std::string& containing_type, int field_number,
     FileDescriptorProto* output) {
-  return MaybeParse(index_.FindExtension(containing_type, field_number),
+  return MaybeParse(index_->FindExtension(containing_type, field_number),
                     output);
 }
 
 bool EncodedDescriptorDatabase::FindAllExtensionNumbers(
-    const string& extendee_type,
-    std::vector<int>* output) {
-  return index_.FindAllExtensionNumbers(extendee_type, output);
+    const std::string& extendee_type, std::vector<int>* output) {
+  return index_->FindAllExtensionNumbers(extendee_type, output);
+}
+
+template <typename FileProto>
+bool EncodedDescriptorDatabase::DescriptorIndex::AddFile(const FileProto& file,
+                                                         Value value) {
+  // We push `value` into the array first. This is important because the AddXXX
+  // functions below will expect it to be there.
+  all_values_.push_back({value.first, value.second, {}});
+
+  if (!ValidateSymbolName(file.package())) {
+    GOOGLE_LOG(ERROR) << "Invalid package name: " << file.package();
+    return false;
+  }
+  all_values_.back().encoded_package = EncodeString(file.package());
+
+  if (!InsertIfNotPresent(
+          &by_name_, FileEntry{static_cast<int>(all_values_.size() - 1),
+                               EncodeString(file.name())}) ||
+      std::binary_search(by_name_flat_.begin(), by_name_flat_.end(),
+                         file.name(), by_name_.key_comp())) {
+    GOOGLE_LOG(ERROR) << "File already exists in database: " << file.name();
+    return false;
+  }
+
+  for (const auto& message_type : file.message_type()) {
+    if (!AddSymbol(message_type.name())) return false;
+    if (!AddNestedExtensions(file.name(), message_type)) return false;
+  }
+  for (const auto& enum_type : file.enum_type()) {
+    if (!AddSymbol(enum_type.name())) return false;
+  }
+  for (const auto& extension : file.extension()) {
+    if (!AddSymbol(extension.name())) return false;
+    if (!AddExtension(file.name(), extension)) return false;
+  }
+  for (const auto& service : file.service()) {
+    if (!AddSymbol(service.name())) return false;
+  }
+
+  return true;
+}
+
+template <typename Iter, typename Iter2, typename Index>
+static bool CheckForMutualSubsymbols(StringPiece symbol_name, Iter* iter,
+                                     Iter2 end, const Index& index) {
+  if (*iter != end) {
+    if (IsSubSymbol((*iter)->AsString(index), symbol_name)) {
+      GOOGLE_LOG(ERROR) << "Symbol name \"" << symbol_name
+                 << "\" conflicts with the existing symbol \""
+                 << (*iter)->AsString(index) << "\".";
+      return false;
+    }
+
+    // OK, that worked.  Now we have to make sure that no symbol in the map is
+    // a sub-symbol of the one we are inserting.  The only symbol which could
+    // be so is the first symbol that is greater than the new symbol.  Since
+    // |iter| points at the last symbol that is less than or equal, we just have
+    // to increment it.
+    ++*iter;
+
+    if (*iter != end && IsSubSymbol(symbol_name, (*iter)->AsString(index))) {
+      GOOGLE_LOG(ERROR) << "Symbol name \"" << symbol_name
+                 << "\" conflicts with the existing symbol \""
+                 << (*iter)->AsString(index) << "\".";
+      return false;
+    }
+  }
+  return true;
+}
+
+bool EncodedDescriptorDatabase::DescriptorIndex::AddSymbol(
+    StringPiece symbol) {
+  SymbolEntry entry = {static_cast<int>(all_values_.size() - 1),
+                       EncodeString(symbol)};
+  std::string entry_as_string = entry.AsString(*this);
+
+  // We need to make sure not to violate our map invariant.
+
+  // If the symbol name is invalid it could break our lookup algorithm (which
+  // relies on the fact that '.' sorts before all other characters that are
+  // valid in symbol names).
+  if (!ValidateSymbolName(symbol)) {
+    GOOGLE_LOG(ERROR) << "Invalid symbol name: " << entry_as_string;
+    return false;
+  }
+
+  auto iter = FindLastLessOrEqual(&by_symbol_, entry);
+  if (!CheckForMutualSubsymbols(entry_as_string, &iter, by_symbol_.end(),
+                                *this)) {
+    return false;
+  }
+
+  // Same, but on by_symbol_flat_
+  auto flat_iter =
+      FindLastLessOrEqual(&by_symbol_flat_, entry, by_symbol_.key_comp());
+  if (!CheckForMutualSubsymbols(entry_as_string, &flat_iter,
+                                by_symbol_flat_.end(), *this)) {
+    return false;
+  }
+
+  // OK, no conflicts.
+
+  // Insert the new symbol using the iterator as a hint, the new entry will
+  // appear immediately before the one the iterator is pointing at.
+  by_symbol_.insert(iter, entry);
+
+  return true;
+}
+
+template <typename DescProto>
+bool EncodedDescriptorDatabase::DescriptorIndex::AddNestedExtensions(
+    StringPiece filename, const DescProto& message_type) {
+  for (const auto& nested_type : message_type.nested_type()) {
+    if (!AddNestedExtensions(filename, nested_type)) return false;
+  }
+  for (const auto& extension : message_type.extension()) {
+    if (!AddExtension(filename, extension)) return false;
+  }
+  return true;
+}
+
+template <typename FieldProto>
+bool EncodedDescriptorDatabase::DescriptorIndex::AddExtension(
+    StringPiece filename, const FieldProto& field) {
+  if (!field.extendee().empty() && field.extendee()[0] == '.') {
+    // The extension is fully-qualified.  We can use it as a lookup key in
+    // the by_symbol_ table.
+    if (!InsertIfNotPresent(
+            &by_extension_,
+            ExtensionEntry{static_cast<int>(all_values_.size() - 1),
+                           EncodeString(field.extendee()), field.number()}) ||
+        std::binary_search(
+            by_extension_flat_.begin(), by_extension_flat_.end(),
+            std::make_pair(field.extendee().substr(1), field.number()),
+            by_extension_.key_comp())) {
+      GOOGLE_LOG(ERROR) << "Extension conflicts with extension already in database: "
+                    "extend "
+                 << field.extendee() << " { " << field.name() << " = "
+                 << field.number() << " } from:" << filename;
+      return false;
+    }
+  } else {
+    // Not fully-qualified.  We can't really do anything here, unfortunately.
+    // We don't consider this an error, though, because the descriptor is
+    // valid.
+  }
+  return true;
+}
+
+std::pair<const void*, int>
+EncodedDescriptorDatabase::DescriptorIndex::FindSymbol(StringPiece name) {
+  EnsureFlat();
+  return FindSymbolOnlyFlat(name);
+}
+
+std::pair<const void*, int>
+EncodedDescriptorDatabase::DescriptorIndex::FindSymbolOnlyFlat(
+    StringPiece name) const {
+  auto iter =
+      FindLastLessOrEqual(&by_symbol_flat_, name, by_symbol_.key_comp());
+
+  return iter != by_symbol_flat_.end() &&
+                 IsSubSymbol(iter->AsString(*this), name)
+             ? all_values_[iter->data_offset].value()
+             : Value();
+}
+
+std::pair<const void*, int>
+EncodedDescriptorDatabase::DescriptorIndex::FindExtension(
+    StringPiece containing_type, int field_number) {
+  EnsureFlat();
+
+  auto it = std::lower_bound(
+      by_extension_flat_.begin(), by_extension_flat_.end(),
+      std::make_tuple(containing_type, field_number), by_extension_.key_comp());
+  return it == by_extension_flat_.end() ||
+                 it->extendee(*this) != containing_type ||
+                 it->extension_number != field_number
+             ? std::make_pair(nullptr, 0)
+             : all_values_[it->data_offset].value();
+}
+
+template <typename T, typename Less>
+static void MergeIntoFlat(std::set<T, Less>* s, std::vector<T>* flat) {
+  if (s->empty()) return;
+  std::vector<T> new_flat(s->size() + flat->size());
+  std::merge(s->begin(), s->end(), flat->begin(), flat->end(), &new_flat[0],
+             s->key_comp());
+  *flat = std::move(new_flat);
+  s->clear();
+}
+
+void EncodedDescriptorDatabase::DescriptorIndex::EnsureFlat() {
+  all_values_.shrink_to_fit();
+  // Merge each of the sets into their flat counterpart.
+  MergeIntoFlat(&by_name_, &by_name_flat_);
+  MergeIntoFlat(&by_symbol_, &by_symbol_flat_);
+  MergeIntoFlat(&by_extension_, &by_extension_flat_);
+}
+
+bool EncodedDescriptorDatabase::DescriptorIndex::FindAllExtensionNumbers(
+    StringPiece containing_type, std::vector<int>* output) {
+  EnsureFlat();
+
+  bool success = false;
+  auto it = std::lower_bound(
+      by_extension_flat_.begin(), by_extension_flat_.end(),
+      std::make_tuple(containing_type, 0), by_extension_.key_comp());
+  for (;
+       it != by_extension_flat_.end() && it->extendee(*this) == containing_type;
+       ++it) {
+    output->push_back(it->extension_number);
+    success = true;
+  }
+
+  return success;
+}
+
+void EncodedDescriptorDatabase::DescriptorIndex::FindAllFileNames(
+    std::vector<std::string>* output) const {
+  output->resize(by_name_.size() + by_name_flat_.size());
+  int i = 0;
+  for (const auto& entry : by_name_) {
+    (*output)[i] = std::string(entry.name(*this));
+    i++;
+  }
+  for (const auto& entry : by_name_flat_) {
+    (*output)[i] = std::string(entry.name(*this));
+    i++;
+  }
+}
+
+std::pair<const void*, int>
+EncodedDescriptorDatabase::DescriptorIndex::FindFile(
+    StringPiece filename) {
+  EnsureFlat();
+
+  auto it = std::lower_bound(by_name_flat_.begin(), by_name_flat_.end(),
+                             filename, by_name_.key_comp());
+  return it == by_name_flat_.end() || it->name(*this) != filename
+             ? std::make_pair(nullptr, 0)
+             : all_values_[it->data_offset].value();
+}
+
+
+bool EncodedDescriptorDatabase::FindAllFileNames(
+    std::vector<std::string>* output) {
+  index_->FindAllFileNames(output);
+  return true;
 }
 
 bool EncodedDescriptorDatabase::MaybeParse(
-    std::pair<const void*, int> encoded_file,
-    FileDescriptorProto* output) {
-  if (encoded_file.first == NULL) return false;
+    std::pair<const void*, int> encoded_file, FileDescriptorProto* output) {
+  if (encoded_file.first == nullptr) return false;
   return output->ParseFromArray(encoded_file.first, encoded_file.second);
 }
 
+EncodedDescriptorDatabase::EncodedDescriptorDatabase()
+    : index_(new DescriptorIndex()) {}
+
+EncodedDescriptorDatabase::~EncodedDescriptorDatabase() {
+  for (void* p : files_to_delete_) {
+    operator delete(p);
+  }
+}
+
 // ===================================================================
 
 DescriptorPoolDatabase::DescriptorPoolDatabase(const DescriptorPool& pool)
-  : pool_(pool) {}
+    : pool_(pool) {}
 DescriptorPoolDatabase::~DescriptorPoolDatabase() {}
 
-bool DescriptorPoolDatabase::FindFileByName(
-    const string& filename,
-    FileDescriptorProto* output) {
+bool DescriptorPoolDatabase::FindFileByName(const std::string& filename,
+                                            FileDescriptorProto* output) {
   const FileDescriptor* file = pool_.FindFileByName(filename);
-  if (file == NULL) return false;
+  if (file == nullptr) return false;
   output->Clear();
   file->CopyTo(output);
   return true;
 }
 
 bool DescriptorPoolDatabase::FindFileContainingSymbol(
-    const string& symbol_name,
-    FileDescriptorProto* output) {
+    const std::string& symbol_name, FileDescriptorProto* output) {
   const FileDescriptor* file = pool_.FindFileContainingSymbol(symbol_name);
-  if (file == NULL) return false;
+  if (file == nullptr) return false;
   output->Clear();
   file->CopyTo(output);
   return true;
 }
 
 bool DescriptorPoolDatabase::FindFileContainingExtension(
-    const string& containing_type,
-    int field_number,
+    const std::string& containing_type, int field_number,
     FileDescriptorProto* output) {
   const Descriptor* extendee = pool_.FindMessageTypeByName(containing_type);
-  if (extendee == NULL) return false;
+  if (extendee == nullptr) return false;
 
   const FieldDescriptor* extension =
-    pool_.FindExtensionByNumber(extendee, field_number);
-  if (extension == NULL) return false;
+      pool_.FindExtensionByNumber(extendee, field_number);
+  if (extension == nullptr) return false;
 
   output->Clear();
   extension->file()->CopyTo(output);
@@ -434,16 +924,15 @@ bool DescriptorPoolDatabase::FindFileContainingExtension(
 }
 
 bool DescriptorPoolDatabase::FindAllExtensionNumbers(
-    const string& extendee_type,
-    std::vector<int>* output) {
+    const std::string& extendee_type, std::vector<int>* output) {
   const Descriptor* extendee = pool_.FindMessageTypeByName(extendee_type);
-  if (extendee == NULL) return false;
+  if (extendee == nullptr) return false;
 
   std::vector<const FieldDescriptor*> extensions;
   pool_.FindAllExtensions(extendee, &extensions);
 
-  for (int i = 0; i < extensions.size(); ++i) {
-    output->push_back(extensions[i]->number());
+  for (const FieldDescriptor* extension : extensions) {
+    output->push_back(extension->number());
   }
 
   return true;
@@ -452,21 +941,19 @@ bool DescriptorPoolDatabase::FindAllExtensionNumbers(
 // ===================================================================
 
 MergedDescriptorDatabase::MergedDescriptorDatabase(
-    DescriptorDatabase* source1,
-    DescriptorDatabase* source2) {
+    DescriptorDatabase* source1, DescriptorDatabase* source2) {
   sources_.push_back(source1);
   sources_.push_back(source2);
 }
 MergedDescriptorDatabase::MergedDescriptorDatabase(
     const std::vector<DescriptorDatabase*>& sources)
-  : sources_(sources) {}
+    : sources_(sources) {}
 MergedDescriptorDatabase::~MergedDescriptorDatabase() {}
 
-bool MergedDescriptorDatabase::FindFileByName(
-    const string& filename,
-    FileDescriptorProto* output) {
-  for (int i = 0; i < sources_.size(); i++) {
-    if (sources_[i]->FindFileByName(filename, output)) {
+bool MergedDescriptorDatabase::FindFileByName(const std::string& filename,
+                                              FileDescriptorProto* output) {
+  for (DescriptorDatabase* source : sources_) {
+    if (source->FindFileByName(filename, output)) {
       return true;
     }
   }
@@ -474,16 +961,15 @@ bool MergedDescriptorDatabase::FindFileByName(
 }
 
 bool MergedDescriptorDatabase::FindFileContainingSymbol(
-    const string& symbol_name,
-    FileDescriptorProto* output) {
-  for (int i = 0; i < sources_.size(); i++) {
+    const std::string& symbol_name, FileDescriptorProto* output) {
+  for (size_t i = 0; i < sources_.size(); i++) {
     if (sources_[i]->FindFileContainingSymbol(symbol_name, output)) {
       // The symbol was found in source i.  However, if one of the previous
       // sources defines a file with the same name (which presumably doesn't
       // contain the symbol, since it wasn't found in that source), then we
       // must hide it from the caller.
       FileDescriptorProto temp;
-      for (int j = 0; j < i; j++) {
+      for (size_t j = 0; j < i; j++) {
         if (sources_[j]->FindFileByName(output->name(), &temp)) {
           // Found conflicting file in a previous source.
           return false;
@@ -496,18 +982,17 @@ bool MergedDescriptorDatabase::FindFileContainingSymbol(
 }
 
 bool MergedDescriptorDatabase::FindFileContainingExtension(
-    const string& containing_type,
-    int field_number,
+    const std::string& containing_type, int field_number,
     FileDescriptorProto* output) {
-  for (int i = 0; i < sources_.size(); i++) {
-    if (sources_[i]->FindFileContainingExtension(
-          containing_type, field_number, output)) {
+  for (size_t i = 0; i < sources_.size(); i++) {
+    if (sources_[i]->FindFileContainingExtension(containing_type, field_number,
+                                                 output)) {
       // The symbol was found in source i.  However, if one of the previous
       // sources defines a file with the same name (which presumably doesn't
       // contain the symbol, since it wasn't found in that source), then we
       // must hide it from the caller.
       FileDescriptorProto temp;
-      for (int j = 0; j < i; j++) {
+      for (size_t j = 0; j < i; j++) {
         if (sources_[j]->FindFileByName(output->name(), &temp)) {
           // Found conflicting file in a previous source.
           return false;
@@ -520,14 +1005,13 @@ bool MergedDescriptorDatabase::FindFileContainingExtension(
 }
 
 bool MergedDescriptorDatabase::FindAllExtensionNumbers(
-    const string& extendee_type,
-    std::vector<int>* output) {
+    const std::string& extendee_type, std::vector<int>* output) {
   std::set<int> merged_results;
   std::vector<int> results;
   bool success = false;
 
-  for (int i = 0; i < sources_.size(); i++) {
-    if (sources_[i]->FindAllExtensionNumbers(extendee_type, &results)) {
+  for (DescriptorDatabase* source : sources_) {
+    if (source->FindAllExtensionNumbers(extendee_type, &results)) {
       std::copy(results.begin(), results.end(),
                 std::insert_iterator<std::set<int> >(merged_results,
                                                      merged_results.begin()));
index 28f8af7..f2d144d 100644 (file)
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/descriptor.h>
 
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
 namespace google {
 namespace protobuf {
 
@@ -62,27 +68,27 @@ class MergedDescriptorDatabase;
 // calling DescriptorPool::BuildFile() for each one.  Instead, a DescriptorPool
 // can be created which wraps a DescriptorDatabase and only builds particular
 // descriptors when they are needed.
-class LIBPROTOBUF_EXPORT DescriptorDatabase {
+class PROTOBUF_EXPORT DescriptorDatabase {
  public:
   inline DescriptorDatabase() {}
   virtual ~DescriptorDatabase();
 
   // Find a file by file name.  Fills in in *output and returns true if found.
   // Otherwise, returns false, leaving the contents of *output undefined.
-  virtual bool FindFileByName(const string& filename,
+  virtual bool FindFileByName(const std::string& filename,
                               FileDescriptorProto* output) = 0;
 
   // Find the file that declares the given fully-qualified symbol name.
   // If found, fills in *output and returns true, otherwise returns false
   // and leaves *output undefined.
-  virtual bool FindFileContainingSymbol(const string& symbol_name,
+  virtual bool FindFileContainingSymbol(const std::string& symbol_name,
                                         FileDescriptorProto* output) = 0;
 
   // Find the file which defines an extension extending the given message type
   // with the given field number.  If found, fills in *output and returns true,
   // otherwise returns false and leaves *output undefined.  containing_type
   // must be a fully-qualified type name.
-  virtual bool FindFileContainingExtension(const string& containing_type,
+  virtual bool FindFileContainingExtension(const std::string& containing_type,
                                            int field_number,
                                            FileDescriptorProto* output) = 0;
 
@@ -96,7 +102,7 @@ class LIBPROTOBUF_EXPORT DescriptorDatabase {
   //
   // This method has a default implementation that always returns
   // false.
-  virtual bool FindAllExtensionNumbers(const string& /* extendee_type */,
+  virtual bool FindAllExtensionNumbers(const std::string& /* extendee_type */,
                                        std::vector<int>* /* output */) {
     return false;
   }
@@ -110,10 +116,24 @@ class LIBPROTOBUF_EXPORT DescriptorDatabase {
   //
   // This method has a default implementation that always returns
   // false.
-  virtual bool FindAllFileNames(std::vector<string>* output) {
+  virtual bool FindAllFileNames(std::vector<std::string>* /*output*/) {
     return false;
   }
 
+  // Finds the package names and appends them to the output in an
+  // undefined order. This method is best-effort: it's not guaranteed that the
+  // database will find all packages. Returns true if the database supports
+  // searching all package names, otherwise returns false and leaves output
+  // unchanged.
+  bool FindAllPackageNames(std::vector<std::string>* output);
+
+  // Finds the message names and appends them to the output in an
+  // undefined order. This method is best-effort: it's not guaranteed that the
+  // database will find all messages. Returns true if the database supports
+  // searching all message names, otherwise returns false and leaves output
+  // unchanged.
+  bool FindAllMessageNames(std::vector<std::string>* output);
+
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DescriptorDatabase);
 };
@@ -139,10 +159,10 @@ class LIBPROTOBUF_EXPORT DescriptorDatabase {
 // FileDescriptor::CopyTo()) will always use fully-qualified names for all
 // types.  You only need to worry if you are constructing FileDescriptorProtos
 // yourself, or are calling compiler::Parser directly.
-class LIBPROTOBUF_EXPORT SimpleDescriptorDatabase : public DescriptorDatabase {
+class PROTOBUF_EXPORT SimpleDescriptorDatabase : public DescriptorDatabase {
  public:
   SimpleDescriptorDatabase();
-  ~SimpleDescriptorDatabase();
+  ~SimpleDescriptorDatabase() override;
 
   // Adds the FileDescriptorProto to the database, making a copy.  The object
   // can be deleted after Add() returns.  Returns false if the file conflicted
@@ -154,20 +174,19 @@ class LIBPROTOBUF_EXPORT SimpleDescriptorDatabase : public DescriptorDatabase {
   bool AddAndOwn(const FileDescriptorProto* file);
 
   // implements DescriptorDatabase -----------------------------------
-  bool FindFileByName(const string& filename,
-                      FileDescriptorProto* output);
-  bool FindFileContainingSymbol(const string& symbol_name,
-                                FileDescriptorProto* output);
-  bool FindFileContainingExtension(const string& containing_type,
+  bool FindFileByName(const std::string& filename,
+                      FileDescriptorProto* output) override;
+  bool FindFileContainingSymbol(const std::string& symbol_name,
+                                FileDescriptorProto* output) override;
+  bool FindFileContainingExtension(const std::string& containing_type,
                                    int field_number,
-                                   FileDescriptorProto* output);
-  bool FindAllExtensionNumbers(const string& extendee_type,
-                               std::vector<int>* output);
+                                   FileDescriptorProto* output) override;
+  bool FindAllExtensionNumbers(const std::string& extendee_type,
+                               std::vector<int>* output) override;
 
- private:
-  // So that it can use DescriptorIndex.
-  friend class EncodedDescriptorDatabase;
+  bool FindAllFileNames(std::vector<std::string>* output) override;
 
+ private:
   // An index mapping file names, symbol names, and extension numbers to
   // some sort of values.
   template <typename Value>
@@ -175,24 +194,24 @@ class LIBPROTOBUF_EXPORT SimpleDescriptorDatabase : public DescriptorDatabase {
    public:
     // Helpers to recursively add particular descriptors and all their contents
     // to the index.
-    bool AddFile(const FileDescriptorProto& file,
-                 Value value);
-    bool AddSymbol(const string& name, Value value);
-    bool AddNestedExtensions(const DescriptorProto& message_type,
-                             Value value);
-    bool AddExtension(const FieldDescriptorProto& field,
-                      Value value);
-
-    Value FindFile(const string& filename);
-    Value FindSymbol(const string& name);
-    Value FindExtension(const string& containing_type, int field_number);
-    bool FindAllExtensionNumbers(const string& containing_type,
+    bool AddFile(const FileDescriptorProto& file, Value value);
+    bool AddSymbol(const std::string& name, Value value);
+    bool AddNestedExtensions(const std::string& filename,
+                             const DescriptorProto& message_type, Value value);
+    bool AddExtension(const std::string& filename,
+                      const FieldDescriptorProto& field, Value value);
+
+    Value FindFile(const std::string& filename);
+    Value FindSymbol(const std::string& name);
+    Value FindExtension(const std::string& containing_type, int field_number);
+    bool FindAllExtensionNumbers(const std::string& containing_type,
                                  std::vector<int>* output);
+    void FindAllFileNames(std::vector<std::string>* output);
 
    private:
-    std::map<string, Value> by_name_;
-    std::map<string, Value> by_symbol_;
-    std::map<std::pair<string, int>, Value> by_extension_;
+    std::map<std::string, Value> by_name_;
+    std::map<std::string, Value> by_symbol_;
+    std::map<std::pair<std::string, int>, Value> by_extension_;
 
     // Invariant:  The by_symbol_ map does not contain any symbols which are
     // prefixes of other symbols in the map.  For example, "foo.bar" is a
@@ -214,7 +233,7 @@ class LIBPROTOBUF_EXPORT SimpleDescriptorDatabase : public DescriptorDatabase {
     // will find it.  Proof:
     // 1) Define the "search key" to be the key we are looking for, the "found
     //    key" to be the key found in step (1), and the "match key" to be the
-    //    key which actually matches the serach key (i.e. the key we're trying
+    //    key which actually matches the search key (i.e. the key we're trying
     //    to find).
     // 2) The found key must be less than or equal to the search key by
     //    definition.
@@ -244,30 +263,14 @@ class LIBPROTOBUF_EXPORT SimpleDescriptorDatabase : public DescriptorDatabase {
     // That symbol cannot be a super-symbol of the search key since if it were,
     // then it would be a match, and we're assuming the match key doesn't exist.
     // Therefore, step 2 will correctly return no match.
-
-    // Find the last entry in the by_symbol_ map whose key is less than or
-    // equal to the given name.
-    typename std::map<string, Value>::iterator FindLastLessOrEqual(
-        const string& name);
-
-    // True if either the arguments are equal or super_symbol identifies a
-    // parent symbol of sub_symbol (e.g. "foo.bar" is a parent of
-    // "foo.bar.baz", but not a parent of "foo.barbaz").
-    bool IsSubSymbol(const string& sub_symbol, const string& super_symbol);
-
-    // Returns true if and only if all characters in the name are alphanumerics,
-    // underscores, or periods.
-    bool ValidateSymbolName(const string& name);
   };
 
-
   DescriptorIndex<const FileDescriptorProto*> index_;
-  std::vector<const FileDescriptorProto*> files_to_delete_;
+  std::vector<std::unique_ptr<const FileDescriptorProto>> files_to_delete_;
 
-  // If file is non-NULL, copy it into *output and return true, otherwise
+  // If file is non-nullptr, copy it into *output and return true, otherwise
   // return false.
-  bool MaybeCopy(const FileDescriptorProto* file,
-                 FileDescriptorProto* output);
+  bool MaybeCopy(const FileDescriptorProto* file, FileDescriptorProto* output);
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SimpleDescriptorDatabase);
 };
@@ -277,10 +280,10 @@ class LIBPROTOBUF_EXPORT SimpleDescriptorDatabase : public DescriptorDatabase {
 //
 // The same caveats regarding FindFileContainingExtension() apply as with
 // SimpleDescriptorDatabase.
-class LIBPROTOBUF_EXPORT EncodedDescriptorDatabase : public DescriptorDatabase {
+class PROTOBUF_EXPORT EncodedDescriptorDatabase : public DescriptorDatabase {
  public:
   EncodedDescriptorDatabase();
-  ~EncodedDescriptorDatabase();
+  ~EncodedDescriptorDatabase() override;
 
   // Adds the FileDescriptorProto to the database.  The descriptor is provided
   // in encoded form.  The database does not make a copy of the bytes, nor
@@ -295,27 +298,30 @@ class LIBPROTOBUF_EXPORT EncodedDescriptorDatabase : public DescriptorDatabase {
   bool AddCopy(const void* encoded_file_descriptor, int size);
 
   // Like FindFileContainingSymbol but returns only the name of the file.
-  bool FindNameOfFileContainingSymbol(const string& symbol_name,
-                                      string* output);
+  bool FindNameOfFileContainingSymbol(const std::string& symbol_name,
+                                      std::string* output);
 
   // implements DescriptorDatabase -----------------------------------
-  bool FindFileByName(const string& filename,
-                      FileDescriptorProto* output);
-  bool FindFileContainingSymbol(const string& symbol_name,
-                                FileDescriptorProto* output);
-  bool FindFileContainingExtension(const string& containing_type,
+  bool FindFileByName(const std::string& filename,
+                      FileDescriptorProto* output) override;
+  bool FindFileContainingSymbol(const std::string& symbol_name,
+                                FileDescriptorProto* output) override;
+  bool FindFileContainingExtension(const std::string& containing_type,
                                    int field_number,
-                                   FileDescriptorProto* output);
-  bool FindAllExtensionNumbers(const string& extendee_type,
-                               std::vector<int>* output);
+                                   FileDescriptorProto* output) override;
+  bool FindAllExtensionNumbers(const std::string& extendee_type,
+                               std::vector<int>* output) override;
+  bool FindAllFileNames(std::vector<std::string>* output) override;
 
  private:
-  SimpleDescriptorDatabase::DescriptorIndex<std::pair<const void*, int> >
-      index_;
+  class DescriptorIndex;
+  // Keep DescriptorIndex by pointer to hide the implementation to keep a
+  // cleaner header.
+  std::unique_ptr<DescriptorIndex> index_;
   std::vector<void*> files_to_delete_;
 
-  // If encoded_file.first is non-NULL, parse the data into *output and return
-  // true, otherwise return false.
+  // If encoded_file.first is non-nullptr, parse the data into *output and
+  // return true, otherwise return false.
   bool MaybeParse(std::pair<const void*, int> encoded_file,
                   FileDescriptorProto* output);
 
@@ -323,21 +329,21 @@ class LIBPROTOBUF_EXPORT EncodedDescriptorDatabase : public DescriptorDatabase {
 };
 
 // A DescriptorDatabase that fetches files from a given pool.
-class LIBPROTOBUF_EXPORT DescriptorPoolDatabase : public DescriptorDatabase {
+class PROTOBUF_EXPORT DescriptorPoolDatabase : public DescriptorDatabase {
  public:
   explicit DescriptorPoolDatabase(const DescriptorPool& pool);
-  ~DescriptorPoolDatabase();
+  ~DescriptorPoolDatabase() override;
 
   // implements DescriptorDatabase -----------------------------------
-  bool FindFileByName(const string& filename,
-                      FileDescriptorProto* output);
-  bool FindFileContainingSymbol(const string& symbol_name,
-                                FileDescriptorProto* output);
-  bool FindFileContainingExtension(const string& containing_type,
+  bool FindFileByName(const std::string& filename,
+                      FileDescriptorProto* output) override;
+  bool FindFileContainingSymbol(const std::string& symbol_name,
+                                FileDescriptorProto* output) override;
+  bool FindFileContainingExtension(const std::string& containing_type,
                                    int field_number,
-                                   FileDescriptorProto* output);
-  bool FindAllExtensionNumbers(const string& extendee_type,
-                               std::vector<int>* output);
+                                   FileDescriptorProto* output) override;
+  bool FindAllExtensionNumbers(const std::string& extendee_type,
+                               std::vector<int>* output) override;
 
  private:
   const DescriptorPool& pool_;
@@ -346,7 +352,7 @@ class LIBPROTOBUF_EXPORT DescriptorPoolDatabase : public DescriptorDatabase {
 
 // A DescriptorDatabase that wraps two or more others.  It first searches the
 // first database and, if that fails, tries the second, and so on.
-class LIBPROTOBUF_EXPORT MergedDescriptorDatabase : public DescriptorDatabase {
+class PROTOBUF_EXPORT MergedDescriptorDatabase : public DescriptorDatabase {
  public:
   // Merge just two databases.  The sources remain property of the caller.
   MergedDescriptorDatabase(DescriptorDatabase* source1,
@@ -356,20 +362,20 @@ class LIBPROTOBUF_EXPORT MergedDescriptorDatabase : public DescriptorDatabase {
   // DescriptorDatabases need to stick around.
   explicit MergedDescriptorDatabase(
       const std::vector<DescriptorDatabase*>& sources);
-  ~MergedDescriptorDatabase();
+  ~MergedDescriptorDatabase() override;
 
   // implements DescriptorDatabase -----------------------------------
-  bool FindFileByName(const string& filename,
-                      FileDescriptorProto* output);
-  bool FindFileContainingSymbol(const string& symbol_name,
-                                FileDescriptorProto* output);
-  bool FindFileContainingExtension(const string& containing_type,
+  bool FindFileByName(const std::string& filename,
+                      FileDescriptorProto* output) override;
+  bool FindFileContainingSymbol(const std::string& symbol_name,
+                                FileDescriptorProto* output) override;
+  bool FindFileContainingExtension(const std::string& containing_type,
                                    int field_number,
-                                   FileDescriptorProto* output);
+                                   FileDescriptorProto* output) override;
   // Merges the results of calling all databases. Returns true iff any
   // of the databases returned true.
-  bool FindAllExtensionNumbers(const string& extendee_type,
-                               std::vector<int>* output);
+  bool FindAllExtensionNumbers(const std::string& extendee_type,
+                               std::vector<int>* output) override;
 
 
  private:
@@ -378,6 +384,8 @@ class LIBPROTOBUF_EXPORT MergedDescriptorDatabase : public DescriptorDatabase {
 };
 
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_DESCRIPTOR_DATABASE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/duration.pb.cc b/3rdparty/protobuf/src/google/protobuf/duration.pb.cc
deleted file mode 100644 (file)
index 0a8aad4..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/duration.proto
-
-#include <google/protobuf/duration.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class DurationDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_Duration_default_instance_;
-    new (ptr) ::google::protobuf::Duration();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::google::protobuf::Duration::InitAsDefaultInstance();
-}
-
-void InitDefaultsDuration() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDurationImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[1];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::Duration, seconds_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Duration, nanos_),
-};
-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*>(&::google::protobuf::_Duration_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/duration.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "rationProtoP\001Z*github.com/golang/protobu"
-      "f/ptypes/duration\370\001\001\242\002\003GPB\252\002\036Google.Prot"
-      "obuf.WellKnownTypesb\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 227);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/duration.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_2fduration_2eproto
-namespace google {
-namespace protobuf {
-
-// ===================================================================
-
-void Duration::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Duration::kSecondsFieldNumber;
-const int Duration::kNanosFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Duration::Duration()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaultsDuration();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Duration)
-}
-Duration::Duration(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaultsDuration();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration)
-}
-Duration::Duration(const Duration& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::memcpy(&seconds_, &from.seconds_,
-    static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
-    reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration)
-}
-
-void Duration::SharedCtor() {
-  ::memset(&seconds_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&nanos_) -
-      reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
-  _cached_size_ = 0;
-}
-
-Duration::~Duration() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Duration)
-  SharedDtor();
-}
-
-void Duration::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void Duration::ArenaDtor(void* object) {
-  Duration* _this = reinterpret_cast< Duration* >(object);
-  (void)_this;
-}
-void Duration::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Duration::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Duration& Duration::default_instance() {
-  ::protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaultsDuration();
-  return *internal_default_instance();
-}
-
-Duration* Duration::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Duration>(arena);
-}
-
-void Duration::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Duration)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  ::memset(&seconds_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&nanos_) -
-      reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
-  _internal_metadata_.Clear();
-}
-
-bool Duration::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.Duration)
-  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)) {
-      // int64 seconds = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &seconds_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // int32 nanos = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &nanos_)));
-        } 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.Duration)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Duration)
-  return false;
-#undef DO_
-}
-
-void Duration::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Duration)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int64 seconds = 1;
-  if (this->seconds() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(), output);
-  }
-
-  // int32 nanos = 2;
-  if (this->nanos() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Duration)
-}
-
-::google::protobuf::uint8* Duration::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int64 seconds = 1;
-  if (this->seconds() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->seconds(), target);
-  }
-
-  // int32 nanos = 2;
-  if (this->nanos() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration)
-  return target;
-}
-
-size_t Duration::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // int64 seconds = 1;
-  if (this->seconds() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->seconds());
-  }
-
-  // int32 nanos = 2;
-  if (this->nanos() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->nanos());
-  }
-
-  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 Duration::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Duration)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Duration* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Duration>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Duration)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Duration)
-    MergeFrom(*source);
-  }
-}
-
-void Duration::MergeFrom(const Duration& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Duration)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.seconds() != 0) {
-    set_seconds(from.seconds());
-  }
-  if (from.nanos() != 0) {
-    set_nanos(from.nanos());
-  }
-}
-
-void Duration::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Duration)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Duration::CopyFrom(const Duration& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Duration)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Duration::IsInitialized() const {
-  return true;
-}
-
-void Duration::Swap(Duration* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Duration* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Duration::UnsafeArenaSwap(Duration* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Duration::InternalSwap(Duration* other) {
-  using std::swap;
-  swap(seconds_, other->seconds_);
-  swap(nanos_, other->nanos_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Duration::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fduration_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/duration.pb.h b/3rdparty/protobuf/src/google/protobuf/duration.pb.h
deleted file mode 100644 (file)
index e13328a..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/duration.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2fduration_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fduration_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/unknown_field_set.h>
-// @@protoc_insertion_point(includes)
-
-namespace protobuf_google_2fprotobuf_2fduration_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[1];
-  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 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 {
-
-// ===================================================================
-
-class LIBPROTOBUF_EXPORT Duration : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Duration) */ {
- public:
-  Duration();
-  virtual ~Duration();
-
-  Duration(const Duration& from);
-
-  inline Duration& operator=(const Duration& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Duration(Duration&& from) noexcept
-    : Duration() {
-    *this = ::std::move(from);
-  }
-
-  inline Duration& operator=(Duration&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void UnsafeArenaSwap(Duration* other);
-  void Swap(Duration* other);
-  friend void swap(Duration& a, Duration& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Duration* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Duration* 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 Duration& from);
-  void MergeFrom(const Duration& 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(Duration* other);
-  protected:
-  explicit Duration(::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 -------------------------------------------------------
-
-  // int64 seconds = 1;
-  void clear_seconds();
-  static const int kSecondsFieldNumber = 1;
-  ::google::protobuf::int64 seconds() const;
-  void set_seconds(::google::protobuf::int64 value);
-
-  // int32 nanos = 2;
-  void clear_nanos();
-  static const int kNanosFieldNumber = 2;
-  ::google::protobuf::int32 nanos() const;
-  void set_nanos(::google::protobuf::int32 value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Duration)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::int64 seconds_;
-  ::google::protobuf::int32 nanos_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fduration_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaultsDurationImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// Duration
-
-// int64 seconds = 1;
-inline void Duration::clear_seconds() {
-  seconds_ = GOOGLE_LONGLONG(0);
-}
-inline ::google::protobuf::int64 Duration::seconds() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Duration.seconds)
-  return seconds_;
-}
-inline void Duration::set_seconds(::google::protobuf::int64 value) {
-  
-  seconds_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Duration.seconds)
-}
-
-// int32 nanos = 2;
-inline void Duration::clear_nanos() {
-  nanos_ = 0;
-}
-inline ::google::protobuf::int32 Duration::nanos() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Duration.nanos)
-  return nanos_;
-}
-inline void Duration::set_nanos(::google::protobuf::int32 value) {
-  
-  nanos_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Duration.nanos)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2fduration_2eproto__INCLUDED
index cdd4324..88c9844 100644 (file)
 //
 // DynamicMessage is implemented by constructing a data structure which
 // has roughly the same memory layout as a generated message would have.
-// Then, we use GeneratedMessageReflection to implement our reflection
-// interface.  All the other operations we need to implement (e.g.
-// parsing, copying, etc.) are already implemented in terms of
-// Reflection, so the rest is easy.
+// Then, we use Reflection to implement our reflection interface.  All
+// the other operations we need to implement (e.g.  parsing, copying,
+// etc.) are already implemented in terms of Reflection, so the rest is
+// easy.
 //
 // The up side of this strategy is that it's very efficient.  We don't
 // need to use hash_maps or generic representations of fields.  The
 //
 // Note on memory allocation:  This module often calls "operator new()"
 // to allocate untyped memory, rather than calling something like
-// "new uint8[]".  This is because "operator new()" means "Give me some
-// space which I can use as I please." while "new uint8[]" means "Give
+// "new uint8_t[]".  This is because "operator new()" means "Give me some
+// space which I can use as I please." while "new uint8_t[]" means "Give
 // me an array of 8-bit integers.".  In practice, the later may return
 // a pointer that is not aligned correctly for general use.  I believe
 // Item 8 of "More Effective C++" discusses this in more detail, though
 // I don't have the book on me right now so I'm not sure.
 
+#include <google/protobuf/dynamic_message.h>
+
 #include <algorithm>
-#include <google/protobuf/stubs/hash.h>
+#include <cstddef>
 #include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
-
-#include <google/protobuf/stubs/common.h>
+#include <new>
+#include <unordered_map>
 
-#include <google/protobuf/dynamic_message.h>
-#include <google/protobuf/descriptor.h>
 #include <google/protobuf/descriptor.pb.h>
-#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/unknown_field_set.h>
+#include <google/protobuf/stubs/hash.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/extension_set.h>
 #include <google/protobuf/map_field.h>
 #include <google/protobuf/repeated_field.h>
 #include <google/protobuf/wire_format.h>
 
+#include <google/protobuf/port_def.inc>  // NOLINT
 
 namespace google {
 namespace protobuf {
 
 using internal::DynamicMapField;
 using internal::ExtensionSet;
-using internal::GeneratedMessageReflection;
-using internal::InternalMetadataWithArena;
 using internal::MapField;
 
 
@@ -101,10 +100,38 @@ using internal::ArenaStringPtr;
 // ===================================================================
 // Some helper tables and functions...
 
+class DynamicMessageReflectionHelper {
+ public:
+  static bool IsLazyField(const Reflection* reflection,
+                          const FieldDescriptor* field) {
+    return reflection->IsLazyField(field);
+  }
+};
+
 namespace {
 
-bool IsMapFieldInApi(const FieldDescriptor* field) {
-  return field->is_map();
+bool IsMapFieldInApi(const FieldDescriptor* field) { return field->is_map(); }
+
+// Sync with helpers.h.
+inline bool HasHasbit(const FieldDescriptor* field) {
+  // This predicate includes proto3 message fields only if they have "optional".
+  //   Foo submsg1 = 1;           // HasHasbit() == false
+  //   optional Foo submsg2 = 2;  // HasHasbit() == true
+  // This is slightly odd, as adding "optional" to a singular proto3 field does
+  // not change the semantics or API. However whenever any field in a message
+  // has a hasbit, it forces reflection to include hasbit offsets for *all*
+  // fields, even if almost all of them are set to -1 (no hasbit). So to avoid
+  // causing a sudden size regression for ~all proto3 messages, we give proto3
+  // message fields a hasbit only if "optional" is present. If the user is
+  // explicitly writing "optional", it is likely they are writing it on
+  // primitive fields also.
+  return (field->has_optional_keyword() || field->is_required()) &&
+         !field->options().weak();
+}
+
+inline bool InRealOneof(const FieldDescriptor* field) {
+  return field->containing_oneof() &&
+         !field->containing_oneof()->is_synthetic();
 }
 
 // Compute the byte size of the in-memory representation of the field.
@@ -112,14 +139,22 @@ int FieldSpaceUsed(const FieldDescriptor* field) {
   typedef FieldDescriptor FD;  // avoid line wrapping
   if (field->label() == FD::LABEL_REPEATED) {
     switch (field->cpp_type()) {
-      case FD::CPPTYPE_INT32  : return sizeof(RepeatedField<int32   >);
-      case FD::CPPTYPE_INT64  : return sizeof(RepeatedField<int64   >);
-      case FD::CPPTYPE_UINT32 : return sizeof(RepeatedField<uint32  >);
-      case FD::CPPTYPE_UINT64 : return sizeof(RepeatedField<uint64  >);
-      case FD::CPPTYPE_DOUBLE : return sizeof(RepeatedField<double  >);
-      case FD::CPPTYPE_FLOAT  : return sizeof(RepeatedField<float   >);
-      case FD::CPPTYPE_BOOL   : return sizeof(RepeatedField<bool    >);
-      case FD::CPPTYPE_ENUM   : return sizeof(RepeatedField<int     >);
+      case FD::CPPTYPE_INT32:
+        return sizeof(RepeatedField<int32_t>);
+      case FD::CPPTYPE_INT64:
+        return sizeof(RepeatedField<int64_t>);
+      case FD::CPPTYPE_UINT32:
+        return sizeof(RepeatedField<uint32_t>);
+      case FD::CPPTYPE_UINT64:
+        return sizeof(RepeatedField<uint64_t>);
+      case FD::CPPTYPE_DOUBLE:
+        return sizeof(RepeatedField<double>);
+      case FD::CPPTYPE_FLOAT:
+        return sizeof(RepeatedField<float>);
+      case FD::CPPTYPE_BOOL:
+        return sizeof(RepeatedField<bool>);
+      case FD::CPPTYPE_ENUM:
+        return sizeof(RepeatedField<int>);
       case FD::CPPTYPE_MESSAGE:
         if (IsMapFieldInApi(field)) {
           return sizeof(DynamicMapField);
@@ -131,20 +166,28 @@ int FieldSpaceUsed(const FieldDescriptor* field) {
         switch (field->options().ctype()) {
           default:  // TODO(kenton):  Support other string reps.
           case FieldOptions::STRING:
-            return sizeof(RepeatedPtrField<string>);
+            return sizeof(RepeatedPtrField<std::string>);
         }
         break;
     }
   } else {
     switch (field->cpp_type()) {
-      case FD::CPPTYPE_INT32  : return sizeof(int32   );
-      case FD::CPPTYPE_INT64  : return sizeof(int64   );
-      case FD::CPPTYPE_UINT32 : return sizeof(uint32  );
-      case FD::CPPTYPE_UINT64 : return sizeof(uint64  );
-      case FD::CPPTYPE_DOUBLE : return sizeof(double  );
-      case FD::CPPTYPE_FLOAT  : return sizeof(float   );
-      case FD::CPPTYPE_BOOL   : return sizeof(bool    );
-      case FD::CPPTYPE_ENUM   : return sizeof(int     );
+      case FD::CPPTYPE_INT32:
+        return sizeof(int32_t);
+      case FD::CPPTYPE_INT64:
+        return sizeof(int64_t);
+      case FD::CPPTYPE_UINT32:
+        return sizeof(uint32_t);
+      case FD::CPPTYPE_UINT64:
+        return sizeof(uint64_t);
+      case FD::CPPTYPE_DOUBLE:
+        return sizeof(double);
+      case FD::CPPTYPE_FLOAT:
+        return sizeof(float);
+      case FD::CPPTYPE_BOOL:
+        return sizeof(bool);
+      case FD::CPPTYPE_ENUM:
+        return sizeof(int);
 
       case FD::CPPTYPE_MESSAGE:
         return sizeof(Message*);
@@ -163,42 +206,10 @@ int FieldSpaceUsed(const FieldDescriptor* field) {
   return 0;
 }
 
-// Compute the byte size of in-memory representation of the oneof fields
-// in default oneof instance.
-int OneofFieldSpaceUsed(const FieldDescriptor* field) {
-  typedef FieldDescriptor FD;  // avoid line wrapping
-  switch (field->cpp_type()) {
-    case FD::CPPTYPE_INT32  : return sizeof(int32   );
-    case FD::CPPTYPE_INT64  : return sizeof(int64   );
-    case FD::CPPTYPE_UINT32 : return sizeof(uint32  );
-    case FD::CPPTYPE_UINT64 : return sizeof(uint64  );
-    case FD::CPPTYPE_DOUBLE : return sizeof(double  );
-    case FD::CPPTYPE_FLOAT  : return sizeof(float   );
-    case FD::CPPTYPE_BOOL   : return sizeof(bool    );
-    case FD::CPPTYPE_ENUM   : return sizeof(int     );
-
-    case FD::CPPTYPE_MESSAGE:
-      return sizeof(Message*);
-
-    case FD::CPPTYPE_STRING:
-      switch (field->options().ctype()) {
-        default:
-        case FieldOptions::STRING:
-          return sizeof(ArenaStringPtr);
-      }
-      break;
-  }
-
-  GOOGLE_LOG(DFATAL) << "Can't get here.";
-  return 0;
-}
-
-inline int DivideRoundingUp(int i, int j) {
-  return (i + (j - 1)) / j;
-}
+inline int DivideRoundingUp(int i, int j) { return (i + (j - 1)) / j; }
 
-static const int kSafeAlignment = sizeof(uint64);
-static const int kMaxOneofUnionSize = sizeof(uint64);
+static const int kSafeAlignment = sizeof(uint64_t);
+static const int kMaxOneofUnionSize = sizeof(uint64_t);
 
 inline int AlignTo(int offset, int alignment) {
   return DivideRoundingUp(offset, alignment) * alignment;
@@ -206,9 +217,7 @@ inline int AlignTo(int offset, int alignment) {
 
 // Rounds the given byte offset up to the next offset aligned such that any
 // type may be stored at it.
-inline int AlignOffset(int offset) {
-  return AlignTo(offset, kSafeAlignment);
-}
+inline int AlignOffset(int offset) { return AlignTo(offset, kSafeAlignment); }
 
 #define bitsizeof(T) (sizeof(T) * 8)
 
@@ -218,112 +227,153 @@ inline int AlignOffset(int offset) {
 
 class DynamicMessage : public Message {
  public:
-  struct TypeInfo {
-    int size;
-    int has_bits_offset;
-    int oneof_case_offset;
-    int internal_metadata_offset;
-    int extensions_offset;
-
-    // Not owned by the TypeInfo.
-    DynamicMessageFactory* factory;  // The factory that created this object.
-    const DescriptorPool* pool;      // The factory's DescriptorPool.
-    const Descriptor* type;          // Type of this DynamicMessage.
-
-    // Warning:  The order in which the following pointers are defined is
-    //   important (the prototype must be deleted *before* the offsets).
-    google::protobuf::scoped_array<uint32> offsets;
-    google::protobuf::scoped_array<uint32> has_bits_indices;
-    google::protobuf::scoped_ptr<const GeneratedMessageReflection> reflection;
-    // Don't use a scoped_ptr to hold the prototype: the destructor for
-    // DynamicMessage needs to know whether it is the prototype, and does so by
-    // looking back at this field. This would assume details about the
-    // implementation of scoped_ptr.
-    const DynamicMessage* prototype;
-    int weak_field_map_offset;  // The offset for the weak_field_map;
-
-    TypeInfo() : prototype(NULL) {}
-
-    ~TypeInfo() {
-      delete prototype;
-    }
-  };
-
-  DynamicMessage(const TypeInfo* type_info);
+  explicit DynamicMessage(const DynamicMessageFactory::TypeInfo* type_info);
 
   // This should only be used by GetPrototypeNoLock() to avoid dead lock.
-  DynamicMessage(const TypeInfo* type_info, bool lock_factory);
+  DynamicMessage(DynamicMessageFactory::TypeInfo* type_info, bool lock_factory);
 
   ~DynamicMessage();
 
   // Called on the prototype after construction to initialize message fields.
+  // Cross linking the default instances allows for fast reflection access of
+  // unset message fields. Without it we would have to go to the MessageFactory
+  // to get the prototype, which is a much more expensive operation.
+  //
+  // Generated messages do not cross-link to avoid dynamic initialization of the
+  // global instances.
+  // Instead, they keep the default instances in the FieldDescriptor objects.
   void CrossLinkPrototypes();
 
   // implements Message ----------------------------------------------
 
-  Message* New() const;
-  Message* New(::google::protobuf::Arena* arena) const;
-  ::google::protobuf::Arena* GetArena() const { return NULL; };
+  Message* New(Arena* arena) const override;
 
-  int GetCachedSize() const;
-  void SetCachedSize(int size) const;
+  int GetCachedSize() const override;
+  void SetCachedSize(int size) const override;
 
-  Metadata GetMetadata() const;
+  Metadata GetMetadata() const override;
 
+#if defined(__cpp_lib_destroying_delete) && defined(__cpp_sized_deallocation)
+  static void operator delete(DynamicMessage* msg, std::destroying_delete_t);
+#else
   // We actually allocate more memory than sizeof(*this) when this
   // class's memory is allocated via the global operator new. Thus, we need to
   // manually call the global operator delete. Calling the destructor is taken
   // care of for us. This makes DynamicMessage compatible with -fsized-delete.
   // It doesn't work for MSVC though.
 #ifndef _MSC_VER
-  static void operator delete(void* ptr) {
-    ::operator delete(ptr);
-  }
+  static void operator delete(void* ptr) { ::operator delete(ptr); }
 #endif  // !_MSC_VER
+#endif
 
  private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMessage);
-  DynamicMessage(const TypeInfo* type_info, ::google::protobuf::Arena* arena);
+  DynamicMessage(const DynamicMessageFactory::TypeInfo* type_info,
+                 Arena* arena);
 
   void SharedCtor(bool lock_factory);
 
-  inline bool is_prototype() const {
-    return type_info_->prototype == this ||
-           // If type_info_->prototype is NULL, then we must be constructing
-           // the prototype now, which means we must be the prototype.
-           type_info_->prototype == NULL;
+  // Needed to get the offset of the internal metadata member.
+  friend class DynamicMessageFactory;
+
+  bool is_prototype() const;
+
+  inline int OffsetValue(int v, FieldDescriptor::Type type) const {
+    if (type == FieldDescriptor::TYPE_MESSAGE) {
+      return v & ~0x1u;
+    }
+    return v;
   }
 
   inline void* OffsetToPointer(int offset) {
-    return reinterpret_cast<uint8*>(this) + offset;
+    return reinterpret_cast<uint8_t*>(this) + offset;
   }
   inline const void* OffsetToPointer(int offset) const {
-    return reinterpret_cast<const uint8*>(this) + offset;
+    return reinterpret_cast<const uint8_t*>(this) + offset;
   }
 
-  const TypeInfo* type_info_;
-  // TODO(kenton):  Make this an atomic<int> when C++ supports it.
-  mutable int cached_byte_size_;
+  void* MutableRaw(int i);
+  void* MutableExtensionsRaw();
+  void* MutableWeakFieldMapRaw();
+  void* MutableOneofCaseRaw(int i);
+  void* MutableOneofFieldRaw(const FieldDescriptor* f);
+
+  const DynamicMessageFactory::TypeInfo* type_info_;
+  mutable std::atomic<int> cached_byte_size_;
+  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMessage);
+};
+
+struct DynamicMessageFactory::TypeInfo {
+  int size;
+  int has_bits_offset;
+  int oneof_case_offset;
+  int extensions_offset;
+
+  // Not owned by the TypeInfo.
+  DynamicMessageFactory* factory;  // The factory that created this object.
+  const DescriptorPool* pool;      // The factory's DescriptorPool.
+  const Descriptor* type;          // Type of this DynamicMessage.
+
+  // Warning:  The order in which the following pointers are defined is
+  //   important (the prototype must be deleted *before* the offsets).
+  std::unique_ptr<uint32_t[]> offsets;
+  std::unique_ptr<uint32_t[]> has_bits_indices;
+  std::unique_ptr<const Reflection> reflection;
+  // Don't use a unique_ptr to hold the prototype: the destructor for
+  // DynamicMessage needs to know whether it is the prototype, and does so by
+  // looking back at this field. This would assume details about the
+  // implementation of unique_ptr.
+  const DynamicMessage* prototype;
+  int weak_field_map_offset;  // The offset for the weak_field_map;
+
+  TypeInfo() : prototype(nullptr) {}
+
+  ~TypeInfo() { delete prototype; }
 };
 
-DynamicMessage::DynamicMessage(const TypeInfo* type_info)
-  : type_info_(type_info),
-    cached_byte_size_(0) {
+DynamicMessage::DynamicMessage(const DynamicMessageFactory::TypeInfo* type_info)
+    : type_info_(type_info), cached_byte_size_(0) {
   SharedCtor(true);
 }
 
-DynamicMessage::DynamicMessage(const TypeInfo* type_info,
-                               ::google::protobuf::Arena* arena)
-  : type_info_(type_info),
-    cached_byte_size_(0) {
+DynamicMessage::DynamicMessage(const DynamicMessageFactory::TypeInfo* type_info,
+                               Arena* arena)
+    : Message(arena), type_info_(type_info), cached_byte_size_(0) {
   SharedCtor(true);
 }
 
-DynamicMessage::DynamicMessage(const TypeInfo* type_info, bool lock_factory)
+DynamicMessage::DynamicMessage(DynamicMessageFactory::TypeInfo* type_info,
+                               bool lock_factory)
     : type_info_(type_info), cached_byte_size_(0) {
+  // The prototype in type_info has to be set before creating the prototype
+  // instance on memory. e.g., message Foo { map<int32_t, Foo> a = 1; }. When
+  // creating prototype for Foo, prototype of the map entry will also be
+  // created, which needs the address of the prototype of Foo (the value in
+  // map). To break the cyclic dependency, we have to assign the address of
+  // prototype into type_info first.
+  type_info->prototype = this;
   SharedCtor(lock_factory);
 }
 
+inline void* DynamicMessage::MutableRaw(int i) {
+  return OffsetToPointer(
+      OffsetValue(type_info_->offsets[i], type_info_->type->field(i)->type()));
+}
+void* DynamicMessage::MutableExtensionsRaw() {
+  return OffsetToPointer(type_info_->extensions_offset);
+}
+void* DynamicMessage::MutableWeakFieldMapRaw() {
+  return OffsetToPointer(type_info_->weak_field_map_offset);
+}
+void* DynamicMessage::MutableOneofCaseRaw(int i) {
+  return OffsetToPointer(type_info_->oneof_case_offset + sizeof(uint32_t) * i);
+}
+void* DynamicMessage::MutableOneofFieldRaw(const FieldDescriptor* f) {
+  return OffsetToPointer(
+      OffsetValue(type_info_->offsets[type_info_->type->field_count() +
+                                      f->containing_oneof()->index()],
+                  f->type()));
+}
+
 void DynamicMessage::SharedCtor(bool lock_factory) {
   // We need to call constructors for various fields manually and set
   // default values where appropriate.  We use placement new to call
@@ -336,47 +386,45 @@ void DynamicMessage::SharedCtor(bool lock_factory) {
 
   const Descriptor* descriptor = type_info_->type;
   // Initialize oneof cases.
-  for (int i = 0 ; i < descriptor->oneof_decl_count(); ++i) {
-    new (OffsetToPointer(type_info_->oneof_case_offset + sizeof(uint32) * i))
-        uint32(0);
+  int oneof_count = 0;
+  for (int i = 0; i < descriptor->oneof_decl_count(); ++i) {
+    if (descriptor->oneof_decl(i)->is_synthetic()) continue;
+    new (MutableOneofCaseRaw(oneof_count++)) uint32_t{0};
   }
 
-  new (OffsetToPointer(type_info_->internal_metadata_offset))
-      InternalMetadataWithArena;
-
   if (type_info_->extensions_offset != -1) {
-    new (OffsetToPointer(type_info_->extensions_offset)) ExtensionSet;
+    new (MutableExtensionsRaw()) ExtensionSet(GetArenaForAllocation());
   }
   for (int i = 0; i < descriptor->field_count(); i++) {
     const FieldDescriptor* field = descriptor->field(i);
-    void* field_ptr = OffsetToPointer(type_info_->offsets[i]);
-    if (field->containing_oneof()) {
+    void* field_ptr = MutableRaw(i);
+    if (InRealOneof(field)) {
       continue;
     }
     switch (field->cpp_type()) {
-#define HANDLE_TYPE(CPPTYPE, TYPE)                                           \
-      case FieldDescriptor::CPPTYPE_##CPPTYPE:                               \
-        if (!field->is_repeated()) {                                         \
-          new(field_ptr) TYPE(field->default_value_##TYPE());                \
-        } else {                                                             \
-          new(field_ptr) RepeatedField<TYPE>();                              \
-        }                                                                    \
-        break;
-
-      HANDLE_TYPE(INT32 , int32 );
-      HANDLE_TYPE(INT64 , int64 );
-      HANDLE_TYPE(UINT32, uint32);
-      HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(CPPTYPE, TYPE)                                  \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE:                          \
+    if (!field->is_repeated()) {                                    \
+      new (field_ptr) TYPE(field->default_value_##TYPE());          \
+    } else {                                                        \
+      new (field_ptr) RepeatedField<TYPE>(GetArenaForAllocation()); \
+    }                                                               \
+    break;
+
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
       HANDLE_TYPE(DOUBLE, double);
-      HANDLE_TYPE(FLOAT , float );
-      HANDLE_TYPE(BOOL  , bool  );
+      HANDLE_TYPE(FLOAT, float);
+      HANDLE_TYPE(BOOL, bool);
 #undef HANDLE_TYPE
 
       case FieldDescriptor::CPPTYPE_ENUM:
         if (!field->is_repeated()) {
-          new(field_ptr) int(field->default_value_enum()->number());
+          new (field_ptr) int{field->default_value_enum()->number()};
         } else {
-          new(field_ptr) RepeatedField<int>();
+          new (field_ptr) RepeatedField<int>(GetArenaForAllocation());
         }
         break;
 
@@ -385,19 +433,15 @@ void DynamicMessage::SharedCtor(bool lock_factory) {
           default:  // TODO(kenton):  Support other string reps.
           case FieldOptions::STRING:
             if (!field->is_repeated()) {
-              const string* default_value;
-              if (is_prototype()) {
-                default_value = &field->default_value_string();
-              } else {
-                default_value = &(reinterpret_cast<const ArenaStringPtr*>(
-                                      type_info_->prototype->OffsetToPointer(
-                                          type_info_->offsets[i]))
-                                      ->Get());
-              }
-              ArenaStringPtr* asp = new(field_ptr) ArenaStringPtr();
+              const std::string* default_value =
+                  field->default_value_string().empty()
+                      ? &internal::GetEmptyStringAlreadyInited()
+                      : nullptr;
+              ArenaStringPtr* asp = new (field_ptr) ArenaStringPtr();
               asp->UnsafeSetDefault(default_value);
             } else {
-              new(field_ptr) RepeatedPtrField<string>();
+              new (field_ptr)
+                  RepeatedPtrField<std::string>(GetArenaForAllocation());
             }
             break;
         }
@@ -405,22 +449,45 @@ void DynamicMessage::SharedCtor(bool lock_factory) {
 
       case FieldDescriptor::CPPTYPE_MESSAGE: {
         if (!field->is_repeated()) {
-          new(field_ptr) Message*(NULL);
+          new (field_ptr) Message*(nullptr);
         } else {
           if (IsMapFieldInApi(field)) {
             // We need to lock in most cases to avoid data racing. Only not lock
             // when the constructor is called inside GetPrototype(), in which
             // case we have already locked the factory.
             if (lock_factory) {
-              new (field_ptr) DynamicMapField(
-                  type_info_->factory->GetPrototype(field->message_type()));
+              if (GetArenaForAllocation() != nullptr) {
+                new (field_ptr) DynamicMapField(
+                    type_info_->factory->GetPrototype(field->message_type()),
+                    GetArenaForAllocation());
+                if (GetOwningArena() != nullptr) {
+                  // Needs to destroy the mutex member.
+                  GetOwningArena()->OwnDestructor(
+                      static_cast<DynamicMapField*>(field_ptr));
+                }
+              } else {
+                new (field_ptr) DynamicMapField(
+                    type_info_->factory->GetPrototype(field->message_type()));
+              }
             } else {
-              new (field_ptr)
-                  DynamicMapField(type_info_->factory->GetPrototypeNoLock(
-                      field->message_type()));
+              if (GetArenaForAllocation() != nullptr) {
+                new (field_ptr)
+                    DynamicMapField(type_info_->factory->GetPrototypeNoLock(
+                                        field->message_type()),
+                                    GetArenaForAllocation());
+                if (GetOwningArena() != nullptr) {
+                  // Needs to destroy the mutex member.
+                  GetOwningArena()->OwnDestructor(
+                      static_cast<DynamicMapField*>(field_ptr));
+                }
+              } else {
+                new (field_ptr)
+                    DynamicMapField(type_info_->factory->GetPrototypeNoLock(
+                        field->message_type()));
+              }
             }
           } else {
-            new (field_ptr) RepeatedPtrField<Message>();
+            new (field_ptr) RepeatedPtrField<Message>(GetArenaForAllocation());
           }
         }
         break;
@@ -429,16 +496,29 @@ void DynamicMessage::SharedCtor(bool lock_factory) {
   }
 }
 
+bool DynamicMessage::is_prototype() const {
+  return type_info_->prototype == this ||
+         // If type_info_->prototype is nullptr, then we must be constructing
+         // the prototype now, which means we must be the prototype.
+         type_info_->prototype == nullptr;
+}
+
+#if defined(__cpp_lib_destroying_delete) && defined(__cpp_sized_deallocation)
+void DynamicMessage::operator delete(DynamicMessage* msg,
+                                     std::destroying_delete_t) {
+  const size_t size = msg->type_info_->size;
+  msg->~DynamicMessage();
+  ::operator delete(msg, size);
+}
+#endif
+
 DynamicMessage::~DynamicMessage() {
   const Descriptor* descriptor = type_info_->type;
 
-  reinterpret_cast<InternalMetadataWithArena*>(
-      OffsetToPointer(type_info_->internal_metadata_offset))
-      ->~InternalMetadataWithArena();
+  _internal_metadata_.Delete<UnknownFieldSet>();
 
   if (type_info_->extensions_offset != -1) {
-    reinterpret_cast<ExtensionSet*>(
-      OffsetToPointer(type_info_->extensions_offset))->~ExtensionSet();
+    reinterpret_cast<ExtensionSet*>(MutableExtensionsRaw())->~ExtensionSet();
   }
 
   // We need to manually run the destructors for repeated fields and strings,
@@ -451,26 +531,21 @@ DynamicMessage::~DynamicMessage() {
   // be touched.
   for (int i = 0; i < descriptor->field_count(); i++) {
     const FieldDescriptor* field = descriptor->field(i);
-    if (field->containing_oneof()) {
-      void* field_ptr = OffsetToPointer(
-          type_info_->oneof_case_offset
-          + sizeof(uint32) * field->containing_oneof()->index());
-      if (*(reinterpret_cast<const uint32*>(field_ptr)) ==
-          field->number()) {
-        field_ptr = OffsetToPointer(type_info_->offsets[
-            descriptor->field_count() + field->containing_oneof()->index()]);
+    if (InRealOneof(field)) {
+      void* field_ptr = MutableOneofCaseRaw(field->containing_oneof()->index());
+      if (*(reinterpret_cast<const int32_t*>(field_ptr)) == field->number()) {
+        field_ptr = MutableOneofFieldRaw(field);
         if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) {
           switch (field->options().ctype()) {
             default:
             case FieldOptions::STRING: {
-              const ::std::string* default_value =
-                  &(reinterpret_cast<const ArenaStringPtr*>(
-                        reinterpret_cast<const uint8*>(
-                            type_info_->prototype) +
-                        type_info_->offsets[i])
-                        ->Get());
+              // Oneof string fields are never set as a default instance.
+              // We just need to pass some arbitrary default string to make it
+              // work. This allows us to not have the real default accessible
+              // from reflection.
+              const std::string* default_value = nullptr;
               reinterpret_cast<ArenaStringPtr*>(field_ptr)->Destroy(
-                  default_value, NULL);
+                  default_value, nullptr);
               break;
             }
           }
@@ -480,32 +555,32 @@ DynamicMessage::~DynamicMessage() {
       }
       continue;
     }
-    void* field_ptr = OffsetToPointer(type_info_->offsets[i]);
+    void* field_ptr = MutableRaw(i);
 
     if (field->is_repeated()) {
       switch (field->cpp_type()) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                                     \
-        case FieldDescriptor::CPPTYPE_##UPPERCASE :                           \
-          reinterpret_cast<RepeatedField<LOWERCASE>*>(field_ptr)              \
-              ->~RepeatedField<LOWERCASE>();                                  \
-          break
-
-        HANDLE_TYPE( INT32,  int32);
-        HANDLE_TYPE( INT64,  int64);
-        HANDLE_TYPE(UINT32, uint32);
-        HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                  \
+  case FieldDescriptor::CPPTYPE_##UPPERCASE:               \
+    reinterpret_cast<RepeatedField<LOWERCASE>*>(field_ptr) \
+        ->~RepeatedField<LOWERCASE>();                     \
+    break
+
+        HANDLE_TYPE(INT32, int32_t);
+        HANDLE_TYPE(INT64, int64_t);
+        HANDLE_TYPE(UINT32, uint32_t);
+        HANDLE_TYPE(UINT64, uint64_t);
         HANDLE_TYPE(DOUBLE, double);
-        HANDLE_TYPE( FLOAT,  float);
-        HANDLE_TYPE(  BOOL,   bool);
-        HANDLE_TYPE(  ENUM,    int);
+        HANDLE_TYPE(FLOAT, float);
+        HANDLE_TYPE(BOOL, bool);
+        HANDLE_TYPE(ENUM, int);
 #undef HANDLE_TYPE
 
         case FieldDescriptor::CPPTYPE_STRING:
           switch (field->options().ctype()) {
             default:  // TODO(kenton):  Support other string reps.
             case FieldOptions::STRING:
-              reinterpret_cast<RepeatedPtrField<string>*>(field_ptr)
-                  ->~RepeatedPtrField<string>();
+              reinterpret_cast<RepeatedPtrField<std::string>*>(field_ptr)
+                  ->~RepeatedPtrField<std::string>();
               break;
           }
           break;
@@ -524,20 +599,20 @@ DynamicMessage::~DynamicMessage() {
       switch (field->options().ctype()) {
         default:  // TODO(kenton):  Support other string reps.
         case FieldOptions::STRING: {
-          const ::std::string* default_value =
-              &(reinterpret_cast<const ArenaStringPtr*>(
-                    type_info_->prototype->OffsetToPointer(
-                        type_info_->offsets[i]))
-                    ->Get());
-          reinterpret_cast<ArenaStringPtr*>(field_ptr)->Destroy(
-              default_value, NULL);
+          const std::string* default_value =
+              reinterpret_cast<const ArenaStringPtr*>(
+                  type_info_->prototype->OffsetToPointer(
+                      type_info_->offsets[i]))
+                  ->GetPointer();
+          reinterpret_cast<ArenaStringPtr*>(field_ptr)->Destroy(default_value,
+                                                                nullptr);
           break;
         }
       }
     } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-      if (!is_prototype()) {
+          if (!is_prototype()) {
         Message* message = *reinterpret_cast<Message**>(field_ptr);
-        if (message != NULL) {
+        if (message != nullptr) {
           delete message;
         }
       }
@@ -555,46 +630,38 @@ void DynamicMessage::CrossLinkPrototypes() {
   // Cross-link default messages.
   for (int i = 0; i < descriptor->field_count(); i++) {
     const FieldDescriptor* field = descriptor->field(i);
-    void* field_ptr = OffsetToPointer(type_info_->offsets[i]);
     if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE &&
+        !field->options().weak() && !InRealOneof(field) &&
         !field->is_repeated()) {
+      void* field_ptr = MutableRaw(i);
       // For fields with message types, we need to cross-link with the
       // prototype for the field's type.
       // For singular fields, the field is just a pointer which should
       // point to the prototype.
       *reinterpret_cast<const Message**>(field_ptr) =
-        factory->GetPrototypeNoLock(field->message_type());
+          factory->GetPrototypeNoLock(field->message_type());
     }
   }
 }
 
-Message* DynamicMessage::New() const {
-  void* new_base = operator new(type_info_->size);
-  memset(new_base, 0, type_info_->size);
-  return new(new_base) DynamicMessage(type_info_);
-}
-
-Message* DynamicMessage::New(::google::protobuf::Arena* arena) const {
-  if (arena != NULL) {
-    Message* message = New();
-    arena->Own(message);
-    return message;
+Message* DynamicMessage::New(Arena* arena) const {
+  if (arena != nullptr) {
+    void* new_base = Arena::CreateArray<char>(arena, type_info_->size);
+    memset(new_base, 0, type_info_->size);
+    return new (new_base) DynamicMessage(type_info_, arena);
   } else {
-    return New();
+    void* new_base = operator new(type_info_->size);
+    memset(new_base, 0, type_info_->size);
+    return new (new_base) DynamicMessage(type_info_);
   }
 }
 
 int DynamicMessage::GetCachedSize() const {
-  return cached_byte_size_;
+  return cached_byte_size_.load(std::memory_order_relaxed);
 }
 
 void DynamicMessage::SetCachedSize(int size) const {
-  // This is theoretically not thread-compatible, but in practice it works
-  // because if multiple threads write this simultaneously, they will be
-  // writing the exact same value.
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  cached_byte_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  cached_byte_size_.store(size, std::memory_order_relaxed);
 }
 
 Metadata DynamicMessage::GetMetadata() const {
@@ -606,27 +673,14 @@ Metadata DynamicMessage::GetMetadata() const {
 
 // ===================================================================
 
-struct DynamicMessageFactory::PrototypeMap {
-  typedef hash_map<const Descriptor*, const DynamicMessage::TypeInfo*> Map;
-  Map map_;
-};
-
 DynamicMessageFactory::DynamicMessageFactory()
-  : pool_(NULL), delegate_to_generated_factory_(false),
-    prototypes_(new PrototypeMap) {
-}
+    : pool_(nullptr), delegate_to_generated_factory_(false) {}
 
 DynamicMessageFactory::DynamicMessageFactory(const DescriptorPool* pool)
-  : pool_(pool), delegate_to_generated_factory_(false),
-    prototypes_(new PrototypeMap) {
-}
+    : pool_(pool), delegate_to_generated_factory_(false) {}
 
 DynamicMessageFactory::~DynamicMessageFactory() {
-  for (PrototypeMap::Map::iterator iter = prototypes_->map_.begin();
-       iter != prototypes_->map_.end(); ++iter) {
-    DeleteDefaultOneofInstance(iter->second->type,
-                               iter->second->offsets.get(),
-                               iter->second->prototype);
+  for (auto iter = prototypes_.begin(); iter != prototypes_.end(); ++iter) {
     delete iter->second;
   }
 }
@@ -643,30 +697,35 @@ const Message* DynamicMessageFactory::GetPrototypeNoLock(
     return MessageFactory::generated_factory()->GetPrototype(type);
   }
 
-  const DynamicMessage::TypeInfo** target = &prototypes_->map_[type];
-  if (*target != NULL) {
+  const TypeInfo** target = &prototypes_[type];
+  if (*target != nullptr) {
     // Already exists.
     return (*target)->prototype;
   }
 
-  DynamicMessage::TypeInfo* type_info = new DynamicMessage::TypeInfo;
+  TypeInfo* type_info = new TypeInfo;
   *target = type_info;
 
   type_info->type = type;
-  type_info->pool = (pool_ == NULL) ? type->file()->pool() : pool_;
+  type_info->pool = (pool_ == nullptr) ? type->file()->pool() : pool_;
   type_info->factory = this;
 
-  // We need to construct all the structures passed to
-  // GeneratedMessageReflection's constructor.  This includes:
+  // We need to construct all the structures passed to Reflection's constructor.
+  // This includes:
   // - A block of memory that contains space for all the message's fields.
   // - An array of integers indicating the byte offset of each field within
   //   this block.
   // - A big bitfield containing a bit for each field indicating whether
   //   or not that field is set.
+  int real_oneof_count = 0;
+  for (int i = 0; i < type->oneof_decl_count(); i++) {
+    if (!type->oneof_decl(i)->is_synthetic()) {
+      real_oneof_count++;
+    }
+  }
 
   // Compute size and offsets.
-  uint32* offsets =
-      new uint32[type->field_count() + type->oneof_decl_count()];
+  uint32_t* offsets = new uint32_t[type->field_count() + real_oneof_count];
   type_info->offsets.reset(offsets);
 
   // Decide all field offsets by packing in order.
@@ -676,26 +735,35 @@ const Message* DynamicMessageFactory::GetPrototypeNoLock(
   size = AlignOffset(size);
 
   // Next the has_bits, which is an array of uint32s.
-  if (type->file()->syntax() == FileDescriptor::SYNTAX_PROTO3) {
-    type_info->has_bits_offset = -1;
-  } else {
-    type_info->has_bits_offset = size;
-    int has_bits_array_size =
-      DivideRoundingUp(type->field_count(), bitsizeof(uint32));
-    size += has_bits_array_size * sizeof(uint32);
-    size = AlignOffset(size);
-
-    uint32* has_bits_indices = new uint32[type->field_count()];
-    for (int i = 0; i < type->field_count(); i++) {
-      has_bits_indices[i] = i;
+  type_info->has_bits_offset = -1;
+  int max_hasbit = 0;
+  for (int i = 0; i < type->field_count(); i++) {
+    if (HasHasbit(type->field(i))) {
+      if (type_info->has_bits_offset == -1) {
+        // At least one field in the message requires a hasbit, so allocate
+        // hasbits.
+        type_info->has_bits_offset = size;
+        uint32_t* has_bits_indices = new uint32_t[type->field_count()];
+        for (int j = 0; j < type->field_count(); j++) {
+          // Initialize to -1, fields that need a hasbit will overwrite.
+          has_bits_indices[j] = static_cast<uint32_t>(-1);
+        }
+        type_info->has_bits_indices.reset(has_bits_indices);
+      }
+      type_info->has_bits_indices[i] = max_hasbit++;
     }
-    type_info->has_bits_indices.reset(has_bits_indices);
+  }
+
+  if (max_hasbit > 0) {
+    int has_bits_array_size = DivideRoundingUp(max_hasbit, bitsizeof(uint32_t));
+    size += has_bits_array_size * sizeof(uint32_t);
+    size = AlignOffset(size);
   }
 
   // The oneof_case, if any. It is an array of uint32s.
-  if (type->oneof_decl_count() > 0) {
+  if (real_oneof_count > 0) {
     type_info->oneof_case_offset = size;
-    size += type->oneof_decl_count() * sizeof(uint32);
+    size += real_oneof_count * sizeof(uint32_t);
     size = AlignOffset(size);
   }
 
@@ -712,11 +780,10 @@ const Message* DynamicMessageFactory::GetPrototypeNoLock(
   // All the fields.
   //
   // TODO(b/31226269):  Optimize the order of fields to minimize padding.
-  int num_weak_fields = 0;
   for (int i = 0; i < type->field_count(); i++) {
     // Make sure field is aligned to avoid bus errors.
     // Oneof fields do not use any space.
-    if (!type->field(i)->containing_oneof()) {
+    if (!InRealOneof(type->field(i))) {
       int field_size = FieldSpaceUsed(type->field(i));
       size = AlignTo(size, std::min(kSafeAlignment, field_size));
       offsets[i] = size;
@@ -726,75 +793,59 @@ const Message* DynamicMessageFactory::GetPrototypeNoLock(
 
   // The oneofs.
   for (int i = 0; i < type->oneof_decl_count(); i++) {
-    size = AlignTo(size, kSafeAlignment);
-    offsets[type->field_count() + i] = size;
-    size += kMaxOneofUnionSize;
+    if (!type->oneof_decl(i)->is_synthetic()) {
+      size = AlignTo(size, kSafeAlignment);
+      offsets[type->field_count() + i] = size;
+      size += kMaxOneofUnionSize;
+    }
   }
 
-  // Add the InternalMetadataWithArena to the end.
-  size = AlignOffset(size);
-  type_info->internal_metadata_offset = size;
-  size += sizeof(InternalMetadataWithArena);
-
   type_info->weak_field_map_offset = -1;
 
   // Align the final size to make sure no clever allocators think that
   // alignment is not necessary.
   type_info->size = size;
 
-
   // Construct the reflection object.
 
-  if (type->oneof_decl_count() > 0) {
-    // Compute the size of default oneof instance and offsets of default
-    // oneof fields.
-    for (int i = 0; i < type->oneof_decl_count(); i++) {
-      for (int j = 0; j < type->oneof_decl(i)->field_count(); j++) {
-        const FieldDescriptor* field = type->oneof_decl(i)->field(j);
-        int field_size = OneofFieldSpaceUsed(field);
-        size = AlignTo(size, std::min(kSafeAlignment, field_size));
-        offsets[field->index()] = size;
-        size += field_size;
-      }
+  // Compute the size of default oneof instance and offsets of default
+  // oneof fields.
+  for (int i = 0; i < type->oneof_decl_count(); i++) {
+    if (type->oneof_decl(i)->is_synthetic()) continue;
+    for (int j = 0; j < type->oneof_decl(i)->field_count(); j++) {
+      const FieldDescriptor* field = type->oneof_decl(i)->field(j);
+      // oneof fields are not accessed through offsets, but we still have the
+      // entry from a legacy implementation. This should be removed at some
+      // point.
+      // Mark the field to prevent unintentional access through reflection.
+      // Don't use the top bit because that is for unused fields.
+      offsets[field->index()] = internal::kInvalidFieldOffsetTag;
     }
   }
-  size = AlignOffset(size);
-  // Allocate the prototype + oneof fields.
+
+  // Allocate the prototype fields.
   void* base = operator new(size);
   memset(base, 0, size);
 
-  // The prototype in type_info has to be set before creating the prototype
-  // instance on memory. e.g., message Foo { map<int32, Foo> a = 1; }. When
-  // creating prototype for Foo, prototype of the map entry will also be
-  // created, which needs the address of the prototype of Foo (the value in
-  // map). To break the cyclic dependency, we have to assgin the address of
-  // prototype into type_info first.
-  type_info->prototype = static_cast<DynamicMessage*>(base);
-
   // We have already locked the factory so we should not lock in the constructor
   // of dynamic message to avoid dead lock.
   DynamicMessage* prototype = new (base) DynamicMessage(type_info, false);
 
-  if (type->oneof_decl_count() > 0 || num_weak_fields > 0) {
-    // Construct default oneof instance.
-    ConstructDefaultOneofInstance(type_info->type,
-                                  type_info->offsets.get(),
-                                  prototype);
-  }
-
   internal::ReflectionSchema schema = {
       type_info->prototype,
       type_info->offsets.get(),
       type_info->has_bits_indices.get(),
       type_info->has_bits_offset,
-      type_info->internal_metadata_offset,
+      PROTOBUF_FIELD_OFFSET(DynamicMessage, _internal_metadata_),
       type_info->extensions_offset,
       type_info->oneof_case_offset,
       type_info->size,
-      type_info->weak_field_map_offset};
+      type_info->weak_field_map_offset,
+      nullptr /* inlined_string_indices_ */,
+      0 /* inlined_string_donated_offset_ */};
 
-  type_info->reflection.reset(new GeneratedMessageReflection(
-      type_info->type, schema, type_info->pool, this));
+  type_info->reflection.reset(
+      new Reflection(type_info->type, schema, type_info->pool, this));
 
   // Cross link prototypes.
   prototype->CrossLinkPrototypes();
@@ -802,69 +853,7 @@ const Message* DynamicMessageFactory::GetPrototypeNoLock(
   return prototype;
 }
 
-void DynamicMessageFactory::ConstructDefaultOneofInstance(
-    const Descriptor* type,
-    const uint32 offsets[],
-    void* default_oneof_or_weak_instance) {
-  for (int i = 0; i < type->oneof_decl_count(); i++) {
-    for (int j = 0; j < type->oneof_decl(i)->field_count(); j++) {
-      const FieldDescriptor* field = type->oneof_decl(i)->field(j);
-      void* field_ptr = reinterpret_cast<uint8*>(
-          default_oneof_or_weak_instance) + offsets[field->index()];
-      switch (field->cpp_type()) {
-#define HANDLE_TYPE(CPPTYPE, TYPE)                                      \
-        case FieldDescriptor::CPPTYPE_##CPPTYPE:                        \
-          new(field_ptr) TYPE(field->default_value_##TYPE());           \
-          break;
-
-        HANDLE_TYPE(INT32 , int32 );
-        HANDLE_TYPE(INT64 , int64 );
-        HANDLE_TYPE(UINT32, uint32);
-        HANDLE_TYPE(UINT64, uint64);
-        HANDLE_TYPE(DOUBLE, double);
-        HANDLE_TYPE(FLOAT , float );
-        HANDLE_TYPE(BOOL  , bool  );
-#undef HANDLE_TYPE
-
-        case FieldDescriptor::CPPTYPE_ENUM:
-          new(field_ptr) int(field->default_value_enum()->number());
-          break;
-        case FieldDescriptor::CPPTYPE_STRING:
-          switch (field->options().ctype()) {
-            default:
-            case FieldOptions::STRING:
-              ArenaStringPtr* asp = new (field_ptr) ArenaStringPtr();
-              asp->UnsafeSetDefault(&field->default_value_string());
-              break;
-          }
-          break;
-
-        case FieldDescriptor::CPPTYPE_MESSAGE: {
-          new(field_ptr) Message*(NULL);
-          break;
-        }
-      }
-    }
-  }
-}
-
-void DynamicMessageFactory::DeleteDefaultOneofInstance(
-    const Descriptor* type,
-    const uint32 offsets[],
-    const void* default_oneof_instance) {
-  for (int i = 0; i < type->oneof_decl_count(); i++) {
-    for (int j = 0; j < type->oneof_decl(i)->field_count(); j++) {
-      const FieldDescriptor* field = type->oneof_decl(i)->field(j);
-      if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) {
-        switch (field->options().ctype()) {
-          default:
-          case FieldOptions::STRING:
-            break;
-        }
-      }
-    }
-  }
-}
-
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>  // NOLINT
index e29b148..d0af57c 100644 (file)
 
 #include <algorithm>
 #include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
+#include <unordered_map>
 #include <vector>
 
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/message.h>
 #include <google/protobuf/stubs/mutex.h>
+#include <google/protobuf/reflection.h>
+#include <google/protobuf/repeated_field.h>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
 
 // Defined in other files.
-class Descriptor;        // descriptor.h
-class DescriptorPool;    // descriptor.h
+class Descriptor;      // descriptor.h
+class DescriptorPool;  // descriptor.h
 
 // Constructs implementations of Message which can emulate types which are not
 // known at compile-time.
@@ -74,7 +79,7 @@ class DescriptorPool;    // descriptor.h
 // encapsulates this "cache".  All DynamicMessages of the same type created
 // from the same factory will share the same support data.  Any Descriptors
 // used with a particular factory must outlive the factory.
-class LIBPROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory {
+class PROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory {
  public:
   // Construct a DynamicMessageFactory that will search for extensions in
   // the DescriptorPool in which the extendee is defined.
@@ -118,62 +123,44 @@ class LIBPROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory {
   // outlive the DynamicMessageFactory.
   //
   // The method is thread-safe.
-  const Message* GetPrototype(const Descriptor* type);
+  const Message* GetPrototype(const Descriptor* type) override;
 
  private:
   const DescriptorPool* pool_;
   bool delegate_to_generated_factory_;
 
-  // This struct just contains a hash_map.  We can't #include <google/protobuf/stubs/hash.h> from
-  // this header due to hacks needed for hash_map portability in the open source
-  // release.  Namely, stubs/hash.h, which defines hash_map portably, is not a
-  // public header (for good reason), but dynamic_message.h is, and public
-  // headers may only #include other public headers.
-  struct PrototypeMap;
-  google::protobuf::scoped_ptr<PrototypeMap> prototypes_;
-  mutable Mutex prototypes_mutex_;
+  struct TypeInfo;
+  std::unordered_map<const Descriptor*, const TypeInfo*> prototypes_;
+  mutable internal::WrappedMutex prototypes_mutex_;
 
   friend class DynamicMessage;
   const Message* GetPrototypeNoLock(const Descriptor* type);
 
-  // Construct default oneof instance for reflection usage if oneof
-  // is defined.
-  static void ConstructDefaultOneofInstance(const Descriptor* type,
-                                            const uint32 offsets[],
-                                            void* default_oneof_instance);
-  // Delete default oneof instance. Called by ~DynamicMessageFactory.
-  static void DeleteDefaultOneofInstance(const Descriptor* type,
-                                         const uint32 offsets[],
-                                         const void* default_oneof_instance);
-
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMessageFactory);
 };
 
 // Helper for computing a sorted list of map entries via reflection.
-class LIBPROTOBUF_EXPORT DynamicMapSorter {
+class PROTOBUF_EXPORT DynamicMapSorter {
  public:
-  static std::vector<const Message*> Sort(const Message& message,
-                                          int map_size,
+  static std::vector<const Message*> Sort(const Message& message, int map_size,
                                           const Reflection* reflection,
                                           const FieldDescriptor* field) {
-    std::vector<const Message*> result(static_cast<size_t>(map_size));
-    const RepeatedPtrField<Message>& map_field =
-        reflection->GetRepeatedPtrField<Message>(message, field);
-    size_t i = 0;
-    for (RepeatedPtrField<Message>::const_pointer_iterator it =
-             map_field.pointer_begin(); it != map_field.pointer_end(); ) {
-      result[i++] = *it++;
+    std::vector<const Message*> result;
+    result.reserve(map_size);
+    RepeatedFieldRef<Message> map_field =
+        reflection->GetRepeatedFieldRef<Message>(message, field);
+    for (auto it = map_field.begin(); it != map_field.end(); ++it) {
+      result.push_back(&*it);
     }
-    GOOGLE_DCHECK_EQ(result.size(), i);
     MapEntryMessageComparator comparator(field->message_type());
     std::stable_sort(result.begin(), result.end(), comparator);
     // Complain if the keys aren't in ascending order.
 #ifndef NDEBUG
     for (size_t j = 1; j < static_cast<size_t>(map_size); j++) {
       if (!comparator(result[j - 1], result[j])) {
-        GOOGLE_LOG(ERROR) << (comparator(result[j], result[j - 1]) ?
-                      "internal error in map key sorting" :
-                      "map keys are not unique");
+        GOOGLE_LOG(ERROR) << (comparator(result[j], result[j - 1])
+                           ? "internal error in map key sorting"
+                           : "map keys are not unique");
       }
     }
 #endif
@@ -181,7 +168,7 @@ class LIBPROTOBUF_EXPORT DynamicMapSorter {
   }
 
  private:
-  class LIBPROTOBUF_EXPORT MapEntryMessageComparator {
+  class PROTOBUF_EXPORT MapEntryMessageComparator {
    public:
     explicit MapEntryMessageComparator(const Descriptor* descriptor)
         : field_(descriptor->field(0)) {}
@@ -195,28 +182,28 @@ class LIBPROTOBUF_EXPORT DynamicMapSorter {
           return first < second;
         }
         case FieldDescriptor::CPPTYPE_INT32: {
-          int32 first = reflection->GetInt32(*a, field_);
-          int32 second = reflection->GetInt32(*b, field_);
+          int32_t first = reflection->GetInt32(*a, field_);
+          int32_t second = reflection->GetInt32(*b, field_);
           return first < second;
         }
         case FieldDescriptor::CPPTYPE_INT64: {
-          int64 first = reflection->GetInt64(*a, field_);
-          int64 second = reflection->GetInt64(*b, field_);
+          int64_t first = reflection->GetInt64(*a, field_);
+          int64_t second = reflection->GetInt64(*b, field_);
           return first < second;
         }
         case FieldDescriptor::CPPTYPE_UINT32: {
-          uint32 first = reflection->GetUInt32(*a, field_);
-          uint32 second = reflection->GetUInt32(*b, field_);
+          uint32_t first = reflection->GetUInt32(*a, field_);
+          uint32_t second = reflection->GetUInt32(*b, field_);
           return first < second;
         }
         case FieldDescriptor::CPPTYPE_UINT64: {
-          uint64 first = reflection->GetUInt64(*a, field_);
-          uint64 second = reflection->GetUInt64(*b, field_);
+          uint64_t first = reflection->GetUInt64(*a, field_);
+          uint64_t second = reflection->GetUInt64(*b, field_);
           return first < second;
         }
         case FieldDescriptor::CPPTYPE_STRING: {
-          string first = reflection->GetString(*a, field_);
-          string second = reflection->GetString(*b, field_);
+          std::string first = reflection->GetString(*a, field_);
+          std::string second = reflection->GetString(*b, field_);
           return first < second;
         }
         default:
@@ -231,6 +218,8 @@ class LIBPROTOBUF_EXPORT DynamicMapSorter {
 };
 
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/empty.pb.cc b/3rdparty/protobuf/src/google/protobuf/empty.pb.cc
deleted file mode 100644 (file)
index caa019e..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/empty.proto
-
-#include <google/protobuf/empty.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class EmptyDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_Empty_default_instance_;
-    new (ptr) ::google::protobuf::Empty();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::google::protobuf::Empty::InitAsDefaultInstance();
-}
-
-void InitDefaultsEmpty() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEmptyImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[1];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  ~0u,  // no _has_bits_
-  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_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*>(&::google::protobuf::_Empty_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/empty.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "/ptypes/empty\370\001\001\242\002\003GPB\252\002\036Google.Protobuf"
-      ".WellKnownTypesb\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 183);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/empty.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_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::InitDefaultsEmpty();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Empty)
-}
-Empty::Empty(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaultsEmpty();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Empty)
-}
-Empty::Empty(const Empty& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Empty)
-}
-
-void Empty::SharedCtor() {
-  _cached_size_ = 0;
-}
-
-Empty::~Empty() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Empty)
-  SharedDtor();
-}
-
-void Empty::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void Empty::ArenaDtor(void* object) {
-  Empty* _this = reinterpret_cast< Empty* >(object);
-  (void)_this;
-}
-void Empty::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Empty::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Empty& Empty::default_instance() {
-  ::protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaultsEmpty();
-  return *internal_default_instance();
-}
-
-Empty* Empty::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Empty>(arena);
-}
-
-void Empty::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Empty)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  _internal_metadata_.Clear();
-}
-
-bool Empty::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.Empty)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-  handle_unusual:
-    if (tag == 0) {
-      goto success;
-    }
-    DO_(::google::protobuf::internal::WireFormat::SkipField(
-          input, tag, _internal_metadata_.mutable_unknown_fields()));
-  }
-success:
-  // @@protoc_insertion_point(parse_success:google.protobuf.Empty)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Empty)
-  return false;
-#undef DO_
-}
-
-void Empty::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Empty)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Empty)
-}
-
-::google::protobuf::uint8* Empty::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Empty)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Empty)
-  return target;
-}
-
-size_t Empty::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Empty)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  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 Empty::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Empty)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Empty* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Empty>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Empty)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Empty)
-    MergeFrom(*source);
-  }
-}
-
-void Empty::MergeFrom(const Empty& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Empty)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-}
-
-void Empty::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Empty)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Empty::CopyFrom(const Empty& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Empty)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Empty::IsInitialized() const {
-  return true;
-}
-
-void Empty::Swap(Empty* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Empty* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Empty::UnsafeArenaSwap(Empty* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Empty::InternalSwap(Empty* other) {
-  using std::swap;
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Empty::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fempty_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fempty_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/empty.pb.h b/3rdparty/protobuf/src/google/protobuf/empty.pb.h
deleted file mode 100644 (file)
index 76e0e4c..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/empty.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/unknown_field_set.h>
-// @@protoc_insertion_point(includes)
-
-namespace protobuf_google_2fprotobuf_2fempty_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[1];
-  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 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 {
-
-// ===================================================================
-
-class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ {
- public:
-  Empty();
-  virtual ~Empty();
-
-  Empty(const Empty& from);
-
-  inline Empty& operator=(const Empty& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Empty(Empty&& from) noexcept
-    : Empty() {
-    *this = ::std::move(from);
-  }
-
-  inline Empty& operator=(Empty&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void UnsafeArenaSwap(Empty* other);
-  void Swap(Empty* other);
-  friend void swap(Empty& a, Empty& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Empty* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Empty* 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 Empty& from);
-  void MergeFrom(const Empty& 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(Empty* other);
-  protected:
-  explicit Empty(::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 -------------------------------------------------------
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Empty)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fempty_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaultsEmptyImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// Empty
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
 // 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_STUBS_TIME_H_
-#define GOOGLE_PROTOBUF_STUBS_TIME_H_
 
+#ifndef GOOGLE_PROTOBUF_EXPLICITLY_CONSTRUCTED_H__
+#define GOOGLE_PROTOBUF_EXPLICITLY_CONSTRUCTED_H__
+
+#include <stdint.h>
+
+#include <utility>
+
+#include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
 
+// clang-format off
+#include <google/protobuf/port_def.inc>
+// clang-format on
+
 namespace google {
 namespace protobuf {
 namespace internal {
 
-struct DateTime {
-  int year;
-  int month;
-  int day;
-  int hour;
-  int minute;
-  int second;
-};
+// Wraps a variable whose constructor and destructor are explicitly
+// called. It is particularly useful for a global variable, without its
+// constructor and destructor run on start and end of the program lifetime.
+// This circumvents the initial construction order fiasco, while keeping
+// the address of the empty string a compile time constant.
+//
+// Pay special attention to the initialization state of the object.
+// 1. The object is "uninitialized" to begin with.
+// 2. Call Construct() or DefaultConstruct() only if the object is
+//    uninitialized. After the call, the object becomes "initialized".
+// 3. Call get() and get_mutable() only if the object is initialized.
+// 4. Call Destruct() only if the object is initialized.
+//    After the call, the object becomes uninitialized.
+template <typename T>
+class ExplicitlyConstructed {
+ public:
+  void DefaultConstruct() { new (&union_) T(); }
 
-// Converts a timestamp (seconds elapsed since 1970-01-01T00:00:00, could be
-// negative to represent time before 1970-01-01) to DateTime. Returns false
-// if the timestamp is not in the range between 0001-01-01T00:00:00 and
-// 9999-12-31T23:59:59.
-bool LIBPROTOBUF_EXPORT SecondsToDateTime(int64 seconds, DateTime* time);
-// Converts DateTime to a timestamp (seconds since 1970-01-01T00:00:00).
-// Returns false if the DateTime is not valid or is not in the valid range.
-bool LIBPROTOBUF_EXPORT DateTimeToSeconds(const DateTime& time, int64* seconds);
+  template <typename... Args>
+  void Construct(Args&&... args) {
+    new (&union_) T(std::forward<Args>(args)...);
+  }
 
-void LIBPROTOBUF_EXPORT GetCurrentTime(int64* seconds, int32* nanos);
+  void Destruct() { get_mutable()->~T(); }
 
-// Formats a time string in RFC3339 fromat.
-//
-// For example, "2015-05-20T13:29:35.120Z". For nanos, 0, 3, 6 or 9 fractional
-// digits will be used depending on how many are required to represent the exact
-// value.
-//
-// Note that "nanos" must in the range of [0, 999999999].
-string LIBPROTOBUF_EXPORT FormatTime(int64 seconds, int32 nanos);
-// Parses a time string. This method accepts RFC3339 date/time string with UTC
-// offset. For example, "2015-05-20T13:29:35.120-08:00".
-bool LIBPROTOBUF_EXPORT ParseTime(const string& value, int64* seconds, int32* nanos);
+  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }
+  T* get_mutable() { return reinterpret_cast<T*>(&union_); }
+
+ private:
+  union AlignedUnion {
+    alignas(T) char space[sizeof(T)];
+    int64_t align_to_int64;
+    void* align_to_ptr;
+  } union_;
+};
 
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
 
-#endif  // GOOGLE_PROTOBUF_STUBS_TIME_H_
+#include <google/protobuf/port_undef.inc>
+
+#endif  // GOOGLE_PROTOBUF_EXPLICITLY_CONSTRUCTED_H__
index cf6b6fb..1bf7a36 100644 (file)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
-#include <google/protobuf/stubs/hash.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/extension_set.h>
-#include <google/protobuf/message_lite.h>
+
+#include <tuple>
+#include <unordered_set>
+#include <utility>
+
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/extension_set_inl.h>
+#include <google/protobuf/parse_context.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/metadata_lite.h>
 #include <google/protobuf/repeated_field.h>
 #include <google/protobuf/stubs/map_util.h>
+#include <google/protobuf/stubs/hash.h>
 
+// clang-format off
+#include <google/protobuf/port_def.inc>  // must be last.
+// clang-format on
 namespace google {
 namespace protobuf {
 namespace internal {
@@ -68,48 +79,61 @@ inline bool is_packable(WireFormatLite::WireType type) {
     case WireFormatLite::WIRETYPE_END_GROUP:
       return false;
 
-    // Do not add a default statement. Let the compiler complain when someone
-    // adds a new wire type.
+      // Do not add a default statement. Let the compiler complain when someone
+      // adds a new wire type.
   }
   GOOGLE_LOG(FATAL) << "can't reach here.";
   return false;
 }
 
 // Registry stuff.
-typedef hash_map<std::pair<const MessageLite*, int>,
-                 ExtensionInfo> ExtensionRegistry;
-ExtensionRegistry* registry_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(registry_init_);
 
-void DeleteRegistry() {
-  delete registry_;
-  registry_ = NULL;
-}
+// Note that we cannot use hetererogeneous lookup for std containers since we
+// need to support C++11.
+struct ExtensionEq {
+  bool operator()(const ExtensionInfo& lhs, const ExtensionInfo& rhs) const {
+    return lhs.message == rhs.message && lhs.number == rhs.number;
+  }
+};
 
-void InitRegistry() {
-  registry_ = new ExtensionRegistry;
-  OnShutdown(&DeleteRegistry);
-}
+struct ExtensionHasher {
+  std::size_t operator()(const ExtensionInfo& info) const {
+    return std::hash<const MessageLite*>{}(info.message) ^
+           std::hash<int>{}(info.number);
+  }
+};
+
+using ExtensionRegistry =
+    std::unordered_set<ExtensionInfo, ExtensionHasher, ExtensionEq>;
+
+static const ExtensionRegistry* global_registry = nullptr;
 
 // This function is only called at startup, so there is no need for thread-
 // safety.
-void Register(const MessageLite* containing_type,
-              int number, ExtensionInfo info) {
-  ::google::protobuf::GoogleOnceInit(&registry_init_, &InitRegistry);
-
-  if (!InsertIfNotPresent(registry_, std::make_pair(containing_type, number),
-                          info)) {
+void Register(const ExtensionInfo& info) {
+  static auto local_static_registry = OnShutdownDelete(new ExtensionRegistry);
+  global_registry = local_static_registry;
+  if (!InsertIfNotPresent(local_static_registry, info)) {
     GOOGLE_LOG(FATAL) << "Multiple extension registrations for type \""
-               << containing_type->GetTypeName()
-               << "\", field number " << number << ".";
+               << info.message->GetTypeName() << "\", field number "
+               << info.number << ".";
   }
 }
 
-const ExtensionInfo* FindRegisteredExtension(
-    const MessageLite* containing_type, int number) {
-  return (registry_ == NULL)
-             ? NULL
-             : FindOrNull(*registry_, std::make_pair(containing_type, number));
+const ExtensionInfo* FindRegisteredExtension(const MessageLite* extendee,
+                                             int number) {
+  if (!global_registry) return nullptr;
+
+  ExtensionInfo info;
+  info.message = extendee;
+  info.number = number;
+
+  auto it = global_registry->find(info);
+  if (it == global_registry->end()) {
+    return nullptr;
+  } else {
+    return &*it;
+  }
 }
 
 }  // namespace
@@ -117,9 +141,8 @@ const ExtensionInfo* FindRegisteredExtension(
 ExtensionFinder::~ExtensionFinder() {}
 
 bool GeneratedExtensionFinder::Find(int number, ExtensionInfo* output) {
-  const ExtensionInfo* extension =
-      FindRegisteredExtension(containing_type_, number);
-  if (extension == NULL) {
+  const ExtensionInfo* extension = FindRegisteredExtension(extendee_, number);
+  if (extension == nullptr) {
     return false;
   } else {
     *output = *extension;
@@ -127,14 +150,14 @@ bool GeneratedExtensionFinder::Find(int number, ExtensionInfo* output) {
   }
 }
 
-void ExtensionSet::RegisterExtension(const MessageLite* containing_type,
-                                     int number, FieldType type,
-                                     bool is_repeated, bool is_packed) {
+void ExtensionSet::RegisterExtension(const MessageLite* extendee, int number,
+                                     FieldType type, bool is_repeated,
+                                     bool is_packed) {
   GOOGLE_CHECK_NE(type, WireFormatLite::TYPE_ENUM);
   GOOGLE_CHECK_NE(type, WireFormatLite::TYPE_MESSAGE);
   GOOGLE_CHECK_NE(type, WireFormatLite::TYPE_GROUP);
-  ExtensionInfo info(type, is_repeated, is_packed);
-  Register(containing_type, number, info);
+  ExtensionInfo info(extendee, number, type, is_repeated, is_packed);
+  Register(info);
 }
 
 static bool CallNoArgValidityFunc(const void* arg, int number) {
@@ -150,97 +173,115 @@ static bool CallNoArgValidityFunc(const void* arg, int number) {
   return ((EnumValidityFunc*)arg)(number);
 }
 
-void ExtensionSet::RegisterEnumExtension(const MessageLite* containing_type,
+void ExtensionSet::RegisterEnumExtension(const MessageLite* extendee,
                                          int number, FieldType type,
                                          bool is_repeated, bool is_packed,
                                          EnumValidityFunc* is_valid) {
   GOOGLE_CHECK_EQ(type, WireFormatLite::TYPE_ENUM);
-  ExtensionInfo info(type, is_repeated, is_packed);
+  ExtensionInfo info(extendee, number, type, is_repeated, is_packed);
   info.enum_validity_check.func = CallNoArgValidityFunc;
   // See comment in CallNoArgValidityFunc() about why we use a c-style cast.
   info.enum_validity_check.arg = (void*)is_valid;
-  Register(containing_type, number, info);
+  Register(info);
 }
 
-void ExtensionSet::RegisterMessageExtension(const MessageLite* containing_type,
+void ExtensionSet::RegisterMessageExtension(const MessageLite* extendee,
                                             int number, FieldType type,
                                             bool is_repeated, bool is_packed,
                                             const MessageLite* prototype) {
   GOOGLE_CHECK(type == WireFormatLite::TYPE_MESSAGE ||
         type == WireFormatLite::TYPE_GROUP);
-  ExtensionInfo info(type, is_repeated, is_packed);
-  info.message_prototype = prototype;
-  Register(containing_type, number, info);
+  ExtensionInfo info(extendee, number, type, is_repeated, is_packed);
+  info.message_info = {prototype};
+  Register(info);
 }
 
-
 // ===================================================================
 // Constructors and basic methods.
 
-ExtensionSet::ExtensionSet(::google::protobuf::Arena* arena)
-    : arena_(arena) {
-  if (arena_ != NULL) {
-    arena_->OwnDestructor(&extensions_);
-  }
-}
-
-ExtensionSet::ExtensionSet() : arena_(NULL) {}
+ExtensionSet::ExtensionSet(Arena* arena)
+    : arena_(arena),
+      flat_capacity_(0),
+      flat_size_(0),
+      map_{flat_capacity_ == 0
+               ? nullptr
+               : Arena::CreateArray<KeyValue>(arena_, flat_capacity_)} {}
 
 ExtensionSet::~ExtensionSet() {
   // Deletes all allocated extensions.
-  if (arena_ == NULL) {
-    for (ExtensionMap::iterator iter = extensions_.begin();
-         iter != extensions_.end(); ++iter) {
-      iter->second.Free();
+  if (arena_ == nullptr) {
+    ForEach([](int /* number */, Extension& ext) { ext.Free(); });
+    if (PROTOBUF_PREDICT_FALSE(is_large())) {
+      delete map_.large;
+    } else {
+      DeleteFlatMap(map_.flat, flat_capacity_);
     }
   }
 }
 
+void ExtensionSet::DeleteFlatMap(const ExtensionSet::KeyValue* flat,
+                                 uint16_t flat_capacity) {
+#ifdef __cpp_sized_deallocation
+  // Arena::CreateArray already requires a trivially destructible type, but
+  // ensure this constraint is not violated in the future.
+  static_assert(std::is_trivially_destructible<KeyValue>::value,
+                "CreateArray requires a trivially destructible type");
+  // A const-cast is needed, but this is safe as we are about to deallocate the
+  // array.
+  ::operator delete[](const_cast<ExtensionSet::KeyValue*>(flat),
+                      sizeof(*flat) * flat_capacity);
+#else   // !__cpp_sized_deallocation
+  delete[] flat;
+#endif  // !__cpp_sized_deallocation
+}
+
 // Defined in extension_set_heavy.cc.
-// void ExtensionSet::AppendToList(const Descriptor* containing_type,
+// void ExtensionSet::AppendToList(const Descriptor* extendee,
 //                                 const DescriptorPool* pool,
 //                                 vector<const FieldDescriptor*>* output) const
 
 bool ExtensionSet::Has(int number) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  if (iter == extensions_.end()) return false;
-  GOOGLE_DCHECK(!iter->second.is_repeated);
-  return !iter->second.is_cleared;
+  const Extension* ext = FindOrNull(number);
+  if (ext == nullptr) return false;
+  GOOGLE_DCHECK(!ext->is_repeated);
+  return !ext->is_cleared;
+}
+
+bool ExtensionSet::HasLazy(int number) const {
+  return Has(number) && FindOrNull(number)->is_lazy;
 }
 
 int ExtensionSet::NumExtensions() const {
   int result = 0;
-  for (ExtensionMap::const_iterator iter = extensions_.begin();
-       iter != extensions_.end(); ++iter) {
-    if (!iter->second.is_cleared) {
+  ForEach([&result](int /* number */, const Extension& ext) {
+    if (!ext.is_cleared) {
       ++result;
     }
-  }
+  });
   return result;
 }
 
 int ExtensionSet::ExtensionSize(int number) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  if (iter == extensions_.end()) return 0;
-  return iter->second.GetSize();
+  const Extension* ext = FindOrNull(number);
+  return ext == nullptr ? 0 : ext->GetSize();
 }
 
 FieldType ExtensionSet::ExtensionType(int number) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  if (iter == extensions_.end()) {
+  const Extension* ext = FindOrNull(number);
+  if (ext == nullptr) {
     GOOGLE_LOG(DFATAL) << "Don't lookup extension types if they aren't present (1). ";
     return 0;
   }
-  if (iter->second.is_cleared) {
+  if (ext->is_cleared) {
     GOOGLE_LOG(DFATAL) << "Don't lookup extension types if they aren't present (2). ";
   }
-  return iter->second.type;
+  return ext->type;
 }
 
 void ExtensionSet::ClearExtension(int number) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  if (iter == extensions_.end()) return;
-  iter->second.Clear();
+  Extension* ext = FindOrNull(number);
+  if (ext == nullptr) return;
+  ext->Clear();
 }
 
 // ===================================================================
@@ -248,100 +289,119 @@ void ExtensionSet::ClearExtension(int number) {
 
 namespace {
 
-enum Cardinality {
-  REPEATED,
-  OPTIONAL
-};
+enum { REPEATED_FIELD, OPTIONAL_FIELD };
 
 }  // namespace
 
-#define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE)                             \
-  GOOGLE_DCHECK_EQ((EXTENSION).is_repeated ? REPEATED : OPTIONAL, LABEL);         \
+#define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE)                                 \
+  GOOGLE_DCHECK_EQ((EXTENSION).is_repeated ? REPEATED_FIELD : OPTIONAL_FIELD, LABEL); \
   GOOGLE_DCHECK_EQ(cpp_type((EXTENSION).type), WireFormatLite::CPPTYPE_##CPPTYPE)
 
 // -------------------------------------------------------------------
 // Primitives
 
-#define PRIMITIVE_ACCESSORS(UPPERCASE, LOWERCASE, CAMELCASE)                   \
-                                                                               \
-LOWERCASE ExtensionSet::Get##CAMELCASE(int number,                             \
-                                       LOWERCASE default_value) const {        \
-  ExtensionMap::const_iterator iter = extensions_.find(number);                \
-  if (iter == extensions_.end() || iter->second.is_cleared) {                  \
-    return default_value;                                                      \
-  } else {                                                                     \
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, UPPERCASE);                            \
-    return iter->second.LOWERCASE##_value;                                     \
-  }                                                                            \
-}                                                                              \
-                                                                               \
-void ExtensionSet::Set##CAMELCASE(int number, FieldType type,                  \
-                                  LOWERCASE value,                             \
-                                  const FieldDescriptor* descriptor) {         \
-  Extension* extension;                                                        \
-  if (MaybeNewExtension(number, descriptor, &extension)) {                     \
-    extension->type = type;                                                    \
-    GOOGLE_DCHECK_EQ(cpp_type(extension->type), WireFormatLite::CPPTYPE_##UPPERCASE); \
-    extension->is_repeated = false;                                            \
-  } else {                                                                     \
-    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, UPPERCASE);                              \
-  }                                                                            \
-  extension->is_cleared = false;                                               \
-  extension->LOWERCASE##_value = value;                                        \
-}                                                                              \
-                                                                               \
-LOWERCASE ExtensionSet::GetRepeated##CAMELCASE(int number, int index) const {  \
-  ExtensionMap::const_iterator iter = extensions_.find(number);                \
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty)."; \
-  GOOGLE_DCHECK_TYPE(iter->second, REPEATED, UPPERCASE);                              \
-  return iter->second.repeated_##LOWERCASE##_value->Get(index);                \
-}                                                                              \
-                                                                               \
-void ExtensionSet::SetRepeated##CAMELCASE(                                     \
-    int number, int index, LOWERCASE value) {                                  \
-  ExtensionMap::iterator iter = extensions_.find(number);                      \
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty)."; \
-  GOOGLE_DCHECK_TYPE(iter->second, REPEATED, UPPERCASE);                              \
-  iter->second.repeated_##LOWERCASE##_value->Set(index, value);                \
-}                                                                              \
-                                                                               \
-void ExtensionSet::Add##CAMELCASE(int number, FieldType type,                  \
-                                  bool packed, LOWERCASE value,                \
-                                  const FieldDescriptor* descriptor) {         \
-  Extension* extension;                                                        \
-  if (MaybeNewExtension(number, descriptor, &extension)) {                     \
-    extension->type = type;                                                    \
-    GOOGLE_DCHECK_EQ(cpp_type(extension->type), WireFormatLite::CPPTYPE_##UPPERCASE); \
-    extension->is_repeated = true;                                             \
-    extension->is_packed = packed;                                             \
-    extension->repeated_##LOWERCASE##_value =                                  \
-      Arena::CreateMessage<RepeatedField<LOWERCASE> >(arena_);                 \
-  } else {                                                                     \
-    GOOGLE_DCHECK_TYPE(*extension, REPEATED, UPPERCASE);                              \
-    GOOGLE_DCHECK_EQ(extension->is_packed, packed);                                   \
-  }                                                                            \
-  extension->repeated_##LOWERCASE##_value->Add(value);                         \
-}
-
-PRIMITIVE_ACCESSORS( INT32,  int32,  Int32)
-PRIMITIVE_ACCESSORS( INT64,  int64,  Int64)
-PRIMITIVE_ACCESSORS(UINT32, uint32, UInt32)
-PRIMITIVE_ACCESSORS(UINT64, uint64, UInt64)
-PRIMITIVE_ACCESSORS( FLOAT,  float,  Float)
+#define PRIMITIVE_ACCESSORS(UPPERCASE, LOWERCASE, CAMELCASE)                  \
+                                                                              \
+  LOWERCASE ExtensionSet::Get##CAMELCASE(int number, LOWERCASE default_value) \
+      const {                                                                 \
+    const Extension* extension = FindOrNull(number);                          \
+    if (extension == nullptr || extension->is_cleared) {                      \
+      return default_value;                                                   \
+    } else {                                                                  \
+      GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, UPPERCASE);                     \
+      return extension->LOWERCASE##_value;                                    \
+    }                                                                         \
+  }                                                                           \
+                                                                              \
+  const LOWERCASE& ExtensionSet::GetRef##CAMELCASE(                           \
+      int number, const LOWERCASE& default_value) const {                     \
+    const Extension* extension = FindOrNull(number);                          \
+    if (extension == nullptr || extension->is_cleared) {                      \
+      return default_value;                                                   \
+    } else {                                                                  \
+      GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, UPPERCASE);                     \
+      return extension->LOWERCASE##_value;                                    \
+    }                                                                         \
+  }                                                                           \
+                                                                              \
+  void ExtensionSet::Set##CAMELCASE(int number, FieldType type,               \
+                                    LOWERCASE value,                          \
+                                    const FieldDescriptor* descriptor) {      \
+    Extension* extension;                                                     \
+    if (MaybeNewExtension(number, descriptor, &extension)) {                  \
+      extension->type = type;                                                 \
+      GOOGLE_DCHECK_EQ(cpp_type(extension->type),                                    \
+                WireFormatLite::CPPTYPE_##UPPERCASE);                         \
+      extension->is_repeated = false;                                         \
+    } else {                                                                  \
+      GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, UPPERCASE);                     \
+    }                                                                         \
+    extension->is_cleared = false;                                            \
+    extension->LOWERCASE##_value = value;                                     \
+  }                                                                           \
+                                                                              \
+  LOWERCASE ExtensionSet::GetRepeated##CAMELCASE(int number, int index)       \
+      const {                                                                 \
+    const Extension* extension = FindOrNull(number);                          \
+    GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";   \
+    GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, UPPERCASE);                       \
+    return extension->repeated_##LOWERCASE##_value->Get(index);               \
+  }                                                                           \
+                                                                              \
+  const LOWERCASE& ExtensionSet::GetRefRepeated##CAMELCASE(int number,        \
+                                                           int index) const { \
+    const Extension* extension = FindOrNull(number);                          \
+    GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";   \
+    GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, UPPERCASE);                       \
+    return extension->repeated_##LOWERCASE##_value->Get(index);               \
+  }                                                                           \
+                                                                              \
+  void ExtensionSet::SetRepeated##CAMELCASE(int number, int index,            \
+                                            LOWERCASE value) {                \
+    Extension* extension = FindOrNull(number);                                \
+    GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";   \
+    GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, UPPERCASE);                       \
+    extension->repeated_##LOWERCASE##_value->Set(index, value);               \
+  }                                                                           \
+                                                                              \
+  void ExtensionSet::Add##CAMELCASE(int number, FieldType type, bool packed,  \
+                                    LOWERCASE value,                          \
+                                    const FieldDescriptor* descriptor) {      \
+    Extension* extension;                                                     \
+    if (MaybeNewExtension(number, descriptor, &extension)) {                  \
+      extension->type = type;                                                 \
+      GOOGLE_DCHECK_EQ(cpp_type(extension->type),                                    \
+                WireFormatLite::CPPTYPE_##UPPERCASE);                         \
+      extension->is_repeated = true;                                          \
+      extension->is_packed = packed;                                          \
+      extension->repeated_##LOWERCASE##_value =                               \
+          Arena::CreateMessage<RepeatedField<LOWERCASE>>(arena_);             \
+    } else {                                                                  \
+      GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, UPPERCASE);                     \
+      GOOGLE_DCHECK_EQ(extension->is_packed, packed);                                \
+    }                                                                         \
+    extension->repeated_##LOWERCASE##_value->Add(value);                      \
+  }
+
+PRIMITIVE_ACCESSORS(INT32, int32_t, Int32)
+PRIMITIVE_ACCESSORS(INT64, int64_t, Int64)
+PRIMITIVE_ACCESSORS(UINT32, uint32_t, UInt32)
+PRIMITIVE_ACCESSORS(UINT64, uint64_t, UInt64)
+PRIMITIVE_ACCESSORS(FLOAT, float, Float)
 PRIMITIVE_ACCESSORS(DOUBLE, double, Double)
-PRIMITIVE_ACCESSORS(  BOOL,   bool,   Bool)
+PRIMITIVE_ACCESSORS(BOOL, bool, Bool)
 
 #undef PRIMITIVE_ACCESSORS
 
 const void* ExtensionSet::GetRawRepeatedField(int number,
                                               const void* default_value) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  if (iter == extensions_.end()) {
+  const Extension* extension = FindOrNull(number);
+  if (extension == nullptr) {
     return default_value;
   }
   // We assume that all the RepeatedField<>* pointers have the same
   // size and alignment within the anonymous union in Extension.
-  return iter->second.repeated_int32_value;
+  return extension->repeated_int32_t_value;
 }
 
 void* ExtensionSet::MutableRawRepeatedField(int number, FieldType field_type,
@@ -359,75 +419,86 @@ void* ExtensionSet::MutableRawRepeatedField(int number, FieldType field_type,
     switch (WireFormatLite::FieldTypeToCppType(
         static_cast<WireFormatLite::FieldType>(field_type))) {
       case WireFormatLite::CPPTYPE_INT32:
-        extension->repeated_int32_value =
-            Arena::CreateMessage<RepeatedField<int32>(arena_);
+        extension->repeated_int32_t_value =
+            Arena::CreateMessage<RepeatedField<int32_t>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_INT64:
-        extension->repeated_int64_value =
-            Arena::CreateMessage<RepeatedField<int64>(arena_);
+        extension->repeated_int64_t_value =
+            Arena::CreateMessage<RepeatedField<int64_t>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_UINT32:
-        extension->repeated_uint32_value =
-            Arena::CreateMessage<RepeatedField<uint32>(arena_);
+        extension->repeated_uint32_t_value =
+            Arena::CreateMessage<RepeatedField<uint32_t>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_UINT64:
-        extension->repeated_uint64_value =
-            Arena::CreateMessage<RepeatedField<uint64>(arena_);
+        extension->repeated_uint64_t_value =
+            Arena::CreateMessage<RepeatedField<uint64_t>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_DOUBLE:
         extension->repeated_double_value =
-            Arena::CreateMessage<RepeatedField<double> >(arena_);
+            Arena::CreateMessage<RepeatedField<double>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_FLOAT:
         extension->repeated_float_value =
-            Arena::CreateMessage<RepeatedField<float> >(arena_);
+            Arena::CreateMessage<RepeatedField<float>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_BOOL:
         extension->repeated_bool_value =
-            Arena::CreateMessage<RepeatedField<bool> >(arena_);
+            Arena::CreateMessage<RepeatedField<bool>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_ENUM:
         extension->repeated_enum_value =
-            Arena::CreateMessage<RepeatedField<int> >(arena_);
+            Arena::CreateMessage<RepeatedField<int>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_STRING:
         extension->repeated_string_value =
-            Arena::CreateMessage<RepeatedPtrField< ::std::string> >(arena_);
+            Arena::CreateMessage<RepeatedPtrField<std::string>>(arena_);
         break;
       case WireFormatLite::CPPTYPE_MESSAGE:
         extension->repeated_message_value =
-            Arena::CreateMessage<RepeatedPtrField<MessageLite> >(arena_);
+            Arena::CreateMessage<RepeatedPtrField<MessageLite>>(arena_);
         break;
     }
   }
 
   // We assume that all the RepeatedField<>* pointers have the same
   // size and alignment within the anonymous union in Extension.
-  return extension->repeated_int32_value;
+  return extension->repeated_int32_t_value;
 }
 
 // Compatible version using old call signature. Does not create extensions when
 // the don't already exist; instead, just GOOGLE_CHECK-fails.
 void* ExtensionSet::MutableRawRepeatedField(int number) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter == extensions_.end()) << "Extension not found.";
+  Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Extension not found.";
   // We assume that all the RepeatedField<>* pointers have the same
   // size and alignment within the anonymous union in Extension.
-  return iter->second.repeated_int32_value;
+  return extension->repeated_int32_t_value;
 }
 
-
 // -------------------------------------------------------------------
 // Enums
 
 int ExtensionSet::GetEnum(int number, int default_value) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  if (iter == extensions_.end() || iter->second.is_cleared) {
+  const Extension* extension = FindOrNull(number);
+  if (extension == nullptr || extension->is_cleared) {
+    // Not present.  Return the default value.
+    return default_value;
+  } else {
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, ENUM);
+    return extension->enum_value;
+  }
+}
+
+const int& ExtensionSet::GetRefEnum(int number,
+                                    const int& default_value) const {
+  const Extension* extension = FindOrNull(number);
+  if (extension == nullptr || extension->is_cleared) {
     // Not present.  Return the default value.
     return default_value;
   } else {
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, ENUM);
-    return iter->second.enum_value;
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, ENUM);
+    return extension->enum_value;
   }
 }
 
@@ -439,28 +510,34 @@ void ExtensionSet::SetEnum(int number, FieldType type, int value,
     GOOGLE_DCHECK_EQ(cpp_type(extension->type), WireFormatLite::CPPTYPE_ENUM);
     extension->is_repeated = false;
   } else {
-    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, ENUM);
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, ENUM);
   }
   extension->is_cleared = false;
   extension->enum_value = value;
 }
 
 int ExtensionSet::GetRepeatedEnum(int number, int index) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
-  GOOGLE_DCHECK_TYPE(iter->second, REPEATED, ENUM);
-  return iter->second.repeated_enum_value->Get(index);
+  const Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
+  GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, ENUM);
+  return extension->repeated_enum_value->Get(index);
+}
+
+const int& ExtensionSet::GetRefRepeatedEnum(int number, int index) const {
+  const Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
+  GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, ENUM);
+  return extension->repeated_enum_value->Get(index);
 }
 
 void ExtensionSet::SetRepeatedEnum(int number, int index, int value) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
-  GOOGLE_DCHECK_TYPE(iter->second, REPEATED, ENUM);
-  iter->second.repeated_enum_value->Set(index, value);
+  Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
+  GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, ENUM);
+  extension->repeated_enum_value->Set(index, value);
 }
 
-void ExtensionSet::AddEnum(int number, FieldType type,
-                           bool packed, int value,
+void ExtensionSet::AddEnum(int number, FieldType type, bool packed, int value,
                            const FieldDescriptor* descriptor) {
   Extension* extension;
   if (MaybeNewExtension(number, descriptor, &extension)) {
@@ -469,9 +546,9 @@ void ExtensionSet::AddEnum(int number, FieldType type,
     extension->is_repeated = true;
     extension->is_packed = packed;
     extension->repeated_enum_value =
-        Arena::CreateMessage<RepeatedField<int> >(arena_);
+        Arena::CreateMessage<RepeatedField<int>>(arena_);
   } else {
-    GOOGLE_DCHECK_TYPE(*extension, REPEATED, ENUM);
+    GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, ENUM);
     GOOGLE_DCHECK_EQ(extension->is_packed, packed);
   }
   extension->repeated_enum_value->Add(value);
@@ -480,49 +557,50 @@ void ExtensionSet::AddEnum(int number, FieldType type,
 // -------------------------------------------------------------------
 // Strings
 
-const string& ExtensionSet::GetString(int number,
-                                      const string& default_value) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  if (iter == extensions_.end() || iter->second.is_cleared) {
+const std::string& ExtensionSet::GetString(
+    int number, const std::string& default_value) const {
+  const Extension* extension = FindOrNull(number);
+  if (extension == nullptr || extension->is_cleared) {
     // Not present.  Return the default value.
     return default_value;
   } else {
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, STRING);
-    return *iter->second.string_value;
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, STRING);
+    return *extension->string_value;
   }
 }
 
-string* ExtensionSet::MutableString(int number, FieldType type,
-                                    const FieldDescriptor* descriptor) {
+std::string* ExtensionSet::MutableString(int number, FieldType type,
+                                         const FieldDescriptor* descriptor) {
   Extension* extension;
   if (MaybeNewExtension(number, descriptor, &extension)) {
     extension->type = type;
     GOOGLE_DCHECK_EQ(cpp_type(extension->type), WireFormatLite::CPPTYPE_STRING);
     extension->is_repeated = false;
-    extension->string_value = Arena::Create<string>(arena_);
+    extension->string_value = Arena::Create<std::string>(arena_);
   } else {
-    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, STRING);
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, STRING);
   }
   extension->is_cleared = false;
   return extension->string_value;
 }
 
-const string& ExtensionSet::GetRepeatedString(int number, int index) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
-  GOOGLE_DCHECK_TYPE(iter->second, REPEATED, STRING);
-  return iter->second.repeated_string_value->Get(index);
+const std::string& ExtensionSet::GetRepeatedString(int number,
+                                                   int index) const {
+  const Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
+  GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, STRING);
+  return extension->repeated_string_value->Get(index);
 }
 
-string* ExtensionSet::MutableRepeatedString(int number, int index) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
-  GOOGLE_DCHECK_TYPE(iter->second, REPEATED, STRING);
-  return iter->second.repeated_string_value->Mutable(index);
+std::string* ExtensionSet::MutableRepeatedString(int number, int index) {
+  Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
+  GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, STRING);
+  return extension->repeated_string_value->Mutable(index);
 }
 
-string* ExtensionSet::AddString(int number, FieldType type,
-                                const FieldDescriptor* descriptor) {
+std::string* ExtensionSet::AddString(int number, FieldType type,
+                                     const FieldDescriptor* descriptor) {
   Extension* extension;
   if (MaybeNewExtension(number, descriptor, &extension)) {
     extension->type = type;
@@ -530,9 +608,9 @@ string* ExtensionSet::AddString(int number, FieldType type,
     extension->is_repeated = true;
     extension->is_packed = false;
     extension->repeated_string_value =
-        Arena::CreateMessage<RepeatedPtrField<string> >(arena_);
+        Arena::CreateMessage<RepeatedPtrField<std::string>>(arena_);
   } else {
-    GOOGLE_DCHECK_TYPE(*extension, REPEATED, STRING);
+    GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, STRING);
   }
   return extension->repeated_string_value->Add();
 }
@@ -542,16 +620,16 @@ string* ExtensionSet::AddString(int number, FieldType type,
 
 const MessageLite& ExtensionSet::GetMessage(
     int number, const MessageLite& default_value) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  if (iter == extensions_.end()) {
+  const Extension* extension = FindOrNull(number);
+  if (extension == nullptr) {
     // Not present.  Return the default value.
     return default_value;
   } else {
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, MESSAGE);
-    if (iter->second.is_lazy) {
-      return iter->second.lazymessage_value->GetMessage(default_value);
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, MESSAGE);
+    if (extension->is_lazy) {
+      return extension->lazymessage_value->GetMessage(default_value, arena_);
     } else {
-      return *iter->second.message_value;
+      return *extension->message_value;
     }
   }
 }
@@ -574,10 +652,10 @@ MessageLite* ExtensionSet::MutableMessage(int number, FieldType type,
     extension->is_cleared = false;
     return extension->message_value;
   } else {
-    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, MESSAGE);
     extension->is_cleared = false;
     if (extension->is_lazy) {
-      return extension->lazymessage_value->MutableMessage(prototype);
+      return extension->lazymessage_value->MutableMessage(prototype, arena_);
     } else {
       return extension->message_value;
     }
@@ -592,11 +670,13 @@ MessageLite* ExtensionSet::MutableMessage(int number, FieldType type,
 void ExtensionSet::SetAllocatedMessage(int number, FieldType type,
                                        const FieldDescriptor* descriptor,
                                        MessageLite* message) {
-  if (message == NULL) {
+  if (message == nullptr) {
     ClearExtension(number);
     return;
   }
-  ::google::protobuf::Arena* message_arena = message->GetArena();
+  GOOGLE_DCHECK(message->GetOwningArena() == nullptr ||
+         message->GetOwningArena() == arena_);
+  Arena* message_arena = message->GetOwningArena();
   Extension* extension;
   if (MaybeNewExtension(number, descriptor, &extension)) {
     extension->type = type;
@@ -605,26 +685,26 @@ void ExtensionSet::SetAllocatedMessage(int number, FieldType type,
     extension->is_lazy = false;
     if (message_arena == arena_) {
       extension->message_value = message;
-    } else if (message_arena == NULL) {
+    } else if (message_arena == nullptr) {
       extension->message_value = message;
-      arena_->Own(message);  // not NULL because not equal to message_arena
+      arena_->Own(message);  // not nullptr because not equal to message_arena
     } else {
       extension->message_value = message->New(arena_);
       extension->message_value->CheckTypeAndMergeFrom(*message);
     }
   } else {
-    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, MESSAGE);
     if (extension->is_lazy) {
-      extension->lazymessage_value->SetAllocatedMessage(message);
+      extension->lazymessage_value->SetAllocatedMessage(message, arena_);
     } else {
-      if (arena_ == NULL) {
+      if (arena_ == nullptr) {
         delete extension->message_value;
       }
       if (message_arena == arena_) {
         extension->message_value = message;
-      } else if (message_arena == NULL) {
+      } else if (message_arena == nullptr) {
         extension->message_value = message;
-        arena_->Own(message);  // not NULL because not equal to message_arena
+        arena_->Own(message);  // not nullptr because not equal to message_arena
       } else {
         extension->message_value = message->New(arena_);
         extension->message_value->CheckTypeAndMergeFrom(*message);
@@ -637,7 +717,7 @@ void ExtensionSet::SetAllocatedMessage(int number, FieldType type,
 void ExtensionSet::UnsafeArenaSetAllocatedMessage(
     int number, FieldType type, const FieldDescriptor* descriptor,
     MessageLite* message) {
-  if (message == NULL) {
+  if (message == nullptr) {
     ClearExtension(number);
     return;
   }
@@ -649,11 +729,12 @@ void ExtensionSet::UnsafeArenaSetAllocatedMessage(
     extension->is_lazy = false;
     extension->message_value = message;
   } else {
-    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, MESSAGE);
     if (extension->is_lazy) {
-      extension->lazymessage_value->UnsafeArenaSetAllocatedMessage(message);
+      extension->lazymessage_value->UnsafeArenaSetAllocatedMessage(message,
+                                                                   arena_);
     } else {
-      if (arena_ == NULL) {
+      if (arena_ == nullptr) {
         delete extension->message_value;
       }
       extension->message_value = message;
@@ -662,55 +743,54 @@ void ExtensionSet::UnsafeArenaSetAllocatedMessage(
   extension->is_cleared = false;
 }
 
-
 MessageLite* ExtensionSet::ReleaseMessage(int number,
                                           const MessageLite& prototype) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  if (iter == extensions_.end()) {
-    // Not present.  Return NULL.
-    return NULL;
+  Extension* extension = FindOrNull(number);
+  if (extension == nullptr) {
+    // Not present.  Return nullptr.
+    return nullptr;
   } else {
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, MESSAGE);
-    MessageLite* ret = NULL;
-    if (iter->second.is_lazy) {
-      ret = iter->second.lazymessage_value->ReleaseMessage(prototype);
-      if (arena_ == NULL) {
-        delete iter->second.lazymessage_value;
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, MESSAGE);
+    MessageLite* ret = nullptr;
+    if (extension->is_lazy) {
+      ret = extension->lazymessage_value->ReleaseMessage(prototype, arena_);
+      if (arena_ == nullptr) {
+        delete extension->lazymessage_value;
       }
     } else {
-      if (arena_ == NULL) {
-        ret = iter->second.message_value;
+      if (arena_ == nullptr) {
+        ret = extension->message_value;
       } else {
         // ReleaseMessage() always returns a heap-allocated message, and we are
         // on an arena, so we need to make a copy of this message to return.
-        ret = (iter->second.message_value)->New();
-        ret->CheckTypeAndMergeFrom(*iter->second.message_value);
+        ret = extension->message_value->New();
+        ret->CheckTypeAndMergeFrom(*extension->message_value);
       }
     }
-    extensions_.erase(number);
+    Erase(number);
     return ret;
   }
 }
 
 MessageLite* ExtensionSet::UnsafeArenaReleaseMessage(
     int number, const MessageLite& prototype) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  if (iter == extensions_.end()) {
-    // Not present.  Return NULL.
-    return NULL;
+  Extension* extension = FindOrNull(number);
+  if (extension == nullptr) {
+    // Not present.  Return nullptr.
+    return nullptr;
   } else {
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, MESSAGE);
-    MessageLite* ret = NULL;
-    if (iter->second.is_lazy) {
-      ret =
-        iter->second.lazymessage_value->UnsafeArenaReleaseMessage(prototype);
-      if (arena_ == NULL) {
-        delete iter->second.lazymessage_value;
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL_FIELD, MESSAGE);
+    MessageLite* ret = nullptr;
+    if (extension->is_lazy) {
+      ret = extension->lazymessage_value->UnsafeArenaReleaseMessage(prototype,
+                                                                    arena_);
+      if (arena_ == nullptr) {
+        delete extension->lazymessage_value;
       }
     } else {
-      ret = iter->second.message_value;
+      ret = extension->message_value;
     }
-    extensions_.erase(number);
+    Erase(number);
     return ret;
   }
 }
@@ -719,19 +799,19 @@ MessageLite* ExtensionSet::UnsafeArenaReleaseMessage(
 // MessageLite* ExtensionSet::ReleaseMessage(const FieldDescriptor* descriptor,
 //                                           MessageFactory* factory);
 
-const MessageLite& ExtensionSet::GetRepeatedMessage(
-    int number, int index) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
-  GOOGLE_DCHECK_TYPE(iter->second, REPEATED, MESSAGE);
-  return iter->second.repeated_message_value->Get(index);
+const MessageLite& ExtensionSet::GetRepeatedMessage(int number,
+                                                    int index) const {
+  const Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
+  GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, MESSAGE);
+  return extension->repeated_message_value->Get(index);
 }
 
 MessageLite* ExtensionSet::MutableRepeatedMessage(int number, int index) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
-  GOOGLE_DCHECK_TYPE(iter->second, REPEATED, MESSAGE);
-  return iter->second.repeated_message_value->Mutable(index);
+  Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
+  GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, MESSAGE);
+  return extension->repeated_message_value->Mutable(index);
 }
 
 MessageLite* ExtensionSet::AddMessage(int number, FieldType type,
@@ -743,16 +823,17 @@ MessageLite* ExtensionSet::AddMessage(int number, FieldType type,
     GOOGLE_DCHECK_EQ(cpp_type(extension->type), WireFormatLite::CPPTYPE_MESSAGE);
     extension->is_repeated = true;
     extension->repeated_message_value =
-        Arena::CreateMessage<RepeatedPtrField<MessageLite> >(arena_);
+        Arena::CreateMessage<RepeatedPtrField<MessageLite>>(arena_);
   } else {
-    GOOGLE_DCHECK_TYPE(*extension, REPEATED, MESSAGE);
+    GOOGLE_DCHECK_TYPE(*extension, REPEATED_FIELD, MESSAGE);
   }
 
   // RepeatedPtrField<MessageLite> does not know how to Add() since it cannot
   // allocate an abstract object, so we have to be tricky.
-  MessageLite* result = extension->repeated_message_value
-      ->AddFromCleared<GenericTypeHandler<MessageLite> >();
-  if (result == NULL) {
+  MessageLite* result = reinterpret_cast<internal::RepeatedPtrFieldBase*>(
+                            extension->repeated_message_value)
+                            ->AddFromCleared<GenericTypeHandler<MessageLite>>();
+  if (result == nullptr) {
     result = prototype.New(arena_);
     extension->repeated_message_value->AddAllocated(result);
   }
@@ -767,24 +848,22 @@ MessageLite* ExtensionSet::AddMessage(int number, FieldType type,
 #undef GOOGLE_DCHECK_TYPE
 
 void ExtensionSet::RemoveLast(int number) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
-
-  Extension* extension = &iter->second;
+  Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
   GOOGLE_DCHECK(extension->is_repeated);
 
-  switch(cpp_type(extension->type)) {
+  switch (cpp_type(extension->type)) {
     case WireFormatLite::CPPTYPE_INT32:
-      extension->repeated_int32_value->RemoveLast();
+      extension->repeated_int32_t_value->RemoveLast();
       break;
     case WireFormatLite::CPPTYPE_INT64:
-      extension->repeated_int64_value->RemoveLast();
+      extension->repeated_int64_t_value->RemoveLast();
       break;
     case WireFormatLite::CPPTYPE_UINT32:
-      extension->repeated_uint32_value->RemoveLast();
+      extension->repeated_uint32_t_value->RemoveLast();
       break;
     case WireFormatLite::CPPTYPE_UINT64:
-      extension->repeated_uint64_value->RemoveLast();
+      extension->repeated_uint64_t_value->RemoveLast();
       break;
     case WireFormatLite::CPPTYPE_FLOAT:
       extension->repeated_float_value->RemoveLast();
@@ -808,34 +887,38 @@ void ExtensionSet::RemoveLast(int number) {
 }
 
 MessageLite* ExtensionSet::ReleaseLast(int number) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
-
-  Extension* extension = &iter->second;
+  Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
   GOOGLE_DCHECK(extension->is_repeated);
   GOOGLE_DCHECK(cpp_type(extension->type) == WireFormatLite::CPPTYPE_MESSAGE);
   return extension->repeated_message_value->ReleaseLast();
 }
 
-void ExtensionSet::SwapElements(int number, int index1, int index2) {
-  ExtensionMap::iterator iter = extensions_.find(number);
-  GOOGLE_CHECK(iter != extensions_.end()) << "Index out-of-bounds (field is empty).";
+MessageLite* ExtensionSet::UnsafeArenaReleaseLast(int number) {
+  Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
+  GOOGLE_DCHECK(extension->is_repeated);
+  GOOGLE_DCHECK(cpp_type(extension->type) == WireFormatLite::CPPTYPE_MESSAGE);
+  return extension->repeated_message_value->UnsafeArenaReleaseLast();
+}
 
-  Extension* extension = &iter->second;
+void ExtensionSet::SwapElements(int number, int index1, int index2) {
+  Extension* extension = FindOrNull(number);
+  GOOGLE_CHECK(extension != nullptr) << "Index out-of-bounds (field is empty).";
   GOOGLE_DCHECK(extension->is_repeated);
 
-  switch(cpp_type(extension->type)) {
+  switch (cpp_type(extension->type)) {
     case WireFormatLite::CPPTYPE_INT32:
-      extension->repeated_int32_value->SwapElements(index1, index2);
+      extension->repeated_int32_t_value->SwapElements(index1, index2);
       break;
     case WireFormatLite::CPPTYPE_INT64:
-      extension->repeated_int64_value->SwapElements(index1, index2);
+      extension->repeated_int64_t_value->SwapElements(index1, index2);
       break;
     case WireFormatLite::CPPTYPE_UINT32:
-      extension->repeated_uint32_value->SwapElements(index1, index2);
+      extension->repeated_uint32_t_value->SwapElements(index1, index2);
       break;
     case WireFormatLite::CPPTYPE_UINT64:
-      extension->repeated_uint64_value->SwapElements(index1, index2);
+      extension->repeated_uint64_t_value->SwapElements(index1, index2);
       break;
     case WireFormatLite::CPPTYPE_FLOAT:
       extension->repeated_float_value->SwapElements(index1, index2);
@@ -861,26 +944,56 @@ void ExtensionSet::SwapElements(int number, int index1, int index2) {
 // ===================================================================
 
 void ExtensionSet::Clear() {
-  for (ExtensionMap::iterator iter = extensions_.begin();
-       iter != extensions_.end(); ++iter) {
-    iter->second.Clear();
+  ForEach([](int /* number */, Extension& ext) { ext.Clear(); });
+}
+
+namespace {
+// Computes the size of a std::set_union without constructing the union.
+template <typename ItX, typename ItY>
+size_t SizeOfUnion(ItX it_xs, ItX end_xs, ItY it_ys, ItY end_ys) {
+  size_t result = 0;
+  while (it_xs != end_xs && it_ys != end_ys) {
+    ++result;
+    if (it_xs->first < it_ys->first) {
+      ++it_xs;
+    } else if (it_xs->first == it_ys->first) {
+      ++it_xs;
+      ++it_ys;
+    } else {
+      ++it_ys;
+    }
   }
+  result += std::distance(it_xs, end_xs);
+  result += std::distance(it_ys, end_ys);
+  return result;
 }
+}  // namespace
 
-void ExtensionSet::MergeFrom(const ExtensionSet& other) {
-  for (ExtensionMap::const_iterator iter = other.extensions_.begin();
-       iter != other.extensions_.end(); ++iter) {
-    const Extension& other_extension = iter->second;
-    InternalExtensionMergeFrom(iter->first, other_extension);
+void ExtensionSet::MergeFrom(const MessageLite* extendee,
+                             const ExtensionSet& other) {
+  if (PROTOBUF_PREDICT_TRUE(!is_large())) {
+    if (PROTOBUF_PREDICT_TRUE(!other.is_large())) {
+      GrowCapacity(SizeOfUnion(flat_begin(), flat_end(), other.flat_begin(),
+                               other.flat_end()));
+    } else {
+      GrowCapacity(SizeOfUnion(flat_begin(), flat_end(),
+                               other.map_.large->begin(),
+                               other.map_.large->end()));
+    }
   }
+  other.ForEach([extendee, this, &other](int number, const Extension& ext) {
+    this->InternalExtensionMergeFrom(extendee, number, ext, other.arena_);
+  });
 }
 
-void ExtensionSet::InternalExtensionMergeFrom(
-  int number, const Extension& other_extension) {
+void ExtensionSet::InternalExtensionMergeFrom(const MessageLite* extendee,
+                                              int number,
+                                              const Extension& other_extension,
+                                              Arena* other_arena) {
   if (other_extension.is_repeated) {
     Extension* extension;
-    bool is_new = MaybeNewExtension(number, other_extension.descriptor,
-                                    &extension);
+    bool is_new =
+        MaybeNewExtension(number, other_extension.descriptor, &extension);
     if (is_new) {
       // Extension did not already exist in set.
       extension->type = other_extension.type;
@@ -893,31 +1006,31 @@ void ExtensionSet::InternalExtensionMergeFrom(
     }
 
     switch (cpp_type(other_extension.type)) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE, REPEATED_TYPE)                    \
-      case WireFormatLite::CPPTYPE_##UPPERCASE:                             \
-        if (is_new) {                                                       \
-          extension->repeated_##LOWERCASE##_value =                         \
-            Arena::CreateMessage<REPEATED_TYPE >(arena_);                   \
-        }                                                                   \
-        extension->repeated_##LOWERCASE##_value->MergeFrom(                 \
-          *other_extension.repeated_##LOWERCASE##_value);                   \
-        break;
-
-      HANDLE_TYPE(  INT32,   int32, RepeatedField   <  int32>);
-      HANDLE_TYPE(  INT64,   int64, RepeatedField   <  int64>);
-      HANDLE_TYPE( UINT32,  uint32, RepeatedField   < uint32>);
-      HANDLE_TYPE( UINT64,  uint64, RepeatedField   < uint64>);
-      HANDLE_TYPE(  FLOAT,   float, RepeatedField   <  float>);
-      HANDLE_TYPE( DOUBLE,  double, RepeatedField   < double>);
-      HANDLE_TYPE(   BOOL,    bool, RepeatedField   <   bool>);
-      HANDLE_TYPE(   ENUM,    enum, RepeatedField   <    int>);
-      HANDLE_TYPE( STRING,  string, RepeatedPtrField< string>);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE, REPEATED_TYPE) \
+  case WireFormatLite::CPPTYPE_##UPPERCASE:              \
+    if (is_new) {                                        \
+      extension->repeated_##LOWERCASE##_value =          \
+          Arena::CreateMessage<REPEATED_TYPE>(arena_);   \
+    }                                                    \
+    extension->repeated_##LOWERCASE##_value->MergeFrom(  \
+        *other_extension.repeated_##LOWERCASE##_value);  \
+    break;
+
+      HANDLE_TYPE(INT32, int32_t, RepeatedField<int32_t>);
+      HANDLE_TYPE(INT64, int64_t, RepeatedField<int64_t>);
+      HANDLE_TYPE(UINT32, uint32_t, RepeatedField<uint32_t>);
+      HANDLE_TYPE(UINT64, uint64_t, RepeatedField<uint64_t>);
+      HANDLE_TYPE(FLOAT, float, RepeatedField<float>);
+      HANDLE_TYPE(DOUBLE, double, RepeatedField<double>);
+      HANDLE_TYPE(BOOL, bool, RepeatedField<bool>);
+      HANDLE_TYPE(ENUM, enum, RepeatedField<int>);
+      HANDLE_TYPE(STRING, string, RepeatedPtrField<std::string>);
 #undef HANDLE_TYPE
 
       case WireFormatLite::CPPTYPE_MESSAGE:
         if (is_new) {
           extension->repeated_message_value =
-              Arena::CreateMessage<RepeatedPtrField<MessageLite> >(arena_);
+              Arena::CreateMessage<RepeatedPtrField<MessageLite>>(arena_);
         }
         // We can't call RepeatedPtrField<MessageLite>::MergeFrom() because
         // it would attempt to allocate new objects.
@@ -925,9 +1038,11 @@ void ExtensionSet::InternalExtensionMergeFrom(
             other_extension.repeated_message_value;
         for (int i = 0; i < other_repeated_message->size(); i++) {
           const MessageLite& other_message = other_repeated_message->Get(i);
-          MessageLite* target = extension->repeated_message_value
-                   ->AddFromCleared<GenericTypeHandler<MessageLite> >();
-          if (target == NULL) {
+          MessageLite* target =
+              reinterpret_cast<internal::RepeatedPtrFieldBase*>(
+                  extension->repeated_message_value)
+                  ->AddFromCleared<GenericTypeHandler<MessageLite>>();
+          if (target == nullptr) {
             target = other_message.New(arena_);
             extension->repeated_message_value->AddAllocated(target);
           }
@@ -938,32 +1053,30 @@ void ExtensionSet::InternalExtensionMergeFrom(
   } else {
     if (!other_extension.is_cleared) {
       switch (cpp_type(other_extension.type)) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE, CAMELCASE)                       \
-        case WireFormatLite::CPPTYPE_##UPPERCASE:                          \
-          Set##CAMELCASE(number, other_extension.type,                     \
-                         other_extension.LOWERCASE##_value,                \
-                         other_extension.descriptor);                      \
-          break;
-
-        HANDLE_TYPE( INT32,  int32,  Int32);
-        HANDLE_TYPE( INT64,  int64,  Int64);
-        HANDLE_TYPE(UINT32, uint32, UInt32);
-        HANDLE_TYPE(UINT64, uint64, UInt64);
-        HANDLE_TYPE( FLOAT,  float,  Float);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE, CAMELCASE)  \
+  case WireFormatLite::CPPTYPE_##UPPERCASE:           \
+    Set##CAMELCASE(number, other_extension.type,      \
+                   other_extension.LOWERCASE##_value, \
+                   other_extension.descriptor);       \
+    break;
+
+        HANDLE_TYPE(INT32, int32_t, Int32);
+        HANDLE_TYPE(INT64, int64_t, Int64);
+        HANDLE_TYPE(UINT32, uint32_t, UInt32);
+        HANDLE_TYPE(UINT64, uint64_t, UInt64);
+        HANDLE_TYPE(FLOAT, float, Float);
         HANDLE_TYPE(DOUBLE, double, Double);
-        HANDLE_TYPE(  BOOL,   bool,   Bool);
-        HANDLE_TYPE(  ENUM,   enum,   Enum);
+        HANDLE_TYPE(BOOL, bool, Bool);
+        HANDLE_TYPE(ENUM, enum, Enum);
 #undef HANDLE_TYPE
         case WireFormatLite::CPPTYPE_STRING:
-          SetString(number, other_extension.type,
-                    *other_extension.string_value,
+          SetString(number, other_extension.type, *other_extension.string_value,
                     other_extension.descriptor);
           break;
         case WireFormatLite::CPPTYPE_MESSAGE: {
           Extension* extension;
-          bool is_new = MaybeNewExtension(number,
-                                          other_extension.descriptor,
-                                          &extension);
+          bool is_new =
+              MaybeNewExtension(number, other_extension.descriptor, &extension);
           if (is_new) {
             extension->type = other_extension.type;
             extension->is_packed = other_extension.is_packed;
@@ -973,7 +1086,8 @@ void ExtensionSet::InternalExtensionMergeFrom(
               extension->lazymessage_value =
                   other_extension.lazymessage_value->New(arena_);
               extension->lazymessage_value->MergeFrom(
-                  *other_extension.lazymessage_value);
+                  GetPrototypeForLazyMessage(extendee, number),
+                  *other_extension.lazymessage_value, arena_);
             } else {
               extension->is_lazy = false;
               extension->message_value =
@@ -983,22 +1097,23 @@ void ExtensionSet::InternalExtensionMergeFrom(
             }
           } else {
             GOOGLE_DCHECK_EQ(extension->type, other_extension.type);
-            GOOGLE_DCHECK_EQ(extension->is_packed,other_extension.is_packed);
+            GOOGLE_DCHECK_EQ(extension->is_packed, other_extension.is_packed);
             GOOGLE_DCHECK(!extension->is_repeated);
             if (other_extension.is_lazy) {
               if (extension->is_lazy) {
                 extension->lazymessage_value->MergeFrom(
-                    *other_extension.lazymessage_value);
+                    GetPrototypeForLazyMessage(extendee, number),
+                    *other_extension.lazymessage_value, arena_);
               } else {
                 extension->message_value->CheckTypeAndMergeFrom(
                     other_extension.lazymessage_value->GetMessage(
-                        *extension->message_value));
+                        *extension->message_value, other_arena));
               }
             } else {
               if (extension->is_lazy) {
-                extension->lazymessage_value->MutableMessage(
-                    *other_extension.message_value)->CheckTypeAndMergeFrom(
-                        *other_extension.message_value);
+                extension->lazymessage_value
+                    ->MutableMessage(*other_extension.message_value, arena_)
+                    ->CheckTypeAndMergeFrom(*other_extension.message_value);
               } else {
                 extension->message_value->CheckTypeAndMergeFrom(
                     *other_extension.message_value);
@@ -1013,107 +1128,117 @@ void ExtensionSet::InternalExtensionMergeFrom(
   }
 }
 
-void ExtensionSet::Swap(ExtensionSet* x) {
-  if (GetArenaNoVirtual() == x->GetArenaNoVirtual()) {
-    extensions_.swap(x->extensions_);
+void ExtensionSet::Swap(const MessageLite* extendee, ExtensionSet* other) {
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+  if (GetArena() != nullptr && GetArena() == other->GetArena()) {
+#else   // PROTOBUF_FORCE_COPY_IN_SWAP
+  if (GetArena() == other->GetArena()) {
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+    InternalSwap(other);
   } else {
     // TODO(cfallin, rohananil): We maybe able to optimize a case where we are
     // swapping from heap to arena-allocated extension set, by just Own()'ing
     // the extensions.
     ExtensionSet extension_set;
-    extension_set.MergeFrom(*x);
-    x->Clear();
-    x->MergeFrom(*this);
+    extension_set.MergeFrom(extendee, *other);
+    other->Clear();
+    other->MergeFrom(extendee, *this);
     Clear();
-    MergeFrom(extension_set);
+    MergeFrom(extendee, extension_set);
   }
 }
 
-void ExtensionSet::SwapExtension(ExtensionSet* other,
-                                 int number) {
+void ExtensionSet::InternalSwap(ExtensionSet* other) {
+  using std::swap;
+  swap(arena_, other->arena_);
+  swap(flat_capacity_, other->flat_capacity_);
+  swap(flat_size_, other->flat_size_);
+  swap(map_, other->map_);
+}
+
+void ExtensionSet::SwapExtension(const MessageLite* extendee,
+                                 ExtensionSet* other, int number) {
   if (this == other) return;
-  ExtensionMap::iterator this_iter = extensions_.find(number);
-  ExtensionMap::iterator other_iter = other->extensions_.find(number);
 
-  if (this_iter == extensions_.end() &&
-      other_iter == other->extensions_.end()) {
+  if (GetArena() == other->GetArena()) {
+    UnsafeShallowSwapExtension(other, number);
     return;
   }
 
-  if (this_iter != extensions_.end() &&
-      other_iter != other->extensions_.end()) {
-    if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-      using std::swap;
-      swap(this_iter->second, other_iter->second);
-    } else {
-      // TODO(cfallin, rohananil): We could further optimize these cases,
-      // especially avoid creation of ExtensionSet, and move MergeFrom logic
-      // into Extensions itself (which takes arena as an argument).
-      // We do it this way to reuse the copy-across-arenas logic already
-      // implemented in ExtensionSet's MergeFrom.
-      ExtensionSet temp;
-      temp.InternalExtensionMergeFrom(number, other_iter->second);
-      ExtensionMap::iterator temp_iter = temp.extensions_.find(number);
-      other_iter->second.Clear();
-      other->InternalExtensionMergeFrom(number, this_iter->second);
-      this_iter->second.Clear();
-      InternalExtensionMergeFrom(number, temp_iter->second);
-    }
-    return;
+  Extension* this_ext = FindOrNull(number);
+  Extension* other_ext = other->FindOrNull(number);
+
+  if (this_ext == other_ext) return;
+
+  if (this_ext != nullptr && other_ext != nullptr) {
+    // TODO(cfallin, rohananil): We could further optimize these cases,
+    // especially avoid creation of ExtensionSet, and move MergeFrom logic
+    // into Extensions itself (which takes arena as an argument).
+    // We do it this way to reuse the copy-across-arenas logic already
+    // implemented in ExtensionSet's MergeFrom.
+    ExtensionSet temp;
+    temp.InternalExtensionMergeFrom(extendee, number, *other_ext,
+                                    other->GetArena());
+    Extension* temp_ext = temp.FindOrNull(number);
+
+    other_ext->Clear();
+    other->InternalExtensionMergeFrom(extendee, number, *this_ext,
+                                      this->GetArena());
+    this_ext->Clear();
+    InternalExtensionMergeFrom(extendee, number, *temp_ext, temp.GetArena());
+  } else if (this_ext == nullptr) {
+    InternalExtensionMergeFrom(extendee, number, *other_ext, other->GetArena());
+    if (other->GetArena() == nullptr) other_ext->Free();
+    other->Erase(number);
+  } else {
+    other->InternalExtensionMergeFrom(extendee, number, *this_ext,
+                                      this->GetArena());
+    if (GetArena() == nullptr) this_ext->Free();
+    Erase(number);
   }
+}
 
-  if (this_iter == extensions_.end()) {
-    if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-      extensions_.insert(std::make_pair(number, other_iter->second));
-    } else {
-      InternalExtensionMergeFrom(number, other_iter->second);
-    }
-    other->extensions_.erase(number);
-    return;
-  }
+void ExtensionSet::UnsafeShallowSwapExtension(ExtensionSet* other, int number) {
+  if (this == other) return;
 
-  if (other_iter == other->extensions_.end()) {
-    if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-      other->extensions_.insert(std::make_pair(number, this_iter->second));
-    } else {
-      other->InternalExtensionMergeFrom(number, this_iter->second);
-    }
-    extensions_.erase(number);
-    return;
+  Extension* this_ext = FindOrNull(number);
+  Extension* other_ext = other->FindOrNull(number);
+
+  if (this_ext == other_ext) return;
+
+  GOOGLE_DCHECK_EQ(GetArena(), other->GetArena());
+
+  if (this_ext != nullptr && other_ext != nullptr) {
+    std::swap(*this_ext, *other_ext);
+  } else if (this_ext == nullptr) {
+    *Insert(number).first = *other_ext;
+    other->Erase(number);
+  } else {
+    *other->Insert(number).first = *this_ext;
+    Erase(number);
   }
 }
 
 bool ExtensionSet::IsInitialized() const {
   // Extensions are never required.  However, we need to check that all
   // embedded messages are initialized.
-  for (ExtensionMap::const_iterator iter = extensions_.begin();
-       iter != extensions_.end(); ++iter) {
-    const Extension& extension = iter->second;
-    if (cpp_type(extension.type) == WireFormatLite::CPPTYPE_MESSAGE) {
-      if (extension.is_repeated) {
-        for (int i = 0; i < extension.repeated_message_value->size(); i++) {
-          if (!extension.repeated_message_value->Get(i).IsInitialized()) {
-            return false;
-          }
-        }
-      } else {
-        if (!extension.is_cleared) {
-          if (extension.is_lazy) {
-            if (!extension.lazymessage_value->IsInitialized()) return false;
-          } else {
-            if (!extension.message_value->IsInitialized()) return false;
-          }
-        }
-      }
+  if (PROTOBUF_PREDICT_FALSE(is_large())) {
+    for (const auto& kv : *map_.large) {
+      if (!kv.second.IsInitialized()) return false;
     }
+    return true;
+  }
+  for (const KeyValue* it = flat_begin(); it != flat_end(); ++it) {
+    if (!it->second.IsInitialized()) return false;
   }
-
   return true;
 }
 
-bool ExtensionSet::FindExtensionInfoFromTag(
-    uint32 tag, ExtensionFinder* extension_finder, int* field_number,
-    ExtensionInfo* extension, bool* was_packed_on_wire) {
+bool ExtensionSet::FindExtensionInfoFromTag(uint32_t tag,
+                                            ExtensionFinder* extension_finder,
+                                            int* field_number,
+                                            ExtensionInfo* extension,
+                                            bool* was_packed_on_wire) {
   *field_number = WireFormatLite::GetTagFieldNumber(tag);
   WireFormatLite::WireType wire_type = WireFormatLite::GetTagWireType(tag);
   return FindExtensionInfoFromFieldNumber(wire_type, *field_number,
@@ -1123,7 +1248,7 @@ bool ExtensionSet::FindExtensionInfoFromTag(
 
 bool ExtensionSet::FindExtensionInfoFromFieldNumber(
     int wire_type, int field_number, ExtensionFinder* extension_finder,
-    ExtensionInfo* extension, bool* was_packed_on_wire) {
+    ExtensionInfo* extension, bool* was_packed_on_wire) const {
   if (!extension_finder->Find(field_number, extension)) {
     return false;
   }
@@ -1143,66 +1268,92 @@ bool ExtensionSet::FindExtensionInfoFromFieldNumber(
   return expected_wire_type == wire_type;
 }
 
-bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input,
+bool ExtensionSet::ParseField(uint32_t tag, io::CodedInputStream* input,
                               ExtensionFinder* extension_finder,
                               FieldSkipper* field_skipper) {
   int number;
   bool was_packed_on_wire;
   ExtensionInfo extension;
-  if (!FindExtensionInfoFromTag(
-      tag, extension_finder, &number, &extension, &was_packed_on_wire)) {
+  if (!FindExtensionInfoFromTag(tag, extension_finder, &number, &extension,
+                                &was_packed_on_wire)) {
     return field_skipper->SkipField(input, tag);
   } else {
-    return ParseFieldWithExtensionInfo(
-        number, was_packed_on_wire, extension, input, field_skipper);
+    return ParseFieldWithExtensionInfo(number, was_packed_on_wire, extension,
+                                       input, field_skipper);
+  }
+}
+
+const char* ExtensionSet::ParseField(uint64_t tag, const char* ptr,
+                                     const MessageLite* extendee,
+                                     internal::InternalMetadata* metadata,
+                                     internal::ParseContext* ctx) {
+  GeneratedExtensionFinder finder(extendee);
+  int number = tag >> 3;
+  bool was_packed_on_wire;
+  ExtensionInfo extension;
+  if (!FindExtensionInfoFromFieldNumber(tag & 7, number, &finder, &extension,
+                                        &was_packed_on_wire)) {
+    return UnknownFieldParse(
+        tag, metadata->mutable_unknown_fields<std::string>(), ptr, ctx);
   }
+  return ParseFieldWithExtensionInfo<std::string>(
+      number, was_packed_on_wire, extension, metadata, ptr, ctx);
+}
+
+const char* ExtensionSet::ParseMessageSetItem(
+    const char* ptr, const MessageLite* extendee,
+    internal::InternalMetadata* metadata, internal::ParseContext* ctx) {
+  return ParseMessageSetItemTmpl<MessageLite, std::string>(ptr, extendee,
+                                                           metadata, ctx);
 }
 
-bool ExtensionSet::ParseFieldWithExtensionInfo(
-    int number, bool was_packed_on_wire, const ExtensionInfo& extension,
-    io::CodedInputStream* input,
-    FieldSkipper* field_skipper) {
+bool ExtensionSet::ParseFieldWithExtensionInfo(int number,
+                                               bool was_packed_on_wire,
+                                               const ExtensionInfo& extension,
+                                               io::CodedInputStream* input,
+                                               FieldSkipper* field_skipper) {
   // Explicitly not read extension.is_packed, instead check whether the field
   // was encoded in packed form on the wire.
   if (was_packed_on_wire) {
-    uint32 size;
+    uint32_t size;
     if (!input->ReadVarint32(&size)) return false;
     io::CodedInputStream::Limit limit = input->PushLimit(size);
 
     switch (extension.type) {
-#define HANDLE_TYPE(UPPERCASE, CPP_CAMELCASE, CPP_LOWERCASE)        \
-      case WireFormatLite::TYPE_##UPPERCASE:                                   \
-        while (input->BytesUntilLimit() > 0) {                                 \
-          CPP_LOWERCASE value;                                                 \
-          if (!WireFormatLite::ReadPrimitive<                                  \
-                  CPP_LOWERCASE, WireFormatLite::TYPE_##UPPERCASE>(            \
-                input, &value)) return false;                                  \
-          Add##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE,         \
-                             extension.is_packed, value,                       \
-                             extension.descriptor);                            \
-        }                                                                      \
-        break
-
-      HANDLE_TYPE(   INT32,  Int32,   int32);
-      HANDLE_TYPE(   INT64,  Int64,   int64);
-      HANDLE_TYPE(  UINT32, UInt32,  uint32);
-      HANDLE_TYPE(  UINT64, UInt64,  uint64);
-      HANDLE_TYPE(  SINT32,  Int32,   int32);
-      HANDLE_TYPE(  SINT64,  Int64,   int64);
-      HANDLE_TYPE( FIXED32, UInt32,  uint32);
-      HANDLE_TYPE( FIXED64, UInt64,  uint64);
-      HANDLE_TYPE(SFIXED32,  Int32,   int32);
-      HANDLE_TYPE(SFIXED64,  Int64,   int64);
-      HANDLE_TYPE(   FLOAT,  Float,   float);
-      HANDLE_TYPE(  DOUBLE, Double,  double);
-      HANDLE_TYPE(    BOOL,   Bool,    bool);
+#define HANDLE_TYPE(UPPERCASE, CPP_CAMELCASE, CPP_LOWERCASE)                \
+  case WireFormatLite::TYPE_##UPPERCASE:                                    \
+    while (input->BytesUntilLimit() > 0) {                                  \
+      CPP_LOWERCASE value;                                                  \
+      if (!WireFormatLite::ReadPrimitive<CPP_LOWERCASE,                     \
+                                         WireFormatLite::TYPE_##UPPERCASE>( \
+              input, &value))                                               \
+        return false;                                                       \
+      Add##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE,          \
+                         extension.is_packed, value, extension.descriptor); \
+                                                                          \
+    break
+
+      HANDLE_TYPE(INT32, Int32, int32_t);
+      HANDLE_TYPE(INT64, Int64, int64_t);
+      HANDLE_TYPE(UINT32, UInt32, uint32_t);
+      HANDLE_TYPE(UINT64, UInt64, uint64_t);
+      HANDLE_TYPE(SINT32, Int32, int32_t);
+      HANDLE_TYPE(SINT64, Int64, int64_t);
+      HANDLE_TYPE(FIXED32, UInt32, uint32_t);
+      HANDLE_TYPE(FIXED64, UInt64, uint64_t);
+      HANDLE_TYPE(SFIXED32, Int32, int32_t);
+      HANDLE_TYPE(SFIXED64, Int64, int64_t);
+      HANDLE_TYPE(FLOAT, Float, float);
+      HANDLE_TYPE(DOUBLE, Double, double);
+      HANDLE_TYPE(BOOL, Bool, bool);
 #undef HANDLE_TYPE
 
       case WireFormatLite::TYPE_ENUM:
         while (input->BytesUntilLimit() > 0) {
           int value;
           if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
-                  input, &value)) return false;
+                  input, &value))
+            return false;
           if (extension.enum_validity_check.func(
                   extension.enum_validity_check.arg, value)) {
             AddEnum(number, WireFormatLite::TYPE_ENUM, extension.is_packed,
@@ -1225,41 +1376,42 @@ bool ExtensionSet::ParseFieldWithExtensionInfo(
     input->PopLimit(limit);
   } else {
     switch (extension.type) {
-#define HANDLE_TYPE(UPPERCASE, CPP_CAMELCASE, CPP_LOWERCASE)                   \
-      case WireFormatLite::TYPE_##UPPERCASE: {                                 \
-        CPP_LOWERCASE value;                                                   \
-        if (!WireFormatLite::ReadPrimitive<                                    \
-                CPP_LOWERCASE, WireFormatLite::TYPE_##UPPERCASE>(              \
-               input, &value)) return false;                                   \
-        if (extension.is_repeated) {                                           \
-          Add##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE,         \
-                             extension.is_packed, value,                       \
-                             extension.descriptor);                            \
-        } else {                                                               \
-          Set##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE, value,  \
-                             extension.descriptor);                            \
-        }                                                                      \
-      } break
-
-      HANDLE_TYPE(   INT32,  Int32,   int32);
-      HANDLE_TYPE(   INT64,  Int64,   int64);
-      HANDLE_TYPE(  UINT32, UInt32,  uint32);
-      HANDLE_TYPE(  UINT64, UInt64,  uint64);
-      HANDLE_TYPE(  SINT32,  Int32,   int32);
-      HANDLE_TYPE(  SINT64,  Int64,   int64);
-      HANDLE_TYPE( FIXED32, UInt32,  uint32);
-      HANDLE_TYPE( FIXED64, UInt64,  uint64);
-      HANDLE_TYPE(SFIXED32,  Int32,   int32);
-      HANDLE_TYPE(SFIXED64,  Int64,   int64);
-      HANDLE_TYPE(   FLOAT,  Float,   float);
-      HANDLE_TYPE(  DOUBLE, Double,  double);
-      HANDLE_TYPE(    BOOL,   Bool,    bool);
+#define HANDLE_TYPE(UPPERCASE, CPP_CAMELCASE, CPP_LOWERCASE)                \
+  case WireFormatLite::TYPE_##UPPERCASE: {                                  \
+    CPP_LOWERCASE value;                                                    \
+    if (!WireFormatLite::ReadPrimitive<CPP_LOWERCASE,                       \
+                                       WireFormatLite::TYPE_##UPPERCASE>(   \
+            input, &value))                                                 \
+      return false;                                                         \
+    if (extension.is_repeated) {                                            \
+      Add##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE,          \
+                         extension.is_packed, value, extension.descriptor); \
+    } else {                                                                \
+      Set##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE, value,   \
+                         extension.descriptor);                             \
+                                                                          \
+  } break
+
+      HANDLE_TYPE(INT32, Int32, int32_t);
+      HANDLE_TYPE(INT64, Int64, int64_t);
+      HANDLE_TYPE(UINT32, UInt32, uint32_t);
+      HANDLE_TYPE(UINT64, UInt64, uint64_t);
+      HANDLE_TYPE(SINT32, Int32, int32_t);
+      HANDLE_TYPE(SINT64, Int64, int64_t);
+      HANDLE_TYPE(FIXED32, UInt32, uint32_t);
+      HANDLE_TYPE(FIXED64, UInt64, uint64_t);
+      HANDLE_TYPE(SFIXED32, Int32, int32_t);
+      HANDLE_TYPE(SFIXED64, Int64, int64_t);
+      HANDLE_TYPE(FLOAT, Float, float);
+      HANDLE_TYPE(DOUBLE, Double, double);
+      HANDLE_TYPE(BOOL, Bool, bool);
 #undef HANDLE_TYPE
 
       case WireFormatLite::TYPE_ENUM: {
         int value;
         if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
-                input, &value)) return false;
+                input, &value))
+          return false;
 
         if (!extension.enum_validity_check.func(
                 extension.enum_validity_check.arg, value)) {
@@ -1275,40 +1427,50 @@ bool ExtensionSet::ParseFieldWithExtensionInfo(
         break;
       }
 
-      case WireFormatLite::TYPE_STRING:  {
-        string* value = extension.is_repeated ?
-          AddString(number, WireFormatLite::TYPE_STRING, extension.descriptor) :
-          MutableString(number, WireFormatLite::TYPE_STRING,
-                        extension.descriptor);
+      case WireFormatLite::TYPE_STRING: {
+        std::string* value =
+            extension.is_repeated
+                ? AddString(number, WireFormatLite::TYPE_STRING,
+                            extension.descriptor)
+                : MutableString(number, WireFormatLite::TYPE_STRING,
+                                extension.descriptor);
         if (!WireFormatLite::ReadString(input, value)) return false;
         break;
       }
 
-      case WireFormatLite::TYPE_BYTES:  {
-        string* value = extension.is_repeated ?
-          AddString(number, WireFormatLite::TYPE_BYTES, extension.descriptor) :
-          MutableString(number, WireFormatLite::TYPE_BYTES,
-                        extension.descriptor);
+      case WireFormatLite::TYPE_BYTES: {
+        std::string* value =
+            extension.is_repeated
+                ? AddString(number, WireFormatLite::TYPE_BYTES,
+                            extension.descriptor)
+                : MutableString(number, WireFormatLite::TYPE_BYTES,
+                                extension.descriptor);
         if (!WireFormatLite::ReadBytes(input, value)) return false;
         break;
       }
 
       case WireFormatLite::TYPE_GROUP: {
-        MessageLite* value = extension.is_repeated ?
-            AddMessage(number, WireFormatLite::TYPE_GROUP,
-                       *extension.message_prototype, extension.descriptor) :
-            MutableMessage(number, WireFormatLite::TYPE_GROUP,
-                           *extension.message_prototype, extension.descriptor);
+        MessageLite* value =
+            extension.is_repeated
+                ? AddMessage(number, WireFormatLite::TYPE_GROUP,
+                             *extension.message_info.prototype,
+                             extension.descriptor)
+                : MutableMessage(number, WireFormatLite::TYPE_GROUP,
+                                 *extension.message_info.prototype,
+                                 extension.descriptor);
         if (!WireFormatLite::ReadGroup(number, input, value)) return false;
         break;
       }
 
       case WireFormatLite::TYPE_MESSAGE: {
-        MessageLite* value = extension.is_repeated ?
-            AddMessage(number, WireFormatLite::TYPE_MESSAGE,
-                       *extension.message_prototype, extension.descriptor) :
-            MutableMessage(number, WireFormatLite::TYPE_MESSAGE,
-                           *extension.message_prototype, extension.descriptor);
+        MessageLite* value =
+            extension.is_repeated
+                ? AddMessage(number, WireFormatLite::TYPE_MESSAGE,
+                             *extension.message_info.prototype,
+                             extension.descriptor)
+                : MutableMessage(number, WireFormatLite::TYPE_MESSAGE,
+                                 *extension.message_info.prototype,
+                                 extension.descriptor);
         if (!WireFormatLite::ReadMessage(input, value)) return false;
         break;
       }
@@ -1318,50 +1480,115 @@ bool ExtensionSet::ParseFieldWithExtensionInfo(
   return true;
 }
 
-bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input,
-                              const MessageLite* containing_type) {
+bool ExtensionSet::ParseField(uint32_t tag, io::CodedInputStream* input,
+                              const MessageLite* extendee) {
   FieldSkipper skipper;
-  GeneratedExtensionFinder finder(containing_type);
+  GeneratedExtensionFinder finder(extendee);
   return ParseField(tag, input, &finder, &skipper);
 }
 
-bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input,
-                              const MessageLite* containing_type,
+bool ExtensionSet::ParseField(uint32_t tag, io::CodedInputStream* input,
+                              const MessageLite* extendee,
                               io::CodedOutputStream* unknown_fields) {
   CodedOutputStreamFieldSkipper skipper(unknown_fields);
-  GeneratedExtensionFinder finder(containing_type);
+  GeneratedExtensionFinder finder(extendee);
   return ParseField(tag, input, &finder, &skipper);
 }
 
-// Defined in extension_set_heavy.cc.
-// bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input,
-//                               const MessageLite* containing_type,
-//                               UnknownFieldSet* unknown_fields)
+bool ExtensionSet::ParseMessageSetLite(io::CodedInputStream* input,
+                                       ExtensionFinder* extension_finder,
+                                       FieldSkipper* field_skipper) {
+  while (true) {
+    const uint32_t tag = input->ReadTag();
+    switch (tag) {
+      case 0:
+        return true;
+      case WireFormatLite::kMessageSetItemStartTag:
+        if (!ParseMessageSetItemLite(input, extension_finder, field_skipper)) {
+          return false;
+        }
+        break;
+      default:
+        if (!ParseField(tag, input, extension_finder, field_skipper)) {
+          return false;
+        }
+        break;
+    }
+  }
+}
 
-// Defined in extension_set_heavy.cc.
-// bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input,
-//                                    const MessageLite* containing_type,
-//                                    UnknownFieldSet* unknown_fields);
+bool ExtensionSet::ParseMessageSetItemLite(io::CodedInputStream* input,
+                                           ExtensionFinder* extension_finder,
+                                           FieldSkipper* field_skipper) {
+  struct MSLite {
+    bool ParseField(int type_id, io::CodedInputStream* input) {
+      return me->ParseField(
+          WireFormatLite::WIRETYPE_LENGTH_DELIMITED + 8 * type_id, input,
+          extension_finder, field_skipper);
+    }
 
-void ExtensionSet::SerializeWithCachedSizes(
-    int start_field_number, int end_field_number,
-    io::CodedOutputStream* output) const {
-  ExtensionMap::const_iterator iter;
-  for (iter = extensions_.lower_bound(start_field_number);
-       iter != extensions_.end() && iter->first < end_field_number;
-       ++iter) {
-    iter->second.SerializeFieldWithCachedSizes(iter->first, output);
+    bool SkipField(uint32_t tag, io::CodedInputStream* input) {
+      return field_skipper->SkipField(input, tag);
+    }
+
+    ExtensionSet* me;
+    ExtensionFinder* extension_finder;
+    FieldSkipper* field_skipper;
+  };
+
+  return ParseMessageSetItemImpl(input,
+                                 MSLite{this, extension_finder, field_skipper});
+}
+
+bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input,
+                                   const MessageLite* extendee,
+                                   std::string* unknown_fields) {
+  io::StringOutputStream zcis(unknown_fields);
+  io::CodedOutputStream output(&zcis);
+  CodedOutputStreamFieldSkipper skipper(&output);
+  GeneratedExtensionFinder finder(extendee);
+  return ParseMessageSetLite(input, &finder, &skipper);
+}
+
+uint8_t* ExtensionSet::_InternalSerializeImpl(
+    const MessageLite* extendee, int start_field_number, int end_field_number,
+    uint8_t* target, io::EpsCopyOutputStream* stream) const {
+  if (PROTOBUF_PREDICT_FALSE(is_large())) {
+    const auto& end = map_.large->end();
+    for (auto it = map_.large->lower_bound(start_field_number);
+         it != end && it->first < end_field_number; ++it) {
+      target = it->second.InternalSerializeFieldWithCachedSizesToArray(
+          extendee, this, it->first, target, stream);
+    }
+    return target;
+  }
+  const KeyValue* end = flat_end();
+  for (const KeyValue* it = std::lower_bound(
+           flat_begin(), end, start_field_number, KeyValue::FirstComparator());
+       it != end && it->first < end_field_number; ++it) {
+    target = it->second.InternalSerializeFieldWithCachedSizesToArray(
+        extendee, this, it->first, target, stream);
   }
+  return target;
+}
+
+uint8_t* ExtensionSet::InternalSerializeMessageSetWithCachedSizesToArray(
+    const MessageLite* extendee, uint8_t* target,
+    io::EpsCopyOutputStream* stream) const {
+  const ExtensionSet* extension_set = this;
+  ForEach([&target, extendee, stream, extension_set](int number,
+                                                     const Extension& ext) {
+    target = ext.InternalSerializeMessageSetItemWithCachedSizesToArray(
+        extendee, extension_set, number, target, stream);
+  });
+  return target;
 }
 
 size_t ExtensionSet::ByteSize() const {
   size_t total_size = 0;
-
-  for (ExtensionMap::const_iterator iter = extensions_.begin();
-       iter != extensions_.end(); ++iter) {
-    total_size += iter->second.ByteSize(iter->first);
-  }
-
+  ForEach([&total_size](int number, const Extension& ext) {
+    total_size += ext.ByteSize(number);
+  });
   return total_size;
 }
 
@@ -1371,11 +1598,10 @@ size_t ExtensionSet::ByteSize() const {
 bool ExtensionSet::MaybeNewExtension(int number,
                                      const FieldDescriptor* descriptor,
                                      Extension** result) {
-  std::pair<ExtensionMap::iterator, bool> insert_result =
-      extensions_.insert(std::make_pair(number, Extension()));
-  *result = &insert_result.first->second;
+  bool extension_is_new = false;
+  std::tie(*result, extension_is_new) = Insert(number);
   (*result)->descriptor = descriptor;
-  return insert_result.second;
+  return extension_is_new;
 }
 
 // ===================================================================
@@ -1384,20 +1610,20 @@ bool ExtensionSet::MaybeNewExtension(int number,
 void ExtensionSet::Extension::Clear() {
   if (is_repeated) {
     switch (cpp_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                          \
-      case WireFormatLite::CPPTYPE_##UPPERCASE:                    \
-        repeated_##LOWERCASE##_value->Clear();                     \
-        break
-
-      HANDLE_TYPE(  INT32,   int32);
-      HANDLE_TYPE(  INT64,   int64);
-      HANDLE_TYPE( UINT32,  uint32);
-      HANDLE_TYPE( UINT64,  uint64);
-      HANDLE_TYPE(  FLOAT,   float);
-      HANDLE_TYPE( DOUBLE,  double);
-      HANDLE_TYPE(   BOOL,    bool);
-      HANDLE_TYPE(   ENUM,    enum);
-      HANDLE_TYPE( STRING,  string);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)   \
+  case WireFormatLite::CPPTYPE_##UPPERCASE: \
+    repeated_##LOWERCASE##_value->Clear();  \
+    break
+
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
+      HANDLE_TYPE(FLOAT, float);
+      HANDLE_TYPE(DOUBLE, double);
+      HANDLE_TYPE(BOOL, bool);
+      HANDLE_TYPE(ENUM, enum);
+      HANDLE_TYPE(STRING, string);
       HANDLE_TYPE(MESSAGE, message);
 #undef HANDLE_TYPE
     }
@@ -1426,152 +1652,42 @@ void ExtensionSet::Extension::Clear() {
   }
 }
 
-void ExtensionSet::Extension::SerializeFieldWithCachedSizes(
-    int number,
-    io::CodedOutputStream* output) const {
-  if (is_repeated) {
-    if (is_packed) {
-      if (cached_size == 0) return;
-
-      WireFormatLite::WriteTag(number,
-          WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-      output->WriteVarint32(cached_size);
-
-      switch (real_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case WireFormatLite::TYPE_##UPPERCASE:                              \
-          for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {  \
-            WireFormatLite::Write##CAMELCASE##NoTag(                        \
-              repeated_##LOWERCASE##_value->Get(i), output);                \
-          }                                                                 \
-          break
-
-        HANDLE_TYPE(   INT32,    Int32,   int32);
-        HANDLE_TYPE(   INT64,    Int64,   int64);
-        HANDLE_TYPE(  UINT32,   UInt32,  uint32);
-        HANDLE_TYPE(  UINT64,   UInt64,  uint64);
-        HANDLE_TYPE(  SINT32,   SInt32,   int32);
-        HANDLE_TYPE(  SINT64,   SInt64,   int64);
-        HANDLE_TYPE( FIXED32,  Fixed32,  uint32);
-        HANDLE_TYPE( FIXED64,  Fixed64,  uint64);
-        HANDLE_TYPE(SFIXED32, SFixed32,   int32);
-        HANDLE_TYPE(SFIXED64, SFixed64,   int64);
-        HANDLE_TYPE(   FLOAT,    Float,   float);
-        HANDLE_TYPE(  DOUBLE,   Double,  double);
-        HANDLE_TYPE(    BOOL,     Bool,    bool);
-        HANDLE_TYPE(    ENUM,     Enum,    enum);
-#undef HANDLE_TYPE
-
-        case WireFormatLite::TYPE_STRING:
-        case WireFormatLite::TYPE_BYTES:
-        case WireFormatLite::TYPE_GROUP:
-        case WireFormatLite::TYPE_MESSAGE:
-          GOOGLE_LOG(FATAL) << "Non-primitive types can't be packed.";
-          break;
-      }
-    } else {
-      switch (real_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case WireFormatLite::TYPE_##UPPERCASE:                              \
-          for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {  \
-            WireFormatLite::Write##CAMELCASE(number,                        \
-              repeated_##LOWERCASE##_value->Get(i), output);                \
-          }                                                                 \
-          break
-
-        HANDLE_TYPE(   INT32,    Int32,   int32);
-        HANDLE_TYPE(   INT64,    Int64,   int64);
-        HANDLE_TYPE(  UINT32,   UInt32,  uint32);
-        HANDLE_TYPE(  UINT64,   UInt64,  uint64);
-        HANDLE_TYPE(  SINT32,   SInt32,   int32);
-        HANDLE_TYPE(  SINT64,   SInt64,   int64);
-        HANDLE_TYPE( FIXED32,  Fixed32,  uint32);
-        HANDLE_TYPE( FIXED64,  Fixed64,  uint64);
-        HANDLE_TYPE(SFIXED32, SFixed32,   int32);
-        HANDLE_TYPE(SFIXED64, SFixed64,   int64);
-        HANDLE_TYPE(   FLOAT,    Float,   float);
-        HANDLE_TYPE(  DOUBLE,   Double,  double);
-        HANDLE_TYPE(    BOOL,     Bool,    bool);
-        HANDLE_TYPE(  STRING,   String,  string);
-        HANDLE_TYPE(   BYTES,    Bytes,  string);
-        HANDLE_TYPE(    ENUM,     Enum,    enum);
-        HANDLE_TYPE(   GROUP,    Group, message);
-        HANDLE_TYPE( MESSAGE,  Message, message);
-#undef HANDLE_TYPE
-      }
-    }
-  } else if (!is_cleared) {
-    switch (real_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, VALUE)                 \
-      case WireFormatLite::TYPE_##UPPERCASE:                     \
-        WireFormatLite::Write##CAMELCASE(number, VALUE, output); \
-        break
-
-      HANDLE_TYPE(   INT32,    Int32,    int32_value);
-      HANDLE_TYPE(   INT64,    Int64,    int64_value);
-      HANDLE_TYPE(  UINT32,   UInt32,   uint32_value);
-      HANDLE_TYPE(  UINT64,   UInt64,   uint64_value);
-      HANDLE_TYPE(  SINT32,   SInt32,    int32_value);
-      HANDLE_TYPE(  SINT64,   SInt64,    int64_value);
-      HANDLE_TYPE( FIXED32,  Fixed32,   uint32_value);
-      HANDLE_TYPE( FIXED64,  Fixed64,   uint64_value);
-      HANDLE_TYPE(SFIXED32, SFixed32,    int32_value);
-      HANDLE_TYPE(SFIXED64, SFixed64,    int64_value);
-      HANDLE_TYPE(   FLOAT,    Float,    float_value);
-      HANDLE_TYPE(  DOUBLE,   Double,   double_value);
-      HANDLE_TYPE(    BOOL,     Bool,     bool_value);
-      HANDLE_TYPE(  STRING,   String,  *string_value);
-      HANDLE_TYPE(   BYTES,    Bytes,  *string_value);
-      HANDLE_TYPE(    ENUM,     Enum,     enum_value);
-      HANDLE_TYPE(   GROUP,    Group, *message_value);
-#undef HANDLE_TYPE
-      case WireFormatLite::TYPE_MESSAGE:
-        if (is_lazy) {
-          lazymessage_value->WriteMessage(number, output);
-        } else {
-          WireFormatLite::WriteMessage(number, *message_value, output);
-        }
-        break;
-    }
-  }
-}
-
 size_t ExtensionSet::Extension::ByteSize(int number) const {
   size_t result = 0;
 
   if (is_repeated) {
     if (is_packed) {
       switch (real_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case WireFormatLite::TYPE_##UPPERCASE:                              \
-          for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {  \
-            result += WireFormatLite::CAMELCASE##Size(                      \
-              repeated_##LOWERCASE##_value->Get(i));                        \
-          }                                                                 \
-          break
-
-        HANDLE_TYPE(   INT32,    Int32,   int32);
-        HANDLE_TYPE(   INT64,    Int64,   int64);
-        HANDLE_TYPE(  UINT32,   UInt32,  uint32);
-        HANDLE_TYPE(  UINT64,   UInt64,  uint64);
-        HANDLE_TYPE(  SINT32,   SInt32,   int32);
-        HANDLE_TYPE(  SINT64,   SInt64,   int64);
-        HANDLE_TYPE(    ENUM,     Enum,    enum);
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                 \
+  case WireFormatLite::TYPE_##UPPERCASE:                             \
+    for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) { \
+      result += WireFormatLite::CAMELCASE##Size(                     \
+          repeated_##LOWERCASE##_value->Get(i));                     \
+    }                                                                \
+    break
+
+        HANDLE_TYPE(INT32, Int32, int32_t);
+        HANDLE_TYPE(INT64, Int64, int64_t);
+        HANDLE_TYPE(UINT32, UInt32, uint32_t);
+        HANDLE_TYPE(UINT64, UInt64, uint64_t);
+        HANDLE_TYPE(SINT32, SInt32, int32_t);
+        HANDLE_TYPE(SINT64, SInt64, int64_t);
+        HANDLE_TYPE(ENUM, Enum, enum);
 #undef HANDLE_TYPE
 
         // Stuff with fixed size.
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case WireFormatLite::TYPE_##UPPERCASE:                              \
-          result += WireFormatLite::k##CAMELCASE##Size *                    \
-                    FromIntSize(repeated_##LOWERCASE##_value->size());      \
-          break
-        HANDLE_TYPE( FIXED32,  Fixed32, uint32);
-        HANDLE_TYPE( FIXED64,  Fixed64, uint64);
-        HANDLE_TYPE(SFIXED32, SFixed32,  int32);
-        HANDLE_TYPE(SFIXED64, SFixed64,  int64);
-        HANDLE_TYPE(   FLOAT,    Float,  float);
-        HANDLE_TYPE(  DOUBLE,   Double, double);
-        HANDLE_TYPE(    BOOL,     Bool,   bool);
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)             \
+  case WireFormatLite::TYPE_##UPPERCASE:                         \
+    result += WireFormatLite::k##CAMELCASE##Size *               \
+              FromIntSize(repeated_##LOWERCASE##_value->size()); \
+    break
+        HANDLE_TYPE(FIXED32, Fixed32, uint32_t);
+        HANDLE_TYPE(FIXED64, Fixed64, uint64_t);
+        HANDLE_TYPE(SFIXED32, SFixed32, int32_t);
+        HANDLE_TYPE(SFIXED64, SFixed64, int64_t);
+        HANDLE_TYPE(FLOAT, Float, float);
+        HANDLE_TYPE(DOUBLE, Double, double);
+        HANDLE_TYPE(BOOL, Bool, bool);
 #undef HANDLE_TYPE
 
         case WireFormatLite::TYPE_STRING:
@@ -1585,75 +1701,73 @@ size_t ExtensionSet::Extension::ByteSize(int number) const {
       cached_size = ToCachedSize(result);
       if (result > 0) {
         result += io::CodedOutputStream::VarintSize32(result);
-        result += io::CodedOutputStream::VarintSize32(
-            WireFormatLite::MakeTag(number,
-                WireFormatLite::WIRETYPE_LENGTH_DELIMITED));
+        result += io::CodedOutputStream::VarintSize32(WireFormatLite::MakeTag(
+            number, WireFormatLite::WIRETYPE_LENGTH_DELIMITED));
       }
     } else {
       size_t tag_size = WireFormatLite::TagSize(number, real_type(type));
 
       switch (real_type(type)) {
 #define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case WireFormatLite::TYPE_##UPPERCASE:                              \
-          result += tag_size *                                              \
-                    FromIntSize(repeated_##LOWERCASE##_value->size());      \
-          for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {  \
-            result += WireFormatLite::CAMELCASE##Size(                      \
-              repeated_##LOWERCASE##_value->Get(i));                        \
-          }                                                                 \
-          break
-
-        HANDLE_TYPE(   INT32,    Int32,   int32);
-        HANDLE_TYPE(   INT64,    Int64,   int64);
-        HANDLE_TYPE(  UINT32,   UInt32,  uint32);
-        HANDLE_TYPE(  UINT64,   UInt64,  uint64);
-        HANDLE_TYPE(  SINT32,   SInt32,   int32);
-        HANDLE_TYPE(  SINT64,   SInt64,   int64);
-        HANDLE_TYPE(  STRING,   String,  string);
-        HANDLE_TYPE(   BYTES,    Bytes,  string);
-        HANDLE_TYPE(    ENUM,     Enum,    enum);
-        HANDLE_TYPE(   GROUP,    Group, message);
-        HANDLE_TYPE( MESSAGE,  Message, message);
+  case WireFormatLite::TYPE_##UPPERCASE:                                    \
+    result += tag_size * FromIntSize(repeated_##LOWERCASE##_value->size()); \
+    for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {        \
+      result += WireFormatLite::CAMELCASE##Size(                            \
+          repeated_##LOWERCASE##_value->Get(i));                            \
+    }                                                                       \
+    break
+
+        HANDLE_TYPE(INT32, Int32, int32_t);
+        HANDLE_TYPE(INT64, Int64, int64_t);
+        HANDLE_TYPE(UINT32, UInt32, uint32_t);
+        HANDLE_TYPE(UINT64, UInt64, uint64_t);
+        HANDLE_TYPE(SINT32, SInt32, int32_t);
+        HANDLE_TYPE(SINT64, SInt64, int64_t);
+        HANDLE_TYPE(STRING, String, string);
+        HANDLE_TYPE(BYTES, Bytes, string);
+        HANDLE_TYPE(ENUM, Enum, enum);
+        HANDLE_TYPE(GROUP, Group, message);
+        HANDLE_TYPE(MESSAGE, Message, message);
 #undef HANDLE_TYPE
 
         // Stuff with fixed size.
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case WireFormatLite::TYPE_##UPPERCASE:                              \
-          result += (tag_size + WireFormatLite::k##CAMELCASE##Size) *       \
-                    FromIntSize(repeated_##LOWERCASE##_value->size());      \
-          break
-        HANDLE_TYPE( FIXED32,  Fixed32, uint32);
-        HANDLE_TYPE( FIXED64,  Fixed64, uint64);
-        HANDLE_TYPE(SFIXED32, SFixed32,  int32);
-        HANDLE_TYPE(SFIXED64, SFixed64,  int64);
-        HANDLE_TYPE(   FLOAT,    Float,  float);
-        HANDLE_TYPE(  DOUBLE,   Double, double);
-        HANDLE_TYPE(    BOOL,     Bool,   bool);
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)             \
+  case WireFormatLite::TYPE_##UPPERCASE:                         \
+    result += (tag_size + WireFormatLite::k##CAMELCASE##Size) *  \
+              FromIntSize(repeated_##LOWERCASE##_value->size()); \
+    break
+        HANDLE_TYPE(FIXED32, Fixed32, uint32_t);
+        HANDLE_TYPE(FIXED64, Fixed64, uint64_t);
+        HANDLE_TYPE(SFIXED32, SFixed32, int32_t);
+        HANDLE_TYPE(SFIXED64, SFixed64, int64_t);
+        HANDLE_TYPE(FLOAT, Float, float);
+        HANDLE_TYPE(DOUBLE, Double, double);
+        HANDLE_TYPE(BOOL, Bool, bool);
 #undef HANDLE_TYPE
       }
     }
   } else if (!is_cleared) {
     result += WireFormatLite::TagSize(number, real_type(type));
     switch (real_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                      \
-      case WireFormatLite::TYPE_##UPPERCASE:                              \
-        result += WireFormatLite::CAMELCASE##Size(LOWERCASE);             \
-        break
-
-      HANDLE_TYPE(   INT32,    Int32,    int32_value);
-      HANDLE_TYPE(   INT64,    Int64,    int64_value);
-      HANDLE_TYPE(  UINT32,   UInt32,   uint32_value);
-      HANDLE_TYPE(  UINT64,   UInt64,   uint64_value);
-      HANDLE_TYPE(  SINT32,   SInt32,    int32_value);
-      HANDLE_TYPE(  SINT64,   SInt64,    int64_value);
-      HANDLE_TYPE(  STRING,   String,  *string_value);
-      HANDLE_TYPE(   BYTES,    Bytes,  *string_value);
-      HANDLE_TYPE(    ENUM,     Enum,     enum_value);
-      HANDLE_TYPE(   GROUP,    Group, *message_value);
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)      \
+  case WireFormatLite::TYPE_##UPPERCASE:                  \
+    result += WireFormatLite::CAMELCASE##Size(LOWERCASE); \
+    break
+
+      HANDLE_TYPE(INT32, Int32, int32_t_value);
+      HANDLE_TYPE(INT64, Int64, int64_t_value);
+      HANDLE_TYPE(UINT32, UInt32, uint32_t_value);
+      HANDLE_TYPE(UINT64, UInt64, uint64_t_value);
+      HANDLE_TYPE(SINT32, SInt32, int32_t_value);
+      HANDLE_TYPE(SINT64, SInt64, int64_t_value);
+      HANDLE_TYPE(STRING, String, *string_value);
+      HANDLE_TYPE(BYTES, Bytes, *string_value);
+      HANDLE_TYPE(ENUM, Enum, enum_value);
+      HANDLE_TYPE(GROUP, Group, *message_value);
 #undef HANDLE_TYPE
       case WireFormatLite::TYPE_MESSAGE: {
         if (is_lazy) {
-          size_t size = lazymessage_value->ByteSize();
+          size_t size = lazymessage_value->ByteSizeLong();
           result += io::CodedOutputStream::VarintSize32(size) + size;
         } else {
           result += WireFormatLite::MessageSize(*message_value);
@@ -1662,17 +1776,17 @@ size_t ExtensionSet::Extension::ByteSize(int number) const {
       }
 
       // Stuff with fixed size.
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE)                                 \
-      case WireFormatLite::TYPE_##UPPERCASE:                              \
-        result += WireFormatLite::k##CAMELCASE##Size;                     \
-        break
-      HANDLE_TYPE( FIXED32,  Fixed32);
-      HANDLE_TYPE( FIXED64,  Fixed64);
-      HANDLE_TYPE(SFIXED32, SFixed32);
-      HANDLE_TYPE(SFIXED64, SFixed64);
-      HANDLE_TYPE(   FLOAT,    Float);
-      HANDLE_TYPE(  DOUBLE,   Double);
-      HANDLE_TYPE(    BOOL,     Bool);
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE)         \
+  case WireFormatLite::TYPE_##UPPERCASE:          \
+    result += WireFormatLite::k##CAMELCASE##Size; \
+    break
+        HANDLE_TYPE(FIXED32, Fixed32);
+        HANDLE_TYPE(FIXED64, Fixed64);
+        HANDLE_TYPE(SFIXED32, SFixed32);
+        HANDLE_TYPE(SFIXED64, SFixed64);
+        HANDLE_TYPE(FLOAT, Float);
+        HANDLE_TYPE(DOUBLE, Double);
+        HANDLE_TYPE(BOOL, Bool);
 #undef HANDLE_TYPE
     }
   }
@@ -1683,19 +1797,19 @@ size_t ExtensionSet::Extension::ByteSize(int number) const {
 int ExtensionSet::Extension::GetSize() const {
   GOOGLE_DCHECK(is_repeated);
   switch (cpp_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                        \
-    case WireFormatLite::CPPTYPE_##UPPERCASE:                    \
-      return repeated_##LOWERCASE##_value->size()
-
-    HANDLE_TYPE(  INT32,   int32);
-    HANDLE_TYPE(  INT64,   int64);
-    HANDLE_TYPE( UINT32,  uint32);
-    HANDLE_TYPE( UINT64,  uint64);
-    HANDLE_TYPE(  FLOAT,   float);
-    HANDLE_TYPE( DOUBLE,  double);
-    HANDLE_TYPE(   BOOL,    bool);
-    HANDLE_TYPE(   ENUM,    enum);
-    HANDLE_TYPE( STRING,  string);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)   \
+  case WireFormatLite::CPPTYPE_##UPPERCASE: \
+    return repeated_##LOWERCASE##_value->size()
+
+    HANDLE_TYPE(INT32, int32_t);
+    HANDLE_TYPE(INT64, int64_t);
+    HANDLE_TYPE(UINT32, uint32_t);
+    HANDLE_TYPE(UINT64, uint64_t);
+    HANDLE_TYPE(FLOAT, float);
+    HANDLE_TYPE(DOUBLE, double);
+    HANDLE_TYPE(BOOL, bool);
+    HANDLE_TYPE(ENUM, enum);
+    HANDLE_TYPE(STRING, string);
     HANDLE_TYPE(MESSAGE, message);
 #undef HANDLE_TYPE
   }
@@ -1705,24 +1819,24 @@ int ExtensionSet::Extension::GetSize() const {
 }
 
 // This function deletes all allocated objects. This function should be only
-// called if the Extension was created with an arena.
+// called if the Extension was created without an arena.
 void ExtensionSet::Extension::Free() {
   if (is_repeated) {
     switch (cpp_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                          \
-      case WireFormatLite::CPPTYPE_##UPPERCASE:                    \
-        delete repeated_##LOWERCASE##_value;                       \
-        break
-
-      HANDLE_TYPE(  INT32,   int32);
-      HANDLE_TYPE(  INT64,   int64);
-      HANDLE_TYPE( UINT32,  uint32);
-      HANDLE_TYPE( UINT64,  uint64);
-      HANDLE_TYPE(  FLOAT,   float);
-      HANDLE_TYPE( DOUBLE,  double);
-      HANDLE_TYPE(   BOOL,    bool);
-      HANDLE_TYPE(   ENUM,    enum);
-      HANDLE_TYPE( STRING,  string);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)   \
+  case WireFormatLite::CPPTYPE_##UPPERCASE: \
+    delete repeated_##LOWERCASE##_value;    \
+    break
+
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
+      HANDLE_TYPE(FLOAT, float);
+      HANDLE_TYPE(DOUBLE, double);
+      HANDLE_TYPE(BOOL, bool);
+      HANDLE_TYPE(ENUM, enum);
+      HANDLE_TYPE(STRING, string);
       HANDLE_TYPE(MESSAGE, message);
 #undef HANDLE_TYPE
     }
@@ -1747,71 +1861,395 @@ void ExtensionSet::Extension::Free() {
 // Defined in extension_set_heavy.cc.
 // int ExtensionSet::Extension::SpaceUsedExcludingSelf() const
 
-// ==================================================================
-// Default repeated field instances for iterator-compatible accessors
+bool ExtensionSet::Extension::IsInitialized() const {
+  if (cpp_type(type) == WireFormatLite::CPPTYPE_MESSAGE) {
+    if (is_repeated) {
+      for (int i = 0; i < repeated_message_value->size(); i++) {
+        if (!repeated_message_value->Get(i).IsInitialized()) {
+          return false;
+        }
+      }
+    } else {
+      if (!is_cleared) {
+        if (is_lazy) {
+          if (!lazymessage_value->IsInitialized()) return false;
+        } else {
+          if (!message_value->IsInitialized()) return false;
+        }
+      }
+    }
+  }
+  return true;
+}
 
-GOOGLE_PROTOBUF_DECLARE_ONCE(repeated_primitive_generic_type_traits_once_init_);
-GOOGLE_PROTOBUF_DECLARE_ONCE(repeated_string_type_traits_once_init_);
-GOOGLE_PROTOBUF_DECLARE_ONCE(repeated_message_generic_type_traits_once_init_);
+// Dummy key method to avoid weak vtable.
+void ExtensionSet::LazyMessageExtension::UnusedKeyMethod() {}
 
-void RepeatedPrimitiveGenericTypeTraits::InitializeDefaultRepeatedFields() {
-  default_repeated_field_int32_ = new RepeatedField<int32>;
-  default_repeated_field_int64_ = new RepeatedField<int64>;
-  default_repeated_field_uint32_ = new RepeatedField<uint32>;
-  default_repeated_field_uint64_ = new RepeatedField<uint64>;
-  default_repeated_field_double_ = new RepeatedField<double>;
-  default_repeated_field_float_ = new RepeatedField<float>;
-  default_repeated_field_bool_ = new RepeatedField<bool>;
-  OnShutdown(&DestroyDefaultRepeatedFields);
+const ExtensionSet::Extension* ExtensionSet::FindOrNull(int key) const {
+  if (flat_size_ == 0) {
+    return nullptr;
+  } else if (PROTOBUF_PREDICT_TRUE(!is_large())) {
+    auto it = std::lower_bound(flat_begin(), flat_end() - 1, key,
+                               KeyValue::FirstComparator());
+    return it->first == key ? &it->second : nullptr;
+  } else {
+    return FindOrNullInLargeMap(key);
+  }
 }
 
-void RepeatedPrimitiveGenericTypeTraits::DestroyDefaultRepeatedFields() {
-  delete default_repeated_field_int32_;
-  delete default_repeated_field_int64_;
-  delete default_repeated_field_uint32_;
-  delete default_repeated_field_uint64_;
-  delete default_repeated_field_double_;
-  delete default_repeated_field_float_;
-  delete default_repeated_field_bool_;
+const ExtensionSet::Extension* ExtensionSet::FindOrNullInLargeMap(
+    int key) const {
+  assert(is_large());
+  LargeMap::const_iterator it = map_.large->find(key);
+  if (it != map_.large->end()) {
+    return &it->second;
+  }
+  return nullptr;
 }
 
-void RepeatedStringTypeTraits::InitializeDefaultRepeatedFields() {
-  default_repeated_field_ = new RepeatedFieldType;
-  OnShutdown(&DestroyDefaultRepeatedFields);
+ExtensionSet::Extension* ExtensionSet::FindOrNull(int key) {
+  const auto* const_this = this;
+  return const_cast<ExtensionSet::Extension*>(const_this->FindOrNull(key));
 }
 
-void RepeatedStringTypeTraits::DestroyDefaultRepeatedFields() {
-  delete default_repeated_field_;
+ExtensionSet::Extension* ExtensionSet::FindOrNullInLargeMap(int key) {
+  const auto* const_this = this;
+  return const_cast<ExtensionSet::Extension*>(
+      const_this->FindOrNullInLargeMap(key));
 }
 
-void RepeatedMessageGenericTypeTraits::InitializeDefaultRepeatedFields() {
-  default_repeated_field_ = new RepeatedFieldType;
-  OnShutdown(&DestroyDefaultRepeatedFields);
+std::pair<ExtensionSet::Extension*, bool> ExtensionSet::Insert(int key) {
+  if (PROTOBUF_PREDICT_FALSE(is_large())) {
+    auto maybe = map_.large->insert({key, Extension()});
+    return {&maybe.first->second, maybe.second};
+  }
+  KeyValue* end = flat_end();
+  KeyValue* it =
+      std::lower_bound(flat_begin(), end, key, KeyValue::FirstComparator());
+  if (it != end && it->first == key) {
+    return {&it->second, false};
+  }
+  if (flat_size_ < flat_capacity_) {
+    std::copy_backward(it, end, end + 1);
+    ++flat_size_;
+    it->first = key;
+    it->second = Extension();
+    return {&it->second, true};
+  }
+  GrowCapacity(flat_size_ + 1);
+  return Insert(key);
 }
 
-void RepeatedMessageGenericTypeTraits::DestroyDefaultRepeatedFields() {
-  delete default_repeated_field_;
+void ExtensionSet::GrowCapacity(size_t minimum_new_capacity) {
+  if (PROTOBUF_PREDICT_FALSE(is_large())) {
+    return;  // LargeMap does not have a "reserve" method.
+  }
+  if (flat_capacity_ >= minimum_new_capacity) {
+    return;
+  }
+
+  auto new_flat_capacity = flat_capacity_;
+  do {
+    new_flat_capacity = new_flat_capacity == 0 ? 1 : new_flat_capacity * 4;
+  } while (new_flat_capacity < minimum_new_capacity);
+
+  const KeyValue* begin = flat_begin();
+  const KeyValue* end = flat_end();
+  AllocatedData new_map;
+  if (new_flat_capacity > kMaximumFlatCapacity) {
+    new_map.large = Arena::Create<LargeMap>(arena_);
+    LargeMap::iterator hint = new_map.large->begin();
+    for (const KeyValue* it = begin; it != end; ++it) {
+      hint = new_map.large->insert(hint, {it->first, it->second});
+    }
+    flat_size_ = static_cast<uint16_t>(-1);
+    GOOGLE_DCHECK(is_large());
+  } else {
+    new_map.flat = Arena::CreateArray<KeyValue>(arena_, new_flat_capacity);
+    std::copy(begin, end, new_map.flat);
+  }
+
+  if (arena_ == nullptr) {
+    DeleteFlatMap(begin, flat_capacity_);
+  }
+  flat_capacity_ = new_flat_capacity;
+  map_ = new_map;
+}
+
+#if (__cplusplus < 201703) && \
+    (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+// static
+constexpr uint16_t ExtensionSet::kMaximumFlatCapacity;
+#endif  //  (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900
+        //  && _MSC_VER < 1912))
+
+void ExtensionSet::Erase(int key) {
+  if (PROTOBUF_PREDICT_FALSE(is_large())) {
+    map_.large->erase(key);
+    return;
+  }
+  KeyValue* end = flat_end();
+  KeyValue* it =
+      std::lower_bound(flat_begin(), end, key, KeyValue::FirstComparator());
+  if (it != end && it->first == key) {
+    std::copy(it + 1, end, it);
+    --flat_size_;
+  }
+}
+
+// ==================================================================
+// Default repeated field instances for iterator-compatible accessors
+
+const RepeatedPrimitiveDefaults* RepeatedPrimitiveDefaults::default_instance() {
+  static auto instance = OnShutdownDelete(new RepeatedPrimitiveDefaults);
+  return instance;
 }
 
-const RepeatedField<int32>*
-RepeatedPrimitiveGenericTypeTraits::default_repeated_field_int32_ = NULL;
-const RepeatedField<int64>*
-RepeatedPrimitiveGenericTypeTraits::default_repeated_field_int64_ = NULL;
-const RepeatedField<uint32>*
-RepeatedPrimitiveGenericTypeTraits::default_repeated_field_uint32_ = NULL;
-const RepeatedField<uint64>*
-RepeatedPrimitiveGenericTypeTraits::default_repeated_field_uint64_ = NULL;
-const RepeatedField<double>*
-RepeatedPrimitiveGenericTypeTraits::default_repeated_field_double_ = NULL;
-const RepeatedField<float>*
-RepeatedPrimitiveGenericTypeTraits::default_repeated_field_float_ = NULL;
-const RepeatedField<bool>*
-RepeatedPrimitiveGenericTypeTraits::default_repeated_field_bool_ = NULL;
 const RepeatedStringTypeTraits::RepeatedFieldType*
-RepeatedStringTypeTraits::default_repeated_field_ = NULL;
-const RepeatedMessageGenericTypeTraits::RepeatedFieldType*
-RepeatedMessageGenericTypeTraits::default_repeated_field_ = NULL;
+RepeatedStringTypeTraits::GetDefaultRepeatedField() {
+  static auto instance = OnShutdownDelete(new RepeatedFieldType);
+  return instance;
+}
+
+uint8_t* ExtensionSet::Extension::InternalSerializeFieldWithCachedSizesToArray(
+    const MessageLite* extendee, const ExtensionSet* extension_set, int number,
+    uint8_t* target, io::EpsCopyOutputStream* stream) const {
+  if (is_repeated) {
+    if (is_packed) {
+      if (cached_size == 0) return target;
+
+      target = stream->EnsureSpace(target);
+      target = WireFormatLite::WriteTagToArray(
+          number, WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target);
+      target = WireFormatLite::WriteInt32NoTagToArray(cached_size, target);
+
+      switch (real_type(type)) {
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                 \
+  case WireFormatLite::TYPE_##UPPERCASE:                             \
+    for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) { \
+      target = stream->EnsureSpace(target);                          \
+      target = WireFormatLite::Write##CAMELCASE##NoTagToArray(       \
+          repeated_##LOWERCASE##_value->Get(i), target);             \
+    }                                                                \
+    break
+
+        HANDLE_TYPE(INT32, Int32, int32_t);
+        HANDLE_TYPE(INT64, Int64, int64_t);
+        HANDLE_TYPE(UINT32, UInt32, uint32_t);
+        HANDLE_TYPE(UINT64, UInt64, uint64_t);
+        HANDLE_TYPE(SINT32, SInt32, int32_t);
+        HANDLE_TYPE(SINT64, SInt64, int64_t);
+        HANDLE_TYPE(FIXED32, Fixed32, uint32_t);
+        HANDLE_TYPE(FIXED64, Fixed64, uint64_t);
+        HANDLE_TYPE(SFIXED32, SFixed32, int32_t);
+        HANDLE_TYPE(SFIXED64, SFixed64, int64_t);
+        HANDLE_TYPE(FLOAT, Float, float);
+        HANDLE_TYPE(DOUBLE, Double, double);
+        HANDLE_TYPE(BOOL, Bool, bool);
+        HANDLE_TYPE(ENUM, Enum, enum);
+#undef HANDLE_TYPE
+
+        case WireFormatLite::TYPE_STRING:
+        case WireFormatLite::TYPE_BYTES:
+        case WireFormatLite::TYPE_GROUP:
+        case WireFormatLite::TYPE_MESSAGE:
+          GOOGLE_LOG(FATAL) << "Non-primitive types can't be packed.";
+          break;
+      }
+    } else {
+      switch (real_type(type)) {
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                 \
+  case WireFormatLite::TYPE_##UPPERCASE:                             \
+    for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) { \
+      target = stream->EnsureSpace(target);                          \
+      target = WireFormatLite::Write##CAMELCASE##ToArray(            \
+          number, repeated_##LOWERCASE##_value->Get(i), target);     \
+    }                                                                \
+    break
+
+        HANDLE_TYPE(INT32, Int32, int32_t);
+        HANDLE_TYPE(INT64, Int64, int64_t);
+        HANDLE_TYPE(UINT32, UInt32, uint32_t);
+        HANDLE_TYPE(UINT64, UInt64, uint64_t);
+        HANDLE_TYPE(SINT32, SInt32, int32_t);
+        HANDLE_TYPE(SINT64, SInt64, int64_t);
+        HANDLE_TYPE(FIXED32, Fixed32, uint32_t);
+        HANDLE_TYPE(FIXED64, Fixed64, uint64_t);
+        HANDLE_TYPE(SFIXED32, SFixed32, int32_t);
+        HANDLE_TYPE(SFIXED64, SFixed64, int64_t);
+        HANDLE_TYPE(FLOAT, Float, float);
+        HANDLE_TYPE(DOUBLE, Double, double);
+        HANDLE_TYPE(BOOL, Bool, bool);
+        HANDLE_TYPE(ENUM, Enum, enum);
+#undef HANDLE_TYPE
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                 \
+  case WireFormatLite::TYPE_##UPPERCASE:                             \
+    for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) { \
+      target = stream->EnsureSpace(target);                          \
+      target = stream->WriteString(                                  \
+          number, repeated_##LOWERCASE##_value->Get(i), target);     \
+    }                                                                \
+    break
+        HANDLE_TYPE(STRING, String, string);
+        HANDLE_TYPE(BYTES, Bytes, string);
+#undef HANDLE_TYPE
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                     \
+  case WireFormatLite::TYPE_##UPPERCASE:                                 \
+    for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {     \
+      target = stream->EnsureSpace(target);                              \
+      target = WireFormatLite::InternalWrite##CAMELCASE(                 \
+          number, repeated_##LOWERCASE##_value->Get(i), target, stream); \
+    }                                                                    \
+    break
+
+        HANDLE_TYPE(GROUP, Group, message);
+        HANDLE_TYPE(MESSAGE, Message, message);
+#undef HANDLE_TYPE
+      }
+    }
+  } else if (!is_cleared) {
+    switch (real_type(type)) {
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, VALUE)                               \
+  case WireFormatLite::TYPE_##UPPERCASE:                                       \
+    target = stream->EnsureSpace(target);                                      \
+    target = WireFormatLite::Write##CAMELCASE##ToArray(number, VALUE, target); \
+    break
+
+      HANDLE_TYPE(INT32, Int32, int32_t_value);
+      HANDLE_TYPE(INT64, Int64, int64_t_value);
+      HANDLE_TYPE(UINT32, UInt32, uint32_t_value);
+      HANDLE_TYPE(UINT64, UInt64, uint64_t_value);
+      HANDLE_TYPE(SINT32, SInt32, int32_t_value);
+      HANDLE_TYPE(SINT64, SInt64, int64_t_value);
+      HANDLE_TYPE(FIXED32, Fixed32, uint32_t_value);
+      HANDLE_TYPE(FIXED64, Fixed64, uint64_t_value);
+      HANDLE_TYPE(SFIXED32, SFixed32, int32_t_value);
+      HANDLE_TYPE(SFIXED64, SFixed64, int64_t_value);
+      HANDLE_TYPE(FLOAT, Float, float_value);
+      HANDLE_TYPE(DOUBLE, Double, double_value);
+      HANDLE_TYPE(BOOL, Bool, bool_value);
+      HANDLE_TYPE(ENUM, Enum, enum_value);
+#undef HANDLE_TYPE
+#define HANDLE_TYPE(UPPERCASE, CAMELCASE, VALUE)         \
+  case WireFormatLite::TYPE_##UPPERCASE:                 \
+    target = stream->EnsureSpace(target);                \
+    target = stream->WriteString(number, VALUE, target); \
+    break
+      HANDLE_TYPE(STRING, String, *string_value);
+      HANDLE_TYPE(BYTES, Bytes, *string_value);
+#undef HANDLE_TYPE
+      case WireFormatLite::TYPE_GROUP:
+        target = stream->EnsureSpace(target);
+        target = WireFormatLite::InternalWriteGroup(number, *message_value,
+                                                    target, stream);
+        break;
+      case WireFormatLite::TYPE_MESSAGE:
+        if (is_lazy) {
+          const auto* prototype =
+              extension_set->GetPrototypeForLazyMessage(extendee, number);
+          target = lazymessage_value->WriteMessageToArray(prototype, number,
+                                                          target, stream);
+        } else {
+          target = stream->EnsureSpace(target);
+          target = WireFormatLite::InternalWriteMessage(number, *message_value,
+                                                        target, stream);
+        }
+        break;
+    }
+  }
+  return target;
+}
+
+const MessageLite* ExtensionSet::GetPrototypeForLazyMessage(
+    const MessageLite* extendee, int number) const {
+  GeneratedExtensionFinder finder(extendee);
+  bool was_packed_on_wire = false;
+  ExtensionInfo extension_info;
+  if (!FindExtensionInfoFromFieldNumber(
+          WireFormatLite::WireType::WIRETYPE_LENGTH_DELIMITED, number, &finder,
+          &extension_info, &was_packed_on_wire)) {
+    return nullptr;
+  }
+  return extension_info.message_info.prototype;
+}
+
+uint8_t*
+ExtensionSet::Extension::InternalSerializeMessageSetItemWithCachedSizesToArray(
+    const MessageLite* extendee, const ExtensionSet* extension_set, int number,
+    uint8_t* target, io::EpsCopyOutputStream* stream) const {
+  if (type != WireFormatLite::TYPE_MESSAGE || is_repeated) {
+    // Not a valid MessageSet extension, but serialize it the normal way.
+    GOOGLE_LOG(WARNING) << "Invalid message set extension.";
+    return InternalSerializeFieldWithCachedSizesToArray(extendee, extension_set,
+                                                        number, target, stream);
+  }
+
+  if (is_cleared) return target;
+
+  target = stream->EnsureSpace(target);
+  // Start group.
+  target = io::CodedOutputStream::WriteTagToArray(
+      WireFormatLite::kMessageSetItemStartTag, target);
+  // Write type ID.
+  target = WireFormatLite::WriteUInt32ToArray(
+      WireFormatLite::kMessageSetTypeIdNumber, number, target);
+  // Write message.
+  if (is_lazy) {
+    const auto* prototype =
+        extension_set->GetPrototypeForLazyMessage(extendee, number);
+    target = lazymessage_value->WriteMessageToArray(
+        prototype, WireFormatLite::kMessageSetMessageNumber, target, stream);
+  } else {
+    target = WireFormatLite::InternalWriteMessage(
+        WireFormatLite::kMessageSetMessageNumber, *message_value, target,
+        stream);
+  }
+  // End group.
+  target = stream->EnsureSpace(target);
+  target = io::CodedOutputStream::WriteTagToArray(
+      WireFormatLite::kMessageSetItemEndTag, target);
+  return target;
+}
+
+size_t ExtensionSet::Extension::MessageSetItemByteSize(int number) const {
+  if (type != WireFormatLite::TYPE_MESSAGE || is_repeated) {
+    // Not a valid MessageSet extension, but compute the byte size for it the
+    // normal way.
+    return ByteSize(number);
+  }
+
+  if (is_cleared) return 0;
+
+  size_t our_size = WireFormatLite::kMessageSetItemTagsSize;
+
+  // type_id
+  our_size += io::CodedOutputStream::VarintSize32(number);
+
+  // message
+  size_t message_size = 0;
+  if (is_lazy) {
+    message_size = lazymessage_value->ByteSizeLong();
+  } else {
+    message_size = message_value->ByteSizeLong();
+  }
+
+  our_size += io::CodedOutputStream::VarintSize32(message_size);
+  our_size += message_size;
+
+  return our_size;
+}
+
+size_t ExtensionSet::MessageSetByteSize() const {
+  size_t total_size = 0;
+  ForEach([&total_size](int number, const Extension& ext) {
+    total_size += ext.MessageSetItemByteSize(number);
+  });
+  return total_size;
+}
+
 
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 0a5d98f..beb4202 100644 (file)
 #ifndef GOOGLE_PROTOBUF_EXTENSION_SET_H__
 #define GOOGLE_PROTOBUF_EXTENSION_SET_H__
 
-#include <vector>
+#include <algorithm>
+#include <cassert>
 #include <map>
-#include <utility>
 #include <string>
-
+#include <utility>
+#include <vector>
 
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/once.h>
-
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/port.h>
 #include <google/protobuf/repeated_field.h>
+#include <google/protobuf/wire_format_lite.h>
 
-namespace google {
+// clang-format off
+#include <google/protobuf/port_def.inc>  // Must be last
+// clang-format on
 
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+namespace google {
 namespace protobuf {
-  class Arena;
-  class Descriptor;                                    // descriptor.h
-  class FieldDescriptor;                               // descriptor.h
-  class DescriptorPool;                                // descriptor.h
-  class MessageLite;                                   // message_lite.h
-  class Message;                                       // message.h
-  class MessageFactory;                                // message.h
-  class UnknownFieldSet;                               // unknown_field_set.h
-  namespace io {
-    class CodedInputStream;                              // coded_stream.h
-    class CodedOutputStream;                             // coded_stream.h
-  }
-  namespace internal {
-    class FieldSkipper;                                  // wire_format_lite.h
-  }
-}
+class Arena;
+class Descriptor;       // descriptor.h
+class FieldDescriptor;  // descriptor.h
+class DescriptorPool;   // descriptor.h
+class MessageLite;      // message_lite.h
+class Message;          // message.h
+class MessageFactory;   // message.h
+class Reflection;       // message.h
+class UnknownFieldSet;  // unknown_field_set.h
+namespace internal {
+class FieldSkipper;  // wire_format_lite.h
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
 
+namespace google {
 namespace protobuf {
 namespace internal {
 
+class InternalMetadata;
+
 // Used to store values of type WireFormatLite::FieldType without having to
 // #include wire_format_lite.h.  Also, ensures that we use only one byte to
 // store these values, which is important to keep the layout of
 // ExtensionSet::Extension small.
-typedef uint8 FieldType;
+typedef uint8_t FieldType;
 
 // A function which, given an integer value, returns true if the number
 // matches one of the defined values for the corresponding enum type.  This
@@ -90,34 +101,46 @@ typedef bool EnumValidityFuncWithArg(const void* arg, int number);
 
 // Information about a registered extension.
 struct ExtensionInfo {
-  inline ExtensionInfo() {}
-  inline ExtensionInfo(FieldType type_param, bool isrepeated, bool ispacked)
-      : type(type_param), is_repeated(isrepeated), is_packed(ispacked),
-        descriptor(NULL) {}
-
-  FieldType type;
-  bool is_repeated;
-  bool is_packed;
+  constexpr ExtensionInfo() : enum_validity_check() {}
+  constexpr ExtensionInfo(const MessageLite* extendee, int param_number,
+                          FieldType type_param, bool isrepeated, bool ispacked)
+      : message(extendee),
+        number(param_number),
+        type(type_param),
+        is_repeated(isrepeated),
+        is_packed(ispacked),
+        enum_validity_check() {}
+
+  const MessageLite* message = nullptr;
+  int number = 0;
+
+  FieldType type = 0;
+  bool is_repeated = false;
+  bool is_packed = false;
 
   struct EnumValidityCheck {
     EnumValidityFuncWithArg* func;
     const void* arg;
   };
 
+  struct MessageInfo {
+    const MessageLite* prototype;
+  };
+
   union {
     EnumValidityCheck enum_validity_check;
-    const MessageLite* message_prototype;
+    MessageInfo message_info;
   };
 
   // The descriptor for this extension, if one exists and is known.  May be
-  // NULL.  Must not be NULL if the descriptor for the extension does not
+  // nullptr.  Must not be nullptr if the descriptor for the extension does not
   // live in the same pool as the descriptor for the containing type.
-  const FieldDescriptor* descriptor;
+  const FieldDescriptor* descriptor = nullptr;
 };
 
 // Abstract interface for an object which looks up extension definitions.  Used
 // when parsing.
-class LIBPROTOBUF_EXPORT ExtensionFinder {
+class PROTOBUF_EXPORT ExtensionFinder {
  public:
   virtual ~ExtensionFinder();
 
@@ -127,17 +150,17 @@ class LIBPROTOBUF_EXPORT ExtensionFinder {
 
 // Implementation of ExtensionFinder which finds extensions defined in .proto
 // files which have been compiled into the binary.
-class LIBPROTOBUF_EXPORT GeneratedExtensionFinder : public ExtensionFinder {
+class PROTOBUF_EXPORT GeneratedExtensionFinder : public ExtensionFinder {
  public:
-  GeneratedExtensionFinder(const MessageLite* containing_type)
-      : containing_type_(containing_type) {}
-  virtual ~GeneratedExtensionFinder() {}
+  explicit GeneratedExtensionFinder(const MessageLite* extendee)
+      : extendee_(extendee) {}
+  ~GeneratedExtensionFinder() override {}
 
   // Returns true and fills in *output if found, otherwise returns false.
-  virtual bool Find(int number, ExtensionInfo* output);
+  bool Find(int number, ExtensionInfo* output) override;
 
  private:
-  const MessageLite* containing_type_;
+  const MessageLite* extendee_;
 };
 
 // A FieldSkipper used for parsing MessageSet.
@@ -157,10 +180,10 @@ class MessageSetFieldSkipper;
 // ExtensionSet.  When parsing, if a tag number is encountered which is
 // inside one of the message type's extension ranges, the tag is passed
 // off to the ExtensionSet for parsing.  Etc.
-class LIBPROTOBUF_EXPORT ExtensionSet {
+class PROTOBUF_EXPORT ExtensionSet {
  public:
-  ExtensionSet();
-  explicit ExtensionSet(::google::protobuf::Arena* arena);
+  constexpr ExtensionSet();
+  explicit ExtensionSet(Arena* arena);
   ~ExtensionSet();
 
   // These are called at startup by protocol-compiler-generated code to
@@ -168,24 +191,22 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
   // to look up extensions for parsed field numbers.  Note that dynamic parsing
   // does not use ParseField(); only protocol-compiler-generated parsing
   // methods do.
-  static void RegisterExtension(const MessageLite* containing_type,
-                                int number, FieldType type,
-                                bool is_repeated, bool is_packed);
-  static void RegisterEnumExtension(const MessageLite* containing_type,
-                                    int number, FieldType type,
-                                    bool is_repeated, bool is_packed,
-                                    EnumValidityFunc* is_valid);
-  static void RegisterMessageExtension(const MessageLite* containing_type,
-                                       int number, FieldType type,
-                                       bool is_repeated, bool is_packed,
+  static void RegisterExtension(const MessageLite* extendee, int number,
+                                FieldType type, bool is_repeated,
+                                bool is_packed);
+  static void RegisterEnumExtension(const MessageLite* extendee, int number,
+                                    FieldType type, bool is_repeated,
+                                    bool is_packed, EnumValidityFunc* is_valid);
+  static void RegisterMessageExtension(const MessageLite* extendee, int number,
+                                       FieldType type, bool is_repeated,
+                                       bool is_packed,
                                        const MessageLite* prototype);
 
   // =================================================================
 
   // Add all fields which are currently present to the given vector.  This
   // is useful to implement Reflection::ListFields().
-  void AppendToList(const Descriptor* containing_type,
-                    const DescriptorPool* pool,
+  void AppendToList(const Descriptor* extendee, const DescriptorPool* pool,
                     std::vector<const FieldDescriptor*>* output) const;
 
   // =================================================================
@@ -219,64 +240,66 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
   // - Strings provide Mutable() in addition to Set() accessors.
 
   bool Has(int number) const;
-  int ExtensionSize(int number) const;   // Size of a repeated extension.
-  int NumExtensions() const;  // The number of extensions
+  int ExtensionSize(int number) const;  // Size of a repeated extension.
+  int NumExtensions() const;            // The number of extensions
   FieldType ExtensionType(int number) const;
   void ClearExtension(int number);
 
   // singular fields -------------------------------------------------
 
-  int32  GetInt32 (int number, int32  default_value) const;
-  int64  GetInt64 (int number, int64  default_value) const;
-  uint32 GetUInt32(int number, uint32 default_value) const;
-  uint64 GetUInt64(int number, uint64 default_value) const;
-  float  GetFloat (int number, float  default_value) const;
+  int32_t GetInt32(int number, int32_t default_value) const;
+  int64_t GetInt64(int number, int64_t default_value) const;
+  uint32_t GetUInt32(int number, uint32_t default_value) const;
+  uint64_t GetUInt64(int number, uint64_t default_value) const;
+  float GetFloat(int number, float default_value) const;
   double GetDouble(int number, double default_value) const;
-  bool   GetBool  (int number, bool   default_value) const;
-  int    GetEnum  (int number, int    default_value) const;
-  const string & GetString (int number, const string&  default_value) const;
+  bool GetBool(int number, bool default_value) const;
+  int GetEnum(int number, int default_value) const;
+  const std::string& GetString(int number,
+                               const std::string& default_value) const;
   const MessageLite& GetMessage(int number,
                                 const MessageLite& default_value) const;
   const MessageLite& GetMessage(int number, const Descriptor* message_type,
                                 MessageFactory* factory) const;
 
-  // |descriptor| may be NULL so long as it is known that the descriptor for
+  // |descriptor| may be nullptr so long as it is known that the descriptor for
   // the extension lives in the same pool as the descriptor for the containing
   // type.
 #define desc const FieldDescriptor* descriptor  // avoid line wrapping
-  void SetInt32 (int number, FieldType type, int32  value, desc);
-  void SetInt64 (int number, FieldType type, int64  value, desc);
-  void SetUInt32(int number, FieldType type, uint32 value, desc);
-  void SetUInt64(int number, FieldType type, uint64 value, desc);
-  void SetFloat (int number, FieldType type, float  value, desc);
+  void SetInt32(int number, FieldType type, int32_t value, desc);
+  void SetInt64(int number, FieldType type, int64_t value, desc);
+  void SetUInt32(int number, FieldType type, uint32_t value, desc);
+  void SetUInt64(int number, FieldType type, uint64_t value, desc);
+  void SetFloat(int number, FieldType type, float value, desc);
   void SetDouble(int number, FieldType type, double value, desc);
-  void SetBool  (int number, FieldType type, bool   value, desc);
-  void SetEnum  (int number, FieldType type, int    value, desc);
-  void SetString(int number, FieldType type, const string& value, desc);
-  string * MutableString (int number, FieldType type, desc);
+  void SetBool(int number, FieldType type, bool value, desc);
+  void SetEnum(int number, FieldType type, int value, desc);
+  void SetString(int number, FieldType type, std::string value, desc);
+  std::string* MutableString(int number, FieldType type, desc);
   MessageLite* MutableMessage(int number, FieldType type,
                               const MessageLite& prototype, desc);
-  MessageLite* MutableMessage(const FieldDescriptor* decsriptor,
+  MessageLite* MutableMessage(const FieldDescriptor* descriptor,
                               MessageFactory* factory);
   // Adds the given message to the ExtensionSet, taking ownership of the
   // message object. Existing message with the same number will be deleted.
-  // If "message" is NULL, this is equivalent to "ClearExtension(number)".
+  // If "message" is nullptr, this is equivalent to "ClearExtension(number)".
   void SetAllocatedMessage(int number, FieldType type,
                            const FieldDescriptor* descriptor,
                            MessageLite* message);
   void UnsafeArenaSetAllocatedMessage(int number, FieldType type,
                                       const FieldDescriptor* descriptor,
                                       MessageLite* message);
-  MessageLite* ReleaseMessage(int number, const MessageLite& prototype);
-  MessageLite* UnsafeArenaReleaseMessage(
-      int number, const MessageLite& prototype);
+  PROTOBUF_NODISCARD MessageLite* ReleaseMessage(int number,
+                                                 const MessageLite& prototype);
+  MessageLite* UnsafeArenaReleaseMessage(int number,
+                                         const MessageLite& prototype);
 
-  MessageLite* ReleaseMessage(const FieldDescriptor* descriptor,
-                              MessageFactory* factory);
+  PROTOBUF_NODISCARD MessageLite* ReleaseMessage(
+      const FieldDescriptor* descriptor, MessageFactory* factory);
   MessageLite* UnsafeArenaReleaseMessage(const FieldDescriptor* descriptor,
                                          MessageFactory* factory);
 #undef desc
-  ::google::protobuf::Arena* GetArenaNoVirtual() const { return arena_; }
+  Arena* GetArena() const { return arena_; }
 
   // repeated fields -------------------------------------------------
 
@@ -287,8 +310,8 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
   // Fetches a mutable version of a RepeatedField extension by number,
   // instantiating one if none exists. Similar to above, user should not use
   // this directly; it underlies MutableRepeatedExtension().
-  void* MutableRawRepeatedField(int number, FieldType field_type,
-                                bool packed, const FieldDescriptor* desc);
+  void* MutableRawRepeatedField(int number, FieldType field_type, bool packed,
+                                const FieldDescriptor* desc);
 
   // This is an overload of MutableRawRepeatedField to maintain compatibility
   // with old code using a previous API. This version of
@@ -296,50 +319,53 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
   // (E.g.: borg/clients/internal/proto1/proto2_reflection.cc.)
   void* MutableRawRepeatedField(int number);
 
-  int32  GetRepeatedInt32 (int number, int index) const;
-  int64  GetRepeatedInt64 (int number, int index) const;
-  uint32 GetRepeatedUInt32(int number, int index) const;
-  uint64 GetRepeatedUInt64(int number, int index) const;
-  float  GetRepeatedFloat (int number, int index) const;
+  int32_t GetRepeatedInt32(int number, int index) const;
+  int64_t GetRepeatedInt64(int number, int index) const;
+  uint32_t GetRepeatedUInt32(int number, int index) const;
+  uint64_t GetRepeatedUInt64(int number, int index) const;
+  float GetRepeatedFloat(int number, int index) const;
   double GetRepeatedDouble(int number, int index) const;
-  bool   GetRepeatedBool  (int number, int index) const;
-  int    GetRepeatedEnum  (int number, int index) const;
-  const string & GetRepeatedString (int number, int index) const;
+  bool GetRepeatedBool(int number, int index) const;
+  int GetRepeatedEnum(int number, int index) const;
+  const std::string& GetRepeatedString(int number, int index) const;
   const MessageLite& GetRepeatedMessage(int number, int index) const;
 
-  void SetRepeatedInt32 (int number, int index, int32  value);
-  void SetRepeatedInt64 (int number, int index, int64  value);
-  void SetRepeatedUInt32(int number, int index, uint32 value);
-  void SetRepeatedUInt64(int number, int index, uint64 value);
-  void SetRepeatedFloat (int number, int index, float  value);
+  void SetRepeatedInt32(int number, int index, int32_t value);
+  void SetRepeatedInt64(int number, int index, int64_t value);
+  void SetRepeatedUInt32(int number, int index, uint32_t value);
+  void SetRepeatedUInt64(int number, int index, uint64_t value);
+  void SetRepeatedFloat(int number, int index, float value);
   void SetRepeatedDouble(int number, int index, double value);
-  void SetRepeatedBool  (int number, int index, bool   value);
-  void SetRepeatedEnum  (int number, int index, int    value);
-  void SetRepeatedString(int number, int index, const string& value);
-  string * MutableRepeatedString (int number, int index);
+  void SetRepeatedBool(int number, int index, bool value);
+  void SetRepeatedEnum(int number, int index, int value);
+  void SetRepeatedString(int number, int index, std::string value);
+  std::string* MutableRepeatedString(int number, int index);
   MessageLite* MutableRepeatedMessage(int number, int index);
 
 #define desc const FieldDescriptor* descriptor  // avoid line wrapping
-  void AddInt32 (int number, FieldType type, bool packed, int32  value, desc);
-  void AddInt64 (int number, FieldType type, bool packed, int64  value, desc);
-  void AddUInt32(int number, FieldType type, bool packed, uint32 value, desc);
-  void AddUInt64(int number, FieldType type, bool packed, uint64 value, desc);
-  void AddFloat (int number, FieldType type, bool packed, float  value, desc);
+  void AddInt32(int number, FieldType type, bool packed, int32_t value, desc);
+  void AddInt64(int number, FieldType type, bool packed, int64_t value, desc);
+  void AddUInt32(int number, FieldType type, bool packed, uint32_t value, desc);
+  void AddUInt64(int number, FieldType type, bool packed, uint64_t value, desc);
+  void AddFloat(int number, FieldType type, bool packed, float value, desc);
   void AddDouble(int number, FieldType type, bool packed, double value, desc);
-  void AddBool  (int number, FieldType type, bool packed, bool   value, desc);
-  void AddEnum  (int number, FieldType type, bool packed, int    value, desc);
-  void AddString(int number, FieldType type, const string& value, desc);
-  string * AddString (int number, FieldType type, desc);
+  void AddBool(int number, FieldType type, bool packed, bool value, desc);
+  void AddEnum(int number, FieldType type, bool packed, int value, desc);
+  void AddString(int number, FieldType type, std::string value, desc);
+  std::string* AddString(int number, FieldType type, desc);
   MessageLite* AddMessage(int number, FieldType type,
                           const MessageLite& prototype, desc);
   MessageLite* AddMessage(const FieldDescriptor* descriptor,
                           MessageFactory* factory);
   void AddAllocatedMessage(const FieldDescriptor* descriptor,
                            MessageLite* new_entry);
+  void UnsafeArenaAddAllocatedMessage(const FieldDescriptor* descriptor,
+                                      MessageLite* new_entry);
 #undef desc
 
   void RemoveLast(int number);
-  MessageLite* ReleaseLast(int number);
+  PROTOBUF_NODISCARD MessageLite* ReleaseLast(int number);
+  MessageLite* UnsafeArenaReleaseLast(int number);
   void SwapElements(int number, int index1, int index2);
 
   // -----------------------------------------------------------------
@@ -352,76 +378,138 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
   // class, but providing them here helps keep the generated code size down.
 
   void Clear();
-  void MergeFrom(const ExtensionSet& other);
-  void Swap(ExtensionSet* other);
-  void SwapExtension(ExtensionSet* other, int number);
+  void MergeFrom(const MessageLite* extendee, const ExtensionSet& other);
+  void Swap(const MessageLite* extendee, ExtensionSet* other);
+  void InternalSwap(ExtensionSet* other);
+  void SwapExtension(const MessageLite* extendee, ExtensionSet* other,
+                     int number);
+  void UnsafeShallowSwapExtension(ExtensionSet* other, int number);
   bool IsInitialized() const;
 
   // Parses a single extension from the input. The input should start out
   // positioned immediately after the tag.
-  bool ParseField(uint32 tag, io::CodedInputStream* input,
+  bool ParseField(uint32_t tag, io::CodedInputStream* input,
                   ExtensionFinder* extension_finder,
                   FieldSkipper* field_skipper);
 
   // Specific versions for lite or full messages (constructs the appropriate
-  // FieldSkipper automatically).  |containing_type| is the default
+  // FieldSkipper automatically).  |extendee| is the default
   // instance for the containing message; it is used only to look up the
   // extension by number.  See RegisterExtension(), above.  Unlike the other
   // methods of ExtensionSet, this only works for generated message types --
   // it looks up extensions registered using RegisterExtension().
-  bool ParseField(uint32 tag, io::CodedInputStream* input,
-                  const MessageLite* containing_type);
-  bool ParseField(uint32 tag, io::CodedInputStream* input,
-                  const Message* containing_type,
-                  UnknownFieldSet* unknown_fields);
-  bool ParseField(uint32 tag, io::CodedInputStream* input,
-                  const MessageLite* containing_type,
+  bool ParseField(uint32_t tag, io::CodedInputStream* input,
+                  const MessageLite* extendee);
+  bool ParseField(uint32_t tag, io::CodedInputStream* input,
+                  const Message* extendee, UnknownFieldSet* unknown_fields);
+  bool ParseField(uint32_t tag, io::CodedInputStream* input,
+                  const MessageLite* extendee,
                   io::CodedOutputStream* unknown_fields);
 
+  // Lite parser
+  const char* ParseField(uint64_t tag, const char* ptr,
+                         const MessageLite* extendee,
+                         internal::InternalMetadata* metadata,
+                         internal::ParseContext* ctx);
+  // Full parser
+  const char* ParseField(uint64_t tag, const char* ptr, const Message* extendee,
+                         internal::InternalMetadata* metadata,
+                         internal::ParseContext* ctx);
+  template <typename Msg>
+  const char* ParseMessageSet(const char* ptr, const Msg* extendee,
+                              InternalMetadata* metadata,
+                              internal::ParseContext* ctx) {
+    struct MessageSetItem {
+      const char* _InternalParse(const char* ptr, ParseContext* ctx) {
+        return me->ParseMessageSetItem(ptr, extendee, metadata, ctx);
+      }
+      ExtensionSet* me;
+      const Msg* extendee;
+      InternalMetadata* metadata;
+    } item{this, extendee, metadata};
+    while (!ctx->Done(&ptr)) {
+      uint32_t tag;
+      ptr = ReadTag(ptr, &tag);
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+      if (tag == WireFormatLite::kMessageSetItemStartTag) {
+        ptr = ctx->ParseGroup(&item, ptr, tag);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+      } else {
+        if (tag == 0 || (tag & 7) == 4) {
+          ctx->SetLastTag(tag);
+          return ptr;
+        }
+        ptr = ParseField(tag, ptr, extendee, metadata, ctx);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+      }
+    }
+    return ptr;
+  }
+
   // Parse an entire message in MessageSet format.  Such messages have no
   // fields, only extensions.
+  bool ParseMessageSetLite(io::CodedInputStream* input,
+                           ExtensionFinder* extension_finder,
+                           FieldSkipper* field_skipper);
   bool ParseMessageSet(io::CodedInputStream* input,
                        ExtensionFinder* extension_finder,
                        MessageSetFieldSkipper* field_skipper);
 
   // Specific versions for lite or full messages (constructs the appropriate
   // FieldSkipper automatically).
-  bool ParseMessageSet(io::CodedInputStream* input,
-                       const MessageLite* containing_type);
-  bool ParseMessageSet(io::CodedInputStream* input,
-                       const Message* containing_type,
+  bool ParseMessageSet(io::CodedInputStream* input, const MessageLite* extendee,
+                       std::string* unknown_fields);
+  bool ParseMessageSet(io::CodedInputStream* input, const Message* extendee,
                        UnknownFieldSet* unknown_fields);
 
   // Write all extension fields with field numbers in the range
   //   [start_field_number, end_field_number)
   // to the output stream, using the cached sizes computed when ByteSize() was
   // last called.  Note that the range bounds are inclusive-exclusive.
-  void SerializeWithCachedSizes(int start_field_number,
-                                int end_field_number,
-                                io::CodedOutputStream* output) const;
+  void SerializeWithCachedSizes(const MessageLite* extendee,
+                                int start_field_number, int end_field_number,
+                                io::CodedOutputStream* output) const {
+    output->SetCur(_InternalSerialize(extendee, start_field_number,
+                                      end_field_number, output->Cur(),
+                                      output->EpsCopy()));
+  }
 
   // Same as SerializeWithCachedSizes, but without any bounds checking.
   // The caller must ensure that target has sufficient capacity for the
   // serialized extensions.
   //
   // Returns a pointer past the last written byte.
-  uint8* InternalSerializeWithCachedSizesToArray(int start_field_number,
-                                                 int end_field_number,
-                                                 bool deterministic,
-                                                 uint8* target) const;
+
+  uint8_t* _InternalSerialize(const MessageLite* extendee,
+                              int start_field_number, int end_field_number,
+                              uint8_t* target,
+                              io::EpsCopyOutputStream* stream) const {
+    if (flat_size_ == 0) {
+      assert(!is_large());
+      return target;
+    }
+    return _InternalSerializeImpl(extendee, start_field_number,
+                                  end_field_number, target, stream);
+  }
 
   // Like above but serializes in MessageSet format.
-  void SerializeMessageSetWithCachedSizes(io::CodedOutputStream* output) const;
-  uint8* InternalSerializeMessageSetWithCachedSizesToArray(bool deterministic,
-                                                           uint8* target) const;
+  void SerializeMessageSetWithCachedSizes(const MessageLite* extendee,
+                                          io::CodedOutputStream* output) const {
+    output->SetCur(InternalSerializeMessageSetWithCachedSizesToArray(
+        extendee, output->Cur(), output->EpsCopy()));
+  }
+  uint8_t* InternalSerializeMessageSetWithCachedSizesToArray(
+      const MessageLite* extendee, uint8_t* target,
+      io::EpsCopyOutputStream* stream) const;
 
   // For backward-compatibility, versions of two of the above methods that
   // serialize deterministically iff SetDefaultSerializationDeterministic()
   // has been called.
-  uint8* SerializeWithCachedSizesToArray(int start_field_number,
-                                         int end_field_number,
-                                         uint8* target) const;
-  uint8* SerializeMessageSetWithCachedSizesToArray(uint8* target) const;
+  uint8_t* SerializeWithCachedSizesToArray(int start_field_number,
+                                           int end_field_number,
+                                           uint8_t* target) const;
+  uint8_t* SerializeMessageSetWithCachedSizesToArray(
+      const MessageLite* extendee, uint8_t* target) const;
 
   // Returns the total serialized size of all the extensions.
   size_t ByteSize() const;
@@ -446,70 +534,113 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
   int SpaceUsedExcludingSelf() const;
 
  private:
-
+  template <typename Type>
+  friend class PrimitiveTypeTraits;
+
+  template <typename Type>
+  friend class RepeatedPrimitiveTypeTraits;
+
+  template <typename Type, bool IsValid(int)>
+  friend class EnumTypeTraits;
+
+  template <typename Type, bool IsValid(int)>
+  friend class RepeatedEnumTypeTraits;
+
+  friend class google::protobuf::Reflection;
+
+  const int32_t& GetRefInt32(int number, const int32_t& default_value) const;
+  const int64_t& GetRefInt64(int number, const int64_t& default_value) const;
+  const uint32_t& GetRefUInt32(int number, const uint32_t& default_value) const;
+  const uint64_t& GetRefUInt64(int number, const uint64_t& default_value) const;
+  const float& GetRefFloat(int number, const float& default_value) const;
+  const double& GetRefDouble(int number, const double& default_value) const;
+  const bool& GetRefBool(int number, const bool& default_value) const;
+  const int& GetRefEnum(int number, const int& default_value) const;
+  const int32_t& GetRefRepeatedInt32(int number, int index) const;
+  const int64_t& GetRefRepeatedInt64(int number, int index) const;
+  const uint32_t& GetRefRepeatedUInt32(int number, int index) const;
+  const uint64_t& GetRefRepeatedUInt64(int number, int index) const;
+  const float& GetRefRepeatedFloat(int number, int index) const;
+  const double& GetRefRepeatedDouble(int number, int index) const;
+  const bool& GetRefRepeatedBool(int number, int index) const;
+  const int& GetRefRepeatedEnum(int number, int index) const;
+
+  // Implementation of _InternalSerialize for non-empty map_.
+  uint8_t* _InternalSerializeImpl(const MessageLite* extendee,
+                                  int start_field_number, int end_field_number,
+                                  uint8_t* target,
+                                  io::EpsCopyOutputStream* stream) const;
   // Interface of a lazily parsed singular message extension.
-  class LIBPROTOBUF_EXPORT LazyMessageExtension {
+  class PROTOBUF_EXPORT LazyMessageExtension {
    public:
     LazyMessageExtension() {}
     virtual ~LazyMessageExtension() {}
 
-    virtual LazyMessageExtension* New(::google::protobuf::Arena* arena) const = 0;
-    virtual const MessageLite& GetMessage(
-        const MessageLite& prototype) const = 0;
-    virtual MessageLite* MutableMessage(const MessageLite& prototype) = 0;
-    virtual void SetAllocatedMessage(MessageLite *message) = 0;
-    virtual void UnsafeArenaSetAllocatedMessage(MessageLite *message) = 0;
-    virtual MessageLite* ReleaseMessage(const MessageLite& prototype) = 0;
-    virtual MessageLite* UnsafeArenaReleaseMessage(
-        const MessageLite& prototype) = 0;
+    virtual LazyMessageExtension* New(Arena* arena) const = 0;
+    virtual const MessageLite& GetMessage(const MessageLite& prototype,
+                                          Arena* arena) const = 0;
+    virtual MessageLite* MutableMessage(const MessageLite& prototype,
+                                        Arena* arena) = 0;
+    virtual void SetAllocatedMessage(MessageLite* message, Arena* arena) = 0;
+    virtual void UnsafeArenaSetAllocatedMessage(MessageLite* message,
+                                                Arena* arena) = 0;
+    PROTOBUF_NODISCARD virtual MessageLite* ReleaseMessage(
+        const MessageLite& prototype, Arena* arena) = 0;
+    virtual MessageLite* UnsafeArenaReleaseMessage(const MessageLite& prototype,
+                                                   Arena* arena) = 0;
 
     virtual bool IsInitialized() const = 0;
-    virtual int ByteSize() const = 0;
+
+    PROTOBUF_DEPRECATED_MSG("Please use ByteSizeLong() instead")
+    virtual int ByteSize() const { return internal::ToIntSize(ByteSizeLong()); }
+    virtual size_t ByteSizeLong() const = 0;
     virtual size_t SpaceUsedLong() const = 0;
 
-    virtual void MergeFrom(const LazyMessageExtension& other) = 0;
+    virtual void MergeFrom(const MessageLite* prototype,
+                           const LazyMessageExtension& other, Arena* arena) = 0;
+    virtual void MergeFromMessage(const MessageLite& msg, Arena* arena) = 0;
     virtual void Clear() = 0;
 
     virtual bool ReadMessage(const MessageLite& prototype,
                              io::CodedInputStream* input) = 0;
-    virtual void WriteMessage(int number,
-                              io::CodedOutputStream* output) const = 0;
-    virtual uint8* WriteMessageToArray(int number, uint8* target) const = 0;
-    virtual uint8* InternalWriteMessageToArray(int number, bool,
-                                               uint8* target) const {
-      // TODO(gpike): make this pure virtual. This is a placeholder because we
-      // need to update third_party/upb, for example.
-      return WriteMessageToArray(number, target);
-    }
+    virtual const char* _InternalParse(const Message& prototype, Arena* arena,
+                                       const char* ptr, ParseContext* ctx) = 0;
+    virtual uint8_t* WriteMessageToArray(
+        const MessageLite* prototype, int number, uint8_t* target,
+        io::EpsCopyOutputStream* stream) const = 0;
 
    private:
+    virtual void UnusedKeyMethod();  // Dummy key method to avoid weak vtable.
+
     GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(LazyMessageExtension);
   };
+  // Give access to function defined below to see LazyMessageExtension.
+  friend LazyMessageExtension* MaybeCreateLazyExtension(Arena* arena);
   struct Extension {
     // The order of these fields packs Extension into 24 bytes when using 8
     // byte alignment. Consider this when adding or removing fields here.
     union {
-      int32                 int32_value;
-      int64                 int64_value;
-      uint32                uint32_value;
-      uint64                uint64_value;
-      float                 float_value;
-      double                double_value;
-      bool                  bool_value;
-      int                   enum_value;
-      string*               string_value;
-      MessageLite*          message_value;
+      int32_t int32_t_value;
+      int64_t int64_t_value;
+      uint32_t uint32_t_value;
+      uint64_t uint64_t_value;
+      float float_value;
+      double double_value;
+      bool bool_value;
+      int enum_value;
+      std::string* string_value;
+      MessageLite* message_value;
       LazyMessageExtension* lazymessage_value;
 
-      RepeatedField   <int32      >* repeated_int32_value;
-      RepeatedField   <int64      >* repeated_int64_value;
-      RepeatedField   <uint32     >* repeated_uint32_value;
-      RepeatedField   <uint64     >* repeated_uint64_value;
-      RepeatedField   <float      >* repeated_float_value;
-      RepeatedField   <double     >* repeated_double_value;
-      RepeatedField   <bool       >* repeated_bool_value;
-      RepeatedField   <int        >* repeated_enum_value;
-      RepeatedPtrField<string     >* repeated_string_value;
+      RepeatedField<int32_t>* repeated_int32_t_value;
+      RepeatedField<int64_t>* repeated_int64_t_value;
+      RepeatedField<uint32_t>* repeated_uint32_t_value;
+      RepeatedField<uint64_t>* repeated_uint64_t_value;
+      RepeatedField<float>* repeated_float_value;
+      RepeatedField<double>* repeated_double_value;
+      RepeatedField<bool>* repeated_bool_value;
+      RepeatedField<int>* repeated_enum_value;
+      RepeatedPtrField<std::string>* repeated_string_value;
       RepeatedPtrField<MessageLite>* repeated_message_value;
     };
 
@@ -540,43 +671,117 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
     mutable int cached_size;
 
     // The descriptor for this extension, if one exists and is known.  May be
-    // NULL.  Must not be NULL if the descriptor for the extension does not
-    // live in the same pool as the descriptor for the containing type.
+    // nullptr.  Must not be nullptr if the descriptor for the extension does
+    // not live in the same pool as the descriptor for the containing type.
     const FieldDescriptor* descriptor;
 
     // Some helper methods for operations on a single Extension.
-    void SerializeFieldWithCachedSizes(
-        int number,
-        io::CodedOutputStream* output) const;
-    uint8* InternalSerializeFieldWithCachedSizesToArray(
-        int number,
-        bool deterministic,
-        uint8* target) const;
-    void SerializeMessageSetItemWithCachedSizes(
-        int number,
-        io::CodedOutputStream* output) const;
-    uint8* InternalSerializeMessageSetItemWithCachedSizesToArray(
-        int number,
-        bool deterministic,
-        uint8* target) const;
+    uint8_t* InternalSerializeFieldWithCachedSizesToArray(
+        const MessageLite* extendee, const ExtensionSet* extension_set,
+        int number, uint8_t* target, io::EpsCopyOutputStream* stream) const;
+    uint8_t* InternalSerializeMessageSetItemWithCachedSizesToArray(
+        const MessageLite* extendee, const ExtensionSet* extension_set,
+        int number, uint8_t* target, io::EpsCopyOutputStream* stream) const;
     size_t ByteSize(int number) const;
     size_t MessageSetItemByteSize(int number) const;
     void Clear();
     int GetSize() const;
     void Free();
     size_t SpaceUsedExcludingSelfLong() const;
+    bool IsInitialized() const;
+  };
+
+  // The Extension struct is small enough to be passed by value, so we use it
+  // directly as the value type in mappings rather than use pointers.  We use
+  // sorted maps rather than hash-maps because we expect most ExtensionSets will
+  // only contain a small number of extension.  Also, we want AppendToList and
+  // deterministic serialization to order fields by field number.
+
+  struct KeyValue {
+    int first;
+    Extension second;
+
+    struct FirstComparator {
+      bool operator()(const KeyValue& lhs, const KeyValue& rhs) const {
+        return lhs.first < rhs.first;
+      }
+      bool operator()(const KeyValue& lhs, int key) const {
+        return lhs.first < key;
+      }
+      bool operator()(int key, const KeyValue& rhs) const {
+        return key < rhs.first;
+      }
+    };
   };
-  typedef std::map<int, Extension> ExtensionMap;
 
+  typedef std::map<int, Extension> LargeMap;
+
+  // Wrapper API that switches between flat-map and LargeMap.
+
+  // Finds a key (if present) in the ExtensionSet.
+  const Extension* FindOrNull(int key) const;
+  Extension* FindOrNull(int key);
+
+  // Helper-functions that only inspect the LargeMap.
+  const Extension* FindOrNullInLargeMap(int key) const;
+  Extension* FindOrNullInLargeMap(int key);
+
+  // Inserts a new (key, Extension) into the ExtensionSet (and returns true), or
+  // finds the already-existing Extension for that key (returns false).
+  // The Extension* will point to the new-or-found Extension.
+  std::pair<Extension*, bool> Insert(int key);
+
+  // Grows the flat_capacity_.
+  // If flat_capacity_ > kMaximumFlatCapacity, converts to LargeMap.
+  void GrowCapacity(size_t minimum_new_capacity);
+  static constexpr uint16_t kMaximumFlatCapacity = 256;
+  bool is_large() const { return static_cast<int16_t>(flat_size_) < 0; }
+
+  // Removes a key from the ExtensionSet.
+  void Erase(int key);
+
+  size_t Size() const {
+    return PROTOBUF_PREDICT_FALSE(is_large()) ? map_.large->size() : flat_size_;
+  }
+
+  // Similar to std::for_each.
+  // Each Iterator is decomposed into ->first and ->second fields, so
+  // that the KeyValueFunctor can be agnostic vis-a-vis KeyValue-vs-std::pair.
+  template <typename Iterator, typename KeyValueFunctor>
+  static KeyValueFunctor ForEach(Iterator begin, Iterator end,
+                                 KeyValueFunctor func) {
+    for (Iterator it = begin; it != end; ++it) func(it->first, it->second);
+    return std::move(func);
+  }
+
+  // Applies a functor to the <int, Extension&> pairs in sorted order.
+  template <typename KeyValueFunctor>
+  KeyValueFunctor ForEach(KeyValueFunctor func) {
+    if (PROTOBUF_PREDICT_FALSE(is_large())) {
+      return ForEach(map_.large->begin(), map_.large->end(), std::move(func));
+    }
+    return ForEach(flat_begin(), flat_end(), std::move(func));
+  }
+
+  // Applies a functor to the <int, const Extension&> pairs in sorted order.
+  template <typename KeyValueFunctor>
+  KeyValueFunctor ForEach(KeyValueFunctor func) const {
+    if (PROTOBUF_PREDICT_FALSE(is_large())) {
+      return ForEach(map_.large->begin(), map_.large->end(), std::move(func));
+    }
+    return ForEach(flat_begin(), flat_end(), std::move(func));
+  }
 
   // Merges existing Extension from other_extension
-  void InternalExtensionMergeFrom(int number, const Extension& other_extension);
+  void InternalExtensionMergeFrom(const MessageLite* extendee, int number,
+                                  const Extension& other_extension,
+                                  Arena* other_arena);
 
   // Returns true and fills field_number and extension if extension is found.
   // Note to support packed repeated field compatibility, it also fills whether
   // the tag on wire is packed, which can be different from
   // extension->is_packed (whether packed=true is specified).
-  bool FindExtensionInfoFromTag(uint32 tag, ExtensionFinder* extension_finder,
+  bool FindExtensionInfoFromTag(uint32_t tag, ExtensionFinder* extension_finder,
                                 int* field_number, ExtensionInfo* extension,
                                 bool* was_packed_on_wire);
 
@@ -587,14 +792,18 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
   bool FindExtensionInfoFromFieldNumber(int wire_type, int field_number,
                                         ExtensionFinder* extension_finder,
                                         ExtensionInfo* extension,
-                                        bool* was_packed_on_wire);
+                                        bool* was_packed_on_wire) const;
+
+  // Find the prototype for a LazyMessage from the extension registry. Returns
+  // null if the extension is not found.
+  const MessageLite* GetPrototypeForLazyMessage(const MessageLite* extendee,
+                                                int number) const;
 
   // Parses a single extension from the input. The input should start out
   // positioned immediately after the wire tag. This method is called in
   // ParseField() after field number and was_packed_on_wire is extracted from
   // the wire tag and ExtensionInfo is found by the field number.
-  bool ParseFieldWithExtensionInfo(int field_number,
-                                   bool was_packed_on_wire,
+  bool ParseFieldWithExtensionInfo(int field_number, bool was_packed_on_wire,
                                    const ExtensionInfo& extension,
                                    io::CodedInputStream* input,
                                    FieldSkipper* field_skipper);
@@ -606,6 +815,9 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
                              ExtensionFinder* extension_finder,
                              MessageSetFieldSkipper* field_skipper);
 
+  // Returns true if extension is present and lazy.
+  bool HasLazy(int number) const;
+
   // Gets the extension with the given number, creating it if it does not
   // already exist.  Returns true if the extension did not already exist.
   bool MaybeNewExtension(int number, const FieldDescriptor* descriptor,
@@ -617,10 +829,57 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
 
   // Parse a single MessageSet item -- called just after the item group start
   // tag has been read.
+  bool ParseMessageSetItemLite(io::CodedInputStream* input,
+                               ExtensionFinder* extension_finder,
+                               FieldSkipper* field_skipper);
+  // Parse a single MessageSet item -- called just after the item group start
+  // tag has been read.
   bool ParseMessageSetItem(io::CodedInputStream* input,
                            ExtensionFinder* extension_finder,
                            MessageSetFieldSkipper* field_skipper);
 
+  bool FindExtension(int wire_type, uint32_t field, const MessageLite* extendee,
+                     const internal::ParseContext* /*ctx*/,
+                     ExtensionInfo* extension, bool* was_packed_on_wire) {
+    GeneratedExtensionFinder finder(extendee);
+    return FindExtensionInfoFromFieldNumber(wire_type, field, &finder,
+                                            extension, was_packed_on_wire);
+  }
+  inline bool FindExtension(int wire_type, uint32_t field,
+                            const Message* extendee,
+                            const internal::ParseContext* ctx,
+                            ExtensionInfo* extension, bool* was_packed_on_wire);
+  // Used for MessageSet only
+  const char* ParseFieldMaybeLazily(uint64_t tag, const char* ptr,
+                                    const MessageLite* extendee,
+                                    internal::InternalMetadata* metadata,
+                                    internal::ParseContext* ctx) {
+    // Lite MessageSet doesn't implement lazy.
+    return ParseField(tag, ptr, extendee, metadata, ctx);
+  }
+  const char* ParseFieldMaybeLazily(uint64_t tag, const char* ptr,
+                                    const Message* extendee,
+                                    internal::InternalMetadata* metadata,
+                                    internal::ParseContext* ctx);
+  const char* ParseMessageSetItem(const char* ptr, const MessageLite* extendee,
+                                  internal::InternalMetadata* metadata,
+                                  internal::ParseContext* ctx);
+  const char* ParseMessageSetItem(const char* ptr, const Message* extendee,
+                                  internal::InternalMetadata* metadata,
+                                  internal::ParseContext* ctx);
+
+  // Implemented in extension_set_inl.h to keep code out of the header file.
+  template <typename T>
+  const char* ParseFieldWithExtensionInfo(int number, bool was_packed_on_wire,
+                                          const ExtensionInfo& info,
+                                          internal::InternalMetadata* metadata,
+                                          const char* ptr,
+                                          internal::ParseContext* ctx);
+  template <typename Msg, typename T>
+  const char* ParseMessageSetItemTmpl(const char* ptr, const Msg* extendee,
+                                      internal::InternalMetadata* metadata,
+                                      internal::ParseContext* ctx);
+
   // Hack:  RepeatedPtrFieldBase declares ExtensionSet as a friend.  This
   //   friendship should automatically extend to ExtensionSet::Extension, but
   //   unfortunately some older compilers (e.g. GCC 3.4.4) do not implement this
@@ -631,33 +890,61 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
   static inline size_t RepeatedMessage_SpaceUsedExcludingSelfLong(
       RepeatedPtrFieldBase* field);
 
-  // The Extension struct is small enough to be passed by value, so we use it
-  // directly as the value type in the map rather than use pointers.  We use
-  // a map rather than hash_map here because we expect most ExtensionSets will
-  // only contain a small number of extensions whereas hash_map is optimized
-  // for 100 elements or more.  Also, we want AppendToList() to order fields
-  // by field number.
-  ExtensionMap extensions_;
-  ::google::protobuf::Arena* arena_;
+  KeyValue* flat_begin() {
+    assert(!is_large());
+    return map_.flat;
+  }
+  const KeyValue* flat_begin() const {
+    assert(!is_large());
+    return map_.flat;
+  }
+  KeyValue* flat_end() {
+    assert(!is_large());
+    return map_.flat + flat_size_;
+  }
+  const KeyValue* flat_end() const {
+    assert(!is_large());
+    return map_.flat + flat_size_;
+  }
+
+  Arena* arena_;
+
+  // Manual memory-management:
+  // map_.flat is an allocated array of flat_capacity_ elements.
+  // [map_.flat, map_.flat + flat_size_) is the currently-in-use prefix.
+  uint16_t flat_capacity_;
+  uint16_t flat_size_;  // negative int16_t(flat_size_) indicates is_large()
+  union AllocatedData {
+    KeyValue* flat;
+
+    // If flat_capacity_ > kMaximumFlatCapacity, switch to LargeMap,
+    // which guarantees O(n lg n) CPU but larger constant factors.
+    LargeMap* large;
+  } map_;
+
+  static void DeleteFlatMap(const KeyValue* flat, uint16_t flat_capacity);
+
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionSet);
 };
 
+constexpr ExtensionSet::ExtensionSet()
+    : arena_(nullptr), flat_capacity_(0), flat_size_(0), map_{nullptr} {}
+
 // These are just for convenience...
 inline void ExtensionSet::SetString(int number, FieldType type,
-                                    const string& value,
+                                    std::string value,
                                     const FieldDescriptor* descriptor) {
-  MutableString(number, type, descriptor)->assign(value);
+  MutableString(number, type, descriptor)->assign(std::move(value));
 }
 inline void ExtensionSet::SetRepeatedString(int number, int index,
-                                            const string& value) {
-  MutableRepeatedString(number, index)->assign(value);
+                                            std::string value) {
+  MutableRepeatedString(number, index)->assign(std::move(value));
 }
 inline void ExtensionSet::AddString(int number, FieldType type,
-                                    const string& value,
+                                    std::string value,
                                     const FieldDescriptor* descriptor) {
-  AddString(number, type, descriptor)->assign(value);
+  AddString(number, type, descriptor)->assign(std::move(value));
 }
-
 // ===================================================================
 // Glue for generated extension accessors
 
@@ -712,7 +999,7 @@ inline void ExtensionSet::AddString(int number, FieldType type,
 // For example, if "foo" is an extension of type "optional int32", then if you
 // try to write code like:
 //   my_message.MutableExtension(foo)
-// you will get a compile error because PrimitiveTypeTraits<int32> does not
+// you will get a compile error because PrimitiveTypeTraits<int32_t> does not
 // have a "Mutable()" method.
 
 // -------------------------------------------------------------------
@@ -730,8 +1017,11 @@ class PrimitiveTypeTraits {
 
   static inline ConstType Get(int number, const ExtensionSet& set,
                               ConstType default_value);
-  static inline void Set(int number, FieldType field_type,
-                         ConstType value, ExtensionSet* set);
+
+  static inline const ConstType* GetPtr(int number, const ExtensionSet& set,
+                                        const 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,
@@ -749,15 +1039,20 @@ class RepeatedPrimitiveTypeTraits {
   typedef RepeatedField<Type> RepeatedFieldType;
 
   static inline Type Get(int number, const ExtensionSet& set, int index);
+  static inline const Type* GetPtr(int number, const ExtensionSet& set,
+                                   int index);
+  static inline const RepeatedField<ConstType>* GetRepeatedPtr(
+      int number, const ExtensionSet& set);
   static inline void Set(int number, int index, Type value, ExtensionSet* set);
-  static inline void Add(int number, FieldType field_type,
-                         bool is_packed, Type value, ExtensionSet* set);
+  static inline void Add(int number, FieldType field_type, bool is_packed,
+                         Type value, ExtensionSet* set);
 
-  static inline const RepeatedField<ConstType>&
-      GetRepeated(int number, const ExtensionSet& set);
-  static inline RepeatedField<Type>*
-      MutableRepeated(int number, FieldType field_type,
-                      bool is_packed, ExtensionSet* set);
+  static inline const RepeatedField<ConstType>& GetRepeated(
+      int number, const ExtensionSet& set);
+  static inline RepeatedField<Type>* MutableRepeated(int number,
+                                                     FieldType field_type,
+                                                     bool is_packed,
+                                                     ExtensionSet* set);
 
   static const RepeatedFieldType* GetDefaultRepeatedField();
   template <typename ExtendeeT>
@@ -767,76 +1062,92 @@ class RepeatedPrimitiveTypeTraits {
   }
 };
 
-LIBPROTOBUF_EXPORT extern ProtobufOnceType repeated_primitive_generic_type_traits_once_init_;
-
-class LIBPROTOBUF_EXPORT RepeatedPrimitiveGenericTypeTraits {
+class PROTOBUF_EXPORT RepeatedPrimitiveDefaults {
  private:
-  template<typename Type> friend class RepeatedPrimitiveTypeTraits;
-  static void InitializeDefaultRepeatedFields();
-  static void DestroyDefaultRepeatedFields();
-  static const RepeatedField<int32>* default_repeated_field_int32_;
-  static const RepeatedField<int64>* default_repeated_field_int64_;
-  static const RepeatedField<uint32>* default_repeated_field_uint32_;
-  static const RepeatedField<uint64>* default_repeated_field_uint64_;
-  static const RepeatedField<double>* default_repeated_field_double_;
-  static const RepeatedField<float>* default_repeated_field_float_;
-  static const RepeatedField<bool>* default_repeated_field_bool_;
+  template <typename Type>
+  friend class RepeatedPrimitiveTypeTraits;
+  static const RepeatedPrimitiveDefaults* default_instance();
+  RepeatedField<int32_t> default_repeated_field_int32_t_;
+  RepeatedField<int64_t> default_repeated_field_int64_t_;
+  RepeatedField<uint32_t> default_repeated_field_uint32_t_;
+  RepeatedField<uint64_t> default_repeated_field_uint64_t_;
+  RepeatedField<double> default_repeated_field_double_;
+  RepeatedField<float> default_repeated_field_float_;
+  RepeatedField<bool> default_repeated_field_bool_;
 };
 
-#define PROTOBUF_DEFINE_PRIMITIVE_TYPE(TYPE, METHOD)                       \
-template<> inline TYPE PrimitiveTypeTraits<TYPE>::Get(                     \
-    int number, const ExtensionSet& set, TYPE default_value) {             \
-  return set.Get##METHOD(number, default_value);                           \
-}                                                                          \
-template<> inline void PrimitiveTypeTraits<TYPE>::Set(                     \
-    int number, FieldType field_type, TYPE value, ExtensionSet* set) {     \
-  set->Set##METHOD(number, field_type, value, NULL);                       \
-}                                                                          \
-                                                                           \
-template<> inline TYPE RepeatedPrimitiveTypeTraits<TYPE>::Get(             \
-    int number, const ExtensionSet& set, int index) {                      \
-  return set.GetRepeated##METHOD(number, index);                           \
-}                                                                          \
-template<> inline void RepeatedPrimitiveTypeTraits<TYPE>::Set(             \
-    int number, int index, TYPE value, ExtensionSet* set) {                \
-  set->SetRepeated##METHOD(number, index, value);                          \
-}                                                                          \
-template<> inline void RepeatedPrimitiveTypeTraits<TYPE>::Add(             \
-    int number, FieldType field_type, bool is_packed,                      \
-    TYPE value, ExtensionSet* set) {                                       \
-  set->Add##METHOD(number, field_type, is_packed, value, NULL);            \
-}                                                                          \
-template<> inline const RepeatedField<TYPE>*                               \
-    RepeatedPrimitiveTypeTraits<TYPE>::GetDefaultRepeatedField() {         \
-  ::google::protobuf::GoogleOnceInit(                                                          \
-      &repeated_primitive_generic_type_traits_once_init_,                  \
-      &RepeatedPrimitiveGenericTypeTraits::InitializeDefaultRepeatedFields); \
-  return RepeatedPrimitiveGenericTypeTraits::                              \
-      default_repeated_field_##TYPE##_;                                    \
-}                                                                          \
-template<> inline const RepeatedField<TYPE>&                               \
-    RepeatedPrimitiveTypeTraits<TYPE>::GetRepeated(int number,             \
-                                               const ExtensionSet& set) {  \
-  return *reinterpret_cast<const RepeatedField<TYPE>*>(                    \
-                            set.GetRawRepeatedField(                       \
-                                number, GetDefaultRepeatedField()));       \
-}                                                                          \
-template<> inline RepeatedField<TYPE>*                                     \
-    RepeatedPrimitiveTypeTraits<TYPE>::MutableRepeated(int number,         \
-                                                   FieldType field_type,   \
-                                                   bool is_packed,         \
-                                                   ExtensionSet* set) {    \
-  return reinterpret_cast<RepeatedField<TYPE>*>(                           \
-      set->MutableRawRepeatedField(number, field_type, is_packed, NULL));  \
-}
+#define PROTOBUF_DEFINE_PRIMITIVE_TYPE(TYPE, METHOD)                           \
+  template <>                                                                  \
+  inline TYPE PrimitiveTypeTraits<TYPE>::Get(                                  \
+      int number, const ExtensionSet& set, TYPE default_value) {               \
+    return set.Get##METHOD(number, default_value);                             \
+  }                                                                            \
+  template <>                                                                  \
+  inline const TYPE* PrimitiveTypeTraits<TYPE>::GetPtr(                        \
+      int number, const ExtensionSet& set, const TYPE& default_value) {        \
+    return &set.GetRef##METHOD(number, default_value);                         \
+  }                                                                            \
+  template <>                                                                  \
+  inline void PrimitiveTypeTraits<TYPE>::Set(int number, FieldType field_type, \
+                                             TYPE value, ExtensionSet* set) {  \
+    set->Set##METHOD(number, field_type, value, nullptr);                      \
+  }                                                                            \
+                                                                               \
+  template <>                                                                  \
+  inline TYPE RepeatedPrimitiveTypeTraits<TYPE>::Get(                          \
+      int number, const ExtensionSet& set, int index) {                        \
+    return set.GetRepeated##METHOD(number, index);                             \
+  }                                                                            \
+  template <>                                                                  \
+  inline const TYPE* RepeatedPrimitiveTypeTraits<TYPE>::GetPtr(                \
+      int number, const ExtensionSet& set, int index) {                        \
+    return &set.GetRefRepeated##METHOD(number, index);                         \
+  }                                                                            \
+  template <>                                                                  \
+  inline void RepeatedPrimitiveTypeTraits<TYPE>::Set(                          \
+      int number, int index, TYPE value, ExtensionSet* set) {                  \
+    set->SetRepeated##METHOD(number, index, value);                            \
+  }                                                                            \
+  template <>                                                                  \
+  inline void RepeatedPrimitiveTypeTraits<TYPE>::Add(                          \
+      int number, FieldType field_type, bool is_packed, TYPE value,            \
+      ExtensionSet* set) {                                                     \
+    set->Add##METHOD(number, field_type, is_packed, value, nullptr);           \
+  }                                                                            \
+  template <>                                                                  \
+  inline const RepeatedField<TYPE>*                                            \
+  RepeatedPrimitiveTypeTraits<TYPE>::GetDefaultRepeatedField() {               \
+    return &RepeatedPrimitiveDefaults::default_instance()                      \
+                ->default_repeated_field_##TYPE##_;                            \
+  }                                                                            \
+  template <>                                                                  \
+  inline const RepeatedField<TYPE>&                                            \
+  RepeatedPrimitiveTypeTraits<TYPE>::GetRepeated(int number,                   \
+                                                 const ExtensionSet& set) {    \
+    return *reinterpret_cast<const RepeatedField<TYPE>*>(                      \
+        set.GetRawRepeatedField(number, GetDefaultRepeatedField()));           \
+  }                                                                            \
+  template <>                                                                  \
+  inline const RepeatedField<TYPE>*                                            \
+  RepeatedPrimitiveTypeTraits<TYPE>::GetRepeatedPtr(int number,                \
+                                                    const ExtensionSet& set) { \
+    return &GetRepeated(number, set);                                          \
+  }                                                                            \
+  template <>                                                                  \
+  inline RepeatedField<TYPE>*                                                  \
+  RepeatedPrimitiveTypeTraits<TYPE>::MutableRepeated(                          \
+      int number, FieldType field_type, bool is_packed, ExtensionSet* set) {   \
+    return reinterpret_cast<RepeatedField<TYPE>*>(                             \
+        set->MutableRawRepeatedField(number, field_type, is_packed, nullptr)); \
+  }
 
-PROTOBUF_DEFINE_PRIMITIVE_TYPE( int32,  Int32)
-PROTOBUF_DEFINE_PRIMITIVE_TYPE( int64,  Int64)
-PROTOBUF_DEFINE_PRIMITIVE_TYPE(uint32, UInt32)
-PROTOBUF_DEFINE_PRIMITIVE_TYPE(uint64, UInt64)
-PROTOBUF_DEFINE_PRIMITIVE_TYPE( float,  Float)
+PROTOBUF_DEFINE_PRIMITIVE_TYPE(int32_t, Int32)
+PROTOBUF_DEFINE_PRIMITIVE_TYPE(int64_t, Int64)
+PROTOBUF_DEFINE_PRIMITIVE_TYPE(uint32_t, UInt32)
+PROTOBUF_DEFINE_PRIMITIVE_TYPE(uint64_t, UInt64)
+PROTOBUF_DEFINE_PRIMITIVE_TYPE(float, Float)
 PROTOBUF_DEFINE_PRIMITIVE_TYPE(double, Double)
-PROTOBUF_DEFINE_PRIMITIVE_TYPE(  bool,   Bool)
+PROTOBUF_DEFINE_PRIMITIVE_TYPE(bool, Bool)
 
 #undef PROTOBUF_DEFINE_PRIMITIVE_TYPE
 
@@ -844,23 +1155,27 @@ PROTOBUF_DEFINE_PRIMITIVE_TYPE(  bool,   Bool)
 // StringTypeTraits
 
 // Strings support both Set() and Mutable().
-class LIBPROTOBUF_EXPORT StringTypeTraits {
+class PROTOBUF_EXPORT StringTypeTraits {
  public:
-  typedef const string& ConstType;
-  typedef string* MutableType;
+  typedef const std::string& ConstType;
+  typedef std::string* MutableType;
   typedef StringTypeTraits Singular;
 
-  static inline const string& Get(int number, const ExtensionSet& set,
-                                  ConstType default_value) {
+  static inline const std::string& Get(int number, const ExtensionSet& set,
+                                       ConstType default_value) {
     return set.GetString(number, default_value);
   }
+  static inline const std::string* GetPtr(int number, const ExtensionSet& set,
+                                          ConstType default_value) {
+    return &Get(number, set, default_value);
+  }
   static inline void Set(int number, FieldType field_type,
-                         const string& value, ExtensionSet* set) {
-    set->SetString(number, field_type, value, NULL);
+                         const std::string& value, ExtensionSet* set) {
+    set->SetString(number, field_type, value, nullptr);
   }
-  static inline string* Mutable(int number, FieldType field_type,
-                                ExtensionSet* set) {
-    return set->MutableString(number, field_type, NULL);
+  static inline std::string* Mutable(int number, FieldType field_type,
+                                     ExtensionSet* set) {
+    return set->MutableString(number, field_type, nullptr);
   }
   template <typename ExtendeeT>
   static void Register(int number, FieldType type, bool is_packed) {
@@ -869,55 +1184,54 @@ class LIBPROTOBUF_EXPORT StringTypeTraits {
   }
 };
 
-LIBPROTOBUF_EXPORT extern ProtobufOnceType repeated_string_type_traits_once_init_;
-
-class LIBPROTOBUF_EXPORT RepeatedStringTypeTraits {
+class PROTOBUF_EXPORT RepeatedStringTypeTraits {
  public:
-  typedef const string& ConstType;
-  typedef string* MutableType;
+  typedef const std::string& ConstType;
+  typedef std::string* MutableType;
   typedef RepeatedStringTypeTraits Repeated;
 
-  typedef RepeatedPtrField<string> RepeatedFieldType;
+  typedef RepeatedPtrField<std::string> RepeatedFieldType;
 
-  static inline const string& Get(int number, const ExtensionSet& set,
-                                  int index) {
+  static inline const std::string& Get(int number, const ExtensionSet& set,
+                                       int index) {
     return set.GetRepeatedString(number, index);
   }
-  static inline void Set(int number, int index,
-                         const string& value, ExtensionSet* set) {
+  static inline const std::string* GetPtr(int number, const ExtensionSet& set,
+                                          int index) {
+    return &Get(number, set, index);
+  }
+  static inline const RepeatedPtrField<std::string>* GetRepeatedPtr(
+      int number, const ExtensionSet& set) {
+    return &GetRepeated(number, set);
+  }
+  static inline void Set(int number, int index, const std::string& value,
+                         ExtensionSet* set) {
     set->SetRepeatedString(number, index, value);
   }
-  static inline string* Mutable(int number, int index, ExtensionSet* set) {
+  static inline std::string* Mutable(int number, int index, ExtensionSet* set) {
     return set->MutableRepeatedString(number, index);
   }
-  static inline void Add(int number, FieldType field_type,
-                         bool /*is_packed*/, const string& value,
-                         ExtensionSet* set) {
-    set->AddString(number, field_type, value, NULL);
+  static inline void Add(int number, FieldType field_type, bool /*is_packed*/,
+                         const std::string& value, ExtensionSet* set) {
+    set->AddString(number, field_type, value, nullptr);
   }
-  static inline string* Add(int number, FieldType field_type,
-                            ExtensionSet* set) {
-    return set->AddString(number, field_type, NULL);
+  static inline std::string* Add(int number, FieldType field_type,
+                                 ExtensionSet* set) {
+    return set->AddString(number, field_type, nullptr);
   }
-  static inline const RepeatedPtrField<string>&
-      GetRepeated(int number, const ExtensionSet& set) {
-    return *reinterpret_cast<const RepeatedPtrField<string>*>(
+  static inline const RepeatedPtrField<std::string>& GetRepeated(
+      int number, const ExtensionSet& set) {
+    return *reinterpret_cast<const RepeatedPtrField<std::string>*>(
         set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
   }
 
-  static inline RepeatedPtrField<string>*
-      MutableRepeated(int number, FieldType field_type,
-                      bool is_packed, ExtensionSet* set) {
-    return reinterpret_cast<RepeatedPtrField<string>*>(
-        set->MutableRawRepeatedField(number, field_type,
-                                     is_packed, NULL));
+  static inline RepeatedPtrField<std::string>* MutableRepeated(
+      int number, FieldType field_type, bool is_packed, ExtensionSet* set) {
+    return reinterpret_cast<RepeatedPtrField<std::string>*>(
+        set->MutableRawRepeatedField(number, field_type, is_packed, nullptr));
   }
 
-  static const RepeatedFieldType* GetDefaultRepeatedField() {
-    ::google::protobuf::GoogleOnceInit(&repeated_string_type_traits_once_init_,
-                   &InitializeDefaultRepeatedFields);
-    return default_repeated_field_;
-  }
+  static const RepeatedFieldType* GetDefaultRepeatedField();
 
   template <typename ExtendeeT>
   static void Register(int number, FieldType type, bool is_packed) {
@@ -928,7 +1242,6 @@ class LIBPROTOBUF_EXPORT RepeatedStringTypeTraits {
  private:
   static void InitializeDefaultRepeatedFields();
   static void DestroyDefaultRepeatedFields();
-  static const RepeatedFieldType *default_repeated_field_;
 };
 
 // -------------------------------------------------------------------
@@ -947,10 +1260,15 @@ class EnumTypeTraits {
                               ConstType default_value) {
     return static_cast<Type>(set.GetEnum(number, default_value));
   }
-  static inline void Set(int number, FieldType field_type,
-                         ConstType value, ExtensionSet* set) {
+  static inline const ConstType* GetPtr(int number, const ExtensionSet& set,
+                                        const ConstType& default_value) {
+    return reinterpret_cast<const Type*>(
+        &set.GetRefEnum(number, default_value));
+  }
+  static inline void Set(int number, FieldType field_type, ConstType value,
+                         ExtensionSet* set) {
     GOOGLE_DCHECK(IsValid(value));
-    set->SetEnum(number, field_type, value, NULL);
+    set->SetEnum(number, field_type, value, nullptr);
   }
   template <typename ExtendeeT>
   static void Register(int number, FieldType type, bool is_packed) {
@@ -971,19 +1289,23 @@ class RepeatedEnumTypeTraits {
   static inline ConstType Get(int number, const ExtensionSet& set, int index) {
     return static_cast<Type>(set.GetRepeatedEnum(number, index));
   }
-  static inline void Set(int number, int index,
-                         ConstType value, ExtensionSet* set) {
+  static inline const ConstType* GetPtr(int number, const ExtensionSet& set,
+                                        int index) {
+    return reinterpret_cast<const Type*>(
+        &set.GetRefRepeatedEnum(number, index));
+  }
+  static inline void Set(int number, int index, ConstType value,
+                         ExtensionSet* set) {
     GOOGLE_DCHECK(IsValid(value));
     set->SetRepeatedEnum(number, index, value);
   }
-  static inline void Add(int number, FieldType field_type,
-                         bool is_packed, ConstType value, ExtensionSet* set) {
+  static inline void Add(int number, FieldType field_type, bool is_packed,
+                         ConstType value, ExtensionSet* set) {
     GOOGLE_DCHECK(IsValid(value));
-    set->AddEnum(number, field_type, is_packed, value, NULL);
+    set->AddEnum(number, field_type, is_packed, value, nullptr);
   }
-  static inline const RepeatedField<Type>& GetRepeated(int number,
-                                                       const ExtensionSet&
-                                                       set) {
+  static inline const RepeatedField<Type>& GetRepeated(
+      int number, const ExtensionSet& set) {
     // Hack: the `Extension` struct stores a RepeatedField<int> for enums.
     // RepeatedField<int> cannot implicitly convert to RepeatedField<EnumType>
     // so we need to do some casting magic. See message.h for similar
@@ -991,13 +1313,16 @@ class RepeatedEnumTypeTraits {
     return *reinterpret_cast<const RepeatedField<Type>*>(
         set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
   }
-
+  static inline const RepeatedField<Type>* GetRepeatedPtr(
+      int number, const ExtensionSet& set) {
+    return &GetRepeated(number, set);
+  }
   static inline RepeatedField<Type>* MutableRepeated(int number,
                                                      FieldType field_type,
                                                      bool is_packed,
                                                      ExtensionSet* set) {
     return reinterpret_cast<RepeatedField<Type>*>(
-        set->MutableRawRepeatedField(number, field_type, is_packed, NULL));
+        set->MutableRawRepeatedField(number, field_type, is_packed, nullptr));
   }
 
   static const RepeatedFieldType* GetDefaultRepeatedField() {
@@ -1005,10 +1330,10 @@ class RepeatedEnumTypeTraits {
     // RepeatedField<int>. We need to be able to instantiate global static
     // objects to return as default (empty) repeated fields on non-existent
     // extensions. We would not be able to know a-priori all of the enum types
-    // (values of |Type|) to instantiate all of these, so we just re-use int32's
-    // default repeated field object.
+    // (values of |Type|) to instantiate all of these, so we just re-use
+    // int32_t's default repeated field object.
     return reinterpret_cast<const RepeatedField<Type>*>(
-        RepeatedPrimitiveTypeTraits<int32>::GetDefaultRepeatedField());
+        RepeatedPrimitiveTypeTraits<int32_t>::GetDefaultRepeatedField());
   }
   template <typename ExtendeeT>
   static void Register(int number, FieldType type, bool is_packed) {
@@ -1032,33 +1357,37 @@ class MessageTypeTraits {
 
   static inline ConstType Get(int number, const ExtensionSet& set,
                               ConstType default_value) {
-    return static_cast<const Type&>(
-        set.GetMessage(number, default_value));
+    return static_cast<const Type&>(set.GetMessage(number, default_value));
+  }
+  static inline std::nullptr_t GetPtr(int /* number */, const ExtensionSet& /* set */,
+                                      ConstType /* default_value */) {
+    // Cannot be implemented because of forward declared messages?
+    return nullptr;
   }
   static inline MutableType Mutable(int number, FieldType field_type,
                                     ExtensionSet* set) {
-    return static_cast<Type*>(
-      set->MutableMessage(number, field_type, Type::default_instance(), NULL));
+    return static_cast<Type*>(set->MutableMessage(
+        number, field_type, Type::default_instance(), nullptr));
   }
   static inline void SetAllocated(int number, FieldType field_type,
                                   MutableType message, ExtensionSet* set) {
-    set->SetAllocatedMessage(number, field_type, NULL, message);
+    set->SetAllocatedMessage(number, field_type, nullptr, message);
   }
   static inline void UnsafeArenaSetAllocated(int number, FieldType field_type,
                                              MutableType message,
                                              ExtensionSet* set) {
-    set->UnsafeArenaSetAllocatedMessage(number, field_type, NULL, message);
+    set->UnsafeArenaSetAllocatedMessage(number, field_type, nullptr, message);
   }
-  static inline MutableType Release(int number, FieldType /* field_type */,
-                                    ExtensionSet* set) {
-    return static_cast<Type*>(set->ReleaseMessage(
-        number, Type::default_instance()));
+  PROTOBUF_NODISCARD static inline MutableType Release(
+      int number, FieldType /* field_type */, ExtensionSet* set) {
+    return static_cast<Type*>(
+        set->ReleaseMessage(number, Type::default_instance()));
   }
   static inline MutableType UnsafeArenaRelease(int number,
                                                FieldType /* field_type */,
                                                ExtensionSet* set) {
-    return static_cast<Type*>(set->UnsafeArenaReleaseMessage(
-        number, Type::default_instance()));
+    return static_cast<Type*>(
+        set->UnsafeArenaReleaseMessage(number, Type::default_instance()));
   }
   template <typename ExtendeeT>
   static void Register(int number, FieldType type, bool is_packed) {
@@ -1068,7 +1397,7 @@ class MessageTypeTraits {
   }
 };
 
-// forward declaration
+// forward declaration.
 class RepeatedMessageGenericTypeTraits;
 
 template <typename Type>
@@ -1083,17 +1412,26 @@ class RepeatedMessageTypeTraits {
   static inline ConstType Get(int number, const ExtensionSet& set, int index) {
     return static_cast<const Type&>(set.GetRepeatedMessage(number, index));
   }
+  static inline std::nullptr_t GetPtr(int /* number */, const ExtensionSet& /* set */,
+                                      int /* index */) {
+    // Cannot be implemented because of forward declared messages?
+    return nullptr;
+  }
+  static inline std::nullptr_t GetRepeatedPtr(int /* number */,
+                                              const ExtensionSet& /* set */) {
+    // Cannot be implemented because of forward declared messages?
+    return nullptr;
+  }
   static inline MutableType Mutable(int number, int index, ExtensionSet* set) {
     return static_cast<Type*>(set->MutableRepeatedMessage(number, index));
   }
   static inline MutableType Add(int number, FieldType field_type,
                                 ExtensionSet* set) {
     return static_cast<Type*>(
-        set->AddMessage(number, field_type, Type::default_instance(), NULL));
+        set->AddMessage(number, field_type, Type::default_instance(), nullptr));
   }
-  static inline const RepeatedPtrField<Type>& GetRepeated(int number,
-                                                          const ExtensionSet&
-                                                          set) {
+  static inline const RepeatedPtrField<Type>& GetRepeated(
+      int number, const ExtensionSet& set) {
     // See notes above in RepeatedEnumTypeTraits::GetRepeated(): same
     // casting hack applies here, because a RepeatedPtrField<MessageLite>
     // cannot naturally become a RepeatedPtrType<Type> even though Type is
@@ -1107,7 +1445,7 @@ class RepeatedMessageTypeTraits {
                                                         bool is_packed,
                                                         ExtensionSet* set) {
     return reinterpret_cast<RepeatedPtrField<Type>*>(
-        set->MutableRawRepeatedField(number, field_type, is_packed, NULL));
+        set->MutableRawRepeatedField(number, field_type, is_packed, nullptr));
   }
 
   static const RepeatedFieldType* GetDefaultRepeatedField();
@@ -1119,49 +1457,34 @@ class RepeatedMessageTypeTraits {
   }
 };
 
-LIBPROTOBUF_EXPORT extern ProtobufOnceType repeated_message_generic_type_traits_once_init_;
-
-// This class exists only to hold a generic default empty repeated field for all
-// message-type repeated field extensions.
-class LIBPROTOBUF_EXPORT RepeatedMessageGenericTypeTraits {
- public:
-  typedef RepeatedPtrField< ::google::protobuf::MessageLite*> RepeatedFieldType;
- private:
-  template<typename Type> friend class RepeatedMessageTypeTraits;
-  static void InitializeDefaultRepeatedFields();
-  static void DestroyDefaultRepeatedFields();
-  static const RepeatedFieldType* default_repeated_field_;
-};
-
-template<typename Type> inline
-    const typename RepeatedMessageTypeTraits<Type>::RepeatedFieldType*
-    RepeatedMessageTypeTraits<Type>::GetDefaultRepeatedField() {
-  ::google::protobuf::GoogleOnceInit(
-      &repeated_message_generic_type_traits_once_init_,
-      &RepeatedMessageGenericTypeTraits::InitializeDefaultRepeatedFields);
-  return reinterpret_cast<const RepeatedFieldType*>(
-      RepeatedMessageGenericTypeTraits::default_repeated_field_);
+template <typename Type>
+inline const typename RepeatedMessageTypeTraits<Type>::RepeatedFieldType*
+RepeatedMessageTypeTraits<Type>::GetDefaultRepeatedField() {
+  static auto instance = OnShutdownDelete(new RepeatedFieldType);
+  return instance;
 }
 
 // -------------------------------------------------------------------
 // ExtensionIdentifier
 
 // This is the type of actual extension objects.  E.g. if you have:
-//   extends Foo with optional int32 bar = 1234;
+//   extend Foo {
+//     optional int32 bar = 1234;
+//   }
 // then "bar" will be defined in C++ as:
-//   ExtensionIdentifier<Foo, PrimitiveTypeTraits<int32>, 1, false> bar(1234);
+//   ExtensionIdentifier<Foo, PrimitiveTypeTraits<int32_t>, 5, false> bar(1234);
 //
 // Note that we could, in theory, supply the field number as a template
 // parameter, and thus make an instance of ExtensionIdentifier have no
-// actual contents.  However, if we did that, then using at extension
+// actual contents.  However, if we did that, then using an extension
 // identifier would not necessarily cause the compiler to output any sort
 // of reference to any symbol defined in the extension's .pb.o file.  Some
 // linkers will actually drop object files that are not explicitly referenced,
 // but that would be bad because it would cause this extension to not be
 // registered at static initialization, and therefore using it would crash.
 
-template <typename ExtendeeType, typename TypeTraitsType,
-          FieldType field_type, bool is_packed>
+template <typename ExtendeeType, typename TypeTraitsType, FieldType field_type,
+          bool is_packed>
 class ExtensionIdentifier {
  public:
   typedef TypeTraitsType TypeTraits;
@@ -1180,6 +1503,10 @@ class ExtensionIdentifier {
     TypeTraits::template Register<ExtendeeType>(number, field_type, is_packed);
   }
 
+  typename TypeTraits::ConstType const& default_value_ref() const {
+    return default_value_;
+  }
+
  private:
   const int number_;
   typename TypeTraits::ConstType default_value_;
@@ -1188,192 +1515,46 @@ class ExtensionIdentifier {
 // -------------------------------------------------------------------
 // Generated accessors
 
-// This macro should be expanded in the context of a generated type which
-// has extensions.
+
+// Used to retrieve a lazy extension, may return nullptr in some environments.
+extern PROTOBUF_ATTRIBUTE_WEAK ExtensionSet::LazyMessageExtension*
+MaybeCreateLazyExtension(Arena* arena);
+
+}  // namespace internal
+
+// Call this function to ensure that this extensions's reflection is linked into
+// the binary:
 //
-// We use "_proto_TypeTraits" as a type name below because "TypeTraits"
-// causes problems if the class has a nested message or enum type with that
-// name and "_TypeTraits" is technically reserved for the C++ library since
-// it starts with an underscore followed by a capital letter.
+//   google::protobuf::LinkExtensionReflection(Foo::my_extension);
 //
-// For similar reason, we use "_field_type" and "_is_packed" as parameter names
-// below, so that "field_type" and "is_packed" can be used as field names.
-#define GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(CLASSNAME)                        \
-  /* Has, Size, Clear */                                                      \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline bool HasExtension(                                                   \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const {   \
-    return _extensions_.Has(id.number());                                     \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline void ClearExtension(                                                 \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {         \
-    _extensions_.ClearExtension(id.number());                                 \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline int ExtensionSize(                                                   \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const {   \
-    return _extensions_.ExtensionSize(id.number());                           \
-  }                                                                           \
-                                                                              \
-  /* Singular accessors */                                                    \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(        \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const {   \
-    return _proto_TypeTraits::Get(id.number(), _extensions_,                  \
-                                  id.default_value());                        \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(  \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {         \
-    return _proto_TypeTraits::Mutable(id.number(), _field_type,               \
-                                      &_extensions_);                         \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline void SetExtension(                                                   \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \
-      typename _proto_TypeTraits::Singular::ConstType value) {                \
-    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);   \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline void SetAllocatedExtension(                                          \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \
-      typename _proto_TypeTraits::Singular::MutableType value) {              \
-    _proto_TypeTraits::SetAllocated(id.number(), _field_type,                 \
-                                    value, &_extensions_);                    \
-  }                                                                           \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline void UnsafeArenaSetAllocatedExtension(                               \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \
-      typename _proto_TypeTraits::Singular::MutableType value) {              \
-    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,      \
-                                               value, &_extensions_);         \
-  }                                                                           \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline typename _proto_TypeTraits::Singular::MutableType ReleaseExtension(  \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {         \
-    return _proto_TypeTraits::Release(id.number(), _field_type,               \
-                                      &_extensions_);                         \
-  }                                                                           \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline typename _proto_TypeTraits::Singular::MutableType                    \
-      UnsafeArenaReleaseExtension(                                            \
-          const ::google::protobuf::internal::ExtensionIdentifier<                      \
-            CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {     \
-    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,    \
-                                                 &_extensions_);              \
-  }                                                                           \
-                                                                              \
-  /* Repeated accessors */                                                    \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(        \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \
-      int index) const {                                                      \
-    return _proto_TypeTraits::Get(id.number(), _extensions_, index);          \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(  \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \
-      int index) {                                                            \
-    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);     \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline void SetExtension(                                                   \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \
-      int index, typename _proto_TypeTraits::Repeated::ConstType value) {     \
-    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);         \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(      \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {         \
-    return _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);   \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline void AddExtension(                                                   \
-      const ::google::protobuf::internal::ExtensionIdentifier<                          \
-        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \
-      typename _proto_TypeTraits::Repeated::ConstType value) {                \
-    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed,              \
-                           value, &_extensions_);                             \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&       \
-      GetRepeatedExtension(                                                   \
-          const ::google::protobuf::internal::ExtensionIdentifier<                      \
-            CLASSNAME, _proto_TypeTraits, _field_type,                        \
-            _is_packed>& id) const {                                          \
-    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);         \
-  }                                                                           \
-                                                                              \
-  template <typename _proto_TypeTraits,                                       \
-            ::google::protobuf::internal::FieldType _field_type,                        \
-            bool _is_packed>                                                  \
-  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*             \
-      MutableRepeatedExtension(                                               \
-          const ::google::protobuf::internal::ExtensionIdentifier<                      \
-              CLASSNAME, _proto_TypeTraits, _field_type,                      \
-              _is_packed>& id) {                                              \
-    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,       \
-                                              _is_packed, &_extensions_);     \
-  }
+// This will ensure that the following lookup will succeed:
+//
+//   DescriptorPool::generated_pool()->FindExtensionByName("Foo.my_extension");
+//
+// This is often relevant for parsing extensions in text mode.
+//
+// As a side-effect, it will also guarantee that anything else from the same
+// .proto file will also be available for lookup in the generated pool.
+//
+// This function does not actually register the extension, so it does not need
+// to be called before the lookup.  However it does need to occur in a function
+// that cannot be stripped from the binary (ie. it must be reachable from main).
+//
+// Best practice is to call this function as close as possible to where the
+// reflection is actually needed.  This function is very cheap to call, so you
+// should not need to worry about its runtime overhead except in tight loops (on
+// x86-64 it compiles into two "mov" instructions).
+template <typename ExtendeeType, typename TypeTraitsType,
+          internal::FieldType field_type, bool is_packed>
+void LinkExtensionReflection(
+    const google::protobuf::internal::ExtensionIdentifier<
+        ExtendeeType, TypeTraitsType, field_type, is_packed>& extension) {
+  internal::StrongReference(extension);
+}
 
-}  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_EXTENSION_SET_H__
index fad3134..91187af 100644 (file)
 // Contains methods defined in extension_set.h which cannot be part of the
 // lite library because they use descriptors or reflection.
 
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
+#include <google/protobuf/stubs/casts.h>
 #include <google/protobuf/descriptor.pb.h>
+#include <google/protobuf/extension_set_inl.h>
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arena.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/extension_set.h>
 #include <google/protobuf/message.h>
+#include <google/protobuf/message_lite.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>
+#include <google/protobuf/wire_format_lite.h>
 
-namespace google {
 
+#include <google/protobuf/port_def.inc>
+
+namespace google {
 namespace protobuf {
 namespace internal {
 
 // A FieldSkipper used to store unknown MessageSet fields into UnknownFieldSet.
-class MessageSetFieldSkipper
-    : public UnknownFieldSetFieldSkipper {
+class MessageSetFieldSkipper : public UnknownFieldSetFieldSkipper {
  public:
   explicit MessageSetFieldSkipper(UnknownFieldSet* unknown_fields)
       : UnknownFieldSetFieldSkipper(unknown_fields) {}
-  virtual ~MessageSetFieldSkipper() {}
+  ~MessageSetFieldSkipper() override {}
 
   virtual bool SkipMessageSetField(io::CodedInputStream* input,
                                    int field_number);
 };
-bool MessageSetFieldSkipper::SkipMessageSetField(
-    io::CodedInputStream* input, int field_number) {
-  uint32 length;
+bool MessageSetFieldSkipper::SkipMessageSetField(io::CodedInputStream* input,
+                                                 int field_number) {
+  uint32_t length;
   if (!input->ReadVarint32(&length)) return false;
-  if (unknown_fields_ == NULL) {
+  if (unknown_fields_ == nullptr) {
     return input->Skip(length);
   } else {
-    return input->ReadString(
-        unknown_fields_->AddLengthDelimited(field_number), length);
+    return input->ReadString(unknown_fields_->AddLengthDelimited(field_number),
+                             length);
   }
 }
 
@@ -84,9 +89,9 @@ class DescriptorPoolExtensionFinder : public ExtensionFinder {
                                 MessageFactory* factory,
                                 const Descriptor* containing_type)
       : pool_(pool), factory_(factory), containing_type_(containing_type) {}
-  virtual ~DescriptorPoolExtensionFinder() {}
+  ~DescriptorPoolExtensionFinder() override {}
 
-  virtual bool Find(int number, ExtensionInfo* output);
+  bool Find(int number, ExtensionInfo* output) override;
 
  private:
   const DescriptorPool* pool_;
@@ -95,16 +100,14 @@ class DescriptorPoolExtensionFinder : public ExtensionFinder {
 };
 
 void ExtensionSet::AppendToList(
-    const Descriptor* containing_type,
-    const DescriptorPool* pool,
+    const Descriptor* containing_type, const DescriptorPool* pool,
     std::vector<const FieldDescriptor*>* output) const {
-  for (ExtensionMap::const_iterator iter = extensions_.begin();
-       iter != extensions_.end(); ++iter) {
+  ForEach([containing_type, pool, &output](int number, const Extension& ext) {
     bool has = false;
-    if (iter->second.is_repeated) {
-      has = iter->second.GetSize() > 0;
+    if (ext.is_repeated) {
+      has = ext.GetSize() > 0;
     } else {
-      has = !iter->second.is_cleared;
+      has = !ext.is_cleared;
     }
 
     if (has) {
@@ -113,14 +116,13 @@ void ExtensionSet::AppendToList(
       //   initialized, so they might not even be constructed until
       //   AppendToList() is called.
 
-      if (iter->second.descriptor == NULL) {
-        output->push_back(pool->FindExtensionByNumber(
-            containing_type, iter->first));
+      if (ext.descriptor == nullptr) {
+        output->push_back(pool->FindExtensionByNumber(containing_type, number));
       } else {
-        output->push_back(iter->second.descriptor);
+        output->push_back(ext.descriptor);
       }
     }
-  }
+  });
 }
 
 inline FieldDescriptor::Type real_type(FieldType type) {
@@ -138,26 +140,26 @@ inline WireFormatLite::FieldType field_type(FieldType type) {
   return static_cast<WireFormatLite::FieldType>(type);
 }
 
-#define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE)                            \
-  GOOGLE_DCHECK_EQ((EXTENSION).is_repeated ? FieldDescriptor::LABEL_REPEATED     \
-                                  : FieldDescriptor::LABEL_OPTIONAL,      \
-            FieldDescriptor::LABEL_##LABEL);                              \
+#define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE)                         \
+  GOOGLE_DCHECK_EQ((EXTENSION).is_repeated ? FieldDescriptor::LABEL_REPEATED  \
+                                    : FieldDescriptor::LABEL_OPTIONAL, \
+            FieldDescriptor::LABEL_##LABEL);                           \
   GOOGLE_DCHECK_EQ(cpp_type((EXTENSION).type), FieldDescriptor::CPPTYPE_##CPPTYPE)
 
 const MessageLite& ExtensionSet::GetMessage(int number,
                                             const Descriptor* message_type,
                                             MessageFactory* factory) const {
-  ExtensionMap::const_iterator iter = extensions_.find(number);
-  if (iter == extensions_.end() || iter->second.is_cleared) {
+  const Extension* extension = FindOrNull(number);
+  if (extension == nullptr || extension->is_cleared) {
     // Not present.  Return the default value.
     return *factory->GetPrototype(message_type);
   } else {
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, MESSAGE);
-    if (iter->second.is_lazy) {
-      return iter->second.lazymessage_value->GetMessage(
-          *factory->GetPrototype(message_type));
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
+    if (extension->is_lazy) {
+      return extension->lazymessage_value->GetMessage(
+          *factory->GetPrototype(message_type), arena_);
     } else {
-      return *iter->second.message_value;
+      return *extension->message_value;
     }
   }
 }
@@ -181,7 +183,7 @@ MessageLite* ExtensionSet::MutableMessage(const FieldDescriptor* descriptor,
     extension->is_cleared = false;
     if (extension->is_lazy) {
       return extension->lazymessage_value->MutableMessage(
-          *factory->GetPrototype(descriptor->message_type()));
+          *factory->GetPrototype(descriptor->message_type()), arena_);
     } else {
       return extension->message_value;
     }
@@ -190,63 +192,64 @@ MessageLite* ExtensionSet::MutableMessage(const FieldDescriptor* descriptor,
 
 MessageLite* ExtensionSet::ReleaseMessage(const FieldDescriptor* descriptor,
                                           MessageFactory* factory) {
-  ExtensionMap::iterator iter = extensions_.find(descriptor->number());
-  if (iter == extensions_.end()) {
-    // Not present.  Return NULL.
-    return NULL;
+  Extension* extension = FindOrNull(descriptor->number());
+  if (extension == nullptr) {
+    // Not present.  Return nullptr.
+    return nullptr;
   } else {
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, MESSAGE);
-    MessageLite* ret = NULL;
-    if (iter->second.is_lazy) {
-      ret = iter->second.lazymessage_value->ReleaseMessage(
-          *factory->GetPrototype(descriptor->message_type()));
-      if (arena_ == NULL) {
-        delete iter->second.lazymessage_value;
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
+    MessageLite* ret = nullptr;
+    if (extension->is_lazy) {
+      ret = extension->lazymessage_value->ReleaseMessage(
+          *factory->GetPrototype(descriptor->message_type()), arena_);
+      if (arena_ == nullptr) {
+        delete extension->lazymessage_value;
       }
     } else {
-      if (arena_ != NULL) {
-        ret = (iter->second.message_value)->New();
-        ret->CheckTypeAndMergeFrom(*(iter->second.message_value));
+      if (arena_ != nullptr) {
+        ret = extension->message_value->New();
+        ret->CheckTypeAndMergeFrom(*extension->message_value);
       } else {
-        ret = iter->second.message_value;
+        ret = extension->message_value;
       }
     }
-    extensions_.erase(descriptor->number());
+    Erase(descriptor->number());
     return ret;
   }
 }
 
 MessageLite* ExtensionSet::UnsafeArenaReleaseMessage(
     const FieldDescriptor* descriptor, MessageFactory* factory) {
-  ExtensionMap::iterator iter = extensions_.find(descriptor->number());
-  if (iter == extensions_.end()) {
-    // Not present.  Return NULL.
-    return NULL;
+  Extension* extension = FindOrNull(descriptor->number());
+  if (extension == nullptr) {
+    // Not present.  Return nullptr.
+    return nullptr;
   } else {
-    GOOGLE_DCHECK_TYPE(iter->second, OPTIONAL, MESSAGE);
-    MessageLite* ret = NULL;
-    if (iter->second.is_lazy) {
-      ret = iter->second.lazymessage_value->UnsafeArenaReleaseMessage(
-          *factory->GetPrototype(descriptor->message_type()));
-      if (arena_ == NULL) {
-        delete iter->second.lazymessage_value;
+    GOOGLE_DCHECK_TYPE(*extension, OPTIONAL, MESSAGE);
+    MessageLite* ret = nullptr;
+    if (extension->is_lazy) {
+      ret = extension->lazymessage_value->UnsafeArenaReleaseMessage(
+          *factory->GetPrototype(descriptor->message_type()), arena_);
+      if (arena_ == nullptr) {
+        delete extension->lazymessage_value;
       }
     } else {
-      ret = iter->second.message_value;
+      ret = extension->message_value;
     }
-    extensions_.erase(descriptor->number());
+    Erase(descriptor->number());
     return ret;
   }
 }
 
-ExtensionSet::Extension* ExtensionSet::MaybeNewRepeatedExtension(const FieldDescriptor* descriptor) {
+ExtensionSet::Extension* ExtensionSet::MaybeNewRepeatedExtension(
+    const FieldDescriptor* descriptor) {
   Extension* extension;
   if (MaybeNewExtension(descriptor->number(), descriptor, &extension)) {
     extension->type = descriptor->type();
     GOOGLE_DCHECK_EQ(cpp_type(extension->type), FieldDescriptor::CPPTYPE_MESSAGE);
     extension->is_repeated = true;
     extension->repeated_message_value =
-        ::google::protobuf::Arena::CreateMessage<RepeatedPtrField<MessageLite> >(arena_);
+        Arena::CreateMessage<RepeatedPtrField<MessageLite> >(arena_);
   } else {
     GOOGLE_DCHECK_TYPE(*extension, REPEATED, MESSAGE);
   }
@@ -259,13 +262,15 @@ MessageLite* ExtensionSet::AddMessage(const FieldDescriptor* descriptor,
 
   // RepeatedPtrField<Message> does not know how to Add() since it cannot
   // allocate an abstract object, so we have to be tricky.
-  MessageLite* result = extension->repeated_message_value
-      ->AddFromCleared<GenericTypeHandler<MessageLite> >();
-  if (result == NULL) {
+  MessageLite* result =
+      reinterpret_cast<internal::RepeatedPtrFieldBase*>(
+          extension->repeated_message_value)
+          ->AddFromCleared<GenericTypeHandler<MessageLite> >();
+  if (result == nullptr) {
     const MessageLite* prototype;
-    if (extension->repeated_message_value->size() == 0) {
+    if (extension->repeated_message_value->empty()) {
       prototype = factory->GetPrototype(descriptor->message_type());
-      GOOGLE_CHECK(prototype != NULL);
+      GOOGLE_CHECK(prototype != nullptr);
     } else {
       prototype = &extension->repeated_message_value->Get(0);
     }
@@ -282,15 +287,22 @@ void ExtensionSet::AddAllocatedMessage(const FieldDescriptor* descriptor,
   extension->repeated_message_value->AddAllocated(new_entry);
 }
 
+void ExtensionSet::UnsafeArenaAddAllocatedMessage(
+    const FieldDescriptor* descriptor, MessageLite* new_entry) {
+  Extension* extension = MaybeNewRepeatedExtension(descriptor);
+
+  extension->repeated_message_value->UnsafeArenaAddAllocated(new_entry);
+}
+
 static bool ValidateEnumUsingDescriptor(const void* arg, int number) {
-  return reinterpret_cast<const EnumDescriptor*>(arg)
-      ->FindValueByNumber(number) != NULL;
+  return reinterpret_cast<const EnumDescriptor*>(arg)->FindValueByNumber(
+             number) != nullptr;
 }
 
 bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
   const FieldDescriptor* extension =
       pool_->FindExtensionByNumber(containing_type_, number);
-  if (extension == NULL) {
+  if (extension == nullptr) {
     return false;
   } else {
     output->type = extension->type();
@@ -298,10 +310,10 @@ bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
     output->is_packed = extension->options().packed();
     output->descriptor = extension;
     if (extension->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-      output->message_prototype =
+      output->message_info.prototype =
           factory_->GetPrototype(extension->message_type());
-      GOOGLE_CHECK(output->message_prototype != NULL)
-          << "Extension factory's GetPrototype() returned NULL for extension: "
+      GOOGLE_CHECK(output->message_info.prototype != nullptr)
+          << "Extension factory's GetPrototype() returned nullptr; extension: "
           << extension->full_name();
     } else if (extension->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
       output->enum_validity_check.func = ValidateEnumUsingDescriptor;
@@ -312,11 +324,63 @@ bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
   }
 }
 
-bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input,
+
+bool ExtensionSet::FindExtension(int wire_type, uint32_t field,
+                                 const Message* containing_type,
+                                 const internal::ParseContext* ctx,
+                                 ExtensionInfo* extension,
+                                 bool* was_packed_on_wire) {
+  if (ctx->data().pool == nullptr) {
+    GeneratedExtensionFinder finder(containing_type);
+    if (!FindExtensionInfoFromFieldNumber(wire_type, field, &finder, extension,
+                                          was_packed_on_wire)) {
+      return false;
+    }
+  } else {
+    DescriptorPoolExtensionFinder finder(ctx->data().pool, ctx->data().factory,
+                                         containing_type->GetDescriptor());
+    if (!FindExtensionInfoFromFieldNumber(wire_type, field, &finder, extension,
+                                          was_packed_on_wire)) {
+      return false;
+    }
+  }
+  return true;
+}
+
+const char* ExtensionSet::ParseField(uint64_t tag, const char* ptr,
+                                     const Message* containing_type,
+                                     internal::InternalMetadata* metadata,
+                                     internal::ParseContext* ctx) {
+  int number = tag >> 3;
+  bool was_packed_on_wire;
+  ExtensionInfo extension;
+  if (!FindExtension(tag & 7, number, containing_type, ctx, &extension,
+                     &was_packed_on_wire)) {
+    return UnknownFieldParse(
+        tag, metadata->mutable_unknown_fields<UnknownFieldSet>(), ptr, ctx);
+  }
+  return ParseFieldWithExtensionInfo<UnknownFieldSet>(
+      number, was_packed_on_wire, extension, metadata, ptr, ctx);
+}
+
+const char* ExtensionSet::ParseFieldMaybeLazily(
+    uint64_t tag, const char* ptr, const Message* containing_type,
+    internal::InternalMetadata* metadata, internal::ParseContext* ctx) {
+  return ParseField(tag, ptr, containing_type, metadata, ctx);
+}
+
+const char* ExtensionSet::ParseMessageSetItem(
+    const char* ptr, const Message* containing_type,
+    internal::InternalMetadata* metadata, internal::ParseContext* ctx) {
+  return ParseMessageSetItemTmpl<Message, UnknownFieldSet>(ptr, containing_type,
+                                                           metadata, ctx);
+}
+
+bool ExtensionSet::ParseField(uint32_t tag, io::CodedInputStream* input,
                               const Message* containing_type,
                               UnknownFieldSet* unknown_fields) {
   UnknownFieldSetFieldSkipper skipper(unknown_fields);
-  if (input->GetExtensionPool() == NULL) {
+  if (input->GetExtensionPool() == nullptr) {
     GeneratedExtensionFinder finder(containing_type);
     return ParseField(tag, input, &finder, &skipper);
   } else {
@@ -331,7 +395,7 @@ bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input,
                                    const Message* containing_type,
                                    UnknownFieldSet* unknown_fields) {
   MessageSetFieldSkipper skipper(unknown_fields);
-  if (input->GetExtensionPool() == NULL) {
+  if (input->GetExtensionPool() == nullptr) {
     GeneratedExtensionFinder finder(containing_type);
     return ParseMessageSet(input, &finder, &skipper);
   } else {
@@ -347,14 +411,10 @@ int ExtensionSet::SpaceUsedExcludingSelf() const {
 }
 
 size_t ExtensionSet::SpaceUsedExcludingSelfLong() const {
-  size_t total_size =
-      extensions_.size() * sizeof(ExtensionMap::value_type);
-  for (ExtensionMap::const_iterator iter = extensions_.begin(),
-       end = extensions_.end();
-       iter != end;
-       ++iter) {
-    total_size += iter->second.SpaceUsedExcludingSelfLong();
-  }
+  size_t total_size = Size() * sizeof(KeyValue);
+  ForEach([&total_size](int /* number */, const Extension& ext) {
+    total_size += ext.SpaceUsedExcludingSelfLong();
+  });
   return total_size;
 }
 
@@ -373,15 +433,15 @@ size_t ExtensionSet::Extension::SpaceUsedExcludingSelfLong() const {
                   repeated_##LOWERCASE##_value->SpaceUsedExcludingSelfLong(); \
     break
 
-      HANDLE_TYPE(  INT32,   int32);
-      HANDLE_TYPE(  INT64,   int64);
-      HANDLE_TYPE( UINT32,  uint32);
-      HANDLE_TYPE( UINT64,  uint64);
-      HANDLE_TYPE(  FLOAT,   float);
-      HANDLE_TYPE( DOUBLE,  double);
-      HANDLE_TYPE(   BOOL,    bool);
-      HANDLE_TYPE(   ENUM,    enum);
-      HANDLE_TYPE( STRING,  string);
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
+      HANDLE_TYPE(FLOAT, float);
+      HANDLE_TYPE(DOUBLE, double);
+      HANDLE_TYPE(BOOL, bool);
+      HANDLE_TYPE(ENUM, enum);
+      HANDLE_TYPE(STRING, string);
 #undef HANDLE_TYPE
 
       case FieldDescriptor::CPPTYPE_MESSAGE:
@@ -389,9 +449,10 @@ size_t ExtensionSet::Extension::SpaceUsedExcludingSelfLong() const {
         // but MessageLite has no SpaceUsedLong(), so we must directly call
         // RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong() with a different
         // type handler.
-        total_size +=
-            sizeof(*repeated_message_value) +
-            RepeatedMessage_SpaceUsedExcludingSelfLong(repeated_message_value);
+        total_size += sizeof(*repeated_message_value) +
+                      RepeatedMessage_SpaceUsedExcludingSelfLong(
+                          reinterpret_cast<internal::RepeatedPtrFieldBase*>(
+                              repeated_message_value));
         break;
     }
   } else {
@@ -415,218 +476,29 @@ size_t ExtensionSet::Extension::SpaceUsedExcludingSelfLong() const {
   return total_size;
 }
 
-// The Serialize*ToArray methods are only needed in the heavy library, as
-// the lite library only generates SerializeWithCachedSizes.
-uint8* ExtensionSet::SerializeWithCachedSizesToArray(int start_field_number,
-                                                     int end_field_number,
-                                                     uint8* target) const {
-  return InternalSerializeWithCachedSizesToArray(
-      start_field_number, end_field_number,
-      google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(),
-      target);
-}
-
-uint8* ExtensionSet::SerializeMessageSetWithCachedSizesToArray(
-    uint8* target) const {
-  return InternalSerializeMessageSetWithCachedSizesToArray(
-      google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic(),
-      target);
-}
-
-uint8* ExtensionSet::InternalSerializeWithCachedSizesToArray(
-    int start_field_number, int end_field_number,
-    bool deterministic, uint8* target) const {
-  ExtensionMap::const_iterator iter;
-  for (iter = extensions_.lower_bound(start_field_number);
-       iter != extensions_.end() && iter->first < end_field_number;
-       ++iter) {
-    target = iter->second.InternalSerializeFieldWithCachedSizesToArray(
-        iter->first, deterministic, target);
-  }
-  return target;
-}
-
-uint8* ExtensionSet::InternalSerializeMessageSetWithCachedSizesToArray(
-    bool deterministic, uint8* target) const {
-  ExtensionMap::const_iterator iter;
-  for (iter = extensions_.begin(); iter != extensions_.end(); ++iter) {
-    target = iter->second.InternalSerializeMessageSetItemWithCachedSizesToArray(
-        iter->first, deterministic, target);
-  }
-  return target;
-}
-
-uint8* ExtensionSet::Extension::InternalSerializeFieldWithCachedSizesToArray(
-    int number, bool deterministic, uint8* target) const {
-  if (is_repeated) {
-    if (is_packed) {
-      if (cached_size == 0) return target;
-
-      target = WireFormatLite::WriteTagToArray(number,
-          WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target);
-      target = WireFormatLite::WriteInt32NoTagToArray(cached_size, target);
-
-      switch (real_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case FieldDescriptor::TYPE_##UPPERCASE:                             \
-          for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {  \
-            target = WireFormatLite::Write##CAMELCASE##NoTagToArray(        \
-              repeated_##LOWERCASE##_value->Get(i), target);                \
-          }                                                                 \
-          break
-
-        HANDLE_TYPE(   INT32,    Int32,   int32);
-        HANDLE_TYPE(   INT64,    Int64,   int64);
-        HANDLE_TYPE(  UINT32,   UInt32,  uint32);
-        HANDLE_TYPE(  UINT64,   UInt64,  uint64);
-        HANDLE_TYPE(  SINT32,   SInt32,   int32);
-        HANDLE_TYPE(  SINT64,   SInt64,   int64);
-        HANDLE_TYPE( FIXED32,  Fixed32,  uint32);
-        HANDLE_TYPE( FIXED64,  Fixed64,  uint64);
-        HANDLE_TYPE(SFIXED32, SFixed32,   int32);
-        HANDLE_TYPE(SFIXED64, SFixed64,   int64);
-        HANDLE_TYPE(   FLOAT,    Float,   float);
-        HANDLE_TYPE(  DOUBLE,   Double,  double);
-        HANDLE_TYPE(    BOOL,     Bool,    bool);
-        HANDLE_TYPE(    ENUM,     Enum,    enum);
-#undef HANDLE_TYPE
-
-        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;
-      }
-    } else {
-      switch (real_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case FieldDescriptor::TYPE_##UPPERCASE:                             \
-          for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {  \
-            target = WireFormatLite::Write##CAMELCASE##ToArray(number,      \
-              repeated_##LOWERCASE##_value->Get(i), target);                \
-          }                                                                 \
-          break
-
-        HANDLE_TYPE(   INT32,    Int32,   int32);
-        HANDLE_TYPE(   INT64,    Int64,   int64);
-        HANDLE_TYPE(  UINT32,   UInt32,  uint32);
-        HANDLE_TYPE(  UINT64,   UInt64,  uint64);
-        HANDLE_TYPE(  SINT32,   SInt32,   int32);
-        HANDLE_TYPE(  SINT64,   SInt64,   int64);
-        HANDLE_TYPE( FIXED32,  Fixed32,  uint32);
-        HANDLE_TYPE( FIXED64,  Fixed64,  uint64);
-        HANDLE_TYPE(SFIXED32, SFixed32,   int32);
-        HANDLE_TYPE(SFIXED64, SFixed64,   int64);
-        HANDLE_TYPE(   FLOAT,    Float,   float);
-        HANDLE_TYPE(  DOUBLE,   Double,  double);
-        HANDLE_TYPE(    BOOL,     Bool,    bool);
-        HANDLE_TYPE(  STRING,   String,  string);
-        HANDLE_TYPE(   BYTES,    Bytes,  string);
-        HANDLE_TYPE(    ENUM,     Enum,    enum);
-#undef HANDLE_TYPE
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE)                        \
-        case FieldDescriptor::TYPE_##UPPERCASE:                             \
-          for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) {  \
-            target = WireFormatLite::InternalWrite##CAMELCASE##ToArray(     \
-                      number, repeated_##LOWERCASE##_value->Get(i),         \
-                      deterministic, target);                               \
-          }                                                                 \
-          break
-
-        HANDLE_TYPE(   GROUP,    Group, message);
-        HANDLE_TYPE( MESSAGE,  Message, message);
-#undef HANDLE_TYPE
-      }
-    }
-  } else if (!is_cleared) {
-    switch (real_type(type)) {
-#define HANDLE_TYPE(UPPERCASE, CAMELCASE, VALUE)                 \
-      case FieldDescriptor::TYPE_##UPPERCASE:                    \
-        target = WireFormatLite::Write##CAMELCASE##ToArray(      \
-            number, VALUE, target); \
-        break
-
-      HANDLE_TYPE(   INT32,    Int32,    int32_value);
-      HANDLE_TYPE(   INT64,    Int64,    int64_value);
-      HANDLE_TYPE(  UINT32,   UInt32,   uint32_value);
-      HANDLE_TYPE(  UINT64,   UInt64,   uint64_value);
-      HANDLE_TYPE(  SINT32,   SInt32,    int32_value);
-      HANDLE_TYPE(  SINT64,   SInt64,    int64_value);
-      HANDLE_TYPE( FIXED32,  Fixed32,   uint32_value);
-      HANDLE_TYPE( FIXED64,  Fixed64,   uint64_value);
-      HANDLE_TYPE(SFIXED32, SFixed32,    int32_value);
-      HANDLE_TYPE(SFIXED64, SFixed64,    int64_value);
-      HANDLE_TYPE(   FLOAT,    Float,    float_value);
-      HANDLE_TYPE(  DOUBLE,   Double,   double_value);
-      HANDLE_TYPE(    BOOL,     Bool,     bool_value);
-      HANDLE_TYPE(  STRING,   String,  *string_value);
-      HANDLE_TYPE(   BYTES,    Bytes,  *string_value);
-      HANDLE_TYPE(    ENUM,     Enum,     enum_value);
-      HANDLE_TYPE(   GROUP,    Group, *message_value);
-#undef HANDLE_TYPE
-      case FieldDescriptor::TYPE_MESSAGE:
-        if (is_lazy) {
-          target = lazymessage_value->InternalWriteMessageToArray(
-              number, deterministic, target);
-        } else {
-          target = WireFormatLite::InternalWriteMessageToArray(
-              number, *message_value, deterministic, target);
-        }
-        break;
-    }
-  }
-  return target;
+uint8_t* ExtensionSet::SerializeMessageSetWithCachedSizesToArray(
+    const MessageLite* extendee, uint8_t* target) const {
+  io::EpsCopyOutputStream stream(
+      target, MessageSetByteSize(),
+      io::CodedOutputStream::IsDefaultSerializationDeterministic());
+  return InternalSerializeMessageSetWithCachedSizesToArray(extendee, target,
+                                                           &stream);
 }
 
-uint8*
-ExtensionSet::Extension::InternalSerializeMessageSetItemWithCachedSizesToArray(
-    int number, bool deterministic, uint8* target) const {
-  if (type != WireFormatLite::TYPE_MESSAGE || is_repeated) {
-    // Not a valid MessageSet extension, but serialize it the normal way.
-    GOOGLE_LOG(WARNING) << "Invalid message set extension.";
-    return InternalSerializeFieldWithCachedSizesToArray(number, deterministic,
-                                                        target);
-  }
-
-  if (is_cleared) return target;
-
-  // Start group.
-  target = io::CodedOutputStream::WriteTagToArray(
-      WireFormatLite::kMessageSetItemStartTag, target);
-  // Write type ID.
-  target = WireFormatLite::WriteUInt32ToArray(
-      WireFormatLite::kMessageSetTypeIdNumber, number, target);
-  // Write message.
-  if (is_lazy) {
-    target = lazymessage_value->InternalWriteMessageToArray(
-        WireFormatLite::kMessageSetMessageNumber, deterministic, target);
-  } else {
-    target = WireFormatLite::InternalWriteMessageToArray(
-        WireFormatLite::kMessageSetMessageNumber, *message_value, deterministic,
-        target);
-  }
-  // End group.
-  target = io::CodedOutputStream::WriteTagToArray(
-      WireFormatLite::kMessageSetItemEndTag, target);
-  return target;
-}
-
-
 bool ExtensionSet::ParseFieldMaybeLazily(
     int wire_type, int field_number, io::CodedInputStream* input,
-    ExtensionFinder* extension_finder,
-    MessageSetFieldSkipper* field_skipper) {
-  return ParseField(WireFormatLite::MakeTag(
-      field_number, static_cast<WireFormatLite::WireType>(wire_type)),
-                    input, extension_finder, field_skipper);
+    ExtensionFinder* extension_finder, MessageSetFieldSkipper* field_skipper) {
+  return ParseField(
+      WireFormatLite::MakeTag(field_number,
+                              static_cast<WireFormatLite::WireType>(wire_type)),
+      input, extension_finder, field_skipper);
 }
 
 bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input,
                                    ExtensionFinder* extension_finder,
                                    MessageSetFieldSkipper* field_skipper) {
   while (true) {
-    const uint32 tag = input->ReadTag();
+    const uint32_t tag = input->ReadTag();
     switch (tag) {
       case 0:
         return true;
@@ -644,171 +516,31 @@ bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input,
   }
 }
 
-bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input,
-                                   const MessageLite* containing_type) {
-  MessageSetFieldSkipper skipper(NULL);
-  GeneratedExtensionFinder finder(containing_type);
-  return ParseMessageSet(input, &finder, &skipper);
-}
-
 bool ExtensionSet::ParseMessageSetItem(io::CodedInputStream* input,
                                        ExtensionFinder* extension_finder,
                                        MessageSetFieldSkipper* field_skipper) {
-  // TODO(kenton):  It would be nice to share code between this and
-  // WireFormatLite::ParseAndMergeMessageSetItem(), but I think the
-  // differences would be hard to factor out.
-
-  // This method parses a group which should contain two fields:
-  //   required int32 type_id = 2;
-  //   required data message = 3;
-
-  uint32 last_type_id = 0;
-
-  // If we see message data before the type_id, we'll append it to this so
-  // we can parse it later.
-  string message_data;
-
-  while (true) {
-    const uint32 tag = input->ReadTagNoLastTag();
-    if (tag == 0) return false;
-
-    switch (tag) {
-      case WireFormatLite::kMessageSetTypeIdTag: {
-        uint32 type_id;
-        if (!input->ReadVarint32(&type_id)) return false;
-        last_type_id = type_id;
-
-        if (!message_data.empty()) {
-          // We saw some message data before the type_id.  Have to parse it
-          // now.
-          io::CodedInputStream sub_input(
-              reinterpret_cast<const uint8*>(message_data.data()),
-              message_data.size());
-          if (!ParseFieldMaybeLazily(WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-                                     last_type_id, &sub_input,
-                                     extension_finder, field_skipper)) {
-            return false;
-          }
-          message_data.clear();
-        }
-
-        break;
-      }
-
-      case WireFormatLite::kMessageSetMessageTag: {
-        if (last_type_id == 0) {
-          // We haven't seen a type_id yet.  Append this data to message_data.
-          string temp;
-          uint32 length;
-          if (!input->ReadVarint32(&length)) return false;
-          if (!input->ReadString(&temp, length)) return false;
-          io::StringOutputStream output_stream(&message_data);
-          io::CodedOutputStream coded_output(&output_stream);
-          coded_output.WriteVarint32(length);
-          coded_output.WriteString(temp);
-        } else {
-          // Already saw type_id, so we can parse this directly.
-          if (!ParseFieldMaybeLazily(WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-                                     last_type_id, input,
-                                     extension_finder, field_skipper)) {
-            return false;
-          }
-        }
-
-        break;
-      }
-
-      case WireFormatLite::kMessageSetItemEndTag: {
-        return true;
-      }
-
-      default: {
-        if (!field_skipper->SkipField(input, tag)) return false;
-      }
+  struct MSFull {
+    bool ParseField(int type_id, io::CodedInputStream* input) {
+      return me->ParseFieldMaybeLazily(
+          WireFormatLite::WIRETYPE_LENGTH_DELIMITED, type_id, input,
+          extension_finder, field_skipper);
     }
-  }
-}
-
-void ExtensionSet::Extension::SerializeMessageSetItemWithCachedSizes(
-    int number,
-    io::CodedOutputStream* output) const {
-  if (type != WireFormatLite::TYPE_MESSAGE || is_repeated) {
-    // Not a valid MessageSet extension, but serialize it the normal way.
-    SerializeFieldWithCachedSizes(number, output);
-    return;
-  }
-
-  if (is_cleared) return;
-
-  // Start group.
-  output->WriteTag(WireFormatLite::kMessageSetItemStartTag);
-
-  // Write type ID.
-  WireFormatLite::WriteUInt32(WireFormatLite::kMessageSetTypeIdNumber,
-                              number,
-                              output);
-  // Write message.
-  if (is_lazy) {
-    lazymessage_value->WriteMessage(
-        WireFormatLite::kMessageSetMessageNumber, output);
-  } else {
-    WireFormatLite::WriteMessageMaybeToArray(
-        WireFormatLite::kMessageSetMessageNumber,
-        *message_value,
-        output);
-  }
-
-  // End group.
-  output->WriteTag(WireFormatLite::kMessageSetItemEndTag);
-}
-
-size_t ExtensionSet::Extension::MessageSetItemByteSize(int number) const {
-  if (type != WireFormatLite::TYPE_MESSAGE || is_repeated) {
-    // Not a valid MessageSet extension, but compute the byte size for it the
-    // normal way.
-    return ByteSize(number);
-  }
-
-  if (is_cleared) return 0;
-
-  size_t our_size = WireFormatLite::kMessageSetItemTagsSize;
-
-  // type_id
-  our_size += io::CodedOutputStream::VarintSize32(number);
 
-  // message
-  size_t message_size = 0;
-  if (is_lazy) {
-    message_size = lazymessage_value->ByteSize();
-  } else {
-    message_size = message_value->ByteSize();
-  }
-
-  our_size += io::CodedOutputStream::VarintSize32(message_size);
-  our_size += message_size;
-
-  return our_size;
-}
-
-void ExtensionSet::SerializeMessageSetWithCachedSizes(
-    io::CodedOutputStream* output) const {
-  for (ExtensionMap::const_iterator iter = extensions_.begin();
-       iter != extensions_.end(); ++iter) {
-    iter->second.SerializeMessageSetItemWithCachedSizes(iter->first, output);
-  }
-}
+    bool SkipField(uint32_t tag, io::CodedInputStream* input) {
+      return field_skipper->SkipField(input, tag);
+    }
 
-size_t ExtensionSet::MessageSetByteSize() const {
-  size_t total_size = 0;
+    ExtensionSet* me;
+    ExtensionFinder* extension_finder;
+    MessageSetFieldSkipper* field_skipper;
+  };
 
-  for (ExtensionMap::const_iterator iter = extensions_.begin();
-       iter != extensions_.end(); ++iter) {
-    total_size += iter->second.MessageSetItemByteSize(iter->first);
-  }
-
-  return total_size;
+  return ParseMessageSetItemImpl(input,
+                                 MSFull{this, extension_finder, field_skipper});
 }
 
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
diff --git a/3rdparty/protobuf/src/google/protobuf/extension_set_inl.h b/3rdparty/protobuf/src/google/protobuf/extension_set_inl.h
new file mode 100644 (file)
index 0000000..291990f
--- /dev/null
@@ -0,0 +1,276 @@
+// 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_EXTENSION_SET_INL_H__
+#define GOOGLE_PROTOBUF_EXTENSION_SET_INL_H__
+
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/metadata_lite.h>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+
+template <typename T>
+const char* ExtensionSet::ParseFieldWithExtensionInfo(
+    int number, bool was_packed_on_wire, const ExtensionInfo& extension,
+    InternalMetadata* metadata, const char* ptr, internal::ParseContext* ctx) {
+  if (was_packed_on_wire) {
+    switch (extension.type) {
+#define HANDLE_TYPE(UPPERCASE, CPP_CAMELCASE)                                \
+  case WireFormatLite::TYPE_##UPPERCASE:                                     \
+    return internal::Packed##CPP_CAMELCASE##Parser(                          \
+        MutableRawRepeatedField(number, extension.type, extension.is_packed, \
+                                extension.descriptor),                       \
+        ptr, ctx);
+      HANDLE_TYPE(INT32, Int32);
+      HANDLE_TYPE(INT64, Int64);
+      HANDLE_TYPE(UINT32, UInt32);
+      HANDLE_TYPE(UINT64, UInt64);
+      HANDLE_TYPE(SINT32, SInt32);
+      HANDLE_TYPE(SINT64, SInt64);
+      HANDLE_TYPE(FIXED32, Fixed32);
+      HANDLE_TYPE(FIXED64, Fixed64);
+      HANDLE_TYPE(SFIXED32, SFixed32);
+      HANDLE_TYPE(SFIXED64, SFixed64);
+      HANDLE_TYPE(FLOAT, Float);
+      HANDLE_TYPE(DOUBLE, Double);
+      HANDLE_TYPE(BOOL, Bool);
+#undef HANDLE_TYPE
+
+      case WireFormatLite::TYPE_ENUM:
+        return internal::PackedEnumParserArg<T>(
+            MutableRawRepeatedField(number, extension.type, extension.is_packed,
+                                    extension.descriptor),
+            ptr, ctx, extension.enum_validity_check.func,
+            extension.enum_validity_check.arg, metadata, number);
+      case WireFormatLite::TYPE_STRING:
+      case WireFormatLite::TYPE_BYTES:
+      case WireFormatLite::TYPE_GROUP:
+      case WireFormatLite::TYPE_MESSAGE:
+        GOOGLE_LOG(FATAL) << "Non-primitive types can't be packed.";
+        break;
+    }
+  } else {
+    switch (extension.type) {
+#define HANDLE_VARINT_TYPE(UPPERCASE, CPP_CAMELCASE)                        \
+  case WireFormatLite::TYPE_##UPPERCASE: {                                  \
+    uint64_t value;                                                         \
+    ptr = VarintParse(ptr, &value);                                         \
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);                                    \
+    if (extension.is_repeated) {                                            \
+      Add##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE,          \
+                         extension.is_packed, value, extension.descriptor); \
+    } else {                                                                \
+      Set##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE, value,   \
+                         extension.descriptor);                             \
+    }                                                                       \
+  } break
+
+      HANDLE_VARINT_TYPE(INT32, Int32);
+      HANDLE_VARINT_TYPE(INT64, Int64);
+      HANDLE_VARINT_TYPE(UINT32, UInt32);
+      HANDLE_VARINT_TYPE(UINT64, UInt64);
+      HANDLE_VARINT_TYPE(BOOL, Bool);
+#undef HANDLE_VARINT_TYPE
+#define HANDLE_SVARINT_TYPE(UPPERCASE, CPP_CAMELCASE, SIZE)                 \
+  case WireFormatLite::TYPE_##UPPERCASE: {                                  \
+    uint64_t val;                                                           \
+    ptr = VarintParse(ptr, &val);                                           \
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);                                    \
+    auto value = WireFormatLite::ZigZagDecode##SIZE(val);                   \
+    if (extension.is_repeated) {                                            \
+      Add##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE,          \
+                         extension.is_packed, value, extension.descriptor); \
+    } else {                                                                \
+      Set##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE, value,   \
+                         extension.descriptor);                             \
+    }                                                                       \
+  } break
+
+      HANDLE_SVARINT_TYPE(SINT32, Int32, 32);
+      HANDLE_SVARINT_TYPE(SINT64, Int64, 64);
+#undef HANDLE_SVARINT_TYPE
+#define HANDLE_FIXED_TYPE(UPPERCASE, CPP_CAMELCASE, CPPTYPE)                \
+  case WireFormatLite::TYPE_##UPPERCASE: {                                  \
+    auto value = UnalignedLoad<CPPTYPE>(ptr);                               \
+    ptr += sizeof(CPPTYPE);                                                 \
+    if (extension.is_repeated) {                                            \
+      Add##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE,          \
+                         extension.is_packed, value, extension.descriptor); \
+    } else {                                                                \
+      Set##CPP_CAMELCASE(number, WireFormatLite::TYPE_##UPPERCASE, value,   \
+                         extension.descriptor);                             \
+    }                                                                       \
+  } break
+
+      HANDLE_FIXED_TYPE(FIXED32, UInt32, uint32_t);
+      HANDLE_FIXED_TYPE(FIXED64, UInt64, uint64_t);
+      HANDLE_FIXED_TYPE(SFIXED32, Int32, int32_t);
+      HANDLE_FIXED_TYPE(SFIXED64, Int64, int64_t);
+      HANDLE_FIXED_TYPE(FLOAT, Float, float);
+      HANDLE_FIXED_TYPE(DOUBLE, Double, double);
+#undef HANDLE_FIXED_TYPE
+
+      case WireFormatLite::TYPE_ENUM: {
+        uint64_t val;
+        ptr = VarintParse(ptr, &val);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        int value = val;
+
+        if (!extension.enum_validity_check.func(
+                extension.enum_validity_check.arg, value)) {
+          WriteVarint(number, val, metadata->mutable_unknown_fields<T>());
+        } else if (extension.is_repeated) {
+          AddEnum(number, WireFormatLite::TYPE_ENUM, extension.is_packed, value,
+                  extension.descriptor);
+        } else {
+          SetEnum(number, WireFormatLite::TYPE_ENUM, value,
+                  extension.descriptor);
+        }
+        break;
+      }
+
+      case WireFormatLite::TYPE_BYTES:
+      case WireFormatLite::TYPE_STRING: {
+        std::string* value =
+            extension.is_repeated
+                ? AddString(number, WireFormatLite::TYPE_STRING,
+                            extension.descriptor)
+                : MutableString(number, WireFormatLite::TYPE_STRING,
+                                extension.descriptor);
+        int size = ReadSize(&ptr);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        return ctx->ReadString(ptr, size, value);
+      }
+
+      case WireFormatLite::TYPE_GROUP: {
+        MessageLite* value =
+            extension.is_repeated
+                ? AddMessage(number, WireFormatLite::TYPE_GROUP,
+                             *extension.message_info.prototype,
+                             extension.descriptor)
+                : MutableMessage(number, WireFormatLite::TYPE_GROUP,
+                                 *extension.message_info.prototype,
+                                 extension.descriptor);
+        uint32_t tag = (number << 3) + WireFormatLite::WIRETYPE_START_GROUP;
+        return ctx->ParseGroup(value, ptr, tag);
+      }
+
+      case WireFormatLite::TYPE_MESSAGE: {
+        MessageLite* value =
+            extension.is_repeated
+                ? AddMessage(number, WireFormatLite::TYPE_MESSAGE,
+                             *extension.message_info.prototype,
+                             extension.descriptor)
+                : MutableMessage(number, WireFormatLite::TYPE_MESSAGE,
+                                 *extension.message_info.prototype,
+                                 extension.descriptor);
+        return ctx->ParseMessage(value, ptr);
+      }
+    }
+  }
+  return ptr;
+}
+
+template <typename Msg, typename T>
+const char* ExtensionSet::ParseMessageSetItemTmpl(
+    const char* ptr, const Msg* extendee, internal::InternalMetadata* metadata,
+    internal::ParseContext* ctx) {
+  std::string payload;
+  uint32_t type_id = 0;
+  bool payload_read = false;
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag = static_cast<uint8_t>(*ptr++);
+    if (tag == WireFormatLite::kMessageSetTypeIdTag) {
+      uint64_t tmp;
+      ptr = ParseBigVarint(ptr, &tmp);
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+      type_id = tmp;
+      if (payload_read) {
+        ExtensionInfo extension;
+        bool was_packed_on_wire;
+        if (!FindExtension(2, type_id, extendee, ctx, &extension,
+                           &was_packed_on_wire)) {
+          WriteLengthDelimited(type_id, payload,
+                               metadata->mutable_unknown_fields<T>());
+        } else {
+          MessageLite* value =
+              extension.is_repeated
+                  ? AddMessage(type_id, WireFormatLite::TYPE_MESSAGE,
+                               *extension.message_info.prototype,
+                               extension.descriptor)
+                  : MutableMessage(type_id, WireFormatLite::TYPE_MESSAGE,
+                                   *extension.message_info.prototype,
+                                   extension.descriptor);
+
+          const char* p;
+          // We can't use regular parse from string as we have to track
+          // proper recursion depth and descriptor pools.
+          ParseContext tmp_ctx(ctx->depth(), false, &p, payload);
+          tmp_ctx.data().pool = ctx->data().pool;
+          tmp_ctx.data().factory = ctx->data().factory;
+          GOOGLE_PROTOBUF_PARSER_ASSERT(value->_InternalParse(p, &tmp_ctx) &&
+                                         tmp_ctx.EndedAtLimit());
+        }
+        type_id = 0;
+      }
+    } else if (tag == WireFormatLite::kMessageSetMessageTag) {
+      if (type_id != 0) {
+        ptr = ParseFieldMaybeLazily(static_cast<uint64_t>(type_id) * 8 + 2, ptr,
+                                    extendee, metadata, ctx);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr);
+        type_id = 0;
+      } else {
+        int32_t size = ReadSize(&ptr);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        ptr = ctx->ReadString(ptr, size, &payload);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        payload_read = true;
+      }
+    } else {
+      ptr = ReadTag(ptr - 1, &tag);
+      if (tag == 0 || (tag & 7) == 4) {
+        ctx->SetLastTag(tag);
+        return ptr;
+      }
+      ptr = ParseField(tag, ptr, extendee, metadata, ctx);
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+    }
+  }
+  return ptr;
+}
+
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
+
+#endif  // GOOGLE_PROTOBUF_EXTENSION_SET_INL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/field_access_listener.h b/3rdparty/protobuf/src/google/protobuf/field_access_listener.h
new file mode 100644 (file)
index 0000000..47422e6
--- /dev/null
@@ -0,0 +1,172 @@
+// 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_FIELD_ACCESS_LISTENER_H__
+#define GOOGLE_PROTOBUF_FIELD_ACCESS_LISTENER_H__
+
+#include <cstddef>
+
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/message_lite.h>
+
+
+namespace google {
+namespace protobuf {
+
+// A default/no-op implementation of message hooks.
+//
+// See go/statically-dispatched-message-hooks for details.
+template <typename Proto>
+struct NoOpAccessListener {
+  // Number of fields are provided at compile time for the trackers to be able
+  // to have stack allocated bitmaps for the fields. This is useful for
+  // performance critical trackers. This is also to avoid cyclic dependencies
+  // if the number of fields is needed.
+  static constexpr int kFields = Proto::_kInternalFieldNumber;
+  // Default constructor is called during the static global initialization of
+  // the program.
+  // We provide a pointer to extract the name of the proto not to get cyclic
+  // dependencies on GetDescriptor() and OnGetMetadata() calls. If you want
+  // to differentiate the protos during the runtime before the start of the
+  // program, use this functor to get its name. We either way need it for
+  // LITE_RUNTIME protos as they don't have descriptors at all.
+  explicit NoOpAccessListener(StringPiece (*name_extractor)()) {}
+  // called repeatedly during serialization/deserialization/ByteSize of
+  // Reflection as:
+  //   AccessListener<MessageT>::OnSerialize(this);
+  static void OnSerialize(const MessageLite* msg) {}
+  static void OnDeserialize(const MessageLite* msg) {}
+  static void OnByteSize(const MessageLite* msg) {}
+  static void OnMergeFrom(const MessageLite* to, const MessageLite* from) {}
+
+  // NOTE: This function can be called pre-main. Make sure it does not make
+  // the state of the listener invalid.
+  static void OnGetMetadata() {}
+
+  // called from accessors as:
+  //   AccessListener<MessageT>::On$operation(this, &field_storage_);
+  // If you need to override this with type, in your hook implementation
+  // introduce
+  // template <int kFieldNum, typename T>
+  // static void On$operation(const MessageLite* msg,
+  //                          const T* field) {}
+  // And overloads for std::nullptr_t for incomplete types such as Messages,
+  // Maps. Extract them using reflection if you need. Consequently, second
+  // argument can be null pointer.
+  // For an example, see proto_hooks/testing/memory_test_field_listener.h
+  // And argument template deduction will deduce the type itself without
+  // changing the generated code.
+
+  // add_<field>(f)
+  template <int kFieldNum>
+  static void OnAdd(const MessageLite* msg, const void* field) {}
+
+  // add_<field>()
+  template <int kFieldNum>
+  static void OnAddMutable(const MessageLite* msg, const void* field) {}
+
+  // <field>() and <repeated_field>(i)
+  template <int kFieldNum>
+  static void OnGet(const MessageLite* msg, const void* field) {}
+
+  // clear_<field>()
+  template <int kFieldNum>
+  static void OnClear(const MessageLite* msg, const void* field) {}
+
+  // has_<field>()
+  template <int kFieldNum>
+  static void OnHas(const MessageLite* msg, const void* field) {}
+
+  // <repeated_field>()
+  template <int kFieldNum>
+  static void OnList(const MessageLite* msg, const void* field) {}
+
+  // mutable_<field>()
+  template <int kFieldNum>
+  static void OnMutable(const MessageLite* msg, const void* field) {}
+
+  // mutable_<repeated_field>()
+  template <int kFieldNum>
+  static void OnMutableList(const MessageLite* msg, const void* field) {}
+
+  // release_<field>()
+  template <int kFieldNum>
+  static void OnRelease(const MessageLite* msg, const void* field) {}
+
+  // set_<field>() and set_<repeated_field>(i)
+  template <int kFieldNum>
+  static void OnSet(const MessageLite* msg, const void* field) {}
+
+  // <repeated_field>_size()
+  template <int kFieldNum>
+  static void OnSize(const MessageLite* msg, const void* field) {}
+
+  static void OnHasExtension(const MessageLite* msg, int extension_tag,
+                             const void* field) {}
+  // TODO(b/190614678): Support clear in the proto compiler.
+  static void OnClearExtension(const MessageLite* msg, int extension_tag,
+                               const void* field) {}
+  static void OnExtensionSize(const MessageLite* msg, int extension_tag,
+                              const void* field) {}
+  static void OnGetExtension(const MessageLite* msg, int extension_tag,
+                             const void* field) {}
+  static void OnMutableExtension(const MessageLite* msg, int extension_tag,
+                                 const void* field) {}
+  static void OnSetExtension(const MessageLite* msg, int extension_tag,
+                             const void* field) {}
+  static void OnReleaseExtension(const MessageLite* msg, int extension_tag,
+                                 const void* field) {}
+  static void OnAddExtension(const MessageLite* msg, int extension_tag,
+                             const void* field) {}
+  static void OnAddMutableExtension(const MessageLite* msg, int extension_tag,
+                                    const void* field) {}
+  static void OnListExtension(const MessageLite* msg, int extension_tag,
+                              const void* field) {}
+  static void OnMutableListExtension(const MessageLite* msg, int extension_tag,
+                                     const void* field) {}
+};
+
+}  // namespace protobuf
+}  // namespace google
+
+#ifndef REPLACE_PROTO_LISTENER_IMPL
+namespace google {
+namespace protobuf {
+template <class T>
+using AccessListener = NoOpAccessListener<T>;
+}  // namespace protobuf
+}  // namespace google
+#else
+// You can put your implementations of hooks/listeners here.
+// All hooks are subject to approval by protobuf-team@.
+
+#endif  // !REPLACE_PROTO_LISTENER_IMPL
+
+#endif  // GOOGLE_PROTOBUF_FIELD_ACCESS_LISTENER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/field_mask.pb.cc b/3rdparty/protobuf/src/google/protobuf/field_mask.pb.cc
deleted file mode 100644 (file)
index c55a697..0000000
+++ /dev/null
@@ -1,373 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/field_mask.proto
-
-#include <google/protobuf/field_mask.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class FieldMaskDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_FieldMask_default_instance_;
-    new (ptr) ::google::protobuf::FieldMask();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::google::protobuf::FieldMask::InitAsDefaultInstance();
-}
-
-void InitDefaultsFieldMask() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFieldMaskImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[1];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::FieldMask, paths_),
-};
-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*>(&::google::protobuf::_FieldMask_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/field_mask.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "\001Z9google.golang.org/genproto/protobuf/f"
-      "ield_mask;field_mask\242\002\003GPB\252\002\036Google.Prot"
-      "obuf.WellKnownTypesb\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 227);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/field_mask.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_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
-
-FieldMask::FieldMask()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaultsFieldMask();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.FieldMask)
-}
-FieldMask::FieldMask(const FieldMask& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      paths_(from.paths_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldMask)
-}
-
-void FieldMask::SharedCtor() {
-  _cached_size_ = 0;
-}
-
-FieldMask::~FieldMask() {
-  // @@protoc_insertion_point(destructor:google.protobuf.FieldMask)
-  SharedDtor();
-}
-
-void FieldMask::SharedDtor() {
-}
-
-void FieldMask::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const FieldMask& FieldMask::default_instance() {
-  ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaultsFieldMask();
-  return *internal_default_instance();
-}
-
-FieldMask* FieldMask::New(::google::protobuf::Arena* arena) const {
-  FieldMask* n = new FieldMask;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void FieldMask::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.FieldMask)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  paths_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FieldMask::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.FieldMask)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated string paths = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_paths()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->paths(this->paths_size() - 1).data(),
-            static_cast<int>(this->paths(this->paths_size() - 1).length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.FieldMask.paths"));
-        } 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.FieldMask)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.FieldMask)
-  return false;
-#undef DO_
-}
-
-void FieldMask::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.FieldMask)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated string paths = 1;
-  for (int i = 0, n = this->paths_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->paths(i).data(), static_cast<int>(this->paths(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.FieldMask.paths");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      1, this->paths(i), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.FieldMask)
-}
-
-::google::protobuf::uint8* FieldMask::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated string paths = 1;
-  for (int i = 0, n = this->paths_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->paths(i).data(), static_cast<int>(this->paths(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.FieldMask.paths");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(1, this->paths(i), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldMask)
-  return target;
-}
-
-size_t FieldMask::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldMask)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // repeated string paths = 1;
-  total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->paths_size());
-  for (int i = 0, n = this->paths_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->paths(i));
-  }
-
-  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = cached_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void FieldMask::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldMask)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FieldMask* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FieldMask>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldMask)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldMask)
-    MergeFrom(*source);
-  }
-}
-
-void FieldMask::MergeFrom(const FieldMask& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldMask)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  paths_.MergeFrom(from.paths_);
-}
-
-void FieldMask::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FieldMask)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void FieldMask::CopyFrom(const FieldMask& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FieldMask)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool FieldMask::IsInitialized() const {
-  return true;
-}
-
-void FieldMask::Swap(FieldMask* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void FieldMask::InternalSwap(FieldMask* other) {
-  using std::swap;
-  paths_.InternalSwap(&other->paths_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::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];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
index d57a449..4114740 100644 (file)
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: google/protobuf/field_mask.proto
 
-#ifndef PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ffield_5fmask_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ffield_5fmask_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include <google/protobuf/unknown_field_set.h>
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ffield_5fmask_2eproto PROTOBUF_EXPORT
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_google_2fprotobuf_2ffield_5fmask_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[1];
-  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
-  static const ::google::protobuf::internal::SerializationTable serialization_table[];
-  static const ::google::protobuf::uint32 offsets[];
+struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void LIBPROTOBUF_EXPORT AddDescriptors();
-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 {
+PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto;
+PROTOBUF_NAMESPACE_OPEN
 class FieldMask;
-class FieldMaskDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern FieldMaskDefaultTypeInternal _FieldMask_default_instance_;
-}  // namespace protobuf
-}  // namespace google
-namespace google {
-namespace protobuf {
+struct FieldMaskDefaultTypeInternal;
+PROTOBUF_EXPORT extern FieldMaskDefaultTypeInternal _FieldMask_default_instance_;
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::FieldMask* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldMask>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
+PROTOBUF_NAMESPACE_OPEN
 
 // ===================================================================
 
-class LIBPROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldMask) */ {
+class PROTOBUF_EXPORT FieldMask final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldMask) */ {
  public:
-  FieldMask();
-  virtual ~FieldMask();
+  inline FieldMask() : FieldMask(nullptr) {}
+  ~FieldMask() override;
+  explicit constexpr FieldMask(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FieldMask(const FieldMask& from);
-
-  inline FieldMask& operator=(const FieldMask& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FieldMask(FieldMask&& from) noexcept
     : FieldMask() {
     *this = ::std::move(from);
   }
 
+  inline FieldMask& operator=(const FieldMask& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FieldMask& operator=(FieldMask&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const FieldMask& default_instance();
 
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FieldMask& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const FieldMask* internal_default_instance() {
     return reinterpret_cast<const FieldMask*>(
                &_FieldMask_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void Swap(FieldMask* other);
   friend void swap(FieldMask& a, FieldMask& b) {
     a.Swap(&b);
   }
+  inline void Swap(FieldMask* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FieldMask* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FieldMask* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FieldMask* 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;
+  FieldMask* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FieldMask>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FieldMask& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FieldMask& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FieldMask* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "google.protobuf.FieldMask";
   }
+  protected:
+  explicit FieldMask(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kPathsFieldNumber = 1,
+  };
   // repeated string paths = 1;
   int paths_size() const;
+  private:
+  int _internal_paths_size() const;
+  public:
   void clear_paths();
-  static const int kPathsFieldNumber = 1;
-  const ::std::string& paths(int index) const;
-  ::std::string* mutable_paths(int index);
-  void set_paths(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_paths(int index, ::std::string&& value);
-  #endif
+  const std::string& paths(int index) const;
+  std::string* mutable_paths(int index);
+  void set_paths(int index, const std::string& value);
+  void set_paths(int index, std::string&& value);
   void set_paths(int index, const char* value);
   void set_paths(int index, const char* value, size_t size);
-  ::std::string* add_paths();
-  void add_paths(const ::std::string& value);
-  #if LANG_CXX11
-  void add_paths(::std::string&& value);
-  #endif
+  std::string* add_paths();
+  void add_paths(const std::string& value);
+  void add_paths(std::string&& value);
   void add_paths(const char* value);
   void add_paths(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& paths() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_paths();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& paths() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_paths();
+  private:
+  const std::string& _internal_paths(int index) const;
+  std::string* _internal_add_paths();
+  public:
 
   // @@protoc_insertion_point(class_scope:google.protobuf.FieldMask)
  private:
-
-  ::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 void ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaultsFieldMaskImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> paths_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto;
 };
 // ===================================================================
 
@@ -185,32 +236,41 @@ class LIBPROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@pro
 // FieldMask
 
 // repeated string paths = 1;
-inline int FieldMask::paths_size() const {
+inline int FieldMask::_internal_paths_size() const {
   return paths_.size();
 }
+inline int FieldMask::paths_size() const {
+  return _internal_paths_size();
+}
 inline void FieldMask::clear_paths() {
   paths_.Clear();
 }
-inline const ::std::string& FieldMask::paths(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FieldMask.paths)
+inline std::string* FieldMask::add_paths() {
+  std::string* _s = _internal_add_paths();
+  // @@protoc_insertion_point(field_add_mutable:google.protobuf.FieldMask.paths)
+  return _s;
+}
+inline const std::string& FieldMask::_internal_paths(int index) const {
   return paths_.Get(index);
 }
-inline ::std::string* FieldMask::mutable_paths(int index) {
+inline const std::string& FieldMask::paths(int index) const {
+  // @@protoc_insertion_point(field_get:google.protobuf.FieldMask.paths)
+  return _internal_paths(index);
+}
+inline std::string* FieldMask::mutable_paths(int index) {
   // @@protoc_insertion_point(field_mutable:google.protobuf.FieldMask.paths)
   return paths_.Mutable(index);
 }
-inline void FieldMask::set_paths(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths)
+inline void FieldMask::set_paths(int index, const std::string& value) {
   paths_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void FieldMask::set_paths(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths)
+}
+inline void FieldMask::set_paths(int index, std::string&& value) {
   paths_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths)
 }
-#endif
 inline void FieldMask::set_paths(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   paths_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths)
 }
@@ -219,22 +279,19 @@ inline void FieldMask::set_paths(int index, const char* value, size_t size) {
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldMask.paths)
 }
-inline ::std::string* FieldMask::add_paths() {
-  // @@protoc_insertion_point(field_add_mutable:google.protobuf.FieldMask.paths)
+inline std::string* FieldMask::_internal_add_paths() {
   return paths_.Add();
 }
-inline void FieldMask::add_paths(const ::std::string& value) {
+inline void FieldMask::add_paths(const std::string& value) {
   paths_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths)
 }
-#if LANG_CXX11
-inline void FieldMask::add_paths(::std::string&& value) {
+inline void FieldMask::add_paths(std::string&& value) {
   paths_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths)
 }
-#endif
 inline void FieldMask::add_paths(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   paths_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths)
 }
@@ -242,12 +299,12 @@ inline 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)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 FieldMask::paths() const {
   // @@protoc_insertion_point(field_list:google.protobuf.FieldMask.paths)
   return paths_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 FieldMask::mutable_paths() {
   // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldMask.paths)
   return &paths_;
@@ -259,9 +316,9 @@ FieldMask::mutable_paths() {
 
 // @@protoc_insertion_point(namespace_scope)
 
-}  // namespace protobuf
-}  // namespace google
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2ffield_5fmask_2eproto
index fdcdc27..5debc0a 100644 (file)
 
 #include <string>
 
-#include <google/protobuf/stubs/template_util.h>
 #include <google/protobuf/generated_enum_util.h>
+#include <google/protobuf/port.h>
+#include <google/protobuf/stubs/strutil.h>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
-  class EnumDescriptor;
+class EnumDescriptor;
 }  // namespace protobuf
+}  // namespace google
 
+namespace google {
 namespace protobuf {
 
 // Returns the EnumDescriptor for enum type E, which must be a
@@ -59,16 +68,14 @@ const EnumDescriptor* GetEnumDescriptor();
 
 namespace internal {
 
-// Helper for EnumType_Parse functions: try to parse the string 'name' as an
-// enum name of the given type, returning true and filling in value on success,
-// or returning false and leaving value unchanged on failure.
-LIBPROTOBUF_EXPORT bool ParseNamedEnum(const EnumDescriptor* descriptor,
-                    const string& name,
-                    int* value);
+// Helper for EnumType_Parse functions: try to parse the string 'name' as
+// an enum name of the given type, returning true and filling in value on
+// success, or returning false and leaving value unchanged on failure.
+PROTOBUF_EXPORT bool ParseNamedEnum(const EnumDescriptor* descriptor,
+                                    ConstStringParam name, int* value);
 
-template<typename EnumType>
-bool ParseNamedEnum(const EnumDescriptor* descriptor,
-                    const string& name,
+template <typename EnumType>
+bool ParseNamedEnum(const EnumDescriptor* descriptor, ConstStringParam name,
                     EnumType* value) {
   int tmp;
   if (!ParseNamedEnum(descriptor, name, &tmp)) return false;
@@ -79,10 +86,13 @@ bool ParseNamedEnum(const EnumDescriptor* descriptor,
 // Just a wrapper around printing the name of a value. The main point of this
 // function is not to be inlined, so that you can do this without including
 // descriptor.h.
-LIBPROTOBUF_EXPORT const string& NameOfEnum(const EnumDescriptor* descriptor, int value);
+PROTOBUF_EXPORT const std::string& NameOfEnum(const EnumDescriptor* descriptor,
+                                              int value);
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__
index e424205..f1002e2 100644 (file)
 #ifndef GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__
 #define GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__
 
-#include <google/protobuf/stubs/template_util.h>
+#include <type_traits>
+
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/stubs/strutil.h>
+
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
 
 // This type trait can be used to cause templates to only match proto2 enum
 // types.
-template <typename T> struct is_proto_enum : ::google::protobuf::internal::false_type {};
+template <typename T>
+struct is_proto_enum : ::std::false_type {};
 
-}  // namespace protobuf
+namespace internal {
+
+// The table entry format for storing enum name-to-value mapping used with lite
+// protos. This struct and the following related functions should only be used
+// by protobuf generated code.
+struct EnumEntry {
+  StringPiece name;
+  int value;
+};
+
+// Looks up a numeric enum value given the string name.
+PROTOBUF_EXPORT bool LookUpEnumValue(const EnumEntry* enums, size_t size,
+                                     StringPiece name, int* value);
 
+// Looks up an enum name given the numeric value.
+PROTOBUF_EXPORT int LookUpEnumName(const EnumEntry* enums,
+                                   const int* sorted_indices, size_t size,
+                                   int value);
+
+// Initializes the list of enum names in std::string form.
+PROTOBUF_EXPORT bool InitializeEnumStrings(
+    const EnumEntry* enums, const int* sorted_indices, size_t size,
+    internal::ExplicitlyConstructed<std::string>* enum_strings);
+
+}  // namespace internal
+}  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/generated_message_bases.h b/3rdparty/protobuf/src/google/protobuf/generated_message_bases.h
new file mode 100644 (file)
index 0000000..29ab66b
--- /dev/null
@@ -0,0 +1,87 @@
+// 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.
+
+// This file contains helpers for generated code.
+//
+//  Nothing in this file should be directly referenced by users of protobufs.
+
+#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__
+#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__
+
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/zero_copy_stream_impl.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/message.h>
+
+// Must come last:
+#include <google/protobuf/port_def.inc>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+
+// To save code size, protos without any fields are derived from ZeroFieldsBase
+// rather than Message.
+class PROTOBUF_EXPORT ZeroFieldsBase : public Message {
+ public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final { return true; }
+  size_t ByteSizeLong() const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+  const char* _InternalParse(const char* ptr,
+                             internal::ParseContext* ctx) final;
+  ::uint8_t* _InternalSerialize(::uint8_t* target,
+                                io::EpsCopyOutputStream* stream) const final;
+
+ protected:
+  constexpr ZeroFieldsBase() {}
+  explicit ZeroFieldsBase(Arena* arena, bool is_message_owned)
+      : Message(arena, is_message_owned) {}
+  ZeroFieldsBase(const ZeroFieldsBase&) = delete;
+  ZeroFieldsBase& operator=(const ZeroFieldsBase&) = delete;
+  ~ZeroFieldsBase() override;
+
+  void SetCachedSize(int size) const final { _cached_size_.Set(size); }
+
+  static void MergeImpl(Message* to, const Message& from);
+  static void CopyImpl(Message* to, const Message& from);
+  void InternalSwap(ZeroFieldsBase* other);
+
+  mutable internal::CachedSize _cached_size_;
+};
+
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
+#endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__
index f0f207e..cf7cd85 100644 (file)
@@ -32,6 +32,8 @@
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
+#include <google/protobuf/generated_message_reflection.h>
+
 #include <algorithm>
 #include <set>
 
 #include <google/protobuf/descriptor.pb.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/extension_set.h>
-#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/inlined_string_field.h>
 #include <google/protobuf/map_field.h>
+#include <google/protobuf/map_field_inl.h>
+#include <google/protobuf/stubs/mutex.h>
 #include <google/protobuf/repeated_field.h>
+#include <google/protobuf/unknown_field_set.h>
 #include <google/protobuf/wire_format.h>
+#include <google/protobuf/stubs/casts.h>
+#include <google/protobuf/stubs/strutil.h>
+
 
+// clang-format off
+#include <google/protobuf/port_def.inc>
+// clang-format on
 
 #define GOOGLE_PROTOBUF_HAS_ONEOF
 
+using google::protobuf::internal::ArenaStringPtr;
+using google::protobuf::internal::DescriptorTable;
+using google::protobuf::internal::ExtensionSet;
+using google::protobuf::internal::GenericTypeHandler;
+using google::protobuf::internal::GetEmptyString;
+using google::protobuf::internal::InlinedStringField;
+using google::protobuf::internal::InternalMetadata;
+using google::protobuf::internal::LazyField;
+using google::protobuf::internal::MapFieldBase;
+using google::protobuf::internal::MigrationSchema;
+using google::protobuf::internal::OnShutdownDelete;
+using google::protobuf::internal::ReflectionSchema;
+using google::protobuf::internal::RepeatedPtrFieldBase;
+using google::protobuf::internal::StringSpaceUsedExcludingSelfLong;
+using google::protobuf::internal::WrappedMutex;
+
 namespace google {
 namespace protobuf {
-namespace internal {
 
 namespace {
-bool IsMapFieldInApi(const FieldDescriptor* field) {
-  return field->is_map();
+bool IsMapFieldInApi(const FieldDescriptor* field) { return field->is_map(); }
+
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+Message* MaybeForceCopy(Arena* arena, Message* msg) {
+  if (arena != nullptr || msg == nullptr) return msg;
+
+  Message* copy = msg->New();
+  copy->MergeFrom(*msg);
+  delete msg;
+  return copy;
 }
+#endif  // PROTOBUF_FORCE_COPY_IN_RELEASE
 }  // anonymous namespace
 
-bool ParseNamedEnum(const EnumDescriptor* descriptor,
-                    const string& name,
+namespace internal {
+
+bool ParseNamedEnum(const EnumDescriptor* descriptor, ConstStringParam name,
                     int* value) {
   const EnumValueDescriptor* d = descriptor->FindValueByName(name);
-  if (d == NULL) return false;
+  if (d == nullptr) return false;
   *value = d->number();
   return true;
 }
 
-const string& NameOfEnum(const EnumDescriptor* descriptor, int value) {
+const std::string& NameOfEnum(const EnumDescriptor* descriptor, int value) {
   const EnumValueDescriptor* d = descriptor->FindValueByNumber(value);
-  return (d == NULL ? GetEmptyString() : d->name());
+  return (d == nullptr ? GetEmptyString() : d->name());
 }
 
+}  // namespace internal
+
 // ===================================================================
 // Helpers for reporting usage errors (e.g. trying to use GetInt32() on
 // a string field).
 
 namespace {
 
-template <class To>
-To* GetPointerAtOffset(Message* message, uint32 offset) {
-  return reinterpret_cast<To*>(reinterpret_cast<char*>(message) + offset);
-}
-
-template <class To>
-const To* GetConstPointerAtOffset(const Message* message, uint32 offset) {
-  return reinterpret_cast<const To*>(reinterpret_cast<const char*>(message) +
-                                     offset);
-}
-
-template <class To>
-const To& GetConstRefAtOffset(const Message& message, uint32 offset) {
-  return *GetConstPointerAtOffset<To>(&message, offset);
-}
-
-void ReportReflectionUsageError(
-    const Descriptor* descriptor, const FieldDescriptor* field,
-    const char* method, const char* description) {
-  GOOGLE_LOG(FATAL)
-    << "Protocol Buffer reflection usage error:\n"
-       "  Method      : google::protobuf::Reflection::" << method << "\n"
-       "  Message type: " << descriptor->full_name() << "\n"
-       "  Field       : " << field->full_name() << "\n"
-       "  Problem     : " << description;
+using internal::GetConstPointerAtOffset;
+using internal::GetConstRefAtOffset;
+using internal::GetPointerAtOffset;
+
+void ReportReflectionUsageError(const Descriptor* descriptor,
+                                const FieldDescriptor* field,
+                                const char* method, const char* description) {
+  GOOGLE_LOG(FATAL) << "Protocol Buffer reflection usage error:\n"
+                "  Method      : google::protobuf::Reflection::"
+             << method
+             << "\n"
+                "  Message type: "
+             << descriptor->full_name()
+             << "\n"
+                "  Field       : "
+             << field->full_name()
+             << "\n"
+                "  Problem     : "
+             << description;
 }
 
 const char* cpptype_names_[FieldDescriptor::MAX_CPPTYPE + 1] = {
-  "INVALID_CPPTYPE",
-  "CPPTYPE_INT32",
-  "CPPTYPE_INT64",
-  "CPPTYPE_UINT32",
-  "CPPTYPE_UINT64",
-  "CPPTYPE_DOUBLE",
-  "CPPTYPE_FLOAT",
-  "CPPTYPE_BOOL",
-  "CPPTYPE_ENUM",
-  "CPPTYPE_STRING",
-  "CPPTYPE_MESSAGE"
-};
+    "INVALID_CPPTYPE", "CPPTYPE_INT32",  "CPPTYPE_INT64",  "CPPTYPE_UINT32",
+    "CPPTYPE_UINT64",  "CPPTYPE_DOUBLE", "CPPTYPE_FLOAT",  "CPPTYPE_BOOL",
+    "CPPTYPE_ENUM",    "CPPTYPE_STRING", "CPPTYPE_MESSAGE"};
 
 static void ReportReflectionUsageTypeError(
     const Descriptor* descriptor, const FieldDescriptor* field,
-    const char* method,
-    FieldDescriptor::CppType expected_type) {
+    const char* method, FieldDescriptor::CppType expected_type) {
   GOOGLE_LOG(FATAL)
-    << "Protocol Buffer reflection usage error:\n"
-       "  Method      : google::protobuf::Reflection::" << method << "\n"
-       "  Message type: " << descriptor->full_name() << "\n"
-       "  Field       : " << field->full_name() << "\n"
-       "  Problem     : Field is not the right type for this message:\n"
-       "    Expected  : " << cpptype_names_[expected_type] << "\n"
-       "    Field type: " << cpptype_names_[field->cpp_type()];
+      << "Protocol Buffer reflection usage error:\n"
+         "  Method      : google::protobuf::Reflection::"
+      << method
+      << "\n"
+         "  Message type: "
+      << descriptor->full_name()
+      << "\n"
+         "  Field       : "
+      << field->full_name()
+      << "\n"
+         "  Problem     : Field is not the right type for this message:\n"
+         "    Expected  : "
+      << cpptype_names_[expected_type]
+      << "\n"
+         "    Field type: "
+      << cpptype_names_[field->cpp_type()];
 }
 
 static void ReportReflectionUsageEnumTypeError(
     const Descriptor* descriptor, const FieldDescriptor* field,
     const char* method, const EnumValueDescriptor* value) {
-  GOOGLE_LOG(FATAL)
-    << "Protocol Buffer reflection usage error:\n"
-       "  Method      : google::protobuf::Reflection::" << method << "\n"
-       "  Message type: " << descriptor->full_name() << "\n"
-       "  Field       : " << field->full_name() << "\n"
-       "  Problem     : Enum value did not match field type:\n"
-       "    Expected  : " << field->enum_type()->full_name() << "\n"
-       "    Actual    : " << value->full_name();
-}
-
-#define USAGE_CHECK(CONDITION, METHOD, ERROR_DESCRIPTION)                      \
-  if (!(CONDITION))                                                            \
-    ReportReflectionUsageError(descriptor_, field, #METHOD, ERROR_DESCRIPTION)
-#define USAGE_CHECK_EQ(A, B, METHOD, ERROR_DESCRIPTION)                        \
+  GOOGLE_LOG(FATAL) << "Protocol Buffer reflection usage error:\n"
+                "  Method      : google::protobuf::Reflection::"
+             << method
+             << "\n"
+                "  Message type: "
+             << descriptor->full_name()
+             << "\n"
+                "  Field       : "
+             << field->full_name()
+             << "\n"
+                "  Problem     : Enum value did not match field type:\n"
+                "    Expected  : "
+             << field->enum_type()->full_name()
+             << "\n"
+                "    Actual    : "
+             << value->full_name();
+}
+
+inline void CheckInvalidAccess(const internal::ReflectionSchema& schema,
+                               const FieldDescriptor* field) {
+  GOOGLE_CHECK(!schema.IsFieldStripped(field))
+      << "invalid access to a stripped field " << field->full_name();
+}
+
+#define USAGE_CHECK(CONDITION, METHOD, ERROR_DESCRIPTION) \
+  if (!(CONDITION))                                       \
+  ReportReflectionUsageError(descriptor_, field, #METHOD, ERROR_DESCRIPTION)
+#define USAGE_CHECK_EQ(A, B, METHOD, ERROR_DESCRIPTION) \
   USAGE_CHECK((A) == (B), METHOD, ERROR_DESCRIPTION)
-#define USAGE_CHECK_NE(A, B, METHOD, ERROR_DESCRIPTION)                        \
+#define USAGE_CHECK_NE(A, B, METHOD, ERROR_DESCRIPTION) \
   USAGE_CHECK((A) != (B), METHOD, ERROR_DESCRIPTION)
 
-#define USAGE_CHECK_TYPE(METHOD, CPPTYPE)                                      \
-  if (field->cpp_type() != FieldDescriptor::CPPTYPE_##CPPTYPE)                 \
-    ReportReflectionUsageTypeError(descriptor_, field, #METHOD,                \
-                                   FieldDescriptor::CPPTYPE_##CPPTYPE)
+#define USAGE_CHECK_TYPE(METHOD, CPPTYPE)                      \
+  if (field->cpp_type() != FieldDescriptor::CPPTYPE_##CPPTYPE) \
+  ReportReflectionUsageTypeError(descriptor_, field, #METHOD,  \
+                                 FieldDescriptor::CPPTYPE_##CPPTYPE)
 
-#define USAGE_CHECK_ENUM_VALUE(METHOD)                                         \
-  if (value->type() != field->enum_type())                                     \
-    ReportReflectionUsageEnumTypeError(descriptor_, field, #METHOD, value)
+#define USAGE_CHECK_ENUM_VALUE(METHOD)     \
+  if (value->type() != field->enum_type()) \
+  ReportReflectionUsageEnumTypeError(descriptor_, field, #METHOD, value)
 
-#define USAGE_CHECK_MESSAGE_TYPE(METHOD)                                       \
-  USAGE_CHECK_EQ(field->containing_type(), descriptor_,                        \
-                 METHOD, "Field does not match message type.");
-#define USAGE_CHECK_SINGULAR(METHOD)                                           \
-  USAGE_CHECK_NE(field->label(), FieldDescriptor::LABEL_REPEATED, METHOD,      \
+#define USAGE_CHECK_MESSAGE_TYPE(METHOD)                        \
+  USAGE_CHECK_EQ(field->containing_type(), descriptor_, METHOD, \
+                 "Field does not match message type.");
+#define USAGE_CHECK_SINGULAR(METHOD)                                      \
+  USAGE_CHECK_NE(field->label(), FieldDescriptor::LABEL_REPEATED, METHOD, \
                  "Field is repeated; the method requires a singular field.")
-#define USAGE_CHECK_REPEATED(METHOD)                                           \
-  USAGE_CHECK_EQ(field->label(), FieldDescriptor::LABEL_REPEATED, METHOD,      \
+#define USAGE_CHECK_REPEATED(METHOD)                                      \
+  USAGE_CHECK_EQ(field->label(), FieldDescriptor::LABEL_REPEATED, METHOD, \
                  "Field is singular; the method requires a repeated field.")
 
-#define USAGE_CHECK_ALL(METHOD, LABEL, CPPTYPE)                       \
-    USAGE_CHECK_MESSAGE_TYPE(METHOD);                                 \
-    USAGE_CHECK_##LABEL(METHOD);                                      \
-    USAGE_CHECK_TYPE(METHOD, CPPTYPE)
+#define USAGE_CHECK_ALL(METHOD, LABEL, CPPTYPE) \
+  USAGE_CHECK_MESSAGE_TYPE(METHOD);             \
+  USAGE_CHECK_##LABEL(METHOD);                  \
+  USAGE_CHECK_TYPE(METHOD, CPPTYPE)
 
 }  // namespace
 
 // ===================================================================
 
-GeneratedMessageReflection::GeneratedMessageReflection(
-    const Descriptor* descriptor, const ReflectionSchema& schema,
-    const DescriptorPool* pool, MessageFactory* factory)
+Reflection::Reflection(const Descriptor* descriptor,
+                       const internal::ReflectionSchema& schema,
+                       const DescriptorPool* pool, MessageFactory* factory)
     : descriptor_(descriptor),
       schema_(schema),
-      descriptor_pool_((pool == NULL) ? DescriptorPool::generated_pool()
-                                      : pool),
+      descriptor_pool_(
+          (pool == nullptr) ? DescriptorPool::internal_generated_pool() : pool),
       message_factory_(factory),
       last_non_weak_field_index_(-1) {
   last_non_weak_field_index_ = descriptor_->field_count() - 1;
 }
 
-GeneratedMessageReflection::~GeneratedMessageReflection() {}
-
-const UnknownFieldSet& GeneratedMessageReflection::GetUnknownFields(
+const UnknownFieldSet& Reflection::GetUnknownFields(
     const Message& message) const {
-  if (descriptor_->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 &&
-      !GetProto3PreserveUnknownsDefault()) {
-    // We have to ensure that any mutations made to the return value of
-    // MutableUnknownFields() are not reflected here when Proto3 defaults to
-    // discard unknowns.
-    return *UnknownFieldSet::default_instance();
-  } else {
-    return GetInternalMetadataWithArena(message).unknown_fields();
-  }
+  return GetInternalMetadata(message).unknown_fields<UnknownFieldSet>(
+      UnknownFieldSet::default_instance);
+}
+
+UnknownFieldSet* Reflection::MutableUnknownFields(Message* message) const {
+  return MutableInternalMetadata(message)
+      ->mutable_unknown_fields<UnknownFieldSet>();
 }
 
-UnknownFieldSet* GeneratedMessageReflection::MutableUnknownFields(
-    Message* message) const {
-  return MutableInternalMetadataWithArena(message)->mutable_unknown_fields();
+bool Reflection::IsLazyExtension(const Message& message,
+                                 const FieldDescriptor* field) const {
+  return field->is_extension() &&
+         GetExtensionSet(message).HasLazy(field->number());
 }
 
-size_t GeneratedMessageReflection::SpaceUsedLong(const Message& message) const {
+bool Reflection::IsLazilyVerifiedLazyField(const FieldDescriptor* field) const {
+  return field->options().lazy();
+}
+
+bool Reflection::IsEagerlyVerifiedLazyField(
+    const FieldDescriptor* field) const {
+  return (field->type() == FieldDescriptor::TYPE_MESSAGE &&
+          schema_.IsEagerlyVerifiedLazyField(field));
+}
+
+bool Reflection::IsInlined(const FieldDescriptor* field) const {
+  return schema_.IsFieldInlined(field);
+}
+
+size_t Reflection::SpaceUsedLong(const Message& message) const {
   // object_size_ already includes the in-memory representation of each field
   // in the message, so we only need to account for additional memory used by
   // the fields.
@@ -230,35 +286,36 @@ size_t GeneratedMessageReflection::SpaceUsedLong(const Message& message) const {
     const FieldDescriptor* field = descriptor_->field(i);
     if (field->is_repeated()) {
       switch (field->cpp_type()) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                                     \
-        case FieldDescriptor::CPPTYPE_##UPPERCASE :                           \
-          total_size += GetRaw<RepeatedField<LOWERCASE> >(message, field)     \
-                          .SpaceUsedExcludingSelfLong();                      \
-          break
-
-        HANDLE_TYPE( INT32,  int32);
-        HANDLE_TYPE( INT64,  int64);
-        HANDLE_TYPE(UINT32, uint32);
-        HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                           \
+  case FieldDescriptor::CPPTYPE_##UPPERCASE:                        \
+    total_size += GetRaw<RepeatedField<LOWERCASE> >(message, field) \
+                      .SpaceUsedExcludingSelfLong();                \
+    break
+
+        HANDLE_TYPE(INT32, int32_t);
+        HANDLE_TYPE(INT64, int64_t);
+        HANDLE_TYPE(UINT32, uint32_t);
+        HANDLE_TYPE(UINT64, uint64_t);
         HANDLE_TYPE(DOUBLE, double);
-        HANDLE_TYPE( FLOAT,  float);
-        HANDLE_TYPE(  BOOL,   bool);
-        HANDLE_TYPE(  ENUM,    int);
+        HANDLE_TYPE(FLOAT, float);
+        HANDLE_TYPE(BOOL, bool);
+        HANDLE_TYPE(ENUM, int);
 #undef HANDLE_TYPE
 
         case FieldDescriptor::CPPTYPE_STRING:
           switch (field->options().ctype()) {
             default:  // TODO(kenton):  Support other string reps.
             case FieldOptions::STRING:
-              total_size += GetRaw<RepeatedPtrField<string> >(message, field)
-                                .SpaceUsedExcludingSelfLong();
+              total_size +=
+                  GetRaw<RepeatedPtrField<std::string> >(message, field)
+                      .SpaceUsedExcludingSelfLong();
               break;
           }
           break;
 
         case FieldDescriptor::CPPTYPE_MESSAGE:
           if (IsMapFieldInApi(field)) {
-            total_size += GetRaw<MapFieldBase>(message, field)
+            total_size += GetRaw<internal::MapFieldBase>(message, field)
                               .SpaceUsedExcludingSelfLong();
           } else {
             // We don't know which subclass of RepeatedPtrFieldBase the type is,
@@ -271,18 +328,18 @@ size_t GeneratedMessageReflection::SpaceUsedLong(const Message& message) const {
           break;
       }
     } else {
-      if (field->containing_oneof() && !HasOneofField(message, field)) {
+      if (schema_.InRealOneof(field) && !HasOneofField(message, field)) {
         continue;
       }
       switch (field->cpp_type()) {
-        case FieldDescriptor::CPPTYPE_INT32 :
-        case FieldDescriptor::CPPTYPE_INT64 :
+        case FieldDescriptor::CPPTYPE_INT32:
+        case FieldDescriptor::CPPTYPE_INT64:
         case FieldDescriptor::CPPTYPE_UINT32:
         case FieldDescriptor::CPPTYPE_UINT64:
         case FieldDescriptor::CPPTYPE_DOUBLE:
-        case FieldDescriptor::CPPTYPE_FLOAT :
-        case FieldDescriptor::CPPTYPE_BOOL  :
-        case FieldDescriptor::CPPTYPE_ENUM  :
+        case FieldDescriptor::CPPTYPE_FLOAT:
+        case FieldDescriptor::CPPTYPE_BOOL:
+        case FieldDescriptor::CPPTYPE_ENUM:
           // Field is inline, so we've already counted it.
           break;
 
@@ -290,15 +347,23 @@ size_t GeneratedMessageReflection::SpaceUsedLong(const Message& message) const {
           switch (field->options().ctype()) {
             default:  // TODO(kenton):  Support other string reps.
             case FieldOptions::STRING: {
-              // Initially, the string points to the default value stored in
-              // the prototype. Only count the string if it has been changed
-              // from the default value.
-              const string* default_ptr =
-                  &DefaultRaw<ArenaStringPtr>(field).Get();
-              const string* ptr =
-                  &GetField<ArenaStringPtr>(message, field).Get();
-
-              if (ptr != default_ptr) {
+              if (IsInlined(field)) {
+                const std::string* ptr =
+                    &GetField<InlinedStringField>(message, field).GetNoArena();
+                total_size += StringSpaceUsedExcludingSelfLong(*ptr);
+                break;
+              }
+
+              const std::string* ptr =
+                  GetField<ArenaStringPtr>(message, field).GetPointer();
+
+              // Initially, the string points to the default value stored
+              // in the prototype. Only count the string if it has been
+              // changed from the default value.
+              // Except oneof fields, those never point to a default instance,
+              // and there is no default instance to point to.
+              if (schema_.InRealOneof(field) ||
+                  ptr != DefaultRaw<ArenaStringPtr>(field).GetPointer()) {
                 // string fields are represented by just a pointer, so also
                 // include sizeof(string) as well.
                 total_size +=
@@ -316,7 +381,7 @@ size_t GeneratedMessageReflection::SpaceUsedLong(const Message& message) const {
             // external type's prototype, so there is no extra memory usage.
           } else {
             const Message* sub_message = GetRaw<const Message*>(message, field);
-            if (sub_message != NULL) {
+            if (sub_message != nullptr) {
               total_size += sub_message->SpaceUsedLong();
             }
           }
@@ -327,384 +392,681 @@ size_t GeneratedMessageReflection::SpaceUsedLong(const Message& message) const {
   return total_size;
 }
 
-void GeneratedMessageReflection::SwapField(
-    Message* message1,
-    Message* message2,
-    const FieldDescriptor* field) const {
-  if (field->is_repeated()) {
+namespace {
+
+template <bool unsafe_shallow_swap>
+struct OneofFieldMover {
+  template <typename FromType, typename ToType>
+  void operator()(const FieldDescriptor* field, FromType* from, ToType* to) {
     switch (field->cpp_type()) {
-#define SWAP_ARRAYS(CPPTYPE, TYPE)                                      \
-      case FieldDescriptor::CPPTYPE_##CPPTYPE:                          \
-        MutableRaw<RepeatedField<TYPE> >(message1, field)->Swap(        \
-            MutableRaw<RepeatedField<TYPE> >(message2, field));         \
+      case FieldDescriptor::CPPTYPE_INT32:
+        to->SetInt32(from->GetInt32());
         break;
-
-      SWAP_ARRAYS(INT32 , int32 );
-      SWAP_ARRAYS(INT64 , int64 );
-      SWAP_ARRAYS(UINT32, uint32);
-      SWAP_ARRAYS(UINT64, uint64);
-      SWAP_ARRAYS(FLOAT , float );
-      SWAP_ARRAYS(DOUBLE, double);
-      SWAP_ARRAYS(BOOL  , bool  );
-      SWAP_ARRAYS(ENUM  , int   );
-#undef SWAP_ARRAYS
-
-      case FieldDescriptor::CPPTYPE_STRING:
-        switch (field->options().ctype()) {
-          default:  // TODO(kenton):  Support other string reps.
-          case FieldOptions::STRING:
-            MutableRaw<RepeatedPtrFieldBase>(message1, field)->
-                Swap<GenericTypeHandler<string> >(
-                    MutableRaw<RepeatedPtrFieldBase>(message2, field));
-            break;
-        }
+      case FieldDescriptor::CPPTYPE_INT64:
+        to->SetInt64(from->GetInt64());
         break;
-      case FieldDescriptor::CPPTYPE_MESSAGE:
-        if (IsMapFieldInApi(field)) {
-          MutableRaw<MapFieldBase>(message1, field)->
-            MutableRepeatedField()->
-              Swap<GenericTypeHandler<google::protobuf::Message> >(
-                MutableRaw<MapFieldBase>(message2, field)->
-                  MutableRepeatedField());
-        } else {
-          MutableRaw<RepeatedPtrFieldBase>(message1, field)->
-            Swap<GenericTypeHandler<google::protobuf::Message> >(
-              MutableRaw<RepeatedPtrFieldBase>(message2, field));
-        }
+      case FieldDescriptor::CPPTYPE_UINT32:
+        to->SetUint32(from->GetUint32());
         break;
-
-      default:
-        GOOGLE_LOG(FATAL) << "Unimplemented type: " << field->cpp_type();
-    }
-  } else {
-    switch (field->cpp_type()) {
-#define SWAP_VALUES(CPPTYPE, TYPE)                                      \
-      case FieldDescriptor::CPPTYPE_##CPPTYPE:                          \
-        std::swap(*MutableRaw<TYPE>(message1, field),                   \
-                  *MutableRaw<TYPE>(message2, field));                  \
+      case FieldDescriptor::CPPTYPE_UINT64:
+        to->SetUint64(from->GetUint64());
+        break;
+      case FieldDescriptor::CPPTYPE_FLOAT:
+        to->SetFloat(from->GetFloat());
+        break;
+      case FieldDescriptor::CPPTYPE_DOUBLE:
+        to->SetDouble(from->GetDouble());
+        break;
+      case FieldDescriptor::CPPTYPE_BOOL:
+        to->SetBool(from->GetBool());
+        break;
+      case FieldDescriptor::CPPTYPE_ENUM:
+        to->SetEnum(from->GetEnum());
         break;
-
-      SWAP_VALUES(INT32 , int32 );
-      SWAP_VALUES(INT64 , int64 );
-      SWAP_VALUES(UINT32, uint32);
-      SWAP_VALUES(UINT64, uint64);
-      SWAP_VALUES(FLOAT , float );
-      SWAP_VALUES(DOUBLE, double);
-      SWAP_VALUES(BOOL  , bool  );
-      SWAP_VALUES(ENUM  , int   );
-#undef SWAP_VALUES
       case FieldDescriptor::CPPTYPE_MESSAGE:
-        if (GetArena(message1) == GetArena(message2)) {
-          std::swap(*MutableRaw<Message*>(message1, field),
-                    *MutableRaw<Message*>(message2, field));
+        if (!unsafe_shallow_swap) {
+          to->SetMessage(from->GetMessage());
         } else {
-          Message** sub_msg1 = MutableRaw<Message*>(message1, field);
-          Message** sub_msg2 = MutableRaw<Message*>(message2, field);
-          if (*sub_msg1 == NULL && *sub_msg2 == NULL) break;
-          if (*sub_msg1 && *sub_msg2) {
-            (*sub_msg1)->GetReflection()->Swap(*sub_msg1, *sub_msg2);
-            break;
-          }
-          if (*sub_msg1 == NULL) {
-            *sub_msg1 = (*sub_msg2)->New(message1->GetArena());
-            (*sub_msg1)->CopyFrom(**sub_msg2);
-            ClearField(message2, field);
-          } else {
-            *sub_msg2 = (*sub_msg1)->New(message2->GetArena());
-            (*sub_msg2)->CopyFrom(**sub_msg1);
-            ClearField(message1, field);
-          }
+          to->UnsafeSetMessage(from->UnsafeGetMessage());
         }
         break;
-
       case FieldDescriptor::CPPTYPE_STRING:
+        if (!unsafe_shallow_swap) {
+          to->SetString(from->GetString());
+          break;
+        }
         switch (field->options().ctype()) {
-          default:  // TODO(kenton):  Support other string reps.
-          case FieldOptions::STRING:
-            {
-              Arena* arena1 = GetArena(message1);
-              Arena* arena2 = GetArena(message2);
-              ArenaStringPtr* string1 =
-                  MutableRaw<ArenaStringPtr>(message1, field);
-              ArenaStringPtr* string2 =
-                  MutableRaw<ArenaStringPtr>(message2, field);
-              if (arena1 == arena2) {
-                string1->Swap(string2);
-              } else {
-                const string* default_ptr =
-                    &DefaultRaw<ArenaStringPtr>(field).Get();
-                const string temp = string1->Get();
-                string1->Set(default_ptr, string2->Get(), arena1);
-                string2->Set(default_ptr, temp, arena2);
-              }
-            }
+          default:
+          case FieldOptions::STRING: {
+            to->SetArenaStringPtr(from->GetArenaStringPtr());
             break;
+          }
         }
         break;
-
       default:
-        GOOGLE_LOG(FATAL) << "Unimplemented type: " << field->cpp_type();
+        GOOGLE_LOG(FATAL) << "unimplemented type: " << field->cpp_type();
+    }
+    if (unsafe_shallow_swap) {
+      // Not clearing oneof case after move may cause unwanted "ClearOneof"
+      // where the residual message or string value is deleted and causes
+      // use-after-free (only for unsafe swap).
+      from->ClearOneofCase();
     }
   }
-}
+};
 
-void GeneratedMessageReflection::SwapOneofField(
-    Message* message1,
-    Message* message2,
-    const OneofDescriptor* oneof_descriptor) const {
-  uint32 oneof_case1 = GetOneofCase(*message1, oneof_descriptor);
-  uint32 oneof_case2 = GetOneofCase(*message2, oneof_descriptor);
-
-  int32 temp_int32;
-  int64 temp_int64;
-  uint32 temp_uint32;
-  uint64 temp_uint64;
-  float temp_float;
-  double temp_double;
-  bool temp_bool;
-  int temp_int;
-  Message* temp_message = NULL;
-  string temp_string;
-
-  // Stores message1's oneof field to a temp variable.
-  const FieldDescriptor* field1 = NULL;
-  if (oneof_case1 > 0) {
-    field1 = descriptor_->FindFieldByNumber(oneof_case1);
-    //oneof_descriptor->field(oneof_case1);
-    switch (field1->cpp_type()) {
-#define GET_TEMP_VALUE(CPPTYPE, TYPE)                                   \
-      case FieldDescriptor::CPPTYPE_##CPPTYPE:                          \
-        temp_##TYPE = GetField<TYPE>(*message1, field1);                \
-        break;
+}  // namespace
 
-      GET_TEMP_VALUE(INT32 , int32 );
-      GET_TEMP_VALUE(INT64 , int64 );
-      GET_TEMP_VALUE(UINT32, uint32);
-      GET_TEMP_VALUE(UINT64, uint64);
-      GET_TEMP_VALUE(FLOAT , float );
-      GET_TEMP_VALUE(DOUBLE, double);
-      GET_TEMP_VALUE(BOOL  , bool  );
-      GET_TEMP_VALUE(ENUM  , int   );
-#undef GET_TEMP_VALUE
-      case FieldDescriptor::CPPTYPE_MESSAGE:
-        temp_message = ReleaseMessage(message1, field1);
-        break;
+namespace internal {
 
-      case FieldDescriptor::CPPTYPE_STRING:
-        temp_string = GetString(*message1, field1);
-        break;
+class SwapFieldHelper {
+ public:
+  template <bool unsafe_shallow_swap>
+  static void SwapRepeatedStringField(const Reflection* r, Message* lhs,
+                                      Message* rhs,
+                                      const FieldDescriptor* field);
+
+  template <bool unsafe_shallow_swap>
+  static void SwapInlinedStrings(const Reflection* r, Message* lhs,
+                                 Message* rhs, const FieldDescriptor* field);
+
+  template <bool unsafe_shallow_swap>
+  static void SwapNonInlinedStrings(const Reflection* r, Message* lhs,
+                                    Message* rhs, const FieldDescriptor* field);
+
+  template <bool unsafe_shallow_swap>
+  static void SwapStringField(const Reflection* r, Message* lhs, Message* rhs,
+                              const FieldDescriptor* field);
+
+  static void SwapArenaStringPtr(const std::string* default_ptr,
+                                 ArenaStringPtr* lhs, Arena* lhs_arena,
+                                 ArenaStringPtr* rhs, Arena* rhs_arena);
+
+  template <bool unsafe_shallow_swap>
+  static void SwapRepeatedMessageField(const Reflection* r, Message* lhs,
+                                       Message* rhs,
+                                       const FieldDescriptor* field);
+
+  template <bool unsafe_shallow_swap>
+  static void SwapMessageField(const Reflection* r, Message* lhs, Message* rhs,
+                               const FieldDescriptor* field);
+
+  static void SwapMessage(const Reflection* r, Message* lhs, Arena* lhs_arena,
+                          Message* rhs, Arena* rhs_arena,
+                          const FieldDescriptor* field);
+};
 
-      default:
-        GOOGLE_LOG(FATAL) << "Unimplemented type: " << field1->cpp_type();
+template <bool unsafe_shallow_swap>
+void SwapFieldHelper::SwapRepeatedStringField(const Reflection* r, Message* lhs,
+                                              Message* rhs,
+                                              const FieldDescriptor* field) {
+  switch (field->options().ctype()) {
+    default:
+    case FieldOptions::STRING: {
+      auto* lhs_string = r->MutableRaw<RepeatedPtrFieldBase>(lhs, field);
+      auto* rhs_string = r->MutableRaw<RepeatedPtrFieldBase>(rhs, field);
+      if (unsafe_shallow_swap) {
+        lhs_string->InternalSwap(rhs_string);
+      } else {
+        lhs_string->Swap<GenericTypeHandler<std::string>>(rhs_string);
+      }
+      break;
     }
   }
+}
 
-  // Sets message1's oneof field from the message2's oneof field.
-  if (oneof_case2 > 0) {
-    const FieldDescriptor* field2 =
-        descriptor_->FindFieldByNumber(oneof_case2);
-    switch (field2->cpp_type()) {
-#define SET_ONEOF_VALUE1(CPPTYPE, TYPE)                                 \
-      case FieldDescriptor::CPPTYPE_##CPPTYPE:                          \
-        SetField<TYPE>(message1, field2, GetField<TYPE>(*message2, field2)); \
-        break;
-
-      SET_ONEOF_VALUE1(INT32 , int32 );
-      SET_ONEOF_VALUE1(INT64 , int64 );
-      SET_ONEOF_VALUE1(UINT32, uint32);
-      SET_ONEOF_VALUE1(UINT64, uint64);
-      SET_ONEOF_VALUE1(FLOAT , float );
-      SET_ONEOF_VALUE1(DOUBLE, double);
-      SET_ONEOF_VALUE1(BOOL  , bool  );
-      SET_ONEOF_VALUE1(ENUM  , int   );
-#undef SET_ONEOF_VALUE1
-      case FieldDescriptor::CPPTYPE_MESSAGE:
-        SetAllocatedMessage(message1,
-                            ReleaseMessage(message2, field2),
-                            field2);
-        break;
+template <bool unsafe_shallow_swap>
+void SwapFieldHelper::SwapInlinedStrings(const Reflection* r, Message* lhs,
+                                         Message* rhs,
+                                         const FieldDescriptor* field) {
+  // Inlined string field.
+  Arena* lhs_arena = lhs->GetArenaForAllocation();
+  Arena* rhs_arena = rhs->GetArenaForAllocation();
+  auto* lhs_string = r->MutableRaw<InlinedStringField>(lhs, field);
+  auto* rhs_string = r->MutableRaw<InlinedStringField>(rhs, field);
+  const uint32 index = r->schema_.InlinedStringIndex(field);
+  uint32* lhs_state = &r->MutableInlinedStringDonatedArray(lhs)[index / 32];
+  uint32* rhs_state = &r->MutableInlinedStringDonatedArray(rhs)[index / 32];
+  const uint32 mask = ~(static_cast<uint32>(1) << (index % 32));
+  if (unsafe_shallow_swap || lhs_arena == rhs_arena) {
+    lhs_string->Swap(rhs_string, /*default_value=*/nullptr, lhs_arena,
+                     r->IsInlinedStringDonated(*lhs, field),
+                     r->IsInlinedStringDonated(*rhs, field),
+                     /*donating_states=*/lhs_state, rhs_state, mask);
+  } else {
+    const std::string temp = lhs_string->Get();
+    lhs_string->Set(nullptr, rhs_string->Get(), lhs_arena,
+                    r->IsInlinedStringDonated(*lhs, field), lhs_state, mask);
+    rhs_string->Set(nullptr, temp, rhs_arena,
+                    r->IsInlinedStringDonated(*rhs, field), rhs_state, mask);
+  }
+}
+
+template <bool unsafe_shallow_swap>
+void SwapFieldHelper::SwapNonInlinedStrings(const Reflection* r, Message* lhs,
+                                            Message* rhs,
+                                            const FieldDescriptor* field) {
+  ArenaStringPtr* lhs_string = r->MutableRaw<ArenaStringPtr>(lhs, field);
+  ArenaStringPtr* rhs_string = r->MutableRaw<ArenaStringPtr>(rhs, field);
+  if (unsafe_shallow_swap) {
+    ArenaStringPtr::UnsafeShallowSwap(lhs_string, rhs_string);
+  } else {
+    SwapFieldHelper::SwapArenaStringPtr(
+        r->DefaultRaw<ArenaStringPtr>(field).GetPointer(),  //
+        lhs_string, lhs->GetArenaForAllocation(),           //
+        rhs_string, rhs->GetArenaForAllocation());
+  }
+}
+
+template <bool unsafe_shallow_swap>
+void SwapFieldHelper::SwapStringField(const Reflection* r, Message* lhs,
+                                      Message* rhs,
+                                      const FieldDescriptor* field) {
+  switch (field->options().ctype()) {
+    default:
+    case FieldOptions::STRING: {
+      if (r->IsInlined(field)) {
+        SwapFieldHelper::SwapInlinedStrings<unsafe_shallow_swap>(r, lhs, rhs,
+                                                                 field);
+      } else {
+        SwapFieldHelper::SwapNonInlinedStrings<unsafe_shallow_swap>(r, lhs, rhs,
+                                                                    field);
+      }
+      break;
+    }
+  }
+}
 
-      case FieldDescriptor::CPPTYPE_STRING:
-        SetString(message1, field2, GetString(*message2, field2));
-        break;
+void SwapFieldHelper::SwapArenaStringPtr(const std::string* default_ptr,
+                                         ArenaStringPtr* lhs, Arena* lhs_arena,
+                                         ArenaStringPtr* rhs,
+                                         Arena* rhs_arena) {
+  if (lhs_arena == rhs_arena) {
+    ArenaStringPtr::InternalSwap(default_ptr, lhs, lhs_arena, rhs, rhs_arena);
+  } else if (lhs->IsDefault(default_ptr) && rhs->IsDefault(default_ptr)) {
+    // Nothing to do.
+  } else if (lhs->IsDefault(default_ptr)) {
+    lhs->Set(default_ptr, rhs->Get(), lhs_arena);
+    // rhs needs to be destroyed before overwritten.
+    rhs->Destroy(default_ptr, rhs_arena);
+    rhs->UnsafeSetDefault(default_ptr);
+  } else if (rhs->IsDefault(default_ptr)) {
+    rhs->Set(default_ptr, lhs->Get(), rhs_arena);
+    // lhs needs to be destroyed before overwritten.
+    lhs->Destroy(default_ptr, lhs_arena);
+    lhs->UnsafeSetDefault(default_ptr);
+  } else {
+    std::string temp = lhs->Get();
+    lhs->Set(default_ptr, rhs->Get(), lhs_arena);
+    rhs->Set(default_ptr, std::move(temp), rhs_arena);
+  }
+}
 
-      default:
-        GOOGLE_LOG(FATAL) << "Unimplemented type: " << field2->cpp_type();
+template <bool unsafe_shallow_swap>
+void SwapFieldHelper::SwapRepeatedMessageField(const Reflection* r,
+                                               Message* lhs, Message* rhs,
+                                               const FieldDescriptor* field) {
+  if (IsMapFieldInApi(field)) {
+    auto* lhs_map = r->MutableRaw<MapFieldBase>(lhs, field);
+    auto* rhs_map = r->MutableRaw<MapFieldBase>(rhs, field);
+    if (unsafe_shallow_swap) {
+      lhs_map->UnsafeShallowSwap(rhs_map);
+    } else {
+      lhs_map->Swap(rhs_map);
     }
   } else {
-    ClearOneof(message1, oneof_descriptor);
+    auto* lhs_rm = r->MutableRaw<RepeatedPtrFieldBase>(lhs, field);
+    auto* rhs_rm = r->MutableRaw<RepeatedPtrFieldBase>(rhs, field);
+    if (unsafe_shallow_swap) {
+      lhs_rm->InternalSwap(rhs_rm);
+    } else {
+      lhs_rm->Swap<GenericTypeHandler<Message>>(rhs_rm);
+    }
+  }
+}
+
+template <bool unsafe_shallow_swap>
+void SwapFieldHelper::SwapMessageField(const Reflection* r, Message* lhs,
+                                       Message* rhs,
+                                       const FieldDescriptor* field) {
+  if (unsafe_shallow_swap) {
+    std::swap(*r->MutableRaw<Message*>(lhs, field),
+              *r->MutableRaw<Message*>(rhs, field));
+  } else {
+    SwapMessage(r, lhs, lhs->GetArenaForAllocation(), rhs,
+                rhs->GetArenaForAllocation(), field);
+  }
+}
+
+void SwapFieldHelper::SwapMessage(const Reflection* r, Message* lhs,
+                                  Arena* lhs_arena, Message* rhs,
+                                  Arena* rhs_arena,
+                                  const FieldDescriptor* field) {
+  Message** lhs_sub = r->MutableRaw<Message*>(lhs, field);
+  Message** rhs_sub = r->MutableRaw<Message*>(rhs, field);
+
+  if (*lhs_sub == *rhs_sub) return;
+
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+  if (lhs_arena != nullptr && lhs_arena == rhs_arena) {
+#else   // PROTOBUF_FORCE_COPY_IN_SWAP
+  if (lhs_arena == rhs_arena) {
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+    std::swap(*lhs_sub, *rhs_sub);
+    return;
+  }
+
+  if (*lhs_sub != nullptr && *rhs_sub != nullptr) {
+    (*lhs_sub)->GetReflection()->Swap(*lhs_sub, *rhs_sub);
+  } else if (*lhs_sub == nullptr && r->HasBit(*rhs, field)) {
+    *lhs_sub = (*rhs_sub)->New(lhs_arena);
+    (*lhs_sub)->CopyFrom(**rhs_sub);
+    r->ClearField(rhs, field);
+    // Ensures has bit is unchanged after ClearField.
+    r->SetBit(rhs, field);
+  } else if (*rhs_sub == nullptr && r->HasBit(*lhs, field)) {
+    *rhs_sub = (*lhs_sub)->New(rhs_arena);
+    (*rhs_sub)->CopyFrom(**lhs_sub);
+    r->ClearField(lhs, field);
+    // Ensures has bit is unchanged after ClearField.
+    r->SetBit(lhs, field);
   }
+}
+
+}  // namespace internal
+
+void Reflection::SwapField(Message* message1, Message* message2,
+                           const FieldDescriptor* field) const {
+  if (field->is_repeated()) {
+    switch (field->cpp_type()) {
+#define SWAP_ARRAYS(CPPTYPE, TYPE)                                 \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE:                         \
+    MutableRaw<RepeatedField<TYPE> >(message1, field)              \
+        ->Swap(MutableRaw<RepeatedField<TYPE> >(message2, field)); \
+    break;
+
+      SWAP_ARRAYS(INT32, int32_t);
+      SWAP_ARRAYS(INT64, int64_t);
+      SWAP_ARRAYS(UINT32, uint32_t);
+      SWAP_ARRAYS(UINT64, uint64_t);
+      SWAP_ARRAYS(FLOAT, float);
+      SWAP_ARRAYS(DOUBLE, double);
+      SWAP_ARRAYS(BOOL, bool);
+      SWAP_ARRAYS(ENUM, int);
+#undef SWAP_ARRAYS
 
-  // Sets message2's oneof field from the temp variable.
-  if (oneof_case1 > 0) {
-    switch (field1->cpp_type()) {
-#define SET_ONEOF_VALUE2(CPPTYPE, TYPE)                                 \
-      case FieldDescriptor::CPPTYPE_##CPPTYPE:                          \
-        SetField<TYPE>(message2, field1, temp_##TYPE);                  \
+      case FieldDescriptor::CPPTYPE_STRING:
+        internal::SwapFieldHelper::SwapRepeatedStringField<false>(
+            this, message1, message2, field);
+        break;
+      case FieldDescriptor::CPPTYPE_MESSAGE:
+        internal::SwapFieldHelper::SwapRepeatedMessageField<false>(
+            this, message1, message2, field);
         break;
 
-      SET_ONEOF_VALUE2(INT32 , int32 );
-      SET_ONEOF_VALUE2(INT64 , int64 );
-      SET_ONEOF_VALUE2(UINT32, uint32);
-      SET_ONEOF_VALUE2(UINT64, uint64);
-      SET_ONEOF_VALUE2(FLOAT , float );
-      SET_ONEOF_VALUE2(DOUBLE, double);
-      SET_ONEOF_VALUE2(BOOL  , bool  );
-      SET_ONEOF_VALUE2(ENUM  , int   );
-#undef SET_ONEOF_VALUE2
+      default:
+        GOOGLE_LOG(FATAL) << "Unimplemented type: " << field->cpp_type();
+    }
+  } else {
+    switch (field->cpp_type()) {
+#define SWAP_VALUES(CPPTYPE, TYPE)                 \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE:         \
+    std::swap(*MutableRaw<TYPE>(message1, field),  \
+              *MutableRaw<TYPE>(message2, field)); \
+    break;
+
+      SWAP_VALUES(INT32, int32_t);
+      SWAP_VALUES(INT64, int64_t);
+      SWAP_VALUES(UINT32, uint32_t);
+      SWAP_VALUES(UINT64, uint64_t);
+      SWAP_VALUES(FLOAT, float);
+      SWAP_VALUES(DOUBLE, double);
+      SWAP_VALUES(BOOL, bool);
+      SWAP_VALUES(ENUM, int);
+#undef SWAP_VALUES
       case FieldDescriptor::CPPTYPE_MESSAGE:
-        SetAllocatedMessage(message2, temp_message, field1);
+        internal::SwapFieldHelper::SwapMessageField<false>(this, message1,
+                                                           message2, field);
         break;
 
       case FieldDescriptor::CPPTYPE_STRING:
-        SetString(message2, field1, temp_string);
+        internal::SwapFieldHelper::SwapStringField<false>(this, message1,
+                                                          message2, field);
         break;
 
       default:
-        GOOGLE_LOG(FATAL) << "Unimplemented type: " << field1->cpp_type();
+        GOOGLE_LOG(FATAL) << "Unimplemented type: " << field->cpp_type();
     }
-  } else {
-    ClearOneof(message2, oneof_descriptor);
   }
 }
 
-void GeneratedMessageReflection::Swap(
-    Message* message1,
-    Message* message2) const {
+void Reflection::UnsafeShallowSwapField(Message* message1, Message* message2,
+                                        const FieldDescriptor* field) const {
+  if (!field->is_repeated()) {
+    if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
+      internal::SwapFieldHelper::SwapMessageField<true>(this, message1,
+                                                        message2, field);
+    } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) {
+      internal::SwapFieldHelper::SwapStringField<true>(this, message1, message2,
+                                                       field);
+    } else {
+      SwapField(message1, message2, field);
+    }
+    return;
+  }
+
+  switch (field->cpp_type()) {
+#define SHALLOW_SWAP_ARRAYS(CPPTYPE, TYPE)                                \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE:                                \
+    MutableRaw<RepeatedField<TYPE>>(message1, field)                      \
+        ->InternalSwap(MutableRaw<RepeatedField<TYPE>>(message2, field)); \
+    break;
+
+    SHALLOW_SWAP_ARRAYS(INT32, int32_t);
+    SHALLOW_SWAP_ARRAYS(INT64, int64_t);
+    SHALLOW_SWAP_ARRAYS(UINT32, uint32_t);
+    SHALLOW_SWAP_ARRAYS(UINT64, uint64_t);
+    SHALLOW_SWAP_ARRAYS(FLOAT, float);
+    SHALLOW_SWAP_ARRAYS(DOUBLE, double);
+    SHALLOW_SWAP_ARRAYS(BOOL, bool);
+    SHALLOW_SWAP_ARRAYS(ENUM, int);
+#undef SHALLOW_SWAP_ARRAYS
+
+    case FieldDescriptor::CPPTYPE_STRING:
+      internal::SwapFieldHelper::SwapRepeatedStringField<true>(this, message1,
+                                                               message2, field);
+      break;
+    case FieldDescriptor::CPPTYPE_MESSAGE:
+      internal::SwapFieldHelper::SwapRepeatedMessageField<true>(
+          this, message1, message2, field);
+      break;
+
+    default:
+      GOOGLE_LOG(FATAL) << "Unimplemented type: " << field->cpp_type();
+  }
+}
+
+// Swaps oneof field between lhs and rhs. If unsafe_shallow_swap is true, it
+// directly swaps oneof values; otherwise, it may involve copy/delete. Note that
+// two messages may have different oneof cases. So, it has to be done in three
+// steps (i.e. lhs -> temp, rhs -> lhs, temp -> rhs).
+template <bool unsafe_shallow_swap>
+void Reflection::SwapOneofField(Message* lhs, Message* rhs,
+                                const OneofDescriptor* oneof_descriptor) const {
+  // Wraps a local variable to temporarily store oneof value.
+  struct LocalVarWrapper {
+#define LOCAL_VAR_ACCESSOR(type, var, name)               \
+  type Get##name() const { return oneof_val.type_##var; } \
+  void Set##name(type v) { oneof_val.type_##var = v; }
+
+    LOCAL_VAR_ACCESSOR(int32_t, int32, Int32);
+    LOCAL_VAR_ACCESSOR(int64_t, int64, Int64);
+    LOCAL_VAR_ACCESSOR(uint32_t, uint32, Uint32);
+    LOCAL_VAR_ACCESSOR(uint64_t, uint64, Uint64);
+    LOCAL_VAR_ACCESSOR(float, float, Float);
+    LOCAL_VAR_ACCESSOR(double, double, Double);
+    LOCAL_VAR_ACCESSOR(bool, bool, Bool);
+    LOCAL_VAR_ACCESSOR(int, enum, Enum);
+    LOCAL_VAR_ACCESSOR(Message*, message, Message);
+    LOCAL_VAR_ACCESSOR(ArenaStringPtr, arena_string_ptr, ArenaStringPtr);
+    const std::string& GetString() const { return string_val; }
+    void SetString(const std::string& v) { string_val = v; }
+    Message* UnsafeGetMessage() const { return GetMessage(); }
+    void UnsafeSetMessage(Message* v) { SetMessage(v); }
+    void ClearOneofCase() {}
+
+    union {
+      int32_t type_int32;
+      int64_t type_int64;
+      uint32_t type_uint32;
+      uint64_t type_uint64;
+      float type_float;
+      double type_double;
+      bool type_bool;
+      int type_enum;
+      Message* type_message;
+      internal::ArenaStringPtr type_arena_string_ptr;
+    } oneof_val;
+
+    // std::string cannot be in union.
+    std::string string_val;
+  };
+
+  // Wraps a message pointer to read and write a field.
+  struct MessageWrapper {
+#define MESSAGE_FIELD_ACCESSOR(type, var, name)         \
+  type Get##name() const {                              \
+    return reflection->GetField<type>(*message, field); \
+  }                                                     \
+  void Set##name(type v) { reflection->SetField<type>(message, field, v); }
+
+    MESSAGE_FIELD_ACCESSOR(int32_t, int32, Int32);
+    MESSAGE_FIELD_ACCESSOR(int64_t, int64, Int64);
+    MESSAGE_FIELD_ACCESSOR(uint32_t, uint32, Uint32);
+    MESSAGE_FIELD_ACCESSOR(uint64_t, uint64, Uint64);
+    MESSAGE_FIELD_ACCESSOR(float, float, Float);
+    MESSAGE_FIELD_ACCESSOR(double, double, Double);
+    MESSAGE_FIELD_ACCESSOR(bool, bool, Bool);
+    MESSAGE_FIELD_ACCESSOR(int, enum, Enum);
+    MESSAGE_FIELD_ACCESSOR(ArenaStringPtr, arena_string_ptr, ArenaStringPtr);
+    std::string GetString() const {
+      return reflection->GetString(*message, field);
+    }
+    void SetString(const std::string& v) {
+      reflection->SetString(message, field, v);
+    }
+    Message* GetMessage() const {
+      return reflection->ReleaseMessage(message, field);
+    }
+    void SetMessage(Message* v) {
+      reflection->SetAllocatedMessage(message, v, field);
+    }
+    Message* UnsafeGetMessage() const {
+      return reflection->UnsafeArenaReleaseMessage(message, field);
+    }
+    void UnsafeSetMessage(Message* v) {
+      reflection->UnsafeArenaSetAllocatedMessage(message, v, field);
+    }
+    void ClearOneofCase() {
+      *reflection->MutableOneofCase(message, field->containing_oneof()) = 0;
+    }
+
+    const Reflection* reflection;
+    Message* message;
+    const FieldDescriptor* field;
+  };
+
+  GOOGLE_DCHECK(!oneof_descriptor->is_synthetic());
+  uint32 oneof_case_lhs = GetOneofCase(*lhs, oneof_descriptor);
+  uint32 oneof_case_rhs = GetOneofCase(*rhs, oneof_descriptor);
+
+  LocalVarWrapper temp;
+  MessageWrapper lhs_wrapper, rhs_wrapper;
+  const FieldDescriptor* field_lhs = nullptr;
+  OneofFieldMover<unsafe_shallow_swap> mover;
+  // lhs --> temp
+  if (oneof_case_lhs > 0) {
+    field_lhs = descriptor_->FindFieldByNumber(oneof_case_lhs);
+    lhs_wrapper = {this, lhs, field_lhs};
+    mover(field_lhs, &lhs_wrapper, &temp);
+  }
+  // rhs --> lhs
+  if (oneof_case_rhs > 0) {
+    const FieldDescriptor* f = descriptor_->FindFieldByNumber(oneof_case_rhs);
+    lhs_wrapper = {this, lhs, f};
+    rhs_wrapper = {this, rhs, f};
+    mover(f, &rhs_wrapper, &lhs_wrapper);
+  } else if (!unsafe_shallow_swap) {
+    ClearOneof(lhs, oneof_descriptor);
+  }
+  // temp --> rhs
+  if (oneof_case_lhs > 0) {
+    rhs_wrapper = {this, rhs, field_lhs};
+    mover(field_lhs, &temp, &rhs_wrapper);
+  } else if (!unsafe_shallow_swap) {
+    ClearOneof(rhs, oneof_descriptor);
+  }
+
+  if (unsafe_shallow_swap) {
+    *MutableOneofCase(lhs, oneof_descriptor) = oneof_case_rhs;
+    *MutableOneofCase(rhs, oneof_descriptor) = oneof_case_lhs;
+  }
+}
+
+void Reflection::Swap(Message* message1, Message* message2) const {
   if (message1 == message2) return;
 
   // TODO(kenton):  Other Reflection methods should probably check this too.
   GOOGLE_CHECK_EQ(message1->GetReflection(), this)
-    << "First argument to Swap() (of type \""
-    << message1->GetDescriptor()->full_name()
-    << "\") is not compatible with this reflection object (which is for type \""
-    << descriptor_->full_name()
-    << "\").  Note that the exact same class is required; not just the same "
-       "descriptor.";
+      << "First argument to Swap() (of type \""
+      << message1->GetDescriptor()->full_name()
+      << "\") is not compatible with this reflection object (which is for type "
+         "\""
+      << descriptor_->full_name()
+      << "\").  Note that the exact same class is required; not just the same "
+         "descriptor.";
   GOOGLE_CHECK_EQ(message2->GetReflection(), this)
-    << "Second argument to Swap() (of type \""
-    << message2->GetDescriptor()->full_name()
-    << "\") is not compatible with this reflection object (which is for type \""
-    << descriptor_->full_name()
-    << "\").  Note that the exact same class is required; not just the same "
-       "descriptor.";
+      << "Second argument to Swap() (of type \""
+      << message2->GetDescriptor()->full_name()
+      << "\") is not compatible with this reflection object (which is for type "
+         "\""
+      << descriptor_->full_name()
+      << "\").  Note that the exact same class is required; not just the same "
+         "descriptor.";
 
   // Check that both messages are in the same arena (or both on the heap). We
   // need to copy all data if not, due to ownership semantics.
-  if (GetArena(message1) != GetArena(message2)) {
-    // Slow copy path.
-    // Use our arena as temp space, if available.
-    Message* temp = message1->New(GetArena(message1));
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+  if (message1->GetOwningArena() == nullptr ||
+      message1->GetOwningArena() != message2->GetOwningArena()) {
+#else   // PROTOBUF_FORCE_COPY_IN_SWAP
+  if (message1->GetOwningArena() != message2->GetOwningArena()) {
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+    // One of the two is guaranteed to have an arena.  Switch things around
+    // to guarantee that message1 has an arena.
+    Arena* arena = message1->GetOwningArena();
+    if (arena == nullptr) {
+      arena = message2->GetOwningArena();
+      std::swap(message1, message2);  // Swapping names for pointers!
+    }
+
+    Message* temp = message1->New(arena);
     temp->MergeFrom(*message2);
     message2->CopyFrom(*message1);
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    message1->CopyFrom(*temp);
+    if (arena == nullptr) delete temp;
+#else   // PROTOBUF_FORCE_COPY_IN_SWAP
     Swap(message1, temp);
-    if (GetArena(message1) == NULL) {
-      delete temp;
-    }
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
     return;
   }
 
-  if (schema_.HasHasbits()) {
-    uint32* has_bits1 = MutableHasBits(message1);
-    uint32* has_bits2 = MutableHasBits(message2);
+  GOOGLE_DCHECK_EQ(message1->GetOwningArena(), message2->GetOwningArena());
 
-    int fields_with_has_bits = 0;
-    for (int i = 0; i < descriptor_->field_count(); i++) {
-      const FieldDescriptor* field = descriptor_->field(i);
-      if (field->is_repeated() || field->containing_oneof()) {
-        continue;
-      }
-      fields_with_has_bits++;
-    }
-
-    int has_bits_size = (fields_with_has_bits + 31) / 32;
-
-    for (int i = 0; i < has_bits_size; i++) {
-      std::swap(has_bits1[i], has_bits2[i]);
-    }
-  }
-
-  for (int i = 0; i <= last_non_weak_field_index_; i++) {
-    const FieldDescriptor* field = descriptor_->field(i);
-    if (field->containing_oneof()) continue;
-    SwapField(message1, message2, field);
-  }
-  const int oneof_decl_count = descriptor_->oneof_decl_count();
-  for (int i = 0; i < oneof_decl_count; i++) {
-    SwapOneofField(message1, message2, descriptor_->oneof_decl(i));
-  }
-
-  if (schema_.HasExtensionSet()) {
-    MutableExtensionSet(message1)->Swap(MutableExtensionSet(message2));
-  }
-
-  MutableUnknownFields(message1)->Swap(MutableUnknownFields(message2));
+  UnsafeArenaSwap(message1, message2);
 }
 
-void GeneratedMessageReflection::SwapFields(
-    Message* message1,
-    Message* message2,
+template <bool unsafe_shallow_swap>
+void Reflection::SwapFieldsImpl(
+    Message* message1, Message* message2,
     const std::vector<const FieldDescriptor*>& fields) const {
   if (message1 == message2) return;
 
   // TODO(kenton):  Other Reflection methods should probably check this too.
   GOOGLE_CHECK_EQ(message1->GetReflection(), this)
-    << "First argument to SwapFields() (of type \""
-    << message1->GetDescriptor()->full_name()
-    << "\") is not compatible with this reflection object (which is for type \""
-    << descriptor_->full_name()
-    << "\").  Note that the exact same class is required; not just the same "
-       "descriptor.";
+      << "First argument to SwapFields() (of type \""
+      << message1->GetDescriptor()->full_name()
+      << "\") is not compatible with this reflection object (which is for type "
+         "\""
+      << descriptor_->full_name()
+      << "\").  Note that the exact same class is required; not just the same "
+         "descriptor.";
   GOOGLE_CHECK_EQ(message2->GetReflection(), this)
-    << "Second argument to SwapFields() (of type \""
-    << message2->GetDescriptor()->full_name()
-    << "\") is not compatible with this reflection object (which is for type \""
-    << descriptor_->full_name()
-    << "\").  Note that the exact same class is required; not just the same "
-       "descriptor.";
+      << "Second argument to SwapFields() (of type \""
+      << message2->GetDescriptor()->full_name()
+      << "\") is not compatible with this reflection object (which is for type "
+         "\""
+      << descriptor_->full_name()
+      << "\").  Note that the exact same class is required; not just the same "
+         "descriptor.";
 
   std::set<int> swapped_oneof;
 
-  const int fields_size = static_cast<int>(fields.size());
-  for (int i = 0; i < fields_size; i++) {
-    const FieldDescriptor* field = fields[i];
+  GOOGLE_DCHECK(!unsafe_shallow_swap || message1->GetArenaForAllocation() ==
+                                     message2->GetArenaForAllocation());
+
+  const Message* prototype =
+      message_factory_->GetPrototype(message1->GetDescriptor());
+  for (const auto* field : fields) {
+    CheckInvalidAccess(schema_, field);
     if (field->is_extension()) {
-      MutableExtensionSet(message1)->SwapExtension(
-          MutableExtensionSet(message2),
-          field->number());
+      if (unsafe_shallow_swap) {
+        MutableExtensionSet(message1)->UnsafeShallowSwapExtension(
+            MutableExtensionSet(message2), field->number());
+      } else {
+        MutableExtensionSet(message1)->SwapExtension(
+            prototype, MutableExtensionSet(message2), field->number());
+      }
     } else {
-      if (field->containing_oneof()) {
+      if (schema_.InRealOneof(field)) {
         int oneof_index = field->containing_oneof()->index();
         // Only swap the oneof field once.
         if (swapped_oneof.find(oneof_index) != swapped_oneof.end()) {
           continue;
         }
         swapped_oneof.insert(oneof_index);
-        SwapOneofField(message1, message2, field->containing_oneof());
+        SwapOneofField<unsafe_shallow_swap>(message1, message2,
+                                            field->containing_oneof());
       } else {
+        // Swap field.
+        if (unsafe_shallow_swap) {
+          UnsafeShallowSwapField(message1, message2, field);
+        } else {
+          SwapField(message1, message2, field);
+        }
         // Swap has bit for non-repeated fields.  We have already checked for
-        // oneof already.
+        // oneof already. This has to be done after SwapField, because SwapField
+        // may depend on the information in has bits.
         if (!field->is_repeated()) {
           SwapBit(message1, message2, field);
         }
-        // Swap field.
-        SwapField(message1, message2, field);
       }
     }
   }
 }
 
+void Reflection::SwapFields(
+    Message* message1, Message* message2,
+    const std::vector<const FieldDescriptor*>& fields) const {
+  SwapFieldsImpl<false>(message1, message2, fields);
+}
+
+void Reflection::UnsafeShallowSwapFields(
+    Message* message1, Message* message2,
+    const std::vector<const FieldDescriptor*>& fields) const {
+  SwapFieldsImpl<true>(message1, message2, fields);
+}
+
+void Reflection::UnsafeArenaSwapFields(
+    Message* lhs, Message* rhs,
+    const std::vector<const FieldDescriptor*>& fields) const {
+  GOOGLE_DCHECK_EQ(lhs->GetArenaForAllocation(), rhs->GetArenaForAllocation());
+  UnsafeShallowSwapFields(lhs, rhs, fields);
+}
+
 // -------------------------------------------------------------------
 
-bool GeneratedMessageReflection::HasField(const Message& message,
-                                          const FieldDescriptor* field) const {
+bool Reflection::HasField(const Message& message,
+                          const FieldDescriptor* field) const {
   USAGE_CHECK_MESSAGE_TYPE(HasField);
   USAGE_CHECK_SINGULAR(HasField);
+  CheckInvalidAccess(schema_, field);
 
   if (field->is_extension()) {
     return GetExtensionSet(message).Has(field->number());
   } else {
-    if (field->containing_oneof()) {
+    if (schema_.InRealOneof(field)) {
       return HasOneofField(message, field);
     } else {
       return HasBit(message, field);
@@ -712,33 +1074,88 @@ bool GeneratedMessageReflection::HasField(const Message& message,
   }
 }
 
-int GeneratedMessageReflection::FieldSize(const Message& message,
-                                          const FieldDescriptor* field) const {
+void Reflection::UnsafeArenaSwap(Message* lhs, Message* rhs) const {
+  if (lhs == rhs) return;
+
+  MutableInternalMetadata(lhs)->InternalSwap(MutableInternalMetadata(rhs));
+
+  for (int i = 0; i <= last_non_weak_field_index_; i++) {
+    const FieldDescriptor* field = descriptor_->field(i);
+    if (schema_.InRealOneof(field)) continue;
+    if (schema_.IsFieldStripped(field)) continue;
+    UnsafeShallowSwapField(lhs, rhs, field);
+  }
+  const int oneof_decl_count = descriptor_->oneof_decl_count();
+  for (int i = 0; i < oneof_decl_count; i++) {
+    const OneofDescriptor* oneof = descriptor_->oneof_decl(i);
+    if (!oneof->is_synthetic()) {
+      SwapOneofField<true>(lhs, rhs, oneof);
+    }
+  }
+
+  // Swapping bits need to happen after swapping fields, because the latter may
+  // depend on the has bit information.
+  if (schema_.HasHasbits()) {
+    uint32* lhs_has_bits = MutableHasBits(lhs);
+    uint32* rhs_has_bits = MutableHasBits(rhs);
+
+    int fields_with_has_bits = 0;
+    for (int i = 0; i < descriptor_->field_count(); i++) {
+      const FieldDescriptor* field = descriptor_->field(i);
+      if (field->is_repeated() || schema_.InRealOneof(field)) {
+        continue;
+      }
+      fields_with_has_bits++;
+    }
+
+    int has_bits_size = (fields_with_has_bits + 31) / 32;
+
+    for (int i = 0; i < has_bits_size; i++) {
+      std::swap(lhs_has_bits[i], rhs_has_bits[i]);
+    }
+  }
+
+  if (schema_.HasExtensionSet()) {
+    MutableExtensionSet(lhs)->InternalSwap(MutableExtensionSet(rhs));
+  }
+}
+
+int Reflection::FieldSize(const Message& message,
+                          const FieldDescriptor* field) const {
   USAGE_CHECK_MESSAGE_TYPE(FieldSize);
   USAGE_CHECK_REPEATED(FieldSize);
+  CheckInvalidAccess(schema_, field);
 
   if (field->is_extension()) {
     return GetExtensionSet(message).ExtensionSize(field->number());
   } else {
     switch (field->cpp_type()) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                                     \
-      case FieldDescriptor::CPPTYPE_##UPPERCASE :                             \
-        return GetRaw<RepeatedField<LOWERCASE> >(message, field).size()
-
-      HANDLE_TYPE( INT32,  int32);
-      HANDLE_TYPE( INT64,  int64);
-      HANDLE_TYPE(UINT32, uint32);
-      HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)    \
+  case FieldDescriptor::CPPTYPE_##UPPERCASE: \
+    return GetRaw<RepeatedField<LOWERCASE> >(message, field).size()
+
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
       HANDLE_TYPE(DOUBLE, double);
-      HANDLE_TYPE( FLOAT,  float);
-      HANDLE_TYPE(  BOOL,   bool);
-      HANDLE_TYPE(  ENUM,    int);
+      HANDLE_TYPE(FLOAT, float);
+      HANDLE_TYPE(BOOL, bool);
+      HANDLE_TYPE(ENUM, int);
 #undef HANDLE_TYPE
 
       case FieldDescriptor::CPPTYPE_STRING:
       case FieldDescriptor::CPPTYPE_MESSAGE:
         if (IsMapFieldInApi(field)) {
-          return GetRaw<MapFieldBase>(message, field).GetRepeatedField().size();
+          const internal::MapFieldBase& map =
+              GetRaw<MapFieldBase>(message, field);
+          if (map.IsRepeatedFieldValid()) {
+            return map.GetRepeatedField().size();
+          } else {
+            // No need to materialize the repeated field if it is out of sync:
+            // its size will be the same as the map's size.
+            return map.size();
+          }
         } else {
           return GetRaw<RepeatedPtrFieldBase>(message, field).size();
         }
@@ -749,14 +1166,15 @@ int GeneratedMessageReflection::FieldSize(const Message& message,
   }
 }
 
-void GeneratedMessageReflection::ClearField(
-    Message* message, const FieldDescriptor* field) const {
+void Reflection::ClearField(Message* message,
+                            const FieldDescriptor* field) const {
   USAGE_CHECK_MESSAGE_TYPE(ClearField);
+  CheckInvalidAccess(schema_, field);
 
   if (field->is_extension()) {
     MutableExtensionSet(message)->ClearExtension(field->number());
   } else if (!field->is_repeated()) {
-    if (field->containing_oneof()) {
+    if (schema_.InRealOneof(field)) {
       ClearOneofField(message, field);
       return;
     }
@@ -765,34 +1183,40 @@ void GeneratedMessageReflection::ClearField(
 
       // We need to set the field back to its default value.
       switch (field->cpp_type()) {
-#define CLEAR_TYPE(CPPTYPE, TYPE)                                            \
-        case FieldDescriptor::CPPTYPE_##CPPTYPE:                             \
-          *MutableRaw<TYPE>(message, field) =                                \
-            field->default_value_##TYPE();                                   \
-          break;
-
-        CLEAR_TYPE(INT32 , int32 );
-        CLEAR_TYPE(INT64 , int64 );
-        CLEAR_TYPE(UINT32, uint32);
-        CLEAR_TYPE(UINT64, uint64);
-        CLEAR_TYPE(FLOAT , float );
+#define CLEAR_TYPE(CPPTYPE, TYPE)                                      \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE:                             \
+    *MutableRaw<TYPE>(message, field) = field->default_value_##TYPE(); \
+    break;
+
+        CLEAR_TYPE(INT32, int32_t);
+        CLEAR_TYPE(INT64, int64_t);
+        CLEAR_TYPE(UINT32, uint32_t);
+        CLEAR_TYPE(UINT64, uint64_t);
+        CLEAR_TYPE(FLOAT, float);
         CLEAR_TYPE(DOUBLE, double);
-        CLEAR_TYPE(BOOL  , bool  );
+        CLEAR_TYPE(BOOL, bool);
 #undef CLEAR_TYPE
 
         case FieldDescriptor::CPPTYPE_ENUM:
           *MutableRaw<int>(message, field) =
-            field->default_value_enum()->number();
+              field->default_value_enum()->number();
           break;
 
         case FieldDescriptor::CPPTYPE_STRING: {
           switch (field->options().ctype()) {
             default:  // TODO(kenton):  Support other string reps.
             case FieldOptions::STRING: {
-              const string* default_ptr =
-                  &DefaultRaw<ArenaStringPtr>(field).Get();
-              MutableRaw<ArenaStringPtr>(message, field)->SetAllocated(
-                  default_ptr, NULL, GetArena(message));
+              if (IsInlined(field)) {
+                // Currently, string with default value can't be inlined. So we
+                // don't have to handle default value here.
+                MutableRaw<InlinedStringField>(message, field)->ClearToEmpty();
+                break;
+              }
+              const std::string* default_ptr =
+                  DefaultRaw<ArenaStringPtr>(field).GetPointer();
+              MutableRaw<ArenaStringPtr>(message, field)
+                  ->SetAllocated(default_ptr, nullptr,
+                                 message->GetArenaForAllocation());
               break;
             }
           }
@@ -800,13 +1224,13 @@ void GeneratedMessageReflection::ClearField(
         }
 
         case FieldDescriptor::CPPTYPE_MESSAGE:
-          if (!schema_.HasHasbits()) {
+          if (schema_.HasBitIndex(field) == static_cast<uint32_t>(-1)) {
             // Proto3 does not have has-bits and we need to set a message field
-            // to NULL in order to indicate its un-presence.
-            if (GetArena(message) == NULL) {
+            // to nullptr in order to indicate its un-presence.
+            if (message->GetArenaForAllocation() == nullptr) {
               delete *MutableRaw<Message*>(message, field);
             }
-            *MutableRaw<Message*>(message, field) = NULL;
+            *MutableRaw<Message*>(message, field) = nullptr;
           } else {
             (*MutableRaw<Message*>(message, field))->Clear();
           }
@@ -815,26 +1239,26 @@ void GeneratedMessageReflection::ClearField(
     }
   } else {
     switch (field->cpp_type()) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                                     \
-      case FieldDescriptor::CPPTYPE_##UPPERCASE :                             \
-        MutableRaw<RepeatedField<LOWERCASE> >(message, field)->Clear();       \
-        break
-
-      HANDLE_TYPE( INT32,  int32);
-      HANDLE_TYPE( INT64,  int64);
-      HANDLE_TYPE(UINT32, uint32);
-      HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                           \
+  case FieldDescriptor::CPPTYPE_##UPPERCASE:                        \
+    MutableRaw<RepeatedField<LOWERCASE> >(message, field)->Clear(); \
+    break
+
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
       HANDLE_TYPE(DOUBLE, double);
-      HANDLE_TYPE( FLOAT,  float);
-      HANDLE_TYPE(  BOOL,   bool);
-      HANDLE_TYPE(  ENUM,    int);
+      HANDLE_TYPE(FLOAT, float);
+      HANDLE_TYPE(BOOL, bool);
+      HANDLE_TYPE(ENUM, int);
 #undef HANDLE_TYPE
 
       case FieldDescriptor::CPPTYPE_STRING: {
         switch (field->options().ctype()) {
           default:  // TODO(kenton):  Support other string reps.
           case FieldOptions::STRING:
-            MutableRaw<RepeatedPtrField<string> >(message, field)->Clear();
+            MutableRaw<RepeatedPtrField<std::string> >(message, field)->Clear();
             break;
         }
         break;
@@ -842,9 +1266,7 @@ void GeneratedMessageReflection::ClearField(
 
       case FieldDescriptor::CPPTYPE_MESSAGE: {
         if (IsMapFieldInApi(field)) {
-          MutableRaw<MapFieldBase>(message, field)
-              ->MutableRepeatedField()
-              ->Clear<GenericTypeHandler<Message> >();
+          MutableRaw<MapFieldBase>(message, field)->Clear();
         } else {
           // We don't know which subclass of RepeatedPtrFieldBase the type is,
           // so we use RepeatedPtrFieldBase directly.
@@ -857,36 +1279,37 @@ void GeneratedMessageReflection::ClearField(
   }
 }
 
-void GeneratedMessageReflection::RemoveLast(
-    Message* message,
-    const FieldDescriptor* field) const {
+void Reflection::RemoveLast(Message* message,
+                            const FieldDescriptor* field) const {
   USAGE_CHECK_MESSAGE_TYPE(RemoveLast);
   USAGE_CHECK_REPEATED(RemoveLast);
+  CheckInvalidAccess(schema_, field);
 
   if (field->is_extension()) {
     MutableExtensionSet(message)->RemoveLast(field->number());
   } else {
     switch (field->cpp_type()) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                                     \
-      case FieldDescriptor::CPPTYPE_##UPPERCASE :                             \
-        MutableRaw<RepeatedField<LOWERCASE> >(message, field)->RemoveLast();  \
-        break
-
-      HANDLE_TYPE( INT32,  int32);
-      HANDLE_TYPE( INT64,  int64);
-      HANDLE_TYPE(UINT32, uint32);
-      HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                                \
+  case FieldDescriptor::CPPTYPE_##UPPERCASE:                             \
+    MutableRaw<RepeatedField<LOWERCASE> >(message, field)->RemoveLast(); \
+    break
+
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
       HANDLE_TYPE(DOUBLE, double);
-      HANDLE_TYPE( FLOAT,  float);
-      HANDLE_TYPE(  BOOL,   bool);
-      HANDLE_TYPE(  ENUM,    int);
+      HANDLE_TYPE(FLOAT, float);
+      HANDLE_TYPE(BOOL, bool);
+      HANDLE_TYPE(ENUM, int);
 #undef HANDLE_TYPE
 
       case FieldDescriptor::CPPTYPE_STRING:
         switch (field->options().ctype()) {
           default:  // TODO(kenton):  Support other string reps.
           case FieldOptions::STRING:
-            MutableRaw<RepeatedPtrField<string> >(message, field)->RemoveLast();
+            MutableRaw<RepeatedPtrField<std::string> >(message, field)
+                ->RemoveLast();
             break;
         }
         break;
@@ -898,59 +1321,83 @@ void GeneratedMessageReflection::RemoveLast(
               ->RemoveLast<GenericTypeHandler<Message> >();
         } else {
           MutableRaw<RepeatedPtrFieldBase>(message, field)
-            ->RemoveLast<GenericTypeHandler<Message> >();
+              ->RemoveLast<GenericTypeHandler<Message> >();
         }
         break;
     }
   }
 }
 
-Message* GeneratedMessageReflection::ReleaseLast(
-    Message* message,
-    const FieldDescriptor* field) const {
+Message* Reflection::ReleaseLast(Message* message,
+                                 const FieldDescriptor* field) const {
   USAGE_CHECK_ALL(ReleaseLast, REPEATED, MESSAGE);
+  CheckInvalidAccess(schema_, field);
 
+  Message* released;
   if (field->is_extension()) {
-    return static_cast<Message*>(
+    released = static_cast<Message*>(
         MutableExtensionSet(message)->ReleaseLast(field->number()));
   } else {
     if (IsMapFieldInApi(field)) {
+      released = MutableRaw<MapFieldBase>(message, field)
+                     ->MutableRepeatedField()
+                     ->ReleaseLast<GenericTypeHandler<Message>>();
+    } else {
+      released = MutableRaw<RepeatedPtrFieldBase>(message, field)
+                     ->ReleaseLast<GenericTypeHandler<Message>>();
+    }
+  }
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  return MaybeForceCopy(message->GetArenaForAllocation(), released);
+#else   // PROTOBUF_FORCE_COPY_IN_RELEASE
+  return released;
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+}
+
+Message* Reflection::UnsafeArenaReleaseLast(
+    Message* message, const FieldDescriptor* field) const {
+  USAGE_CHECK_ALL(UnsafeArenaReleaseLast, REPEATED, MESSAGE);
+  CheckInvalidAccess(schema_, field);
+
+  if (field->is_extension()) {
+    return static_cast<Message*>(
+        MutableExtensionSet(message)->UnsafeArenaReleaseLast(field->number()));
+  } else {
+    if (IsMapFieldInApi(field)) {
       return MutableRaw<MapFieldBase>(message, field)
           ->MutableRepeatedField()
-          ->ReleaseLast<GenericTypeHandler<Message> >();
+          ->UnsafeArenaReleaseLast<GenericTypeHandler<Message>>();
     } else {
       return MutableRaw<RepeatedPtrFieldBase>(message, field)
-        ->ReleaseLast<GenericTypeHandler<Message> >();
+          ->UnsafeArenaReleaseLast<GenericTypeHandler<Message>>();
     }
   }
 }
 
-void GeneratedMessageReflection::SwapElements(
-    Message* message,
-    const FieldDescriptor* field,
-    int index1,
-    int index2) const {
+void Reflection::SwapElements(Message* message, const FieldDescriptor* field,
+                              int index1, int index2) const {
   USAGE_CHECK_MESSAGE_TYPE(Swap);
   USAGE_CHECK_REPEATED(Swap);
+  CheckInvalidAccess(schema_, field);
 
   if (field->is_extension()) {
     MutableExtensionSet(message)->SwapElements(field->number(), index1, index2);
   } else {
     switch (field->cpp_type()) {
-#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                                     \
-      case FieldDescriptor::CPPTYPE_##UPPERCASE :                             \
-        MutableRaw<RepeatedField<LOWERCASE> >(message, field)                 \
-            ->SwapElements(index1, index2);                                   \
-        break
-
-      HANDLE_TYPE( INT32,  int32);
-      HANDLE_TYPE( INT64,  int64);
-      HANDLE_TYPE(UINT32, uint32);
-      HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(UPPERCASE, LOWERCASE)                 \
+  case FieldDescriptor::CPPTYPE_##UPPERCASE:              \
+    MutableRaw<RepeatedField<LOWERCASE> >(message, field) \
+        ->SwapElements(index1, index2);                   \
+    break
+
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
       HANDLE_TYPE(DOUBLE, double);
-      HANDLE_TYPE( FLOAT,  float);
-      HANDLE_TYPE(  BOOL,   bool);
-      HANDLE_TYPE(  ENUM,    int);
+      HANDLE_TYPE(FLOAT, float);
+      HANDLE_TYPE(BOOL, bool);
+      HANDLE_TYPE(ENUM, int);
 #undef HANDLE_TYPE
 
       case FieldDescriptor::CPPTYPE_STRING:
@@ -961,7 +1408,7 @@ void GeneratedMessageReflection::SwapElements(
               ->SwapElements(index1, index2);
         } else {
           MutableRaw<RepeatedPtrFieldBase>(message, field)
-            ->SwapElements(index1, index2);
+              ->SwapElements(index1, index2);
         }
         break;
     }
@@ -977,16 +1424,27 @@ struct FieldNumberSorter {
   }
 };
 
-inline bool IsIndexInHasBitSet(
-    const uint32* has_bit_set, uint32 has_bit_index) {
+bool IsIndexInHasBitSet(const uint32_t* has_bit_set, uint32_t has_bit_index) {
   GOOGLE_DCHECK_NE(has_bit_index, ~0u);
   return ((has_bit_set[has_bit_index / 32] >> (has_bit_index % 32)) &
-          static_cast<uint32>(1)) != 0;
+          static_cast<uint32_t>(1)) != 0;
+}
+
+bool CreateUnknownEnumValues(const FileDescriptor* file) {
+  return file->syntax() == FileDescriptor::SYNTAX_PROTO3;
 }
 }  // namespace
 
-void GeneratedMessageReflection::ListFields(
-    const Message& message,
+namespace internal {
+bool CreateUnknownEnumValues(const FieldDescriptor* field) {
+  bool open_enum = false;
+  return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 || open_enum;
+}
+}  // namespace internal
+using internal::CreateUnknownEnumValues;
+
+void Reflection::ListFieldsMayFailOnStripped(
+    const Message& message, bool should_fail,
     std::vector<const FieldDescriptor*>* output) const {
   output->clear();
 
@@ -995,29 +1453,36 @@ void GeneratedMessageReflection::ListFields(
 
   // Optimization: Avoid calling GetHasBits() and HasOneofField() many times
   // within the field loop.  We allow this violation of ReflectionSchema
-  // encapsulation because this function takes a noticable about of CPU
+  // encapsulation because this function takes a noticeable about of CPU
   // fleetwide and properly allowing this optimization through public interfaces
   // seems more trouble than it is worth.
-  const uint32* const has_bits =
-      schema_.HasHasbits() ? GetHasBits(message) : NULL;
-  const uint32* const has_bits_indices = schema_.has_bit_indices_;
-  const uint32* const oneof_case_array =
-      GetConstPointerAtOffset<uint32>(&message, schema_.oneof_case_offset_);
+  const uint32_t* const has_bits =
+      schema_.HasHasbits() ? GetHasBits(message) : nullptr;
+  const uint32_t* const has_bits_indices = schema_.has_bit_indices_;
   output->reserve(descriptor_->field_count());
-  for (int i = 0; i <= last_non_weak_field_index_; i++) {
+  const int last_non_weak_field_index = last_non_weak_field_index_;
+  for (int i = 0; i <= last_non_weak_field_index; i++) {
     const FieldDescriptor* field = descriptor_->field(i);
+    if (!should_fail && schema_.IsFieldStripped(field)) {
+      continue;
+    }
     if (field->is_repeated()) {
       if (FieldSize(message, field) > 0) {
         output->push_back(field);
       }
     } else {
       const OneofDescriptor* containing_oneof = field->containing_oneof();
-      if (containing_oneof) {
+      if (schema_.InRealOneof(field)) {
+        const uint32_t* const oneof_case_array =
+            GetConstPointerAtOffset<uint32_t>(&message,
+                                              schema_.oneof_case_offset_);
         // Equivalent to: HasOneofField(message, field)
-        if (oneof_case_array[containing_oneof->index()] == field->number()) {
+        if (static_cast<int64_t>(oneof_case_array[containing_oneof->index()]) ==
+            field->number()) {
           output->push_back(field);
         }
-      } else if (has_bits) {
+      } else if (has_bits && has_bits_indices[i] != static_cast<uint32_t>(-1)) {
+        CheckInvalidAccess(schema_, field);
         // Equivalent to: HasBit(message, field)
         if (IsIndexInHasBitSet(has_bits, has_bits_indices[i])) {
           output->push_back(field);
@@ -1036,140 +1501,184 @@ void GeneratedMessageReflection::ListFields(
   std::sort(output->begin(), output->end(), FieldNumberSorter());
 }
 
+void Reflection::ListFields(const Message& message,
+                            std::vector<const FieldDescriptor*>* output) const {
+  ListFieldsMayFailOnStripped(message, true, output);
+}
+
+void Reflection::ListFieldsOmitStripped(
+    const Message& message, std::vector<const FieldDescriptor*>* output) const {
+  ListFieldsMayFailOnStripped(message, false, output);
+}
+
 // -------------------------------------------------------------------
 
 #undef DEFINE_PRIMITIVE_ACCESSORS
-#define DEFINE_PRIMITIVE_ACCESSORS(TYPENAME, TYPE, PASSTYPE, CPPTYPE)        \
-  PASSTYPE GeneratedMessageReflection::Get##TYPENAME(                        \
-      const Message& message, const FieldDescriptor* field) const {          \
-    USAGE_CHECK_ALL(Get##TYPENAME, SINGULAR, CPPTYPE);                       \
-    if (field->is_extension()) {                                             \
-      return GetExtensionSet(message).Get##TYPENAME(                         \
-        field->number(), field->default_value_##PASSTYPE());                 \
-    } else {                                                                 \
-      return GetField<TYPE>(message, field);                                 \
-    }                                                                        \
-  }                                                                          \
-                                                                             \
-  void GeneratedMessageReflection::Set##TYPENAME(                            \
-      Message* message, const FieldDescriptor* field,                        \
-      PASSTYPE value) const {                                                \
-    USAGE_CHECK_ALL(Set##TYPENAME, SINGULAR, CPPTYPE);                       \
-    if (field->is_extension()) {                                             \
-      return MutableExtensionSet(message)->Set##TYPENAME(                    \
-        field->number(), field->type(), value, field);                       \
-    } else {                                                                 \
-      SetField<TYPE>(message, field, value);                                 \
-    }                                                                        \
-  }                                                                          \
-                                                                             \
-  PASSTYPE GeneratedMessageReflection::GetRepeated##TYPENAME(                \
-      const Message& message,                                                \
-      const FieldDescriptor* field, int index) const {                       \
-    USAGE_CHECK_ALL(GetRepeated##TYPENAME, REPEATED, CPPTYPE);               \
-    if (field->is_extension()) {                                             \
-      return GetExtensionSet(message).GetRepeated##TYPENAME(                 \
-        field->number(), index);                                             \
-    } else {                                                                 \
-      return GetRepeatedField<TYPE>(message, field, index);                  \
-    }                                                                        \
-  }                                                                          \
-                                                                             \
-  void GeneratedMessageReflection::SetRepeated##TYPENAME(                    \
-      Message* message, const FieldDescriptor* field,                        \
-      int index, PASSTYPE value) const {                                     \
-    USAGE_CHECK_ALL(SetRepeated##TYPENAME, REPEATED, CPPTYPE);               \
-    if (field->is_extension()) {                                             \
-      MutableExtensionSet(message)->SetRepeated##TYPENAME(                   \
-        field->number(), index, value);                                      \
-    } else {                                                                 \
-      SetRepeatedField<TYPE>(message, field, index, value);                  \
-    }                                                                        \
-  }                                                                          \
-                                                                             \
-  void GeneratedMessageReflection::Add##TYPENAME(                            \
-      Message* message, const FieldDescriptor* field,                        \
-      PASSTYPE value) const {                                                \
-    USAGE_CHECK_ALL(Add##TYPENAME, REPEATED, CPPTYPE);                       \
-    if (field->is_extension()) {                                             \
-      MutableExtensionSet(message)->Add##TYPENAME(                           \
-        field->number(), field->type(), field->options().packed(), value,    \
-        field);                                                              \
-    } else {                                                                 \
-      AddField<TYPE>(message, field, value);                                 \
-    }                                                                        \
-  }
-
-DEFINE_PRIMITIVE_ACCESSORS(Int32 , int32 , int32 , INT32 )
-DEFINE_PRIMITIVE_ACCESSORS(Int64 , int64 , int64 , INT64 )
-DEFINE_PRIMITIVE_ACCESSORS(UInt32, uint32, uint32, UINT32)
-DEFINE_PRIMITIVE_ACCESSORS(UInt64, uint64, uint64, UINT64)
-DEFINE_PRIMITIVE_ACCESSORS(Float , float , float , FLOAT )
+#define DEFINE_PRIMITIVE_ACCESSORS(TYPENAME, TYPE, PASSTYPE, CPPTYPE)          \
+  PASSTYPE Reflection::Get##TYPENAME(const Message& message,                   \
+                                     const FieldDescriptor* field) const {     \
+    USAGE_CHECK_ALL(Get##TYPENAME, SINGULAR, CPPTYPE);                         \
+    if (field->is_extension()) {                                               \
+      return GetExtensionSet(message).Get##TYPENAME(                           \
+          field->number(), field->default_value_##PASSTYPE());                 \
+    } else if (schema_.InRealOneof(field) && !HasOneofField(message, field)) { \
+      return field->default_value_##PASSTYPE();                                \
+    } else {                                                                   \
+      return GetField<TYPE>(message, field);                                   \
+    }                                                                          \
+  }                                                                            \
+                                                                               \
+  void Reflection::Set##TYPENAME(                                              \
+      Message* message, const FieldDescriptor* field, PASSTYPE value) const {  \
+    USAGE_CHECK_ALL(Set##TYPENAME, SINGULAR, CPPTYPE);                         \
+    if (field->is_extension()) {                                               \
+      return MutableExtensionSet(message)->Set##TYPENAME(                      \
+          field->number(), field->type(), value, field);                       \
+    } else {                                                                   \
+      SetField<TYPE>(message, field, value);                                   \
+    }                                                                          \
+  }                                                                            \
+                                                                               \
+  PASSTYPE Reflection::GetRepeated##TYPENAME(                                  \
+      const Message& message, const FieldDescriptor* field, int index) const { \
+    USAGE_CHECK_ALL(GetRepeated##TYPENAME, REPEATED, CPPTYPE);                 \
+    if (field->is_extension()) {                                               \
+      return GetExtensionSet(message).GetRepeated##TYPENAME(field->number(),   \
+                                                            index);            \
+    } else {                                                                   \
+      return GetRepeatedField<TYPE>(message, field, index);                    \
+    }                                                                          \
+  }                                                                            \
+                                                                               \
+  void Reflection::SetRepeated##TYPENAME(Message* message,                     \
+                                         const FieldDescriptor* field,         \
+                                         int index, PASSTYPE value) const {    \
+    USAGE_CHECK_ALL(SetRepeated##TYPENAME, REPEATED, CPPTYPE);                 \
+    if (field->is_extension()) {                                               \
+      MutableExtensionSet(message)->SetRepeated##TYPENAME(field->number(),     \
+                                                          index, value);       \
+    } else {                                                                   \
+      SetRepeatedField<TYPE>(message, field, index, value);                    \
+    }                                                                          \
+  }                                                                            \
+                                                                               \
+  void Reflection::Add##TYPENAME(                                              \
+      Message* message, const FieldDescriptor* field, PASSTYPE value) const {  \
+    USAGE_CHECK_ALL(Add##TYPENAME, REPEATED, CPPTYPE);                         \
+    if (field->is_extension()) {                                               \
+      MutableExtensionSet(message)->Add##TYPENAME(                             \
+          field->number(), field->type(), field->options().packed(), value,    \
+          field);                                                              \
+    } else {                                                                   \
+      AddField<TYPE>(message, field, value);                                   \
+    }                                                                          \
+  }
+
+DEFINE_PRIMITIVE_ACCESSORS(Int32, int32_t, int32_t, INT32)
+DEFINE_PRIMITIVE_ACCESSORS(Int64, int64_t, int64_t, INT64)
+DEFINE_PRIMITIVE_ACCESSORS(UInt32, uint32_t, uint32_t, UINT32)
+DEFINE_PRIMITIVE_ACCESSORS(UInt64, uint64_t, uint64_t, UINT64)
+DEFINE_PRIMITIVE_ACCESSORS(Float, float, float, FLOAT)
 DEFINE_PRIMITIVE_ACCESSORS(Double, double, double, DOUBLE)
-DEFINE_PRIMITIVE_ACCESSORS(Bool  , bool  , bool  , BOOL  )
+DEFINE_PRIMITIVE_ACCESSORS(Bool, bool, bool, BOOL)
 #undef DEFINE_PRIMITIVE_ACCESSORS
 
 // -------------------------------------------------------------------
 
-string GeneratedMessageReflection::GetString(
-    const Message& message, const FieldDescriptor* field) const {
+std::string Reflection::GetString(const Message& message,
+                                  const FieldDescriptor* field) const {
   USAGE_CHECK_ALL(GetString, SINGULAR, STRING);
   if (field->is_extension()) {
     return GetExtensionSet(message).GetString(field->number(),
                                               field->default_value_string());
   } else {
+    if (schema_.InRealOneof(field) && !HasOneofField(message, field)) {
+      return field->default_value_string();
+    }
     switch (field->options().ctype()) {
       default:  // TODO(kenton):  Support other string reps.
       case FieldOptions::STRING: {
-        return GetField<ArenaStringPtr>(message, field).Get();
+        if (IsInlined(field)) {
+          return GetField<InlinedStringField>(message, field).GetNoArena();
+        }
+
+        if (auto* value =
+                GetField<ArenaStringPtr>(message, field).GetPointer()) {
+          return *value;
+        }
+        return field->default_value_string();
       }
     }
-
-    GOOGLE_LOG(FATAL) << "Can't get here.";
-    return GetEmptyString();  // Make compiler happy.
   }
 }
 
-const string& GeneratedMessageReflection::GetStringReference(
-    const Message& message,
-    const FieldDescriptor* field, string* scratch) const {
+const std::string& Reflection::GetStringReference(const Message& message,
+                                                  const FieldDescriptor* field,
+                                                  std::string* scratch) const {
+  (void)scratch;  // Parameter is used by Google-internal code.
   USAGE_CHECK_ALL(GetStringReference, SINGULAR, STRING);
   if (field->is_extension()) {
     return GetExtensionSet(message).GetString(field->number(),
                                               field->default_value_string());
   } else {
+    if (schema_.InRealOneof(field) && !HasOneofField(message, field)) {
+      return field->default_value_string();
+    }
     switch (field->options().ctype()) {
       default:  // TODO(kenton):  Support other string reps.
       case FieldOptions::STRING: {
-        return GetField<ArenaStringPtr>(message, field).Get();
+        if (IsInlined(field)) {
+          return GetField<InlinedStringField>(message, field).GetNoArena();
+        }
+
+        if (auto* value =
+                GetField<ArenaStringPtr>(message, field).GetPointer()) {
+          return *value;
+        }
+        return field->default_value_string();
       }
     }
-
-    GOOGLE_LOG(FATAL) << "Can't get here.";
-    return GetEmptyString();  // Make compiler happy.
   }
 }
 
 
-void GeneratedMessageReflection::SetString(
-    Message* message, const FieldDescriptor* field,
-    const string& value) const {
+void Reflection::SetString(Message* message, const FieldDescriptor* field,
+                           std::string value) const {
   USAGE_CHECK_ALL(SetString, SINGULAR, STRING);
   if (field->is_extension()) {
-    return MutableExtensionSet(message)->SetString(field->number(),
-                                                   field->type(), value, field);
+    return MutableExtensionSet(message)->SetString(
+        field->number(), field->type(), std::move(value), field);
   } else {
     switch (field->options().ctype()) {
       default:  // TODO(kenton):  Support other string reps.
       case FieldOptions::STRING: {
-        const string* default_ptr = &DefaultRaw<ArenaStringPtr>(field).Get();
-        if (field->containing_oneof() && !HasOneofField(*message, field)) {
+        if (IsInlined(field)) {
+          const uint32_t index = schema_.InlinedStringIndex(field);
+          uint32_t* states =
+              &MutableInlinedStringDonatedArray(message)[index / 32];
+          uint32_t mask = ~(static_cast<uint32_t>(1) << (index % 32));
+          MutableField<InlinedStringField>(message, field)
+              ->Set(nullptr, value, message->GetArenaForAllocation(),
+                    IsInlinedStringDonated(*message, field), states, mask);
+          break;
+        }
+
+        // Oneof string fields are never set as a default instance.
+        // We just need to pass some arbitrary default string to make it work.
+        // This allows us to not have the real default accessible from
+        // reflection.
+        const std::string* default_ptr =
+            schema_.InRealOneof(field)
+                ? nullptr
+                : DefaultRaw<ArenaStringPtr>(field).GetPointer();
+        if (schema_.InRealOneof(field) && !HasOneofField(*message, field)) {
           ClearOneof(message, field->containing_oneof());
-          MutableField<ArenaStringPtr>(message, field)->UnsafeSetDefault(
-              default_ptr);
+          MutableField<ArenaStringPtr>(message, field)
+              ->UnsafeSetDefault(default_ptr);
         }
-        MutableField<ArenaStringPtr>(message, field)->Set(default_ptr,
-            value, GetArena(message));
+        MutableField<ArenaStringPtr>(message, field)
+            ->Set(default_ptr, std::move(value),
+                  message->GetArenaForAllocation());
         break;
       }
     }
@@ -1177,8 +1686,9 @@ void GeneratedMessageReflection::SetString(
 }
 
 
-string GeneratedMessageReflection::GetRepeatedString(
-    const Message& message, const FieldDescriptor* field, int index) const {
+std::string Reflection::GetRepeatedString(const Message& message,
+                                          const FieldDescriptor* field,
+                                          int index) const {
   USAGE_CHECK_ALL(GetRepeatedString, REPEATED, STRING);
   if (field->is_extension()) {
     return GetExtensionSet(message).GetRepeatedString(field->number(), index);
@@ -1186,17 +1696,15 @@ string GeneratedMessageReflection::GetRepeatedString(
     switch (field->options().ctype()) {
       default:  // TODO(kenton):  Support other string reps.
       case FieldOptions::STRING:
-        return GetRepeatedPtrField<string>(message, field, index);
+        return GetRepeatedPtrField<std::string>(message, field, index);
     }
-
-    GOOGLE_LOG(FATAL) << "Can't get here.";
-    return GetEmptyString();  // Make compiler happy.
   }
 }
 
-const string& GeneratedMessageReflection::GetRepeatedStringReference(
-    const Message& message, const FieldDescriptor* field,
-    int index, string* scratch) const {
+const std::string& Reflection::GetRepeatedStringReference(
+    const Message& message, const FieldDescriptor* field, int index,
+    std::string* scratch) const {
+  (void)scratch;  // Parameter is used by Google-internal code.
   USAGE_CHECK_ALL(GetRepeatedStringReference, REPEATED, STRING);
   if (field->is_extension()) {
     return GetExtensionSet(message).GetRepeatedString(field->number(), index);
@@ -1204,45 +1712,42 @@ const string& GeneratedMessageReflection::GetRepeatedStringReference(
     switch (field->options().ctype()) {
       default:  // TODO(kenton):  Support other string reps.
       case FieldOptions::STRING:
-        return GetRepeatedPtrField<string>(message, field, index);
+        return GetRepeatedPtrField<std::string>(message, field, index);
     }
-
-    GOOGLE_LOG(FATAL) << "Can't get here.";
-    return GetEmptyString();  // Make compiler happy.
   }
 }
 
 
-void GeneratedMessageReflection::SetRepeatedString(
-    Message* message, const FieldDescriptor* field,
-    int index, const string& value) const {
+void Reflection::SetRepeatedString(Message* message,
+                                   const FieldDescriptor* field, int index,
+                                   std::string value) const {
   USAGE_CHECK_ALL(SetRepeatedString, REPEATED, STRING);
   if (field->is_extension()) {
-    MutableExtensionSet(message)->SetRepeatedString(
-      field->number(), index, value);
+    MutableExtensionSet(message)->SetRepeatedString(field->number(), index,
+                                                    std::move(value));
   } else {
     switch (field->options().ctype()) {
       default:  // TODO(kenton):  Support other string reps.
       case FieldOptions::STRING:
-        *MutableRepeatedField<string>(message, field, index) = value;
+        MutableRepeatedField<std::string>(message, field, index)
+            ->assign(std::move(value));
         break;
     }
   }
 }
 
 
-void GeneratedMessageReflection::AddString(
-    Message* message, const FieldDescriptor* field,
-    const string& value) const {
+void Reflection::AddString(Message* message, const FieldDescriptor* field,
+                           std::string value) const {
   USAGE_CHECK_ALL(AddString, REPEATED, STRING);
   if (field->is_extension()) {
-    MutableExtensionSet(message)->AddString(field->number(),
-                                            field->type(), value, field);
+    MutableExtensionSet(message)->AddString(field->number(), field->type(),
+                                            std::move(value), field);
   } else {
     switch (field->options().ctype()) {
       default:  // TODO(kenton):  Support other string reps.
       case FieldOptions::STRING:
-        *AddField<string>(message, field) = value;
+        AddField<std::string>(message, field)->assign(std::move(value));
         break;
     }
   }
@@ -1251,79 +1756,73 @@ void GeneratedMessageReflection::AddString(
 
 // -------------------------------------------------------------------
 
-inline bool CreateUnknownEnumValues(const FileDescriptor* file) {
-  return file->syntax() == FileDescriptor::SYNTAX_PROTO3;
-}
-
-const EnumValueDescriptor* GeneratedMessageReflection::GetEnum(
+const EnumValueDescriptor* Reflection::GetEnum(
     const Message& message, const FieldDescriptor* field) const {
   // Usage checked by GetEnumValue.
   int value = GetEnumValue(message, field);
   return field->enum_type()->FindValueByNumberCreatingIfUnknown(value);
 }
 
-int GeneratedMessageReflection::GetEnumValue(
-    const Message& message, const FieldDescriptor* field) const {
+int Reflection::GetEnumValue(const Message& message,
+                             const FieldDescriptor* field) const {
   USAGE_CHECK_ALL(GetEnumValue, SINGULAR, ENUM);
 
-  int32 value;
+  int32_t value;
   if (field->is_extension()) {
     value = GetExtensionSet(message).GetEnum(
-      field->number(), field->default_value_enum()->number());
+        field->number(), field->default_value_enum()->number());
+  } else if (schema_.InRealOneof(field) && !HasOneofField(message, field)) {
+    value = field->default_value_enum()->number();
   } else {
     value = GetField<int>(message, field);
   }
   return value;
 }
 
-void GeneratedMessageReflection::SetEnum(
-    Message* message, const FieldDescriptor* field,
-    const EnumValueDescriptor* value) const {
+void Reflection::SetEnum(Message* message, const FieldDescriptor* field,
+                         const EnumValueDescriptor* value) const {
   // Usage checked by SetEnumValue.
   USAGE_CHECK_ENUM_VALUE(SetEnum);
   SetEnumValueInternal(message, field, value->number());
 }
 
-void GeneratedMessageReflection::SetEnumValue(
-    Message* message, const FieldDescriptor* field,
-    int value) const {
+void Reflection::SetEnumValue(Message* message, const FieldDescriptor* field,
+                              int value) const {
   USAGE_CHECK_ALL(SetEnumValue, SINGULAR, ENUM);
-  if (!CreateUnknownEnumValues(descriptor_->file())) {
+  if (!CreateUnknownEnumValues(field)) {
     // Check that the value is valid if we don't support direct storage of
     // unknown enum values.
     const EnumValueDescriptor* value_desc =
         field->enum_type()->FindValueByNumber(value);
-    if (value_desc == NULL) {
-      GOOGLE_LOG(DFATAL) << "SetEnumValue accepts only valid integer values: value "
-                  << value << " unexpected for field " << field->full_name();
-      // In production builds, DFATAL will not terminate the program, so we have
-      // to do something reasonable: just set the default value.
-      value = field->default_value_enum()->number();
+    if (value_desc == nullptr) {
+      MutableUnknownFields(message)->AddVarint(field->number(), value);
+      return;
     }
   }
   SetEnumValueInternal(message, field, value);
 }
 
-void GeneratedMessageReflection::SetEnumValueInternal(
-    Message* message, const FieldDescriptor* field,
-    int value) const {
+void Reflection::SetEnumValueInternal(Message* message,
+                                      const FieldDescriptor* field,
+                                      int value) const {
   if (field->is_extension()) {
-    MutableExtensionSet(message)->SetEnum(field->number(), field->type(),
-                                          value, field);
+    MutableExtensionSet(message)->SetEnum(field->number(), field->type(), value,
+                                          field);
   } else {
     SetField<int>(message, field, value);
   }
 }
 
-const EnumValueDescriptor* GeneratedMessageReflection::GetRepeatedEnum(
+const EnumValueDescriptor* Reflection::GetRepeatedEnum(
     const Message& message, const FieldDescriptor* field, int index) const {
   // Usage checked by GetRepeatedEnumValue.
   int value = GetRepeatedEnumValue(message, field, index);
   return field->enum_type()->FindValueByNumberCreatingIfUnknown(value);
 }
 
-int GeneratedMessageReflection::GetRepeatedEnumValue(
-    const Message& message, const FieldDescriptor* field, int index) const {
+int Reflection::GetRepeatedEnumValue(const Message& message,
+                                     const FieldDescriptor* field,
+                                     int index) const {
   USAGE_CHECK_ALL(GetRepeatedEnumValue, REPEATED, ENUM);
 
   int value;
@@ -1335,84 +1834,72 @@ int GeneratedMessageReflection::GetRepeatedEnumValue(
   return value;
 }
 
-void GeneratedMessageReflection::SetRepeatedEnum(
-    Message* message,
-    const FieldDescriptor* field, int index,
-    const EnumValueDescriptor* value) const {
+void Reflection::SetRepeatedEnum(Message* message, const FieldDescriptor* field,
+                                 int index,
+                                 const EnumValueDescriptor* value) const {
   // Usage checked by SetRepeatedEnumValue.
   USAGE_CHECK_ENUM_VALUE(SetRepeatedEnum);
   SetRepeatedEnumValueInternal(message, field, index, value->number());
 }
 
-void GeneratedMessageReflection::SetRepeatedEnumValue(
-    Message* message,
-    const FieldDescriptor* field, int index,
-    int value) const {
+void Reflection::SetRepeatedEnumValue(Message* message,
+                                      const FieldDescriptor* field, int index,
+                                      int value) const {
   USAGE_CHECK_ALL(SetRepeatedEnum, REPEATED, ENUM);
-  if (!CreateUnknownEnumValues(descriptor_->file())) {
+  if (!CreateUnknownEnumValues(field)) {
     // Check that the value is valid if we don't support direct storage of
     // unknown enum values.
     const EnumValueDescriptor* value_desc =
         field->enum_type()->FindValueByNumber(value);
-    if (value_desc == NULL) {
-      GOOGLE_LOG(DFATAL) << "SetRepeatedEnumValue accepts only valid integer values: "
-                  << "value " << value << " unexpected for field "
-                  << field->full_name();
-      // In production builds, DFATAL will not terminate the program, so we have
-      // to do something reasonable: just set the default value.
-      value = field->default_value_enum()->number();
+    if (value_desc == nullptr) {
+      MutableUnknownFields(message)->AddVarint(field->number(), value);
+      return;
     }
   }
   SetRepeatedEnumValueInternal(message, field, index, value);
 }
 
-void GeneratedMessageReflection::SetRepeatedEnumValueInternal(
-    Message* message,
-    const FieldDescriptor* field, int index,
-    int value) const {
+void Reflection::SetRepeatedEnumValueInternal(Message* message,
+                                              const FieldDescriptor* field,
+                                              int index, int value) const {
   if (field->is_extension()) {
-    MutableExtensionSet(message)->SetRepeatedEnum(
-      field->number(), index, value);
+    MutableExtensionSet(message)->SetRepeatedEnum(field->number(), index,
+                                                  value);
   } else {
     SetRepeatedField<int>(message, field, index, value);
   }
 }
 
-void GeneratedMessageReflection::AddEnum(
-    Message* message, const FieldDescriptor* field,
-    const EnumValueDescriptor* value) const {
+void Reflection::AddEnum(Message* message, const FieldDescriptor* field,
+                         const EnumValueDescriptor* value) const {
   // Usage checked by AddEnumValue.
   USAGE_CHECK_ENUM_VALUE(AddEnum);
   AddEnumValueInternal(message, field, value->number());
 }
 
-void GeneratedMessageReflection::AddEnumValue(
-    Message* message, const FieldDescriptor* field,
-    int value) const {
+void Reflection::AddEnumValue(Message* message, const FieldDescriptor* field,
+                              int value) const {
   USAGE_CHECK_ALL(AddEnum, REPEATED, ENUM);
-  if (!CreateUnknownEnumValues(descriptor_->file())) {
+  if (!CreateUnknownEnumValues(field)) {
     // Check that the value is valid if we don't support direct storage of
     // unknown enum values.
     const EnumValueDescriptor* value_desc =
         field->enum_type()->FindValueByNumber(value);
-    if (value_desc == NULL) {
-      GOOGLE_LOG(DFATAL) << "AddEnumValue accepts only valid integer values: value "
-                  << value << " unexpected for field " << field->full_name();
-      // In production builds, DFATAL will not terminate the program, so we have
-      // to do something reasonable: just set the default value.
-      value = field->default_value_enum()->number();
+    if (value_desc == nullptr) {
+      MutableUnknownFields(message)->AddVarint(field->number(), value);
+      return;
     }
   }
   AddEnumValueInternal(message, field, value);
 }
 
-void GeneratedMessageReflection::AddEnumValueInternal(
-    Message* message, const FieldDescriptor* field,
-    int value) const {
+void Reflection::AddEnumValueInternal(Message* message,
+                                      const FieldDescriptor* field,
+                                      int value) const {
   if (field->is_extension()) {
     MutableExtensionSet(message)->AddEnum(field->number(), field->type(),
-                                          field->options().packed(),
-                                          value, field);
+                                          field->options().packed(), value,
+                                          field);
   } else {
     AddField<int>(message, field, value);
   }
@@ -1420,32 +1907,70 @@ void GeneratedMessageReflection::AddEnumValueInternal(
 
 // -------------------------------------------------------------------
 
-const Message& GeneratedMessageReflection::GetMessage(
-    const Message& message, const FieldDescriptor* field,
-    MessageFactory* factory) const {
+const Message* Reflection::GetDefaultMessageInstance(
+    const FieldDescriptor* field) const {
+  // If we are using the generated factory, we cache the prototype in the field
+  // descriptor for faster access.
+  // The default instances of generated messages are not cross-linked, which
+  // means they contain null pointers on their message fields and can't be used
+  // to get the default of submessages.
+  if (message_factory_ == MessageFactory::generated_factory()) {
+    auto& ptr = field->default_generated_instance_;
+    auto* res = ptr.load(std::memory_order_acquire);
+    if (res == nullptr) {
+      // First time asking for this field's default. Load it and cache it.
+      res = message_factory_->GetPrototype(field->message_type());
+      ptr.store(res, std::memory_order_release);
+    }
+    return res;
+  }
+
+  // For other factories, we try the default's object field.
+  // In particular, the DynamicMessageFactory will cross link the default
+  // instances to allow for this. But only do this for real fields.
+  // This is an optimization to avoid going to GetPrototype() below, as that
+  // requires a lock and a map lookup.
+  if (!field->is_extension() && !field->options().weak() &&
+      !IsLazyField(field) && !schema_.InRealOneof(field)) {
+    auto* res = DefaultRaw<const Message*>(field);
+    if (res != nullptr) {
+      return res;
+    }
+  }
+  // Otherwise, just go to the factory.
+  return message_factory_->GetPrototype(field->message_type());
+}
+
+const Message& Reflection::GetMessage(const Message& message,
+                                      const FieldDescriptor* field,
+                                      MessageFactory* factory) const {
   USAGE_CHECK_ALL(GetMessage, SINGULAR, MESSAGE);
+  CheckInvalidAccess(schema_, field);
 
-  if (factory == NULL) factory = message_factory_;
+  if (factory == nullptr) factory = message_factory_;
 
   if (field->is_extension()) {
-    return static_cast<const Message&>(
-        GetExtensionSet(message).GetMessage(
-          field->number(), field->message_type(), factory));
+    return static_cast<const Message&>(GetExtensionSet(message).GetMessage(
+        field->number(), field->message_type(), factory));
   } else {
+    if (schema_.InRealOneof(field) && !HasOneofField(message, field)) {
+      return *GetDefaultMessageInstance(field);
+    }
     const Message* result = GetRaw<const Message*>(message, field);
-    if (result == NULL) {
-      result = DefaultRaw<const Message*>(field);
+    if (result == nullptr) {
+      result = GetDefaultMessageInstance(field);
     }
     return *result;
   }
 }
 
-Message* GeneratedMessageReflection::MutableMessage(
-    Message* message, const FieldDescriptor* field,
-    MessageFactory* factory) const {
+Message* Reflection::MutableMessage(Message* message,
+                                    const FieldDescriptor* field,
+                                    MessageFactory* factory) const {
   USAGE_CHECK_ALL(MutableMessage, SINGULAR, MESSAGE);
+  CheckInvalidAccess(schema_, field);
 
-  if (factory == NULL) factory = message_factory_;
+  if (factory == nullptr) factory = message_factory_;
 
   if (field->is_extension()) {
     return static_cast<Message*>(
@@ -1455,38 +1980,39 @@ Message* GeneratedMessageReflection::MutableMessage(
 
     Message** result_holder = MutableRaw<Message*>(message, field);
 
-    if (field->containing_oneof()) {
+    if (schema_.InRealOneof(field)) {
       if (!HasOneofField(*message, field)) {
         ClearOneof(message, field->containing_oneof());
         result_holder = MutableField<Message*>(message, field);
-        const Message* default_message = DefaultRaw<const Message*>(field);
-        *result_holder = default_message->New(message->GetArena());
+        const Message* default_message = GetDefaultMessageInstance(field);
+        *result_holder = default_message->New(message->GetArenaForAllocation());
       }
     } else {
       SetBit(message, field);
     }
 
-    if (*result_holder == NULL) {
-      const Message* default_message = DefaultRaw<const Message*>(field);
-      *result_holder = default_message->New(message->GetArena());
+    if (*result_holder == nullptr) {
+      const Message* default_message = GetDefaultMessageInstance(field);
+      *result_holder = default_message->New(message->GetArenaForAllocation());
     }
     result = *result_holder;
     return result;
   }
 }
 
-void GeneratedMessageReflection::UnsafeArenaSetAllocatedMessage(
-    Message* message,
-    Message* sub_message,
+void Reflection::UnsafeArenaSetAllocatedMessage(
+    Message* message, Message* sub_message,
     const FieldDescriptor* field) const {
   USAGE_CHECK_ALL(SetAllocatedMessage, SINGULAR, MESSAGE);
+  CheckInvalidAccess(schema_, field);
+
 
   if (field->is_extension()) {
     MutableExtensionSet(message)->UnsafeArenaSetAllocatedMessage(
         field->number(), field->type(), field, sub_message);
   } else {
-    if (field->containing_oneof()) {
-      if (sub_message == NULL) {
+    if (schema_.InRealOneof(field)) {
+      if (sub_message == nullptr) {
         ClearOneof(message, field->containing_oneof());
         return;
       }
@@ -1496,33 +2022,36 @@ void GeneratedMessageReflection::UnsafeArenaSetAllocatedMessage(
       return;
     }
 
-    if (sub_message == NULL) {
+    if (sub_message == nullptr) {
       ClearBit(message, field);
     } else {
       SetBit(message, field);
     }
     Message** sub_message_holder = MutableRaw<Message*>(message, field);
-    if (GetArena(message) == NULL) {
+    if (message->GetArenaForAllocation() == nullptr) {
       delete *sub_message_holder;
     }
     *sub_message_holder = sub_message;
   }
 }
 
-void GeneratedMessageReflection::SetAllocatedMessage(
-    Message* message,
-    Message* sub_message,
-    const FieldDescriptor* field) const {
+void Reflection::SetAllocatedMessage(Message* message, Message* sub_message,
+                                     const FieldDescriptor* field) const {
+  GOOGLE_DCHECK(sub_message == nullptr || sub_message->GetOwningArena() == nullptr ||
+         sub_message->GetOwningArena() == message->GetArenaForAllocation());
+  CheckInvalidAccess(schema_, field);
+
   // If message and sub-message are in different memory ownership domains
   // (different arenas, or one is on heap and one is not), then we may need to
   // do a copy.
-  if (sub_message != NULL &&
-      sub_message->GetArena() != message->GetArena()) {
-    if (sub_message->GetArena() == NULL && message->GetArena() != NULL) {
+  if (sub_message != nullptr &&
+      sub_message->GetOwningArena() != message->GetArenaForAllocation()) {
+    if (sub_message->GetOwningArena() == nullptr &&
+        message->GetArenaForAllocation() != nullptr) {
       // Case 1: parent is on an arena and child is heap-allocated. We can add
       // the child to the arena's Own() list to free on arena destruction, then
       // set our pointer.
-      message->GetArena()->Own(sub_message);
+      message->GetArenaForAllocation()->Own(sub_message);
       UnsafeArenaSetAllocatedMessage(message, sub_message, field);
     } else {
       // Case 2: all other cases. We need to make a copy. MutableMessage() will
@@ -1537,42 +2066,46 @@ void GeneratedMessageReflection::SetAllocatedMessage(
   }
 }
 
-Message* GeneratedMessageReflection::UnsafeArenaReleaseMessage(
-    Message* message,
-    const FieldDescriptor* field,
-    MessageFactory* factory) const {
+Message* Reflection::UnsafeArenaReleaseMessage(Message* message,
+                                               const FieldDescriptor* field,
+                                               MessageFactory* factory) const {
   USAGE_CHECK_ALL(ReleaseMessage, SINGULAR, MESSAGE);
+  CheckInvalidAccess(schema_, field);
 
-  if (factory == NULL) factory = message_factory_;
+  if (factory == nullptr) factory = message_factory_;
 
   if (field->is_extension()) {
     return static_cast<Message*>(
         MutableExtensionSet(message)->UnsafeArenaReleaseMessage(field,
                                                                 factory));
   } else {
-    if (!(field->is_repeated() || field->containing_oneof())) {
+    if (!(field->is_repeated() || schema_.InRealOneof(field))) {
       ClearBit(message, field);
     }
-    if (field->containing_oneof()) {
+    if (schema_.InRealOneof(field)) {
       if (HasOneofField(*message, field)) {
         *MutableOneofCase(message, field->containing_oneof()) = 0;
       } else {
-        return NULL;
+        return nullptr;
       }
     }
     Message** result = MutableRaw<Message*>(message, field);
     Message* ret = *result;
-    *result = NULL;
+    *result = nullptr;
     return ret;
   }
 }
 
-Message* GeneratedMessageReflection::ReleaseMessage(
-    Message* message,
-    const FieldDescriptor* field,
-    MessageFactory* factory) const {
+Message* Reflection::ReleaseMessage(Message* message,
+                                    const FieldDescriptor* field,
+                                    MessageFactory* factory) const {
+  CheckInvalidAccess(schema_, field);
+
   Message* released = UnsafeArenaReleaseMessage(message, field, factory);
-  if (GetArena(message) != NULL && released != NULL) {
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  released = MaybeForceCopy(message->GetArenaForAllocation(), released);
+#endif  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (message->GetArenaForAllocation() != nullptr && released != nullptr) {
     Message* copy_from_arena = released->New();
     copy_from_arena->CopyFrom(*released);
     released = copy_from_arena;
@@ -1580,9 +2113,11 @@ Message* GeneratedMessageReflection::ReleaseMessage(
   return released;
 }
 
-const Message& GeneratedMessageReflection::GetRepeatedMessage(
-    const Message& message, const FieldDescriptor* field, int index) const {
+const Message& Reflection::GetRepeatedMessage(const Message& message,
+                                              const FieldDescriptor* field,
+                                              int index) const {
   USAGE_CHECK_ALL(GetRepeatedMessage, REPEATED, MESSAGE);
+  CheckInvalidAccess(schema_, field);
 
   if (field->is_extension()) {
     return static_cast<const Message&>(
@@ -1599,14 +2134,16 @@ const Message& GeneratedMessageReflection::GetRepeatedMessage(
   }
 }
 
-Message* GeneratedMessageReflection::MutableRepeatedMessage(
-    Message* message, const FieldDescriptor* field, int index) const {
+Message* Reflection::MutableRepeatedMessage(Message* message,
+                                            const FieldDescriptor* field,
+                                            int index) const {
   USAGE_CHECK_ALL(MutableRepeatedMessage, REPEATED, MESSAGE);
+  CheckInvalidAccess(schema_, field);
 
   if (field->is_extension()) {
     return static_cast<Message*>(
-        MutableExtensionSet(message)->MutableRepeatedMessage(
-          field->number(), index));
+        MutableExtensionSet(message)->MutableRepeatedMessage(field->number(),
+                                                             index));
   } else {
     if (IsMapFieldInApi(field)) {
       return MutableRaw<MapFieldBase>(message, field)
@@ -1614,27 +2151,27 @@ Message* GeneratedMessageReflection::MutableRepeatedMessage(
           ->Mutable<GenericTypeHandler<Message> >(index);
     } else {
       return MutableRaw<RepeatedPtrFieldBase>(message, field)
-        ->Mutable<GenericTypeHandler<Message> >(index);
+          ->Mutable<GenericTypeHandler<Message> >(index);
     }
   }
 }
 
-Message* GeneratedMessageReflection::AddMessage(
-    Message* message, const FieldDescriptor* field,
-    MessageFactory* factory) const {
+Message* Reflection::AddMessage(Message* message, const FieldDescriptor* field,
+                                MessageFactory* factory) const {
   USAGE_CHECK_ALL(AddMessage, REPEATED, MESSAGE);
+  CheckInvalidAccess(schema_, field);
 
-  if (factory == NULL) factory = message_factory_;
+  if (factory == nullptr) factory = message_factory_;
 
   if (field->is_extension()) {
     return static_cast<Message*>(
         MutableExtensionSet(message)->AddMessage(field, factory));
   } else {
-    Message* result = NULL;
+    Message* result = nullptr;
 
     // We can't use AddField<Message>() because RepeatedPtrFieldBase doesn't
     // know how to allocate one.
-    RepeatedPtrFieldBase* repeated = NULL;
+    RepeatedPtrFieldBase* repeated = nullptr;
     if (IsMapFieldInApi(field)) {
       repeated =
           MutableRaw<MapFieldBase>(message, field)->MutableRepeatedField();
@@ -1642,7 +2179,7 @@ Message* GeneratedMessageReflection::AddMessage(
       repeated = MutableRaw<RepeatedPtrFieldBase>(message, field);
     }
     result = repeated->AddFromCleared<GenericTypeHandler<Message> >();
-    if (result == NULL) {
+    if (result == nullptr) {
       // We must allocate a new object.
       const Message* prototype;
       if (repeated->size() == 0) {
@@ -1650,7 +2187,7 @@ Message* GeneratedMessageReflection::AddMessage(
       } else {
         prototype = &repeated->Get<GenericTypeHandler<Message> >(0);
       }
-      result = prototype->New(message->GetArena());
+      result = prototype->New(message->GetArenaForAllocation());
       // We can guarantee here that repeated and result are either both heap
       // allocated or arena owned. So it is safe to call the unsafe version
       // of AddAllocated.
@@ -1661,15 +2198,16 @@ Message* GeneratedMessageReflection::AddMessage(
   }
 }
 
-void GeneratedMessageReflection::AddAllocatedMessage(
-    Message* message, const FieldDescriptor* field,
-    Message* new_entry) const {
+void Reflection::AddAllocatedMessage(Message* message,
+                                     const FieldDescriptor* field,
+                                     Message* new_entry) const {
   USAGE_CHECK_ALL(AddAllocatedMessage, REPEATED, MESSAGE);
+  CheckInvalidAccess(schema_, field);
 
   if (field->is_extension()) {
     MutableExtensionSet(message)->AddAllocatedMessage(field, new_entry);
   } else {
-    RepeatedPtrFieldBase* repeated = NULL;
+    RepeatedPtrFieldBase* repeated = nullptr;
     if (IsMapFieldInApi(field)) {
       repeated =
           MutableRaw<MapFieldBase>(message, field)->MutableRepeatedField();
@@ -1680,17 +2218,42 @@ void GeneratedMessageReflection::AddAllocatedMessage(
   }
 }
 
-void* GeneratedMessageReflection::MutableRawRepeatedField(
-    Message* message, const FieldDescriptor* field,
-    FieldDescriptor::CppType cpptype,
-    int ctype, const Descriptor* desc) const {
+void Reflection::UnsafeArenaAddAllocatedMessage(Message* message,
+                                                const FieldDescriptor* field,
+                                                Message* new_entry) const {
+  USAGE_CHECK_ALL(UnsafeArenaAddAllocatedMessage, REPEATED, MESSAGE);
+  CheckInvalidAccess(schema_, field);
+
+  if (field->is_extension()) {
+    MutableExtensionSet(message)->UnsafeArenaAddAllocatedMessage(field,
+                                                                 new_entry);
+  } else {
+    RepeatedPtrFieldBase* repeated = nullptr;
+    if (IsMapFieldInApi(field)) {
+      repeated =
+          MutableRaw<MapFieldBase>(message, field)->MutableRepeatedField();
+    } else {
+      repeated = MutableRaw<RepeatedPtrFieldBase>(message, field);
+    }
+    repeated->UnsafeArenaAddAllocated<GenericTypeHandler<Message>>(new_entry);
+  }
+}
+
+void* Reflection::MutableRawRepeatedField(Message* message,
+                                          const FieldDescriptor* field,
+                                          FieldDescriptor::CppType cpptype,
+                                          int ctype,
+                                          const Descriptor* desc) const {
+  (void)ctype;  // Parameter is used by Google-internal code.
   USAGE_CHECK_REPEATED("MutableRawRepeatedField");
-  if (field->cpp_type() != cpptype)
-    ReportReflectionUsageTypeError(descriptor_,
-        field, "MutableRawRepeatedField", cpptype);
-  if (ctype >= 0)
-    GOOGLE_CHECK_EQ(field->options().ctype(), ctype) << "subtype mismatch";
-  if (desc != NULL)
+  CheckInvalidAccess(schema_, field);
+
+  if (field->cpp_type() != cpptype &&
+      (field->cpp_type() != FieldDescriptor::CPPTYPE_ENUM ||
+       cpptype != FieldDescriptor::CPPTYPE_INT32))
+    ReportReflectionUsageTypeError(descriptor_, field,
+                                   "MutableRawRepeatedField", cpptype);
+  if (desc != nullptr)
     GOOGLE_CHECK_EQ(field->message_type(), desc) << "wrong submessage type";
   if (field->is_extension()) {
     return MutableExtensionSet(message)->MutableRawRepeatedField(
@@ -1705,17 +2268,18 @@ void* GeneratedMessageReflection::MutableRawRepeatedField(
   }
 }
 
-const void* GeneratedMessageReflection::GetRawRepeatedField(
-    const Message& message, const FieldDescriptor* field,
-    FieldDescriptor::CppType cpptype,
-    int ctype, const Descriptor* desc) const {
+const void* Reflection::GetRawRepeatedField(const Message& message,
+                                            const FieldDescriptor* field,
+                                            FieldDescriptor::CppType cpptype,
+                                            int ctype,
+                                            const Descriptor* desc) const {
   USAGE_CHECK_REPEATED("GetRawRepeatedField");
   if (field->cpp_type() != cpptype)
-    ReportReflectionUsageTypeError(descriptor_,
-        field, "GetRawRepeatedField", cpptype);
+    ReportReflectionUsageTypeError(descriptor_, field, "GetRawRepeatedField",
+                                   cpptype);
   if (ctype >= 0)
     GOOGLE_CHECK_EQ(field->options().ctype(), ctype) << "subtype mismatch";
-  if (desc != NULL)
+  if (desc != nullptr)
     GOOGLE_CHECK_EQ(field->message_type(), desc) << "wrong submessage type";
   if (field->is_extension()) {
     // Should use extension_set::GetRawRepeatedField. However, the required
@@ -1723,8 +2287,8 @@ const void* GeneratedMessageReflection::GetRawRepeatedField(
     // Map is not supported in extensions, it is acceptable to use
     // extension_set::MutableRawRepeatedField which does not change the message.
     return MutableExtensionSet(const_cast<Message*>(&message))
-        ->MutableRawRepeatedField(
-        field->number(), field->type(), field->is_packed(), field);
+        ->MutableRawRepeatedField(field->number(), field->type(),
+                                  field->is_packed(), field);
   } else {
     // Trigger transform for MapField
     if (IsMapFieldInApi(field)) {
@@ -1734,120 +2298,91 @@ const void* GeneratedMessageReflection::GetRawRepeatedField(
   }
 }
 
-const FieldDescriptor* GeneratedMessageReflection::GetOneofFieldDescriptor(
-    const Message& message,
-    const OneofDescriptor* oneof_descriptor) const {
-  uint32 field_number = GetOneofCase(message, oneof_descriptor);
+const FieldDescriptor* Reflection::GetOneofFieldDescriptor(
+    const Message& message, const OneofDescriptor* oneof_descriptor) const {
+  if (oneof_descriptor->is_synthetic()) {
+    const FieldDescriptor* field = oneof_descriptor->field(0);
+    return HasField(message, field) ? field : nullptr;
+  }
+  uint32_t field_number = GetOneofCase(message, oneof_descriptor);
   if (field_number == 0) {
-    return NULL;
+    return nullptr;
   }
   return descriptor_->FindFieldByNumber(field_number);
 }
 
-bool GeneratedMessageReflection::ContainsMapKey(
-    const Message& message,
-    const FieldDescriptor* field,
-    const MapKey& key) const {
-  USAGE_CHECK(IsMapFieldInApi(field),
-              "LookupMapValue",
+bool Reflection::ContainsMapKey(const Message& message,
+                                const FieldDescriptor* field,
+                                const MapKey& key) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "LookupMapValue",
               "Field is not a map field.");
   return GetRaw<MapFieldBase>(message, field).ContainsMapKey(key);
 }
 
-bool GeneratedMessageReflection::InsertOrLookupMapValue(
-    Message* message,
-    const FieldDescriptor* field,
-    const MapKey& key,
-    MapValueRef* val) const {
-  USAGE_CHECK(IsMapFieldInApi(field),
-              "InsertOrLookupMapValue",
+bool Reflection::InsertOrLookupMapValue(Message* message,
+                                        const FieldDescriptor* field,
+                                        const MapKey& key,
+                                        MapValueRef* val) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "InsertOrLookupMapValue",
               "Field is not a map field.");
   val->SetType(field->message_type()->FindFieldByName("value")->cpp_type());
-  return MutableRaw<MapFieldBase>(message, field)->InsertOrLookupMapValue(
-      key, val);
+  return MutableRaw<MapFieldBase>(message, field)
+      ->InsertOrLookupMapValue(key, val);
 }
 
-bool GeneratedMessageReflection::DeleteMapValue(
-    Message* message,
-    const FieldDescriptor* field,
-    const MapKey& key) const {
-  USAGE_CHECK(IsMapFieldInApi(field),
-              "DeleteMapValue",
+bool Reflection::LookupMapValue(const Message& message,
+                                const FieldDescriptor* field, const MapKey& key,
+                                MapValueConstRef* val) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "LookupMapValue",
               "Field is not a map field.");
-  return MutableRaw<MapFieldBase>(message, field)->DeleteMapValue(key);
+  val->SetType(field->message_type()->FindFieldByName("value")->cpp_type());
+  return GetRaw<MapFieldBase>(message, field).LookupMapValue(key, val);
 }
 
-MapIterator GeneratedMessageReflection::MapBegin(
-    Message* message,
-    const FieldDescriptor* field) const {
-  USAGE_CHECK(IsMapFieldInApi(field),
-              "MapBegin",
+bool Reflection::DeleteMapValue(Message* message, const FieldDescriptor* field,
+                                const MapKey& key) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "DeleteMapValue",
               "Field is not a map field.");
+  return MutableRaw<MapFieldBase>(message, field)->DeleteMapValue(key);
+}
+
+MapIterator Reflection::MapBegin(Message* message,
+                                 const FieldDescriptor* field) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "MapBegin", "Field is not a map field.");
   MapIterator iter(message, field);
   GetRaw<MapFieldBase>(*message, field).MapBegin(&iter);
   return iter;
 }
 
-MapIterator GeneratedMessageReflection::MapEnd(
-    Message* message,
-    const FieldDescriptor* field) const {
-  USAGE_CHECK(IsMapFieldInApi(field),
-              "MapEnd",
-              "Field is not a map field.");
+MapIterator Reflection::MapEnd(Message* message,
+                               const FieldDescriptor* field) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "MapEnd", "Field is not a map field.");
   MapIterator iter(message, field);
   GetRaw<MapFieldBase>(*message, field).MapEnd(&iter);
   return iter;
 }
 
-int GeneratedMessageReflection::MapSize(
-    const Message& message,
-    const FieldDescriptor* field) const {
-  USAGE_CHECK(IsMapFieldInApi(field),
-              "MapSize",
-              "Field is not a map field.");
+int Reflection::MapSize(const Message& message,
+                        const FieldDescriptor* field) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "MapSize", "Field is not a map field.");
   return GetRaw<MapFieldBase>(message, field).size();
 }
 
 // -----------------------------------------------------------------------------
 
-const FieldDescriptor* GeneratedMessageReflection::FindKnownExtensionByName(
-    const string& name) const {
-  if (!schema_.HasExtensionSet()) return NULL;
-
-  const FieldDescriptor* result = descriptor_pool_->FindExtensionByName(name);
-  if (result != NULL && result->containing_type() == descriptor_) {
-    return result;
-  }
-
-  if (descriptor_->options().message_set_wire_format()) {
-    // MessageSet extensions may be identified by type name.
-    const Descriptor* type = descriptor_pool_->FindMessageTypeByName(name);
-    if (type != NULL) {
-      // Look for a matching extension in the foreign type's scope.
-      const int type_extension_count = type->extension_count();
-      for (int i = 0; i < type_extension_count; i++) {
-        const FieldDescriptor* extension = type->extension(i);
-        if (extension->containing_type() == descriptor_ &&
-            extension->type() == FieldDescriptor::TYPE_MESSAGE &&
-            extension->is_optional() &&
-            extension->message_type() == type) {
-          // Found it.
-          return extension;
-        }
-      }
-    }
-  }
-
-  return NULL;
+const FieldDescriptor* Reflection::FindKnownExtensionByName(
+    const std::string& name) const {
+  if (!schema_.HasExtensionSet()) return nullptr;
+  return descriptor_pool_->FindExtensionByPrintableName(descriptor_, name);
 }
 
-const FieldDescriptor* GeneratedMessageReflection::FindKnownExtensionByNumber(
+const FieldDescriptor* Reflection::FindKnownExtensionByNumber(
     int number) const {
-  if (!schema_.HasExtensionSet()) return NULL;
+  if (!schema_.HasExtensionSet()) return nullptr;
   return descriptor_pool_->FindExtensionByNumber(descriptor_, number);
 }
 
-bool GeneratedMessageReflection::SupportsUnknownEnumValues() const {
+bool Reflection::SupportsUnknownEnumValues() const {
   return CreateUnknownEnumValues(descriptor_->file());
 }
 
@@ -1858,115 +2393,106 @@ bool GeneratedMessageReflection::SupportsUnknownEnumValues() const {
 // the given field.
 
 template <class Type>
-const Type& GeneratedMessageReflection::GetRawNonOneof(
-    const Message& message, const FieldDescriptor* field) const {
+const Type& Reflection::GetRawNonOneof(const Message& message,
+                                       const FieldDescriptor* field) const {
   return GetConstRefAtOffset<Type>(message,
                                    schema_.GetFieldOffsetNonOneof(field));
 }
 
 template <class Type>
-Type* GeneratedMessageReflection::MutableRawNonOneof(
-    Message* message, const FieldDescriptor* field) const {
+Type* Reflection::MutableRawNonOneof(Message* message,
+                                     const FieldDescriptor* field) const {
   return GetPointerAtOffset<Type>(message,
                                   schema_.GetFieldOffsetNonOneof(field));
 }
 
 template <typename Type>
-const Type& GeneratedMessageReflection::GetRaw(
-    const Message& message, const FieldDescriptor* field) const {
-  if (field->containing_oneof() && !HasOneofField(message, field)) {
-    return DefaultRaw<Type>(field);
-  }
-  return GetConstRefAtOffset<Type>(message, schema_.GetFieldOffset(field));
-}
-
-template <typename Type>
-Type* GeneratedMessageReflection::MutableRaw(Message* message,
-                                   const FieldDescriptor* field) const {
+Type* Reflection::MutableRaw(Message* message,
+                             const FieldDescriptor* field) const {
   return GetPointerAtOffset<Type>(message, schema_.GetFieldOffset(field));
 }
 
-
-inline const uint32* GeneratedMessageReflection::GetHasBits(
-    const Message& message) const {
+const uint32_t* Reflection::GetHasBits(const Message& message) const {
   GOOGLE_DCHECK(schema_.HasHasbits());
-  return &GetConstRefAtOffset<uint32>(message, schema_.HasBitsOffset());
+  return &GetConstRefAtOffset<uint32_t>(message, schema_.HasBitsOffset());
 }
 
-inline uint32* GeneratedMessageReflection::MutableHasBits(
-    Message* message) const {
+uint32_t* Reflection::MutableHasBits(Message* message) const {
   GOOGLE_DCHECK(schema_.HasHasbits());
-  return GetPointerAtOffset<uint32>(message, schema_.HasBitsOffset());
-}
-
-inline uint32 GeneratedMessageReflection::GetOneofCase(
-    const Message& message, const OneofDescriptor* oneof_descriptor) const {
-  return GetConstRefAtOffset<uint32>(
-      message, schema_.GetOneofCaseOffset(oneof_descriptor));
+  return GetPointerAtOffset<uint32_t>(message, schema_.HasBitsOffset());
 }
 
-inline uint32* GeneratedMessageReflection::MutableOneofCase(
+uint32_t* Reflection::MutableOneofCase(
     Message* message, const OneofDescriptor* oneof_descriptor) const {
-  return GetPointerAtOffset<uint32>(
+  GOOGLE_DCHECK(!oneof_descriptor->is_synthetic());
+  return GetPointerAtOffset<uint32_t>(
       message, schema_.GetOneofCaseOffset(oneof_descriptor));
 }
 
-inline const ExtensionSet& GeneratedMessageReflection::GetExtensionSet(
-    const Message& message) const {
+const ExtensionSet& Reflection::GetExtensionSet(const Message& message) const {
   return GetConstRefAtOffset<ExtensionSet>(message,
                                            schema_.GetExtensionSetOffset());
 }
 
-inline ExtensionSet* GeneratedMessageReflection::MutableExtensionSet(
-    Message* message) const {
+ExtensionSet* Reflection::MutableExtensionSet(Message* message) const {
   return GetPointerAtOffset<ExtensionSet>(message,
                                           schema_.GetExtensionSetOffset());
 }
 
-inline Arena* GeneratedMessageReflection::GetArena(Message* message) const {
-  return GetInternalMetadataWithArena(*message).arena();
+const InternalMetadata& Reflection::GetInternalMetadata(
+    const Message& message) const {
+  return GetConstRefAtOffset<InternalMetadata>(message,
+                                               schema_.GetMetadataOffset());
+}
+
+InternalMetadata* Reflection::MutableInternalMetadata(Message* message) const {
+  return GetPointerAtOffset<InternalMetadata>(message,
+                                              schema_.GetMetadataOffset());
 }
 
-inline const InternalMetadataWithArena&
-GeneratedMessageReflection::GetInternalMetadataWithArena(
+const uint32_t* Reflection::GetInlinedStringDonatedArray(
     const Message& message) const {
-  return GetConstRefAtOffset<InternalMetadataWithArena>(
-      message, schema_.GetMetadataOffset());
+  GOOGLE_DCHECK(schema_.HasInlinedString());
+  return &GetConstRefAtOffset<uint32_t>(message,
+                                        schema_.InlinedStringDonatedOffset());
 }
 
-inline InternalMetadataWithArena*
-GeneratedMessageReflection::MutableInternalMetadataWithArena(
-    Message* message) const {
-  return GetPointerAtOffset<InternalMetadataWithArena>(
-      message, schema_.GetMetadataOffset());
+uint32_t* Reflection::MutableInlinedStringDonatedArray(Message* message) const {
+  GOOGLE_DCHECK(schema_.HasHasbits());
+  return GetPointerAtOffset<uint32_t>(message,
+                                      schema_.InlinedStringDonatedOffset());
 }
 
-template <typename Type>
-inline const Type& GeneratedMessageReflection::DefaultRaw(
-    const FieldDescriptor* field) const {
-  return *reinterpret_cast<const Type*>(schema_.GetFieldDefault(field));
+// Simple accessors for manipulating _inlined_string_donated_;
+bool Reflection::IsInlinedStringDonated(const Message& message,
+                                        const FieldDescriptor* field) const {
+  return IsIndexInHasBitSet(GetInlinedStringDonatedArray(message),
+                            schema_.InlinedStringIndex(field));
 }
 
 // Simple accessors for manipulating has_bits_.
-inline bool GeneratedMessageReflection::HasBit(
-    const Message& message, const FieldDescriptor* field) const {
+bool Reflection::HasBit(const Message& message,
+                        const FieldDescriptor* field) const {
   GOOGLE_DCHECK(!field->options().weak());
-  if (schema_.HasHasbits()) {
+  if (schema_.HasBitIndex(field) != static_cast<uint32_t>(-1)) {
     return IsIndexInHasBitSet(GetHasBits(message), schema_.HasBitIndex(field));
   }
 
+  // Intentionally check here because HasBitIndex(field) != -1 means valid.
+  CheckInvalidAccess(schema_, field);
+
   // proto3: no has-bits. All fields present except messages, which are
-  // present only if their message-field pointer is non-NULL.
+  // present only if their message-field pointer is non-null.
   if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
     return !schema_.IsDefaultInstance(message) &&
-        GetRaw<const Message*>(message, field) != NULL;
+           GetRaw<const Message*>(message, field) != nullptr;
   } else {
     // Non-message field (and non-oneof, since that was handled in HasField()
     // before calling us), and singular (again, checked in HasField). So, this
     // field must be a scalar.
 
     // Scalar primitive (numeric or string/bytes) fields are present if
-    // their value is non-zero (numeric) or non-empty (string/bytes).  N.B.:
+    // their value is non-zero (numeric) or non-empty (string/bytes). N.B.:
     // we must use this definition here, rather than the "scalar fields
     // always present" in the proto3 docs, because MergeFrom() semantics
     // require presence as "present on wire", and reflection-based merge
@@ -1975,6 +2501,12 @@ inline bool GeneratedMessageReflection::HasBit(
       case FieldDescriptor::CPPTYPE_STRING:
         switch (field->options().ctype()) {
           default: {
+            if (IsInlined(field)) {
+              return !GetField<InlinedStringField>(message, field)
+                          .GetNoArena()
+                          .empty();
+            }
+
             return GetField<ArenaStringPtr>(message, field).Get().size() > 0;
           }
         }
@@ -1982,17 +2514,21 @@ inline bool GeneratedMessageReflection::HasBit(
       case FieldDescriptor::CPPTYPE_BOOL:
         return GetRaw<bool>(message, field) != false;
       case FieldDescriptor::CPPTYPE_INT32:
-        return GetRaw<int32>(message, field) != 0;
+        return GetRaw<int32_t>(message, field) != 0;
       case FieldDescriptor::CPPTYPE_INT64:
-        return GetRaw<int64>(message, field) != 0;
+        return GetRaw<int64_t>(message, field) != 0;
       case FieldDescriptor::CPPTYPE_UINT32:
-        return GetRaw<uint32>(message, field) != 0;
+        return GetRaw<uint32_t>(message, field) != 0;
       case FieldDescriptor::CPPTYPE_UINT64:
-        return GetRaw<uint64>(message, field) != 0;
+        return GetRaw<uint64_t>(message, field) != 0;
       case FieldDescriptor::CPPTYPE_FLOAT:
-        return GetRaw<float>(message, field) != 0.0;
+        static_assert(sizeof(uint32_t) == sizeof(float),
+                      "Code assumes uint32_t and float are the same size.");
+        return GetRaw<uint32_t>(message, field) != 0;
       case FieldDescriptor::CPPTYPE_DOUBLE:
-        return GetRaw<double>(message, field) != 0.0;
+        static_assert(sizeof(uint64_t) == sizeof(double),
+                      "Code assumes uint64_t and double are the same size.");
+        return GetRaw<uint64_t>(message, field) != 0;
       case FieldDescriptor::CPPTYPE_ENUM:
         return GetRaw<int>(message, field) != 0;
       case FieldDescriptor::CPPTYPE_MESSAGE:
@@ -2004,30 +2540,25 @@ inline bool GeneratedMessageReflection::HasBit(
   }
 }
 
-inline void GeneratedMessageReflection::SetBit(
-    Message* message, const FieldDescriptor* field) const {
+void Reflection::SetBit(Message* message, const FieldDescriptor* field) const {
   GOOGLE_DCHECK(!field->options().weak());
-  if (!schema_.HasHasbits()) {
-    return;
-  }
-  const uint32 index = schema_.HasBitIndex(field);
+  const uint32_t index = schema_.HasBitIndex(field);
+  if (index == static_cast<uint32_t>(-1)) return;
   MutableHasBits(message)[index / 32] |=
-      (static_cast<uint32>(1) << (index % 32));
+      (static_cast<uint32_t>(1) << (index % 32));
 }
 
-inline void GeneratedMessageReflection::ClearBit(
-    Message* message, const FieldDescriptor* field) const {
+void Reflection::ClearBit(Message* message,
+                          const FieldDescriptor* field) const {
   GOOGLE_DCHECK(!field->options().weak());
-  if (!schema_.HasHasbits()) {
-    return;
-  }
-  const uint32 index = schema_.HasBitIndex(field);
+  const uint32_t index = schema_.HasBitIndex(field);
+  if (index == static_cast<uint32_t>(-1)) return;
   MutableHasBits(message)[index / 32] &=
-      ~(static_cast<uint32>(1) << (index % 32));
+      ~(static_cast<uint32_t>(1) << (index % 32));
 }
 
-inline void GeneratedMessageReflection::SwapBit(
-    Message* message1, Message* message2, const FieldDescriptor* field) const {
+void Reflection::SwapBit(Message* message1, Message* message2,
+                         const FieldDescriptor* field) const {
   GOOGLE_DCHECK(!field->options().weak());
   if (!schema_.HasHasbits()) {
     return;
@@ -2045,46 +2576,50 @@ inline void GeneratedMessageReflection::SwapBit(
   }
 }
 
-inline bool GeneratedMessageReflection::HasOneof(
-    const Message& message, const OneofDescriptor* oneof_descriptor) const {
+bool Reflection::HasOneof(const Message& message,
+                          const OneofDescriptor* oneof_descriptor) const {
+  if (oneof_descriptor->is_synthetic()) {
+    return HasField(message, oneof_descriptor->field(0));
+  }
   return (GetOneofCase(message, oneof_descriptor) > 0);
 }
 
-inline bool GeneratedMessageReflection::HasOneofField(
-    const Message& message, const FieldDescriptor* field) const {
-  return (GetOneofCase(message, field->containing_oneof()) == field->number());
-}
-
-inline void GeneratedMessageReflection::SetOneofCase(
-    Message* message, const FieldDescriptor* field) const {
+void Reflection::SetOneofCase(Message* message,
+                              const FieldDescriptor* field) const {
   *MutableOneofCase(message, field->containing_oneof()) = field->number();
 }
 
-inline void GeneratedMessageReflection::ClearOneofField(
-    Message* message, const FieldDescriptor* field) const {
+void Reflection::ClearOneofField(Message* message,
+                                 const FieldDescriptor* field) const {
   if (HasOneofField(*message, field)) {
     ClearOneof(message, field->containing_oneof());
   }
 }
 
-inline void GeneratedMessageReflection::ClearOneof(
-    Message* message, const OneofDescriptor* oneof_descriptor) const {
+void Reflection::ClearOneof(Message* message,
+                            const OneofDescriptor* oneof_descriptor) const {
+  if (oneof_descriptor->is_synthetic()) {
+    ClearField(message, oneof_descriptor->field(0));
+    return;
+  }
   // TODO(jieluo): Consider to cache the unused object instead of deleting
   // it. It will be much faster if an application switches a lot from
   // a few oneof fields.  Time/space tradeoff
-  uint32 oneof_case = GetOneofCase(*message, oneof_descriptor);
+  uint32_t oneof_case = GetOneofCase(*message, oneof_descriptor);
   if (oneof_case > 0) {
     const FieldDescriptor* field = descriptor_->FindFieldByNumber(oneof_case);
-    if (GetArena(message) == NULL) {
+    if (message->GetArenaForAllocation() == nullptr) {
       switch (field->cpp_type()) {
         case FieldDescriptor::CPPTYPE_STRING: {
           switch (field->options().ctype()) {
             default:  // TODO(kenton):  Support other string reps.
             case FieldOptions::STRING: {
-              const string* default_ptr =
-                  &DefaultRaw<ArenaStringPtr>(field).Get();
-              MutableField<ArenaStringPtr>(message, field)->
-                  Destroy(default_ptr, GetArena(message));
+              // Oneof string fields are never set as a default instance.
+              // We just need to pass some arbitrary default string to make it
+              // work. This allows us to not have the real default accessible
+              // from reflection.
+              MutableField<ArenaStringPtr>(message, field)
+                  ->Destroy(nullptr, message->GetArenaForAllocation());
               break;
             }
           }
@@ -2103,91 +2638,129 @@ inline void GeneratedMessageReflection::ClearOneof(
   }
 }
 
+#define HANDLE_TYPE(TYPE, CPPTYPE, CTYPE)                                  \
+  template <>                                                              \
+  const RepeatedField<TYPE>& Reflection::GetRepeatedFieldInternal<TYPE>(   \
+      const Message& message, const FieldDescriptor* field) const {        \
+    return *static_cast<RepeatedField<TYPE>*>(MutableRawRepeatedField(     \
+        const_cast<Message*>(&message), field, CPPTYPE, CTYPE, nullptr));  \
+  }                                                                        \
+                                                                           \
+  template <>                                                              \
+  RepeatedField<TYPE>* Reflection::MutableRepeatedFieldInternal<TYPE>(     \
+      Message * message, const FieldDescriptor* field) const {             \
+    return static_cast<RepeatedField<TYPE>*>(                              \
+        MutableRawRepeatedField(message, field, CPPTYPE, CTYPE, nullptr)); \
+  }
+
+HANDLE_TYPE(int32_t, FieldDescriptor::CPPTYPE_INT32, -1);
+HANDLE_TYPE(int64_t, FieldDescriptor::CPPTYPE_INT64, -1);
+HANDLE_TYPE(uint32_t, FieldDescriptor::CPPTYPE_UINT32, -1);
+HANDLE_TYPE(uint64_t, FieldDescriptor::CPPTYPE_UINT64, -1);
+HANDLE_TYPE(float, FieldDescriptor::CPPTYPE_FLOAT, -1);
+HANDLE_TYPE(double, FieldDescriptor::CPPTYPE_DOUBLE, -1);
+HANDLE_TYPE(bool, FieldDescriptor::CPPTYPE_BOOL, -1);
+
+
+#undef HANDLE_TYPE
+
+void* Reflection::MutableRawRepeatedString(Message* message,
+                                           const FieldDescriptor* field,
+                                           bool is_string) const {
+  (void)is_string;  // Parameter is used by Google-internal code.
+  return MutableRawRepeatedField(message, field,
+                                 FieldDescriptor::CPPTYPE_STRING,
+                                 FieldOptions::STRING, nullptr);
+}
+
 // Template implementations of basic accessors.  Inline because each
 // template instance is only called from one location.  These are
 // used for all types except messages.
 template <typename Type>
-inline const Type& GeneratedMessageReflection::GetField(
-    const Message& message, const FieldDescriptor* field) const {
+const Type& Reflection::GetField(const Message& message,
+                                 const FieldDescriptor* field) const {
   return GetRaw<Type>(message, field);
 }
 
 template <typename Type>
-inline void GeneratedMessageReflection::SetField(
-    Message* message, const FieldDescriptor* field, const Type& value) const {
-  if (field->containing_oneof() && !HasOneofField(*message, field)) {
+void Reflection::SetField(Message* message, const FieldDescriptor* field,
+                          const Type& value) const {
+  bool real_oneof = schema_.InRealOneof(field);
+  if (real_oneof && !HasOneofField(*message, field)) {
     ClearOneof(message, field->containing_oneof());
   }
   *MutableRaw<Type>(message, field) = value;
-  field->containing_oneof() ?
-      SetOneofCase(message, field) : SetBit(message, field);
+  real_oneof ? SetOneofCase(message, field) : SetBit(message, field);
 }
 
 template <typename Type>
-inline Type* GeneratedMessageReflection::MutableField(
-    Message* message, const FieldDescriptor* field) const {
-  field->containing_oneof() ?
-      SetOneofCase(message, field) : SetBit(message, field);
+Type* Reflection::MutableField(Message* message,
+                               const FieldDescriptor* field) const {
+  schema_.InRealOneof(field) ? SetOneofCase(message, field)
+                             : SetBit(message, field);
   return MutableRaw<Type>(message, field);
 }
 
 template <typename Type>
-inline const Type& GeneratedMessageReflection::GetRepeatedField(
-    const Message& message, const FieldDescriptor* field, int index) const {
+const Type& Reflection::GetRepeatedField(const Message& message,
+                                         const FieldDescriptor* field,
+                                         int index) const {
   return GetRaw<RepeatedField<Type> >(message, field).Get(index);
 }
 
 template <typename Type>
-inline const Type& GeneratedMessageReflection::GetRepeatedPtrField(
-    const Message& message, const FieldDescriptor* field, int index) const {
+const Type& Reflection::GetRepeatedPtrField(const Message& message,
+                                            const FieldDescriptor* field,
+                                            int index) const {
   return GetRaw<RepeatedPtrField<Type> >(message, field).Get(index);
 }
 
 template <typename Type>
-inline void GeneratedMessageReflection::SetRepeatedField(
-    Message* message, const FieldDescriptor* field,
-    int index, Type value) const {
+void Reflection::SetRepeatedField(Message* message,
+                                  const FieldDescriptor* field, int index,
+                                  Type value) const {
   MutableRaw<RepeatedField<Type> >(message, field)->Set(index, value);
 }
 
 template <typename Type>
-inline Type* GeneratedMessageReflection::MutableRepeatedField(
-    Message* message, const FieldDescriptor* field, int index) const {
+Type* Reflection::MutableRepeatedField(Message* message,
+                                       const FieldDescriptor* field,
+                                       int index) const {
   RepeatedPtrField<Type>* repeated =
-    MutableRaw<RepeatedPtrField<Type> >(message, field);
+      MutableRaw<RepeatedPtrField<Type> >(message, field);
   return repeated->Mutable(index);
 }
 
 template <typename Type>
-inline void GeneratedMessageReflection::AddField(
-    Message* message, const FieldDescriptor* field, const Type& value) const {
+void Reflection::AddField(Message* message, const FieldDescriptor* field,
+                          const Type& value) const {
   MutableRaw<RepeatedField<Type> >(message, field)->Add(value);
 }
 
 template <typename Type>
-inline Type* GeneratedMessageReflection::AddField(
-    Message* message, const FieldDescriptor* field) const {
+Type* Reflection::AddField(Message* message,
+                           const FieldDescriptor* field) const {
   RepeatedPtrField<Type>* repeated =
-    MutableRaw<RepeatedPtrField<Type> >(message, field);
+      MutableRaw<RepeatedPtrField<Type> >(message, field);
   return repeated->Add();
 }
 
-MessageFactory* GeneratedMessageReflection::GetMessageFactory() const {
+MessageFactory* Reflection::GetMessageFactory() const {
   return message_factory_;
 }
 
-void* GeneratedMessageReflection::RepeatedFieldData(
-    Message* message, const FieldDescriptor* field,
-    FieldDescriptor::CppType cpp_type,
-    const Descriptor* message_type) const {
+void* Reflection::RepeatedFieldData(Message* message,
+                                    const FieldDescriptor* field,
+                                    FieldDescriptor::CppType cpp_type,
+                                    const Descriptor* message_type) const {
   GOOGLE_CHECK(field->is_repeated());
   GOOGLE_CHECK(field->cpp_type() == cpp_type ||
         (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM &&
          cpp_type == FieldDescriptor::CPPTYPE_INT32))
       << "The type parameter T in RepeatedFieldRef<T> API doesn't match "
       << "the actual field type (for enums T should be the generated enum "
-      << "type or int32).";
-  if (message_type != NULL) {
+      << "type or int32_t).";
+  if (message_type != nullptr) {
     GOOGLE_CHECK_EQ(message_type, field->message_type());
   }
   if (field->is_extension()) {
@@ -2198,25 +2771,31 @@ void* GeneratedMessageReflection::RepeatedFieldData(
   }
 }
 
-MapFieldBase* GeneratedMessageReflection::MapData(
-    Message* message, const FieldDescriptor* field) const {
-  USAGE_CHECK(IsMapFieldInApi(field),
-              "GetMapData",
+MapFieldBase* Reflection::MutableMapData(Message* message,
+                                         const FieldDescriptor* field) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "GetMapData",
               "Field is not a map field.");
   return MutableRaw<MapFieldBase>(message, field);
 }
 
+const MapFieldBase* Reflection::GetMapData(const Message& message,
+                                           const FieldDescriptor* field) const {
+  USAGE_CHECK(IsMapFieldInApi(field), "GetMapData",
+              "Field is not a map field.");
+  return &(GetRaw<MapFieldBase>(message, field));
+}
+
 namespace {
 
 // Helper function to transform migration schema into reflection schema.
 ReflectionSchema MigrationToReflectionSchema(
-    const Message* const* default_instance, const uint32* offsets,
+    const Message* const* default_instance, const uint32_t* offsets,
     MigrationSchema migration_schema) {
   ReflectionSchema result;
   result.default_instance_ = *default_instance;
-  // First 6 offsets are offsets to the special fields. The following offsets
+  // First 7 offsets are offsets to the special fields. The following offsets
   // are the proto fields.
-  result.offsets_ = offsets + migration_schema.offsets_index + 5;
+  result.offsets_ = offsets + migration_schema.offsets_index + 6;
   result.has_bit_indices_ = offsets + migration_schema.has_bit_indices_index;
   result.has_bits_offset_ = offsets[migration_schema.offsets_index + 0];
   result.metadata_offset_ = offsets[migration_schema.offsets_index + 1];
@@ -2224,18 +2803,23 @@ ReflectionSchema MigrationToReflectionSchema(
   result.oneof_case_offset_ = offsets[migration_schema.offsets_index + 3];
   result.object_size_ = migration_schema.object_size;
   result.weak_field_map_offset_ = offsets[migration_schema.offsets_index + 4];
+  result.inlined_string_donated_offset_ =
+      offsets[migration_schema.offsets_index + 5];
+  result.inlined_string_indices_ =
+      offsets + migration_schema.inlined_string_indices_index;
   return result;
 }
 
-template<typename Schema>
+}  // namespace
+
 class AssignDescriptorsHelper {
  public:
   AssignDescriptorsHelper(MessageFactory* factory,
                           Metadata* file_level_metadata,
                           const EnumDescriptor** file_level_enum_descriptors,
-                          const Schema* schemas,
+                          const MigrationSchema* schemas,
                           const Message* const* default_instance_data,
-                          const uint32* offsets)
+                          const uint32_t* offsets)
       : factory_(factory),
         file_level_metadata_(file_level_metadata),
         file_level_enum_descriptors_(file_level_enum_descriptors),
@@ -2250,11 +2834,11 @@ class AssignDescriptorsHelper {
 
     file_level_metadata_->descriptor = descriptor;
 
-    file_level_metadata_->reflection = new GeneratedMessageReflection(
-        descriptor,
-        MigrationToReflectionSchema(default_instance_data_, offsets_,
-                                    *schemas_),
-        ::google::protobuf::DescriptorPool::generated_pool(), factory_);
+    file_level_metadata_->reflection =
+        new Reflection(descriptor,
+                       MigrationToReflectionSchema(default_instance_data_,
+                                                   offsets_, *schemas_),
+                       DescriptorPool::internal_generated_pool(), factory_);
     for (int i = 0; i < descriptor->enum_type_count(); i++) {
       AssignEnumDescriptor(descriptor->enum_type(i));
     }
@@ -2274,65 +2858,85 @@ class AssignDescriptorsHelper {
   MessageFactory* factory_;
   Metadata* file_level_metadata_;
   const EnumDescriptor** file_level_enum_descriptors_;
-  const Schema* schemas_;
-  const Message* const * default_instance_data_;
-  const uint32* offsets_;
+  const MigrationSchema* schemas_;
+  const Message* const* default_instance_data_;
+  const uint32_t* offsets_;
 };
 
+namespace {
+
 // We have the routines that assign descriptors and build reflection
 // automatically delete the allocated reflection. MetadataOwner owns
 // all the allocated reflection instances.
 struct MetadataOwner {
+  ~MetadataOwner() {
+    for (auto range : metadata_arrays_) {
+      for (const Metadata* m = range.first; m < range.second; m++) {
+        delete m->reflection;
+      }
+    }
+  }
+
   void AddArray(const Metadata* begin, const Metadata* end) {
-    MutexLock lock(&mu_);
+    mu_.Lock();
     metadata_arrays_.push_back(std::make_pair(begin, end));
+    mu_.Unlock();
   }
 
   static MetadataOwner* Instance() {
-    static MetadataOwner* res = new MetadataOwner;
+    static MetadataOwner* res = OnShutdownDelete(new MetadataOwner);
     return res;
   }
 
  private:
-  // Use the constructor to register the shutdown code. Because c++ makes sure
-  // this called only once.
-  MetadataOwner() { OnShutdown(&DeleteMetadata); }
-  ~MetadataOwner() {
-    for (int i = 0; i < metadata_arrays_.size(); i++) {
-      for (const Metadata* m = metadata_arrays_[i].first;
-           m < metadata_arrays_[i].second; m++) {
-        delete m->reflection;
-      }
-    }
-  }
+  MetadataOwner() = default;  // private because singleton
 
-  static void DeleteMetadata() {
-    delete Instance();
-  }
-
-  Mutex mu_;
+  WrappedMutex mu_;
   std::vector<std::pair<const Metadata*, const Metadata*> > metadata_arrays_;
 };
 
-}  // namespace
+void AddDescriptors(const DescriptorTable* table);
+
+void AssignDescriptorsImpl(const DescriptorTable* table, bool eager) {
+  // Ensure the file descriptor is added to the pool.
+  {
+    // This only happens once per proto file. So a global mutex to serialize
+    // calls to AddDescriptors.
+    static WrappedMutex mu{GOOGLE_PROTOBUF_LINKER_INITIALIZED};
+    mu.Lock();
+    AddDescriptors(table);
+    mu.Unlock();
+  }
+  if (eager) {
+    // Normally we do not want to eagerly build descriptors of our deps.
+    // However if this proto is optimized for code size (ie using reflection)
+    // and it has a message extending a custom option of a descriptor with that
+    // message being optimized for code size as well. Building the descriptors
+    // in this file requires parsing the serialized file descriptor, which now
+    // requires parsing the message extension, which potentially requires
+    // building the descriptor of the message extending one of the options.
+    // However we are already updating descriptor pool under a lock. To prevent
+    // this the compiler statically looks for this case and we just make sure we
+    // first build the descriptors of all our dependencies, preventing the
+    // deadlock.
+    int num_deps = table->num_deps;
+    for (int i = 0; i < num_deps; i++) {
+      // In case of weak fields deps[i] could be null.
+      if (table->deps[i]) AssignDescriptors(table->deps[i], true);
+    }
+  }
 
-void AssignDescriptors(
-    const string& filename, const MigrationSchema* schemas,
-    const Message* const* default_instances_, const uint32* offsets,
-    MessageFactory* factory,
-    // update the following descriptor arrays.
-    Metadata* file_level_metadata,
-    const EnumDescriptor** file_level_enum_descriptors,
-    const ServiceDescriptor** file_level_service_descriptors) {
-  const ::google::protobuf::FileDescriptor* file =
-      ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(filename);
-  GOOGLE_CHECK(file != NULL);
+  // Fill the arrays with pointers to descriptors and reflection classes.
+  const FileDescriptor* file =
+      DescriptorPool::internal_generated_pool()->FindFileByName(
+          table->filename);
+  GOOGLE_CHECK(file != nullptr);
 
-  if (!factory) factory = MessageFactory::generated_factory();
+  MessageFactory* factory = MessageFactory::generated_factory();
 
-  AssignDescriptorsHelper<MigrationSchema> helper(factory, file_level_metadata,
-                                 file_level_enum_descriptors, schemas,
-                                 default_instances_, offsets);
+  AssignDescriptorsHelper helper(
+      factory, table->file_level_metadata, table->file_level_enum_descriptors,
+      table->schemas, table->default_instances, table->offsets);
 
   for (int i = 0; i < file->message_type_count(); i++) {
     helper.AssignMessageDescriptor(file->message_type(i));
@@ -2343,43 +2947,95 @@ void AssignDescriptors(
   }
   if (file->options().cc_generic_services()) {
     for (int i = 0; i < file->service_count(); i++) {
-      file_level_service_descriptors[i] = file->service(i);
+      table->file_level_service_descriptors[i] = file->service(i);
     }
   }
-  MetadataOwner::Instance()->AddArray(
-      file_level_metadata, helper.GetCurrentMetadataPtr());
+  MetadataOwner::Instance()->AddArray(table->file_level_metadata,
+                                      helper.GetCurrentMetadataPtr());
 }
 
+void AddDescriptorsImpl(const DescriptorTable* table) {
+  // Reflection refers to the default fields so make sure they are initialized.
+  internal::InitProtobufDefaults();
+
+  // Ensure all dependent descriptors are registered to the generated descriptor
+  // pool and message factory.
+  int num_deps = table->num_deps;
+  for (int i = 0; i < num_deps; i++) {
+    // In case of weak fields deps[i] could be null.
+    if (table->deps[i]) AddDescriptors(table->deps[i]);
+  }
+
+  // Register the descriptor of this file.
+  DescriptorPool::InternalAddGeneratedFile(table->descriptor, table->size);
+  MessageFactory::InternalRegisterGeneratedFile(table);
+}
+
+void AddDescriptors(const DescriptorTable* table) {
+  // AddDescriptors is not thread safe. Callers need to ensure calls are
+  // properly serialized. This function is only called pre-main by global
+  // descriptors and we can assume single threaded access or it's called
+  // by AssignDescriptorImpl which uses a mutex to sequence calls.
+  if (table->is_initialized) return;
+  table->is_initialized = true;
+  AddDescriptorsImpl(table);
+}
+
+}  // namespace
+
+// Separate function because it needs to be a friend of
+// Reflection
 void RegisterAllTypesInternal(const Metadata* file_level_metadata, int size) {
   for (int i = 0; i < size; i++) {
-    const GeneratedMessageReflection* reflection =
-        static_cast<const GeneratedMessageReflection*>(
-           file_level_metadata[i].reflection);
-    if (reflection) {
-      // It's not a map type
-      ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
-          file_level_metadata[i].descriptor,
-          reflection->schema_.default_instance_);
-    }
+    const Reflection* reflection = file_level_metadata[i].reflection;
+    MessageFactory::InternalRegisterGeneratedMessage(
+        file_level_metadata[i].descriptor,
+        reflection->schema_.default_instance_);
   }
 }
 
-void RegisterAllTypes(const Metadata* file_level_metadata, int size) {
-  RegisterAllTypesInternal(file_level_metadata, size);
+namespace internal {
+
+Metadata AssignDescriptors(const DescriptorTable* (*table)(),
+                           internal::once_flag* once,
+                           const Metadata& metadata) {
+  call_once(*once, [=] {
+    auto* t = table();
+    AssignDescriptorsImpl(t, t->is_eager);
+  });
+
+  return metadata;
+}
+
+void AssignDescriptors(const DescriptorTable* table, bool eager) {
+  if (!eager) eager = table->is_eager;
+  call_once(*table->once, AssignDescriptorsImpl, table, eager);
+}
+
+AddDescriptorsRunner::AddDescriptorsRunner(const DescriptorTable* table) {
+  AddDescriptors(table);
 }
 
-void UnknownFieldSetSerializer(const uint8* base, uint32 offset, uint32 tag,
-                               uint32 has_offset,
-                               ::google::protobuf::io::CodedOutputStream* output) {
+void RegisterFileLevelMetadata(const DescriptorTable* table) {
+  AssignDescriptors(table);
+  RegisterAllTypesInternal(table->file_level_metadata, table->num_messages);
+}
+
+void UnknownFieldSetSerializer(const uint8_t* base, uint32_t offset,
+                               uint32_t /*tag*/, uint32_t /*has_offset*/,
+                               io::CodedOutputStream* output) {
   const void* ptr = base + offset;
-  const InternalMetadataWithArena* metadata =
-      static_cast<const InternalMetadataWithArena*>(ptr);
+  const InternalMetadata* metadata = static_cast<const InternalMetadata*>(ptr);
   if (metadata->have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        metadata->unknown_fields(), output);
+    internal::WireFormat::SerializeUnknownFields(
+        metadata->unknown_fields<UnknownFieldSet>(
+            UnknownFieldSet::default_instance),
+        output);
   }
 }
 
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 02ecba6..6a570ff 100644 (file)
 #include <vector>
 #include <google/protobuf/stubs/casts.h>
 #include <google/protobuf/stubs/common.h>
-// TODO(jasonh): Remove this once the compiler change to directly include this
-// is released to components.
+#include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_enum_reflection.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/port.h>
 #include <google/protobuf/unknown_field_set.h>
 
 
-namespace google {
-namespace upb {
-namespace google_opensource {
-class GMR_Handlers;
-}  // namespace google_opensource
-}  // namespace upb
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
+namespace google {
 namespace protobuf {
-class DescriptorPool;
 class MapKey;
 class MapValueRef;
+class MessageLayoutInspector;
+class Message;
+struct Metadata;
 }  // namespace protobuf
+}  // namespace google
 
-
-namespace protobuf {
-namespace flat {
-class MetadataBuilder;
-}  // namespace flat
-}  // namespace protobuf
-
-
+namespace google {
 namespace protobuf {
 namespace internal {
 class DefaultEmptyOneof;
-
-// Defined in this file.
-class GeneratedMessageReflection;
-
 // Defined in other files.
-class ExtensionSet;             // extension_set.h
-class WeakFieldMap;             // weak_field_map.h
+class ExtensionSet;  // extension_set.h
+class WeakFieldMap;  // weak_field_map.h
 
 // This struct describes the internal layout of the message, hence this is
 // used to act on the message reflectively.
@@ -88,17 +79,17 @@ class WeakFieldMap;             // weak_field_map.h
 //                  used to obtain pointers to default instances of embedded
 //                  messages, which GetMessage() will return if the particular
 //                  sub-message has not been initialized yet.  (Thus, all
-//                  embedded message fields *must* have non-NULL pointers
+//                  embedded message fields *must* have non-null pointers
 //                  in the default instance.)
 //   offsets:       An array of ints giving the byte offsets.
 //                  For each oneof or weak field, the offset is relative to the
 //                  default_instance. These can be computed at compile time
 //                  using the
-//                  GOOGLE_PROTOBUF_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET()
+//                  PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET()
 //                  macro. For each none oneof field, the offset is related to
 //                  the start of the message object.  These can be computed at
 //                  compile time using the
-//                  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET() macro.
+//                  PROTO2_GENERATED_MESSAGE_FIELD_OFFSET() macro.
 //                  Besides offsets for all fields, this array also contains
 //                  offsets for oneof unions. The offset of the i-th oneof union
 //                  is offsets[descriptor->field_count() + i].
@@ -116,7 +107,7 @@ class WeakFieldMap;             // weak_field_map.h
 //                  message, or -1 if the message type has no extension
 //                  ranges.
 //   oneof_case_offset:  Offset in the message of an array of uint32s of
-//                  size descriptor->oneof_decl_count().  Each uint32
+//                  size descriptor->oneof_decl_count().  Each uint32_t
 //                  indicates what field is set for each oneof.
 //   object_size:   The size of a message object of this type, as measured
 //                  by sizeof().
@@ -128,62 +119,88 @@ class WeakFieldMap;             // weak_field_map.h
 struct ReflectionSchema {
  public:
   // Size of a google::protobuf::Message object of this type.
-  uint32 GetObjectSize() const { return static_cast<uint32>(object_size_); }
+  uint32_t GetObjectSize() const { return static_cast<uint32_t>(object_size_); }
+
+  bool InRealOneof(const FieldDescriptor* field) const {
+    return field->containing_oneof() &&
+           !field->containing_oneof()->is_synthetic();
+  }
 
   // Offset of a non-oneof field.  Getting a field offset is slightly more
   // efficient when we know statically that it is not a oneof field.
-  uint32 GetFieldOffsetNonOneof(const FieldDescriptor* field) const {
-    GOOGLE_DCHECK(!field->containing_oneof());
-    return offsets_[field->index()];
+  uint32_t GetFieldOffsetNonOneof(const FieldDescriptor* field) const {
+    GOOGLE_DCHECK(!InRealOneof(field));
+    return OffsetValue(offsets_[field->index()], field->type());
   }
 
   // Offset of any field.
-  uint32 GetFieldOffset(const FieldDescriptor* field) const {
-    if (field->containing_oneof()) {
+  uint32_t GetFieldOffset(const FieldDescriptor* field) const {
+    if (InRealOneof(field)) {
       size_t offset =
           static_cast<size_t>(field->containing_type()->field_count() +
-          field->containing_oneof()->index());
-      return offsets_[offset];
+                              field->containing_oneof()->index());
+      return OffsetValue(offsets_[offset], field->type());
     } else {
       return GetFieldOffsetNonOneof(field);
     }
   }
 
-  uint32 GetOneofCaseOffset(const OneofDescriptor* oneof_descriptor) const {
-    return static_cast<uint32>(oneof_case_offset_) +
-           static_cast<uint32>(
-               static_cast<size_t>(oneof_descriptor->index()) * sizeof(uint32));
+  bool IsFieldInlined(const FieldDescriptor* field) const {
+    return Inlined(offsets_[field->index()], field->type());
+  }
+
+  uint32_t GetOneofCaseOffset(const OneofDescriptor* oneof_descriptor) const {
+    return static_cast<uint32_t>(oneof_case_offset_) +
+           static_cast<uint32_t>(
+               static_cast<size_t>(oneof_descriptor->index()) *
+               sizeof(uint32_t));
   }
 
   bool HasHasbits() const { return has_bits_offset_ != -1; }
 
   // Bit index within the bit array of hasbits.  Bit order is low-to-high.
-  uint32 HasBitIndex(const FieldDescriptor* field) const {
+  uint32_t HasBitIndex(const FieldDescriptor* field) const {
+    if (has_bits_offset_ == -1) return static_cast<uint32_t>(-1);
     GOOGLE_DCHECK(HasHasbits());
     return has_bit_indices_[field->index()];
   }
 
   // Byte offset of the hasbits array.
-  uint32 HasBitsOffset() const {
+  uint32_t HasBitsOffset() const {
     GOOGLE_DCHECK(HasHasbits());
-    return static_cast<uint32>(has_bits_offset_);
+    return static_cast<uint32_t>(has_bits_offset_);
+  }
+
+  bool HasInlinedString() const { return inlined_string_donated_offset_ != -1; }
+
+  // Bit index within the bit array of _inlined_string_donated_.  Bit order is
+  // low-to-high.
+  uint32_t InlinedStringIndex(const FieldDescriptor* field) const {
+    GOOGLE_DCHECK(HasInlinedString());
+    return inlined_string_indices_[field->index()];
+  }
+
+  // Byte offset of the _inlined_string_donated_ array.
+  uint32_t InlinedStringDonatedOffset() const {
+    GOOGLE_DCHECK(HasInlinedString());
+    return static_cast<uint32_t>(inlined_string_donated_offset_);
   }
 
   // The offset of the InternalMetadataWithArena member.
   // For Lite this will actually be an InternalMetadataWithArenaLite.
   // The schema doesn't contain enough information to distinguish between
   // these two cases.
-  uint32 GetMetadataOffset() const {
-    return static_cast<uint32>(metadata_offset_);
+  uint32_t GetMetadataOffset() const {
+    return static_cast<uint32_t>(metadata_offset_);
   }
 
   // Whether this message has an ExtensionSet.
   bool HasExtensionSet() const { return extensions_offset_ != -1; }
 
   // The offset of the ExtensionSet in this message.
-  uint32 GetExtensionSetOffset() const {
+  uint32_t GetExtensionSetOffset() const {
     GOOGLE_DCHECK(HasExtensionSet());
-    return static_cast<uint32>(extensions_offset_);
+    return static_cast<uint32_t>(extensions_offset_);
   }
 
   // The off set of WeakFieldMap when the message contains weak fields.
@@ -196,9 +213,33 @@ struct ReflectionSchema {
 
   // Returns a pointer to the default value for this field.  The size and type
   // of the underlying data depends on the field's type.
-  const void *GetFieldDefault(const FieldDescriptor* field) const {
-    return reinterpret_cast<const uint8*>(default_instance_) +
-                     offsets_[field->index()];
+  const void* GetFieldDefault(const FieldDescriptor* field) const {
+    return reinterpret_cast<const uint8_t*>(default_instance_) +
+           OffsetValue(offsets_[field->index()], field->type());
+  }
+
+  // Returns true if the field is implicitly backed by LazyField.
+  bool IsEagerlyVerifiedLazyField(const FieldDescriptor* field) const {
+    GOOGLE_DCHECK_EQ(field->type(), FieldDescriptor::TYPE_MESSAGE);
+    (void)field;
+    return false;
+  }
+
+  // Returns true if the field's accessor is called by any external code (aka,
+  // non proto library code).
+  bool IsFieldUsed(const FieldDescriptor* field) const {
+    (void)field;
+    return true;
+  }
+
+  bool IsFieldStripped(const FieldDescriptor* field) const {
+    (void)field;
+    return false;
+  }
+
+  bool IsMessageStripped(const Descriptor* descriptor) const {
+    (void)descriptor;
+    return false;
   }
 
 
@@ -209,16 +250,39 @@ struct ReflectionSchema {
   // them, ie.
   //
   //   ReflectionSchema schema = {a, b, c, d, e, ...};
- // private:
 // private:
   const Message* default_instance_;
-  const uint32* offsets_;
-  const uint32* has_bit_indices_;
+  const uint32_t* offsets_;
+  const uint32_t* has_bit_indices_;
   int has_bits_offset_;
   int metadata_offset_;
   int extensions_offset_;
   int oneof_case_offset_;
   int object_size_;
   int weak_field_map_offset_;
+  const uint32_t* inlined_string_indices_;
+  int inlined_string_donated_offset_;
+
+  // We tag offset values to provide additional data about fields (such as
+  // "unused" or "lazy" or "inlined").
+  static uint32_t OffsetValue(uint32_t v, FieldDescriptor::Type type) {
+    if (type == FieldDescriptor::TYPE_MESSAGE ||
+        type == FieldDescriptor::TYPE_STRING ||
+        type == FieldDescriptor::TYPE_BYTES) {
+      return v & 0x7FFFFFFEu;
+    }
+    return v & 0x7FFFFFFFu;
+  }
+
+  static bool Inlined(uint32_t v, FieldDescriptor::Type type) {
+    if (type == FieldDescriptor::TYPE_STRING ||
+        type == FieldDescriptor::TYPE_BYTES) {
+      return (v & 1u) != 0u;
+    } else {
+      // Non string/byte fields are not inlined.
+      return false;
+    }
+  }
 };
 
 // Structs that the code generator emits directly to describe a message.
@@ -228,501 +292,71 @@ struct ReflectionSchema {
 // EXPERIMENTAL: these are changing rapidly, and may completely disappear
 // or merge with ReflectionSchema.
 struct MigrationSchema {
-  int32 offsets_index;
-  int32 has_bit_indices_index;
+  int32_t offsets_index;
+  int32_t has_bit_indices_index;
+  int32_t inlined_string_indices_index;
   int object_size;
 };
 
-// THIS CLASS IS NOT INTENDED FOR DIRECT USE.  It is intended for use
-// by generated code.  This class is just a big hack that reduces code
-// size.
-//
-// A GeneratedMessageReflection is an implementation of Reflection
-// which expects all fields to be backed by simple variables located in
-// memory.  The locations are given using a base pointer and a set of
-// offsets.
-//
-// It is required that the user represents fields of each type in a standard
-// way, so that GeneratedMessageReflection can cast the void* pointer to
-// the appropriate type.  For primitive fields and string fields, each field
-// should be represented using the obvious C++ primitive type.  Enums and
-// Messages are different:
-//  - Singular Message fields are stored as a pointer to a Message.  These
-//    should start out NULL, except for in the default instance where they
-//    should start out pointing to other default instances.
-//  - Enum fields are stored as an int.  This int must always contain
-//    a valid value, such that EnumDescriptor::FindValueByNumber() would
-//    not return NULL.
-//  - Repeated fields are stored as RepeatedFields or RepeatedPtrFields
-//    of whatever type the individual field would be.  Strings and
-//    Messages use RepeatedPtrFields while everything else uses
-//    RepeatedFields.
-class LIBPROTOBUF_EXPORT GeneratedMessageReflection PROTOBUF_FINAL : public Reflection {
- public:
-  // Constructs a GeneratedMessageReflection.
-  // Parameters:
-  //   descriptor:    The descriptor for the message type being implemented.
-  //   schema:        The description of the internal guts of the message.
-  //   pool:          DescriptorPool to search for extension definitions.  Only
-  //                  used by FindKnownExtensionByName() and
-  //                  FindKnownExtensionByNumber().
-  //   factory:       MessageFactory to use to construct extension messages.
-  GeneratedMessageReflection(const Descriptor* descriptor,
-                             const ReflectionSchema& schema,
-                             const DescriptorPool* pool,
-                             MessageFactory* factory);
-
-  ~GeneratedMessageReflection();
-
-  // implements Reflection -------------------------------------------
-
-  const UnknownFieldSet& GetUnknownFields(const Message& message) const;
-  UnknownFieldSet* MutableUnknownFields(Message* message) const;
-
-  size_t SpaceUsedLong(const Message& message) const;
-
-  bool HasField(const Message& message, const FieldDescriptor* field) const;
-  int FieldSize(const Message& message, const FieldDescriptor* field) const;
-  void ClearField(Message* message, const FieldDescriptor* field) const;
-  bool HasOneof(const Message& message,
-                const OneofDescriptor* oneof_descriptor) const;
-  void ClearOneof(Message* message, const OneofDescriptor* field) const;
-  void RemoveLast(Message* message, const FieldDescriptor* field) const;
-  Message* ReleaseLast(Message* message, const FieldDescriptor* field) const;
-  void Swap(Message* message1, Message* message2) const;
-  void SwapFields(Message* message1, Message* message2,
-                  const std::vector<const FieldDescriptor*>& fields) const;
-  void SwapElements(Message* message, const FieldDescriptor* field,
-                    int index1, int index2) const;
-  void ListFields(const Message& message,
-                  std::vector<const FieldDescriptor*>* output) const;
-
-  int32  GetInt32 (const Message& message,
-                   const FieldDescriptor* field) const;
-  int64  GetInt64 (const Message& message,
-                   const FieldDescriptor* field) const;
-  uint32 GetUInt32(const Message& message,
-                   const FieldDescriptor* field) const;
-  uint64 GetUInt64(const Message& message,
-                   const FieldDescriptor* field) const;
-  float  GetFloat (const Message& message,
-                   const FieldDescriptor* field) const;
-  double GetDouble(const Message& message,
-                   const FieldDescriptor* field) const;
-  bool   GetBool  (const Message& message,
-                   const FieldDescriptor* field) const;
-  string GetString(const Message& message,
-                   const FieldDescriptor* field) const;
-  const string& GetStringReference(const Message& message,
-                                   const FieldDescriptor* field,
-                                   string* scratch) const;
-  const EnumValueDescriptor* GetEnum(const Message& message,
-                                     const FieldDescriptor* field) const;
-  int GetEnumValue(const Message& message,
-                   const FieldDescriptor* field) const;
-  const Message& GetMessage(const Message& message,
-                            const FieldDescriptor* field,
-                            MessageFactory* factory = NULL) const;
-
-  const FieldDescriptor* GetOneofFieldDescriptor(
-      const Message& message,
-      const OneofDescriptor* oneof_descriptor) const;
-
- private:
-  bool ContainsMapKey(const Message& message,
-                      const FieldDescriptor* field,
-                      const MapKey& key) const;
-  bool InsertOrLookupMapValue(Message* message,
-                              const FieldDescriptor* field,
-                              const MapKey& key,
-                              MapValueRef* val) const;
-  bool DeleteMapValue(Message* message,
-                      const FieldDescriptor* field,
-                      const MapKey& key) const;
-  MapIterator MapBegin(
-      Message* message,
-      const FieldDescriptor* field) const;
-  MapIterator MapEnd(
-      Message* message,
-      const FieldDescriptor* field) const;
-  int MapSize(const Message& message, const FieldDescriptor* field) const;
-
- public:
-  void SetInt32 (Message* message,
-                 const FieldDescriptor* field, int32  value) const;
-  void SetInt64 (Message* message,
-                 const FieldDescriptor* field, int64  value) const;
-  void SetUInt32(Message* message,
-                 const FieldDescriptor* field, uint32 value) const;
-  void SetUInt64(Message* message,
-                 const FieldDescriptor* field, uint64 value) const;
-  void SetFloat (Message* message,
-                 const FieldDescriptor* field, float  value) const;
-  void SetDouble(Message* message,
-                 const FieldDescriptor* field, double value) const;
-  void SetBool  (Message* message,
-                 const FieldDescriptor* field, bool   value) const;
-  void SetString(Message* message,
-                 const FieldDescriptor* field,
-                 const string& value) const;
-  void SetEnum  (Message* message, const FieldDescriptor* field,
-                 const EnumValueDescriptor* value) const;
-  void SetEnumValue(Message* message, const FieldDescriptor* field,
-                    int value) const;
-  Message* MutableMessage(Message* message, const FieldDescriptor* field,
-                          MessageFactory* factory = NULL) const;
-  void SetAllocatedMessage(Message* message,
-                           Message* sub_message,
-                           const FieldDescriptor* field) const;
-  Message* ReleaseMessage(Message* message, const FieldDescriptor* field,
-                          MessageFactory* factory = NULL) const;
-
-  int32  GetRepeatedInt32 (const Message& message,
-                           const FieldDescriptor* field, int index) const;
-  int64  GetRepeatedInt64 (const Message& message,
-                           const FieldDescriptor* field, int index) const;
-  uint32 GetRepeatedUInt32(const Message& message,
-                           const FieldDescriptor* field, int index) const;
-  uint64 GetRepeatedUInt64(const Message& message,
-                           const FieldDescriptor* field, int index) const;
-  float  GetRepeatedFloat (const Message& message,
-                           const FieldDescriptor* field, int index) const;
-  double GetRepeatedDouble(const Message& message,
-                           const FieldDescriptor* field, int index) const;
-  bool   GetRepeatedBool  (const Message& message,
-                           const FieldDescriptor* field, int index) const;
-  string GetRepeatedString(const Message& message,
-                           const FieldDescriptor* field, int index) const;
-  const string& GetRepeatedStringReference(const Message& message,
-                                           const FieldDescriptor* field,
-                                           int index, string* scratch) const;
-  const EnumValueDescriptor* GetRepeatedEnum(const Message& message,
-                                             const FieldDescriptor* field,
-                                             int index) const;
-  int GetRepeatedEnumValue(const Message& message,
-                           const FieldDescriptor* field,
-                           int index) const;
-  const Message& GetRepeatedMessage(const Message& message,
-                                    const FieldDescriptor* field,
-                                    int index) const;
-
-  // Set the value of a field.
-  void SetRepeatedInt32 (Message* message,
-                         const FieldDescriptor* field, int index, int32  value) const;
-  void SetRepeatedInt64 (Message* message,
-                         const FieldDescriptor* field, int index, int64  value) const;
-  void SetRepeatedUInt32(Message* message,
-                         const FieldDescriptor* field, int index, uint32 value) const;
-  void SetRepeatedUInt64(Message* message,
-                         const FieldDescriptor* field, int index, uint64 value) const;
-  void SetRepeatedFloat (Message* message,
-                         const FieldDescriptor* field, int index, float  value) const;
-  void SetRepeatedDouble(Message* message,
-                         const FieldDescriptor* field, int index, double value) const;
-  void SetRepeatedBool  (Message* message,
-                         const FieldDescriptor* field, int index, bool   value) const;
-  void SetRepeatedString(Message* message,
-                         const FieldDescriptor* field, int index,
-                         const string& value) const;
-  void SetRepeatedEnum(Message* message, const FieldDescriptor* field,
-                       int index, const EnumValueDescriptor* value) const;
-  void SetRepeatedEnumValue(Message* message, const FieldDescriptor* field,
-                            int index, int value) const;
-  // Get a mutable pointer to a field with a message type.
-  Message* MutableRepeatedMessage(Message* message,
-                                  const FieldDescriptor* field,
-                                  int index) const;
-
-  void AddInt32 (Message* message,
-                 const FieldDescriptor* field, int32  value) const;
-  void AddInt64 (Message* message,
-                 const FieldDescriptor* field, int64  value) const;
-  void AddUInt32(Message* message,
-                 const FieldDescriptor* field, uint32 value) const;
-  void AddUInt64(Message* message,
-                 const FieldDescriptor* field, uint64 value) const;
-  void AddFloat (Message* message,
-                 const FieldDescriptor* field, float  value) const;
-  void AddDouble(Message* message,
-                 const FieldDescriptor* field, double value) const;
-  void AddBool  (Message* message,
-                 const FieldDescriptor* field, bool   value) const;
-  void AddString(Message* message,
-                 const FieldDescriptor* field, const string& value) const;
-  void AddEnum(Message* message,
-               const FieldDescriptor* field,
-               const EnumValueDescriptor* value) const;
-  void AddEnumValue(Message* message,
-                    const FieldDescriptor* field,
-                    int value) const;
-  Message* AddMessage(Message* message, const FieldDescriptor* field,
-                      MessageFactory* factory = NULL) const;
-  void AddAllocatedMessage(
-      Message* message, const FieldDescriptor* field,
-      Message* new_entry) const;
-
-  const FieldDescriptor* FindKnownExtensionByName(const string& name) const;
-  const FieldDescriptor* FindKnownExtensionByNumber(int number) const;
-
-  bool SupportsUnknownEnumValues() const;
-
-  // This value for arena_offset_ indicates that there is no arena pointer in
-  // this message (e.g., old generated code).
-  static const int kNoArenaPointer = -1;
-
-  // This value for unknown_field_offset_ indicates that there is no
-  // UnknownFieldSet in this message, and that instead, we are using the
-  // Zero-Overhead Arena Pointer trick. When this is the case, arena_offset_
-  // actually indexes to an InternalMetadataWithArena instance, which can return
-  // either an arena pointer or an UnknownFieldSet or both. It is never the case
-  // that unknown_field_offset_ == kUnknownFieldSetInMetadata && arena_offset_
-  // == kNoArenaPointer.
-  static const int kUnknownFieldSetInMetadata = -1;
-
- protected:
-  void* MutableRawRepeatedField(
-      Message* message, const FieldDescriptor* field, FieldDescriptor::CppType,
-      int ctype, const Descriptor* desc) const;
-
-  const void* GetRawRepeatedField(
-      const Message& message, const FieldDescriptor* field,
-      FieldDescriptor::CppType, int ctype,
-      const Descriptor* desc) const;
-
-  virtual MessageFactory* GetMessageFactory() const;
-
-  virtual void* RepeatedFieldData(
-      Message* message, const FieldDescriptor* field,
-      FieldDescriptor::CppType cpp_type,
-      const Descriptor* message_type) const;
-
- private:
-  friend class google::protobuf::flat::MetadataBuilder;
-  friend class upb::google_opensource::GMR_Handlers;
-
-  const Descriptor* const descriptor_;
-  const ReflectionSchema schema_;
-  const DescriptorPool* const descriptor_pool_;
-  MessageFactory* const message_factory_;
-
-  // Last non weak field index. This is an optimization when most weak fields
-  // are at the end of the containing message. If a message proto doesn't
-  // contain weak fields, then this field equals descriptor_->field_count().
-  int last_non_weak_field_index_;
-
-  template <class T>
-  const T& GetRawNonOneof(const Message& message,
-                          const FieldDescriptor* field) const;
-  template <class T>
-  T* MutableRawNonOneof(Message* message, const FieldDescriptor* field) const;
-
-  template <typename Type>
-  const Type& GetRaw(const Message& message,
-                            const FieldDescriptor* field) const;
-  template <typename Type>
-  inline Type* MutableRaw(Message* message,
-                          const FieldDescriptor* field) const;
-  template <typename Type>
-  inline const Type& DefaultRaw(const FieldDescriptor* field) const;
-
-  inline const uint32* GetHasBits(const Message& message) const;
-  inline uint32* MutableHasBits(Message* message) const;
-  inline uint32 GetOneofCase(
-      const Message& message,
-      const OneofDescriptor* oneof_descriptor) const;
-  inline uint32* MutableOneofCase(
-      Message* message,
-      const OneofDescriptor* oneof_descriptor) const;
-  inline const ExtensionSet& GetExtensionSet(const Message& message) const;
-  inline ExtensionSet* MutableExtensionSet(Message* message) const;
-  inline Arena* GetArena(Message* message) const;
-
-  inline const InternalMetadataWithArena& GetInternalMetadataWithArena(
-      const Message& message) const;
-
-  inline InternalMetadataWithArena*
-      MutableInternalMetadataWithArena(Message* message) const;
-
-  inline bool HasBit(const Message& message,
-                     const FieldDescriptor* field) const;
-  inline void SetBit(Message* message,
-                     const FieldDescriptor* field) const;
-  inline void ClearBit(Message* message,
-                       const FieldDescriptor* field) const;
-  inline void SwapBit(Message* message1,
-                      Message* message2,
-                      const FieldDescriptor* field) const;
-
-  // This function only swaps the field. Should swap corresponding has_bit
-  // before or after using this function.
-  void SwapField(Message* message1,
-                 Message* message2,
-                 const FieldDescriptor* field) const;
-
-  void SwapOneofField(Message* message1,
-                      Message* message2,
-                      const OneofDescriptor* oneof_descriptor) const;
-
-  inline bool HasOneofField(const Message& message,
-                            const FieldDescriptor* field) const;
-  inline void SetOneofCase(Message* message,
-                           const FieldDescriptor* field) const;
-  inline void ClearOneofField(Message* message,
-                              const FieldDescriptor* field) const;
-
-  template <typename Type>
-  inline const Type& GetField(const Message& message,
-                              const FieldDescriptor* field) const;
-  template <typename Type>
-  inline void SetField(Message* message,
-                       const FieldDescriptor* field, const Type& value) const;
-  template <typename Type>
-  inline Type* MutableField(Message* message,
-                            const FieldDescriptor* field) const;
-  template <typename Type>
-  inline const Type& GetRepeatedField(const Message& message,
-                                      const FieldDescriptor* field,
-                                      int index) const;
-  template <typename Type>
-  inline const Type& GetRepeatedPtrField(const Message& message,
-                                         const FieldDescriptor* field,
-                                         int index) const;
-  template <typename Type>
-  inline void SetRepeatedField(Message* message,
-                               const FieldDescriptor* field, int index,
-                               Type value) const;
-  template <typename Type>
-  inline Type* MutableRepeatedField(Message* message,
-                                    const FieldDescriptor* field,
-                                    int index) const;
-  template <typename Type>
-  inline void AddField(Message* message,
-                       const FieldDescriptor* field, const Type& value) const;
-  template <typename Type>
-  inline Type* AddField(Message* message,
-                        const FieldDescriptor* field) const;
-
-  int GetExtensionNumberOrDie(const Descriptor* type) const;
-
-  // Internal versions of EnumValue API perform no checking. Called after checks
-  // by public methods.
-  void SetEnumValueInternal(Message* message,
-                            const FieldDescriptor* field,
-                            int value) const;
-  void SetRepeatedEnumValueInternal(Message* message,
-                                    const FieldDescriptor* field,
-                                    int index,
-                                    int value) const;
-  void AddEnumValueInternal(Message* message,
-                            const FieldDescriptor* field,
-                            int value) const;
-
-
-  Message* UnsafeArenaReleaseMessage(Message* message,
-                                     const FieldDescriptor* field,
-                                     MessageFactory* factory = NULL) const;
-
-  void UnsafeArenaSetAllocatedMessage(Message* message,
-                                      Message* sub_message,
-                                      const FieldDescriptor* field) const;
-
-  internal::MapFieldBase* MapData(
-      Message* message, const FieldDescriptor* field) const;
-
-  friend inline  // inline so nobody can call this function.
-      void
-      RegisterAllTypesInternal(const Metadata* file_level_metadata, int size);
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GeneratedMessageReflection);
+// This struct tries to reduce unnecessary padding.
+// The num_xxx might not be close to their respective pointer, but this saves
+// padding.
+struct PROTOBUF_EXPORT DescriptorTable {
+  mutable bool is_initialized;
+  bool is_eager;
+  int size;  // of serialized descriptor
+  const char* descriptor;
+  const char* filename;
+  once_flag* once;
+  const DescriptorTable* const* deps;
+  int num_deps;
+  int num_messages;
+  const MigrationSchema* schemas;
+  const Message* const* default_instances;
+  const uint32_t* offsets;
+  // update the following descriptor arrays.
+  Metadata* file_level_metadata;
+  const EnumDescriptor** file_level_enum_descriptors;
+  const ServiceDescriptor** file_level_service_descriptors;
 };
 
-// There are some places in proto2 where dynamic_cast would be useful as an
-// optimization.  For example, take Message::MergeFrom(const Message& other).
-// For a given generated message FooMessage, we generate these two methods:
-//   void MergeFrom(const FooMessage& other);
-//   void MergeFrom(const Message& other);
-// The former method can be implemented directly in terms of FooMessage's
-// inline accessors, but the latter method must work with the reflection
-// interface.  However, if the parameter to the latter method is actually of
-// type FooMessage, then we'd like to be able to just call the other method
-// as an optimization.  So, we use dynamic_cast to check this.
-//
-// That said, dynamic_cast requires RTTI, which many people like to disable
-// for performance and code size reasons.  When RTTI is not available, we
-// still need to produce correct results.  So, in this case we have to fall
-// back to using reflection, which is what we would have done anyway if the
-// objects were not of the exact same class.
-//
-// dynamic_cast_if_available() implements this logic.  If RTTI is
-// enabled, it does a dynamic_cast.  If RTTI is disabled, it just returns
-// NULL.
-//
-// If you need to compile without RTTI, simply #define GOOGLE_PROTOBUF_NO_RTTI.
-// On MSVC, this should be detected automatically.
-template<typename To, typename From>
-inline To dynamic_cast_if_available(From from) {
-#if defined(GOOGLE_PROTOBUF_NO_RTTI) || (defined(_MSC_VER)&&!defined(_CPPRTTI))
-  // Avoid the compiler warning about unused variables.
-  (void)from;
-  return NULL;
-#else
-  return dynamic_cast<To>(from);
-#endif
-}
-
-// Tries to downcast this message to a generated message type.
-// Returns NULL if this class is not an instance of T.
-//
-// This is like dynamic_cast_if_available, except it works even when
-// dynamic_cast is not available by using Reflection.  However it only works
-// with Message objects.
-//
-// TODO(haberman): can we remove dynamic_cast_if_available in favor of this?
-template <typename T>
-T* DynamicCastToGenerated(const Message* from) {
-  // Compile-time assert that T is a generated type that has a
-  // default_instance() accessor, but avoid actually calling it.
-  const T&(*get_default_instance)() = &T::default_instance;
-  (void)get_default_instance;
-
-  // Compile-time assert that T is a subclass of google::protobuf::Message.
-  const Message* unused = static_cast<T*>(NULL);
-  (void)unused;
-
-#if defined(GOOGLE_PROTOBUF_NO_RTTI) || \
-  (defined(_MSC_VER) && !defined(_CPPRTTI))
-  bool ok = &T::default_instance() ==
-            from->GetReflection()->GetMessageFactory()->GetPrototype(
-                from->GetDescriptor());
-  return ok ? down_cast<T*>(from) : NULL;
-#else
-  return dynamic_cast<T*>(from);
-#endif
-}
-
-template <typename T>
-T* DynamicCastToGenerated(Message* from) {
-  const Message* message_const = from;
-  return const_cast<T*>(DynamicCastToGenerated<const T>(message_const));
-}
-
-LIBPROTOBUF_EXPORT void AssignDescriptors(
-    const string& filename, const MigrationSchema* schemas,
-    const Message* const* default_instances_, const uint32* offsets,
-    MessageFactory* factory,
-    // update the following descriptor arrays.
-    Metadata* file_level_metadata,
-    const EnumDescriptor** file_level_enum_descriptors,
-    const ServiceDescriptor** file_level_service_descriptors);
+enum {
+  // Tag used on offsets for fields that don't have a real offset.
+  // For example, weak message fields go into the WeakFieldMap and not in an
+  // actual field.
+  kInvalidFieldOffsetTag = 0x40000000u,
+};
 
-LIBPROTOBUF_EXPORT void RegisterAllTypes(const Metadata* file_level_metadata, int size);
+// AssignDescriptors() pulls the compiled FileDescriptor from the DescriptorPool
+// and uses it to populate all of the global variables which store pointers to
+// the descriptor objects.  It also constructs the reflection objects.  It is
+// called the first time anyone calls descriptor() or GetReflection() on one of
+// the types defined in the file.  AssignDescriptors() is thread-safe.
+void PROTOBUF_EXPORT AssignDescriptors(const DescriptorTable* table,
+                                       bool eager = false);
+
+// Overload used to implement GetMetadataStatic in the generated code.
+// See comments in compiler/cpp/internal/file.cc as to why.
+// It takes a `Metadata` and returns it to allow for tail calls and reduce
+// binary size.
+Metadata PROTOBUF_EXPORT AssignDescriptors(const DescriptorTable* (*table)(),
+                                           internal::once_flag* once,
+                                           const Metadata& metadata);
 
 // These cannot be in lite so we put them in the reflection.
-LIBPROTOBUF_EXPORT void UnknownFieldSetSerializer(const uint8* base, uint32 offset, uint32 tag,
-                               uint32 has_offset,
-                               ::google::protobuf::io::CodedOutputStream* output);
+PROTOBUF_EXPORT void UnknownFieldSetSerializer(const uint8_t* base,
+                                               uint32_t offset, uint32_t tag,
+                                               uint32_t has_offset,
+                                               io::CodedOutputStream* output);
+
+struct PROTOBUF_EXPORT AddDescriptorsRunner {
+  explicit AddDescriptorsRunner(const DescriptorTable* table);
+};
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/generated_message_table_driven.cc b/3rdparty/protobuf/src/google/protobuf/generated_message_table_driven.cc
deleted file mode 100644 (file)
index 29af1ef..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/generated_message_table_driven.h>
-
-#include <google/protobuf/stubs/type_traits.h>
-
-#include <google/protobuf/generated_message_table_driven_lite.h>
-#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/repeated_field.h>
-#include <google/protobuf/wire_format.h>
-#include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-namespace {
-
-UnknownFieldSet* MutableUnknownFields(MessageLite* msg, int64 arena_offset) {
-  return Raw<InternalMetadataWithArena>(msg, arena_offset)
-      ->mutable_unknown_fields();
-}
-
-struct UnknownFieldHandler {
-  static bool Skip(MessageLite* msg, const ParseTable& table,
-                   io::CodedInputStream* input,
-                   int tag) {
-    GOOGLE_DCHECK(table.unknown_field_set);
-
-    return WireFormat::SkipField(input, tag,
-        MutableUnknownFields(msg, table.arena_offset));
-  }
-
-  static void Varint(MessageLite* msg, const ParseTable& table,
-                     int tag, int value) {
-    GOOGLE_DCHECK(table.unknown_field_set);
-
-    MutableUnknownFields(msg, table.arena_offset)->AddVarint(
-        WireFormatLite::GetTagFieldNumber(tag), value);
-  }
-
-  static bool ParseExtension(
-      MessageLite* msg, const ParseTable& table,
-      io::CodedInputStream* input, int tag) {
-    ExtensionSet* extensions = GetExtensionSet(msg, table.extension_offset);
-    if (extensions == NULL) {
-      return false;
-    }
-
-    const Message* prototype = down_cast<const Message*>(
-        table.default_instance());
-
-    GOOGLE_DCHECK(prototype != NULL);
-    GOOGLE_DCHECK(table.unknown_field_set);
-    UnknownFieldSet* unknown_fields =
-        MutableUnknownFields(msg, table.arena_offset);
-
-    return extensions->ParseField(tag, input, prototype, unknown_fields);
-  }
-};
-
-}  // namespace
-
-bool MergePartialFromCodedStream(
-    MessageLite* msg, const ParseTable& table, io::CodedInputStream* input) {
-  return MergePartialFromCodedStreamImpl<UnknownFieldHandler,
-                                         InternalMetadataWithArena>(msg, table,
-                                                                    input);
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
index 6f3fe66..15eebcb 100644 (file)
 #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>
-
-#if LANG_CXX11
-#define PROTOBUF_CONSTEXPR constexpr
 
 // We require C++11 and Clang to use constexpr for variables, as GCC 4.8
 // requires constexpr to be consistent between declarations of variables
 #define PROTOBUF_CONSTEXPR_VAR
 #endif  // !_clang
 
-#else
-#define PROTOBUF_CONSTEXPR
-#define PROTOBUF_CONSTEXPR_VAR
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
 #endif
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace internal {
 
 // Processing-type masks.
-static PROTOBUF_CONSTEXPR const unsigned char kOneofMask = 0x40;
-static PROTOBUF_CONSTEXPR const unsigned char kRepeatedMask = 0x20;
+static constexpr const unsigned char kOneofMask = 0x40;
+static constexpr const unsigned char kRepeatedMask = 0x20;
 // Mask for the raw type: either a WireFormatLite::FieldType or one of the
 // ProcessingTypes below, without the oneof or repeated flag.
-static PROTOBUF_CONSTEXPR const unsigned char kTypeMask = 0x1f;
+static constexpr const unsigned char kTypeMask = 0x1f;
 
 // Wire type masks.
-static PROTOBUF_CONSTEXPR const unsigned char kNotPackedMask = 0x10;
-static PROTOBUF_CONSTEXPR const unsigned char kInvalidMask = 0x20;
+static constexpr const unsigned char kNotPackedMask = 0x10;
+static constexpr const unsigned char kInvalidMask = 0x20;
 
 enum ProcessingTypes {
   TYPE_STRING_CORD = 19,
   TYPE_STRING_STRING_PIECE = 20,
   TYPE_BYTES_CORD = 21,
   TYPE_BYTES_STRING_PIECE = 22,
-  TYPE_MAP = 23,
+  TYPE_STRING_INLINED = 23,
+  TYPE_BYTES_INLINED = 24,
+  TYPE_MAP = 25,
 };
 
-#if LANG_CXX11
 static_assert(TYPE_MAP < kRepeatedMask, "Invalid enum");
-#endif
+
+struct PROTOBUF_EXPORT FieldMetadata {
+  uint32_t offset;  // offset of this field in the struct
+  uint32_t tag;     // field * 8 + wire_type
+  // byte offset * 8 + bit_offset;
+  // if the high bit is set then this is the byte offset of the oneof_case
+  // for this field.
+  uint32_t has_offset;
+  uint32_t type;    // the type of this field.
+  const void* ptr;  // auxiliary data
+
+  // From the serializer point of view each fundamental type can occur in
+  // 4 different ways. For simplicity we treat all combinations as a cartesion
+  // product although not all combinations are allowed.
+  enum FieldTypeClass {
+    kPresence,
+    kNoPresence,
+    kRepeated,
+    kPacked,
+    kOneOf,
+    kNumTypeClasses  // must be last enum
+  };
+  // C++ protobuf has 20 fundamental types, were we added Cord and StringPiece
+  // and also distinguish the same types if they have different wire format.
+  enum {
+    kCordType = 19,
+    kStringPieceType = 20,
+    kInlinedType = 21,
+    kNumTypes = 21,
+    kSpecial = kNumTypes * kNumTypeClasses,
+  };
+
+  static int CalculateType(int fundamental_type, FieldTypeClass type_class);
+};
 
 // TODO(ckennelly):  Add a static assertion to ensure that these masks do not
 // conflict with wiretypes.
@@ -89,12 +120,12 @@ static_assert(TYPE_MAP < kRepeatedMask, "Invalid enum");
 // ParseTableField is kept small to help simplify instructions for computing
 // offsets, as we will always need this information to parse a field.
 // Additional data, needed for some types, is stored in
-// AuxillaryParseTableField.
+// AuxiliaryParseTableField.
 struct ParseTableField {
-  uint32 offset;
+  uint32_t offset;
   // The presence_index ordinarily represents a has_bit index, but for fields
   // inside a oneof it represents the index in _oneof_case_.
-  uint32 presence_index;
+  uint32_t presence_index;
   unsigned char normal_wiretype;
   unsigned char packed_wiretype;
 
@@ -107,7 +138,7 @@ struct ParseTableField {
 
 struct ParseTable;
 
-union AuxillaryParseTableField {
+union AuxiliaryParseTableField {
   typedef bool (*EnumValidator)(int);
 
   // Enums
@@ -124,7 +155,6 @@ union AuxillaryParseTableField {
     const MessageLite* default_message() const {
       return static_cast<const MessageLite*>(default_message_void);
     }
-    const ParseTable* parse_table;
   };
   message_aux messages;
   // Strings
@@ -139,33 +169,28 @@ union AuxillaryParseTableField {
   };
   map_aux maps;
 
-#if LANG_CXX11
-  AuxillaryParseTableField() = default;
-#else
-  AuxillaryParseTableField() { }
-#endif
-  PROTOBUF_CONSTEXPR AuxillaryParseTableField(
-      AuxillaryParseTableField::enum_aux e) : enums(e) {}
-  PROTOBUF_CONSTEXPR AuxillaryParseTableField(
-      AuxillaryParseTableField::message_aux m) : messages(m) {}
-  PROTOBUF_CONSTEXPR AuxillaryParseTableField(
-      AuxillaryParseTableField::string_aux s) : strings(s) {}
-  PROTOBUF_CONSTEXPR AuxillaryParseTableField(
-      AuxillaryParseTableField::map_aux m)
+  AuxiliaryParseTableField() = default;
+  constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::enum_aux e)
+      : enums(e) {}
+  constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::message_aux m)
+      : messages(m) {}
+  constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::string_aux s)
+      : strings(s) {}
+  constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::map_aux m)
       : maps(m) {}
 };
 
 struct ParseTable {
   const ParseTableField* fields;
-  const AuxillaryParseTableField* aux;
+  const AuxiliaryParseTableField* aux;
   int max_field_number;
   // TODO(ckennelly): Do something with this padding.
 
   // TODO(ckennelly): Vet these for sign extension.
-  int64 has_bits_offset;
-  int64 oneof_case_offset;
-  int64 extension_offset;
-  int64 arena_offset;
+  int64_t has_bits_offset;
+  int64_t oneof_case_offset;
+  int64_t extension_offset;
+  int64_t arena_offset;
 
   // ExplicitlyInitialized<T> -> T requires a reinterpret_cast, which prevents
   // the tables from being constructed as a constexpr.  We use void to avoid
@@ -178,42 +203,149 @@ struct ParseTable {
   bool unknown_field_set;
 };
 
-// TODO(jhen): Remove the __NVCC__ check when we get a version of nvcc that
-// supports these checks.
-#if LANG_CXX11 && !defined(__NVCC__)
 static_assert(sizeof(ParseTableField) <= 16, "ParseTableField is too large");
 // The tables must be composed of POD components to ensure link-time
 // initialization.
-static_assert(std::is_pod<ParseTableField>::value, "");
-static_assert(std::is_pod<AuxillaryParseTableField>::value, "");
-static_assert(std::is_pod<AuxillaryParseTableField::enum_aux>::value, "");
-static_assert(std::is_pod<AuxillaryParseTableField::message_aux>::value, "");
-static_assert(std::is_pod<AuxillaryParseTableField::string_aux>::value, "");
-static_assert(std::is_pod<ParseTable>::value, "");
-#endif
+static_assert(std::is_standard_layout<ParseTableField>::value, "");
+static_assert(std::is_trivial<ParseTableField>::value, "");
+static_assert(std::is_standard_layout<AuxiliaryParseTableField>::value, "");
+static_assert(std::is_trivial<AuxiliaryParseTableField>::value, "");
+static_assert(
+    std::is_standard_layout<AuxiliaryParseTableField::enum_aux>::value, "");
+static_assert(std::is_trivial<AuxiliaryParseTableField::enum_aux>::value, "");
+static_assert(
+    std::is_standard_layout<AuxiliaryParseTableField::message_aux>::value, "");
+static_assert(std::is_trivial<AuxiliaryParseTableField::message_aux>::value,
+              "");
+static_assert(
+    std::is_standard_layout<AuxiliaryParseTableField::string_aux>::value, "");
+static_assert(std::is_trivial<AuxiliaryParseTableField::string_aux>::value, "");
+static_assert(std::is_standard_layout<ParseTable>::value, "");
+static_assert(std::is_trivial<ParseTable>::value, "");
 
 // TODO(ckennelly): Consolidate these implementations into a single one, using
 // dynamic dispatch to the appropriate unknown field handler.
 bool MergePartialFromCodedStream(MessageLite* msg, const ParseTable& table,
                                  io::CodedInputStream* input);
 bool MergePartialFromCodedStreamLite(MessageLite* msg, const ParseTable& table,
-                                 io::CodedInputStream* input);
+                                     io::CodedInputStream* input);
 
 template <typename Entry>
 bool ParseMap(io::CodedInputStream* input, void* map_field) {
   typedef typename MapEntryToMapField<Entry>::MapFieldType MapFieldType;
-  typedef google::protobuf::Map<typename Entry::EntryKeyType,
-                      typename Entry::EntryValueType>
+  typedef Map<typename Entry::EntryKeyType, typename Entry::EntryValueType>
       MapType;
   typedef typename Entry::template Parser<MapFieldType, MapType> ParserType;
 
   ParserType parser(static_cast<MapFieldType*>(map_field));
-  return ::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(input,
-                                                                  &parser);
+  return WireFormatLite::ReadMessageNoVirtual(input, &parser);
+}
+
+struct SerializationTable {
+  int num_fields;
+  const FieldMetadata* field_table;
+};
+
+PROTOBUF_EXPORT void SerializeInternal(const uint8_t* base,
+                                       const FieldMetadata* table,
+                                       int32_t num_fields,
+                                       io::CodedOutputStream* output);
+
+inline void TableSerialize(const MessageLite& msg,
+                           const SerializationTable* table,
+                           io::CodedOutputStream* output) {
+  const FieldMetadata* field_table = table->field_table;
+  int num_fields = table->num_fields - 1;
+  const uint8_t* base = reinterpret_cast<const uint8_t*>(&msg);
+  // TODO(gerbens) This skips the first test if we could use the fast
+  // array serialization path, we should make this
+  // int cached_size =
+  //    *reinterpret_cast<const int32_t*>(base + field_table->offset);
+  // SerializeWithCachedSize(msg, field_table + 1, num_fields, cached_size, ...)
+  // But we keep conformance with the old way for now.
+  SerializeInternal(base, field_table + 1, num_fields, output);
+}
+
+PROTOBUF_EXPORT uint8_t* SerializeInternalToArray(const uint8_t* base,
+                                                  const FieldMetadata* table,
+                                                  int32_t num_fields,
+                                                  bool is_deterministic,
+                                                  uint8_t* buffer);
+
+inline uint8_t* TableSerializeToArray(const MessageLite& msg,
+                                      const SerializationTable* table,
+                                      bool is_deterministic, uint8_t* buffer) {
+  const uint8_t* base = reinterpret_cast<const uint8_t*>(&msg);
+  const FieldMetadata* field_table = table->field_table + 1;
+  int num_fields = table->num_fields - 1;
+  return SerializeInternalToArray(base, field_table, num_fields,
+                                  is_deterministic, buffer);
+}
+
+template <typename T>
+struct CompareHelper {
+  bool operator()(const T& a, const T& b) const { return a < b; }
+};
+
+template <>
+struct CompareHelper<ArenaStringPtr> {
+  bool operator()(const ArenaStringPtr& a, const ArenaStringPtr& b) const {
+    return a.Get() < b.Get();
+  }
+};
+
+struct CompareMapKey {
+  template <typename T>
+  bool operator()(const MapEntryHelper<T>& a,
+                  const MapEntryHelper<T>& b) const {
+    return Compare(a.key_, b.key_);
+  }
+  template <typename T>
+  bool Compare(const T& a, const T& b) const {
+    return CompareHelper<T>()(a, b);
+  }
+};
+
+template <typename MapFieldType, const SerializationTable* table>
+void MapFieldSerializer(const uint8_t* base, uint32_t offset, uint32_t tag,
+                        uint32_t has_offset, io::CodedOutputStream* output) {
+  typedef MapEntryHelper<typename MapFieldType::EntryTypeTrait> Entry;
+  typedef typename MapFieldType::MapType::const_iterator Iter;
+
+  const MapFieldType& map_field =
+      *reinterpret_cast<const MapFieldType*>(base + offset);
+  const SerializationTable* t =
+      table +
+      has_offset;  // has_offset is overloaded for maps to mean table offset
+  if (!output->IsSerializationDeterministic()) {
+    for (Iter it = map_field.GetMap().begin(); it != map_field.GetMap().end();
+         ++it) {
+      Entry map_entry(*it);
+      output->WriteVarint32(tag);
+      output->WriteVarint32(map_entry._cached_size_);
+      SerializeInternal(reinterpret_cast<const uint8_t*>(&map_entry),
+                        t->field_table, t->num_fields, output);
+    }
+  } else {
+    std::vector<Entry> v;
+    for (Iter it = map_field.GetMap().begin(); it != map_field.GetMap().end();
+         ++it) {
+      v.push_back(Entry(*it));
+    }
+    std::sort(v.begin(), v.end(), CompareMapKey());
+    for (int i = 0; i < v.size(); i++) {
+      output->WriteVarint32(tag);
+      output->WriteVarint32(v[i]._cached_size_);
+      SerializeInternal(reinterpret_cast<const uint8_t*>(&v[i]), t->field_table,
+                        t->num_fields, output);
+    }
+  }
 }
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc b/3rdparty/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc
deleted file mode 100644 (file)
index 90a5050..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/generated_message_table_driven_lite.h>
-
-#include <google/protobuf/stubs/type_traits.h>
-
-#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
-#include <google/protobuf/metadata_lite.h>
-#include <google/protobuf/repeated_field.h>
-#include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-namespace {
-
-string* MutableUnknownFields(MessageLite* msg, int64 arena_offset) {
-  return Raw<InternalMetadataWithArenaLite>(msg, arena_offset)
-      ->mutable_unknown_fields();
-}
-
-struct UnknownFieldHandlerLite {
-  static bool Skip(MessageLite* msg, const ParseTable& table,
-                   io::CodedInputStream* input,
-                   int tag) {
-    GOOGLE_DCHECK(!table.unknown_field_set);
-    ::google::protobuf::io::StringOutputStream unknown_fields_string(
-        MutableUnknownFields(msg, table.arena_offset));
-    ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
-        &unknown_fields_string, false);
-
-    return ::google::protobuf::internal::WireFormatLite::SkipField(
-        input, tag, &unknown_fields_stream);
-  }
-
-  static void Varint(MessageLite* msg, const ParseTable& table,
-                     int tag, int value) {
-    GOOGLE_DCHECK(!table.unknown_field_set);
-
-    ::google::protobuf::io::StringOutputStream unknown_fields_string(
-        MutableUnknownFields(msg, table.arena_offset));
-    ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
-        &unknown_fields_string, false);
-    unknown_fields_stream.WriteVarint32(tag);
-    unknown_fields_stream.WriteVarint32(value);
-  }
-
-  static bool ParseExtension(
-      MessageLite* msg, const ParseTable& table,
-      io::CodedInputStream* input, int tag) {
-    ExtensionSet* extensions = GetExtensionSet(msg, table.extension_offset);
-    if (extensions == NULL) {
-      return false;
-    }
-
-    const MessageLite* prototype = table.default_instance();
-
-    GOOGLE_DCHECK(!table.unknown_field_set);
-    ::google::protobuf::io::StringOutputStream unknown_fields_string(
-        MutableUnknownFields(msg, table.arena_offset));
-    ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
-        &unknown_fields_string, false);
-    return extensions->ParseField(
-        tag, input, prototype, &unknown_fields_stream);
-  }
-};
-
-}  // namespace
-
-bool MergePartialFromCodedStreamLite(
-    MessageLite* msg, const ParseTable& table, io::CodedInputStream* input) {
-  return MergePartialFromCodedStreamImpl<UnknownFieldHandlerLite,
-                                         InternalMetadataWithArenaLite>(
-      msg, table, input);
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/generated_message_table_driven_lite.h b/3rdparty/protobuf/src/google/protobuf/generated_message_table_driven_lite.h
deleted file mode 100644 (file)
index 20b4da2..0000000
+++ /dev/null
@@ -1,823 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_LITE_H__
-#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_LITE_H__
-
-#include <google/protobuf/generated_message_table_driven.h>
-
-#include <google/protobuf/stubs/type_traits.h>
-
-#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
-#include <google/protobuf/extension_set.h>
-#include <google/protobuf/metadata_lite.h>
-#include <google/protobuf/repeated_field.h>
-#include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-
-enum StringType {
-  StringType_STRING = 0,
-  StringType_CORD = 1,
-  StringType_STRING_PIECE = 2
-};
-
-// Logically a superset of StringType, consisting of all field types that
-// require special initialization.
-enum ProcessingType {
-  ProcessingType_STRING = 0,
-  ProcessingType_CORD = 1,
-  ProcessingType_STRING_PIECE = 2,
-  ProcessingType_MESSAGE = 3
-};
-
-enum Cardinality {
-  Cardinality_SINGULAR = 0,
-  Cardinality_REPEATED = 1,
-  Cardinality_ONEOF = 3
-};
-
-template <typename Type>
-inline Type* Raw(MessageLite* msg, int64 offset) {
-  return reinterpret_cast<Type*>(reinterpret_cast<uint8*>(msg) + offset);
-}
-
-template <typename Type>
-inline const Type* Raw(const MessageLite* msg, int64 offset) {
-  return reinterpret_cast<const Type*>(reinterpret_cast<const uint8*>(msg) +
-                                       offset);
-}
-
-template <typename InternalMetadata>
-inline Arena* GetArena(MessageLite* msg, int64 arena_offset) {
-  if (GOOGLE_PREDICT_FALSE(arena_offset == -1)) {
-    return NULL;
-  }
-
-  return Raw<InternalMetadata>(msg, arena_offset)->arena();
-}
-
-inline ExtensionSet* GetExtensionSet(MessageLite* msg, int64 extension_offset) {
-  if (extension_offset == -1) {
-    return NULL;
-  }
-
-  return Raw<ExtensionSet>(msg, extension_offset);
-}
-
-template <typename Type>
-inline Type* AddField(MessageLite* msg, int64 offset) {
-#if LANG_CXX11
-  static_assert(has_trivial_copy<Type>::value,
-                "Do not assign");
-#endif
-
-  google::protobuf::RepeatedField<Type>* repeated =
-      Raw<google::protobuf::RepeatedField<Type> >(msg, offset);
-  return repeated->Add();
-}
-
-template <>
-inline string* AddField<string>(MessageLite* msg, int64 offset) {
-  google::protobuf::RepeatedPtrField<string>* repeated =
-      Raw<google::protobuf::RepeatedPtrField<string> >(msg, offset);
-  return repeated->Add();
-}
-
-
-template <typename Type>
-inline void AddField(MessageLite* msg, int64 offset, Type value) {
-#if LANG_CXX11
-  static_assert(has_trivial_copy<Type>::value,
-                "Do not assign");
-#endif
-  *AddField<Type>(msg, offset) = value;
-}
-
-inline void SetBit(uint32* has_bits, uint32 has_bit_index) {
-  GOOGLE_DCHECK(has_bits != NULL);
-
-  uint32 mask = static_cast<uint32>(1u) << (has_bit_index % 32);
-  has_bits[has_bit_index / 32u] |= mask;
-}
-
-template <typename Type>
-inline Type* MutableField(MessageLite* msg, uint32* has_bits,
-                          uint32 has_bit_index, int64 offset) {
-  SetBit(has_bits, has_bit_index);
-  return Raw<Type>(msg, offset);
-}
-
-template <typename Type>
-inline void SetField(MessageLite* msg, uint32* has_bits, uint32 has_bit_index,
-                     int64 offset, Type value) {
-#if LANG_CXX11
-  static_assert(has_trivial_copy<Type>::value,
-                "Do not assign");
-#endif
-  *MutableField<Type>(msg, has_bits, has_bit_index, offset) = value;
-}
-
-template <typename Type>
-inline void SetOneofField(MessageLite* msg, uint32* oneof_case,
-                          uint32 oneof_case_index, int64 offset,
-                          int field_number, Type value) {
-  oneof_case[oneof_case_index] = field_number;
-  *Raw<Type>(msg, offset) = value;
-}
-
-// Clears a oneof field. The field argument should correspond to the particular
-// field that is currently set in the oneof.
-inline void ClearOneofField(const ParseTableField& field, Arena* arena,
-                     MessageLite* msg) {
-  switch (field.processing_type & kTypeMask) {
-    case WireFormatLite::TYPE_MESSAGE:
-      if (arena == NULL) {
-        delete *Raw<MessageLite*>(msg, field.offset);
-      }
-      break;
-
-    case WireFormatLite::TYPE_STRING:
-    case WireFormatLite::TYPE_BYTES:
-      Raw<ArenaStringPtr>(msg, field.offset)
-          ->Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena);
-      break;
-
-    default:
-      // No cleanup needed.
-      break;
-  }
-}
-
-// Clears and reinitializes a oneof field as necessary, in preparation for
-// parsing a new value with type field_type and field number field_number.
-//
-// Note: the oneof_case argument should point directly to the _oneof_case_
-// element corresponding to this particular oneof, not to the beginning of the
-// _oneof_case_ array.
-template <ProcessingType field_type>
-inline void ResetOneofField(const ParseTable& table, int field_number,
-                            Arena* arena, MessageLite* msg, uint32* oneof_case,
-                            int64 offset, const void* default_ptr) {
-  if (*oneof_case == field_number) {
-    // The oneof is already set to the right type, so there is no need to clear
-    // it.
-    return;
-  }
-
-  if (*oneof_case != 0) {
-    ClearOneofField(table.fields[*oneof_case], arena, msg);
-  }
-  *oneof_case = field_number;
-
-  switch (field_type) {
-    case ProcessingType_STRING:
-      Raw<ArenaStringPtr>(msg, offset)
-          ->UnsafeSetDefault(static_cast<const string*>(default_ptr));
-      break;
-    case ProcessingType_MESSAGE:
-      MessageLite** submessage = Raw<MessageLite*>(msg, offset);
-      const MessageLite* prototype =
-          table.aux[field_number].messages.default_message();
-      *submessage = prototype->New(arena);
-      break;
-  }
-}
-
-template <Cardinality cardinality, bool validate, StringType ctype>
-static inline bool HandleString(io::CodedInputStream* input, MessageLite* msg,
-                                Arena* arena, uint32* has_bits,
-                                uint32 has_bit_index, int64 offset,
-                                const void* default_ptr,
-                                const char* field_name) {
-#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
-  const char* sdata;
-  size_t size;
-#endif
-
-    string* value;
-    switch (cardinality) {
-      case Cardinality_SINGULAR:
-        // TODO(ckennelly): Is this optimal?
-        value =
-            MutableField<ArenaStringPtr>(msg, has_bits, has_bit_index, offset)
-                ->Mutable(static_cast<const string*>(default_ptr), arena);
-        break;
-      case Cardinality_REPEATED:
-        value = AddField<string>(msg, offset);
-        break;
-      case Cardinality_ONEOF:
-        value = Raw<ArenaStringPtr>(msg, offset)
-                    ->Mutable(static_cast<const string*>(default_ptr), arena);
-        break;
-    }
-    GOOGLE_DCHECK(value != NULL);
-
-    if (GOOGLE_PREDICT_FALSE(!WireFormatLite::ReadString(input, value))) {
-      return false;
-    }
-
-#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
-    sdata = value->data();
-    size = value->size();
-#endif
-
-#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
-  if (validate) {
-    WireFormatLite::VerifyUtf8String(sdata, size, WireFormatLite::PARSE,
-                                     field_name);
-  }
-#endif
-
-  return true;
-}
-
-template <typename UnknownFieldHandler, typename InternalMetadata,
-          Cardinality cardinality>
-inline bool HandleEnum(const ParseTable& table, io::CodedInputStream* input,
-                       MessageLite* msg, uint32* presence,
-                       uint32 presence_index, int64 offset, uint32 tag,
-                       int field_number) {
-  int value;
-  if (GOOGLE_PREDICT_FALSE(
-          (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
-              input, &value)))) {
-    return false;
-  }
-
-  AuxillaryParseTableField::EnumValidator validator =
-      table.aux[field_number].enums.validator;
-  if (validator(value)) {
-    switch (cardinality) {
-      case Cardinality_SINGULAR:
-        SetField(msg, presence, presence_index, offset, value);
-        break;
-      case Cardinality_REPEATED:
-        AddField(msg, offset, value);
-        break;
-      case Cardinality_ONEOF:
-        ClearOneofField(table.fields[presence[presence_index]],
-                        GetArena<InternalMetadata>(msg, table.arena_offset),
-                        msg);
-        SetOneofField(msg, presence, presence_index, offset, field_number,
-                      value);
-        break;
-    }
-  } else {
-    UnknownFieldHandler::Varint(msg, table, tag, value);
-  }
-
-  return true;
-}
-
-// RepeatedMessageTypeHandler allows us to operate on RepeatedPtrField fields
-// without instantiating the specific template.
-class RepeatedMessageTypeHandler {
- public:
-  typedef MessageLite Type;
-  static Arena* GetArena(Type* t) { return t->GetArena(); }
-  static void* GetMaybeArenaPointer(Type* t) {
-    return t->GetMaybeArenaPointer();
-  }
-  static inline Type* NewFromPrototype(const Type* prototype,
-                                       Arena* arena = NULL) {
-    return prototype->New(arena);
-  }
-  static void Delete(Type* t, Arena* arena = NULL) {
-    if (arena == NULL) {
-      delete t;
-    }
-  }
-};
-
-inline bool ReadGroup(int field_number, io::CodedInputStream* input,
-                      MessageLite* value) {
-  if (GOOGLE_PREDICT_FALSE(!input->IncrementRecursionDepth())) {
-    return false;
-  }
-
-  if (GOOGLE_PREDICT_FALSE(!value->MergePartialFromCodedStream(input))) {
-    return false;
-  }
-
-  input->DecrementRecursionDepth();
-  // Make sure the last thing read was an end tag for this group.
-  if (GOOGLE_PREDICT_FALSE(!input->LastTagWas(WireFormatLite::MakeTag(
-          field_number, WireFormatLite::WIRETYPE_END_GROUP)))) {
-    return false;
-  }
-
-  return true;
-}
-
-inline bool ReadMessage(io::CodedInputStream* input, MessageLite* value) {
-  int length;
-  if (GOOGLE_PREDICT_FALSE(!input->ReadVarintSizeAsInt(&length))) {
-    return false;
-  }
-
-  std::pair<io::CodedInputStream::Limit, int> p =
-      input->IncrementRecursionDepthAndPushLimit(length);
-  if (GOOGLE_PREDICT_FALSE(p.second < 0 ||
-                    !value->MergePartialFromCodedStream(input))) {
-    return false;
-  }
-
-  // Make sure that parsing stopped when the limit was hit, not at an endgroup
-  // tag.
-  return input->DecrementRecursionDepthAndPopLimit(p.first);
-}
-
-class MergePartialFromCodedStreamHelper {
- public:
-  static MessageLite* Add(RepeatedPtrFieldBase* field,
-                          const MessageLite* prototype) {
-    return field->Add<RepeatedMessageTypeHandler>(
-        const_cast<MessageLite*>(prototype));
-  }
-};
-
-template <typename UnknownFieldHandler, typename InternalMetadata>
-bool MergePartialFromCodedStreamImpl(MessageLite* msg, const ParseTable& table,
-                                     io::CodedInputStream* input) {
-  // We require that has_bits are present, as to avoid having to check for them
-  // for every field.
-  //
-  // TODO(ckennelly):  Make this a compile-time parameter with templates.
-  GOOGLE_DCHECK_GE(table.has_bits_offset, 0);
-  uint32* has_bits = Raw<uint32>(msg, table.has_bits_offset);
-  GOOGLE_DCHECK(has_bits != NULL);
-
-  while (true) {
-    uint32 tag = input->ReadTag();
-
-    const WireFormatLite::WireType wire_type =
-        WireFormatLite::GetTagWireType(tag);
-    const int field_number = WireFormatLite::GetTagFieldNumber(tag);
-
-    if (field_number > table.max_field_number) {
-      // check for possible extensions
-      if (UnknownFieldHandler::ParseExtension(msg, table, input, tag)) {
-        // successfully parsed
-        continue;
-      }
-
-      if (GOOGLE_PREDICT_FALSE(!UnknownFieldHandler::Skip(msg, table, input, tag))) {
-        return false;
-      }
-
-      continue;
-    }
-
-    // We implicitly verify that data points to a valid field as we check the
-    // wire types.  Entries in table.fields[i] that do not correspond to valid
-    // field numbers have their normal_wiretype and packed_wiretype fields set
-    // with the kInvalidMask value.  As wire_type cannot take on that value, we
-    // will never match.
-    const ParseTableField* data = table.fields + field_number;
-
-    // TODO(ckennelly): Avoid sign extension
-    const int64 presence_index = data->presence_index;
-    const int64 offset = data->offset;
-    const unsigned char processing_type = data->processing_type;
-
-    if (data->normal_wiretype == static_cast<unsigned char>(wire_type)) {
-      // TODO(ckennelly): Use a computed goto on GCC/LLVM or otherwise eliminate
-      // the bounds check on processing_type.
-
-      switch (processing_type) {
-#define HANDLE_TYPE(TYPE, CPPTYPE)                                             \
-  case (WireFormatLite::TYPE_##TYPE): {                                        \
-    CPPTYPE value;                                                             \
-    if (GOOGLE_PREDICT_FALSE(                                                         \
-            (!WireFormatLite::ReadPrimitive<                                   \
-                CPPTYPE, WireFormatLite::TYPE_##TYPE>(input, &value)))) {      \
-      return false;                                                            \
-    }                                                                          \
-    SetField(msg, has_bits, presence_index, offset, value);                    \
-    break;                                                                     \
-  }                                                                            \
-  case (WireFormatLite::TYPE_##TYPE) | kRepeatedMask: {                        \
-    google::protobuf::RepeatedField<CPPTYPE>* values =                                   \
-        Raw<google::protobuf::RepeatedField<CPPTYPE> >(msg, offset);                     \
-    if (GOOGLE_PREDICT_FALSE((!WireFormatLite::ReadRepeatedPrimitive<                 \
-                       CPPTYPE, WireFormatLite::TYPE_##TYPE>(                  \
-            data->tag_size, tag, input, values)))) {                           \
-      return false;                                                            \
-    }                                                                          \
-    break;                                                                     \
-  }                                                                            \
-  case (WireFormatLite::TYPE_##TYPE) | kOneofMask: {                           \
-    uint32* oneof_case = Raw<uint32>(msg, table.oneof_case_offset);            \
-    CPPTYPE value;                                                             \
-    if (GOOGLE_PREDICT_FALSE(                                                         \
-            (!WireFormatLite::ReadPrimitive<                                   \
-                CPPTYPE, WireFormatLite::TYPE_##TYPE>(input, &value)))) {      \
-      return false;                                                            \
-    }                                                                          \
-    ClearOneofField(table.fields[oneof_case[presence_index]],                  \
-                    GetArena<InternalMetadata>(msg, table.arena_offset), msg); \
-    SetOneofField(msg, oneof_case, presence_index, offset, field_number,       \
-                  value);                                                      \
-    break;                                                                     \
-  }
-
-        HANDLE_TYPE(INT32, int32)
-        HANDLE_TYPE(INT64, int64)
-        HANDLE_TYPE(SINT32, int32)
-        HANDLE_TYPE(SINT64, int64)
-        HANDLE_TYPE(UINT32, uint32)
-        HANDLE_TYPE(UINT64, uint64)
-
-        HANDLE_TYPE(FIXED32, uint32)
-        HANDLE_TYPE(FIXED64, uint64)
-        HANDLE_TYPE(SFIXED32, int32)
-        HANDLE_TYPE(SFIXED64, int64)
-
-        HANDLE_TYPE(FLOAT, float)
-        HANDLE_TYPE(DOUBLE, double)
-
-        HANDLE_TYPE(BOOL, bool)
-#undef HANDLE_TYPE
-        case WireFormatLite::TYPE_BYTES:
-#ifndef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
-        case WireFormatLite::TYPE_STRING:
-#endif
-        {
-          Arena* const arena =
-              GetArena<InternalMetadata>(msg, table.arena_offset);
-          const void* default_ptr = table.aux[field_number].strings.default_ptr;
-
-          if (GOOGLE_PREDICT_FALSE((
-                  !HandleString<Cardinality_SINGULAR, false, StringType_STRING>(
-                      input, msg, arena, has_bits, presence_index, offset,
-                      default_ptr, NULL)))) {
-            return false;
-          }
-          break;
-        }
-        case WireFormatLite::TYPE_BYTES | kOneofMask:
-#ifndef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
-        case WireFormatLite::TYPE_STRING | kOneofMask:
-#endif
-        {
-          Arena* const arena =
-              GetArena<InternalMetadata>(msg, table.arena_offset);
-          uint32* oneof_case = Raw<uint32>(msg, table.oneof_case_offset);
-          const void* default_ptr = table.aux[field_number].strings.default_ptr;
-
-          ResetOneofField<ProcessingType_STRING>(
-              table, field_number, arena, msg, oneof_case + presence_index,
-              offset, default_ptr);
-
-          if (GOOGLE_PREDICT_FALSE(
-                  (!HandleString<Cardinality_ONEOF, false, StringType_STRING>(
-                      input, msg, arena, has_bits, presence_index, offset,
-                      default_ptr, NULL)))) {
-            return false;
-          }
-          break;
-        }
-        case (WireFormatLite::TYPE_BYTES) | kRepeatedMask:
-#ifndef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
-        case (WireFormatLite::TYPE_STRING) | kRepeatedMask:
-#endif
-        {
-          Arena* const arena =
-              GetArena<InternalMetadata>(msg, table.arena_offset);
-          const void* default_ptr =
-              table.aux[field_number].strings.default_ptr;
-
-          if (GOOGLE_PREDICT_FALSE((
-                  !HandleString<Cardinality_REPEATED, false, StringType_STRING>(
-                      input, msg, arena, has_bits, presence_index, offset,
-                      default_ptr, NULL)))) {
-            return false;
-          }
-          break;
-        }
-#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
-        case (WireFormatLite::TYPE_STRING): {
-          Arena* const arena =
-              GetArena<InternalMetadata>(msg, table.arena_offset);
-          const void* default_ptr = table.aux[field_number].strings.default_ptr;
-          const char* field_name = table.aux[field_number].strings.field_name;
-
-          if (GOOGLE_PREDICT_FALSE(
-                  (!HandleString<Cardinality_SINGULAR, true, StringType_STRING>(
-                      input, msg, arena, has_bits, presence_index, offset,
-                      default_ptr, field_name)))) {
-            return false;
-          }
-          break;
-        }
-        case (WireFormatLite::TYPE_STRING) | kRepeatedMask: {
-          Arena* const arena =
-              GetArena<InternalMetadata>(msg, table.arena_offset);
-          const void* default_ptr = table.aux[field_number].strings.default_ptr;
-          const char* field_name = table.aux[field_number].strings.field_name;
-
-          if (GOOGLE_PREDICT_FALSE(
-                  (!HandleString<Cardinality_REPEATED, true, StringType_STRING>(
-                      input, msg, arena, has_bits, presence_index, offset,
-                      default_ptr, field_name)))) {
-            return false;
-          }
-          break;
-        }
-        case (WireFormatLite::TYPE_STRING) | kOneofMask: {
-          Arena* const arena =
-              GetArena<InternalMetadata>(msg, table.arena_offset);
-          uint32* oneof_case = Raw<uint32>(msg, table.oneof_case_offset);
-          const void* default_ptr = table.aux[field_number].strings.default_ptr;
-          const char* field_name = table.aux[field_number].strings.field_name;
-
-          ResetOneofField<ProcessingType_STRING>(
-              table, field_number, arena, msg, oneof_case + presence_index,
-              offset, default_ptr);
-
-          if (GOOGLE_PREDICT_FALSE(
-                  (!HandleString<Cardinality_ONEOF, true, StringType_STRING>(
-                      input, msg, arena, has_bits, presence_index, offset,
-                      default_ptr, field_name)))) {
-            return false;
-          }
-          break;
-        }
-#endif
-        case WireFormatLite::TYPE_ENUM: {
-          if (GOOGLE_PREDICT_FALSE((!HandleEnum<UnknownFieldHandler, InternalMetadata,
-                                         Cardinality_SINGULAR>(
-                  table, input, msg, has_bits, presence_index, offset, tag,
-                  field_number)))) {
-            return false;
-          }
-          break;
-        }
-        case WireFormatLite::TYPE_ENUM | kRepeatedMask: {
-          if (GOOGLE_PREDICT_FALSE((!HandleEnum<UnknownFieldHandler, InternalMetadata,
-                                         Cardinality_REPEATED>(
-                  table, input, msg, has_bits, presence_index, offset, tag,
-                  field_number)))) {
-            return false;
-          }
-          break;
-        }
-        case WireFormatLite::TYPE_ENUM | kOneofMask: {
-          uint32* oneof_case = Raw<uint32>(msg, table.oneof_case_offset);
-          if (GOOGLE_PREDICT_FALSE((!HandleEnum<UnknownFieldHandler, InternalMetadata,
-                                         Cardinality_ONEOF>(
-                  table, input, msg, oneof_case, presence_index, offset, tag,
-                  field_number)))) {
-            return false;
-          }
-          break;
-        }
-        case WireFormatLite::TYPE_GROUP: {
-          MessageLite** submsg_holder =
-              MutableField<MessageLite*>(msg, has_bits, presence_index, offset);
-          MessageLite* submsg = *submsg_holder;
-
-          if (submsg == NULL) {
-            Arena* const arena =
-                GetArena<InternalMetadata>(msg, table.arena_offset);
-            const MessageLite* prototype =
-                table.aux[field_number].messages.default_message();
-            submsg = prototype->New(arena);
-            *submsg_holder = submsg;
-          }
-
-          if (GOOGLE_PREDICT_FALSE(!WireFormatLite::ReadGroup(
-              field_number, input, submsg))) {
-            return false;
-          }
-
-          break;
-        }
-        case WireFormatLite::TYPE_GROUP | kRepeatedMask: {
-          RepeatedPtrFieldBase* field = Raw<RepeatedPtrFieldBase>(msg, offset);
-          const MessageLite* prototype =
-              table.aux[field_number].messages.default_message();
-          GOOGLE_DCHECK(prototype != NULL);
-
-          MessageLite* submsg =
-              MergePartialFromCodedStreamHelper::Add(field, prototype);
-
-          if (GOOGLE_PREDICT_FALSE(!WireFormatLite::ReadGroup(
-              field_number, input, submsg))) {
-            return false;
-          }
-
-          break;
-        }
-        case WireFormatLite::TYPE_MESSAGE: {
-          MessageLite** submsg_holder =
-              MutableField<MessageLite*>(msg, has_bits, presence_index, offset);
-          MessageLite* submsg = *submsg_holder;
-
-          if (submsg == NULL) {
-            Arena* const arena =
-                GetArena<InternalMetadata>(msg, table.arena_offset);
-            const MessageLite* prototype =
-                table.aux[field_number].messages.default_message();
-            submsg = prototype->New(arena);
-            *submsg_holder = submsg;
-          }
-
-          if (GOOGLE_PREDICT_FALSE(!WireFormatLite::ReadMessage(input, submsg))) {
-            return false;
-          }
-
-          break;
-        }
-        // TODO(ckennelly):  Adapt ReadMessageNoVirtualNoRecursionDepth and
-        // manage input->IncrementRecursionDepth() here.
-        case WireFormatLite::TYPE_MESSAGE | kRepeatedMask: {
-          RepeatedPtrFieldBase* field = Raw<RepeatedPtrFieldBase>(msg, offset);
-          const MessageLite* prototype =
-              table.aux[field_number].messages.default_message();
-          GOOGLE_DCHECK(prototype != NULL);
-
-          MessageLite* submsg =
-              MergePartialFromCodedStreamHelper::Add(field, prototype);
-
-          if (GOOGLE_PREDICT_FALSE(!WireFormatLite::ReadMessage(input, submsg))) {
-            return false;
-          }
-
-          break;
-        }
-        case WireFormatLite::TYPE_MESSAGE | kOneofMask: {
-          Arena* const arena =
-              GetArena<InternalMetadata>(msg, table.arena_offset);
-          uint32* oneof_case = Raw<uint32>(msg, table.oneof_case_offset);
-          MessageLite** submsg_holder = Raw<MessageLite*>(msg, offset);
-          ResetOneofField<ProcessingType_MESSAGE>(
-              table, field_number, arena, msg, oneof_case + presence_index,
-              offset, NULL);
-          MessageLite* submsg = *submsg_holder;
-
-          if (GOOGLE_PREDICT_FALSE(!WireFormatLite::ReadMessage(input, submsg))) {
-            return false;
-          }
-
-          break;
-        }
-        case TYPE_MAP: {
-          if (GOOGLE_PREDICT_FALSE(!(*table.aux[field_number].maps.parse_map)(
-                  input, Raw<void>(msg, offset)))) {
-            return false;
-          }
-          break;
-        }
-        case 0: {
-          // Done.
-          return true;
-        }
-        default:
-          break;
-      }
-    } else if (data->packed_wiretype == static_cast<unsigned char>(wire_type)) {
-      // Non-packable fields have their packed_wiretype masked with
-      // kNotPackedMask, which is impossible to match here.
-      GOOGLE_DCHECK(processing_type & kRepeatedMask);
-      GOOGLE_DCHECK_NE(processing_type, kRepeatedMask);
-      GOOGLE_DCHECK_EQ(0, processing_type & kOneofMask);
-
-
-
-      // TODO(ckennelly): Use a computed goto on GCC/LLVM.
-      //
-      // Mask out kRepeatedMask bit, allowing the jump table to be smaller.
-      switch (static_cast<WireFormatLite::FieldType>(
-          processing_type ^ kRepeatedMask)) {
-#define HANDLE_PACKED_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD)                 \
-  case WireFormatLite::TYPE_##TYPE: {                                     \
-    google::protobuf::RepeatedField<CPPTYPE>* values =                              \
-        Raw<google::protobuf::RepeatedField<CPPTYPE> >(msg, offset);                \
-    if (GOOGLE_PREDICT_FALSE(                                                    \
-            (!WireFormatLite::ReadPackedPrimitive<                        \
-                CPPTYPE, WireFormatLite::TYPE_##TYPE>(input, values)))) { \
-      return false;                                                       \
-    }                                                                     \
-    break;                                                                \
-  }
-
-        HANDLE_PACKED_TYPE(INT32, int32, Int32)
-        HANDLE_PACKED_TYPE(INT64, int64, Int64)
-        HANDLE_PACKED_TYPE(SINT32, int32, Int32)
-        HANDLE_PACKED_TYPE(SINT64, int64, Int64)
-        HANDLE_PACKED_TYPE(UINT32, uint32, UInt32)
-        HANDLE_PACKED_TYPE(UINT64, uint64, UInt64)
-
-        HANDLE_PACKED_TYPE(FIXED32, uint32, UInt32)
-        HANDLE_PACKED_TYPE(FIXED64, uint64, UInt64)
-        HANDLE_PACKED_TYPE(SFIXED32, int32, Int32)
-        HANDLE_PACKED_TYPE(SFIXED64, int64, Int64)
-
-        HANDLE_PACKED_TYPE(FLOAT, float, Float)
-        HANDLE_PACKED_TYPE(DOUBLE, double, Double)
-
-        HANDLE_PACKED_TYPE(BOOL, bool, Bool)
-#undef HANDLE_PACKED_TYPE
-        case WireFormatLite::TYPE_ENUM: {
-          // To avoid unnecessarily calling MutableUnknownFields (which mutates
-          // InternalMetadataWithArena) when all inputs in the repeated series
-          // are valid, we implement our own parser rather than call
-          // WireFormat::ReadPackedEnumPreserveUnknowns.
-          uint32 length;
-          if (GOOGLE_PREDICT_FALSE(!input->ReadVarint32(&length))) {
-            return false;
-          }
-
-          AuxillaryParseTableField::EnumValidator validator =
-              table.aux[field_number].enums.validator;
-          google::protobuf::RepeatedField<int>* values =
-              Raw<google::protobuf::RepeatedField<int> >(msg, offset);
-
-          io::CodedInputStream::Limit limit = input->PushLimit(length);
-          while (input->BytesUntilLimit() > 0) {
-            int value;
-            if (GOOGLE_PREDICT_FALSE(
-                    (!google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                        int, WireFormatLite::TYPE_ENUM>(input, &value)))) {
-              return false;
-            }
-
-            if (validator(value)) {
-              values->Add(value);
-            } else {
-              // TODO(ckennelly): Consider caching here.
-              UnknownFieldHandler::Varint(msg, table, tag, value);
-            }
-          }
-          input->PopLimit(limit);
-
-          break;
-        }
-        case WireFormatLite::TYPE_STRING:
-        case WireFormatLite::TYPE_GROUP:
-        case WireFormatLite::TYPE_MESSAGE:
-        case WireFormatLite::TYPE_BYTES:
-          GOOGLE_DCHECK(false);
-          return false;
-        default:
-          break;
-      }
-    } else {
-      if (wire_type == WireFormatLite::WIRETYPE_END_GROUP) {
-        // Must be the end of the message.
-        return true;
-      }
-
-      // check for possible extensions
-      if (UnknownFieldHandler::ParseExtension(msg, table, input, tag)) {
-        // successfully parsed
-        continue;
-      }
-
-      // process unknown field.
-      if (GOOGLE_PREDICT_FALSE(!UnknownFieldHandler::Skip(msg, table, input, tag))) {
-        return false;
-      }
-    }
-  }
-}
-
-}  // namespace internal
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_LITE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/generated_message_tctable_decl.h b/3rdparty/protobuf/src/google/protobuf/generated_message_tctable_decl.h
new file mode 100644 (file)
index 0000000..4e5c1ea
--- /dev/null
@@ -0,0 +1,139 @@
+// 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.
+
+// This file contains declarations needed in generated headers for messages
+// that use tail-call table parsing. Everything in this file is for internal
+// use only.
+
+#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_DECL_H__
+#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_DECL_H__
+
+#include <cstdint>
+#include <type_traits>
+
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/message_lite.h>
+
+// Must come last:
+#include <google/protobuf/port_def.inc>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+
+// Additional information about this field:
+struct TcFieldData {
+  constexpr TcFieldData() : data(0) {}
+  constexpr TcFieldData(uint16_t coded_tag, uint8_t hasbit_idx, uint16_t offset)
+      : data(static_cast<uint64_t>(offset) << 48 |
+             static_cast<uint64_t>(hasbit_idx) << 16 | coded_tag) {}
+
+  template <typename TagType = uint16_t>
+  TagType coded_tag() const {
+    return static_cast<TagType>(data);
+  }
+  uint8_t hasbit_idx() const { return static_cast<uint8_t>(data >> 16); }
+  uint16_t offset() const { return static_cast<uint16_t>(data >> 48); }
+
+  uint64_t data;
+};
+
+struct TcParseTableBase;
+
+// TailCallParseFunc is the function pointer type used in the tailcall table.
+typedef const char* (*TailCallParseFunc)(PROTOBUF_TC_PARAM_DECL);
+
+#if defined(_MSC_VER) && !defined(_WIN64)
+#pragma warning(push)
+// TcParseTableBase is intentionally overaligned on 32 bit targets.
+#pragma warning(disable : 4324)
+#endif
+
+// Base class for message-level table with info for the tail-call parser.
+struct alignas(uint64_t) TcParseTableBase {
+  // Common attributes for message layout:
+  uint16_t has_bits_offset;
+  uint16_t extension_offset;
+  uint32_t extension_range_low;
+  uint32_t extension_range_high;
+  uint8_t fast_idx_mask;
+  uint8_t reserved;
+  uint16_t num_fields;
+  const MessageLite* default_instance;
+
+  // Handler for fields which are not handled by table dispatch.
+  TailCallParseFunc fallback;
+
+  // Table entry for fast-path tailcall dispatch handling.
+  struct FastFieldEntry {
+    // Target function for dispatch:
+    TailCallParseFunc target;
+    // Field data used during parse:
+    TcFieldData bits;
+  };
+  // There is always at least one table entry.
+  const FastFieldEntry* fast_entry(size_t idx) const {
+    return reinterpret_cast<const FastFieldEntry*>(this + 1) + idx;
+  }
+};
+
+#if defined(_MSC_VER) && !defined(_WIN64)
+#pragma warning(pop)
+#endif
+
+static_assert(sizeof(TcParseTableBase::FastFieldEntry) <= 16,
+              "Field entry is too big.");
+
+template <size_t kFastTableSizeLog2>
+struct TcParseTable {
+  TcParseTableBase header;
+
+  // Entries for each field.
+  //
+  // Fields are indexed by the lowest bits of their field number. The field
+  // number is masked to fit inside the table. Note that the parsing logic
+  // generally calls `TailCallParseTableBase::table()` instead of accessing
+  // this field directly.
+  TcParseTableBase::FastFieldEntry entries[(1 << kFastTableSizeLog2)];
+};
+
+static_assert(std::is_standard_layout<TcParseTable<1>>::value,
+              "TcParseTable must be standard layout.");
+
+static_assert(offsetof(TcParseTable<1>, entries) == sizeof(TcParseTableBase),
+              "Table entries must be laid out after TcParseTableBase.");
+
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
+#endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_DECL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/generated_message_tctable_impl.h b/3rdparty/protobuf/src/google/protobuf/generated_message_tctable_impl.h
new file mode 100644 (file)
index 0000000..3f2b1ca
--- /dev/null
@@ -0,0 +1,302 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_IMPL_H__
+#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_IMPL_H__
+
+#include <cstdint>
+#include <type_traits>
+
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/generated_message_tctable_decl.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/port.h>
+#include <google/protobuf/wire_format_lite.h>
+
+// Must come last:
+#include <google/protobuf/port_def.inc>
+
+namespace google {
+namespace protobuf {
+
+class Message;
+class UnknownFieldSet;
+
+namespace internal {
+
+// PROTOBUF_TC_PARAM_DECL are the parameters for tailcall functions, it is
+// defined in port_def.inc.
+//
+// Note that this is performance sensitive: changing the parameters will change
+// the registers used by the ABI calling convention, which subsequently affects
+// register selection logic inside the function.
+
+// PROTOBUF_TC_PARAM_PASS passes values to match PROTOBUF_TC_PARAM_DECL.
+#define PROTOBUF_TC_PARAM_PASS msg, ptr, ctx, table, hasbits, data
+
+// PROTOBUF_TC_PARSE_* decide which function is used to parse message-typed
+// fields. The guard macros are defined in port_def.inc.
+#if PROTOBUF_TC_STATIC_PARSE_SINGULAR1
+#define PROTOBUF_TC_PARSE_SINGULAR1(MESSAGE) MESSAGE::Tct_ParseS1
+#else
+#define PROTOBUF_TC_PARSE_SINGULAR1(MESSAGE) \
+  ::google::protobuf::internal::TcParser::SingularParseMessage<MESSAGE, uint8_t>
+#endif  // PROTOBUF_TC_STATIC_PARSE_SINGULAR1
+
+#if PROTOBUF_TC_STATIC_PARSE_SINGULAR2
+#define PROTOBUF_TC_PARSE_SINGULAR2(MESSAGE) MESSAGE::Tct_ParseS2
+#else
+#define PROTOBUF_TC_PARSE_SINGULAR2(MESSAGE) \
+  ::google::protobuf::internal::TcParser::SingularParseMessage<MESSAGE, uint16_t>
+#endif  // PROTOBUF_TC_STATIC_PARSE_SINGULAR2
+
+#if PROTOBUF_TC_STATIC_PARSE_REPEATED1
+#define PROTOBUF_TC_PARSE_REPEATED1(MESSAGE) MESSAGE::Tct_ParseR1
+#else
+#define PROTOBUF_TC_PARSE_REPEATED1(MESSAGE) \
+  ::google::protobuf::internal::TcParser::RepeatedParseMessage<MESSAGE, uint8_t>
+#endif  // PROTOBUF_TC_STATIC_PARSE_REPEATED1
+
+#if PROTOBUF_TC_STATIC_PARSE_REPEATED2
+#define PROTOBUF_TC_PARSE_REPEATED2(MESSAGE) MESSAGE::Tct_ParseR2
+#else
+#define PROTOBUF_TC_PARSE_REPEATED2(MESSAGE) \
+  ::google::protobuf::internal::TcParser::RepeatedParseMessage<MESSAGE, uint16_t>
+#endif  // PROTOBUF_TC_STATIC_PARSE_REPEATED2
+
+#ifndef NDEBUG
+template <size_t align>
+#ifndef _MSC_VER
+[[noreturn]]
+#endif
+void AlignFail(uintptr_t address) {
+  GOOGLE_LOG(FATAL) << "Unaligned (" << align << ") access at " << address;
+}
+
+extern template void AlignFail<4>(uintptr_t);
+extern template void AlignFail<8>(uintptr_t);
+#endif
+
+// TcParser implements most of the parsing logic for tailcall tables.
+class TcParser final {
+ public:
+  static const char* GenericFallback(PROTOBUF_TC_PARAM_DECL);
+  static const char* GenericFallbackLite(PROTOBUF_TC_PARAM_DECL);
+
+  // Dispatch to the designated parse function
+  inline PROTOBUF_ALWAYS_INLINE static const char* TagDispatch(
+      PROTOBUF_TC_PARAM_DECL) {
+    const auto coded_tag = UnalignedLoad<uint16_t>(ptr);
+    const size_t idx = coded_tag & table->fast_idx_mask;
+    PROTOBUF_ASSUME((idx & 7) == 0);
+    auto* fast_entry = table->fast_entry(idx >> 3);
+    data = fast_entry->bits;
+    data.data ^= coded_tag;
+    PROTOBUF_MUSTTAIL return fast_entry->target(PROTOBUF_TC_PARAM_PASS);
+  }
+
+  // We can only safely call from field to next field if the call is optimized
+  // to a proper tail call. Otherwise we blow through stack. Clang and gcc
+  // reliably do this optimization in opt mode, but do not perform this in debug
+  // mode. Luckily the structure of the algorithm is such that it's always
+  // possible to just return and use the enclosing parse loop as a trampoline.
+  static const char* ToTagDispatch(PROTOBUF_TC_PARAM_DECL) {
+    constexpr bool always_return = !PROTOBUF_TAILCALL;
+    if (always_return || !ctx->DataAvailable(ptr)) {
+      PROTOBUF_MUSTTAIL return ToParseLoop(PROTOBUF_TC_PARAM_PASS);
+    }
+    PROTOBUF_MUSTTAIL return TagDispatch(PROTOBUF_TC_PARAM_PASS);
+  }
+
+  static const char* ParseLoop(MessageLite* msg, const char* ptr,
+                               ParseContext* ctx,
+                               const TcParseTableBase* table) {
+    ScopedArenaSwap saved(msg, ctx);
+    const uint32_t has_bits_offset = table->has_bits_offset;
+    while (!ctx->Done(&ptr)) {
+      uint64_t hasbits = 0;
+      if (has_bits_offset) hasbits = RefAt<uint32_t>(msg, has_bits_offset);
+      ptr = TagDispatch(msg, ptr, ctx, table, hasbits, {});
+      if (ptr == nullptr) break;
+      if (ctx->LastTag() != 1) break;  // Ended on terminating tag
+    }
+    return ptr;
+  }
+
+  template <typename FieldType, typename TagType>
+  PROTOBUF_NOINLINE static const char* SingularParseMessage(
+      PROTOBUF_TC_PARAM_DECL) {
+    if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
+      return table->fallback(PROTOBUF_TC_PARAM_PASS);
+    }
+    ptr += sizeof(TagType);
+    hasbits |= (uint64_t{1} << data.hasbit_idx());
+    auto& field = RefAt<FieldType*>(msg, data.offset());
+    if (field == nullptr) {
+      auto arena = ctx->data().arena;
+      if (Arena::is_arena_constructable<FieldType>::value) {
+        field = Arena::CreateMessage<FieldType>(arena);
+      } else {
+        field = Arena::Create<FieldType>(arena);
+      }
+    }
+    SyncHasbits(msg, hasbits, table);
+    return ctx->ParseMessage(field, ptr);
+  }
+
+  template <typename FieldType, typename TagType>
+  PROTOBUF_NOINLINE static const char* RepeatedParseMessage(
+      PROTOBUF_TC_PARAM_DECL) {
+    if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
+      return table->fallback(PROTOBUF_TC_PARAM_PASS);
+    }
+    ptr += sizeof(TagType);
+    auto& field = RefAt<RepeatedPtrField<FieldType>>(msg, data.offset());
+    SyncHasbits(msg, hasbits, table);
+    ptr = ctx->ParseMessage(field.Add(), ptr);
+    return ptr;
+  }
+
+  template <typename LayoutType, typename TagType>
+  static const char* SingularFixed(PROTOBUF_TC_PARAM_DECL);
+  template <typename LayoutType, typename TagType>
+  static const char* RepeatedFixed(PROTOBUF_TC_PARAM_DECL);
+  template <typename LayoutType, typename TagType>
+  static const char* PackedFixed(PROTOBUF_TC_PARAM_DECL);
+
+  enum VarintDecode { kNoConversion = 0, kZigZag = 1 };
+  template <typename FieldType, typename TagType, VarintDecode zigzag>
+  static const char* SingularVarint(PROTOBUF_TC_PARAM_DECL);
+  template <typename FieldType, typename TagType, VarintDecode zigzag>
+  static const char* RepeatedVarint(PROTOBUF_TC_PARAM_DECL);
+  template <typename FieldType, typename TagType, VarintDecode zigzag>
+  static const char* PackedVarint(PROTOBUF_TC_PARAM_DECL);
+
+  enum Utf8Type { kNoUtf8 = 0, kUtf8 = 1, kUtf8ValidateOnly = 2 };
+  template <typename TagType, Utf8Type utf8>
+  static const char* SingularString(PROTOBUF_TC_PARAM_DECL);
+  template <typename TagType, Utf8Type utf8>
+  static const char* RepeatedString(PROTOBUF_TC_PARAM_DECL);
+
+  template <typename T>
+  static inline T& RefAt(void* x, size_t offset) {
+    T* target = reinterpret_cast<T*>(static_cast<char*>(x) + offset);
+#ifndef NDEBUG
+    if (PROTOBUF_PREDICT_FALSE(
+            reinterpret_cast<uintptr_t>(target) % alignof(T) != 0)) {
+      AlignFail<alignof(T)>(reinterpret_cast<uintptr_t>(target));
+    }
+#endif
+    return *target;
+  }
+
+  static inline PROTOBUF_ALWAYS_INLINE void SyncHasbits(
+      MessageLite* msg, uint64_t hasbits, const TcParseTableBase* table) {
+    const uint32_t has_bits_offset = table->has_bits_offset;
+    if (has_bits_offset) {
+      // Only the first 32 has-bits are updated. Nothing above those is stored,
+      // but e.g. messages without has-bits update the upper bits.
+      RefAt<uint32_t>(msg, has_bits_offset) = static_cast<uint32_t>(hasbits);
+    }
+  }
+
+ protected:
+  static inline PROTOBUF_ALWAYS_INLINE const char* ToParseLoop(
+      PROTOBUF_TC_PARAM_DECL) {
+    (void)data;
+    (void)ctx;
+    SyncHasbits(msg, hasbits, table);
+    return ptr;
+  }
+
+  static inline PROTOBUF_ALWAYS_INLINE const char* Error(
+      PROTOBUF_TC_PARAM_DECL) {
+    (void)data;
+    (void)ctx;
+    (void)ptr;
+    SyncHasbits(msg, hasbits, table);
+    return nullptr;
+  }
+
+  class ScopedArenaSwap final {
+   public:
+    ScopedArenaSwap(MessageLite* msg, ParseContext* ctx)
+        : ctx_(ctx), saved_(ctx->data().arena) {
+      ctx_->data().arena = msg->GetArenaForAllocation();
+    }
+    ScopedArenaSwap(const ScopedArenaSwap&) = delete;
+    ~ScopedArenaSwap() { ctx_->data().arena = saved_; }
+
+   private:
+    ParseContext* const ctx_;
+    Arena* const saved_;
+  };
+
+  template <class MessageBaseT, class UnknownFieldsT>
+  static const char* GenericFallbackImpl(PROTOBUF_TC_PARAM_DECL) {
+#define CHK_(x) \
+  if (PROTOBUF_PREDICT_FALSE(!(x))) return nullptr /* NOLINT */
+
+    SyncHasbits(msg, hasbits, table);
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    CHK_(ptr);
+    if ((tag & 7) == WireFormatLite::WIRETYPE_END_GROUP || tag == 0) {
+      ctx->SetLastTag(tag);
+      return ptr;
+    }
+    (void)data;
+    uint32_t num = tag >> 3;
+    if (table->extension_range_low <= num &&
+        num <= table->extension_range_high) {
+      return RefAt<ExtensionSet>(msg, table->extension_offset)
+          .ParseField(tag, ptr,
+                      static_cast<const MessageBaseT*>(table->default_instance),
+                      &msg->_internal_metadata_, ctx);
+    }
+    return UnknownFieldParse(
+        tag, msg->_internal_metadata_.mutable_unknown_fields<UnknownFieldsT>(),
+        ptr, ctx);
+#undef CHK_
+  }
+};
+
+// Declare helper functions:
+#include <google/protobuf/generated_message_tctable_impl.inc>
+
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
+#endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_IMPL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/generated_message_tctable_impl.inc b/3rdparty/protobuf/src/google/protobuf/generated_message_tctable_impl.inc
new file mode 100644 (file)
index 0000000..a6831b5
--- /dev/null
@@ -0,0 +1,92 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// clang-format off
+#ifdef PROTOBUF_TCT_SOURCE
+#define PROTOBUF_TCT_EXTERN
+#else
+#define PROTOBUF_TCT_EXTERN extern
+#endif
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularFixed<uint64_t, uint8_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedFixed<uint64_t, uint8_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedFixed<uint64_t, uint8_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularFixed<uint32_t, uint8_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedFixed<uint32_t, uint8_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedFixed<uint32_t, uint8_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<uint64_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<uint64_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<uint64_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<uint32_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<uint32_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<uint32_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<int64_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<int64_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<int64_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<int32_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<int32_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<int32_t, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<bool, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<bool, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<bool, uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString<uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoUtf8>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString<uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoUtf8>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString<uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kUtf8>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString<uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kUtf8>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString<uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kUtf8ValidateOnly>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString<uint8_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kUtf8ValidateOnly>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularFixed<uint64_t, uint16_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedFixed<uint64_t, uint16_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedFixed<uint64_t, uint16_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularFixed<uint32_t, uint16_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedFixed<uint32_t, uint16_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedFixed<uint32_t, uint16_t>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<uint64_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<uint64_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<uint64_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<uint32_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<uint32_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<uint32_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<int64_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<int64_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<int64_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<int32_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<int32_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<int32_t, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kZigZag>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint<bool, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint<bool, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint<bool, uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoConversion>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString<uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoUtf8>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString<uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kNoUtf8>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString<uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kUtf8>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString<uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kUtf8>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString<uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kUtf8ValidateOnly>(PROTOBUF_TC_PARAM_DECL);
+PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString<uint16_t, ::PROTOBUF_NAMESPACE_ID::internal::TcParser::kUtf8ValidateOnly>(PROTOBUF_TC_PARAM_DECL);
+#undef PROTOBUF_TCT_EXTERN
+// clang-format on
index 15d8422..32a57d3 100644 (file)
 
 #include <google/protobuf/generated_message_util.h>
 
+#include <atomic>
 #include <limits>
 #include <vector>
 
-#include <google/protobuf/io/coded_stream_inl.h>
 #include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/extension_set.h>
+#include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/message_lite.h>
 #include <google/protobuf/metadata_lite.h>
-#include <google/protobuf/stubs/port.h>
 #include <google/protobuf/repeated_field.h>
 #include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/wire_format_lite_inl.h>
 
-namespace google {
+// Must be included last
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
+
 
+namespace google {
 namespace protobuf {
 namespace internal {
 
-
-double Infinity() {
-  return std::numeric_limits<double>::infinity();
+void DestroyMessage(const void* message) {
+  static_cast<const MessageLite*>(message)->~MessageLite();
 }
-double NaN() {
-  return std::numeric_limits<double>::quiet_NaN();
+void DestroyString(const void* s) {
+  static_cast<const std::string*>(s)->~basic_string();
 }
 
-ExplicitlyConstructed< ::std::string> fixed_address_empty_string;
-GOOGLE_PROTOBUF_DECLARE_ONCE(empty_string_once_init_);
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
+    PROTOBUF_ATTRIBUTE_INIT_PRIORITY ExplicitlyConstructed<std::string>
+        fixed_address_empty_string{};  // NOLINT
 
-void DeleteEmptyString() { fixed_address_empty_string.Destruct(); }
 
-void InitEmptyString() {
+PROTOBUF_CONSTINIT std::atomic<bool> init_protobuf_defaults_state{false};
+static bool InitProtobufDefaultsImpl() {
   fixed_address_empty_string.DefaultConstruct();
-  OnShutdown(&DeleteEmptyString);
+  OnShutdownDestroyString(fixed_address_empty_string.get_mutable());
+
+
+  init_protobuf_defaults_state.store(true, std::memory_order_release);
+  return true;
+}
+
+void InitProtobufDefaultsSlow() {
+  static bool is_inited = InitProtobufDefaultsImpl();
+  (void)is_inited;
 }
+// Force the initialization of the empty string.
+// Normally, registration would do it, but we don't have any guarantee that
+// there is any object with reflection.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static std::true_type init_empty_string =
+    (InitProtobufDefaultsSlow(), std::true_type{});
 
-size_t StringSpaceUsedExcludingSelfLong(const string& str) {
+size_t StringSpaceUsedExcludingSelfLong(const std::string& str) {
   const void* start = &str;
   const void* end = &str + 1;
   if (start <= str.data() && str.data() < end) {
@@ -82,12 +101,6 @@ size_t StringSpaceUsedExcludingSelfLong(const string& str) {
   }
 }
 
-
-
-void InitProtobufDefaults() {
-  GetEmptyString();
-}
-
 template <typename T>
 const T& Get(const void* ptr) {
   return *static_cast<const T*>(ptr);
@@ -103,105 +116,96 @@ struct PrimitiveTypeHelper;
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_BOOL> {
   typedef bool Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
     WireFormatLite::WriteBoolNoTag(Get<bool>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteBoolNoTagToArray(Get<Type>(ptr), buffer);
   }
 };
 
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_INT32> {
-  typedef int32 Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-    WireFormatLite::WriteInt32NoTag(Get<int32>(ptr), output);
+  typedef int32_t Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
+    WireFormatLite::WriteInt32NoTag(Get<int32_t>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteInt32NoTagToArray(Get<Type>(ptr), buffer);
   }
 };
 
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_SINT32> {
-  typedef int32 Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-    WireFormatLite::WriteSInt32NoTag(Get<int32>(ptr), output);
+  typedef int32_t Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
+    WireFormatLite::WriteSInt32NoTag(Get<int32_t>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteSInt32NoTagToArray(Get<Type>(ptr), buffer);
   }
 };
 
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_UINT32> {
-  typedef uint32 Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-    WireFormatLite::WriteUInt32NoTag(Get<uint32>(ptr), output);
+  typedef uint32_t Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
+    WireFormatLite::WriteUInt32NoTag(Get<uint32_t>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteUInt32NoTagToArray(Get<Type>(ptr), buffer);
   }
 };
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_INT64> {
-  typedef int64 Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-    WireFormatLite::WriteInt64NoTag(Get<int64>(ptr), output);
+  typedef int64_t Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
+    WireFormatLite::WriteInt64NoTag(Get<int64_t>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteInt64NoTagToArray(Get<Type>(ptr), buffer);
   }
 };
 
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_SINT64> {
-  typedef int64 Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-    WireFormatLite::WriteSInt64NoTag(Get<int64>(ptr), output);
+  typedef int64_t Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
+    WireFormatLite::WriteSInt64NoTag(Get<int64_t>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteSInt64NoTagToArray(Get<Type>(ptr), buffer);
   }
 };
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_UINT64> {
-  typedef uint64 Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-    WireFormatLite::WriteUInt64NoTag(Get<uint64>(ptr), output);
+  typedef uint64_t Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
+    WireFormatLite::WriteUInt64NoTag(Get<uint64_t>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteUInt64NoTagToArray(Get<Type>(ptr), buffer);
   }
 };
 
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED32> {
-  typedef uint32 Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-    WireFormatLite::WriteFixed32NoTag(Get<uint32>(ptr), output);
+  typedef uint32_t Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
+    WireFormatLite::WriteFixed32NoTag(Get<uint32_t>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteFixed32NoTagToArray(Get<Type>(ptr), buffer);
   }
 };
 
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED64> {
-  typedef uint64 Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-    WireFormatLite::WriteFixed64NoTag(Get<uint64>(ptr), output);
+  typedef uint64_t Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
+    WireFormatLite::WriteFixed64NoTag(Get<uint64_t>(ptr), output);
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     return WireFormatLite::WriteFixed64NoTagToArray(Get<Type>(ptr), buffer);
   }
 };
@@ -213,12 +217,12 @@ struct PrimitiveTypeHelper<WireFormatLite::TYPE_ENUM>
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_SFIXED32>
     : PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED32> {
-  typedef int32 Type;
+  typedef int32_t Type;
 };
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_SFIXED64>
     : PrimitiveTypeHelper<WireFormatLite::TYPE_FIXED64> {
-  typedef int64 Type;
+  typedef int64_t Type;
 };
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_FLOAT>
@@ -233,14 +237,13 @@ struct PrimitiveTypeHelper<WireFormatLite::TYPE_DOUBLE>
 
 template <>
 struct PrimitiveTypeHelper<WireFormatLite::TYPE_STRING> {
-  typedef string Type;
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
+  typedef std::string Type;
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
     const Type& value = *static_cast<const Type*>(ptr);
     output->WriteVarint32(value.size());
     output->WriteRawMaybeAliased(value.data(), value.size());
   }
-  static uint8* SerializeToArray(const void* ptr, uint8* buffer) {
+  static uint8_t* SerializeToArray(const void* ptr, uint8_t* buffer) {
     const Type& value = *static_cast<const Type*>(ptr);
     return io::CodedOutputStream::WriteStringWithSizeToArray(value, buffer);
   }
@@ -251,6 +254,10 @@ struct PrimitiveTypeHelper<WireFormatLite::TYPE_BYTES>
     : PrimitiveTypeHelper<WireFormatLite::TYPE_STRING> {};
 
 
+template <>
+struct PrimitiveTypeHelper<FieldMetadata::kInlinedType>
+    : PrimitiveTypeHelper<WireFormatLite::TYPE_STRING> {};
+
 // We want to serialize to both CodedOutputStream and directly into byte arrays
 // without duplicating the code. In fact we might want extra output channels in
 // the future.
@@ -263,27 +270,26 @@ void SerializeTo(const void* ptr, O* output) {
 }
 
 template <typename O>
-void WriteTagTo(uint32 tag, O* output) {
+void WriteTagTo(uint32_t tag, O* output) {
   SerializeTo<WireFormatLite::TYPE_UINT32>(&tag, output);
 }
 
 template <typename O>
-void WriteLengthTo(uint32 length, O* output) {
+void WriteLengthTo(uint32_t length, O* output) {
   SerializeTo<WireFormatLite::TYPE_UINT32>(&length, output);
 }
 
 // Specialization for coded output stream
 template <int type>
-struct OutputHelper< ::google::protobuf::io::CodedOutputStream, type> {
-  static void Serialize(const void* ptr,
-                        ::google::protobuf::io::CodedOutputStream* output) {
+struct OutputHelper<io::CodedOutputStream, type> {
+  static void Serialize(const void* ptr, io::CodedOutputStream* output) {
     PrimitiveTypeHelper<type>::Serialize(ptr, output);
   }
 };
 
 // Specialization for writing into a plain array
 struct ArrayOutput {
-  uint8* ptr;
+  uint8_t* ptr;
   bool is_deterministic;
 };
 
@@ -295,38 +301,32 @@ struct OutputHelper<ArrayOutput, type> {
 };
 
 void SerializeMessageNoTable(const MessageLite* msg,
-                             ::google::protobuf::io::CodedOutputStream* output) {
+                             io::CodedOutputStream* output) {
   msg->SerializeWithCachedSizes(output);
 }
 
 void SerializeMessageNoTable(const MessageLite* msg, ArrayOutput* output) {
-  output->ptr = msg->InternalSerializeWithCachedSizesToArray(
-      output->is_deterministic, output->ptr);
+  io::ArrayOutputStream array_stream(output->ptr, INT_MAX);
+  io::CodedOutputStream o(&array_stream);
+  o.SetSerializationDeterministic(output->is_deterministic);
+  msg->SerializeWithCachedSizes(&o);
+  output->ptr += o.ByteCount();
 }
 
 // Helper to branch to fast path if possible
-void SerializeMessageDispatch(const ::google::protobuf::MessageLite& msg,
+void SerializeMessageDispatch(const MessageLite& msg,
                               const FieldMetadata* field_table, int num_fields,
-                              int32 cached_size,
-                              ::google::protobuf::io::CodedOutputStream* output) {
-  const uint8* base = reinterpret_cast<const uint8*>(&msg);
-  // Try the fast path
-  uint8* ptr = output->GetDirectBufferForNBytesAndAdvance(cached_size);
-  if (ptr) {
-    // We use virtual dispatch to enable dedicated generated code for the
-    // fast path.
-    msg.InternalSerializeWithCachedSizesToArray(
-        output->IsSerializationDeterministic(), ptr);
-    return;
-  }
+                              int32_t /*cached_size*/,
+                              io::CodedOutputStream* output) {
+  const uint8_t* base = reinterpret_cast<const uint8_t*>(&msg);
   SerializeInternal(base, field_table, num_fields, output);
 }
 
 // Helper to branch to fast path if possible
-void SerializeMessageDispatch(const ::google::protobuf::MessageLite& msg,
+void SerializeMessageDispatch(const MessageLite& msg,
                               const FieldMetadata* field_table, int num_fields,
-                              int32 cached_size, ArrayOutput* output) {
-  const uint8* base = reinterpret_cast<const uint8*>(&msg);
+                              int32_t /*cached_size*/, ArrayOutput* output) {
+  const uint8_t* base = reinterpret_cast<const uint8_t*>(&msg);
   output->ptr = SerializeInternalToArray(base, field_table, num_fields,
                                          output->is_deterministic, output->ptr);
 }
@@ -345,8 +345,9 @@ void SerializeMessageTo(const MessageLite* msg, const void* table_ptr,
     return;
   }
   const FieldMetadata* field_table = table->field_table;
-  const uint8* base = reinterpret_cast<const uint8*>(msg);
-  int cached_size = *reinterpret_cast<const int32*>(base + field_table->offset);
+  const uint8_t* base = reinterpret_cast<const uint8_t*>(msg);
+  int cached_size =
+      *reinterpret_cast<const int32_t*>(base + field_table->offset);
   WriteLengthTo(cached_size, output);
   int num_fields = table->num_fields - 1;
   SerializeMessageDispatch(*msg, field_table + 1, num_fields, cached_size,
@@ -365,8 +366,9 @@ void SerializeGroupTo(const MessageLite* msg, const void* table_ptr,
     return;
   }
   const FieldMetadata* field_table = table->field_table;
-  const uint8* base = reinterpret_cast<const uint8*>(msg);
-  int cached_size = *reinterpret_cast<const int32*>(base + field_table->offset);
+  const uint8_t* base = reinterpret_cast<const uint8_t*>(msg);
+  int cached_size =
+      *reinterpret_cast<const int32_t*>(base + field_table->offset);
   int num_fields = table->num_fields - 1;
   SerializeMessageDispatch(*msg, field_table + 1, num_fields, cached_size,
                            output);
@@ -416,6 +418,15 @@ struct SingularFieldHelper<WireFormatLite::TYPE_MESSAGE> {
   }
 };
 
+template <>
+struct SingularFieldHelper<FieldMetadata::kInlinedType> {
+  template <typename O>
+  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
+    WriteTagTo(md.tag, output);
+    SerializeTo<FieldMetadata::kInlinedType>(&Get<std::string>(field), output);
+  }
+};
+
 template <int type>
 struct RepeatedFieldHelper {
   template <typename O>
@@ -481,13 +492,17 @@ struct RepeatedFieldHelper<WireFormatLite::TYPE_MESSAGE> {
     for (int i = 0; i < AccessorHelper::Size(array); i++) {
       WriteTagTo(md.tag, output);
       SerializeMessageTo(
-          static_cast<const MessageLite*>(AccessorHelper::Get(array, i)), md.ptr,
-          output);
+          static_cast<const MessageLite*>(AccessorHelper::Get(array, i)),
+          md.ptr, output);
     }
   }
 };
 
 
+template <>
+struct RepeatedFieldHelper<FieldMetadata::kInlinedType>
+    : RepeatedFieldHelper<WireFormatLite::TYPE_STRING> {};
+
 template <int type>
 struct PackedFieldHelper {
   template <typename O>
@@ -497,7 +512,7 @@ struct PackedFieldHelper {
     if (array.empty()) return;
     WriteTagTo(md.tag, output);
     int cached_size =
-        Get<int>(static_cast<const uint8*>(field) + sizeof(RepeatedField<T>));
+        Get<int>(static_cast<const uint8_t*>(field) + sizeof(RepeatedField<T>));
     WriteLengthTo(cached_size, output);
     for (int i = 0; i < array.size(); i++) {
       SerializeTo<type>(&array[i], output);
@@ -508,7 +523,8 @@ struct PackedFieldHelper {
 template <>
 struct PackedFieldHelper<WireFormatLite::TYPE_STRING> {
   template <typename O>
-  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
+  static void Serialize(const void* /*field*/, const FieldMetadata& md,
+                        O* /*output*/) {
     GOOGLE_LOG(FATAL) << "Not implemented field number " << md.tag << " with type "
                << md.type;
   }
@@ -523,6 +539,9 @@ struct PackedFieldHelper<WireFormatLite::TYPE_GROUP>
 template <>
 struct PackedFieldHelper<WireFormatLite::TYPE_MESSAGE>
     : PackedFieldHelper<WireFormatLite::TYPE_STRING> {};
+template <>
+struct PackedFieldHelper<FieldMetadata::kInlinedType>
+    : PackedFieldHelper<WireFormatLite::TYPE_STRING> {};
 
 template <int type>
 struct OneOfFieldHelper {
@@ -533,6 +552,15 @@ struct OneOfFieldHelper {
 };
 
 
+template <>
+struct OneOfFieldHelper<FieldMetadata::kInlinedType> {
+  template <typename O>
+  static void Serialize(const void* field, const FieldMetadata& md, O* output) {
+    SingularFieldHelper<FieldMetadata::kInlinedType>::Serialize(
+        Get<const std::string*>(field), md, output);
+  }
+};
+
 void SerializeNotImplemented(int field) {
   GOOGLE_LOG(FATAL) << "Not implemented field number " << field;
 }
@@ -564,15 +592,20 @@ bool IsNull<WireFormatLite::TYPE_BYTES>(const void* ptr) {
 
 template <>
 bool IsNull<WireFormatLite::TYPE_GROUP>(const void* ptr) {
-  return Get<const MessageLite*>(ptr) == NULL;
+  return Get<const MessageLite*>(ptr) == nullptr;
 }
 
 template <>
 bool IsNull<WireFormatLite::TYPE_MESSAGE>(const void* ptr) {
-  return Get<const MessageLite*>(ptr) == NULL;
+  return Get<const MessageLite*>(ptr) == nullptr;
 }
 
 
+template <>
+bool IsNull<FieldMetadata::kInlinedType>(const void* ptr) {
+  return static_cast<const std::string*>(ptr)->empty();
+}
+
 #define SERIALIZERS_FOR_TYPE(type)                                            \
   case SERIALIZE_TABLE_OP(type, FieldMetadata::kPresence):                    \
     if (!IsPresent(base, field_metadata.has_offset)) continue;                \
@@ -594,13 +627,13 @@ bool IsNull<WireFormatLite::TYPE_MESSAGE>(const void* ptr) {
     OneOfFieldHelper<type>::Serialize(ptr, field_metadata, output);           \
     break
 
-void SerializeInternal(const uint8* base,
+void SerializeInternal(const uint8_t* base,
                        const FieldMetadata* field_metadata_table,
-                       int32 num_fields,
-                       ::google::protobuf::io::CodedOutputStream* output) {
+                       int32_t num_fields, io::CodedOutputStream* output) {
+  SpecialSerializer func = nullptr;
   for (int i = 0; i < num_fields; i++) {
     const FieldMetadata& field_metadata = field_metadata_table[i];
-    const uint8* ptr = base + field_metadata.offset;
+    const uint8_t* ptr = base + field_metadata.offset;
     switch (field_metadata.type) {
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_DOUBLE);
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_FLOAT);
@@ -620,13 +653,14 @@ void SerializeInternal(const uint8* base,
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_SFIXED64);
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_SINT32);
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_SINT64);
+      SERIALIZERS_FOR_TYPE(FieldMetadata::kInlinedType);
 
       // Special cases
       case FieldMetadata::kSpecial:
-        reinterpret_cast<SpecialSerializer>(
-            const_cast<void*>(field_metadata.ptr))(
-            base, field_metadata.offset, field_metadata.tag,
-            field_metadata.has_offset, output);
+        func = reinterpret_cast<SpecialSerializer>(
+            const_cast<void*>(field_metadata.ptr));
+        func(base, field_metadata.offset, field_metadata.tag,
+             field_metadata.has_offset, output);
         break;
       default:
         // __builtin_unreachable()
@@ -635,15 +669,16 @@ void SerializeInternal(const uint8* base,
   }
 }
 
-uint8* SerializeInternalToArray(const uint8* base,
-                                const FieldMetadata* field_metadata_table,
-                                int32 num_fields, bool is_deterministic,
-                                uint8* buffer) {
+uint8_t* SerializeInternalToArray(const uint8_t* base,
+                                  const FieldMetadata* field_metadata_table,
+                                  int32_t num_fields, bool is_deterministic,
+                                  uint8_t* buffer) {
   ArrayOutput array_output = {buffer, is_deterministic};
   ArrayOutput* output = &array_output;
+  SpecialSerializer func = nullptr;
   for (int i = 0; i < num_fields; i++) {
     const FieldMetadata& field_metadata = field_metadata_table[i];
-    const uint8* ptr = base + field_metadata.offset;
+    const uint8_t* ptr = base + field_metadata.offset;
     switch (field_metadata.type) {
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_DOUBLE);
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_FLOAT);
@@ -663,16 +698,17 @@ uint8* SerializeInternalToArray(const uint8* base,
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_SFIXED64);
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_SINT32);
       SERIALIZERS_FOR_TYPE(WireFormatLite::TYPE_SINT64);
+      SERIALIZERS_FOR_TYPE(FieldMetadata::kInlinedType);
       // Special cases
       case FieldMetadata::kSpecial: {
         io::ArrayOutputStream array_stream(array_output.ptr, INT_MAX);
-        io::CodedOutputStream output(&array_stream);
-        output.SetSerializationDeterministic(is_deterministic);
-        reinterpret_cast<SpecialSerializer>(
-            const_cast<void*>(field_metadata.ptr))(
-            base, field_metadata.offset, field_metadata.tag,
-            field_metadata.has_offset, &output);
-        array_output.ptr += output.ByteCount();
+        io::CodedOutputStream output_stream(&array_stream);
+        output_stream.SetSerializationDeterministic(is_deterministic);
+        func = reinterpret_cast<SpecialSerializer>(
+            const_cast<void*>(field_metadata.ptr));
+        func(base, field_metadata.offset, field_metadata.tag,
+             field_metadata.has_offset, &output_stream);
+        array_output.ptr += output_stream.ByteCount();
       } break;
       default:
         // __builtin_unreachable()
@@ -683,39 +719,50 @@ uint8* SerializeInternalToArray(const uint8* base,
 }
 #undef SERIALIZERS_FOR_TYPE
 
-void ExtensionSerializer(const uint8* ptr, uint32 offset, uint32 tag,
-                         uint32 has_offset,
-                         ::google::protobuf::io::CodedOutputStream* output) {
+void ExtensionSerializer(const MessageLite* extendee, const uint8_t* ptr,
+                         uint32_t offset, uint32_t tag, uint32_t has_offset,
+                         io::CodedOutputStream* output) {
   reinterpret_cast<const ExtensionSet*>(ptr + offset)
-      ->SerializeWithCachedSizes(tag, has_offset, output);
+      ->SerializeWithCachedSizes(extendee, tag, has_offset, output);
 }
 
-void UnknownFieldSerializerLite(const uint8* ptr, uint32 offset, uint32 tag,
-                                uint32 has_offset,
-                                ::google::protobuf::io::CodedOutputStream* output) {
+void UnknownFieldSerializerLite(const uint8_t* ptr, uint32_t offset,
+                                uint32_t /*tag*/, uint32_t /*has_offset*/,
+                                io::CodedOutputStream* output) {
   output->WriteString(
-      reinterpret_cast<const InternalMetadataWithArenaLite*>(ptr + offset)
-          ->unknown_fields());
+      reinterpret_cast<const InternalMetadata*>(ptr + offset)
+          ->unknown_fields<std::string>(&internal::GetEmptyString));
 }
 
-MessageLite* DuplicateIfNonNullInternal(MessageLite* message, Arena* arena) {
+MessageLite* DuplicateIfNonNullInternal(MessageLite* message) {
   if (message) {
-    MessageLite* ret = message->New(arena);
+    MessageLite* ret = message->New();
     ret->CheckTypeAndMergeFrom(*message);
     return ret;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
 
+void GenericSwap(MessageLite* m1, MessageLite* m2) {
+  std::unique_ptr<MessageLite> tmp(m1->New());
+  tmp->CheckTypeAndMergeFrom(*m1);
+  m1->Clear();
+  m1->CheckTypeAndMergeFrom(*m2);
+  m2->Clear();
+  m2->CheckTypeAndMergeFrom(*tmp);
+}
+
 // Returns a message owned by this Arena.  This may require Own()ing or
 // duplicating the message.
 MessageLite* GetOwnedMessageInternal(Arena* message_arena,
                                      MessageLite* submessage,
                                      Arena* submessage_arena) {
-  GOOGLE_DCHECK(submessage->GetArena() == submessage_arena);
+  GOOGLE_DCHECK(Arena::InternalHelper<MessageLite>::GetOwningArena(submessage) ==
+         submessage_arena);
   GOOGLE_DCHECK(message_arena != submessage_arena);
-  if (message_arena != NULL && submessage_arena == NULL) {
+  GOOGLE_DCHECK_EQ(submessage_arena, nullptr);
+  if (message_arena != nullptr && submessage_arena == nullptr) {
     message_arena->Own(submessage);
     return submessage;
   } else {
@@ -728,3 +775,5 @@ MessageLite* GetOwnedMessageInternal(Arena* message_arena,
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 8ebfc13..336234c 100644 (file)
 #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__
 
 #include <assert.h>
+
+#include <atomic>
 #include <climits>
 #include <string>
 #include <vector>
 
-#include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/any.h>
 #include <google/protobuf/has_bits.h>
-#include <google/protobuf/map_entry_lite.h>
+#include <google/protobuf/implicit_weak_message.h>
 #include <google/protobuf/message_lite.h>
+#include <google/protobuf/stubs/once.h>  // Add direct dep on port for pb.cc
+#include <google/protobuf/port.h>
+#include <google/protobuf/repeated_field.h>
 #include <google/protobuf/wire_format_lite.h>
+#include <google/protobuf/stubs/strutil.h>
+#include <google/protobuf/stubs/casts.h>
 
-namespace google {
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
+namespace google {
 namespace protobuf {
 
 class Arena;
+class Message;
 
-namespace io { class CodedInputStream; }
+namespace io {
+class CodedInputStream;
+}
 
 namespace internal {
 
-
-// Annotation for the compiler to emit a deprecation message if a field marked
-// with option 'deprecated=true' is used in the code, or for other things in
-// generated code which are deprecated.
-//
-// For internal use in the pb.cc files, deprecation warnings are suppressed
-// there.
-#undef DEPRECATED_PROTOBUF_FIELD
-#define PROTOBUF_DEPRECATED
-
-#define GOOGLE_PROTOBUF_DEPRECATED_ATTR
+template <typename To, typename From>
+inline To DownCast(From* f) {
+  return PROTOBUF_NAMESPACE_ID::internal::down_cast<To>(f);
+}
+template <typename To, typename From>
+inline To DownCast(From& f) {
+  return PROTOBUF_NAMESPACE_ID::internal::down_cast<To>(f);
+}
 
 
-// Returns the offset of the given field within the given aggregate type.
-// This is equivalent to the ANSI C offsetof() macro.  However, according
-// to the C++ standard, offsetof() only works on POD types, and GCC
-// enforces this requirement with a warning.  In practice, this rule is
-// unnecessarily strict; there is probably no compiler or platform on
-// which the offsets of the direct fields of a class are non-constant.
-// Fields inherited from superclasses *can* have non-constant offsets,
-// but that's not what this macro will be used for.
-#if defined(__clang__)
-// For Clang we use __builtin_offsetof() and suppress the warning,
-// to avoid Control Flow Integrity and UBSan vptr sanitizers from
-// crashing while trying to validate the invalid reinterpet_casts.
-#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD)  \
-  _Pragma("clang diagnostic push")                                   \
-  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"")         \
-  __builtin_offsetof(TYPE, FIELD)                                    \
-  _Pragma("clang diagnostic pop")
-#else
-// Note that we calculate relative to the pointer value 16 here since if we
-// just use zero, GCC complains about dereferencing a NULL pointer.  We
-// choose 16 rather than some other number just in case the compiler would
-// be confused by an unaligned pointer.
-#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD)  \
-  static_cast< ::google::protobuf::uint32>(                           \
-      reinterpret_cast<const char*>(                                 \
-          &reinterpret_cast<const TYPE*>(16)->FIELD) -               \
-      reinterpret_cast<const char*>(16))
-#endif
+// This fastpath inlines a single branch instead of having to make the
+// InitProtobufDefaults function call.
+// It also generates less inlined code than a function-scope static initializer.
+PROTOBUF_EXPORT extern std::atomic<bool> init_protobuf_defaults_state;
+PROTOBUF_EXPORT void InitProtobufDefaultsSlow();
+PROTOBUF_EXPORT inline void InitProtobufDefaults() {
+  if (PROTOBUF_PREDICT_FALSE(
+          !init_protobuf_defaults_state.load(std::memory_order_acquire))) {
+    InitProtobufDefaultsSlow();
+  }
+}
 
-// Constants for special floating point values.
-LIBPROTOBUF_EXPORT double Infinity();
-LIBPROTOBUF_EXPORT double NaN();
+// This used by proto1
+PROTOBUF_EXPORT inline const std::string& GetEmptyString() {
+  InitProtobufDefaults();
+  return GetEmptyStringAlreadyInited();
+}
 
 
 // True if IsInitialized() is true for all elements of t.  Type is expected
@@ -113,178 +109,67 @@ LIBPROTOBUF_EXPORT double NaN();
 // helper here to keep the protobuf compiler from ever having to emit loops in
 // IsInitialized() methods.  We want the C++ compiler to inline this or not
 // as it sees fit.
-template <class Type> bool AllAreInitialized(const Type& t) {
-  for (int i = t.size(); --i >= 0; ) {
+template <typename Msg>
+bool AllAreInitialized(const RepeatedPtrField<Msg>& t) {
+  for (int i = t.size(); --i >= 0;) {
     if (!t.Get(i).IsInitialized()) return false;
   }
   return true;
 }
 
-LIBPROTOBUF_EXPORT void InitProtobufDefaults();
-
-struct LIBPROTOBUF_EXPORT FieldMetadata {
-  uint32 offset;  // offset of this field in the struct
-  uint32 tag;     // field * 8 + wire_type
-  // byte offset * 8 + bit_offset;
-  // if the high bit is set then this is the byte offset of the oneof_case
-  // for this field.
-  uint32 has_offset;
-  uint32 type;      // the type of this field.
-  const void* ptr;  // auxiliary data
-
-  // From the serializer point of view each fundamental type can occur in
-  // 4 different ways. For simplicity we treat all combinations as a cartesion
-  // product although not all combinations are allowed.
-  enum FieldTypeClass {
-    kPresence,
-    kNoPresence,
-    kRepeated,
-    kPacked,
-    kOneOf,
-    kNumTypeClasses  // must be last enum
-  };
-  // C++ protobuf has 20 fundamental types, were we added Cord and StringPiece
-  // and also distinquish the same types if they have different wire format.
-  enum {
-    kCordType = 19,
-    kStringPieceType = 20,
-    kNumTypes = 20,
-    kSpecial = kNumTypes * kNumTypeClasses,
-  };
-
-  static int CalculateType(int fundamental_type, FieldTypeClass type_class);
-};
-
-inline bool IsPresent(const void* base, uint32 hasbit) {
-  const uint32* has_bits_array = static_cast<const uint32*>(base);
-  return has_bits_array[hasbit / 32] & (1u << (hasbit & 31));
-}
-
-inline bool IsOneofPresent(const void* base, uint32 offset, uint32 tag) {
-  const uint32* oneof =
-      reinterpret_cast<const uint32*>(static_cast<const uint8*>(base) + offset);
-  return *oneof == tag >> 3;
-}
-
-typedef void (*SpecialSerializer)(const uint8* base, uint32 offset, uint32 tag,
-                                  uint32 has_offset,
-                                  ::google::protobuf::io::CodedOutputStream* output);
-
-LIBPROTOBUF_EXPORT void ExtensionSerializer(const uint8* base, uint32 offset, uint32 tag,
-                         uint32 has_offset,
-                         ::google::protobuf::io::CodedOutputStream* output);
-LIBPROTOBUF_EXPORT void UnknownFieldSerializerLite(const uint8* base, uint32 offset, uint32 tag,
-                                uint32 has_offset,
-                                ::google::protobuf::io::CodedOutputStream* output);
-
-struct SerializationTable {
-  int num_fields;
-  const FieldMetadata* field_table;
-};
-
-LIBPROTOBUF_EXPORT void SerializeInternal(const uint8* base, const FieldMetadata* table,
-                       int num_fields, ::google::protobuf::io::CodedOutputStream* output);
-
-inline void TableSerialize(const ::google::protobuf::MessageLite& msg,
-                           const SerializationTable* table,
-                           ::google::protobuf::io::CodedOutputStream* output) {
-  const FieldMetadata* field_table = table->field_table;
-  int num_fields = table->num_fields - 1;
-  const uint8* base = reinterpret_cast<const uint8*>(&msg);
-  // TODO(gerbens) This skips the first test if we could use the fast
-  // array serialization path, we should make this
-  // int cached_size =
-  //    *reinterpret_cast<const int32*>(base + field_table->offset);
-  // SerializeWithCachedSize(msg, field_table + 1, num_fields, cached_size, ...)
-  // But we keep conformance with the old way for now.
-  SerializeInternal(base, field_table + 1, num_fields, output);
+// "Weak" variant of AllAreInitialized, used to implement implicit weak fields.
+// This version operates on MessageLite to avoid introducing a dependency on the
+// concrete message type.
+template <class T>
+bool AllAreInitializedWeak(const RepeatedPtrField<T>& t) {
+  for (int i = t.size(); --i >= 0;) {
+    if (!reinterpret_cast<const RepeatedPtrFieldBase&>(t)
+             .Get<ImplicitWeakTypeHandler<T> >(i)
+             .IsInitialized()) {
+      return false;
+    }
+  }
+  return true;
 }
 
-uint8* SerializeInternalToArray(const uint8* base, const FieldMetadata* table,
-                                int num_fields, bool is_deterministic,
-                                uint8* buffer);
-
-inline uint8* TableSerializeToArray(const ::google::protobuf::MessageLite& msg,
-                                    const SerializationTable* table,
-                                    bool is_deterministic, uint8* buffer) {
-  const uint8* base = reinterpret_cast<const uint8*>(&msg);
-  const FieldMetadata* field_table = table->field_table + 1;
-  int num_fields = table->num_fields - 1;
-  return SerializeInternalToArray(base, field_table, num_fields,
-                                  is_deterministic, buffer);
+inline bool IsPresent(const void* base, uint32_t hasbit) {
+  const uint32_t* has_bits_array = static_cast<const uint32_t*>(base);
+  return (has_bits_array[hasbit / 32] & (1u << (hasbit & 31))) != 0;
 }
 
-template <typename T>
-struct CompareHelper {
-  bool operator()(const T& a, const T& b) { return a < b; }
-};
-
-template <>
-struct CompareHelper<ArenaStringPtr> {
-  bool operator()(const ArenaStringPtr& a, const ArenaStringPtr& b) {
-    return a.Get() < b.Get();
-  }
-};
-
-struct CompareMapKey {
-  template <typename T>
-  bool operator()(const MapEntryHelper<T>& a, const MapEntryHelper<T>& b) {
-    return Compare(a.key_, b.key_);
-  }
-  template <typename T>
-  bool Compare(const T& a, const T& b) {
-    return CompareHelper<T>()(a, b);
-  }
-};
-
-template <typename MapFieldType, const SerializationTable* table>
-void MapFieldSerializer(const uint8* base, uint32 offset, uint32 tag,
-                        uint32 has_offset,
-                        ::google::protobuf::io::CodedOutputStream* output) {
-  typedef MapEntryHelper<typename MapFieldType::EntryTypeTrait> Entry;
-  typedef typename MapFieldType::MapType::const_iterator Iter;
-
-  const MapFieldType& map_field =
-      *reinterpret_cast<const MapFieldType*>(base + offset);
-  const SerializationTable* t =
-      table +
-      has_offset;  // has_offset is overloaded for maps to mean table offset
-  if (!output->IsSerializationDeterministic()) {
-    for (Iter it = map_field.GetMap().begin(); it != map_field.GetMap().end();
-         ++it) {
-      Entry map_entry(*it);
-      output->WriteVarint32(tag);
-      output->WriteVarint32(map_entry._cached_size_);
-      SerializeInternal(reinterpret_cast<const uint8*>(&map_entry),
-                        t->field_table, t->num_fields, output);
-    }
-  } else {
-    std::vector<Entry> v;
-    for (Iter it = map_field.GetMap().begin(); it != map_field.GetMap().end();
-         ++it) {
-      v.push_back(Entry(*it));
-    }
-    std::sort(v.begin(), v.end(), CompareMapKey());
-    for (int i = 0; i < v.size(); i++) {
-      output->WriteVarint32(tag);
-      output->WriteVarint32(v[i]._cached_size_);
-      SerializeInternal(reinterpret_cast<const uint8*>(&v[i]), t->field_table,
-                        t->num_fields, output);
-    }
-  }
+inline bool IsOneofPresent(const void* base, uint32_t offset, uint32_t tag) {
+  const uint32_t* oneof = reinterpret_cast<const uint32_t*>(
+      static_cast<const uint8_t*>(base) + offset);
+  return *oneof == tag >> 3;
 }
 
-LIBPROTOBUF_EXPORT MessageLite* DuplicateIfNonNullInternal(MessageLite* message, Arena* arena);
-LIBPROTOBUF_EXPORT MessageLite* GetOwnedMessageInternal(Arena* message_arena,
-                                     MessageLite* submessage,
-                                     Arena* submessage_arena);
+typedef void (*SpecialSerializer)(const uint8_t* base, uint32_t offset,
+                                  uint32_t tag, uint32_t has_offset,
+                                  io::CodedOutputStream* output);
+
+PROTOBUF_EXPORT void ExtensionSerializer(const MessageLite* extendee,
+                                         const uint8_t* ptr, uint32_t offset,
+                                         uint32_t tag, uint32_t has_offset,
+                                         io::CodedOutputStream* output);
+PROTOBUF_EXPORT void UnknownFieldSerializerLite(const uint8_t* base,
+                                                uint32_t offset, uint32_t tag,
+                                                uint32_t has_offset,
+                                                io::CodedOutputStream* output);
+
+PROTOBUF_EXPORT MessageLite* DuplicateIfNonNullInternal(MessageLite* message);
+PROTOBUF_EXPORT MessageLite* GetOwnedMessageInternal(Arena* message_arena,
+                                                     MessageLite* submessage,
+                                                     Arena* submessage_arena);
+PROTOBUF_EXPORT void GenericSwap(MessageLite* m1, MessageLite* m2);
+// We specialize GenericSwap for non-lite messages to benefit from reflection.
+PROTOBUF_EXPORT void GenericSwap(Message* m1, Message* m2);
 
 template <typename T>
-T* DuplicateIfNonNull(T* message, Arena* arena) {
+T* DuplicateIfNonNull(T* message) {
   // The casts must be reinterpret_cast<> because T might be a forward-declared
   // type that the compiler doesn't know is related to MessageLite.
-  return reinterpret_cast<T*>(DuplicateIfNonNullInternal(
-      reinterpret_cast<MessageLite*>(message), arena));
+  return reinterpret_cast<T*>(
+      DuplicateIfNonNullInternal(reinterpret_cast<MessageLite*>(message)));
 }
 
 template <typename T>
@@ -297,24 +182,32 @@ T* GetOwnedMessage(Arena* message_arena, T* submessage,
       submessage_arena));
 }
 
-// Returns a message owned by this Arena.  This may require Own()ing or
-// duplicating the message.
-template <typename T>
-T* GetOwnedMessage(T* message, Arena* arena) {
-  GOOGLE_DCHECK(message);
-  Arena* message_arena = google::protobuf::Arena::GetArena(message);
-  if (message_arena == arena) {
-    return message;
-  } else if (arena != NULL && message_arena == NULL) {
-    arena->Own(message);
-    return message;
-  } else {
-    return DuplicateIfNonNull(message, arena);
-  }
+// Hide atomic from the public header and allow easy change to regular int
+// on platforms where the atomic might have a perf impact.
+class PROTOBUF_EXPORT CachedSize {
+ public:
+  int Get() const { return size_.load(std::memory_order_relaxed); }
+  void Set(int size) { size_.store(size, std::memory_order_relaxed); }
+
+ private:
+  std::atomic<int> size_{0};
+};
+
+PROTOBUF_EXPORT void DestroyMessage(const void* message);
+PROTOBUF_EXPORT void DestroyString(const void* s);
+// Destroy (not delete) the message
+inline void OnShutdownDestroyMessage(const void* ptr) {
+  OnShutdownRun(DestroyMessage, ptr);
+}
+// Destroy the string (call std::string destructor)
+inline void OnShutdownDestroyString(const std::string* ptr) {
+  OnShutdownRun(DestroyString, ptr);
 }
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__
index e3a0149..acbca68 100644 (file)
 #define GOOGLE_PROTOBUF_HAS_BITS_H__
 
 #include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/port.h>
+
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
 namespace internal {
 
-template<size_t doublewords>
+template <size_t doublewords>
 class HasBits {
  public:
-  HasBits() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE { Clear(); }
+  PROTOBUF_NDEBUG_INLINE constexpr HasBits() : has_bits_{} {}
 
-  void Clear() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
+  PROTOBUF_NDEBUG_INLINE void Clear() {
     memset(has_bits_, 0, sizeof(has_bits_));
   }
 
-  ::google::protobuf::uint32& operator[](int index) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
+  PROTOBUF_NDEBUG_INLINE uint32_t& operator[](int index) {
     return has_bits_[index];
   }
 
-  const ::google::protobuf::uint32& operator[](int index) const
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
+  PROTOBUF_NDEBUG_INLINE const uint32_t& operator[](int index) const {
     return has_bits_[index];
   }
 
@@ -64,10 +69,14 @@ class HasBits {
     return !(*this == rhs);
   }
 
+  void Or(const HasBits<doublewords>& rhs) {
+    for (size_t i = 0; i < doublewords; i++) has_bits_[i] |= rhs[i];
+  }
+
   bool empty() const;
 
  private:
-  ::google::protobuf::uint32 has_bits_[doublewords];
+  uint32_t has_bits_[doublewords];
 };
 
 template <>
@@ -100,6 +109,8 @@ inline bool HasBits<doublewords>::empty() const {
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_HAS_BITS_H__
 // (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/stubs/statusor.h>
+#include <google/protobuf/implicit_weak_message.h>
+
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/wire_format_lite.h>
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
-namespace util {
 namespace internal {
 
-void StatusOrHelper::Crash(const Status& status) {
-  GOOGLE_LOG(FATAL) << "Attempting to fetch value instead of handling error "
-                    << status.ToString();
+const char* ImplicitWeakMessage::_InternalParse(const char* ptr,
+                                                ParseContext* ctx) {
+  return ctx->AppendString(ptr, &data_);
+}
+
+ExplicitlyConstructed<ImplicitWeakMessage>
+    implicit_weak_message_default_instance;
+internal::once_flag implicit_weak_message_once_init_;
+
+void InitImplicitWeakMessageDefaultInstance() {
+  implicit_weak_message_default_instance.DefaultConstruct();
+}
+
+const ImplicitWeakMessage* ImplicitWeakMessage::default_instance() {
+  internal::call_once(implicit_weak_message_once_init_,
+                      InitImplicitWeakMessageDefaultInstance);
+  return &implicit_weak_message_default_instance.get();
 }
 
 }  // namespace internal
-}  // namespace util
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
diff --git a/3rdparty/protobuf/src/google/protobuf/implicit_weak_message.h b/3rdparty/protobuf/src/google/protobuf/implicit_weak_message.h
new file mode 100644 (file)
index 0000000..5db8b9c
--- /dev/null
@@ -0,0 +1,186 @@
+// 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 <string>
+
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/repeated_field.h>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+#include <google/protobuf/port_def.inc>
+
+// This file is logically internal-only and should only be used by protobuf
+// generated code.
+
+namespace google {
+namespace protobuf {
+namespace internal {
+
+// An implementation of MessageLite that treats all data as unknown. This type
+// acts as a placeholder for an implicit weak field in the case where the true
+// message type does not get linked into the binary.
+class PROTOBUF_EXPORT ImplicitWeakMessage : public MessageLite {
+ public:
+  ImplicitWeakMessage() {}
+  explicit ImplicitWeakMessage(Arena* arena) : MessageLite(arena) {}
+
+  static const ImplicitWeakMessage* default_instance();
+
+  std::string GetTypeName() const override { return ""; }
+
+  MessageLite* New(Arena* arena) const override {
+    return Arena::CreateMessage<ImplicitWeakMessage>(arena);
+  }
+
+  void Clear() override { data_.clear(); }
+
+  bool IsInitialized() const override { return true; }
+
+  void CheckTypeAndMergeFrom(const MessageLite& other) override {
+    data_.append(static_cast<const ImplicitWeakMessage&>(other).data_);
+  }
+
+  const char* _InternalParse(const char* ptr, ParseContext* ctx) final;
+
+  size_t ByteSizeLong() const override { return data_.size(); }
+
+  uint8_t* _InternalSerialize(uint8_t* target,
+                              io::EpsCopyOutputStream* stream) const final {
+    return stream->WriteRaw(data_.data(), static_cast<int>(data_.size()),
+                            target);
+  }
+
+  int GetCachedSize() const override { return static_cast<int>(data_.size()); }
+
+  typedef void InternalArenaConstructable_;
+
+ private:
+  std::string data_;
+  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImplicitWeakMessage);
+};
+
+// A type handler for use with implicit weak repeated message fields.
+template <typename ImplicitWeakType>
+class ImplicitWeakTypeHandler {
+ public:
+  typedef MessageLite Type;
+  static constexpr bool Moveable = false;
+
+  static inline MessageLite* NewFromPrototype(const MessageLite* prototype,
+                                              Arena* arena = nullptr) {
+    return prototype->New(arena);
+  }
+
+  static inline void Delete(MessageLite* value, Arena* arena) {
+    if (arena == nullptr) {
+      delete value;
+    }
+  }
+  static inline Arena* GetArena(MessageLite* value) {
+    return value->GetArena();
+  }
+  static inline void Clear(MessageLite* value) { value->Clear(); }
+  static void Merge(const MessageLite& from, MessageLite* to) {
+    to->CheckTypeAndMergeFrom(from);
+  }
+};
+
+}  // namespace internal
+
+template <typename T>
+struct WeakRepeatedPtrField {
+  using TypeHandler = internal::ImplicitWeakTypeHandler<T>;
+  constexpr WeakRepeatedPtrField() : weak() {}
+  explicit WeakRepeatedPtrField(Arena* arena) : weak(arena) {}
+  ~WeakRepeatedPtrField() { weak.template Destroy<TypeHandler>(); }
+
+  typedef internal::RepeatedPtrIterator<MessageLite> iterator;
+  typedef internal::RepeatedPtrIterator<const MessageLite> const_iterator;
+  typedef internal::RepeatedPtrOverPtrsIterator<MessageLite*, void*>
+      pointer_iterator;
+  typedef internal::RepeatedPtrOverPtrsIterator<const MessageLite* const,
+                                                const void* const>
+      const_pointer_iterator;
+
+  iterator begin() { return iterator(base().raw_data()); }
+  const_iterator begin() const { return iterator(base().raw_data()); }
+  const_iterator cbegin() const { return begin(); }
+  iterator end() { return begin() + base().size(); }
+  const_iterator end() const { return begin() + base().size(); }
+  const_iterator cend() const { return end(); }
+  pointer_iterator pointer_begin() {
+    return pointer_iterator(base().raw_mutable_data());
+  }
+  const_pointer_iterator pointer_begin() const {
+    return const_pointer_iterator(base().raw_mutable_data());
+  }
+  pointer_iterator pointer_end() {
+    return pointer_iterator(base().raw_mutable_data() + base().size());
+  }
+  const_pointer_iterator pointer_end() const {
+    return const_pointer_iterator(base().raw_mutable_data() + base().size());
+  }
+
+  MessageLite* AddWeak(const MessageLite* prototype) {
+    return base().AddWeak(prototype);
+  }
+  T* Add() { return weak.Add(); }
+  void Clear() { base().template Clear<TypeHandler>(); }
+  void MergeFrom(const WeakRepeatedPtrField& other) {
+    base().template MergeFrom<TypeHandler>(other.base());
+  }
+  void InternalSwap(WeakRepeatedPtrField* other) {
+    base().InternalSwap(&other->base());
+  }
+
+  const internal::RepeatedPtrFieldBase& base() const { return weak; }
+  internal::RepeatedPtrFieldBase& base() { return weak; }
+  // Union disables running the destructor. Which would create a strong link.
+  // Instead we explicitly destroy the underlying base through the virtual
+  // destructor.
+  union {
+    RepeatedPtrField<T> weak;
+  };
+};
+
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
+#endif  // GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/inlined_string_field.h b/3rdparty/protobuf/src/google/protobuf/inlined_string_field.h
new file mode 100644 (file)
index 0000000..1fe639f
--- /dev/null
@@ -0,0 +1,384 @@
+// 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_INLINED_STRING_FIELD_H__
+#define GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__
+
+#include <string>
+#include <utility>
+
+#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/port.h>
+#include <google/protobuf/stubs/strutil.h>
+
+// Must be included last.
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+namespace google {
+namespace protobuf {
+
+class Arena;
+
+namespace internal {
+
+// InlinedStringField wraps a std::string instance and exposes an API similar to
+// ArenaStringPtr's wrapping of a std::string* instance.
+//
+// default_value parameters are taken for consistency with ArenaStringPtr, but
+// are not used for most methods. With inlining, these should be removed from
+// the generated binary.
+//
+// InlinedStringField has a donating mechanism that allows string buffer
+// allocated on arena. A string is donated means both the string container and
+// the data buffer are on arena. The donating mechanism here is similar to the
+// one in ArenaStringPtr with some differences:
+//
+// When an InlinedStringField is constructed, the donating state is true. This
+// is because the string container is directly stored in the message on the
+// arena:
+//
+//   Construction: donated=true
+//   Arena:
+//   +-----------------------+
+//   |Message foo:           |
+//   | +-------------------+ |
+//   | |InlinedStringField:| |
+//   | | +-----+           | |
+//   | | | | | |           | |
+//   | | +-----+           | |
+//   | +-------------------+ |
+//   +-----------------------+
+//
+// When lvalue Set is called, the donating state is still true. String data will
+// be allocated on the arena:
+//
+//   Lvalue Set: donated=true
+//   Arena:
+//   +-----------------------+
+//   |Message foo:           |
+//   | +-------------------+ |
+//   | |InlinedStringField:| |
+//   | | +-----+           | |
+//   | | | | | |           | |
+//   | | +|----+           | |
+//   | +--|----------------+ |
+//   |    V                  |
+//   |  +----------------+   |
+//   |  |'f','o','o',... |   |
+//   |  +----------------+   |
+//   +-----------------------+
+//
+// Some operations will undonate a donated string, including: Mutable,
+// SetAllocated, Rvalue Set, and Swap with a non-donated string.
+//
+// For more details of the donating states transitions, go/pd-inlined-string.
+class PROTOBUF_EXPORT InlinedStringField {
+ public:
+  InlinedStringField() { Init(); }
+  inline void Init() { new (get_mutable()) std::string(); }
+  // Add the dummy parameter just to make InlinedStringField(nullptr)
+  // unambiguous.
+  constexpr InlinedStringField(
+      const ExplicitlyConstructed<std::string>* /*default_value*/,
+      bool /*dummy*/)
+      : value_{} {}
+  explicit InlinedStringField(const std::string& default_value);
+  explicit InlinedStringField(Arena* arena);
+  ~InlinedStringField() { Destruct(); }
+
+  // Lvalue Set. To save space, we pack the donating states of multiple
+  // InlinedStringFields into an uint32_t `donating_states`. The `mask`
+  // indicates the position of the bit for this InlinedStringField. `donated` is
+  // whether this field is donated.
+  //
+  // The caller should guarantee that:
+  //
+  //   `donated == ((donating_states & ~mask) != 0)`
+  //
+  // This method never changes the `donating_states`.
+  void Set(const std::string* default_value, ConstStringParam value,
+           Arena* arena, bool donated, uint32_t* /*donating_states*/,
+           uint32_t /*mask*/) {
+    (void)arena;
+    (void)donated;
+    SetNoArena(default_value, value);
+  }
+
+  // Rvalue Set. If this field is donated, this method will undonate this field
+  // by mutating the `donating_states` according to `mask`.
+  void Set(const std::string* default_value, std::string&& value, Arena* arena,
+           bool donated, uint32_t* donating_states, uint32_t mask);
+
+  template <typename FirstParam>
+  void Set(FirstParam p1, const char* str, ::google::protobuf::Arena* arena, bool donated,
+           uint32_t* donating_states, uint32_t mask) {
+    Set(p1, ConstStringParam(str), arena, donated, donating_states, mask);
+  }
+
+  template <typename FirstParam>
+  void Set(FirstParam p1, const char* str, size_t size, ::google::protobuf::Arena* arena,
+           bool donated, uint32_t* donating_states, uint32_t mask) {
+    ConstStringParam sp{str, size};  // for string_view and `const string &`
+    Set(p1, sp, arena, donated, donating_states, mask);
+  }
+
+  template <typename FirstParam, typename RefWrappedType>
+  void Set(FirstParam p1,
+           std::reference_wrapper<RefWrappedType> const_string_ref,
+           ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
+           uint32_t mask) {
+    Set(p1, const_string_ref.get(), arena, donated, donating_states, mask);
+  }
+
+  template <typename FirstParam, typename SecondParam>
+  void SetBytes(FirstParam p1, SecondParam&& p2, ::google::protobuf::Arena* arena,
+                bool donated, uint32_t* donating_states, uint32_t mask) {
+    Set(p1, static_cast<SecondParam&&>(p2), arena, donated, donating_states,
+        mask);
+  }
+
+  template <typename FirstParam>
+  void SetBytes(FirstParam p1, const void* str, size_t size,
+                ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
+                uint32_t mask) {
+    // Must work whether ConstStringParam is string_view or `const string &`
+    ConstStringParam sp{static_cast<const char*>(str), size};
+    Set(p1, sp, arena, donated, donating_states, mask);
+  }
+
+  PROTOBUF_NDEBUG_INLINE void SetNoArena(const std::string* default_value,
+                                         StringPiece value);
+  PROTOBUF_NDEBUG_INLINE void SetNoArena(const std::string* default_value,
+                                         std::string&& value);
+
+  // Basic accessors.
+  PROTOBUF_NDEBUG_INLINE const std::string& Get() const { return GetNoArena(); }
+  PROTOBUF_NDEBUG_INLINE const std::string& GetNoArena() const;
+
+  // Mutable returns a std::string* instance that is heap-allocated. If this
+  // field is donated, this method undonates this field by mutating the
+  // `donating_states` according to `mask`, and copies the content of the
+  // original string to the returning string.
+  std::string* Mutable(const LazyString& default_value, Arena* arena,
+                       bool donated, uint32_t* donating_states, uint32_t mask);
+  std::string* Mutable(ArenaStringPtr::EmptyDefault, Arena* arena, bool donated,
+                       uint32_t* donating_states, uint32_t mask);
+
+  // Release returns a std::string* instance that is heap-allocated and is not
+  // Own()'d by any arena. If the field is not set, this returns nullptr. The
+  // caller retains ownership. Clears this field back to nullptr state. Used to
+  // implement release_<field>() methods on generated classes.
+  PROTOBUF_NODISCARD std::string* Release(const std::string* default_value,
+                                          Arena* arena, bool donated);
+  PROTOBUF_NODISCARD std::string* ReleaseNonDefault(
+      const std::string* default_value, Arena* arena);
+  std::string* ReleaseNonDefaultNoArena(const std::string* default_value);
+
+  // Takes a std::string that is heap-allocated, and takes ownership. The
+  // std::string's destructor is registered with the arena. Used to implement
+  // set_allocated_<field> in generated classes.
+  //
+  // If this field is donated, this method undonates this field by mutating the
+  // `donating_states` according to `mask`.
+  void SetAllocated(const std::string* default_value, std::string* value,
+                    Arena* arena, bool donated, uint32_t* donating_states,
+                    uint32_t mask);
+
+  void SetAllocatedNoArena(const std::string* default_value,
+                           std::string* value);
+
+  // When one of `this` and `from` is donated and the other is not donated, this
+  // method will undonate the donated one and swap the two heap-allocated
+  // strings.
+  PROTOBUF_NDEBUG_INLINE void Swap(InlinedStringField* from,
+                                   const std::string* default_value,
+                                   Arena* arena, bool donated,
+                                   bool from_donated, uint32_t* donating_states,
+                                   uint32_t* from_donating_states,
+                                   uint32_t mask);
+
+  // Frees storage (if not on an arena).
+  PROTOBUF_NDEBUG_INLINE void Destroy(const std::string* default_value,
+                                      Arena* arena) {
+    if (arena == nullptr) {
+      DestroyNoArena(default_value);
+    }
+  }
+  PROTOBUF_NDEBUG_INLINE void DestroyNoArena(const std::string* default_value);
+
+  // Clears content, but keeps allocated std::string, to avoid the overhead of
+  // heap operations. After this returns, the content (as seen by the user) will
+  // always be the empty std::string.
+  PROTOBUF_NDEBUG_INLINE void ClearToEmpty() { ClearNonDefaultToEmpty(); }
+  PROTOBUF_NDEBUG_INLINE void ClearNonDefaultToEmpty() {
+    get_mutable()->clear();
+  }
+
+  // Clears content, but keeps allocated std::string if arena != nullptr, to
+  // avoid the overhead of heap operations. After this returns, the content (as
+  // seen by the user) will always be equal to |default_value|.
+  void ClearToDefault(const LazyString& default_value, Arena* arena,
+                      bool donated);
+
+  // Returns a mutable pointer, but doesn't initialize the string to the
+  // default value.
+  PROTOBUF_NDEBUG_INLINE std::string* MutableNoArenaNoDefault(
+      const std::string* /*default_value*/);
+
+  // Generated code / reflection only! Returns a mutable pointer to the string.
+  PROTOBUF_NDEBUG_INLINE std::string* UnsafeMutablePointer();
+
+  // InlinedStringField doesn't have things like the `default_value` pointer in
+  // ArenaStringPtr.
+  bool IsDefault(const std::string* /*default_value*/) const { return false; }
+
+ private:
+  void Destruct() { get_mutable()->~basic_string(); }
+
+  PROTOBUF_NDEBUG_INLINE std::string* get_mutable();
+  PROTOBUF_NDEBUG_INLINE const std::string* get_const() const;
+
+  alignas(std::string) char value_[sizeof(std::string)];
+
+  std::string* MutableSlow(::google::protobuf::Arena* arena, bool donated,
+                           uint32_t* donating_states, uint32_t mask);
+
+
+  // When constructed in an Arena, we want our destructor to be skipped.
+  friend class ::google::protobuf::Arena;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+};
+
+inline std::string* InlinedStringField::get_mutable() {
+  return reinterpret_cast<std::string*>(&value_);
+}
+
+inline const std::string* InlinedStringField::get_const() const {
+  return reinterpret_cast<const std::string*>(&value_);
+}
+
+inline InlinedStringField::InlinedStringField(
+    const std::string& default_value) {
+  new (get_mutable()) std::string(default_value);
+}
+
+inline InlinedStringField::InlinedStringField(Arena* arena) {
+  Init();
+  if (arena != nullptr) {
+    arena->OwnDestructor(get_mutable());
+  }
+}
+
+inline const std::string& InlinedStringField::GetNoArena() const {
+  return *get_const();
+}
+
+inline void InlinedStringField::SetAllocatedNoArena(
+    const std::string* /*default_value*/, std::string* value) {
+  if (value == nullptr) {
+    // Currently, inlined string field can't have non empty default.
+    get_mutable()->clear();
+  } else {
+    get_mutable()->assign(std::move(*value));
+    delete value;
+  }
+}
+
+inline void InlinedStringField::DestroyNoArena(const std::string*) {
+  // This is invoked from the generated message's ArenaDtor, which is used to
+  // clean up objects not allocated on the Arena.
+  this->~InlinedStringField();
+}
+
+inline std::string* InlinedStringField::ReleaseNonDefaultNoArena(
+    const std::string* /*default_value*/) {
+  // Currently, inlined string field can't have non empty default.
+  auto* released = new std::string();
+  get_mutable()->swap(*released);
+  return released;
+}
+
+inline void InlinedStringField::SetNoArena(const std::string* /*default_value*/,
+                                           StringPiece value) {
+  get_mutable()->assign(value.data(), value.length());
+}
+
+inline void InlinedStringField::SetNoArena(const std::string* /*default_value*/,
+                                           std::string&& value) {
+  get_mutable()->assign(std::move(value));
+}
+
+inline void InlinedStringField::Swap(
+    InlinedStringField* from, const std::string* /*default_value*/,
+    Arena* arena, bool donated, bool from_donated, uint32_t* donating_states,
+    uint32_t* from_donating_states, uint32_t mask) {
+#if GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE
+  // If one is donated and the other is not, undonate the donated one.
+  if (donated && !from_donated) {
+    MutableSlow(arena, donated, donating_states, mask);
+  } else if (!donated && from_donated) {
+    from->MutableSlow(arena, from_donated, from_donating_states, mask);
+  }
+  // Then, swap the two undonated strings.
+#else
+  (void)arena;
+  (void)donated;
+  (void)from_donated;
+  (void)donating_states;
+  (void)from_donating_states;
+  (void)mask;
+#endif
+  get_mutable()->swap(*from->get_mutable());
+}
+
+inline std::string* InlinedStringField::MutableNoArenaNoDefault(
+    const std::string*) {
+  return get_mutable();
+}
+
+inline std::string* InlinedStringField::UnsafeMutablePointer() {
+  return get_mutable();
+}
+
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
+#endif  // GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__
index 79cff2c..20977b7 100644 (file)
 // will not cross the end of the buffer, since we can avoid a lot
 // of branching in this case.
 
-#include <google/protobuf/io/coded_stream_inl.h>
+#include <google/protobuf/io/coded_stream.h>
+
+#include <limits.h>
+
 #include <algorithm>
+#include <cstring>
 #include <utility>
-#include <limits.h>
-#include <google/protobuf/io/zero_copy_stream.h>
-#include <google/protobuf/arena.h>
+
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/io/zero_copy_stream.h>
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
 #include <google/protobuf/stubs/stl_util.h>
 
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace io {
@@ -59,8 +66,8 @@ static const int kMaxVarintBytes = 10;
 static const int kMaxVarint32Bytes = 5;
 
 
-inline bool NextNonEmpty(ZeroCopyInputStream* input,
-                         const void** data, int* size) {
+inline bool NextNonEmpty(ZeroCopyInputStream* input, const void** data,
+                         int* size) {
   bool success;
   do {
     success = input->Next(data, size);
@@ -82,10 +89,6 @@ CodedInputStream::~CodedInputStream() {
 int CodedInputStream::default_recursion_limit_ = 100;
 
 
-void CodedOutputStream::EnableAliasing(bool enabled) {
-  aliasing_enabled_ = enabled && output_->AllowsAliasing();
-}
-
 void CodedInputStream::BackUpInputToCurrentPosition() {
   int backup_bytes = BufferSize() + buffer_size_after_limit_ + overflow_bytes_;
   if (backup_bytes > 0) {
@@ -121,9 +124,9 @@ CodedInputStream::Limit CodedInputStream::PushLimit(int byte_limit) {
   // security: byte_limit is possibly evil, so check for negative values
   // and overflow. Also check that the new requested limit is before the
   // previous limit; otherwise we continue to enforce the previous limit.
-  if GOOGLE_PREDICT_TRUE(byte_limit >= 0 &&
-                  byte_limit <= INT_MAX - current_position &&
-                  byte_limit < current_limit_ - current_position) {
+  if (PROTOBUF_PREDICT_TRUE(byte_limit >= 0 &&
+                            byte_limit <= INT_MAX - current_position &&
+                            byte_limit < current_limit_ - current_position)) {
     current_limit_ = current_position + byte_limit;
     RecomputeBufferLimits();
   }
@@ -148,7 +151,7 @@ CodedInputStream::IncrementRecursionDepthAndPushLimit(int byte_limit) {
 }
 
 CodedInputStream::Limit CodedInputStream::ReadLengthAndPushLimit() {
-  uint32 length;
+  uint32_t length;
   return PushLimit(ReadVarint32(&length) ? length : 0);
 }
 
@@ -173,10 +176,7 @@ int CodedInputStream::BytesUntilLimit() const {
   return current_limit_ - current_position;
 }
 
-void CodedInputStream::SetTotalBytesLimit(
-    int total_bytes_limit, int warning_threshold) {
-  (void) warning_threshold;
-
+void CodedInputStream::SetTotalBytesLimit(int total_bytes_limit) {
   // Make sure the limit isn't already past, since this could confuse other
   // code.
   int current_position = CurrentPosition();
@@ -190,11 +190,13 @@ int CodedInputStream::BytesUntilTotalBytesLimit() const {
 }
 
 void CodedInputStream::PrintTotalBytesLimitError() {
-  GOOGLE_LOG(ERROR) << "A protocol message was rejected because it was too "
-                "big (more than " << total_bytes_limit_
-             << " bytes).  To increase the limit (or to disable these "
-                "warnings), see CodedInputStream::SetTotalBytesLimit() "
-                "in google/protobuf/io/coded_stream.h.";
+  GOOGLE_LOG(ERROR)
+      << "A protocol message was rejected because it was too "
+         "big (more than "
+      << total_bytes_limit_
+      << " bytes).  To increase the limit (or to disable these "
+         "warnings), see CodedInputStream::SetTotalBytesLimit() "
+         "in third_party/protobuf/src/google/protobuf/io/coded_stream.h.";
 }
 
 bool CodedInputStream::SkipFallback(int count, int original_buffer_size) {
@@ -220,8 +222,12 @@ bool CodedInputStream::SkipFallback(int count, int original_buffer_size) {
     return false;
   }
 
+  if (!input_->Skip(count)) {
+    total_bytes_read_ = input_->ByteCount();
+    return false;
+  }
   total_bytes_read_ += count;
-  return input_->Skip(count);
+  return true;
 }
 
 bool CodedInputStream::GetDirectBufferPointer(const void** data, int* size) {
@@ -233,15 +239,42 @@ bool CodedInputStream::GetDirectBufferPointer(const void** data, int* size) {
 }
 
 bool CodedInputStream::ReadRaw(void* buffer, int size) {
-  return InternalReadRawInline(buffer, size);
+  int current_buffer_size;
+  while ((current_buffer_size = BufferSize()) < size) {
+    // Reading past end of buffer.  Copy what we have, then refresh.
+    memcpy(buffer, buffer_, current_buffer_size);
+    buffer = reinterpret_cast<uint8_t*>(buffer) + current_buffer_size;
+    size -= current_buffer_size;
+    Advance(current_buffer_size);
+    if (!Refresh()) return false;
+  }
+
+  memcpy(buffer, buffer_, size);
+  Advance(size);
+
+  return true;
 }
 
-bool CodedInputStream::ReadString(string* buffer, int size) {
+bool CodedInputStream::ReadString(std::string* buffer, int size) {
   if (size < 0) return false;  // security: size is often user-supplied
-  return InternalReadStringInline(buffer, size);
+
+  if (BufferSize() >= size) {
+    STLStringResizeUninitialized(buffer, size);
+    std::pair<char*, bool> z = as_string_data(buffer);
+    if (z.second) {
+      // Oddly enough, memcpy() requires its first two args to be non-NULL even
+      // if we copy 0 bytes.  So, we have ensured that z.first is non-NULL here.
+      GOOGLE_DCHECK(z.first != NULL);
+      memcpy(z.first, buffer_, size);
+      Advance(size);
+    }
+    return true;
+  }
+
+  return ReadStringFallback(buffer, size);
 }
 
-bool CodedInputStream::ReadStringFallback(string* buffer, int size) {
+bool CodedInputStream::ReadStringFallback(std::string* buffer, int size) {
   if (!buffer->empty()) {
     buffer->clear();
   }
@@ -275,11 +308,11 @@ bool CodedInputStream::ReadStringFallback(string* buffer, int size) {
 }
 
 
-bool CodedInputStream::ReadLittleEndian32Fallback(uint32* value) {
-  uint8 bytes[sizeof(*value)];
+bool CodedInputStream::ReadLittleEndian32Fallback(uint32_t* value) {
+  uint8_t bytes[sizeof(*value)];
 
-  const uint8* ptr;
-  if (BufferSize() >= sizeof(*value)) {
+  const uint8_t* ptr;
+  if (BufferSize() >= static_cast<int64_t>(sizeof(*value))) {
     // Fast path:  Enough bytes in the buffer to read directly.
     ptr = buffer_;
     Advance(sizeof(*value));
@@ -292,11 +325,11 @@ bool CodedInputStream::ReadLittleEndian32Fallback(uint32* value) {
   return true;
 }
 
-bool CodedInputStream::ReadLittleEndian64Fallback(uint64* value) {
-  uint8 bytes[sizeof(*value)];
+bool CodedInputStream::ReadLittleEndian64Fallback(uint64_t* value) {
+  uint8_t bytes[sizeof(*value)];
 
-  const uint8* ptr;
-  if (BufferSize() >= sizeof(*value)) {
+  const uint8_t* ptr;
+  if (BufferSize() >= static_cast<int64_t>(sizeof(*value))) {
     // Fast path:  Enough bytes in the buffer to read directly.
     ptr = buffer_;
     Advance(sizeof(*value));
@@ -311,111 +344,126 @@ bool CodedInputStream::ReadLittleEndian64Fallback(uint64* value) {
 
 namespace {
 
+// Decodes varint64 with known size, N, and returns next pointer. Knowing N at
+// compile time, compiler can generate optimal code. For example, instead of
+// subtracting 0x80 at each iteration, it subtracts properly shifted mask once.
+template <size_t N>
+const uint8_t* DecodeVarint64KnownSize(const uint8_t* buffer, uint64_t* value) {
+  GOOGLE_DCHECK_GT(N, 0);
+  uint64_t result = static_cast<uint64_t>(buffer[N - 1]) << (7 * (N - 1));
+  for (size_t i = 0, offset = 0; i < N - 1; i++, offset += 7) {
+    result += static_cast<uint64_t>(buffer[i] - 0x80) << offset;
+  }
+  *value = result;
+  return buffer + N;
+}
+
 // Read a varint from the given buffer, write it to *value, and return a pair.
 // 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_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(
-    uint32 first_byte, const uint8* buffer, uint32* value) {
+PROTOBUF_ALWAYS_INLINE
+::std::pair<bool, const uint8_t*> ReadVarint32FromArray(uint32_t first_byte,
+                                                      const uint8_t* buffer,
+                                                      uint32_t* value);
+inline ::std::pair<bool, const uint8_t*> ReadVarint32FromArray(
+    uint32_t first_byte, const uint8_t* buffer, uint32_t* value) {
   // Fast path:  We have enough bytes left in the buffer to guarantee that
   // this read won't cross the end, so we can skip the checks.
   GOOGLE_DCHECK_EQ(*buffer, first_byte);
   GOOGLE_DCHECK_EQ(first_byte & 0x80, 0x80) << first_byte;
-  const uint8* ptr = buffer;
-  uint32 b;
-  uint32 result = first_byte - 0x80;
+  const uint8_t* ptr = buffer;
+  uint32_t b;
+  uint32_t result = first_byte - 0x80;
   ++ptr;  // We just processed the first byte.  Move on to the second.
-  b = *(ptr++); result += b <<  7; if (!(b & 0x80)) goto done;
+  b = *(ptr++);
+  result += b << 7;
+  if (!(b & 0x80)) goto done;
   result -= 0x80 << 7;
-  b = *(ptr++); result += b << 14; if (!(b & 0x80)) goto done;
+  b = *(ptr++);
+  result += b << 14;
+  if (!(b & 0x80)) goto done;
   result -= 0x80 << 14;
-  b = *(ptr++); result += b << 21; if (!(b & 0x80)) goto done;
+  b = *(ptr++);
+  result += b << 21;
+  if (!(b & 0x80)) goto done;
   result -= 0x80 << 21;
-  b = *(ptr++); result += b << 28; if (!(b & 0x80)) goto done;
+  b = *(ptr++);
+  result += b << 28;
+  if (!(b & 0x80)) goto done;
   // "result -= 0x80 << 28" is irrevelant.
 
   // If the input is larger than 32 bits, we still need to read it all
   // and discard the high-order bits.
   for (int i = 0; i < kMaxVarintBytes - kMaxVarint32Bytes; i++) {
-    b = *(ptr++); if (!(b & 0x80)) goto done;
+    b = *(ptr++);
+    if (!(b & 0x80)) goto done;
   }
 
   // We have overrun the maximum size of a varint (10 bytes).  Assume
   // the data is corrupt.
   return std::make_pair(false, ptr);
 
- done:
+done:
   *value = result;
   return std::make_pair(true, ptr);
 }
 
-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;
-  uint32 b;
-
-  // Splitting into 32-bit pieces gives better performance on 32-bit
-  // processors.
-  uint32 part0 = 0, part1 = 0, part2 = 0;
-
-  b = *(ptr++); part0  = b      ; if (!(b & 0x80)) goto done;
-  part0 -= 0x80;
-  b = *(ptr++); part0 += b <<  7; if (!(b & 0x80)) goto done;
-  part0 -= 0x80 << 7;
-  b = *(ptr++); part0 += b << 14; if (!(b & 0x80)) goto done;
-  part0 -= 0x80 << 14;
-  b = *(ptr++); part0 += b << 21; if (!(b & 0x80)) goto done;
-  part0 -= 0x80 << 21;
-  b = *(ptr++); part1  = b      ; if (!(b & 0x80)) goto done;
-  part1 -= 0x80;
-  b = *(ptr++); part1 += b <<  7; if (!(b & 0x80)) goto done;
-  part1 -= 0x80 << 7;
-  b = *(ptr++); part1 += b << 14; if (!(b & 0x80)) goto done;
-  part1 -= 0x80 << 14;
-  b = *(ptr++); part1 += b << 21; if (!(b & 0x80)) goto done;
-  part1 -= 0x80 << 21;
-  b = *(ptr++); part2  = b      ; if (!(b & 0x80)) goto done;
-  part2 -= 0x80;
-  b = *(ptr++); part2 += b <<  7; if (!(b & 0x80)) goto done;
-  // "part2 -= 0x80 << 7" is irrelevant because (0x80 << 7) << 56 is 0.
-
-  // We have overrun the maximum size of a varint (10 bytes).  Assume
-  // the data is corrupt.
-  return std::make_pair(false, ptr);
+PROTOBUF_ALWAYS_INLINE::std::pair<bool, const uint8_t*> ReadVarint64FromArray(
+    const uint8_t* buffer, uint64_t* value);
+inline ::std::pair<bool, const uint8_t*> ReadVarint64FromArray(
+    const uint8_t* buffer, uint64_t* value) {
+  // Assumes varint64 is at least 2 bytes.
+  GOOGLE_DCHECK_GE(buffer[0], 128);
+
+  const uint8_t* next;
+  if (buffer[1] < 128) {
+    next = DecodeVarint64KnownSize<2>(buffer, value);
+  } else if (buffer[2] < 128) {
+    next = DecodeVarint64KnownSize<3>(buffer, value);
+  } else if (buffer[3] < 128) {
+    next = DecodeVarint64KnownSize<4>(buffer, value);
+  } else if (buffer[4] < 128) {
+    next = DecodeVarint64KnownSize<5>(buffer, value);
+  } else if (buffer[5] < 128) {
+    next = DecodeVarint64KnownSize<6>(buffer, value);
+  } else if (buffer[6] < 128) {
+    next = DecodeVarint64KnownSize<7>(buffer, value);
+  } else if (buffer[7] < 128) {
+    next = DecodeVarint64KnownSize<8>(buffer, value);
+  } else if (buffer[8] < 128) {
+    next = DecodeVarint64KnownSize<9>(buffer, value);
+  } else if (buffer[9] < 128) {
+    next = DecodeVarint64KnownSize<10>(buffer, value);
+  } else {
+    // We have overrun the maximum size of a varint (10 bytes). Assume
+    // the data is corrupt.
+    return std::make_pair(false, buffer + 11);
+  }
 
- done:
-  *value = (static_cast<uint64>(part0)) |
-           (static_cast<uint64>(part1) << 28) |
-           (static_cast<uint64>(part2) << 56);
-  return std::make_pair(true, ptr);
+  return std::make_pair(true, next);
 }
 
 }  // namespace
 
-bool CodedInputStream::ReadVarint32Slow(uint32* value) {
+bool CodedInputStream::ReadVarint32Slow(uint32_t* value) {
   // Directly invoke ReadVarint64Fallback, since we already tried to optimize
   // for one-byte varints.
-  std::pair<uint64, bool> p = ReadVarint64Fallback();
-  *value = static_cast<uint32>(p.first);
+  std::pair<uint64_t, bool> p = ReadVarint64Fallback();
+  *value = static_cast<uint32_t>(p.first);
   return p.second;
 }
 
-int64 CodedInputStream::ReadVarint32Fallback(uint32 first_byte_or_zero) {
+int64_t CodedInputStream::ReadVarint32Fallback(uint32_t first_byte_or_zero) {
   if (BufferSize() >= kMaxVarintBytes ||
       // Optimization:  We're also safe if the buffer is non-empty and it ends
       // with a byte that would terminate a varint.
       (buffer_end_ > buffer_ && !(buffer_end_[-1] & 0x80))) {
     GOOGLE_DCHECK_NE(first_byte_or_zero, 0)
         << "Caller should provide us with *buffer_ when buffer is non-empty";
-    uint32 temp;
-    ::std::pair<bool, const uint8*> p =
-          ReadVarint32FromArray(first_byte_or_zero, buffer_, &temp);
+    uint32_t temp;
+    ::std::pair<bool, const uint8_t*> p =
+        ReadVarint32FromArray(first_byte_or_zero, buffer_, &temp);
     if (!p.first) return -1;
     buffer_ = p.second;
     return temp;
@@ -423,16 +471,16 @@ int64 CodedInputStream::ReadVarint32Fallback(uint32 first_byte_or_zero) {
     // Really slow case: we will incur the cost of an extra function call here,
     // but moving this out of line reduces the size of this function, which
     // improves the common case. In micro benchmarks, this is worth about 10-15%
-    uint32 temp;
-    return ReadVarint32Slow(&temp) ? static_cast<int64>(temp) : -1;
+    uint32_t temp;
+    return ReadVarint32Slow(&temp) ? static_cast<int64_t>(temp) : -1;
   }
 }
 
 int CodedInputStream::ReadVarintSizeAsIntSlow() {
   // Directly invoke ReadVarint64Fallback, since we already tried to optimize
   // for one-byte varints.
-  std::pair<uint64, bool> p = ReadVarint64Fallback();
-  if (!p.second || p.first > static_cast<uint64>(INT_MAX)) return -1;
+  std::pair<uint64_t, bool> p = ReadVarint64Fallback();
+  if (!p.second || p.first > static_cast<uint64_t>(INT_MAX)) return -1;
   return p.first;
 }
 
@@ -441,9 +489,9 @@ int CodedInputStream::ReadVarintSizeAsIntFallback() {
       // Optimization:  We're also safe if the buffer is non-empty and it ends
       // with a byte that would terminate a varint.
       (buffer_end_ > buffer_ && !(buffer_end_[-1] & 0x80))) {
-    uint64 temp;
-    ::std::pair<bool, const uint8*> p = ReadVarint64FromArray(buffer_, &temp);
-    if (!p.first || temp > static_cast<uint64>(INT_MAX)) return -1;
+    uint64_t temp;
+    ::std::pair<bool, const uint8_t*> p = ReadVarint64FromArray(buffer_, &temp);
+    if (!p.first || temp > static_cast<uint64_t>(INT_MAX)) return -1;
     buffer_ = p.second;
     return temp;
   } else {
@@ -454,7 +502,7 @@ int CodedInputStream::ReadVarintSizeAsIntFallback() {
   }
 }
 
-uint32 CodedInputStream::ReadTagSlow() {
+uint32_t CodedInputStream::ReadTagSlow() {
   if (buffer_ == buffer_end_) {
     // Call refresh.
     if (!Refresh()) {
@@ -475,12 +523,12 @@ uint32 CodedInputStream::ReadTagSlow() {
 
   // For the slow path, just do a 64-bit read. Try to optimize for one-byte tags
   // again, since we have now refreshed the buffer.
-  uint64 result = 0;
+  uint64_t result = 0;
   if (!ReadVarint64(&result)) return 0;
-  return static_cast<uint32>(result);
+  return static_cast<uint32_t>(result);
 }
 
-uint32 CodedInputStream::ReadTagFallback(uint32 first_byte_or_zero) {
+uint32_t CodedInputStream::ReadTagFallback(uint32_t first_byte_or_zero) {
   const int buf_size = BufferSize();
   if (buf_size >= kMaxVarintBytes ||
       // Optimization:  We're also safe if the buffer is non-empty and it ends
@@ -491,8 +539,8 @@ uint32 CodedInputStream::ReadTagFallback(uint32 first_byte_or_zero) {
       ++buffer_;
       return 0;
     }
-    uint32 tag;
-    ::std::pair<bool, const uint8*> p =
+    uint32_t tag;
+    ::std::pair<bool, const uint8_t*> p =
         ReadVarint32FromArray(first_byte_or_zero, buffer_, &tag);
     if (!p.first) {
       return 0;
@@ -517,13 +565,13 @@ uint32 CodedInputStream::ReadTagFallback(uint32 first_byte_or_zero) {
   }
 }
 
-bool CodedInputStream::ReadVarint64Slow(uint64* value) {
+bool CodedInputStream::ReadVarint64Slow(uint64_t* value) {
   // Slow path:  This read might cross the end of the buffer, so we
   // need to check and refresh the buffer if and when it does.
 
-  uint64 result = 0;
+  uint64_t result = 0;
   int count = 0;
-  uint32 b;
+  uint32_t b;
 
   do {
     if (count == kMaxVarintBytes) {
@@ -537,7 +585,7 @@ bool CodedInputStream::ReadVarint64Slow(uint64* value) {
       }
     }
     b = *buffer_;
-    result |= static_cast<uint64>(b & 0x7F) << (7 * count);
+    result |= static_cast<uint64_t>(b & 0x7F) << (7 * count);
     Advance(1);
     ++count;
   } while (b & 0x80);
@@ -546,20 +594,20 @@ bool CodedInputStream::ReadVarint64Slow(uint64* value) {
   return true;
 }
 
-std::pair<uint64, bool> CodedInputStream::ReadVarint64Fallback() {
+std::pair<uint64_t, bool> CodedInputStream::ReadVarint64Fallback() {
   if (BufferSize() >= kMaxVarintBytes ||
       // Optimization:  We're also safe if the buffer is non-empty and it ends
       // with a byte that would terminate a varint.
       (buffer_end_ > buffer_ && !(buffer_end_[-1] & 0x80))) {
-    uint64 temp;
-    ::std::pair<bool, const uint8*> p = ReadVarint64FromArray(buffer_, &temp);
+    uint64_t temp;
+    ::std::pair<bool, const uint8_t*> p = ReadVarint64FromArray(buffer_, &temp);
     if (!p.first) {
       return std::make_pair(0, false);
     }
     buffer_ = p.second;
     return std::make_pair(temp, true);
   } else {
-    uint64 temp;
+    uint64_t temp;
     bool success = ReadVarint64Slow(&temp);
     return std::make_pair(temp, success);
   }
@@ -585,7 +633,7 @@ bool CodedInputStream::Refresh() {
   const void* void_buffer;
   int buffer_size;
   if (NextNonEmpty(input_, &void_buffer, &buffer_size)) {
-    buffer_ = reinterpret_cast<const uint8*>(void_buffer);
+    buffer_ = reinterpret_cast<const uint8_t*>(void_buffer);
     buffer_end_ = buffer_ + buffer_size;
     GOOGLE_CHECK_GE(buffer_size, 0);
 
@@ -618,174 +666,313 @@ bool CodedInputStream::Refresh() {
 
 // CodedOutputStream =================================================
 
-google::protobuf::internal::AtomicWord CodedOutputStream::default_serialization_deterministic_ = 0;
-
-CodedOutputStream::CodedOutputStream(ZeroCopyOutputStream* output)
-  : output_(output),
-    buffer_(NULL),
-    buffer_size_(0),
-    total_bytes_(0),
-    had_error_(false),
-    aliasing_enabled_(false),
-    serialization_deterministic_is_overridden_(false) {
-  // Eagerly Refresh() so buffer space is immediately available.
-  Refresh();
-  // The Refresh() may have failed. If the client doesn't write any data,
-  // though, don't consider this an error. If the client does write data, then
-  // another Refresh() will be attempted and it will set the error once again.
-  had_error_ = false;
-}
-
-CodedOutputStream::CodedOutputStream(ZeroCopyOutputStream* output,
-                                     bool do_eager_refresh)
-  : output_(output),
-    buffer_(NULL),
-    buffer_size_(0),
-    total_bytes_(0),
-    had_error_(false),
-    aliasing_enabled_(false),
-    serialization_deterministic_is_overridden_(false) {
-  if (do_eager_refresh) {
-    // Eagerly Refresh() so buffer space is immediately available.
-    Refresh();
-    // The Refresh() may have failed. If the client doesn't write any data,
-    // though, don't consider this an error. If the client does write data, then
-    // another Refresh() will be attempted and it will set the error once again.
-    had_error_ = false;
-  }
+void EpsCopyOutputStream::EnableAliasing(bool enabled) {
+  aliasing_enabled_ = enabled && stream_->AllowsAliasing();
 }
 
-CodedOutputStream::~CodedOutputStream() {
-  Trim();
+int64_t EpsCopyOutputStream::ByteCount(uint8_t* ptr) const {
+  // Calculate the current offset relative to the end of the stream buffer.
+  int delta = (end_ - ptr) + (buffer_end_ ? 0 : kSlopBytes);
+  return stream_->ByteCount() - delta;
 }
 
-void CodedOutputStream::Trim() {
-  if (buffer_size_ > 0) {
-    output_->BackUp(buffer_size_);
-    total_bytes_ -= buffer_size_;
-    buffer_size_ = 0;
-    buffer_ = NULL;
+// Flushes what's written out to the underlying ZeroCopyOutputStream buffers.
+// Returns the size remaining in the buffer and sets buffer_end_ to the start
+// of the remaining buffer, ie. [buffer_end_, buffer_end_ + return value)
+int EpsCopyOutputStream::Flush(uint8_t* ptr) {
+  while (buffer_end_ && ptr > end_) {
+    int overrun = ptr - end_;
+    GOOGLE_DCHECK(!had_error_);
+    GOOGLE_DCHECK(overrun <= kSlopBytes);  // NOLINT
+    ptr = Next() + overrun;
+    if (had_error_) return 0;
+  }
+  int s;
+  if (buffer_end_) {
+    std::memcpy(buffer_end_, buffer_, ptr - buffer_);
+    buffer_end_ += ptr - buffer_;
+    s = end_ - ptr;
+  } else {
+    // The stream is writing directly in the ZeroCopyOutputStream buffer.
+    s = end_ + kSlopBytes - ptr;
+    buffer_end_ = ptr;
   }
+  GOOGLE_DCHECK(s >= 0);  // NOLINT
+  return s;
 }
 
-bool CodedOutputStream::Skip(int count) {
-  if (count < 0) return false;
+uint8_t* EpsCopyOutputStream::Trim(uint8_t* ptr) {
+  if (had_error_) return ptr;
+  int s = Flush(ptr);
+  if (s) stream_->BackUp(s);
+  // Reset to initial state (expecting new buffer)
+  buffer_end_ = end_ = buffer_;
+  return buffer_;
+}
 
-  while (count > buffer_size_) {
-    count -= buffer_size_;
-    if (!Refresh()) return false;
-  }
 
-  Advance(count);
-  return true;
+uint8_t* EpsCopyOutputStream::FlushAndResetBuffer(uint8_t* ptr) {
+  if (had_error_) return buffer_;
+  int s = Flush(ptr);
+  if (had_error_) return buffer_;
+  return SetInitialBuffer(buffer_end_, s);
 }
 
-bool CodedOutputStream::GetDirectBufferPointer(void** data, int* size) {
-  if (buffer_size_ == 0 && !Refresh()) return false;
-
-  *data = buffer_;
-  *size = buffer_size_;
+bool EpsCopyOutputStream::Skip(int count, uint8_t** pp) {
+  if (count < 0) return false;
+  if (had_error_) {
+    *pp = buffer_;
+    return false;
+  }
+  int size = Flush(*pp);
+  if (had_error_) {
+    *pp = buffer_;
+    return false;
+  }
+  void* data = buffer_end_;
+  while (count > size) {
+    count -= size;
+    if (!stream_->Next(&data, &size)) {
+      *pp = Error();
+      return false;
+    }
+  }
+  *pp = SetInitialBuffer(static_cast<uint8_t*>(data) + count, size - count);
   return true;
 }
 
-void CodedOutputStream::WriteRaw(const void* data, int size) {
-  while (buffer_size_ < size) {
-    memcpy(buffer_, data, buffer_size_);
-    size -= buffer_size_;
-    data = reinterpret_cast<const uint8*>(data) + buffer_size_;
-    if (!Refresh()) return;
+bool EpsCopyOutputStream::GetDirectBufferPointer(void** data, int* size,
+                                                 uint8_t** pp) {
+  if (had_error_) {
+    *pp = buffer_;
+    return false;
   }
-
-  memcpy(buffer_, data, size);
-  Advance(size);
+  *size = Flush(*pp);
+  if (had_error_) {
+    *pp = buffer_;
+    return false;
+  }
+  *data = buffer_end_;
+  while (*size == 0) {
+    if (!stream_->Next(data, size)) {
+      *pp = Error();
+      return false;
+    }
+  }
+  *pp = SetInitialBuffer(*data, *size);
+  return true;
 }
 
-uint8* CodedOutputStream::WriteRawToArray(
-    const void* data, int size, uint8* target) {
-  memcpy(target, data, size);
-  return target + size;
+uint8_t* EpsCopyOutputStream::GetDirectBufferForNBytesAndAdvance(int size,
+                                                               uint8_t** pp) {
+  if (had_error_) {
+    *pp = buffer_;
+    return nullptr;
+  }
+  int s = Flush(*pp);
+  if (had_error_) {
+    *pp = buffer_;
+    return nullptr;
+  }
+  if (s >= size) {
+    auto res = buffer_end_;
+    *pp = SetInitialBuffer(buffer_end_ + size, s - size);
+    return res;
+  } else {
+    *pp = SetInitialBuffer(buffer_end_, s);
+    return nullptr;
+  }
 }
 
-
-void CodedOutputStream::WriteAliasedRaw(const void* data, int size) {
-  if (size < buffer_size_
-      ) {
-    WriteRaw(data, size);
+uint8_t* EpsCopyOutputStream::Next() {
+  GOOGLE_DCHECK(!had_error_);  // NOLINT
+  if (PROTOBUF_PREDICT_FALSE(stream_ == nullptr)) return Error();
+  if (buffer_end_) {
+    // We're in the patch buffer and need to fill up the previous buffer.
+    std::memcpy(buffer_end_, buffer_, end_ - buffer_);
+    uint8_t* ptr;
+    int size;
+    do {
+      void* data;
+      if (PROTOBUF_PREDICT_FALSE(!stream_->Next(&data, &size))) {
+        // Stream has an error, we use the patch buffer to continue to be
+        // able to write.
+        return Error();
+      }
+      ptr = static_cast<uint8_t*>(data);
+    } while (size == 0);
+    if (PROTOBUF_PREDICT_TRUE(size > kSlopBytes)) {
+      std::memcpy(ptr, end_, kSlopBytes);
+      end_ = ptr + size - kSlopBytes;
+      buffer_end_ = nullptr;
+      return ptr;
+    } else {
+      GOOGLE_DCHECK(size > 0);  // NOLINT
+      // Buffer to small
+      std::memmove(buffer_, end_, kSlopBytes);
+      buffer_end_ = ptr;
+      end_ = buffer_ + size;
+      return buffer_;
+    }
   } else {
-    Trim();
-
-    total_bytes_ += size;
-    had_error_ |= !output_->WriteAliasedRaw(data, size);
+    std::memcpy(buffer_, end_, kSlopBytes);
+    buffer_end_ = end_;
+    end_ = buffer_ + kSlopBytes;
+    return buffer_;
   }
 }
 
-void CodedOutputStream::WriteLittleEndian32(uint32 value) {
-  uint8 bytes[sizeof(value)];
-
-  bool use_fast = buffer_size_ >= sizeof(value);
-  uint8* ptr = use_fast ? buffer_ : bytes;
-
-  WriteLittleEndian32ToArray(value, ptr);
+uint8_t* EpsCopyOutputStream::EnsureSpaceFallback(uint8_t* ptr) {
+  do {
+    if (PROTOBUF_PREDICT_FALSE(had_error_)) return buffer_;
+    int overrun = ptr - end_;
+    GOOGLE_DCHECK(overrun >= 0);           // NOLINT
+    GOOGLE_DCHECK(overrun <= kSlopBytes);  // NOLINT
+    ptr = Next() + overrun;
+  } while (ptr >= end_);
+  GOOGLE_DCHECK(ptr < end_);  // NOLINT
+  return ptr;
+}
+
+uint8_t* EpsCopyOutputStream::WriteRawFallback(const void* data, int size,
+                                             uint8_t* ptr) {
+  int s = GetSize(ptr);
+  while (s < size) {
+    std::memcpy(ptr, data, s);
+    size -= s;
+    data = static_cast<const uint8_t*>(data) + s;
+    ptr = EnsureSpaceFallback(ptr + s);
+    s = GetSize(ptr);
+  }
+  std::memcpy(ptr, data, size);
+  return ptr + size;
+}
 
-  if (use_fast) {
-    Advance(sizeof(value));
+uint8_t* EpsCopyOutputStream::WriteAliasedRaw(const void* data, int size,
+                                            uint8_t* ptr) {
+  if (size < GetSize(ptr)
+  ) {
+    return WriteRaw(data, size, ptr);
   } else {
-    WriteRaw(bytes, sizeof(value));
+    ptr = Trim(ptr);
+    if (stream_->WriteAliasedRaw(data, size)) return ptr;
+    return Error();
   }
 }
 
-void CodedOutputStream::WriteLittleEndian64(uint64 value) {
-  uint8 bytes[sizeof(value)];
-
-  bool use_fast = buffer_size_ >= sizeof(value);
-  uint8* ptr = use_fast ? buffer_ : bytes;
-
-  WriteLittleEndian64ToArray(value, ptr);
-
-  if (use_fast) {
-    Advance(sizeof(value));
-  } else {
-    WriteRaw(bytes, sizeof(value));
+#ifndef PROTOBUF_LITTLE_ENDIAN
+uint8_t* EpsCopyOutputStream::WriteRawLittleEndian32(const void* data, int size,
+                                                   uint8_t* ptr) {
+  auto p = static_cast<const uint8_t*>(data);
+  auto end = p + size;
+  while (end - p >= kSlopBytes) {
+    ptr = EnsureSpace(ptr);
+    uint32_t buffer[4];
+    static_assert(sizeof(buffer) == kSlopBytes, "Buffer must be kSlopBytes");
+    std::memcpy(buffer, p, kSlopBytes);
+    p += kSlopBytes;
+    for (auto x : buffer)
+      ptr = CodedOutputStream::WriteLittleEndian32ToArray(x, ptr);
+  }
+  while (p < end) {
+    ptr = EnsureSpace(ptr);
+    uint32_t buffer;
+    std::memcpy(&buffer, p, 4);
+    p += 4;
+    ptr = CodedOutputStream::WriteLittleEndian32ToArray(buffer, ptr);
+  }
+  return ptr;
+}
+
+uint8_t* EpsCopyOutputStream::WriteRawLittleEndian64(const void* data, int size,
+                                                   uint8_t* ptr) {
+  auto p = static_cast<const uint8_t*>(data);
+  auto end = p + size;
+  while (end - p >= kSlopBytes) {
+    ptr = EnsureSpace(ptr);
+    uint64_t buffer[2];
+    static_assert(sizeof(buffer) == kSlopBytes, "Buffer must be kSlopBytes");
+    std::memcpy(buffer, p, kSlopBytes);
+    p += kSlopBytes;
+    for (auto x : buffer)
+      ptr = CodedOutputStream::WriteLittleEndian64ToArray(x, ptr);
   }
+  while (p < end) {
+    ptr = EnsureSpace(ptr);
+    uint64_t buffer;
+    std::memcpy(&buffer, p, 8);
+    p += 8;
+    ptr = CodedOutputStream::WriteLittleEndian64ToArray(buffer, ptr);
+  }
+  return ptr;
 }
+#endif
+
 
-void CodedOutputStream::WriteVarint32SlowPath(uint32 value) {
-  uint8 bytes[kMaxVarint32Bytes];
-  uint8* target = &bytes[0];
-  uint8* end = WriteVarint32ToArray(value, target);
-  int size = end - target;
-  WriteRaw(bytes, size);
+uint8_t* EpsCopyOutputStream::WriteStringMaybeAliasedOutline(uint32_t num,
+                                                           const std::string& s,
+                                                           uint8_t* ptr) {
+  ptr = EnsureSpace(ptr);
+  uint32_t size = s.size();
+  ptr = WriteLengthDelim(num, size, ptr);
+  return WriteRawMaybeAliased(s.data(), size, ptr);
 }
 
-void CodedOutputStream::WriteVarint64SlowPath(uint64 value) {
-  uint8 bytes[kMaxVarintBytes];
-  uint8* target = &bytes[0];
-  uint8* end = WriteVarint64ToArray(value, target);
-  int size = end - target;
-  WriteRaw(bytes, size);
+uint8_t* EpsCopyOutputStream::WriteStringOutline(uint32_t num, const std::string& s,
+                                               uint8_t* ptr) {
+  ptr = EnsureSpace(ptr);
+  uint32_t size = s.size();
+  ptr = WriteLengthDelim(num, size, ptr);
+  return WriteRaw(s.data(), size, ptr);
 }
 
-bool CodedOutputStream::Refresh() {
-  void* void_buffer;
-  if (output_->Next(&void_buffer, &buffer_size_)) {
-    buffer_ = reinterpret_cast<uint8*>(void_buffer);
-    total_bytes_ += buffer_size_;
-    return true;
-  } else {
-    buffer_ = NULL;
-    buffer_size_ = 0;
-    had_error_ = true;
-    return false;
+std::atomic<bool> CodedOutputStream::default_serialization_deterministic_{
+    false};
+
+CodedOutputStream::CodedOutputStream(ZeroCopyOutputStream* stream,
+                                     bool do_eager_refresh)
+    : impl_(stream, IsDefaultSerializationDeterministic(), &cur_),
+      start_count_(stream->ByteCount()) {
+  if (do_eager_refresh) {
+    void* data;
+    int size;
+    if (!stream->Next(&data, &size) || size == 0) return;
+    cur_ = impl_.SetInitialBuffer(data, size);
   }
 }
 
-uint8* CodedOutputStream::WriteStringWithSizeToArray(const string& str,
-                                                     uint8* target) {
-  GOOGLE_DCHECK_LE(str.size(), kuint32max);
+CodedOutputStream::~CodedOutputStream() { Trim(); }
+
+
+uint8_t* CodedOutputStream::WriteStringWithSizeToArray(const std::string& str,
+                                                     uint8_t* target) {
+  GOOGLE_DCHECK_LE(str.size(), std::numeric_limits<uint32_t>::max());
   target = WriteVarint32ToArray(str.size(), target);
   return WriteStringToArray(str, target);
 }
 
+uint8_t* CodedOutputStream::WriteVarint32ToArrayOutOfLineHelper(uint32_t value,
+                                                              uint8_t* target) {
+  GOOGLE_DCHECK_GE(value, 0x80);
+  target[0] |= static_cast<uint8_t>(0x80);
+  value >>= 7;
+  target[1] = static_cast<uint8_t>(value);
+  if (value < 0x80) {
+    return target + 2;
+  }
+  target += 2;
+  do {
+    // Turn on continuation bit in the byte we just wrote.
+    target[-1] |= static_cast<uint8_t>(0x80);
+    value >>= 7;
+    *target = static_cast<uint8_t>(value);
+    ++target;
+  } while (value >= 0x80);
+  return target;
+}
+
 }  // namespace io
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 02d87ea..45963ef 100644 (file)
@@ -67,7 +67,7 @@
 //   // Read a file created by the above code.
 //   int fd = open("myfile", O_RDONLY);
 //   ZeroCopyInputStream* raw_input = new FileInputStream(fd);
-//   CodedInputStream coded_input = new CodedInputStream(raw_input);
+//   CodedInputStream* coded_input = new CodedInputStream(raw_input);
 //
 //   coded_input->ReadLittleEndian32(&magic_number);
 //   if (magic_number != 1234) {
@@ -75,7 +75,7 @@
 //     return;
 //   }
 //
-//   uint32 size;
+//   uint32_t size;
 //   coded_input->ReadVarint32(&size);
 //
 //   char* text = new char[size + 1];
 #ifndef GOOGLE_PROTOBUF_IO_CODED_STREAM_H__
 #define GOOGLE_PROTOBUF_IO_CODED_STREAM_H__
 
+
 #include <assert.h>
+
+#include <atomic>
 #include <climits>
+#include <cstddef>
+#include <cstring>
+#include <limits>
 #include <string>
+#include <type_traits>
 #include <utility>
-#ifdef _MSC_VER
-  // Assuming windows is always little-endian.
-  #if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
-    #define PROTOBUF_LITTLE_ENDIAN 1
-  #endif
-  #if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
-    // If MSVC has "/RTCc" set, it will complain about truncating casts at
-    // runtime.  This file contains some intentional truncating casts.
-    #pragma runtime_checks("c", off)
-  #endif
+
+#ifdef _WIN32
+// Assuming windows is always little-endian.
+#if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
+#define PROTOBUF_LITTLE_ENDIAN 1
+#endif
+#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
+// If MSVC has "/RTCc" set, it will complain about truncating casts at
+// runtime.  This file contains some intentional truncating casts.
+#pragma runtime_checks("c", off)
+#endif
+#else
+#ifdef __APPLE__
+#include <machine/endian.h>  // __BYTE_ORDER
+#elif defined(__FreeBSD__)
+#include <sys/endian.h>  // __BYTE_ORDER
+#elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
+#include <sys/isa_defs.h>  // __BYTE_ORDER
+#elif defined(_AIX) || defined(__TOS_AIX__)
+#include <sys/machine.h>  // BYTE_ORDER
 #else
-  #include <sys/param.h>   // __BYTE_ORDER
-  #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
-         (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \
-      !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
-    #define PROTOBUF_LITTLE_ENDIAN 1
-  #endif
+#if !defined(__QNX__)
+#include <endian.h>  // __BYTE_ORDER
+#endif
+#endif
+#if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) ||    \
+     (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \
+    !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
+#define PROTOBUF_LITTLE_ENDIAN 1
+#endif
 #endif
-#include <google/protobuf/stubs/atomicops.h>
 #include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/strutil.h>
+#include <google/protobuf/port.h>
 #include <google/protobuf/stubs/port.h>
 
-namespace google {
 
+#include <google/protobuf/port_def.inc>
+
+namespace google {
 namespace protobuf {
 
 class DescriptorPool;
 class MessageFactory;
+class ZeroCopyCodedInputStream;
 
-namespace internal { void MapTestForceDeterministic(); }
+namespace internal {
+void MapTestForceDeterministic();
+class EpsCopyByteStream;
+}  // namespace internal
 
 namespace io {
 
@@ -152,8 +179,8 @@ class CodedInputStream;
 class CodedOutputStream;
 
 // Defined in other files.
-class ZeroCopyInputStream;           // zero_copy_stream.h
-class ZeroCopyOutputStream;          // zero_copy_stream.h
+class ZeroCopyInputStream;   // zero_copy_stream.h
+class ZeroCopyOutputStream;  // zero_copy_stream.h
 
 // Class which reads and decodes binary data which is composed of varint-
 // encoded integers and fixed-width pieces.  Wraps a ZeroCopyInputStream.
@@ -162,7 +189,9 @@ class ZeroCopyOutputStream;          // zero_copy_stream.h
 // Most methods of CodedInputStream that return a bool return false if an
 // underlying I/O error occurs or if the data is malformed.  Once such a
 // failure occurs, the CodedInputStream is broken and is no longer useful.
-class LIBPROTOBUF_EXPORT CodedInputStream {
+// After a failure, callers also should assume writes to "out" args may have
+// occurred, though nothing useful can be determined from those writes.
+class PROTOBUF_EXPORT CodedInputStream {
  public:
   // Create a CodedInputStream that reads from the given ZeroCopyInputStream.
   explicit CodedInputStream(ZeroCopyInputStream* input);
@@ -170,7 +199,7 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   // Create a CodedInputStream that reads from the given flat array.  This is
   // faster than using an ArrayInputStream.  PushLimit(size) is implied by
   // this constructor.
-  explicit CodedInputStream(const uint8* buffer, int size);
+  explicit CodedInputStream(const uint8_t* buffer, int size);
 
   // Destroy the CodedInputStream and position the underlying
   // ZeroCopyInputStream at the first unread byte.  If an error occurred while
@@ -198,45 +227,36 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
 
   // Like GetDirectBufferPointer, but this method is inlined, and does not
   // attempt to Refresh() if the buffer is currently empty.
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+  PROTOBUF_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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  bool InternalReadRawInline(void* buffer, int size);
-
   // Like ReadRaw, but reads into a string.
-  bool ReadString(string* buffer, int size);
-  // Like the above, with inlined optimizations. This should only be used
-  // by the protobuf implementation.
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  bool InternalReadStringInline(string* buffer, int size);
+  bool ReadString(std::string* buffer, int size);
 
 
   // Read a 32-bit little-endian integer.
-  bool ReadLittleEndian32(uint32* value);
+  bool ReadLittleEndian32(uint32_t* value);
   // Read a 64-bit little-endian integer.
-  bool ReadLittleEndian64(uint64* value);
+  bool ReadLittleEndian64(uint64_t* value);
 
   // These methods read from an externally provided buffer. The caller is
   // responsible for ensuring that the buffer has sufficient space.
   // Read a 32-bit little-endian integer.
-  static const uint8* ReadLittleEndian32FromArray(const uint8* buffer,
-                                                   uint32* value);
+  static const uint8_t* ReadLittleEndian32FromArray(const uint8_t* buffer,
+                                                    uint32_t* value);
   // Read a 64-bit little-endian integer.
-  static const uint8* ReadLittleEndian64FromArray(const uint8* buffer,
-                                                   uint64* value);
+  static const uint8_t* ReadLittleEndian64FromArray(const uint8_t* buffer,
+                                                    uint64_t* value);
 
   // Read an unsigned integer with Varint encoding, truncating to 32 bits.
   // Reading a 32-bit value is equivalent to reading a 64-bit one and casting
-  // it to uint32, but may be more efficient.
-  bool ReadVarint32(uint32* value);
+  // it to uint32_t, but may be more efficient.
+  bool ReadVarint32(uint32_t* value);
   // Read an unsigned integer with Varint encoding.
-  bool ReadVarint64(uint64* value);
+  bool ReadVarint64(uint64_t* value);
 
   // Reads a varint off the wire into an "int". This should be used for reading
   // sizes off the wire (sizes of strings, submessages, bytes fields, etc).
@@ -257,12 +277,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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE uint32 ReadTag() {
+  PROTOBUF_ALWAYS_INLINE uint32_t ReadTag() {
     return last_tag_ = ReadTagNoLastTag();
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE uint32 ReadTagNoLastTag();
-
+  PROTOBUF_ALWAYS_INLINE uint32_t ReadTagNoLastTag();
 
   // This usually a faster alternative to ReadTag() when cutoff is a manifest
   // constant.  It does particularly well for cutoff >= 127.  The first part
@@ -272,15 +291,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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  std::pair<uint32, bool> ReadTagWithCutoff(uint32 cutoff) {
-    std::pair<uint32, bool> result = ReadTagWithCutoffNoLastTag(cutoff);
+  PROTOBUF_ALWAYS_INLINE
+  std::pair<uint32_t, bool> ReadTagWithCutoff(uint32_t cutoff) {
+    std::pair<uint32_t, bool> result = ReadTagWithCutoffNoLastTag(cutoff);
     last_tag_ = result.first;
     return result;
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  std::pair<uint32, bool> ReadTagWithCutoffNoLastTag(uint32 cutoff);
+  PROTOBUF_ALWAYS_INLINE
+  std::pair<uint32_t, bool> ReadTagWithCutoffNoLastTag(uint32_t cutoff);
 
   // Usually returns true if calling ReadVarint32() now would produce the given
   // value.  Will always return false if ReadVarint32() would not return the
@@ -289,7 +308,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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool ExpectTag(uint32 expected);
+  PROTOBUF_ALWAYS_INLINE bool ExpectTag(uint32_t 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
@@ -298,8 +317,9 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   //
   // Returns a pointer beyond the expected tag if it was found, or NULL if it
   // was not.
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static const uint8* ExpectTagFromArray(const uint8* buffer, uint32 expected);
+  PROTOBUF_ALWAYS_INLINE
+  static const uint8_t* ExpectTagFromArray(const uint8_t* buffer,
+                                           uint32_t 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
@@ -318,8 +338,8 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   // of the enclosing message.  The enclosing message would like to check that
   // tag to make sure it had the right number, so it calls LastTagWas() on
   // return from the embedded parser to check.
-  bool LastTagWas(uint32 expected);
-  void SetLastTag(uint32 tag) { last_tag_ = tag; }
+  bool LastTagWas(uint32_t expected);
+  void SetLastTag(uint32_t tag) { last_tag_ = tag; }
 
   // When parsing message (but NOT a group), this method must be called
   // immediately after MergeFromCodedStream() returns (if it returns true)
@@ -328,6 +348,7 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   // It also checks for some cases where, due to optimizations,
   // MergeFromCodedStream() can incorrectly return true.
   bool ConsumedEntireMessage();
+  void SetConsumed() { legitimate_message_end_ = true; }
 
   // Limits ----------------------------------------------------------
   // Limits are used when parsing length-delimited embedded messages.
@@ -367,42 +388,25 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
 
   // Total Bytes Limit -----------------------------------------------
   // To prevent malicious users from sending excessively large messages
-  // and causing integer overflows or memory exhaustion, CodedInputStream
-  // imposes a hard limit on the total number of bytes it will read.
+  // and causing memory exhaustion, CodedInputStream imposes a hard limit on
+  // the total number of bytes it will read.
 
   // Sets the maximum number of bytes that this CodedInputStream will read
-  // before refusing to continue.  To prevent integer overflows in the
-  // protocol buffers implementation, as well as to prevent servers from
-  // allocating enormous amounts of memory to hold parsed messages, the
-  // maximum message length should be limited to the shortest length that
-  // will not harm usability.  The theoretical shortest message that could
-  // cause integer overflows is 512MB.  The default limit is 64MB.  Apps
-  // should set shorter limits if possible.  For backwards compatibility all
-  // negative values get squashed to -1, as other negative values might have
-  // special internal meanings.  An error will always be printed to stderr if
-  // the limit is reached.
+  // before refusing to continue.  To prevent servers from allocating enormous
+  // amounts of memory to hold parsed messages, the maximum message length
+  // should be limited to the shortest length that will not harm usability.
+  // The default limit is INT_MAX (~2GB) and apps should set shorter limits
+  // if possible. An error will always be printed to stderr if the limit is
+  // reached.
   //
-  // This is unrelated to PushLimit()/PopLimit().
+  // Note: setting a limit less than the current read position is interpreted
+  // as a limit on the current position.
   //
-  // Hint:  If you are reading this because your program is printing a
-  //   warning about dangerously large protocol messages, you may be
-  //   confused about what to do next.  The best option is to change your
-  //   design such that excessively large messages are not necessary.
-  //   For example, try to design file formats to consist of many small
-  //   messages rather than a single large one.  If this is infeasible,
-  //   you will need to increase the limit.  Chances are, though, that
-  //   your code never constructs a CodedInputStream on which the limit
-  //   can be set.  You probably parse messages by calling things like
-  //   Message::ParseFromString().  In this case, you will need to change
-  //   your code to instead construct some sort of ZeroCopyInputStream
-  //   (e.g. an ArrayInputStream), construct a CodedInputStream around
-  //   that, then you can adjust the limit. Then call
-  //   Message::ParseFromCodedStream() instead. Yes, it's more work, but
-  //   you're doing something unusual.
-  void SetTotalBytesLimit(int total_bytes_limit, int warning_threshold);
-
-  // The Total Bytes Limit minus the Current Position, or -1 if there
-  // is no Total Bytes Limit.
+  // This is unrelated to PushLimit()/PopLimit().
+  void SetTotalBytesLimit(int total_bytes_limit);
+
+  // The Total Bytes Limit minus the Current Position, or -1 if the total bytes
+  // limit is INT_MAX.
   int BytesUntilTotalBytesLimit() const;
 
   // Recursion Limit -------------------------------------------------
@@ -413,7 +417,9 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
 
   // Sets the maximum recursion depth.  The default is 100.
   void SetRecursionLimit(int limit);
+  int RecursionBudget() { return recursion_budget_; }
 
+  static int GetDefaultRecursionLimit() { return default_recursion_limit_; }
 
   // Increments the current recursion depth.  Returns true if the depth is
   // under the limit, false if it has gone over.
@@ -536,8 +542,8 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CodedInputStream);
 
-  const uint8* buffer_;
-  const uint8* buffer_end_;     // pointer to the end of the buffer.
+  const uint8_t* buffer_;
+  const uint8_t* buffer_end_;  // pointer to the end of the buffer.
   ZeroCopyInputStream* input_;
   int total_bytes_read_;  // total bytes read from input_, including
                           // the current buffer
@@ -547,7 +553,7 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   int overflow_bytes_;
 
   // LastTagWas() stuff.
-  uint32 last_tag_;         // result of last ReadTag() or ReadTagWithCutoff().
+  uint32_t last_tag_;  // result of last ReadTag() or ReadTagWithCutoff().
 
   // This is set true by ReadTag{Fallback/Slow}() if it is called when exactly
   // at EOF, or by ExpectAtEnd() when it returns true.  This happens when we
@@ -558,7 +564,7 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   bool aliasing_enabled_;
 
   // Limits
-  Limit current_limit_;   // if position = -1, no limit is applied
+  Limit current_limit_;  // if position = -1, no limit is applied
 
   // For simplicity, if the current buffer crosses a limit (either a normal
   // limit created by PushLimit() or the total bytes limit), buffer_size_
@@ -580,8 +586,6 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   // Recursion depth limit, set by SetRecursionLimit().
   int recursion_limit_;
 
-  bool disable_strict_correctness_enforcement_;
-
   // See SetExtensionRegistry().
   const DescriptorPool* extension_pool_;
   MessageFactory* extension_factory_;
@@ -617,23 +621,23 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   // message crosses multiple buffers.  Note: ReadVarint32Fallback() and
   // ReadVarint64Fallback() are called frequently and generally not inlined, so
   // they have been optimized to avoid "out" parameters.  The former returns -1
-  // if it fails and the uint32 it read otherwise.  The latter has a bool
+  // if it fails and the uint32_t it read otherwise.  The latter has a bool
   // indicating success or failure as part of its return type.
-  int64 ReadVarint32Fallback(uint32 first_byte_or_zero);
+  int64_t ReadVarint32Fallback(uint32_t first_byte_or_zero);
   int ReadVarintSizeAsIntFallback();
-  std::pair<uint64, bool> ReadVarint64Fallback();
-  bool ReadVarint32Slow(uint32* value);
-  bool ReadVarint64Slow(uint64* value);
+  std::pair<uint64_t, bool> ReadVarint64Fallback();
+  bool ReadVarint32Slow(uint32_t* value);
+  bool ReadVarint64Slow(uint64_t* value);
   int ReadVarintSizeAsIntSlow();
-  bool ReadLittleEndian32Fallback(uint32* value);
-  bool ReadLittleEndian64Fallback(uint64* value);
+  bool ReadLittleEndian32Fallback(uint32_t* value);
+  bool ReadLittleEndian64Fallback(uint64_t* value);
 
   // Fallback/slow methods for reading tags. These do not update last_tag_,
   // but will set legitimate_message_end_ if we are at the end of the input
   // stream.
-  uint32 ReadTagFallback(uint32 first_byte_or_zero);
-  uint32 ReadTagSlow();
-  bool ReadStringFallback(string* buffer, int size);
+  uint32_t ReadTagFallback(uint32_t first_byte_or_zero);
+  uint32_t ReadTagSlow();
+  bool ReadStringFallback(std::string* buffer, int size);
 
   // Return the size of the buffer.
   int BufferSize() const;
@@ -641,8 +645,380 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
   static const int kDefaultTotalBytesLimit = INT_MAX;
 
   static int default_recursion_limit_;  // 100 by default.
+
+  friend class google::protobuf::ZeroCopyCodedInputStream;
+  friend class google::protobuf::internal::EpsCopyByteStream;
 };
 
+// EpsCopyOutputStream wraps a ZeroCopyOutputStream and exposes a new stream,
+// which has the property you can write kSlopBytes (16 bytes) from the current
+// position without bounds checks. The cursor into the stream is managed by
+// the user of the class and is an explicit parameter in the methods. Careful
+// use of this class, ie. keep ptr a local variable, eliminates the need to
+// for the compiler to sync the ptr value between register and memory.
+class PROTOBUF_EXPORT EpsCopyOutputStream {
+ public:
+  enum { kSlopBytes = 16 };
+
+  // Initialize from a stream.
+  EpsCopyOutputStream(ZeroCopyOutputStream* stream, bool deterministic,
+                      uint8_t** pp)
+      : end_(buffer_),
+        stream_(stream),
+        is_serialization_deterministic_(deterministic) {
+    *pp = buffer_;
+  }
+
+  // Only for array serialization. No overflow protection, end_ will be the
+  // pointed to the end of the array. When using this the total size is already
+  // known, so no need to maintain the slop region.
+  EpsCopyOutputStream(void* data, int size, bool deterministic)
+      : end_(static_cast<uint8_t*>(data) + size),
+        buffer_end_(nullptr),
+        stream_(nullptr),
+        is_serialization_deterministic_(deterministic) {}
+
+  // Initialize from stream but with the first buffer already given (eager).
+  EpsCopyOutputStream(void* data, int size, ZeroCopyOutputStream* stream,
+                      bool deterministic, uint8_t** pp)
+      : stream_(stream), is_serialization_deterministic_(deterministic) {
+    *pp = SetInitialBuffer(data, size);
+  }
+
+  // Flush everything that's written into the underlying ZeroCopyOutputStream
+  // and trims the underlying stream to the location of ptr.
+  uint8_t* Trim(uint8_t* ptr);
+
+  // After this it's guaranteed you can safely write kSlopBytes to ptr. This
+  // will never fail! The underlying stream can produce an error. Use HadError
+  // to check for errors.
+  PROTOBUF_NODISCARD uint8_t* EnsureSpace(uint8_t* ptr) {
+    if (PROTOBUF_PREDICT_FALSE(ptr >= end_)) {
+      return EnsureSpaceFallback(ptr);
+    }
+    return ptr;
+  }
+
+  uint8_t* WriteRaw(const void* data, int size, uint8_t* ptr) {
+    if (PROTOBUF_PREDICT_FALSE(end_ - ptr < size)) {
+      return WriteRawFallback(data, size, ptr);
+    }
+    std::memcpy(ptr, data, size);
+    return ptr + size;
+  }
+  // Writes the buffer specified by data, size to the stream. Possibly by
+  // aliasing the buffer (ie. not copying the data). The caller is responsible
+  // to make sure the buffer is alive for the duration of the
+  // ZeroCopyOutputStream.
+#ifndef NDEBUG
+  PROTOBUF_NOINLINE
+#endif
+  uint8_t* WriteRawMaybeAliased(const void* data, int size, uint8_t* ptr) {
+    if (aliasing_enabled_) {
+      return WriteAliasedRaw(data, size, ptr);
+    } else {
+      return WriteRaw(data, size, ptr);
+    }
+  }
+
+
+#ifndef NDEBUG
+  PROTOBUF_NOINLINE
+#endif
+  uint8_t* WriteStringMaybeAliased(uint32_t num, const std::string& s,
+                                   uint8_t* ptr) {
+    std::ptrdiff_t size = s.size();
+    if (PROTOBUF_PREDICT_FALSE(
+            size >= 128 || end_ - ptr + 16 - TagSize(num << 3) - 1 < size)) {
+      return WriteStringMaybeAliasedOutline(num, s, ptr);
+    }
+    ptr = UnsafeVarint((num << 3) | 2, ptr);
+    *ptr++ = static_cast<uint8_t>(size);
+    std::memcpy(ptr, s.data(), size);
+    return ptr + size;
+  }
+  uint8_t* WriteBytesMaybeAliased(uint32_t num, const std::string& s,
+                                  uint8_t* ptr) {
+    return WriteStringMaybeAliased(num, s, ptr);
+  }
+
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteString(uint32_t num, const T& s,
+                                              uint8_t* ptr) {
+    std::ptrdiff_t size = s.size();
+    if (PROTOBUF_PREDICT_FALSE(
+            size >= 128 || end_ - ptr + 16 - TagSize(num << 3) - 1 < size)) {
+      return WriteStringOutline(num, s, ptr);
+    }
+    ptr = UnsafeVarint((num << 3) | 2, ptr);
+    *ptr++ = static_cast<uint8_t>(size);
+    std::memcpy(ptr, s.data(), size);
+    return ptr + size;
+  }
+  template <typename T>
+#ifndef NDEBUG
+  PROTOBUF_NOINLINE
+#endif
+  uint8_t* WriteBytes(uint32_t num, const T& s, uint8_t* ptr) {
+    return WriteString(num, s, ptr);
+  }
+
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteInt32Packed(int num, const T& r,
+                                                   int size, uint8_t* ptr) {
+    return WriteVarintPacked(num, r, size, ptr, Encode64);
+  }
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteUInt32Packed(int num, const T& r,
+                                                    int size, uint8_t* ptr) {
+    return WriteVarintPacked(num, r, size, ptr, Encode32);
+  }
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteSInt32Packed(int num, const T& r,
+                                                    int size, uint8_t* ptr) {
+    return WriteVarintPacked(num, r, size, ptr, ZigZagEncode32);
+  }
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteInt64Packed(int num, const T& r,
+                                                   int size, uint8_t* ptr) {
+    return WriteVarintPacked(num, r, size, ptr, Encode64);
+  }
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteUInt64Packed(int num, const T& r,
+                                                    int size, uint8_t* ptr) {
+    return WriteVarintPacked(num, r, size, ptr, Encode64);
+  }
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteSInt64Packed(int num, const T& r,
+                                                    int size, uint8_t* ptr) {
+    return WriteVarintPacked(num, r, size, ptr, ZigZagEncode64);
+  }
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteEnumPacked(int num, const T& r, int size,
+                                                  uint8_t* ptr) {
+    return WriteVarintPacked(num, r, size, ptr, Encode64);
+  }
+
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteFixedPacked(int num, const T& r,
+                                                   uint8_t* ptr) {
+    ptr = EnsureSpace(ptr);
+    constexpr auto element_size = sizeof(typename T::value_type);
+    auto size = r.size() * element_size;
+    ptr = WriteLengthDelim(num, size, ptr);
+    return WriteRawLittleEndian<element_size>(r.data(), static_cast<int>(size),
+                                              ptr);
+  }
+
+  // Returns true if there was an underlying I/O error since this object was
+  // created.
+  bool HadError() const { return had_error_; }
+
+  // Instructs the EpsCopyOutputStream to allow the underlying
+  // ZeroCopyOutputStream to hold pointers to the original structure instead of
+  // copying, if it supports it (i.e. output->AllowsAliasing() is true).  If the
+  // underlying stream does not support aliasing, then enabling it has no
+  // affect.  For now, this only affects the behavior of
+  // WriteRawMaybeAliased().
+  //
+  // NOTE: It is caller's responsibility to ensure that the chunk of memory
+  // remains live until all of the data has been consumed from the stream.
+  void EnableAliasing(bool enabled);
+
+  // See documentation on CodedOutputStream::SetSerializationDeterministic.
+  void SetSerializationDeterministic(bool value) {
+    is_serialization_deterministic_ = value;
+  }
+
+  // See documentation on CodedOutputStream::IsSerializationDeterministic.
+  bool IsSerializationDeterministic() const {
+    return is_serialization_deterministic_;
+  }
+
+  // The number of bytes written to the stream at position ptr, relative to the
+  // stream's overall position.
+  int64_t ByteCount(uint8_t* ptr) const;
+
+
+ private:
+  uint8_t* end_;
+  uint8_t* buffer_end_ = buffer_;
+  uint8_t buffer_[2 * kSlopBytes];
+  ZeroCopyOutputStream* stream_;
+  bool had_error_ = false;
+  bool aliasing_enabled_ = false;  // See EnableAliasing().
+  bool is_serialization_deterministic_;
+
+  uint8_t* EnsureSpaceFallback(uint8_t* ptr);
+  inline uint8_t* Next();
+  int Flush(uint8_t* ptr);
+  std::ptrdiff_t GetSize(uint8_t* ptr) const {
+    GOOGLE_DCHECK(ptr <= end_ + kSlopBytes);  // NOLINT
+    return end_ + kSlopBytes - ptr;
+  }
+
+  uint8_t* Error() {
+    had_error_ = true;
+    // We use the patch buffer to always guarantee space to write to.
+    end_ = buffer_ + kSlopBytes;
+    return buffer_;
+  }
+
+  static constexpr int TagSize(uint32_t tag) {
+    return (tag < (1 << 7))    ? 1
+           : (tag < (1 << 14)) ? 2
+           : (tag < (1 << 21)) ? 3
+           : (tag < (1 << 28)) ? 4
+                               : 5;
+  }
+
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteTag(uint32_t num, uint32_t wt,
+                                           uint8_t* ptr) {
+    GOOGLE_DCHECK(ptr < end_);  // NOLINT
+    return UnsafeVarint((num << 3) | wt, ptr);
+  }
+
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteLengthDelim(int num, uint32_t size,
+                                                   uint8_t* ptr) {
+    ptr = WriteTag(num, 2, ptr);
+    return UnsafeWriteSize(size, ptr);
+  }
+
+  uint8_t* WriteRawFallback(const void* data, int size, uint8_t* ptr);
+
+  uint8_t* WriteAliasedRaw(const void* data, int size, uint8_t* ptr);
+
+  uint8_t* WriteStringMaybeAliasedOutline(uint32_t num, const std::string& s,
+                                          uint8_t* ptr);
+  uint8_t* WriteStringOutline(uint32_t num, const std::string& s, uint8_t* ptr);
+
+  template <typename T, typename E>
+  PROTOBUF_ALWAYS_INLINE uint8_t* WriteVarintPacked(int num, const T& r,
+                                                    int size, uint8_t* ptr,
+                                                    const E& encode) {
+    ptr = EnsureSpace(ptr);
+    ptr = WriteLengthDelim(num, size, ptr);
+    auto it = r.data();
+    auto end = it + r.size();
+    do {
+      ptr = EnsureSpace(ptr);
+      ptr = UnsafeVarint(encode(*it++), ptr);
+    } while (it < end);
+    return ptr;
+  }
+
+  static uint32_t Encode32(uint32_t v) { return v; }
+  static uint64_t Encode64(uint64_t v) { return v; }
+  static uint32_t ZigZagEncode32(int32_t v) {
+    return (static_cast<uint32_t>(v) << 1) ^ static_cast<uint32_t>(v >> 31);
+  }
+  static uint64_t ZigZagEncode64(int64_t v) {
+    return (static_cast<uint64_t>(v) << 1) ^ static_cast<uint64_t>(v >> 63);
+  }
+
+  template <typename T>
+  PROTOBUF_ALWAYS_INLINE static uint8_t* UnsafeVarint(T value, uint8_t* ptr) {
+    static_assert(std::is_unsigned<T>::value,
+                  "Varint serialization must be unsigned");
+    ptr[0] = static_cast<uint8_t>(value);
+    if (value < 0x80) {
+      return ptr + 1;
+    }
+    // Turn on continuation bit in the byte we just wrote.
+    ptr[0] |= static_cast<uint8_t>(0x80);
+    value >>= 7;
+    ptr[1] = static_cast<uint8_t>(value);
+    if (value < 0x80) {
+      return ptr + 2;
+    }
+    ptr += 2;
+    do {
+      // Turn on continuation bit in the byte we just wrote.
+      ptr[-1] |= static_cast<uint8_t>(0x80);
+      value >>= 7;
+      *ptr = static_cast<uint8_t>(value);
+      ++ptr;
+    } while (value >= 0x80);
+    return ptr;
+  }
+
+  PROTOBUF_ALWAYS_INLINE static uint8_t* UnsafeWriteSize(uint32_t value,
+                                                         uint8_t* ptr) {
+    while (PROTOBUF_PREDICT_FALSE(value >= 0x80)) {
+      *ptr = static_cast<uint8_t>(value | 0x80);
+      value >>= 7;
+      ++ptr;
+    }
+    *ptr++ = static_cast<uint8_t>(value);
+    return ptr;
+  }
+
+  template <int S>
+  uint8_t* WriteRawLittleEndian(const void* data, int size, uint8_t* ptr);
+#ifndef PROTOBUF_LITTLE_ENDIAN
+  uint8_t* WriteRawLittleEndian32(const void* data, int size, uint8_t* ptr);
+  uint8_t* WriteRawLittleEndian64(const void* data, int size, uint8_t* ptr);
+#endif
+
+  // These methods are for CodedOutputStream. Ideally they should be private
+  // but to match current behavior of CodedOutputStream as close as possible
+  // we allow it some functionality.
+ public:
+  uint8_t* SetInitialBuffer(void* data, int size) {
+    auto ptr = static_cast<uint8_t*>(data);
+    if (size > kSlopBytes) {
+      end_ = ptr + size - kSlopBytes;
+      buffer_end_ = nullptr;
+      return ptr;
+    } else {
+      end_ = buffer_ + size;
+      buffer_end_ = ptr;
+      return buffer_;
+    }
+  }
+
+ private:
+  // Needed by CodedOutputStream HadError. HadError needs to flush the patch
+  // buffers to ensure there is no error as of yet.
+  uint8_t* FlushAndResetBuffer(uint8_t*);
+
+  // The following functions mimic the old CodedOutputStream behavior as close
+  // as possible. They flush the current state to the stream, behave as
+  // the old CodedOutputStream and then return to normal operation.
+  bool Skip(int count, uint8_t** pp);
+  bool GetDirectBufferPointer(void** data, int* size, uint8_t** pp);
+  uint8_t* GetDirectBufferForNBytesAndAdvance(int size, uint8_t** pp);
+
+  friend class CodedOutputStream;
+};
+
+template <>
+inline uint8_t* EpsCopyOutputStream::WriteRawLittleEndian<1>(const void* data,
+                                                             int size,
+                                                             uint8_t* ptr) {
+  return WriteRaw(data, size, ptr);
+}
+template <>
+inline uint8_t* EpsCopyOutputStream::WriteRawLittleEndian<4>(const void* data,
+                                                             int size,
+                                                             uint8_t* ptr) {
+#ifdef PROTOBUF_LITTLE_ENDIAN
+  return WriteRaw(data, size, ptr);
+#else
+  return WriteRawLittleEndian32(data, size, ptr);
+#endif
+}
+template <>
+inline uint8_t* EpsCopyOutputStream::WriteRawLittleEndian<8>(const void* data,
+                                                             int size,
+                                                             uint8_t* ptr) {
+#ifdef PROTOBUF_LITTLE_ENDIAN
+  return WriteRaw(data, size, ptr);
+#else
+  return WriteRawLittleEndian64(data, size, ptr);
+#endif
+}
+
 // Class which encodes and writes binary data which is composed of varint-
 // encoded integers and fixed-width pieces.  Wraps a ZeroCopyOutputStream.
 // Most users will not need to deal with CodedOutputStream.
@@ -663,7 +1039,7 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
 // individual value.
 // i.e., in the example above:
 //
-//   CodedOutputStream coded_output = new CodedOutputStream(raw_output);
+//   CodedOutputStream* coded_output = new CodedOutputStream(raw_output);
 //   int magic_number = 1234;
 //   char text[] = "Hello world!";
 //
@@ -671,9 +1047,9 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
 //                    CodedOutputStream::VarintSize32(strlen(text)) +
 //                    strlen(text);
 //
-//   uint8* buffer =
+//   uint8_t* buffer =
 //       coded_output->GetDirectBufferForNBytesAndAdvance(coded_size);
-//   if (buffer != NULL) {
+//   if (buffer != nullptr) {
 //     // The output stream has enough space in the buffer: write directly to
 //     // the array.
 //     buffer = CodedOutputStream::WriteLittleEndian32ToArray(magic_number,
@@ -689,27 +1065,40 @@ class LIBPROTOBUF_EXPORT CodedInputStream {
 //   }
 //
 //   delete coded_output;
-class LIBPROTOBUF_EXPORT CodedOutputStream {
+class PROTOBUF_EXPORT CodedOutputStream {
  public:
   // Create an CodedOutputStream that writes to the given ZeroCopyOutputStream.
-  explicit CodedOutputStream(ZeroCopyOutputStream* output);
-  CodedOutputStream(ZeroCopyOutputStream* output, bool do_eager_refresh);
+  explicit CodedOutputStream(ZeroCopyOutputStream* stream)
+      : CodedOutputStream(stream, true) {}
+  CodedOutputStream(ZeroCopyOutputStream* stream, bool do_eager_refresh);
 
   // Destroy the CodedOutputStream and position the underlying
   // ZeroCopyOutputStream immediately after the last byte written.
   ~CodedOutputStream();
 
+  // Returns true if there was an underlying I/O error since this object was
+  // created. On should call Trim before this function in order to catch all
+  // errors.
+  bool HadError() {
+    cur_ = impl_.FlushAndResetBuffer(cur_);
+    GOOGLE_DCHECK(cur_);
+    return impl_.HadError();
+  }
+
   // Trims any unused space in the underlying buffer so that its size matches
   // the number of bytes written by this stream. The underlying buffer will
   // automatically be trimmed when this stream is destroyed; this call is only
   // necessary if the underlying buffer is accessed *before* the stream is
   // destroyed.
-  void Trim();
+  void Trim() { cur_ = impl_.Trim(cur_); }
 
   // Skips a number of bytes, leaving the bytes unmodified in the underlying
   // buffer.  Returns false if an underlying write error occurs.  This is
   // mainly useful with GetDirectBufferPointer().
-  bool Skip(int count);
+  // Note of caution, the skipped bytes may contain uninitialized data. The
+  // caller must make sure that the skipped bytes are properly initialized,
+  // otherwise you might leak bytes from your heap.
+  bool Skip(int count) { return impl_.Skip(count, &cur_); }
 
   // Sets *data to point directly at the unwritten part of the
   // CodedOutputStream's underlying buffer, and *size to the size of that
@@ -719,7 +1108,9 @@ class LIBPROTOBUF_EXPORT CodedOutputStream {
   // the consumed bytes.  This may be useful for implementing external fast
   // serialization routines for types of data not covered by the
   // CodedOutputStream interface.
-  bool GetDirectBufferPointer(void** data, int* size);
+  bool GetDirectBufferPointer(void** data, int* size) {
+    return impl_.GetDirectBufferPointer(data, size, &cur_);
+  }
 
   // If there are at least "size" bytes available in the current buffer,
   // returns a pointer directly into the buffer and advances over these bytes.
@@ -728,10 +1119,14 @@ class LIBPROTOBUF_EXPORT CodedOutputStream {
   // there are not enough bytes available, returns NULL.  The return pointer is
   // invalidated as soon as any other non-const method of CodedOutputStream
   // is called.
-  inline uint8* GetDirectBufferForNBytesAndAdvance(int size);
+  inline uint8_t* GetDirectBufferForNBytesAndAdvance(int size) {
+    return impl_.GetDirectBufferForNBytesAndAdvance(size, &cur_);
+  }
 
   // Write raw bytes, copying them from the given buffer.
-  void WriteRaw(const void* buffer, int size);
+  void WriteRaw(const void* buffer, int size) {
+    cur_ = impl_.WriteRaw(buffer, size, cur_);
+  }
   // Like WriteRaw()  but will try to write aliased data if aliasing is
   // turned on.
   void WriteRawMaybeAliased(const void* data, int size);
@@ -740,166 +1135,151 @@ class LIBPROTOBUF_EXPORT CodedOutputStream {
   // copy loops. Since this gets called by every field with string or bytes
   // type, inlining may lead to a significant amount of code bloat, with only a
   // minor performance gain.
-  static uint8* WriteRawToArray(const void* buffer, int size, uint8* target);
+  static uint8_t* WriteRawToArray(const void* buffer, int size,
+                                  uint8_t* target);
 
   // Equivalent to WriteRaw(str.data(), str.size()).
-  void WriteString(const string& str);
+  void WriteString(const std::string& str);
   // Like WriteString()  but writing directly to the target array.
-  static uint8* WriteStringToArray(const string& str, uint8* target);
+  static uint8_t* WriteStringToArray(const std::string& str, uint8_t* target);
   // Write the varint-encoded size of str followed by str.
-  static uint8* WriteStringWithSizeToArray(const string& str, uint8* target);
-
+  static uint8_t* WriteStringWithSizeToArray(const std::string& str,
+                                             uint8_t* target);
 
-  // Instructs the CodedOutputStream to allow the underlying
-  // ZeroCopyOutputStream to hold pointers to the original structure instead of
-  // copying, if it supports it (i.e. output->AllowsAliasing() is true).  If the
-  // underlying stream does not support aliasing, then enabling it has no
-  // affect.  For now, this only affects the behavior of
-  // WriteRawMaybeAliased().
-  //
-  // NOTE: It is caller's responsibility to ensure that the chunk of memory
-  // remains live until all of the data has been consumed from the stream.
-  void EnableAliasing(bool enabled);
 
   // Write a 32-bit little-endian integer.
-  void WriteLittleEndian32(uint32 value);
+  void WriteLittleEndian32(uint32_t value) {
+    cur_ = impl_.EnsureSpace(cur_);
+    SetCur(WriteLittleEndian32ToArray(value, Cur()));
+  }
   // Like WriteLittleEndian32()  but writing directly to the target array.
-  static uint8* WriteLittleEndian32ToArray(uint32 value, uint8* target);
+  static uint8_t* WriteLittleEndian32ToArray(uint32_t value, uint8_t* target);
   // Write a 64-bit little-endian integer.
-  void WriteLittleEndian64(uint64 value);
+  void WriteLittleEndian64(uint64_t value) {
+    cur_ = impl_.EnsureSpace(cur_);
+    SetCur(WriteLittleEndian64ToArray(value, Cur()));
+  }
   // Like WriteLittleEndian64()  but writing directly to the target array.
-  static uint8* WriteLittleEndian64ToArray(uint64 value, uint8* target);
+  static uint8_t* WriteLittleEndian64ToArray(uint64_t value, uint8_t* target);
 
   // Write an unsigned integer with Varint encoding.  Writing a 32-bit value
-  // is equivalent to casting it to uint64 and writing it as a 64-bit value,
+  // is equivalent to casting it to uint64_t and writing it as a 64-bit value,
   // but may be more efficient.
-  void WriteVarint32(uint32 value);
+  void WriteVarint32(uint32_t value);
   // Like WriteVarint32()  but writing directly to the target array.
-  static uint8* WriteVarint32ToArray(uint32 value, uint8* target);
+  static uint8_t* WriteVarint32ToArray(uint32_t value, uint8_t* target);
+  // Like WriteVarint32()  but writing directly to the target array, and with
+  // the less common-case paths being out of line rather than inlined.
+  static uint8_t* WriteVarint32ToArrayOutOfLine(uint32_t value,
+                                                uint8_t* target);
   // Write an unsigned integer with Varint encoding.
-  void WriteVarint64(uint64 value);
+  void WriteVarint64(uint64_t value);
   // Like WriteVarint64()  but writing directly to the target array.
-  static uint8* WriteVarint64ToArray(uint64 value, uint8* target);
+  static uint8_t* WriteVarint64ToArray(uint64_t value, uint8_t* target);
 
   // Equivalent to WriteVarint32() except when the value is negative,
   // in which case it must be sign-extended to a full 10 bytes.
-  void WriteVarint32SignExtended(int32 value);
+  void WriteVarint32SignExtended(int32_t value);
   // Like WriteVarint32SignExtended()  but writing directly to the target array.
-  static uint8* WriteVarint32SignExtendedToArray(int32 value, uint8* target);
+  static uint8_t* WriteVarint32SignExtendedToArray(int32_t value,
+                                                   uint8_t* target);
 
   // This is identical to WriteVarint32(), but optimized for writing tags.
   // In particular, if the input is a compile-time constant, this method
   // compiles down to a couple instructions.
-  // Always inline because otherwise the aformentioned optimization can't work,
+  // Always inline because otherwise the aforementioned optimization can't work,
   // but GCC by default doesn't want to inline this.
-  void WriteTag(uint32 value);
+  void WriteTag(uint32_t value);
   // Like WriteTag()  but writing directly to the target array.
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static uint8* WriteTagToArray(uint32 value, uint8* target);
+  PROTOBUF_ALWAYS_INLINE
+  static uint8_t* WriteTagToArray(uint32_t value, uint8_t* target);
 
   // Returns the number of bytes needed to encode the given value as a varint.
-  static size_t VarintSize32(uint32 value);
+  static size_t VarintSize32(uint32_t value);
   // Returns the number of bytes needed to encode the given value as a varint.
-  static size_t VarintSize64(uint64 value);
+  static size_t VarintSize64(uint64_t value);
+
+  // If negative, 10 bytes.  Otherwise, same as VarintSize32().
+  static size_t VarintSize32SignExtended(int32_t value);
 
-  // If negative, 10 bytes.  Otheriwse, same as VarintSize32().
-  static size_t VarintSize32SignExtended(int32 value);
+  // Same as above, plus one.  The additional one comes at no compute cost.
+  static size_t VarintSize32PlusOne(uint32_t value);
+  static size_t VarintSize64PlusOne(uint64_t value);
+  static size_t VarintSize32SignExtendedPlusOne(int32_t value);
 
   // Compile-time equivalent of VarintSize32().
-  template <uint32 Value>
+  template <uint32_t Value>
   struct StaticVarintSize32 {
-    static const size_t value =
-        (Value < (1 << 7))
-            ? 1
-            : (Value < (1 << 14))
-                ? 2
-                : (Value < (1 << 21))
-                    ? 3
-                    : (Value < (1 << 28))
-                        ? 4
-                        : 5;
+    static const size_t value = (Value < (1 << 7))    ? 1
+                                : (Value < (1 << 14)) ? 2
+                                : (Value < (1 << 21)) ? 3
+                                : (Value < (1 << 28)) ? 4
+                                                      : 5;
   };
 
   // Returns the total number of bytes written since this object was created.
-  inline int ByteCount() const;
+  int ByteCount() const {
+    return static_cast<int>(impl_.ByteCount(cur_) - start_count_);
+  }
 
-  // Returns true if there was an underlying I/O error since this object was
-  // created.
-  bool HadError() const { return had_error_; }
+  // Instructs the CodedOutputStream to allow the underlying
+  // ZeroCopyOutputStream to hold pointers to the original structure instead of
+  // copying, if it supports it (i.e. output->AllowsAliasing() is true).  If the
+  // underlying stream does not support aliasing, then enabling it has no
+  // affect.  For now, this only affects the behavior of
+  // WriteRawMaybeAliased().
+  //
+  // NOTE: It is caller's responsibility to ensure that the chunk of memory
+  // remains live until all of the data has been consumed from the stream.
+  void EnableAliasing(bool enabled) { impl_.EnableAliasing(enabled); }
 
-  // Deterministic serialization, if requested, guarantees that for a given
-  // binary, equal messages will always be serialized to the same bytes. This
-  // implies:
-  //   . repeated serialization of a message will return the same bytes
-  //   . different processes of the same binary (which may be executing on
-  //     different machines) will serialize equal messages to the same bytes.
+  // Indicate to the serializer whether the user wants derministic
+  // serialization. The default when this is not called comes from the global
+  // default, controlled by SetDefaultSerializationDeterministic.
   //
-  // Note the deterministic serialization is NOT canonical across languages; it
-  // is also unstable across different builds with schema changes due to unknown
-  // fields. Users who need canonical serialization, e.g., persistent storage in
-  // a canonical form, fingerprinting, etc., should define their own
-  // canonicalization specification and implement the serializer using
-  // reflection APIs rather than relying on this API.
+  // What deterministic serialization means is entirely up to the driver of the
+  // serialization process (i.e. the caller of methods like WriteVarint32). In
+  // the case of serializing a proto buffer message using one of the methods of
+  // MessageLite, this means that for a given binary equal messages will always
+  // be serialized to the same bytes. This implies:
+  //
+  //   * Repeated serialization of a message will return the same bytes.
   //
-  // If determinisitc serialization is requested, the serializer will
-  // sort map entries by keys in lexicographical order or numerical order.
-  // (This is an implementation detail and may subject to change.)
+  //   * Different processes running the same binary (including on different
+  //     machines) will serialize equal messages to the same bytes.
   //
-  // There are two ways to determine whether serialization should be
-  // deterministic for this CodedOutputStream.  If SetSerializationDeterministic
-  // has not yet been called, then the default comes from the global default,
-  // which is false, until SetDefaultSerializationDeterministic has been called.
-  // Otherwise, SetSerializationDeterministic has been called, and the last
-  // value passed to it is all that matters.
+  // Note that this is *not* canonical across languages. It is also unstable
+  // across different builds with intervening message definition changes, due to
+  // unknown fields. Users who need canonical serialization (e.g. persistent
+  // storage in a canonical form, fingerprinting) should define their own
+  // canonicalization specification and implement the serializer using
+  // reflection APIs rather than relying on this API.
   void SetSerializationDeterministic(bool value) {
-    serialization_deterministic_is_overridden_ = true;
-    serialization_deterministic_override_ = value;
+    impl_.SetSerializationDeterministic(value);
   }
-  // See above.  Also, note that users of this CodedOutputStream may need to
-  // call IsSerializationDeterministic() to serialize in the intended way.  This
-  // CodedOutputStream cannot enforce a desire for deterministic serialization
-  // by itself.
+
+  // Return whether the user wants deterministic serialization. See above.
   bool IsSerializationDeterministic() const {
-    return serialization_deterministic_is_overridden_ ?
-        serialization_deterministic_override_ :
-        IsDefaultSerializationDeterministic();
+    return impl_.IsSerializationDeterministic();
   }
 
   static bool IsDefaultSerializationDeterministic() {
-    return google::protobuf::internal::NoBarrier_Load(&default_serialization_deterministic_);
+    return default_serialization_deterministic_.load(
+               std::memory_order_relaxed) != 0;
   }
 
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CodedOutputStream);
-
-  ZeroCopyOutputStream* output_;
-  uint8* buffer_;
-  int buffer_size_;
-  int total_bytes_;  // Sum of sizes of all buffers seen so far.
-  bool had_error_;   // Whether an error occurred during output.
-  bool aliasing_enabled_;  // See EnableAliasing().
-  // See SetSerializationDeterministic() regarding these three fields.
-  bool serialization_deterministic_is_overridden_;
-  bool serialization_deterministic_override_;
-  // Conceptually, default_serialization_deterministic_ is an atomic bool.
-  // TODO(haberman): replace with std::atomic<bool> when we move to C++11.
-  static google::protobuf::internal::AtomicWord default_serialization_deterministic_;
-
-  // Advance the buffer by a given number of bytes.
-  void Advance(int amount);
-
-  // Called when the buffer runs out to request more data.  Implies an
-  // Advance(buffer_size_).
-  bool Refresh();
+  template <typename Func>
+  void Serialize(const Func& func);
 
-  // Like WriteRaw() but may avoid copying if the underlying
-  // ZeroCopyOutputStream supports it.
-  void WriteAliasedRaw(const void* buffer, int size);
+  uint8_t* Cur() const { return cur_; }
+  void SetCur(uint8_t* ptr) { cur_ = ptr; }
+  EpsCopyOutputStream* EpsCopy() { return &impl_; }
 
-  // If this write might cross the end of the buffer, we compose the bytes first
-  // then use WriteRaw().
-  void WriteVarint32SlowPath(uint32 value);
-  void WriteVarint64SlowPath(uint64 value);
+ private:
+  EpsCopyOutputStream impl_;
+  uint8_t* cur_;
+  int64_t start_count_;
+  static std::atomic<bool> default_serialization_deterministic_;
 
   // See above.  Other projects may use "friend" to allow them to call this.
   // After SetDefaultSerializationDeterministic() completes, all protocol
@@ -908,19 +1288,23 @@ class LIBPROTOBUF_EXPORT CodedOutputStream {
   // that wants deterministic serialization by default needs to call
   // SetDefaultSerializationDeterministic() or ensure on its own that another
   // thread has done so.
-  friend void ::google::protobuf::internal::MapTestForceDeterministic();
+  friend void internal::MapTestForceDeterministic();
   static void SetDefaultSerializationDeterministic() {
-    google::protobuf::internal::NoBarrier_Store(&default_serialization_deterministic_, 1);
+    default_serialization_deterministic_.store(true, std::memory_order_relaxed);
   }
+  // REQUIRES: value >= 0x80, and that (value & 7f) has been written to *target.
+  static uint8_t* WriteVarint32ToArrayOutOfLineHelper(uint32_t value,
+                                                      uint8_t* target);
+  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CodedOutputStream);
 };
 
 // inline methods ====================================================
 // The vast majority of varints are only one byte.  These inline
 // methods optimize for that case.
 
-inline bool CodedInputStream::ReadVarint32(uint32* value) {
-  uint32 v = 0;
-  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_)) {
+inline bool CodedInputStream::ReadVarint32(uint32_t* value) {
+  uint32_t v = 0;
+  if (PROTOBUF_PREDICT_TRUE(buffer_ < buffer_end_)) {
     v = *buffer_;
     if (v < 0x80) {
       *value = v;
@@ -928,24 +1312,24 @@ inline bool CodedInputStream::ReadVarint32(uint32* value) {
       return true;
     }
   }
-  int64 result = ReadVarint32Fallback(v);
-  *value = static_cast<uint32>(result);
+  int64_t result = ReadVarint32Fallback(v);
+  *value = static_cast<uint32_t>(result);
   return result >= 0;
 }
 
-inline bool CodedInputStream::ReadVarint64(uint64* value) {
-  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_) && *buffer_ < 0x80) {
+inline bool CodedInputStream::ReadVarint64(uint64_t* value) {
+  if (PROTOBUF_PREDICT_TRUE(buffer_ < buffer_end_) && *buffer_ < 0x80) {
     *value = *buffer_;
     Advance(1);
     return true;
   }
-  std::pair<uint64, bool> p = ReadVarint64Fallback();
+  std::pair<uint64_t, bool> p = ReadVarint64Fallback();
   *value = p.first;
   return p.second;
 }
 
 inline bool CodedInputStream::ReadVarintSizeAsInt(int* value) {
-  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_)) {
+  if (PROTOBUF_PREDICT_TRUE(buffer_ < buffer_end_)) {
     int v = *buffer_;
     if (v < 0x80) {
       *value = v;
@@ -958,45 +1342,42 @@ inline bool CodedInputStream::ReadVarintSizeAsInt(int* value) {
 }
 
 // static
-inline const uint8* CodedInputStream::ReadLittleEndian32FromArray(
-    const uint8* buffer,
-    uint32* value) {
+inline const uint8_t* CodedInputStream::ReadLittleEndian32FromArray(
+    const uint8_t* buffer, uint32_t* value) {
 #if defined(PROTOBUF_LITTLE_ENDIAN)
   memcpy(value, buffer, sizeof(*value));
   return buffer + sizeof(*value);
 #else
-  *value = (static_cast<uint32>(buffer[0])      ) |
-           (static_cast<uint32>(buffer[1]) <<  8) |
-           (static_cast<uint32>(buffer[2]) << 16) |
-           (static_cast<uint32>(buffer[3]) << 24);
+  *value = (static_cast<uint32_t>(buffer[0])) |
+           (static_cast<uint32_t>(buffer[1]) << 8) |
+           (static_cast<uint32_t>(buffer[2]) << 16) |
+           (static_cast<uint32_t>(buffer[3]) << 24);
   return buffer + sizeof(*value);
 #endif
 }
 // static
-inline const uint8* CodedInputStream::ReadLittleEndian64FromArray(
-    const uint8* buffer,
-    uint64* value) {
+inline const uint8_t* CodedInputStream::ReadLittleEndian64FromArray(
+    const uint8_t* buffer, uint64_t* value) {
 #if defined(PROTOBUF_LITTLE_ENDIAN)
   memcpy(value, buffer, sizeof(*value));
   return buffer + sizeof(*value);
 #else
-  uint32 part0 = (static_cast<uint32>(buffer[0])      ) |
-                 (static_cast<uint32>(buffer[1]) <<  8) |
-                 (static_cast<uint32>(buffer[2]) << 16) |
-                 (static_cast<uint32>(buffer[3]) << 24);
-  uint32 part1 = (static_cast<uint32>(buffer[4])      ) |
-                 (static_cast<uint32>(buffer[5]) <<  8) |
-                 (static_cast<uint32>(buffer[6]) << 16) |
-                 (static_cast<uint32>(buffer[7]) << 24);
-  *value = static_cast<uint64>(part0) |
-          (static_cast<uint64>(part1) << 32);
+  uint32_t part0 = (static_cast<uint32_t>(buffer[0])) |
+                   (static_cast<uint32_t>(buffer[1]) << 8) |
+                   (static_cast<uint32_t>(buffer[2]) << 16) |
+                   (static_cast<uint32_t>(buffer[3]) << 24);
+  uint32_t part1 = (static_cast<uint32_t>(buffer[4])) |
+                   (static_cast<uint32_t>(buffer[5]) << 8) |
+                   (static_cast<uint32_t>(buffer[6]) << 16) |
+                   (static_cast<uint32_t>(buffer[7]) << 24);
+  *value = static_cast<uint64_t>(part0) | (static_cast<uint64_t>(part1) << 32);
   return buffer + sizeof(*value);
 #endif
 }
 
-inline bool CodedInputStream::ReadLittleEndian32(uint32* value) {
+inline bool CodedInputStream::ReadLittleEndian32(uint32_t* value) {
 #if defined(PROTOBUF_LITTLE_ENDIAN)
-  if (GOOGLE_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) {
+  if (PROTOBUF_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) {
     buffer_ = ReadLittleEndian32FromArray(buffer_, value);
     return true;
   } else {
@@ -1007,9 +1388,9 @@ inline bool CodedInputStream::ReadLittleEndian32(uint32* value) {
 #endif
 }
 
-inline bool CodedInputStream::ReadLittleEndian64(uint64* value) {
+inline bool CodedInputStream::ReadLittleEndian64(uint64_t* value) {
 #if defined(PROTOBUF_LITTLE_ENDIAN)
-  if (GOOGLE_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) {
+  if (PROTOBUF_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) {
     buffer_ = ReadLittleEndian64FromArray(buffer_, value);
     return true;
   } else {
@@ -1020,9 +1401,9 @@ inline bool CodedInputStream::ReadLittleEndian64(uint64* value) {
 #endif
 }
 
-inline uint32 CodedInputStream::ReadTagNoLastTag() {
-  uint32 v = 0;
-  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_)) {
+inline uint32_t CodedInputStream::ReadTagNoLastTag() {
+  uint32_t v = 0;
+  if (PROTOBUF_PREDICT_TRUE(buffer_ < buffer_end_)) {
     v = *buffer_;
     if (v < 0x80) {
       Advance(1);
@@ -1033,31 +1414,30 @@ inline uint32 CodedInputStream::ReadTagNoLastTag() {
   return v;
 }
 
-inline std::pair<uint32, bool> CodedInputStream::ReadTagWithCutoffNoLastTag(
-    uint32 cutoff) {
+inline std::pair<uint32_t, bool> CodedInputStream::ReadTagWithCutoffNoLastTag(
+    uint32_t cutoff) {
   // In performance-sensitive code we can expect cutoff to be a compile-time
   // constant, and things like "cutoff >= kMax1ByteVarint" to be evaluated at
   // compile time.
-  uint32 first_byte_or_zero = 0;
-  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_)) {
+  uint32_t first_byte_or_zero = 0;
+  if (PROTOBUF_PREDICT_TRUE(buffer_ < buffer_end_)) {
     // Hot case: buffer_ non_empty, buffer_[0] in [1, 128).
     // TODO(gpike): Is it worth rearranging this? E.g., if the number of fields
     // is large enough then is it better to check for the two-byte case first?
     first_byte_or_zero = buffer_[0];
-    if (static_cast<int8>(buffer_[0]) > 0) {
-      const uint32 kMax1ByteVarint = 0x7f;
-      uint32 tag = buffer_[0];
+    if (static_cast<int8_t>(buffer_[0]) > 0) {
+      const uint32_t kMax1ByteVarint = 0x7f;
+      uint32_t tag = buffer_[0];
       Advance(1);
       return std::make_pair(tag, cutoff >= kMax1ByteVarint || tag <= cutoff);
     }
     // Other hot case: cutoff >= 0x80, buffer_ has at least two bytes available,
     // and tag is two bytes.  The latter is tested by bitwise-and-not of the
     // first byte and the second byte.
-    if (cutoff >= 0x80 &&
-        GOOGLE_PREDICT_TRUE(buffer_ + 1 < buffer_end_) &&
-        GOOGLE_PREDICT_TRUE((buffer_[0] & ~buffer_[1]) >= 0x80)) {
-      const uint32 kMax2ByteVarint = (0x7f << 7) + 0x7f;
-      uint32 tag = (1u << 7) * buffer_[1] + (buffer_[0] - 0x80);
+    if (cutoff >= 0x80 && PROTOBUF_PREDICT_TRUE(buffer_ + 1 < buffer_end_) &&
+        PROTOBUF_PREDICT_TRUE((buffer_[0] & ~buffer_[1]) >= 0x80)) {
+      const uint32_t kMax2ByteVarint = (0x7f << 7) + 0x7f;
+      uint32_t tag = (1u << 7) * buffer_[1] + (buffer_[0] - 0x80);
       Advance(2);
       // It might make sense to test for tag == 0 now, but it is so rare that
       // that we don't bother.  A varint-encoded 0 should be one byte unless
@@ -1070,11 +1450,11 @@ inline std::pair<uint32, bool> CodedInputStream::ReadTagWithCutoffNoLastTag(
     }
   }
   // Slow path
-  const uint32 tag = ReadTagFallback(first_byte_or_zero);
-  return std::make_pair(tag, static_cast<uint32>(tag - 1) < cutoff);
+  const uint32_t tag = ReadTagFallback(first_byte_or_zero);
+  return std::make_pair(tag, static_cast<uint32_t>(tag - 1) < cutoff);
 }
 
-inline bool CodedInputStream::LastTagWas(uint32 expected) {
+inline bool CodedInputStream::LastTagWas(uint32_t expected) {
   return last_tag_ == expected;
 }
 
@@ -1082,18 +1462,19 @@ inline bool CodedInputStream::ConsumedEntireMessage() {
   return legitimate_message_end_;
 }
 
-inline bool CodedInputStream::ExpectTag(uint32 expected) {
+inline bool CodedInputStream::ExpectTag(uint32_t expected) {
   if (expected < (1 << 7)) {
-    if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_) && buffer_[0] == expected) {
+    if (PROTOBUF_PREDICT_TRUE(buffer_ < buffer_end_) &&
+        buffer_[0] == expected) {
       Advance(1);
       return true;
     } else {
       return false;
     }
   } else if (expected < (1 << 14)) {
-    if (GOOGLE_PREDICT_TRUE(BufferSize() >= 2) &&
-        buffer_[0] == static_cast<uint8>(expected | 0x80) &&
-        buffer_[1] == static_cast<uint8>(expected >> 7)) {
+    if (PROTOBUF_PREDICT_TRUE(BufferSize() >= 2) &&
+        buffer_[0] == static_cast<uint8_t>(expected | 0x80) &&
+        buffer_[1] == static_cast<uint8_t>(expected >> 7)) {
       Advance(2);
       return true;
     } else {
@@ -1105,19 +1486,19 @@ inline bool CodedInputStream::ExpectTag(uint32 expected) {
   }
 }
 
-inline const uint8* CodedInputStream::ExpectTagFromArray(
-    const uint8* buffer, uint32 expected) {
+inline const uint8_t* CodedInputStream::ExpectTagFromArray(
+    const uint8_t* buffer, uint32_t expected) {
   if (expected < (1 << 7)) {
     if (buffer[0] == expected) {
       return buffer + 1;
     }
   } else if (expected < (1 << 14)) {
-    if (buffer[0] == static_cast<uint8>(expected | 0x80) &&
-        buffer[1] == static_cast<uint8>(expected >> 7)) {
+    if (buffer[0] == static_cast<uint8_t>(expected | 0x80) &&
+        buffer[1] == static_cast<uint8_t>(expected >> 7)) {
       return buffer + 2;
     }
   }
-  return NULL;
+  return nullptr;
 }
 
 inline void CodedInputStream::GetDirectBufferPointerInline(const void** data,
@@ -1130,9 +1511,8 @@ inline bool CodedInputStream::ExpectAtEnd() {
   // If we are at a limit we know no more bytes can be read.  Otherwise, it's
   // hard to say without calling Refresh(), and we'd rather not do that.
 
-  if (buffer_ == buffer_end_ &&
-      ((buffer_size_after_limit_ != 0) ||
-       (total_bytes_read_ == current_limit_))) {
+  if (buffer_ == buffer_end_ && ((buffer_size_after_limit_ != 0) ||
+                                 (total_bytes_read_ == current_limit_))) {
     last_tag_ = 0;                   // Pretend we called ReadTag()...
     legitimate_message_end_ = true;  // ... and it hit EOF.
     return true;
@@ -1145,278 +1525,251 @@ inline int CodedInputStream::CurrentPosition() const {
   return total_bytes_read_ - (BufferSize() + buffer_size_after_limit_);
 }
 
-inline uint8* CodedOutputStream::GetDirectBufferForNBytesAndAdvance(int size) {
-  if (buffer_size_ < size) {
-    return NULL;
-  } else {
-    uint8* result = buffer_;
-    Advance(size);
-    return result;
-  }
-}
+inline void CodedInputStream::Advance(int amount) { buffer_ += amount; }
 
-inline uint8* CodedOutputStream::WriteVarint32ToArray(uint32 value,
-                                                      uint8* target) {
-  while (value >= 0x80) {
-    *target = static_cast<uint8>(value | 0x80);
-    value >>= 7;
-    ++target;
-  }
-  *target = static_cast<uint8>(value);
-  return target + 1;
+inline void CodedInputStream::SetRecursionLimit(int limit) {
+  recursion_budget_ += limit - recursion_limit_;
+  recursion_limit_ = limit;
 }
 
-inline uint8* CodedOutputStream::WriteVarint64ToArray(uint64 value,
-                                                      uint8* target) {
-  while (value >= 0x80) {
-    *target = static_cast<uint8>(value | 0x80);
-    value >>= 7;
-    ++target;
-  }
-  *target = static_cast<uint8>(value);
-  return target + 1;
+inline bool CodedInputStream::IncrementRecursionDepth() {
+  --recursion_budget_;
+  return recursion_budget_ >= 0;
 }
 
-inline void CodedOutputStream::WriteVarint32SignExtended(int32 value) {
-  WriteVarint64(static_cast<uint64>(value));
+inline void CodedInputStream::DecrementRecursionDepth() {
+  if (recursion_budget_ < recursion_limit_) ++recursion_budget_;
 }
 
-inline uint8* CodedOutputStream::WriteVarint32SignExtendedToArray(
-    int32 value, uint8* target) {
-  return WriteVarint64ToArray(static_cast<uint64>(value), target);
+inline void CodedInputStream::UnsafeDecrementRecursionDepth() {
+  assert(recursion_budget_ < recursion_limit_);
+  ++recursion_budget_;
 }
 
-inline uint8* CodedOutputStream::WriteLittleEndian32ToArray(uint32 value,
-                                                            uint8* target) {
-#if defined(PROTOBUF_LITTLE_ENDIAN)
-  memcpy(target, &value, sizeof(value));
-#else
-  target[0] = static_cast<uint8>(value);
-  target[1] = static_cast<uint8>(value >>  8);
-  target[2] = static_cast<uint8>(value >> 16);
-  target[3] = static_cast<uint8>(value >> 24);
-#endif
-  return target + sizeof(value);
+inline void CodedInputStream::SetExtensionRegistry(const DescriptorPool* pool,
+                                                   MessageFactory* factory) {
+  extension_pool_ = pool;
+  extension_factory_ = factory;
 }
 
-inline uint8* CodedOutputStream::WriteLittleEndian64ToArray(uint64 value,
-                                                            uint8* target) {
-#if defined(PROTOBUF_LITTLE_ENDIAN)
-  memcpy(target, &value, sizeof(value));
-#else
-  uint32 part0 = static_cast<uint32>(value);
-  uint32 part1 = static_cast<uint32>(value >> 32);
-
-  target[0] = static_cast<uint8>(part0);
-  target[1] = static_cast<uint8>(part0 >>  8);
-  target[2] = static_cast<uint8>(part0 >> 16);
-  target[3] = static_cast<uint8>(part0 >> 24);
-  target[4] = static_cast<uint8>(part1);
-  target[5] = static_cast<uint8>(part1 >>  8);
-  target[6] = static_cast<uint8>(part1 >> 16);
-  target[7] = static_cast<uint8>(part1 >> 24);
-#endif
-  return target + sizeof(value);
+inline const DescriptorPool* CodedInputStream::GetExtensionPool() {
+  return extension_pool_;
 }
 
-inline void CodedOutputStream::WriteVarint32(uint32 value) {
-  if (buffer_size_ >= 5) {
-    // Fast path:  We have enough bytes left in the buffer to guarantee that
-    // this write won't cross the end, so we can skip the checks.
-    uint8* target = buffer_;
-    uint8* end = WriteVarint32ToArray(value, target);
-    int size = static_cast<int>(end - target);
-    Advance(size);
-  } else {
-    WriteVarint32SlowPath(value);
-  }
+inline MessageFactory* CodedInputStream::GetExtensionFactory() {
+  return extension_factory_;
 }
 
-inline void CodedOutputStream::WriteVarint64(uint64 value) {
-  if (buffer_size_ >= 10) {
-    // Fast path:  We have enough bytes left in the buffer to guarantee that
-    // this write won't cross the end, so we can skip the checks.
-    uint8* target = buffer_;
-    uint8* end = WriteVarint64ToArray(value, target);
-    int size = static_cast<int>(end - target);
-    Advance(size);
-  } else {
-    WriteVarint64SlowPath(value);
-  }
+inline int CodedInputStream::BufferSize() const {
+  return static_cast<int>(buffer_end_ - buffer_);
 }
 
-inline void CodedOutputStream::WriteTag(uint32 value) {
-  WriteVarint32(value);
+inline CodedInputStream::CodedInputStream(ZeroCopyInputStream* input)
+    : buffer_(nullptr),
+      buffer_end_(nullptr),
+      input_(input),
+      total_bytes_read_(0),
+      overflow_bytes_(0),
+      last_tag_(0),
+      legitimate_message_end_(false),
+      aliasing_enabled_(false),
+      current_limit_(std::numeric_limits<int32_t>::max()),
+      buffer_size_after_limit_(0),
+      total_bytes_limit_(kDefaultTotalBytesLimit),
+      recursion_budget_(default_recursion_limit_),
+      recursion_limit_(default_recursion_limit_),
+      extension_pool_(nullptr),
+      extension_factory_(nullptr) {
+  // Eagerly Refresh() so buffer space is immediately available.
+  Refresh();
 }
 
-inline uint8* CodedOutputStream::WriteTagToArray(
-    uint32 value, uint8* target) {
-  return WriteVarint32ToArray(value, target);
+inline CodedInputStream::CodedInputStream(const uint8_t* buffer, int size)
+    : buffer_(buffer),
+      buffer_end_(buffer + size),
+      input_(nullptr),
+      total_bytes_read_(size),
+      overflow_bytes_(0),
+      last_tag_(0),
+      legitimate_message_end_(false),
+      aliasing_enabled_(false),
+      current_limit_(size),
+      buffer_size_after_limit_(0),
+      total_bytes_limit_(kDefaultTotalBytesLimit),
+      recursion_budget_(default_recursion_limit_),
+      recursion_limit_(default_recursion_limit_),
+      extension_pool_(nullptr),
+      extension_factory_(nullptr) {
+  // Note that setting current_limit_ == size is important to prevent some
+  // code paths from trying to access input_ and segfaulting.
 }
 
-inline size_t CodedOutputStream::VarintSize32(uint32 value) {
-  // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1
-  // Use an explicit multiplication to implement the divide of
-  // a number in the 1..31 range.
-  // Explicit OR 0x1 to avoid calling Bits::Log2FloorNonZero(0), which is
-  // undefined.
-  uint32 log2value = Bits::Log2FloorNonZero(value | 0x1);
-  return static_cast<size_t>((log2value * 9 + 73) / 64);
-}
+inline bool CodedInputStream::IsFlat() const { return input_ == nullptr; }
 
-inline size_t CodedOutputStream::VarintSize64(uint64 value) {
-  // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1
-  // Use an explicit multiplication to implement the divide of
-  // a number in the 1..63 range.
-  // Explicit OR 0x1 to avoid calling Bits::Log2FloorNonZero(0), which is
-  // undefined.
-  uint32 log2value = Bits::Log2FloorNonZero64(value | 0x1);
-  return static_cast<size_t>((log2value * 9 + 73) / 64);
-}
+inline bool CodedInputStream::Skip(int count) {
+  if (count < 0) return false;  // security: count is often user-supplied
 
-inline size_t CodedOutputStream::VarintSize32SignExtended(int32 value) {
-  if (value < 0) {
-    return 10;     // TODO(kenton):  Make this a symbolic constant.
-  } else {
-    return VarintSize32(static_cast<uint32>(value));
+  const int original_buffer_size = BufferSize();
+
+  if (count <= original_buffer_size) {
+    // Just skipping within the current buffer.  Easy.
+    Advance(count);
+    return true;
   }
+
+  return SkipFallback(count, original_buffer_size);
 }
 
-inline void CodedOutputStream::WriteString(const string& str) {
-  WriteRaw(str.data(), static_cast<int>(str.size()));
+inline uint8_t* CodedOutputStream::WriteVarint32ToArray(uint32_t value,
+                                                        uint8_t* target) {
+  return EpsCopyOutputStream::UnsafeVarint(value, target);
 }
 
-inline void CodedOutputStream::WriteRawMaybeAliased(
-    const void* data, int size) {
-  if (aliasing_enabled_) {
-    WriteAliasedRaw(data, size);
+inline uint8_t* CodedOutputStream::WriteVarint32ToArrayOutOfLine(
+    uint32_t value, uint8_t* target) {
+  target[0] = static_cast<uint8_t>(value);
+  if (value < 0x80) {
+    return target + 1;
   } else {
-    WriteRaw(data, size);
+    return WriteVarint32ToArrayOutOfLineHelper(value, target);
   }
 }
 
-inline uint8* CodedOutputStream::WriteStringToArray(
-    const string& str, uint8* target) {
-  return WriteRawToArray(str.data(), static_cast<int>(str.size()), target);
+inline uint8_t* CodedOutputStream::WriteVarint64ToArray(uint64_t value,
+                                                        uint8_t* target) {
+  return EpsCopyOutputStream::UnsafeVarint(value, target);
 }
 
-inline int CodedOutputStream::ByteCount() const {
-  return total_bytes_ - buffer_size_;
+inline void CodedOutputStream::WriteVarint32SignExtended(int32_t value) {
+  WriteVarint64(static_cast<uint64_t>(value));
 }
 
-inline void CodedInputStream::Advance(int amount) {
-  buffer_ += amount;
+inline uint8_t* CodedOutputStream::WriteVarint32SignExtendedToArray(
+    int32_t value, uint8_t* target) {
+  return WriteVarint64ToArray(static_cast<uint64_t>(value), target);
 }
 
-inline void CodedOutputStream::Advance(int amount) {
-  buffer_ += amount;
-  buffer_size_ -= amount;
+inline uint8_t* CodedOutputStream::WriteLittleEndian32ToArray(uint32_t value,
+                                                              uint8_t* target) {
+#if defined(PROTOBUF_LITTLE_ENDIAN)
+  memcpy(target, &value, sizeof(value));
+#else
+  target[0] = static_cast<uint8_t>(value);
+  target[1] = static_cast<uint8_t>(value >> 8);
+  target[2] = static_cast<uint8_t>(value >> 16);
+  target[3] = static_cast<uint8_t>(value >> 24);
+#endif
+  return target + sizeof(value);
 }
 
-inline void CodedInputStream::SetRecursionLimit(int limit) {
-  recursion_budget_ += limit - recursion_limit_;
-  recursion_limit_ = limit;
+inline uint8_t* CodedOutputStream::WriteLittleEndian64ToArray(uint64_t value,
+                                                              uint8_t* target) {
+#if defined(PROTOBUF_LITTLE_ENDIAN)
+  memcpy(target, &value, sizeof(value));
+#else
+  uint32_t part0 = static_cast<uint32_t>(value);
+  uint32_t part1 = static_cast<uint32_t>(value >> 32);
+
+  target[0] = static_cast<uint8_t>(part0);
+  target[1] = static_cast<uint8_t>(part0 >> 8);
+  target[2] = static_cast<uint8_t>(part0 >> 16);
+  target[3] = static_cast<uint8_t>(part0 >> 24);
+  target[4] = static_cast<uint8_t>(part1);
+  target[5] = static_cast<uint8_t>(part1 >> 8);
+  target[6] = static_cast<uint8_t>(part1 >> 16);
+  target[7] = static_cast<uint8_t>(part1 >> 24);
+#endif
+  return target + sizeof(value);
 }
 
-inline bool CodedInputStream::IncrementRecursionDepth() {
-  --recursion_budget_;
-  return recursion_budget_ >= 0;
+inline void CodedOutputStream::WriteVarint32(uint32_t value) {
+  cur_ = impl_.EnsureSpace(cur_);
+  SetCur(WriteVarint32ToArray(value, Cur()));
 }
 
-inline void CodedInputStream::DecrementRecursionDepth() {
-  if (recursion_budget_ < recursion_limit_) ++recursion_budget_;
+inline void CodedOutputStream::WriteVarint64(uint64_t value) {
+  cur_ = impl_.EnsureSpace(cur_);
+  SetCur(WriteVarint64ToArray(value, Cur()));
 }
 
-inline void CodedInputStream::UnsafeDecrementRecursionDepth() {
-  assert(recursion_budget_ < recursion_limit_);
-  ++recursion_budget_;
+inline void CodedOutputStream::WriteTag(uint32_t value) {
+  WriteVarint32(value);
 }
 
-inline void CodedInputStream::SetExtensionRegistry(const DescriptorPool* pool,
-                                                   MessageFactory* factory) {
-  extension_pool_ = pool;
-  extension_factory_ = factory;
+inline uint8_t* CodedOutputStream::WriteTagToArray(uint32_t value,
+                                                   uint8_t* target) {
+  return WriteVarint32ToArray(value, target);
 }
 
-inline const DescriptorPool* CodedInputStream::GetExtensionPool() {
-  return extension_pool_;
+inline size_t CodedOutputStream::VarintSize32(uint32_t value) {
+  // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1
+  // Use an explicit multiplication to implement the divide of
+  // a number in the 1..31 range.
+  // Explicit OR 0x1 to avoid calling Bits::Log2FloorNonZero(0), which is
+  // undefined.
+  uint32_t log2value = Bits::Log2FloorNonZero(value | 0x1);
+  return static_cast<size_t>((log2value * 9 + 73) / 64);
 }
 
-inline MessageFactory* CodedInputStream::GetExtensionFactory() {
-  return extension_factory_;
+inline size_t CodedOutputStream::VarintSize32PlusOne(uint32_t value) {
+  // Same as above, but one more.
+  uint32_t log2value = Bits::Log2FloorNonZero(value | 0x1);
+  return static_cast<size_t>((log2value * 9 + 73 + 64) / 64);
 }
 
-inline int CodedInputStream::BufferSize() const {
-  return static_cast<int>(buffer_end_ - buffer_);
+inline size_t CodedOutputStream::VarintSize64(uint64_t value) {
+  // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1
+  // Use an explicit multiplication to implement the divide of
+  // a number in the 1..63 range.
+  // Explicit OR 0x1 to avoid calling Bits::Log2FloorNonZero(0), which is
+  // undefined.
+  uint32_t log2value = Bits::Log2FloorNonZero64(value | 0x1);
+  return static_cast<size_t>((log2value * 9 + 73) / 64);
 }
 
-inline CodedInputStream::CodedInputStream(ZeroCopyInputStream* input)
-  : buffer_(NULL),
-    buffer_end_(NULL),
-    input_(input),
-    total_bytes_read_(0),
-    overflow_bytes_(0),
-    last_tag_(0),
-    legitimate_message_end_(false),
-    aliasing_enabled_(false),
-    current_limit_(kint32max),
-    buffer_size_after_limit_(0),
-    total_bytes_limit_(kDefaultTotalBytesLimit),
-    recursion_budget_(default_recursion_limit_),
-    recursion_limit_(default_recursion_limit_),
-    disable_strict_correctness_enforcement_(true),
-    extension_pool_(NULL),
-    extension_factory_(NULL) {
-  // Eagerly Refresh() so buffer space is immediately available.
-  Refresh();
+inline size_t CodedOutputStream::VarintSize64PlusOne(uint64_t value) {
+  // Same as above, but one more.
+  uint32_t log2value = Bits::Log2FloorNonZero64(value | 0x1);
+  return static_cast<size_t>((log2value * 9 + 73 + 64) / 64);
 }
 
-inline CodedInputStream::CodedInputStream(const uint8* buffer, int size)
-  : buffer_(buffer),
-    buffer_end_(buffer + size),
-    input_(NULL),
-    total_bytes_read_(size),
-    overflow_bytes_(0),
-    last_tag_(0),
-    legitimate_message_end_(false),
-    aliasing_enabled_(false),
-    current_limit_(size),
-    buffer_size_after_limit_(0),
-    total_bytes_limit_(kDefaultTotalBytesLimit),
-    recursion_budget_(default_recursion_limit_),
-    recursion_limit_(default_recursion_limit_),
-    disable_strict_correctness_enforcement_(true),
-    extension_pool_(NULL),
-    extension_factory_(NULL) {
-  // Note that setting current_limit_ == size is important to prevent some
-  // code paths from trying to access input_ and segfaulting.
+inline size_t CodedOutputStream::VarintSize32SignExtended(int32_t value) {
+  return VarintSize64(static_cast<uint64_t>(int64_t{value}));
 }
 
-inline bool CodedInputStream::IsFlat() const {
-  return input_ == NULL;
+inline size_t CodedOutputStream::VarintSize32SignExtendedPlusOne(
+    int32_t value) {
+  return VarintSize64PlusOne(static_cast<uint64_t>(int64_t{value}));
 }
 
-inline bool CodedInputStream::Skip(int count) {
-  if (count < 0) return false;  // security: count is often user-supplied
+inline void CodedOutputStream::WriteString(const std::string& str) {
+  WriteRaw(str.data(), static_cast<int>(str.size()));
+}
 
-  const int original_buffer_size = BufferSize();
+inline void CodedOutputStream::WriteRawMaybeAliased(const void* data,
+                                                    int size) {
+  cur_ = impl_.WriteRawMaybeAliased(data, size, cur_);
+}
 
-  if (count <= original_buffer_size) {
-    // Just skipping within the current buffer.  Easy.
-    Advance(count);
-    return true;
-  }
+inline uint8_t* CodedOutputStream::WriteRawToArray(const void* data, int size,
+                                                   uint8_t* target) {
+  memcpy(target, data, size);
+  return target + size;
+}
 
-  return SkipFallback(count, original_buffer_size);
+inline uint8_t* CodedOutputStream::WriteStringToArray(const std::string& str,
+                                                      uint8_t* target) {
+  return WriteRawToArray(str.data(), static_cast<int>(str.size()), target);
 }
 
 }  // namespace io
 }  // namespace protobuf
-
+}  // namespace google
 
 #if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
-  #pragma runtime_checks("c", restore)
+#pragma runtime_checks("c", restore)
 #endif  // _MSC_VER && !defined(__INTEL_COMPILER)
 
-}  // namespace google
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_IO_CODED_STREAM_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/io/coded_stream_inl.h b/3rdparty/protobuf/src/google/protobuf/io/coded_stream_inl.h
deleted file mode 100644 (file)
index d95b06e..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: jasonh@google.com (Jason Hsueh)
-//
-// Implements methods of coded_stream.h that need to be inlined for performance
-// reasons, but should not be defined in a public header.
-
-#ifndef GOOGLE_PROTOBUF_IO_CODED_STREAM_INL_H__
-#define GOOGLE_PROTOBUF_IO_CODED_STREAM_INL_H__
-
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
-#include <string>
-#include <google/protobuf/stubs/stl_util.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-
-inline bool CodedInputStream::InternalReadStringInline(string* buffer,
-                                                       int size) {
-  if (size < 0) return false;  // security: size is often user-supplied
-
-  if (BufferSize() >= size) {
-    STLStringResizeUninitialized(buffer, size);
-    std::pair<char*, bool> z = as_string_data(buffer);
-    if (z.second) {
-      // Oddly enough, memcpy() requires its first two args to be non-NULL even
-      // if we copy 0 bytes.  So, we have ensured that z.first is non-NULL here.
-      GOOGLE_DCHECK(z.first != NULL);
-      memcpy(z.first, buffer_, size);
-      Advance(size);
-    }
-    return true;
-  }
-
-  return ReadStringFallback(buffer, size);
-}
-
-inline bool CodedInputStream::InternalReadRawInline(void* buffer, int size) {
-  int current_buffer_size;
-  while ((current_buffer_size = BufferSize()) < size) {
-    // Reading past end of buffer.  Copy what we have, then refresh.
-    memcpy(buffer, buffer_, current_buffer_size);
-    buffer = reinterpret_cast<uint8*>(buffer) + current_buffer_size;
-    size -= current_buffer_size;
-    Advance(current_buffer_size);
-    if (!Refresh()) return false;
-  }
-
-  memcpy(buffer, buffer_, size);
-  Advance(size);
-
-  return true;
-}
-
-}  // namespace io
-}  // namespace protobuf
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_IO_CODED_STREAM_INL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/io/gzip_stream.cc b/3rdparty/protobuf/src/google/protobuf/io/gzip_stream.cc
deleted file mode 100644 (file)
index a569eff..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: brianolson@google.com (Brian Olson)
-//
-// This file contains the implementation of classes GzipInputStream and
-// GzipOutputStream.
-
-
-#if HAVE_ZLIB
-#include <google/protobuf/io/gzip_stream.h>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/logging.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-
-static const int kDefaultBufferSize = 65536;
-
-GzipInputStream::GzipInputStream(
-    ZeroCopyInputStream* sub_stream, Format format, int buffer_size)
-    : format_(format), sub_stream_(sub_stream), zerror_(Z_OK), byte_count_(0) {
-  zcontext_.state = Z_NULL;
-  zcontext_.zalloc = Z_NULL;
-  zcontext_.zfree = Z_NULL;
-  zcontext_.opaque = Z_NULL;
-  zcontext_.total_out = 0;
-  zcontext_.next_in = NULL;
-  zcontext_.avail_in = 0;
-  zcontext_.total_in = 0;
-  zcontext_.msg = NULL;
-  if (buffer_size == -1) {
-    output_buffer_length_ = kDefaultBufferSize;
-  } else {
-    output_buffer_length_ = buffer_size;
-  }
-  output_buffer_ = operator new(output_buffer_length_);
-  GOOGLE_CHECK(output_buffer_ != NULL);
-  zcontext_.next_out = static_cast<Bytef*>(output_buffer_);
-  zcontext_.avail_out = output_buffer_length_;
-  output_position_ = output_buffer_;
-}
-GzipInputStream::~GzipInputStream() {
-  operator delete(output_buffer_);
-  zerror_ = inflateEnd(&zcontext_);
-}
-
-static inline int internalInflateInit2(
-    z_stream* zcontext, GzipInputStream::Format format) {
-  int windowBitsFormat = 0;
-  switch (format) {
-    case GzipInputStream::GZIP: windowBitsFormat = 16; break;
-    case GzipInputStream::AUTO: windowBitsFormat = 32; break;
-    case GzipInputStream::ZLIB: windowBitsFormat = 0; break;
-  }
-  return inflateInit2(zcontext, /* windowBits */15 | windowBitsFormat);
-}
-
-int GzipInputStream::Inflate(int flush) {
-  if ((zerror_ == Z_OK) && (zcontext_.avail_out == 0)) {
-    // previous inflate filled output buffer. don't change input params yet.
-  } else if (zcontext_.avail_in == 0) {
-    const void* in;
-    int in_size;
-    bool first = zcontext_.next_in == NULL;
-    bool ok = sub_stream_->Next(&in, &in_size);
-    if (!ok) {
-      zcontext_.next_out = NULL;
-      zcontext_.avail_out = 0;
-      return Z_STREAM_END;
-    }
-    zcontext_.next_in = static_cast<Bytef*>(const_cast<void*>(in));
-    zcontext_.avail_in = in_size;
-    if (first) {
-      int error = internalInflateInit2(&zcontext_, format_);
-      if (error != Z_OK) {
-        return error;
-      }
-    }
-  }
-  zcontext_.next_out = static_cast<Bytef*>(output_buffer_);
-  zcontext_.avail_out = output_buffer_length_;
-  output_position_ = output_buffer_;
-  int error = inflate(&zcontext_, flush);
-  return error;
-}
-
-void GzipInputStream::DoNextOutput(const void** data, int* size) {
-  *data = output_position_;
-  *size = ((uintptr_t)zcontext_.next_out) - ((uintptr_t)output_position_);
-  output_position_ = zcontext_.next_out;
-}
-
-// implements ZeroCopyInputStream ----------------------------------
-bool GzipInputStream::Next(const void** data, int* size) {
-  bool ok = (zerror_ == Z_OK) || (zerror_ == Z_STREAM_END)
-      || (zerror_ == Z_BUF_ERROR);
-  if ((!ok) || (zcontext_.next_out == NULL)) {
-    return false;
-  }
-  if (zcontext_.next_out != output_position_) {
-    DoNextOutput(data, size);
-    return true;
-  }
-  if (zerror_ == Z_STREAM_END) {
-    if (zcontext_.next_out != NULL) {
-      // sub_stream_ may have concatenated streams to follow
-      zerror_ = inflateEnd(&zcontext_);
-      byte_count_ += zcontext_.total_out;
-      if (zerror_ != Z_OK) {
-        return false;
-      }
-      zerror_ = internalInflateInit2(&zcontext_, format_);
-      if (zerror_ != Z_OK) {
-        return false;
-      }
-    } else {
-      *data = NULL;
-      *size = 0;
-      return false;
-    }
-  }
-  zerror_ = Inflate(Z_NO_FLUSH);
-  if ((zerror_ == Z_STREAM_END) && (zcontext_.next_out == NULL)) {
-    // The underlying stream's Next returned false inside Inflate.
-    return false;
-  }
-  ok = (zerror_ == Z_OK) || (zerror_ == Z_STREAM_END)
-      || (zerror_ == Z_BUF_ERROR);
-  if (!ok) {
-    return false;
-  }
-  DoNextOutput(data, size);
-  return true;
-}
-void GzipInputStream::BackUp(int count) {
-  output_position_ = reinterpret_cast<void*>(
-      reinterpret_cast<uintptr_t>(output_position_) - count);
-}
-bool GzipInputStream::Skip(int count) {
-  const void* data;
-  int size = 0;
-  bool ok = Next(&data, &size);
-  while (ok && (size < count)) {
-    count -= size;
-    ok = Next(&data, &size);
-  }
-  if (size > count) {
-    BackUp(size - count);
-  }
-  return ok;
-}
-int64 GzipInputStream::ByteCount() const {
-  int64 ret = byte_count_ + zcontext_.total_out;
-  if (zcontext_.next_out != NULL && output_position_ != NULL) {
-    ret += reinterpret_cast<uintptr_t>(zcontext_.next_out) -
-           reinterpret_cast<uintptr_t>(output_position_);
-  }
-  return ret;
-}
-
-// =========================================================================
-
-GzipOutputStream::Options::Options()
-    : format(GZIP),
-      buffer_size(kDefaultBufferSize),
-      compression_level(Z_DEFAULT_COMPRESSION),
-      compression_strategy(Z_DEFAULT_STRATEGY) {}
-
-GzipOutputStream::GzipOutputStream(ZeroCopyOutputStream* sub_stream) {
-  Init(sub_stream, Options());
-}
-
-GzipOutputStream::GzipOutputStream(ZeroCopyOutputStream* sub_stream,
-                                   const Options& options) {
-  Init(sub_stream, options);
-}
-
-void GzipOutputStream::Init(ZeroCopyOutputStream* sub_stream,
-                            const Options& options) {
-  sub_stream_ = sub_stream;
-  sub_data_ = NULL;
-  sub_data_size_ = 0;
-
-  input_buffer_length_ = options.buffer_size;
-  input_buffer_ = operator new(input_buffer_length_);
-  GOOGLE_CHECK(input_buffer_ != NULL);
-
-  zcontext_.zalloc = Z_NULL;
-  zcontext_.zfree = Z_NULL;
-  zcontext_.opaque = Z_NULL;
-  zcontext_.next_out = NULL;
-  zcontext_.avail_out = 0;
-  zcontext_.total_out = 0;
-  zcontext_.next_in = NULL;
-  zcontext_.avail_in = 0;
-  zcontext_.total_in = 0;
-  zcontext_.msg = NULL;
-  // default to GZIP format
-  int windowBitsFormat = 16;
-  if (options.format == ZLIB) {
-    windowBitsFormat = 0;
-  }
-  zerror_ = deflateInit2(
-      &zcontext_,
-      options.compression_level,
-      Z_DEFLATED,
-      /* windowBits */15 | windowBitsFormat,
-      /* memLevel (default) */8,
-      options.compression_strategy);
-}
-
-GzipOutputStream::~GzipOutputStream() {
-  Close();
-  operator delete(input_buffer_);
-}
-
-// private
-int GzipOutputStream::Deflate(int flush) {
-  int error = Z_OK;
-  do {
-    if ((sub_data_ == NULL) || (zcontext_.avail_out == 0)) {
-      bool ok = sub_stream_->Next(&sub_data_, &sub_data_size_);
-      if (!ok) {
-        sub_data_ = NULL;
-        sub_data_size_ = 0;
-        return Z_BUF_ERROR;
-      }
-      GOOGLE_CHECK_GT(sub_data_size_, 0);
-      zcontext_.next_out = static_cast<Bytef*>(sub_data_);
-      zcontext_.avail_out = sub_data_size_;
-    }
-    error = deflate(&zcontext_, flush);
-  } while (error == Z_OK && zcontext_.avail_out == 0);
-  if ((flush == Z_FULL_FLUSH) || (flush == Z_FINISH)) {
-    // Notify lower layer of data.
-    sub_stream_->BackUp(zcontext_.avail_out);
-    // We don't own the buffer anymore.
-    sub_data_ = NULL;
-    sub_data_size_ = 0;
-  }
-  return error;
-}
-
-// implements ZeroCopyOutputStream ---------------------------------
-bool GzipOutputStream::Next(void** data, int* size) {
-  if ((zerror_ != Z_OK) && (zerror_ != Z_BUF_ERROR)) {
-    return false;
-  }
-  if (zcontext_.avail_in != 0) {
-    zerror_ = Deflate(Z_NO_FLUSH);
-    if (zerror_ != Z_OK) {
-      return false;
-    }
-  }
-  if (zcontext_.avail_in == 0) {
-    // all input was consumed. reset the buffer.
-    zcontext_.next_in = static_cast<Bytef*>(input_buffer_);
-    zcontext_.avail_in = input_buffer_length_;
-    *data = input_buffer_;
-    *size = input_buffer_length_;
-  } else {
-    // The loop in Deflate should consume all avail_in
-    GOOGLE_LOG(DFATAL) << "Deflate left bytes unconsumed";
-  }
-  return true;
-}
-void GzipOutputStream::BackUp(int count) {
-  GOOGLE_CHECK_GE(zcontext_.avail_in, count);
-  zcontext_.avail_in -= count;
-}
-int64 GzipOutputStream::ByteCount() const {
-  return zcontext_.total_in + zcontext_.avail_in;
-}
-
-bool GzipOutputStream::Flush() {
-  zerror_ = Deflate(Z_FULL_FLUSH);
-  // Return true if the flush succeeded or if it was a no-op.
-  return  (zerror_ == Z_OK) ||
-      (zerror_ == Z_BUF_ERROR && zcontext_.avail_in == 0 &&
-       zcontext_.avail_out != 0);
-}
-
-bool GzipOutputStream::Close() {
-  if ((zerror_ != Z_OK) && (zerror_ != Z_BUF_ERROR)) {
-    return false;
-  }
-  do {
-    zerror_ = Deflate(Z_FINISH);
-  } while (zerror_ == Z_OK);
-  zerror_ = deflateEnd(&zcontext_);
-  bool ok = zerror_ == Z_OK;
-  zerror_ = Z_STREAM_END;
-  return ok;
-}
-
-}  // namespace io
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // HAVE_ZLIB
diff --git a/3rdparty/protobuf/src/google/protobuf/io/gzip_stream.h b/3rdparty/protobuf/src/google/protobuf/io/gzip_stream.h
deleted file mode 100644 (file)
index 15b02fe..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: brianolson@google.com (Brian Olson)
-//
-// This file contains the definition for classes GzipInputStream and
-// GzipOutputStream.
-//
-// GzipInputStream decompresses data from an underlying
-// ZeroCopyInputStream and provides the decompressed data as a
-// ZeroCopyInputStream.
-//
-// GzipOutputStream is an ZeroCopyOutputStream that compresses data to
-// an underlying ZeroCopyOutputStream.
-
-#ifndef GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__
-#define GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/io/zero_copy_stream.h>
-#include <zlib.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-
-// A ZeroCopyInputStream that reads compressed data through zlib
-class LIBPROTOBUF_EXPORT GzipInputStream : public ZeroCopyInputStream {
- public:
-  // Format key for constructor
-  enum Format {
-    // zlib will autodetect gzip header or deflate stream
-    AUTO = 0,
-
-    // GZIP streams have some extra header data for file attributes.
-    GZIP = 1,
-
-    // Simpler zlib stream format.
-    ZLIB = 2,
-  };
-
-  // buffer_size and format may be -1 for default of 64kB and GZIP format
-  explicit GzipInputStream(
-      ZeroCopyInputStream* sub_stream,
-      Format format = AUTO,
-      int buffer_size = -1);
-  virtual ~GzipInputStream();
-
-  // Return last error message or NULL if no error.
-  inline const char* ZlibErrorMessage() const {
-    return zcontext_.msg;
-  }
-  inline int ZlibErrorCode() const {
-    return zerror_;
-  }
-
-  // implements ZeroCopyInputStream ----------------------------------
-  bool Next(const void** data, int* size);
-  void BackUp(int count);
-  bool Skip(int count);
-  int64 ByteCount() const;
-
- private:
-  Format format_;
-
-  ZeroCopyInputStream* sub_stream_;
-
-  z_stream zcontext_;
-  int zerror_;
-
-  void* output_buffer_;
-  void* output_position_;
-  size_t output_buffer_length_;
-  int64 byte_count_;
-
-  int Inflate(int flush);
-  void DoNextOutput(const void** data, int* size);
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipInputStream);
-};
-
-
-class LIBPROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream {
- public:
-  // Format key for constructor
-  enum Format {
-    // GZIP streams have some extra header data for file attributes.
-    GZIP = 1,
-
-    // Simpler zlib stream format.
-    ZLIB = 2,
-  };
-
-  struct Options {
-    // Defaults to GZIP.
-    Format format;
-
-    // What size buffer to use internally.  Defaults to 64kB.
-    int buffer_size;
-
-    // A number between 0 and 9, where 0 is no compression and 9 is best
-    // compression.  Defaults to Z_DEFAULT_COMPRESSION (see zlib.h).
-    int compression_level;
-
-    // Defaults to Z_DEFAULT_STRATEGY.  Can also be set to Z_FILTERED,
-    // Z_HUFFMAN_ONLY, or Z_RLE.  See the documentation for deflateInit2 in
-    // zlib.h for definitions of these constants.
-    int compression_strategy;
-
-    Options();  // Initializes with default values.
-  };
-
-  // Create a GzipOutputStream with default options.
-  explicit GzipOutputStream(ZeroCopyOutputStream* sub_stream);
-
-  // Create a GzipOutputStream with the given options.
-  GzipOutputStream(
-      ZeroCopyOutputStream* sub_stream,
-      const Options& options);
-
-  virtual ~GzipOutputStream();
-
-  // Return last error message or NULL if no error.
-  inline const char* ZlibErrorMessage() const {
-    return zcontext_.msg;
-  }
-  inline int ZlibErrorCode() const {
-    return zerror_;
-  }
-
-  // Flushes data written so far to zipped data in the underlying stream.
-  // It is the caller's responsibility to flush the underlying stream if
-  // necessary.
-  // Compression may be less efficient stopping and starting around flushes.
-  // Returns true if no error.
-  //
-  // Please ensure that block size is > 6. Here is an excerpt from the zlib
-  // doc that explains why:
-  //
-  // In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out
-  // is greater than six to avoid repeated flush markers due to
-  // avail_out == 0 on return.
-  bool Flush();
-
-  // Writes out all data and closes the gzip stream.
-  // It is the caller's responsibility to close the underlying stream if
-  // necessary.
-  // Returns true if no error.
-  bool Close();
-
-  // implements ZeroCopyOutputStream ---------------------------------
-  bool Next(void** data, int* size);
-  void BackUp(int count);
-  int64 ByteCount() const;
-
- private:
-  ZeroCopyOutputStream* sub_stream_;
-  // Result from calling Next() on sub_stream_
-  void* sub_data_;
-  int sub_data_size_;
-
-  z_stream zcontext_;
-  int zerror_;
-  void* input_buffer_;
-  size_t input_buffer_length_;
-
-  // Shared constructor code.
-  void Init(ZeroCopyOutputStream* sub_stream, const Options& options);
-
-  // Do some compression.
-  // Takes zlib flush mode.
-  // Returns zlib error code.
-  int Deflate(int flush);
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipOutputStream);
-};
-
-}  // namespace io
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__
@@ -29,7 +29,9 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 // Author: laszlocsomor@google.com (Laszlo Csomor)
-//
+//  Based on original Protocol Buffers design by
+//  Sanjay Ghemawat, Jeff Dean, and others.
+
 // Implementation for long-path-aware open/mkdir/access/etc. on Windows, as well
 // as for the supporting utility functions.
 //
 //
 // This file is only used on Windows, it's empty on other platforms.
 
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(_XBOX_ONE)
 
 // Comment this out to fall back to using the ANSI versions (open, mkdir, ...)
 // instead of the Unicode ones (_wopen, _wmkdir, ...). Doing so can be useful to
 // debug failing tests if that's caused by the long path support.
 #define SUPPORT_LONGPATHS
 
+#include <google/protobuf/io/io_win32.h>
+
 #include <ctype.h>
 #include <direct.h>
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <wctype.h>
-#include <windows.h>
 
-#include <google/protobuf/stubs/io_win32.h>
-#include <google/protobuf/stubs/scoped_ptr.h>
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
+
+#include <windows.h>
 
 #include <memory>
 #include <sstream>
@@ -67,7 +73,7 @@
 
 namespace google {
 namespace protobuf {
-namespace internal {
+namespace io {
 namespace win32 {
 namespace {
 
@@ -91,7 +97,7 @@ struct CharTraits<wchar_t> {
 
 template <typename char_type>
 bool null_or_empty(const char_type* s) {
-  return s == NULL || *s == 0;
+  return s == nullptr || *s == 0;
 }
 
 // Returns true if the path starts with a drive letter, e.g. "c:".
@@ -151,12 +157,13 @@ wstring normalize(wstring path) {
 
   static const wstring dot(L".");
   static const wstring dotdot(L"..");
+  const WCHAR* p = path.c_str();
 
   std::vector<wstring> segments;
   int segment_start = -1;
   // Find the path segments in `path` (separated by "/").
   for (int i = 0;; ++i) {
-    if (!is_separator(path[i]) && path[i] != L'\0') {
+    if (!is_separator(p[i]) && p[i] != L'\0') {
       // The current character does not end a segment, so start one unless it's
       // already started.
       if (segment_start < 0) {
@@ -165,7 +172,7 @@ wstring normalize(wstring path) {
     } else if (segment_start >= 0 && i > segment_start) {
       // The current character is "/" or "\0", so this ends a segment.
       // Add that to `segments` if there's anything to add; handle "." and "..".
-      wstring segment(path, segment_start, i - segment_start);
+      wstring segment(p, segment_start, i - segment_start);
       segment_start = -1;
       if (segment == dotdot) {
         if (!segments.empty() &&
@@ -176,7 +183,7 @@ wstring normalize(wstring path) {
         segments.push_back(segment);
       }
     }
-    if (path[i] == L'\0') {
+    if (p[i] == L'\0') {
       break;
     }
   }
@@ -199,7 +206,7 @@ wstring normalize(wstring path) {
     result << segments[i];
   }
   // Preserve trailing separator if the input contained it.
-  if (!path.empty() && is_separator(path[path.size() - 1])) {
+  if (!path.empty() && is_separator(p[path.size() - 1])) {
     result << L'\\';
   }
   return result.str();
@@ -224,11 +231,11 @@ bool as_windows_path(const char* path, wstring* result) {
 
 
   if (!is_path_absolute(wpath.c_str())) {
-    int size = ::GetCurrentDirectoryW(0, NULL);
+    int size = ::GetCurrentDirectoryW(0, nullptr);
     if (size == 0 && GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
       return false;
     }
-    scoped_array<WCHAR> wcwd(new WCHAR[size]);
+    std::unique_ptr<WCHAR[]> wcwd(new WCHAR[size]);
     ::GetCurrentDirectoryW(size, wcwd.get());
     wpath = join_paths(wcwd.get(), wpath);
   }
@@ -259,7 +266,7 @@ int open(const char* path, int flags, int mode) {
 #endif
 }
 
-int mkdir(const char* path, int _mode) {
+int mkdir(const char* path, int /*_mode*/) {
 #ifdef SUPPORT_LONGPATHS
   wstring wpath;
   if (!as_windows_path(path, &wpath)) {
@@ -315,17 +322,17 @@ FILE* fopen(const char* path, const char* mode) {
 #ifdef SUPPORT_LONGPATHS
   if (null_or_empty(path)) {
     errno = EINVAL;
-    return NULL;
+    return nullptr;
   }
   wstring wpath;
   if (!as_windows_path(path, &wpath)) {
     errno = ENOENT;
-    return NULL;
+    return nullptr;
   }
   wstring wmode;
   if (!strings::utf8_to_wcs(mode, &wmode)) {
     errno = EINVAL;
-    return NULL;
+    return nullptr;
   }
   return ::_wfopen(wpath.c_str(), wmode.c_str());
 #else
@@ -333,7 +340,7 @@ FILE* fopen(const char* path, const char* mode) {
 #endif
 }
 
-int close(int fd) { return ::close(fd); }
+int close(int fd) { return ::_close(fd); }
 
 int dup(int fd) { return ::_dup(fd); }
 
@@ -354,6 +361,56 @@ wstring testonly_utf8_to_winpath(const char* path) {
   return as_windows_path(path, &wpath) ? wpath : wstring();
 }
 
+ExpandWildcardsResult ExpandWildcards(
+    const string& path, std::function<void(const string&)> consume) {
+  if (path.find_first_of("*?") == string::npos) {
+    // There are no wildcards in the path, we don't need to expand it.
+    consume(path);
+    return ExpandWildcardsResult::kSuccess;
+  }
+
+  wstring wpath;
+  if (!as_windows_path(path.c_str(), &wpath)) {
+    return ExpandWildcardsResult::kErrorInputPathConversion;
+  }
+
+  static const wstring kDot = L".";
+  static const wstring kDotDot = L"..";
+  WIN32_FIND_DATAW metadata;
+  HANDLE handle = ::FindFirstFileW(wpath.c_str(), &metadata);
+  if (handle == INVALID_HANDLE_VALUE) {
+    // The pattern does not match any files (or directories).
+    return ExpandWildcardsResult::kErrorNoMatchingFile;
+  }
+
+  string::size_type pos = path.find_last_of("\\/");
+  string dirname;
+  if (pos != string::npos) {
+    dirname = path.substr(0, pos + 1);
+  }
+
+  ExpandWildcardsResult matched = ExpandWildcardsResult::kErrorNoMatchingFile;
+  do {
+    // Ignore ".", "..", and directories.
+    if ((metadata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0 &&
+        kDot != metadata.cFileName && kDotDot != metadata.cFileName) {
+      matched = ExpandWildcardsResult::kSuccess;
+      string filename;
+      if (!strings::wcs_to_utf8(metadata.cFileName, &filename)) {
+        return ExpandWildcardsResult::kErrorOutputPathConversion;
+      }
+
+      if (dirname.empty()) {
+        consume(filename);
+      } else {
+        consume(dirname + filename);
+      }
+    }
+  } while (::FindNextFileW(handle, &metadata));
+  FindClose(handle);
+  return matched;
+}
+
 namespace strings {
 
 bool wcs_to_mbs(const WCHAR* s, string* out, bool outUtf8) {
@@ -364,15 +421,15 @@ bool wcs_to_mbs(const WCHAR* s, string* out, bool outUtf8) {
   BOOL usedDefaultChar = FALSE;
   SetLastError(0);
   int size = WideCharToMultiByte(
-      outUtf8 ? CP_UTF8 : CP_ACP, 0, s, -1, NULL, 0, NULL,
-      outUtf8 ? NULL : &usedDefaultChar);
+      outUtf8 ? CP_UTF8 : CP_ACP, 0, s, -1, nullptr, 0, nullptr,
+      outUtf8 ? nullptr : &usedDefaultChar);
   if ((size == 0 && GetLastError() != ERROR_INSUFFICIENT_BUFFER)
       || usedDefaultChar) {
     return false;
   }
-  scoped_array<CHAR> astr(new CHAR[size]);
+  std::unique_ptr<CHAR[]> astr(new CHAR[size]);
   WideCharToMultiByte(
-      outUtf8 ? CP_UTF8 : CP_ACP, 0, s, -1, astr.get(), size, NULL, NULL);
+      outUtf8 ? CP_UTF8 : CP_ACP, 0, s, -1, astr.get(), size, nullptr, nullptr);
   out->assign(astr.get());
   return true;
 }
@@ -385,11 +442,11 @@ bool mbs_to_wcs(const char* s, wstring* out, bool inUtf8) {
 
   SetLastError(0);
   int size =
-      MultiByteToWideChar(inUtf8 ? CP_UTF8 : CP_ACP, 0, s, -1, NULL, 0);
+      MultiByteToWideChar(inUtf8 ? CP_UTF8 : CP_ACP, 0, s, -1, nullptr, 0);
   if (size == 0 && GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
     return false;
   }
-  scoped_array<WCHAR> wstr(new WCHAR[size]);
+  std::unique_ptr<WCHAR[]> wstr(new WCHAR[size]);
   MultiByteToWideChar(
       inUtf8 ? CP_UTF8 : CP_ACP, 0, s, -1, wstr.get(), size + 1);
   out->assign(wstr.get());
@@ -406,7 +463,7 @@ bool wcs_to_utf8(const wchar_t* input, string* out) {
 
 }  // namespace strings
 }  // namespace win32
-}  // namespace internal
+}  // namespace io
 }  // namespace protobuf
 }  // namespace google
 
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 // Author: laszlocsomor@google.com (Laszlo Csomor)
-//
+//  Based on original Protocol Buffers design by
+//  Sanjay Ghemawat, Jeff Dean, and others.
+
 // This file contains the declarations for Windows implementations of
 // commonly used POSIX functions such as open(2) and access(2), as well
 // as macro definitions for flags of these functions.
 //
 // By including this file you'll redefine open/access/etc. to
-// ::google::protobuf::internal::win32::{open/access/etc.}.
+// ::google::protobuf::io::win32::{open/access/etc.}.
 // Make sure you don't include a header that attempts to redeclare or
 // redefine these functions, that'll lead to confusing compilation
 // errors. It's best to #include this file as the last one to ensure that.
 //
 // This file is only used on Windows, it's empty on other platforms.
 
-#ifndef GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
-#define GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
+#ifndef GOOGLE_PROTOBUF_IO_IO_WIN32_H__
+#define GOOGLE_PROTOBUF_IO_IO_WIN32_H__
 
 #if defined(_WIN32)
 
+#include <functional>
 #include <string>
-#include <google/protobuf/stubs/port.h>
+
+#include <google/protobuf/port.h>
+#include <google/protobuf/port_def.inc>
 
 // Compilers on Windows other than MSVC (e.g. Cygwin, MinGW32) define the
 // following functions already, except for mkdir.
 namespace google {
 namespace protobuf {
-namespace internal {
+namespace io {
 namespace win32 {
 
-LIBPROTOBUF_EXPORT FILE* fopen(const char* path, const char* mode);
-LIBPROTOBUF_EXPORT int access(const char* path, int mode);
-LIBPROTOBUF_EXPORT int chdir(const char* path);
-LIBPROTOBUF_EXPORT int close(int fd);
-LIBPROTOBUF_EXPORT int dup(int fd);
-LIBPROTOBUF_EXPORT int dup2(int fd1, int fd2);
-LIBPROTOBUF_EXPORT int mkdir(const char* path, int _mode);
-LIBPROTOBUF_EXPORT int open(const char* path, int flags, int mode = 0);
-LIBPROTOBUF_EXPORT int read(int fd, void* buffer, size_t size);
-LIBPROTOBUF_EXPORT int setmode(int fd, int mode);
-LIBPROTOBUF_EXPORT int stat(const char* path, struct _stat* buffer);
-LIBPROTOBUF_EXPORT int write(int fd, const void* buffer, size_t size);
-LIBPROTOBUF_EXPORT std::wstring testonly_utf8_to_winpath(const char* path);
+PROTOBUF_EXPORT FILE* fopen(const char* path, const char* mode);
+PROTOBUF_EXPORT int access(const char* path, int mode);
+PROTOBUF_EXPORT int chdir(const char* path);
+PROTOBUF_EXPORT int close(int fd);
+PROTOBUF_EXPORT int dup(int fd);
+PROTOBUF_EXPORT int dup2(int fd1, int fd2);
+PROTOBUF_EXPORT int mkdir(const char* path, int _mode);
+PROTOBUF_EXPORT int open(const char* path, int flags, int mode = 0);
+PROTOBUF_EXPORT int read(int fd, void* buffer, size_t size);
+PROTOBUF_EXPORT int setmode(int fd, int mode);
+PROTOBUF_EXPORT int stat(const char* path, struct _stat* buffer);
+PROTOBUF_EXPORT int write(int fd, const void* buffer, size_t size);
+PROTOBUF_EXPORT std::wstring testonly_utf8_to_winpath(const char* path);
+
+enum class ExpandWildcardsResult {
+  kSuccess = 0,
+  kErrorNoMatchingFile = 1,
+  kErrorInputPathConversion = 2,
+  kErrorOutputPathConversion = 3,
+};
+
+// Expand wildcards in a path pattern, feed the result to a consumer function.
+//
+// `path` must be a valid, Windows-style path. It may be absolute, or relative
+// to the current working directory, and it may contain wildcards ("*" and "?")
+// in the last path segment. This function passes all matching file names to
+// `consume`. The resulting paths may not be absolute nor normalized.
+//
+// The function returns a value from `ExpandWildcardsResult`.
+PROTOBUF_EXPORT ExpandWildcardsResult ExpandWildcards(
+    const std::string& path, std::function<void(const std::string&)> consume);
 
 namespace strings {
 
 // Convert from UTF-16 to Active-Code-Page-encoded or to UTF-8-encoded text.
-LIBPROTOBUF_EXPORT bool wcs_to_mbs(
-    const wchar_t* s, std::string* out, bool outUtf8);
+PROTOBUF_EXPORT bool wcs_to_mbs(const wchar_t* s, std::string* out,
+                                bool outUtf8);
 
 // Convert from Active-Code-Page-encoded or UTF-8-encoded text to UTF-16.
-LIBPROTOBUF_EXPORT bool mbs_to_wcs(
-    const char* s, std::wstring* out, bool inUtf8);
+PROTOBUF_EXPORT bool mbs_to_wcs(const char* s, std::wstring* out, bool inUtf8);
 
 // Convert from UTF-8-encoded text to UTF-16.
-LIBPROTOBUF_EXPORT bool utf8_to_wcs(const char* input, std::wstring* out);
+PROTOBUF_EXPORT bool utf8_to_wcs(const char* input, std::wstring* out);
 
 // Convert from UTF-16-encoded text to UTF-8.
-LIBPROTOBUF_EXPORT bool wcs_to_utf8(const wchar_t* input, std::string* out);
+PROTOBUF_EXPORT bool wcs_to_utf8(const wchar_t* input, std::string* out);
 
 }  // namespace strings
 
 }  // namespace win32
-}  // namespace internal
+}  // namespace io
 }  // namespace protobuf
 }  // namespace google
 
@@ -110,6 +132,8 @@ LIBPROTOBUF_EXPORT bool wcs_to_utf8(const wchar_t* input, std::string* out);
 #define STDOUT_FILENO 1
 #endif
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // defined(_WIN32)
 
-#endif  // GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
+#endif  // GOOGLE_PROTOBUF_IO_IO_WIN32_H__
index dc1fc91..46c3dac 100644 (file)
@@ -37,7 +37,6 @@
 // documentation generator.
 
 namespace google {
-
 namespace protobuf {
 
 // Auxiliary classes used for I/O.
diff --git a/3rdparty/protobuf/src/google/protobuf/io/printer.cc b/3rdparty/protobuf/src/google/protobuf/io/printer.cc
deleted file mode 100644 (file)
index 8493268..0000000
+++ /dev/null
@@ -1,372 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-
-#include <google/protobuf/io/printer.h>
-#include <google/protobuf/io/zero_copy_stream.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/common.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-
-Printer::Printer(ZeroCopyOutputStream* output, char variable_delimiter)
-    : variable_delimiter_(variable_delimiter),
-      output_(output),
-      buffer_(NULL),
-      buffer_size_(0),
-      offset_(0),
-      at_start_of_line_(true),
-      failed_(false),
-      annotation_collector_(NULL) {}
-
-Printer::Printer(ZeroCopyOutputStream* output, char variable_delimiter,
-                 AnnotationCollector* annotation_collector)
-    : variable_delimiter_(variable_delimiter),
-      output_(output),
-      buffer_(NULL),
-      buffer_size_(0),
-      offset_(0),
-      at_start_of_line_(true),
-      failed_(false),
-      annotation_collector_(annotation_collector) {}
-
-Printer::~Printer() {
-  // Only BackUp() if we have called Next() at least once and never failed.
-  if (buffer_size_ > 0 && !failed_) {
-    output_->BackUp(buffer_size_);
-  }
-}
-
-bool Printer::GetSubstitutionRange(const char* varname,
-                                   std::pair<size_t, size_t>* range) {
-  std::map<string, std::pair<size_t, size_t> >::const_iterator iter =
-      substitutions_.find(varname);
-  if (iter == substitutions_.end()) {
-    GOOGLE_LOG(DFATAL) << " Undefined variable in annotation: " << varname;
-    return false;
-  }
-  if (iter->second.first > iter->second.second) {
-    GOOGLE_LOG(DFATAL) << " Variable used for annotation used multiple times: "
-                << varname;
-    return false;
-  }
-  *range = iter->second;
-  return true;
-}
-
-void Printer::Annotate(const char* begin_varname, const char* end_varname,
-                       const string& file_path, const std::vector<int>& path) {
-  if (annotation_collector_ == NULL) {
-    // Can't generate signatures with this Printer.
-    return;
-  }
-  std::pair<size_t, size_t> begin, end;
-  if (!GetSubstitutionRange(begin_varname, &begin) ||
-      !GetSubstitutionRange(end_varname, &end)) {
-    return;
-  }
-  if (begin.first > end.second) {
-    GOOGLE_LOG(DFATAL) << "  Annotation has negative length from " << begin_varname
-                << " to " << end_varname;
-  } else {
-    annotation_collector_->AddAnnotation(begin.first, end.second, file_path,
-                                         path);
-  }
-}
-
-void Printer::Print(const std::map<string, string>& variables,
-                    const char* text) {
-  int size = strlen(text);
-  int pos = 0;  // The number of bytes we've written so far.
-  substitutions_.clear();
-  line_start_variables_.clear();
-
-  for (int i = 0; i < size; i++) {
-    if (text[i] == '\n') {
-      // Saw newline.  If there is more text, we may need to insert an indent
-      // here.  So, write what we have so far, including the '\n'.
-      WriteRaw(text + pos, i - pos + 1);
-      pos = i + 1;
-
-      // Setting this true will cause the next WriteRaw() to insert an indent
-      // first.
-      at_start_of_line_ = true;
-      line_start_variables_.clear();
-
-    } else if (text[i] == variable_delimiter_) {
-      // Saw the start of a variable name.
-
-      // Write what we have so far.
-      WriteRaw(text + pos, i - pos);
-      pos = i + 1;
-
-      // Find closing delimiter.
-      const char* end = strchr(text + pos, variable_delimiter_);
-      if (end == NULL) {
-        GOOGLE_LOG(DFATAL) << " Unclosed variable name.";
-        end = text + pos;
-      }
-      int endpos = end - text;
-
-      string varname(text + pos, endpos - pos);
-      if (varname.empty()) {
-        // Two delimiters in a row reduce to a literal delimiter character.
-        WriteRaw(&variable_delimiter_, 1);
-      } else {
-        // Replace with the variable's value.
-        std::map<string, string>::const_iterator iter = variables.find(varname);
-        if (iter == variables.end()) {
-          GOOGLE_LOG(DFATAL) << " Undefined variable: " << varname;
-        } else {
-          if (at_start_of_line_ && iter->second.empty()) {
-            line_start_variables_.push_back(varname);
-          }
-          WriteRaw(iter->second.data(), iter->second.size());
-          std::pair<std::map<string, std::pair<size_t, size_t> >::iterator,
-                    bool>
-              inserted = substitutions_.insert(std::make_pair(
-                  varname,
-                  std::make_pair(offset_ - iter->second.size(), offset_)));
-          if (!inserted.second) {
-            // This variable was used multiple times.  Make its span have
-            // negative length so we can detect it if it gets used in an
-            // annotation.
-            inserted.first->second = std::make_pair(1, 0);
-          }
-        }
-      }
-
-      // Advance past this variable.
-      i = endpos;
-      pos = endpos + 1;
-    }
-  }
-
-  // Write the rest.
-  WriteRaw(text + pos, size - pos);
-}
-
-void Printer::Print(const char* text) {
-  static std::map<string, string> empty;
-  Print(empty, text);
-}
-
-void Printer::Print(const char* text,
-                    const char* variable, const string& value) {
-  std::map<string, string> vars;
-  vars[variable] = value;
-  Print(vars, text);
-}
-
-void Printer::Print(const char* text,
-                    const char* variable1, const string& value1,
-                    const char* variable2, const string& value2) {
-  std::map<string, string> vars;
-  vars[variable1] = value1;
-  vars[variable2] = value2;
-  Print(vars, text);
-}
-
-void Printer::Print(const char* text,
-                    const char* variable1, const string& value1,
-                    const char* variable2, const string& value2,
-                    const char* variable3, const string& value3) {
-  std::map<string, string> vars;
-  vars[variable1] = value1;
-  vars[variable2] = value2;
-  vars[variable3] = value3;
-  Print(vars, text);
-}
-
-void Printer::Print(const char* text,
-                    const char* variable1, const string& value1,
-                    const char* variable2, const string& value2,
-                    const char* variable3, const string& value3,
-                    const char* variable4, const string& value4) {
-  std::map<string, string> vars;
-  vars[variable1] = value1;
-  vars[variable2] = value2;
-  vars[variable3] = value3;
-  vars[variable4] = value4;
-  Print(vars, text);
-}
-
-void Printer::Print(const char* text,
-                    const char* variable1, const string& value1,
-                    const char* variable2, const string& value2,
-                    const char* variable3, const string& value3,
-                    const char* variable4, const string& value4,
-                    const char* variable5, const string& value5) {
-  std::map<string, string> vars;
-  vars[variable1] = value1;
-  vars[variable2] = value2;
-  vars[variable3] = value3;
-  vars[variable4] = value4;
-  vars[variable5] = value5;
-  Print(vars, text);
-}
-
-void Printer::Print(const char* text,
-                    const char* variable1, const string& value1,
-                    const char* variable2, const string& value2,
-                    const char* variable3, const string& value3,
-                    const char* variable4, const string& value4,
-                    const char* variable5, const string& value5,
-                    const char* variable6, const string& value6) {
-  std::map<string, string> vars;
-  vars[variable1] = value1;
-  vars[variable2] = value2;
-  vars[variable3] = value3;
-  vars[variable4] = value4;
-  vars[variable5] = value5;
-  vars[variable6] = value6;
-  Print(vars, text);
-}
-
-void Printer::Print(const char* text,
-                    const char* variable1, const string& value1,
-                    const char* variable2, const string& value2,
-                    const char* variable3, const string& value3,
-                    const char* variable4, const string& value4,
-                    const char* variable5, const string& value5,
-                    const char* variable6, const string& value6,
-                    const char* variable7, const string& value7) {
-  std::map<string, string> vars;
-  vars[variable1] = value1;
-  vars[variable2] = value2;
-  vars[variable3] = value3;
-  vars[variable4] = value4;
-  vars[variable5] = value5;
-  vars[variable6] = value6;
-  vars[variable7] = value7;
-  Print(vars, text);
-}
-
-void Printer::Print(const char* text,
-                    const char* variable1, const string& value1,
-                    const char* variable2, const string& value2,
-                    const char* variable3, const string& value3,
-                    const char* variable4, const string& value4,
-                    const char* variable5, const string& value5,
-                    const char* variable6, const string& value6,
-                    const char* variable7, const string& value7,
-                    const char* variable8, const string& value8) {
-  std::map<string, string> vars;
-  vars[variable1] = value1;
-  vars[variable2] = value2;
-  vars[variable3] = value3;
-  vars[variable4] = value4;
-  vars[variable5] = value5;
-  vars[variable6] = value6;
-  vars[variable7] = value7;
-  vars[variable8] = value8;
-  Print(vars, text);
-}
-
-void Printer::Indent() {
-  indent_ += "  ";
-}
-
-void Printer::Outdent() {
-  if (indent_.empty()) {
-    GOOGLE_LOG(DFATAL) << " Outdent() without matching Indent().";
-    return;
-  }
-
-  indent_.resize(indent_.size() - 2);
-}
-
-void Printer::PrintRaw(const string& data) {
-  WriteRaw(data.data(), data.size());
-}
-
-void Printer::PrintRaw(const char* data) {
-  if (failed_) return;
-  WriteRaw(data, strlen(data));
-}
-
-void Printer::WriteRaw(const char* data, int size) {
-  if (failed_) return;
-  if (size == 0) return;
-
-  if (at_start_of_line_ && (size > 0) && (data[0] != '\n')) {
-    // Insert an indent.
-    at_start_of_line_ = false;
-    CopyToBuffer(indent_.data(), indent_.size());
-    if (failed_) return;
-    // Fix up empty variables (e.g., "{") that should be annotated as
-    // coming after the indent.
-    for (std::vector<string>::iterator i = line_start_variables_.begin();
-         i != line_start_variables_.end(); ++i) {
-      substitutions_[*i].first += indent_.size();
-      substitutions_[*i].second += indent_.size();
-    }
-  }
-
-  // If we're going to write any data, clear line_start_variables_, since
-  // we've either updated them in the block above or they no longer refer to
-  // the current line.
-  line_start_variables_.clear();
-
-  CopyToBuffer(data, size);
-}
-
-void Printer::CopyToBuffer(const char* data, int size) {
-  if (failed_) return;
-  if (size == 0) return;
-
-  while (size > buffer_size_) {
-    // Data exceeds space in the buffer.  Copy what we can and request a
-    // new buffer.
-    memcpy(buffer_, data, buffer_size_);
-    offset_ += buffer_size_;
-    data += buffer_size_;
-    size -= buffer_size_;
-    void* void_buffer;
-    failed_ = !output_->Next(&void_buffer, &buffer_size_);
-    if (failed_) return;
-    buffer_ = reinterpret_cast<char*>(void_buffer);
-  }
-
-  // Buffer is big enough to receive the data; copy it.
-  memcpy(buffer_, data, size);
-  buffer_ += size;
-  buffer_size_ -= size;
-  offset_ += size;
-}
-
-}  // namespace io
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/io/printer.h b/3rdparty/protobuf/src/google/protobuf/io/printer.h
deleted file mode 100644 (file)
index d11745c..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-//
-// Utility class for writing text to a ZeroCopyOutputStream.
-
-#ifndef GOOGLE_PROTOBUF_IO_PRINTER_H__
-#define GOOGLE_PROTOBUF_IO_PRINTER_H__
-
-#include <string>
-#include <map>
-#include <vector>
-#include <google/protobuf/stubs/common.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-
-class ZeroCopyOutputStream;     // zero_copy_stream.h
-
-// Records annotations about a Printer's output.
-class LIBPROTOBUF_EXPORT AnnotationCollector {
- public:
-  // Records that the bytes in file_path beginning with begin_offset and ending
-  // before end_offset are associated with the SourceCodeInfo-style path.
-  virtual void AddAnnotation(size_t begin_offset, size_t end_offset,
-                             const string& file_path,
-                             const std::vector<int>& path) = 0;
-
-  virtual ~AnnotationCollector() {}
-};
-
-// Records annotations about a Printer's output to the given protocol buffer,
-// assuming that the buffer has an ::Annotation message exposing path,
-// source_file, begin and end fields.
-template <typename AnnotationProto>
-class AnnotationProtoCollector : public AnnotationCollector {
- public:
-  // annotation_proto is the protocol buffer to which new Annotations should be
-  // added. It is not owned by the AnnotationProtoCollector.
-  explicit AnnotationProtoCollector(AnnotationProto* annotation_proto)
-      : annotation_proto_(annotation_proto) {}
-
-  // Override for AnnotationCollector::AddAnnotation.
-  virtual void AddAnnotation(size_t begin_offset, size_t end_offset,
-                             const string& file_path,
-                             const std::vector<int>& path) {
-    typename AnnotationProto::Annotation* annotation =
-        annotation_proto_->add_annotation();
-    for (int i = 0; i < path.size(); ++i) {
-      annotation->add_path(path[i]);
-    }
-    annotation->set_source_file(file_path);
-    annotation->set_begin(begin_offset);
-    annotation->set_end(end_offset);
-  }
-
- private:
-  // The protocol buffer to which new annotations should be added.
-  AnnotationProto* const annotation_proto_;
-};
-
-// This simple utility class assists in code generation.  It basically
-// allows the caller to define a set of variables and then output some
-// text with variable substitutions.  Example usage:
-//
-//   Printer printer(output, '$');
-//   map<string, string> vars;
-//   vars["name"] = "Bob";
-//   printer.Print(vars, "My name is $name$.");
-//
-// The above writes "My name is Bob." to the output stream.
-//
-// Printer aggressively enforces correct usage, crashing (with assert failures)
-// in the case of undefined variables in debug builds. This helps greatly in
-// debugging code which uses it.
-//
-// If a Printer is constructed with an AnnotationCollector, it will provide it
-// with annotations that connect the Printer's output to paths that can identify
-// various descriptors.  In the above example, if person_ is a descriptor that
-// identifies Bob, we can associate the output string "My name is Bob." with
-// a source path pointing to that descriptor with:
-//
-//   printer.Annotate("name", person_);
-//
-// The AnnotationCollector will be sent an annotation linking the output range
-// covering "Bob" to the logical path provided by person_.  Tools may use
-// this association to (for example) link "Bob" in the output back to the
-// source file that defined the person_ descriptor identifying Bob.
-//
-// Annotate can only examine variables substituted during the last call to
-// Print.  It is invalid to refer to a variable that was used multiple times
-// in a single Print call.
-//
-// In full generality, one may specify a range of output text using a beginning
-// substitution variable and an ending variable.  The resulting annotation will
-// span from the first character of the substituted value for the beginning
-// variable to the last character of the substituted value for the ending
-// variable.  For example, the Annotate call above is equivalent to this one:
-//
-//   printer.Annotate("name", "name", person_);
-//
-// This is useful if multiple variables combine to form a single span of output
-// that should be annotated with the same source path.  For example:
-//
-//   Printer printer(output, '$');
-//   map<string, string> vars;
-//   vars["first"] = "Alice";
-//   vars["last"] = "Smith";
-//   printer.Print(vars, "My name is $first$ $last$.");
-//   printer.Annotate("first", "last", person_);
-//
-// This code would associate the span covering "Alice Smith" in the output with
-// the person_ descriptor.
-//
-// Note that the beginning variable must come before (or overlap with, in the
-// case of zero-sized substitution values) the ending variable.
-//
-// It is also sometimes useful to use variables with zero-sized values as
-// markers.  This avoids issues with multiple references to the same variable
-// and also allows annotation ranges to span literal text from the Print
-// templates:
-//
-//   Printer printer(output, '$');
-//   map<string, string> vars;
-//   vars["foo"] = "bar";
-//   vars["function"] = "call";
-//   vars["mark"] = "";
-//   printer.Print(vars, "$function$($foo$,$foo$)$mark$");
-//   printer.Annotate("function", "mark", call_);
-//
-// This code associates the span covering "call(bar,bar)" in the output with the
-// call_ descriptor.
-
-class LIBPROTOBUF_EXPORT Printer {
- public:
-  // Create a printer that writes text to the given output stream.  Use the
-  // given character as the delimiter for variables.
-  Printer(ZeroCopyOutputStream* output, char variable_delimiter);
-
-  // Create a printer that writes text to the given output stream.  Use the
-  // given character as the delimiter for variables.  If annotation_collector
-  // is not null, Printer will provide it with annotations about code written
-  // to the stream.  annotation_collector is not owned by Printer.
-  Printer(ZeroCopyOutputStream* output, char variable_delimiter,
-          AnnotationCollector* annotation_collector);
-
-  ~Printer();
-
-  // Link a subsitution variable emitted by the last call to Print to the object
-  // described by descriptor.
-  template <typename SomeDescriptor>
-  void Annotate(const char* varname, const SomeDescriptor* descriptor) {
-    Annotate(varname, varname, descriptor);
-  }
-
-  // Link the output range defined by the substitution variables as emitted by
-  // the last call to Print to the object described by descriptor. The range
-  // begins at begin_varname's value and ends after the last character of the
-  // value substituted for end_varname.
-  template <typename SomeDescriptor>
-  void Annotate(const char* begin_varname, const char* end_varname,
-                const SomeDescriptor* descriptor) {
-    if (annotation_collector_ == NULL) {
-      // Annotations aren't turned on for this Printer, so don't pay the cost
-      // of building the location path.
-      return;
-    }
-    std::vector<int> path;
-    descriptor->GetLocationPath(&path);
-    Annotate(begin_varname, end_varname, descriptor->file()->name(), path);
-  }
-
-  // Link a subsitution variable emitted by the last call to Print to the file
-  // with path file_name.
-  void Annotate(const char* varname, const string& file_name) {
-    Annotate(varname, varname, file_name);
-  }
-
-  // Link the output range defined by the substitution variables as emitted by
-  // the last call to Print to the file with path file_name. The range begins
-  // at begin_varname's value and ends after the last character of the value
-  // substituted for end_varname.
-  void Annotate(const char* begin_varname, const char* end_varname,
-                const string& file_name) {
-    if (annotation_collector_ == NULL) {
-      // Annotations aren't turned on for this Printer.
-      return;
-    }
-    std::vector<int> empty_path;
-    Annotate(begin_varname, end_varname, file_name, empty_path);
-  }
-
-  // Print some text after applying variable substitutions.  If a particular
-  // variable in the text is not defined, this will crash.  Variables to be
-  // substituted are identified by their names surrounded by delimiter
-  // characters (as given to the constructor).  The variable bindings are
-  // defined by the given map.
-  void Print(const std::map<string, string>& variables, const char* text);
-
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text);
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text, const char* variable, const string& value);
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text, const char* variable1, const string& value1,
-                               const char* variable2, const string& value2);
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text, const char* variable1, const string& value1,
-                               const char* variable2, const string& value2,
-                               const char* variable3, const string& value3);
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text, const char* variable1, const string& value1,
-                               const char* variable2, const string& value2,
-                               const char* variable3, const string& value3,
-                               const char* variable4, const string& value4);
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text, const char* variable1, const string& value1,
-                               const char* variable2, const string& value2,
-                               const char* variable3, const string& value3,
-                               const char* variable4, const string& value4,
-                               const char* variable5, const string& value5);
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text, const char* variable1, const string& value1,
-                               const char* variable2, const string& value2,
-                               const char* variable3, const string& value3,
-                               const char* variable4, const string& value4,
-                               const char* variable5, const string& value5,
-                               const char* variable6, const string& value6);
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text, const char* variable1, const string& value1,
-                               const char* variable2, const string& value2,
-                               const char* variable3, const string& value3,
-                               const char* variable4, const string& value4,
-                               const char* variable5, const string& value5,
-                               const char* variable6, const string& value6,
-                               const char* variable7, const string& value7);
-  // Like the first Print(), except the substitutions are given as parameters.
-  void Print(const char* text, const char* variable1, const string& value1,
-                               const char* variable2, const string& value2,
-                               const char* variable3, const string& value3,
-                               const char* variable4, const string& value4,
-                               const char* variable5, const string& value5,
-                               const char* variable6, const string& value6,
-                               const char* variable7, const string& value7,
-                               const char* variable8, const string& value8);
-
-  // Indent text by two spaces.  After calling Indent(), two spaces will be
-  // inserted at the beginning of each line of text.  Indent() may be called
-  // multiple times to produce deeper indents.
-  void Indent();
-
-  // Reduces the current indent level by two spaces, or crashes if the indent
-  // level is zero.
-  void Outdent();
-
-  // Write a string to the output buffer.
-  // This method does not look for newlines to add indentation.
-  void PrintRaw(const string& data);
-
-  // Write a zero-delimited string to output buffer.
-  // This method does not look for newlines to add indentation.
-  void PrintRaw(const char* data);
-
-  // Write some bytes to the output buffer.
-  // This method does not look for newlines to add indentation.
-  void WriteRaw(const char* data, int size);
-
-  // True if any write to the underlying stream failed.  (We don't just
-  // crash in this case because this is an I/O failure, not a programming
-  // error.)
-  bool failed() const { return failed_; }
-
- private:
-  // Link the output range defined by the substitution variables as emitted by
-  // the last call to Print to the object found at the SourceCodeInfo-style path
-  // in a file with path file_path. The range begins at the start of
-  // begin_varname's value and ends after the last character of the value
-  // substituted for end_varname. Note that begin_varname and end_varname
-  // may refer to the same variable.
-  void Annotate(const char* begin_varname, const char* end_varname,
-                const string& file_path, const std::vector<int>& path);
-
-  // Copy size worth of bytes from data to buffer_.
-  void CopyToBuffer(const char* data, int size);
-
-  const char variable_delimiter_;
-
-  ZeroCopyOutputStream* const output_;
-  char* buffer_;
-  int buffer_size_;
-  // The current position, in bytes, in the output stream.  This is equivalent
-  // to the total number of bytes that have been written so far.  This value is
-  // used to calculate annotation ranges in the substitutions_ map below.
-  size_t offset_;
-
-  string indent_;
-  bool at_start_of_line_;
-  bool failed_;
-
-  // A map from variable name to [start, end) offsets in the output buffer.
-  // These refer to the offsets used for a variable after the last call to
-  // Print.  If a variable was used more than once, the entry used in
-  // this map is set to a negative-length span.  For singly-used variables, the
-  // start offset is the beginning of the substitution; the end offset is the
-  // last byte of the substitution plus one (such that (end - start) is the
-  // length of the substituted string).
-  std::map<string, std::pair<size_t, size_t> > substitutions_;
-
-  // Keeps track of the keys in substitutions_ that need to be updated when
-  // indents are inserted. These are keys that refer to the beginning of the
-  // current line.
-  std::vector<string> line_start_variables_;
-
-  // Returns true and sets range to the substitution range in the output for
-  // varname if varname was used once in the last call to Print. If varname
-  // was not used, or if it was used multiple times, returns false (and
-  // fails a debug assertion).
-  bool GetSubstitutionRange(const char* varname,
-                            std::pair<size_t, size_t>* range);
-
-  // If non-null, annotation_collector_ is used to store annotations about
-  // generated code.
-  AnnotationCollector* const annotation_collector_;
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Printer);
-};
-
-}  // namespace io
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_IO_PRINTER_H__
index a90bb9a..03acb5b 100644 (file)
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
 
+#include <google/protobuf/stubs/strutil.h>
+
 namespace google {
 namespace protobuf {
 namespace io {
 
-// ----------------------------------------------------------------------
-// NoLocaleStrtod()
-//   This code will make you cry.
-// ----------------------------------------------------------------------
-
-namespace {
-
-// Returns a string identical to *input except that the character pointed to
-// by radix_pos (which should be '.') is replaced with the locale-specific
-// radix character.
-string LocalizeRadix(const char* input, const char* radix_pos) {
-  // Determine the locale-specific radix character by calling sprintf() to
-  // print the number 1.5, then stripping off the digits.  As far as I can
-  // tell, this is the only portable, thread-safe way to get the C library
-  // to divuldge the locale's radix character.  No, localeconv() is NOT
-  // thread-safe.
-  char temp[16];
-  int size = sprintf(temp, "%.1f", 1.5);
-  GOOGLE_CHECK_EQ(temp[0], '1');
-  GOOGLE_CHECK_EQ(temp[size-1], '5');
-  GOOGLE_CHECK_LE(size, 6);
-
-  // Now replace the '.' in the input with it.
-  string result;
-  result.reserve(strlen(input) + size - 3);
-  result.append(input, radix_pos);
-  result.append(temp + 1, size - 2);
-  result.append(radix_pos + 1);
-  return result;
-}
-
-}  // namespace
-
-double NoLocaleStrtod(const char* text, char** original_endptr) {
-  // We cannot simply set the locale to "C" temporarily with setlocale()
-  // as this is not thread-safe.  Instead, we try to parse in the current
-  // locale first.  If parsing stops at a '.' character, then this is a
-  // pretty good hint that we're actually in some other locale in which
-  // '.' is not the radix character.
-
-  char* temp_endptr;
-  double result = strtod(text, &temp_endptr);
-  if (original_endptr != NULL) *original_endptr = temp_endptr;
-  if (*temp_endptr != '.') return result;
-
-  // Parsing halted on a '.'.  Perhaps we're in a different locale?  Let's
-  // try to replace the '.' with a locale-specific radix character and
-  // try again.
-  string localized = LocalizeRadix(text, temp_endptr);
-  const char* localized_cstr = localized.c_str();
-  char* localized_endptr;
-  result = strtod(localized_cstr, &localized_endptr);
-  if ((localized_endptr - localized_cstr) >
-      (temp_endptr - text)) {
-    // This attempt got further, so replacing the decimal must have helped.
-    // Update original_endptr to point at the right location.
-    if (original_endptr != NULL) {
-      // size_diff is non-zero if the localized radix has multiple bytes.
-      int size_diff = localized.size() - strlen(text);
-      // const_cast is necessary to match the strtod() interface.
-      *original_endptr = const_cast<char*>(
-        text + (localized_endptr - localized_cstr - size_diff));
-    }
-  }
-
-  return result;
-}
+// This approximately 0x1.ffffffp127, but we don't use 0x1.ffffffp127 because
+// it won't compile in MSVC.
+const double MAX_FLOAT_AS_DOUBLE_ROUNDED = 3.4028235677973366e+38;
 
 float SafeDoubleToFloat(double value) {
+  // static_cast<float> on a number larger than float can result in illegal
+  // instruction error, so we need to manually convert it to infinity or max.
   if (value > std::numeric_limits<float>::max()) {
+    // Max float value is about 3.4028234664E38 when represented as a double.
+    // However, when printing float as text, it will be rounded as
+    // 3.4028235e+38. If we parse the value of 3.4028235e+38 from text and
+    // compare it to 3.4028234664E38, we may think that it is larger, but
+    // actually, any number between these two numbers could only be represented
+    // as the same max float number in float, so we should treat them the same
+    // as max float.
+    if (value <= MAX_FLOAT_AS_DOUBLE_ROUNDED) {
+      return std::numeric_limits<float>::max();
+    }
     return std::numeric_limits<float>::infinity();
   } else if (value < -std::numeric_limits<float>::max()) {
+    if (value >= -MAX_FLOAT_AS_DOUBLE_ROUNDED) {
+      return -std::numeric_limits<float>::max();
+    }
     return -std::numeric_limits<float>::infinity();
   } else {
     return static_cast<float>(value);
   }
 }
 
+double NoLocaleStrtod(const char* str, char** endptr) {
+  return google::protobuf::internal::NoLocaleStrtod(str, endptr);
+}
+
 }  // namespace io
 }  // namespace protobuf
 }  // namespace google
index f56e41c..38f544a 100644 (file)
@@ -50,6 +50,6 @@ float SafeDoubleToFloat(double value);
 
 }  // namespace io
 }  // namespace protobuf
-
 }  // namespace google
+
 #endif  // GOOGLE_PROTOBUF_IO_STRTOD_H__
index 916d160..d6456bc 100644 (file)
 // exactly pretty.
 
 #include <google/protobuf/io/tokenizer.h>
+
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/stringprintf.h>
+#include <google/protobuf/stubs/strutil.h>
 #include <google/protobuf/io/strtod.h>
 #include <google/protobuf/io/zero_copy_stream.h>
-#include <google/protobuf/stubs/strutil.h>
 #include <google/protobuf/stubs/stl_util.h>
 
 namespace google {
@@ -113,39 +114,34 @@ namespace {
 // Note:  No class is allowed to contain '\0', since this is used to mark end-
 //   of-input and is handled specially.
 
-#define CHARACTER_CLASS(NAME, EXPRESSION)      \
-  class NAME {                                 \
-   public:                                     \
-    static inline bool InClass(char c) {       \
-      return EXPRESSION;                       \
-    }                                          \
+#define CHARACTER_CLASS(NAME, EXPRESSION)                     \
+  class NAME {                                                \
+   public:                                                    \
+    static inline bool InClass(char c) { return EXPRESSION; } \
   }
 
-CHARACTER_CLASS(Whitespace, c == ' ' || c == '\n' || c == '\t' ||
-                            c == '\r' || c == '\v' || c == '\f');
-CHARACTER_CLASS(WhitespaceNoNewline, c == ' ' || c == '\t' ||
-                                     c == '\r' || c == '\v' || c == '\f');
+CHARACTER_CLASS(Whitespace, c == ' ' || c == '\n' || c == '\t' || c == '\r' ||
+                                c == '\v' || c == '\f');
+CHARACTER_CLASS(WhitespaceNoNewline,
+                c == ' ' || c == '\t' || c == '\r' || c == '\v' || c == '\f');
 
-CHARACTER_CLASS(Unprintable, c < ' ' && c > '\0');
+CHARACTER_CLASS(Unprintable, c<' ' && c> '\0');
 
 CHARACTER_CLASS(Digit, '0' <= c && c <= '9');
 CHARACTER_CLASS(OctalDigit, '0' <= c && c <= '7');
-CHARACTER_CLASS(HexDigit, ('0' <= c && c <= '9') ||
-                          ('a' <= c && c <= 'f') ||
-                          ('A' <= c && c <= 'F'));
+CHARACTER_CLASS(HexDigit, ('0' <= c && c <= '9') || ('a' <= c && c <= 'f') ||
+                              ('A' <= c && c <= 'F'));
 
-CHARACTER_CLASS(Letter, ('a' <= c && c <= 'z') ||
-                        ('A' <= c && c <= 'Z') ||
-                        (c == '_'));
+CHARACTER_CLASS(Letter,
+                ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || (c == '_'));
 
 CHARACTER_CLASS(Alphanumeric, ('a' <= c && c <= 'z') ||
-                              ('A' <= c && c <= 'Z') ||
-                              ('0' <= c && c <= '9') ||
-                              (c == '_'));
+                                  ('A' <= c && c <= 'Z') ||
+                                  ('0' <= c && c <= '9') || (c == '_'));
 
 CHARACTER_CLASS(Escape, c == 'a' || c == 'b' || c == 'f' || c == 'n' ||
-                        c == 'r' || c == 't' || c == 'v' || c == '\\' ||
-                        c == '?' || c == '\'' || c == '\"');
+                            c == 'r' || c == 't' || c == 'v' || c == '\\' ||
+                            c == '?' || c == '\'' || c == '\"');
 
 #undef CHARACTER_CLASS
 
@@ -161,20 +157,32 @@ inline int DigitValue(char digit) {
 // Inline because it's only used in one place.
 inline char TranslateEscape(char c) {
   switch (c) {
-    case 'a':  return '\a';
-    case 'b':  return '\b';
-    case 'f':  return '\f';
-    case 'n':  return '\n';
-    case 'r':  return '\r';
-    case 't':  return '\t';
-    case 'v':  return '\v';
-    case '\\': return '\\';
-    case '?':  return '\?';    // Trigraphs = :(
-    case '\'': return '\'';
-    case '"':  return '\"';
+    case 'a':
+      return '\a';
+    case 'b':
+      return '\b';
+    case 'f':
+      return '\f';
+    case 'n':
+      return '\n';
+    case 'r':
+      return '\r';
+    case 't':
+      return '\t';
+    case 'v':
+      return '\v';
+    case '\\':
+      return '\\';
+    case '?':
+      return '\?';  // Trigraphs = :(
+    case '\'':
+      return '\'';
+    case '"':
+      return '\"';
 
     // We expect escape sequences to have been validated separately.
-    default:   return '?';
+    default:
+      return '?';
   }
 }
 
@@ -186,21 +194,20 @@ ErrorCollector::~ErrorCollector() {}
 
 Tokenizer::Tokenizer(ZeroCopyInputStream* input,
                      ErrorCollector* error_collector)
-  : input_(input),
-    error_collector_(error_collector),
-    buffer_(NULL),
-    buffer_size_(0),
-    buffer_pos_(0),
-    read_error_(false),
-    line_(0),
-    column_(0),
-    record_target_(NULL),
-    record_start_(-1),
-    allow_f_after_float_(false),
-    comment_style_(CPP_COMMENT_STYLE),
-    require_space_after_number_(true),
-    allow_multiline_strings_(false) {
-
+    : input_(input),
+      error_collector_(error_collector),
+      buffer_(NULL),
+      buffer_size_(0),
+      buffer_pos_(0),
+      read_error_(false),
+      line_(0),
+      column_(0),
+      record_target_(NULL),
+      record_start_(-1),
+      allow_f_after_float_(false),
+      comment_style_(CPP_COMMENT_STYLE),
+      require_space_after_number_(true),
+      allow_multiline_strings_(false) {
   current_.line = 0;
   current_.column = 0;
   current_.end_column = 0;
@@ -217,6 +224,21 @@ Tokenizer::~Tokenizer() {
   }
 }
 
+bool Tokenizer::report_whitespace() const { return report_whitespace_; }
+// Note: `set_report_whitespace(false)` implies `set_report_newlines(false)`.
+void Tokenizer::set_report_whitespace(bool report) {
+  report_whitespace_ = report;
+  report_newlines_ &= report;
+}
+
+// If true, newline tokens are reported by Next().
+bool Tokenizer::report_newlines() const { return report_newlines_; }
+// Note: `set_report_newlines(true)` implies `set_report_whitespace(true)`.
+void Tokenizer::set_report_newlines(bool report) {
+  report_newlines_ = report;
+  report_whitespace_ |= report;  // enable report_whitespace if necessary
+}
+
 // -------------------------------------------------------------------
 // Internal helpers.
 
@@ -249,7 +271,8 @@ void Tokenizer::Refresh() {
 
   // If we're in a token, append the rest of the buffer to it.
   if (record_target_ != NULL && record_start_ < buffer_size_) {
-    record_target_->append(buffer_ + record_start_, buffer_size_ - record_start_);
+    record_target_->append(buffer_ + record_start_,
+                           buffer_size_ - record_start_);
     record_start_ = 0;
   }
 
@@ -271,7 +294,7 @@ void Tokenizer::Refresh() {
   current_char_ = buffer_[0];
 }
 
-inline void Tokenizer::RecordTo(string* target) {
+inline void Tokenizer::RecordTo(std::string* target) {
   record_target_ = target;
   record_start_ = buffer_pos_;
 }
@@ -282,14 +305,15 @@ inline void Tokenizer::StopRecording() {
   //   be helpful by detecting the NULL pointer, even though there's nothing
   //   wrong with reading zero bytes from NULL.
   if (buffer_pos_ != record_start_) {
-    record_target_->append(buffer_ + record_start_, buffer_pos_ - record_start_);
+    record_target_->append(buffer_ + record_start_,
+                           buffer_pos_ - record_start_);
   }
   record_target_ = NULL;
   record_start_ = -1;
 }
 
 inline void Tokenizer::StartToken() {
-  current_.type = TYPE_START;    // Just for the sake of initializing it.
+  current_.type = TYPE_START;  // Just for the sake of initializing it.
   current_.text.clear();
   current_.line = line_;
   current_.column = column_;
@@ -304,12 +328,12 @@ inline void Tokenizer::EndToken() {
 // -------------------------------------------------------------------
 // Helper methods that consume characters.
 
-template<typename CharacterClass>
+template <typename CharacterClass>
 inline bool Tokenizer::LookingAt() {
   return CharacterClass::InClass(current_char_);
 }
 
-template<typename CharacterClass>
+template <typename CharacterClass>
 inline bool Tokenizer::TryConsumeOne() {
   if (CharacterClass::InClass(current_char_)) {
     NextChar();
@@ -328,14 +352,14 @@ inline bool Tokenizer::TryConsume(char c) {
   }
 }
 
-template<typename CharacterClass>
+template <typename CharacterClass>
 inline void Tokenizer::ConsumeZeroOrMore() {
   while (CharacterClass::InClass(current_char_)) {
     NextChar();
   }
 }
 
-template<typename CharacterClass>
+template <typename CharacterClass>
 inline void Tokenizer::ConsumeOneOrMore(const char* error) {
   if (!CharacterClass::InClass(current_char_)) {
     AddError(error);
@@ -381,25 +405,21 @@ void Tokenizer::ConsumeString(char delimiter) {
           }
           // Possibly followed by another hex digit, but again we don't care.
         } else if (TryConsume('u')) {
-          if (!TryConsumeOne<HexDigit>() ||
-              !TryConsumeOne<HexDigit>() ||
-              !TryConsumeOne<HexDigit>() ||
-              !TryConsumeOne<HexDigit>()) {
+          if (!TryConsumeOne<HexDigit>() || !TryConsumeOne<HexDigit>() ||
+              !TryConsumeOne<HexDigit>() || !TryConsumeOne<HexDigit>()) {
             AddError("Expected four hex digits for \\u escape sequence.");
           }
         } else if (TryConsume('U')) {
           // We expect 8 hex digits; but only the range up to 0x10ffff is
           // legal.
-          if (!TryConsume('0') ||
-              !TryConsume('0') ||
+          if (!TryConsume('0') || !TryConsume('0') ||
               !(TryConsume('0') || TryConsume('1')) ||
-              !TryConsumeOne<HexDigit>() ||
-              !TryConsumeOne<HexDigit>() ||
-              !TryConsumeOne<HexDigit>() ||
-              !TryConsumeOne<HexDigit>() ||
+              !TryConsumeOne<HexDigit>() || !TryConsumeOne<HexDigit>() ||
+              !TryConsumeOne<HexDigit>() || !TryConsumeOne<HexDigit>() ||
               !TryConsumeOne<HexDigit>()) {
-            AddError("Expected eight hex digits up to 10ffff for \\U escape "
-                     "sequence");
+            AddError(
+                "Expected eight hex digits up to 10ffff for \\U escape "
+                "sequence");
           }
         } else {
           AddError("Invalid escape sequence in string literal.");
@@ -465,7 +485,7 @@ Tokenizer::TokenType Tokenizer::ConsumeNumber(bool started_with_zero,
   } else if (current_char_ == '.') {
     if (is_float) {
       AddError(
-        "Already saw decimal point or exponent; can't have another one.");
+          "Already saw decimal point or exponent; can't have another one.");
     } else {
       AddError("Hex and octal numbers must be integers.");
     }
@@ -474,7 +494,7 @@ Tokenizer::TokenType Tokenizer::ConsumeNumber(bool started_with_zero,
   return is_float ? TYPE_FLOAT : TYPE_INTEGER;
 }
 
-void Tokenizer::ConsumeLineComment(string* content) {
+void Tokenizer::ConsumeLineComment(std::string* content) {
   if (content != NULL) RecordTo(content);
 
   while (current_char_ != '\0' && current_char_ != '\n') {
@@ -485,17 +505,15 @@ void Tokenizer::ConsumeLineComment(string* content) {
   if (content != NULL) StopRecording();
 }
 
-void Tokenizer::ConsumeBlockComment(string* content) {
+void Tokenizer::ConsumeBlockComment(std::string* content) {
   int start_line = line_;
   int start_column = column_ - 2;
 
   if (content != NULL) RecordTo(content);
 
   while (true) {
-    while (current_char_ != '\0' &&
-           current_char_ != '*' &&
-           current_char_ != '/' &&
-           current_char_ != '\n') {
+    while (current_char_ != '\0' && current_char_ != '*' &&
+           current_char_ != '/' && current_char_ != '\n') {
       NextChar();
     }
 
@@ -524,11 +542,11 @@ void Tokenizer::ConsumeBlockComment(string* content) {
       // Note:  We didn't consume the '*' because if there is a '/' after it
       //   we want to interpret that as the end of the comment.
       AddError(
-        "\"/*\" inside block comment.  Block comments cannot be nested.");
+          "\"/*\" inside block comment.  Block comments cannot be nested.");
     } else if (current_char_ == '\0') {
       AddError("End-of-file inside block comment.");
-      error_collector_->AddError(
-        start_line, start_column, "  Comment started here.");
+      error_collector_->AddError(start_line, start_column,
+                                 "  Comment started here.");
       if (content != NULL) StopRecording();
       break;
     }
@@ -557,13 +575,46 @@ Tokenizer::NextCommentStatus Tokenizer::TryConsumeCommentStart() {
   }
 }
 
+bool Tokenizer::TryConsumeWhitespace() {
+  if (report_newlines_) {
+    if (TryConsumeOne<WhitespaceNoNewline>()) {
+      ConsumeZeroOrMore<WhitespaceNoNewline>();
+      current_.type = TYPE_WHITESPACE;
+      return true;
+    }
+    return false;
+  }
+  if (TryConsumeOne<Whitespace>()) {
+    ConsumeZeroOrMore<Whitespace>();
+    current_.type = TYPE_WHITESPACE;
+    return report_whitespace_;
+  }
+  return false;
+}
+
+bool Tokenizer::TryConsumeNewline() {
+  if (!report_whitespace_ || !report_newlines_) {
+    return false;
+  }
+  if (TryConsume('\n')) {
+    current_.type = TYPE_NEWLINE;
+    return true;
+  }
+  return false;
+}
+
 // -------------------------------------------------------------------
 
 bool Tokenizer::Next() {
   previous_ = current_;
 
   while (!read_error_) {
-    ConsumeZeroOrMore<Whitespace>();
+    StartToken();
+    bool report_token = TryConsumeWhitespace() || TryConsumeNewline();
+    EndToken();
+    if (report_token) {
+      return true;
+    }
 
     switch (TryConsumeCommentStart()) {
       case LINE_COMMENT:
@@ -613,8 +664,9 @@ bool Tokenizer::Next() {
               current_.line == previous_.line &&
               current_.column == previous_.end_column) {
             // We don't accept syntax like "blah.123".
-            error_collector_->AddError(line_, column_ - 2,
-              "Need space between identifier and decimal point.");
+            error_collector_->AddError(
+                line_, column_ - 2,
+                "Need space between identifier and decimal point.");
           }
           current_.type = ConsumeNumber(false, true);
         } else {
@@ -631,7 +683,8 @@ bool Tokenizer::Next() {
       } else {
         // Check if the high order bit is set.
         if (current_char_ & 0x80) {
-          error_collector_->AddError(line_, column_,
+          error_collector_->AddError(
+              line_, column_,
               StringPrintf("Interpreting non ascii codepoint %d.",
                            static_cast<unsigned char>(current_char_)));
         }
@@ -664,9 +717,9 @@ namespace {
 // next_leading_comments.
 class CommentCollector {
  public:
-  CommentCollector(string* prev_trailing_comments,
-                   std::vector<string>* detached_comments,
-                   string* next_leading_comments)
+  CommentCollector(std::string* prev_trailing_comments,
+                   std::vector<std::string>* detached_comments,
+                   std::string* next_leading_comments)
       : prev_trailing_comments_(prev_trailing_comments),
         detached_comments_(detached_comments),
         next_leading_comments_(next_leading_comments),
@@ -687,7 +740,7 @@ class CommentCollector {
 
   // About to read a line comment.  Get the comment buffer pointer in order to
   // read into it.
-  string* GetBufferForLineComment() {
+  std::string* GetBufferForLineComment() {
     // We want to combine with previous line comments, but not block comments.
     if (has_comment_ && !is_line_comment_) {
       Flush();
@@ -699,7 +752,7 @@ class CommentCollector {
 
   // About to read a block comment.  Get the comment buffer pointer in order to
   // read into it.
-  string* GetBufferForBlockComment() {
+  std::string* GetBufferForBlockComment() {
     if (has_comment_) {
       Flush();
     }
@@ -731,16 +784,14 @@ class CommentCollector {
     }
   }
 
-  void DetachFromPrev() {
-    can_attach_to_prev_ = false;
-  }
+  void DetachFromPrev() { can_attach_to_prev_ = false; }
 
  private:
-  string* prev_trailing_comments_;
-  std::vector<string>* detached_comments_;
-  string* next_leading_comments_;
+  std::string* prev_trailing_comments_;
+  std::vector<std::string>* detached_comments_;
+  std::string* next_leading_comments_;
 
-  string comment_buffer_;
+  std::string comment_buffer_;
 
   // True if any comments were read into comment_buffer_.  This can be true even
   // if comment_buffer_ is empty, namely if the comment was "/**/".
@@ -754,21 +805,23 @@ class CommentCollector {
   bool can_attach_to_prev_;
 };
 
-} // namespace
+}  // namespace
 
-bool Tokenizer::NextWithComments(string* prev_trailing_comments,
-                                 std::vector<string>* detached_comments,
-                                 string* next_leading_comments) {
+bool Tokenizer::NextWithComments(std::string* prev_trailing_comments,
+                                 std::vector<std::string>* detached_comments,
+                                 std::string* next_leading_comments) {
   CommentCollector collector(prev_trailing_comments, detached_comments,
                              next_leading_comments);
 
   if (current_.type == TYPE_START) {
     // Ignore unicode byte order mark(BOM) if it appears at the file
     // beginning. Only UTF-8 BOM (0xEF 0xBB 0xBF) is accepted.
-    if (TryConsume((char)0xEF)) {
-      if (!TryConsume((char)0xBB) || !TryConsume((char)0xBF)) {
-        AddError("Proto file starts with 0xEF but not UTF-8 BOM. "
-                 "Only UTF-8 is accepted for proto file.");
+    if (TryConsume(static_cast<char>(0xEF))) {
+      if (!TryConsume(static_cast<char>(0xBB)) ||
+          !TryConsume(static_cast<char>(0xBF))) {
+        AddError(
+            "Proto file starts with 0xEF but not UTF-8 BOM. "
+            "Only UTF-8 is accepted for proto file.");
         return false;
       }
     }
@@ -836,9 +889,7 @@ bool Tokenizer::NextWithComments(string* prev_trailing_comments,
           collector.DetachFromPrev();
         } else {
           bool result = Next();
-          if (!result ||
-              current_.text == "}" ||
-              current_.text == "]" ||
+          if (!result || current_.text == "}" || current_.text == "]" ||
               current_.text == ")") {
             // It looks like we're at the end of a scope.  In this case it
             // makes no sense to attach a comment to the following token.
@@ -858,12 +909,12 @@ bool Tokenizer::NextWithComments(string* prev_trailing_comments,
 // are given is text that the tokenizer actually parsed as a token
 // of the given type.
 
-bool Tokenizer::ParseInteger(const string& text, uint64 max_value,
-                             uint64* output) {
+bool Tokenizer::ParseInteger(const std::string& text, uint64_t max_value,
+                             uint64_t* output) {
   // Sadly, we can't just use strtoul() since it is only 32-bit and strtoull()
   // is non-standard.  I hate the C standard library.  :(
 
-//  return strtoull(text.c_str(), NULL, 0);
+  //  return strtoull(text.c_str(), NULL, 0);
 
   const char* ptr = text.c_str();
   int base = 10;
@@ -878,7 +929,7 @@ bool Tokenizer::ParseInteger(const string& text, uint64 max_value,
     }
   }
 
-  uint64 result = 0;
+  uint64_t result = 0;
   for (; *ptr != '\0'; ptr++) {
     int digit = DigitValue(*ptr);
     if (digit < 0 || digit >= base) {
@@ -886,7 +937,8 @@ bool Tokenizer::ParseInteger(const string& text, uint64 max_value,
       // token, but Tokenizer still think it's integer.
       return false;
     }
-    if (digit > max_value || result > (max_value - digit) / base) {
+    if (static_cast<uint64_t>(digit) > max_value ||
+        result > (max_value - digit) / base) {
       // Overflow.
       return false;
     }
@@ -897,7 +949,7 @@ bool Tokenizer::ParseInteger(const string& text, uint64 max_value,
   return true;
 }
 
-double Tokenizer::ParseFloat(const string& text) {
+double Tokenizer::ParseFloat(const std::string& text) {
   const char* start = text.c_str();
   char* end;
   double result = NoLocaleStrtod(start, &end);
@@ -916,41 +968,38 @@ double Tokenizer::ParseFloat(const string& text) {
     ++end;
   }
 
-  GOOGLE_LOG_IF(DFATAL, end - start != text.size() || *start == '-')
-    << " Tokenizer::ParseFloat() passed text that could not have been"
-       " tokenized as a float: " << CEscape(text);
+  GOOGLE_LOG_IF(DFATAL,
+         static_cast<size_t>(end - start) != text.size() || *start == '-')
+      << " Tokenizer::ParseFloat() passed text that could not have been"
+         " tokenized as a float: "
+      << CEscape(text);
   return result;
 }
 
 // Helper to append a Unicode code point to a string as UTF8, without bringing
 // in any external dependencies.
-static void AppendUTF8(uint32 code_point, string* output) {
-  uint32 tmp = 0;
+static void AppendUTF8(uint32_t code_point, std::string* output) {
+  uint32_t tmp = 0;
   int len = 0;
   if (code_point <= 0x7f) {
     tmp = code_point;
     len = 1;
   } else if (code_point <= 0x07ff) {
-    tmp = 0x0000c080 |
-        ((code_point & 0x07c0) << 2) |
-        (code_point & 0x003f);
+    tmp = 0x0000c080 | ((code_point & 0x07c0) << 2) | (code_point & 0x003f);
     len = 2;
   } else if (code_point <= 0xffff) {
-    tmp = 0x00e08080 |
-        ((code_point & 0xf000) << 4) |
-        ((code_point & 0x0fc0) << 2) |
-        (code_point & 0x003f);
+    tmp = 0x00e08080 | ((code_point & 0xf000) << 4) |
+          ((code_point & 0x0fc0) << 2) | (code_point & 0x003f);
     len = 3;
-  } else if (code_point <= 0x1fffff) {
-    tmp = 0xf0808080 |
-        ((code_point & 0x1c0000) << 6) |
-        ((code_point & 0x03f000) << 4) |
-        ((code_point & 0x000fc0) << 2) |
-        (code_point & 0x003f);
+  } else if (code_point <= 0x10ffff) {
+    tmp = 0xf0808080 | ((code_point & 0x1c0000) << 6) |
+          ((code_point & 0x03f000) << 4) | ((code_point & 0x000fc0) << 2) |
+          (code_point & 0x003f);
     len = 4;
   } else {
-    // UTF-16 is only defined for code points up to 0x10FFFF, and UTF-8 is
-    // normally only defined up to there as well.
+    // Unicode code points end at 0x10FFFF, so this is out-of-range.
+    // ConsumeString permits hex values up to 0x1FFFFF, and FetchUnicodePoint
+    // doesn't perform a range check.
     StringAppendF(output, "\\U%08x", code_point);
     return;
   }
@@ -960,7 +1009,7 @@ static void AppendUTF8(uint32 code_point, string* output) {
 
 // Try to read <len> hex digits from ptr, and stuff the numeric result into
 // *result. Returns true if that many digits were successfully consumed.
-static bool ReadHexDigits(const char* ptr, int len, uint32* result) {
+static bool ReadHexDigits(const char* ptr, int len, uint32_t* result) {
   *result = 0;
   if (len == 0) return false;
   for (const char* end = ptr + len; ptr < end; ++ptr) {
@@ -975,26 +1024,27 @@ static bool ReadHexDigits(const char* ptr, int len, uint32* result) {
 // surrogate. These numbers are in a reserved range of Unicode code points, so
 // if we encounter such a pair we know how to parse it and convert it into a
 // single code point.
-static const uint32 kMinHeadSurrogate = 0xd800;
-static const uint32 kMaxHeadSurrogate = 0xdc00;
-static const uint32 kMinTrailSurrogate = 0xdc00;
-static const uint32 kMaxTrailSurrogate = 0xe000;
+static const uint32_t kMinHeadSurrogate = 0xd800;
+static const uint32_t kMaxHeadSurrogate = 0xdc00;
+static const uint32_t kMinTrailSurrogate = 0xdc00;
+static const uint32_t kMaxTrailSurrogate = 0xe000;
 
-static inline bool IsHeadSurrogate(uint32 code_point) {
+static inline bool IsHeadSurrogate(uint32_t code_point) {
   return (code_point >= kMinHeadSurrogate) && (code_point < kMaxHeadSurrogate);
 }
 
-static inline bool IsTrailSurrogate(uint32 code_point) {
+static inline bool IsTrailSurrogate(uint32_t code_point) {
   return (code_point >= kMinTrailSurrogate) &&
-      (code_point < kMaxTrailSurrogate);
+         (code_point < kMaxTrailSurrogate);
 }
 
 // Combine a head and trail surrogate into a single Unicode code point.
-static uint32 AssembleUTF16(uint32 head_surrogate, uint32 trail_surrogate) {
+static uint32_t AssembleUTF16(uint32_t head_surrogate,
+                              uint32_t trail_surrogate) {
   GOOGLE_DCHECK(IsHeadSurrogate(head_surrogate));
   GOOGLE_DCHECK(IsTrailSurrogate(trail_surrogate));
   return 0x10000 + (((head_surrogate - kMinHeadSurrogate) << 10) |
-      (trail_surrogate - kMinTrailSurrogate));
+                    (trail_surrogate - kMinTrailSurrogate));
 }
 
 // Convert the escape sequence parameter to a number of expected hex digits.
@@ -1008,12 +1058,11 @@ static inline int UnicodeLength(char key) {
 // to parse that sequence. On success, returns a pointer to the first char
 // beyond that sequence, and fills in *code_point. On failure, returns ptr
 // itself.
-static const char* FetchUnicodePoint(const char* ptr, uint32* code_point) {
+static const char* FetchUnicodePoint(const char* ptr, uint32_t* code_point) {
   const char* p = ptr;
   // Fetch the code point.
   const int len = UnicodeLength(*p++);
-  if (!ReadHexDigits(p, len, code_point))
-    return ptr;
+  if (!ReadHexDigits(p, len, code_point)) return ptr;
   p += len;
 
   // Check if the code point we read is a "head surrogate." If so, then we
@@ -1021,7 +1070,7 @@ static const char* FetchUnicodePoint(const char* ptr, uint32* code_point) {
   // "trail surrogate," and together they form a UTF-16 pair which decodes into
   // a single Unicode point. Trail surrogates may only use \u, not \U.
   if (IsHeadSurrogate(*code_point) && *p == '\\' && *(p + 1) == 'u') {
-    uint32 trail_surrogate;
+    uint32_t trail_surrogate;
     if (ReadHexDigits(p + 2, 4, &trail_surrogate) &&
         IsTrailSurrogate(trail_surrogate)) {
       *code_point = AssembleUTF16(*code_point, trail_surrogate);
@@ -1036,14 +1085,15 @@ static const char* FetchUnicodePoint(const char* ptr, uint32* code_point) {
 
 // The text string must begin and end with single or double quote
 // characters.
-void Tokenizer::ParseStringAppend(const string& text, string* output) {
+void Tokenizer::ParseStringAppend(const std::string& text,
+                                  std::string* output) {
   // Reminder: text[0] is always a quote character.  (If text is
   // empty, it's invalid, so we'll just return).
   const size_t text_size = text.size();
   if (text_size == 0) {
-    GOOGLE_LOG(DFATAL)
-      << " Tokenizer::ParseStringAppend() passed text that could not"
-         " have been tokenized as a string: " << CEscape(text);
+    GOOGLE_LOG(DFATAL) << " Tokenizer::ParseStringAppend() passed text that could not"
+                   " have been tokenized as a string: "
+                << CEscape(text);
     return;
   }
 
@@ -1092,7 +1142,7 @@ void Tokenizer::ParseStringAppend(const string& text, string* output) {
         output->push_back(static_cast<char>(code));
 
       } else if (*ptr == 'u' || *ptr == 'U') {
-        uint32 unicode;
+        uint32_t unicode;
         const char* end = FetchUnicodePoint(ptr, &unicode);
         if (end == ptr) {
           // Failure: Just dump out what we saw, don't try to parse it.
@@ -1114,23 +1164,19 @@ void Tokenizer::ParseStringAppend(const string& text, string* output) {
   }
 }
 
-template<typename CharacterClass>
-static bool AllInClass(const string& s) {
-  for (int i = 0; i < s.size(); ++i) {
-    if (!CharacterClass::InClass(s[i]))
-      return false;
+template <typename CharacterClass>
+static bool AllInClass(const std::string& s) {
+  for (const char character : s) {
+    if (!CharacterClass::InClass(character)) return false;
   }
   return true;
 }
 
-bool Tokenizer::IsIdentifier(const string& text) {
+bool Tokenizer::IsIdentifier(const std::string& text) {
   // Mirrors IDENTIFIER definition in Tokenizer::Next() above.
-  if (text.size() == 0)
-    return false;
-  if (!Letter::InClass(text.at(0)))
-    return false;
-  if (!AllInClass<Alphanumeric>(text.substr(1)))
-    return false;
+  if (text.size() == 0) return false;
+  if (!Letter::InClass(text.at(0))) return false;
+  if (!AllInClass<Alphanumeric>(text.substr(1))) return false;
   return true;
 }
 
index e80d564..f7b693e 100644 (file)
 #ifndef GOOGLE_PROTOBUF_IO_TOKENIZER_H__
 #define GOOGLE_PROTOBUF_IO_TOKENIZER_H__
 
+
 #include <string>
 #include <vector>
+
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
 namespace io {
 
-class ZeroCopyInputStream;     // zero_copy_stream.h
+class ZeroCopyInputStream;  // zero_copy_stream.h
 
 // Defined in this file.
 class ErrorCollector;
@@ -61,7 +64,7 @@ typedef int ColumnNumber;
 // Abstract interface for an object which collects the errors that occur
 // during parsing.  A typical implementation might simply print the errors
 // to stdout.
-class LIBPROTOBUF_EXPORT ErrorCollector {
+class PROTOBUF_EXPORT ErrorCollector {
  public:
   inline ErrorCollector() {}
   virtual ~ErrorCollector();
@@ -70,13 +73,13 @@ class LIBPROTOBUF_EXPORT ErrorCollector {
   // column numbers.  The numbers are zero-based, so you may want to add
   // 1 to each before printing them.
   virtual void AddError(int line, ColumnNumber column,
-                        const string& message) = 0;
+                        const std::string& message) = 0;
 
   // Indicates that there was a warning in the input at the given line and
   // column numbers.  The numbers are zero-based, so you may want to add
   // 1 to each before printing them.
-  virtual void AddWarning(int line, ColumnNumber column,
-                          const string& message) { }
+  virtual void AddWarning(int /* line */, ColumnNumber /* column */,
+                          const std::string& /* message */) {}
 
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorCollector);
@@ -88,7 +91,7 @@ class LIBPROTOBUF_EXPORT ErrorCollector {
 // precise descriptions.  Whitespace and comments are skipped.  By default,
 // C- and C++-style comments are recognized, but other styles can be used by
 // calling set_comment_style().
-class LIBPROTOBUF_EXPORT Tokenizer {
+class PROTOBUF_EXPORT Tokenizer {
  public:
   // Construct a Tokenizer that reads and tokenizes text from the given
   // input stream and writes errors to the given error_collector.
@@ -97,8 +100,8 @@ class LIBPROTOBUF_EXPORT Tokenizer {
   ~Tokenizer();
 
   enum TokenType {
-    TYPE_START,       // Next() has not yet been called.
-    TYPE_END,         // End of input reached.  "text" is empty.
+    TYPE_START,  // Next() has not yet been called.
+    TYPE_END,    // End of input reached.  "text" is empty.
 
     TYPE_IDENTIFIER,  // A sequence of letters, digits, and underscores, not
                       // starting with a digit.  It is an error for a number
@@ -119,12 +122,19 @@ class LIBPROTOBUF_EXPORT Tokenizer {
     TYPE_SYMBOL,      // Any other printable character, like '!' or '+'.
                       // Symbols are always a single character, so "!+$%" is
                       // four tokens.
+    TYPE_WHITESPACE,  // A sequence of whitespace.  This token type is only
+                      // produced if report_whitespace() is true.  It is not
+                      // reported for whitespace within comments or strings.
+    TYPE_NEWLINE,     // A newline (\n).  This token type is only
+                      // produced if report_whitespace() is true and
+                      // report_newlines() is true.  It is not reported for
+                      // newlines in comments or strings.
   };
 
   // Structure representing a token read from the token stream.
   struct Token {
     TokenType type;
-    string text;       // The exact text of the token as it appeared in
+    std::string text;  // The exact text of the token as it appeared in
                        // the input.  e.g. tokens of TYPE_STRING will still
                        // be escaped and in quotes.
 
@@ -190,32 +200,32 @@ class LIBPROTOBUF_EXPORT Tokenizer {
   //   /* Block comment attached to
   //    * grault. */
   //   optional int32 grault = 6;
-  bool NextWithComments(string* prev_trailing_comments,
-                        std::vector<string>* detached_comments,
-                        string* next_leading_comments);
+  bool NextWithComments(std::string* prev_trailing_comments,
+                        std::vector<std::string>* detached_comments,
+                        std::string* next_leading_comments);
 
   // Parse helpers ---------------------------------------------------
 
   // Parses a TYPE_FLOAT token.  This never fails, so long as the text actually
   // comes from a TYPE_FLOAT token parsed by Tokenizer.  If it doesn't, the
   // result is undefined (possibly an assert failure).
-  static double ParseFloat(const string& text);
+  static double ParseFloat(const std::string& text);
 
   // Parses a TYPE_STRING token.  This never fails, so long as the text actually
   // comes from a TYPE_STRING token parsed by Tokenizer.  If it doesn't, the
   // result is undefined (possibly an assert failure).
-  static void ParseString(const string& text, string* output);
+  static void ParseString(const std::string& text, std::string* output);
 
   // Identical to ParseString, but appends to output.
-  static void ParseStringAppend(const string& text, string* output);
+  static void ParseStringAppend(const std::string& text, std::string* output);
 
   // Parses a TYPE_INTEGER token.  Returns false if the result would be
   // greater than max_value.  Otherwise, returns true and sets *output to the
   // result.  If the text is not from a Token of type TYPE_INTEGER originally
   // parsed by a Tokenizer, the result is undefined (possibly an assert
   // failure).
-  static bool ParseInteger(const string& text, uint64 max_value,
-                           uint64* output);
+  static bool ParseInteger(const std::string& text, uint64_t max_value,
+                           uint64_t* output);
 
   // Options ---------------------------------------------------------
 
@@ -249,24 +259,34 @@ class LIBPROTOBUF_EXPORT Tokenizer {
     allow_multiline_strings_ = allow;
   }
 
+  // If true, whitespace tokens are reported by Next().
+  // Note: `set_report_whitespace(false)` implies `set_report_newlines(false)`.
+  bool report_whitespace() const;
+  void set_report_whitespace(bool report);
+
+  // If true, newline tokens are reported by Next().
+  // Note: `set_report_newlines(true)` implies `set_report_whitespace(true)`.
+  bool report_newlines() const;
+  void set_report_newlines(bool report);
+
   // External helper: validate an identifier.
-  static bool IsIdentifier(const string& text);
+  static bool IsIdentifier(const std::string& text);
 
   // -----------------------------------------------------------------
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Tokenizer);
 
-  Token current_;           // Returned by current().
-  Token previous_;          // Returned by previous().
+  Token current_;   // Returned by current().
+  Token previous_;  // Returned by previous().
 
   ZeroCopyInputStream* input_;
   ErrorCollector* error_collector_;
 
-  char current_char_;       // == buffer_[buffer_pos_], updated by NextChar().
-  const char* buffer_;      // Current buffer returned from input_.
-  int buffer_size_;         // Size of buffer_.
-  int buffer_pos_;          // Current position within the buffer.
-  bool read_error_;         // Did we previously encounter a read error?
+  char current_char_;   // == buffer_[buffer_pos_], updated by NextChar().
+  const char* buffer_;  // Current buffer returned from input_.
+  int buffer_size_;     // Size of buffer_.
+  int buffer_pos_;      // Current position within the buffer.
+  bool read_error_;     // Did we previously encounter a read error?
 
   // Line and column number of current_char_ within the whole input stream.
   int line_;
@@ -276,7 +296,7 @@ class LIBPROTOBUF_EXPORT Tokenizer {
   // Call RecordTo(&str) to start recording and StopRecording() to stop.
   // E.g. StartToken() calls RecordTo(&current_.text).  record_start_ is the
   // position within the current buffer where recording started.
-  string* record_target_;
+  std::string* record_target_;
   int record_start_;
 
   // Options.
@@ -284,6 +304,8 @@ class LIBPROTOBUF_EXPORT Tokenizer {
   CommentStyle comment_style_;
   bool require_space_after_number_;
   bool allow_multiline_strings_;
+  bool report_whitespace_ = false;
+  bool report_newlines_ = false;
 
   // Since we count columns we need to interpret tabs somehow.  We'll take
   // the standard 8-character definition for lack of any way to do better.
@@ -299,7 +321,7 @@ class LIBPROTOBUF_EXPORT Tokenizer {
   // Read a new buffer from the input.
   void Refresh();
 
-  inline void RecordTo(string* target);
+  inline void RecordTo(std::string* target);
   inline void StopRecording();
 
   // Called when the current character is the first character of a new
@@ -311,7 +333,7 @@ class LIBPROTOBUF_EXPORT Tokenizer {
   inline void EndToken();
 
   // Convenience method to add an error at the current line and column.
-  void AddError(const string& message) {
+  void AddError(const std::string& message) {
     error_collector_->AddError(line_, column_, message);
   }
 
@@ -334,9 +356,9 @@ class LIBPROTOBUF_EXPORT Tokenizer {
   TokenType ConsumeNumber(bool started_with_zero, bool started_with_dot);
 
   // Consume the rest of a line.
-  void ConsumeLineComment(string* content);
+  void ConsumeLineComment(std::string* content);
   // Consume until "*/".
-  void ConsumeBlockComment(string* content);
+  void ConsumeBlockComment(std::string* content);
 
   enum NextCommentStatus {
     // Started a line comment.
@@ -357,6 +379,14 @@ class LIBPROTOBUF_EXPORT Tokenizer {
   // of comment it is.
   NextCommentStatus TryConsumeCommentStart();
 
+  // If we're looking at a TYPE_WHITESPACE token and `report_whitespace_` is
+  // true, consume it and return true.
+  bool TryConsumeWhitespace();
+
+  // If we're looking at a TYPE_NEWLINE token and `report_newlines_` is true,
+  // consume it and return true.
+  bool TryConsumeNewline();
+
   // -----------------------------------------------------------------
   // These helper methods make the parsing code more readable.  The
   // "character classes" referred to are defined at the top of the .cc file.
@@ -367,45 +397,44 @@ class LIBPROTOBUF_EXPORT Tokenizer {
 
   // Returns true if the current character is of the given character
   // class, but does not consume anything.
-  template<typename CharacterClass>
+  template <typename CharacterClass>
   inline bool LookingAt();
 
   // If the current character is in the given class, consume it and return
   // true.  Otherwise return false.
   // e.g. TryConsumeOne<Letter>()
-  template<typename CharacterClass>
+  template <typename CharacterClass>
   inline bool TryConsumeOne();
 
   // Like above, but try to consume the specific character indicated.
   inline bool TryConsume(char c);
 
   // Consume zero or more of the given character class.
-  template<typename CharacterClass>
+  template <typename CharacterClass>
   inline void ConsumeZeroOrMore();
 
   // Consume one or more of the given character class or log the given
   // error message.
   // e.g. ConsumeOneOrMore<Digit>("Expected digits.");
-  template<typename CharacterClass>
+  template <typename CharacterClass>
   inline void ConsumeOneOrMore(const char* error);
 };
 
 // inline methods ====================================================
-inline const Tokenizer::Token& Tokenizer::current() {
-  return current_;
-}
+inline const Tokenizer::Token& Tokenizer::current() { return current_; }
 
-inline const Tokenizer::Token& Tokenizer::previous() {
-  return previous_;
-}
+inline const Tokenizer::Token& Tokenizer::previous() { return previous_; }
 
-inline void Tokenizer::ParseString(const string& text, string* output) {
+inline void Tokenizer::ParseString(const std::string& text,
+                                   std::string* output) {
   output->clear();
   ParseStringAppend(text, output);
 }
 
 }  // namespace io
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_IO_TOKENIZER_H__
index 62ace7a..d3bd6da 100644 (file)
 #ifndef GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__
 #define GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__
 
+
 #include <string>
+
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/port_def.inc>
 
-namespace google {
 
+namespace google {
 namespace protobuf {
 namespace io {
 
@@ -121,7 +124,7 @@ class ZeroCopyOutputStream;
 
 // Abstract interface similar to an input stream but designed to minimize
 // copying.
-class LIBPROTOBUF_EXPORT ZeroCopyInputStream {
+class PROTOBUF_EXPORT ZeroCopyInputStream {
  public:
   ZeroCopyInputStream() {}
   virtual ~ZeroCopyInputStream() {}
@@ -169,7 +172,7 @@ class LIBPROTOBUF_EXPORT ZeroCopyInputStream {
   virtual bool Skip(int count) = 0;
 
   // Returns the total number of bytes read since this object was created.
-  virtual int64 ByteCount() const = 0;
+  virtual int64_t ByteCount() const = 0;
 
 
  private:
@@ -178,7 +181,7 @@ class LIBPROTOBUF_EXPORT ZeroCopyInputStream {
 
 // Abstract interface similar to an output stream but designed to minimize
 // copying.
-class LIBPROTOBUF_EXPORT ZeroCopyOutputStream {
+class PROTOBUF_EXPORT ZeroCopyOutputStream {
  public:
   ZeroCopyOutputStream() {}
   virtual ~ZeroCopyOutputStream() {}
@@ -224,7 +227,7 @@ class LIBPROTOBUF_EXPORT ZeroCopyOutputStream {
   virtual void BackUp(int count) = 0;
 
   // Returns the total number of bytes written since this object was created.
-  virtual int64 ByteCount() const = 0;
+  virtual int64_t ByteCount() const = 0;
 
   // Write a given chunk of data to the output.  Some output streams may
   // implement this in a way that avoids copying. Check AllowsAliasing() before
@@ -243,6 +246,8 @@ class LIBPROTOBUF_EXPORT ZeroCopyOutputStream {
 
 }  // namespace io
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__
index dd92113..c66bc86 100644 (file)
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
 #ifndef _MSC_VER
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
 #endif
 #include <errno.h>
-#include <iostream>
+
 #include <algorithm>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
+#include <iostream>
+
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/io/io_win32.h>
+#include <google/protobuf/io/zero_copy_stream_impl.h>
 #include <google/protobuf/stubs/stl_util.h>
-#include <google/protobuf/stubs/io_win32.h>
 
 
 namespace google {
@@ -58,11 +60,11 @@ namespace io {
 #define lseek(fd, offset, origin) ((off_t)-1)
 // DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
 // them like we do below.
-using google::protobuf::internal::win32::access;
-using google::protobuf::internal::win32::close;
-using google::protobuf::internal::win32::open;
-using google::protobuf::internal::win32::read;
-using google::protobuf::internal::win32::write;
+using google::protobuf::io::win32::access;
+using google::protobuf::io::win32::close;
+using google::protobuf::io::win32::open;
+using google::protobuf::io::win32::read;
+using google::protobuf::io::win32::write;
 #endif
 
 namespace {
@@ -78,41 +80,35 @@ int close_no_eintr(int fd) {
 
 }  // namespace
 
-
 // ===================================================================
 
 FileInputStream::FileInputStream(int file_descriptor, int block_size)
-  : copying_input_(file_descriptor),
-    impl_(&copying_input_, block_size) {
-}
+    : copying_input_(file_descriptor), impl_(&copying_input_, block_size) {}
 
-bool FileInputStream::Close() {
-  return copying_input_.Close();
-}
+bool FileInputStream::Close() { return copying_input_.Close(); }
 
 bool FileInputStream::Next(const void** data, int* size) {
   return impl_.Next(data, size);
 }
 
-void FileInputStream::BackUp(int count) {
-  impl_.BackUp(count);
-}
+void FileInputStream::BackUp(int count) { impl_.BackUp(count); }
 
-bool FileInputStream::Skip(int count) {
-  return impl_.Skip(count);
-}
+bool FileInputStream::Skip(int count) { return impl_.Skip(count); }
 
-int64 FileInputStream::ByteCount() const {
-  return impl_.ByteCount();
-}
+int64_t FileInputStream::ByteCount() const { return impl_.ByteCount(); }
 
 FileInputStream::CopyingFileInputStream::CopyingFileInputStream(
     int file_descriptor)
-  : file_(file_descriptor),
-    close_on_delete_(false),
-    is_closed_(false),
-    errno_(0),
-    previous_seek_failed_(false) {
+    : file_(file_descriptor),
+      close_on_delete_(false),
+      is_closed_(false),
+      errno_(0),
+      previous_seek_failed_(false) {
+#ifndef _WIN32
+  int flags = fcntl(file_, F_GETFL);
+  flags &= ~O_NONBLOCK;
+  fcntl(file_, F_SETFL, flags);
+#endif
 }
 
 FileInputStream::CopyingFileInputStream::~CopyingFileInputStream() {
@@ -157,8 +153,7 @@ int FileInputStream::CopyingFileInputStream::Read(void* buffer, int size) {
 int FileInputStream::CopyingFileInputStream::Skip(int count) {
   GOOGLE_CHECK(!is_closed_);
 
-  if (!previous_seek_failed_ &&
-      lseek(file_, count, SEEK_CUR) != (off_t)-1) {
+  if (!previous_seek_failed_ && lseek(file_, count, SEEK_CUR) != (off_t)-1) {
     // Seek succeeded.
     return count;
   } else {
@@ -175,43 +170,23 @@ int FileInputStream::CopyingFileInputStream::Skip(int count) {
 
 // ===================================================================
 
-FileOutputStream::FileOutputStream(int file_descriptor, int block_size)
-  : copying_output_(file_descriptor),
-    impl_(&copying_output_, block_size) {
-}
-
-FileOutputStream::~FileOutputStream() {
-  impl_.Flush();
-}
+FileOutputStream::FileOutputStream(int file_descriptor, int /*block_size*/)
+    : CopyingOutputStreamAdaptor(&copying_output_),
+      copying_output_(file_descriptor) {}
 
 bool FileOutputStream::Close() {
-  bool flush_succeeded = impl_.Flush();
+  bool flush_succeeded = Flush();
   return copying_output_.Close() && flush_succeeded;
 }
 
-bool FileOutputStream::Flush() {
-  return impl_.Flush();
-}
-
-bool FileOutputStream::Next(void** data, int* size) {
-  return impl_.Next(data, size);
-}
-
-void FileOutputStream::BackUp(int count) {
-  impl_.BackUp(count);
-}
-
-int64 FileOutputStream::ByteCount() const {
-  return impl_.ByteCount();
-}
-
 FileOutputStream::CopyingFileOutputStream::CopyingFileOutputStream(
     int file_descriptor)
-  : file_(file_descriptor),
-    close_on_delete_(false),
-    is_closed_(false),
-    errno_(0) {
-}
+    : file_(file_descriptor),
+      close_on_delete_(false),
+      is_closed_(false),
+      errno_(0) {}
+
+FileOutputStream::~FileOutputStream() { Flush(); }
 
 FileOutputStream::CopyingFileOutputStream::~CopyingFileOutputStream() {
   if (close_on_delete_) {
@@ -236,12 +211,12 @@ bool FileOutputStream::CopyingFileOutputStream::Close() {
   return true;
 }
 
-bool FileOutputStream::CopyingFileOutputStream::Write(
-    const void* buffer, int size) {
+bool FileOutputStream::CopyingFileOutputStream::Write(const void* buffer,
+                                                      int size) {
   GOOGLE_CHECK(!is_closed_);
   int total_written = 0;
 
-  const uint8* buffer_base = reinterpret_cast<const uint8*>(buffer);
+  const uint8_t* buffer_base = reinterpret_cast<const uint8_t*>(buffer);
 
   while (total_written < size) {
     int bytes;
@@ -280,17 +255,11 @@ bool IstreamInputStream::Next(const void** data, int* size) {
   return impl_.Next(data, size);
 }
 
-void IstreamInputStream::BackUp(int count) {
-  impl_.BackUp(count);
-}
+void IstreamInputStream::BackUp(int count) { impl_.BackUp(count); }
 
-bool IstreamInputStream::Skip(int count) {
-  return impl_.Skip(count);
-}
+bool IstreamInputStream::Skip(int count) { return impl_.Skip(count); }
 
-int64 IstreamInputStream::ByteCount() const {
-  return impl_.ByteCount();
-}
+int64_t IstreamInputStream::ByteCount() const { return impl_.ByteCount(); }
 
 IstreamInputStream::CopyingIstreamInputStream::CopyingIstreamInputStream(
     std::istream* input)
@@ -298,8 +267,8 @@ IstreamInputStream::CopyingIstreamInputStream::CopyingIstreamInputStream(
 
 IstreamInputStream::CopyingIstreamInputStream::~CopyingIstreamInputStream() {}
 
-int IstreamInputStream::CopyingIstreamInputStream::Read(
-    void* buffer, int size) {
+int IstreamInputStream::CopyingIstreamInputStream::Read(void* buffer,
+                                                        int size) {
   input_->read(reinterpret_cast<char*>(buffer), size);
   int result = input_->gcount();
   if (result == 0 && input_->fail() && !input_->eof()) {
@@ -313,21 +282,15 @@ int IstreamInputStream::CopyingIstreamInputStream::Read(
 OstreamOutputStream::OstreamOutputStream(std::ostream* output, int block_size)
     : copying_output_(output), impl_(&copying_output_, block_size) {}
 
-OstreamOutputStream::~OstreamOutputStream() {
-  impl_.Flush();
-}
+OstreamOutputStream::~OstreamOutputStream() { impl_.Flush(); }
 
 bool OstreamOutputStream::Next(void** data, int* size) {
   return impl_.Next(data, size);
 }
 
-void OstreamOutputStream::BackUp(int count) {
-  impl_.BackUp(count);
-}
+void OstreamOutputStream::BackUp(int count) { impl_.BackUp(count); }
 
-int64 OstreamOutputStream::ByteCount() const {
-  return impl_.ByteCount();
-}
+int64_t OstreamOutputStream::ByteCount() const { return impl_.ByteCount(); }
 
 OstreamOutputStream::CopyingOstreamOutputStream::CopyingOstreamOutputStream(
     std::ostream* output)
@@ -336,8 +299,8 @@ OstreamOutputStream::CopyingOstreamOutputStream::CopyingOstreamOutputStream(
 OstreamOutputStream::CopyingOstreamOutputStream::~CopyingOstreamOutputStream() {
 }
 
-bool OstreamOutputStream::CopyingOstreamOutputStream::Write(
-    const void* buffer, int size) {
+bool OstreamOutputStream::CopyingOstreamOutputStream::Write(const void* buffer,
+                                                            int size) {
   output_->write(reinterpret_cast<const char*>(buffer), size);
   return output_->good();
 }
@@ -346,7 +309,7 @@ bool OstreamOutputStream::CopyingOstreamOutputStream::Write(
 
 ConcatenatingInputStream::ConcatenatingInputStream(
     ZeroCopyInputStream* const streams[], int count)
-  : streams_(streams), stream_count_(count), bytes_retired_(0) {
+    : streams_(streams), stream_count_(count), bytes_retired_(0) {
 }
 
 bool ConcatenatingInputStream::Next(const void** data, int* size) {
@@ -375,12 +338,12 @@ bool ConcatenatingInputStream::Skip(int count) {
   while (stream_count_ > 0) {
     // Assume that ByteCount() can be used to find out how much we actually
     // skipped when Skip() fails.
-    int64 target_byte_count = streams_[0]->ByteCount() + count;
+    int64_t target_byte_count = streams_[0]->ByteCount() + count;
     if (streams_[0]->Skip(count)) return true;
 
     // Hit the end of the stream.  Figure out how many more bytes we still have
     // to skip.
-    int64 final_byte_count = streams_[0]->ByteCount();
+    int64_t final_byte_count = streams_[0]->ByteCount();
     GOOGLE_DCHECK_LT(final_byte_count, target_byte_count);
     count = target_byte_count - final_byte_count;
 
@@ -393,7 +356,7 @@ bool ConcatenatingInputStream::Skip(int count) {
   return false;
 }
 
-int64 ConcatenatingInputStream::ByteCount() const {
+int64_t ConcatenatingInputStream::ByteCount() const {
   if (stream_count_ == 0) {
     return bytes_retired_;
   } else {
@@ -404,63 +367,6 @@ int64 ConcatenatingInputStream::ByteCount() const {
 
 // ===================================================================
 
-LimitingInputStream::LimitingInputStream(ZeroCopyInputStream* input,
-                                         int64 limit)
-  : input_(input), limit_(limit) {
-  prior_bytes_read_ = input_->ByteCount();
-}
-
-LimitingInputStream::~LimitingInputStream() {
-  // If we overshot the limit, back up.
-  if (limit_ < 0) input_->BackUp(-limit_);
-}
-
-bool LimitingInputStream::Next(const void** data, int* size) {
-  if (limit_ <= 0) return false;
-  if (!input_->Next(data, size)) return false;
-
-  limit_ -= *size;
-  if (limit_ < 0) {
-    // We overshot the limit.  Reduce *size to hide the rest of the buffer.
-    *size += limit_;
-  }
-  return true;
-}
-
-void LimitingInputStream::BackUp(int count) {
-  if (limit_ < 0) {
-    input_->BackUp(count - limit_);
-    limit_ = count;
-  } else {
-    input_->BackUp(count);
-    limit_ += count;
-  }
-}
-
-bool LimitingInputStream::Skip(int count) {
-  if (count > limit_) {
-    if (limit_ < 0) return false;
-    input_->Skip(limit_);
-    limit_ = 0;
-    return false;
-  } else {
-    if (!input_->Skip(count)) return false;
-    limit_ -= count;
-    return true;
-  }
-}
-
-int64 LimitingInputStream::ByteCount() const {
-  if (limit_ < 0) {
-    return input_->ByteCount() + limit_ - prior_bytes_read_;
-  } else {
-    return input_->ByteCount() - prior_bytes_read_;
-  }
-}
-
-
-// ===================================================================
-
 }  // namespace io
 }  // namespace protobuf
 }  // namespace google
index ea978bf..e6ba902 100644 (file)
 #ifndef GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_H__
 #define GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_H__
 
-#include <string>
+
 #include <iosfwd>
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
 #include <google/protobuf/io/zero_copy_stream.h>
 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
-#include <google/protobuf/stubs/common.h>
 
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
 namespace io {
 
-
 // ===================================================================
 
 // A ZeroCopyInputStream which reads from a file descriptor.
@@ -60,7 +62,7 @@ namespace io {
 // The latter will introduce an extra layer of buffering, harming performance.
 // Also, it's conceivable that FileInputStream could someday be enhanced
 // to use zero-copy file descriptors on OSs which support them.
-class LIBPROTOBUF_EXPORT FileInputStream : public ZeroCopyInputStream {
+class PROTOBUF_EXPORT FileInputStream : public ZeroCopyInputStream {
  public:
   // Creates a stream that reads from the given Unix file descriptor.
   // If a block_size is given, it specifies the number of bytes that
@@ -84,27 +86,27 @@ class LIBPROTOBUF_EXPORT FileInputStream : public ZeroCopyInputStream {
   // errno from that error.  Otherwise, this is zero.  Once an error
   // occurs, the stream is broken and all subsequent operations will
   // fail.
-  int GetErrno() { return copying_input_.GetErrno(); }
+  int GetErrno() const { return copying_input_.GetErrno(); }
 
   // implements ZeroCopyInputStream ----------------------------------
-  bool Next(const void** data, int* size);
-  void BackUp(int count);
-  bool Skip(int count);
-  int64 ByteCount() const;
+  bool Next(const void** data, int* size) override;
+  void BackUp(int count) override;
+  bool Skip(int count) override;
+  int64_t ByteCount() const override;
 
  private:
-  class LIBPROTOBUF_EXPORT CopyingFileInputStream : public CopyingInputStream {
+  class PROTOBUF_EXPORT CopyingFileInputStream : public CopyingInputStream {
    public:
     CopyingFileInputStream(int file_descriptor);
-    ~CopyingFileInputStream();
+    ~CopyingFileInputStream() override;
 
     bool Close();
     void SetCloseOnDelete(bool value) { close_on_delete_ = value; }
-    int GetErrno() { return errno_; }
+    int GetErrno() const { return errno_; }
 
     // implements CopyingInputStream ---------------------------------
-    int Read(void* buffer, int size);
-    int Skip(int count);
+    int Read(void* buffer, int size) override;
+    int Skip(int count) override;
 
    private:
     // The file descriptor.
@@ -137,25 +139,21 @@ class LIBPROTOBUF_EXPORT FileInputStream : public ZeroCopyInputStream {
 // harming performance.  Also, it's conceivable that FileOutputStream could
 // someday be enhanced to use zero-copy file descriptors on OSs which
 // support them.
-class LIBPROTOBUF_EXPORT FileOutputStream : public ZeroCopyOutputStream {
+class PROTOBUF_EXPORT FileOutputStream : public CopyingOutputStreamAdaptor {
  public:
   // Creates a stream that writes to the given Unix file descriptor.
   // If a block_size is given, it specifies the size of the buffers
   // that should be returned by Next().  Otherwise, a reasonable default
   // is used.
   explicit FileOutputStream(int file_descriptor, int block_size = -1);
-  ~FileOutputStream();
+
+  ~FileOutputStream() override;
 
   // Flushes any buffers and closes the underlying file.  Returns false if
   // an error occurs during the process; use GetErrno() to examine the error.
   // Even if an error occurs, the file descriptor is closed when this returns.
   bool Close();
 
-  // Flushes FileOutputStream's buffers but does not close the
-  // underlying file. No special measures are taken to ensure that
-  // underlying operating system file object is synchronized to disk.
-  bool Flush();
-
   // By default, the file descriptor is not closed when the stream is
   // destroyed.  Call SetCloseOnDelete(true) to change that.  WARNING:
   // This leaves no way for the caller to detect if close() fails.  If
@@ -167,25 +165,20 @@ class LIBPROTOBUF_EXPORT FileOutputStream : public ZeroCopyOutputStream {
   // errno from that error.  Otherwise, this is zero.  Once an error
   // occurs, the stream is broken and all subsequent operations will
   // fail.
-  int GetErrno() { return copying_output_.GetErrno(); }
-
-  // implements ZeroCopyOutputStream ---------------------------------
-  bool Next(void** data, int* size);
-  void BackUp(int count);
-  int64 ByteCount() const;
+  int GetErrno() const { return copying_output_.GetErrno(); }
 
  private:
-  class LIBPROTOBUF_EXPORT CopyingFileOutputStream : public CopyingOutputStream {
+  class PROTOBUF_EXPORT CopyingFileOutputStream : public CopyingOutputStream {
    public:
     CopyingFileOutputStream(int file_descriptor);
-    ~CopyingFileOutputStream();
+    ~CopyingFileOutputStream() override;
 
     bool Close();
     void SetCloseOnDelete(bool value) { close_on_delete_ = value; }
-    int GetErrno() { return errno_; }
+    int GetErrno() const { return errno_; }
 
     // implements CopyingOutputStream --------------------------------
-    bool Write(const void* buffer, int size);
+    bool Write(const void* buffer, int size) override;
 
    private:
     // The file descriptor.
@@ -200,7 +193,6 @@ class LIBPROTOBUF_EXPORT FileOutputStream : public ZeroCopyOutputStream {
   };
 
   CopyingFileOutputStream copying_output_;
-  CopyingOutputStreamAdaptor impl_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileOutputStream);
 };
@@ -211,7 +203,7 @@ class LIBPROTOBUF_EXPORT FileOutputStream : public ZeroCopyOutputStream {
 //
 // Note that for reading files (or anything represented by a file descriptor),
 // FileInputStream is more efficient.
-class LIBPROTOBUF_EXPORT IstreamInputStream : public ZeroCopyInputStream {
+class PROTOBUF_EXPORT IstreamInputStream : public ZeroCopyInputStream {
  public:
   // Creates a stream that reads from the given C++ istream.
   // If a block_size is given, it specifies the number of bytes that
@@ -220,19 +212,19 @@ class LIBPROTOBUF_EXPORT IstreamInputStream : public ZeroCopyInputStream {
   explicit IstreamInputStream(std::istream* stream, int block_size = -1);
 
   // implements ZeroCopyInputStream ----------------------------------
-  bool Next(const void** data, int* size);
-  void BackUp(int count);
-  bool Skip(int count);
-  int64 ByteCount() const;
+  bool Next(const void** data, int* size) override;
+  void BackUp(int count) override;
+  bool Skip(int count) override;
+  int64_t ByteCount() const override;
 
  private:
-  class LIBPROTOBUF_EXPORT CopyingIstreamInputStream : public CopyingInputStream {
+  class PROTOBUF_EXPORT CopyingIstreamInputStream : public CopyingInputStream {
    public:
     CopyingIstreamInputStream(std::istream* input);
-    ~CopyingIstreamInputStream();
+    ~CopyingIstreamInputStream() override;
 
     // implements CopyingInputStream ---------------------------------
-    int Read(void* buffer, int size);
+    int Read(void* buffer, int size) override;
     // (We use the default implementation of Skip().)
 
    private:
@@ -254,28 +246,29 @@ class LIBPROTOBUF_EXPORT IstreamInputStream : public ZeroCopyInputStream {
 //
 // Note that for writing files (or anything represented by a file descriptor),
 // FileOutputStream is more efficient.
-class LIBPROTOBUF_EXPORT OstreamOutputStream : public ZeroCopyOutputStream {
+class PROTOBUF_EXPORT OstreamOutputStream : public ZeroCopyOutputStream {
  public:
   // Creates a stream that writes to the given C++ ostream.
   // If a block_size is given, it specifies the size of the buffers
   // that should be returned by Next().  Otherwise, a reasonable default
   // is used.
   explicit OstreamOutputStream(std::ostream* stream, int block_size = -1);
-  ~OstreamOutputStream();
+  ~OstreamOutputStream() override;
 
   // implements ZeroCopyOutputStream ---------------------------------
-  bool Next(void** data, int* size);
-  void BackUp(int count);
-  int64 ByteCount() const;
+  bool Next(void** data, int* size) override;
+  void BackUp(int count) override;
+  int64_t ByteCount() const override;
 
  private:
-  class LIBPROTOBUF_EXPORT CopyingOstreamOutputStream : public CopyingOutputStream {
+  class PROTOBUF_EXPORT CopyingOstreamOutputStream
+      : public CopyingOutputStream {
    public:
     CopyingOstreamOutputStream(std::ostream* output);
-    ~CopyingOstreamOutputStream();
+    ~CopyingOstreamOutputStream() override;
 
     // implements CopyingOutputStream --------------------------------
-    bool Write(const void* buffer, int size);
+    bool Write(const void* buffer, int size) override;
 
    private:
     // The stream.
@@ -299,17 +292,18 @@ class LIBPROTOBUF_EXPORT OstreamOutputStream : public ZeroCopyOutputStream {
 // ConcatenatingInputStream may do odd things.  It is suggested that you do
 // not use ConcatenatingInputStream on streams that might produce read errors
 // other than end-of-stream.
-class LIBPROTOBUF_EXPORT ConcatenatingInputStream : public ZeroCopyInputStream {
+class PROTOBUF_EXPORT ConcatenatingInputStream : public ZeroCopyInputStream {
  public:
   // All streams passed in as well as the array itself must remain valid
   // until the ConcatenatingInputStream is destroyed.
   ConcatenatingInputStream(ZeroCopyInputStream* const streams[], int count);
+  ~ConcatenatingInputStream() override = default;
 
   // implements ZeroCopyInputStream ----------------------------------
-  bool Next(const void** data, int* size);
-  void BackUp(int count);
-  bool Skip(int count);
-  int64 ByteCount() const;
+  bool Next(const void** data, int* size) override;
+  void BackUp(int count) override;
+  bool Skip(int count) override;
+  int64_t ByteCount() const override;
 
 
  private:
@@ -317,39 +311,17 @@ class LIBPROTOBUF_EXPORT ConcatenatingInputStream : public ZeroCopyInputStream {
   // decremented.
   ZeroCopyInputStream* const* streams_;
   int stream_count_;
-  int64 bytes_retired_;  // Bytes read from previous streams.
+  int64_t bytes_retired_;  // Bytes read from previous streams.
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ConcatenatingInputStream);
 };
 
 // ===================================================================
 
-// A ZeroCopyInputStream which wraps some other stream and limits it to
-// a particular byte count.
-class LIBPROTOBUF_EXPORT LimitingInputStream : public ZeroCopyInputStream {
- public:
-  LimitingInputStream(ZeroCopyInputStream* input, int64 limit);
-  ~LimitingInputStream();
-
-  // implements ZeroCopyInputStream ----------------------------------
-  bool Next(const void** data, int* size);
-  void BackUp(int count);
-  bool Skip(int count);
-  int64 ByteCount() const;
-
-
- private:
-  ZeroCopyInputStream* input_;
-  int64 limit_;  // Decreases as we go, becomes negative if we overshoot.
-  int64 prior_bytes_read_;  // Bytes read on underlying stream at construction
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(LimitingInputStream);
-};
-
-// ===================================================================
-
 }  // namespace io
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_H__
index 66ad49b..dc4b1e9 100644 (file)
@@ -37,9 +37,9 @@
 #include <algorithm>
 #include <limits>
 
-#include <google/protobuf/stubs/casts.h>
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/casts.h>
 #include <google/protobuf/stubs/stl_util.h>
 
 namespace google {
@@ -55,14 +55,12 @@ static const int kDefaultBlockSize = 8192;
 
 // ===================================================================
 
-ArrayInputStream::ArrayInputStream(const void* data, int size,
-                                   int block_size)
-  : data_(reinterpret_cast<const uint8*>(data)),
-    size_(size),
-    block_size_(block_size > 0 ? block_size : size),
-    position_(0),
-    last_returned_size_(0) {
-}
+ArrayInputStream::ArrayInputStream(const void* data, int size, int block_size)
+    : data_(reinterpret_cast<const uint8_t*>(data)),
+      size_(size),
+      block_size_(block_size > 0 ? block_size : size),
+      position_(0),
+      last_returned_size_(0) {}
 
 bool ArrayInputStream::Next(const void** data, int* size) {
   if (position_ < size_) {
@@ -73,7 +71,7 @@ bool ArrayInputStream::Next(const void** data, int* size) {
     return true;
   } else {
     // We're at the end of the array.
-    last_returned_size_ = 0;   // Don't let caller back up.
+    last_returned_size_ = 0;  // Don't let caller back up.
     return false;
   }
 }
@@ -89,7 +87,7 @@ void ArrayInputStream::BackUp(int count) {
 
 bool ArrayInputStream::Skip(int count) {
   GOOGLE_CHECK_GE(count, 0);
-  last_returned_size_ = 0;   // Don't let caller back up.
+  last_returned_size_ = 0;  // Don't let caller back up.
   if (count > size_ - position_) {
     position_ = size_;
     return false;
@@ -99,20 +97,17 @@ bool ArrayInputStream::Skip(int count) {
   }
 }
 
-int64 ArrayInputStream::ByteCount() const {
-  return position_;
-}
+int64_t ArrayInputStream::ByteCount() const { return position_; }
 
 
 // ===================================================================
 
 ArrayOutputStream::ArrayOutputStream(void* data, int size, int block_size)
-  : data_(reinterpret_cast<uint8*>(data)),
-    size_(size),
-    block_size_(block_size > 0 ? block_size : size),
-    position_(0),
-    last_returned_size_(0) {
-}
+    : data_(reinterpret_cast<uint8_t*>(data)),
+      size_(size),
+      block_size_(block_size > 0 ? block_size : size),
+      position_(0),
+      last_returned_size_(0) {}
 
 bool ArrayOutputStream::Next(void** data, int* size) {
   if (position_ < size_) {
@@ -123,7 +118,7 @@ bool ArrayOutputStream::Next(void** data, int* size) {
     return true;
   } else {
     // We're at the end of the array.
-    last_returned_size_ = 0;   // Don't let caller back up.
+    last_returned_size_ = 0;  // Don't let caller back up.
     return false;
   }
 }
@@ -137,41 +132,33 @@ void ArrayOutputStream::BackUp(int count) {
   last_returned_size_ = 0;  // Don't let caller back up further.
 }
 
-int64 ArrayOutputStream::ByteCount() const {
-  return position_;
-}
+int64_t ArrayOutputStream::ByteCount() const { return position_; }
 
 // ===================================================================
 
-StringOutputStream::StringOutputStream(string* target)
-  : target_(target) {
-}
+StringOutputStream::StringOutputStream(std::string* target) : target_(target) {}
 
 bool StringOutputStream::Next(void** data, int* size) {
   GOOGLE_CHECK(target_ != NULL);
-  int old_size = target_->size();
+  size_t old_size = target_->size();
 
   // Grow the string.
+  size_t new_size;
   if (old_size < target_->capacity()) {
     // Resize the string to match its capacity, since we can get away
     // without a memory allocation this way.
-    STLStringResizeUninitialized(target_, target_->capacity());
+    new_size = target_->capacity();
   } else {
-    // Size has reached capacity, try to double the size.
-    if (old_size > std::numeric_limits<int>::max() / 2) {
-      // Can not double the size otherwise it is going to cause integer
-      // overflow in the expression below: old_size * 2 ";
-      GOOGLE_LOG(ERROR) << "Cannot allocate buffer larger than kint32max for "
-                 << "StringOutputStream.";
-      return false;
-    }
-    // Double the size, also make sure that the new size is at least
-    // kMinimumSize.
-    STLStringResizeUninitialized(
-        target_,
-        std::max(old_size * 2,
-                 kMinimumSize + 0));  // "+ 0" works around GCC4 weirdness.
+    // Size has reached capacity, try to double it.
+    new_size = old_size * 2;
   }
+  // Avoid integer overflow in returned '*size'.
+  new_size = std::min(new_size, old_size + std::numeric_limits<int>::max());
+  // Increase the size, also make sure that it is at least kMinimumSize.
+  STLStringResizeUninitialized(
+      target_,
+      std::max(new_size,
+               kMinimumSize + 0));  // "+ 0" works around GCC4 weirdness.
 
   *data = mutable_string_data(target_) + old_size;
   *size = target_->size() - old_size;
@@ -181,27 +168,23 @@ bool StringOutputStream::Next(void** data, int* size) {
 void StringOutputStream::BackUp(int count) {
   GOOGLE_CHECK_GE(count, 0);
   GOOGLE_CHECK(target_ != NULL);
-  GOOGLE_CHECK_LE(count, target_->size());
+  GOOGLE_CHECK_LE(static_cast<size_t>(count), target_->size());
   target_->resize(target_->size() - count);
 }
 
-int64 StringOutputStream::ByteCount() const {
+int64_t StringOutputStream::ByteCount() const {
   GOOGLE_CHECK(target_ != NULL);
   return target_->size();
 }
 
-void StringOutputStream::SetString(string* target) {
-  target_ = target;
-}
-
 // ===================================================================
 
 int CopyingInputStream::Skip(int count) {
   char junk[4096];
   int skipped = 0;
   while (skipped < count) {
-    int bytes =
-        Read(junk, std::min(count - skipped, implicit_cast<int>(sizeof(junk))));
+    int bytes = Read(junk, std::min(count - skipped,
+                                    implicit_cast<int>(sizeof(junk))));
     if (bytes <= 0) {
       // EOF or read error.
       return skipped;
@@ -213,14 +196,13 @@ int CopyingInputStream::Skip(int count) {
 
 CopyingInputStreamAdaptor::CopyingInputStreamAdaptor(
     CopyingInputStream* copying_stream, int block_size)
-  : copying_stream_(copying_stream),
-    owns_copying_stream_(false),
-    failed_(false),
-    position_(0),
-    buffer_size_(block_size > 0 ? block_size : kDefaultBlockSize),
-    buffer_used_(0),
-    backup_bytes_(0) {
-}
+    : copying_stream_(copying_stream),
+      owns_copying_stream_(false),
+      failed_(false),
+      position_(0),
+      buffer_size_(block_size > 0 ? block_size : kDefaultBlockSize),
+      buffer_used_(0),
+      backup_bytes_(0) {}
 
 CopyingInputStreamAdaptor::~CopyingInputStreamAdaptor() {
   if (owns_copying_stream_) {
@@ -264,12 +246,11 @@ bool CopyingInputStreamAdaptor::Next(const void** data, int* size) {
 
 void CopyingInputStreamAdaptor::BackUp(int count) {
   GOOGLE_CHECK(backup_bytes_ == 0 && buffer_.get() != NULL)
-    << " BackUp() can only be called after Next().";
+      << " BackUp() can only be called after Next().";
   GOOGLE_CHECK_LE(count, buffer_used_)
-    << " Can't back up over more bytes than were returned by the last call"
-       " to Next().";
-  GOOGLE_CHECK_GE(count, 0)
-    << " Parameter to BackUp() can't be negative.";
+      << " Can't back up over more bytes than were returned by the last call"
+         " to Next().";
+  GOOGLE_CHECK_GE(count, 0) << " Parameter to BackUp() can't be negative.";
 
   backup_bytes_ = count;
 }
@@ -297,13 +278,13 @@ bool CopyingInputStreamAdaptor::Skip(int count) {
   return skipped == count;
 }
 
-int64 CopyingInputStreamAdaptor::ByteCount() const {
+int64_t CopyingInputStreamAdaptor::ByteCount() const {
   return position_ - backup_bytes_;
 }
 
 void CopyingInputStreamAdaptor::AllocateBufferIfNeeded() {
   if (buffer_.get() == NULL) {
-    buffer_.reset(new uint8[buffer_size_]);
+    buffer_.reset(new uint8_t[buffer_size_]);
   }
 }
 
@@ -317,13 +298,12 @@ void CopyingInputStreamAdaptor::FreeBuffer() {
 
 CopyingOutputStreamAdaptor::CopyingOutputStreamAdaptor(
     CopyingOutputStream* copying_stream, int block_size)
-  : copying_stream_(copying_stream),
-    owns_copying_stream_(false),
-    failed_(false),
-    position_(0),
-    buffer_size_(block_size > 0 ? block_size : kDefaultBlockSize),
-    buffer_used_(0) {
-}
+    : copying_stream_(copying_stream),
+      owns_copying_stream_(false),
+      failed_(false),
+      position_(0),
+      buffer_size_(block_size > 0 ? block_size : kDefaultBlockSize),
+      buffer_used_(0) {}
 
 CopyingOutputStreamAdaptor::~CopyingOutputStreamAdaptor() {
   WriteBuffer();
@@ -332,9 +312,7 @@ CopyingOutputStreamAdaptor::~CopyingOutputStreamAdaptor() {
   }
 }
 
-bool CopyingOutputStreamAdaptor::Flush() {
-  return WriteBuffer();
-}
+bool CopyingOutputStreamAdaptor::Flush() { return WriteBuffer(); }
 
 bool CopyingOutputStreamAdaptor::Next(void** data, int* size) {
   if (buffer_used_ == buffer_size_) {
@@ -352,18 +330,49 @@ bool CopyingOutputStreamAdaptor::Next(void** data, int* size) {
 void CopyingOutputStreamAdaptor::BackUp(int count) {
   GOOGLE_CHECK_GE(count, 0);
   GOOGLE_CHECK_EQ(buffer_used_, buffer_size_)
-    << " BackUp() can only be called after Next().";
+      << " BackUp() can only be called after Next().";
   GOOGLE_CHECK_LE(count, buffer_used_)
-    << " Can't back up over more bytes than were returned by the last call"
-       " to Next().";
+      << " Can't back up over more bytes than were returned by the last call"
+         " to Next().";
 
   buffer_used_ -= count;
 }
 
-int64 CopyingOutputStreamAdaptor::ByteCount() const {
+int64_t CopyingOutputStreamAdaptor::ByteCount() const {
   return position_ + buffer_used_;
 }
 
+bool CopyingOutputStreamAdaptor::WriteAliasedRaw(const void* data, int size) {
+  if (size >= buffer_size_) {
+    if (!Flush() || !copying_stream_->Write(data, size)) {
+      return false;
+    }
+    GOOGLE_DCHECK_EQ(buffer_used_, 0);
+    position_ += size;
+    return true;
+  }
+
+  void* out;
+  int out_size;
+  while (true) {
+    if (!Next(&out, &out_size)) {
+      return false;
+    }
+
+    if (size <= out_size) {
+      std::memcpy(out, data, size);
+      BackUp(out_size - size);
+      return true;
+    }
+
+    std::memcpy(out, data, out_size);
+    data = static_cast<const char*>(data) + out_size;
+    size -= out_size;
+  }
+  return true;
+}
+
+
 bool CopyingOutputStreamAdaptor::WriteBuffer() {
   if (failed_) {
     // Already failed on a previous write.
@@ -385,7 +394,7 @@ bool CopyingOutputStreamAdaptor::WriteBuffer() {
 
 void CopyingOutputStreamAdaptor::AllocateBufferIfNeeded() {
   if (buffer_ == NULL) {
-    buffer_.reset(new uint8[buffer_size_]);
+    buffer_.reset(new uint8_t[buffer_size_]);
   }
 }
 
@@ -396,6 +405,63 @@ void CopyingOutputStreamAdaptor::FreeBuffer() {
 
 // ===================================================================
 
+LimitingInputStream::LimitingInputStream(ZeroCopyInputStream* input,
+                                         int64_t limit)
+    : input_(input), limit_(limit) {
+  prior_bytes_read_ = input_->ByteCount();
+}
+
+LimitingInputStream::~LimitingInputStream() {
+  // If we overshot the limit, back up.
+  if (limit_ < 0) input_->BackUp(-limit_);
+}
+
+bool LimitingInputStream::Next(const void** data, int* size) {
+  if (limit_ <= 0) return false;
+  if (!input_->Next(data, size)) return false;
+
+  limit_ -= *size;
+  if (limit_ < 0) {
+    // We overshot the limit.  Reduce *size to hide the rest of the buffer.
+    *size += limit_;
+  }
+  return true;
+}
+
+void LimitingInputStream::BackUp(int count) {
+  if (limit_ < 0) {
+    input_->BackUp(count - limit_);
+    limit_ = count;
+  } else {
+    input_->BackUp(count);
+    limit_ += count;
+  }
+}
+
+bool LimitingInputStream::Skip(int count) {
+  if (count > limit_) {
+    if (limit_ < 0) return false;
+    input_->Skip(limit_);
+    limit_ = 0;
+    return false;
+  } else {
+    if (!input_->Skip(count)) return false;
+    limit_ -= count;
+    return true;
+  }
+}
+
+int64_t LimitingInputStream::ByteCount() const {
+  if (limit_ < 0) {
+    return input_->ByteCount() + limit_ - prior_bytes_read_;
+  } else {
+    return input_->ByteCount() - prior_bytes_read_;
+  }
+}
+
+
+// ===================================================================
+
 }  // namespace io
 }  // namespace protobuf
 }  // namespace google
index ab0fd5a..9ee3691 100644 (file)
 #ifndef GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_LITE_H__
 #define GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_LITE_H__
 
+
+#include <iosfwd>
 #include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
 #include <string>
-#include <iosfwd>
-#include <google/protobuf/io/zero_copy_stream.h>
+
 #include <google/protobuf/stubs/callback.h>
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/io/zero_copy_stream.h>
 #include <google/protobuf/stubs/stl_util.h>
 
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace io {
@@ -63,7 +64,7 @@ namespace io {
 // ===================================================================
 
 // A ZeroCopyInputStream backed by an in-memory array of bytes.
-class LIBPROTOBUF_EXPORT ArrayInputStream : public ZeroCopyInputStream {
+class PROTOBUF_EXPORT ArrayInputStream : public ZeroCopyInputStream {
  public:
   // Create an InputStream that returns the bytes pointed to by "data".
   // "data" remains the property of the caller but must remain valid until
@@ -73,22 +74,23 @@ class LIBPROTOBUF_EXPORT ArrayInputStream : public ZeroCopyInputStream {
   // useful for testing; in production you would probably never want to set
   // it.
   ArrayInputStream(const void* data, int size, int block_size = -1);
+  ~ArrayInputStream() override = default;
 
   // implements ZeroCopyInputStream ----------------------------------
-  bool Next(const void** data, int* size);
-  void BackUp(int count);
-  bool Skip(int count);
-  int64 ByteCount() const;
+  bool Next(const void** data, int* size) override;
+  void BackUp(int count) override;
+  bool Skip(int count) override;
+  int64_t ByteCount() const override;
 
 
  private:
-  const uint8* const data_;  // The byte array.
+  const uint8_t* const data_;  // The byte array.
   const int size_;           // Total size of the array.
   const int block_size_;     // How many bytes to return at a time.
 
   int position_;
-  int last_returned_size_;   // How many bytes we returned last time Next()
-                             // was called (used for error checking only).
+  int last_returned_size_;  // How many bytes we returned last time Next()
+                            // was called (used for error checking only).
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ArrayInputStream);
 };
@@ -96,7 +98,7 @@ class LIBPROTOBUF_EXPORT ArrayInputStream : public ZeroCopyInputStream {
 // ===================================================================
 
 // A ZeroCopyOutputStream backed by an in-memory array of bytes.
-class LIBPROTOBUF_EXPORT ArrayOutputStream : public ZeroCopyOutputStream {
+class PROTOBUF_EXPORT ArrayOutputStream : public ZeroCopyOutputStream {
  public:
   // Create an OutputStream that writes to the bytes pointed to by "data".
   // "data" remains the property of the caller but must remain valid until
@@ -106,20 +108,21 @@ class LIBPROTOBUF_EXPORT ArrayOutputStream : public ZeroCopyOutputStream {
   // useful for testing; in production you would probably never want to set
   // it.
   ArrayOutputStream(void* data, int size, int block_size = -1);
+  ~ArrayOutputStream() override = default;
 
   // implements ZeroCopyOutputStream ---------------------------------
-  bool Next(void** data, int* size);
-  void BackUp(int count);
-  int64 ByteCount() const;
+  bool Next(void** data, int* size) override;
+  void BackUp(int count) override;
+  int64_t ByteCount() const override;
 
  private:
-  uint8* const data_;        // The byte array.
-  const int size_;           // Total size of the array.
-  const int block_size_;     // How many bytes to return at a time.
+  uint8_t* const data_;     // The byte array.
+  const int size_;        // Total size of the array.
+  const int block_size_;  // How many bytes to return at a time.
 
   int position_;
-  int last_returned_size_;   // How many bytes we returned last time Next()
-                             // was called (used for error checking only).
+  int last_returned_size_;  // How many bytes we returned last time Next()
+                            // was called (used for error checking only).
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ArrayOutputStream);
 };
@@ -127,7 +130,7 @@ class LIBPROTOBUF_EXPORT ArrayOutputStream : public ZeroCopyOutputStream {
 // ===================================================================
 
 // A ZeroCopyOutputStream which appends bytes to a string.
-class LIBPROTOBUF_EXPORT StringOutputStream : public ZeroCopyOutputStream {
+class PROTOBUF_EXPORT StringOutputStream : public ZeroCopyOutputStream {
  public:
   // Create a StringOutputStream which appends bytes to the given string.
   // The string remains property of the caller, but it is mutated in arbitrary
@@ -138,20 +141,18 @@ class LIBPROTOBUF_EXPORT StringOutputStream : public ZeroCopyOutputStream {
   // Hint:  If you call target->reserve(n) before creating the stream,
   //   the first call to Next() will return at least n bytes of buffer
   //   space.
-  explicit StringOutputStream(string* target);
+  explicit StringOutputStream(std::string* target);
+  ~StringOutputStream() override = default;
 
   // implements ZeroCopyOutputStream ---------------------------------
-  bool Next(void** data, int* size);
-  void BackUp(int count);
-  int64 ByteCount() const;
-
- protected:
-  void SetString(string* target);
+  bool Next(void** data, int* size) override;
+  void BackUp(int count) override;
+  int64_t ByteCount() const override;
 
  private:
-  static const int kMinimumSize = 16;
+  static constexpr size_t kMinimumSize = 16;
 
-  string* target_;
+  std::string* target_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringOutputStream);
 };
@@ -173,7 +174,7 @@ class LIBPROTOBUF_EXPORT StringOutputStream : public ZeroCopyOutputStream {
 // CopyingInputStream implementations should avoid buffering if possible.
 // CopyingInputStreamAdaptor does its own buffering and will read data
 // in large blocks.
-class LIBPROTOBUF_EXPORT CopyingInputStream {
+class PROTOBUF_EXPORT CopyingInputStream {
  public:
   virtual ~CopyingInputStream() {}
 
@@ -199,7 +200,7 @@ class LIBPROTOBUF_EXPORT CopyingInputStream {
 // If you want to read from file descriptors or C++ istreams, this is
 // already implemented for you:  use FileInputStream or IstreamInputStream
 // respectively.
-class LIBPROTOBUF_EXPORT CopyingInputStreamAdaptor : public ZeroCopyInputStream {
+class PROTOBUF_EXPORT CopyingInputStreamAdaptor : public ZeroCopyInputStream {
  public:
   // Creates a stream that reads from the given CopyingInputStream.
   // If a block_size is given, it specifies the number of bytes that
@@ -208,17 +209,17 @@ class LIBPROTOBUF_EXPORT CopyingInputStreamAdaptor : public ZeroCopyInputStream
   // copying_stream unless SetOwnsCopyingStream(true) is called.
   explicit CopyingInputStreamAdaptor(CopyingInputStream* copying_stream,
                                      int block_size = -1);
-  ~CopyingInputStreamAdaptor();
+  ~CopyingInputStreamAdaptor() override;
 
   // Call SetOwnsCopyingStream(true) to tell the CopyingInputStreamAdaptor to
   // delete the underlying CopyingInputStream when it is destroyed.
   void SetOwnsCopyingStream(bool value) { owns_copying_stream_ = value; }
 
   // implements ZeroCopyInputStream ----------------------------------
-  bool Next(const void** data, int* size);
-  void BackUp(int count);
-  bool Skip(int count);
-  int64 ByteCount() const;
+  bool Next(const void** data, int* size) override;
+  void BackUp(int count) override;
+  bool Skip(int count) override;
+  int64_t ByteCount() const override;
 
  private:
   // Insures that buffer_ is not NULL.
@@ -230,16 +231,16 @@ class LIBPROTOBUF_EXPORT CopyingInputStreamAdaptor : public ZeroCopyInputStream
   CopyingInputStream* copying_stream_;
   bool owns_copying_stream_;
 
-  // True if we have seen a permenant error from the underlying stream.
+  // True if we have seen a permanent error from the underlying stream.
   bool failed_;
 
   // The current position of copying_stream_, relative to the point where
   // we started reading.
-  int64 position_;
+  int64_t position_;
 
   // Data is read into this buffer.  It may be NULL if no buffer is currently
   // in use.  Otherwise, it points to an array of size buffer_size_.
-  google::protobuf::scoped_array<uint8> buffer_;
+  std::unique_ptr<uint8_t[]> buffer_;
   const int buffer_size_;
 
   // Number of valid bytes currently in the buffer (i.e. the size last
@@ -267,7 +268,7 @@ class LIBPROTOBUF_EXPORT CopyingInputStreamAdaptor : public ZeroCopyInputStream
 // CopyingOutputStream implementations should avoid buffering if possible.
 // CopyingOutputStreamAdaptor does its own buffering and will write data
 // in large blocks.
-class LIBPROTOBUF_EXPORT CopyingOutputStream {
+class PROTOBUF_EXPORT CopyingOutputStream {
  public:
   virtual ~CopyingOutputStream() {}
 
@@ -283,7 +284,7 @@ class LIBPROTOBUF_EXPORT CopyingOutputStream {
 // If you want to write to file descriptors or C++ ostreams, this is
 // already implemented for you:  use FileOutputStream or OstreamOutputStream
 // respectively.
-class LIBPROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStream {
+class PROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStream {
  public:
   // Creates a stream that writes to the given Unix file descriptor.
   // If a block_size is given, it specifies the size of the buffers
@@ -291,7 +292,7 @@ class LIBPROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStrea
   // is used.
   explicit CopyingOutputStreamAdaptor(CopyingOutputStream* copying_stream,
                                       int block_size = -1);
-  ~CopyingOutputStreamAdaptor();
+  ~CopyingOutputStreamAdaptor() override;
 
   // Writes all pending data to the underlying stream.  Returns false if a
   // write error occurred on the underlying stream.  (The underlying
@@ -303,9 +304,11 @@ class LIBPROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStrea
   void SetOwnsCopyingStream(bool value) { owns_copying_stream_ = value; }
 
   // implements ZeroCopyOutputStream ---------------------------------
-  bool Next(void** data, int* size);
-  void BackUp(int count);
-  int64 ByteCount() const;
+  bool Next(void** data, int* size) override;
+  void BackUp(int count) override;
+  int64_t ByteCount() const override;
+  bool WriteAliasedRaw(const void* data, int size) override;
+  bool AllowsAliasing() const override { return true; }
 
  private:
   // Write the current buffer, if it is present.
@@ -319,16 +322,16 @@ class LIBPROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStrea
   CopyingOutputStream* copying_stream_;
   bool owns_copying_stream_;
 
-  // True if we have seen a permenant error from the underlying stream.
+  // True if we have seen a permanent error from the underlying stream.
   bool failed_;
 
   // The current position of copying_stream_, relative to the point where
   // we started writing.
-  int64 position_;
+  int64_t position_;
 
   // Data is written from this buffer.  It may be NULL if no buffer is
   // currently in use.  Otherwise, it points to an array of size buffer_size_.
-  google::protobuf::scoped_array<uint8> buffer_;
+  std::unique_ptr<uint8_t[]> buffer_;
   const int buffer_size_;
 
   // Number of valid bytes currently in the buffer (i.e. the size last
@@ -341,6 +344,31 @@ class LIBPROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStrea
 
 // ===================================================================
 
+// A ZeroCopyInputStream which wraps some other stream and limits it to
+// a particular byte count.
+class PROTOBUF_EXPORT LimitingInputStream : public ZeroCopyInputStream {
+ public:
+  LimitingInputStream(ZeroCopyInputStream* input, int64_t limit);
+  ~LimitingInputStream() override;
+
+  // implements ZeroCopyInputStream ----------------------------------
+  bool Next(const void** data, int* size) override;
+  void BackUp(int count) override;
+  bool Skip(int count) override;
+  int64_t ByteCount() const override;
+
+
+ private:
+  ZeroCopyInputStream* input_;
+  int64_t limit_;  // Decreases as we go, becomes negative if we overshoot.
+  int64_t prior_bytes_read_;  // Bytes read on underlying stream at construction
+
+  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(LimitingInputStream);
+};
+
+
+// ===================================================================
+
 // mutable_string_data() and as_string_data() are workarounds to improve
 // the performance of writing new data to an existing string.  Unfortunately
 // the methods provided by the string class are suboptimal, and using memcpy()
@@ -356,31 +384,25 @@ class LIBPROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStrea
 // Return a pointer to mutable characters underlying the given string.  The
 // return value is valid until the next time the string is resized.  We
 // trust the caller to treat the return value as an array of length s->size().
-inline char* mutable_string_data(string* s) {
-#ifdef LANG_CXX11
+inline char* mutable_string_data(std::string* s) {
   // This should be simpler & faster than string_as_array() because the latter
   // is guaranteed to return NULL when *s is empty, so it has to check for that.
   return &(*s)[0];
-#else
-  return string_as_array(s);
-#endif
 }
 
 // as_string_data(s) is equivalent to
 //  ({ char* p = mutable_string_data(s); make_pair(p, p != NULL); })
 // Sometimes it's faster: in some scenarios p cannot be NULL, and then the
 // code can avoid that check.
-inline std::pair<char*, bool> as_string_data(string* s) {
-  char *p = mutable_string_data(s);
-#ifdef LANG_CXX11
+inline std::pair<char*, bool> as_string_data(std::string* s) {
+  char* p = mutable_string_data(s);
   return std::make_pair(p, true);
-#else
-  return std::make_pair(p, p != NULL);
-#endif
 }
 
 }  // namespace io
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_LITE_H__
 // (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/util/internal/error_listener.h>
+#include <google/protobuf/map.h>
 
 namespace google {
 namespace protobuf {
-namespace util {
-namespace converter {
+namespace internal {
 
+void* const kGlobalEmptyTable[kGlobalEmptyTableSize] = {nullptr};
 
-}  // namespace converter
-}  // namespace util
+}  // namespace internal
 }  // namespace protobuf
 }  // namespace google
index 7d9cc5c..0708366 100644 (file)
 #ifndef GOOGLE_PROTOBUF_MAP_H__
 #define GOOGLE_PROTOBUF_MAP_H__
 
+#include <functional>
+#include <initializer_list>
 #include <iterator>
 #include <limits>  // To support Visual Studio 2008
-#include <set>
+#include <map>
+#include <string>
+#include <type_traits>
 #include <utility>
 
+#if defined(__cpp_lib_string_view)
+#include <string_view>
+#endif  // defined(__cpp_lib_string_view)
+
+#if !defined(GOOGLE_PROTOBUF_NO_RDTSC) && defined(__APPLE__)
+#include <mach/mach_time.h>
+#endif
+
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/generated_enum_util.h>
 #include <google/protobuf/map_type_handler.h>
 #include <google/protobuf/stubs/hash.h>
 
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 
@@ -56,17 +74,18 @@ class Map;
 
 class MapIterator;
 
-template <typename Enum> struct is_proto_enum;
+template <typename Enum>
+struct is_proto_enum;
 
 namespace internal {
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType key_wire_type,
-          WireFormatLite::FieldType value_wire_type, int default_enum_value>
+          WireFormatLite::FieldType value_wire_type>
 class MapFieldLite;
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType key_wire_type,
-          WireFormatLite::FieldType value_wire_type, int default_enum_value>
+          WireFormatLite::FieldType value_wire_type>
 class MapField;
 
 template <typename Key, typename T>
@@ -75,28 +94,262 @@ class TypeDefinedMapFieldBase;
 class DynamicMapField;
 
 class GeneratedMessageReflection;
+
+// re-implement std::allocator to use arena allocator for memory allocation.
+// Used for Map implementation. Users should not use this class
+// directly.
+template <typename U>
+class MapAllocator {
+ public:
+  using value_type = U;
+  using pointer = value_type*;
+  using const_pointer = const value_type*;
+  using reference = value_type&;
+  using const_reference = const value_type&;
+  using size_type = size_t;
+  using difference_type = ptrdiff_t;
+
+  constexpr MapAllocator() : arena_(nullptr) {}
+  explicit constexpr MapAllocator(Arena* arena) : arena_(arena) {}
+  template <typename X>
+  MapAllocator(const MapAllocator<X>& allocator)  // NOLINT(runtime/explicit)
+      : arena_(allocator.arena()) {}
+
+  pointer allocate(size_type n, const void* /* hint */ = nullptr) {
+    // If arena is not given, malloc needs to be called which doesn't
+    // construct element object.
+    if (arena_ == nullptr) {
+      return static_cast<pointer>(::operator new(n * sizeof(value_type)));
+    } else {
+      return reinterpret_cast<pointer>(
+          Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type)));
+    }
+  }
+
+  void deallocate(pointer p, size_type n) {
+    if (arena_ == nullptr) {
+#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
+      ::operator delete(p, n * sizeof(value_type));
+#else
+      (void)n;
+      ::operator delete(p);
+#endif
+    }
+  }
+
+#if !defined(GOOGLE_PROTOBUF_OS_APPLE) && !defined(GOOGLE_PROTOBUF_OS_NACL) && \
+    !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN)
+  template <class NodeType, class... Args>
+  void construct(NodeType* p, Args&&... args) {
+    // Clang 3.6 doesn't compile static casting to void* directly. (Issue
+    // #1266) According C++ standard 5.2.9/1: "The static_cast operator shall
+    // not cast away constness". So first the maybe const pointer is casted to
+    // const void* and after the const void* is const casted.
+    new (const_cast<void*>(static_cast<const void*>(p)))
+        NodeType(std::forward<Args>(args)...);
+  }
+
+  template <class NodeType>
+  void destroy(NodeType* p) {
+    p->~NodeType();
+  }
+#else
+  void construct(pointer p, const_reference t) { new (p) value_type(t); }
+
+  void destroy(pointer p) { p->~value_type(); }
+#endif
+
+  template <typename X>
+  struct rebind {
+    using other = MapAllocator<X>;
+  };
+
+  template <typename X>
+  bool operator==(const MapAllocator<X>& other) const {
+    return arena_ == other.arena_;
+  }
+
+  template <typename X>
+  bool operator!=(const MapAllocator<X>& other) const {
+    return arena_ != other.arena_;
+  }
+
+  // To support Visual Studio 2008
+  size_type max_size() const {
+    // parentheses around (std::...:max) prevents macro warning of max()
+    return (std::numeric_limits<size_type>::max)();
+  }
+
+  // To support gcc-4.4, which does not properly
+  // support templated friend classes
+  Arena* arena() const { return arena_; }
+
+ private:
+  using DestructorSkippable_ = void;
+  Arena* arena_;
+};
+
+template <typename T>
+using KeyForTree =
+    typename std::conditional<std::is_scalar<T>::value, T,
+                              std::reference_wrapper<const T>>::type;
+
+// Default case: Not transparent.
+// We use std::hash<key_type>/std::less<key_type> and all the lookup functions
+// only accept `key_type`.
+template <typename key_type>
+struct TransparentSupport {
+  using hash = std::hash<key_type>;
+  using less = std::less<key_type>;
+
+  static bool Equals(const key_type& a, const key_type& b) { return a == b; }
+
+  template <typename K>
+  using key_arg = key_type;
+};
+
+#if defined(__cpp_lib_string_view)
+// If std::string_view is available, we add transparent support for std::string
+// keys. We use std::hash<std::string_view> as it supports the input types we
+// care about. The lookup functions accept arbitrary `K`. This will include any
+// key type that is convertible to std::string_view.
+template <>
+struct TransparentSupport<std::string> {
+  static std::string_view ImplicitConvert(std::string_view str) { return str; }
+  // If the element is not convertible to std::string_view, try to convert to
+  // std::string first.
+  // The template makes this overload lose resolution when both have the same
+  // rank otherwise.
+  template <typename = void>
+  static std::string_view ImplicitConvert(const std::string& str) {
+    return str;
+  }
+
+  struct hash : private std::hash<std::string_view> {
+    using is_transparent = void;
+
+    template <typename T>
+    size_t operator()(const T& str) const {
+      return base()(ImplicitConvert(str));
+    }
+
+   private:
+    const std::hash<std::string_view>& base() const { return *this; }
+  };
+  struct less {
+    using is_transparent = void;
+
+    template <typename T, typename U>
+    bool operator()(const T& t, const U& u) const {
+      return ImplicitConvert(t) < ImplicitConvert(u);
+    }
+  };
+
+  template <typename T, typename U>
+  static bool Equals(const T& t, const U& u) {
+    return ImplicitConvert(t) == ImplicitConvert(u);
+  }
+
+  template <typename K>
+  using key_arg = K;
+};
+#endif  // defined(__cpp_lib_string_view)
+
+template <typename Key>
+using TreeForMap =
+    std::map<KeyForTree<Key>, void*, typename TransparentSupport<Key>::less,
+             MapAllocator<std::pair<const KeyForTree<Key>, void*>>>;
+
+inline bool TableEntryIsEmpty(void* const* table, size_t b) {
+  return table[b] == nullptr;
+}
+inline bool TableEntryIsNonEmptyList(void* const* table, size_t b) {
+  return table[b] != nullptr && table[b] != table[b ^ 1];
+}
+inline bool TableEntryIsTree(void* const* table, size_t b) {
+  return !TableEntryIsEmpty(table, b) && !TableEntryIsNonEmptyList(table, b);
+}
+inline bool TableEntryIsList(void* const* table, size_t b) {
+  return !TableEntryIsTree(table, b);
+}
+
+// This captures all numeric types.
+inline size_t MapValueSpaceUsedExcludingSelfLong(bool) { return 0; }
+inline size_t MapValueSpaceUsedExcludingSelfLong(const std::string& str) {
+  return StringSpaceUsedExcludingSelfLong(str);
+}
+template <typename T,
+          typename = decltype(std::declval<const T&>().SpaceUsedLong())>
+size_t MapValueSpaceUsedExcludingSelfLong(const T& message) {
+  return message.SpaceUsedLong() - sizeof(T);
+}
+
+constexpr size_t kGlobalEmptyTableSize = 1;
+PROTOBUF_EXPORT extern void* const kGlobalEmptyTable[kGlobalEmptyTableSize];
+
+// Space used for the table, trees, and nodes.
+// Does not include the indirect space used. Eg the data of a std::string.
+template <typename Key>
+PROTOBUF_NOINLINE size_t SpaceUsedInTable(void** table, size_t num_buckets,
+                                          size_t num_elements,
+                                          size_t sizeof_node) {
+  size_t size = 0;
+  // The size of the table.
+  size += sizeof(void*) * num_buckets;
+  // All the nodes.
+  size += sizeof_node * num_elements;
+  // For each tree, count the overhead of the those nodes.
+  // Two buckets at a time because we only care about trees.
+  for (size_t b = 0; b < num_buckets; b += 2) {
+    if (internal::TableEntryIsTree(table, b)) {
+      using Tree = TreeForMap<Key>;
+      Tree* tree = static_cast<Tree*>(table[b]);
+      // Estimated cost of the red-black tree nodes, 3 pointers plus a
+      // bool (plus alignment, so 4 pointers).
+      size += tree->size() *
+              (sizeof(typename Tree::value_type) + sizeof(void*) * 4);
+    }
+  }
+  return size;
+}
+
+template <typename Map,
+          typename = typename std::enable_if<
+              !std::is_scalar<typename Map::key_type>::value ||
+              !std::is_scalar<typename Map::mapped_type>::value>::type>
+size_t SpaceUsedInValues(const Map* map) {
+  size_t size = 0;
+  for (const auto& v : *map) {
+    size += internal::MapValueSpaceUsedExcludingSelfLong(v.first) +
+            internal::MapValueSpaceUsedExcludingSelfLong(v.second);
+  }
+  return size;
+}
+
+inline size_t SpaceUsedInValues(const void*) { return 0; }
+
 }  // namespace internal
 
-// This is the class for google::protobuf::Map's internal value_type. Instead of using
+// This is the class for Map's internal value_type. Instead of using
 // std::pair as value_type, we use this class which provides us more control of
 // its process of construction and destruction.
 template <typename Key, typename T>
-class MapPair {
- public:
-  typedef const Key first_type;
-  typedef T second_type;
+struct MapPair {
+  using first_type = const Key;
+  using second_type = T;
 
   MapPair(const Key& other_first, const T& other_second)
       : first(other_first), second(other_second) {}
   explicit MapPair(const Key& other_first) : first(other_first), second() {}
-  MapPair(const MapPair& other)
-      : first(other.first), second(other.second) {}
+  explicit MapPair(Key&& other_first)
+      : first(std::move(other_first)), second() {}
+  MapPair(const MapPair& other) : first(other.first), second(other.second) {}
 
   ~MapPair() {}
 
   // Implicitly convertible to std::pair of compatible types.
   template <typename T1, typename T2>
-  operator std::pair<T1, T2>() const {
+  operator std::pair<T1, T2>() const {  // NOLINT(runtime/explicit)
     return std::pair<T1, T2>(first, second);
   }
 
@@ -104,11 +357,11 @@ class MapPair {
   T second;
 
  private:
-  friend class ::google::protobuf::Arena;
+  friend class Arena;
   friend class Map<Key, T>;
 };
 
-// google::protobuf::Map is an associative container type used to store protobuf map
+// Map is an associative container type used to store protobuf map
 // fields.  Each Map instance may or may not use a different hash function, a
 // different iteration order, and so on.  E.g., please don't examine
 // implementation details to decide if the following would work:
@@ -121,38 +374,34 @@ class MapPair {
 template <typename Key, typename T>
 class Map {
  public:
-  typedef Key key_type;
-  typedef T mapped_type;
-  typedef MapPair<Key, T> value_type;
+  using key_type = Key;
+  using mapped_type = T;
+  using value_type = MapPair<Key, T>;
 
-  typedef value_type* pointer;
-  typedef const value_type* const_pointer;
-  typedef value_type& reference;
-  typedef const value_type& const_reference;
+  using pointer = value_type*;
+  using const_pointer = const value_type*;
+  using reference = value_type&;
+  using const_reference = const value_type&;
 
-  typedef size_t size_type;
-  typedef hash<Key> hasher;
+  using size_type = size_t;
+  using hasher = typename internal::TransparentSupport<Key>::hash;
 
-  Map() : arena_(NULL), default_enum_value_(0) { Init(); }
-  explicit Map(Arena* arena) : arena_(arena), default_enum_value_(0) { Init(); }
+  constexpr Map() : elements_(nullptr) {}
+  explicit Map(Arena* arena) : elements_(arena) {}
 
-  Map(const Map& other)
-      : arena_(NULL), default_enum_value_(other.default_enum_value_) {
-    Init();
-    insert(other.begin(), other.end());
-  }
+  Map(const Map& other) : Map() { insert(other.begin(), other.end()); }
 
-#if LANG_CXX11
   Map(Map&& other) noexcept : Map() {
-    if (other.arena_) {
+    if (other.arena() != nullptr) {
       *this = other;
     } else {
       swap(other);
     }
   }
+
   Map& operator=(Map&& other) noexcept {
     if (this != &other) {
-      if (arena_ != other.arena_) {
+      if (arena() != other.arena()) {
         *this = other;
       } else {
         swap(other);
@@ -160,143 +409,16 @@ class Map {
     }
     return *this;
   }
-#endif
 
   template <class InputIt>
-  Map(const InputIt& first, const InputIt& last)
-      : arena_(NULL), default_enum_value_(0) {
-    Init();
+  Map(const InputIt& first, const InputIt& last) : Map() {
     insert(first, last);
   }
 
-  ~Map() {
-    clear();
-    if (arena_ == NULL) {
-      delete elements_;
-    }
-  }
+  ~Map() {}
 
  private:
-  void Init() {
-    elements_ = Arena::Create<InnerMap>(arena_, 0u, hasher(), Allocator(arena_));
-  }
-
-  // re-implement std::allocator to use arena allocator for memory allocation.
-  // Used for google::protobuf::Map implementation. Users should not use this class
-  // directly.
-  template <typename U>
-  class MapAllocator {
-   public:
-    typedef U value_type;
-    typedef value_type* pointer;
-    typedef const value_type* const_pointer;
-    typedef value_type& reference;
-    typedef const value_type& const_reference;
-    typedef size_t size_type;
-    typedef ptrdiff_t difference_type;
-
-    MapAllocator() : arena_(NULL) {}
-    explicit MapAllocator(Arena* arena) : arena_(arena) {}
-    template <typename X>
-    MapAllocator(const MapAllocator<X>& allocator)
-        : arena_(allocator.arena()) {}
-
-    pointer allocate(size_type n, const void* /* hint */ = 0) {
-      // If arena is not given, malloc needs to be called which doesn't
-      // construct element object.
-      if (arena_ == NULL) {
-        return static_cast<pointer>(::operator new(n * sizeof(value_type)));
-      } else {
-        return reinterpret_cast<pointer>(
-            Arena::CreateArray<uint8>(arena_, n * sizeof(value_type)));
-      }
-    }
-
-    void deallocate(pointer p, size_type n) {
-      if (arena_ == NULL) {
-#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
-        ::operator delete(p, n * sizeof(value_type));
-#else
-        (void)n;
-        ::operator delete(p);
-#endif
-      }
-    }
-
-#if __cplusplus >= 201103L && !defined(GOOGLE_PROTOBUF_OS_APPLE) && \
-    !defined(GOOGLE_PROTOBUF_OS_NACL) &&                            \
-    !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN)
-    template<class NodeType, class... Args>
-    void construct(NodeType* p, Args&&... args) {
-      // Clang 3.6 doesn't compile static casting to void* directly. (Issue
-      // #1266) According C++ standard 5.2.9/1: "The static_cast operator shall
-      // not cast away constness". So first the maybe const pointer is casted to
-      // const void* and after the const void* is const casted.
-      new (const_cast<void*>(static_cast<const void*>(p)))
-          NodeType(std::forward<Args>(args)...);
-    }
-
-    template<class NodeType>
-    void destroy(NodeType* p) {
-      p->~NodeType();
-    }
-#else
-    void construct(pointer p, const_reference t) { new (p) value_type(t); }
-
-    void destroy(pointer p) { p->~value_type(); }
-#endif
-
-    template <typename X>
-    struct rebind {
-      typedef MapAllocator<X> other;
-    };
-
-    template <typename X>
-    bool operator==(const MapAllocator<X>& other) const {
-      return arena_ == other.arena_;
-    }
-
-    template <typename X>
-    bool operator!=(const MapAllocator<X>& other) const {
-      return arena_ != other.arena_;
-    }
-
-    // To support Visual Studio 2008
-    size_type max_size() const {
-      // parentheses around (std::...:max) prevents macro warning of max()
-      return (std::numeric_limits<size_type>::max)();
-    }
-
-    // To support gcc-4.4, which does not properly
-    // support templated friend classes
-    Arena* arena() const {
-      return arena_;
-    }
-
-   private:
-    typedef void DestructorSkippable_;
-    Arena* const arena_;
-  };
-
-  // InnerMap's key type is Key and its value type is value_type*.  We use a
-  // custom class here and for Node, below, to ensure that k_ is at offset 0,
-  // allowing safe conversion from pointer to Node to pointer to Key, and vice
-  // versa when appropriate.
-  class KeyValuePair {
-   public:
-    KeyValuePair(const Key& k, value_type* v) : k_(k), v_(v) {}
-
-    const Key& key() const { return k_; }
-    Key& key() { return k_; }
-    value_type* value() const { return v_; }
-    value_type*& value() { return v_; }
-
-   private:
-    Key k_;
-    value_type* v_;
-  };
-
-  typedef MapAllocator<KeyValuePair> Allocator;
+  using Allocator = internal::MapAllocator<void*>;
 
   // InnerMap is a generic hash-based map.  It doesn't contain any
   // protocol-buffer-specific logic.  It is a chaining hash map with the
@@ -313,7 +435,7 @@ class Map {
   // 2. The number of buckets is a power of two.
   // 3. Buckets are converted to trees in pairs: if we convert bucket b then
   //    buckets b and b^1 will share a tree.  Invariant: buckets b and b^1 have
-  //    the same non-NULL value iff they are sharing a tree.  (An alternative
+  //    the same non-null value iff they are sharing a tree.  (An alternative
   //    implementation strategy would be to have a tag bit per bucket.)
   // 4. As is typical for hash_map and such, the Keys and Values are always
   //    stored in linked list nodes.  Pointers to elements are never invalidated
@@ -323,27 +445,27 @@ class Map {
   // 6. Once we've tree-converted a bucket, it is never converted back. However,
   //    the items a tree contains may wind up assigned to trees or lists upon a
   //    rehash.
-  // 7. The code requires no C++ features from C++11 or later.
+  // 7. The code requires no C++ features from C++14 or later.
   // 8. Mutations to a map do not invalidate the map's iterators, pointers to
   //    elements, or references to elements.
   // 9. Except for erase(iterator), any non-const method can reorder iterators.
+  // 10. InnerMap uses KeyForTree<Key> when using the Tree representation, which
+  //    is either `Key`, if Key is a scalar, or `reference_wrapper<const Key>`
+  //    otherwise. This avoids unnecessary copies of string keys, for example.
   class InnerMap : private hasher {
    public:
-    typedef value_type* Value;
-
-    InnerMap(size_type n, hasher h, Allocator alloc)
-        : hasher(h),
+    explicit constexpr InnerMap(Arena* arena)
+        : hasher(),
           num_elements_(0),
-          seed_(Seed()),
-          table_(NULL),
-          alloc_(alloc) {
-      n = TableSize(n);
-      table_ = CreateEmptyTable(n);
-      num_buckets_ = index_of_first_non_null_ = n;
-    }
+          num_buckets_(internal::kGlobalEmptyTableSize),
+          seed_(0),
+          index_of_first_non_null_(internal::kGlobalEmptyTableSize),
+          table_(const_cast<void**>(internal::kGlobalEmptyTable)),
+          alloc_(arena) {}
 
     ~InnerMap() {
-      if (table_ != NULL) {
+      if (alloc_.arena() == nullptr &&
+          num_buckets_ != internal::kGlobalEmptyTableSize) {
         clear();
         Dealloc<void*>(table_, num_buckets_);
       }
@@ -354,42 +476,37 @@ class Map {
 
     // Linked-list nodes, as one would expect for a chaining hash table.
     struct Node {
-      KeyValuePair kv;
+      value_type kv;
       Node* next;
     };
 
-    // This is safe only if the given pointer is known to point to a Key that is
-    // part of a Node.
-    static Node* NodePtrFromKeyPtr(Key* k) {
-      return reinterpret_cast<Node*>(k);
-    }
+    // Trees. The payload type is a copy of Key, so that we can query the tree
+    // with Keys that are not in any particular data structure.
+    // The value is a void* pointing to Node. We use void* instead of Node* to
+    // avoid code bloat. That way there is only one instantiation of the tree
+    // class per key type.
+    using Tree = internal::TreeForMap<Key>;
+    using TreeIterator = typename Tree::iterator;
 
-    static Key* KeyPtrFromNodePtr(Node* node) { return &node->kv.key(); }
-
-    // Trees.  The payload type is pointer to Key, so that we can query the tree
-    // with Keys that are not in any particular data structure.  When we insert,
-    // though, the pointer is always pointing to a Key that is inside a Node.
-    struct KeyCompare {
-      bool operator()(const Key* n0, const Key* n1) const { return *n0 < *n1; }
-    };
-    typedef typename Allocator::template rebind<Key*>::other KeyPtrAllocator;
-    typedef std::set<Key*, KeyCompare, KeyPtrAllocator> Tree;
-    typedef typename Tree::iterator TreeIterator;
+    static Node* NodeFromTreeIterator(TreeIterator it) {
+      return static_cast<Node*>(it->second);
+    }
 
     // iterator and const_iterator are instantiations of iterator_base.
     template <typename KeyValueType>
-    struct iterator_base {
-      typedef KeyValueType& reference;
-      typedef KeyValueType* pointer;
+    class iterator_base {
+     public:
+      using reference = KeyValueType&;
+      using pointer = KeyValueType*;
 
       // Invariants:
       // node_ is always correct. This is handy because the most common
       // operations are operator* and operator-> and they only use node_.
-      // When node_ is set to a non-NULL value, all the other non-const fields
+      // When node_ is set to a non-null value, all the other non-const fields
       // are updated to be correct also, but those fields can become stale
       // if the underlying map is modified.  When those fields are needed they
       // are rechecked, and updated if necessary.
-      iterator_base() : node_(NULL), m_(NULL), bucket_index_(0) {}
+      iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {}
 
       explicit iterator_base(const InnerMap* m) : m_(m) {
         SearchFrom(m->index_of_first_non_null_);
@@ -406,18 +523,18 @@ class Map {
           : node_(n), m_(m), bucket_index_(index) {}
 
       iterator_base(TreeIterator tree_it, const InnerMap* m, size_type index)
-          : node_(NodePtrFromKeyPtr(*tree_it)), m_(m), bucket_index_(index) {
+          : node_(NodeFromTreeIterator(tree_it)), m_(m), bucket_index_(index) {
         // Invariant: iterators that use buckets with trees have an even
         // bucket_index_.
-        GOOGLE_DCHECK_EQ(bucket_index_ % 2, 0);
+        GOOGLE_DCHECK_EQ(bucket_index_ % 2, 0u);
       }
 
       // Advance through buckets, looking for the first that isn't empty.
-      // If nothing non-empty is found then leave node_ == NULL.
+      // If nothing non-empty is found then leave node_ == nullptr.
       void SearchFrom(size_type start_bucket) {
         GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ ||
-               m_->table_[m_->index_of_first_non_null_] != NULL);
-        node_ = NULL;
+               m_->table_[m_->index_of_first_non_null_] != nullptr);
+        node_ = nullptr;
         for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_;
              bucket_index_++) {
           if (m_->TableEntryIsNonEmptyList(bucket_index_)) {
@@ -426,7 +543,7 @@ class Map {
           } else if (m_->TableEntryIsTree(bucket_index_)) {
             Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]);
             GOOGLE_DCHECK(!tree->empty());
-            node_ = NodePtrFromKeyPtr(*tree->begin());
+            node_ = NodeFromTreeIterator(tree->begin());
             break;
           }
         }
@@ -443,18 +560,18 @@ class Map {
       }
 
       iterator_base& operator++() {
-        if (node_->next == NULL) {
+        if (node_->next == nullptr) {
           TreeIterator tree_it;
           const bool is_list = revalidate_if_necessary(&tree_it);
           if (is_list) {
             SearchFrom(bucket_index_ + 1);
           } else {
-            GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0);
+            GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u);
             Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]);
             if (++tree_it == tree->end()) {
               SearchFrom(bucket_index_ + 2);
             } else {
-              node_ = NodePtrFromKeyPtr(*tree_it);
+              node_ = NodeFromTreeIterator(tree_it);
             }
           }
         } else {
@@ -469,22 +586,21 @@ class Map {
         return tmp;
       }
 
-      // Assumes node_ and m_ are correct and non-NULL, but other fields may be
+      // Assumes node_ and m_ are correct and non-null, but other fields may be
       // stale.  Fix them as needed.  Then return true iff node_ points to a
       // Node in a list.  If false is returned then *it is modified to be
       // a valid iterator for node_.
       bool revalidate_if_necessary(TreeIterator* it) {
-        GOOGLE_DCHECK(node_ != NULL && m_ != NULL);
+        GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr);
         // Force bucket_index_ to be in range.
         bucket_index_ &= (m_->num_buckets_ - 1);
         // Common case: the bucket we think is relevant points to node_.
-        if (m_->table_[bucket_index_] == static_cast<void*>(node_))
-          return true;
+        if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true;
         // Less common: the bucket is a linked list with node_ somewhere in it,
         // but not at the head.
         if (m_->TableEntryIsNonEmptyList(bucket_index_)) {
           Node* l = static_cast<Node*>(m_->table_[bucket_index_]);
-          while ((l = l->next) != NULL) {
+          while ((l = l->next) != nullptr) {
             if (l == node_) {
               return true;
             }
@@ -493,8 +609,8 @@ class Map {
         // Well, bucket_index_ still might be correct, but probably
         // not.  Revalidate just to be sure.  This case is rare enough that we
         // don't worry about potential optimizations, such as having a custom
-        // find-like method that compares Node* instead of const Key&.
-        iterator_base i(m_->find(*KeyPtrFromNodePtr(node_), it));
+        // find-like method that compares Node* instead of the key.
+        iterator_base i(m_->find(node_->kv.first, it));
         bucket_index_ = i.bucket_index_;
         return m_->TableEntryIsList(bucket_index_);
       }
@@ -505,8 +621,19 @@ class Map {
     };
 
    public:
-    typedef iterator_base<KeyValuePair> iterator;
-    typedef iterator_base<const KeyValuePair> const_iterator;
+    using iterator = iterator_base<value_type>;
+    using const_iterator = iterator_base<const value_type>;
+
+    Arena* arena() const { return alloc_.arena(); }
+
+    void Swap(InnerMap* other) {
+      std::swap(num_elements_, other->num_elements_);
+      std::swap(num_buckets_, other->num_buckets_);
+      std::swap(seed_, other->seed_);
+      std::swap(index_of_first_non_null_, other->index_of_first_non_null_);
+      std::swap(table_, other->table_);
+      std::swap(alloc_, other->alloc_);
+    }
 
     iterator begin() { return iterator(this); }
     iterator end() { return iterator(); }
@@ -517,19 +644,19 @@ class Map {
       for (size_type b = 0; b < num_buckets_; b++) {
         if (TableEntryIsNonEmptyList(b)) {
           Node* node = static_cast<Node*>(table_[b]);
-          table_[b] = NULL;
+          table_[b] = nullptr;
           do {
             Node* next = node->next;
             DestroyNode(node);
             node = next;
-          } while (node != NULL);
+          } while (node != nullptr);
         } else if (TableEntryIsTree(b)) {
           Tree* tree = static_cast<Tree*>(table_[b]);
           GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0);
-          table_[b] = table_[b + 1] = NULL;
+          table_[b] = table_[b + 1] = nullptr;
           typename Tree::iterator tree_it = tree->begin();
           do {
-            Node* node = NodePtrFromKeyPtr(*tree_it);
+            Node* node = NodeFromTreeIterator(tree_it);
             typename Tree::iterator next = tree_it;
             ++next;
             tree->erase(tree_it);
@@ -552,50 +679,50 @@ class Map {
     size_type size() const { return num_elements_; }
     bool empty() const { return size() == 0; }
 
-    iterator find(const Key& k) { return iterator(FindHelper(k).first); }
-    const_iterator find(const Key& k) const { return find(k, NULL); }
+    template <typename K>
+    iterator find(const K& k) {
+      return iterator(FindHelper(k).first);
+    }
 
-    // In traditional C++ style, this performs "insert if not present."
-    std::pair<iterator, bool> insert(const KeyValuePair& kv) {
-      std::pair<const_iterator, size_type> p = FindHelper(kv.key());
-      // Case 1: key was already present.
-      if (p.first.node_ != NULL)
-        return std::make_pair(iterator(p.first), false);
-      // Case 2: insert.
-      if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) {
-        p = FindHelper(kv.key());
-      }
-      const size_type b = p.second;  // bucket number
-      Node* node = Alloc<Node>(1);
-      alloc_.construct(&node->kv, kv);
-      iterator result = InsertUnique(b, node);
-      ++num_elements_;
-      return std::make_pair(result, true);
+    template <typename K>
+    const_iterator find(const K& k) const {
+      return FindHelper(k).first;
     }
 
-    // The same, but if an insertion is necessary then the value portion of the
-    // inserted key-value pair is left uninitialized.
-    std::pair<iterator, bool> insert(const Key& k) {
+    // Insert the key into the map, if not present. In that case, the value will
+    // be value initialized.
+    template <typename K>
+    std::pair<iterator, bool> insert(K&& k) {
       std::pair<const_iterator, size_type> p = FindHelper(k);
       // Case 1: key was already present.
-      if (p.first.node_ != NULL)
+      if (p.first.node_ != nullptr)
         return std::make_pair(iterator(p.first), false);
       // Case 2: insert.
       if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) {
         p = FindHelper(k);
       }
       const size_type b = p.second;  // bucket number
+      // If K is not key_type, make the conversion to key_type explicit.
+      using TypeToInit = typename std::conditional<
+          std::is_same<typename std::decay<K>::type, key_type>::value, K&&,
+          key_type>::type;
       Node* node = Alloc<Node>(1);
-      typedef typename Allocator::template rebind<Key>::other KeyAllocator;
-      KeyAllocator(alloc_).construct(&node->kv.key(), k);
+      // Even when arena is nullptr, CreateInArenaStorage is still used to
+      // ensure the arena of submessage will be consistent. Otherwise,
+      // submessage may have its own arena when message-owned arena is enabled.
+      Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first),
+                                  alloc_.arena(),
+                                  static_cast<TypeToInit>(std::forward<K>(k)));
+      Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena());
+
       iterator result = InsertUnique(b, node);
       ++num_elements_;
       return std::make_pair(result, true);
     }
 
-    Value& operator[](const Key& k) {
-      KeyValuePair kv(k, Value());
-      return insert(kv).first->value();
+    template <typename K>
+    value_type& operator[](K&& k) {
+      return *insert(std::forward<K>(k)).first;
     }
 
     void erase(iterator it) {
@@ -612,52 +739,58 @@ class Map {
       } else {
         GOOGLE_DCHECK(TableEntryIsTree(b));
         Tree* tree = static_cast<Tree*>(table_[b]);
-        tree->erase(*tree_it);
+        tree->erase(tree_it);
         if (tree->empty()) {
           // Force b to be the minimum of b and b ^ 1.  This is important
           // only because we want index_of_first_non_null_ to be correct.
           b &= ~static_cast<size_type>(1);
           DestroyTree(tree);
-          table_[b] = table_[b + 1] = NULL;
+          table_[b] = table_[b + 1] = nullptr;
         }
       }
       DestroyNode(item);
       --num_elements_;
-      if (GOOGLE_PREDICT_FALSE(b == index_of_first_non_null_)) {
+      if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) {
         while (index_of_first_non_null_ < num_buckets_ &&
-               table_[index_of_first_non_null_] == NULL) {
+               table_[index_of_first_non_null_] == nullptr) {
           ++index_of_first_non_null_;
         }
       }
     }
 
+    size_t SpaceUsedInternal() const {
+      return internal::SpaceUsedInTable<Key>(table_, num_buckets_,
+                                             num_elements_, sizeof(Node));
+    }
+
    private:
     const_iterator find(const Key& k, TreeIterator* it) const {
       return FindHelper(k, it).first;
     }
-    std::pair<const_iterator, size_type> FindHelper(const Key& k) const {
-      return FindHelper(k, NULL);
+    template <typename K>
+    std::pair<const_iterator, size_type> FindHelper(const K& k) const {
+      return FindHelper(k, nullptr);
     }
-    std::pair<const_iterator, size_type> FindHelper(const Key& k,
+    template <typename K>
+    std::pair<const_iterator, size_type> FindHelper(const K& k,
                                                     TreeIterator* it) const {
       size_type b = BucketNumber(k);
       if (TableEntryIsNonEmptyList(b)) {
         Node* node = static_cast<Node*>(table_[b]);
         do {
-          if (IsMatch(*KeyPtrFromNodePtr(node), k)) {
+          if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) {
             return std::make_pair(const_iterator(node, this, b), b);
           } else {
             node = node->next;
           }
-        } while (node != NULL);
+        } while (node != nullptr);
       } else if (TableEntryIsTree(b)) {
         GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]);
         b &= ~static_cast<size_t>(1);
         Tree* tree = static_cast<Tree*>(table_[b]);
-        Key* key = const_cast<Key*>(&k);
-        typename Tree::iterator tree_it = tree->find(key);
+        auto tree_it = tree->find(k);
         if (tree_it != tree->end()) {
-          if (it != NULL) *it = tree_it;
+          if (it != nullptr) *it = tree_it;
           return std::make_pair(const_iterator(tree_it, this, b), b);
         }
       }
@@ -670,17 +803,17 @@ class Map {
     // bucket.  num_elements_ is not modified.
     iterator InsertUnique(size_type b, Node* node) {
       GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ ||
-             table_[index_of_first_non_null_] != NULL);
+             table_[index_of_first_non_null_] != nullptr);
       // In practice, the code that led to this point may have already
       // determined whether we are inserting into an empty list, a short list,
       // or whatever.  But it's probably cheap enough to recompute that here;
       // it's likely that we're inserting into an empty or short list.
       iterator result;
-      GOOGLE_DCHECK(find(*KeyPtrFromNodePtr(node)) == end());
+      GOOGLE_DCHECK(find(node->kv.first) == end());
       if (TableEntryIsEmpty(b)) {
         result = InsertUniqueInList(b, node);
       } else if (TableEntryIsNonEmptyList(b)) {
-        if (GOOGLE_PREDICT_FALSE(TableEntryIsTooLong(b))) {
+        if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) {
           TreeConvert(b);
           result = InsertUniqueInTree(b, node);
           GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1));
@@ -700,9 +833,30 @@ class Map {
       return result;
     }
 
+    // Returns whether we should insert after the head of the list. For
+    // non-optimized builds, we randomly decide whether to insert right at the
+    // head of the list or just after the head. This helps add a little bit of
+    // non-determinism to the map ordering.
+    bool ShouldInsertAfterHead(void* node) {
+#ifdef NDEBUG
+      (void)node;
+      return false;
+#else
+      // Doing modulo with a prime mixes the bits more.
+      return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6;
+#endif
+    }
+
     // Helper for InsertUnique.  Handles the case where bucket b is a
     // not-too-long linked list.
     iterator InsertUniqueInList(size_type b, Node* node) {
+      if (table_[b] != nullptr && ShouldInsertAfterHead(node)) {
+        Node* first = static_cast<Node*>(table_[b]);
+        node->next = first->next;
+        first->next = node;
+        return iterator(node, this, b);
+      }
+
       node->next = static_cast<Node*>(table_[b]);
       table_[b] = static_cast<void*>(node);
       return iterator(node, this, b);
@@ -712,12 +866,11 @@ class Map {
     // Tree.
     iterator InsertUniqueInTree(size_type b, Node* node) {
       GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]);
-      // Maintain the invariant that node->next is NULL for all Nodes in Trees.
-      node->next = NULL;
-      return iterator(static_cast<Tree*>(table_[b])
-                      ->insert(KeyPtrFromNodePtr(node))
-                      .first,
-                      this, b & ~static_cast<size_t>(1));
+      // Maintain the invariant that node->next is null for all Nodes in Trees.
+      node->next = nullptr;
+      return iterator(
+          static_cast<Tree*>(table_[b])->insert({node->kv.first, node}).first,
+          this, b & ~static_cast<size_t>(1));
     }
 
     // Returns whether it did resize.  Currently this is only used when
@@ -735,13 +888,13 @@ class Map {
       // We don't care how many elements are in trees.  If a lot are,
       // we may resize even though there are many empty buckets.  In
       // practice, this seems fine.
-      if (GOOGLE_PREDICT_FALSE(new_size >= hi_cutoff)) {
+      if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) {
         if (num_buckets_ <= max_size() / 2) {
           Resize(num_buckets_ * 2);
           return true;
         }
-      } else if (GOOGLE_PREDICT_FALSE(new_size <= lo_cutoff &&
-                               num_buckets_ > kMinTableSize)) {
+      } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff &&
+                                        num_buckets_ > kMinTableSize)) {
         size_type lg2_of_size_reduction_factor = 1;
         // It's possible we want to shrink a lot here... size() could even be 0.
         // So, estimate how much to shrink by making sure we don't shrink so
@@ -763,6 +916,15 @@ class Map {
 
     // Resize to the given number of buckets.
     void Resize(size_t new_num_buckets) {
+      if (num_buckets_ == internal::kGlobalEmptyTableSize) {
+        // This is the global empty array.
+        // Just overwrite with a new one. No need to transfer or free anything.
+        num_buckets_ = index_of_first_non_null_ = kMinTableSize;
+        table_ = CreateEmptyTable(num_buckets_);
+        seed_ = Seed();
+        return;
+      }
+
       GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize);
       void** const old_table = table_;
       const size_type old_table_size = num_buckets_;
@@ -771,9 +933,9 @@ class Map {
       const size_type start = index_of_first_non_null_;
       index_of_first_non_null_ = num_buckets_;
       for (size_type i = start; i < old_table_size; i++) {
-        if (TableEntryIsNonEmptyList(old_table, i)) {
+        if (internal::TableEntryIsNonEmptyList(old_table, i)) {
           TransferList(old_table, i);
-        } else if (TableEntryIsTree(old_table, i)) {
+        } else if (internal::TableEntryIsTree(old_table, i)) {
           TransferTree(old_table, i++);
         }
       }
@@ -784,17 +946,17 @@ class Map {
       Node* node = static_cast<Node*>(table[index]);
       do {
         Node* next = node->next;
-        InsertUnique(BucketNumber(*KeyPtrFromNodePtr(node)), node);
+        InsertUnique(BucketNumber(node->kv.first), node);
         node = next;
-      } while (node != NULL);
+      } while (node != nullptr);
     }
 
     void TransferTree(void* const* table, size_type index) {
       Tree* tree = static_cast<Tree*>(table[index]);
       typename Tree::iterator tree_it = tree->begin();
       do {
-        Node* node = NodePtrFromKeyPtr(*tree_it);
-        InsertUnique(BucketNumber(**tree_it), node);
+        InsertUnique(BucketNumber(std::cref(tree_it->first).get()),
+                     NodeFromTreeIterator(tree_it));
       } while (++tree_it != tree->end());
       DestroyTree(tree);
     }
@@ -809,42 +971,23 @@ class Map {
     }
 
     bool TableEntryIsEmpty(size_type b) const {
-      return TableEntryIsEmpty(table_, b);
+      return internal::TableEntryIsEmpty(table_, b);
     }
     bool TableEntryIsNonEmptyList(size_type b) const {
-      return TableEntryIsNonEmptyList(table_, b);
+      return internal::TableEntryIsNonEmptyList(table_, b);
     }
     bool TableEntryIsTree(size_type b) const {
-      return TableEntryIsTree(table_, b);
+      return internal::TableEntryIsTree(table_, b);
     }
     bool TableEntryIsList(size_type b) const {
-      return TableEntryIsList(table_, b);
-    }
-    static bool TableEntryIsEmpty(void* const* table, size_type b) {
-      return table[b] == NULL;
-    }
-    static bool TableEntryIsNonEmptyList(void* const* table, size_type b) {
-      return table[b] != NULL && table[b] != table[b ^ 1];
-    }
-    static bool TableEntryIsTree(void* const* table, size_type b) {
-      return !TableEntryIsEmpty(table, b) &&
-          !TableEntryIsNonEmptyList(table, b);
-    }
-    static bool TableEntryIsList(void* const* table, size_type b) {
-      return !TableEntryIsTree(table, b);
+      return internal::TableEntryIsList(table_, b);
     }
 
     void TreeConvert(size_type b) {
       GOOGLE_DCHECK(!TableEntryIsTree(b) && !TableEntryIsTree(b ^ 1));
-      typename Allocator::template rebind<Tree>::other tree_allocator(alloc_);
-      Tree* tree = tree_allocator.allocate(1);
-      // We want to use the three-arg form of construct, if it exists, but we
-      // create a temporary and use the two-arg construct that's known to exist.
-      // It's clunky, but the compiler should be able to generate more-or-less
-      // the same code.
-      tree_allocator.construct(tree,
-                               Tree(KeyCompare(), KeyPtrAllocator(alloc_)));
-      // Now the tree is ready to use.
+      Tree* tree =
+          Arena::Create<Tree>(alloc_.arena(), typename Tree::key_compare(),
+                              typename Tree::allocator_type(alloc_));
       size_type count = CopyListToTree(b, tree) + CopyListToTree(b ^ 1, tree);
       GOOGLE_DCHECK_EQ(count, tree->size());
       table_[b] = table_[b ^ 1] = static_cast<void*>(tree);
@@ -855,11 +998,11 @@ class Map {
     size_type CopyListToTree(size_type b, Tree* tree) {
       size_type count = 0;
       Node* node = static_cast<Node*>(table_[b]);
-      while (node != NULL) {
-        tree->insert(KeyPtrFromNodePtr(node));
+      while (node != nullptr) {
+        tree->insert({node->kv.first, node});
         ++count;
         Node* next = node->next;
-        node->next = NULL;
+        node->next = nullptr;
         node = next;
       }
       return count;
@@ -874,20 +1017,23 @@ class Map {
       do {
         ++count;
         node = node->next;
-      } while (node != NULL);
+      } while (node != nullptr);
       // Invariant: no linked list ever is more than kMaxLength in length.
       GOOGLE_DCHECK_LE(count, kMaxLength);
       return count >= kMaxLength;
     }
 
-    size_type BucketNumber(const Key& k) const {
-      // We inherit from hasher, so one-arg operator() provides a hash function.
-      size_type h = (*const_cast<InnerMap*>(this))(k);
-      return (h + seed_) & (num_buckets_ - 1);
-    }
+    template <typename K>
+    size_type BucketNumber(const K& k) const {
+      // We xor the hash value against the random seed so that we effectively
+      // have a random hash function.
+      uint64_t h = hash_function()(k) ^ seed_;
 
-    bool IsMatch(const Key& k0, const Key& k1) const {
-      return std::equal_to<Key>()(k0, k1);
+      // We use the multiplication method to determine the bucket number from
+      // the hash value. The constant kPhi (suggested by Knuth) is roughly
+      // (sqrt(5) - 1) / 2 * 2^64.
+      constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15};
+      return ((kPhi * h) >> 32) & (num_buckets_ - 1);
     }
 
     // Return a power of two no less than max(kMinTableSize, n).
@@ -901,31 +1047,32 @@ class Map {
     // Use alloc_ to allocate an array of n objects of type U.
     template <typename U>
     U* Alloc(size_type n) {
-      typedef typename Allocator::template rebind<U>::other alloc_type;
+      using alloc_type = typename Allocator::template rebind<U>::other;
       return alloc_type(alloc_).allocate(n);
     }
 
     // Use alloc_ to deallocate an array of n objects of type U.
     template <typename U>
     void Dealloc(U* t, size_type n) {
-      typedef typename Allocator::template rebind<U>::other alloc_type;
+      using alloc_type = typename Allocator::template rebind<U>::other;
       alloc_type(alloc_).deallocate(t, n);
     }
 
     void DestroyNode(Node* node) {
-      alloc_.destroy(&node->kv);
-      Dealloc<Node>(node, 1);
+      if (alloc_.arena() == nullptr) {
+        delete node;
+      }
     }
 
     void DestroyTree(Tree* tree) {
-      typename Allocator::template rebind<Tree>::other tree_allocator(alloc_);
-      tree_allocator.destroy(tree);
-      tree_allocator.deallocate(tree, 1);
+      if (alloc_.arena() == nullptr) {
+        delete tree;
+      }
     }
 
     void** CreateEmptyTable(size_type n) {
       GOOGLE_DCHECK(n >= kMinTableSize);
-      GOOGLE_DCHECK_EQ(n & (n - 1), 0);
+      GOOGLE_DCHECK_EQ(n & (n - 1), 0u);
       void** result = Alloc<void*>(n);
       memset(result, 0, n * sizeof(result[0]));
       return result;
@@ -933,15 +1080,35 @@ class Map {
 
     // Return a randomish value.
     size_type Seed() const {
-      size_type s = static_cast<size_type>(reinterpret_cast<uintptr_t>(this));
-#if defined(__x86_64__) && defined(__GNUC__)
-      uint32 hi, lo;
-      asm("rdtsc" : "=a" (lo), "=d" (hi));
-      s += ((static_cast<uint64>(hi) << 32) | lo);
+      // We get a little bit of randomness from the address of the map. The
+      // lower bits are not very random, due to alignment, so we discard them
+      // and shift the higher bits into their place.
+      size_type s = reinterpret_cast<uintptr_t>(this) >> 4;
+#if !defined(GOOGLE_PROTOBUF_NO_RDTSC)
+#if defined(__APPLE__)
+      // Use a commpage-based fast time function on Apple environments (MacOS,
+      // iOS, tvOS, watchOS, etc).
+      s += mach_absolute_time();
+#elif defined(__x86_64__) && defined(__GNUC__)
+      uint32_t hi, lo;
+      asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
+      s += ((static_cast<uint64_t>(hi) << 32) | lo);
+#elif defined(__aarch64__) && defined(__GNUC__)
+      // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the
+      // system timer. It runs at a different frequency than the CPU's, but is
+      // the best source of time-based entropy we get.
+      uint64_t virtual_timer_value;
+      asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
+      s += virtual_timer_value;
 #endif
+#endif  // !defined(GOOGLE_PROTOBUF_NO_RDTSC)
       return s;
     }
 
+    friend class Arena;
+    using InternalArenaConstructable_ = void;
+    using DestructorSkippable_ = void;
+
     size_type num_elements_;
     size_type num_buckets_;
     size_type seed_;
@@ -951,24 +1118,26 @@ class Map {
     GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(InnerMap);
   };  // end of class InnerMap
 
+  template <typename LookupKey>
+  using key_arg = typename internal::TransparentSupport<
+      key_type>::template key_arg<LookupKey>;
+
  public:
   // Iterators
   class const_iterator {
-    typedef typename InnerMap::const_iterator InnerIt;
+    using InnerIt = typename InnerMap::const_iterator;
 
    public:
-    typedef std::forward_iterator_tag iterator_category;
-    typedef typename Map::value_type value_type;
-    typedef ptrdiff_t difference_type;
-    typedef const value_type* pointer;
-    typedef const value_type& reference;
+    using iterator_category = std::forward_iterator_tag;
+    using value_type = typename Map::value_type;
+    using difference_type = ptrdiff_t;
+    using pointer = const value_type*;
+    using reference = const value_type&;
 
     const_iterator() {}
     explicit const_iterator(const InnerIt& it) : it_(it) {}
 
-    const_reference operator*() const {
-      return *it_->value();
-    }
+    const_reference operator*() const { return *it_; }
     const_pointer operator->() const { return &(operator*()); }
 
     const_iterator& operator++() {
@@ -989,19 +1158,19 @@ class Map {
   };
 
   class iterator {
-    typedef typename InnerMap::iterator InnerIt;
+    using InnerIt = typename InnerMap::iterator;
 
    public:
-    typedef std::forward_iterator_tag iterator_category;
-    typedef typename Map::value_type value_type;
-    typedef ptrdiff_t difference_type;
-    typedef value_type* pointer;
-    typedef value_type& reference;
+    using iterator_category = std::forward_iterator_tag;
+    using value_type = typename Map::value_type;
+    using difference_type = ptrdiff_t;
+    using pointer = value_type*;
+    using reference = value_type&;
 
     iterator() {}
     explicit iterator(const InnerIt& it) : it_(it) {}
 
-    reference operator*() const { return *it_->value(); }
+    reference operator*() const { return *it_; }
     pointer operator->() const { return &(operator*()); }
 
     iterator& operator++() {
@@ -1011,7 +1180,7 @@ class Map {
     iterator operator++(int) { return iterator(it_++); }
 
     // Allow implicit conversion to const_iterator.
-    operator const_iterator() const {
+    operator const_iterator() const {  // NOLINT(runtime/explicit)
       return const_iterator(typename InnerMap::const_iterator(it_));
     }
 
@@ -1028,55 +1197,67 @@ class Map {
     InnerIt it_;
   };
 
-  iterator begin() { return iterator(elements_->begin()); }
-  iterator end() { return iterator(elements_->end()); }
-  const_iterator begin() const {
-    return const_iterator(iterator(elements_->begin()));
-  }
-  const_iterator end() const {
-    return const_iterator(iterator(elements_->end()));
-  }
+  iterator begin() { return iterator(elements_.begin()); }
+  iterator end() { return iterator(elements_.end()); }
+  const_iterator begin() const { return const_iterator(elements_.begin()); }
+  const_iterator end() const { return const_iterator(elements_.end()); }
   const_iterator cbegin() const { return begin(); }
   const_iterator cend() const { return end(); }
 
   // Capacity
-  size_type size() const { return elements_->size(); }
+  size_type size() const { return elements_.size(); }
   bool empty() const { return size() == 0; }
 
   // Element access
-  T& operator[](const key_type& key) {
-    value_type** value =  &(*elements_)[key];
-    if (*value == NULL) {
-      *value = CreateValueTypeInternal(key);
-      internal::MapValueInitializer<google::protobuf::is_proto_enum<T>::value,
-                                    T>::Initialize((*value)->second,
-                                                   default_enum_value_);
-    }
-    return (*value)->second;
+  template <typename K = key_type>
+  T& operator[](const key_arg<K>& key) {
+    return elements_[key].second;
+  }
+  template <
+      typename K = key_type,
+      // Disable for integral types to reduce code bloat.
+      typename = typename std::enable_if<!std::is_integral<K>::value>::type>
+  T& operator[](key_arg<K>&& key) {
+    return elements_[std::forward<K>(key)].second;
   }
-  const T& at(const key_type& key) const {
+
+  template <typename K = key_type>
+  const T& at(const key_arg<K>& key) const {
     const_iterator it = find(key);
-    GOOGLE_CHECK(it != end()) << "key not found: " << key;
+    GOOGLE_CHECK(it != end()) << "key not found: " << static_cast<Key>(key);
     return it->second;
   }
-  T& at(const key_type& key) {
+
+  template <typename K = key_type>
+  T& at(const key_arg<K>& key) {
     iterator it = find(key);
-    GOOGLE_CHECK(it != end()) << "key not found: " << key;
+    GOOGLE_CHECK(it != end()) << "key not found: " << static_cast<Key>(key);
     return it->second;
   }
 
   // Lookup
-  size_type count(const key_type& key) const {
-    const_iterator it = find(key);
-    GOOGLE_DCHECK(it == end() || key == it->first);
-    return it == end() ? 0 : 1;
+  template <typename K = key_type>
+  size_type count(const key_arg<K>& key) const {
+    return find(key) == end() ? 0 : 1;
   }
-  const_iterator find(const key_type& key) const {
-    return const_iterator(iterator(elements_->find(key)));
+
+  template <typename K = key_type>
+  const_iterator find(const key_arg<K>& key) const {
+    return const_iterator(elements_.find(key));
+  }
+  template <typename K = key_type>
+  iterator find(const key_arg<K>& key) {
+    return iterator(elements_.find(key));
+  }
+
+  template <typename K = key_type>
+  bool contains(const key_arg<K>& key) const {
+    return find(key) != end();
   }
-  iterator find(const key_type& key) { return iterator(elements_->find(key)); }
+
+  template <typename K = key_type>
   std::pair<const_iterator, const_iterator> equal_range(
-      const key_type& key) const {
+      const key_arg<K>& key) const {
     const_iterator it = find(key);
     if (it == end()) {
       return std::pair<const_iterator, const_iterator>(it, it);
@@ -1085,7 +1266,9 @@ class Map {
       return std::pair<const_iterator, const_iterator>(begin, it);
     }
   }
-  std::pair<iterator, iterator> equal_range(const key_type& key) {
+
+  template <typename K = key_type>
+  std::pair<iterator, iterator> equal_range(const key_arg<K>& key) {
     iterator it = find(key);
     if (it == end()) {
       return std::pair<iterator, iterator>(it, it);
@@ -1098,9 +1281,9 @@ class Map {
   // insert
   std::pair<iterator, bool> insert(const value_type& value) {
     std::pair<typename InnerMap::iterator, bool> p =
-        elements_->insert(value.first);
+        elements_.insert(value.first);
     if (p.second) {
-      p.first->value() = CreateValueTypeInternal(value);
+      p.first->second = value.second;
     }
     return std::pair<iterator, bool>(iterator(p.first), p.second);
   }
@@ -1113,9 +1296,13 @@ class Map {
       }
     }
   }
+  void insert(std::initializer_list<value_type> values) {
+    insert(values.begin(), values.end());
+  }
 
   // Erase and clear
-  size_type erase(const key_type& key) {
+  template <typename K = key_type>
+  size_type erase(const key_arg<K>& key) {
     iterator it = find(key);
     if (it == end()) {
       return 0;
@@ -1125,9 +1312,8 @@ class Map {
     }
   }
   iterator erase(iterator pos) {
-    if (arena_ == NULL) delete pos.operator->();
     iterator i = pos++;
-    elements_->erase(i.it_);
+    elements_.erase(i.it_);
     return pos;
   }
   void erase(iterator first, iterator last) {
@@ -1135,7 +1321,7 @@ class Map {
       first = erase(first);
     }
   }
-  void clear() { erase(begin(), end()); }
+  void clear() { elements_.clear(); }
 
   // Assign
   Map& operator=(const Map& other) {
@@ -1147,9 +1333,8 @@ class Map {
   }
 
   void swap(Map& other) {
-    if (arena_ == other.arena_) {
-      std::swap(default_enum_value_, other.default_enum_value_);
-      std::swap(elements_, other.elements_);
+    if (arena() == other.arena()) {
+      InternalSwap(other);
     } else {
       // TODO(zuguang): optimize this. The temporary copy can be allocated
       // in the same arena as the other message, and the "other = copy" can
@@ -1160,58 +1345,33 @@ class Map {
     }
   }
 
+  void InternalSwap(Map& other) { elements_.Swap(&other.elements_); }
+
   // 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(); }
-
- private:
-  // Set default enum value only for proto2 map field whose value is enum type.
-  void SetDefaultEnumValue(int default_enum_value) {
-    default_enum_value_ = default_enum_value;
-  }
+  hasher hash_function() const { return elements_.hash_function(); }
 
-  value_type* CreateValueTypeInternal(const Key& key) {
-    if (arena_ == NULL) {
-      return new value_type(key);
-    } else {
-      value_type* value = reinterpret_cast<value_type*>(
-          Arena::CreateArray<uint8>(arena_, sizeof(value_type)));
-      Arena::CreateInArenaStorage(const_cast<Key*>(&value->first), arena_);
-      Arena::CreateInArenaStorage(&value->second, arena_);
-      const_cast<Key&>(value->first) = key;
-      return value;
-    }
-  }
-
-  value_type* CreateValueTypeInternal(const value_type& value) {
-    if (arena_ == NULL) {
-      return new value_type(value);
-    } else {
-      value_type* p = reinterpret_cast<value_type*>(
-          Arena::CreateArray<uint8>(arena_, sizeof(value_type)));
-      Arena::CreateInArenaStorage(const_cast<Key*>(&p->first), arena_);
-      Arena::CreateInArenaStorage(&p->second, arena_);
-      const_cast<Key&>(p->first) = value.first;
-      p->second = value.second;
-      return p;
-    }
+  size_t SpaceUsedExcludingSelfLong() const {
+    if (empty()) return 0;
+    return elements_.SpaceUsedInternal() + internal::SpaceUsedInValues(this);
   }
 
-  Arena* arena_;
-  int default_enum_value_;
-  InnerMap* elements_;
+ private:
+  Arena* arena() const { return elements_.arena(); }
+  InnerMap elements_;
 
-  friend class ::google::protobuf::Arena;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
+  friend class Arena;
+  using InternalArenaConstructable_ = void;
+  using DestructorSkippable_ = void;
   template <typename Derived, typename K, typename V,
             internal::WireFormatLite::FieldType key_wire_type,
-            internal::WireFormatLite::FieldType value_wire_type,
-            int default_enum_value>
+            internal::WireFormatLite::FieldType value_wire_type>
   friend class internal::MapFieldLite;
 };
 
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_MAP_H__
index 801def9..2aec2d4 100644 (file)
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/map_entry_lite.h>
 #include <google/protobuf/map_type_handler.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/port.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/unknown_field_set.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/wire_format_lite.h>
+
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
@@ -45,11 +51,13 @@ class Arena;
 namespace internal {
 template <typename Derived, typename Key, typename Value,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
+          WireFormatLite::FieldType kValueFieldType>
 class MapField;
 }
-}
+}  // namespace protobuf
+}  // namespace google
 
+namespace google {
 namespace protobuf {
 namespace internal {
 
@@ -70,40 +78,52 @@ namespace internal {
 //                         field.
 //
 // cpp type | proto type  | in-memory type | MapEntry accessor type
-// int32      TYPE_INT32    int32            int32
-// int32      TYPE_FIXED32  int32            int32
+// int32_t    TYPE_INT32    int32_t          int32_t
+// int32_t    TYPE_FIXED32  int32_t          int32_t
 // string     TYPE_STRING   ArenaStringPtr   string
 // FooEnum    TYPE_ENUM     int              int
 // FooMessage TYPE_MESSAGE  FooMessage*      FooMessage
 //
 // The in-memory types of primitive types can be inferred from its proto type,
 // while we need to explicitly specify the cpp type if proto type is
-// TYPE_MESSAGE to infer the in-memory type.  Moreover, default_enum_value is
-// used to initialize enum field in proto2.
+// TYPE_MESSAGE to infer the in-memory type.
 template <typename Derived, typename Key, typename Value,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-class MapEntry
-    : public MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType,
-                          kValueFieldType, default_enum_value> {
+          WireFormatLite::FieldType kValueFieldType>
+class MapEntry : public MapEntryImpl<Derived, Message, Key, Value,
+                                     kKeyFieldType, kValueFieldType> {
  public:
-  MapEntry() : _internal_metadata_(NULL) {}
+  constexpr MapEntry() : _internal_metadata_() {}
   explicit MapEntry(Arena* arena)
       : MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType,
-                     kValueFieldType, default_enum_value>(arena),
+                     kValueFieldType>(arena),
         _internal_metadata_(arena) {}
+  ~MapEntry() {
+    Message::_internal_metadata_.template Delete<UnknownFieldSet>();
+    _internal_metadata_.Delete<UnknownFieldSet>();
+  }
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
 
-  InternalMetadataWithArena _internal_metadata_;
+  typedef typename MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType,
+                                kValueFieldType>::KeyTypeHandler KeyTypeHandler;
+  typedef
+      typename MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType,
+                            kValueFieldType>::ValueTypeHandler ValueTypeHandler;
+  size_t SpaceUsedLong() const override {
+    size_t size = sizeof(Derived);
+    size += KeyTypeHandler::SpaceUsedInMapEntryLong(this->key_);
+    size += ValueTypeHandler::SpaceUsedInMapEntryLong(this->value_);
+    return size;
+  }
+
+  InternalMetadata _internal_metadata_;
 
  private:
-  friend class ::google::protobuf::Arena;
+  friend class ::PROTOBUF_NAMESPACE_ID::Arena;
   template <typename C, typename K, typename V,
-            WireFormatLite::FieldType k_wire_type, WireFormatLite::FieldType,
-            int default_enum>
+            WireFormatLite::FieldType k_wire_type, WireFormatLite::FieldType>
   friend class internal::MapField;
-  friend class internal::GeneratedMessageReflection;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntry);
 };
@@ -111,30 +131,30 @@ class MapEntry
 // 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<Derived, Key, Value, kKeyFieldType,
-                                  kValueFieldType, default_enum_value> > {
+          WireFormatLite::FieldType kValueFieldType>
+struct MapEntryHelper<
+    MapEntry<Derived, Key, Value, kKeyFieldType, kValueFieldType> >
+    : MapEntryHelper<
+          MapEntryLite<Derived, Key, Value, kKeyFieldType, kValueFieldType> > {
   explicit MapEntryHelper(const MapPair<Key, Value>& map_pair)
-      : MapEntryHelper<MapEntryLite<Derived, Key, Value, kKeyFieldType,
-                                    kValueFieldType, default_enum_value> >(
+      : MapEntryHelper<
+            MapEntryLite<Derived, Key, Value, kKeyFieldType, kValueFieldType> >(
             map_pair) {}
 };
 
 template <typename Derived, typename K, typename V,
-          WireFormatLite::FieldType key, WireFormatLite::FieldType value,
-          int default_enum>
-struct DeconstructMapEntry<MapEntry<Derived, K, V, key, value, default_enum> > {
+          WireFormatLite::FieldType key, WireFormatLite::FieldType value>
+struct DeconstructMapEntry<MapEntry<Derived, K, V, key, value> > {
   typedef K Key;
   typedef V Value;
-  static const WireFormatLite::FieldType kKeyFieldType = key;
-  static const WireFormatLite::FieldType kValueFieldType = value;
-  static const int default_enum_value = default_enum;
+  static constexpr WireFormatLite::FieldType kKeyFieldType = key;
+  static constexpr WireFormatLite::FieldType kValueFieldType = value;
 };
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_MAP_ENTRY_H__
index 7c477c5..34b185b 100644 (file)
 #define GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__
 
 #include <assert.h>
+#include <string>
 
+#include <google/protobuf/stubs/casts.h>
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/generated_message_util.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>
+#include <google/protobuf/port.h>
+#include <google/protobuf/wire_format_lite.h>
+
+#include <google/protobuf/port_def.inc>
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
 namespace internal {
 template <typename Derived, typename Key, typename Value,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
+          WireFormatLite::FieldType kValueFieldType>
 class MapEntry;
 template <typename Derived, typename Key, typename Value,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
+          WireFormatLite::FieldType kValueFieldType>
 class MapFieldLite;
 }  // namespace internal
 }  // namespace protobuf
+}  // namespace google
 
+namespace google {
 namespace protobuf {
 namespace internal {
 
@@ -80,11 +93,45 @@ struct MoveHelper<false, true, is_stringlike, T> {  // messages
 template <typename T>
 struct MoveHelper<false, false, true, T> {  // strings and similar
   static void Move(T* src, T* dest) {
-#if __cplusplus >= 201103L
     *dest = std::move(*src);
-#else
-    dest->swap(*src);
-#endif
+  }
+};
+
+// Functions for operating on a map entry.  Does not contain any representation
+// (this class is not intended to be instantiated).
+template <typename Key, typename Value, WireFormatLite::FieldType kKeyFieldType,
+          WireFormatLite::FieldType kValueFieldType>
+struct MapEntryFuncs {
+  typedef MapTypeHandler<kKeyFieldType, Key> KeyTypeHandler;
+  typedef MapTypeHandler<kValueFieldType, Value> ValueTypeHandler;
+  static const int kKeyFieldNumber = 1;
+  static const int kValueFieldNumber = 2;
+
+  static uint8_t* InternalSerialize(int field_number, const Key& key,
+                                    const Value& value, uint8_t* ptr,
+                                    io::EpsCopyOutputStream* stream) {
+    ptr = stream->EnsureSpace(ptr);
+    ptr = WireFormatLite::WriteTagToArray(
+        field_number, WireFormatLite::WIRETYPE_LENGTH_DELIMITED, ptr);
+    ptr = io::CodedOutputStream::WriteVarint32ToArray(GetCachedSize(key, value),
+                                                      ptr);
+
+    ptr = KeyTypeHandler::Write(kKeyFieldNumber, key, ptr, stream);
+    return ValueTypeHandler::Write(kValueFieldNumber, value, ptr, stream);
+  }
+
+  static size_t ByteSizeLong(const Key& key, const Value& value) {
+    // Tags for key and value will both be one byte (field numbers 1 and 2).
+    size_t inner_length =
+        2 + KeyTypeHandler::ByteSize(key) + ValueTypeHandler::ByteSize(value);
+    return inner_length + io::CodedOutputStream::VarintSize32(
+                              static_cast<uint32_t>(inner_length));
+  }
+
+  static int GetCachedSize(const Key& key, const Value& value) {
+    // Tags for key and value will both be one byte (field numbers 1 and 2).
+    return 2 + KeyTypeHandler::GetCachedSize(key) +
+           ValueTypeHandler::GetCachedSize(value);
   }
 };
 
@@ -93,8 +140,11 @@ struct MoveHelper<false, false, true, T> {  // strings and similar
 // the eventual code to the template code.
 template <typename Derived, typename Base, typename Key, typename Value,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
+          WireFormatLite::FieldType kValueFieldType>
 class MapEntryImpl : public Base {
+ public:
+  typedef MapEntryFuncs<Key, Value, kKeyFieldType, kValueFieldType> Funcs;
+
  protected:
   // Provide utilities to parse/serialize key/value.  Provide utilities to
   // manipulate internal stored type.
@@ -109,17 +159,17 @@ class MapEntryImpl : public Base {
   // Enum type cannot be used for MapTypeHandler::Read. Define a type
   // which will replace Enum with int.
   typedef typename KeyTypeHandler::MapEntryAccessorType KeyMapEntryAccessorType;
-  typedef typename ValueTypeHandler::MapEntryAccessorType
-      ValueMapEntryAccessorType;
+  typedef
+      typename ValueTypeHandler::MapEntryAccessorType ValueMapEntryAccessorType;
 
   // Constants for field number.
   static const int kKeyFieldNumber = 1;
   static const int kValueFieldNumber = 2;
 
   // Constants for field tag.
-  static const uint8 kKeyTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
-      kKeyFieldNumber, KeyTypeHandler::kWireType);
-  static const uint8 kValueTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
+  static const uint8_t kKeyTag =
+      GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kKeyFieldNumber, KeyTypeHandler::kWireType);
+  static const uint8_t kValueTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
       kValueFieldNumber, ValueTypeHandler::kWireType);
   static const size_t kTagSize = 1;
 
@@ -131,24 +181,20 @@ class MapEntryImpl : public Base {
   typedef Value EntryValueType;
   static const WireFormatLite::FieldType kEntryKeyFieldType = kKeyFieldType;
   static const WireFormatLite::FieldType kEntryValueFieldType = kValueFieldType;
-  static const int kEntryDefaultEnumValue = default_enum_value;
 
-  MapEntryImpl() : arena_(NULL) {
-    KeyTypeHandler::Initialize(&key_, NULL);
-    ValueTypeHandler::InitializeMaybeByDefaultEnum(&value_, default_enum_value,
-                                                   NULL);
-    _has_bits_[0] = 0;
-  }
+  constexpr MapEntryImpl()
+      : key_(KeyTypeHandler::Constinit()),
+        value_(ValueTypeHandler::Constinit()),
+        _has_bits_{} {}
 
-  explicit MapEntryImpl(Arena* arena) : arena_(arena) {
-    KeyTypeHandler::Initialize(&key_, arena);
-    ValueTypeHandler::InitializeMaybeByDefaultEnum(&value_, default_enum_value,
-                                                   arena);
-    _has_bits_[0] = 0;
-  }
+  explicit MapEntryImpl(Arena* arena)
+      : Base(arena),
+        key_(KeyTypeHandler::Constinit()),
+        value_(ValueTypeHandler::Constinit()),
+        _has_bits_{} {}
 
   ~MapEntryImpl() {
-    if (GetArenaNoVirtual() != NULL) return;
+    if (Base::GetArenaForAllocation() != nullptr) return;
     KeyTypeHandler::DeleteNoArena(key_);
     ValueTypeHandler::DeleteNoArena(value_);
   }
@@ -159,187 +205,134 @@ class MapEntryImpl : public Base {
     return KeyTypeHandler::GetExternalReference(key_);
   }
   virtual inline const ValueMapEntryAccessorType& value() const {
-    return ValueTypeHandler::DefaultIfNotInitialized(
-        value_, Derived::internal_default_instance()->value_);
+    return ValueTypeHandler::DefaultIfNotInitialized(value_);
   }
   inline KeyMapEntryAccessorType* mutable_key() {
     set_has_key();
-    return KeyTypeHandler::EnsureMutable(&key_, GetArenaNoVirtual());
+    return KeyTypeHandler::EnsureMutable(&key_, Base::GetArenaForAllocation());
   }
   inline ValueMapEntryAccessorType* mutable_value() {
     set_has_value();
-    return ValueTypeHandler::EnsureMutable(&value_, GetArenaNoVirtual());
+    return ValueTypeHandler::EnsureMutable(&value_,
+                                           Base::GetArenaForAllocation());
   }
 
   // implements MessageLite =========================================
 
   // MapEntryImpl is for implementation only and this function isn't called
   // anywhere. Just provide a fake implementation here for MessageLite.
-  string GetTypeName() const { return ""; }
+  std::string GetTypeName() const override { return ""; }
 
-  void CheckTypeAndMergeFrom(const MessageLite& other) {
-    MergeFromInternal(*::google::protobuf::down_cast<const Derived*>(&other));
+  void CheckTypeAndMergeFrom(const MessageLite& other) override {
+    MergeFromInternal(*::google::protobuf::internal::DownCast<const Derived*>(&other));
   }
 
-  bool MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream* input) {
-    uint32 tag;
-
-    for (;;) {
-      // 1) corrupted data: return false;
-      // 2) unknown field: skip without putting into unknown field set;
-      // 3) unknown enum value: keep it in parsing. In proto2, caller should
-      // check the value and put this entry into containing message's unknown
-      // field set if the value is an unknown enum. In proto3, caller doesn't
-      // need to care whether the value is unknown enum;
-      // 4) missing key/value: missed key/value will have default value. caller
-      // should take this entry as if key/value is set to default value.
-      tag = input->ReadTagNoLastTag();
-      switch (tag) {
-        case kKeyTag:
-          if (!KeyTypeHandler::Read(input, mutable_key())) {
-            return false;
-          }
-          set_has_key();
-          if (!input->ExpectTag(kValueTag)) break;
-          GOOGLE_FALLTHROUGH_INTENDED;
-
-        case kValueTag:
-          if (!ValueTypeHandler::Read(input, mutable_value())) {
-            return false;
-          }
-          set_has_value();
-          if (input->ExpectAtEnd()) return true;
-          break;
-
-        default:
-          if (tag == 0 ||
-              WireFormatLite::GetTagWireType(tag) ==
-              WireFormatLite::WIRETYPE_END_GROUP) {
-            return true;
-          }
-          if (!WireFormatLite::SkipField(input, tag)) return false;
-          break;
+  const char* _InternalParse(const char* ptr, ParseContext* ctx) final {
+    while (!ctx->Done(&ptr)) {
+      uint32_t tag;
+      ptr = ReadTag(ptr, &tag);
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+      if (tag == kKeyTag) {
+        set_has_key();
+        KeyMapEntryAccessorType* key = mutable_key();
+        ptr = KeyTypeHandler::Read(ptr, ctx, key);
+        if (!Derived::ValidateKey(key)) return nullptr;
+      } else if (tag == kValueTag) {
+        set_has_value();
+        ValueMapEntryAccessorType* value = mutable_value();
+        ptr = ValueTypeHandler::Read(ptr, ctx, value);
+        if (!Derived::ValidateValue(value)) return nullptr;
+      } else {
+        if (tag == 0 || WireFormatLite::GetTagWireType(tag) ==
+                            WireFormatLite::WIRETYPE_END_GROUP) {
+          ctx->SetLastTag(tag);
+          return ptr;
+        }
+        ptr = UnknownFieldParse(tag, static_cast<std::string*>(nullptr), ptr,
+                                ctx);
       }
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
     }
+    return ptr;
   }
 
-  size_t ByteSizeLong() const {
+  size_t ByteSizeLong() const override {
     size_t size = 0;
-    size += has_key() ?
-        kTagSize + static_cast<size_t>(KeyTypeHandler::ByteSize(key())) : 0;
-    size += has_value() ?
-        kTagSize + static_cast<size_t>(ValueTypeHandler::ByteSize(value())) : 0;
+    size += kTagSize + static_cast<size_t>(KeyTypeHandler::ByteSize(key()));
+    size += kTagSize + static_cast<size_t>(ValueTypeHandler::ByteSize(value()));
     return size;
   }
 
-  void SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream* output) const {
-    KeyTypeHandler::Write(kKeyFieldNumber, key(), output);
-    ValueTypeHandler::Write(kValueFieldNumber, value(), output);
-  }
-
-  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(bool deterministic,
-                                                   ::google::protobuf::uint8* output) const {
-    output = KeyTypeHandler::InternalWriteToArray(kKeyFieldNumber, key(),
-                                                  deterministic, output);
-    output = ValueTypeHandler::InternalWriteToArray(kValueFieldNumber, value(),
-                                                    deterministic, output);
-    return output;
+  ::uint8_t* _InternalSerialize(
+      ::uint8_t* ptr, io::EpsCopyOutputStream* stream) const override {
+    ptr = KeyTypeHandler::Write(kKeyFieldNumber, key(), ptr, stream);
+    return ValueTypeHandler::Write(kValueFieldNumber, value(), ptr, stream);
   }
 
   // Don't override SerializeWithCachedSizesToArray.  Use MessageLite's.
 
-  int GetCachedSize() const {
+  int GetCachedSize() const override {
     int size = 0;
-    size += has_key()
-        ? static_cast<int>(kTagSize) + KeyTypeHandler::GetCachedSize(key())
-        : 0;
-    size += has_value()
-        ? static_cast<int>(kTagSize) + ValueTypeHandler::GetCachedSize(value())
-        : 0;
+    size += has_key() ? static_cast<int>(kTagSize) +
+                            KeyTypeHandler::GetCachedSize(key())
+                      : 0;
+    size += has_value() ? static_cast<int>(kTagSize) +
+                              ValueTypeHandler::GetCachedSize(value())
+                        : 0;
     return size;
   }
 
-  bool IsInitialized() const { return ValueTypeHandler::IsInitialized(value_); }
-
-  Base* New() const {
-    Derived* entry = new Derived;
-    return entry;
+  bool IsInitialized() const override {
+    return ValueTypeHandler::IsInitialized(value_);
   }
 
-  Base* New(Arena* arena) const {
+  Base* New(Arena* arena) const override {
     Derived* entry = Arena::CreateMessage<Derived>(arena);
     return entry;
   }
 
-  size_t SpaceUsedLong() const {
-    size_t size = sizeof(Derived);
-    size += KeyTypeHandler::SpaceUsedInMapEntryLong(key_);
-    size += ValueTypeHandler::SpaceUsedInMapEntryLong(value_);
-    return size;
-  }
-
  protected:
   // We can't declare this function directly here as it would hide the other
   // overload (const Message&).
   void MergeFromInternal(const MapEntryImpl& from) {
     if (from._has_bits_[0]) {
       if (from.has_key()) {
-        KeyTypeHandler::EnsureMutable(&key_, GetArenaNoVirtual());
-        KeyTypeHandler::Merge(from.key(), &key_, GetArenaNoVirtual());
+        KeyTypeHandler::EnsureMutable(&key_, Base::GetArenaForAllocation());
+        KeyTypeHandler::Merge(from.key(), &key_, Base::GetArenaForAllocation());
         set_has_key();
       }
       if (from.has_value()) {
-        ValueTypeHandler::EnsureMutable(&value_, GetArenaNoVirtual());
-        ValueTypeHandler::Merge(from.value(), &value_, GetArenaNoVirtual());
+        ValueTypeHandler::EnsureMutable(&value_, Base::GetArenaForAllocation());
+        ValueTypeHandler::Merge(from.value(), &value_,
+                                Base::GetArenaForAllocation());
         set_has_value();
       }
     }
   }
 
  public:
-  void Clear() {
-    KeyTypeHandler::Clear(&key_, GetArenaNoVirtual());
-    ValueTypeHandler::ClearMaybeByDefaultEnum(
-        &value_, GetArenaNoVirtual(), default_enum_value);
+  void Clear() override {
+    KeyTypeHandler::Clear(&key_, Base::GetArenaForAllocation());
+    ValueTypeHandler::Clear(&value_, Base::GetArenaForAllocation());
     clear_has_key();
     clear_has_value();
   }
 
-  static void InitAsDefaultInstance() {
-    Derived* d = const_cast<Derived*>(Derived::internal_default_instance());
-    KeyTypeHandler::AssignDefaultValue(&d->key_);
-    ValueTypeHandler::AssignDefaultValue(&d->value_);
-  }
-
-  Arena* GetArena() const {
-    return GetArenaNoVirtual();
-  }
-
-  // Create a MapEntryImpl for given key and value from google::protobuf::Map in
-  // serialization. This function is only called when value is enum. Enum is
-  // treated differently because its type in MapEntry is int and its type in
-  // google::protobuf::Map is enum. We cannot create a reference to int from an enum.
-  static Derived* EnumWrap(const Key& key, const Value value, Arena* arena) {
-    return Arena::CreateMessage<MapEnumEntryWrapper>(arena, key, value);
-  }
-
-  // Like above, but for all the other types. This avoids value copy to create
-  // MapEntryImpl from google::protobuf::Map in serialization.
-  static Derived* Wrap(const Key& key, const Value& value, Arena* arena) {
-    return Arena::CreateMessage<MapEntryWrapper>(arena, key, value);
-  }
-
   // Parsing using MergePartialFromCodedStream, above, is not as
   // efficient as it could be.  This helper class provides a speedier way.
   template <typename MapField, typename Map>
   class Parser {
    public:
     explicit Parser(MapField* mf) : mf_(mf), map_(mf->MutableMap()) {}
+    ~Parser() {
+      if (entry_ != nullptr && entry_->GetArenaForAllocation() == nullptr)
+        delete entry_;
+    }
 
     // This does what the typical MergePartialFromCodedStream() is expected to
     // do, with the additional side-effect that if successful (i.e., if true is
     // going to be its return value) it inserts the key-value pair into map_.
-    bool MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream* input) {
+    bool MergePartialFromCodedStream(io::CodedInputStream* input) {
       // Look for the expected thing: a key and then a value.  If it fails,
       // invoke the enclosing class's MergePartialFromCodedStream, or return
       // false if that would be pointless.
@@ -352,11 +345,11 @@ class MapEntryImpl : public Base {
         int size;
         input->GetDirectBufferPointerInline(&data, &size);
         // We could use memcmp here, but we don't bother. The tag is one byte.
-        GOOGLE_COMPILE_ASSERT(kTagSize == 1, tag_size_error);
+        static_assert(kTagSize == 1, "tag size must be 1");
         if (size > 0 && *reinterpret_cast<const char*>(data) == kValueTag) {
-          typename Map::size_type size = map_->size();
+          typename Map::size_type map_size = map_->size();
           value_ptr_ = &(*map_)[key_];
-          if (GOOGLE_PREDICT_TRUE(size != map_->size())) {
+          if (PROTOBUF_PREDICT_TRUE(map_size != map_->size())) {
             // We created a new key-value pair.  Fill in the value.
             typedef
                 typename MapIf<ValueTypeHandler::kIsEnum, int*, Value*>::type T;
@@ -374,64 +367,119 @@ class MapEntryImpl : public Base {
         key_ = Key();
       }
 
-      entry_.reset(mf_->NewEntry());
+      NewEntry();
       *entry_->mutable_key() = key_;
       const bool result = entry_->MergePartialFromCodedStream(input);
       if (result) UseKeyAndValueFromEntry();
-      if (entry_->GetArena() != NULL) entry_.release();
       return result;
     }
 
+    const char* _InternalParse(const char* ptr, ParseContext* ctx) {
+      if (PROTOBUF_PREDICT_TRUE(!ctx->Done(&ptr) && *ptr == kKeyTag)) {
+        ptr = KeyTypeHandler::Read(ptr + 1, ctx, &key_);
+        if (PROTOBUF_PREDICT_FALSE(!ptr || !Derived::ValidateKey(&key_))) {
+          return nullptr;
+        }
+        if (PROTOBUF_PREDICT_TRUE(!ctx->Done(&ptr) && *ptr == kValueTag)) {
+          typename Map::size_type map_size = map_->size();
+          value_ptr_ = &(*map_)[key_];
+          if (PROTOBUF_PREDICT_TRUE(map_size != map_->size())) {
+            using T =
+                typename MapIf<ValueTypeHandler::kIsEnum, int*, Value*>::type;
+            ptr = ValueTypeHandler::Read(ptr + 1, ctx,
+                                         reinterpret_cast<T>(value_ptr_));
+            if (PROTOBUF_PREDICT_FALSE(!ptr ||
+                                       !Derived::ValidateValue(value_ptr_))) {
+              map_->erase(key_);  // Failure! Undo insertion.
+              return nullptr;
+            }
+            if (PROTOBUF_PREDICT_TRUE(ctx->Done(&ptr))) return ptr;
+            if (!ptr) return nullptr;
+            NewEntry();
+            ValueMover::Move(value_ptr_, entry_->mutable_value());
+            map_->erase(key_);
+            goto move_key;
+          }
+        } else {
+          if (!ptr) return nullptr;
+        }
+        NewEntry();
+      move_key:
+        KeyMover::Move(&key_, entry_->mutable_key());
+      } else {
+        if (!ptr) return nullptr;
+        NewEntry();
+      }
+      ptr = entry_->_InternalParse(ptr, ctx);
+      if (ptr) UseKeyAndValueFromEntry();
+      return ptr;
+    }
+
+    template <typename UnknownType>
+    const char* ParseWithEnumValidation(const char* ptr, ParseContext* ctx,
+                                        bool (*is_valid)(int),
+                                        uint32_t field_num,
+                                        InternalMetadata* metadata) {
+      auto entry = NewEntry();
+      ptr = entry->_InternalParse(ptr, ctx);
+      if (!ptr) return nullptr;
+      if (is_valid(entry->value())) {
+        UseKeyAndValueFromEntry();
+      } else {
+        WriteLengthDelimited(field_num, entry->SerializeAsString(),
+                             metadata->mutable_unknown_fields<UnknownType>());
+      }
+      return ptr;
+    }
+
+    MapEntryImpl* NewEntry() { return entry_ = mf_->NewEntry(); }
+
     const Key& key() const { return key_; }
     const Value& value() const { return *value_ptr_; }
 
+    const Key& entry_key() const { return entry_->key(); }
+    const Value& entry_value() const { return entry_->value(); }
+
    private:
-    void UseKeyAndValueFromEntry() GOOGLE_PROTOBUF_ATTRIBUTE_COLD {
+    void UseKeyAndValueFromEntry() {
       // 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
       // path, so it's not a big deal.
       key_ = entry_->key();
       value_ptr_ = &(*map_)[key_];
-      MoveHelper<ValueTypeHandler::kIsEnum,
-                 ValueTypeHandler::kIsMessage,
-                 ValueTypeHandler::kWireType ==
-                 WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-                 Value>::Move(entry_->mutable_value(), value_ptr_);
+      ValueMover::Move(entry_->mutable_value(), value_ptr_);
     }
 
     // After reading a key and value successfully, and inserting that data
     // 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_PROTOBUF_ATTRIBUTE_COLD {
-      typedef MoveHelper<KeyTypeHandler::kIsEnum,
-                         KeyTypeHandler::kIsMessage,
-                         KeyTypeHandler::kWireType ==
-                         WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-                         Key> KeyMover;
-      typedef MoveHelper<ValueTypeHandler::kIsEnum,
-                         ValueTypeHandler::kIsMessage,
-                         ValueTypeHandler::kWireType ==
-                         WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-                         Value> ValueMover;
-      entry_.reset(mf_->NewEntry());
+    bool ReadBeyondKeyValuePair(io::CodedInputStream* input) PROTOBUF_COLD {
+      NewEntry();
       ValueMover::Move(value_ptr_, entry_->mutable_value());
       map_->erase(key_);
       KeyMover::Move(&key_, entry_->mutable_key());
       const bool result = entry_->MergePartialFromCodedStream(input);
       if (result) UseKeyAndValueFromEntry();
-      if (entry_->GetArena() != NULL) entry_.release();
       return result;
     }
 
+    typedef MoveHelper<KeyTypeHandler::kIsEnum, KeyTypeHandler::kIsMessage,
+                       KeyTypeHandler::kWireType ==
+                           WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
+                       Key>
+        KeyMover;
+    typedef MoveHelper<ValueTypeHandler::kIsEnum, ValueTypeHandler::kIsMessage,
+                       ValueTypeHandler::kWireType ==
+                           WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
+                       Value>
+        ValueMover;
+
     MapField* const mf_;
     Map* const map_;
     Key key_;
     Value* value_ptr_;
-    // On the fast path entry_ is not used.  And, when entry_ is used, it's set
-    // to mf_->NewEntry(), so in the arena case we must call entry_.release.
-    google::protobuf::scoped_ptr<MapEntryImpl> entry_;
+    MapEntryImpl* entry_ = nullptr;
   };
 
  protected:
@@ -442,89 +490,23 @@ class MapEntryImpl : public Base {
   bool has_value() const { return (_has_bits_[0] & 0x00000002u) != 0; }
   void clear_has_value() { _has_bits_[0] &= ~0x00000002u; }
 
- private:
-  // Serializing a generated message containing map field involves serializing
-  // key-value pairs from google::protobuf::Map. The wire format of each key-value pair
-  // after serialization should be the same as that of a MapEntry message
-  // containing the same key and value inside it.  However, google::protobuf::Map doesn't
-  // store key and value as MapEntry message, which disables us to use existing
-  // code to serialize message. In order to use existing code to serialize
-  // message, we need to construct a MapEntry from key-value pair. But it
-  // involves copy of key and value to construct a MapEntry. In order to avoid
-  // this copy in constructing a MapEntry, we need the following class which
-  // only takes references of given key and value.
-  class MapEntryWrapper : public Derived {
-    typedef Derived BaseClass;
-    typedef typename BaseClass::KeyMapEntryAccessorType KeyMapEntryAccessorType;
-    typedef
-        typename BaseClass::ValueMapEntryAccessorType ValueMapEntryAccessorType;
-
-   public:
-    MapEntryWrapper(Arena* arena, const Key& key, const Value& value)
-        : Derived(arena), key_(key), value_(value) {
-      BaseClass::set_has_key();
-      BaseClass::set_has_value();
-    }
-    inline const KeyMapEntryAccessorType& key() const { return key_; }
-    inline const ValueMapEntryAccessorType& value() const { return value_; }
-
-   private:
-    const Key& key_;
-    const Value& value_;
-
-    friend class ::google::protobuf::Arena;
-    typedef void InternalArenaConstructable_;
-    typedef void DestructorSkippable_;
-  };
-
-  // Like above, but for enum value only, which stores value instead of
-  // reference of value field inside. This is needed because the type of value
-  // field in constructor is an enum, while we need to store it as an int. If we
-  // initialize a reference to int with a reference to enum, compiler will
-  // generate a temporary int from enum and initialize the reference to int with
-  // the temporary.
-  class MapEnumEntryWrapper : public Derived {
-    typedef Derived BaseClass;
-    typedef typename BaseClass::KeyMapEntryAccessorType KeyMapEntryAccessorType;
-    typedef
-        typename BaseClass::ValueMapEntryAccessorType ValueMapEntryAccessorType;
-
-   public:
-    MapEnumEntryWrapper(Arena* arena, const Key& key, const Value& value)
-        : Derived(arena), key_(key), value_(value) {
-      BaseClass::set_has_key();
-      BaseClass::set_has_value();
-    }
-    inline const KeyMapEntryAccessorType& key() const { return key_; }
-    inline const ValueMapEntryAccessorType& value() const { return value_; }
-
-   private:
-    const KeyMapEntryAccessorType& key_;
-    const ValueMapEntryAccessorType value_;
-
-    friend class google::protobuf::Arena;
-    typedef void DestructorSkippable_;
-  };
-
-  inline Arena* GetArenaNoVirtual() const {
-    return arena_;
-  }
+ public:
+  inline Arena* GetArena() const { return Base::GetArena(); }
 
  public:  // Needed for constructing tables
   KeyOnMemory key_;
   ValueOnMemory value_;
-  Arena* arena_;
-  uint32 _has_bits_[1];
+  uint32_t _has_bits_[1];
 
  private:
-  friend class ::google::protobuf::Arena;
+  friend class ::PROTOBUF_NAMESPACE_ID::Arena;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
   template <typename C, typename K, typename V, WireFormatLite::FieldType,
-            WireFormatLite::FieldType, int>
+            WireFormatLite::FieldType>
   friend class internal::MapEntry;
   template <typename C, typename K, typename V, WireFormatLite::FieldType,
-            WireFormatLite::FieldType, int>
+            WireFormatLite::FieldType>
   friend class internal::MapFieldLite;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntryImpl);
@@ -532,16 +514,18 @@ class MapEntryImpl : public Base {
 
 template <typename T, typename Key, typename Value,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-class MapEntryLite
-    : public MapEntryImpl<T, MessageLite, Key, Value, kKeyFieldType,
-                          kValueFieldType, default_enum_value> {
+          WireFormatLite::FieldType kValueFieldType>
+class MapEntryLite : public MapEntryImpl<T, MessageLite, Key, Value,
+                                         kKeyFieldType, kValueFieldType> {
  public:
   typedef MapEntryImpl<T, MessageLite, Key, Value, kKeyFieldType,
-                       kValueFieldType, default_enum_value>
+                       kValueFieldType>
       SuperType;
-  MapEntryLite() {}
+  constexpr MapEntryLite() {}
   explicit MapEntryLite(Arena* arena) : SuperType(arena) {}
+  ~MapEntryLite() {
+    MessageLite::_internal_metadata_.template Delete<std::string>();
+  }
   void MergeFrom(const MapEntryLite& other) { MergeFromInternal(other); }
 
  private:
@@ -554,13 +538,12 @@ template <typename Derived>
 struct DeconstructMapEntry;
 
 template <typename T, typename K, typename V, WireFormatLite::FieldType key,
-          WireFormatLite::FieldType value, int default_enum>
-struct DeconstructMapEntry<MapEntryLite<T, K, V, key, value, default_enum> > {
+          WireFormatLite::FieldType value>
+struct DeconstructMapEntry<MapEntryLite<T, K, V, key, value> > {
   typedef K Key;
   typedef V Value;
   static const WireFormatLite::FieldType kKeyFieldType = key;
   static const WireFormatLite::FieldType kValueFieldType = value;
-  static const int default_enum_value = default_enum;
 };
 
 // Helpers for deterministic serialization =============================
@@ -569,7 +552,8 @@ struct DeconstructMapEntry<MapEntryLite<T, K, V, key, value, default_enum> > {
 // type is relatively small and easy to copy then copying Keys into an
 // array of SortItems can be beneficial.  Then all the data the sorting
 // algorithm needs to touch is in that one array.
-template <typename Key, typename PtrToKeyValuePair> struct SortItem {
+template <typename Key, typename PtrToKeyValuePair>
+struct SortItem {
   SortItem() {}
   explicit SortItem(PtrToKeyValuePair p) : first(p->first), second(p) {}
 
@@ -577,16 +561,14 @@ template <typename Key, typename PtrToKeyValuePair> struct SortItem {
   PtrToKeyValuePair second;
 };
 
-template <typename T> struct CompareByFirstField {
-  bool operator()(const T& a, const T& b) const {
-    return a.first < b.first;
-  }
+template <typename T>
+struct CompareByFirstField {
+  bool operator()(const T& a, const T& b) const { return a.first < b.first; }
 };
 
-template <typename T> struct CompareByDerefFirst {
-  bool operator()(const T& a, const T& b) const {
-    return a->first < b->first;
-  }
+template <typename T>
+struct CompareByDerefFirst {
+  bool operator()(const T& a, const T& b) const { return a->first < b->first; }
 };
 
 // Helper for table driven serialization
@@ -601,17 +583,21 @@ struct FromHelper {
 
 template <>
 struct FromHelper<WireFormatLite::TYPE_STRING> {
-  static ArenaStringPtr From(const string& x) {
+  static ArenaStringPtr From(const std::string& x) {
     ArenaStringPtr res;
-    *res.UnsafeRawStringPointer() = const_cast<string*>(&x);
+    TaggedPtr<std::string> ptr;
+    ptr.Set(const_cast<std::string*>(&x));
+    res.UnsafeSetTaggedPointer(ptr);
     return res;
   }
 };
 template <>
 struct FromHelper<WireFormatLite::TYPE_BYTES> {
-  static ArenaStringPtr From(const string& x) {
+  static ArenaStringPtr From(const std::string& x) {
     ArenaStringPtr res;
-    *res.UnsafeRawStringPointer() = const_cast<string*>(&x);
+    TaggedPtr<std::string> ptr;
+    ptr.Set(const_cast<std::string*>(&x));
+    res.UnsafeSetTaggedPointer(ptr);
     return res;
   }
 };
@@ -628,9 +614,9 @@ struct MapEntryHelper;
 
 template <typename T, typename Key, typename Value,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-struct MapEntryHelper<MapEntryLite<T, Key, Value, kKeyFieldType,
-                                   kValueFieldType, default_enum_value> > {
+          WireFormatLite::FieldType kValueFieldType>
+struct MapEntryHelper<
+    MapEntryLite<T, Key, Value, kKeyFieldType, kValueFieldType> > {
   // Provide utilities to parse/serialize key/value.  Provide utilities to
   // manipulate internal stored type.
   typedef MapTypeHandler<kKeyFieldType, Key> KeyTypeHandler;
@@ -648,19 +634,21 @@ struct MapEntryHelper<MapEntryLite<T, Key, Value, kKeyFieldType,
         key_(FromHelper<kKeyFieldType>::From(map_pair.first)),
         value_(FromHelper<kValueFieldType>::From(map_pair.second)) {}
 
-  // Purposely not folowing the style guide naming. These are the names
+  // Purposely not following the style guide naming. These are the names
   // the proto compiler would generate given the map entry descriptor.
   // The proto compiler generates the offsets in this struct as if this was
   // a regular message. This way the table driven code barely notices it's
   // dealing with a map field.
-  uint32 _has_bits_;     // NOLINT
-  uint32 _cached_size_;  // NOLINT
+  uint32_t _has_bits_;     // NOLINT
+  uint32_t _cached_size_;  // NOLINT
   KeyOnMemory key_;      // NOLINT
   ValueOnMemory value_;  // NOLINT
 };
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__
index 64dcc99..367cc2a 100644 (file)
 
 #include <vector>
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace internal {
 
 MapFieldBase::~MapFieldBase() {
-  if (repeated_field_ != NULL && arena_ == NULL) delete repeated_field_;
+  if (repeated_field_ != nullptr && arena_ == nullptr) delete repeated_field_;
 }
 
 const RepeatedPtrFieldBase& MapFieldBase::GetRepeatedField() const {
+  ConstAccess();
   SyncRepeatedFieldWithMap();
-  return *repeated_field_;
+  return *reinterpret_cast<RepeatedPtrFieldBase*>(repeated_field_);
 }
 
 RepeatedPtrFieldBase* MapFieldBase::MutableRepeatedField() {
+  MutableAccess();
   SyncRepeatedFieldWithMap();
   SetRepeatedDirty();
-  return repeated_field_;
+  return reinterpret_cast<RepeatedPtrFieldBase*>(repeated_field_);
+}
+
+void MapFieldBase::SwapState(MapFieldBase* other) {
+  // a relaxed swap of the atomic
+  auto other_state = other->state_.load(std::memory_order_relaxed);
+  auto this_state = state_.load(std::memory_order_relaxed);
+  other->state_.store(this_state, std::memory_order_relaxed);
+  state_.store(other_state, std::memory_order_relaxed);
+}
+
+void SwapRepeatedPtrToNull(RepeatedPtrField<Message>** from,
+                           RepeatedPtrField<Message>** to, Arena* from_arena,
+                           Arena* to_arena) {
+  GOOGLE_DCHECK(*from != nullptr);
+  GOOGLE_DCHECK(*to == nullptr);
+  *to = Arena::CreateMessage<RepeatedPtrField<Message> >(to_arena);
+  **to = std::move(**from);
+  if (from_arena == nullptr) {
+    delete *from;
+  }
+  *from = nullptr;
+}
+
+void MapFieldBase::Swap(MapFieldBase* other) {
+  if (arena_ == other->arena_) {
+    InternalSwap(other);
+    return;
+  }
+  if (repeated_field_ != nullptr || other->repeated_field_ != nullptr) {
+    if (repeated_field_ == nullptr) {
+      SwapRepeatedPtrToNull(&other->repeated_field_, &repeated_field_,
+                            other->arena_, arena_);
+    } else if (other->repeated_field_ == nullptr) {
+      SwapRepeatedPtrToNull(&repeated_field_, &other->repeated_field_, arena_,
+                            other->arena_);
+    } else {
+      repeated_field_->Swap(other->repeated_field_);
+    }
+  }
+  SwapState(other);
+}
+
+void MapFieldBase::UnsafeShallowSwap(MapFieldBase* other) {
+  GOOGLE_DCHECK_EQ(arena_, other->arena_);
+  InternalSwap(other);
+}
+
+void MapFieldBase::InternalSwap(MapFieldBase* other) {
+  std::swap(arena_, other->arena_);
+  std::swap(repeated_field_, other->repeated_field_);
+  SwapState(other);
 }
 
 size_t MapFieldBase::SpaceUsedExcludingSelfLong() const {
+  ConstAccess();
   mutex_.Lock();
   size_t size = SpaceUsedExcludingSelfNoLock();
   mutex_.Unlock();
+  ConstAccess();
   return size;
 }
 
 size_t MapFieldBase::SpaceUsedExcludingSelfNoLock() const {
-  if (repeated_field_ != NULL) {
+  if (repeated_field_ != nullptr) {
     return repeated_field_->SpaceUsedExcludingSelfLong();
   } else {
     return 0;
@@ -68,131 +125,177 @@ size_t MapFieldBase::SpaceUsedExcludingSelfNoLock() const {
 }
 
 bool MapFieldBase::IsMapValid() const {
+  ConstAccess();
   // "Acquire" insures the operation after SyncRepeatedFieldWithMap won't get
   // executed before state_ is checked.
-  Atomic32 state = google::protobuf::internal::Acquire_Load(&state_);
+  int state = state_.load(std::memory_order_acquire);
   return state != STATE_MODIFIED_REPEATED;
 }
 
-void MapFieldBase::SetMapDirty() { state_ = STATE_MODIFIED_MAP; }
+bool MapFieldBase::IsRepeatedFieldValid() const {
+  ConstAccess();
+  int state = state_.load(std::memory_order_acquire);
+  return state != STATE_MODIFIED_MAP;
+}
 
-void MapFieldBase::SetRepeatedDirty() { state_ = STATE_MODIFIED_REPEATED; }
+void MapFieldBase::SetMapDirty() {
+  MutableAccess();
+  // These are called by (non-const) mutator functions. So by our API it's the
+  // callers responsibility to have these calls properly ordered.
+  state_.store(STATE_MODIFIED_MAP, std::memory_order_relaxed);
+}
 
-void* MapFieldBase::MutableRepeatedPtrField() const { return repeated_field_; }
+void MapFieldBase::SetRepeatedDirty() {
+  MutableAccess();
+  // These are called by (non-const) mutator functions. So by our API it's the
+  // callers responsibility to have these calls properly ordered.
+  state_.store(STATE_MODIFIED_REPEATED, std::memory_order_relaxed);
+}
 
 void MapFieldBase::SyncRepeatedFieldWithMap() const {
-  // "Acquire" insures the operation after SyncRepeatedFieldWithMap won't get
-  // executed before state_ is checked.
-  Atomic32 state = google::protobuf::internal::Acquire_Load(&state_);
-  if (state == STATE_MODIFIED_MAP) {
-    mutex_.Lock();
-    // Double check state, because another thread may have seen the same state
-    // and done the synchronization before the current thread.
-    if (state_ == STATE_MODIFIED_MAP) {
-      SyncRepeatedFieldWithMapNoLock();
-      // "Release" insures state_ can only be changed "after"
-      // SyncRepeatedFieldWithMapNoLock is finished.
-      google::protobuf::internal::Release_Store(&state_, CLEAN);
-    }
-    mutex_.Unlock();
+  ConstAccess();
+  // acquire here matches with release below to ensure that we can only see a
+  // value of CLEAN after all previous changes have been synced.
+  switch (state_.load(std::memory_order_acquire)) {
+    case STATE_MODIFIED_MAP:
+      mutex_.Lock();
+      // Double check state, because another thread may have seen the same
+      // state and done the synchronization before the current thread.
+      if (state_.load(std::memory_order_relaxed) == STATE_MODIFIED_MAP) {
+        SyncRepeatedFieldWithMapNoLock();
+        state_.store(CLEAN, std::memory_order_release);
+      }
+      mutex_.Unlock();
+      ConstAccess();
+      break;
+    case CLEAN:
+      mutex_.Lock();
+      // Double check state
+      if (state_.load(std::memory_order_relaxed) == CLEAN) {
+        if (repeated_field_ == nullptr) {
+          repeated_field_ =
+              Arena::CreateMessage<RepeatedPtrField<Message> >(arena_);
+        }
+        state_.store(CLEAN, std::memory_order_release);
+      }
+      mutex_.Unlock();
+      ConstAccess();
+      break;
+    default:
+      break;
   }
 }
 
 void MapFieldBase::SyncRepeatedFieldWithMapNoLock() const {
-  if (repeated_field_ == NULL) {
+  if (repeated_field_ == nullptr) {
     repeated_field_ = Arena::CreateMessage<RepeatedPtrField<Message> >(arena_);
   }
 }
 
 void MapFieldBase::SyncMapWithRepeatedField() const {
-  // "Acquire" insures the operation after SyncMapWithRepeatedField won't get
-  // executed before state_ is checked.
-  Atomic32 state = google::protobuf::internal::Acquire_Load(&state_);
-  if (state == STATE_MODIFIED_REPEATED) {
+  ConstAccess();
+  // acquire here matches with release below to ensure that we can only see a
+  // value of CLEAN after all previous changes have been synced.
+  if (state_.load(std::memory_order_acquire) == STATE_MODIFIED_REPEATED) {
     mutex_.Lock();
     // Double check state, because another thread may have seen the same state
     // and done the synchronization before the current thread.
-    if (state_ == STATE_MODIFIED_REPEATED) {
+    if (state_.load(std::memory_order_relaxed) == STATE_MODIFIED_REPEATED) {
       SyncMapWithRepeatedFieldNoLock();
-      // "Release" insures state_ can only be changed "after"
-      // SyncRepeatedFieldWithMapNoLock is finished.
-      google::protobuf::internal::Release_Store(&state_, CLEAN);
+      state_.store(CLEAN, std::memory_order_release);
     }
     mutex_.Unlock();
+    ConstAccess();
   }
 }
 
 // ------------------DynamicMapField------------------
 DynamicMapField::DynamicMapField(const Message* default_entry)
-    : default_entry_(default_entry) {
-}
+    : default_entry_(default_entry) {}
 
-DynamicMapField::DynamicMapField(const Message* default_entry,
-                                 Arena* arena)
+DynamicMapField::DynamicMapField(const Message* default_entry, Arena* arena)
     : TypeDefinedMapFieldBase<MapKey, MapValueRef>(arena),
-      default_entry_(default_entry) {
-}
+      map_(arena),
+      default_entry_(default_entry) {}
 
 DynamicMapField::~DynamicMapField() {
-  // DynamicMapField owns map values. Need to delete them before clearing
-  // the map.
-  for (Map<MapKey, MapValueRef>::iterator iter = map_.begin();
-       iter != map_.end(); ++iter) {
-    iter->second.DeleteData();
+  if (arena_ != nullptr) return;
+  // DynamicMapField owns map values. Need to delete them before clearing the
+  // map.
+  for (auto& kv : map_) {
+    kv.second.DeleteData();
   }
   map_.clear();
 }
 
-int DynamicMapField::size() const {
-  return GetMap().size();
+int DynamicMapField::size() const { return GetMap().size(); }
+
+void DynamicMapField::Clear() {
+  Map<MapKey, MapValueRef>* map = &const_cast<DynamicMapField*>(this)->map_;
+  if (MapFieldBase::arena_ == nullptr) {
+    for (Map<MapKey, MapValueRef>::iterator iter = map->begin();
+         iter != map->end(); ++iter) {
+      iter->second.DeleteData();
+    }
+  }
+
+  map->clear();
+
+  if (MapFieldBase::repeated_field_ != nullptr) {
+    MapFieldBase::repeated_field_->Clear();
+  }
+  // Data in map and repeated field are both empty, but we can't set status
+  // CLEAN which will invalidate previous reference to map.
+  MapFieldBase::SetMapDirty();
 }
 
-bool DynamicMapField::ContainsMapKey(
-    const MapKey& map_key) const {
+bool DynamicMapField::ContainsMapKey(const MapKey& map_key) const {
   const Map<MapKey, MapValueRef>& map = GetMap();
   Map<MapKey, MapValueRef>::const_iterator iter = map.find(map_key);
   return iter != map.end();
 }
 
-bool DynamicMapField::InsertOrLookupMapValue(
-    const MapKey& map_key, MapValueRef* val) {
+void DynamicMapField::AllocateMapValue(MapValueRef* map_val) {
+  const FieldDescriptor* val_des = default_entry_->GetDescriptor()->map_value();
+  map_val->SetType(val_des->cpp_type());
+  // Allocate memory for the MapValueRef, and initialize to
+  // default value.
+  switch (val_des->cpp_type()) {
+#define HANDLE_TYPE(CPPTYPE, TYPE)                           \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE: {                 \
+    TYPE* value = Arena::Create<TYPE>(MapFieldBase::arena_); \
+    map_val->SetValue(value);                                \
+    break;                                                   \
+  }
+    HANDLE_TYPE(INT32, int32_t);
+    HANDLE_TYPE(INT64, int64_t);
+    HANDLE_TYPE(UINT32, uint32_t);
+    HANDLE_TYPE(UINT64, uint64_t);
+    HANDLE_TYPE(DOUBLE, double);
+    HANDLE_TYPE(FLOAT, float);
+    HANDLE_TYPE(BOOL, bool);
+    HANDLE_TYPE(STRING, std::string);
+    HANDLE_TYPE(ENUM, int32_t);
+#undef HANDLE_TYPE
+    case FieldDescriptor::CPPTYPE_MESSAGE: {
+      const Message& message =
+          default_entry_->GetReflection()->GetMessage(*default_entry_, val_des);
+      Message* value = message.New(MapFieldBase::arena_);
+      map_val->SetValue(value);
+      break;
+    }
+  }
+}
+
+bool DynamicMapField::InsertOrLookupMapValue(const MapKey& map_key,
+                                             MapValueRef* val) {
   // Always use mutable map because users may change the map value by
   // MapValueRef.
   Map<MapKey, MapValueRef>* map = MutableMap();
   Map<MapKey, MapValueRef>::iterator iter = map->find(map_key);
   if (iter == map->end()) {
-    // Insert
-    MapValueRef& map_val = (*map)[map_key];
-    const FieldDescriptor* val_des =
-        default_entry_->GetDescriptor()->FindFieldByName("value");
-    map_val.SetType(val_des->cpp_type());
-    // Allocate memory for the inserted MapValueRef, and initialize to
-    // default value.
-    switch (val_des->cpp_type()) {
-#define HANDLE_TYPE(CPPTYPE, TYPE)                              \
-      case google::protobuf::FieldDescriptor::CPPTYPE_##CPPTYPE: {        \
-        TYPE * value = new TYPE();                              \
-        map_val.SetValue(value);                                \
-        break;                                                  \
-      }
-      HANDLE_TYPE(INT32, int32);
-      HANDLE_TYPE(INT64, int64);
-      HANDLE_TYPE(UINT32, uint32);
-      HANDLE_TYPE(UINT64, uint64);
-      HANDLE_TYPE(DOUBLE, double);
-      HANDLE_TYPE(FLOAT, float);
-      HANDLE_TYPE(BOOL, bool);
-      HANDLE_TYPE(STRING, string);
-      HANDLE_TYPE(ENUM, int32);
-#undef HANDLE_TYPE
-      case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE: {
-        const Message& message = default_entry_->GetReflection()->GetMessage(
-            *default_entry_, val_des);
-        Message* value = message.New();
-        map_val.SetValue(value);
-        break;
-      }
-    }
+    MapValueRef& map_val = map_[map_key];
+    AllocateMapValue(&map_val);
     val->CopyFrom(map_val);
     return true;
   }
@@ -202,6 +305,19 @@ bool DynamicMapField::InsertOrLookupMapValue(
   return false;
 }
 
+bool DynamicMapField::LookupMapValue(const MapKey& map_key,
+                                     MapValueConstRef* val) const {
+  const Map<MapKey, MapValueRef>& map = GetMap();
+  Map<MapKey, MapValueRef>::const_iterator iter = map.find(map_key);
+  if (iter == map.end()) {
+    return false;
+  }
+  // map_key is already in the map. Make sure (*map)[map_key] is not called.
+  // [] may reorder the map and iterators.
+  val->CopyFrom(iter->second);
+  return true;
+}
+
 bool DynamicMapField::DeleteMapValue(const MapKey& map_key) {
   MapFieldBase::SyncMapWithRepeatedField();
   Map<MapKey, MapValueRef>::iterator iter = map_.find(map_key);
@@ -210,7 +326,9 @@ bool DynamicMapField::DeleteMapValue(const MapKey& map_key) {
   }
   // Set map dirty only if the delete is successful.
   MapFieldBase::SetMapDirty();
-  iter->second.DeleteData();
+  if (MapFieldBase::arena_ == nullptr) {
+    iter->second.DeleteData();
+  }
   map_.erase(iter);
   return true;
 }
@@ -235,85 +353,155 @@ void DynamicMapField::SetMapIteratorValue(MapIterator* map_iter) const {
   map_iter->value_.CopyFrom(iter->second);
 }
 
-void DynamicMapField::SyncRepeatedFieldWithMapNoLock() const {
-  const Reflection* reflection = default_entry_->GetReflection();
-  const FieldDescriptor* key_des =
-      default_entry_->GetDescriptor()->FindFieldByName("key");
-  const FieldDescriptor* val_des =
-      default_entry_->GetDescriptor()->FindFieldByName("value");
-  if (MapFieldBase::repeated_field_ == NULL) {
-    if (MapFieldBase::arena_ == NULL) {
-      MapFieldBase::repeated_field_ = new RepeatedPtrField<Message>();
+void DynamicMapField::MergeFrom(const MapFieldBase& other) {
+  GOOGLE_DCHECK(IsMapValid() && other.IsMapValid());
+  Map<MapKey, MapValueRef>* map = MutableMap();
+  const DynamicMapField& other_field =
+      reinterpret_cast<const DynamicMapField&>(other);
+  for (Map<MapKey, MapValueRef>::const_iterator other_it =
+           other_field.map_.begin();
+       other_it != other_field.map_.end(); ++other_it) {
+    Map<MapKey, MapValueRef>::iterator iter = map->find(other_it->first);
+    MapValueRef* map_val;
+    if (iter == map->end()) {
+      map_val = &map_[other_it->first];
+      AllocateMapValue(map_val);
     } else {
-      MapFieldBase::repeated_field_ =
-          Arena::CreateMessage<RepeatedPtrField<Message> >(
-              MapFieldBase::arena_);
+      map_val = &iter->second;
+    }
+
+    // Copy map value
+    const FieldDescriptor* field_descriptor =
+        default_entry_->GetDescriptor()->map_value();
+    switch (field_descriptor->cpp_type()) {
+      case FieldDescriptor::CPPTYPE_INT32: {
+        map_val->SetInt32Value(other_it->second.GetInt32Value());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_INT64: {
+        map_val->SetInt64Value(other_it->second.GetInt64Value());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_UINT32: {
+        map_val->SetUInt32Value(other_it->second.GetUInt32Value());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_UINT64: {
+        map_val->SetUInt64Value(other_it->second.GetUInt64Value());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_FLOAT: {
+        map_val->SetFloatValue(other_it->second.GetFloatValue());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_DOUBLE: {
+        map_val->SetDoubleValue(other_it->second.GetDoubleValue());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_BOOL: {
+        map_val->SetBoolValue(other_it->second.GetBoolValue());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_STRING: {
+        map_val->SetStringValue(other_it->second.GetStringValue());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_ENUM: {
+        map_val->SetEnumValue(other_it->second.GetEnumValue());
+        break;
+      }
+      case FieldDescriptor::CPPTYPE_MESSAGE: {
+        map_val->MutableMessageValue()->CopyFrom(
+            other_it->second.GetMessageValue());
+        break;
+      }
     }
   }
+}
+
+void DynamicMapField::Swap(MapFieldBase* other) {
+  DynamicMapField* other_field = down_cast<DynamicMapField*>(other);
+  std::swap(this->MapFieldBase::repeated_field_, other_field->repeated_field_);
+  map_.swap(other_field->map_);
+  // a relaxed swap of the atomic
+  auto other_state = other_field->state_.load(std::memory_order_relaxed);
+  auto this_state = this->MapFieldBase::state_.load(std::memory_order_relaxed);
+  other_field->state_.store(this_state, std::memory_order_relaxed);
+  this->MapFieldBase::state_.store(other_state, std::memory_order_relaxed);
+}
+
+void DynamicMapField::SyncRepeatedFieldWithMapNoLock() const {
+  const Reflection* reflection = default_entry_->GetReflection();
+  const FieldDescriptor* key_des = default_entry_->GetDescriptor()->map_key();
+  const FieldDescriptor* val_des = default_entry_->GetDescriptor()->map_value();
+  if (MapFieldBase::repeated_field_ == nullptr) {
+    MapFieldBase::repeated_field_ =
+        Arena::CreateMessage<RepeatedPtrField<Message> >(MapFieldBase::arena_);
+  }
 
   MapFieldBase::repeated_field_->Clear();
 
   for (Map<MapKey, MapValueRef>::const_iterator it = map_.begin();
        it != map_.end(); ++it) {
-    Message* new_entry = default_entry_->New();
+    Message* new_entry = default_entry_->New(MapFieldBase::arena_);
     MapFieldBase::repeated_field_->AddAllocated(new_entry);
     const MapKey& map_key = it->first;
     switch (key_des->cpp_type()) {
-      case google::protobuf::FieldDescriptor::CPPTYPE_STRING:
+      case FieldDescriptor::CPPTYPE_STRING:
         reflection->SetString(new_entry, key_des, map_key.GetStringValue());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_INT64:
+      case FieldDescriptor::CPPTYPE_INT64:
         reflection->SetInt64(new_entry, key_des, map_key.GetInt64Value());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_INT32:
+      case FieldDescriptor::CPPTYPE_INT32:
         reflection->SetInt32(new_entry, key_des, map_key.GetInt32Value());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_UINT64:
+      case FieldDescriptor::CPPTYPE_UINT64:
         reflection->SetUInt64(new_entry, key_des, map_key.GetUInt64Value());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_UINT32:
+      case FieldDescriptor::CPPTYPE_UINT32:
         reflection->SetUInt32(new_entry, key_des, map_key.GetUInt32Value());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_BOOL:
+      case FieldDescriptor::CPPTYPE_BOOL:
         reflection->SetBool(new_entry, key_des, map_key.GetBoolValue());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
-      case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT:
-      case google::protobuf::FieldDescriptor::CPPTYPE_ENUM:
-      case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE:
+      case FieldDescriptor::CPPTYPE_DOUBLE:
+      case FieldDescriptor::CPPTYPE_FLOAT:
+      case FieldDescriptor::CPPTYPE_ENUM:
+      case FieldDescriptor::CPPTYPE_MESSAGE:
         GOOGLE_LOG(FATAL) << "Can't get here.";
         break;
     }
     const MapValueRef& map_val = it->second;
     switch (val_des->cpp_type()) {
-      case google::protobuf::FieldDescriptor::CPPTYPE_STRING:
+      case FieldDescriptor::CPPTYPE_STRING:
         reflection->SetString(new_entry, val_des, map_val.GetStringValue());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_INT64:
+      case FieldDescriptor::CPPTYPE_INT64:
         reflection->SetInt64(new_entry, val_des, map_val.GetInt64Value());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_INT32:
+      case FieldDescriptor::CPPTYPE_INT32:
         reflection->SetInt32(new_entry, val_des, map_val.GetInt32Value());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_UINT64:
+      case FieldDescriptor::CPPTYPE_UINT64:
         reflection->SetUInt64(new_entry, val_des, map_val.GetUInt64Value());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_UINT32:
+      case FieldDescriptor::CPPTYPE_UINT32:
         reflection->SetUInt32(new_entry, val_des, map_val.GetUInt32Value());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_BOOL:
+      case FieldDescriptor::CPPTYPE_BOOL:
         reflection->SetBool(new_entry, val_des, map_val.GetBoolValue());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
+      case FieldDescriptor::CPPTYPE_DOUBLE:
         reflection->SetDouble(new_entry, val_des, map_val.GetDoubleValue());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT:
+      case FieldDescriptor::CPPTYPE_FLOAT:
         reflection->SetFloat(new_entry, val_des, map_val.GetFloatValue());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_ENUM:
+      case FieldDescriptor::CPPTYPE_ENUM:
         reflection->SetEnumValue(new_entry, val_des, map_val.GetEnumValue());
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE: {
+      case FieldDescriptor::CPPTYPE_MESSAGE: {
         const Message& message = map_val.GetMessageValue();
         reflection->MutableMessage(new_entry, val_des)->CopyFrom(message);
         break;
@@ -325,77 +513,80 @@ void DynamicMapField::SyncRepeatedFieldWithMapNoLock() const {
 void DynamicMapField::SyncMapWithRepeatedFieldNoLock() const {
   Map<MapKey, MapValueRef>* map = &const_cast<DynamicMapField*>(this)->map_;
   const Reflection* reflection = default_entry_->GetReflection();
-  const FieldDescriptor* key_des =
-      default_entry_->GetDescriptor()->FindFieldByName("key");
-  const FieldDescriptor* val_des =
-      default_entry_->GetDescriptor()->FindFieldByName("value");
+  const FieldDescriptor* key_des = default_entry_->GetDescriptor()->map_key();
+  const FieldDescriptor* val_des = default_entry_->GetDescriptor()->map_value();
   // DynamicMapField owns map values. Need to delete them before clearing
   // the map.
-  for (Map<MapKey, MapValueRef>::iterator iter = map->begin();
-       iter != map->end(); ++iter) {
-    iter->second.DeleteData();
+  if (MapFieldBase::arena_ == nullptr) {
+    for (Map<MapKey, MapValueRef>::iterator iter = map->begin();
+         iter != map->end(); ++iter) {
+      iter->second.DeleteData();
+    }
   }
   map->clear();
   for (RepeatedPtrField<Message>::iterator it =
            MapFieldBase::repeated_field_->begin();
        it != MapFieldBase::repeated_field_->end(); ++it) {
+    // MapKey type will be set later.
     MapKey map_key;
     switch (key_des->cpp_type()) {
-      case google::protobuf::FieldDescriptor::CPPTYPE_STRING:
+      case FieldDescriptor::CPPTYPE_STRING:
         map_key.SetStringValue(reflection->GetString(*it, key_des));
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_INT64:
+      case FieldDescriptor::CPPTYPE_INT64:
         map_key.SetInt64Value(reflection->GetInt64(*it, key_des));
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_INT32:
+      case FieldDescriptor::CPPTYPE_INT32:
         map_key.SetInt32Value(reflection->GetInt32(*it, key_des));
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_UINT64:
+      case FieldDescriptor::CPPTYPE_UINT64:
         map_key.SetUInt64Value(reflection->GetUInt64(*it, key_des));
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_UINT32:
+      case FieldDescriptor::CPPTYPE_UINT32:
         map_key.SetUInt32Value(reflection->GetUInt32(*it, key_des));
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_BOOL:
+      case FieldDescriptor::CPPTYPE_BOOL:
         map_key.SetBoolValue(reflection->GetBool(*it, key_des));
         break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
-      case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT:
-      case google::protobuf::FieldDescriptor::CPPTYPE_ENUM:
-      case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE:
+      case FieldDescriptor::CPPTYPE_DOUBLE:
+      case FieldDescriptor::CPPTYPE_FLOAT:
+      case FieldDescriptor::CPPTYPE_ENUM:
+      case FieldDescriptor::CPPTYPE_MESSAGE:
         GOOGLE_LOG(FATAL) << "Can't get here.";
         break;
     }
 
-    // Remove existing map value with same key.
-    Map<MapKey, MapValueRef>::iterator iter = map->find(map_key);
-    if (iter != map->end()) {
-      iter->second.DeleteData();
+    if (MapFieldBase::arena_ == nullptr) {
+      // Remove existing map value with same key.
+      Map<MapKey, MapValueRef>::iterator iter = map->find(map_key);
+      if (iter != map->end()) {
+        iter->second.DeleteData();
+      }
     }
 
     MapValueRef& map_val = (*map)[map_key];
     map_val.SetType(val_des->cpp_type());
     switch (val_des->cpp_type()) {
-#define HANDLE_TYPE(CPPTYPE, TYPE, METHOD)                      \
-      case google::protobuf::FieldDescriptor::CPPTYPE_##CPPTYPE: {        \
-        TYPE * value = new TYPE;                                \
-        *value = reflection->Get##METHOD(*it, val_des);         \
-            map_val.SetValue(value);                            \
-            break;                                              \
-      }
-      HANDLE_TYPE(INT32, int32, Int32);
-      HANDLE_TYPE(INT64, int64, Int64);
-      HANDLE_TYPE(UINT32, uint32, UInt32);
-      HANDLE_TYPE(UINT64, uint64, UInt64);
+#define HANDLE_TYPE(CPPTYPE, TYPE, METHOD)                   \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE: {                 \
+    TYPE* value = Arena::Create<TYPE>(MapFieldBase::arena_); \
+    *value = reflection->Get##METHOD(*it, val_des);          \
+    map_val.SetValue(value);                                 \
+    break;                                                   \
+  }
+      HANDLE_TYPE(INT32, int32_t, Int32);
+      HANDLE_TYPE(INT64, int64_t, Int64);
+      HANDLE_TYPE(UINT32, uint32_t, UInt32);
+      HANDLE_TYPE(UINT64, uint64_t, UInt64);
       HANDLE_TYPE(DOUBLE, double, Double);
       HANDLE_TYPE(FLOAT, float, Float);
       HANDLE_TYPE(BOOL, bool, Bool);
-      HANDLE_TYPE(STRING, string, String);
-      HANDLE_TYPE(ENUM, int32, EnumValue);
+      HANDLE_TYPE(STRING, std::string, String);
+      HANDLE_TYPE(ENUM, int32_t, EnumValue);
 #undef HANDLE_TYPE
-      case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE: {
+      case FieldDescriptor::CPPTYPE_MESSAGE: {
         const Message& message = reflection->GetMessage(*it, val_des);
-        Message* value = message.New();
+        Message* value = message.New(MapFieldBase::arena_);
         value->CopyFrom(message);
         map_val.SetValue(value);
         break;
@@ -406,7 +597,7 @@ void DynamicMapField::SyncMapWithRepeatedFieldNoLock() const {
 
 size_t DynamicMapField::SpaceUsedExcludingSelfNoLock() const {
   size_t size = 0;
-  if (MapFieldBase::repeated_field_ != NULL) {
+  if (MapFieldBase::repeated_field_ != nullptr) {
     size += MapFieldBase::repeated_field_->SpaceUsedExcludingSelfLong();
   }
   size += sizeof(map_);
@@ -416,27 +607,27 @@ size_t DynamicMapField::SpaceUsedExcludingSelfNoLock() const {
     size += sizeof(it->first) * map_size;
     size += sizeof(it->second) * map_size;
     // If key is string, add the allocated space.
-    if (it->first.type() == google::protobuf::FieldDescriptor::CPPTYPE_STRING) {
-      size += sizeof(string) * map_size;
+    if (it->first.type() == FieldDescriptor::CPPTYPE_STRING) {
+      size += sizeof(std::string) * map_size;
     }
     // Add the allocated space in MapValueRef.
     switch (it->second.type()) {
-#define HANDLE_TYPE(CPPTYPE, TYPE)                              \
-      case google::protobuf::FieldDescriptor::CPPTYPE_##CPPTYPE: {        \
-        size += sizeof(TYPE) * map_size;                        \
-        break;                                                  \
-      }
-      HANDLE_TYPE(INT32, int32);
-      HANDLE_TYPE(INT64, int64);
-      HANDLE_TYPE(UINT32, uint32);
-      HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(CPPTYPE, TYPE)           \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE: { \
+    size += sizeof(TYPE) * map_size;         \
+    break;                                   \
+  }
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
       HANDLE_TYPE(DOUBLE, double);
       HANDLE_TYPE(FLOAT, float);
       HANDLE_TYPE(BOOL, bool);
-      HANDLE_TYPE(STRING, string);
-      HANDLE_TYPE(ENUM, int32);
+      HANDLE_TYPE(STRING, std::string);
+      HANDLE_TYPE(ENUM, int32_t);
 #undef HANDLE_TYPE
-      case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE: {
+      case FieldDescriptor::CPPTYPE_MESSAGE: {
         while (it != map_.end()) {
           const Message& message = it->second.GetMessageValue();
           size += message.GetReflection()->SpaceUsedLong(message);
@@ -452,3 +643,5 @@ size_t DynamicMapField::SpaceUsedExcludingSelfNoLock() const {
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 6c75a6d..c87d44e 100644 (file)
 #ifndef GOOGLE_PROTOBUF_MAP_FIELD_H__
 #define GOOGLE_PROTOBUF_MAP_FIELD_H__
 
-#include <google/protobuf/stubs/atomicops.h>
-#include <google/protobuf/stubs/mutex.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/generated_message_reflection.h>
+#include <atomic>
+#include <functional>
+
 #include <google/protobuf/arena.h>
 #include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/generated_message_util.h>
 #include <google/protobuf/map_entry.h>
 #include <google/protobuf/map_field_lite.h>
 #include <google/protobuf/map_type_handler.h>
 #include <google/protobuf/message.h>
+#include <google/protobuf/stubs/mutex.h>
+#include <google/protobuf/port.h>
 #include <google/protobuf/repeated_field.h>
 #include <google/protobuf/unknown_field_set.h>
 
 
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
 namespace google {
 namespace protobuf {
 class DynamicMessage;
-class MapKey;
+class MapIterator;
+
+#define TYPE_CHECK(EXPECTEDTYPE, METHOD)                                   \
+  if (type() != EXPECTEDTYPE) {                                            \
+    GOOGLE_LOG(FATAL) << "Protocol Buffer map usage error:\n"                     \
+               << METHOD << " type does not match\n"                       \
+               << "  Expected : "                                          \
+               << FieldDescriptor::CppTypeName(EXPECTEDTYPE) << "\n"       \
+               << "  Actual   : " << FieldDescriptor::CppTypeName(type()); \
+  }
+
+// MapKey is an union type for representing any possible
+// map key.
+class PROTOBUF_EXPORT MapKey {
+ public:
+  MapKey() : type_() {}
+  MapKey(const MapKey& other) : type_() { CopyFrom(other); }
+
+  MapKey& operator=(const MapKey& other) {
+    CopyFrom(other);
+    return *this;
+  }
+
+  ~MapKey() {
+    if (type_ == FieldDescriptor::CPPTYPE_STRING) {
+      val_.string_value_.Destruct();
+    }
+  }
+
+  FieldDescriptor::CppType type() const {
+    if (type_ == FieldDescriptor::CppType()) {
+      GOOGLE_LOG(FATAL) << "Protocol Buffer map usage error:\n"
+                 << "MapKey::type MapKey is not initialized. "
+                 << "Call set methods to initialize MapKey.";
+    }
+    return type_;
+  }
+
+  void SetInt64Value(int64_t value) {
+    SetType(FieldDescriptor::CPPTYPE_INT64);
+    val_.int64_value_ = value;
+  }
+  void SetUInt64Value(uint64_t value) {
+    SetType(FieldDescriptor::CPPTYPE_UINT64);
+    val_.uint64_value_ = value;
+  }
+  void SetInt32Value(int32_t value) {
+    SetType(FieldDescriptor::CPPTYPE_INT32);
+    val_.int32_value_ = value;
+  }
+  void SetUInt32Value(uint32_t value) {
+    SetType(FieldDescriptor::CPPTYPE_UINT32);
+    val_.uint32_value_ = value;
+  }
+  void SetBoolValue(bool value) {
+    SetType(FieldDescriptor::CPPTYPE_BOOL);
+    val_.bool_value_ = value;
+  }
+  void SetStringValue(std::string val) {
+    SetType(FieldDescriptor::CPPTYPE_STRING);
+    *val_.string_value_.get_mutable() = std::move(val);
+  }
+
+  int64_t GetInt64Value() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT64, "MapKey::GetInt64Value");
+    return val_.int64_value_;
+  }
+  uint64_t GetUInt64Value() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT64, "MapKey::GetUInt64Value");
+    return val_.uint64_value_;
+  }
+  int32_t GetInt32Value() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT32, "MapKey::GetInt32Value");
+    return val_.int32_value_;
+  }
+  uint32_t GetUInt32Value() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT32, "MapKey::GetUInt32Value");
+    return val_.uint32_value_;
+  }
+  bool GetBoolValue() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL, "MapKey::GetBoolValue");
+    return val_.bool_value_;
+  }
+  const std::string& GetStringValue() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_STRING, "MapKey::GetStringValue");
+    return val_.string_value_.get();
+  }
+
+  bool operator<(const MapKey& other) const {
+    if (type_ != other.type_) {
+      // We could define a total order that handles this case, but
+      // there currently no need.  So, for now, fail.
+      GOOGLE_LOG(FATAL) << "Unsupported: type mismatch";
+    }
+    switch (type()) {
+      case FieldDescriptor::CPPTYPE_DOUBLE:
+      case FieldDescriptor::CPPTYPE_FLOAT:
+      case FieldDescriptor::CPPTYPE_ENUM:
+      case FieldDescriptor::CPPTYPE_MESSAGE:
+        GOOGLE_LOG(FATAL) << "Unsupported";
+        return false;
+      case FieldDescriptor::CPPTYPE_STRING:
+        return val_.string_value_.get() < other.val_.string_value_.get();
+      case FieldDescriptor::CPPTYPE_INT64:
+        return val_.int64_value_ < other.val_.int64_value_;
+      case FieldDescriptor::CPPTYPE_INT32:
+        return val_.int32_value_ < other.val_.int32_value_;
+      case FieldDescriptor::CPPTYPE_UINT64:
+        return val_.uint64_value_ < other.val_.uint64_value_;
+      case FieldDescriptor::CPPTYPE_UINT32:
+        return val_.uint32_value_ < other.val_.uint32_value_;
+      case FieldDescriptor::CPPTYPE_BOOL:
+        return val_.bool_value_ < other.val_.bool_value_;
+    }
+    return false;
+  }
+
+  bool operator==(const MapKey& other) const {
+    if (type_ != other.type_) {
+      // To be consistent with operator<, we don't allow this either.
+      GOOGLE_LOG(FATAL) << "Unsupported: type mismatch";
+    }
+    switch (type()) {
+      case FieldDescriptor::CPPTYPE_DOUBLE:
+      case FieldDescriptor::CPPTYPE_FLOAT:
+      case FieldDescriptor::CPPTYPE_ENUM:
+      case FieldDescriptor::CPPTYPE_MESSAGE:
+        GOOGLE_LOG(FATAL) << "Unsupported";
+        break;
+      case FieldDescriptor::CPPTYPE_STRING:
+        return val_.string_value_.get() == other.val_.string_value_.get();
+      case FieldDescriptor::CPPTYPE_INT64:
+        return val_.int64_value_ == other.val_.int64_value_;
+      case FieldDescriptor::CPPTYPE_INT32:
+        return val_.int32_value_ == other.val_.int32_value_;
+      case FieldDescriptor::CPPTYPE_UINT64:
+        return val_.uint64_value_ == other.val_.uint64_value_;
+      case FieldDescriptor::CPPTYPE_UINT32:
+        return val_.uint32_value_ == other.val_.uint32_value_;
+      case FieldDescriptor::CPPTYPE_BOOL:
+        return val_.bool_value_ == other.val_.bool_value_;
+    }
+    GOOGLE_LOG(FATAL) << "Can't get here.";
+    return false;
+  }
+
+  void CopyFrom(const MapKey& other) {
+    SetType(other.type());
+    switch (type_) {
+      case FieldDescriptor::CPPTYPE_DOUBLE:
+      case FieldDescriptor::CPPTYPE_FLOAT:
+      case FieldDescriptor::CPPTYPE_ENUM:
+      case FieldDescriptor::CPPTYPE_MESSAGE:
+        GOOGLE_LOG(FATAL) << "Unsupported";
+        break;
+      case FieldDescriptor::CPPTYPE_STRING:
+        *val_.string_value_.get_mutable() = other.val_.string_value_.get();
+        break;
+      case FieldDescriptor::CPPTYPE_INT64:
+        val_.int64_value_ = other.val_.int64_value_;
+        break;
+      case FieldDescriptor::CPPTYPE_INT32:
+        val_.int32_value_ = other.val_.int32_value_;
+        break;
+      case FieldDescriptor::CPPTYPE_UINT64:
+        val_.uint64_value_ = other.val_.uint64_value_;
+        break;
+      case FieldDescriptor::CPPTYPE_UINT32:
+        val_.uint32_value_ = other.val_.uint32_value_;
+        break;
+      case FieldDescriptor::CPPTYPE_BOOL:
+        val_.bool_value_ = other.val_.bool_value_;
+        break;
+    }
+  }
+
+ private:
+  template <typename K, typename V>
+  friend class internal::TypeDefinedMapFieldBase;
+  friend class ::PROTOBUF_NAMESPACE_ID::MapIterator;
+  friend class internal::DynamicMapField;
+
+  union KeyValue {
+    KeyValue() {}
+    internal::ExplicitlyConstructed<std::string> string_value_;
+    int64_t int64_value_;
+    int32_t int32_value_;
+    uint64_t uint64_value_;
+    uint32_t uint32_value_;
+    bool bool_value_;
+  } val_;
+
+  void SetType(FieldDescriptor::CppType type) {
+    if (type_ == type) return;
+    if (type_ == FieldDescriptor::CPPTYPE_STRING) {
+      val_.string_value_.Destruct();
+    }
+    type_ = type;
+    if (type_ == FieldDescriptor::CPPTYPE_STRING) {
+      val_.string_value_.DefaultConstruct();
+    }
+  }
+
+  // type_ is 0 or a valid FieldDescriptor::CppType.
+  // Use "CppType()" to indicate zero.
+  FieldDescriptor::CppType type_;
+};
+
+}  // namespace protobuf
+}  // namespace google
+namespace std {
+template <>
+struct hash<::PROTOBUF_NAMESPACE_ID::MapKey> {
+  size_t operator()(const ::PROTOBUF_NAMESPACE_ID::MapKey& map_key) const {
+    switch (map_key.type()) {
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_DOUBLE:
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_FLOAT:
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_ENUM:
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_MESSAGE:
+        GOOGLE_LOG(FATAL) << "Unsupported";
+        break;
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_STRING:
+        return hash<std::string>()(map_key.GetStringValue());
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_INT64: {
+        auto value = map_key.GetInt64Value();
+        return hash<decltype(value)>()(value);
+      }
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_INT32: {
+        auto value = map_key.GetInt32Value();
+        return hash<decltype(value)>()(map_key.GetInt32Value());
+      }
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_UINT64: {
+        auto value = map_key.GetUInt64Value();
+        return hash<decltype(value)>()(map_key.GetUInt64Value());
+      }
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_UINT32: {
+        auto value = map_key.GetUInt32Value();
+        return hash<decltype(value)>()(map_key.GetUInt32Value());
+      }
+      case ::PROTOBUF_NAMESPACE_ID::FieldDescriptor::CPPTYPE_BOOL: {
+        return hash<bool>()(map_key.GetBoolValue());
+      }
+    }
+    GOOGLE_LOG(FATAL) << "Can't get here.";
+    return 0;
+  }
+  bool operator()(const ::PROTOBUF_NAMESPACE_ID::MapKey& map_key1,
+                  const ::PROTOBUF_NAMESPACE_ID::MapKey& map_key2) const {
+    return map_key1 < map_key2;
+  }
+};
+}  // namespace std
+
+namespace google {
+namespace protobuf {
 namespace internal {
 
 class ContendedMapCleanTest;
@@ -57,25 +320,27 @@ class MapFieldAccessor;
 
 // This class provides access to map field using reflection, which is the same
 // as those provided for RepeatedPtrField<Message>. It is used for internal
-// reflection implentation only. Users should never use this directly.
-class LIBPROTOBUF_EXPORT MapFieldBase {
+// reflection implementation only. Users should never use this directly.
+class PROTOBUF_EXPORT MapFieldBase {
  public:
   MapFieldBase()
-      : arena_(NULL),
-        repeated_field_(NULL),
+      : arena_(nullptr), repeated_field_(nullptr), state_(STATE_MODIFIED_MAP) {}
+
+  // This constructor is for constant initialized global instances.
+  // It uses a linker initialized mutex, so it is not compatible with regular
+  // runtime instances.
+  // Except in MSVC, where we can't have a constinit mutex.
+  explicit constexpr MapFieldBase(ConstantInitialized)
+      : arena_(nullptr),
+        repeated_field_(nullptr),
+        mutex_(GOOGLE_PROTOBUF_LINKER_INITIALIZED),
         state_(STATE_MODIFIED_MAP) {}
   explicit MapFieldBase(Arena* arena)
-      : arena_(arena),
-        repeated_field_(NULL),
-        state_(STATE_MODIFIED_MAP) {
-    // Mutex's destructor needs to be called explicitly to release resources
-    // acquired in its constructor.
-    arena->OwnDestructor(&mutex_);
-  }
+      : arena_(arena), repeated_field_(nullptr), state_(STATE_MODIFIED_MAP) {}
   virtual ~MapFieldBase();
 
   // Returns reference to internal repeated field. Data written using
-  // google::protobuf::Map's api prior to calling this function is guarantted to be
+  // Map's api prior to calling this function is guarantted to be
   // included in repeated field.
   const RepeatedPtrFieldBase& GetRepeatedField() const;
 
@@ -84,8 +349,14 @@ class LIBPROTOBUF_EXPORT MapFieldBase {
 
   // Pure virtual map APIs for Map Reflection.
   virtual bool ContainsMapKey(const MapKey& map_key) const = 0;
-  virtual bool InsertOrLookupMapValue(
-      const MapKey& map_key, MapValueRef* val) = 0;
+  virtual bool InsertOrLookupMapValue(const MapKey& map_key,
+                                      MapValueRef* val) = 0;
+  virtual bool LookupMapValue(const MapKey& map_key,
+                              MapValueConstRef* val) const = 0;
+  bool LookupMapValue(const MapKey&, MapValueRef*) const = delete;
+
+  // Returns whether changes to the map are reflected in the repeated field.
+  bool IsRepeatedFieldValid() const;
   // Insures operations after won't get executed before calling this.
   bool IsMapValid() const;
   virtual bool DeleteMapValue(const MapKey& map_key) = 0;
@@ -93,8 +364,12 @@ class LIBPROTOBUF_EXPORT MapFieldBase {
                              const MapIterator& b) const = 0;
   virtual void MapBegin(MapIterator* map_iter) const = 0;
   virtual void MapEnd(MapIterator* map_iter) const = 0;
+  virtual void MergeFrom(const MapFieldBase& other) = 0;
+  virtual void Swap(MapFieldBase* other);
+  virtual void UnsafeShallowSwap(MapFieldBase* other);
   // Sync Map with repeated field and returns the size of map.
   virtual int size() const = 0;
+  virtual void Clear() = 0;
 
   // Returns the number of bytes used by the repeated field, excluding
   // sizeof(*this)
@@ -121,40 +396,61 @@ class LIBPROTOBUF_EXPORT MapFieldBase {
   // Tells MapFieldBase that there is new change to Map.
   void SetMapDirty();
 
-  // Tells MapFieldBase that there is new change to RepeatedPTrField.
+  // Tells MapFieldBase that there is new change to RepeatedPtrField.
   void SetRepeatedDirty();
 
   // Provides derived class the access to repeated field.
   void* MutableRepeatedPtrField() const;
 
+  void InternalSwap(MapFieldBase* other);
+
+  // Support thread sanitizer (tsan) by making const / mutable races
+  // more apparent.  If one thread calls MutableAccess() while another
+  // thread calls either ConstAccess() or MutableAccess(), on the same
+  // MapFieldBase-derived object, and there is no synchronization going
+  // on between them, tsan will alert.
+#if defined(__SANITIZE_THREAD__) || defined(THREAD_SANITIZER)
+  void ConstAccess() const { GOOGLE_CHECK_EQ(seq1_, seq2_); }
+  void MutableAccess() {
+    if (seq1_ & 1) {
+      seq2_ = ++seq1_;
+    } else {
+      seq1_ = ++seq2_;
+    }
+  }
+  unsigned int seq1_ = 0, seq2_ = 0;
+#else
+  void ConstAccess() const {}
+  void MutableAccess() {}
+#endif
   enum State {
     STATE_MODIFIED_MAP = 0,       // map has newly added data that has not been
                                   // synchronized to repeated field
     STATE_MODIFIED_REPEATED = 1,  // repeated field has newly added data that
                                   // has not been synchronized to map
-    CLEAN = 2,  // data in map and repeated field are same
+    CLEAN = 2,                    // data in map and repeated field are same
   };
 
   Arena* arena_;
   mutable RepeatedPtrField<Message>* repeated_field_;
 
-  mutable Mutex mutex_;  // The thread to synchronize map and repeated field
-                         // needs to get lock first;
-  mutable volatile Atomic32 state_;  // 0: STATE_MODIFIED_MAP
-                                     // 1: STATE_MODIFIED_REPEATED
-                                     // 2: CLEAN
+  mutable internal::WrappedMutex
+      mutex_;  // The thread to synchronize map and repeated field
+               // needs to get lock first;
+  mutable std::atomic<State> state_;
 
  private:
   friend class ContendedMapCleanTest;
   friend class GeneratedMessageReflection;
   friend class MapFieldAccessor;
-  friend class ::google::protobuf::DynamicMessage;
+  friend class ::PROTOBUF_NAMESPACE_ID::Reflection;
+  friend class ::PROTOBUF_NAMESPACE_ID::DynamicMessage;
 
   // Virtual helper methods for MapIterator. MapIterator doesn't have the
   // type helper for key and value. Call these help methods to deal with
   // different types. Real helper methods are implemented in
   // TypeDefinedMapFieldBase.
-  friend class ::google::protobuf::MapIterator;
+  friend class ::PROTOBUF_NAMESPACE_ID::MapIterator;
   // Allocate map<...>::iterator for MapIterator.
   virtual void InitializeIterator(MapIterator* map_iter) const = 0;
 
@@ -170,20 +466,30 @@ class LIBPROTOBUF_EXPORT MapFieldBase {
   // IncreaseIterator() is called by operator++() of MapIterator only.
   // It implements the ++ operator of MapIterator.
   virtual void IncreaseIterator(MapIterator* map_iter) const = 0;
+
+  // Swaps state_ with another MapFieldBase
+  void SwapState(MapFieldBase* other);
+
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapFieldBase);
 };
 
 // This class provides common Map Reflection implementations for generated
 // message and dynamic message.
-template<typename Key, typename T>
+template <typename Key, typename T>
 class TypeDefinedMapFieldBase : public MapFieldBase {
  public:
   TypeDefinedMapFieldBase() {}
+
+  // This constructor is for constant initialized global instances.
+  // It uses a linker initialized mutex, so it is not compatible with regular
+  // runtime instances.
+  explicit constexpr TypeDefinedMapFieldBase(ConstantInitialized tag)
+      : MapFieldBase(tag) {}
   explicit TypeDefinedMapFieldBase(Arena* arena) : MapFieldBase(arena) {}
-  ~TypeDefinedMapFieldBase() {}
-  void MapBegin(MapIterator* map_iter) const;
-  void MapEnd(MapIterator* map_iter) const;
-  bool EqualIterator(const MapIterator& a, const MapIterator& b) const;
+  ~TypeDefinedMapFieldBase() override {}
+  void MapBegin(MapIterator* map_iter) const override;
+  void MapEnd(MapIterator* map_iter) const override;
+  bool EqualIterator(const MapIterator& a, const MapIterator& b) const override;
 
   virtual const Map<Key, T>& GetMap() const = 0;
   virtual Map<Key, T>* MutableMap() = 0;
@@ -193,22 +499,22 @@ class TypeDefinedMapFieldBase : public MapFieldBase {
       const MapIterator* map_iter) const;
 
  private:
-  void InitializeIterator(MapIterator* map_iter) const;
-  void DeleteIterator(MapIterator* map_iter) const;
+  void InitializeIterator(MapIterator* map_iter) const override;
+  void DeleteIterator(MapIterator* map_iter) const override;
   void CopyIterator(MapIterator* this_iteratorm,
-                    const MapIterator& that_iterator) const;
-  void IncreaseIterator(MapIterator* map_iter) const;
+                    const MapIterator& that_iterator) const override;
+  void IncreaseIterator(MapIterator* map_iter) const override;
 
   virtual void SetMapIteratorValue(MapIterator* map_iter) const = 0;
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeDefinedMapFieldBase);
 };
 
 // This class provides access to map field using generated api. It is used for
-// internal generated message implentation only. Users should never use this
+// internal generated message implementation only. Users should never use this
 // directly.
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value = 0>
+          WireFormatLite::FieldType kValueFieldType>
 class MapField : public TypeDefinedMapFieldBase<Key, T> {
   // Provide utilities to parse/serialize key/value.  Provide utilities to
   // manipulate internal stored type.
@@ -217,20 +523,16 @@ class MapField : public TypeDefinedMapFieldBase<Key, T> {
 
   // Define message type for internal repeated field.
   typedef Derived EntryType;
-  typedef MapEntryLite<Derived, Key, T, kKeyFieldType, kValueFieldType,
-                       default_enum_value>
-      EntryLiteType;
 
   // Define abbreviation for parent MapFieldLite
-  typedef MapFieldLite<Derived, Key, T, kKeyFieldType, kValueFieldType,
-                       default_enum_value>
+  typedef MapFieldLite<Derived, Key, T, kKeyFieldType, kValueFieldType>
       MapFieldLiteType;
 
   // Enum needs to be handled differently from other types because it has
-  // different exposed type in google::protobuf::Map's api and repeated field's api. For
+  // different exposed type in Map's api and repeated field's api. For
   // details see the comment in the implementation of
   // SyncMapWithRepeatedFieldNoLock.
-  static const bool kIsValueEnum = ValueTypeHandler::kIsEnum;
+  static constexpr bool kIsValueEnum = ValueTypeHandler::kIsEnum;
   typedef typename MapIf<kIsValueEnum, T, const T&>::type CastValueType;
 
  public:
@@ -238,46 +540,67 @@ class MapField : public TypeDefinedMapFieldBase<Key, T> {
   typedef Map<Key, T> MapType;
 
   MapField() {}
+
+  // This constructor is for constant initialized global instances.
+  // It uses a linker initialized mutex, so it is not compatible with regular
+  // runtime instances.
+  explicit constexpr MapField(ConstantInitialized tag)
+      : TypeDefinedMapFieldBase<Key, T>(tag), impl_() {}
   explicit MapField(Arena* arena)
       : TypeDefinedMapFieldBase<Key, T>(arena), impl_(arena) {}
 
   // Implement MapFieldBase
-  bool ContainsMapKey(const MapKey& map_key) const;
-  bool InsertOrLookupMapValue(const MapKey& map_key, MapValueRef* val);
-  bool DeleteMapValue(const MapKey& map_key);
-
-  const Map<Key, T>& GetMap() const {
+  bool ContainsMapKey(const MapKey& map_key) const override;
+  bool InsertOrLookupMapValue(const MapKey& map_key, MapValueRef* val) override;
+  bool LookupMapValue(const MapKey& map_key,
+                      MapValueConstRef* val) const override;
+  bool LookupMapValue(const MapKey&, MapValueRef*) const = delete;
+  bool DeleteMapValue(const MapKey& map_key) override;
+
+  const Map<Key, T>& GetMap() const override {
     MapFieldBase::SyncMapWithRepeatedField();
     return impl_.GetMap();
   }
 
-  Map<Key, T>* MutableMap() {
+  Map<Key, T>* MutableMap() override {
     MapFieldBase::SyncMapWithRepeatedField();
     Map<Key, T>* result = impl_.MutableMap();
     MapFieldBase::SetMapDirty();
     return result;
   }
 
-  // Convenient methods for generated message implementation.
-  int size() const;
-  void Clear();
-  void MergeFrom(const MapField& other);
-  void Swap(MapField* other);
+  int size() const override;
+  void Clear() override;
+  void MergeFrom(const MapFieldBase& other) override;
+  void Swap(MapFieldBase* other) override;
+  void UnsafeShallowSwap(MapFieldBase* other) override;
+  void InternalSwap(MapField* other);
 
   // Used in the implementation of parsing. Caller should take the ownership iff
-  // arena_ is NULL.
+  // arena_ is nullptr.
   EntryType* NewEntry() const { return impl_.NewEntry(); }
   // Used in the implementation of serializing enum value type. Caller should
-  // take the ownership iff arena_ is NULL.
+  // take the ownership iff arena_ is nullptr.
   EntryType* NewEnumEntryWrapper(const Key& key, const T t) const {
     return impl_.NewEnumEntryWrapper(key, t);
   }
   // Used in the implementation of serializing other value types. Caller should
-  // take the ownership iff arena_ is NULL.
+  // take the ownership iff arena_ is nullptr.
   EntryType* NewEntryWrapper(const Key& key, const T& t) const {
     return impl_.NewEntryWrapper(key, t);
   }
 
+  const char* _InternalParse(const char* ptr, ParseContext* ctx) {
+    return impl_._InternalParse(ptr, ctx);
+  }
+  template <typename UnknownType>
+  const char* ParseWithEnumValidation(const char* ptr, ParseContext* ctx,
+                                      bool (*is_valid)(int), uint32_t field_num,
+                                      InternalMetadata* metadata) {
+    return impl_.template ParseWithEnumValidation<UnknownType>(
+        ptr, ctx, is_valid, field_num, metadata);
+  }
+
  private:
   MapFieldLiteType impl_;
 
@@ -285,377 +608,214 @@ class MapField : public TypeDefinedMapFieldBase<Key, T> {
   typedef void DestructorSkippable_;
 
   // Implements MapFieldBase
-  void SyncRepeatedFieldWithMapNoLock() const;
-  void SyncMapWithRepeatedFieldNoLock() const;
-  size_t SpaceUsedExcludingSelfNoLock() const;
+  void SyncRepeatedFieldWithMapNoLock() const override;
+  void SyncMapWithRepeatedFieldNoLock() const override;
+  size_t SpaceUsedExcludingSelfNoLock() const override;
 
-  void SetMapIteratorValue(MapIterator* map_iter) const;
+  void SetMapIteratorValue(MapIterator* map_iter) const override;
 
-  friend class ::google::protobuf::Arena;
+  friend class ::PROTOBUF_NAMESPACE_ID::Arena;
   friend class MapFieldStateTest;  // For testing, it needs raw access to impl_
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapField);
 };
 
+template <typename Derived, typename Key, typename T,
+          WireFormatLite::FieldType key_wire_type,
+          WireFormatLite::FieldType value_wire_type>
+bool AllAreInitialized(
+    const MapField<Derived, Key, T, key_wire_type, value_wire_type>& field) {
+  const auto& t = field.GetMap();
+  for (typename Map<Key, T>::const_iterator it = t.begin(); it != t.end();
+       ++it) {
+    if (!it->second.IsInitialized()) return false;
+  }
+  return true;
+}
+
 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;
+          WireFormatLite::FieldType kValueFieldType>
+struct MapEntryToMapField<
+    MapEntry<T, Key, Value, kKeyFieldType, kValueFieldType>> {
+  typedef MapField<T, Key, Value, kKeyFieldType, kValueFieldType> MapFieldType;
 };
 
-class LIBPROTOBUF_EXPORT DynamicMapField: public TypeDefinedMapFieldBase<MapKey, MapValueRef> {
+class PROTOBUF_EXPORT DynamicMapField
+    : public TypeDefinedMapFieldBase<MapKey, MapValueRef> {
  public:
   explicit DynamicMapField(const Message* default_entry);
   DynamicMapField(const Message* default_entry, Arena* arena);
-  ~DynamicMapField();
+  ~DynamicMapField() override;
 
   // Implement MapFieldBase
-  bool ContainsMapKey(const MapKey& map_key) const;
-  bool InsertOrLookupMapValue(const MapKey& map_key, MapValueRef* val);
-  bool DeleteMapValue(const MapKey& map_key);
-
-  const Map<MapKey, MapValueRef>& GetMap() const;
-  Map<MapKey, MapValueRef>* MutableMap();
-
-  int size() const;
+  bool ContainsMapKey(const MapKey& map_key) const override;
+  bool InsertOrLookupMapValue(const MapKey& map_key, MapValueRef* val) override;
+  bool LookupMapValue(const MapKey& map_key,
+                      MapValueConstRef* val) const override;
+  bool LookupMapValue(const MapKey&, MapValueRef*) const = delete;
+  bool DeleteMapValue(const MapKey& map_key) override;
+  void MergeFrom(const MapFieldBase& other) override;
+  void Swap(MapFieldBase* other) override;
+  void UnsafeShallowSwap(MapFieldBase* other) override { Swap(other); }
+
+  const Map<MapKey, MapValueRef>& GetMap() const override;
+  Map<MapKey, MapValueRef>* MutableMap() override;
+
+  int size() const override;
+  void Clear() override;
 
  private:
   Map<MapKey, MapValueRef> map_;
   const Message* default_entry_;
 
+  void AllocateMapValue(MapValueRef* map_val);
+
   // Implements MapFieldBase
-  void SyncRepeatedFieldWithMapNoLock() const;
-  void SyncMapWithRepeatedFieldNoLock() const;
-  size_t SpaceUsedExcludingSelfNoLock() const;
-  void SetMapIteratorValue(MapIterator* map_iter) const;
+  void SyncRepeatedFieldWithMapNoLock() const override;
+  void SyncMapWithRepeatedFieldNoLock() const override;
+  size_t SpaceUsedExcludingSelfNoLock() const override;
+  void SetMapIteratorValue(MapIterator* map_iter) const override;
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMapField);
 };
 
 }  // namespace internal
 
-#define TYPE_CHECK(EXPECTEDTYPE, METHOD)                        \
-  if (type() != EXPECTEDTYPE) {                                 \
-    GOOGLE_LOG(FATAL)                                                  \
-        << "Protocol Buffer map usage error:\n"                 \
-        << METHOD << " type does not match\n"                   \
-        << "  Expected : "                                      \
-        << FieldDescriptor::CppTypeName(EXPECTEDTYPE) << "\n"   \
-        << "  Actual   : "                                      \
-        << FieldDescriptor::CppTypeName(type());                \
-  }
-
-// MapKey is an union type for representing any possible
-// map key.
-class LIBPROTOBUF_EXPORT MapKey {
+// MapValueConstRef points to a map value. Users can NOT modify
+// the map value.
+class PROTOBUF_EXPORT MapValueConstRef {
  public:
-  MapKey() : type_(0) {
-  }
-  MapKey(const MapKey& other) : type_(0) {
-    CopyFrom(other);
-  }
-  MapKey& operator=(const MapKey& other) {
-    CopyFrom(other);
-    return *this;
-  }
+  MapValueConstRef() : data_(nullptr), type_() {}
 
-  ~MapKey() {
-    if (type_ == FieldDescriptor::CPPTYPE_STRING) {
-      delete val_.string_value_;
-    }
-  }
-
-  FieldDescriptor::CppType type() const {
-    if (type_ == 0) {
-      GOOGLE_LOG(FATAL)
-          << "Protocol Buffer map usage error:\n"
-          << "MapKey::type MapKey is not initialized. "
-          << "Call set methods to initialize MapKey.";
-    }
-    return (FieldDescriptor::CppType)type_;
-  }
-
-  void SetInt64Value(int64 value) {
-    SetType(FieldDescriptor::CPPTYPE_INT64);
-    val_.int64_value_ = value;
-  }
-  void SetUInt64Value(uint64 value) {
-    SetType(FieldDescriptor::CPPTYPE_UINT64);
-    val_.uint64_value_ = value;
-  }
-  void SetInt32Value(int32 value) {
-    SetType(FieldDescriptor::CPPTYPE_INT32);
-    val_.int32_value_ = value;
-  }
-  void SetUInt32Value(uint32 value) {
-    SetType(FieldDescriptor::CPPTYPE_UINT32);
-    val_.uint32_value_ = value;
-  }
-  void SetBoolValue(bool value) {
-    SetType(FieldDescriptor::CPPTYPE_BOOL);
-    val_.bool_value_ = value;
-  }
-  void SetStringValue(const string& val) {
-    SetType(FieldDescriptor::CPPTYPE_STRING);
-    *val_.string_value_ = val;
-  }
-
-  int64 GetInt64Value() const {
+  int64_t GetInt64Value() const {
     TYPE_CHECK(FieldDescriptor::CPPTYPE_INT64,
-               "MapKey::GetInt64Value");
-    return val_.int64_value_;
+               "MapValueConstRef::GetInt64Value");
+    return *reinterpret_cast<int64_t*>(data_);
   }
-  uint64 GetUInt64Value() const {
+  uint64_t GetUInt64Value() const {
     TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT64,
-               "MapKey::GetUInt64Value");
-    return val_.uint64_value_;
+               "MapValueConstRef::GetUInt64Value");
+    return *reinterpret_cast<uint64_t*>(data_);
   }
-  int32 GetInt32Value() const {
+  int32_t GetInt32Value() const {
     TYPE_CHECK(FieldDescriptor::CPPTYPE_INT32,
-               "MapKey::GetInt32Value");
-    return val_.int32_value_;
+               "MapValueConstRef::GetInt32Value");
+    return *reinterpret_cast<int32_t*>(data_);
   }
-  uint32 GetUInt32Value() const {
+  uint32_t GetUInt32Value() const {
     TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT32,
-               "MapKey::GetUInt32Value");
-    return val_.uint32_value_;
+               "MapValueConstRef::GetUInt32Value");
+    return *reinterpret_cast<uint32_t*>(data_);
   }
   bool GetBoolValue() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL,
-               "MapKey::GetBoolValue");
-    return val_.bool_value_;
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL, "MapValueConstRef::GetBoolValue");
+    return *reinterpret_cast<bool*>(data_);
+  }
+  int GetEnumValue() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_ENUM, "MapValueConstRef::GetEnumValue");
+    return *reinterpret_cast<int*>(data_);
   }
-  const string& GetStringValue() const {
+  const std::string& GetStringValue() const {
     TYPE_CHECK(FieldDescriptor::CPPTYPE_STRING,
-               "MapKey::GetStringValue");
-    return *val_.string_value_;
+               "MapValueConstRef::GetStringValue");
+    return *reinterpret_cast<std::string*>(data_);
   }
-
-  bool operator<(const MapKey& other) const {
-    if (type_ != other.type_) {
-      // We could define a total order that handles this case, but
-      // there currently no need.  So, for now, fail.
-      GOOGLE_LOG(FATAL) << "Unsupported: type mismatch";
-    }
-    switch (type()) {
-      case FieldDescriptor::CPPTYPE_DOUBLE:
-      case FieldDescriptor::CPPTYPE_FLOAT:
-      case FieldDescriptor::CPPTYPE_ENUM:
-      case FieldDescriptor::CPPTYPE_MESSAGE:
-        GOOGLE_LOG(FATAL) << "Unsupported";
-        return false;
-      case FieldDescriptor::CPPTYPE_STRING:
-        return *val_.string_value_ < *other.val_.string_value_;
-      case FieldDescriptor::CPPTYPE_INT64:
-        return val_.int64_value_ < other.val_.int64_value_;
-      case FieldDescriptor::CPPTYPE_INT32:
-        return val_.int32_value_ < other.val_.int32_value_;
-      case FieldDescriptor::CPPTYPE_UINT64:
-        return val_.uint64_value_ < other.val_.uint64_value_;
-      case FieldDescriptor::CPPTYPE_UINT32:
-        return val_.uint32_value_ < other.val_.uint32_value_;
-      case FieldDescriptor::CPPTYPE_BOOL:
-        return val_.bool_value_ < other.val_.bool_value_;
-    }
-    return false;
+  float GetFloatValue() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_FLOAT,
+               "MapValueConstRef::GetFloatValue");
+    return *reinterpret_cast<float*>(data_);
+  }
+  double GetDoubleValue() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_DOUBLE,
+               "MapValueConstRef::GetDoubleValue");
+    return *reinterpret_cast<double*>(data_);
   }
 
-  bool operator==(const MapKey& other) const {
-    if (type_ != other.type_) {
-      // To be consistent with operator<, we don't allow this either.
-      GOOGLE_LOG(FATAL) << "Unsupported: type mismatch";
-    }
-    switch (type()) {
-      case FieldDescriptor::CPPTYPE_DOUBLE:
-      case FieldDescriptor::CPPTYPE_FLOAT:
-      case FieldDescriptor::CPPTYPE_ENUM:
-      case FieldDescriptor::CPPTYPE_MESSAGE:
-        GOOGLE_LOG(FATAL) << "Unsupported";
-        break;
-      case FieldDescriptor::CPPTYPE_STRING:
-        return *val_.string_value_ == *other.val_.string_value_;
-      case FieldDescriptor::CPPTYPE_INT64:
-        return val_.int64_value_ == other.val_.int64_value_;
-      case FieldDescriptor::CPPTYPE_INT32:
-        return val_.int32_value_ == other.val_.int32_value_;
-      case FieldDescriptor::CPPTYPE_UINT64:
-        return val_.uint64_value_ == other.val_.uint64_value_;
-      case FieldDescriptor::CPPTYPE_UINT32:
-        return val_.uint32_value_ == other.val_.uint32_value_;
-      case FieldDescriptor::CPPTYPE_BOOL:
-        return val_.bool_value_ == other.val_.bool_value_;
-    }
-    GOOGLE_LOG(FATAL) << "Can't get here.";
-    return false;
+  const Message& GetMessageValue() const {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_MESSAGE,
+               "MapValueConstRef::GetMessageValue");
+    return *reinterpret_cast<Message*>(data_);
   }
 
-  void CopyFrom(const MapKey& other) {
-    SetType(other.type());
-    switch (type_) {
-      case FieldDescriptor::CPPTYPE_DOUBLE:
-      case FieldDescriptor::CPPTYPE_FLOAT:
-      case FieldDescriptor::CPPTYPE_ENUM:
-      case FieldDescriptor::CPPTYPE_MESSAGE:
-        GOOGLE_LOG(FATAL) << "Unsupported";
-        break;
-      case FieldDescriptor::CPPTYPE_STRING:
-        *val_.string_value_ = *other.val_.string_value_;
-        break;
-      case FieldDescriptor::CPPTYPE_INT64:
-        val_.int64_value_ = other.val_.int64_value_;
-        break;
-      case FieldDescriptor::CPPTYPE_INT32:
-        val_.int32_value_ = other.val_.int32_value_;
-        break;
-      case FieldDescriptor::CPPTYPE_UINT64:
-        val_.uint64_value_ = other.val_.uint64_value_;
-        break;
-      case FieldDescriptor::CPPTYPE_UINT32:
-        val_.uint32_value_ = other.val_.uint32_value_;
-        break;
-      case FieldDescriptor::CPPTYPE_BOOL:
-        val_.bool_value_ = other.val_.bool_value_;
-        break;
+ protected:
+  // data_ point to a map value. MapValueConstRef does not
+  // own this value.
+  void* data_;
+  // type_ is 0 or a valid FieldDescriptor::CppType.
+  // Use "CppType()" to indicate zero.
+  FieldDescriptor::CppType type_;
+
+  FieldDescriptor::CppType type() const {
+    if (type_ == FieldDescriptor::CppType() || data_ == nullptr) {
+      GOOGLE_LOG(FATAL)
+          << "Protocol Buffer map usage error:\n"
+          << "MapValueConstRef::type MapValueConstRef is not initialized.";
     }
+    return type_;
   }
 
  private:
+  template <typename Derived, typename K, typename V,
+            internal::WireFormatLite::FieldType key_wire_type,
+            internal::WireFormatLite::FieldType value_wire_type>
+  friend class internal::MapField;
   template <typename K, typename V>
   friend class internal::TypeDefinedMapFieldBase;
-  friend class MapIterator;
+  friend class ::PROTOBUF_NAMESPACE_ID::MapIterator;
+  friend class Reflection;
   friend class internal::DynamicMapField;
 
-  union KeyValue {
-    KeyValue() {}
-    string* string_value_;
-    int64 int64_value_;
-    int32 int32_value_;
-    uint64 uint64_value_;
-    uint32 uint32_value_;
-    bool bool_value_;
-  } val_;
-
-  void SetType(FieldDescriptor::CppType type) {
-    if (type_ == type) return;
-    if (type_ == FieldDescriptor::CPPTYPE_STRING) {
-      delete val_.string_value_;
-    }
-    type_ = type;
-    if (type_ == FieldDescriptor::CPPTYPE_STRING) {
-      val_.string_value_ = new string;
-    }
+  void SetType(FieldDescriptor::CppType type) { type_ = type; }
+  void SetValue(const void* val) { data_ = const_cast<void*>(val); }
+  void CopyFrom(const MapValueConstRef& other) {
+    type_ = other.type_;
+    data_ = other.data_;
   }
-
-  // type_ is 0 or a valid FieldDescriptor::CppType.
-  int type_;
 };
 
-// MapValueRef points to a map value.
-class LIBPROTOBUF_EXPORT MapValueRef {
+// MapValueRef points to a map value. Users are able to modify
+// the map value.
+class PROTOBUF_EXPORT MapValueRef final : public MapValueConstRef {
  public:
-  MapValueRef() : data_(NULL), type_(0) {}
+  MapValueRef() {}
 
-  void SetInt64Value(int64 value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT64,
-               "MapValueRef::SetInt64Value");
-    *reinterpret_cast<int64*>(data_) = value;
+  void SetInt64Value(int64_t value) {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT64, "MapValueRef::SetInt64Value");
+    *reinterpret_cast<int64_t*>(data_) = value;
   }
-  void SetUInt64Value(uint64 value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT64,
-               "MapValueRef::SetUInt64Value");
-    *reinterpret_cast<uint64*>(data_) = value;
+  void SetUInt64Value(uint64_t value) {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT64, "MapValueRef::SetUInt64Value");
+    *reinterpret_cast<uint64_t*>(data_) = value;
   }
-  void SetInt32Value(int32 value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT32,
-               "MapValueRef::SetInt32Value");
-    *reinterpret_cast<int32*>(data_) = value;
+  void SetInt32Value(int32_t value) {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT32, "MapValueRef::SetInt32Value");
+    *reinterpret_cast<int32_t*>(data_) = value;
   }
-  void SetUInt32Value(uint32 value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT32,
-               "MapValueRef::SetUInt32Value");
-    *reinterpret_cast<uint32*>(data_) = value;
+  void SetUInt32Value(uint32_t value) {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT32, "MapValueRef::SetUInt32Value");
+    *reinterpret_cast<uint32_t*>(data_) = value;
   }
   void SetBoolValue(bool value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL,
-               "MapValueRef::SetBoolValue");
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL, "MapValueRef::SetBoolValue");
     *reinterpret_cast<bool*>(data_) = value;
   }
   // TODO(jieluo) - Checks that enum is member.
   void SetEnumValue(int value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_ENUM,
-               "MapValueRef::SetEnumValue");
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_ENUM, "MapValueRef::SetEnumValue");
     *reinterpret_cast<int*>(data_) = value;
   }
-  void SetStringValue(const string& value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_STRING,
-               "MapValueRef::SetStringValue");
-    *reinterpret_cast<string*>(data_) = value;
+  void SetStringValue(const std::string& value) {
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_STRING, "MapValueRef::SetStringValue");
+    *reinterpret_cast<std::string*>(data_) = value;
   }
   void SetFloatValue(float value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_FLOAT,
-               "MapValueRef::SetFloatValue");
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_FLOAT, "MapValueRef::SetFloatValue");
     *reinterpret_cast<float*>(data_) = value;
   }
   void SetDoubleValue(double value) {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_DOUBLE,
-               "MapValueRef::SetDoubleValue");
+    TYPE_CHECK(FieldDescriptor::CPPTYPE_DOUBLE, "MapValueRef::SetDoubleValue");
     *reinterpret_cast<double*>(data_) = value;
   }
 
-  int64 GetInt64Value() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT64,
-               "MapValueRef::GetInt64Value");
-    return *reinterpret_cast<int64*>(data_);
-  }
-  uint64 GetUInt64Value() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT64,
-               "MapValueRef::GetUInt64Value");
-    return *reinterpret_cast<uint64*>(data_);
-  }
-  int32 GetInt32Value() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT32,
-               "MapValueRef::GetInt32Value");
-    return *reinterpret_cast<int32*>(data_);
-  }
-  uint32 GetUInt32Value() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT32,
-               "MapValueRef::GetUInt32Value");
-    return *reinterpret_cast<uint32*>(data_);
-  }
-  bool GetBoolValue() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL,
-               "MapValueRef::GetBoolValue");
-    return *reinterpret_cast<bool*>(data_);
-  }
-  int GetEnumValue() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_ENUM,
-               "MapValueRef::GetEnumValue");
-    return *reinterpret_cast<int*>(data_);
-  }
-  const string& GetStringValue() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_STRING,
-               "MapValueRef::GetStringValue");
-    return *reinterpret_cast<string*>(data_);
-  }
-  float GetFloatValue() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_FLOAT,
-               "MapValueRef::GetFloatValue");
-    return *reinterpret_cast<float*>(data_);
-  }
-  double GetDoubleValue() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_DOUBLE,
-               "MapValueRef::GetDoubleValue");
-    return *reinterpret_cast<double*>(data_);
-  }
-
-  const Message& GetMessageValue() const {
-    TYPE_CHECK(FieldDescriptor::CPPTYPE_MESSAGE,
-               "MapValueRef::GetMessageValue");
-    return *reinterpret_cast<Message*>(data_);
-  }
-
   Message* MutableMessageValue() {
     TYPE_CHECK(FieldDescriptor::CPPTYPE_MESSAGE,
                "MapValueRef::MutableMessageValue");
@@ -663,72 +823,38 @@ class LIBPROTOBUF_EXPORT MapValueRef {
   }
 
  private:
-  template <typename Derived, typename K, typename V,
-            internal::WireFormatLite::FieldType key_wire_type,
-            internal::WireFormatLite::FieldType value_wire_type,
-            int default_enum_value>
-  friend class internal::MapField;
-  template <typename K, typename V>
-  friend class internal::TypeDefinedMapFieldBase;
-  friend class MapIterator;
-  friend class internal::GeneratedMessageReflection;
   friend class internal::DynamicMapField;
 
-  void SetType(FieldDescriptor::CppType type) {
-    type_ = type;
-  }
-
-  FieldDescriptor::CppType type() const {
-    if (type_ == 0 || data_ == NULL) {
-      GOOGLE_LOG(FATAL)
-          << "Protocol Buffer map usage error:\n"
-          << "MapValueRef::type MapValueRef is not initialized.";
-    }
-    return (FieldDescriptor::CppType)type_;
-  }
-  void SetValue(const void* val) {
-    data_ = const_cast<void*>(val);
-  }
-  void CopyFrom(const MapValueRef& other) {
-    type_ = other.type_;
-    data_ = other.data_;
-  }
   // Only used in DynamicMapField
   void DeleteData() {
     switch (type_) {
-#define HANDLE_TYPE(CPPTYPE, TYPE)                              \
-      case google::protobuf::FieldDescriptor::CPPTYPE_##CPPTYPE: {        \
-        delete reinterpret_cast<TYPE*>(data_);                  \
-        break;                                                  \
-      }
-      HANDLE_TYPE(INT32, int32);
-      HANDLE_TYPE(INT64, int64);
-      HANDLE_TYPE(UINT32, uint32);
-      HANDLE_TYPE(UINT64, uint64);
+#define HANDLE_TYPE(CPPTYPE, TYPE)           \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE: { \
+    delete reinterpret_cast<TYPE*>(data_);   \
+    break;                                   \
+  }
+      HANDLE_TYPE(INT32, int32_t);
+      HANDLE_TYPE(INT64, int64_t);
+      HANDLE_TYPE(UINT32, uint32_t);
+      HANDLE_TYPE(UINT64, uint64_t);
       HANDLE_TYPE(DOUBLE, double);
       HANDLE_TYPE(FLOAT, float);
       HANDLE_TYPE(BOOL, bool);
-      HANDLE_TYPE(STRING, string);
-      HANDLE_TYPE(ENUM, int32);
+      HANDLE_TYPE(STRING, std::string);
+      HANDLE_TYPE(ENUM, int32_t);
       HANDLE_TYPE(MESSAGE, Message);
 #undef HANDLE_TYPE
     }
   }
-  // data_ point to a map value. MapValueRef does not
-  // own this value.
-  void* data_;
-  // type_ is 0 or a valid FieldDescriptor::CppType.
-  int type_;
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapValueRef);
 };
 
 #undef TYPE_CHECK
 
-class LIBPROTOBUF_EXPORT MapIterator {
+class PROTOBUF_EXPORT MapIterator {
  public:
   MapIterator(Message* message, const FieldDescriptor* field) {
     const Reflection* reflection = message->GetReflection();
-    map_ = reflection->MapData(message, field);
+    map_ = reflection->MutableMapData(message, field);
     key_.SetType(field->message_type()->FindFieldByName("key")->cpp_type());
     value_.SetType(field->message_type()->FindFieldByName("value")->cpp_type());
     map_->InitializeIterator(this);
@@ -738,9 +864,7 @@ class LIBPROTOBUF_EXPORT MapIterator {
     map_->InitializeIterator(this);
     map_->CopyIterator(this, other);
   }
-  ~MapIterator() {
-    map_->DeleteIterator(this);
-  }
+  ~MapIterator() { map_->DeleteIterator(this); }
   MapIterator& operator=(const MapIterator& other) {
     map_ = other.map_;
     map_->CopyIterator(this, other);
@@ -763,12 +887,8 @@ class LIBPROTOBUF_EXPORT MapIterator {
     map_->IncreaseIterator(this);
     return *this;
   }
-  const MapKey& GetKey() {
-    return key_;
-  }
-  const MapValueRef& GetValueRef() {
-    return value_;
-  }
+  const MapKey& GetKey() { return key_; }
+  const MapValueRef& GetValueRef() { return value_; }
   MapValueRef* MutableValueRef() {
     map_->SetMapDirty();
     return &value_;
@@ -780,8 +900,7 @@ class LIBPROTOBUF_EXPORT MapIterator {
   friend class internal::DynamicMapField;
   template <typename Derived, typename Key, typename T,
             internal::WireFormatLite::FieldType kKeyFieldType,
-            internal::WireFormatLite::FieldType kValueFieldType,
-            int default_enum_value>
+            internal::WireFormatLite::FieldType kValueFieldType>
   friend class internal::MapField;
 
   // reinterpret_cast from heap-allocated Map<...>::iterator*. MapIterator owns
@@ -799,40 +918,6 @@ class LIBPROTOBUF_EXPORT MapIterator {
 }  // namespace protobuf
 }  // namespace google
 
-GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START
-template<>
-struct hash<google::protobuf::MapKey> {
-  size_t
-  operator()(const google::protobuf::MapKey& map_key) const {
-    switch (map_key.type()) {
-      case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
-      case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT:
-      case google::protobuf::FieldDescriptor::CPPTYPE_ENUM:
-      case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE:
-        GOOGLE_LOG(FATAL) << "Unsupported";
-        break;
-      case google::protobuf::FieldDescriptor::CPPTYPE_STRING:
-        return hash<string>()(map_key.GetStringValue());
-      case google::protobuf::FieldDescriptor::CPPTYPE_INT64:
-        return hash< ::google::protobuf::int64>()(map_key.GetInt64Value());
-      case google::protobuf::FieldDescriptor::CPPTYPE_INT32:
-        return hash< ::google::protobuf::int32>()(map_key.GetInt32Value());
-      case google::protobuf::FieldDescriptor::CPPTYPE_UINT64:
-        return hash< ::google::protobuf::uint64>()(map_key.GetUInt64Value());
-      case google::protobuf::FieldDescriptor::CPPTYPE_UINT32:
-        return hash< ::google::protobuf::uint32>()(map_key.GetUInt32Value());
-      case google::protobuf::FieldDescriptor::CPPTYPE_BOOL:
-        return hash<bool>()(map_key.GetBoolValue());
-    }
-    GOOGLE_LOG(FATAL) << "Can't get here.";
-    return 0;
-  }
-  bool
-  operator()(const google::protobuf::MapKey& map_key1,
-             const google::protobuf::MapKey& map_key2) const {
-    return map_key1 < map_key2;
-  }
-};
-GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END
+#include <google/protobuf/port_undef.inc>
 
 #endif  // GOOGLE_PROTOBUF_MAP_FIELD_H__
index e317b5e..7c4c232 100644 (file)
 #define GOOGLE_PROTOBUF_MAP_FIELD_INL_H__
 
 #include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
 
+#include <google/protobuf/stubs/casts.h>
 #include <google/protobuf/map.h>
 #include <google/protobuf/map_field.h>
 #include <google/protobuf/map_type_handler.h>
 
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
 namespace google {
 namespace protobuf {
 namespace internal {
 // UnwrapMapKey template
-template<typename T>
+template <typename T>
 T UnwrapMapKey(const MapKey& map_key);
-template<>
-inline int32 UnwrapMapKey<int32>(const MapKey& map_key) {
+template <>
+inline int32_t UnwrapMapKey<int32_t>(const MapKey& map_key) {
   return map_key.GetInt32Value();
 }
-template<>
-inline uint32 UnwrapMapKey<uint32>(const MapKey& map_key) {
+template <>
+inline uint32_t UnwrapMapKey<uint32_t>(const MapKey& map_key) {
   return map_key.GetUInt32Value();
 }
-template<>
-inline int64 UnwrapMapKey<int64>(const MapKey& map_key) {
+template <>
+inline int64_t UnwrapMapKey<int64_t>(const MapKey& map_key) {
   return map_key.GetInt64Value();
 }
-template<>
-inline uint64 UnwrapMapKey<uint64>(const MapKey& map_key) {
+template <>
+inline uint64_t UnwrapMapKey<uint64_t>(const MapKey& map_key) {
   return map_key.GetUInt64Value();
 }
-template<>
+template <>
 inline bool UnwrapMapKey<bool>(const MapKey& map_key) {
   return map_key.GetBoolValue();
 }
-template<>
-inline string UnwrapMapKey<string>(const MapKey& map_key) {
+template <>
+inline std::string UnwrapMapKey<std::string>(const MapKey& map_key) {
   return map_key.GetStringValue();
 }
 
 // SetMapKey template
-template<typename T>
+template <typename T>
 inline void SetMapKey(MapKey* map_key, const T& value);
-template<>
-inline void SetMapKey<int32>(MapKey* map_key, const int32& value) {
+template <>
+inline void SetMapKey<int32_t>(MapKey* map_key, const int32_t& value) {
   map_key->SetInt32Value(value);
 }
-template<>
-inline void SetMapKey<uint32>(MapKey* map_key, const uint32& value) {
+template <>
+inline void SetMapKey<uint32_t>(MapKey* map_key, const uint32_t& value) {
   map_key->SetUInt32Value(value);
 }
-template<>
-inline void SetMapKey<int64>(MapKey* map_key, const int64& value) {
+template <>
+inline void SetMapKey<int64_t>(MapKey* map_key, const int64_t& value) {
   map_key->SetInt64Value(value);
 }
-template<>
-inline void SetMapKey<uint64>(MapKey* map_key, const uint64& value) {
+template <>
+inline void SetMapKey<uint64_t>(MapKey* map_key, const uint64_t& value) {
   map_key->SetUInt64Value(value);
 }
-template<>
+template <>
 inline void SetMapKey<bool>(MapKey* map_key, const bool& value) {
   map_key->SetBoolValue(value);
 }
-template<>
-inline void SetMapKey<string>(MapKey* map_key, const string& value) {
+template <>
+inline void SetMapKey<std::string>(MapKey* map_key, const std::string& value) {
   map_key->SetStringValue(value);
 }
 
@@ -104,7 +106,7 @@ template <typename Key, typename T>
 typename Map<Key, T>::const_iterator&
 TypeDefinedMapFieldBase<Key, T>::InternalGetIterator(
     const MapIterator* map_iter) const {
-  return *reinterpret_cast<typename Map<Key, T>::const_iterator *>(
+  return *reinterpret_cast<typename Map<Key, T>::const_iterator*>(
       map_iter->iter_);
 }
 
@@ -120,15 +122,14 @@ void TypeDefinedMapFieldBase<Key, T>::MapEnd(MapIterator* map_iter) const {
 }
 
 template <typename Key, typename T>
-bool TypeDefinedMapFieldBase<Key, T>::EqualIterator(const MapIterator& a,
-                                                    const MapIterator& b)
-    const {
+bool TypeDefinedMapFieldBase<Key, T>::EqualIterator(
+    const MapIterator& a, const MapIterator& b) const {
   return InternalGetIterator(&a) == InternalGetIterator(&b);
 }
 
 template <typename Key, typename T>
-void TypeDefinedMapFieldBase<Key, T>::IncreaseIterator(MapIterator* map_iter)
-    const {
+void TypeDefinedMapFieldBase<Key, T>::IncreaseIterator(
+    MapIterator* map_iter) const {
   ++InternalGetIterator(map_iter);
   SetMapIteratorValue(map_iter);
 }
@@ -137,20 +138,19 @@ template <typename Key, typename T>
 void TypeDefinedMapFieldBase<Key, T>::InitializeIterator(
     MapIterator* map_iter) const {
   map_iter->iter_ = new typename Map<Key, T>::const_iterator;
-  GOOGLE_CHECK(map_iter->iter_ != NULL);
+  GOOGLE_CHECK(map_iter->iter_ != nullptr);
 }
 
 template <typename Key, typename T>
-void TypeDefinedMapFieldBase<Key, T>::DeleteIterator(MapIterator* map_iter)
-    const {
-  delete reinterpret_cast<typename Map<Key, T>::const_iterator *>(
+void TypeDefinedMapFieldBase<Key, T>::DeleteIterator(
+    MapIterator* map_iter) const {
+  delete reinterpret_cast<typename Map<Key, T>::const_iterator*>(
       map_iter->iter_);
 }
 
 template <typename Key, typename T>
 void TypeDefinedMapFieldBase<Key, T>::CopyIterator(
-    MapIterator* this_iter,
-    const MapIterator& that_iter) const {
+    MapIterator* this_iter, const MapIterator& that_iter) const {
   InternalGetIterator(this_iter) = InternalGetIterator(&that_iter);
   this_iter->key_.SetType(that_iter.key_.type());
   // MapValueRef::type() fails when containing data is null. However, if
@@ -164,28 +164,35 @@ void TypeDefinedMapFieldBase<Key, T>::CopyIterator(
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-int MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-             default_enum_value>::size() const {
+          WireFormatLite::FieldType kValueFieldType>
+int MapField<Derived, Key, T, kKeyFieldType, kValueFieldType>::size() const {
   MapFieldBase::SyncMapWithRepeatedField();
   return static_cast<int>(impl_.GetMap().size());
 }
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::Clear() {
-  MapFieldBase::SyncMapWithRepeatedField();
+          WireFormatLite::FieldType kValueFieldType>
+void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType>::Clear() {
+  if (this->MapFieldBase::repeated_field_ != nullptr) {
+    RepeatedPtrField<EntryType>* repeated_field =
+        reinterpret_cast<RepeatedPtrField<EntryType>*>(
+            this->MapFieldBase::repeated_field_);
+    repeated_field->Clear();
+  }
+
   impl_.MutableMap()->clear();
+  // Data in map and repeated field are both empty, but we can't set status
+  // CLEAN. Because clear is a generated API, we cannot invalidate previous
+  // reference to map.
   MapFieldBase::SetMapDirty();
 }
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::SetMapIteratorValue(MapIterator* map_iter)
+          WireFormatLite::FieldType kValueFieldType>
+void MapField<Derived, Key, T, kKeyFieldType,
+              kValueFieldType>::SetMapIteratorValue(MapIterator* map_iter)
     const {
   const Map<Key, T>& map = impl_.GetMap();
   typename Map<Key, T>::const_iterator iter =
@@ -197,9 +204,9 @@ void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-bool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::ContainsMapKey(const MapKey& map_key) const {
+          WireFormatLite::FieldType kValueFieldType>
+bool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType>::ContainsMapKey(
+    const MapKey& map_key) const {
   const Map<Key, T>& map = impl_.GetMap();
   const Key& key = UnwrapMapKey<Key>(map_key);
   typename Map<Key, T>::const_iterator iter = map.find(key);
@@ -208,10 +215,10 @@ bool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-bool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::InsertOrLookupMapValue(const MapKey& map_key,
-                                                          MapValueRef* val) {
+          WireFormatLite::FieldType kValueFieldType>
+bool MapField<Derived, Key, T, kKeyFieldType,
+              kValueFieldType>::InsertOrLookupMapValue(const MapKey& map_key,
+                                                       MapValueRef* val) {
   // Always use mutable map because users may change the map value by
   // MapValueRef.
   Map<Key, T>* map = MutableMap();
@@ -229,47 +236,78 @@ bool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-bool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::DeleteMapValue(const MapKey& map_key) {
+          WireFormatLite::FieldType kValueFieldType>
+bool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType>::LookupMapValue(
+    const MapKey& map_key, MapValueConstRef* val) const {
+  const Map<Key, T>& map = GetMap();
+  const Key& key = UnwrapMapKey<Key>(map_key);
+  typename Map<Key, T>::const_iterator iter = map.find(key);
+  if (map.end() == iter) {
+    return false;
+  }
+  // Key is already in the map. Make sure (*map)[key] is not called.
+  // [] may reorder the map and iterators.
+  val->SetValue(&(iter->second));
+  return true;
+}
+
+template <typename Derived, typename Key, typename T,
+          WireFormatLite::FieldType kKeyFieldType,
+          WireFormatLite::FieldType kValueFieldType>
+bool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType>::DeleteMapValue(
+    const MapKey& map_key) {
   const Key& key = UnwrapMapKey<Key>(map_key);
   return MutableMap()->erase(key);
 }
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::MergeFrom(const MapField& other) {
+          WireFormatLite::FieldType kValueFieldType>
+void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType>::MergeFrom(
+    const MapFieldBase& other) {
   MapFieldBase::SyncMapWithRepeatedField();
-  other.SyncMapWithRepeatedField();
-  impl_.MergeFrom(other.impl_);
+  const MapField& other_field = static_cast<const MapField&>(other);
+  other_field.SyncMapWithRepeatedField();
+  impl_.MergeFrom(other_field.impl_);
   MapFieldBase::SetMapDirty();
 }
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::Swap(MapField* other) {
-  std::swap(this->MapFieldBase::repeated_field_, other->repeated_field_);
-  impl_.Swap(&other->impl_);
-  std::swap(this->MapFieldBase::state_, other->state_);
+          WireFormatLite::FieldType kValueFieldType>
+void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType>::Swap(
+    MapFieldBase* other) {
+  MapFieldBase::Swap(other);
+  MapField* other_field = down_cast<MapField*>(other);
+  impl_.Swap(&other_field->impl_);
+}
+
+template <typename Derived, typename Key, typename T,
+          WireFormatLite::FieldType kKeyFieldType,
+          WireFormatLite::FieldType kValueFieldType>
+void MapField<Derived, Key, T, kKeyFieldType,
+              kValueFieldType>::UnsafeShallowSwap(MapFieldBase* other) {
+  InternalSwap(down_cast<MapField*>(other));
+}
+
+template <typename Derived, typename Key, typename T,
+          WireFormatLite::FieldType kKeyFieldType,
+          WireFormatLite::FieldType kValueFieldType>
+void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType>::InternalSwap(
+    MapField* other) {
+  MapFieldBase::InternalSwap(other);
+  impl_.InternalSwap(&other->impl_);
 }
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::SyncRepeatedFieldWithMapNoLock() const {
-  if (this->MapFieldBase::repeated_field_ == NULL) {
-    if (this->MapFieldBase::arena_ == NULL) {
-      this->MapFieldBase::repeated_field_ = new RepeatedPtrField<Message>();
-    } else {
-      this->MapFieldBase::repeated_field_ =
-          Arena::CreateMessage<RepeatedPtrField<Message> >(
-              this->MapFieldBase::arena_);
-    }
+          WireFormatLite::FieldType kValueFieldType>
+void MapField<Derived, Key, T, kKeyFieldType,
+              kValueFieldType>::SyncRepeatedFieldWithMapNoLock() const {
+  if (this->MapFieldBase::repeated_field_ == nullptr) {
+    this->MapFieldBase::repeated_field_ =
+        Arena::CreateMessage<RepeatedPtrField<Message> >(
+            this->MapFieldBase::arena_);
   }
   const Map<Key, T>& map = impl_.GetMap();
   RepeatedPtrField<EntryType>* repeated_field =
@@ -284,8 +322,8 @@ void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
   // know that this MapEntry default_type has also already been constructed.
   // So it's safe to just call internal_default_instance().
   const Message* default_entry = Derived::internal_default_instance();
-  for (typename Map<Key, T>::const_iterator it = map.begin();
-       it != map.end(); ++it) {
+  for (typename Map<Key, T>::const_iterator it = map.begin(); it != map.end();
+       ++it) {
     EntryType* new_entry =
         down_cast<EntryType*>(default_entry->New(this->MapFieldBase::arena_));
     repeated_field->AddAllocated(new_entry);
@@ -296,17 +334,18 @@ void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-              default_enum_value>::SyncMapWithRepeatedFieldNoLock() const {
+          WireFormatLite::FieldType kValueFieldType>
+void MapField<Derived, Key, T, kKeyFieldType,
+              kValueFieldType>::SyncMapWithRepeatedFieldNoLock() const {
   Map<Key, T>* map = const_cast<MapField*>(this)->impl_.MutableMap();
   RepeatedPtrField<EntryType>* repeated_field =
       reinterpret_cast<RepeatedPtrField<EntryType>*>(
           this->MapFieldBase::repeated_field_);
-  GOOGLE_CHECK(this->MapFieldBase::repeated_field_ != NULL);
+  GOOGLE_CHECK(this->MapFieldBase::repeated_field_ != nullptr);
   map->clear();
   for (typename RepeatedPtrField<EntryType>::iterator it =
-           repeated_field->begin(); it != repeated_field->end(); ++it) {
+           repeated_field->begin();
+       it != repeated_field->end(); ++it) {
     // Cast is needed because Map's api and internal storage is different when
     // value is enum. For enum, we cannot cast an int to enum. Thus, we have to
     // copy value. For other types, they have same exposed api type and internal
@@ -318,24 +357,19 @@ void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
 
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType kKeyFieldType,
-          WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-size_t MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
-                default_enum_value>::SpaceUsedExcludingSelfNoLock() const {
+          WireFormatLite::FieldType kValueFieldType>
+size_t MapField<Derived, Key, T, kKeyFieldType,
+                kValueFieldType>::SpaceUsedExcludingSelfNoLock() const {
   size_t size = 0;
-  if (this->MapFieldBase::repeated_field_ != NULL) {
+  if (this->MapFieldBase::repeated_field_ != nullptr) {
     size += this->MapFieldBase::repeated_field_->SpaceUsedExcludingSelfLong();
   }
-  Map<Key, T>* map = const_cast<MapField*>(this)->impl_.MutableMap();
-  size += sizeof(*map);
-  for (typename Map<Key, T>::iterator it = map->begin(); it != map->end();
-       ++it) {
-    size += KeyTypeHandler::SpaceUsedInMapLong(it->first);
-    size += ValueTypeHandler::SpaceUsedInMapLong(it->second);
-  }
+  size += impl_.GetMap().SpaceUsedExcludingSelfLong();
+
   return size;
 }
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
 #endif  // GOOGLE_PROTOBUF_MAP_FIELD_INL_H__
index f648b43..255a0bc 100644 (file)
 #ifndef GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__
 #define GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__
 
+#include <type_traits>
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/map.h>
 #include <google/protobuf/map_entry_lite.h>
+#include <google/protobuf/port.h>
 #include <google/protobuf/wire_format_lite.h>
 
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
 namespace google {
 namespace protobuf {
 namespace internal {
 
 // This class provides access to map field using generated api. It is used for
-// internal generated message implentation only. Users should never use this
+// internal generated message implementation only. Users should never use this
 // directly.
 template <typename Derived, typename Key, typename T,
           WireFormatLite::FieldType key_wire_type,
-          WireFormatLite::FieldType value_wire_type, int default_enum_value = 0>
+          WireFormatLite::FieldType value_wire_type>
 class MapFieldLite {
   // Define message type for internal repeated field.
   typedef Derived EntryType;
@@ -53,11 +63,9 @@ class MapFieldLite {
   typedef Map<Key, T> MapType;
   typedef EntryType EntryTypeTrait;
 
-  MapFieldLite() : arena_(NULL) { SetDefaultEnumValue(); }
+  constexpr MapFieldLite() {}
 
-  explicit MapFieldLite(Arena* arena) : arena_(arena), map_(arena) {
-    SetDefaultEnumValue();
-  }
+  explicit MapFieldLite(Arena* arena) : map_(arena) {}
 
   // Accessors
   const Map<Key, T>& GetMap() const { return map_; }
@@ -73,47 +81,79 @@ class MapFieldLite {
     }
   }
   void Swap(MapFieldLite* other) { map_.swap(other->map_); }
-
-  // Set default enum value only for proto2 map field whose value is enum type.
-  void SetDefaultEnumValue() {
-    MutableMap()->SetDefaultEnumValue(default_enum_value);
-  }
+  void InternalSwap(MapFieldLite* other) { map_.InternalSwap(other->map_); }
 
   // Used in the implementation of parsing. Caller should take the ownership iff
-  // arena_ is NULL.
+  // arena_ is nullptr.
   EntryType* NewEntry() const {
-    if (arena_ == NULL) {
-      return new EntryType();
-    } else {
-      return Arena::CreateMessage<EntryType>(arena_);
-    }
+    return Arena::CreateMessage<EntryType>(map_.arena());
   }
   // Used in the implementation of serializing enum value type. Caller should
-  // take the ownership iff arena_ is NULL.
+  // take the ownership iff arena_ is nullptr.
   EntryType* NewEnumEntryWrapper(const Key& key, const T t) const {
-    return EntryType::EnumWrap(key, t, arena_);
+    return EntryType::EnumWrap(key, t, map_.arena_);
   }
   // Used in the implementation of serializing other value types. Caller should
-  // take the ownership iff arena_ is NULL.
+  // take the ownership iff arena_ is nullptr.
   EntryType* NewEntryWrapper(const Key& key, const T& t) const {
-    return EntryType::Wrap(key, t, arena_);
+    return EntryType::Wrap(key, t, map_.arena_);
+  }
+
+  const char* _InternalParse(const char* ptr, ParseContext* ctx) {
+    typename Derived::template Parser<MapFieldLite, Map<Key, T>> parser(this);
+    return parser._InternalParse(ptr, ctx);
+  }
+
+  template <typename UnknownType>
+  const char* ParseWithEnumValidation(const char* ptr, ParseContext* ctx,
+                                      bool (*is_valid)(int), uint32_t field_num,
+                                      InternalMetadata* metadata) {
+    typename Derived::template Parser<MapFieldLite, Map<Key, T>> parser(this);
+    return parser.template ParseWithEnumValidation<UnknownType>(
+        ptr, ctx, is_valid, field_num, metadata);
   }
 
  private:
   typedef void DestructorSkippable_;
 
-  Arena* arena_;
   Map<Key, T> map_;
 
-  friend class ::google::protobuf::Arena;
+  friend class ::PROTOBUF_NAMESPACE_ID::Arena;
 };
 
+template <typename UnknownType, typename T>
+struct EnumParseWrapper {
+  const char* _InternalParse(const char* ptr, ParseContext* ctx) {
+    return map_field->template ParseWithEnumValidation<UnknownType>(
+        ptr, ctx, is_valid, field_num, metadata);
+  }
+  T* map_field;
+  bool (*is_valid)(int);
+  uint32_t field_num;
+  InternalMetadata* metadata;
+};
+
+// Helper function because the typenames of maps are horrendous to print. This
+// leverages compiler type deduction, to keep all type data out of the
+// generated code
+template <typename UnknownType, typename T>
+EnumParseWrapper<UnknownType, T> InitEnumParseWrapper(
+    T* map_field, bool (*is_valid)(int), uint32_t field_num,
+    InternalMetadata* metadata) {
+  return EnumParseWrapper<UnknownType, T>{map_field, is_valid, field_num,
+                                          metadata};
+}
+
 // True if IsInitialized() is true for value field in all elements of t. T is
 // expected to be message.  It's useful to have this helper here to keep the
 // protobuf compiler from ever having to emit loops in IsInitialized() methods.
 // We want the C++ compiler to inline this or not as it sees fit.
-template <typename Key, typename T>
-bool AllAreInitialized(const Map<Key, T>& t) {
+template <typename Derived, typename Key, typename T,
+          WireFormatLite::FieldType key_wire_type,
+          WireFormatLite::FieldType value_wire_type>
+bool AllAreInitialized(const MapFieldLite<Derived, Key, T, key_wire_type,
+                                          value_wire_type>& field) {
+  const auto& t = field.GetMap();
   for (typename Map<Key, T>::const_iterator it = t.begin(); it != t.end();
        ++it) {
     if (!it->second.IsInitialized()) return false;
@@ -126,18 +166,19 @@ 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>
+          WireFormatLite::FieldType kValueFieldType>
+struct MapEntryToMapField<
+    MapEntryLite<T, Key, Value, kKeyFieldType, kValueFieldType>> {
+  typedef MapFieldLite<
+      MapEntryLite<T, Key, Value, kKeyFieldType, kValueFieldType>, Key, Value,
+      kKeyFieldType, kValueFieldType>
       MapFieldType;
 };
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__
index 7f7b1e0..2857342 100644 (file)
 // (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_TYPE_HANDLER_H__
-#define GOOGLE_PROTOBUF_TYPE_HANDLER_H__
+#ifndef GOOGLE_PROTOBUF_MAP_TYPE_HANDLER_H__
+#define GOOGLE_PROTOBUF_MAP_TYPE_HANDLER_H__
 
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/wire_format_lite.h>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
@@ -40,41 +46,19 @@ namespace internal {
 
 // Used for compile time type selection. MapIf::type will be TrueType if Flag is
 // true and FalseType otherwise.
-template<bool Flag, typename TrueType, typename FalseType>
+template <bool Flag, typename TrueType, typename FalseType>
 struct MapIf;
 
-template<typename TrueType, typename FalseType>
+template <typename TrueType, typename FalseType>
 struct MapIf<true, TrueType, FalseType> {
   typedef TrueType type;
 };
 
-template<typename TrueType, typename FalseType>
+template <typename TrueType, typename FalseType>
 struct MapIf<false, TrueType, FalseType> {
   typedef FalseType type;
 };
 
-// In proto2 Map, enum needs to be initialized to given default value, while
-// other types' default value can be inferred from the type.
-template <bool IsEnum, typename Type>
-class MapValueInitializer {
- public:
-  static inline void Initialize(Type& type, int default_enum_value);
-};
-
-template <typename Type>
-class MapValueInitializer<true, Type> {
- public:
-  static inline void Initialize(Type& value, int default_enum_value) {
-    value = static_cast<Type>(default_enum_value);
-  }
-};
-
-template <typename Type>
-class MapValueInitializer<false, Type> {
- public:
-  static inline void Initialize(Type& /* value */, int /* default_enum_value */) {}
-};
-
 template <typename Type, bool is_arena_constructable>
 class MapArenaMessageCreator {
  public:
@@ -113,23 +97,23 @@ class MapWireFieldTypeTraits {};
         WireFormatLite::WIRETYPE_##WireFormatType;                         \
   };
 
-TYPE_TRAITS(MESSAGE , Type, LENGTH_DELIMITED, true, false)
-TYPE_TRAITS(STRING  , ArenaStringPtr, LENGTH_DELIMITED, false, false)
-TYPE_TRAITS(BYTES   , ArenaStringPtr ,  LENGTH_DELIMITED, false, false)
-TYPE_TRAITS(INT64   , int64  ,  VARINT , false, false)
-TYPE_TRAITS(UINT64  , uint64 ,  VARINT , false, false)
-TYPE_TRAITS(INT32   , int32  ,  VARINT , false, false)
-TYPE_TRAITS(UINT32  , uint32 ,  VARINT , false, false)
-TYPE_TRAITS(SINT64  , int64  ,  VARINT , false, false)
-TYPE_TRAITS(SINT32  , int32  ,  VARINT , false, false)
-TYPE_TRAITS(ENUM    , int    ,  VARINT , false, true )
-TYPE_TRAITS(DOUBLE  , double ,  FIXED64, false, false)
-TYPE_TRAITS(FLOAT   , float  ,  FIXED32, false, false)
-TYPE_TRAITS(FIXED64 , uint64 ,  FIXED64, false, false)
-TYPE_TRAITS(FIXED32 , uint32 ,  FIXED32, false, false)
-TYPE_TRAITS(SFIXED64, int64  ,  FIXED64, false, false)
-TYPE_TRAITS(SFIXED32, int32  ,  FIXED32, false, false)
-TYPE_TRAITS(BOOL    , bool   ,  VARINT , false, false)
+TYPE_TRAITS(MESSAGE, Type, LENGTH_DELIMITED, true, false)
+TYPE_TRAITS(STRING, ArenaStringPtr, LENGTH_DELIMITED, false, false)
+TYPE_TRAITS(BYTES, ArenaStringPtr, LENGTH_DELIMITED, false, false)
+TYPE_TRAITS(INT64, int64_t, VARINT, false, false)
+TYPE_TRAITS(UINT64, uint64_t, VARINT, false, false)
+TYPE_TRAITS(INT32, int32_t, VARINT, false, false)
+TYPE_TRAITS(UINT32, uint32_t, VARINT, false, false)
+TYPE_TRAITS(SINT64, int64_t, VARINT, false, false)
+TYPE_TRAITS(SINT32, int32_t, VARINT, false, false)
+TYPE_TRAITS(ENUM, int, VARINT, false, true)
+TYPE_TRAITS(DOUBLE, double, FIXED64, false, false)
+TYPE_TRAITS(FLOAT, float, FIXED32, false, false)
+TYPE_TRAITS(FIXED64, uint64_t, FIXED64, false, false)
+TYPE_TRAITS(FIXED32, uint32_t, FIXED32, false, false)
+TYPE_TRAITS(SFIXED64, int64_t, FIXED64, false, false)
+TYPE_TRAITS(SFIXED32, int32_t, FIXED32, false, false)
+TYPE_TRAITS(BOOL, bool, VARINT, false, false)
 
 #undef TYPE_TRAITS
 
@@ -142,18 +126,19 @@ class MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type> {
   // Enum type cannot be used for MapTypeHandler::Read. Define a type which will
   // replace Enum with int.
   typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE,
-      Type>::MapEntryAccessorType MapEntryAccessorType;
+                                          Type>::MapEntryAccessorType
+      MapEntryAccessorType;
   // Internal stored type in MapEntryLite for given wire field type.
   typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE,
                                           Type>::TypeOnMemory TypeOnMemory;
   // Corresponding wire type for field type.
-  static const WireFormatLite::WireType kWireType =
+  static constexpr WireFormatLite::WireType kWireType =
       MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE, Type>::kWireType;
   // Whether wire type is for message.
-  static const bool kIsMessage =
+  static constexpr bool kIsMessage =
       MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE, Type>::kIsMessage;
   // Whether wire type is for enum.
-  static const bool kIsEnum =
+  static constexpr bool kIsEnum =
       MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE, Type>::kIsEnum;
 
   // Functions used in parsing and serialization. ===================
@@ -161,98 +146,71 @@ class MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type> {
   static inline int GetCachedSize(const MapEntryAccessorType& value);
   static inline bool Read(io::CodedInputStream* input,
                           MapEntryAccessorType* value);
-  static inline void Write(int field, const MapEntryAccessorType& value,
-                           io::CodedOutputStream* output);
-  static inline uint8* InternalWriteToArray(int field,
-                                            const MapEntryAccessorType& value,
-                                            bool deterministic, uint8* target);
-  static inline uint8* WriteToArray(int field,
-                                    const MapEntryAccessorType& value,
-                                    uint8* target);
+  static inline const char* Read(const char* ptr, ParseContext* ctx,
+                                 MapEntryAccessorType* value);
+
+  static inline uint8_t* Write(int field, const MapEntryAccessorType& value,
+                               uint8_t* ptr, io::EpsCopyOutputStream* stream);
 
   // Functions to manipulate data on memory. ========================
   static inline const Type& GetExternalReference(const Type* value);
   static inline void DeleteNoArena(const Type* x);
   static inline void Merge(const Type& from, Type** to, Arena* arena);
   static inline void Clear(Type** value, Arena* arena);
-  static inline void ClearMaybeByDefaultEnum(Type** value, Arena* arena,
-                                             int default_enum_value);
-  static inline void Initialize(Type** x, Arena* arena);
+  static constexpr TypeOnMemory Constinit();
 
-  static inline void InitializeMaybeByDefaultEnum(Type** x,
-                                                  int default_enum_value,
-                                                  Arena* arena);
   static inline Type* EnsureMutable(Type** value, Arena* arena);
   // SpaceUsedInMapEntry: Return bytes used by value in MapEntry, excluding
   // those already calculate in sizeof(MapField).
   static inline size_t SpaceUsedInMapEntryLong(const Type* value);
-  // Return bytes used by value in Map.
-  static inline size_t SpaceUsedInMapLong(const Type& value);
-  // Assign default value to given instance.
-  static inline void AssignDefaultValue(Type** value);
   // Return default instance if value is not initialized when calling const
   // reference accessor.
-  static inline const Type& DefaultIfNotInitialized(
-      const Type* value, const Type* default_value);
+  static inline const Type& DefaultIfNotInitialized(const Type* value);
   // Check if all required fields have values set.
   static inline bool IsInitialized(Type* value);
 };
 
-#define MAP_HANDLER(FieldType)                                                \
-  template <typename Type>                                                    \
-  class MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type> {              \
-   public:                                                                    \
-    typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType, \
-                                            Type>::MapEntryAccessorType       \
-        MapEntryAccessorType;                                                 \
-    typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType, \
-                                            Type>::TypeOnMemory TypeOnMemory; \
-    static const WireFormatLite::WireType kWireType =                         \
-        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,              \
-                               Type>::kWireType;                              \
-    static const bool kIsMessage =                                            \
-        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,              \
-                               Type>::kIsMessage;                             \
-    static const bool kIsEnum =                                               \
-        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,              \
-                               Type>::kIsEnum;                                \
-    static inline int ByteSize(const MapEntryAccessorType& value);            \
-    static inline int GetCachedSize(const MapEntryAccessorType& value);       \
-    static inline bool Read(io::CodedInputStream* input,                      \
-                            MapEntryAccessorType* value);                     \
-    static inline void Write(int field, const MapEntryAccessorType& value,    \
-                             io::CodedOutputStream* output);                  \
-    static inline uint8* InternalWriteToArray(                                \
-        int field, const MapEntryAccessorType& value, bool deterministic,     \
-        uint8* target);                                                       \
-    static inline uint8* WriteToArray(int field,                              \
-                                      const MapEntryAccessorType& value,      \
-                                      uint8* target) {                        \
-      return InternalWriteToArray(field, value, false, target);               \
-    }                                                                         \
-    static inline const MapEntryAccessorType& GetExternalReference(           \
-        const TypeOnMemory& value);                                           \
-    static inline void DeleteNoArena(const TypeOnMemory& x);                  \
-    static inline void Merge(const MapEntryAccessorType& from,                \
-                             TypeOnMemory* to, Arena* arena);                 \
-    static inline void Clear(TypeOnMemory* value, Arena* arena);              \
-    static inline void ClearMaybeByDefaultEnum(TypeOnMemory* value,           \
-                                               Arena* arena,                  \
-                                               int default_enum);             \
-    static inline size_t SpaceUsedInMapEntryLong(const TypeOnMemory& value);  \
-    static inline size_t SpaceUsedInMapLong(const TypeOnMemory& value);       \
-    static inline size_t SpaceUsedInMapLong(const string& value);             \
-    static inline void AssignDefaultValue(TypeOnMemory* value);               \
-    static inline const MapEntryAccessorType& DefaultIfNotInitialized(        \
-        const TypeOnMemory& value, const TypeOnMemory& default_value);        \
-    static inline bool IsInitialized(const TypeOnMemory& value);              \
-    static void DeleteNoArena(TypeOnMemory& value);                           \
-    static inline void Initialize(TypeOnMemory* value, Arena* arena);         \
-    static inline void InitializeMaybeByDefaultEnum(TypeOnMemory* value,      \
-                                                    int default_enum_value,   \
-                                                    Arena* arena);            \
-    static inline MapEntryAccessorType* EnsureMutable(TypeOnMemory* value,    \
-                                                      Arena* arena);          \
+#define MAP_HANDLER(FieldType)                                                 \
+  template <typename Type>                                                     \
+  class MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type> {               \
+   public:                                                                     \
+    typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,  \
+                                            Type>::MapEntryAccessorType        \
+        MapEntryAccessorType;                                                  \
+    typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,  \
+                                            Type>::TypeOnMemory TypeOnMemory;  \
+    static const WireFormatLite::WireType kWireType =                          \
+        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,               \
+                               Type>::kWireType;                               \
+    static const bool kIsMessage =                                             \
+        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,               \
+                               Type>::kIsMessage;                              \
+    static const bool kIsEnum =                                                \
+        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,               \
+                               Type>::kIsEnum;                                 \
+    static inline int ByteSize(const MapEntryAccessorType& value);             \
+    static inline int GetCachedSize(const MapEntryAccessorType& value);        \
+    static inline bool Read(io::CodedInputStream* input,                       \
+                            MapEntryAccessorType* value);                      \
+    static inline const char* Read(const char* begin, ParseContext* ctx,       \
+                                   MapEntryAccessorType* value);               \
+    static inline uint8_t* Write(int field, const MapEntryAccessorType& value, \
+                                 uint8_t* ptr,                                 \
+                                 io::EpsCopyOutputStream* stream);             \
+    static inline const MapEntryAccessorType& GetExternalReference(            \
+        const TypeOnMemory& value);                                            \
+    static inline void DeleteNoArena(const TypeOnMemory& x);                   \
+    static inline void Merge(const MapEntryAccessorType& from,                 \
+                             TypeOnMemory* to, Arena* arena);                  \
+    static inline void Clear(TypeOnMemory* value, Arena* arena);               \
+    static inline size_t SpaceUsedInMapEntryLong(const TypeOnMemory& value);   \
+    static inline const MapEntryAccessorType& DefaultIfNotInitialized(         \
+        const TypeOnMemory& value);                                            \
+    static inline bool IsInitialized(const TypeOnMemory& value);               \
+    static void DeleteNoArena(TypeOnMemory& value);                            \
+    static constexpr TypeOnMemory Constinit();                                 \
+    static inline MapEntryAccessorType* EnsureMutable(TypeOnMemory* value,     \
+                                                      Arena* arena);           \
   };
 MAP_HANDLER(STRING)
 MAP_HANDLER(BYTES)
@@ -273,8 +231,7 @@ MAP_HANDLER(BOOL)
 #undef MAP_HANDLER
 
 template <typename Type>
-inline size_t
-MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ByteSize(
+inline size_t MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ByteSize(
     const MapEntryAccessorType& value) {
   return WireFormatLite::MessageSizeNoVirtual(value);
 }
@@ -287,14 +244,14 @@ MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ByteSize(
   }
 
 GOOGLE_PROTOBUF_BYTE_SIZE(STRING, String)
-GOOGLE_PROTOBUF_BYTE_SIZE(BYTES , Bytes)
-GOOGLE_PROTOBUF_BYTE_SIZE(INT64 , Int64)
+GOOGLE_PROTOBUF_BYTE_SIZE(BYTES, Bytes)
+GOOGLE_PROTOBUF_BYTE_SIZE(INT64, Int64)
 GOOGLE_PROTOBUF_BYTE_SIZE(UINT64, UInt64)
-GOOGLE_PROTOBUF_BYTE_SIZE(INT32 , Int32)
+GOOGLE_PROTOBUF_BYTE_SIZE(INT32, Int32)
 GOOGLE_PROTOBUF_BYTE_SIZE(UINT32, UInt32)
 GOOGLE_PROTOBUF_BYTE_SIZE(SINT64, SInt64)
 GOOGLE_PROTOBUF_BYTE_SIZE(SINT32, SInt32)
-GOOGLE_PROTOBUF_BYTE_SIZE(ENUM  , Enum)
+GOOGLE_PROTOBUF_BYTE_SIZE(ENUM, Enum)
 
 #undef GOOGLE_PROTOBUF_BYTE_SIZE
 
@@ -305,23 +262,21 @@ GOOGLE_PROTOBUF_BYTE_SIZE(ENUM  , Enum)
     return WireFormatLite::k##DeclaredType##Size;                              \
   }
 
-FIXED_BYTE_SIZE(DOUBLE  , Double)
-FIXED_BYTE_SIZE(FLOAT   , Float)
-FIXED_BYTE_SIZE(FIXED64 , Fixed64)
-FIXED_BYTE_SIZE(FIXED32 , Fixed32)
+FIXED_BYTE_SIZE(DOUBLE, Double)
+FIXED_BYTE_SIZE(FLOAT, Float)
+FIXED_BYTE_SIZE(FIXED64, Fixed64)
+FIXED_BYTE_SIZE(FIXED32, Fixed32)
 FIXED_BYTE_SIZE(SFIXED64, SFixed64)
 FIXED_BYTE_SIZE(SFIXED32, SFixed32)
-FIXED_BYTE_SIZE(BOOL    , Bool)
+FIXED_BYTE_SIZE(BOOL, Bool)
 
 #undef FIXED_BYTE_SIZE
 
 template <typename Type>
-inline int
-MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::GetCachedSize(
+inline int MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::GetCachedSize(
     const MapEntryAccessorType& value) {
-  return static_cast<int>(
-      WireFormatLite::LengthDelimitedSize(
-          static_cast<size_t>(value.GetCachedSize())));
+  return static_cast<int>(WireFormatLite::LengthDelimitedSize(
+      static_cast<size_t>(value.GetCachedSize())));
 }
 
 #define GET_CACHED_SIZE(FieldType, DeclaredType)                         \
@@ -333,14 +288,14 @@ MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::GetCachedSize(
   }
 
 GET_CACHED_SIZE(STRING, String)
-GET_CACHED_SIZE(BYTES , Bytes)
-GET_CACHED_SIZE(INT64 , Int64)
+GET_CACHED_SIZE(BYTES, Bytes)
+GET_CACHED_SIZE(INT64, Int64)
 GET_CACHED_SIZE(UINT64, UInt64)
-GET_CACHED_SIZE(INT32 , Int32)
+GET_CACHED_SIZE(INT32, Int32)
 GET_CACHED_SIZE(UINT32, UInt32)
 GET_CACHED_SIZE(SINT64, SInt64)
 GET_CACHED_SIZE(SINT32, SInt32)
-GET_CACHED_SIZE(ENUM  , Enum)
+GET_CACHED_SIZE(ENUM, Enum)
 
 #undef GET_CACHED_SIZE
 
@@ -352,63 +307,62 @@ GET_CACHED_SIZE(ENUM  , Enum)
     return WireFormatLite::k##DeclaredType##Size;                        \
   }
 
-GET_FIXED_CACHED_SIZE(DOUBLE  , Double)
-GET_FIXED_CACHED_SIZE(FLOAT   , Float)
-GET_FIXED_CACHED_SIZE(FIXED64 , Fixed64)
-GET_FIXED_CACHED_SIZE(FIXED32 , Fixed32)
+GET_FIXED_CACHED_SIZE(DOUBLE, Double)
+GET_FIXED_CACHED_SIZE(FLOAT, Float)
+GET_FIXED_CACHED_SIZE(FIXED64, Fixed64)
+GET_FIXED_CACHED_SIZE(FIXED32, Fixed32)
 GET_FIXED_CACHED_SIZE(SFIXED64, SFixed64)
 GET_FIXED_CACHED_SIZE(SFIXED32, SFixed32)
-GET_FIXED_CACHED_SIZE(BOOL    , Bool)
+GET_FIXED_CACHED_SIZE(BOOL, Bool)
 
 #undef GET_FIXED_CACHED_SIZE
 
 template <typename Type>
-inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Write(
-    int field, const MapEntryAccessorType& value,
-    io::CodedOutputStream* output) {
-  WireFormatLite::WriteMessageMaybeToArray(field, value, output);
+inline uint8_t* MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Write(
+    int field, const MapEntryAccessorType& value, uint8_t* ptr,
+    io::EpsCopyOutputStream* stream) {
+  ptr = stream->EnsureSpace(ptr);
+  return WireFormatLite::InternalWriteMessage(field, value, ptr, stream);
 }
 
-template <typename Type>
-inline uint8*
-MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::InternalWriteToArray(
-    int field, const MapEntryAccessorType& value, bool deterministic,
-    uint8* target) {
-  return WireFormatLite::InternalWriteMessageToArray(field, value,
-                                                     deterministic, target);
-}
+#define WRITE_METHOD(FieldType, DeclaredType)                     \
+  template <typename Type>                                        \
+  inline uint8_t*                                                 \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Write(  \
+      int field, const MapEntryAccessorType& value, uint8_t* ptr, \
+      io::EpsCopyOutputStream* stream) {                          \
+    ptr = stream->EnsureSpace(ptr);                               \
+    return stream->Write##DeclaredType(field, value, ptr);        \
+  }
 
-#define WRITE_METHOD(FieldType, DeclaredType)                                  \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Write(   \
-      int field, const MapEntryAccessorType& value,                            \
-      io::CodedOutputStream* output) {                                         \
-    return WireFormatLite::Write##DeclaredType(field, value, output);          \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline uint8*                                                                \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \
-                 Type>::InternalWriteToArray(                                  \
-      int field, const MapEntryAccessorType& value, bool, uint8* target) {     \
-    return WireFormatLite::Write##DeclaredType##ToArray(field, value, target); \
+WRITE_METHOD(STRING, String)
+WRITE_METHOD(BYTES, Bytes)
+
+#undef WRITE_METHOD
+#define WRITE_METHOD(FieldType, DeclaredType)                               \
+  template <typename Type>                                                  \
+  inline uint8_t*                                                           \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Write(            \
+      int field, const MapEntryAccessorType& value, uint8_t* ptr,           \
+      io::EpsCopyOutputStream* stream) {                                    \
+    ptr = stream->EnsureSpace(ptr);                                         \
+    return WireFormatLite::Write##DeclaredType##ToArray(field, value, ptr); \
   }
 
-WRITE_METHOD(STRING  , String)
-WRITE_METHOD(BYTES   , Bytes)
-WRITE_METHOD(INT64   , Int64)
-WRITE_METHOD(UINT64  , UInt64)
-WRITE_METHOD(INT32   , Int32)
-WRITE_METHOD(UINT32  , UInt32)
-WRITE_METHOD(SINT64  , SInt64)
-WRITE_METHOD(SINT32  , SInt32)
-WRITE_METHOD(ENUM    , Enum)
-WRITE_METHOD(DOUBLE  , Double)
-WRITE_METHOD(FLOAT   , Float)
-WRITE_METHOD(FIXED64 , Fixed64)
-WRITE_METHOD(FIXED32 , Fixed32)
+WRITE_METHOD(INT64, Int64)
+WRITE_METHOD(UINT64, UInt64)
+WRITE_METHOD(INT32, Int32)
+WRITE_METHOD(UINT32, UInt32)
+WRITE_METHOD(SINT64, SInt64)
+WRITE_METHOD(SINT32, SInt32)
+WRITE_METHOD(ENUM, Enum)
+WRITE_METHOD(DOUBLE, Double)
+WRITE_METHOD(FLOAT, Float)
+WRITE_METHOD(FIXED64, Fixed64)
+WRITE_METHOD(FIXED32, Fixed32)
 WRITE_METHOD(SFIXED64, SFixed64)
 WRITE_METHOD(SFIXED32, SFixed32)
-WRITE_METHOD(BOOL    , Bool)
+WRITE_METHOD(BOOL, Bool)
 
 #undef WRITE_METHOD
 
@@ -430,6 +384,82 @@ inline bool MapTypeHandler<WireFormatLite::TYPE_BYTES, Type>::Read(
   return WireFormatLite::ReadBytes(input, value);
 }
 
+template <typename Type>
+const char* MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Read(
+    const char* ptr, ParseContext* ctx, MapEntryAccessorType* value) {
+  return ctx->ParseMessage(value, ptr);
+}
+
+template <typename Type>
+const char* MapTypeHandler<WireFormatLite::TYPE_STRING, Type>::Read(
+    const char* ptr, ParseContext* ctx, MapEntryAccessorType* value) {
+  int size = ReadSize(&ptr);
+  GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+  return ctx->ReadString(ptr, size, value);
+}
+
+template <typename Type>
+const char* MapTypeHandler<WireFormatLite::TYPE_BYTES, Type>::Read(
+    const char* ptr, ParseContext* ctx, MapEntryAccessorType* value) {
+  int size = ReadSize(&ptr);
+  GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+  return ctx->ReadString(ptr, size, value);
+}
+
+inline const char* ReadINT64(const char* ptr, int64_t* value) {
+  return VarintParse(ptr, reinterpret_cast<uint64_t*>(value));
+}
+inline const char* ReadUINT64(const char* ptr, uint64_t* value) {
+  return VarintParse(ptr, value);
+}
+inline const char* ReadINT32(const char* ptr, int32_t* value) {
+  return VarintParse(ptr, reinterpret_cast<uint32_t*>(value));
+}
+inline const char* ReadUINT32(const char* ptr, uint32_t* value) {
+  return VarintParse(ptr, value);
+}
+inline const char* ReadSINT64(const char* ptr, int64_t* value) {
+  *value = ReadVarintZigZag64(&ptr);
+  return ptr;
+}
+inline const char* ReadSINT32(const char* ptr, int32_t* value) {
+  *value = ReadVarintZigZag32(&ptr);
+  return ptr;
+}
+template <typename E>
+inline const char* ReadENUM(const char* ptr, E* value) {
+  *value = static_cast<E>(ReadVarint32(&ptr));
+  return ptr;
+}
+inline const char* ReadBOOL(const char* ptr, bool* value) {
+  *value = static_cast<bool>(ReadVarint32(&ptr));
+  return ptr;
+}
+
+template <typename F>
+inline const char* ReadUnaligned(const char* ptr, F* value) {
+  *value = UnalignedLoad<F>(ptr);
+  return ptr + sizeof(F);
+}
+inline const char* ReadFLOAT(const char* ptr, float* value) {
+  return ReadUnaligned(ptr, value);
+}
+inline const char* ReadDOUBLE(const char* ptr, double* value) {
+  return ReadUnaligned(ptr, value);
+}
+inline const char* ReadFIXED64(const char* ptr, uint64_t* value) {
+  return ReadUnaligned(ptr, value);
+}
+inline const char* ReadFIXED32(const char* ptr, uint32_t* value) {
+  return ReadUnaligned(ptr, value);
+}
+inline const char* ReadSFIXED64(const char* ptr, int64_t* value) {
+  return ReadUnaligned(ptr, value);
+}
+inline const char* ReadSFIXED32(const char* ptr, int32_t* value) {
+  return ReadUnaligned(ptr, value);
+}
+
 #define READ_METHOD(FieldType)                                              \
   template <typename Type>                                                  \
   inline bool MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Read( \
@@ -437,6 +467,12 @@ inline bool MapTypeHandler<WireFormatLite::TYPE_BYTES, Type>::Read(
     return WireFormatLite::ReadPrimitive<TypeOnMemory,                      \
                                          WireFormatLite::TYPE_##FieldType>( \
         input, value);                                                      \
+  }                                                                         \
+  template <typename Type>                                                  \
+  const char* MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Read( \
+      const char* begin, ParseContext* ctx, MapEntryAccessorType* value) {  \
+    (void)ctx;                                                              \
+    return Read##FieldType(begin, value);                                   \
   }
 
 READ_METHOD(INT64)
@@ -460,8 +496,8 @@ READ_METHOD(BOOL)
 
 template <typename Type>
 inline const Type&
-MapTypeHandler<WireFormatLite::TYPE_MESSAGE,
-                        Type>::GetExternalReference(const Type* value) {
+MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::GetExternalReference(
+    const Type* value) {
   return *value;
 }
 
@@ -472,23 +508,9 @@ inline size_t MapTypeHandler<WireFormatLite::TYPE_MESSAGE,
 }
 
 template <typename Type>
-size_t MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::SpaceUsedInMapLong(
-    const Type& value) {
-  return value.SpaceUsedLong();
-}
-
-template <typename Type>
 inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Clear(
     Type** value, Arena* /* arena */) {
-  if (*value != NULL) (*value)->Clear();
-}
-template <typename Type>
-inline void
-MapTypeHandler<WireFormatLite::TYPE_MESSAGE,
-                        Type>::ClearMaybeByDefaultEnum(Type** value,
-                                                       Arena* /* arena */,
-                                                       int /* default_enum_value */) {
-  if (*value != NULL) (*value)->Clear();
+  if (*value != nullptr) (*value)->Clear();
 }
 template <typename Type>
 inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Merge(
@@ -503,218 +525,148 @@ void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::DeleteNoArena(
 }
 
 template <typename Type>
-inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE,
-                                    Type>::AssignDefaultValue(Type** value) {
-  *value = const_cast<Type*>(Type::internal_default_instance());
+constexpr auto MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Constinit()
+    -> TypeOnMemory {
+  return nullptr;
 }
 
 template <typename Type>
-inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE,
-                                    Type>::Initialize(Type** x,
-                                                      Arena* /* arena */) {
-  *x = NULL;
-}
-
-template <typename Type>
-inline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::
-    InitializeMaybeByDefaultEnum(Type** x, int /* default_enum_value */,
-                                 Arena* /* arena */) {
-  *x = NULL;
-}
-
-template <typename Type>
-inline Type* MapTypeHandler<WireFormatLite::TYPE_MESSAGE,
-                                     Type>::EnsureMutable(Type** value,
-                                                          Arena* arena) {
-  if (*value == NULL) {
-    *value =
-        MapArenaMessageCreator<Type, Arena::is_arena_constructable<Type>::
-                                         type::value>::CreateMessage(arena);
+inline Type* MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::EnsureMutable(
+    Type** value, Arena* arena) {
+  if (*value == nullptr) {
+    *value = MapArenaMessageCreator<
+        Type,
+        Arena::is_arena_constructable<Type>::type::value>::CreateMessage(arena);
   }
   return *value;
 }
 
 template <typename Type>
-inline const Type& MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::
-    DefaultIfNotInitialized(const Type* value, const Type* default_value) {
-  return value != NULL ? *value : *default_value;
+inline const Type&
+MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::DefaultIfNotInitialized(
+    const Type* value) {
+  return value != nullptr ? *value : *Type::internal_default_instance();
 }
 
 template <typename Type>
-inline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE,
-                                    Type>::IsInitialized(Type* value) {
-  return value->IsInitialized();
+inline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::IsInitialized(
+    Type* value) {
+  return value ? value->IsInitialized() : false;
 }
 
 // Definition for string/bytes handler
 
-#define STRING_OR_BYTES_HANDLER_FUNCTIONS(FieldType)                           \
-  template <typename Type>                                                     \
-  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,       \
-                                       Type>::MapEntryAccessorType&            \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \
-                 Type>::GetExternalReference(const TypeOnMemory& value) {      \
-    return value.Get();                                                        \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline size_t                                                                \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \
-                 Type>::SpaceUsedInMapEntryLong(const TypeOnMemory& value) {   \
-    return sizeof(value);                                                      \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline size_t                                                                \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::SpaceUsedInMapLong(  \
-      const TypeOnMemory& value) {                                             \
-    return sizeof(value);                                                      \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline size_t                                                                \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::SpaceUsedInMapLong(  \
-      const string& value) {                                                   \
-    return sizeof(value);                                                      \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Clear(   \
-      TypeOnMemory* value, Arena* arena) {                                     \
-    value->ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),    \
-                        arena);                                                \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::         \
-      ClearMaybeByDefaultEnum(TypeOnMemory* value, Arena* arena,               \
-                              int /* default_enum */) {                        \
-    Clear(value, arena);                                                       \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Merge(   \
-      const MapEntryAccessorType& from, TypeOnMemory* to, Arena* arena) {      \
-    to->Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from, arena);  \
-  }                                                                            \
-  template <typename Type>                                                     \
-  void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::DeleteNoArena(  \
-      TypeOnMemory& value) {                                                   \
-    value.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());  \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \
-                             Type>::AssignDefaultValue(TypeOnMemory* /* value */) {} \
-  template <typename Type>                                                     \
-  inline void                                                                  \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Initialize(          \
-      TypeOnMemory* value, Arena* /* arena */) {                               \
-    value->UnsafeSetDefault(                                                   \
-        &::google::protobuf::internal::GetEmptyStringAlreadyInited());                   \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::         \
-      InitializeMaybeByDefaultEnum(TypeOnMemory* value,                        \
-                                   int /* default_enum_value */,               \
-                                   Arena* arena) {                             \
-    Initialize(value, arena);                                                  \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,             \
-                                 Type>::MapEntryAccessorType*                  \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable(       \
-      TypeOnMemory* value, Arena* arena) {                                     \
-    return value->Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),  \
-                          arena);                                              \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,       \
-                                       Type>::MapEntryAccessorType&            \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \
-                 Type>::DefaultIfNotInitialized(const TypeOnMemory& value,     \
-                                                const TypeOnMemory&            \
-                                                    /* default_value */) {     \
-    return value.Get();                                                        \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline bool MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \
-                             Type>::IsInitialized(const TypeOnMemory& /* value */) { \
-    return true;                                                               \
+#define STRING_OR_BYTES_HANDLER_FUNCTIONS(FieldType)                          \
+  template <typename Type>                                                    \
+  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,      \
+                                       Type>::MapEntryAccessorType&           \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                            \
+                 Type>::GetExternalReference(const TypeOnMemory& value) {     \
+    return value.Get();                                                       \
+  }                                                                           \
+  template <typename Type>                                                    \
+  inline size_t                                                               \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                            \
+                 Type>::SpaceUsedInMapEntryLong(const TypeOnMemory& value) {  \
+    return sizeof(value);                                                     \
+  }                                                                           \
+  template <typename Type>                                                    \
+  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Clear(  \
+      TypeOnMemory* value, Arena* /* arena */) {                              \
+    value->ClearToEmpty();                                                    \
+  }                                                                           \
+  template <typename Type>                                                    \
+  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Merge(  \
+      const MapEntryAccessorType& from, TypeOnMemory* to, Arena* arena) {     \
+    to->Set(&internal::GetEmptyStringAlreadyInited(), from, arena);           \
+  }                                                                           \
+  template <typename Type>                                                    \
+  void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::DeleteNoArena( \
+      TypeOnMemory& value) {                                                  \
+    value.DestroyNoArena(&internal::GetEmptyStringAlreadyInited());           \
+  }                                                                           \
+  template <typename Type>                                                    \
+  constexpr auto                                                              \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Constinit()         \
+      ->TypeOnMemory {                                                        \
+    return TypeOnMemory(&internal::fixed_address_empty_string);               \
+  }                                                                           \
+  template <typename Type>                                                    \
+  inline typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,            \
+                                 Type>::MapEntryAccessorType*                 \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable(      \
+      TypeOnMemory* value, Arena* arena) {                                    \
+    return value->Mutable(ArenaStringPtr::EmptyDefault{}, arena);             \
+  }                                                                           \
+  template <typename Type>                                                    \
+  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,      \
+                                       Type>::MapEntryAccessorType&           \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                            \
+                 Type>::DefaultIfNotInitialized(const TypeOnMemory& value) {  \
+    return value.Get();                                                       \
+  }                                                                           \
+  template <typename Type>                                                    \
+  inline bool                                                                 \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::IsInitialized(      \
+      const TypeOnMemory& /* value */) {                                      \
+    return true;                                                              \
   }
 STRING_OR_BYTES_HANDLER_FUNCTIONS(STRING)
 STRING_OR_BYTES_HANDLER_FUNCTIONS(BYTES)
 #undef STRING_OR_BYTES_HANDLER_FUNCTIONS
 
-#define PRIMITIVE_HANDLER_FUNCTIONS(FieldType)                                 \
-  template <typename Type>                                                     \
-  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,       \
-                                       Type>::MapEntryAccessorType&            \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \
-                 Type>::GetExternalReference(const TypeOnMemory& value) {      \
-    return value;                                                              \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline size_t                                                                \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \
-                 Type>::SpaceUsedInMapEntryLong(const TypeOnMemory& /* value */) {   \
-    return 0;                                                                  \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline size_t                                                                \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::SpaceUsedInMapLong(  \
-      const TypeOnMemory& /* value */) {                                       \
-    return sizeof(Type);                                                       \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Clear(   \
-      TypeOnMemory* value, Arena* /* arena */) {                               \
-    *value = 0;                                                                \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::         \
-      ClearMaybeByDefaultEnum(TypeOnMemory* value, Arena* /* arena */,         \
-                              int default_enum_value) {                        \
-    *value = static_cast<TypeOnMemory>(default_enum_value);                    \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Merge(   \
-      const MapEntryAccessorType& from, TypeOnMemory* to,                      \
-      Arena* /* arena */) {                                                    \
-    *to = from;                                                                \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \
-                             Type>::DeleteNoArena(TypeOnMemory& /* x */) {}    \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \
-                             Type>::AssignDefaultValue(TypeOnMemory* /* value */) {} \
-  template <typename Type>                                                     \
-  inline void                                                                  \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Initialize(          \
-      TypeOnMemory* value, Arena* /* arena */) {                               \
-    *value = 0;                                                                \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::         \
-      InitializeMaybeByDefaultEnum(TypeOnMemory* value,                        \
-                                   int default_enum_value,                     \
-                                   Arena* /* arena */) {                       \
-    *value = static_cast<TypeOnMemory>(default_enum_value);                    \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,             \
-                                 Type>::MapEntryAccessorType*                  \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable(       \
-      TypeOnMemory* value, Arena* /* arena */) {                               \
-    return value;                                                              \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,       \
-                                       Type>::MapEntryAccessorType&            \
-  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \
-                 Type>::DefaultIfNotInitialized(const TypeOnMemory& value,     \
-                                                const TypeOnMemory&            \
-                                                   /* default_value */) {      \
-    return value;                                                              \
-  }                                                                            \
-  template <typename Type>                                                     \
-  inline bool MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \
-                             Type>::IsInitialized(const TypeOnMemory& /* value */) { \
-    return true;                                                               \
+#define PRIMITIVE_HANDLER_FUNCTIONS(FieldType)                               \
+  template <typename Type>                                                   \
+  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,     \
+                                       Type>::MapEntryAccessorType&          \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                           \
+                 Type>::GetExternalReference(const TypeOnMemory& value) {    \
+    return value;                                                            \
+  }                                                                          \
+  template <typename Type>                                                   \
+  inline size_t MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::     \
+      SpaceUsedInMapEntryLong(const TypeOnMemory& /* value */) {             \
+    return 0;                                                                \
+  }                                                                          \
+  template <typename Type>                                                   \
+  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Clear( \
+      TypeOnMemory* value, Arena* /* arena */) {                             \
+    *value = 0;                                                              \
+  }                                                                          \
+  template <typename Type>                                                   \
+  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Merge( \
+      const MapEntryAccessorType& from, TypeOnMemory* to,                    \
+      Arena* /* arena */) {                                                  \
+    *to = from;                                                              \
+  }                                                                          \
+  template <typename Type>                                                   \
+  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType,               \
+                             Type>::DeleteNoArena(TypeOnMemory& /* x */) {}  \
+  template <typename Type>                                                   \
+  constexpr auto                                                             \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Constinit()        \
+      ->TypeOnMemory {                                                       \
+    return 0;                                                                \
+  }                                                                          \
+  template <typename Type>                                                   \
+  inline typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,           \
+                                 Type>::MapEntryAccessorType*                \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable(     \
+      TypeOnMemory* value, Arena* /* arena */) {                             \
+    return value;                                                            \
+  }                                                                          \
+  template <typename Type>                                                   \
+  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,     \
+                                       Type>::MapEntryAccessorType&          \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                           \
+                 Type>::DefaultIfNotInitialized(const TypeOnMemory& value) { \
+    return value;                                                            \
+  }                                                                          \
+  template <typename Type>                                                   \
+  inline bool                                                                \
+  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::IsInitialized(     \
+      const TypeOnMemory& /* value */) {                                     \
+    return true;                                                             \
   }
 PRIMITIVE_HANDLER_FUNCTIONS(INT64)
 PRIMITIVE_HANDLER_FUNCTIONS(UINT64)
@@ -734,6 +686,6 @@ PRIMITIVE_HANDLER_FUNCTIONS(BOOL)
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
-#endif  // GOOGLE_PROTOBUF_TYPE_HANDLER_H__
+
+#endif  // GOOGLE_PROTOBUF_MAP_TYPE_HANDLER_H__
index 42ec033..7e50ef1 100644 (file)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
+#include <google/protobuf/message.h>
+
 #include <iostream>
 #include <stack>
-#include <google/protobuf/stubs/hash.h>
-
-#include <google/protobuf/message.h>
+#include <unordered_map>
 
+#include <google/protobuf/stubs/casts.h>
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/mutex.h>
-#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/descriptor.pb.h>
+#include <google/protobuf/parse_context.h>
 #include <google/protobuf/reflection_internal.h>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/descriptor.pb.h>
 #include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/generated_message_util.h>
 #include <google/protobuf/map_field.h>
+#include <google/protobuf/map_field_inl.h>
 #include <google/protobuf/reflection_ops.h>
+#include <google/protobuf/unknown_field_set.h>
 #include <google/protobuf/wire_format.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/stubs/strutil.h>
 #include <google/protobuf/stubs/map_util.h>
-#include <google/protobuf/stubs/singleton.h>
 #include <google/protobuf/stubs/stl_util.h>
+#include <google/protobuf/stubs/hash.h>
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
 
-using internal::WireFormat;
+namespace internal {
+
+// TODO(gerbens) make this factorized better. This should not have to hop
+// to reflection. Currently uses GeneratedMessageReflection and thus is
+// defined in generated_message_reflection.cc
+void RegisterFileLevelMetadata(const DescriptorTable* descriptor_table);
+
+}  // namespace internal
+
 using internal::ReflectionOps;
+using internal::WireFormat;
+using internal::WireFormatLite;
 
 void Message::MergeFrom(const Message& from) {
-  const Descriptor* descriptor = GetDescriptor();
-  GOOGLE_CHECK_EQ(from.GetDescriptor(), descriptor)
-    << ": Tried to merge from a message with a different type.  "
-       "to: " << descriptor->full_name() << ", "
-       "from: " << from.GetDescriptor()->full_name();
-  ReflectionOps::Merge(from, this);
+  auto* class_to = GetClassData();
+  auto* class_from = from.GetClassData();
+  auto* merge_to_from = class_to ? class_to->merge_to_from : nullptr;
+  if (class_to == nullptr || class_to != class_from) {
+    merge_to_from = [](Message* to, const Message& from) {
+      ReflectionOps::Merge(from, to);
+    };
+  }
+  merge_to_from(this, from);
 }
 
 void Message::CheckTypeAndMergeFrom(const MessageLite& other) {
@@ -76,80 +95,80 @@ void Message::CheckTypeAndMergeFrom(const MessageLite& other) {
 }
 
 void Message::CopyFrom(const Message& from) {
-  const Descriptor* descriptor = GetDescriptor();
-  GOOGLE_CHECK_EQ(from.GetDescriptor(), descriptor)
-    << ": Tried to copy from a message with a different type. "
-       "to: " << descriptor->full_name() << ", "
-       "from: " << from.GetDescriptor()->full_name();
-  ReflectionOps::Copy(from, this);
+  if (&from == this) return;
+
+  auto* class_to = GetClassData();
+  auto* class_from = from.GetClassData();
+  auto* copy_to_from = class_to ? class_to->copy_to_from : nullptr;
+
+  if (class_to == nullptr || class_to != class_from) {
+    const Descriptor* descriptor = GetDescriptor();
+    GOOGLE_CHECK_EQ(from.GetDescriptor(), descriptor)
+        << ": Tried to copy from a message with a different type. "
+           "to: "
+        << descriptor->full_name()
+        << ", "
+           "from: "
+        << from.GetDescriptor()->full_name();
+    copy_to_from = [](Message* to, const Message& from) {
+      ReflectionOps::Copy(from, to);
+    };
+  }
+  copy_to_from(this, from);
 }
 
-string Message::GetTypeName() const {
-  return GetDescriptor()->full_name();
+void Message::CopyWithSizeCheck(Message* to, const Message& from) {
+#ifndef NDEBUG
+  size_t from_size = from.ByteSizeLong();
+#endif
+  to->Clear();
+#ifndef NDEBUG
+  GOOGLE_CHECK_EQ(from_size, from.ByteSizeLong())
+      << "Source of CopyFrom changed when clearing target.  Either "
+         "source is a nested message in target (not allowed), or "
+         "another thread is modifying the source.";
+#endif
+  to->GetClassData()->merge_to_from(to, from);
 }
 
-void Message::Clear() {
-  ReflectionOps::Clear(this);
+std::string Message::GetTypeName() const {
+  return GetDescriptor()->full_name();
 }
 
+void Message::Clear() { ReflectionOps::Clear(this); }
+
 bool Message::IsInitialized() const {
   return ReflectionOps::IsInitialized(*this);
 }
 
-void Message::FindInitializationErrors(std::vector<string>* errors) const {
+void Message::FindInitializationErrors(std::vector<std::string>* errors) const {
   return ReflectionOps::FindInitializationErrors(*this, "", errors);
 }
 
-string Message::InitializationErrorString() const {
-  std::vector<string> errors;
+std::string Message::InitializationErrorString() const {
+  std::vector<std::string> errors;
   FindInitializationErrors(&errors);
   return Join(errors, ", ");
 }
 
 void Message::CheckInitialized() const {
-  GOOGLE_CHECK(IsInitialized())
-    << "Message of type \"" << GetDescriptor()->full_name()
-    << "\" is missing required fields: " << InitializationErrorString();
+  GOOGLE_CHECK(IsInitialized()) << "Message of type \"" << GetDescriptor()->full_name()
+                         << "\" is missing required fields: "
+                         << InitializationErrorString();
 }
 
 void Message::DiscardUnknownFields() {
   return ReflectionOps::DiscardUnknownFields(this);
 }
 
-bool Message::MergePartialFromCodedStream(io::CodedInputStream* input) {
-  return WireFormat::ParseAndMergePartial(input, this);
-}
-
-bool Message::ParseFromFileDescriptor(int file_descriptor) {
-  io::FileInputStream input(file_descriptor);
-  return ParseFromZeroCopyStream(&input) && input.GetErrno() == 0;
+const char* Message::_InternalParse(const char* ptr,
+                                    internal::ParseContext* ctx) {
+  return WireFormat::_InternalParse(this, ptr, ctx);
 }
 
-bool Message::ParsePartialFromFileDescriptor(int file_descriptor) {
-  io::FileInputStream input(file_descriptor);
-  return ParsePartialFromZeroCopyStream(&input) && input.GetErrno() == 0;
-}
-
-bool Message::ParseFromIstream(std::istream* input) {
-  io::IstreamInputStream zero_copy_input(input);
-  return ParseFromZeroCopyStream(&zero_copy_input) && input->eof();
-}
-
-bool Message::ParsePartialFromIstream(std::istream* input) {
-  io::IstreamInputStream zero_copy_input(input);
-  return ParsePartialFromZeroCopyStream(&zero_copy_input) && input->eof();
-}
-
-
-void Message::SerializeWithCachedSizes(
-    io::CodedOutputStream* output) const {
-  const internal::SerializationTable* table =
-      static_cast<const internal::SerializationTable*>(InternalGetTable());
-  if (table == 0) {
-    WireFormat::SerializeWithCachedSizes(*this, GetCachedSize(), output);
-  } else {
-    internal::TableSerialize(*this, table, output);
-  }
+uint8_t* Message::_InternalSerialize(uint8_t* target,
+                                     io::EpsCopyOutputStream* stream) const {
+  return WireFormat::_InternalSerialize(*this, target, stream);
 }
 
 size_t Message::ByteSizeLong() const {
@@ -164,91 +183,30 @@ void Message::SetCachedSize(int /* size */) const {
                 "Must implement one or the other.";
 }
 
-size_t Message::SpaceUsedLong() const {
-  return GetReflection()->SpaceUsedLong(*this);
-}
-
-bool Message::SerializeToFileDescriptor(int file_descriptor) const {
-  io::FileOutputStream output(file_descriptor);
-  return SerializeToZeroCopyStream(&output) && output.Flush();
-}
-
-bool Message::SerializePartialToFileDescriptor(int file_descriptor) const {
-  io::FileOutputStream output(file_descriptor);
-  return SerializePartialToZeroCopyStream(&output) && output.Flush();
+size_t Message::ComputeUnknownFieldsSize(
+    size_t total_size, internal::CachedSize* cached_size) const {
+  total_size += WireFormat::ComputeUnknownFieldsSize(
+      _internal_metadata_.unknown_fields<UnknownFieldSet>(
+          UnknownFieldSet::default_instance));
+  cached_size->Set(internal::ToCachedSize(total_size));
+  return total_size;
 }
 
-bool Message::SerializeToOstream(std::ostream* output) const {
-  {
-    io::OstreamOutputStream zero_copy_output(output);
-    if (!SerializeToZeroCopyStream(&zero_copy_output)) return false;
+size_t Message::MaybeComputeUnknownFieldsSize(
+    size_t total_size, internal::CachedSize* cached_size) const {
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    return ComputeUnknownFieldsSize(total_size, cached_size);
   }
-  return output->good();
-}
-
-bool Message::SerializePartialToOstream(std::ostream* output) const {
-  io::OstreamOutputStream zero_copy_output(output);
-  return SerializePartialToZeroCopyStream(&zero_copy_output);
+  cached_size->Set(internal::ToCachedSize(total_size));
+  return total_size;
 }
 
-
-// =============================================================================
-// Reflection and associated Template Specializations
-
-Reflection::~Reflection() {}
-
-void Reflection::AddAllocatedMessage(Message* /* message */,
-                                     const FieldDescriptor* /*field */,
-                                     Message* /* new_entry */) const {}
-
-#define HANDLE_TYPE(TYPE, CPPTYPE, CTYPE)                             \
-template<>                                                            \
-const RepeatedField<TYPE>& Reflection::GetRepeatedField<TYPE>(        \
-    const Message& message, const FieldDescriptor* field) const {     \
-  return *static_cast<RepeatedField<TYPE>* >(                         \
-      MutableRawRepeatedField(const_cast<Message*>(&message),         \
-                          field, CPPTYPE, CTYPE, NULL));              \
-}                                                                     \
-                                                                      \
-template<>                                                            \
-RepeatedField<TYPE>* Reflection::MutableRepeatedField<TYPE>(          \
-    Message* message, const FieldDescriptor* field) const {           \
-  return static_cast<RepeatedField<TYPE>* >(                          \
-      MutableRawRepeatedField(message, field, CPPTYPE, CTYPE, NULL)); \
-}
-
-HANDLE_TYPE(int32,  FieldDescriptor::CPPTYPE_INT32,  -1);
-HANDLE_TYPE(int64,  FieldDescriptor::CPPTYPE_INT64,  -1);
-HANDLE_TYPE(uint32, FieldDescriptor::CPPTYPE_UINT32, -1);
-HANDLE_TYPE(uint64, FieldDescriptor::CPPTYPE_UINT64, -1);
-HANDLE_TYPE(float,  FieldDescriptor::CPPTYPE_FLOAT,  -1);
-HANDLE_TYPE(double, FieldDescriptor::CPPTYPE_DOUBLE, -1);
-HANDLE_TYPE(bool,   FieldDescriptor::CPPTYPE_BOOL,   -1);
-
-
-#undef HANDLE_TYPE
-
-void* Reflection::MutableRawRepeatedString(
-    Message* message, const FieldDescriptor* field, bool is_string) const {
-  return MutableRawRepeatedField(message, field,
-      FieldDescriptor::CPPTYPE_STRING, FieldOptions::STRING, NULL);
-}
-
-
-MapIterator Reflection::MapBegin(
-    Message* message,
-    const FieldDescriptor* field) const {
-  GOOGLE_LOG(FATAL) << "Unimplemented Map Reflection API.";
-  MapIterator iter(message, field);
-  return iter;
+size_t Message::SpaceUsedLong() const {
+  return GetReflection()->SpaceUsedLong(*this);
 }
 
-MapIterator Reflection::MapEnd(
-    Message* message,
-    const FieldDescriptor* field) const {
-  GOOGLE_LOG(FATAL) << "Unimplemented Map Reflection API.";
-  MapIterator iter(message, field);
-  return iter;
+uint64_t Message::GetInvariantPerBuild(uint64_t salt) {
+  return salt;
 }
 
 // =============================================================================
@@ -258,63 +216,50 @@ MessageFactory::~MessageFactory() {}
 
 namespace {
 
-class GeneratedMessageFactory : public MessageFactory {
- public:
-  GeneratedMessageFactory();
-  ~GeneratedMessageFactory();
 
+#define HASH_MAP std::unordered_map
+#define STR_HASH_FXN hash<::google::protobuf::StringPiece>
+
+
+class GeneratedMessageFactory final : public MessageFactory {
+ public:
   static GeneratedMessageFactory* singleton();
 
-  typedef void RegistrationFunc(const string&);
-  void RegisterFile(const char* file, RegistrationFunc* registration_func);
+  void RegisterFile(const google::protobuf::internal::DescriptorTable* table);
   void RegisterType(const Descriptor* descriptor, const Message* prototype);
 
   // implements MessageFactory ---------------------------------------
-  const Message* GetPrototype(const Descriptor* type);
+  const Message* GetPrototype(const Descriptor* type) override;
 
  private:
   // Only written at static init time, so does not require locking.
-  hash_map<const char*, RegistrationFunc*,
-           hash<const char*>, streq> file_map_;
+  HASH_MAP<StringPiece, const google::protobuf::internal::DescriptorTable*,
+           STR_HASH_FXN>
+      file_map_;
 
-  Mutex mutex_;
+  internal::WrappedMutex mutex_;
   // Initialized lazily, so requires locking.
-  hash_map<const Descriptor*, const Message*> type_map_;
+  std::unordered_map<const Descriptor*, const Message*> type_map_;
 };
 
-GeneratedMessageFactory* generated_message_factory_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(generated_message_factory_once_init_);
-
-void ShutdownGeneratedMessageFactory() {
-  delete generated_message_factory_;
-}
-
-void InitGeneratedMessageFactory() {
-  generated_message_factory_ = new GeneratedMessageFactory;
-  internal::OnShutdown(&ShutdownGeneratedMessageFactory);
-}
-
-GeneratedMessageFactory::GeneratedMessageFactory() {}
-GeneratedMessageFactory::~GeneratedMessageFactory() {}
-
 GeneratedMessageFactory* GeneratedMessageFactory::singleton() {
-  ::google::protobuf::GoogleOnceInit(&generated_message_factory_once_init_,
-                 &InitGeneratedMessageFactory);
-  return generated_message_factory_;
+  static auto instance =
+      internal::OnShutdownDelete(new GeneratedMessageFactory);
+  return instance;
 }
 
 void GeneratedMessageFactory::RegisterFile(
-    const char* file, RegistrationFunc* registration_func) {
-  if (!InsertIfNotPresent(&file_map_, file, registration_func)) {
-    GOOGLE_LOG(FATAL) << "File is already registered: " << file;
+    const google::protobuf::internal::DescriptorTable* table) {
+  if (!InsertIfNotPresent(&file_map_, table->filename, table)) {
+    GOOGLE_LOG(FATAL) << "File is already registered: " << table->filename;
   }
 }
 
 void GeneratedMessageFactory::RegisterType(const Descriptor* descriptor,
                                            const Message* prototype) {
   GOOGLE_DCHECK_EQ(descriptor->file()->pool(), DescriptorPool::generated_pool())
-    << "Tried to register a non-generated type with the generated "
-       "type registry.";
+      << "Tried to register a non-generated type with the generated "
+         "type registry.";
 
   // This should only be called as a result of calling a file registration
   // function during GetPrototype(), in which case we already have locked
@@ -330,34 +275,35 @@ const Message* GeneratedMessageFactory::GetPrototype(const Descriptor* type) {
   {
     ReaderMutexLock lock(&mutex_);
     const Message* result = FindPtrOrNull(type_map_, type);
-    if (result != NULL) return result;
+    if (result != nullptr) return result;
   }
 
   // If the type is not in the generated pool, then we can't possibly handle
   // it.
-  if (type->file()->pool() != DescriptorPool::generated_pool()) return NULL;
+  if (type->file()->pool() != DescriptorPool::generated_pool()) return nullptr;
 
   // Apparently the file hasn't been registered yet.  Let's do that now.
-  RegistrationFunc* registration_func =
+  const internal::DescriptorTable* registration_data =
       FindPtrOrNull(file_map_, type->file()->name().c_str());
-  if (registration_func == NULL) {
+  if (registration_data == nullptr) {
     GOOGLE_LOG(DFATAL) << "File appears to be in generated pool but wasn't "
-                   "registered: " << type->file()->name();
-    return NULL;
+                   "registered: "
+                << type->file()->name();
+    return nullptr;
   }
 
   WriterMutexLock lock(&mutex_);
 
   // Check if another thread preempted us.
   const Message* result = FindPtrOrNull(type_map_, type);
-  if (result == NULL) {
+  if (result == nullptr) {
     // Nope.  OK, register everything.
-    registration_func(type->file()->name());
+    internal::RegisterFileLevelMetadata(registration_data);
     // Should be here now.
     result = FindPtrOrNull(type_map_, type);
   }
 
-  if (result == NULL) {
+  if (result == nullptr) {
     GOOGLE_LOG(DFATAL) << "Type appears to be in generated pool but wasn't "
                 << "registered: " << type->full_name();
   }
@@ -372,9 +318,8 @@ MessageFactory* MessageFactory::generated_factory() {
 }
 
 void MessageFactory::InternalRegisterGeneratedFile(
-    const char* filename, void (*register_messages)(const string&)) {
-  GeneratedMessageFactory::singleton()->RegisterFile(filename,
-                                                     register_messages);
+    const google::protobuf::internal::DescriptorTable* table) {
+  GeneratedMessageFactory::singleton()->RegisterFile(table);
 }
 
 void MessageFactory::InternalRegisterGeneratedMessage(
@@ -383,111 +328,73 @@ void MessageFactory::InternalRegisterGeneratedMessage(
 }
 
 
-MessageFactory* Reflection::GetMessageFactory() const {
-  GOOGLE_LOG(FATAL) << "Not implemented.";
-  return NULL;
-}
-
-void* Reflection::RepeatedFieldData(
-    Message* message, const FieldDescriptor* field,
-    FieldDescriptor::CppType cpp_type,
-    const Descriptor* message_type) const {
-  GOOGLE_LOG(FATAL) << "Not implemented.";
-  return NULL;
-}
-
-namespace internal {
-RepeatedFieldAccessor::~RepeatedFieldAccessor() {
+namespace {
+template <typename T>
+T* GetSingleton() {
+  static T singleton;
+  return &singleton;
 }
-}  // namespace internal
+}  // namespace
 
 const internal::RepeatedFieldAccessor* Reflection::RepeatedFieldAccessor(
     const FieldDescriptor* field) const {
   GOOGLE_CHECK(field->is_repeated());
   switch (field->cpp_type()) {
 #define HANDLE_PRIMITIVE_TYPE(TYPE, type) \
-    case FieldDescriptor::CPPTYPE_ ## TYPE: \
-      return internal::Singleton<internal::RepeatedFieldPrimitiveAccessor<type> >::get();
-    HANDLE_PRIMITIVE_TYPE(INT32, int32)
-    HANDLE_PRIMITIVE_TYPE(UINT32, uint32)
-    HANDLE_PRIMITIVE_TYPE(INT64, int64)
-    HANDLE_PRIMITIVE_TYPE(UINT64, uint64)
+  case FieldDescriptor::CPPTYPE_##TYPE:   \
+    return GetSingleton<internal::RepeatedFieldPrimitiveAccessor<type> >();
+    HANDLE_PRIMITIVE_TYPE(INT32, int32_t)
+    HANDLE_PRIMITIVE_TYPE(UINT32, uint32_t)
+    HANDLE_PRIMITIVE_TYPE(INT64, int64_t)
+    HANDLE_PRIMITIVE_TYPE(UINT64, uint64_t)
     HANDLE_PRIMITIVE_TYPE(FLOAT, float)
     HANDLE_PRIMITIVE_TYPE(DOUBLE, double)
     HANDLE_PRIMITIVE_TYPE(BOOL, bool)
-    HANDLE_PRIMITIVE_TYPE(ENUM, int32)
+    HANDLE_PRIMITIVE_TYPE(ENUM, int32_t)
 #undef HANDLE_PRIMITIVE_TYPE
     case FieldDescriptor::CPPTYPE_STRING:
       switch (field->options().ctype()) {
         default:
         case FieldOptions::STRING:
-          return internal::Singleton<internal::RepeatedPtrFieldStringAccessor>::get();
+          return GetSingleton<internal::RepeatedPtrFieldStringAccessor>();
       }
       break;
     case FieldDescriptor::CPPTYPE_MESSAGE:
       if (field->is_map()) {
-        return internal::Singleton<internal::MapFieldAccessor>::get();
+        return GetSingleton<internal::MapFieldAccessor>();
       } else {
-        return internal::Singleton<internal::RepeatedPtrFieldMessageAccessor>::get();
+        return GetSingleton<internal::RepeatedPtrFieldMessageAccessor>();
       }
   }
   GOOGLE_LOG(FATAL) << "Should not reach here.";
-  return NULL;
+  return nullptr;
 }
 
 namespace internal {
-namespace {
-void ShutdownRepeatedFieldAccessor() {
-  internal::Singleton<internal::RepeatedFieldPrimitiveAccessor<int32> >::ShutDown();
-  internal::Singleton<internal::RepeatedFieldPrimitiveAccessor<uint32> >::ShutDown();
-  internal::Singleton<internal::RepeatedFieldPrimitiveAccessor<int64> >::ShutDown();
-  internal::Singleton<internal::RepeatedFieldPrimitiveAccessor<uint64> >::ShutDown();
-  internal::Singleton<internal::RepeatedFieldPrimitiveAccessor<float> >::ShutDown();
-  internal::Singleton<internal::RepeatedFieldPrimitiveAccessor<double> >::ShutDown();
-  internal::Singleton<internal::RepeatedFieldPrimitiveAccessor<bool> >::ShutDown();
-  internal::Singleton<internal::RepeatedPtrFieldStringAccessor>::ShutDown();
-  internal::Singleton<internal::RepeatedPtrFieldMessageAccessor>::ShutDown();
-  internal::Singleton<internal::MapFieldAccessor>::ShutDown();
-}
-
-struct ShutdownRepeatedFieldRegister {
-  ShutdownRepeatedFieldRegister() {
-    OnShutdown(&ShutdownRepeatedFieldAccessor);
-  }
-} shutdown_;
-
-}  // namespace
-}  // namespace internal
-
-namespace internal {
-template<>
+template <>
 #if defined(_MSC_VER) && (_MSC_VER >= 1800)
-// Note: force noinline to workaround MSVC compiler bug with /Zc:inline, issue #240
-GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
+// Note: force noinline to workaround MSVC compiler bug with /Zc:inline, issue
+// #240
+PROTOBUF_NOINLINE
 #endif
-Message* GenericTypeHandler<Message>::NewFromPrototype(
-    const Message* prototype, google::protobuf::Arena* arena) {
+    Message*
+    GenericTypeHandler<Message>::NewFromPrototype(const Message* prototype,
+                                                  Arena* arena) {
   return prototype->New(arena);
 }
-template<>
+template <>
 #if defined(_MSC_VER) && (_MSC_VER >= 1800)
-// Note: force noinline to workaround MSVC compiler bug with /Zc:inline, issue #240
-GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
+// Note: force noinline to workaround MSVC compiler bug with /Zc:inline, issue
+// #240
+PROTOBUF_NOINLINE
 #endif
-google::protobuf::Arena* GenericTypeHandler<Message>::GetArena(
-    Message* value) {
-  return value->GetArena();
-}
-template<>
-#if defined(_MSC_VER) && (_MSC_VER >= 1800)
-// Note: force noinline to workaround MSVC compiler bug with /Zc:inline, issue #240
-GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
-#endif
-void* GenericTypeHandler<Message>::GetMaybeArenaPointer(
-    Message* value) {
-  return value->GetMaybeArenaPointer();
+    Arena*
+    GenericTypeHandler<Message>::GetOwningArena(Message* value) {
+  return value->GetOwningArena();
 }
 }  // namespace internal
 
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index ab01859..a086945 100644 (file)
@@ -49,7 +49,7 @@
 // Then, if you used the protocol compiler to generate a class from the above
 // definition, you could use it like so:
 //
-//   string data;  // Will store a serialized version of the message.
+//   std::string data;  // Will store a serialized version of the message.
 //
 //   {
 //     // Create a message and serialize it.
 //     // Get the descriptors for the fields we're interested in and verify
 //     // their types.
 //     const FieldDescriptor* text_field = descriptor->FindFieldByName("text");
-//     assert(text_field != NULL);
+//     assert(text_field != nullptr);
 //     assert(text_field->type() == FieldDescriptor::TYPE_STRING);
 //     assert(text_field->label() == FieldDescriptor::LABEL_OPTIONAL);
 //     const FieldDescriptor* numbers_field = descriptor->
 //                                            FindFieldByName("numbers");
-//     assert(numbers_field != NULL);
+//     assert(numbers_field != nullptr);
 //     assert(numbers_field->type() == FieldDescriptor::TYPE_INT32);
 //     assert(numbers_field->label() == FieldDescriptor::LABEL_REPEATED);
 //
 
 #include <iosfwd>
 #include <string>
-#include <google/protobuf/stubs/type_traits.h>
+#include <type_traits>
 #include <vector>
 
-#include <google/protobuf/arena.h>
-#include <google/protobuf/message_lite.h>
-
+#include <google/protobuf/stubs/casts.h>
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/arena.h>
 #include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/port.h>
 
 
 #define GOOGLE_PROTOBUF_HAS_ONEOF
 #define GOOGLE_PROTOBUF_HAS_ARENAS
 
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
 namespace google {
 namespace protobuf {
 
@@ -134,37 +143,57 @@ class Reflection;
 class MessageFactory;
 
 // Defined in other files.
+class AssignDescriptorsHelper;
+class DynamicMessageFactory;
+class DynamicMessageReflectionHelper;
+class GeneratedMessageReflectionTestHelper;
 class MapKey;
+class MapValueConstRef;
 class MapValueRef;
 class MapIterator;
 class MapReflectionTester;
 
 namespace internal {
+struct DescriptorTable;
 class MapFieldBase;
-}
-class UnknownFieldSet;         // unknown_field_set.h
+class SwapFieldHelper;
+class CachedSize;
+}  // namespace internal
+class UnknownFieldSet;  // unknown_field_set.h
 namespace io {
-class ZeroCopyInputStream;     // zero_copy_stream.h
-class ZeroCopyOutputStream;    // zero_copy_stream.h
-class CodedInputStream;        // coded_stream.h
-class CodedOutputStream;       // coded_stream.h
-}
+class ZeroCopyInputStream;   // zero_copy_stream.h
+class ZeroCopyOutputStream;  // zero_copy_stream.h
+class CodedInputStream;      // coded_stream.h
+class CodedOutputStream;     // coded_stream.h
+}  // namespace io
 namespace python {
-class MapReflectionFriend;     // scalar_map_container.h
+class MapReflectionFriend;  // scalar_map_container.h
+class MessageReflectionFriend;
+}  // namespace python
+namespace expr {
+class CelMapReflectionFriend;  // field_backed_map_impl.cc
+}
+
+namespace internal {
+class MapFieldPrinterHelper;  // text_format.cc
+}
+namespace util {
+class MessageDifferencer;
 }
 
 
 namespace internal {
-class ReflectionOps;     // reflection_ops.h
-class MapKeySorter;      // wire_format.cc
-class WireFormat;        // wire_format.h
+class ReflectionAccessor;      // message.cc
+class ReflectionOps;           // reflection_ops.h
+class MapKeySorter;            // wire_format.cc
+class WireFormat;              // wire_format.h
 class MapFieldReflectionTest;  // map_test.cc
-}
+}  // namespace internal
 
-template<typename T>
-class RepeatedField;     // repeated_field.h
+template <typename T>
+class RepeatedField;  // repeated_field.h
 
-template<typename T>
+template <typename T>
 class RepeatedPtrField;  // repeated_field.h
 
 // A container to hold message metadata.
@@ -173,6 +202,26 @@ struct Metadata {
   const Reflection* reflection;
 };
 
+namespace internal {
+template <class To>
+inline To* GetPointerAtOffset(Message* message, uint32_t offset) {
+  return reinterpret_cast<To*>(reinterpret_cast<char*>(message) + offset);
+}
+
+template <class To>
+const To* GetConstPointerAtOffset(const Message* message, uint32_t offset) {
+  return reinterpret_cast<const To*>(reinterpret_cast<const char*>(message) +
+                                     offset);
+}
+
+template <class To>
+const To& GetConstRefAtOffset(const Message& message, uint32_t offset) {
+  return *GetConstPointerAtOffset<To>(&message, offset);
+}
+
+bool CreateUnknownEnumValues(const FieldDescriptor* field);
+}  // namespace internal
+
 // Abstract interface for protocol messages.
 //
 // See also MessageLite, which contains most every-day operations.  Message
@@ -183,28 +232,23 @@ struct Metadata {
 // optimized for speed will want to override these with faster implementations,
 // but classes optimized for code size may be happy with keeping them.  See
 // the optimize_for option in descriptor.proto.
-class LIBPROTOBUF_EXPORT Message : public MessageLite {
+//
+// Users must not derive from this class. Only the protocol compiler and
+// the internal library are allowed to create subclasses.
+class PROTOBUF_EXPORT Message : public MessageLite {
  public:
-  inline Message() {}
-  virtual ~Message() {}
+  constexpr Message() {}
 
   // Basic Operations ------------------------------------------------
 
   // Construct a new instance of the same type.  Ownership is passed to the
   // caller.  (This is also defined in MessageLite, but is defined again here
   // for return-type covariance.)
-  virtual Message* New() const = 0;
+  Message* New() const { return New(nullptr); }
 
   // Construct a new instance on the arena. Ownership is passed to the caller
-  // if arena is a NULL. Default implementation allows for API compatibility
-  // during the Arena transition.
-  virtual Message* New(::google::protobuf::Arena* arena) const {
-    Message* message = New();
-    if (arena != NULL) {
-      arena->Own(message);
-    }
-    return message;
-  }
+  // if arena is a nullptr.
+  Message* New(Arena* arena) const override = 0;
 
   // Make this message into a copy of the given message.  The given message
   // must have the same descriptor, but need not necessarily be the same class.
@@ -226,11 +270,11 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite {
   // This is much, much slower than IsInitialized() as it is implemented
   // purely via reflection.  Generally, you should not call this unless you
   // have already determined that an error exists by calling IsInitialized().
-  void FindInitializationErrors(std::vector<string>* errors) const;
+  void FindInitializationErrors(std::vector<std::string>* errors) const;
 
   // Like FindInitializationErrors, but joins all the strings, delimited by
   // commas, and returns them.
-  string InitializationErrorString() const;
+  std::string InitializationErrorString() const override;
 
   // Clears all unknown fields from this message and all embedded messages.
   // Normally, if unknown tag numbers are encountered when parsing a message,
@@ -242,7 +286,7 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite {
   // method after parsing.
   //
   // See Reflection::GetUnknownFields() for more on unknown fields.
-  virtual void DiscardUnknownFields();
+  void DiscardUnknownFields();
 
   // Computes (an estimate of) the total number of bytes currently used for
   // storing the message in memory.  The default implementation calls the
@@ -254,61 +298,39 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite {
   // fields defined for the proto.
   virtual size_t SpaceUsedLong() const;
 
-  PROTOBUF_RUNTIME_DEPRECATED("Please use SpaceUsedLong() instead")
+  PROTOBUF_DEPRECATED_MSG("Please use SpaceUsedLong() instead")
   int SpaceUsed() const { return internal::ToIntSize(SpaceUsedLong()); }
 
   // Debugging & Testing----------------------------------------------
 
   // Generates a human readable form of this message, useful for debugging
   // and other purposes.
-  string DebugString() const;
+  std::string DebugString() const;
   // Like DebugString(), but with less whitespace.
-  string ShortDebugString() const;
+  std::string ShortDebugString() const;
   // Like DebugString(), but do not escape UTF-8 byte sequences.
-  string Utf8DebugString() const;
+  std::string Utf8DebugString() const;
   // Convenience function useful in GDB.  Prints DebugString() to stdout.
   void PrintDebugString() const;
 
-  // Heavy I/O -------------------------------------------------------
-  // Additional parsing and serialization methods not implemented by
-  // MessageLite because they are not supported by the lite library.
-
-  // Parse a protocol buffer from a file descriptor.  If successful, the entire
-  // input will be consumed.
-  bool ParseFromFileDescriptor(int file_descriptor);
-  // Like ParseFromFileDescriptor(), but accepts messages that are missing
-  // required fields.
-  bool ParsePartialFromFileDescriptor(int file_descriptor);
-  // Parse a protocol buffer from a C++ istream.  If successful, the entire
-  // input will be consumed.
-  bool ParseFromIstream(std::istream* input);
-  // Like ParseFromIstream(), but accepts messages that are missing
-  // required fields.
-  bool ParsePartialFromIstream(std::istream* input);
-
-  // Serialize the message and write it to the given file descriptor.  All
-  // required fields must be set.
-  bool SerializeToFileDescriptor(int file_descriptor) const;
-  // Like SerializeToFileDescriptor(), but allows missing required fields.
-  bool SerializePartialToFileDescriptor(int file_descriptor) const;
-  // Serialize the message and write it to the given C++ ostream.  All
-  // required fields must be set.
-  bool SerializeToOstream(std::ostream* output) const;
-  // Like SerializeToOstream(), but allows missing required fields.
-  bool SerializePartialToOstream(std::ostream* output) const;
-
-
   // Reflection-based methods ----------------------------------------
   // These methods are pure-virtual in MessageLite, but Message provides
   // reflection-based default implementations.
 
-  virtual string GetTypeName() const;
-  virtual void Clear();
-  virtual bool IsInitialized() const;
-  virtual void CheckTypeAndMergeFrom(const MessageLite& other);
-  virtual bool MergePartialFromCodedStream(io::CodedInputStream* input);
-  virtual size_t ByteSizeLong() const;
-  virtual void SerializeWithCachedSizes(io::CodedOutputStream* output) const;
+  std::string GetTypeName() const override;
+  void Clear() override;
+
+  // Returns whether all required fields have been set. Note that required
+  // fields no longer exist starting in proto3.
+  bool IsInitialized() const override;
+
+  void CheckTypeAndMergeFrom(const MessageLite& other) override;
+  // Reflective parser
+  const char* _InternalParse(const char* ptr,
+                             internal::ParseContext* ctx) override;
+  size_t ByteSizeLong() const override;
+  uint8_t* _InternalSerialize(uint8_t* target,
+                              io::EpsCopyOutputStream* stream) const override;
 
  private:
   // This is called only by the default implementation of ByteSize(), to
@@ -321,11 +343,8 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite {
   virtual void SetCachedSize(int size) const;
 
  public:
-
   // Introspection ---------------------------------------------------
 
-  // Typedef for backwards-compatibility.
-  typedef google::protobuf::Reflection Reflection;
 
   // 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.
@@ -336,19 +355,43 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite {
   // 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 PROTOBUF_FINAL {
-    return GetMetadata().reflection;
-  }
+  const Reflection* GetReflection() const { return GetMetadata().reflection; }
 
  protected:
-  // Get a struct containing the metadata for the Message. Most subclasses only
-  // need to implement this method, rather than the GetDescriptor() and
-  // GetReflection() wrappers.
-  virtual Metadata GetMetadata() const  = 0;
+  // Get a struct containing the metadata for the Message, which is used in turn
+  // to implement GetDescriptor() and GetReflection() above.
+  virtual Metadata GetMetadata() const = 0;
+
+  struct ClassData {
+    // Note: The order of arguments (to, then from) is chosen so that the ABI
+    // of this function is the same as the CopyFrom method.  That is, the
+    // hidden "this" parameter comes first.
+    void (*copy_to_from)(Message* to, const Message& from_msg);
+    void (*merge_to_from)(Message* to, const Message& from_msg);
+  };
+  // GetClassData() returns a pointer to a ClassData struct which
+  // exists in global memory and is unique to each subclass.  This uniqueness
+  // property is used in order to quickly determine whether two messages are
+  // of the same type.
+  // TODO(jorg): change to pure virtual
+  virtual const ClassData* GetClassData() const { return nullptr; }
+
+  // CopyWithSizeCheck calls Clear() and then MergeFrom(), and in debug
+  // builds, checks that calling Clear() on the destination message doesn't
+  // alter the size of the source.  It assumes the messages are known to be
+  // of the same type, and thus uses GetClassData().
+  static void CopyWithSizeCheck(Message* to, const Message& from);
+
+  inline explicit Message(Arena* arena, bool is_message_owned = false)
+      : MessageLite(arena, is_message_owned) {}
+  size_t ComputeUnknownFieldsSize(size_t total_size,
+                                  internal::CachedSize* cached_size) const;
+  size_t MaybeComputeUnknownFieldsSize(size_t total_size,
+                                       internal::CachedSize* cached_size) const;
+
 
+ protected:
+  static uint64_t GetInvariantPerBuild(uint64_t salt);
 
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Message);
@@ -362,10 +405,10 @@ class RepeatedFieldAccessor;
 
 // Forward-declare RepeatedFieldRef templates. The second type parameter is
 // used for SFINAE tricks. Users should ignore it.
-template<typename T, typename Enable = void>
+template <typename T, typename Enable = void>
 class RepeatedFieldRef;
 
-template<typename T, typename Enable = void>
+template <typename T, typename Enable = void>
 class MutableRepeatedFieldRef;
 
 // This interface contains methods that can be used to dynamically access
@@ -406,67 +449,46 @@ class MutableRepeatedFieldRef;
 // double the message's memory footprint, probably worse.  Allocating the
 // objects on-demand, on the other hand, would be expensive and prone to
 // memory leaks.  So, instead we ended up with this flat interface.
-//
-// TODO(kenton):  Create a utility class which callers can use to read and
-//   write fields from a Reflection without paying attention to the type.
-class LIBPROTOBUF_EXPORT Reflection {
+class PROTOBUF_EXPORT Reflection final {
  public:
-  inline Reflection() {}
-  virtual ~Reflection();
-
   // Get the UnknownFieldSet for the message.  This contains fields which
   // were seen when the Message was parsed but were not recognized according
-  // to the Message's definition. For proto3 protos, this method will always
-  // return an empty UnknownFieldSet.
-  virtual const UnknownFieldSet& GetUnknownFields(
-      const Message& message) const = 0;
+  // to the Message's definition.
+  const UnknownFieldSet& GetUnknownFields(const Message& message) const;
   // Get a mutable pointer to the UnknownFieldSet for the message.  This
   // contains fields which were seen when the Message was parsed but were not
-  // recognized according to the Message's definition. For proto3 protos, this
-  // method will return a valid mutable UnknownFieldSet pointer but modifying
-  // it won't affect the serialized bytes of the message.
-  virtual UnknownFieldSet* MutableUnknownFields(Message* message) const = 0;
+  // recognized according to the Message's definition.
+  UnknownFieldSet* MutableUnknownFields(Message* message) const;
 
   // Estimate the amount of memory used by the message object.
-  virtual size_t SpaceUsedLong(const Message& message) const = 0;
+  size_t SpaceUsedLong(const Message& message) const;
 
-  PROTOBUF_RUNTIME_DEPRECATED("Please use SpaceUsedLong() instead")
+  PROTOBUF_DEPRECATED_MSG("Please use SpaceUsedLong() instead")
   int SpaceUsed(const Message& message) const {
     return internal::ToIntSize(SpaceUsedLong(message));
   }
 
   // Check if the given non-repeated field is set.
-  virtual bool HasField(const Message& message,
-                        const FieldDescriptor* field) const = 0;
+  bool HasField(const Message& message, const FieldDescriptor* field) const;
 
   // Get the number of elements of a repeated field.
-  virtual int FieldSize(const Message& message,
-                        const FieldDescriptor* field) const = 0;
+  int FieldSize(const Message& message, const FieldDescriptor* field) const;
 
   // Clear the value of a field, so that HasField() returns false or
   // FieldSize() returns zero.
-  virtual void ClearField(Message* message,
-                          const FieldDescriptor* field) const = 0;
+  void ClearField(Message* message, const FieldDescriptor* field) const;
 
   // Check if the oneof is set. Returns true if any field in oneof
   // is set, false otherwise.
-  // TODO(jieluo) - make it pure virtual after updating all
-  // the subclasses.
-  virtual bool HasOneof(const Message& /*message*/,
-                        const OneofDescriptor* /*oneof_descriptor*/) const {
-    return false;
-  }
+  bool HasOneof(const Message& message,
+                const OneofDescriptor* oneof_descriptor) const;
 
-  virtual void ClearOneof(Message* /*message*/,
-                          const OneofDescriptor* /*oneof_descriptor*/) const {}
+  void ClearOneof(Message* message,
+                  const OneofDescriptor* oneof_descriptor) const;
 
-  // Returns the field descriptor if the oneof is set. NULL otherwise.
-  // TODO(jieluo) - make it pure virtual.
-  virtual const FieldDescriptor* GetOneofFieldDescriptor(
-      const Message& /*message*/,
-      const OneofDescriptor* /*oneof_descriptor*/) const {
-    return NULL;
-  }
+  // Returns the field descriptor if the oneof is set. nullptr otherwise.
+  const FieldDescriptor* GetOneofFieldDescriptor(
+      const Message& message, const OneofDescriptor* oneof_descriptor) const;
 
   // Removes the last element of a repeated field.
   // We don't provide a way to remove any element other than the last
@@ -475,27 +497,38 @@ class LIBPROTOBUF_EXPORT Reflection {
   // than the last, the best way to do it is to re-arrange the elements
   // (using Swap()) so that the one you want removed is at the end, then
   // call RemoveLast().
-  virtual void RemoveLast(Message* message,
-                          const FieldDescriptor* field) const = 0;
+  void RemoveLast(Message* message, const FieldDescriptor* field) const;
   // Removes the last element of a repeated message field, and returns the
   // pointer to the caller.  Caller takes ownership of the returned pointer.
-  virtual Message* ReleaseLast(Message* message,
-                               const FieldDescriptor* field) const = 0;
+  PROTOBUF_NODISCARD Message* ReleaseLast(Message* message,
+                                          const FieldDescriptor* field) const;
+
+  // Similar to ReleaseLast() without internal safety and ownershp checks. This
+  // method should only be used when the objects are on the same arena or paired
+  // with a call to `UnsafeArenaAddAllocatedMessage`.
+  Message* UnsafeArenaReleaseLast(Message* message,
+                                  const FieldDescriptor* field) const;
 
   // Swap the complete contents of two messages.
-  virtual void Swap(Message* message1, Message* message2) const = 0;
+  void Swap(Message* message1, Message* message2) const;
 
   // Swap fields listed in fields vector of two messages.
-  virtual void SwapFields(Message* message1,
-                          Message* message2,
-                          const std::vector<const FieldDescriptor*>& fields)
-      const = 0;
+  void SwapFields(Message* message1, Message* message2,
+                  const std::vector<const FieldDescriptor*>& fields) const;
 
   // Swap two elements of a repeated field.
-  virtual void SwapElements(Message* message,
-                            const FieldDescriptor* field,
-                            int index1,
-                            int index2) const = 0;
+  void SwapElements(Message* message, const FieldDescriptor* field, int index1,
+                    int index2) const;
+
+  // Swap without internal safety and ownership checks. This method should only
+  // be used when the objects are on the same arena.
+  void UnsafeArenaSwap(Message* lhs, Message* rhs) const;
+
+  // SwapFields without internal safety and ownership checks. This method should
+  // only be used when the objects are on the same arena.
+  void UnsafeArenaSwapFields(
+      Message* lhs, Message* rhs,
+      const std::vector<const FieldDescriptor*>& fields) const;
 
   // 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).
@@ -505,96 +538,89 @@ class LIBPROTOBUF_EXPORT Reflection {
   // 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;
+  void ListFields(const Message& message,
+                  std::vector<const FieldDescriptor*>* output) const;
 
   // Singular field getters ------------------------------------------
   // These get the value of a non-repeated field.  They return the default
   // value for fields that aren't set.
 
-  virtual int32  GetInt32 (const Message& message,
-                           const FieldDescriptor* field) const = 0;
-  virtual int64  GetInt64 (const Message& message,
-                           const FieldDescriptor* field) const = 0;
-  virtual uint32 GetUInt32(const Message& message,
-                           const FieldDescriptor* field) const = 0;
-  virtual uint64 GetUInt64(const Message& message,
-                           const FieldDescriptor* field) const = 0;
-  virtual float  GetFloat (const Message& message,
-                           const FieldDescriptor* field) const = 0;
-  virtual double GetDouble(const Message& message,
-                           const FieldDescriptor* field) const = 0;
-  virtual bool   GetBool  (const Message& message,
-                           const FieldDescriptor* field) const = 0;
-  virtual string GetString(const Message& message,
-                           const FieldDescriptor* field) const = 0;
-  virtual const EnumValueDescriptor* GetEnum(
-      const Message& message, const FieldDescriptor* field) const = 0;
+  int32_t GetInt32(const Message& message, const FieldDescriptor* field) const;
+  int64_t GetInt64(const Message& message, const FieldDescriptor* field) const;
+  uint32_t GetUInt32(const Message& message,
+                     const FieldDescriptor* field) const;
+  uint64_t GetUInt64(const Message& message,
+                     const FieldDescriptor* field) const;
+  float GetFloat(const Message& message, const FieldDescriptor* field) const;
+  double GetDouble(const Message& message, const FieldDescriptor* field) const;
+  bool GetBool(const Message& message, const FieldDescriptor* field) const;
+  std::string GetString(const Message& message,
+                        const FieldDescriptor* field) const;
+  const EnumValueDescriptor* GetEnum(const Message& message,
+                                     const FieldDescriptor* field) const;
 
   // GetEnumValue() returns an enum field's value as an integer rather than
   // an EnumValueDescriptor*. If the integer value does not correspond to a
   // known value descriptor, a new value descriptor is created. (Such a value
   // will only be present when the new unknown-enum-value semantics are enabled
   // for a message.)
-  virtual int GetEnumValue(
-      const Message& message, const FieldDescriptor* field) const = 0;
+  int GetEnumValue(const Message& message, const FieldDescriptor* field) const;
 
   // See MutableMessage() for the meaning of the "factory" parameter.
-  virtual const Message& GetMessage(const Message& message,
-                                    const FieldDescriptor* field,
-                                    MessageFactory* factory = NULL) const = 0;
+  const Message& GetMessage(const Message& message,
+                            const FieldDescriptor* field,
+                            MessageFactory* factory = nullptr) const;
 
   // Get a string value without copying, if possible.
   //
   // GetString() necessarily returns a copy of the string.  This can be
-  // inefficient when the string is already stored in a string object in the
-  // underlying message.  GetStringReference() will return a reference to the
-  // underlying string in this case.  Otherwise, it will copy the string into
-  // *scratch and return that.
+  // inefficient when the std::string is already stored in a std::string object
+  // in the underlying message.  GetStringReference() will return a reference to
+  // the underlying std::string in this case.  Otherwise, it will copy the
+  // string into *scratch and return that.
   //
   // Note:  It is perfectly reasonable and useful to write code like:
-  //     str = reflection->GetStringReference(field, &str);
+  //     str = reflection->GetStringReference(message, field, &str);
   //   This line would ensure that only one copy of the string is made
   //   regardless of the field's underlying representation.  When initializing
-  //   a newly-constructed string, though, it's just as fast and more readable
-  //   to use code like:
-  //     string str = reflection->GetString(message, field);
-  virtual const string& GetStringReference(const Message& message,
-                                           const FieldDescriptor* field,
-                                           string* scratch) const = 0;
+  //   a newly-constructed string, though, it's just as fast and more
+  //   readable to use code like:
+  //     std::string str = reflection->GetString(message, field);
+  const std::string& GetStringReference(const Message& message,
+                                        const FieldDescriptor* field,
+                                        std::string* scratch) const;
 
 
   // Singular field mutators -----------------------------------------
   // These mutate the value of a non-repeated field.
 
-  virtual void SetInt32 (Message* message,
-                         const FieldDescriptor* field, int32  value) const = 0;
-  virtual void SetInt64 (Message* message,
-                         const FieldDescriptor* field, int64  value) const = 0;
-  virtual void SetUInt32(Message* message,
-                         const FieldDescriptor* field, uint32 value) const = 0;
-  virtual void SetUInt64(Message* message,
-                         const FieldDescriptor* field, uint64 value) const = 0;
-  virtual void SetFloat (Message* message,
-                         const FieldDescriptor* field, float  value) const = 0;
-  virtual void SetDouble(Message* message,
-                         const FieldDescriptor* field, double value) const = 0;
-  virtual void SetBool  (Message* message,
-                         const FieldDescriptor* field, bool   value) const = 0;
-  virtual void SetString(Message* message,
-                         const FieldDescriptor* field,
-                         const string& value) const = 0;
-  virtual void SetEnum  (Message* message,
-                         const FieldDescriptor* field,
-                         const EnumValueDescriptor* value) const = 0;
+  void SetInt32(Message* message, const FieldDescriptor* field,
+                int32_t value) const;
+  void SetInt64(Message* message, const FieldDescriptor* field,
+                int64_t value) const;
+  void SetUInt32(Message* message, const FieldDescriptor* field,
+                 uint32_t value) const;
+  void SetUInt64(Message* message, const FieldDescriptor* field,
+                 uint64_t value) const;
+  void SetFloat(Message* message, const FieldDescriptor* field,
+                float value) const;
+  void SetDouble(Message* message, const FieldDescriptor* field,
+                 double value) const;
+  void SetBool(Message* message, const FieldDescriptor* field,
+               bool value) const;
+  void SetString(Message* message, const FieldDescriptor* field,
+                 std::string value) const;
+  void SetEnum(Message* message, const FieldDescriptor* field,
+               const EnumValueDescriptor* value) const;
   // Set an enum field's value with an integer rather than EnumValueDescriptor.
-  // If the value does not correspond to a known enum value, either behavior is
-  // undefined (for proto2 messages), or the value is accepted silently for
-  // messages with new unknown-enum-value semantics.
-  virtual void SetEnumValue(Message* message,
-                            const FieldDescriptor* field,
-                            int value) const = 0;
+  // For proto3 this is just setting the enum field to the value specified, for
+  // proto2 it's more complicated. If value is a known enum value the field is
+  // set as usual. If the value is unknown then it is added to the unknown field
+  // set. Note this matches the behavior of parsing unknown enum values.
+  // If multiple calls with unknown values happen than they are all added to the
+  // unknown field set in order of the calls.
+  void SetEnumValue(Message* message, const FieldDescriptor* field,
+                    int value) const;
 
   // Get a mutable pointer to a field with a message type.  If a MessageFactory
   // is provided, it will be used to construct instances of the sub-message;
@@ -606,161 +632,163 @@ class LIBPROTOBUF_EXPORT Reflection {
   // FieldDescriptor is for a compiled-in extension, then
   // factory->GetPrototype(field->message_type()) MUST return an instance of
   // the compiled-in class for this type, NOT DynamicMessage.
-  virtual Message* MutableMessage(Message* message,
-                                  const FieldDescriptor* field,
-                                  MessageFactory* factory = NULL) const = 0;
+  Message* MutableMessage(Message* message, const FieldDescriptor* field,
+                          MessageFactory* factory = nullptr) const;
+
   // Replaces the message specified by 'field' with the already-allocated object
   // sub_message, passing ownership to the message.  If the field contained a
-  // message, that message is deleted.  If sub_message is NULL, the field is
+  // message, that message is deleted.  If sub_message is nullptr, the field is
   // cleared.
-  virtual void SetAllocatedMessage(Message* message,
-                                   Message* sub_message,
-                                   const FieldDescriptor* field) const = 0;
+  void SetAllocatedMessage(Message* message, Message* sub_message,
+                           const FieldDescriptor* field) const;
+
+  // Similar to `SetAllocatedMessage`, but omits all internal safety and
+  // ownership checks.  This method should only be used when the objects are on
+  // the same arena or paired with a call to `UnsafeArenaReleaseMessage`.
+  void UnsafeArenaSetAllocatedMessage(Message* message, Message* sub_message,
+                                      const FieldDescriptor* field) const;
+
   // Releases the message specified by 'field' and returns the pointer,
   // ReleaseMessage() will return the message the message object if it exists.
-  // Otherwise, it may or may not return NULL.  In any case, if the return value
-  // is non-NULL, the caller takes ownership of the pointer.
+  // Otherwise, it may or may not return nullptr.  In any case, if the return
+  // value is non-null, the caller takes ownership of the pointer.
   // If the field existed (HasField() is true), then the returned pointer will
   // be the same as the pointer returned by MutableMessage().
   // This function has the same effect as ClearField().
-  virtual Message* ReleaseMessage(Message* message,
-                                  const FieldDescriptor* field,
-                                  MessageFactory* factory = NULL) const = 0;
+  PROTOBUF_NODISCARD Message* ReleaseMessage(
+      Message* message, const FieldDescriptor* field,
+      MessageFactory* factory = nullptr) const;
+
+  // Similar to `ReleaseMessage`, but omits all internal safety and ownership
+  // checks.  This method should only be used when the objects are on the same
+  // arena or paired with a call to `UnsafeArenaSetAllocatedMessage`.
+  Message* UnsafeArenaReleaseMessage(Message* message,
+                                     const FieldDescriptor* field,
+                                     MessageFactory* factory = nullptr) const;
 
 
   // Repeated field getters ------------------------------------------
   // These get the value of one element of a repeated field.
 
-  virtual int32  GetRepeatedInt32 (const Message& message,
-                                   const FieldDescriptor* field,
-                                   int index) const = 0;
-  virtual int64  GetRepeatedInt64 (const Message& message,
-                                   const FieldDescriptor* field,
-                                   int index) const = 0;
-  virtual uint32 GetRepeatedUInt32(const Message& message,
-                                   const FieldDescriptor* field,
-                                   int index) const = 0;
-  virtual uint64 GetRepeatedUInt64(const Message& message,
-                                   const FieldDescriptor* field,
-                                   int index) const = 0;
-  virtual float  GetRepeatedFloat (const Message& message,
-                                   const FieldDescriptor* field,
-                                   int index) const = 0;
-  virtual double GetRepeatedDouble(const Message& message,
-                                   const FieldDescriptor* field,
-                                   int index) const = 0;
-  virtual bool   GetRepeatedBool  (const Message& message,
-                                   const FieldDescriptor* field,
-                                   int index) const = 0;
-  virtual string GetRepeatedString(const Message& message,
-                                   const FieldDescriptor* field,
-                                   int index) const = 0;
-  virtual const EnumValueDescriptor* GetRepeatedEnum(
-      const Message& message,
-      const FieldDescriptor* field, int index) const = 0;
+  int32_t GetRepeatedInt32(const Message& message, const FieldDescriptor* field,
+                           int index) const;
+  int64_t GetRepeatedInt64(const Message& message, const FieldDescriptor* field,
+                           int index) const;
+  uint32_t GetRepeatedUInt32(const Message& message,
+                             const FieldDescriptor* field, int index) const;
+  uint64_t GetRepeatedUInt64(const Message& message,
+                             const FieldDescriptor* field, int index) const;
+  float GetRepeatedFloat(const Message& message, const FieldDescriptor* field,
+                         int index) const;
+  double GetRepeatedDouble(const Message& message, const FieldDescriptor* field,
+                           int index) const;
+  bool GetRepeatedBool(const Message& message, const FieldDescriptor* field,
+                       int index) const;
+  std::string GetRepeatedString(const Message& message,
+                                const FieldDescriptor* field, int index) const;
+  const EnumValueDescriptor* GetRepeatedEnum(const Message& message,
+                                             const FieldDescriptor* field,
+                                             int index) const;
   // GetRepeatedEnumValue() returns an enum field's value as an integer rather
   // than an EnumValueDescriptor*. If the integer value does not correspond to a
   // known value descriptor, a new value descriptor is created. (Such a value
   // will only be present when the new unknown-enum-value semantics are enabled
   // for a message.)
-  virtual int GetRepeatedEnumValue(
-      const Message& message,
-      const FieldDescriptor* field, int index) const = 0;
-  virtual const Message& GetRepeatedMessage(
-      const Message& message,
-      const FieldDescriptor* field, int index) const = 0;
+  int GetRepeatedEnumValue(const Message& message, const FieldDescriptor* field,
+                           int index) const;
+  const Message& GetRepeatedMessage(const Message& message,
+                                    const FieldDescriptor* field,
+                                    int index) const;
 
   // See GetStringReference(), above.
-  virtual const string& GetRepeatedStringReference(
-      const Message& message, const FieldDescriptor* field,
-      int index, string* scratch) const = 0;
+  const std::string& GetRepeatedStringReference(const Message& message,
+                                                const FieldDescriptor* field,
+                                                int index,
+                                                std::string* scratch) const;
 
 
   // Repeated field mutators -----------------------------------------
   // These mutate the value of one element of a repeated field.
 
-  virtual void SetRepeatedInt32 (Message* message,
-                                 const FieldDescriptor* field,
-                                 int index, int32  value) const = 0;
-  virtual void SetRepeatedInt64 (Message* message,
-                                 const FieldDescriptor* field,
-                                 int index, int64  value) const = 0;
-  virtual void SetRepeatedUInt32(Message* message,
-                                 const FieldDescriptor* field,
-                                 int index, uint32 value) const = 0;
-  virtual void SetRepeatedUInt64(Message* message,
-                                 const FieldDescriptor* field,
-                                 int index, uint64 value) const = 0;
-  virtual void SetRepeatedFloat (Message* message,
-                                 const FieldDescriptor* field,
-                                 int index, float  value) const = 0;
-  virtual void SetRepeatedDouble(Message* message,
-                                 const FieldDescriptor* field,
-                                 int index, double value) const = 0;
-  virtual void SetRepeatedBool  (Message* message,
-                                 const FieldDescriptor* field,
-                                 int index, bool   value) const = 0;
-  virtual void SetRepeatedString(Message* message,
-                                 const FieldDescriptor* field,
-                                 int index, const string& value) const = 0;
-  virtual void SetRepeatedEnum(Message* message,
-                               const FieldDescriptor* field, int index,
-                               const EnumValueDescriptor* value) const = 0;
+  void SetRepeatedInt32(Message* message, const FieldDescriptor* field,
+                        int index, int32_t value) const;
+  void SetRepeatedInt64(Message* message, const FieldDescriptor* field,
+                        int index, int64_t value) const;
+  void SetRepeatedUInt32(Message* message, const FieldDescriptor* field,
+                         int index, uint32_t value) const;
+  void SetRepeatedUInt64(Message* message, const FieldDescriptor* field,
+                         int index, uint64_t value) const;
+  void SetRepeatedFloat(Message* message, const FieldDescriptor* field,
+                        int index, float value) const;
+  void SetRepeatedDouble(Message* message, const FieldDescriptor* field,
+                         int index, double value) const;
+  void SetRepeatedBool(Message* message, const FieldDescriptor* field,
+                       int index, bool value) const;
+  void SetRepeatedString(Message* message, const FieldDescriptor* field,
+                         int index, std::string value) const;
+  void SetRepeatedEnum(Message* message, const FieldDescriptor* field,
+                       int index, const EnumValueDescriptor* value) const;
   // Set an enum field's value with an integer rather than EnumValueDescriptor.
-  // If the value does not correspond to a known enum value, either behavior is
-  // undefined (for proto2 messages), or the value is accepted silently for
-  // messages with new unknown-enum-value semantics.
-  virtual void SetRepeatedEnumValue(Message* message,
-                                    const FieldDescriptor* field, int index,
-                                    int value) const = 0;
+  // For proto3 this is just setting the enum field to the value specified, for
+  // proto2 it's more complicated. If value is a known enum value the field is
+  // set as usual. If the value is unknown then it is added to the unknown field
+  // set. Note this matches the behavior of parsing unknown enum values.
+  // If multiple calls with unknown values happen than they are all added to the
+  // unknown field set in order of the calls.
+  void SetRepeatedEnumValue(Message* message, const FieldDescriptor* field,
+                            int index, int value) const;
   // Get a mutable pointer to an element of a repeated field with a message
   // type.
-  virtual Message* MutableRepeatedMessage(
-      Message* message, const FieldDescriptor* field, int index) const = 0;
+  Message* MutableRepeatedMessage(Message* message,
+                                  const FieldDescriptor* field,
+                                  int index) const;
 
 
   // Repeated field adders -------------------------------------------
   // These add an element to a repeated field.
 
-  virtual void AddInt32 (Message* message,
-                         const FieldDescriptor* field, int32  value) const = 0;
-  virtual void AddInt64 (Message* message,
-                         const FieldDescriptor* field, int64  value) const = 0;
-  virtual void AddUInt32(Message* message,
-                         const FieldDescriptor* field, uint32 value) const = 0;
-  virtual void AddUInt64(Message* message,
-                         const FieldDescriptor* field, uint64 value) const = 0;
-  virtual void AddFloat (Message* message,
-                         const FieldDescriptor* field, float  value) const = 0;
-  virtual void AddDouble(Message* message,
-                         const FieldDescriptor* field, double value) const = 0;
-  virtual void AddBool  (Message* message,
-                         const FieldDescriptor* field, bool   value) const = 0;
-  virtual void AddString(Message* message,
-                         const FieldDescriptor* field,
-                         const string& value) const = 0;
-  virtual void AddEnum  (Message* message,
-                         const FieldDescriptor* field,
-                         const EnumValueDescriptor* value) const = 0;
-  // Set an enum field's value with an integer rather than EnumValueDescriptor.
-  // If the value does not correspond to a known enum value, either behavior is
-  // undefined (for proto2 messages), or the value is accepted silently for
-  // messages with new unknown-enum-value semantics.
-  virtual void AddEnumValue(Message* message,
-                            const FieldDescriptor* field,
-                            int value) const = 0;
+  void AddInt32(Message* message, const FieldDescriptor* field,
+                int32_t value) const;
+  void AddInt64(Message* message, const FieldDescriptor* field,
+                int64_t value) const;
+  void AddUInt32(Message* message, const FieldDescriptor* field,
+                 uint32_t value) const;
+  void AddUInt64(Message* message, const FieldDescriptor* field,
+                 uint64_t value) const;
+  void AddFloat(Message* message, const FieldDescriptor* field,
+                float value) const;
+  void AddDouble(Message* message, const FieldDescriptor* field,
+                 double value) const;
+  void AddBool(Message* message, const FieldDescriptor* field,
+               bool value) const;
+  void AddString(Message* message, const FieldDescriptor* field,
+                 std::string value) const;
+  void AddEnum(Message* message, const FieldDescriptor* field,
+               const EnumValueDescriptor* value) const;
+  // Add an integer value to a repeated enum field rather than
+  // EnumValueDescriptor. For proto3 this is just setting the enum field to the
+  // value specified, for proto2 it's more complicated. If value is a known enum
+  // value the field is set as usual. If the value is unknown then it is added
+  // to the unknown field set. Note this matches the behavior of parsing unknown
+  // enum values. If multiple calls with unknown values happen than they are all
+  // added to the unknown field set in order of the calls.
+  void AddEnumValue(Message* message, const FieldDescriptor* field,
+                    int value) const;
   // See MutableMessage() for comments on the "factory" parameter.
-  virtual Message* AddMessage(Message* message,
-                              const FieldDescriptor* field,
-                              MessageFactory* factory = NULL) const = 0;
+  Message* AddMessage(Message* message, const FieldDescriptor* field,
+                      MessageFactory* factory = nullptr) const;
 
   // Appends an already-allocated object 'new_entry' to the repeated field
-  // specifyed by 'field' passing ownership to the message.
-  // TODO(tmarek): Make virtual after all subclasses have been
-  // updated.
-  virtual void AddAllocatedMessage(Message* message,
-                                   const FieldDescriptor* field,
-                                   Message* new_entry) const;
+  // specified by 'field' passing ownership to the message.
+  void AddAllocatedMessage(Message* message, const FieldDescriptor* field,
+                           Message* new_entry) const;
+
+  // Similar to AddAllocatedMessage() without internal safety and ownership
+  // checks. This method should only be used when the objects are on the same
+  // arena or paired with a call to `UnsafeArenaReleaseLast`.
+  void UnsafeArenaAddAllocatedMessage(Message* message,
+                                      const FieldDescriptor* field,
+                                      Message* new_entry) const;
 
 
   // Get a RepeatedFieldRef object that can be used to read the underlying
@@ -769,15 +797,15 @@ class LIBPROTOBUF_EXPORT Reflection {
   // to acceptable T.
   //
   //   field->cpp_type()      T
-  //   CPPTYPE_INT32        int32
-  //   CPPTYPE_UINT32       uint32
-  //   CPPTYPE_INT64        int64
-  //   CPPTYPE_UINT64       uint64
+  //   CPPTYPE_INT32        int32_t
+  //   CPPTYPE_UINT32       uint32_t
+  //   CPPTYPE_INT64        int64_t
+  //   CPPTYPE_UINT64       uint64_t
   //   CPPTYPE_DOUBLE       double
   //   CPPTYPE_FLOAT        float
   //   CPPTYPE_BOOL         bool
-  //   CPPTYPE_ENUM         generated enum type or int32
-  //   CPPTYPE_STRING       string
+  //   CPPTYPE_ENUM         generated enum type or int32_t
+  //   CPPTYPE_STRING       std::string
   //   CPPTYPE_MESSAGE      generated message type or google::protobuf::Message
   //
   // A RepeatedFieldRef object can be copied and the resulted object will point
@@ -785,20 +813,19 @@ class LIBPROTOBUF_EXPORT Reflection {
   // long as the message is not destroyed.
   //
   // Note that to use this method users need to include the header file
-  // "google/protobuf/reflection.h" (which defines the RepeatedFieldRef
-  // class templates).
-  template<typename T>
-  RepeatedFieldRef<T> GetRepeatedFieldRef(
-      const Message& message, const FieldDescriptor* field) const;
+  // "reflection.h" (which defines the RepeatedFieldRef class templates).
+  template <typename T>
+  RepeatedFieldRef<T> GetRepeatedFieldRef(const Message& message,
+                                          const FieldDescriptor* field) const;
 
   // Like GetRepeatedFieldRef() but return an object that can also be used
   // manipulate the underlying repeated field.
-  template<typename T>
+  template <typename T>
   MutableRepeatedFieldRef<T> GetMutableRepeatedFieldRef(
       Message* message, const FieldDescriptor* field) const;
 
   // DEPRECATED. Please use Get(Mutable)RepeatedFieldRef() for repeated field
-  // access. The following repeated field accesors will be removed in the
+  // access. The following repeated field accessors will be removed in the
   // future.
   //
   // Repeated field accessors  -------------------------------------------------
@@ -814,44 +841,55 @@ class LIBPROTOBUF_EXPORT Reflection {
   // DEPRECATED. Please use GetRepeatedFieldRef().
   //
   // for T = Cord and all protobuf scalar types except enums.
-  template<typename T>
-  const RepeatedField<T>& GetRepeatedField(
-      const Message&, const FieldDescriptor*) const;
+  template <typename T>
+  PROTOBUF_DEPRECATED_MSG("Please use GetRepeatedFieldRef() instead")
+  const RepeatedField<T>& GetRepeatedField(const Message& msg,
+                                           const FieldDescriptor* d) const {
+    return GetRepeatedFieldInternal<T>(msg, d);
+  }
 
   // DEPRECATED. Please use GetMutableRepeatedFieldRef().
   //
   // for T = Cord and all protobuf scalar types except enums.
-  template<typename T>
-  RepeatedField<T>* MutableRepeatedField(
-      Message*, const FieldDescriptor*) const;
+  template <typename T>
+  PROTOBUF_DEPRECATED_MSG("Please use GetMutableRepeatedFieldRef() instead")
+  RepeatedField<T>* MutableRepeatedField(Message* msg,
+                                         const FieldDescriptor* d) const {
+    return MutableRepeatedFieldInternal<T>(msg, d);
+  }
 
   // DEPRECATED. Please use GetRepeatedFieldRef().
   //
-  // for T = string, google::protobuf::internal::StringPieceField
+  // for T = std::string, google::protobuf::internal::StringPieceField
   //         google::protobuf::Message & descendants.
-  template<typename T>
+  template <typename T>
+  PROTOBUF_DEPRECATED_MSG("Please use GetRepeatedFieldRef() instead")
   const RepeatedPtrField<T>& GetRepeatedPtrField(
-      const Message&, const FieldDescriptor*) const;
+      const Message& msg, const FieldDescriptor* d) const {
+    return GetRepeatedPtrFieldInternal<T>(msg, d);
+  }
 
   // DEPRECATED. Please use GetMutableRepeatedFieldRef().
   //
-  // for T = string, google::protobuf::internal::StringPieceField
+  // for T = std::string, google::protobuf::internal::StringPieceField
   //         google::protobuf::Message & descendants.
-  template<typename T>
-  RepeatedPtrField<T>* MutableRepeatedPtrField(
-      Message*, const FieldDescriptor*) const;
+  template <typename T>
+  PROTOBUF_DEPRECATED_MSG("Please use GetMutableRepeatedFieldRef() instead")
+  RepeatedPtrField<T>* MutableRepeatedPtrField(Message* msg,
+                                               const FieldDescriptor* d) const {
+    return MutableRepeatedPtrFieldInternal<T>(msg, d);
+  }
 
   // Extensions ----------------------------------------------------------------
 
   // Try to find an extension of this message type by fully-qualified field
-  // name.  Returns NULL if no extension is known for this name or number.
-  virtual const FieldDescriptor* FindKnownExtensionByName(
-      const string& name) const = 0;
+  // name.  Returns nullptr if no extension is known for this name or number.
+  const FieldDescriptor* FindKnownExtensionByName(
+      const std::string& name) const;
 
   // Try to find an extension of this message type by field number.
-  // Returns NULL if no extension is known for this name or number.
-  virtual const FieldDescriptor* FindKnownExtensionByNumber(
-      int number) const = 0;
+  // Returns nullptr if no extension is known for this name or number.
+  const FieldDescriptor* FindKnownExtensionByNumber(int number) const;
 
   // Feature Flags -------------------------------------------------------------
 
@@ -872,7 +910,7 @@ class LIBPROTOBUF_EXPORT Reflection {
   //     reflection->SetEnumValue(message, field, new_value);
   //   } else {
   //     if (field_descriptor->enum_type()->
-  //             FindValueByNumber(new_value) != NULL) {
+  //             FindValueByNumber(new_value) != nullptr) {
   //       reflection->SetEnumValue(message, field, new_value);
   //     } else if (emit_unknown_enum_values) {
   //       reflection->MutableUnknownFields(message)->AddVarint(
@@ -883,7 +921,7 @@ class LIBPROTOBUF_EXPORT Reflection {
   //       reflection->SetEnumValue(message, field, new_value);
   //     }
   //   }
-  virtual bool SupportsUnknownEnumValues() const { return false; }
+  bool SupportsUnknownEnumValues() const;
 
   // Returns the MessageFactory associated with this message.  This can be
   // useful for determining if a message is a generated message or not, for
@@ -894,136 +932,330 @@ class LIBPROTOBUF_EXPORT Reflection {
   //   }
   // It can also be used to create more messages of this type, though
   // Message::New() is an easier way to accomplish this.
-  virtual MessageFactory* GetMessageFactory() const;
-
-  // ---------------------------------------------------------------------------
+  MessageFactory* GetMessageFactory() const;
 
- protected:
+ private:
+  template <typename T>
+  const RepeatedField<T>& GetRepeatedFieldInternal(
+      const Message& message, const FieldDescriptor* field) const;
+  template <typename T>
+  RepeatedField<T>* MutableRepeatedFieldInternal(
+      Message* message, const FieldDescriptor* field) const;
+  template <typename T>
+  const RepeatedPtrField<T>& GetRepeatedPtrFieldInternal(
+      const Message& message, const FieldDescriptor* field) const;
+  template <typename T>
+  RepeatedPtrField<T>* MutableRepeatedPtrFieldInternal(
+      Message* message, const FieldDescriptor* field) const;
   // Obtain a pointer to a Repeated Field Structure and do some type checking:
   //   on field->cpp_type(),
   //   on field->field_option().ctype() (if ctype >= 0)
-  //   of field->message_type() (if message_type != NULL).
+  //   of field->message_type() (if message_type != nullptr).
   // We use 2 routine rather than 4 (const vs mutable) x (scalar vs pointer).
-  virtual void* MutableRawRepeatedField(
-      Message* message, const FieldDescriptor* field, FieldDescriptor::CppType,
-      int ctype, const Descriptor* message_type) const = 0;
-
-  // TODO(jieluo) - make it pure virtual after updating all the subclasses.
-  virtual const void* GetRawRepeatedField(
-      const Message& message, const FieldDescriptor* field,
-      FieldDescriptor::CppType cpptype, int ctype,
-      const Descriptor* message_type) const {
-    return MutableRawRepeatedField(
-        const_cast<Message*>(&message), field, cpptype, ctype, message_type);
-  }
+  void* MutableRawRepeatedField(Message* message, const FieldDescriptor* field,
+                                FieldDescriptor::CppType, int ctype,
+                                const Descriptor* message_type) const;
+
+  const void* GetRawRepeatedField(const Message& message,
+                                  const FieldDescriptor* field,
+                                  FieldDescriptor::CppType cpptype, int ctype,
+                                  const Descriptor* message_type) const;
 
   // The following methods are used to implement (Mutable)RepeatedFieldRef.
   // A Ref object will store a raw pointer to the repeated field data (obtained
   // from RepeatedFieldData()) and a pointer to a Accessor (obtained from
   // RepeatedFieldAccessor) which will be used to access the raw data.
-  //
-  // TODO(xiaofeng): Make these methods pure-virtual.
 
   // Returns a raw pointer to the repeated field
   //
   // "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
-  // "cpp_type"/"message_type" is consistent with the actual type of the field.
-  // We use 1 routine rather than 2 (const vs mutable) because it is protected
-  // and it doesn't change the message.
-  virtual void* RepeatedFieldData(
-      Message* message, const FieldDescriptor* field,
-      FieldDescriptor::CppType cpp_type,
-      const Descriptor* message_type) const;
+  // should be set to nullptr. Implementations of this method should check
+  // whether "cpp_type"/"message_type" is consistent with the actual type of the
+  // field. We use 1 routine rather than 2 (const vs mutable) because it is
+  // protected and it doesn't change the message.
+  void* RepeatedFieldData(Message* message, const FieldDescriptor* field,
+                          FieldDescriptor::CppType cpp_type,
+                          const Descriptor* message_type) const;
 
   // The returned pointer should point to a singleton instance which implements
   // the RepeatedFieldAccessor interface.
-  virtual const internal::RepeatedFieldAccessor* RepeatedFieldAccessor(
+  const internal::RepeatedFieldAccessor* RepeatedFieldAccessor(
       const FieldDescriptor* field) const;
 
- private:
-  template<typename T, typename Enable>
+  // Lists all fields of the message which are currently set, except for unknown
+  // fields and stripped fields. See ListFields for details.
+  void ListFieldsOmitStripped(
+      const Message& message,
+      std::vector<const FieldDescriptor*>* output) const;
+
+  bool IsMessageStripped(const Descriptor* descriptor) const {
+    return schema_.IsMessageStripped(descriptor);
+  }
+
+  friend class TextFormat;
+
+  void ListFieldsMayFailOnStripped(
+      const Message& message, bool should_fail,
+      std::vector<const FieldDescriptor*>* output) const;
+
+  // Returns true if the message field is backed by a LazyField.
+  //
+  // A message field may be backed by a LazyField without the user annotation
+  // ([lazy = true]). While the user-annotated LazyField is lazily verified on
+  // first touch (i.e. failure on access rather than parsing if the LazyField is
+  // not initialized), the inferred LazyField is eagerly verified to avoid lazy
+  // parsing error at the cost of lower efficiency. When reflecting a message
+  // field, use this API instead of checking field->options().lazy().
+  bool IsLazyField(const FieldDescriptor* field) const {
+    return IsLazilyVerifiedLazyField(field) ||
+           IsEagerlyVerifiedLazyField(field);
+  }
+
+  // Returns true if the field is lazy extension. It is meant to allow python
+  // reparse lazy field until b/157559327 is fixed.
+  bool IsLazyExtension(const Message& message,
+                       const FieldDescriptor* field) const;
+
+  bool IsLazilyVerifiedLazyField(const FieldDescriptor* field) const;
+  bool IsEagerlyVerifiedLazyField(const FieldDescriptor* field) const;
+
+  friend class FastReflectionMessageMutator;
+
+  const Descriptor* const descriptor_;
+  const internal::ReflectionSchema schema_;
+  const DescriptorPool* const descriptor_pool_;
+  MessageFactory* const message_factory_;
+
+  // Last non weak field index. This is an optimization when most weak fields
+  // are at the end of the containing message. If a message proto doesn't
+  // contain weak fields, then this field equals descriptor_->field_count().
+  int last_non_weak_field_index_;
+
+  template <typename T, typename Enable>
   friend class RepeatedFieldRef;
-  template<typename T, typename Enable>
+  template <typename T, typename Enable>
   friend class MutableRepeatedFieldRef;
-  friend class ::google::protobuf::python::MapReflectionFriend;
+  friend class ::PROTOBUF_NAMESPACE_ID::MessageLayoutInspector;
+  friend class ::PROTOBUF_NAMESPACE_ID::AssignDescriptorsHelper;
+  friend class DynamicMessageFactory;
+  friend class DynamicMessageReflectionHelper;
+  friend class GeneratedMessageReflectionTestHelper;
+  friend class python::MapReflectionFriend;
+  friend class python::MessageReflectionFriend;
+  friend class util::MessageDifferencer;
+#define GOOGLE_PROTOBUF_HAS_CEL_MAP_REFLECTION_FRIEND
+  friend class expr::CelMapReflectionFriend;
   friend class internal::MapFieldReflectionTest;
   friend class internal::MapKeySorter;
   friend class internal::WireFormat;
   friend class internal::ReflectionOps;
+  friend class internal::SwapFieldHelper;
+  // Needed for implementing text format for map.
+  friend class internal::MapFieldPrinterHelper;
 
-  // Special version for specialized implementations of string.  We can't call
-  // MutableRawRepeatedField directly here because we don't have access to
+  Reflection(const Descriptor* descriptor,
+             const internal::ReflectionSchema& schema,
+             const DescriptorPool* pool, MessageFactory* factory);
+
+  // Special version for specialized implementations of string.  We can't
+  // call MutableRawRepeatedField directly here because we don't have access to
   // FieldOptions::* which are defined in descriptor.pb.h.  Including that
   // file here is not possible because it would cause a circular include cycle.
   // We use 1 routine rather than 2 (const vs mutable) because it is private
   // and mutable a repeated string field doesn't change the message.
-  void* MutableRawRepeatedString(
-      Message* message, const FieldDescriptor* field, bool is_string) const;
+  void* MutableRawRepeatedString(Message* message, const FieldDescriptor* field,
+                                 bool is_string) const;
 
   friend class MapReflectionTester;
-  // TODO(jieluo) - make the map APIs pure virtual after updating
-  // all the subclasses.
   // Returns true if key is in map. Returns false if key is not in map field.
-  virtual bool ContainsMapKey(const Message& /* message */,
-                              const FieldDescriptor* /* field */,
-                              const MapKey& /* key */) const {
-    return false;
-  }
+  bool ContainsMapKey(const Message& message, const FieldDescriptor* field,
+                      const MapKey& key) const;
 
   // If key is in map field: Saves the value pointer to val and returns
   // false. If key in not in map field: Insert the key into map, saves
-  // value pointer to val and retuns true.
-  virtual bool InsertOrLookupMapValue(Message* /* message */,
-                                      const FieldDescriptor* /* field */,
-                                      const MapKey& /* key */,
-                                      MapValueRef* /* val */) const {
-    return false;
-  }
+  // value pointer to val and returns true. Users are able to modify the
+  // map value by MapValueRef.
+  bool InsertOrLookupMapValue(Message* message, const FieldDescriptor* field,
+                              const MapKey& key, MapValueRef* val) const;
+
+  // If key is in map field: Saves the value pointer to val and returns true.
+  // Returns false if key is not in map field. Users are NOT able to modify
+  // the value by MapValueConstRef.
+  bool LookupMapValue(const Message& message, const FieldDescriptor* field,
+                      const MapKey& key, MapValueConstRef* val) const;
+  bool LookupMapValue(const Message&, const FieldDescriptor*, const MapKey&,
+                      MapValueRef*) const = delete;
 
   // Delete and returns true if key is in the map field. Returns false
   // otherwise.
-  virtual bool DeleteMapValue(Message* /* message */,
-                              const FieldDescriptor* /* field */,
-                              const MapKey& /* key */) const {
-    return false;
-  }
+  bool DeleteMapValue(Message* message, const FieldDescriptor* field,
+                      const MapKey& key) const;
 
   // Returns a MapIterator referring to the first element in the map field.
   // If the map field is empty, this function returns the same as
   // reflection::MapEnd. Mutation to the field may invalidate the iterator.
-  virtual MapIterator MapBegin(
-      Message* message,
-      const FieldDescriptor* field) const;
+  MapIterator MapBegin(Message* message, const FieldDescriptor* field) const;
 
   // Returns a MapIterator referring to the theoretical element that would
   // follow the last element in the map field. It does not point to any
   // real element. Mutation to the field may invalidate the iterator.
-  virtual MapIterator MapEnd(
-      Message* message,
-      const FieldDescriptor* field) const;
+  MapIterator MapEnd(Message* message, const FieldDescriptor* field) const;
 
   // Get the number of <key, value> pair of a map field. The result may be
   // different from FieldSize which can have duplicate keys.
-  virtual int MapSize(const Message& /* message */,
-                      const FieldDescriptor* /* field */) const {
-    return 0;
-  }
+  int MapSize(const Message& message, const FieldDescriptor* field) const;
 
   // Help method for MapIterator.
   friend class MapIterator;
-  virtual internal::MapFieldBase* MapData(
-      Message* /* message */, const FieldDescriptor* /* field */) const {
-    return NULL;
+  friend class WireFormatForMapFieldTest;
+  internal::MapFieldBase* MutableMapData(Message* message,
+                                         const FieldDescriptor* field) const;
+
+  const internal::MapFieldBase* GetMapData(const Message& message,
+                                           const FieldDescriptor* field) const;
+
+  template <class T>
+  const T& GetRawNonOneof(const Message& message,
+                          const FieldDescriptor* field) const;
+  template <class T>
+  T* MutableRawNonOneof(Message* message, const FieldDescriptor* field) const;
+
+  template <typename Type>
+  const Type& GetRaw(const Message& message,
+                     const FieldDescriptor* field) const;
+  template <typename Type>
+  inline Type* MutableRaw(Message* message, const FieldDescriptor* field) const;
+  template <typename Type>
+  const Type& DefaultRaw(const FieldDescriptor* field) const;
+
+  const Message* GetDefaultMessageInstance(const FieldDescriptor* field) const;
+
+  inline const uint32_t* GetHasBits(const Message& message) const;
+  inline uint32_t* MutableHasBits(Message* message) const;
+  inline uint32_t GetOneofCase(const Message& message,
+                               const OneofDescriptor* oneof_descriptor) const;
+  inline uint32_t* MutableOneofCase(
+      Message* message, const OneofDescriptor* oneof_descriptor) const;
+  inline bool HasExtensionSet(const Message& /* message */) const {
+    return schema_.HasExtensionSet();
   }
+  const internal::ExtensionSet& GetExtensionSet(const Message& message) const;
+  internal::ExtensionSet* MutableExtensionSet(Message* message) const;
+
+  inline const internal::InternalMetadata& GetInternalMetadata(
+      const Message& message) const;
+
+  internal::InternalMetadata* MutableInternalMetadata(Message* message) const;
+
+  inline bool IsInlined(const FieldDescriptor* field) const;
+
+  inline bool HasBit(const Message& message,
+                     const FieldDescriptor* field) const;
+  inline void SetBit(Message* message, const FieldDescriptor* field) const;
+  inline void ClearBit(Message* message, const FieldDescriptor* field) const;
+  inline void SwapBit(Message* message1, Message* message2,
+                      const FieldDescriptor* field) const;
+
+  inline const uint32_t* GetInlinedStringDonatedArray(
+      const Message& message) const;
+  inline uint32_t* MutableInlinedStringDonatedArray(Message* message) const;
+  inline bool IsInlinedStringDonated(const Message& message,
+                                     const FieldDescriptor* field) const;
+
+  // Shallow-swap fields listed in fields vector of two messages. It is the
+  // caller's responsibility to make sure shallow swap is safe.
+  void UnsafeShallowSwapFields(
+      Message* message1, Message* message2,
+      const std::vector<const FieldDescriptor*>& fields) const;
+
+  // This function only swaps the field. Should swap corresponding has_bit
+  // before or after using this function.
+  void SwapField(Message* message1, Message* message2,
+                 const FieldDescriptor* field) const;
+
+  // Unsafe but shallow version of SwapField.
+  void UnsafeShallowSwapField(Message* message1, Message* message2,
+                              const FieldDescriptor* field) const;
+
+  template <bool unsafe_shallow_swap>
+  void SwapFieldsImpl(Message* message1, Message* message2,
+                      const std::vector<const FieldDescriptor*>& fields) const;
+
+  template <bool unsafe_shallow_swap>
+  void SwapOneofField(Message* lhs, Message* rhs,
+                      const OneofDescriptor* oneof_descriptor) const;
+
+  inline bool HasOneofField(const Message& message,
+                            const FieldDescriptor* field) const;
+  inline void SetOneofCase(Message* message,
+                           const FieldDescriptor* field) const;
+  inline void ClearOneofField(Message* message,
+                              const FieldDescriptor* field) const;
+
+  template <typename Type>
+  inline const Type& GetField(const Message& message,
+                              const FieldDescriptor* field) const;
+  template <typename Type>
+  inline void SetField(Message* message, const FieldDescriptor* field,
+                       const Type& value) const;
+  template <typename Type>
+  inline Type* MutableField(Message* message,
+                            const FieldDescriptor* field) const;
+  template <typename Type>
+  inline const Type& GetRepeatedField(const Message& message,
+                                      const FieldDescriptor* field,
+                                      int index) const;
+  template <typename Type>
+  inline const Type& GetRepeatedPtrField(const Message& message,
+                                         const FieldDescriptor* field,
+                                         int index) const;
+  template <typename Type>
+  inline void SetRepeatedField(Message* message, const FieldDescriptor* field,
+                               int index, Type value) const;
+  template <typename Type>
+  inline Type* MutableRepeatedField(Message* message,
+                                    const FieldDescriptor* field,
+                                    int index) const;
+  template <typename Type>
+  inline void AddField(Message* message, const FieldDescriptor* field,
+                       const Type& value) const;
+  template <typename Type>
+  inline Type* AddField(Message* message, const FieldDescriptor* field) const;
+
+  int GetExtensionNumberOrDie(const Descriptor* type) const;
+
+  // Internal versions of EnumValue API perform no checking. Called after checks
+  // by public methods.
+  void SetEnumValueInternal(Message* message, const FieldDescriptor* field,
+                            int value) const;
+  void SetRepeatedEnumValueInternal(Message* message,
+                                    const FieldDescriptor* field, int index,
+                                    int value) const;
+  void AddEnumValueInternal(Message* message, const FieldDescriptor* field,
+                            int value) const;
+
+  friend inline  // inline so nobody can call this function.
+      void
+      RegisterAllTypesInternal(const Metadata* file_level_metadata, int size);
+  friend inline const char* ParseLenDelim(int field_number,
+                                          const FieldDescriptor* field,
+                                          Message* msg,
+                                          const Reflection* reflection,
+                                          const char* ptr,
+                                          internal::ParseContext* ctx);
+  friend inline const char* ParsePackedField(const FieldDescriptor* field,
+                                             Message* msg,
+                                             const Reflection* reflection,
+                                             const char* ptr,
+                                             internal::ParseContext* ctx);
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Reflection);
 };
 
 // Abstract interface for a factory for message objects.
-class LIBPROTOBUF_EXPORT MessageFactory {
+class PROTOBUF_EXPORT MessageFactory {
  public:
   inline MessageFactory() {}
   virtual ~MessageFactory();
@@ -1042,7 +1274,7 @@ class LIBPROTOBUF_EXPORT MessageFactory {
   // outlive the MessageFactory.
   //
   // Some implementations do not support all types.  GetPrototype() will
-  // return NULL if the descriptor passed in is not supported.
+  // return nullptr if the descriptor passed in is not supported.
   //
   // This method may or may not be thread-safe depending on the implementation.
   // Each implementation should document its own degree thread-safety.
@@ -1054,7 +1286,7 @@ class LIBPROTOBUF_EXPORT MessageFactory {
   //     FooMessage::descriptor()) == FooMessage::default_instance()
   // This factory supports all types which are found in
   // DescriptorPool::generated_pool().  If given a descriptor from any other
-  // pool, GetPrototype() will return NULL.  (You can also check if a
+  // pool, GetPrototype() will return nullptr.  (You can also check if a
   // descriptor is for a generated message by checking if
   // descriptor->file()->pool() == DescriptorPool::generated_pool().)
   //
@@ -1073,7 +1305,7 @@ class LIBPROTOBUF_EXPORT MessageFactory {
   // built lazily, so we can't register types by their descriptor until we
   // know that the descriptor exists.  |filename| must be a permanent string.
   static void InternalRegisterGeneratedFile(
-      const char* filename, void (*register_messages)(const string&));
+      const google::protobuf::internal::DescriptorTable* table);
 
   // For internal use only:  Registers a message type.  Called only by the
   // functions which are registered with InternalRegisterGeneratedFile(),
@@ -1086,85 +1318,170 @@ class LIBPROTOBUF_EXPORT MessageFactory {
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFactory);
 };
 
-#define DECLARE_GET_REPEATED_FIELD(TYPE)                         \
-template<>                                                       \
-LIBPROTOBUF_EXPORT                                               \
-const RepeatedField<TYPE>& Reflection::GetRepeatedField<TYPE>(   \
-    const Message& message, const FieldDescriptor* field) const; \
-                                                                 \
-template<>                                                       \
-LIBPROTOBUF_EXPORT                                               \
-RepeatedField<TYPE>* Reflection::MutableRepeatedField<TYPE>(     \
-    Message* message, const FieldDescriptor* field) const;
-
-DECLARE_GET_REPEATED_FIELD(int32)
-DECLARE_GET_REPEATED_FIELD(int64)
-DECLARE_GET_REPEATED_FIELD(uint32)
-DECLARE_GET_REPEATED_FIELD(uint64)
+#define DECLARE_GET_REPEATED_FIELD(TYPE)                           \
+  template <>                                                      \
+  PROTOBUF_EXPORT const RepeatedField<TYPE>&                       \
+  Reflection::GetRepeatedFieldInternal<TYPE>(                      \
+      const Message& message, const FieldDescriptor* field) const; \
+                                                                   \
+  template <>                                                      \
+  PROTOBUF_EXPORT RepeatedField<TYPE>*                             \
+  Reflection::MutableRepeatedFieldInternal<TYPE>(                  \
+      Message * message, const FieldDescriptor* field) const;
+
+DECLARE_GET_REPEATED_FIELD(int32_t)
+DECLARE_GET_REPEATED_FIELD(int64_t)
+DECLARE_GET_REPEATED_FIELD(uint32_t)
+DECLARE_GET_REPEATED_FIELD(uint64_t)
 DECLARE_GET_REPEATED_FIELD(float)
 DECLARE_GET_REPEATED_FIELD(double)
 DECLARE_GET_REPEATED_FIELD(bool)
 
 #undef DECLARE_GET_REPEATED_FIELD
 
+// Tries to downcast this message to a generated message type.  Returns nullptr
+// if this class is not an instance of T.  This works even if RTTI is disabled.
+//
+// This also has the effect of creating a strong reference to T that will
+// prevent the linker from stripping it out at link time.  This can be important
+// if you are using a DynamicMessageFactory that delegates to the generated
+// factory.
+template <typename T>
+const T* DynamicCastToGenerated(const Message* from) {
+  // Compile-time assert that T is a generated type that has a
+  // default_instance() accessor, but avoid actually calling it.
+  const T& (*get_default_instance)() = &T::default_instance;
+  (void)get_default_instance;
+
+  // Compile-time assert that T is a subclass of google::protobuf::Message.
+  const Message* unused = static_cast<T*>(nullptr);
+  (void)unused;
+
+#if PROTOBUF_RTTI
+  return dynamic_cast<const T*>(from);
+#else
+  bool ok = from != nullptr &&
+            T::default_instance().GetReflection() == from->GetReflection();
+  return ok ? down_cast<const T*>(from) : nullptr;
+#endif
+}
+
+template <typename T>
+T* DynamicCastToGenerated(Message* from) {
+  const Message* message_const = from;
+  return const_cast<T*>(DynamicCastToGenerated<T>(message_const));
+}
+
+// Call this function to ensure that this message's reflection is linked into
+// the binary:
+//
+//   google::protobuf::LinkMessageReflection<FooMessage>();
+//
+// This will ensure that the following lookup will succeed:
+//
+//   DescriptorPool::generated_pool()->FindMessageTypeByName("FooMessage");
+//
+// As a side-effect, it will also guarantee that anything else from the same
+// .proto file will also be available for lookup in the generated pool.
+//
+// This function does not actually register the message, so it does not need
+// to be called before the lookup.  However it does need to occur in a function
+// that cannot be stripped from the binary (ie. it must be reachable from main).
+//
+// Best practice is to call this function as close as possible to where the
+// reflection is actually needed.  This function is very cheap to call, so you
+// should not need to worry about its runtime overhead except in the tightest
+// of loops (on x86-64 it compiles into two "mov" instructions).
+template <typename T>
+void LinkMessageReflection() {
+  internal::StrongReference(T::default_instance);
+}
+
 // =============================================================================
 // Implementation details for {Get,Mutable}RawRepeatedPtrField.  We provide
-// specializations for <string>, <StringPieceField> and <Message> and handle
-// everything else with the default template which will match any type having
-// a method with signature "static const google::protobuf::Descriptor* descriptor()".
-// Such a type presumably is a descendant of google::protobuf::Message.
-
-template<>
-inline const RepeatedPtrField<string>& Reflection::GetRepeatedPtrField<string>(
+// specializations for <std::string>, <StringPieceField> and <Message> and
+// handle everything else with the default template which will match any type
+// having a method with signature "static const google::protobuf::Descriptor*
+// descriptor()". Such a type presumably is a descendant of google::protobuf::Message.
+
+template <>
+inline const RepeatedPtrField<std::string>&
+Reflection::GetRepeatedPtrFieldInternal<std::string>(
     const Message& message, const FieldDescriptor* field) const {
-  return *static_cast<RepeatedPtrField<string>* >(
+  return *static_cast<RepeatedPtrField<std::string>*>(
       MutableRawRepeatedString(const_cast<Message*>(&message), field, true));
 }
 
-template<>
-inline RepeatedPtrField<string>* Reflection::MutableRepeatedPtrField<string>(
+template <>
+inline RepeatedPtrField<std::string>*
+Reflection::MutableRepeatedPtrFieldInternal<std::string>(
     Message* message, const FieldDescriptor* field) const {
-  return static_cast<RepeatedPtrField<string>* >(
+  return static_cast<RepeatedPtrField<std::string>*>(
       MutableRawRepeatedString(message, field, true));
 }
 
 
 // -----
 
-template<>
-inline const RepeatedPtrField<Message>& Reflection::GetRepeatedPtrField(
+template <>
+inline const RepeatedPtrField<Message>& Reflection::GetRepeatedPtrFieldInternal(
     const Message& message, const FieldDescriptor* field) const {
-  return *static_cast<const RepeatedPtrField<Message>* >(
-      GetRawRepeatedField(message, field, FieldDescriptor::CPPTYPE_MESSAGE,
-                          -1, NULL));
+  return *static_cast<const RepeatedPtrField<Message>*>(GetRawRepeatedField(
+      message, field, FieldDescriptor::CPPTYPE_MESSAGE, -1, nullptr));
 }
 
-template<>
-inline RepeatedPtrField<Message>* Reflection::MutableRepeatedPtrField(
+template <>
+inline RepeatedPtrField<Message>* Reflection::MutableRepeatedPtrFieldInternal(
     Message* message, const FieldDescriptor* field) const {
-  return static_cast<RepeatedPtrField<Message>* >(
-      MutableRawRepeatedField(message, field,
-          FieldDescriptor::CPPTYPE_MESSAGE, -1,
-          NULL));
+  return static_cast<RepeatedPtrField<Message>*>(MutableRawRepeatedField(
+      message, field, FieldDescriptor::CPPTYPE_MESSAGE, -1, nullptr));
 }
 
-template<typename PB>
-inline const RepeatedPtrField<PB>& Reflection::GetRepeatedPtrField(
+template <typename PB>
+inline const RepeatedPtrField<PB>& Reflection::GetRepeatedPtrFieldInternal(
     const Message& message, const FieldDescriptor* field) const {
-  return *static_cast<const RepeatedPtrField<PB>* >(
-      GetRawRepeatedField(message, field, FieldDescriptor::CPPTYPE_MESSAGE,
-                          -1, PB::default_instance().GetDescriptor()));
+  return *static_cast<const RepeatedPtrField<PB>*>(
+      GetRawRepeatedField(message, field, FieldDescriptor::CPPTYPE_MESSAGE, -1,
+                          PB::default_instance().GetDescriptor()));
 }
 
-template<typename PB>
-inline RepeatedPtrField<PB>* Reflection::MutableRepeatedPtrField(
+template <typename PB>
+inline RepeatedPtrField<PB>* Reflection::MutableRepeatedPtrFieldInternal(
     Message* message, const FieldDescriptor* field) const {
-  return static_cast<RepeatedPtrField<PB>* >(
-      MutableRawRepeatedField(message, field,
-          FieldDescriptor::CPPTYPE_MESSAGE, -1,
-          PB::default_instance().GetDescriptor()));
+  return static_cast<RepeatedPtrField<PB>*>(
+      MutableRawRepeatedField(message, field, FieldDescriptor::CPPTYPE_MESSAGE,
+                              -1, PB::default_instance().GetDescriptor()));
+}
+
+template <typename Type>
+const Type& Reflection::DefaultRaw(const FieldDescriptor* field) const {
+  return *reinterpret_cast<const Type*>(schema_.GetFieldDefault(field));
 }
-}  // namespace protobuf
 
+uint32_t Reflection::GetOneofCase(
+    const Message& message, const OneofDescriptor* oneof_descriptor) const {
+  GOOGLE_DCHECK(!oneof_descriptor->is_synthetic());
+  return internal::GetConstRefAtOffset<uint32_t>(
+      message, schema_.GetOneofCaseOffset(oneof_descriptor));
+}
+
+bool Reflection::HasOneofField(const Message& message,
+                               const FieldDescriptor* field) const {
+  return (GetOneofCase(message, field->containing_oneof()) ==
+          static_cast<uint32_t>(field->number()));
+}
+
+template <typename Type>
+const Type& Reflection::GetRaw(const Message& message,
+                               const FieldDescriptor* field) const {
+  GOOGLE_DCHECK(!schema_.InRealOneof(field) || HasOneofField(message, field))
+      << "Field = " << field->full_name();
+  return internal::GetConstRefAtOffset<Type>(message,
+                                             schema_.GetFieldOffset(field));
+}
+}  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_MESSAGE_H__
index 123b142..b4f8d40 100644 (file)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
-#include <climits>
-
-#include <google/protobuf/arena.h>
-#include <google/protobuf/generated_message_util.h>
 #include <google/protobuf/message_lite.h>
-#include <google/protobuf/repeated_field.h>
+
+#include <climits>
+#include <cstdint>
 #include <string>
+
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/stringprintf.h>
+#include <google/protobuf/parse_context.h>
 #include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/io/zero_copy_stream.h>
+#include <google/protobuf/io/zero_copy_stream_impl.h>
 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/generated_message_table_driven.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/stubs/strutil.h>
 #include <google/protobuf/stubs/stl_util.h>
+#include <google/protobuf/stubs/mutex.h>
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
 
-string MessageLite::InitializationErrorString() const {
+std::string MessageLite::InitializationErrorString() const {
   return "(cannot determine missing fields for lite message)";
 }
 
+std::string MessageLite::DebugString() const {
+  std::uintptr_t address = reinterpret_cast<std::uintptr_t>(this);
+  return StrCat("MessageLite at 0x", strings::Hex(address));
+}
+
 namespace {
 
 // When serializing, we first compute the byte size, then serialize the message.
@@ -71,12 +87,13 @@ void ByteSizeConsistencyError(size_t byte_size_before_serialization,
   GOOGLE_CHECK_EQ(bytes_produced_by_serialization, byte_size_before_serialization)
       << "Byte size calculation and serialization were inconsistent.  This "
          "may indicate a bug in protocol buffers or it may be caused by "
-         "concurrent modification of " << message.GetTypeName() << ".";
+         "concurrent modification of "
+      << message.GetTypeName() << ".";
   GOOGLE_LOG(FATAL) << "This shouldn't be called if all the sizes are equal.";
 }
 
-string InitializationErrorMessage(const char* action,
-                                  const MessageLite& message) {
+std::string InitializationErrorMessage(const char* action,
+                                       const MessageLite& message) {
   // Note:  We want to avoid depending on strutil in the lite library, otherwise
   //   we'd use:
   //
@@ -86,7 +103,7 @@ string InitializationErrorMessage(const char* action,
   //   action, message.GetTypeName(),
   //   message.InitializationErrorString());
 
-  string result;
+  std::string result;
   result += "Can't ";
   result += action;
   result += " message of type \"";
@@ -96,135 +113,252 @@ string InitializationErrorMessage(const char* action,
   return result;
 }
 
-// Several of the Parse methods below just do one thing and then call another
-// method.  In a naive implementation, we might have ParseFromString() call
-// ParseFromArray() which would call ParseFromZeroCopyStream() which would call
-// ParseFromCodedStream() which would call MergeFromCodedStream() which would
-// 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineMergeFromCodedStream(
-    io::CodedInputStream* input, MessageLite* message);
-GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineParseFromCodedStream(
-    io::CodedInputStream* input, MessageLite* message);
-GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineParsePartialFromCodedStream(
-    io::CodedInputStream* input, MessageLite* message);
-GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineParseFromArray(
-    const void* data, int size, MessageLite* message);
-GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineParsePartialFromArray(
-    const void* data, int size, MessageLite* message);
-
-inline bool InlineMergeFromCodedStream(io::CodedInputStream* input,
-                                       MessageLite* message) {
-  if (!message->MergePartialFromCodedStream(input)) return false;
-  if (!message->IsInitialized()) {
-    GOOGLE_LOG(ERROR) << InitializationErrorMessage("parse", *message);
-    return false;
-  }
-  return true;
+inline StringPiece as_string_view(const void* data, int size) {
+  return StringPiece(static_cast<const char*>(data), size);
 }
 
-inline bool InlineParseFromCodedStream(io::CodedInputStream* input,
-                                       MessageLite* message) {
-  message->Clear();
-  return InlineMergeFromCodedStream(input, message);
+// Returns true of all required fields are present / have values.
+inline bool CheckFieldPresence(const internal::ParseContext& ctx,
+                               const MessageLite& msg,
+                               MessageLite::ParseFlags parse_flags) {
+  (void)ctx;  // Parameter is used by Google-internal code.
+  if (PROTOBUF_PREDICT_FALSE((parse_flags & MessageLite::kMergePartial) != 0)) {
+    return true;
+  }
+  return msg.IsInitializedWithErrors();
 }
 
-inline bool InlineParsePartialFromCodedStream(io::CodedInputStream* input,
-                                              MessageLite* message) {
-  message->Clear();
-  return message->MergePartialFromCodedStream(input);
-}
+}  // namespace
 
-inline bool InlineParseFromArray(
-    const void* data, int size, MessageLite* message) {
-  io::CodedInputStream input(reinterpret_cast<const uint8*>(data), size);
-  return InlineParseFromCodedStream(&input, message) &&
-         input.ConsumedEntireMessage();
+void MessageLite::LogInitializationErrorMessage() const {
+  GOOGLE_LOG(ERROR) << InitializationErrorMessage("parse", *this);
 }
 
-inline bool InlineParsePartialFromArray(
-    const void* data, int size, MessageLite* message) {
-  io::CodedInputStream input(reinterpret_cast<const uint8*>(data), size);
-  return InlineParsePartialFromCodedStream(&input, message) &&
-         input.ConsumedEntireMessage();
-}
+namespace internal {
 
-}  // namespace
+template <bool aliasing>
+bool MergeFromImpl(StringPiece input, MessageLite* msg,
+                   MessageLite::ParseFlags parse_flags) {
+  const char* ptr;
+  internal::ParseContext ctx(io::CodedInputStream::GetDefaultRecursionLimit(),
+                             aliasing, &ptr, input);
+  ptr = msg->_InternalParse(ptr, &ctx);
+  // ctx has an explicit limit set (length of string_view).
+  if (PROTOBUF_PREDICT_TRUE(ptr && ctx.EndedAtLimit())) {
+    return CheckFieldPresence(ctx, *msg, parse_flags);
+  }
+  return false;
+}
+
+template <bool aliasing>
+bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg,
+                   MessageLite::ParseFlags parse_flags) {
+  const char* ptr;
+  internal::ParseContext ctx(io::CodedInputStream::GetDefaultRecursionLimit(),
+                             aliasing, &ptr, input);
+  ptr = msg->_InternalParse(ptr, &ctx);
+  // ctx has no explicit limit (hence we end on end of stream)
+  if (PROTOBUF_PREDICT_TRUE(ptr && ctx.EndedAtEndOfStream())) {
+    return CheckFieldPresence(ctx, *msg, parse_flags);
+  }
+  return false;
+}
+
+template <bool aliasing>
+bool MergeFromImpl(BoundedZCIS input, MessageLite* msg,
+                   MessageLite::ParseFlags parse_flags) {
+  const char* ptr;
+  internal::ParseContext ctx(io::CodedInputStream::GetDefaultRecursionLimit(),
+                             aliasing, &ptr, input.zcis, input.limit);
+  ptr = msg->_InternalParse(ptr, &ctx);
+  if (PROTOBUF_PREDICT_FALSE(!ptr)) return false;
+  ctx.BackUp(ptr);
+  if (PROTOBUF_PREDICT_TRUE(ctx.EndedAtLimit())) {
+    return CheckFieldPresence(ctx, *msg, parse_flags);
+  }
+  return false;
+}
+
+template bool MergeFromImpl<false>(StringPiece input, MessageLite* msg,
+                                   MessageLite::ParseFlags parse_flags);
+template bool MergeFromImpl<true>(StringPiece input, MessageLite* msg,
+                                  MessageLite::ParseFlags parse_flags);
+template bool MergeFromImpl<false>(io::ZeroCopyInputStream* input,
+                                   MessageLite* msg,
+                                   MessageLite::ParseFlags parse_flags);
+template bool MergeFromImpl<true>(io::ZeroCopyInputStream* input,
+                                  MessageLite* msg,
+                                  MessageLite::ParseFlags parse_flags);
+template bool MergeFromImpl<false>(BoundedZCIS input, MessageLite* msg,
+                                   MessageLite::ParseFlags parse_flags);
+template bool MergeFromImpl<true>(BoundedZCIS input, MessageLite* msg,
+                                  MessageLite::ParseFlags parse_flags);
 
+}  // namespace internal
 
-MessageLite* MessageLite::New(::google::protobuf::Arena* arena) const {
-  MessageLite* message = New();
-  if (arena != NULL) {
-    arena->Own(message);
+class ZeroCopyCodedInputStream : public io::ZeroCopyInputStream {
+ public:
+  ZeroCopyCodedInputStream(io::CodedInputStream* cis) : cis_(cis) {}
+  bool Next(const void** data, int* size) final {
+    if (!cis_->GetDirectBufferPointer(data, size)) return false;
+    cis_->Skip(*size);
+    return true;
   }
-  return message;
+  void BackUp(int count) final { cis_->Advance(-count); }
+  bool Skip(int count) final { return cis_->Skip(count); }
+  int64_t ByteCount() const final { return 0; }
+
+  bool aliasing_enabled() { return cis_->aliasing_enabled_; }
+
+ private:
+  io::CodedInputStream* cis_;
+};
+
+bool MessageLite::MergeFromImpl(io::CodedInputStream* input,
+                                MessageLite::ParseFlags parse_flags) {
+  ZeroCopyCodedInputStream zcis(input);
+  const char* ptr;
+  internal::ParseContext ctx(input->RecursionBudget(), zcis.aliasing_enabled(),
+                             &ptr, &zcis);
+  // MergePartialFromCodedStream allows terminating the wireformat by 0 or
+  // end-group tag. Leaving it up to the caller to verify correct ending by
+  // calling LastTagWas on input. We need to maintain this behavior.
+  ctx.TrackCorrectEnding();
+  ctx.data().pool = input->GetExtensionPool();
+  ctx.data().factory = input->GetExtensionFactory();
+  ptr = _InternalParse(ptr, &ctx);
+  if (PROTOBUF_PREDICT_FALSE(!ptr)) return false;
+  ctx.BackUp(ptr);
+  if (!ctx.EndedAtEndOfStream()) {
+    GOOGLE_DCHECK(ctx.LastTag() != 1);  // We can't end on a pushed limit.
+    if (ctx.IsExceedingLimit(ptr)) return false;
+    input->SetLastTag(ctx.LastTag());
+  } else {
+    input->SetConsumed();
+  }
+  return CheckFieldPresence(ctx, *this, parse_flags);
+}
+
+bool MessageLite::MergePartialFromCodedStream(io::CodedInputStream* input) {
+  return MergeFromImpl(input, kMergePartial);
 }
 
 bool MessageLite::MergeFromCodedStream(io::CodedInputStream* input) {
-  return InlineMergeFromCodedStream(input, this);
+  return MergeFromImpl(input, kMerge);
 }
 
 bool MessageLite::ParseFromCodedStream(io::CodedInputStream* input) {
-  return InlineParseFromCodedStream(input, this);
+  Clear();
+  return MergeFromImpl(input, kParse);
 }
 
 bool MessageLite::ParsePartialFromCodedStream(io::CodedInputStream* input) {
-  return InlineParsePartialFromCodedStream(input, this);
+  Clear();
+  return MergeFromImpl(input, kParsePartial);
 }
 
 bool MessageLite::ParseFromZeroCopyStream(io::ZeroCopyInputStream* input) {
-  io::CodedInputStream decoder(input);
-  return ParseFromCodedStream(&decoder) && decoder.ConsumedEntireMessage();
+  return ParseFrom<kParse>(input);
 }
 
 bool MessageLite::ParsePartialFromZeroCopyStream(
     io::ZeroCopyInputStream* input) {
-  io::CodedInputStream decoder(input);
-  return ParsePartialFromCodedStream(&decoder) &&
-         decoder.ConsumedEntireMessage();
+  return ParseFrom<kParsePartial>(input);
+}
+
+bool MessageLite::ParseFromFileDescriptor(int file_descriptor) {
+  io::FileInputStream input(file_descriptor);
+  return ParseFromZeroCopyStream(&input) && input.GetErrno() == 0;
+}
+
+bool MessageLite::ParsePartialFromFileDescriptor(int file_descriptor) {
+  io::FileInputStream input(file_descriptor);
+  return ParsePartialFromZeroCopyStream(&input) && input.GetErrno() == 0;
+}
+
+bool MessageLite::ParseFromIstream(std::istream* input) {
+  io::IstreamInputStream zero_copy_input(input);
+  return ParseFromZeroCopyStream(&zero_copy_input) && input->eof();
 }
 
-bool MessageLite::ParseFromBoundedZeroCopyStream(
+bool MessageLite::ParsePartialFromIstream(std::istream* input) {
+  io::IstreamInputStream zero_copy_input(input);
+  return ParsePartialFromZeroCopyStream(&zero_copy_input) && input->eof();
+}
+
+bool MessageLite::MergePartialFromBoundedZeroCopyStream(
     io::ZeroCopyInputStream* input, int size) {
-  io::CodedInputStream decoder(input);
-  decoder.PushLimit(size);
-  return ParseFromCodedStream(&decoder) &&
-         decoder.ConsumedEntireMessage() &&
-         decoder.BytesUntilLimit() == 0;
+  return ParseFrom<kMergePartial>(internal::BoundedZCIS{input, size});
+}
+
+bool MessageLite::MergeFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input,
+                                                 int size) {
+  return ParseFrom<kMerge>(internal::BoundedZCIS{input, size});
+}
+
+bool MessageLite::ParseFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input,
+                                                 int size) {
+  return ParseFrom<kParse>(internal::BoundedZCIS{input, size});
 }
 
 bool MessageLite::ParsePartialFromBoundedZeroCopyStream(
     io::ZeroCopyInputStream* input, int size) {
-  io::CodedInputStream decoder(input);
-  decoder.PushLimit(size);
-  return ParsePartialFromCodedStream(&decoder) &&
-         decoder.ConsumedEntireMessage() &&
-         decoder.BytesUntilLimit() == 0;
+  return ParseFrom<kParsePartial>(internal::BoundedZCIS{input, size});
 }
 
-bool MessageLite::ParseFromString(const string& data) {
-  return InlineParseFromArray(data.data(), data.size(), this);
+bool MessageLite::ParseFromString(ConstStringParam data) {
+  return ParseFrom<kParse>(data);
 }
 
-bool MessageLite::ParsePartialFromString(const string& data) {
-  return InlineParsePartialFromArray(data.data(), data.size(), this);
+bool MessageLite::ParsePartialFromString(ConstStringParam data) {
+  return ParseFrom<kParsePartial>(data);
 }
 
 bool MessageLite::ParseFromArray(const void* data, int size) {
-  return InlineParseFromArray(data, size, this);
+  return ParseFrom<kParse>(as_string_view(data, size));
 }
 
 bool MessageLite::ParsePartialFromArray(const void* data, int size) {
-  return InlineParsePartialFromArray(data, size, this);
+  return ParseFrom<kParsePartial>(as_string_view(data, size));
+}
+
+bool MessageLite::MergeFromString(ConstStringParam data) {
+  return ParseFrom<kMerge>(data);
 }
 
 
 // ===================================================================
 
-uint8* MessageLite::SerializeWithCachedSizesToArray(uint8* target) const {
-  return InternalSerializeWithCachedSizesToArray(
-      io::CodedOutputStream::IsDefaultSerializationDeterministic(), target);
+inline uint8_t* SerializeToArrayImpl(const MessageLite& msg, uint8_t* target,
+                                     int size) {
+  constexpr bool debug = false;
+  if (debug) {
+    // Force serialization to a stream with a block size of 1, which forces
+    // all writes to the stream to cross buffers triggering all fallback paths
+    // in the unittests when serializing to string / array.
+    io::ArrayOutputStream stream(target, size, 1);
+    uint8_t* ptr;
+    io::EpsCopyOutputStream out(
+        &stream, io::CodedOutputStream::IsDefaultSerializationDeterministic(),
+        &ptr);
+    ptr = msg._InternalSerialize(ptr, &out);
+    out.Trim(ptr);
+    GOOGLE_DCHECK(!out.HadError() && stream.ByteCount() == size);
+    return target + size;
+  } else {
+    io::EpsCopyOutputStream out(
+        target, size,
+        io::CodedOutputStream::IsDefaultSerializationDeterministic());
+    auto res = msg._InternalSerialize(target, &out);
+    GOOGLE_DCHECK(target + size == res);
+    return res;
+  }
+}
+
+uint8_t* MessageLite::SerializeWithCachedSizesToArray(uint8_t* target) const {
+  // We only optimize this when using optimize_for = SPEED.  In other cases
+  // we just use the CodedOutputStream path.
+  return SerializeToArrayImpl(*this, target, GetCachedSize());
 }
 
 bool MessageLite::SerializeToCodedStream(io::CodedOutputStream* output) const {
@@ -236,76 +370,101 @@ bool MessageLite::SerializePartialToCodedStream(
     io::CodedOutputStream* output) const {
   const size_t size = ByteSizeLong();  // Force size to be cached.
   if (size > INT_MAX) {
-    GOOGLE_LOG(ERROR) << "Exceeded maximum protobuf size of 2GB: " << size;
+    GOOGLE_LOG(ERROR) << GetTypeName()
+               << " exceeded maximum protobuf size of 2GB: " << size;
     return false;
   }
 
-  uint8* buffer = output->GetDirectBufferForNBytesAndAdvance(size);
-  if (buffer != NULL) {
-    uint8* end = InternalSerializeWithCachedSizesToArray(
-        output->IsSerializationDeterministic(), buffer);
-    if (end - buffer != size) {
-      ByteSizeConsistencyError(size, ByteSizeLong(), end - buffer, *this);
-    }
-    return true;
-  } else {
-    int original_byte_count = output->ByteCount();
-    SerializeWithCachedSizes(output);
-    if (output->HadError()) {
-      return false;
-    }
-    int final_byte_count = output->ByteCount();
-
-    if (final_byte_count - original_byte_count != size) {
-      ByteSizeConsistencyError(size, ByteSizeLong(),
-                               final_byte_count - original_byte_count, *this);
-    }
+  int original_byte_count = output->ByteCount();
+  SerializeWithCachedSizes(output);
+  if (output->HadError()) {
+    return false;
+  }
+  int final_byte_count = output->ByteCount();
 
-    return true;
+  if (final_byte_count - original_byte_count != static_cast<int64_t>(size)) {
+    ByteSizeConsistencyError(size, ByteSizeLong(),
+                             final_byte_count - original_byte_count, *this);
   }
+
+  return true;
 }
 
 bool MessageLite::SerializeToZeroCopyStream(
     io::ZeroCopyOutputStream* output) const {
-  io::CodedOutputStream encoder(output);
-  return SerializeToCodedStream(&encoder);
+  GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
+  return SerializePartialToZeroCopyStream(output);
 }
 
 bool MessageLite::SerializePartialToZeroCopyStream(
     io::ZeroCopyOutputStream* output) const {
-  io::CodedOutputStream encoder(output);
-  return SerializePartialToCodedStream(&encoder);
+  const size_t size = ByteSizeLong();  // Force size to be cached.
+  if (size > INT_MAX) {
+    GOOGLE_LOG(ERROR) << GetTypeName()
+               << " exceeded maximum protobuf size of 2GB: " << size;
+    return false;
+  }
+
+  uint8_t* target;
+  io::EpsCopyOutputStream stream(
+      output, io::CodedOutputStream::IsDefaultSerializationDeterministic(),
+      &target);
+  target = _InternalSerialize(target, &stream);
+  stream.Trim(target);
+  if (stream.HadError()) return false;
+  return true;
+}
+
+bool MessageLite::SerializeToFileDescriptor(int file_descriptor) const {
+  io::FileOutputStream output(file_descriptor);
+  return SerializeToZeroCopyStream(&output) && output.Flush();
 }
 
-bool MessageLite::AppendToString(string* output) const {
+bool MessageLite::SerializePartialToFileDescriptor(int file_descriptor) const {
+  io::FileOutputStream output(file_descriptor);
+  return SerializePartialToZeroCopyStream(&output) && output.Flush();
+}
+
+bool MessageLite::SerializeToOstream(std::ostream* output) const {
+  {
+    io::OstreamOutputStream zero_copy_output(output);
+    if (!SerializeToZeroCopyStream(&zero_copy_output)) return false;
+  }
+  return output->good();
+}
+
+bool MessageLite::SerializePartialToOstream(std::ostream* output) const {
+  io::OstreamOutputStream zero_copy_output(output);
+  return SerializePartialToZeroCopyStream(&zero_copy_output);
+}
+
+bool MessageLite::AppendToString(std::string* output) const {
   GOOGLE_DCHECK(IsInitialized()) << InitializationErrorMessage("serialize", *this);
   return AppendPartialToString(output);
 }
 
-bool MessageLite::AppendPartialToString(string* output) const {
+bool MessageLite::AppendPartialToString(std::string* output) const {
   size_t old_size = output->size();
   size_t byte_size = ByteSizeLong();
   if (byte_size > INT_MAX) {
-    GOOGLE_LOG(ERROR) << "Exceeded maximum protobuf size of 2GB: " << byte_size;
+    GOOGLE_LOG(ERROR) << GetTypeName()
+               << " exceeded maximum protobuf size of 2GB: " << byte_size;
     return false;
   }
 
-  STLStringResizeUninitialized(output, old_size + byte_size);
-  uint8* start =
-      reinterpret_cast<uint8*>(io::mutable_string_data(output) + old_size);
-  uint8* end = SerializeWithCachedSizesToArray(start);
-  if (end - start != byte_size) {
-    ByteSizeConsistencyError(byte_size, ByteSizeLong(), end - start, *this);
-  }
+  STLStringResizeUninitializedAmortized(output, old_size + byte_size);
+  uint8_t* start =
+      reinterpret_cast<uint8_t*>(io::mutable_string_data(output) + old_size);
+  SerializeToArrayImpl(*this, start, byte_size);
   return true;
 }
 
-bool MessageLite::SerializeToString(string* output) const {
+bool MessageLite::SerializeToString(std::string* output) const {
   output->clear();
   return AppendToString(output);
 }
 
-bool MessageLite::SerializePartialToString(string* output) const {
+bool MessageLite::SerializePartialToString(std::string* output) const {
   output->clear();
   return AppendPartialToString(output);
 }
@@ -316,71 +475,40 @@ bool MessageLite::SerializeToArray(void* data, int size) const {
 }
 
 bool MessageLite::SerializePartialToArray(void* data, int size) const {
-  int byte_size = ByteSizeLong();
-  if (size < byte_size) return false;
-  uint8* start = reinterpret_cast<uint8*>(data);
-  uint8* end = SerializeWithCachedSizesToArray(start);
-  if (end - start != byte_size) {
-    ByteSizeConsistencyError(byte_size, ByteSizeLong(), end - start, *this);
+  const size_t byte_size = ByteSizeLong();
+  if (byte_size > INT_MAX) {
+    GOOGLE_LOG(ERROR) << GetTypeName()
+               << " exceeded maximum protobuf size of 2GB: " << byte_size;
+    return false;
   }
+  if (size < static_cast<int64_t>(byte_size)) return false;
+  uint8_t* start = reinterpret_cast<uint8_t*>(data);
+  SerializeToArrayImpl(*this, start, byte_size);
   return true;
 }
 
-string MessageLite::SerializeAsString() const {
+std::string MessageLite::SerializeAsString() const {
   // If the compiler implements the (Named) Return Value Optimization,
   // the local variable 'output' will not actually reside on the stack
   // of this function, but will be overlaid with the object that the
   // caller supplied for the return value to be constructed in.
-  string output;
-  if (!AppendToString(&output))
-    output.clear();
+  std::string output;
+  if (!AppendToString(&output)) output.clear();
   return output;
 }
 
-string MessageLite::SerializePartialAsString() const {
-  string output;
-  if (!AppendPartialToString(&output))
-    output.clear();
+std::string MessageLite::SerializePartialAsString() const {
+  std::string output;
+  if (!AppendPartialToString(&output)) output.clear();
   return output;
 }
 
-void MessageLite::SerializeWithCachedSizes(
-    io::CodedOutputStream* output) const {
-  GOOGLE_DCHECK(InternalGetTable());
-  internal::TableSerialize(
-      *this,
-      static_cast<const internal::SerializationTable*>(InternalGetTable()),
-      output);
-}
-
-// The table driven code optimizes the case that the CodedOutputStream buffer
-// is large enough to serialize into it directly.
-// 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 {
-  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;
-  } else {
-    return internal::TableSerializeToArray(*this, table, deterministic, target);
-  }
-}
 
 namespace internal {
-template<>
+
+template <>
 MessageLite* GenericTypeHandler<MessageLite>::NewFromPrototype(
-    const MessageLite* prototype, google::protobuf::Arena* arena) {
+    const MessageLite* prototype, Arena* arena) {
   return prototype->New(arena);
 }
 template <>
@@ -388,20 +516,80 @@ void GenericTypeHandler<MessageLite>::Merge(const MessageLite& from,
                                             MessageLite* to) {
   to->CheckTypeAndMergeFrom(from);
 }
-template<>
-void GenericTypeHandler<string>::Merge(const string& from,
-                                              string* to) {
+template <>
+void GenericTypeHandler<std::string>::Merge(const std::string& from,
+                                            std::string* to) {
   *to = from;
 }
 
-bool proto3_preserve_unknown_ = true;
+// Non-inline variants of std::string specializations for
+// various InternalMetadata routines.
+template <>
+void InternalMetadata::DoClear<std::string>() {
+  mutable_unknown_fields<std::string>()->clear();
+}
+
+template <>
+void InternalMetadata::DoMergeFrom<std::string>(const std::string& other) {
+  mutable_unknown_fields<std::string>()->append(other);
+}
+
+template <>
+void InternalMetadata::DoSwap<std::string>(std::string* other) {
+  mutable_unknown_fields<std::string>()->swap(*other);
+}
+
+}  // namespace internal
+
+
+// ===================================================================
+// Shutdown support.
+
+namespace internal {
+
+struct ShutdownData {
+  ~ShutdownData() {
+    std::reverse(functions.begin(), functions.end());
+    for (auto pair : functions) pair.first(pair.second);
+  }
+
+  static ShutdownData* get() {
+    static auto* data = new ShutdownData;
+    return data;
+  }
+
+  std::vector<std::pair<void (*)(const void*), const void*>> functions;
+  Mutex mutex;
+};
+
+static void RunZeroArgFunc(const void* arg) {
+  void (*func)() = reinterpret_cast<void (*)()>(const_cast<void*>(arg));
+  func();
+}
 
-void SetProto3PreserveUnknownsDefault(bool preserve) {
-  proto3_preserve_unknown_ = preserve;
+void OnShutdown(void (*func)()) {
+  OnShutdownRun(RunZeroArgFunc, reinterpret_cast<void*>(func));
 }
 
+void OnShutdownRun(void (*f)(const void*), const void* arg) {
+  auto shutdown_data = ShutdownData::get();
+  MutexLock lock(&shutdown_data->mutex);
+  shutdown_data->functions.push_back(std::make_pair(f, arg));
+}
 
 }  // namespace internal
 
+void ShutdownProtobufLibrary() {
+  // This function should be called only once, but accepts multiple calls.
+  static bool is_shutdown = false;
+  if (!is_shutdown) {
+    delete internal::ShutdownData::get();
+    is_shutdown = true;
+  }
+}
+
+
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 5cd6bab..5e6fbdb 100644 (file)
 #define GOOGLE_PROTOBUF_MESSAGE_LITE_H__
 
 #include <climits>
+#include <string>
+
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/explicitly_constructed.h>
+#include <google/protobuf/metadata_lite.h>
 #include <google/protobuf/stubs/once.h>
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/port.h>
+#include <google/protobuf/stubs/strutil.h>
+
+
+// clang-format off
+#include <google/protobuf/port_def.inc>
+// clang-format on
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
-class Arena;
+
+template <typename T>
+class RepeatedPtrField;
+
+class FastReflectionMessageMutator;
+class FastReflectionStringSetter;
+class Reflection;
+
 namespace io {
+
 class CodedInputStream;
 class CodedOutputStream;
 class ZeroCopyInputStream;
 class ZeroCopyOutputStream;
-}
+
+}  // namespace io
 namespace internal {
 
+class SwapFieldHelper;
+
+// Tag type used to invoke the constinit constructor overload of some classes.
+// Such constructors are internal implementation details of the library.
+struct ConstantInitialized {
+  explicit ConstantInitialized() = default;
+};
+
+// See parse_context.h for explanation
+class ParseContext;
+
+class ExtensionSet;
+class LazyField;
+class RepeatedPtrFieldBase;
+class TcParser;
 class WireFormatLite;
+class WeakFieldMap;
+
+template <typename Type>
+class GenericTypeHandler;  // defined in repeated_field.h
 
-#ifndef SWIG
 // We compute sizes as size_t but cache them as int.  This function converts a
 // computed size to a cached size.  Since we don't proceed with serialization
 // if the total size was > INT_MAX, it is not important what this function
@@ -86,66 +129,18 @@ inline int ToIntSize(size_t size) {
   return static_cast<int>(size);
 }
 
-// This type wraps a variable whose constructor and destructor are explicitly
-// called. It is particularly useful for a global variable, without its
-// constructor and destructor run on start and end of the program lifetime.
-// This circumvents the initial construction order fiasco, while keeping
-// the address of the empty string a compile time constant.
-//
-// Pay special attention to the initialization state of the object.
-// 1. The object is "uninitialized" to begin with.
-// 2. Call DefaultConstruct() only if the object is uninitialized.
-//    After the call, the object becomes "initialized".
-// 3. Call get() and get_mutable() only if the object is initialized.
-// 4. Call Destruct() only if the object is initialized.
-//    After the call, the object becomes uninitialized.
-template <typename T>
-class ExplicitlyConstructed {
- public:
-  void DefaultConstruct() {
-    new (&union_) T();
-  }
-
-  void Destruct() {
-    get_mutable()->~T();
-  }
-
-#if LANG_CXX11
-  constexpr
-#endif
-      const T&
-      get() const {
-    return reinterpret_cast<const T&>(union_);
-  }
-  T* get_mutable() { return reinterpret_cast<T*>(&union_); }
-
- private:
-  // Prefer c++14 aligned_storage, but for compatibility this will do.
-  union AlignedUnion {
-    char space[sizeof(T)];
-    int64 align_to_int64;
-    void* align_to_ptr;
-  } union_;
-};
-
 // Default empty string object. Don't use this directly. Instead, call
 // GetEmptyString() to get the reference.
-extern ExplicitlyConstructed< ::std::string> fixed_address_empty_string;
-LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_;
-LIBPROTOBUF_EXPORT void InitEmptyString();
+PROTOBUF_EXPORT extern ExplicitlyConstructed<std::string>
+    fixed_address_empty_string;
 
 
-LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyStringAlreadyInited() {
+PROTOBUF_EXPORT constexpr const std::string& GetEmptyStringAlreadyInited() {
   return fixed_address_empty_string.get();
 }
 
-LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyString() {
-  ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString);
-  return GetEmptyStringAlreadyInited();
-}
+PROTOBUF_EXPORT size_t StringSpaceUsedExcludingSelfLong(const std::string& str);
 
-LIBPROTOBUF_EXPORT size_t StringSpaceUsedExcludingSelfLong(const string& str);
-#endif  // SWIG
 }  // namespace internal
 
 // Interface to light weight protocol messages.
@@ -171,41 +166,29 @@ LIBPROTOBUF_EXPORT size_t StringSpaceUsedExcludingSelfLong(const string& str);
 // is best when you only have a small number of message types linked
 // into your binary, in which case the size of the protocol buffers
 // runtime itself is the biggest problem.
-class LIBPROTOBUF_EXPORT MessageLite {
+//
+// Users must not derive from this class. Only the protocol compiler and
+// the internal library are allowed to create subclasses.
+class PROTOBUF_EXPORT MessageLite {
  public:
-  inline MessageLite() {}
-  virtual ~MessageLite() {}
+  constexpr MessageLite() {}
+  virtual ~MessageLite() = default;
 
   // Basic Operations ------------------------------------------------
 
   // Get the name of this message type, e.g. "foo.bar.BazProto".
-  virtual string GetTypeName() const = 0;
+  virtual std::string GetTypeName() const = 0;
 
   // Construct a new instance of the same type.  Ownership is passed to the
   // caller.
-  virtual MessageLite* New() const = 0;
+  MessageLite* New() const { return New(nullptr); }
 
   // Construct a new instance on the arena. Ownership is passed to the caller
-  // if arena is a NULL. Default implementation for backwards compatibility.
-  virtual MessageLite* New(::google::protobuf::Arena* arena) const;
-
-  // Get the arena, if any, associated with this message. Virtual method
-  // required for generic operations but most arena-related operations should
-  // use the GetArenaNoVirtual() generated-code method. Default implementation
-  // to reduce code size by avoiding the need for per-type implementations
-  // when types do not implement arena support.
-  virtual ::google::protobuf::Arena* GetArena() const { return NULL; }
-
-  // Get a pointer that may be equal to this message's arena, or may not be.
-  // If the value returned by this method is equal to some arena pointer, then
-  // this message is on that arena; however, if this message is on some arena,
-  // this method may or may not return that arena's pointer. As a tradeoff,
-  // this method may be more efficient than GetArena(). The intent is to allow
-  // underlying representations that use e.g. tagged pointers to sometimes
-  // store the arena pointer directly, and sometimes in a more indirect way,
-  // and allow a fastpath comparison against the arena pointer when it's easy
-  // to obtain.
-  virtual void* GetMaybeArenaPointer() const { return GetArena(); }
+  // if arena is a nullptr.
+  virtual MessageLite* New(Arena* arena) const = 0;
+
+  // Same as GetOwningArena.
+  Arena* GetArena() const { return GetOwningArena(); }
 
   // Clear all fields of the message and set them to their default values.
   // Clear() avoids freeing memory, assuming that any memory allocated
@@ -220,12 +203,27 @@ class LIBPROTOBUF_EXPORT MessageLite {
   // This is not implemented for Lite messages -- it just returns "(cannot
   // determine missing fields for lite message)".  However, it is implemented
   // for full messages.  See message.h.
-  virtual string InitializationErrorString() const;
+  virtual std::string InitializationErrorString() const;
 
   // If |other| is the exact same class as this, calls MergeFrom(). Otherwise,
   // results are undefined (probably crash).
   virtual void CheckTypeAndMergeFrom(const MessageLite& other) = 0;
 
+  // These methods return a human-readable summary of the message. Note that
+  // since the MessageLite interface does not support reflection, there is very
+  // little information that these methods can provide. They are shadowed by
+  // methods of the same name on the Message interface which provide much more
+  // information. The methods here are intended primarily to facilitate code
+  // reuse for logic that needs to interoperate with both full and lite protos.
+  //
+  // The format of the returned string is subject to change, so please do not
+  // assume it will remain stable over time.
+  std::string DebugString() const;
+  std::string ShortDebugString() const { return DebugString(); }
+  // MessageLite::DebugString is already Utf8 Safe. This is to add compatibility
+  // with Message.
+  std::string Utf8DebugString() const { return DebugString(); }
+
   // Parsing ---------------------------------------------------------
   // Methods for parsing in protocol buffer format.  Most of these are
   // just simple wrappers around MergeFromCodedStream().  Clear() will be
@@ -236,42 +234,70 @@ class LIBPROTOBUF_EXPORT MessageLite {
   // format.  A successful return does not indicate the entire input is
   // consumed, ensure you call ConsumedEntireMessage() to check that if
   // applicable.
-  bool ParseFromCodedStream(io::CodedInputStream* input);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParseFromCodedStream(
+      io::CodedInputStream* input);
   // Like ParseFromCodedStream(), but accepts messages that are missing
   // required fields.
-  bool ParsePartialFromCodedStream(io::CodedInputStream* input);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParsePartialFromCodedStream(
+      io::CodedInputStream* input);
   // Read a protocol buffer from the given zero-copy input stream.  If
   // successful, the entire input will be consumed.
-  bool ParseFromZeroCopyStream(io::ZeroCopyInputStream* input);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParseFromZeroCopyStream(
+      io::ZeroCopyInputStream* input);
   // Like ParseFromZeroCopyStream(), but accepts messages that are missing
   // required fields.
-  bool ParsePartialFromZeroCopyStream(io::ZeroCopyInputStream* input);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParsePartialFromZeroCopyStream(
+      io::ZeroCopyInputStream* input);
+  // Parse a protocol buffer from a file descriptor.  If successful, the entire
+  // input will be consumed.
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParseFromFileDescriptor(
+      int file_descriptor);
+  // Like ParseFromFileDescriptor(), but accepts messages that are missing
+  // required fields.
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParsePartialFromFileDescriptor(
+      int file_descriptor);
+  // Parse a protocol buffer from a C++ istream.  If successful, the entire
+  // input will be consumed.
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParseFromIstream(std::istream* input);
+  // Like ParseFromIstream(), but accepts messages that are missing
+  // required fields.
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParsePartialFromIstream(
+      std::istream* input);
   // Read a protocol buffer from the given zero-copy input stream, expecting
   // the message to be exactly "size" bytes long.  If successful, exactly
   // this many bytes will have been consumed from the input.
-  bool ParseFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input, int size);
+  bool MergePartialFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input,
+                                             int size);
   // Like ParseFromBoundedZeroCopyStream(), but accepts messages that are
   // missing required fields.
-  bool ParsePartialFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input,
-                                             int size);
+  bool MergeFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input, int size);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParseFromBoundedZeroCopyStream(
+      io::ZeroCopyInputStream* input, int size);
+  // Like ParseFromBoundedZeroCopyStream(), but accepts messages that are
+  // missing required fields.
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParsePartialFromBoundedZeroCopyStream(
+      io::ZeroCopyInputStream* input, int size);
   // Parses a protocol buffer contained in a string. Returns true on success.
   // This function takes a string in the (non-human-readable) binary wire
   // format, matching the encoding output by MessageLite::SerializeToString().
   // If you'd like to convert a human-readable string into a protocol buffer
   // object, see google::protobuf::TextFormat::ParseFromString().
-  bool ParseFromString(const string& data);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParseFromString(ConstStringParam data);
   // Like ParseFromString(), but accepts messages that are missing
   // required fields.
-  bool ParsePartialFromString(const string& data);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParsePartialFromString(
+      ConstStringParam data);
   // Parse a protocol buffer contained in an array of bytes.
-  bool ParseFromArray(const void* data, int size);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParseFromArray(const void* data,
+                                                       int size);
   // Like ParseFromArray(), but accepts messages that are missing
   // required fields.
-  bool ParsePartialFromArray(const void* data, int size);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES bool ParsePartialFromArray(const void* data,
+                                                              int size);
 
 
   // Reads a protocol buffer from the stream and merges it into this
-  // Message.  Singular fields read from the input overwrite what is
+  // Message.  Singular fields read from the what is
   // already in the Message and repeated fields are appended to those
   // already present.
   //
@@ -279,7 +305,7 @@ class LIBPROTOBUF_EXPORT MessageLite {
   // (for groups) or input->ConsumedEntireMessage() (for non-groups) after
   // this returns to verify that the message's end was delimited correctly.
   //
-  // ParsefromCodedStream() is implemented as Clear() followed by
+  // ParseFromCodedStream() is implemented as Clear() followed by
   // MergeFromCodedStream().
   bool MergeFromCodedStream(io::CodedInputStream* input);
 
@@ -288,7 +314,10 @@ class LIBPROTOBUF_EXPORT MessageLite {
   //
   // MergeFromCodedStream() is just implemented as MergePartialFromCodedStream()
   // followed by IsInitialized().
-  virtual bool MergePartialFromCodedStream(io::CodedInputStream* input) = 0;
+  bool MergePartialFromCodedStream(io::CodedInputStream* input);
+
+  // Merge a protocol buffer contained in a string.
+  bool MergeFromString(ConstStringParam data);
 
 
   // Serialization ---------------------------------------------------
@@ -308,9 +337,9 @@ class LIBPROTOBUF_EXPORT MessageLite {
   bool SerializePartialToZeroCopyStream(io::ZeroCopyOutputStream* output) const;
   // Serialize the message and store it in the given string.  All required
   // fields must be set.
-  bool SerializeToString(string* output) const;
+  bool SerializeToString(std::string* output) const;
   // Like SerializeToString(), but allows missing required fields.
-  bool SerializePartialToString(string* output) const;
+  bool SerializePartialToString(std::string* output) const;
   // Serialize the message and store it in the given byte array.  All required
   // fields must be set.
   bool SerializeToArray(void* data, int size) const;
@@ -323,15 +352,27 @@ class LIBPROTOBUF_EXPORT MessageLite {
   // Note: If you intend to generate many such strings, you may
   // reduce heap fragmentation by instead re-using the same string
   // object with calls to SerializeToString().
-  string SerializeAsString() const;
+  std::string SerializeAsString() const;
   // Like SerializeAsString(), but allows missing required fields.
-  string SerializePartialAsString() const;
-
-  // Like SerializeToString(), but appends to the data to the string's existing
-  // contents.  All required fields must be set.
-  bool AppendToString(string* output) const;
+  std::string SerializePartialAsString() const;
+
+  // Serialize the message and write it to the given file descriptor.  All
+  // required fields must be set.
+  bool SerializeToFileDescriptor(int file_descriptor) const;
+  // Like SerializeToFileDescriptor(), but allows missing required fields.
+  bool SerializePartialToFileDescriptor(int file_descriptor) const;
+  // Serialize the message and write it to the given C++ ostream.  All
+  // required fields must be set.
+  bool SerializeToOstream(std::ostream* output) const;
+  // Like SerializeToOstream(), but allows missing required fields.
+  bool SerializePartialToOstream(std::ostream* output) const;
+
+  // Like SerializeToString(), but appends to the data to the string's
+  // existing contents.  All required fields must be set.
+  bool AppendToString(std::string* output) const;
   // Like AppendToString(), but allows missing required fields.
-  bool AppendPartialToString(string* output) const;
+  bool AppendPartialToString(std::string* output) const;
+
 
   // Computes the serialized size of the message.  This recursively calls
   // ByteSizeLong() on all embedded messages.
@@ -341,16 +382,15 @@ class LIBPROTOBUF_EXPORT MessageLite {
   virtual size_t ByteSizeLong() const = 0;
 
   // Legacy ByteSize() API.
-  PROTOBUF_RUNTIME_DEPRECATED("Please use ByteSizeLong() instead")
-  int ByteSize() const {
-    return internal::ToIntSize(ByteSizeLong());
-  }
+  PROTOBUF_DEPRECATED_MSG("Please use ByteSizeLong() instead")
+  int ByteSize() const { return internal::ToIntSize(ByteSizeLong()); }
 
   // Serializes the message without recomputing the size.  The message must not
   // have changed since the last call to ByteSize(), and the value returned by
   // ByteSize must be non-negative.  Otherwise the results are undefined.
-  virtual void SerializeWithCachedSizes(
-      io::CodedOutputStream* output) const;
+  void SerializeWithCachedSizes(io::CodedOutputStream* output) const {
+    output->SetCur(_InternalSerialize(output->Cur(), output->EpsCopy()));
+  }
 
   // Functions below here are not part of the public interface.  It isn't
   // enforced, but they should be treated as private, and will be private
@@ -362,7 +402,7 @@ class LIBPROTOBUF_EXPORT MessageLite {
   // must point at a byte array of at least ByteSize() bytes.  Whether to use
   // deterministic serialization, e.g., maps in sorted order, is determined by
   // CodedOutputStream::IsDefaultSerializationDeterministic().
-  virtual uint8* SerializeWithCachedSizesToArray(uint8* target) const;
+  uint8_t* SerializeWithCachedSizesToArray(uint8_t* target) const;
 
   // Returns the result of the last call to ByteSize().  An embedded message's
   // size is needed both to serialize it (because embedded messages are
@@ -377,36 +417,177 @@ class LIBPROTOBUF_EXPORT MessageLite {
   // method.)
   virtual int GetCachedSize() const = 0;
 
-  virtual uint8* InternalSerializeWithCachedSizesToArray(bool deterministic,
-                                                         uint8* target) const;
+  virtual const char* _InternalParse(const char* /*ptr*/,
+                                     internal::ParseContext* /*ctx*/) {
+    return nullptr;
+  }
+
+ protected:
+  template <typename T>
+  static T* CreateMaybeMessage(Arena* arena) {
+    return Arena::CreateMaybeMessage<T>(arena);
+  }
+
+  inline explicit MessageLite(Arena* arena, bool is_message_owned = false)
+      : _internal_metadata_(arena, is_message_owned) {}
+
+  // Returns the arena, if any, that directly owns this message and its internal
+  // memory (Arena::Own is different in that the arena doesn't directly own the
+  // internal memory). This method is used in proto's implementation for
+  // swapping, moving and setting allocated, for deciding whether the ownership
+  // of this message or its internal memory could be changed.
+  Arena* GetOwningArena() const { return _internal_metadata_.owning_arena(); }
+
+  // Returns the arena, used for allocating internal objects(e.g., child
+  // messages, etc), or owning incoming objects (e.g., set allocated).
+  Arena* GetArenaForAllocation() const { return _internal_metadata_.arena(); }
+
+  internal::InternalMetadata _internal_metadata_;
+
+ public:
+  enum ParseFlags {
+    kMerge = 0,
+    kParse = 1,
+    kMergePartial = 2,
+    kParsePartial = 3,
+    kMergeWithAliasing = 4,
+    kParseWithAliasing = 5,
+    kMergePartialWithAliasing = 6,
+    kParsePartialWithAliasing = 7
+  };
+
+  template <ParseFlags flags, typename T>
+  bool ParseFrom(const T& input);
+
+  // Fast path when conditions match (ie. non-deterministic)
+  //  uint8_t* _InternalSerialize(uint8_t* ptr) const;
+  virtual uint8_t* _InternalSerialize(
+      uint8_t* ptr, io::EpsCopyOutputStream* stream) const = 0;
+
+  // Identical to IsInitialized() except that it logs an error message.
+  bool IsInitializedWithErrors() const {
+    if (IsInitialized()) return true;
+    LogInitializationErrorMessage();
+    return false;
+  }
 
  private:
   // TODO(gerbens) make this a pure abstract function
-  virtual const void* InternalGetTable() const { return NULL; }
+  virtual const void* InternalGetTable() const { return nullptr; }
 
-  friend class internal::WireFormatLite;
+  friend class FastReflectionMessageMutator;
+  friend class FastReflectionStringSetter;
   friend class Message;
+  friend class Reflection;
+  friend class internal::ExtensionSet;
+  friend class internal::LazyField;
+  friend class internal::SwapFieldHelper;
+  friend class internal::TcParser;
+  friend class internal::WeakFieldMap;
+  friend class internal::WireFormatLite;
+
+  template <typename Type>
+  friend class Arena::InternalHelper;
+  template <typename Type>
+  friend class internal::GenericTypeHandler;
+
+  void LogInitializationErrorMessage() const;
+
+  bool MergeFromImpl(io::CodedInputStream* input, ParseFlags parse_flags);
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageLite);
 };
 
 namespace internal {
 
-extern bool LIBPROTOBUF_EXPORT proto3_preserve_unknown_;
+template <bool alias>
+bool MergeFromImpl(StringPiece input, MessageLite* msg,
+                   MessageLite::ParseFlags parse_flags);
+extern template bool MergeFromImpl<false>(StringPiece input,
+                                          MessageLite* msg,
+                                          MessageLite::ParseFlags parse_flags);
+extern template bool MergeFromImpl<true>(StringPiece input,
+                                         MessageLite* msg,
+                                         MessageLite::ParseFlags parse_flags);
+
+template <bool alias>
+bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg,
+                   MessageLite::ParseFlags parse_flags);
+extern template bool MergeFromImpl<false>(io::ZeroCopyInputStream* input,
+                                          MessageLite* msg,
+                                          MessageLite::ParseFlags parse_flags);
+extern template bool MergeFromImpl<true>(io::ZeroCopyInputStream* input,
+                                         MessageLite* msg,
+                                         MessageLite::ParseFlags parse_flags);
+
+struct BoundedZCIS {
+  io::ZeroCopyInputStream* zcis;
+  int limit;
+};
+
+template <bool alias>
+bool MergeFromImpl(BoundedZCIS input, MessageLite* msg,
+                   MessageLite::ParseFlags parse_flags);
+extern template bool MergeFromImpl<false>(BoundedZCIS input, MessageLite* msg,
+                                          MessageLite::ParseFlags parse_flags);
+extern template bool MergeFromImpl<true>(BoundedZCIS input, MessageLite* msg,
+                                         MessageLite::ParseFlags parse_flags);
 
-// DO NOT USE: For migration only. Will be removed when Proto3 defaults to
-// preserve unknowns.
-inline bool GetProto3PreserveUnknownsDefault() {
-  return proto3_preserve_unknown_;
+template <typename T>
+struct SourceWrapper;
+
+template <bool alias, typename T>
+bool MergeFromImpl(const SourceWrapper<T>& input, MessageLite* msg,
+                   MessageLite::ParseFlags parse_flags) {
+  return input.template MergeInto<alias>(msg, parse_flags);
 }
 
-// DO NOT USE: For migration only. Will be removed when Proto3 defaults to
-// preserve unknowns.
-void LIBPROTOBUF_EXPORT SetProto3PreserveUnknownsDefault(bool preserve);
 }  // namespace internal
 
+template <MessageLite::ParseFlags flags, typename T>
+bool MessageLite::ParseFrom(const T& input) {
+  if (flags & kParse) Clear();
+  constexpr bool alias = (flags & kMergeWithAliasing) != 0;
+  return internal::MergeFromImpl<alias>(input, this, flags);
+}
+
+// ===================================================================
+// Shutdown support.
 
-}  // namespace protobuf
 
+// Shut down the entire protocol buffers library, deleting all static-duration
+// objects allocated by the library or by generated .pb.cc files.
+//
+// There are two reasons you might want to call this:
+// * You use a draconian definition of "memory leak" in which you expect
+//   every single malloc() to have a corresponding free(), even for objects
+//   which live until program exit.
+// * You are writing a dynamically-loaded library which needs to clean up
+//   after itself when the library is unloaded.
+//
+// It is safe to call this multiple times.  However, it is not safe to use
+// any other part of the protocol buffers library after
+// ShutdownProtobufLibrary() has been called. Furthermore this call is not
+// thread safe, user needs to synchronize multiple calls.
+PROTOBUF_EXPORT void ShutdownProtobufLibrary();
+
+namespace internal {
+
+// Register a function to be called when ShutdownProtocolBuffers() is called.
+PROTOBUF_EXPORT void OnShutdown(void (*func)());
+// Run an arbitrary function on an arg
+PROTOBUF_EXPORT void OnShutdownRun(void (*f)(const void*), const void* arg);
+
+template <typename T>
+T* OnShutdownDelete(T* p) {
+  OnShutdownRun([](const void* pp) { delete static_cast<const T*>(pp); }, p);
+  return p;
+}
+
+}  // namespace internal
+}  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_MESSAGE_LITE_H__
index 0a6507c..4e89648 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// This header file defines an internal class that encapsulates internal message
-// metadata (Unknown-field set, Arena pointer, ...) and allows its
-// representation to be made more space-efficient via various optimizations.
-//
-// Note that this is distinct from google::protobuf::Metadata, which encapsulates
-// Descriptor and Reflection pointers.
-
 #ifndef GOOGLE_PROTOBUF_METADATA_H__
 #define GOOGLE_PROTOBUF_METADATA_H__
 
-#include <google/protobuf/metadata_lite.h>
-#include <google/protobuf/unknown_field_set.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-class InternalMetadataWithArena
-    : public InternalMetadataWithArenaBase<UnknownFieldSet,
-                                           InternalMetadataWithArena> {
- public:
-  InternalMetadataWithArena() {}
-  explicit InternalMetadataWithArena(Arena* arena)
-      : InternalMetadataWithArenaBase<UnknownFieldSet,
-                                           InternalMetadataWithArena>(arena) {}
-
-  void DoSwap(UnknownFieldSet* other) {
-    mutable_unknown_fields()->Swap(other);
-  }
-
-  void DoMergeFrom(const UnknownFieldSet& other) {
-    mutable_unknown_fields()->MergeFrom(other);
-  }
-
-  void DoClear() {
-    mutable_unknown_fields()->Clear();
-  }
-
-  static const UnknownFieldSet& default_instance() {
-    return *UnknownFieldSet::default_instance();
-  }
-};
-
-}  // namespace internal
-}  // namespace protobuf
+// TODO(b/151117630): Remove this file and all instances where it gets imported.
 
-}  // namespace google
 #endif  // GOOGLE_PROTOBUF_METADATA_H__
index 454d088..e6ecfb7 100644 (file)
 #ifndef GOOGLE_PROTOBUF_METADATA_LITE_H__
 #define GOOGLE_PROTOBUF_METADATA_LITE_H__
 
+#include <string>
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/arena.h>
-#include <google/protobuf/message_lite.h>
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/port.h>
+
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
 namespace internal {
 
 // This is the representation for messages that support arena allocation. It
-// uses a tagged pointer to either store the Arena pointer, if there are no
-// unknown fields, or a pointer to a block of memory with both the Arena pointer
-// and the UnknownFieldSet, if there are unknown fields. This optimization
-// allows for "zero-overhead" storage of the Arena pointer, relative to the
-// above baseline implementation.
+// uses a tagged pointer to either store the owning Arena pointer, if there are
+// no unknown fields, or a pointer to a block of memory with both the owning
+// Arena pointer and the UnknownFieldSet, if there are unknown fields. Besides,
+// it also uses the tag to distinguish whether the owning Arena pointer is also
+// used by sub-structure allocation. This optimization allows for
+// "zero-overhead" storage of the Arena pointer, relative to the above baseline
+// implementation.
 //
-// The tagged pointer uses the LSB to disambiguate cases, and uses bit 0 == 0 to
-// indicate an arena pointer and bit 0 == 1 to indicate a UFS+Arena-container
-// pointer.
-template <class T, class Derived>
-class InternalMetadataWithArenaBase {
+// The tagged pointer uses the least two significant bits to disambiguate cases.
+// It uses bit 0 == 0 to indicate an arena pointer and bit 0 == 1 to indicate a
+// UFS+Arena-container pointer. Besides it uses bit 1 == 0 to indicate arena
+// allocation and bit 1 == 1 to indicate heap allocation.
+class InternalMetadata {
  public:
-  InternalMetadataWithArenaBase() : ptr_(NULL) {}
-  explicit InternalMetadataWithArenaBase(Arena* arena) : ptr_(arena) {}
+  constexpr InternalMetadata() : ptr_(0) {}
+  explicit InternalMetadata(Arena* arena, bool is_message_owned = false)
+      : ptr_(is_message_owned
+                 ? reinterpret_cast<intptr_t>(arena) | kMessageOwnedArenaTagMask
+                 : reinterpret_cast<intptr_t>(arena)) {
+    GOOGLE_DCHECK(!is_message_owned || arena != nullptr);
+  }
 
-  ~InternalMetadataWithArenaBase() {
-    if (have_unknown_fields() && arena() == NULL) {
-      delete PtrValue<Container>();
+  ~InternalMetadata() {
+    if (HasMessageOwnedArenaTag()) {
+      delete arena();
     }
-    ptr_ = NULL;
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE const T& unknown_fields() const {
-    if (GOOGLE_PREDICT_FALSE(have_unknown_fields())) {
-      return PtrValue<Container>()->unknown_fields;
-    } else {
-      return Derived::default_instance();
+  template <typename T>
+  void Delete() {
+    // Note that Delete<> should be called not more than once.
+    if (have_unknown_fields()) {
+      DeleteOutOfLineHelper<T>();
     }
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* mutable_unknown_fields() {
-    if (GOOGLE_PREDICT_TRUE(have_unknown_fields())) {
-      return &PtrValue<Container>()->unknown_fields;
+  PROTOBUF_NDEBUG_INLINE Arena* owning_arena() const {
+    return HasMessageOwnedArenaTag() ? nullptr : arena();
+  }
+
+  PROTOBUF_NDEBUG_INLINE Arena* arena() const {
+    if (PROTOBUF_PREDICT_FALSE(have_unknown_fields())) {
+      return PtrValue<ContainerBase>()->arena;
     } else {
-      return mutable_unknown_fields_slow();
+      return PtrValue<Arena>();
     }
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE Arena* arena() const {
-    if (GOOGLE_PREDICT_FALSE(have_unknown_fields())) {
-      return PtrValue<Container>()->arena;
+  PROTOBUF_NDEBUG_INLINE bool have_unknown_fields() const {
+    return HasUnknownFieldsTag();
+  }
+
+  PROTOBUF_NDEBUG_INLINE void* raw_arena_ptr() const {
+    return reinterpret_cast<void*>(ptr_);
+  }
+
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE const T& unknown_fields(
+      const T& (*default_instance)()) const {
+    if (PROTOBUF_PREDICT_FALSE(have_unknown_fields())) {
+      return PtrValue<Container<T>>()->unknown_fields;
     } else {
-      return PtrValue<Arena>();
+      return default_instance();
     }
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool have_unknown_fields() const {
-    return PtrTag() == kTagContainer;
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE T* mutable_unknown_fields() {
+    if (PROTOBUF_PREDICT_TRUE(have_unknown_fields())) {
+      return &PtrValue<Container<T>>()->unknown_fields;
+    } else {
+      return mutable_unknown_fields_slow<T>();
+    }
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Swap(Derived* other) {
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE void Swap(InternalMetadata* 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
@@ -99,126 +131,140 @@ class InternalMetadataWithArenaBase {
     // cannot simply swap ptr_ and then restore the arena pointers. We reuse
     // UFS's swap implementation instead.
     if (have_unknown_fields() || other->have_unknown_fields()) {
-      static_cast<Derived*>(this)->DoSwap(other->mutable_unknown_fields());
+      DoSwap<T>(other->mutable_unknown_fields<T>());
     }
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void MergeFrom(const Derived& other) {
+  PROTOBUF_NDEBUG_INLINE void InternalSwap(InternalMetadata* other) {
+    std::swap(ptr_, other->ptr_);
+  }
+
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE void MergeFrom(const InternalMetadata& other) {
     if (other.have_unknown_fields()) {
-      static_cast<Derived*>(this)->DoMergeFrom(other.unknown_fields());
+      DoMergeFrom<T>(other.unknown_fields<T>(nullptr));
     }
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Clear() {
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE void Clear() {
     if (have_unknown_fields()) {
-      static_cast<Derived*>(this)->DoClear();
+      DoClear<T>();
     }
   }
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void* raw_arena_ptr() const {
-    return ptr_;
-  }
-
  private:
-  void* ptr_;
+  intptr_t ptr_;
 
   // Tagged pointer implementation.
-  enum {
-    // ptr_ is an Arena*.
-    kTagArena = 0,
-    // ptr_ is a Container*.
-    kTagContainer = 1,
-  };
-  static const intptr_t kPtrTagMask = 1;
-  static const intptr_t kPtrValueMask = ~kPtrTagMask;
+  static constexpr intptr_t kUnknownFieldsTagMask = 1;
+  static constexpr intptr_t kMessageOwnedArenaTagMask = 2;
+  static constexpr intptr_t kPtrTagMask =
+      kUnknownFieldsTagMask | kMessageOwnedArenaTagMask;
+  static constexpr intptr_t kPtrValueMask = ~kPtrTagMask;
 
   // Accessors for pointer tag and pointer value.
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE int PtrTag() const {
-    return reinterpret_cast<intptr_t>(ptr_) & kPtrTagMask;
+  PROTOBUF_ALWAYS_INLINE bool HasUnknownFieldsTag() const {
+    return ptr_ & kUnknownFieldsTagMask;
+  }
+  PROTOBUF_ALWAYS_INLINE bool HasMessageOwnedArenaTag() const {
+    return ptr_ & kMessageOwnedArenaTagMask;
   }
 
-  template<typename U> U* PtrValue() const {
-    return reinterpret_cast<U*>(
-        reinterpret_cast<intptr_t>(ptr_) & kPtrValueMask);
+  template <typename U>
+  U* PtrValue() const {
+    return reinterpret_cast<U*>(ptr_ & kPtrValueMask);
   }
 
   // If ptr_'s tag is kTagContainer, it points to an instance of this struct.
-  struct Container {
-    T unknown_fields;
+  struct ContainerBase {
     Arena* arena;
   };
 
-  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE T* mutable_unknown_fields_slow() {
+  template <typename T>
+  struct Container : public ContainerBase {
+    T unknown_fields;
+  };
+
+  template <typename T>
+  PROTOBUF_NOINLINE void DeleteOutOfLineHelper() {
+    if (arena() == nullptr) {
+      delete PtrValue<Container<T>>();
+    }
+  }
+
+  template <typename T>
+  PROTOBUF_NOINLINE T* mutable_unknown_fields_slow() {
     Arena* my_arena = arena();
-    Container* container = Arena::Create<Container>(my_arena);
+    Container<T>* container = Arena::Create<Container<T>>(my_arena);
+    intptr_t message_owned_arena_tag = ptr_ & kMessageOwnedArenaTagMask;
     // Two-step assignment works around a bug in clang's static analyzer:
     // https://bugs.llvm.org/show_bug.cgi?id=34198.
-    ptr_ = container;
-    ptr_ = reinterpret_cast<void*>(
-        reinterpret_cast<intptr_t>(ptr_) | kTagContainer);
+    ptr_ = reinterpret_cast<intptr_t>(container);
+    ptr_ |= kUnknownFieldsTagMask | message_owned_arena_tag;
     container->arena = my_arena;
     return &(container->unknown_fields);
   }
-};
 
-// We store unknown fields as a string right now, because there is currently no
-// good interface for reading unknown fields into an ArenaString.  We may want
-// to revisit this to allow unknown fields to be parsed onto the Arena.
-class InternalMetadataWithArenaLite
-    : public InternalMetadataWithArenaBase<string,
-                                           InternalMetadataWithArenaLite> {
- public:
-  InternalMetadataWithArenaLite() {}
-
-  explicit InternalMetadataWithArenaLite(Arena* arena)
-      : InternalMetadataWithArenaBase<string,
-                                      InternalMetadataWithArenaLite>(arena) {}
+  // Templated functions.
 
-  void DoSwap(string* other) {
-    mutable_unknown_fields()->swap(*other);
+  template <typename T>
+  PROTOBUF_NOINLINE void DoClear() {
+    mutable_unknown_fields<T>()->Clear();
   }
 
-  void DoMergeFrom(const string& other) {
-    mutable_unknown_fields()->append(other);
+  template <typename T>
+  PROTOBUF_NOINLINE void DoMergeFrom(const T& other) {
+    mutable_unknown_fields<T>()->MergeFrom(other);
   }
 
-  void DoClear() {
-    mutable_unknown_fields()->clear();
-  }
-
-  static const string& default_instance() {
-    return GetEmptyStringAlreadyInited();
+  template <typename T>
+  PROTOBUF_NOINLINE void DoSwap(T* other) {
+    mutable_unknown_fields<T>()->Swap(other);
   }
 };
 
+// String Template specializations.
+
+template <>
+PROTOBUF_EXPORT void InternalMetadata::DoClear<std::string>();
+template <>
+PROTOBUF_EXPORT void InternalMetadata::DoMergeFrom<std::string>(
+    const std::string& other);
+template <>
+PROTOBUF_EXPORT void InternalMetadata::DoSwap<std::string>(std::string* other);
+
 // 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
+// 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 {
+class PROTOBUF_EXPORT LiteUnknownFieldSetter {
  public:
-  explicit LiteUnknownFieldSetter(InternalMetadataWithArenaLite* metadata)
+  explicit LiteUnknownFieldSetter(InternalMetadata* metadata)
       : metadata_(metadata) {
     if (metadata->have_unknown_fields()) {
-      buffer_.swap(*metadata->mutable_unknown_fields());
+      buffer_.swap(*metadata->mutable_unknown_fields<std::string>());
     }
   }
   ~LiteUnknownFieldSetter() {
-    if (!buffer_.empty()) metadata_->mutable_unknown_fields()->swap(buffer_);
+    if (!buffer_.empty())
+      metadata_->mutable_unknown_fields<std::string>()->swap(buffer_);
   }
-  string* buffer() { return &buffer_; }
+  std::string* buffer() { return &buffer_; }
 
  private:
-  InternalMetadataWithArenaLite* metadata_;
-  string buffer_;
+  InternalMetadata* metadata_;
+  std::string buffer_;
 };
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_METADATA_LITE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/package_info.h b/3rdparty/protobuf/src/google/protobuf/package_info.h
deleted file mode 100644 (file)
index 935e963..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-//
-// This file exists solely to document the google::protobuf namespace.
-// It is not compiled into anything, but it may be read by an automated
-// documentation generator.
-
-namespace google {
-
-// Core components of the Protocol Buffers runtime library.
-//
-// The files in this package represent the core of the Protocol Buffer
-// system.  All of them are part of the libprotobuf library.
-//
-// A note on thread-safety:
-//
-// Thread-safety in the Protocol Buffer library follows a simple rule:
-// unless explicitly noted otherwise, it is always safe to use an object
-// from multiple threads simultaneously as long as the object is declared
-// const in all threads (or, it is only used in ways that would be allowed
-// if it were declared const).  However, if an object is accessed in one
-// thread in a way that would not be allowed if it were const, then it is
-// not safe to access that object in any other thread simultaneously.
-//
-// Put simply, read-only access to an object can happen in multiple threads
-// simultaneously, but write access can only happen in a single thread at
-// a time.
-//
-// The implementation does contain some "const" methods which actually modify
-// the object behind the scenes -- e.g., to cache results -- but in these cases
-// mutex locking is used to make the access thread-safe.
-namespace protobuf {}
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/parse_context.cc b/3rdparty/protobuf/src/google/protobuf/parse_context.cc
new file mode 100644 (file)
index 0000000..1aec2ae
--- /dev/null
@@ -0,0 +1,559 @@
+// 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/parse_context.h>
+
+#include <google/protobuf/stubs/stringprintf.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/io/zero_copy_stream.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/wire_format_lite.h>
+#include <google/protobuf/stubs/strutil.h>
+
+#include <google/protobuf/port_def.inc>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+
+namespace {
+
+// Only call if at start of tag.
+bool ParseEndsInSlopRegion(const char* begin, int overrun, int depth) {
+  constexpr int kSlopBytes = EpsCopyInputStream::kSlopBytes;
+  GOOGLE_DCHECK(overrun >= 0);
+  GOOGLE_DCHECK(overrun <= kSlopBytes);
+  auto ptr = begin + overrun;
+  auto end = begin + kSlopBytes;
+  while (ptr < end) {
+    uint32_t tag;
+    ptr = ReadTag(ptr, &tag);
+    if (ptr == nullptr || ptr > end) return false;
+    // ending on 0 tag is allowed and is the major reason for the necessity of
+    // this function.
+    if (tag == 0) return true;
+    switch (tag & 7) {
+      case 0: {  // Varint
+        uint64_t val;
+        ptr = VarintParse(ptr, &val);
+        if (ptr == nullptr) return false;
+        break;
+      }
+      case 1: {  // fixed64
+        ptr += 8;
+        break;
+      }
+      case 2: {  // len delim
+        int32_t size = ReadSize(&ptr);
+        if (ptr == nullptr || size > end - ptr) return false;
+        ptr += size;
+        break;
+      }
+      case 3: {  // start group
+        depth++;
+        break;
+      }
+      case 4: {                    // end group
+        if (--depth < 0) return true;  // We exit early
+        break;
+      }
+      case 5: {  // fixed32
+        ptr += 4;
+        break;
+      }
+      default:
+        return false;  // Unknown wireformat
+    }
+  }
+  return false;
+}
+
+}  // namespace
+
+const char* EpsCopyInputStream::NextBuffer(int overrun, int depth) {
+  if (next_chunk_ == nullptr) return nullptr;  // We've reached end of stream.
+  if (next_chunk_ != buffer_) {
+    GOOGLE_DCHECK(size_ > kSlopBytes);
+    // The chunk is large enough to be used directly
+    buffer_end_ = next_chunk_ + size_ - kSlopBytes;
+    auto res = next_chunk_;
+    next_chunk_ = buffer_;
+    if (aliasing_ == kOnPatch) aliasing_ = kNoDelta;
+    return res;
+  }
+  // Move the slop bytes of previous buffer to start of the patch buffer.
+  // Note we must use memmove because the previous buffer could be part of
+  // buffer_.
+  std::memmove(buffer_, buffer_end_, kSlopBytes);
+  if (overall_limit_ > 0 &&
+      (depth < 0 || !ParseEndsInSlopRegion(buffer_, overrun, depth))) {
+    const void* data;
+    // ZeroCopyInputStream indicates Next may return 0 size buffers. Hence
+    // we loop.
+    while (StreamNext(&data)) {
+      if (size_ > kSlopBytes) {
+        // We got a large chunk
+        std::memcpy(buffer_ + kSlopBytes, data, kSlopBytes);
+        next_chunk_ = static_cast<const char*>(data);
+        buffer_end_ = buffer_ + kSlopBytes;
+        if (aliasing_ >= kNoDelta) aliasing_ = kOnPatch;
+        return buffer_;
+      } else if (size_ > 0) {
+        std::memcpy(buffer_ + kSlopBytes, data, size_);
+        next_chunk_ = buffer_;
+        buffer_end_ = buffer_ + size_;
+        if (aliasing_ >= kNoDelta) aliasing_ = kOnPatch;
+        return buffer_;
+      }
+      GOOGLE_DCHECK(size_ == 0) << size_;
+    }
+    overall_limit_ = 0;  // Next failed, no more needs for next
+  }
+  // End of stream or array
+  if (aliasing_ == kNoDelta) {
+    // If there is no more block and aliasing is true, the previous block
+    // is still valid and we can alias. We have users relying on string_view's
+    // obtained from protos to outlive the proto, when the parse was from an
+    // array. This guarantees string_view's are always aliased if parsed from
+    // an array.
+    aliasing_ = reinterpret_cast<std::uintptr_t>(buffer_end_) -
+                reinterpret_cast<std::uintptr_t>(buffer_);
+  }
+  next_chunk_ = nullptr;
+  buffer_end_ = buffer_ + kSlopBytes;
+  size_ = 0;
+  return buffer_;
+}
+
+const char* EpsCopyInputStream::Next() {
+  GOOGLE_DCHECK(limit_ > kSlopBytes);
+  auto p = NextBuffer(0 /* immaterial */, -1);
+  if (p == nullptr) {
+    limit_end_ = buffer_end_;
+    // Distinguish ending on a pushed limit or ending on end-of-stream.
+    SetEndOfStream();
+    return nullptr;
+  }
+  limit_ -= buffer_end_ - p;  // Adjust limit_ relative to new anchor
+  limit_end_ = buffer_end_ + std::min(0, limit_);
+  return p;
+}
+
+std::pair<const char*, bool> EpsCopyInputStream::DoneFallback(int overrun,
+                                                              int depth) {
+  // Did we exceeded the limit (parse error).
+  if (PROTOBUF_PREDICT_FALSE(overrun > limit_)) return {nullptr, true};
+  GOOGLE_DCHECK(overrun != limit_);  // Guaranteed by caller.
+  GOOGLE_DCHECK(overrun < limit_);   // Follows from above
+  // TODO(gerbens) Instead of this dcheck we could just assign, and remove
+  // updating the limit_end from PopLimit, ie.
+  // limit_end_ = buffer_end_ + (std::min)(0, limit_);
+  // if (ptr < limit_end_) return {ptr, false};
+  GOOGLE_DCHECK(limit_end_ == buffer_end_ + (std::min)(0, limit_));
+  // At this point we know the following assertion holds.
+  GOOGLE_DCHECK(limit_ > 0);
+  GOOGLE_DCHECK(limit_end_ == buffer_end_);  // because limit_ > 0
+  const char* p;
+  do {
+    // We are past the end of buffer_end_, in the slop region.
+    GOOGLE_DCHECK(overrun >= 0);
+    p = NextBuffer(overrun, depth);
+    if (p == nullptr) {
+      // We are at the end of the stream
+      if (PROTOBUF_PREDICT_FALSE(overrun != 0)) return {nullptr, true};
+      GOOGLE_DCHECK(limit_ > 0);
+      limit_end_ = buffer_end_;
+      // Distinguish ending on a pushed limit or ending on end-of-stream.
+      SetEndOfStream();
+      return {buffer_end_, true};
+    }
+    limit_ -= buffer_end_ - p;  // Adjust limit_ relative to new anchor
+    p += overrun;
+    overrun = p - buffer_end_;
+  } while (overrun >= 0);
+  limit_end_ = buffer_end_ + std::min(0, limit_);
+  return {p, false};
+}
+
+const char* EpsCopyInputStream::SkipFallback(const char* ptr, int size) {
+  return AppendSize(ptr, size, [](const char* /*p*/, int /*s*/) {});
+}
+
+const char* EpsCopyInputStream::ReadStringFallback(const char* ptr, int size,
+                                                   std::string* str) {
+  str->clear();
+  if (PROTOBUF_PREDICT_TRUE(size <= buffer_end_ - ptr + limit_)) {
+    // Reserve the string up to a static safe size. If strings are bigger than
+    // this we proceed by growing the string as needed. This protects against
+    // malicious payloads making protobuf hold on to a lot of memory.
+    str->reserve(str->size() + std::min<int>(size, kSafeStringSize));
+  }
+  return AppendSize(ptr, size,
+                    [str](const char* p, int s) { str->append(p, s); });
+}
+
+const char* EpsCopyInputStream::AppendStringFallback(const char* ptr, int size,
+                                                     std::string* str) {
+  if (PROTOBUF_PREDICT_TRUE(size <= buffer_end_ - ptr + limit_)) {
+    // Reserve the string up to a static safe size. If strings are bigger than
+    // this we proceed by growing the string as needed. This protects against
+    // malicious payloads making protobuf hold on to a lot of memory.
+    str->reserve(str->size() + std::min<int>(size, kSafeStringSize));
+  }
+  return AppendSize(ptr, size,
+                    [str](const char* p, int s) { str->append(p, s); });
+}
+
+
+template <int>
+void byteswap(void* p);
+template <>
+void byteswap<1>(void* /*p*/) {}
+template <>
+void byteswap<4>(void* p) {
+  *static_cast<uint32_t*>(p) = bswap_32(*static_cast<uint32_t*>(p));
+}
+template <>
+void byteswap<8>(void* p) {
+  *static_cast<uint64_t*>(p) = bswap_64(*static_cast<uint64_t*>(p));
+}
+
+const char* EpsCopyInputStream::InitFrom(io::ZeroCopyInputStream* zcis) {
+  zcis_ = zcis;
+  const void* data;
+  int size;
+  limit_ = INT_MAX;
+  if (zcis->Next(&data, &size)) {
+    overall_limit_ -= size;
+    if (size > kSlopBytes) {
+      auto ptr = static_cast<const char*>(data);
+      limit_ -= size - kSlopBytes;
+      limit_end_ = buffer_end_ = ptr + size - kSlopBytes;
+      next_chunk_ = buffer_;
+      if (aliasing_ == kOnPatch) aliasing_ = kNoDelta;
+      return ptr;
+    } else {
+      limit_end_ = buffer_end_ = buffer_ + kSlopBytes;
+      next_chunk_ = buffer_;
+      auto ptr = buffer_ + 2 * kSlopBytes - size;
+      std::memcpy(ptr, data, size);
+      return ptr;
+    }
+  }
+  overall_limit_ = 0;
+  next_chunk_ = nullptr;
+  size_ = 0;
+  limit_end_ = buffer_end_ = buffer_;
+  return buffer_;
+}
+
+const char* ParseContext::ReadSizeAndPushLimitAndDepth(const char* ptr,
+                                                       int* old_limit) {
+  int size = ReadSize(&ptr);
+  if (PROTOBUF_PREDICT_FALSE(!ptr)) {
+    *old_limit = 0;  // Make sure this isn't uninitialized even on error return
+    return nullptr;
+  }
+  *old_limit = PushLimit(ptr, size);
+  if (--depth_ < 0) return nullptr;
+  return ptr;
+}
+
+const char* ParseContext::ParseMessage(MessageLite* msg, const char* ptr) {
+  int old;
+  ptr = ReadSizeAndPushLimitAndDepth(ptr, &old);
+  ptr = ptr ? msg->_InternalParse(ptr, this) : nullptr;
+  depth_++;
+  if (!PopLimit(old)) return nullptr;
+  return ptr;
+}
+
+inline void WriteVarint(uint64_t val, std::string* s) {
+  while (val >= 128) {
+    uint8_t c = val | 0x80;
+    s->push_back(c);
+    val >>= 7;
+  }
+  s->push_back(val);
+}
+
+void WriteVarint(uint32_t num, uint64_t val, std::string* s) {
+  WriteVarint(num << 3, s);
+  WriteVarint(val, s);
+}
+
+void WriteLengthDelimited(uint32_t num, StringPiece val, std::string* s) {
+  WriteVarint((num << 3) + 2, s);
+  WriteVarint(val.size(), s);
+  s->append(val.data(), val.size());
+}
+
+std::pair<const char*, uint32_t> VarintParseSlow32(const char* p,
+                                                   uint32_t res) {
+  for (std::uint32_t i = 2; i < 5; i++) {
+    uint32_t byte = static_cast<uint8_t>(p[i]);
+    res += (byte - 1) << (7 * i);
+    if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
+      return {p + i + 1, res};
+    }
+  }
+  // Accept >5 bytes
+  for (std::uint32_t i = 5; i < 10; i++) {
+    uint32_t byte = static_cast<uint8_t>(p[i]);
+    if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
+      return {p + i + 1, res};
+    }
+  }
+  return {nullptr, 0};
+}
+
+std::pair<const char*, uint64_t> VarintParseSlow64(const char* p,
+                                                   uint32_t res32) {
+  uint64_t res = res32;
+  for (std::uint32_t i = 2; i < 10; i++) {
+    uint64_t byte = static_cast<uint8_t>(p[i]);
+    res += (byte - 1) << (7 * i);
+    if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
+      return {p + i + 1, res};
+    }
+  }
+  return {nullptr, 0};
+}
+
+std::pair<const char*, uint32_t> ReadTagFallback(const char* p, uint32_t res) {
+  for (std::uint32_t i = 2; i < 5; i++) {
+    uint32_t byte = static_cast<uint8_t>(p[i]);
+    res += (byte - 1) << (7 * i);
+    if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
+      return {p + i + 1, res};
+    }
+  }
+  return {nullptr, 0};
+}
+
+std::pair<const char*, int32_t> ReadSizeFallback(const char* p, uint32_t res) {
+  for (std::uint32_t i = 1; i < 4; i++) {
+    uint32_t byte = static_cast<uint8_t>(p[i]);
+    res += (byte - 1) << (7 * i);
+    if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
+      return {p + i + 1, res};
+    }
+  }
+  std::uint32_t byte = static_cast<uint8_t>(p[4]);
+  if (PROTOBUF_PREDICT_FALSE(byte >= 8)) return {nullptr, 0};  // size >= 2gb
+  res += (byte - 1) << 28;
+  // Protect against sign integer overflow in PushLimit. Limits are relative
+  // to buffer ends and ptr could potential be kSlopBytes beyond a buffer end.
+  // To protect against overflow we reject limits absurdly close to INT_MAX.
+  if (PROTOBUF_PREDICT_FALSE(res > INT_MAX - ParseContext::kSlopBytes)) {
+    return {nullptr, 0};
+  }
+  return {p + 5, res};
+}
+
+const char* StringParser(const char* begin, const char* end, void* object,
+                         ParseContext*) {
+  auto str = static_cast<std::string*>(object);
+  str->append(begin, end - begin);
+  return end;
+}
+
+// Defined in wire_format_lite.cc
+void PrintUTF8ErrorLog(const char* field_name, const char* operation_str,
+                       bool emit_stacktrace);
+
+bool VerifyUTF8(StringPiece str, const char* field_name) {
+  if (!IsStructurallyValidUTF8(str)) {
+    PrintUTF8ErrorLog(field_name, "parsing", false);
+    return false;
+  }
+  return true;
+}
+
+const char* InlineGreedyStringParser(std::string* s, const char* ptr,
+                                     ParseContext* ctx) {
+  int size = ReadSize(&ptr);
+  if (!ptr) return nullptr;
+  return ctx->ReadString(ptr, size, s);
+}
+
+
+template <typename T, bool sign>
+const char* VarintParser(void* object, const char* ptr, ParseContext* ctx) {
+  return ctx->ReadPackedVarint(ptr, [object](uint64_t varint) {
+    T val;
+    if (sign) {
+      if (sizeof(T) == 8) {
+        val = WireFormatLite::ZigZagDecode64(varint);
+      } else {
+        val = WireFormatLite::ZigZagDecode32(varint);
+      }
+    } else {
+      val = varint;
+    }
+    static_cast<RepeatedField<T>*>(object)->Add(val);
+  });
+}
+
+const char* PackedInt32Parser(void* object, const char* ptr,
+                              ParseContext* ctx) {
+  return VarintParser<int32_t, false>(object, ptr, ctx);
+}
+const char* PackedUInt32Parser(void* object, const char* ptr,
+                               ParseContext* ctx) {
+  return VarintParser<uint32_t, false>(object, ptr, ctx);
+}
+const char* PackedInt64Parser(void* object, const char* ptr,
+                              ParseContext* ctx) {
+  return VarintParser<int64_t, false>(object, ptr, ctx);
+}
+const char* PackedUInt64Parser(void* object, const char* ptr,
+                               ParseContext* ctx) {
+  return VarintParser<uint64_t, false>(object, ptr, ctx);
+}
+const char* PackedSInt32Parser(void* object, const char* ptr,
+                               ParseContext* ctx) {
+  return VarintParser<int32_t, true>(object, ptr, ctx);
+}
+const char* PackedSInt64Parser(void* object, const char* ptr,
+                               ParseContext* ctx) {
+  return VarintParser<int64_t, true>(object, ptr, ctx);
+}
+
+const char* PackedEnumParser(void* object, const char* ptr, ParseContext* ctx) {
+  return VarintParser<int, false>(object, ptr, ctx);
+}
+
+const char* PackedBoolParser(void* object, const char* ptr, ParseContext* ctx) {
+  return VarintParser<bool, false>(object, ptr, ctx);
+}
+
+template <typename T>
+const char* FixedParser(void* object, const char* ptr, ParseContext* ctx) {
+  int size = ReadSize(&ptr);
+  return ctx->ReadPackedFixed(ptr, size,
+                              static_cast<RepeatedField<T>*>(object));
+}
+
+const char* PackedFixed32Parser(void* object, const char* ptr,
+                                ParseContext* ctx) {
+  return FixedParser<uint32_t>(object, ptr, ctx);
+}
+const char* PackedSFixed32Parser(void* object, const char* ptr,
+                                 ParseContext* ctx) {
+  return FixedParser<int32_t>(object, ptr, ctx);
+}
+const char* PackedFixed64Parser(void* object, const char* ptr,
+                                ParseContext* ctx) {
+  return FixedParser<uint64_t>(object, ptr, ctx);
+}
+const char* PackedSFixed64Parser(void* object, const char* ptr,
+                                 ParseContext* ctx) {
+  return FixedParser<int64_t>(object, ptr, ctx);
+}
+const char* PackedFloatParser(void* object, const char* ptr,
+                              ParseContext* ctx) {
+  return FixedParser<float>(object, ptr, ctx);
+}
+const char* PackedDoubleParser(void* object, const char* ptr,
+                               ParseContext* ctx) {
+  return FixedParser<double>(object, ptr, ctx);
+}
+
+class UnknownFieldLiteParserHelper {
+ public:
+  explicit UnknownFieldLiteParserHelper(std::string* unknown)
+      : unknown_(unknown) {}
+
+  void AddVarint(uint32_t num, uint64_t value) {
+    if (unknown_ == nullptr) return;
+    WriteVarint(num * 8, unknown_);
+    WriteVarint(value, unknown_);
+  }
+  void AddFixed64(uint32_t num, uint64_t value) {
+    if (unknown_ == nullptr) return;
+    WriteVarint(num * 8 + 1, unknown_);
+    char buffer[8];
+    io::CodedOutputStream::WriteLittleEndian64ToArray(
+        value, reinterpret_cast<uint8_t*>(buffer));
+    unknown_->append(buffer, 8);
+  }
+  const char* ParseLengthDelimited(uint32_t num, const char* ptr,
+                                   ParseContext* ctx) {
+    int size = ReadSize(&ptr);
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+    if (unknown_ == nullptr) return ctx->Skip(ptr, size);
+    WriteVarint(num * 8 + 2, unknown_);
+    WriteVarint(size, unknown_);
+    return ctx->AppendString(ptr, size, unknown_);
+  }
+  const char* ParseGroup(uint32_t num, const char* ptr, ParseContext* ctx) {
+    if (unknown_) WriteVarint(num * 8 + 3, unknown_);
+    ptr = ctx->ParseGroup(this, ptr, num * 8 + 3);
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+    if (unknown_) WriteVarint(num * 8 + 4, unknown_);
+    return ptr;
+  }
+  void AddFixed32(uint32_t num, uint32_t value) {
+    if (unknown_ == nullptr) return;
+    WriteVarint(num * 8 + 5, unknown_);
+    char buffer[4];
+    io::CodedOutputStream::WriteLittleEndian32ToArray(
+        value, reinterpret_cast<uint8_t*>(buffer));
+    unknown_->append(buffer, 4);
+  }
+
+  const char* _InternalParse(const char* ptr, ParseContext* ctx) {
+    return WireFormatParser(*this, ptr, ctx);
+  }
+
+ private:
+  std::string* unknown_;
+};
+
+const char* UnknownGroupLiteParse(std::string* unknown, const char* ptr,
+                                  ParseContext* ctx) {
+  UnknownFieldLiteParserHelper field_parser(unknown);
+  return WireFormatParser(field_parser, ptr, ctx);
+}
+
+const char* UnknownFieldParse(uint32_t tag, std::string* unknown,
+                              const char* ptr, ParseContext* ctx) {
+  UnknownFieldLiteParserHelper field_parser(unknown);
+  return FieldParser(tag, field_parser, ptr, ctx);
+}
+
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
diff --git a/3rdparty/protobuf/src/google/protobuf/parse_context.h b/3rdparty/protobuf/src/google/protobuf/parse_context.h
new file mode 100644 (file)
index 0000000..62e25dc
--- /dev/null
@@ -0,0 +1,938 @@
+// 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_PARSE_CONTEXT_H__
+#define GOOGLE_PROTOBUF_PARSE_CONTEXT_H__
+
+#include <cstdint>
+#include <cstring>
+#include <string>
+
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/io/zero_copy_stream.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/implicit_weak_message.h>
+#include <google/protobuf/inlined_string_field.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/port.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/wire_format_lite.h>
+#include <google/protobuf/stubs/strutil.h>
+
+#include <google/protobuf/port_def.inc>
+
+
+namespace google {
+namespace protobuf {
+
+class UnknownFieldSet;
+class DescriptorPool;
+class MessageFactory;
+
+namespace internal {
+
+// Template code below needs to know about the existence of these functions.
+PROTOBUF_EXPORT void WriteVarint(uint32_t num, uint64_t val, std::string* s);
+PROTOBUF_EXPORT void WriteLengthDelimited(uint32_t num, StringPiece val,
+                                          std::string* s);
+// Inline because it is just forwarding to s->WriteVarint
+inline void WriteVarint(uint32_t num, uint64_t val, UnknownFieldSet* s);
+inline void WriteLengthDelimited(uint32_t num, StringPiece val,
+                                 UnknownFieldSet* s);
+
+
+// The basic abstraction the parser is designed for is a slight modification
+// of the ZeroCopyInputStream (ZCIS) abstraction. A ZCIS presents a serialized
+// stream as a series of buffers that concatenate to the full stream.
+// Pictorially a ZCIS presents a stream in chunks like so
+// [---------------------------------------------------------------]
+// [---------------------] chunk 1
+//                      [----------------------------] chunk 2
+//                                          chunk 3 [--------------]
+//
+// Where the '-' represent the bytes which are vertically lined up with the
+// bytes of the stream. The proto parser requires its input to be presented
+// similarly with the extra
+// property that each chunk has kSlopBytes past its end that overlaps with the
+// first kSlopBytes of the next chunk, or if there is no next chunk at least its
+// still valid to read those bytes. Again, pictorially, we now have
+//
+// [---------------------------------------------------------------]
+// [-------------------....] chunk 1
+//                    [------------------------....] chunk 2
+//                                    chunk 3 [------------------..**]
+//                                                      chunk 4 [--****]
+// Here '-' mean the bytes of the stream or chunk and '.' means bytes past the
+// chunk that match up with the start of the next chunk. Above each chunk has
+// 4 '.' after the chunk. In the case these 'overflow' bytes represents bytes
+// past the stream, indicated by '*' above, their values are unspecified. It is
+// still legal to read them (ie. should not segfault). Reading past the
+// end should be detected by the user and indicated as an error.
+//
+// The reason for this, admittedly, unconventional invariant is to ruthlessly
+// optimize the protobuf parser. Having an overlap helps in two important ways.
+// Firstly it alleviates having to performing bounds checks if a piece of code
+// is guaranteed to not read more than kSlopBytes. Secondly, and more
+// importantly, the protobuf wireformat is such that reading a key/value pair is
+// always less than 16 bytes. This removes the need to change to next buffer in
+// the middle of reading primitive values. Hence there is no need to store and
+// load the current position.
+
+class PROTOBUF_EXPORT EpsCopyInputStream {
+ public:
+  enum { kSlopBytes = 16, kMaxCordBytesToCopy = 512 };
+
+  explicit EpsCopyInputStream(bool enable_aliasing)
+      : aliasing_(enable_aliasing ? kOnPatch : kNoAliasing) {}
+
+  void BackUp(const char* ptr) {
+    GOOGLE_DCHECK(ptr <= buffer_end_ + kSlopBytes);
+    int count;
+    if (next_chunk_ == buffer_) {
+      count = static_cast<int>(buffer_end_ + kSlopBytes - ptr);
+    } else {
+      count = size_ + static_cast<int>(buffer_end_ - ptr);
+    }
+    if (count > 0) StreamBackUp(count);
+  }
+
+  // If return value is negative it's an error
+  PROTOBUF_NODISCARD int PushLimit(const char* ptr, int limit) {
+    GOOGLE_DCHECK(limit >= 0 && limit <= INT_MAX - kSlopBytes);
+    // This add is safe due to the invariant above, because
+    // ptr - buffer_end_ <= kSlopBytes.
+    limit += static_cast<int>(ptr - buffer_end_);
+    limit_end_ = buffer_end_ + (std::min)(0, limit);
+    auto old_limit = limit_;
+    limit_ = limit;
+    return old_limit - limit;
+  }
+
+  PROTOBUF_NODISCARD bool PopLimit(int delta) {
+    if (PROTOBUF_PREDICT_FALSE(!EndedAtLimit())) return false;
+    limit_ = limit_ + delta;
+    // TODO(gerbens) We could remove this line and hoist the code to
+    // DoneFallback. Study the perf/bin-size effects.
+    limit_end_ = buffer_end_ + (std::min)(0, limit_);
+    return true;
+  }
+
+  PROTOBUF_NODISCARD const char* Skip(const char* ptr, int size) {
+    if (size <= buffer_end_ + kSlopBytes - ptr) {
+      return ptr + size;
+    }
+    return SkipFallback(ptr, size);
+  }
+  PROTOBUF_NODISCARD const char* ReadString(const char* ptr, int size,
+                                            std::string* s) {
+    if (size <= buffer_end_ + kSlopBytes - ptr) {
+      s->assign(ptr, size);
+      return ptr + size;
+    }
+    return ReadStringFallback(ptr, size, s);
+  }
+  PROTOBUF_NODISCARD const char* AppendString(const char* ptr, int size,
+                                              std::string* s) {
+    if (size <= buffer_end_ + kSlopBytes - ptr) {
+      s->append(ptr, size);
+      return ptr + size;
+    }
+    return AppendStringFallback(ptr, size, s);
+  }
+  // Implemented in arenastring.cc
+  PROTOBUF_NODISCARD const char* ReadArenaString(const char* ptr,
+                                                 ArenaStringPtr* s,
+                                                 Arena* arena);
+
+  template <typename Tag, typename T>
+  PROTOBUF_NODISCARD const char* ReadRepeatedFixed(const char* ptr,
+                                                   Tag expected_tag,
+                                                   RepeatedField<T>* out);
+
+  template <typename T>
+  PROTOBUF_NODISCARD const char* ReadPackedFixed(const char* ptr, int size,
+                                                 RepeatedField<T>* out);
+  template <typename Add>
+  PROTOBUF_NODISCARD const char* ReadPackedVarint(const char* ptr, Add add);
+
+  uint32_t LastTag() const { return last_tag_minus_1_ + 1; }
+  bool ConsumeEndGroup(uint32_t start_tag) {
+    bool res = last_tag_minus_1_ == start_tag;
+    last_tag_minus_1_ = 0;
+    return res;
+  }
+  bool EndedAtLimit() const { return last_tag_minus_1_ == 0; }
+  bool EndedAtEndOfStream() const { return last_tag_minus_1_ == 1; }
+  void SetLastTag(uint32_t tag) { last_tag_minus_1_ = tag - 1; }
+  void SetEndOfStream() { last_tag_minus_1_ = 1; }
+  bool IsExceedingLimit(const char* ptr) {
+    return ptr > limit_end_ &&
+           (next_chunk_ == nullptr || ptr - buffer_end_ > limit_);
+  }
+  int BytesUntilLimit(const char* ptr) const {
+    return limit_ + static_cast<int>(buffer_end_ - ptr);
+  }
+  // Returns true if more data is available, if false is returned one has to
+  // call Done for further checks.
+  bool DataAvailable(const char* ptr) { return ptr < limit_end_; }
+
+ protected:
+  // Returns true is limit (either an explicit limit or end of stream) is
+  // reached. It aligns *ptr across buffer seams.
+  // If limit is exceeded it returns true and ptr is set to null.
+  bool DoneWithCheck(const char** ptr, int d) {
+    GOOGLE_DCHECK(*ptr);
+    if (PROTOBUF_PREDICT_TRUE(*ptr < limit_end_)) return false;
+    int overrun = static_cast<int>(*ptr - buffer_end_);
+    GOOGLE_DCHECK_LE(overrun, kSlopBytes);  // Guaranteed by parse loop.
+    if (overrun ==
+        limit_) {  //  No need to flip buffers if we ended on a limit.
+      // If we actually overrun the buffer and next_chunk_ is null. It means
+      // the stream ended and we passed the stream end.
+      if (overrun > 0 && next_chunk_ == nullptr) *ptr = nullptr;
+      return true;
+    }
+    auto res = DoneFallback(overrun, d);
+    *ptr = res.first;
+    return res.second;
+  }
+
+  const char* InitFrom(StringPiece flat) {
+    overall_limit_ = 0;
+    if (flat.size() > kSlopBytes) {
+      limit_ = kSlopBytes;
+      limit_end_ = buffer_end_ = flat.data() + flat.size() - kSlopBytes;
+      next_chunk_ = buffer_;
+      if (aliasing_ == kOnPatch) aliasing_ = kNoDelta;
+      return flat.data();
+    } else {
+      std::memcpy(buffer_, flat.data(), flat.size());
+      limit_ = 0;
+      limit_end_ = buffer_end_ = buffer_ + flat.size();
+      next_chunk_ = nullptr;
+      if (aliasing_ == kOnPatch) {
+        aliasing_ = reinterpret_cast<std::uintptr_t>(flat.data()) -
+                    reinterpret_cast<std::uintptr_t>(buffer_);
+      }
+      return buffer_;
+    }
+  }
+
+  const char* InitFrom(io::ZeroCopyInputStream* zcis);
+
+  const char* InitFrom(io::ZeroCopyInputStream* zcis, int limit) {
+    if (limit == -1) return InitFrom(zcis);
+    overall_limit_ = limit;
+    auto res = InitFrom(zcis);
+    limit_ = limit - static_cast<int>(buffer_end_ - res);
+    limit_end_ = buffer_end_ + (std::min)(0, limit_);
+    return res;
+  }
+
+ private:
+  const char* limit_end_;  // buffer_end_ + min(limit_, 0)
+  const char* buffer_end_;
+  const char* next_chunk_;
+  int size_;
+  int limit_;  // relative to buffer_end_;
+  io::ZeroCopyInputStream* zcis_ = nullptr;
+  char buffer_[2 * kSlopBytes] = {};
+  enum { kNoAliasing = 0, kOnPatch = 1, kNoDelta = 2 };
+  std::uintptr_t aliasing_ = kNoAliasing;
+  // This variable is used to communicate how the parse ended, in order to
+  // completely verify the parsed data. A wire-format parse can end because of
+  // one of the following conditions:
+  // 1) A parse can end on a pushed limit.
+  // 2) A parse can end on End Of Stream (EOS).
+  // 3) A parse can end on 0 tag (only valid for toplevel message).
+  // 4) A parse can end on an end-group tag.
+  // This variable should always be set to 0, which indicates case 1. If the
+  // parse terminated due to EOS (case 2), it's set to 1. In case the parse
+  // ended due to a terminating tag (case 3 and 4) it's set to (tag - 1).
+  // This var doesn't really belong in EpsCopyInputStream and should be part of
+  // the ParseContext, but case 2 is most easily and optimally implemented in
+  // DoneFallback.
+  uint32_t last_tag_minus_1_ = 0;
+  int overall_limit_ = INT_MAX;  // Overall limit independent of pushed limits.
+  // Pretty random large number that seems like a safe allocation on most
+  // systems. TODO(gerbens) do we need to set this as build flag?
+  enum { kSafeStringSize = 50000000 };
+
+  // Advances to next buffer chunk returns a pointer to the same logical place
+  // in the stream as set by overrun. Overrun indicates the position in the slop
+  // region the parse was left (0 <= overrun <= kSlopBytes). Returns true if at
+  // limit, at which point the returned pointer maybe null if there was an
+  // error. The invariant of this function is that it's guaranteed that
+  // kSlopBytes bytes can be accessed from the returned ptr. This function might
+  // advance more buffers than one in the underlying ZeroCopyInputStream.
+  std::pair<const char*, bool> DoneFallback(int overrun, int depth);
+  // Advances to the next buffer, at most one call to Next() on the underlying
+  // ZeroCopyInputStream is made. This function DOES NOT match the returned
+  // pointer to where in the slop region the parse ends, hence no overrun
+  // parameter. This is useful for string operations where you always copy
+  // to the end of the buffer (including the slop region).
+  const char* Next();
+  // overrun is the location in the slop region the stream currently is
+  // (0 <= overrun <= kSlopBytes). To prevent flipping to the next buffer of
+  // the ZeroCopyInputStream in the case the parse will end in the last
+  // kSlopBytes of the current buffer. depth is the current depth of nested
+  // groups (or negative if the use case does not need careful tracking).
+  inline const char* NextBuffer(int overrun, int depth);
+  const char* SkipFallback(const char* ptr, int size);
+  const char* AppendStringFallback(const char* ptr, int size, std::string* str);
+  const char* ReadStringFallback(const char* ptr, int size, std::string* str);
+  bool StreamNext(const void** data) {
+    bool res = zcis_->Next(data, &size_);
+    if (res) overall_limit_ -= size_;
+    return res;
+  }
+  void StreamBackUp(int count) {
+    zcis_->BackUp(count);
+    overall_limit_ += count;
+  }
+
+  template <typename A>
+  const char* AppendSize(const char* ptr, int size, const A& append) {
+    int chunk_size = buffer_end_ + kSlopBytes - ptr;
+    do {
+      GOOGLE_DCHECK(size > chunk_size);
+      if (next_chunk_ == nullptr) return nullptr;
+      append(ptr, chunk_size);
+      ptr += chunk_size;
+      size -= chunk_size;
+      // TODO(gerbens) Next calls NextBuffer which generates buffers with
+      // overlap and thus incurs cost of copying the slop regions. This is not
+      // necessary for reading strings. We should just call Next buffers.
+      if (limit_ <= kSlopBytes) return nullptr;
+      ptr = Next();
+      if (ptr == nullptr) return nullptr;  // passed the limit
+      ptr += kSlopBytes;
+      chunk_size = buffer_end_ + kSlopBytes - ptr;
+    } while (size > chunk_size);
+    append(ptr, size);
+    return ptr + size;
+  }
+
+  // AppendUntilEnd appends data until a limit (either a PushLimit or end of
+  // stream. Normal payloads are from length delimited fields which have an
+  // explicit size. Reading until limit only comes when the string takes
+  // the place of a protobuf, ie RawMessage/StringRawMessage, lazy fields and
+  // implicit weak messages. We keep these methods private and friend them.
+  template <typename A>
+  const char* AppendUntilEnd(const char* ptr, const A& append) {
+    if (ptr - buffer_end_ > limit_) return nullptr;
+    while (limit_ > kSlopBytes) {
+      size_t chunk_size = buffer_end_ + kSlopBytes - ptr;
+      append(ptr, chunk_size);
+      ptr = Next();
+      if (ptr == nullptr) return limit_end_;
+      ptr += kSlopBytes;
+    }
+    auto end = buffer_end_ + limit_;
+    GOOGLE_DCHECK(end >= ptr);
+    append(ptr, end - ptr);
+    return end;
+  }
+
+  PROTOBUF_NODISCARD const char* AppendString(const char* ptr,
+                                              std::string* str) {
+    return AppendUntilEnd(
+        ptr, [str](const char* p, ptrdiff_t s) { str->append(p, s); });
+  }
+  friend class ImplicitWeakMessage;
+};
+
+// ParseContext holds all data that is global to the entire parse. Most
+// importantly it contains the input stream, but also recursion depth and also
+// stores the end group tag, in case a parser ended on a endgroup, to verify
+// matching start/end group tags.
+class PROTOBUF_EXPORT ParseContext : public EpsCopyInputStream {
+ public:
+  struct Data {
+    const DescriptorPool* pool = nullptr;
+    MessageFactory* factory = nullptr;
+    Arena* arena = nullptr;
+  };
+
+  template <typename... T>
+  ParseContext(int depth, bool aliasing, const char** start, T&&... args)
+      : EpsCopyInputStream(aliasing), depth_(depth) {
+    *start = InitFrom(std::forward<T>(args)...);
+  }
+
+  void TrackCorrectEnding() { group_depth_ = 0; }
+
+  bool Done(const char** ptr) { return DoneWithCheck(ptr, group_depth_); }
+
+  int depth() const { return depth_; }
+
+  Data& data() { return data_; }
+  const Data& data() const { return data_; }
+
+  const char* ParseMessage(MessageLite* msg, const char* ptr);
+
+  // This overload supports those few cases where ParseMessage is called
+  // on a class that is not actually a proto message.
+  // TODO(jorg): Eliminate this use case.
+  template <typename T,
+            typename std::enable_if<!std::is_base_of<MessageLite, T>::value,
+                                    bool>::type = true>
+  PROTOBUF_NODISCARD const char* ParseMessage(T* msg, const char* ptr);
+
+  template <typename T>
+  PROTOBUF_NODISCARD PROTOBUF_NDEBUG_INLINE const char* ParseGroup(
+      T* msg, const char* ptr, uint32_t tag) {
+    if (--depth_ < 0) return nullptr;
+    group_depth_++;
+    ptr = msg->_InternalParse(ptr, this);
+    group_depth_--;
+    depth_++;
+    if (PROTOBUF_PREDICT_FALSE(!ConsumeEndGroup(tag))) return nullptr;
+    return ptr;
+  }
+
+ private:
+  // Out-of-line routine to save space in ParseContext::ParseMessage<T>
+  //   int old;
+  //   ptr = ReadSizeAndPushLimitAndDepth(ptr, &old)
+  // is equivalent to:
+  //   int size = ReadSize(&ptr);
+  //   if (!ptr) return nullptr;
+  //   int old = PushLimit(ptr, size);
+  //   if (--depth_ < 0) return nullptr;
+  PROTOBUF_NODISCARD const char* ReadSizeAndPushLimitAndDepth(const char* ptr,
+                                                              int* old_limit);
+
+  // The context keeps an internal stack to keep track of the recursive
+  // part of the parse state.
+  // Current depth of the active parser, depth counts down.
+  // This is used to limit recursion depth (to prevent overflow on malicious
+  // data), but is also used to index in stack_ to store the current state.
+  int depth_;
+  // Unfortunately necessary for the fringe case of ending on 0 or end-group tag
+  // in the last kSlopBytes of a ZeroCopyInputStream chunk.
+  int group_depth_ = INT_MIN;
+  Data data_;
+};
+
+template <uint32_t tag>
+bool ExpectTag(const char* ptr) {
+  if (tag < 128) {
+    return *ptr == static_cast<char>(tag);
+  } else {
+    static_assert(tag < 128 * 128, "We only expect tags for 1 or 2 bytes");
+    char buf[2] = {static_cast<char>(tag | 0x80), static_cast<char>(tag >> 7)};
+    return std::memcmp(ptr, buf, 2) == 0;
+  }
+}
+
+template <int>
+struct EndianHelper;
+
+template <>
+struct EndianHelper<1> {
+  static uint8_t Load(const void* p) { return *static_cast<const uint8_t*>(p); }
+};
+
+template <>
+struct EndianHelper<2> {
+  static uint16_t Load(const void* p) {
+    uint16_t tmp;
+    std::memcpy(&tmp, p, 2);
+#ifndef PROTOBUF_LITTLE_ENDIAN
+    tmp = bswap_16(tmp);
+#endif
+    return tmp;
+  }
+};
+
+template <>
+struct EndianHelper<4> {
+  static uint32_t Load(const void* p) {
+    uint32_t tmp;
+    std::memcpy(&tmp, p, 4);
+#ifndef PROTOBUF_LITTLE_ENDIAN
+    tmp = bswap_32(tmp);
+#endif
+    return tmp;
+  }
+};
+
+template <>
+struct EndianHelper<8> {
+  static uint64_t Load(const void* p) {
+    uint64_t tmp;
+    std::memcpy(&tmp, p, 8);
+#ifndef PROTOBUF_LITTLE_ENDIAN
+    tmp = bswap_64(tmp);
+#endif
+    return tmp;
+  }
+};
+
+template <typename T>
+T UnalignedLoad(const char* p) {
+  auto tmp = EndianHelper<sizeof(T)>::Load(p);
+  T res;
+  memcpy(&res, &tmp, sizeof(T));
+  return res;
+}
+
+PROTOBUF_EXPORT
+std::pair<const char*, uint32_t> VarintParseSlow32(const char* p, uint32_t res);
+PROTOBUF_EXPORT
+std::pair<const char*, uint64_t> VarintParseSlow64(const char* p, uint32_t res);
+
+inline const char* VarintParseSlow(const char* p, uint32_t res, uint32_t* out) {
+  auto tmp = VarintParseSlow32(p, res);
+  *out = tmp.second;
+  return tmp.first;
+}
+
+inline const char* VarintParseSlow(const char* p, uint32_t res, uint64_t* out) {
+  auto tmp = VarintParseSlow64(p, res);
+  *out = tmp.second;
+  return tmp.first;
+}
+
+template <typename T>
+PROTOBUF_NODISCARD const char* VarintParse(const char* p, T* out) {
+  auto ptr = reinterpret_cast<const uint8_t*>(p);
+  uint32_t res = ptr[0];
+  if (!(res & 0x80)) {
+    *out = res;
+    return p + 1;
+  }
+  uint32_t byte = ptr[1];
+  res += (byte - 1) << 7;
+  if (!(byte & 0x80)) {
+    *out = res;
+    return p + 2;
+  }
+  return VarintParseSlow(p, res, out);
+}
+
+// Used for tags, could read up to 5 bytes which must be available.
+// Caller must ensure its safe to call.
+
+PROTOBUF_EXPORT
+std::pair<const char*, uint32_t> ReadTagFallback(const char* p, uint32_t res);
+
+// Same as ParseVarint but only accept 5 bytes at most.
+inline const char* ReadTag(const char* p, uint32_t* out,
+                           uint32_t /*max_tag*/ = 0) {
+  uint32_t res = static_cast<uint8_t>(p[0]);
+  if (res < 128) {
+    *out = res;
+    return p + 1;
+  }
+  uint32_t second = static_cast<uint8_t>(p[1]);
+  res += (second - 1) << 7;
+  if (second < 128) {
+    *out = res;
+    return p + 2;
+  }
+  auto tmp = ReadTagFallback(p, res);
+  *out = tmp.second;
+  return tmp.first;
+}
+
+// Decode 2 consecutive bytes of a varint and returns the value, shifted left
+// by 1. It simultaneous updates *ptr to *ptr + 1 or *ptr + 2 depending if the
+// first byte's continuation bit is set.
+// If bit 15 of return value is set (equivalent to the continuation bits of both
+// bytes being set) the varint continues, otherwise the parse is done. On x86
+// movsx eax, dil
+// add edi, eax
+// adc [rsi], 1
+// add eax, eax
+// and eax, edi
+inline uint32_t DecodeTwoBytes(const char** ptr) {
+  uint32_t value = UnalignedLoad<uint16_t>(*ptr);
+  // Sign extend the low byte continuation bit
+  uint32_t x = static_cast<int8_t>(value);
+  // This add is an amazing operation, it cancels the low byte continuation bit
+  // from y transferring it to the carry. Simultaneously it also shifts the 7
+  // LSB left by one tightly against high byte varint bits. Hence value now
+  // contains the unpacked value shifted left by 1.
+  value += x;
+  // Use the carry to update the ptr appropriately.
+  *ptr += value < x ? 2 : 1;
+  return value & (x + x);  // Mask out the high byte iff no continuation
+}
+
+// More efficient varint parsing for big varints
+inline const char* ParseBigVarint(const char* p, uint64_t* out) {
+  auto pnew = p;
+  auto tmp = DecodeTwoBytes(&pnew);
+  uint64_t res = tmp >> 1;
+  if (PROTOBUF_PREDICT_TRUE(static_cast<std::int16_t>(tmp) >= 0)) {
+    *out = res;
+    return pnew;
+  }
+  for (std::uint32_t i = 1; i < 5; i++) {
+    pnew = p + 2 * i;
+    tmp = DecodeTwoBytes(&pnew);
+    res += (static_cast<std::uint64_t>(tmp) - 2) << (14 * i - 1);
+    if (PROTOBUF_PREDICT_TRUE(static_cast<std::int16_t>(tmp) >= 0)) {
+      *out = res;
+      return pnew;
+    }
+  }
+  return nullptr;
+}
+
+PROTOBUF_EXPORT
+std::pair<const char*, int32_t> ReadSizeFallback(const char* p, uint32_t first);
+// Used for tags, could read up to 5 bytes which must be available. Additionally
+// it makes sure the unsigned value fits a int32_t, otherwise returns nullptr.
+// Caller must ensure its safe to call.
+inline uint32_t ReadSize(const char** pp) {
+  auto p = *pp;
+  uint32_t res = static_cast<uint8_t>(p[0]);
+  if (res < 128) {
+    *pp = p + 1;
+    return res;
+  }
+  auto x = ReadSizeFallback(p, res);
+  *pp = x.first;
+  return x.second;
+}
+
+// Some convenience functions to simplify the generated parse loop code.
+// Returning the value and updating the buffer pointer allows for nicer
+// function composition. We rely on the compiler to inline this.
+// Also in debug compiles having local scoped variables tend to generated
+// stack frames that scale as O(num fields).
+inline uint64_t ReadVarint64(const char** p) {
+  uint64_t tmp;
+  *p = VarintParse(*p, &tmp);
+  return tmp;
+}
+
+inline uint32_t ReadVarint32(const char** p) {
+  uint32_t tmp;
+  *p = VarintParse(*p, &tmp);
+  return tmp;
+}
+
+inline int64_t ReadVarintZigZag64(const char** p) {
+  uint64_t tmp;
+  *p = VarintParse(*p, &tmp);
+  return WireFormatLite::ZigZagDecode64(tmp);
+}
+
+inline int32_t ReadVarintZigZag32(const char** p) {
+  uint64_t tmp;
+  *p = VarintParse(*p, &tmp);
+  return WireFormatLite::ZigZagDecode32(static_cast<uint32_t>(tmp));
+}
+
+template <typename T, typename std::enable_if<
+                          !std::is_base_of<MessageLite, T>::value, bool>::type>
+PROTOBUF_NODISCARD const char* ParseContext::ParseMessage(T* msg,
+                                                          const char* ptr) {
+  int old;
+  ptr = ReadSizeAndPushLimitAndDepth(ptr, &old);
+  ptr = ptr ? msg->_InternalParse(ptr, this) : nullptr;
+  depth_++;
+  if (!PopLimit(old)) return nullptr;
+  return ptr;
+}
+
+template <typename Tag, typename T>
+const char* EpsCopyInputStream::ReadRepeatedFixed(const char* ptr,
+                                                  Tag expected_tag,
+                                                  RepeatedField<T>* out) {
+  do {
+    out->Add(UnalignedLoad<T>(ptr));
+    ptr += sizeof(T);
+    if (PROTOBUF_PREDICT_FALSE(ptr >= limit_end_)) return ptr;
+  } while (UnalignedLoad<Tag>(ptr) == expected_tag && (ptr += sizeof(Tag)));
+  return ptr;
+}
+
+// Add any of the following lines to debug which parse function is failing.
+
+#define GOOGLE_PROTOBUF_ASSERT_RETURN(predicate, ret) \
+  if (!(predicate)) {                                  \
+    /*  ::raise(SIGINT);  */                           \
+    /*  GOOGLE_LOG(ERROR) << "Parse failure";  */             \
+    return ret;                                        \
+  }
+
+#define GOOGLE_PROTOBUF_PARSER_ASSERT(predicate) \
+  GOOGLE_PROTOBUF_ASSERT_RETURN(predicate, nullptr)
+
+template <typename T>
+const char* EpsCopyInputStream::ReadPackedFixed(const char* ptr, int size,
+                                                RepeatedField<T>* out) {
+  GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+  int nbytes = buffer_end_ + kSlopBytes - ptr;
+  while (size > nbytes) {
+    int num = nbytes / sizeof(T);
+    int old_entries = out->size();
+    out->Reserve(old_entries + num);
+    int block_size = num * sizeof(T);
+    auto dst = out->AddNAlreadyReserved(num);
+#ifdef PROTOBUF_LITTLE_ENDIAN
+    std::memcpy(dst, ptr, block_size);
+#else
+    for (int i = 0; i < num; i++)
+      dst[i] = UnalignedLoad<T>(ptr + i * sizeof(T));
+#endif
+    size -= block_size;
+    if (limit_ <= kSlopBytes) return nullptr;
+    ptr = Next();
+    if (ptr == nullptr) return nullptr;
+    ptr += kSlopBytes - (nbytes - block_size);
+    nbytes = buffer_end_ + kSlopBytes - ptr;
+  }
+  int num = size / sizeof(T);
+  int old_entries = out->size();
+  out->Reserve(old_entries + num);
+  int block_size = num * sizeof(T);
+  auto dst = out->AddNAlreadyReserved(num);
+#ifdef PROTOBUF_LITTLE_ENDIAN
+  std::memcpy(dst, ptr, block_size);
+#else
+  for (int i = 0; i < num; i++) dst[i] = UnalignedLoad<T>(ptr + i * sizeof(T));
+#endif
+  ptr += block_size;
+  if (size != block_size) return nullptr;
+  return ptr;
+}
+
+template <typename Add>
+const char* ReadPackedVarintArray(const char* ptr, const char* end, Add add) {
+  while (ptr < end) {
+    uint64_t varint;
+    ptr = VarintParse(ptr, &varint);
+    if (ptr == nullptr) return nullptr;
+    add(varint);
+  }
+  return ptr;
+}
+
+template <typename Add>
+const char* EpsCopyInputStream::ReadPackedVarint(const char* ptr, Add add) {
+  int size = ReadSize(&ptr);
+  GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+  int chunk_size = buffer_end_ - ptr;
+  while (size > chunk_size) {
+    ptr = ReadPackedVarintArray(ptr, buffer_end_, add);
+    if (ptr == nullptr) return nullptr;
+    int overrun = ptr - buffer_end_;
+    GOOGLE_DCHECK(overrun >= 0 && overrun <= kSlopBytes);
+    if (size - chunk_size <= kSlopBytes) {
+      // The current buffer contains all the information needed, we don't need
+      // to flip buffers. However we must parse from a buffer with enough space
+      // so we are not prone to a buffer overflow.
+      char buf[kSlopBytes + 10] = {};
+      std::memcpy(buf, buffer_end_, kSlopBytes);
+      GOOGLE_CHECK_LE(size - chunk_size, kSlopBytes);
+      auto end = buf + (size - chunk_size);
+      auto res = ReadPackedVarintArray(buf + overrun, end, add);
+      if (res == nullptr || res != end) return nullptr;
+      return buffer_end_ + (res - buf);
+    }
+    size -= overrun + chunk_size;
+    GOOGLE_DCHECK_GT(size, 0);
+    // We must flip buffers
+    if (limit_ <= kSlopBytes) return nullptr;
+    ptr = Next();
+    if (ptr == nullptr) return nullptr;
+    ptr += overrun;
+    chunk_size = buffer_end_ - ptr;
+  }
+  auto end = ptr + size;
+  ptr = ReadPackedVarintArray(ptr, end, add);
+  return end == ptr ? ptr : nullptr;
+}
+
+// Helper for verification of utf8
+PROTOBUF_EXPORT
+bool VerifyUTF8(StringPiece s, const char* field_name);
+
+inline bool VerifyUTF8(const std::string* s, const char* field_name) {
+  return VerifyUTF8(*s, field_name);
+}
+
+// All the string parsers with or without UTF checking and for all CTypes.
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* InlineGreedyStringParser(
+    std::string* s, const char* ptr, ParseContext* ctx);
+
+
+template <typename T>
+PROTOBUF_NODISCARD const char* FieldParser(uint64_t tag, T& field_parser,
+                                           const char* ptr, ParseContext* ctx) {
+  uint32_t number = tag >> 3;
+  GOOGLE_PROTOBUF_PARSER_ASSERT(number != 0);
+  using WireType = internal::WireFormatLite::WireType;
+  switch (tag & 7) {
+    case WireType::WIRETYPE_VARINT: {
+      uint64_t value;
+      ptr = VarintParse(ptr, &value);
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+      field_parser.AddVarint(number, value);
+      break;
+    }
+    case WireType::WIRETYPE_FIXED64: {
+      uint64_t value = UnalignedLoad<uint64_t>(ptr);
+      ptr += 8;
+      field_parser.AddFixed64(number, value);
+      break;
+    }
+    case WireType::WIRETYPE_LENGTH_DELIMITED: {
+      ptr = field_parser.ParseLengthDelimited(number, ptr, ctx);
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+      break;
+    }
+    case WireType::WIRETYPE_START_GROUP: {
+      ptr = field_parser.ParseGroup(number, ptr, ctx);
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+      break;
+    }
+    case WireType::WIRETYPE_END_GROUP: {
+      GOOGLE_LOG(FATAL) << "Can't happen";
+      break;
+    }
+    case WireType::WIRETYPE_FIXED32: {
+      uint32_t value = UnalignedLoad<uint32_t>(ptr);
+      ptr += 4;
+      field_parser.AddFixed32(number, value);
+      break;
+    }
+    default:
+      return nullptr;
+  }
+  return ptr;
+}
+
+template <typename T>
+PROTOBUF_NODISCARD const char* WireFormatParser(T& field_parser,
+                                                const char* ptr,
+                                                ParseContext* ctx) {
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ReadTag(ptr, &tag);
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr);
+    if (tag == 0 || (tag & 7) == 4) {
+      ctx->SetLastTag(tag);
+      return ptr;
+    }
+    ptr = FieldParser(tag, field_parser, ptr, ctx);
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr);
+  }
+  return ptr;
+}
+
+// The packed parsers parse repeated numeric primitives directly into  the
+// corresponding field
+
+// These are packed varints
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedInt32Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedUInt32Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedInt64Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedUInt64Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedSInt32Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedSInt64Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedEnumParser(
+    void* object, const char* ptr, ParseContext* ctx);
+
+template <typename T>
+PROTOBUF_NODISCARD const char* PackedEnumParser(void* object, const char* ptr,
+                                                ParseContext* ctx,
+                                                bool (*is_valid)(int),
+                                                InternalMetadata* metadata,
+                                                int field_num) {
+  return ctx->ReadPackedVarint(
+      ptr, [object, is_valid, metadata, field_num](uint64_t val) {
+        if (is_valid(val)) {
+          static_cast<RepeatedField<int>*>(object)->Add(val);
+        } else {
+          WriteVarint(field_num, val, metadata->mutable_unknown_fields<T>());
+        }
+      });
+}
+
+template <typename T>
+PROTOBUF_NODISCARD const char* PackedEnumParserArg(
+    void* object, const char* ptr, ParseContext* ctx,
+    bool (*is_valid)(const void*, int), const void* data,
+    InternalMetadata* metadata, int field_num) {
+  return ctx->ReadPackedVarint(
+      ptr, [object, is_valid, data, metadata, field_num](uint64_t val) {
+        if (is_valid(data, val)) {
+          static_cast<RepeatedField<int>*>(object)->Add(val);
+        } else {
+          WriteVarint(field_num, val, metadata->mutable_unknown_fields<T>());
+        }
+      });
+}
+
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedBoolParser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedFixed32Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedSFixed32Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedFixed64Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedSFixed64Parser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedFloatParser(
+    void* object, const char* ptr, ParseContext* ctx);
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedDoubleParser(
+    void* object, const char* ptr, ParseContext* ctx);
+
+// This is the only recursive parser.
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* UnknownGroupLiteParse(
+    std::string* unknown, const char* ptr, ParseContext* ctx);
+// This is a helper to for the UnknownGroupLiteParse but is actually also
+// useful in the generated code. It uses overload on std::string* vs
+// UnknownFieldSet* to make the generated code isomorphic between full and lite.
+PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* UnknownFieldParse(
+    uint32_t tag, std::string* unknown, const char* ptr, ParseContext* ctx);
+
+}  // namespace internal
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
+#endif  // GOOGLE_PROTOBUF_PARSE_CONTEXT_H__
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Author: kenton@google.com (Kenton Varda)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
+// A common header that is included across all protobuf headers.  We do our best
+// to avoid #defining any macros here; instead we generally put macros in
+// port_def.inc and port_undef.inc so they are not visible from outside of
+// protobuf.
 
-#include <google/protobuf/service.h>
+#ifndef GOOGLE_PROTOBUF_PORT_H__
+#define GOOGLE_PROTOBUF_PORT_H__
 
-namespace google {
-namespace protobuf {
 
-Service::~Service() {}
-RpcChannel::~RpcChannel() {}
-RpcController::~RpcController() {}
-
-}  // namespace protobuf
-
-}  // namespace google
+#endif  // GOOGLE_PROTOBUF_PORT_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/port_def.inc b/3rdparty/protobuf/src/google/protobuf/port_def.inc
new file mode 100644 (file)
index 0000000..71325c3
--- /dev/null
@@ -0,0 +1,824 @@
+// 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.
+
+// This file defines common macros that are used in protobuf.
+//
+// To hide these definitions from the outside world (and to prevent collisions
+// if more than one version of protobuf is #included in the same project) you
+// must follow this pattern when #including port_def.inc in a header file:
+//
+// #include "other_header.h"
+// #include "message.h"
+// // etc.
+//
+// #include "port_def.inc"  // MUST be last header included
+//
+// // Definitions for this header.
+//
+// #include "port_undef.inc"
+//
+// This is a textual header with no include guard, because we want to
+// detect/prohibit anytime it is #included twice without a corresponding
+// #undef.
+
+// The definitions in this file are intended to be portable across Clang,
+// GCC, and MSVC. Function-like macros are usable without an #ifdef guard.
+// Syntax macros (for example, attributes) are always defined, although
+// they may be empty.
+//
+// Some definitions rely on the NDEBUG macro and/or (in MSVC) _DEBUG:
+// - https://en.cppreference.com/w/c/error/assert
+// - https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros#microsoft-specific-predefined-macros
+//
+// References for predefined macros:
+// - Standard: https://en.cppreference.com/w/cpp/preprocessor/replace
+// - Clang: https://clang.llvm.org/docs/LanguageExtensions.html
+//          (see also GCC predefined macros)
+// - GCC: https://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html
+// - MSVC: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
+// - Interactive (Clang/GCC only): https://www.compiler-explorer.com/z/hc6jKd3sj
+//
+// References for attributes (and extension attributes):
+// - Standard: https://en.cppreference.com/w/cpp/language/attributes
+// - Clang: https://clang.llvm.org/docs/AttributeReference.html
+// - GCC: https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
+//        (see Clang attribute docs as well)
+//
+// References for standard C++ language conformance (and minimum versions):
+// - Clang: https://clang.llvm.org/cxx_status.html
+// - GCC: https://gcc.gnu.org/projects/cxx-status.html
+// - MSVC: https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance
+//
+// Historical release notes (which can help to determine minimum versions):
+// - Clang: https://releases.llvm.org/
+// - GCC: https://gcc.gnu.org/releases.html
+// - MSVC: https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-history
+//         https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes-history
+
+// Portable fallbacks for C++20 feature test macros:
+// https://en.cppreference.com/w/cpp/feature_test
+#ifndef __has_cpp_attribute
+#define __has_cpp_attribute(x) 0
+#define PROTOBUF_has_cpp_attribute_DEFINED_
+#endif
+
+// Portable fallback for Clang's __has_feature macro:
+// https://clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension
+#ifndef __has_feature
+#define __has_feature(x) 0
+#define PROTOBUF_has_feature_DEFINED_
+#endif
+
+// Portable fallback for Clang's __has_warning macro:
+#ifndef __has_warning
+#define __has_warning(x) 0
+#define PROTOBUF_has_warning_DEFINED_
+#endif
+
+// Portable fallbacks for the __has_attribute macro (GCC and Clang):
+// https://clang.llvm.org/docs/LanguageExtensions.html#has-attribute
+// https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#define PROTOBUF_has_attribute_DEFINED_
+#endif
+
+// Portable fallback for __has_builtin (GCC and Clang):
+// https://clang.llvm.org/docs/LanguageExtensions.html#has-builtin
+// https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fbuiltin.html
+#ifndef __has_builtin
+#define __has_builtin(x) 0
+#define PROTOBUF_has_builtin_DEFINED_
+#endif
+
+// Portable check for GCC minimum version:
+// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
+#if defined(__GNUC__) && defined(__GNUC_MINOR__) \
+    && defined(__GNUC_PATCHLEVEL__)
+#  define PROTOBUF_GNUC_MIN(x, y) \
+  (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
+#else
+#  define PROTOBUF_GNUC_MIN(x, y) 0
+#endif
+
+// Portable check for MSVC minimum version:
+// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
+#if defined(_MSC_VER)
+#define PROTOBUF_MSC_VER_MIN(x) (_MSC_VER >= x)
+#else
+#define PROTOBUF_MSC_VER_MIN(x) 0
+#endif
+
+// Portable check for minimum C++ language version:
+// https://en.cppreference.com/w/cpp/preprocessor/replace
+// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
+#if !defined(_MSVC_LANG)
+#define PROTOBUF_CPLUSPLUS_MIN(x) (__cplusplus >= x)
+#else
+#define PROTOBUF_CPLUSPLUS_MIN(x) (_MSVC_LANG >= x)
+#endif
+
+// Future versions of protobuf will include breaking changes to some APIs.
+// This macro can be set to enable these API changes ahead of time, so that
+// user code can be updated before upgrading versions of protobuf.
+// #define PROTOBUF_FUTURE_BREAKING_CHANGES 1
+
+#ifdef PROTOBUF_VERSION
+#error PROTOBUF_VERSION was previously defined
+#endif
+#define PROTOBUF_VERSION 3019001
+
+#ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
+#error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined
+#endif
+#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3019000
+
+#ifdef PROTOBUF_MIN_PROTOC_VERSION
+#error PROTOBUF_MIN_PROTOC_VERSION was previously defined
+#endif
+#define PROTOBUF_MIN_PROTOC_VERSION 3019000
+
+#ifdef PROTOBUF_VERSION_SUFFIX
+#error PROTOBUF_VERSION_SUFFIX was previously defined
+#endif
+#define PROTOBUF_VERSION_SUFFIX ""
+
+#if defined(PROTOBUF_NAMESPACE) || defined(PROTOBUF_NAMESPACE_ID)
+#error PROTOBUF_NAMESPACE or PROTOBUF_NAMESPACE_ID was previously defined
+#endif
+#define PROTOBUF_NAMESPACE "google::protobuf"
+#define PROTOBUF_NAMESPACE_ID google::protobuf
+#define PROTOBUF_NAMESPACE_OPEN \
+  namespace google {            \
+  namespace protobuf {
+#define PROTOBUF_NAMESPACE_CLOSE \
+  } /* namespace protobuf */     \
+  } /* namespace google */
+
+#ifdef PROTOBUF_ALWAYS_INLINE
+#error PROTOBUF_ALWAYS_INLINE was previously defined
+#endif
+// For functions we want to force inline.
+#if defined(PROTOBUF_NO_INLINE)
+# define PROTOBUF_ALWAYS_INLINE
+#elif PROTOBUF_GNUC_MIN(3, 1)
+# define PROTOBUF_ALWAYS_INLINE __attribute__((always_inline))
+#elif defined(_MSC_VER)
+# define PROTOBUF_ALWAYS_INLINE __forceinline
+#else
+# define PROTOBUF_ALWAYS_INLINE
+#endif
+
+#ifdef PROTOBUF_NDEBUG_INLINE
+#error PROTOBUF_NDEBUG_INLINE was previously defined
+#endif
+// Avoid excessive inlining in non-optimized builds. Without other optimizations
+// the inlining is not going to provide benefits anyway and the huge resulting
+// functions, especially in the proto-generated serialization functions, produce
+// stack frames so large that many tests run into stack overflows (b/32192897).
+#if defined(NDEBUG) || (defined(_MSC_VER) && !defined(_DEBUG))
+# define PROTOBUF_NDEBUG_INLINE PROTOBUF_ALWAYS_INLINE
+#else
+# define PROTOBUF_NDEBUG_INLINE
+#endif
+
+// Note that PROTOBUF_NOINLINE is an attribute applied to functions, to prevent
+// them from being inlined by the compiler. This is different from
+// PROTOBUF_NO_INLINE, which is a user-supplied macro that disables forced
+// inlining by PROTOBUF_(ALWAYS|NDEBUG)_INLINE.
+#ifdef PROTOBUF_NOINLINE
+#error PROTOBUF_NOINLINE was previously defined
+#endif
+#if PROTOBUF_GNUC_MIN(3, 1)
+# define PROTOBUF_NOINLINE __attribute__((noinline))
+#elif defined(_MSC_VER)
+// Seems to have been around since at least Visual Studio 2005
+# define PROTOBUF_NOINLINE __declspec(noinline)
+#endif
+
+#ifdef PROTOBUF_MUSTTAIL
+#error PROTOBUF_MUSTTAIL was previously defined
+#endif
+#ifdef PROTOBUF_TAILCALL
+#error PROTOBUF_TAILCALL was previously defined
+#endif
+#if __has_cpp_attribute(clang::musttail) && \
+  !defined(__arm__) && !defined(_ARCH_PPC) && !defined(__wasm__)
+#  ifndef PROTO2_OPENSOURCE
+// Compilation fails on ARM32: b/195943306
+// Compilation fails on powerpc64le: b/187985113
+#  endif
+#define PROTOBUF_MUSTTAIL [[clang::musttail]]
+#define PROTOBUF_TAILCALL true
+#else
+#define PROTOBUF_MUSTTAIL
+#define PROTOBUF_TAILCALL false
+#endif
+
+#ifdef PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED
+#error PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED was previously defined
+#endif
+#if __has_attribute(exclusive_locks_required)
+#define PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED(...) \
+  __attribute__((exclusive_locks_required(__VA_ARGS__)))
+#else
+#define PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED(...)
+#endif
+
+#ifdef PROTOBUF_NO_THREAD_SAFETY_ANALYSIS
+#error PROTOBUF_NO_THREAD_SAFETY_ANALYSIS was previously defined
+#endif
+#if __has_attribute(no_thread_safety_analysis)
+#define PROTOBUF_NO_THREAD_SAFETY_ANALYSIS \
+  __attribute__((no_thread_safety_analysis))
+#else
+#define PROTOBUF_NO_THREAD_SAFETY_ANALYSIS
+#endif
+
+#ifdef PROTOBUF_GUARDED_BY
+#error PROTOBUF_GUARDED_BY was previously defined
+#endif
+#if __has_attribute(guarded_by)
+#define PROTOBUF_GUARDED_BY(x) __attribute__((guarded_by(x)))
+#else
+#define PROTOBUF_GUARDED_BY(x)
+#endif
+
+#ifdef PROTOBUF_LOCKS_EXCLUDED
+#error PROTOBUF_LOCKS_EXCLUDED was previously defined
+#endif
+#if __has_attribute(locks_excluded)
+#define PROTOBUF_LOCKS_EXCLUDED(...) \
+  __attribute__((locks_excluded(__VA_ARGS__)))
+#else
+#define PROTOBUF_LOCKS_EXCLUDED(...)
+#endif
+
+#ifdef PROTOBUF_COLD
+#error PROTOBUF_COLD was previously defined
+#endif
+#if __has_attribute(cold) || PROTOBUF_GNUC_MIN(4, 3)
+# define PROTOBUF_COLD __attribute__((cold))
+#else
+# define PROTOBUF_COLD
+#endif
+
+#ifdef PROTOBUF_SECTION_VARIABLE
+#error PROTOBUF_SECTION_VARIABLE was previously defined
+#endif
+#if (__has_attribute(section) || defined(__GNUC__)) && defined(__ELF__)
+// Place a variable in the given ELF section.
+# define PROTOBUF_SECTION_VARIABLE(x) __attribute__((section(#x)))
+#else
+# define PROTOBUF_SECTION_VARIABLE(x)
+#endif
+
+#if defined(PROTOBUF_DEPRECATED)
+#error PROTOBUF_DEPRECATED was previously defined
+#endif
+#if defined(PROTOBUF_DEPRECATED_MSG)
+#error PROTOBUF_DEPRECATED_MSG was previously defined
+#endif
+#if __has_attribute(deprecated) || PROTOBUF_GNUC_MIN(3, 0)
+# define PROTOBUF_DEPRECATED __attribute__((deprecated))
+# define PROTOBUF_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
+#elif defined(_MSC_VER)
+# define PROTOBUF_DEPRECATED __declspec(deprecated)
+# define PROTOBUF_DEPRECATED_MSG(msg) __declspec(deprecated(msg))
+#else
+# define PROTOBUF_DEPRECATED
+# define PROTOBUF_DEPRECATED_MSG(msg)
+#endif
+
+#if defined(PROTOBUF_DEPRECATED_ENUM)
+#error PROTOBUF_DEPRECATED_ENUM was previously defined
+#endif
+#if defined(__clang__) || PROTOBUF_GNUC_MIN(6, 0)
+// https://gcc.gnu.org/gcc-6/changes.html
+# define PROTOBUF_DEPRECATED_ENUM __attribute__((deprecated))
+#else
+# define PROTOBUF_DEPRECATED_ENUM
+#endif
+
+#ifdef PROTOBUF_FUNC_ALIGN
+#error PROTOBUF_FUNC_ALIGN was previously defined
+#endif
+#if __has_attribute(aligned) || PROTOBUF_GNUC_MIN(4, 3)
+#define PROTOBUF_FUNC_ALIGN(bytes) __attribute__((aligned(bytes)))
+#else
+#define PROTOBUF_FUNC_ALIGN(bytes)
+#endif
+
+#ifdef PROTOBUF_RETURNS_NONNULL
+#error PROTOBUF_RETURNS_NONNULL was previously defined
+#endif
+#if __has_attribute(returns_nonnull) || PROTOBUF_GNUC_MIN(4, 9)
+#define PROTOBUF_RETURNS_NONNULL __attribute__((returns_nonnull))
+#else
+#define PROTOBUF_RETURNS_NONNULL
+#endif
+
+#ifdef PROTOBUF_ATTRIBUTE_REINITIALIZES
+#error PROTOBUF_ATTRIBUTE_REINITIALIZES was previously defined
+#endif
+#if __has_cpp_attribute(clang::reinitializes)
+#define PROTOBUF_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]]
+#else
+#define PROTOBUF_ATTRIBUTE_REINITIALIZES
+#endif
+
+// The minimum library version which works with the current version of the
+// headers.
+#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3019000
+
+#ifdef PROTOBUF_RTTI
+#error PROTOBUF_RTTI was previously defined
+#endif
+#if defined(GOOGLE_PROTOBUF_NO_RTTI) && GOOGLE_PROTOBUF_NO_RTTI
+#define PROTOBUF_RTTI 0
+#elif __has_feature(cxx_rtti)
+#define PROTOBUF_RTTI 1
+#elif defined(__cxx_rtti)
+// https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros#C.2B.2B98
+#define PROTOBUF_RTTI 1
+#else
+#define PROTOBUF_RTTI 0
+#endif
+
+// Returns the offset of the given field within the given aggregate type.
+// This is equivalent to the ANSI C offsetof() macro.  However, according
+// to the C++ standard, offsetof() only works on POD types, and GCC
+// enforces this requirement with a warning.  In practice, this rule is
+// unnecessarily strict; there is probably no compiler or platform on
+// which the offsets of the direct fields of a class are non-constant.
+// Fields inherited from superclasses *can* have non-constant offsets,
+// but that's not what this macro will be used for.
+#ifdef PROTOBUF_FIELD_OFFSET
+#error PROTOBUF_FIELD_OFFSET was previously defined
+#endif
+#if defined(__clang__)
+// For Clang we use __builtin_offsetof() and suppress the warning,
+// to avoid Control Flow Integrity and UBSan vptr sanitizers from
+// crashing while trying to validate the invalid reinterpret_casts.
+#define PROTOBUF_FIELD_OFFSET(TYPE, FIELD)                   \
+  _Pragma("clang diagnostic push")                           \
+  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
+  __builtin_offsetof(TYPE, FIELD)                            \
+  _Pragma("clang diagnostic pop")
+#elif PROTOBUF_GNUC_MIN(4, 8)
+#define PROTOBUF_FIELD_OFFSET(TYPE, FIELD) __builtin_offsetof(TYPE, FIELD)
+#else  // defined(__clang__)
+// Note that we calculate relative to the pointer value 16 here since if we
+// just use zero, GCC complains about dereferencing a NULL pointer.  We
+// choose 16 rather than some other number just in case the compiler would
+// be confused by an unaligned pointer.
+#define PROTOBUF_FIELD_OFFSET(TYPE, FIELD)                                \
+  static_cast< ::uint32_t>(reinterpret_cast<const char*>(                   \
+                             &reinterpret_cast<const TYPE*>(16)->FIELD) - \
+                         reinterpret_cast<const char*>(16))
+#endif
+
+#ifdef PROTOBUF_EXPORT
+#error PROTOBUF_EXPORT was previously defined
+#endif
+
+#if defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER)
+# if defined(LIBPROTOBUF_EXPORTS)
+#  define PROTOBUF_EXPORT __declspec(dllexport)
+#  define PROTOBUF_EXPORT_TEMPLATE_DECLARE
+#  define PROTOBUF_EXPORT_TEMPLATE_DEFINE __declspec(dllexport)
+# else
+#  define PROTOBUF_EXPORT __declspec(dllimport)
+#  define PROTOBUF_EXPORT_TEMPLATE_DECLARE
+#  define PROTOBUF_EXPORT_TEMPLATE_DEFINE __declspec(dllimport)
+# endif  // defined(LIBPROTOBUF_EXPORTS)
+#elif defined(PROTOBUF_USE_DLLS) && defined(LIBPROTOBUF_EXPORTS)
+# define PROTOBUF_EXPORT __attribute__((visibility("default")))
+# define PROTOBUF_EXPORT_TEMPLATE_DECLARE __attribute__((visibility("default")))
+# define PROTOBUF_EXPORT_TEMPLATE_DEFINE
+#else
+# define PROTOBUF_EXPORT
+# define PROTOBUF_EXPORT_TEMPLATE_DECLARE
+# define PROTOBUF_EXPORT_TEMPLATE_DEFINE
+#endif
+
+#ifdef PROTOC_EXPORT
+#error PROTOC_EXPORT was previously defined
+#endif
+
+#if defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER)
+# if defined(LIBPROTOC_EXPORTS)
+#  define PROTOC_EXPORT __declspec(dllexport)
+# else
+#  define PROTOC_EXPORT __declspec(dllimport)
+# endif  // defined(LIBPROTOC_EXPORTS)
+#elif defined(PROTOBUF_USE_DLLS) && defined(LIBPROTOBUF_EXPORTS)
+# define PROTOC_EXPORT __attribute__((visibility("default")))
+#else
+# define PROTOC_EXPORT
+#endif
+
+#if defined(PROTOBUF_PREDICT_TRUE) || defined(PROTOBUF_PREDICT_FALSE)
+#error PROTOBUF_PREDICT_(TRUE|FALSE) was previously defined
+#endif
+#if PROTOBUF_GNUC_MIN(3, 0)
+# define PROTOBUF_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
+# define PROTOBUF_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
+#else
+# define PROTOBUF_PREDICT_TRUE(x) (x)
+# define PROTOBUF_PREDICT_FALSE(x) (x)
+#endif
+
+#ifdef PROTOBUF_NODISCARD
+#error PROTOBUF_NODISCARD was previously defined
+#endif
+#if __has_cpp_attribute(nodiscard)
+#define PROTOBUF_NODISCARD [[nodiscard]]
+#elif __has_attribute(warn_unused_result) || PROTOBUF_GNUC_MIN(4, 8)
+#define PROTOBUF_NODISCARD __attribute__((warn_unused_result))
+#else
+#define PROTOBUF_NODISCARD
+#endif
+
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+#error PROTOBUF_FORCE_COPY_IN_RELEASE was previously defined
+#endif
+
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+#error PROTOBUF_FORCE_COPY_IN_SWAP was previously defined
+#endif
+
+#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+#error PROTOBUF_FORCE_COPY_IN_MOVE was previously defined
+#endif
+
+// Force copy the default string to a string field so that non-optimized builds
+// have harder-to-rely-on address stability.
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+#error PROTOBUF_FORCE_COPY_DEFAULT_STRING was previously defined
+#endif
+
+#ifdef PROTOBUF_FALLTHROUGH_INTENDED
+#error PROTOBUF_FALLTHROUGH_INTENDED was previously defined
+#endif
+#if __has_cpp_attribute(fallthrough)
+#define PROTOBUF_FALLTHROUGH_INTENDED [[fallthrough]]
+#elif __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
+#define PROTOBUF_FALLTHROUGH_INTENDED [[clang::fallthrough]]
+#elif PROTOBUF_GNUC_MIN(7, 0)
+#define PROTOBUF_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
+#else
+#define PROTOBUF_FALLTHROUGH_INTENDED
+#endif
+
+// PROTOBUF_ASSUME(pred) tells the compiler that it can assume pred is true. To
+// be safe, we also validate the assumption with a GOOGLE_DCHECK in unoptimized
+// builds. The macro does not do anything useful if the compiler does not
+// support __builtin_assume.
+#ifdef PROTOBUF_ASSUME
+#error PROTOBUF_ASSUME was previously defined
+#endif
+#if __has_builtin(__builtin_assume)
+#define PROTOBUF_ASSUME(pred) \
+  GOOGLE_DCHECK(pred);               \
+  __builtin_assume(pred)
+#else
+#define PROTOBUF_ASSUME(pred) GOOGLE_DCHECK(pred)
+#endif
+
+// Specify memory alignment for structs, classes, etc.
+// Use like:
+//   class PROTOBUF_ALIGNAS(16) MyClass { ... }
+//   PROTOBUF_ALIGNAS(16) int array[4];
+//
+// In most places you can use the C++11 keyword "alignas", which is preferred.
+//
+// But compilers have trouble mixing __attribute__((...)) syntax with
+// alignas(...) syntax.
+//
+// Doesn't work in clang or gcc:
+//   struct alignas(16) __attribute__((packed)) S { char c; };
+// Works in clang but not gcc:
+//   struct __attribute__((packed)) alignas(16) S2 { char c; };
+// Works in clang and gcc:
+//   struct alignas(16) S3 { char c; } __attribute__((packed));
+//
+// There are also some attributes that must be specified *before* a class
+// definition: visibility (used for exporting functions/classes) is one of
+// these attributes. This means that it is not possible to use alignas() with a
+// class that is marked as exported.
+#ifdef PROTOBUF_ALIGNAS
+#error PROTOBUF_ALIGNAS was previously defined
+#endif
+#if defined(_MSC_VER)
+#define PROTOBUF_ALIGNAS(byte_alignment) __declspec(align(byte_alignment))
+#elif PROTOBUF_GNUC_MIN(3, 0)
+#define PROTOBUF_ALIGNAS(byte_alignment) \
+  __attribute__((aligned(byte_alignment)))
+#else
+#define PROTOBUF_ALIGNAS(byte_alignment) alignas(byte_alignment)
+#endif
+
+#ifdef PROTOBUF_FINAL
+#error PROTOBUF_FINAL was previously defined
+#endif
+#define PROTOBUF_FINAL final
+
+#ifdef PROTOBUF_THREAD_LOCAL
+#error PROTOBUF_THREAD_LOCAL was previously defined
+#endif
+#if defined(_MSC_VER)
+#define PROTOBUF_THREAD_LOCAL __declspec(thread)
+#else
+#define PROTOBUF_THREAD_LOCAL __thread
+#endif
+
+// For enabling message owned arena, one major blocker is semantic change from
+// moving to copying when there is ownership transfer (e.g., move ctor, swap,
+// set allocated, release). This change not only causes performance regression
+// but also breaks users code (e.g., dangling reference). For top-level
+// messages, since it owns the arena, we can mitigate the issue by transferring
+// ownership of arena. However, we cannot do that for nested messages. In order
+// to tell how many usages of nested messages affected by message owned arena,
+// we need to simulate the arena ownership.
+// This experiment is purely for the purpose of gathering data. All code guarded
+// by this flag is supposed to be removed after this experiment.
+#define PROTOBUF_MESSAGE_OWNED_ARENA_EXPERIMENT
+#ifdef PROTOBUF_CONSTINIT
+#error PROTOBUF_CONSTINIT was previously defined
+#endif
+#if defined(__cpp_constinit) && !PROTOBUF_GNUC_MIN(3, 0) && !defined(_MSC_VER)
+// Our use of constinit does not yet work with GCC:
+// https://github.com/protocolbuffers/protobuf/issues/8310
+// Does not work yet with Visual Studio 2019 Update 16.10
+#define PROTOBUF_CONSTINIT constinit
+#elif !defined(_MSC_VER) && \
+    __has_cpp_attribute(clang::require_constant_initialization)
+#define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
+#else
+#define PROTOBUF_CONSTINIT
+#endif
+
+// Some globals with an empty non-trivial destructor are annotated with
+// no_destroy for performance reasons. It reduces the cost of these globals in
+// non-opt mode and under sanitizers.
+#ifdef PROTOBUF_ATTRIBUTE_NO_DESTROY
+#error PROTOBUF_ATTRIBUTE_NO_DESTROY was previously defined
+#endif
+#if __has_cpp_attribute(clang::no_destroy)
+#define PROTOBUF_ATTRIBUTE_NO_DESTROY [[clang::no_destroy]]
+#else
+#define PROTOBUF_ATTRIBUTE_NO_DESTROY
+#endif
+
+// Protobuf extensions and reflection require registration of the protos linked
+// in the binary. Not until everything is registered does the runtime have a
+// complete view on all protos. When code is using reflection or extensions
+// in between registration calls this can lead to surprising behavior. By
+// having the registration run first we mitigate this scenario.
+// Highest priority is 101. We use 102 to allow code that really wants to
+// higher priority to still beat us.
+#ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY
+#error PROTOBUF_ATTRIBUTE_INIT_PRIORITY was previously defined
+#endif
+#if PROTOBUF_GNUC_MIN(3, 0) && (!defined(__APPLE__) || defined(__clang__)) && !((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)))
+#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY __attribute__((init_priority((102))))
+#else
+#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY
+#endif
+
+#ifdef PROTOBUF_PRAGMA_INIT_SEG
+#error PROTOBUF_PRAGMA_INIT_SEG was previously defined
+#endif
+#if _MSC_VER
+#define PROTOBUF_PRAGMA_INIT_SEG __pragma(init_seg(lib))
+#else
+#define PROTOBUF_PRAGMA_INIT_SEG
+#endif
+
+#ifdef PROTOBUF_ATTRIBUTE_WEAK
+#error PROTOBUF_ATTRIBUTE_WEAK was previously defined
+#endif
+#if __has_attribute(weak) && \
+    !defined(__APPLE__) && \
+    (!defined(_WIN32) || __clang_major__ < 9) && \
+    !defined(__MINGW32__)
+#define PROTOBUF_ATTRIBUTE_WEAK __attribute__((weak))
+#define PROTOBUF_HAVE_ATTRIBUTE_WEAK 1
+#else
+#define PROTOBUF_ATTRIBUTE_WEAK
+#define PROTOBUF_HAVE_ATTRIBUTE_WEAK 0
+#endif
+
+// Macros to detect sanitizers.
+#ifdef PROTOBUF_ASAN
+#error PROTOBUF_ASAN was previously defined
+#endif
+#ifdef PROTOBUF_MSAN
+#error PROTOBUF_MSAN was previously defined
+#endif
+#ifdef PROTOBUF_TSAN
+#error PROTOBUF_TSAN was previously defined
+#endif
+#if defined(__clang__)
+#  if __has_feature(address_sanitizer)
+#    define PROTOBUF_ASAN 1
+#  endif
+#  if __has_feature(thread_sanitizer)
+#    define PROTOBUF_TSAN 1
+#  endif
+#  if __has_feature(memory_sanitizer)
+#    define PROTOBUF_MSAN 1
+#  endif
+#elif PROTOBUF_GNUC_MIN(3, 0)
+// Double-guard is needed for -Wundef:
+#  ifdef __SANITIZE_ADDRESS__
+#  if    __SANITIZE_ADDRESS__
+#    define PROTOBUF_ASAN 1
+#  endif
+#  endif
+#  ifdef __SANITIZE_THREAD__
+#  if    __SANITIZE_THREAD__
+#    define PROTOBUF_TSAN 1
+#  endif
+#  endif
+#endif
+
+// Tail call table-driven parsing can be enabled by defining
+// PROTOBUF_EXPERIMENTAL_USE_TAIL_CALL_TABLE_PARSER at compilation time. Note
+// that this macro is for small-scale testing only, and is not supported.
+#ifdef PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED
+#error PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED was previously declared
+#endif
+#if defined(PROTOBUF_EXPERIMENTAL_USE_TAIL_CALL_TABLE_PARSER)
+#define PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED 1
+// Selectively use static member functions instead of templates:
+#ifndef PROTOBUF_TC_STATIC_PARSE_SINGULAR1
+#  define PROTOBUF_TC_STATIC_PARSE_SINGULAR1 1
+#endif
+#ifndef PROTOBUF_TC_STATIC_PARSE_SINGULAR2
+#  define PROTOBUF_TC_STATIC_PARSE_SINGULAR2 0
+#endif
+#ifndef PROTOBUF_TC_STATIC_PARSE_REPEATED1
+#  define PROTOBUF_TC_STATIC_PARSE_REPEATED1 0
+#endif
+#ifndef PROTOBUF_TC_STATIC_PARSE_REPEATED2
+#  define PROTOBUF_TC_STATIC_PARSE_REPEATED2 0
+#endif
+#endif
+
+#define PROTOBUF_TC_PARAM_DECL                                 \
+  ::google::protobuf::MessageLite *msg, const char *ptr,                 \
+      ::google::protobuf::internal::ParseContext *ctx,                   \
+      const ::google::protobuf::internal::TcParseTableBase *table,       \
+      uint64_t hasbits, ::google::protobuf::internal::TcFieldData data
+
+#ifdef PROTOBUF_UNUSED
+#error PROTOBUF_UNUSED was previously defined
+#endif
+#if __has_cpp_attribute(maybe_unused) || \
+    (PROTOBUF_MSC_VER_MIN(1911) && PROTOBUF_CPLUSPLUS_MIN(201703L))
+#define PROTOBUF_UNUSED [[maybe_unused]]
+#elif __has_attribute(unused) || PROTOBUF_GNUC_MIN(3, 0)
+#define PROTOBUF_UNUSED __attribute__((__unused__))
+#else
+#define PROTOBUF_UNUSED
+#endif
+
+// Windows declares several inconvenient macro names.  We #undef them and then
+// restore them in port_undef.inc.
+#ifdef _MSC_VER
+#pragma push_macro("CREATE_NEW")
+#undef CREATE_NEW
+#pragma push_macro("DELETE")
+#undef DELETE
+#pragma push_macro("DOUBLE_CLICK")
+#undef DOUBLE_CLICK
+#pragma push_macro("ERROR")
+#undef ERROR
+#pragma push_macro("ERROR_BUSY")
+#undef ERROR_BUSY
+#pragma push_macro("ERROR_INSTALL_FAILED")
+#undef ERROR_INSTALL_FAILED
+#pragma push_macro("ERROR_NOT_FOUND")
+#undef ERROR_NOT_FOUND
+#pragma push_macro("GetMessage")
+#undef GetMessage
+#pragma push_macro("IGNORE")
+#undef IGNORE
+#pragma push_macro("IN")
+#undef IN
+#pragma push_macro("INPUT_KEYBOARD")
+#undef INPUT_KEYBOARD
+#pragma push_macro("NO_ERROR")
+#undef NO_ERROR
+#pragma push_macro("OUT")
+#undef OUT
+#pragma push_macro("OPTIONAL")
+#undef OPTIONAL
+#pragma push_macro("min")
+#undef min
+#pragma push_macro("max")
+#undef max
+#pragma push_macro("NEAR")
+#undef NEAR
+#pragma push_macro("NO_DATA")
+#undef NO_DATA
+#pragma push_macro("REASON_UNKNOWN")
+#undef REASON_UNKNOWN
+#pragma push_macro("SERVICE_DISABLED")
+#undef SERVICE_DISABLED
+#pragma push_macro("SEVERITY_ERROR")
+#undef SEVERITY_ERROR
+#pragma push_macro("STRICT")
+#undef STRICT
+#pragma push_macro("timezone")
+#undef timezone
+#endif  // _MSC_VER
+
+#if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER)
+// Don't let Objective-C Macros interfere with proto identifiers with the same
+// name.
+#pragma push_macro("DEBUG")
+#undef DEBUG
+#endif // defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER)
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+// TODO(gerbens) ideally we cleanup the code. But a cursory try shows many
+// violations. So let's ignore for now.
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#elif PROTOBUF_GNUC_MIN(3, 0)
+// GCC does not allow disabling diagnostics within an expression:
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60875, so we disable this one
+// globally even though it's only used for PROTOBUF_FIELD_OFFSET.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Winvalid-offsetof"
+#endif
+
+// Silence some MSVC warnings in all our code.
+#if _MSC_VER
+#pragma warning(push)
+// For non-trivial unions
+#pragma warning(disable : 4582)
+#pragma warning(disable : 4583)
+// For init_seg(lib)
+#pragma warning(disable : 4073)
+// To silence the fact that we will pop this push from another file
+#pragma warning(disable : 5031)
+// Conditional expression is constant
+#pragma warning(disable: 4127)
+// decimal digit terminates octal escape sequence
+#pragma warning(disable: 4125)
+#endif
+
+// We don't want code outside port_def doing complex testing, so
+// remove our portable condition test macros to nudge folks away from
+// using it themselves.
+#ifdef PROTOBUF_has_cpp_attribute_DEFINED_
+#  undef __has_cpp_attribute
+#  undef PROTOBUF_has_cpp_attribute_DEFINED_
+#endif
+#ifdef PROTOBUF_has_feature_DEFINED_
+#  undef __has_feature
+#  undef PROTOBUF_has_feature_DEFINED_
+#endif
+#ifdef PROTOBUF_has_warning_DEFINED_
+#  undef __has_warning
+#  undef PROTOBUF_has_warning_DEFINED_
+#endif
+#ifdef PROTOBUF_has_attribute_DEFINED_
+#  undef __has_attribute
+#  undef PROTOBUF_has_attribute_DEFINED_
+#endif
+#ifdef PROTOBUF_has_builtin_DEFINED_
+#  undef __has_builtin
+#  undef PROTOBUF_has_builtin_DEFINED_
+#endif
diff --git a/3rdparty/protobuf/src/google/protobuf/port_undef.inc b/3rdparty/protobuf/src/google/protobuf/port_undef.inc
new file mode 100644 (file)
index 0000000..579eb41
--- /dev/null
@@ -0,0 +1,145 @@
+// 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.
+
+// #undefs all macros defined in port_def.inc.  See comments in port_def.inc
+// for more info.
+
+#ifndef PROTOBUF_NAMESPACE
+#error "port_undef.inc must be included after port_def.inc"
+#endif
+#undef PROTOBUF_GNUC_MIN
+#undef PROTOBUF_MSC_VER_MIN
+#undef PROTOBUF_CPLUSPLUS_MIN
+#undef PROTOBUF_NAMESPACE
+#undef PROTOBUF_NAMESPACE_ID
+#undef PROTOBUF_ALWAYS_INLINE
+#undef PROTOBUF_NDEBUG_INLINE
+#undef PROTOBUF_MUSTTAIL
+#undef PROTOBUF_TAILCALL
+#undef PROTOBUF_COLD
+#undef PROTOBUF_NOINLINE
+#undef PROTOBUF_SECTION_VARIABLE
+#undef PROTOBUF_DEPRECATED
+#undef PROTOBUF_DEPRECATED_ENUM
+#undef PROTOBUF_DEPRECATED_MSG
+#undef PROTOBUF_FUNC_ALIGN
+#undef PROTOBUF_RETURNS_NONNULL
+#undef PROTOBUF_ATTRIBUTE_REINITIALIZES
+#undef PROTOBUF_RTTI
+#undef PROTOBUF_VERSION
+#undef PROTOBUF_VERSION_SUFFIX
+#undef PROTOBUF_FIELD_OFFSET
+#undef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
+#undef PROTOBUF_MIN_PROTOC_VERSION
+#undef PROTOBUF_PREDICT_TRUE
+#undef PROTOBUF_PREDICT_FALSE
+#undef PROTOBUF_FALLTHROUGH_INTENDED
+#undef PROTOBUF_EXPORT
+#undef PROTOC_EXPORT
+#undef PROTOBUF_NODISCARD
+#undef PROTOBUF_FORCE_COPY_IN_RELEASE
+#undef PROTOBUF_FORCE_COPY_IN_SWAP
+#undef PROTOBUF_FORCE_COPY_IN_MOVE
+#undef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+#undef PROTOBUF_NAMESPACE_OPEN
+#undef PROTOBUF_NAMESPACE_CLOSE
+#undef PROTOBUF_UNUSED
+#undef PROTOBUF_ASSUME
+#undef PROTOBUF_EXPORT_TEMPLATE_DECLARE
+#undef PROTOBUF_EXPORT_TEMPLATE_DEFINE
+#undef PROTOBUF_ALIGNAS
+#undef PROTOBUF_FINAL
+#undef PROTOBUF_THREAD_LOCAL
+#undef PROTOBUF_MESSAGE_OWNED_ARENA_EXPERIMENT
+#undef PROTOBUF_CONSTINIT
+#undef PROTOBUF_ATTRIBUTE_WEAK
+#undef PROTOBUF_HAVE_ATTRIBUTE_WEAK
+#undef PROTOBUF_ATTRIBUTE_NO_DESTROY
+#undef PROTOBUF_ATTRIBUTE_INIT_PRIORITY
+#undef PROTOBUF_PRAGMA_INIT_SEG
+#undef PROTOBUF_ASAN
+#undef PROTOBUF_MSAN
+#undef PROTOBUF_TSAN
+#undef PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED
+#undef PROTOBUF_TC_STATIC_PARSE_SINGULAR1
+#undef PROTOBUF_TC_STATIC_PARSE_SINGULAR2
+#undef PROTOBUF_TC_STATIC_PARSE_REPEATED1
+#undef PROTOBUF_TC_STATIC_PARSE_REPEATED2
+#undef PROTOBUF_TC_PARAM_DECL
+#undef PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED
+#undef PROTOBUF_LOCKS_EXCLUDED
+#undef PROTOBUF_NO_THREAD_SAFETY_ANALYSIS
+#undef PROTOBUF_GUARDED_BY
+
+#ifdef PROTOBUF_FUTURE_BREAKING_CHANGES
+#undef PROTOBUF_FUTURE_BREAKING_CHANGES
+#endif
+
+// Restore macro that may have been #undef'd in port_def.inc.
+#ifdef _MSC_VER
+#pragma pop_macro("CREATE_NEW")
+#pragma pop_macro("DELETE")
+#pragma pop_macro("DOUBLE_CLICK")
+#pragma pop_macro("ERROR")
+#pragma pop_macro("ERROR_BUSY")
+#pragma pop_macro("ERROR_INSTALL_FAILED")
+#pragma pop_macro("ERROR_NOT_FOUND")
+#pragma pop_macro("GetMessage")
+#pragma pop_macro("IGNORE")
+#pragma pop_macro("IN")
+#pragma pop_macro("INPUT_KEYBOARD")
+#pragma pop_macro("OUT")
+#pragma pop_macro("OPTIONAL")
+#pragma pop_macro("min")
+#pragma pop_macro("max")
+#pragma pop_macro("NEAR")
+#pragma pop_macro("NO_DATA")
+#pragma pop_macro("NO_ERROR")
+#pragma pop_macro("REASON_UNKNOWN")
+#pragma pop_macro("SERVICE_DISABLED")
+#pragma pop_macro("SEVERITY_ERROR")
+#pragma pop_macro("STRICT")
+#pragma pop_macro("timezone")
+#endif
+
+#if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER)
+#pragma pop_macro("DEBUG")
+#endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER)
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#elif defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
+
+// Pop the warning(push) from port_def.inc
+#if _MSC_VER
+#pragma warning(pop)
+#endif
index fcb9a43..498ab71 100644 (file)
 #define GOOGLE_PROTOBUF_REFLECTION_H__
 
 #include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
 
 #include <google/protobuf/message.h>
 #include <google/protobuf/generated_enum_util.h>
 
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace internal {
-template<typename T, typename Enable = void>
+template <typename T, typename Enable = void>
 struct RefTypeTraits;
 }  // namespace internal
 
-template<typename T>
+template <typename T>
 RepeatedFieldRef<T> Reflection::GetRepeatedFieldRef(
     const Message& message, const FieldDescriptor* field) const {
   return RepeatedFieldRef<T>(message, field);
 }
 
-template<typename T>
+template <typename T>
 MutableRepeatedFieldRef<T> Reflection::GetMutableRepeatedFieldRef(
     Message* message, const FieldDescriptor* field) const {
   return MutableRepeatedFieldRef<T>(message, field);
 }
 
 // RepeatedFieldRef definition for non-message types.
-template<typename T>
+template <typename T>
 class RepeatedFieldRef<
-    T, typename internal::enable_if<!internal::is_base_of<Message, T>::value>::type> {
+    T, typename std::enable_if<!std::is_base_of<Message, T>::value>::type> {
   typedef typename internal::RefTypeTraits<T>::iterator IteratorType;
   typedef typename internal::RefTypeTraits<T>::AccessorType AccessorType;
 
  public:
-  bool empty() const {
-    return accessor_->IsEmpty(data_);
-  }
-  int size() const {
-    return accessor_->Size(data_);
-  }
-  T Get(int index) const {
-    return accessor_->template Get<T>(data_, index);
-  }
+  bool empty() const { return accessor_->IsEmpty(data_); }
+  int size() const { return accessor_->Size(data_); }
+  T Get(int index) const { return accessor_->template Get<T>(data_, index); }
 
   typedef IteratorType iterator;
   typedef IteratorType const_iterator;
@@ -86,22 +83,16 @@ class RepeatedFieldRef<
   typedef int size_type;
   typedef ptrdiff_t difference_type;
 
-  iterator begin() const {
-    return iterator(data_, accessor_, true);
-  }
-  iterator end() const {
-    return iterator(data_, accessor_, false);
-  }
+  iterator begin() const { return iterator(data_, accessor_, true); }
+  iterator end() const { return iterator(data_, accessor_, false); }
 
  private:
   friend class Reflection;
-  RepeatedFieldRef(
-      const Message& message,
-      const FieldDescriptor* field) {
+  RepeatedFieldRef(const Message& message, const FieldDescriptor* field) {
     const Reflection* reflection = message.GetReflection();
-    data_ = reflection->RepeatedFieldData(
-        const_cast<Message*>(&message), field,
-        internal::RefTypeTraits<T>::cpp_type, NULL);
+    data_ = reflection->RepeatedFieldData(const_cast<Message*>(&message), field,
+                                          internal::RefTypeTraits<T>::cpp_type,
+                                          nullptr);
     accessor_ = reflection->RepeatedFieldAccessor(field);
   }
 
@@ -110,50 +101,38 @@ class RepeatedFieldRef<
 };
 
 // MutableRepeatedFieldRef definition for non-message types.
-template<typename T>
+template <typename T>
 class MutableRepeatedFieldRef<
-    T, typename internal::enable_if<!internal::is_base_of<Message, T>::value>::type> {
+    T, typename std::enable_if<!std::is_base_of<Message, T>::value>::type> {
   typedef typename internal::RefTypeTraits<T>::AccessorType AccessorType;
 
  public:
-  bool empty() const {
-    return accessor_->IsEmpty(data_);
-  }
-  int size() const {
-    return accessor_->Size(data_);
-  }
-  T Get(int index) const {
-    return accessor_->template Get<T>(data_, index);
-  }
+  bool empty() const { return accessor_->IsEmpty(data_); }
+  int size() const { return accessor_->Size(data_); }
+  T Get(int index) const { return accessor_->template Get<T>(data_, index); }
 
   void Set(int index, const T& value) const {
     accessor_->template Set<T>(data_, index, value);
   }
-  void Add(const T& value) const {
-    accessor_->template Add<T>(data_, value);
-  }
-  void RemoveLast() const {
-    accessor_->RemoveLast(data_);
-  }
+  void Add(const T& value) const { accessor_->template Add<T>(data_, value); }
+  void RemoveLast() const { accessor_->RemoveLast(data_); }
   void SwapElements(int index1, int index2) const {
     accessor_->SwapElements(data_, index1, index2);
   }
-  void Clear() const {
-    accessor_->Clear(data_);
-  }
+  void Clear() const { accessor_->Clear(data_); }
 
   void Swap(const MutableRepeatedFieldRef& other) const {
     accessor_->Swap(data_, other.accessor_, other.data_);
   }
 
-  template<typename Container>
+  template <typename Container>
   void MergeFrom(const Container& container) const {
     typedef typename Container::const_iterator Iterator;
     for (Iterator it = container.begin(); it != container.end(); ++it) {
       Add(*it);
     }
   }
-  template<typename Container>
+  template <typename Container>
   void CopyFrom(const Container& container) const {
     Clear();
     MergeFrom(container);
@@ -161,12 +140,10 @@ class MutableRepeatedFieldRef<
 
  private:
   friend class Reflection;
-  MutableRepeatedFieldRef(
-      Message* message,
-      const FieldDescriptor* field) {
+  MutableRepeatedFieldRef(Message* message, const FieldDescriptor* field) {
     const Reflection* reflection = message->GetReflection();
     data_ = reflection->RepeatedFieldData(
-        message, field, internal::RefTypeTraits<T>::cpp_type, NULL);
+        message, field, internal::RefTypeTraits<T>::cpp_type, nullptr);
     accessor_ = reflection->RepeatedFieldAccessor(field);
   }
 
@@ -175,19 +152,15 @@ class MutableRepeatedFieldRef<
 };
 
 // RepeatedFieldRef definition for message types.
-template<typename T>
+template <typename T>
 class RepeatedFieldRef<
-    T, typename internal::enable_if<internal::is_base_of<Message, T>::value>::type> {
+    T, typename std::enable_if<std::is_base_of<Message, T>::value>::type> {
   typedef typename internal::RefTypeTraits<T>::iterator IteratorType;
   typedef typename internal::RefTypeTraits<T>::AccessorType AccessorType;
 
  public:
-  bool empty() const {
-    return accessor_->IsEmpty(data_);
-  }
-  int size() const {
-    return accessor_->Size(data_);
-  }
+  bool empty() const { return accessor_->IsEmpty(data_); }
+  int size() const { return accessor_->Size(data_); }
   // This method returns a reference to the underlying message object if it
   // exists. If a message object doesn't exist (e.g., data stored in serialized
   // form), scratch_space will be filled with the data and a reference to it
@@ -202,9 +175,7 @@ class RepeatedFieldRef<
   }
   // Create a new message of the same type as the messages stored in this
   // repeated field. Caller takes ownership of the returned object.
-  T* NewMessage() const {
-    return static_cast<T*>(default_instance_->New());
-  }
+  T* NewMessage() const { return static_cast<T*>(default_instance_->New()); }
 
   typedef IteratorType iterator;
   typedef IteratorType const_iterator;
@@ -219,14 +190,12 @@ class RepeatedFieldRef<
   }
   iterator end() const {
     // The end iterator must not be dereferenced, no need for scratch space.
-    return iterator(data_, accessor_, false, NULL);
+    return iterator(data_, accessor_, false, nullptr);
   }
 
  private:
   friend class Reflection;
-  RepeatedFieldRef(
-      const Message& message,
-      const FieldDescriptor* field) {
+  RepeatedFieldRef(const Message& message, const FieldDescriptor* field) {
     const Reflection* reflection = message.GetReflection();
     data_ = reflection->RepeatedFieldData(
         const_cast<Message*>(&message), field,
@@ -243,56 +212,44 @@ class RepeatedFieldRef<
 };
 
 // MutableRepeatedFieldRef definition for message types.
-template<typename T>
+template <typename T>
 class MutableRepeatedFieldRef<
-    T, typename internal::enable_if<internal::is_base_of<Message, T>::value>::type> {
+    T, typename std::enable_if<std::is_base_of<Message, T>::value>::type> {
   typedef typename internal::RefTypeTraits<T>::AccessorType AccessorType;
 
  public:
-  bool empty() const {
-    return accessor_->IsEmpty(data_);
-  }
-  int size() const {
-    return accessor_->Size(data_);
-  }
+  bool empty() const { return accessor_->IsEmpty(data_); }
+  int size() const { return accessor_->Size(data_); }
   // See comments for RepeatedFieldRef<Message>::Get()
   const T& Get(int index, T* scratch_space) const {
     return *static_cast<const T*>(accessor_->Get(data_, index, scratch_space));
   }
   // Create a new message of the same type as the messages stored in this
   // repeated field. Caller takes ownership of the returned object.
-  T* NewMessage() const {
-    return static_cast<T*>(default_instance_->New());
-  }
+  T* NewMessage() const { return static_cast<T*>(default_instance_->New()); }
 
   void Set(int index, const T& value) const {
     accessor_->Set(data_, index, &value);
   }
-  void Add(const T& value) const {
-    accessor_->Add(data_, &value);
-  }
-  void RemoveLast() const {
-    accessor_->RemoveLast(data_);
-  }
+  void Add(const T& value) const { accessor_->Add(data_, &value); }
+  void RemoveLast() const { accessor_->RemoveLast(data_); }
   void SwapElements(int index1, int index2) const {
     accessor_->SwapElements(data_, index1, index2);
   }
-  void Clear() const {
-    accessor_->Clear(data_);
-  }
+  void Clear() const { accessor_->Clear(data_); }
 
   void Swap(const MutableRepeatedFieldRef& other) const {
     accessor_->Swap(data_, other.accessor_, other.data_);
   }
 
-  template<typename Container>
+  template <typename Container>
   void MergeFrom(const Container& container) const {
     typedef typename Container::const_iterator Iterator;
     for (Iterator it = container.begin(); it != container.end(); ++it) {
       Add(*it);
     }
   }
-  template<typename Container>
+  template <typename Container>
   void CopyFrom(const Container& container) const {
     Clear();
     MergeFrom(container);
@@ -300,9 +257,7 @@ class MutableRepeatedFieldRef<
 
  private:
   friend class Reflection;
-  MutableRepeatedFieldRef(
-      Message* message,
-      const FieldDescriptor* field) {
+  MutableRepeatedFieldRef(Message* message, const FieldDescriptor* field) {
     const Reflection* reflection = message->GetReflection();
     data_ = reflection->RepeatedFieldData(
         message, field, internal::RefTypeTraits<T>::cpp_type,
@@ -327,30 +282,29 @@ namespace internal {
 // cpp_type to the type that should be used in this interface:
 //
 //   field->cpp_type()      T                Actual type of void*
-//   CPPTYPE_INT32        int32                   int32
-//   CPPTYPE_UINT32       uint32                  uint32
-//   CPPTYPE_INT64        int64                   int64
-//   CPPTYPE_UINT64       uint64                  uint64
+//   CPPTYPE_INT32        int32_t                 int32_t
+//   CPPTYPE_UINT32       uint32_t                uint32_t
+//   CPPTYPE_INT64        int64_t                 int64_t
+//   CPPTYPE_UINT64       uint64_t                uint64_t
 //   CPPTYPE_DOUBLE       double                  double
 //   CPPTYPE_FLOAT        float                   float
 //   CPPTYPE_BOOL         bool                    bool
-//   CPPTYPE_ENUM         generated enum type     int32
-//   CPPTYPE_STRING       string                  string
+//   CPPTYPE_ENUM         generated enum type     int32_t
+//   CPPTYPE_STRING       string                  std::string
 //   CPPTYPE_MESSAGE      generated message type  google::protobuf::Message
 //                        or google::protobuf::Message
 //
-// Note that for enums we use int32 in the interface.
+// Note that for enums we use int32_t in the interface.
 //
 // You can map from T to the actual type using RefTypeTraits:
 //   typedef RefTypeTraits<T>::AccessorValueType ActualType;
-class LIBPROTOBUF_EXPORT RepeatedFieldAccessor {
+class PROTOBUF_EXPORT RepeatedFieldAccessor {
  public:
   // Typedefs for clarity.
   typedef void Field;
   typedef void Value;
   typedef void Iterator;
 
-  virtual ~RepeatedFieldAccessor();
   virtual bool IsEmpty(const Field* data) const = 0;
   virtual int Size(const Field* data) const = 0;
   // Depends on the underlying representation of the repeated field, this
@@ -358,8 +312,8 @@ class LIBPROTOBUF_EXPORT RepeatedFieldAccessor {
   // exists, or fill the data into scratch_space and return scratch_space.
   // Callers of this method must ensure scratch_space is a valid pointer
   // to a mutable object of the correct type.
-  virtual const Value* Get(
-      const Field* data, int index, Value* scratch_space) const = 0;
+  virtual const Value* Get(const Field* data, int index,
+                           Value* scratch_space) const = 0;
 
   virtual void Clear(Field* data) const = 0;
   virtual void Set(Field* data, int index, const Value* value) const = 0;
@@ -392,16 +346,15 @@ class LIBPROTOBUF_EXPORT RepeatedFieldAccessor {
 
   // Templated methods that make using this interface easier for non-message
   // types.
-  template<typename T>
+  template <typename T>
   T Get(const Field* data, int index) const {
     typedef typename RefTypeTraits<T>::AccessorValueType ActualType;
     ActualType scratch_space;
-    return static_cast<T>(
-        *reinterpret_cast<const ActualType*>(
-            Get(data, index, static_cast<Value*>(&scratch_space))));
+    return static_cast<T>(*reinterpret_cast<const ActualType*>(
+        Get(data, index, static_cast<Value*>(&scratch_space))));
   }
 
-  template<typename T, typename ValueType>
+  template <typename T, typename ValueType>
   void Set(Field* data, int index, const ValueType& value) const {
     typedef typename RefTypeTraits<T>::AccessorValueType ActualType;
     // In this RepeatedFieldAccessor interface we pass/return data using
@@ -409,13 +362,13 @@ class LIBPROTOBUF_EXPORT RepeatedFieldAccessor {
     // be ActualType. Here we have a ValueType object and want a ActualType
     // pointer. We can't cast a ValueType pointer to an ActualType pointer
     // directly because their type might be different (for enums ValueType
-    // may be a generated enum type while ActualType is int32). To be safe
+    // may be a generated enum type while ActualType is int32_t). To be safe
     // we make a copy to get a temporary ActualType object and use it.
     ActualType tmp = static_cast<ActualType>(value);
     Set(data, index, static_cast<const Value*>(&tmp));
   }
 
-  template<typename T, typename ValueType>
+  template <typename T, typename ValueType>
   void Add(Field* data, const ValueType& value) const {
     typedef typename RefTypeTraits<T>::AccessorValueType ActualType;
     // In this RepeatedFieldAccessor interface we pass/return data using
@@ -423,22 +376,34 @@ class LIBPROTOBUF_EXPORT RepeatedFieldAccessor {
     // be ActualType. Here we have a ValueType object and want a ActualType
     // pointer. We can't cast a ValueType pointer to an ActualType pointer
     // directly because their type might be different (for enums ValueType
-    // may be a generated enum type while ActualType is int32). To be safe
+    // may be a generated enum type while ActualType is int32_t). To be safe
     // we make a copy to get a temporary ActualType object and use it.
     ActualType tmp = static_cast<ActualType>(value);
     Add(data, static_cast<const Value*>(&tmp));
   }
+
+ protected:
+  // We want the destructor to be completely trivial as to allow it to be
+  // a function local static. Hence we make it non-virtual and protected,
+  // this class only live as part of a global singleton and should not be
+  // deleted.
+  ~RepeatedFieldAccessor() = default;
 };
 
 // Implement (Mutable)RepeatedFieldRef::iterator
-template<typename T>
-class RepeatedFieldRefIterator
-    : public std::iterator<std::forward_iterator_tag, T> {
+template <typename T>
+class RepeatedFieldRefIterator {
   typedef typename RefTypeTraits<T>::AccessorValueType AccessorValueType;
   typedef typename RefTypeTraits<T>::IteratorValueType IteratorValueType;
   typedef typename RefTypeTraits<T>::IteratorPointerType IteratorPointerType;
 
  public:
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = T;
+  using pointer = T*;
+  using reference = T&;
+  using difference_type = std::ptrdiff_t;
+
   // Constructor for non-message fields.
   RepeatedFieldRefIterator(const void* data,
                            const RepeatedFieldAccessor* accessor, bool begin)
@@ -447,20 +412,17 @@ class RepeatedFieldRefIterator
         iterator_(begin ? accessor->BeginIterator(data)
                         : accessor->EndIterator(data)),
         // The end iterator must not be dereferenced, no need for scratch space.
-        scratch_space_(begin ? new AccessorValueType : NULL) {}
+        scratch_space_(begin ? new AccessorValueType : nullptr) {}
   // Constructor for message fields.
   RepeatedFieldRefIterator(const void* data,
-                           const RepeatedFieldAccessor* accessor,
-                           bool begin,
+                           const RepeatedFieldAccessor* accessor, bool begin,
                            AccessorValueType* scratch_space)
-      : data_(data), accessor_(accessor),
-        iterator_(begin ? accessor->BeginIterator(data) :
-                          accessor->EndIterator(data)),
-        scratch_space_(scratch_space) {
-  }
-  ~RepeatedFieldRefIterator() {
-    accessor_->DeleteIterator(data_, iterator_);
-  }
+      : data_(data),
+        accessor_(accessor),
+        iterator_(begin ? accessor->BeginIterator(data)
+                        : accessor->EndIterator(data)),
+        scratch_space_(scratch_space) {}
+  ~RepeatedFieldRefIterator() { accessor_->DeleteIterator(data_, iterator_); }
   RepeatedFieldRefIterator operator++(int) {
     RepeatedFieldRefIterator tmp(*this);
     iterator_ = accessor_->AdvanceIterator(data_, iterator_);
@@ -472,14 +434,12 @@ class RepeatedFieldRefIterator
   }
   IteratorValueType operator*() const {
     return static_cast<IteratorValueType>(
-        *static_cast<const AccessorValueType*>(
-            accessor_->GetIteratorValue(
-                data_, iterator_, scratch_space_.get())));
+        *static_cast<const AccessorValueType*>(accessor_->GetIteratorValue(
+            data_, iterator_, scratch_space_.get())));
   }
   IteratorPointerType operator->() const {
     return static_cast<IteratorPointerType>(
-        accessor_->GetIteratorValue(
-            data_, iterator_, scratch_space_.get()));
+        accessor_->GetIteratorValue(data_, iterator_, scratch_space_.get()));
   }
   bool operator!=(const RepeatedFieldRefIterator& other) const {
     assert(data_ == other.data_);
@@ -491,9 +451,9 @@ class RepeatedFieldRefIterator
   }
 
   RepeatedFieldRefIterator(const RepeatedFieldRefIterator& other)
-      : data_(other.data_), accessor_(other.accessor_),
-        iterator_(accessor_->CopyIterator(data_, other.iterator_)) {
-  }
+      : data_(other.data_),
+        accessor_(other.accessor_),
+        iterator_(accessor_->CopyIterator(data_, other.iterator_)) {}
   RepeatedFieldRefIterator& operator=(const RepeatedFieldRefIterator& other) {
     if (this != &other) {
       accessor_->DeleteIterator(data_, iterator_);
@@ -508,99 +468,92 @@ class RepeatedFieldRefIterator
   const void* data_;
   const RepeatedFieldAccessor* accessor_;
   void* iterator_;
-  google::protobuf::scoped_ptr<AccessorValueType> scratch_space_;
+  std::unique_ptr<AccessorValueType> scratch_space_;
 };
 
 // TypeTraits that maps the type parameter T of RepeatedFieldRef or
 // MutableRepeatedFieldRef to corresponding iterator type,
 // RepeatedFieldAccessor type, etc.
-template<typename T>
+template <typename T>
 struct PrimitiveTraits {
-  static const bool is_primitive = false;
+  static constexpr bool is_primitive = false;
 };
-#define DEFINE_PRIMITIVE(TYPE, type) \
-    template<> struct PrimitiveTraits<type> { \
-      static const bool is_primitive = true; \
-      static const FieldDescriptor::CppType cpp_type = \
-          FieldDescriptor::CPPTYPE_ ## TYPE; \
-    };
-DEFINE_PRIMITIVE(INT32, int32)
-DEFINE_PRIMITIVE(UINT32, uint32)
-DEFINE_PRIMITIVE(INT64, int64)
-DEFINE_PRIMITIVE(UINT64, uint64)
+#define DEFINE_PRIMITIVE(TYPE, type)                 \
+  template <>                                        \
+  struct PrimitiveTraits<type> {                     \
+    static const bool is_primitive = true;           \
+    static const FieldDescriptor::CppType cpp_type = \
+        FieldDescriptor::CPPTYPE_##TYPE;             \
+  };
+DEFINE_PRIMITIVE(INT32, int32_t)
+DEFINE_PRIMITIVE(UINT32, uint32_t)
+DEFINE_PRIMITIVE(INT64, int64_t)
+DEFINE_PRIMITIVE(UINT64, uint64_t)
 DEFINE_PRIMITIVE(FLOAT, float)
 DEFINE_PRIMITIVE(DOUBLE, double)
 DEFINE_PRIMITIVE(BOOL, bool)
 #undef DEFINE_PRIMITIVE
 
-template<typename T>
+template <typename T>
 struct RefTypeTraits<
-    T, typename internal::enable_if<PrimitiveTraits<T>::is_primitive>::type> {
+    T, typename std::enable_if<PrimitiveTraits<T>::is_primitive>::type> {
   typedef RepeatedFieldRefIterator<T> iterator;
   typedef RepeatedFieldAccessor AccessorType;
   typedef T AccessorValueType;
   typedef T IteratorValueType;
   typedef T* IteratorPointerType;
-  static const FieldDescriptor::CppType cpp_type =
+  static constexpr FieldDescriptor::CppType cpp_type =
       PrimitiveTraits<T>::cpp_type;
-  static const Descriptor* GetMessageFieldDescriptor() {
-    return NULL;
-  }
+  static const Descriptor* GetMessageFieldDescriptor() { return nullptr; }
 };
 
-template<typename T>
+template <typename T>
 struct RefTypeTraits<
-    T, typename internal::enable_if<is_proto_enum<T>::value>::type> {
+    T, typename std::enable_if<is_proto_enum<T>::value>::type> {
   typedef RepeatedFieldRefIterator<T> iterator;
   typedef RepeatedFieldAccessor AccessorType;
-  // We use int32 for repeated enums in RepeatedFieldAccessor.
-  typedef int32 AccessorValueType;
+  // We use int32_t for repeated enums in RepeatedFieldAccessor.
+  typedef int32_t AccessorValueType;
   typedef T IteratorValueType;
-  typedef int32* IteratorPointerType;
-  static const FieldDescriptor::CppType cpp_type =
+  typedef int32_t* IteratorPointerType;
+  static constexpr FieldDescriptor::CppType cpp_type =
       FieldDescriptor::CPPTYPE_ENUM;
-  static const Descriptor* GetMessageFieldDescriptor() {
-    return NULL;
-  }
+  static const Descriptor* GetMessageFieldDescriptor() { return nullptr; }
 };
 
-template<typename T>
+template <typename T>
 struct RefTypeTraits<
-    T, typename internal::enable_if< ::google::protobuf::internal::is_same<string, T>::value>::type> {
+    T, typename std::enable_if<std::is_same<std::string, T>::value>::type> {
   typedef RepeatedFieldRefIterator<T> iterator;
   typedef RepeatedFieldAccessor AccessorType;
-  typedef string AccessorValueType;
-  typedef const string IteratorValueType;
-  typedef const string* IteratorPointerType;
-  static const FieldDescriptor::CppType cpp_type =
+  typedef std::string AccessorValueType;
+  typedef const std::string IteratorValueType;
+  typedef const std::string* IteratorPointerType;
+  static constexpr FieldDescriptor::CppType cpp_type =
       FieldDescriptor::CPPTYPE_STRING;
-  static const Descriptor* GetMessageFieldDescriptor() {
-    return NULL;
-  }
+  static const Descriptor* GetMessageFieldDescriptor() { return nullptr; }
 };
 
-template<typename T>
+template <typename T>
 struct MessageDescriptorGetter {
   static const Descriptor* get() {
     return T::default_instance().GetDescriptor();
   }
 };
-template<>
+template <>
 struct MessageDescriptorGetter<Message> {
-  static const Descriptor* get() {
-    return NULL;
-  }
+  static const Descriptor* get() { return nullptr; }
 };
 
-template<typename T>
+template <typename T>
 struct RefTypeTraits<
-    T, typename internal::enable_if<internal::is_base_of<Message, T>::value>::type> {
+    T, typename std::enable_if<std::is_base_of<Message, T>::value>::type> {
   typedef RepeatedFieldRefIterator<T> iterator;
   typedef RepeatedFieldAccessor AccessorType;
   typedef Message AccessorValueType;
   typedef const T& IteratorValueType;
   typedef const T* IteratorPointerType;
-  static const FieldDescriptor::CppType cpp_type =
+  static constexpr FieldDescriptor::CppType cpp_type =
       FieldDescriptor::CPPTYPE_MESSAGE;
   static const Descriptor* GetMessageFieldDescriptor() {
     return MessageDescriptorGetter<T>::get();
@@ -610,4 +563,6 @@ struct RefTypeTraits<
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_REFLECTION_H__
index fcb4247..f749c3e 100644 (file)
@@ -43,36 +43,35 @@ namespace internal {
 // corresponding random-access methods.
 class RandomAccessRepeatedFieldAccessor : public RepeatedFieldAccessor {
  public:
-  virtual ~RandomAccessRepeatedFieldAccessor() {}
-
-  virtual Iterator* BeginIterator(const Field* data) const {
+  Iterator* BeginIterator(const Field* /*data*/) const override {
     return PositionToIterator(0);
   }
-  virtual Iterator* EndIterator(const Field* data) const {
+  Iterator* EndIterator(const Field* data) const override {
     return PositionToIterator(this->Size(data));
   }
-  virtual Iterator* CopyIterator(const Field* data,
-                                 const Iterator* iterator) const {
+  Iterator* CopyIterator(const Field* /*data*/,
+                         const Iterator* iterator) const override {
     return const_cast<Iterator*>(iterator);
   }
-  virtual Iterator* AdvanceIterator(const Field* data,
-                                    Iterator* iterator) const {
+  Iterator* AdvanceIterator(const Field* /*data*/,
+                            Iterator* iterator) const override {
     return PositionToIterator(IteratorToPosition(iterator) + 1);
   }
-  virtual bool EqualsIterator(const Field* data,
-                              const Iterator* a,
-                              const Iterator* b) const {
+  bool EqualsIterator(const Field* /*data*/, const Iterator* a,
+                      const Iterator* b) const override {
     return a == b;
   }
-  virtual void DeleteIterator(const Field* data, Iterator* iterator) const {
-  }
-  virtual const Value* GetIteratorValue(const Field* data,
-                                        const Iterator* iterator,
-                                        Value* scratch_space) const {
+  void DeleteIterator(const Field* /*data*/,
+                      Iterator* /*iterator*/) const override {}
+  const Value* GetIteratorValue(const Field* data, const Iterator* iterator,
+                                Value* scratch_space) const override {
     return Get(data, static_cast<int>(IteratorToPosition(iterator)),
                scratch_space);
   }
 
+ protected:
+  ~RandomAccessRepeatedFieldAccessor() = default;
+
  private:
   static intptr_t IteratorToPosition(const Iterator* iterator) {
     return reinterpret_cast<intptr_t>(iterator);
@@ -84,38 +83,38 @@ class RandomAccessRepeatedFieldAccessor : public RepeatedFieldAccessor {
 
 // Base class for RepeatedFieldAccessor implementations that manipulates
 // RepeatedField<T>.
-template<typename T>
+template <typename T>
 class RepeatedFieldWrapper : public RandomAccessRepeatedFieldAccessor {
  public:
   RepeatedFieldWrapper() {}
-  virtual ~RepeatedFieldWrapper() {}
-  virtual bool IsEmpty(const Field* data) const {
+  bool IsEmpty(const Field* data) const override {
     return GetRepeatedField(data)->empty();
   }
-  virtual int Size(const Field* data) const {
+  int Size(const Field* data) const override {
     return GetRepeatedField(data)->size();
   }
-  virtual const Value* Get(const Field* data, int index,
-                          Value* scratch_space) const {
+  const Value* Get(const Field* data, int index,
+                   Value* scratch_space) const override {
     return ConvertFromT(GetRepeatedField(data)->Get(index), scratch_space);
   }
-  virtual void Clear(Field* data) const {
+  void Clear(Field* data) const override {
     MutableRepeatedField(data)->Clear();
   }
-  virtual void Set(Field* data, int index, const Value* value) const {
+  void Set(Field* data, int index, const Value* value) const override {
     MutableRepeatedField(data)->Set(index, ConvertToT(value));
   }
-  virtual void Add(Field* data, const Value* value) const {
+  void Add(Field* data, const Value* value) const override {
     MutableRepeatedField(data)->Add(ConvertToT(value));
   }
-  virtual void RemoveLast(Field* data) const {
+  void RemoveLast(Field* data) const override {
     MutableRepeatedField(data)->RemoveLast();
   }
-  virtual void SwapElements(Field* data, int index1, int index2) const {
+  void SwapElements(Field* data, int index1, int index2) const override {
     MutableRepeatedField(data)->SwapElements(index1, index2);
   }
 
  protected:
+  ~RepeatedFieldWrapper() = default;
   typedef RepeatedField<T> RepeatedFieldType;
   static const RepeatedFieldType* GetRepeatedField(const Field* data) {
     return reinterpret_cast<const RepeatedFieldType*>(data);
@@ -124,14 +123,14 @@ class RepeatedFieldWrapper : public RandomAccessRepeatedFieldAccessor {
     return reinterpret_cast<RepeatedFieldType*>(data);
   }
 
-  // Convert an object recevied by this accessor to an object to be stored in
+  // Convert an object received by this accessor to an object to be stored in
   // the underlying RepeatedField.
   virtual T ConvertToT(const Value* value) const = 0;
 
   // Convert an object stored in RepeatedPtrField to an object that will be
-  // returned by this accessor. If the two objects have the same type (true
-  // for string fields with ctype=STRING), a pointer to the source object can
-  // be returned directly. Otherwise, data should be copied from value to
+  // returned by this accessor. If the two objects have the same type (true for
+  // string fields with ctype=STRING), a pointer to the source object can be
+  // returned directly. Otherwise, data should be copied from value to
   // scratch_space and scratch_space should be returned.
   virtual const Value* ConvertFromT(const T& value,
                                     Value* scratch_space) const = 0;
@@ -139,40 +138,39 @@ class RepeatedFieldWrapper : public RandomAccessRepeatedFieldAccessor {
 
 // Base class for RepeatedFieldAccessor implementations that manipulates
 // RepeatedPtrField<T>.
-template<typename T>
+template <typename T>
 class RepeatedPtrFieldWrapper : public RandomAccessRepeatedFieldAccessor {
  public:
-  RepeatedPtrFieldWrapper() {}
-  virtual ~RepeatedPtrFieldWrapper() {}
-  virtual bool IsEmpty(const Field* data) const {
+  bool IsEmpty(const Field* data) const override {
     return GetRepeatedField(data)->empty();
   }
-  virtual int Size(const Field* data) const {
+  int Size(const Field* data) const override {
     return GetRepeatedField(data)->size();
   }
-  virtual const Value* Get(const Field* data, int index,
-                           Value* scratch_space) const {
+  const Value* Get(const Field* data, int index,
+                   Value* scratch_space) const override {
     return ConvertFromT(GetRepeatedField(data)->Get(index), scratch_space);
   }
-  virtual void Clear(Field* data) const {
+  void Clear(Field* data) const override {
     MutableRepeatedField(data)->Clear();
   }
-  virtual void Set(Field* data, int index, const Value* value) const {
+  void Set(Field* data, int index, const Value* value) const override {
     ConvertToT(value, MutableRepeatedField(data)->Mutable(index));
   }
-  virtual void Add(Field* data, const Value* value) const {
+  void Add(Field* data, const Value* value) const override {
     T* allocated = New(value);
     ConvertToT(value, allocated);
     MutableRepeatedField(data)->AddAllocated(allocated);
   }
-  virtual void RemoveLast(Field* data) const {
+  void RemoveLast(Field* data) const override {
     MutableRepeatedField(data)->RemoveLast();
   }
-  virtual void SwapElements(Field* data, int index1, int index2) const {
+  void SwapElements(Field* data, int index1, int index2) const override {
     MutableRepeatedField(data)->SwapElements(index1, index2);
   }
 
  protected:
+  ~RepeatedPtrFieldWrapper() = default;
   typedef RepeatedPtrField<T> RepeatedFieldType;
   static const RepeatedFieldType* GetRepeatedField(const Field* data) {
     return reinterpret_cast<const RepeatedFieldType*>(data);
@@ -192,9 +190,9 @@ class RepeatedPtrFieldWrapper : public RandomAccessRepeatedFieldAccessor {
   virtual void ConvertToT(const Value* value, T* result) const = 0;
 
   // Convert an object stored in RepeatedPtrField to an object that will be
-  // returned by this accessor. If the two objects have the same type (true
-  // for string fields with ctype=STRING), a pointer to the source object can
-  // be returned directly. Otherwise, data should be copied from value to
+  // returned by this accessor. If the two objects have the same type (true for
+  // string fields with ctype=STRING), a pointer to the source object can be
+  // returned directly. Otherwise, data should be copied from value to
   // scratch_space and scratch_space should be returned.
   virtual const Value* ConvertFromT(const T& value,
                                     Value* scratch_space) const = 0;
@@ -202,41 +200,39 @@ class RepeatedPtrFieldWrapper : public RandomAccessRepeatedFieldAccessor {
 
 // An implementation of RandomAccessRepeatedFieldAccessor that manipulates
 // MapFieldBase.
-class MapFieldAccessor : public RandomAccessRepeatedFieldAccessor {
+class MapFieldAccessor final : public RandomAccessRepeatedFieldAccessor {
  public:
   MapFieldAccessor() {}
   virtual ~MapFieldAccessor() {}
-  virtual bool IsEmpty(const Field* data) const {
+  bool IsEmpty(const Field* data) const override {
     return GetRepeatedField(data)->empty();
   }
-  virtual int Size(const Field* data) const {
+  int Size(const Field* data) const override {
     return GetRepeatedField(data)->size();
   }
-  virtual const Value* Get(const Field* data, int index,
-                           Value* scratch_space) const {
+  const Value* Get(const Field* data, int index,
+                   Value* scratch_space) const override {
     return ConvertFromEntry(GetRepeatedField(data)->Get(index), scratch_space);
   }
-  virtual void Clear(Field* data) const {
+  void Clear(Field* data) const override {
     MutableRepeatedField(data)->Clear();
   }
-  virtual void Set(Field* data, int index, const Value* value) const {
+  void Set(Field* data, int index, const Value* value) const override {
     ConvertToEntry(value, MutableRepeatedField(data)->Mutable(index));
   }
-  virtual void Add(Field* data, const Value* value) const {
+  void Add(Field* data, const Value* value) const override {
     Message* allocated = New(value);
     ConvertToEntry(value, allocated);
     MutableRepeatedField(data)->AddAllocated(allocated);
   }
-  virtual void RemoveLast(Field* data) const {
+  void RemoveLast(Field* data) const override {
     MutableRepeatedField(data)->RemoveLast();
   }
-  virtual void SwapElements(Field* data, int index1, int index2) const {
+  void SwapElements(Field* data, int index1, int index2) const override {
     MutableRepeatedField(data)->SwapElements(index1, index2);
   }
-  virtual void Swap(
-      Field* data,
-      const internal::RepeatedFieldAccessor* other_mutator,
-      Field* other_data) const {
+  void Swap(Field* data, const internal::RepeatedFieldAccessor* other_mutator,
+            Field* other_data) const override {
     GOOGLE_CHECK(this == other_mutator);
     MutableRepeatedField(data)->Swap(MutableRepeatedField(other_data));
   }
@@ -262,25 +258,22 @@ class MapFieldAccessor : public RandomAccessRepeatedFieldAccessor {
   // Convert a MapEntry message stored in the underlying MapFieldBase to an
   // object that will be returned by this accessor.
   virtual const Value* ConvertFromEntry(const Message& value,
-                                        Value* scratch_space) const {
+                                        Value* /*scratch_space*/) const {
     return static_cast<const Value*>(&value);
   }
 };
 
 // Default implementations of RepeatedFieldAccessor for primitive types.
-template<typename T>
-class RepeatedFieldPrimitiveAccessor : public RepeatedFieldWrapper<T> {
+template <typename T>
+class RepeatedFieldPrimitiveAccessor final : public RepeatedFieldWrapper<T> {
   typedef void Field;
   typedef void Value;
   using RepeatedFieldWrapper<T>::MutableRepeatedField;
 
  public:
   RepeatedFieldPrimitiveAccessor() {}
-  virtual ~RepeatedFieldPrimitiveAccessor() {}
-  virtual void Swap(
-      Field* data,
-      const internal::RepeatedFieldAccessor* other_mutator,
-      Field* other_data) const {
+  void Swap(Field* data, const internal::RepeatedFieldAccessor* other_mutator,
+            Field* other_data) const override {
     // Currently RepeatedFieldPrimitiveAccessor is the only implementation of
     // RepeatedFieldAccessor for primitive types. As we are using singletons
     // for these accessors, here "other_mutator" must be "this".
@@ -289,90 +282,83 @@ class RepeatedFieldPrimitiveAccessor : public RepeatedFieldWrapper<T> {
   }
 
  protected:
-  virtual T ConvertToT(const Value* value) const {
+  T ConvertToT(const Value* value) const override {
     return *static_cast<const T*>(value);
   }
-  virtual const Value* ConvertFromT(const T& value,
-                                    Value* scratch_space) const {
+  const Value* ConvertFromT(const T& value,
+                            Value* /*scratch_space*/) const override {
     return static_cast<const Value*>(&value);
   }
 };
 
 // Default implementation of RepeatedFieldAccessor for string fields with
 // ctype=STRING.
-class RepeatedPtrFieldStringAccessor : public RepeatedPtrFieldWrapper<string> {
+class RepeatedPtrFieldStringAccessor final
+    : public RepeatedPtrFieldWrapper<std::string> {
   typedef void Field;
   typedef void Value;
   using RepeatedFieldAccessor::Add;
 
  public:
   RepeatedPtrFieldStringAccessor() {}
-  virtual ~RepeatedPtrFieldStringAccessor() {}
-  virtual void Swap(
-      Field* data,
-      const internal::RepeatedFieldAccessor* other_mutator,
-      Field* other_data) const {
+  void Swap(Field* data, const internal::RepeatedFieldAccessor* other_mutator,
+            Field* other_data) const override {
     if (this == other_mutator) {
       MutableRepeatedField(data)->Swap(MutableRepeatedField(other_data));
     } else {
-      RepeatedPtrField<string> tmp;
+      RepeatedPtrField<std::string> tmp;
       tmp.Swap(MutableRepeatedField(data));
       int other_size = other_mutator->Size(other_data);
       for (int i = 0; i < other_size; ++i) {
-        Add<string>(data, other_mutator->Get<string>(other_data, i));
+        Add<std::string>(data, other_mutator->Get<std::string>(other_data, i));
       }
       int size = Size(data);
       other_mutator->Clear(other_data);
       for (int i = 0; i < size; ++i) {
-        other_mutator->Add<string>(other_data, tmp.Get(i));
+        other_mutator->Add<std::string>(other_data, tmp.Get(i));
       }
     }
   }
 
  protected:
-  virtual string* New(const Value*) const {
-    return new string();
+  std::string* New(const Value*) const override { return new std::string(); }
+  void ConvertToT(const Value* value, std::string* result) const override {
+    *result = *static_cast<const std::string*>(value);
   }
-  virtual void ConvertToT(const Value* value, string* result) const {
-    *result = *static_cast<const string*>(value);
-  }
-  virtual const Value* ConvertFromT(const string& value,
-                                    Value* scratch_space) const {
+  const Value* ConvertFromT(const std::string& value,
+                            Value* /*scratch_space*/) const override {
     return static_cast<const Value*>(&value);
   }
 };
 
 
-class RepeatedPtrFieldMessageAccessor
+class RepeatedPtrFieldMessageAccessor final
     : public RepeatedPtrFieldWrapper<Message> {
   typedef void Field;
   typedef void Value;
 
  public:
   RepeatedPtrFieldMessageAccessor() {}
-  virtual ~RepeatedPtrFieldMessageAccessor() {}
-  virtual void Swap(
-      Field* data,
-      const internal::RepeatedFieldAccessor* other_mutator,
-      Field* other_data) const {
+  void Swap(Field* data, const internal::RepeatedFieldAccessor* other_mutator,
+            Field* other_data) const override {
     GOOGLE_CHECK(this == other_mutator);
     MutableRepeatedField(data)->Swap(MutableRepeatedField(other_data));
   }
 
  protected:
-  virtual Message* New(const Value* value) const {
+  Message* New(const Value* value) const override {
     return static_cast<const Message*>(value)->New();
   }
-  virtual void ConvertToT(const Value* value, Message* result) const {
+  void ConvertToT(const Value* value, Message* result) const override {
     result->CopyFrom(*static_cast<const Message*>(value));
   }
-  virtual const Value* ConvertFromT(const Message& value,
-                                    Value* scratch_space) const {
+  const Value* ConvertFromT(const Message& value,
+                            Value* /*scratch_space*/) const override {
     return static_cast<const Value*>(&value);
   }
 };
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
 #endif  // GOOGLE_PROTOBUF_REFLECTION_INTERNAL_H__
index d186731..8f0cfb9 100644 (file)
 // Author: kenton@google.com (Kenton Varda)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
+#include <google/protobuf/reflection_ops.h>
 
 #include <string>
 #include <vector>
 
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/descriptor.h>
+#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/common.h>
 #include <google/protobuf/descriptor.pb.h>
+#include <google/protobuf/descriptor.h>
 #include <google/protobuf/map_field.h>
+#include <google/protobuf/map_field_inl.h>
 #include <google/protobuf/unknown_field_set.h>
-#include <google/protobuf/stubs/strutil.h>
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
 namespace internal {
 
+static const Reflection* GetReflectionOrDie(const Message& m) {
+  const Reflection* r = m.GetReflection();
+  if (r == nullptr) {
+    const Descriptor* d = m.GetDescriptor();
+    const std::string& mtype = d ? d->name() : "unknown";
+    // RawMessage is one known type for which GetReflection() returns nullptr.
+    GOOGLE_LOG(FATAL) << "Message does not support reflection (type " << mtype << ").";
+  }
+  return r;
+}
+
 void ReflectionOps::Copy(const Message& from, Message* to) {
   if (&from == to) return;
   Clear(to);
@@ -57,113 +72,210 @@ void ReflectionOps::Merge(const Message& from, Message* to) {
 
   const Descriptor* descriptor = from.GetDescriptor();
   GOOGLE_CHECK_EQ(to->GetDescriptor(), descriptor)
-    << "Tried to merge messages of different types "
-    << "(merge " << descriptor->full_name()
-    << " to " << to->GetDescriptor()->full_name() << ")";
+      << "Tried to merge messages of different types "
+      << "(merge " << descriptor->full_name() << " to "
+      << to->GetDescriptor()->full_name() << ")";
 
-  const Reflection* from_reflection = from.GetReflection();
-  const Reflection* to_reflection = to->GetReflection();
+  const Reflection* from_reflection = GetReflectionOrDie(from);
+  const Reflection* to_reflection = GetReflectionOrDie(*to);
+  bool is_from_generated = (from_reflection->GetMessageFactory() ==
+                            google::protobuf::MessageFactory::generated_factory());
+  bool is_to_generated = (to_reflection->GetMessageFactory() ==
+                          google::protobuf::MessageFactory::generated_factory());
 
   std::vector<const FieldDescriptor*> fields;
-  from_reflection->ListFields(from, &fields);
-  for (int i = 0; i < fields.size(); i++) {
-    const FieldDescriptor* field = fields[i];
-
+  from_reflection->ListFieldsOmitStripped(from, &fields);
+  for (const FieldDescriptor* field : fields) {
     if (field->is_repeated()) {
+      // Use map reflection if both are in map status and have the
+      // same map type to avoid sync with repeated field.
+      // Note: As from and to messages have the same descriptor, the
+      // map field types are the same if they are both generated
+      // messages or both dynamic messages.
+      if (is_from_generated == is_to_generated && field->is_map()) {
+        const MapFieldBase* from_field =
+            from_reflection->GetMapData(from, field);
+        MapFieldBase* to_field = to_reflection->MutableMapData(to, field);
+        if (to_field->IsMapValid() && from_field->IsMapValid()) {
+          to_field->MergeFrom(*from_field);
+          continue;
+        }
+      }
       int count = from_reflection->FieldSize(from, field);
       for (int j = 0; j < count; j++) {
         switch (field->cpp_type()) {
-#define HANDLE_TYPE(CPPTYPE, METHOD)                                     \
-          case FieldDescriptor::CPPTYPE_##CPPTYPE:                       \
-            to_reflection->Add##METHOD(to, field,                        \
-              from_reflection->GetRepeated##METHOD(from, field, j));     \
-            break;
-
-          HANDLE_TYPE(INT32 , Int32 );
-          HANDLE_TYPE(INT64 , Int64 );
+#define HANDLE_TYPE(CPPTYPE, METHOD)                                      \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE:                                \
+    to_reflection->Add##METHOD(                                           \
+        to, field, from_reflection->GetRepeated##METHOD(from, field, j)); \
+    break;
+
+          HANDLE_TYPE(INT32, Int32);
+          HANDLE_TYPE(INT64, Int64);
           HANDLE_TYPE(UINT32, UInt32);
           HANDLE_TYPE(UINT64, UInt64);
-          HANDLE_TYPE(FLOAT , Float );
+          HANDLE_TYPE(FLOAT, Float);
           HANDLE_TYPE(DOUBLE, Double);
-          HANDLE_TYPE(BOOL  , Bool  );
+          HANDLE_TYPE(BOOL, Bool);
           HANDLE_TYPE(STRING, String);
-          HANDLE_TYPE(ENUM  , Enum  );
+          HANDLE_TYPE(ENUM, Enum);
 #undef HANDLE_TYPE
 
           case FieldDescriptor::CPPTYPE_MESSAGE:
-            to_reflection->AddMessage(to, field)->MergeFrom(
-              from_reflection->GetRepeatedMessage(from, field, j));
+            const Message& from_child =
+                from_reflection->GetRepeatedMessage(from, field, j);
+            if (from_reflection == to_reflection) {
+              to_reflection
+                  ->AddMessage(to, field,
+                               from_child.GetReflection()->GetMessageFactory())
+                  ->MergeFrom(from_child);
+            } else {
+              to_reflection->AddMessage(to, field)->MergeFrom(from_child);
+            }
             break;
         }
       }
     } else {
       switch (field->cpp_type()) {
-#define HANDLE_TYPE(CPPTYPE, METHOD)                                        \
-        case FieldDescriptor::CPPTYPE_##CPPTYPE:                            \
-          to_reflection->Set##METHOD(to, field,                             \
-            from_reflection->Get##METHOD(from, field));                     \
-          break;
-
-        HANDLE_TYPE(INT32 , Int32 );
-        HANDLE_TYPE(INT64 , Int64 );
+#define HANDLE_TYPE(CPPTYPE, METHOD)                                       \
+  case FieldDescriptor::CPPTYPE_##CPPTYPE:                                 \
+    to_reflection->Set##METHOD(to, field,                                  \
+                               from_reflection->Get##METHOD(from, field)); \
+    break;
+
+        HANDLE_TYPE(INT32, Int32);
+        HANDLE_TYPE(INT64, Int64);
         HANDLE_TYPE(UINT32, UInt32);
         HANDLE_TYPE(UINT64, UInt64);
-        HANDLE_TYPE(FLOAT , Float );
+        HANDLE_TYPE(FLOAT, Float);
         HANDLE_TYPE(DOUBLE, Double);
-        HANDLE_TYPE(BOOL  , Bool  );
+        HANDLE_TYPE(BOOL, Bool);
         HANDLE_TYPE(STRING, String);
-        HANDLE_TYPE(ENUM  , Enum  );
+        HANDLE_TYPE(ENUM, Enum);
 #undef HANDLE_TYPE
 
         case FieldDescriptor::CPPTYPE_MESSAGE:
-          to_reflection->MutableMessage(to, field)->MergeFrom(
-            from_reflection->GetMessage(from, field));
+          const Message& from_child = from_reflection->GetMessage(from, field);
+          if (from_reflection == to_reflection) {
+            to_reflection
+                ->MutableMessage(
+                    to, field, from_child.GetReflection()->GetMessageFactory())
+                ->MergeFrom(from_child);
+          } else {
+            to_reflection->MutableMessage(to, field)->MergeFrom(from_child);
+          }
           break;
       }
     }
   }
 
   to_reflection->MutableUnknownFields(to)->MergeFrom(
-    from_reflection->GetUnknownFields(from));
+      from_reflection->GetUnknownFields(from));
 }
 
 void ReflectionOps::Clear(Message* message) {
-  const Reflection* reflection = message->GetReflection();
+  const Reflection* reflection = GetReflectionOrDie(*message);
 
   std::vector<const FieldDescriptor*> fields;
-  reflection->ListFields(*message, &fields);
-  for (int i = 0; i < fields.size(); i++) {
-    reflection->ClearField(message, fields[i]);
+  reflection->ListFieldsOmitStripped(*message, &fields);
+  for (const FieldDescriptor* field : fields) {
+    reflection->ClearField(message, field);
   }
 
   reflection->MutableUnknownFields(message)->Clear();
 }
 
+bool ReflectionOps::IsInitialized(const Message& message, bool check_fields,
+                                  bool check_descendants) {
+  const Descriptor* descriptor = message.GetDescriptor();
+  const Reflection* reflection = GetReflectionOrDie(message);
+  if (const int field_count = descriptor->field_count()) {
+    const FieldDescriptor* begin = descriptor->field(0);
+    const FieldDescriptor* end = begin + field_count;
+    GOOGLE_DCHECK_EQ(descriptor->field(field_count - 1), end - 1);
+
+    if (check_fields) {
+      // Check required fields of this message.
+      for (const FieldDescriptor* field = begin; field != end; ++field) {
+        if (field->is_required() && !reflection->HasField(message, field)) {
+          return false;
+        }
+      }
+    }
+
+    if (check_descendants) {
+      for (const FieldDescriptor* field = begin; field != end; ++field) {
+        if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
+          const Descriptor* message_type = field->message_type();
+          if (PROTOBUF_PREDICT_FALSE(message_type->options().map_entry())) {
+            if (message_type->field(1)->cpp_type() ==
+                FieldDescriptor::CPPTYPE_MESSAGE) {
+              const MapFieldBase* map_field =
+                  reflection->GetMapData(message, field);
+              if (map_field->IsMapValid()) {
+                MapIterator it(const_cast<Message*>(&message), field);
+                MapIterator end_map(const_cast<Message*>(&message), field);
+                for (map_field->MapBegin(&it), map_field->MapEnd(&end_map);
+                     it != end_map; ++it) {
+                  if (!it.GetValueRef().GetMessageValue().IsInitialized()) {
+                    return false;
+                  }
+                }
+              }
+            }
+          } else if (field->is_repeated()) {
+            const int size = reflection->FieldSize(message, field);
+            for (int j = 0; j < size; j++) {
+              if (!reflection->GetRepeatedMessage(message, field, j)
+                       .IsInitialized()) {
+                return false;
+              }
+            }
+          } else if (reflection->HasField(message, field)) {
+            if (!reflection->GetMessage(message, field).IsInitialized()) {
+              return false;
+            }
+          }
+        }
+      }
+    }
+  }
+  if (check_descendants && reflection->HasExtensionSet(message) &&
+      !reflection->GetExtensionSet(message).IsInitialized()) {
+    return false;
+  }
+  return true;
+}
+
 bool ReflectionOps::IsInitialized(const Message& message) {
   const Descriptor* descriptor = message.GetDescriptor();
-  const Reflection* reflection = message.GetReflection();
+  const Reflection* reflection = GetReflectionOrDie(message);
 
   // Check required fields of this message.
-  for (int i = 0; i < descriptor->field_count(); i++) {
-    if (descriptor->field(i)->is_required()) {
-      if (!reflection->HasField(message, descriptor->field(i))) {
-        return false;
+  {
+    const int field_count = descriptor->field_count();
+    for (int i = 0; i < field_count; i++) {
+      if (descriptor->field(i)->is_required()) {
+        if (!reflection->HasField(message, descriptor->field(i))) {
+          return false;
+        }
       }
     }
   }
 
   // Check that sub-messages are initialized.
   std::vector<const FieldDescriptor*> fields;
-  reflection->ListFields(message, &fields);
-  for (int i = 0; i < fields.size(); i++) {
-    const FieldDescriptor* field = fields[i];
+  // Should be safe to skip stripped fields because required fields are not
+  // stripped.
+  reflection->ListFieldsOmitStripped(message, &fields);
+  for (const FieldDescriptor* field : fields) {
     if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
 
       if (field->is_map()) {
         const FieldDescriptor* value_field = field->message_type()->field(1);
         if (value_field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-          MapFieldBase* map_field =
-              reflection->MapData(const_cast<Message*>(&message), field);
+          const MapFieldBase* map_field =
+              reflection->GetMapData(message, field);
           if (map_field->IsMapValid()) {
             MapIterator iter(const_cast<Message*>(&message), field);
             MapIterator end(const_cast<Message*>(&message), field);
@@ -185,7 +297,7 @@ bool ReflectionOps::IsInitialized(const Message& message) {
 
         for (int j = 0; j < size; j++) {
           if (!reflection->GetRepeatedMessage(message, field, j)
-                          .IsInitialized()) {
+                   .IsInitialized()) {
             return false;
           }
         }
@@ -200,33 +312,54 @@ bool ReflectionOps::IsInitialized(const Message& message) {
   return true;
 }
 
+static bool IsMapValueMessageTyped(const FieldDescriptor* map_field) {
+  return map_field->message_type()->field(1)->cpp_type() ==
+         FieldDescriptor::CPPTYPE_MESSAGE;
+}
+
 void ReflectionOps::DiscardUnknownFields(Message* message) {
-  const Reflection* reflection = message->GetReflection();
+  const Reflection* reflection = GetReflectionOrDie(*message);
 
   reflection->MutableUnknownFields(message)->Clear();
 
+  // Walk through the fields of this message and DiscardUnknownFields on any
+  // messages present.
   std::vector<const FieldDescriptor*> fields;
   reflection->ListFields(*message, &fields);
-  for (int i = 0; i < fields.size(); i++) {
-    const FieldDescriptor* field = fields[i];
-    if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-      if (field->is_repeated()) {
-        int size = reflection->FieldSize(*message, field);
-        for (int j = 0; j < size; j++) {
-          reflection->MutableRepeatedMessage(message, field, j)
-                    ->DiscardUnknownFields();
+  for (const FieldDescriptor* field : fields) {
+    // Skip over non-message fields.
+    if (field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) {
+      continue;
+    }
+    // Discard the unknown fields in maps that contain message values.
+    if (field->is_map() && IsMapValueMessageTyped(field)) {
+      const MapFieldBase* map_field =
+          reflection->MutableMapData(message, field);
+      if (map_field->IsMapValid()) {
+        MapIterator iter(message, field);
+        MapIterator end(message, field);
+        for (map_field->MapBegin(&iter), map_field->MapEnd(&end); iter != end;
+             ++iter) {
+          iter.MutableValueRef()->MutableMessageValue()->DiscardUnknownFields();
         }
-      } else {
-        reflection->MutableMessage(message, field)->DiscardUnknownFields();
       }
+      // Discard every unknown field inside messages in a repeated field.
+    } else if (field->is_repeated()) {
+      int size = reflection->FieldSize(*message, field);
+      for (int j = 0; j < size; j++) {
+        reflection->MutableRepeatedMessage(message, field, j)
+            ->DiscardUnknownFields();
+      }
+      // Discard the unknown fields inside an optional message.
+    } else {
+      reflection->MutableMessage(message, field)->DiscardUnknownFields();
     }
   }
 }
 
-static string SubMessagePrefix(const string& prefix,
-                               const FieldDescriptor* field,
-                               int index) {
-  string result(prefix);
+static std::string SubMessagePrefix(const std::string& prefix,
+                                    const FieldDescriptor* field, int index) {
+  std::string result(prefix);
   if (field->is_extension()) {
     result.append("(");
     result.append(field->full_name());
@@ -236,34 +369,35 @@ static string SubMessagePrefix(const string& prefix,
   }
   if (index != -1) {
     result.append("[");
-    result.append(SimpleItoa(index));
+    result.append(StrCat(index));
     result.append("]");
   }
   result.append(".");
   return result;
 }
 
-void ReflectionOps::FindInitializationErrors(
-    const Message& message,
-    const string& prefix,
-    std::vector<string>* errors) {
+void ReflectionOps::FindInitializationErrors(const Message& message,
+                                             const std::string& prefix,
+                                             std::vector<std::string>* errors) {
   const Descriptor* descriptor = message.GetDescriptor();
-  const Reflection* reflection = message.GetReflection();
+  const Reflection* reflection = GetReflectionOrDie(message);
 
   // Check required fields of this message.
-  for (int i = 0; i < descriptor->field_count(); i++) {
-    if (descriptor->field(i)->is_required()) {
-      if (!reflection->HasField(message, descriptor->field(i))) {
-        errors->push_back(prefix + descriptor->field(i)->name());
+  {
+    const int field_count = descriptor->field_count();
+    for (int i = 0; i < field_count; i++) {
+      if (descriptor->field(i)->is_required()) {
+        if (!reflection->HasField(message, descriptor->field(i))) {
+          errors->push_back(prefix + descriptor->field(i)->name());
+        }
       }
     }
   }
 
   // Check sub-messages.
   std::vector<const FieldDescriptor*> fields;
-  reflection->ListFields(message, &fields);
-  for (int i = 0; i < fields.size(); i++) {
-    const FieldDescriptor* field = fields[i];
+  reflection->ListFieldsOmitStripped(message, &fields);
+  for (const FieldDescriptor* field : fields) {
     if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
 
       if (field->is_repeated()) {
@@ -271,21 +405,50 @@ void ReflectionOps::FindInitializationErrors(
 
         for (int j = 0; j < size; j++) {
           const Message& sub_message =
-            reflection->GetRepeatedMessage(message, field, j);
+              reflection->GetRepeatedMessage(message, field, j);
           FindInitializationErrors(sub_message,
-                                   SubMessagePrefix(prefix, field, j),
-                                   errors);
+                                   SubMessagePrefix(prefix, field, j), errors);
         }
       } else {
         const Message& sub_message = reflection->GetMessage(message, field);
         FindInitializationErrors(sub_message,
-                                 SubMessagePrefix(prefix, field, -1),
-                                 errors);
+                                 SubMessagePrefix(prefix, field, -1), errors);
       }
     }
   }
 }
 
+void GenericSwap(Message* lhs, Message* rhs) {
+#ifndef PROTOBUF_FORCE_COPY_IN_SWAP
+  GOOGLE_DCHECK(Arena::InternalHelper<Message>::GetOwningArena(lhs) !=
+         Arena::InternalHelper<Message>::GetOwningArena(rhs));
+  GOOGLE_DCHECK(Arena::InternalHelper<Message>::GetOwningArena(lhs) != nullptr ||
+         Arena::InternalHelper<Message>::GetOwningArena(rhs) != nullptr);
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+  // At least one of these must have an arena, so make `rhs` point to it.
+  Arena* arena = Arena::InternalHelper<Message>::GetOwningArena(rhs);
+  if (arena == nullptr) {
+    std::swap(lhs, rhs);
+    arena = Arena::InternalHelper<Message>::GetOwningArena(rhs);
+  }
+
+  // Improve efficiency by placing the temporary on an arena so that messages
+  // are copied twice rather than three times.
+  Message* tmp = rhs->New(arena);
+  tmp->CheckTypeAndMergeFrom(*lhs);
+  lhs->Clear();
+  lhs->CheckTypeAndMergeFrom(*rhs);
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+  rhs->Clear();
+  rhs->CheckTypeAndMergeFrom(*tmp);
+  if (arena == nullptr) delete tmp;
+#else   // PROTOBUF_FORCE_COPY_IN_SWAP
+  rhs->GetReflection()->Swap(tmp, rhs);
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+}
+
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 45d8c65..fb98714 100644 (file)
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/message.h>
 
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace internal {
@@ -54,20 +60,22 @@ namespace internal {
 // the Message interface.
 //
 // This class is really a namespace that contains only static methods.
-class LIBPROTOBUF_EXPORT ReflectionOps {
+class PROTOBUF_EXPORT ReflectionOps {
  public:
   static void Copy(const Message& from, Message* to);
   static void Merge(const Message& from, Message* to);
   static void Clear(Message* message);
   static bool IsInitialized(const Message& message);
+  static bool IsInitialized(const Message& message, bool check_fields,
+                            bool check_descendants);
   static void DiscardUnknownFields(Message* message);
 
   // Finds all unset required fields in the message and adds their full
   // paths (e.g. "foo.bar[5].baz") to *names.  "prefix" will be attached to
   // the front of each name.
   static void FindInitializationErrors(const Message& message,
-                                       const string& prefix,
-                                       std::vector<string>* errors);
+                                       const std::string& prefix,
+                                       std::vector<std::string>* errors);
 
  private:
   // All methods are static.  No need to construct.
@@ -76,6 +84,8 @@ class LIBPROTOBUF_EXPORT ReflectionOps {
 
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_REFLECTION_OPS_H__
index 5ca964c..28a7bd3 100644 (file)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
+#include <google/protobuf/repeated_field.h>
+
 #include <algorithm>
 
-#include <google/protobuf/repeated_field.h>
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 
-namespace internal {
-
-void** RepeatedPtrFieldBase::InternalExtend(int extend_amount) {
-  int new_size = current_size_ + extend_amount;
-  if (total_size_ >= new_size) {
-    // N.B.: rep_ is non-NULL because extend_amount is always > 0, hence
-    // total_size must be non-zero since it is lower-bounded by new_size.
-    return &rep_->elements[current_size_];
-  }
-  Rep* old_rep = rep_;
-  Arena* arena = GetArenaNoVirtual();
-  new_size = std::max(kMinRepeatedFieldAllocationSize,
-                      std::max(total_size_ * 2, new_size));
-  GOOGLE_CHECK_LE(new_size,
-           (std::numeric_limits<size_t>::max() - kRepHeaderSize) /
-           sizeof(old_rep->elements[0]))
-      << "Requested size is too large to fit into size_t.";
-  size_t bytes = kRepHeaderSize + sizeof(old_rep->elements[0]) * new_size;
-  if (arena == NULL) {
-    rep_ = reinterpret_cast<Rep*>(::operator new(bytes));
-  } else {
-    rep_ = reinterpret_cast<Rep*>(
-        ::google::protobuf::Arena::CreateArray<char>(arena, bytes));
-  }
-#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
-  const int old_total_size = total_size_;
-#endif
-  total_size_ = new_size;
-  if (old_rep && old_rep->allocated_size > 0) {
-    memcpy(rep_->elements, old_rep->elements,
-           old_rep->allocated_size * sizeof(rep_->elements[0]));
-    rep_->allocated_size = old_rep->allocated_size;
-  } else {
-    rep_->allocated_size = 0;
-  }
-  if (arena == NULL) {
-#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
-    const size_t old_size =
-        old_total_size * sizeof(rep_->elements[0]) + kRepHeaderSize;
-    ::operator delete(static_cast<void*>(old_rep), old_size);
-#else
-    ::operator delete(static_cast<void*>(old_rep));
-#endif
-  }
-  return &rep_->elements[current_size_];
-}
-
-void RepeatedPtrFieldBase::Reserve(int new_size) {
-  if (new_size > current_size_) {
-    InternalExtend(new_size - current_size_);
-  }
-}
-
-void RepeatedPtrFieldBase::CloseGap(int start, int num) {
-  if (rep_ == NULL) return;
-  // Close up a gap of "num" elements starting at offset "start".
-  for (int i = start + num; i < rep_->allocated_size; ++i)
-    rep_->elements[i - num] = rep_->elements[i];
-  current_size_ -= num;
-  rep_->allocated_size -= num;
-}
-
-}  // namespace internal
 
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<bool>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<int32_t>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<uint32_t>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<int64_t>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<uint64_t>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<float>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<double>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedPtrField<std::string>;
 
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 8eb6c79..3f362f9 100644 (file)
 // Typically, clients should not need to access RepeatedField objects directly,
 // but should instead use the accessor functions generated automatically by the
 // protocol compiler.
+//
+// This header covers RepeatedField.
 
 #ifndef GOOGLE_PROTOBUF_REPEATED_FIELD_H__
 #define GOOGLE_PROTOBUF_REPEATED_FIELD_H__
 
+#include <utility>
 #ifdef _MSC_VER
 // This is required for min/max on VS2013 only.
 #include <algorithm>
 #include <iterator>
 #include <limits>
 #include <string>
-#include <google/protobuf/stubs/casts.h>
+#include <type_traits>
+
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/type_traits.h>
+#include <google/protobuf/repeated_ptr_field.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/message_lite.h>
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/port.h>
 
 
-// Forward-declare these so that we can make them friends.
-namespace google {
-namespace upb {
-namespace google_opensource {
-class GMR_Handlers;
-}  // namespace google_opensource
-}  // namespace upb
+// Must be included last.
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
+namespace google {
 namespace protobuf {
 
 class Message;
 
 namespace internal {
 
-class MergePartialFromCodedStreamHelper;
+// kRepeatedFieldLowerClampLimit is the smallest size that will be allocated
+// when growing a repeated field.
+constexpr int kRepeatedFieldLowerClampLimit = 4;
 
-static const int kMinRepeatedFieldAllocationSize = 4;
-
-// A utility function for logging that doesn't need any template types.
-void LogIndexOutOfBounds(int index, int size);
+// kRepeatedFieldUpperClampLimit is the lowest signed integer value that
+// overflows when multiplied by 2 (which is undefined behavior). Sizes above
+// this will clamp to the maximum int value instead of following exponential
+// growth when growing a repeated field.
+constexpr int kRepeatedFieldUpperClampLimit =
+    (std::numeric_limits<int>::max() / 2) + 1;
 
 template <typename Iter>
 inline int CalculateReserve(Iter begin, Iter end, std::forward_iterator_tag) {
-  return std::distance(begin, end);
+  return static_cast<int>(std::distance(begin, end));
 }
 
 template <typename Iter>
@@ -100,29 +108,75 @@ inline int CalculateReserve(Iter begin, Iter end) {
   typedef typename std::iterator_traits<Iter>::iterator_category Category;
   return CalculateReserve(begin, end, Category());
 }
-}  // namespace internal
 
+// Swaps two blocks of memory of size sizeof(T).
+template <typename T>
+inline void SwapBlock(char* p, char* q) {
+  T tmp;
+  memcpy(&tmp, p, sizeof(T));
+  memcpy(p, q, sizeof(T));
+  memcpy(q, &tmp, sizeof(T));
+}
+
+// Swaps two blocks of memory of size kSize:
+//  template <int kSize> void memswap(char* p, char* q);
+
+template <int kSize>
+inline typename std::enable_if<(kSize == 0), void>::type memswap(char*, char*) {
+}
+
+#define PROTO_MEMSWAP_DEF_SIZE(reg_type, max_size)                           \
+  template <int kSize>                                                       \
+  typename std::enable_if<(kSize >= sizeof(reg_type) && kSize < (max_size)), \
+                          void>::type                                        \
+  memswap(char* p, char* q) {                                                \
+    SwapBlock<reg_type>(p, q);                                               \
+    memswap<kSize - sizeof(reg_type)>(p + sizeof(reg_type),                  \
+                                      q + sizeof(reg_type));                 \
+  }
+
+PROTO_MEMSWAP_DEF_SIZE(uint8_t, 2)
+PROTO_MEMSWAP_DEF_SIZE(uint16_t, 4)
+PROTO_MEMSWAP_DEF_SIZE(uint32_t, 8)
+
+#ifdef __SIZEOF_INT128__
+PROTO_MEMSWAP_DEF_SIZE(uint64_t, 16)
+PROTO_MEMSWAP_DEF_SIZE(__uint128_t, (1u << 31))
+#else
+PROTO_MEMSWAP_DEF_SIZE(uint64_t, (1u << 31))
+#endif
+
+#undef PROTO_MEMSWAP_DEF_SIZE
+
+}  // namespace internal
 
 // RepeatedField is used to represent repeated fields of a primitive type (in
 // other words, everything except strings and nested Messages).  Most users will
 // not ever use a RepeatedField directly; they will use the get-by-index,
 // set-by-index, and add accessors that are generated for all repeated fields.
 template <typename Element>
-class RepeatedField PROTOBUF_FINAL {
+class RepeatedField final {
+  static_assert(
+      alignof(Arena) >= alignof(Element),
+      "We only support types that have an alignment smaller than Arena");
+
  public:
-  RepeatedField();
+  constexpr RepeatedField();
   explicit RepeatedField(Arena* arena);
+
   RepeatedField(const RepeatedField& other);
-  template <typename Iter>
-  RepeatedField(Iter begin, const Iter& end);
+
+  template <typename Iter,
+            typename = typename std::enable_if<std::is_constructible<
+                Element, decltype(*std::declval<Iter>())>::value>::type>
+  RepeatedField(Iter begin, Iter end);
+
   ~RepeatedField();
 
   RepeatedField& operator=(const RepeatedField& other);
 
-#if LANG_CXX11
   RepeatedField(RepeatedField&& other) noexcept;
   RepeatedField& operator=(RepeatedField&& other) noexcept;
-#endif
 
   bool empty() const;
   int size() const;
@@ -133,23 +187,35 @@ class RepeatedField PROTOBUF_FINAL {
   const Element& operator[](int index) const { return Get(index); }
   Element& operator[](int index) { return *Mutable(index); }
 
+  const Element& at(int index) const;
+  Element& at(int index);
+
   void Set(int index, const Element& value);
   void Add(const Element& value);
   // Appends a new element and return a pointer to it.
   // The new element is uninitialized if |Element| is a POD type.
   Element* Add();
+  // Append elements in the range [begin, end) after reserving
+  // the appropriate number of elements.
+  template <typename Iter>
+  void Add(Iter begin, Iter end);
+
   // Remove the last element in the array.
   void RemoveLast();
 
   // Extract elements with indices in "[start .. start+num-1]".
-  // Copy them into "elements[0 .. num-1]" if "elements" is not NULL.
+  // Copy them into "elements[0 .. num-1]" if "elements" is not nullptr.
   // Caution: implementation also moves elements with indices [start+num ..].
   // Calling this routine inside a loop can cause quadratic behavior.
   void ExtractSubrange(int start, int num, Element* elements);
 
-  void Clear();
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear();
   void MergeFrom(const RepeatedField& other);
-  void CopyFrom(const RepeatedField& other);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void CopyFrom(const RepeatedField& other);
+
+  // Replaces the contents with RepeatedField(begin, end).
+  template <typename Iter>
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Assign(Iter begin, Iter end);
 
   // Reserve space to expand the field to at least the given size.  If the
   // array is grown, it will always be at least doubled in size.
@@ -210,15 +276,11 @@ class RepeatedField PROTOBUF_FINAL {
   // Reverse iterator support
   typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
   typedef std::reverse_iterator<iterator> reverse_iterator;
-  reverse_iterator rbegin() {
-    return reverse_iterator(end());
-  }
+  reverse_iterator rbegin() { return reverse_iterator(end()); }
   const_reverse_iterator rbegin() const {
     return const_reverse_iterator(end());
   }
-  reverse_iterator rend() {
-    return reverse_iterator(begin());
-  }
+  reverse_iterator rend() { return reverse_iterator(begin()); }
   const_reverse_iterator rend() const {
     return const_reverse_iterator(begin());
   }
@@ -247,8 +309,9 @@ class RepeatedField PROTOBUF_FINAL {
   iterator erase(const_iterator first, const_iterator last);
 
   // Get the Arena on which this RepeatedField stores its elements.
-  ::google::protobuf::Arena* GetArena() const {
-    return GetArenaNoVirtual();
+  inline Arena* GetArena() const {
+    return (total_size_ == 0) ? static_cast<Arena*>(arena_or_elements_)
+                              : rep()->arena;
   }
 
   // For internal use only.
@@ -257,7 +320,7 @@ class RepeatedField PROTOBUF_FINAL {
   inline void InternalSwap(RepeatedField* other);
 
  private:
-  static const int kInitialSize = 0;
+  static constexpr int kInitialSize = 0;
   // A note on the representation here (see also comment below for
   // RepeatedPtrFieldBase's struct Rep):
   //
@@ -272,21 +335,43 @@ class RepeatedField PROTOBUF_FINAL {
   int total_size_;
   struct Rep {
     Arena* arena;
-    Element elements[1];
+    // Here we declare a huge array as a way of approximating C's "flexible
+    // array member" feature without relying on undefined behavior.
+    Element elements[(std::numeric_limits<int>::max() - 2 * sizeof(Arena*)) /
+                     sizeof(Element)];
   };
-  // We can not use sizeof(Rep) - sizeof(Element) due to the trailing padding on
-  // the struct. We can not use sizeof(Arena*) as well because there might be
-  // a "gap" after the field arena and before the field elements (e.g., when
-  // Element is double and pointer is 32bit).
-  static const size_t kRepHeaderSize;
-  // Contains arena ptr and the elements array. We also keep the invariant that
-  // if rep_ is NULL, then arena is NULL.
-  Rep* rep_;
+  static constexpr size_t kRepHeaderSize = offsetof(Rep, elements);
+
+  // If total_size_ == 0 this points to an Arena otherwise it points to the
+  // elements member of a Rep struct. Using this invariant allows the storage of
+  // the arena pointer without an extra allocation in the constructor.
+  void* arena_or_elements_;
+
+  // Return pointer to elements array.
+  // pre-condition: the array must have been allocated.
+  Element* elements() const {
+    GOOGLE_DCHECK_GT(total_size_, 0);
+    // Because of above pre-condition this cast is safe.
+    return unsafe_elements();
+  }
+
+  // Return pointer to elements array if it exists otherwise either null or
+  // a invalid pointer is returned. This only happens for empty repeated fields,
+  // where you can't dereference this pointer anyway (it's empty).
+  Element* unsafe_elements() const {
+    return static_cast<Element*>(arena_or_elements_);
+  }
+
+  // Return pointer to the Rep struct.
+  // pre-condition: the Rep must have been allocated, ie elements() is safe.
+  Rep* rep() const {
+    char* addr = reinterpret_cast<char*>(elements()) - offsetof(Rep, elements);
+    return reinterpret_cast<Rep*>(addr);
+  }
 
   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.
@@ -295,22 +380,17 @@ class RepeatedField PROTOBUF_FINAL {
   // Copy the elements of |from| into |to|.
   void CopyArray(Element* to, const Element* from, int size);
 
-  // Internal helper expected by Arena methods.
-  inline Arena* GetArenaNoVirtual() const {
-    return (rep_ == NULL) ? NULL : rep_->arena;
-  }
-
   // Internal helper to delete all elements and deallocate the storage.
-  // If Element has a trivial destructor (for example, if it's a fundamental
-  // type, like int32), the loop will be removed by the optimizer.
   void InternalDeallocate(Rep* rep, int size) {
-    if (rep != NULL) {
+    if (rep != nullptr) {
       Element* e = &rep->elements[0];
-      Element* limit = &rep->elements[size];
-      for (; e < limit; e++) {
-        e->~Element();
+      if (!std::is_trivial<Element>::value) {
+        Element* limit = &rep->elements[size];
+        for (; e < limit; e++) {
+          e->~Element();
+        }
       }
-      if (rep->arena == NULL) {
+      if (rep->arena == nullptr) {
 #if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
         const size_t bytes = size * sizeof(*e) + kRepHeaderSize;
         ::operator delete(static_cast<void*>(rep), bytes);
@@ -321,18 +401,91 @@ class RepeatedField PROTOBUF_FINAL {
     }
   }
 
-  friend class internal::WireFormatLite;
-  const Element* unsafe_data() const;
-};
+  // This class is a performance wrapper around RepeatedField::Add(const T&)
+  // function. In general unless a RepeatedField is a local stack variable LLVM
+  // has a hard time optimizing Add. The machine code tends to be
+  // loop:
+  // mov %size, dword ptr [%repeated_field]       // load
+  // cmp %size, dword ptr [%repeated_field + 4]
+  // jae fallback
+  // mov %buffer, qword ptr [%repeated_field + 8]
+  // mov dword [%buffer + %size * 4], %value
+  // inc %size                                    // increment
+  // mov dword ptr [%repeated_field], %size       // store
+  // jmp loop
+  //
+  // This puts a load/store in each iteration of the important loop variable
+  // size. It's a pretty bad compile that happens even in simple cases, but
+  // largely the presence of the fallback path disturbs the compilers mem-to-reg
+  // analysis.
+  //
+  // This class takes ownership of a repeated field for the duration of it's
+  // lifetime. The repeated field should not be accessed during this time, ie.
+  // only access through this class is allowed. This class should always be a
+  // function local stack variable. Intended use
+  //
+  // void AddSequence(const int* begin, const int* end, RepeatedField<int>* out)
+  // {
+  //   RepeatedFieldAdder<int> adder(out);  // Take ownership of out
+  //   for (auto it = begin; it != end; ++it) {
+  //     adder.Add(*it);
+  //   }
+  // }
+  //
+  // Typically due to the fact adder is a local stack variable. The compiler
+  // will be successful in mem-to-reg transformation and the machine code will
+  // be loop: cmp %size, %capacity jae fallback mov dword ptr [%buffer + %size *
+  // 4], %val inc %size jmp loop
+  //
+  // The first version executes at 7 cycles per iteration while the second
+  // version near 1 or 2 cycles.
+  template <int = 0, bool = std::is_trivial<Element>::value>
+  class FastAdderImpl {
+   public:
+    explicit FastAdderImpl(RepeatedField* rf) : repeated_field_(rf) {
+      index_ = repeated_field_->current_size_;
+      capacity_ = repeated_field_->total_size_;
+      buffer_ = repeated_field_->unsafe_elements();
+    }
+    ~FastAdderImpl() { repeated_field_->current_size_ = index_; }
+
+    void Add(Element val) {
+      if (index_ == capacity_) {
+        repeated_field_->current_size_ = index_;
+        repeated_field_->Reserve(index_ + 1);
+        capacity_ = repeated_field_->total_size_;
+        buffer_ = repeated_field_->unsafe_elements();
+      }
+      buffer_[index_++] = val;
+    }
 
-template<typename Element>
-const size_t RepeatedField<Element>::kRepHeaderSize =
-    reinterpret_cast<size_t>(&reinterpret_cast<Rep*>(16)->elements[0]) - 16;
+   private:
+    RepeatedField* repeated_field_;
+    int index_;
+    int capacity_;
+    Element* buffer_;
 
-namespace internal {
-template <typename It> class RepeatedPtrIterator;
-template <typename It, typename VoidPtr> class RepeatedPtrOverPtrsIterator;
-}  // namespace internal
+    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FastAdderImpl);
+  };
+
+  // FastAdder is a wrapper for adding fields. The specialization above handles
+  // POD types more efficiently than RepeatedField.
+  template <int I>
+  class FastAdderImpl<I, false> {
+   public:
+    explicit FastAdderImpl(RepeatedField* rf) : repeated_field_(rf) {}
+    void Add(const Element& val) { repeated_field_->Add(val); }
+
+   private:
+    RepeatedField* repeated_field_;
+    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FastAdderImpl);
+  };
+
+  using FastAdder = FastAdderImpl<>;
+
+  friend class TestRepeatedFieldHelper;
+  friend class ::google::protobuf::internal::ParseContext;
+};
 
 namespace internal {
 
@@ -341,2159 +494,534 @@ namespace internal {
 // shouldn't be necessary, but our compiler doesn't optimize std::copy very
 // effectively.
 template <typename Element,
-          bool HasTrivialCopy =
-              has_trivial_copy<Element>::value>
+          bool HasTrivialCopy = std::is_trivial<Element>::value>
 struct ElementCopier {
   void operator()(Element* to, const Element* from, int array_size);
 };
 
 }  // namespace internal
 
-namespace internal {
-
-// type-traits helper for RepeatedPtrFieldBase: we only want to invoke
-// arena-related "copy if on different arena" behavior if the necessary methods
-// exist on the contained type. In particular, we rely on MergeFrom() existing
-// as a general proxy for the fact that a copy will work, and we also provide a
-// specific override for string*.
-template <typename T>
-struct TypeImplementsMergeBehaviorProbeForMergeFrom {
-  typedef char HasMerge;
-  typedef long HasNoMerge;
-
-  // We accept either of:
-  // - void MergeFrom(const T& other)
-  // - bool MergeFrom(const T& other)
-  //
-  // We mangle these names a bit to avoid compatibility issues in 'unclean'
-  // include environments that may have, e.g., "#define test ..." (yes, this
-  // exists).
-  template<typename U, typename RetType, RetType (U::*)(const U& arg)>
-      struct CheckType;
-  template<typename U> static HasMerge Check(
-      CheckType<U, void, &U::MergeFrom>*);
-  template<typename U> static HasMerge Check(
-      CheckType<U, bool, &U::MergeFrom>*);
-  template<typename U> static HasNoMerge Check(...);
-
-  // Resolves to either google::protobuf::internal::true_type or google::protobuf::internal::false_type.
-  typedef google::protobuf::internal::integral_constant<bool,
-               (sizeof(Check<T>(0)) == sizeof(HasMerge))> type;
-};
-
-template <typename T, typename = void>
-struct TypeImplementsMergeBehavior :
-    TypeImplementsMergeBehaviorProbeForMergeFrom<T> {};
+// implementation ====================================================
 
+template <typename Element>
+constexpr RepeatedField<Element>::RepeatedField()
+    : current_size_(0), total_size_(0), arena_or_elements_(nullptr) {}
 
-template <>
-struct TypeImplementsMergeBehavior< ::std::string> {
-  typedef google::protobuf::internal::true_type type;
-};
+template <typename Element>
+inline RepeatedField<Element>::RepeatedField(Arena* arena)
+    : current_size_(0), total_size_(0), arena_or_elements_(arena) {}
 
-// This is the common base class for RepeatedPtrFields.  It deals only in void*
-// pointers.  Users should not use this interface directly.
-//
-// The methods of this interface correspond to the methods of RepeatedPtrField,
-// but may have a template argument called TypeHandler.  Its signature is:
-//   class TypeHandler {
-//    public:
-//     typedef MyType Type;
-//     static Type* New();
-//     static void Delete(Type*);
-//     static void Clear(Type*);
-//     static void Merge(const Type& from, Type* to);
-//
-//     // Only needs to be implemented if SpaceUsedExcludingSelf() is called.
-//     static int SpaceUsedLong(const Type&);
-//   };
-class LIBPROTOBUF_EXPORT RepeatedPtrFieldBase {
- protected:
-  // The reflection implementation needs to call protected methods directly,
-  // reinterpreting pointers as being to Message instead of a specific Message
-  // subclass.
-  friend class GeneratedMessageReflection;
-
-  // ExtensionSet stores repeated message extensions as
-  // RepeatedPtrField<MessageLite>, but non-lite ExtensionSets need to implement
-  // SpaceUsedLong(), and thus need to call SpaceUsedExcludingSelfLong()
-  // reinterpreting MessageLite as Message.  ExtensionSet also needs to make use
-  // of AddFromCleared(), which is not part of the public interface.
-  friend class ExtensionSet;
-
-  // The MapFieldBase implementation needs to call protected methods directly,
-  // reinterpreting pointers as being to Message instead of a specific Message
-  // subclass.
-  friend class MapFieldBase;
-
-  // The table-driven MergePartialFromCodedStream implementation needs to
-  // operate on RepeatedPtrField<MessageLite>.
-  friend class MergePartialFromCodedStreamHelper;
-
-  // To parse directly into a proto2 generated class, the upb class GMR_Handlers
-  // needs to be able to modify a RepeatedPtrFieldBase directly.
-  friend class upb::google_opensource::GMR_Handlers;
-
-  RepeatedPtrFieldBase();
-  explicit RepeatedPtrFieldBase(::google::protobuf::Arena* arena);
-  ~RepeatedPtrFieldBase() {}
-
-  // Must be called from destructor.
-  template <typename TypeHandler>
-  void Destroy();
+template <typename Element>
+inline RepeatedField<Element>::RepeatedField(const RepeatedField& other)
+    : current_size_(0), total_size_(0), arena_or_elements_(nullptr) {
+  if (other.current_size_ != 0) {
+    Reserve(other.size());
+    AddNAlreadyReserved(other.size());
+    CopyArray(Mutable(0), &other.Get(0), other.size());
+  }
+}
 
-  bool empty() const;
-  int size() const;
+template <typename Element>
+template <typename Iter, typename>
+RepeatedField<Element>::RepeatedField(Iter begin, Iter end)
+    : current_size_(0), total_size_(0), arena_or_elements_(nullptr) {
+  Add(begin, end);
+}
 
-  template <typename TypeHandler>
-  const typename TypeHandler::Type& Get(int index) const;
-  template <typename TypeHandler>
-  typename TypeHandler::Type* Mutable(int index);
-  template <typename TypeHandler>
-  void Delete(int index);
-  template <typename TypeHandler>
-  typename TypeHandler::Type* Add(typename TypeHandler::Type* prototype = NULL);
-#if LANG_CXX11
-  template <typename TypeHandler>
-  void Add(typename TypeHandler::Type&& value,
-           internal::enable_if<TypeHandler::Moveable>* dummy = NULL);
+template <typename Element>
+RepeatedField<Element>::~RepeatedField() {
+#ifndef NDEBUG
+  // Try to trigger segfault / asan failure in non-opt builds. If arena_
+  // lifetime has ended before the destructor.
+  auto arena = GetArena();
+  if (arena) (void)arena->SpaceAllocated();
 #endif
+  if (total_size_ > 0) {
+    InternalDeallocate(rep(), total_size_);
+  }
+}
 
-  template <typename TypeHandler>
-  void RemoveLast();
-  template <typename TypeHandler>
-  void Clear();
-  template <typename TypeHandler>
-  void MergeFrom(const RepeatedPtrFieldBase& other);
-  template <typename TypeHandler>
-  void CopyFrom(const RepeatedPtrFieldBase& other);
-
-  void CloseGap(int start, int num);
+template <typename Element>
+inline RepeatedField<Element>& RepeatedField<Element>::operator=(
+    const RepeatedField& other) {
+  if (this != &other) CopyFrom(other);
+  return *this;
+}
 
-  void Reserve(int new_size);
+template <typename Element>
+inline RepeatedField<Element>::RepeatedField(RepeatedField&& other) noexcept
+    : RepeatedField() {
+#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+  CopyFrom(other);
+#else   // PROTOBUF_FORCE_COPY_IN_MOVE
+  // We don't just call Swap(&other) here because it would perform 3 copies if
+  // other is on an arena. This field can't be on an arena because arena
+  // construction always uses the Arena* accepting constructor.
+  if (other.GetArena()) {
+    CopyFrom(other);
+  } else {
+    InternalSwap(&other);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+}
 
-  int Capacity() const;
+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 (GetArena() != other.GetArena()
+#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        || GetArena() == nullptr
+#endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      CopyFrom(other);
+    } else {
+      InternalSwap(&other);
+    }
+  }
+  return *this;
+}
 
-  // Used for constructing iterators.
-  void* const* raw_data() const;
-  void** raw_mutable_data() const;
+template <typename Element>
+inline bool RepeatedField<Element>::empty() const {
+  return current_size_ == 0;
+}
 
-  template <typename TypeHandler>
-  typename TypeHandler::Type** mutable_data();
-  template <typename TypeHandler>
-  const typename TypeHandler::Type* const* data() const;
+template <typename Element>
+inline int RepeatedField<Element>::size() const {
+  return current_size_;
+}
 
-  template <typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  void Swap(RepeatedPtrFieldBase* other);
+template <typename Element>
+inline int RepeatedField<Element>::Capacity() const {
+  return total_size_;
+}
 
-  void SwapElements(int index1, int index2);
+template <typename Element>
+inline void RepeatedField<Element>::AddAlreadyReserved(const Element& value) {
+  GOOGLE_DCHECK_LT(current_size_, total_size_);
+  elements()[current_size_++] = value;
+}
 
-  template <typename TypeHandler>
-  size_t SpaceUsedExcludingSelfLong() const;
+template <typename Element>
+inline Element* RepeatedField<Element>::AddAlreadyReserved() {
+  GOOGLE_DCHECK_LT(current_size_, total_size_);
+  return &elements()[current_size_++];
+}
 
+template <typename Element>
+inline Element* RepeatedField<Element>::AddNAlreadyReserved(int n) {
+  GOOGLE_DCHECK_GE(total_size_ - current_size_, n)
+      << total_size_ << ", " << current_size_;
+  // Warning: sometimes people call this when n == 0 and total_size_ == 0. In
+  // this case the return pointer points to a zero size array (n == 0). Hence
+  // we can just use unsafe_elements(), because the user cannot dereference the
+  // pointer anyway.
+  Element* ret = unsafe_elements() + current_size_;
+  current_size_ += n;
+  return ret;
+}
 
-  // Advanced memory management --------------------------------------
+template <typename Element>
+inline void RepeatedField<Element>::Resize(int new_size, const Element& value) {
+  GOOGLE_DCHECK_GE(new_size, 0);
+  if (new_size > current_size_) {
+    Reserve(new_size);
+    std::fill(&elements()[current_size_], &elements()[new_size], value);
+  }
+  current_size_ = new_size;
+}
 
-  // Like Add(), but if there are no cleared objects to use, returns NULL.
-  template <typename TypeHandler>
-  typename TypeHandler::Type* AddFromCleared();
+template <typename Element>
+inline const Element& RepeatedField<Element>::Get(int index) const {
+  GOOGLE_DCHECK_GE(index, 0);
+  GOOGLE_DCHECK_LT(index, current_size_);
+  return elements()[index];
+}
 
-  template<typename TypeHandler>
-  void AddAllocated(typename TypeHandler::Type* value) {
-    typename TypeImplementsMergeBehavior<typename TypeHandler::Type>::type t;
-    AddAllocatedInternal<TypeHandler>(value, t);
-  }
+template <typename Element>
+inline const Element& RepeatedField<Element>::at(int index) const {
+  GOOGLE_CHECK_GE(index, 0);
+  GOOGLE_CHECK_LT(index, current_size_);
+  return elements()[index];
+}
 
-  template <typename TypeHandler>
-  void UnsafeArenaAddAllocated(typename TypeHandler::Type* value);
+template <typename Element>
+inline Element& RepeatedField<Element>::at(int index) {
+  GOOGLE_CHECK_GE(index, 0);
+  GOOGLE_CHECK_LT(index, current_size_);
+  return elements()[index];
+}
 
-  template <typename TypeHandler>
-  typename TypeHandler::Type* ReleaseLast() {
-    typename TypeImplementsMergeBehavior<typename TypeHandler::Type>::type t;
-    return ReleaseLastInternal<TypeHandler>(t);
-  }
+template <typename Element>
+inline Element* RepeatedField<Element>::Mutable(int index) {
+  GOOGLE_DCHECK_GE(index, 0);
+  GOOGLE_DCHECK_LT(index, current_size_);
+  return &elements()[index];
+}
 
-  // Releases last element and returns it, but does not do out-of-arena copy.
-  // And just returns the raw pointer to the contained element in the arena.
-  template <typename TypeHandler>
-  typename TypeHandler::Type* UnsafeArenaReleaseLast();
-
-  int ClearedCount() const;
-  template <typename TypeHandler>
-  void AddCleared(typename TypeHandler::Type* value);
-  template <typename TypeHandler>
-  typename TypeHandler::Type* ReleaseCleared();
-
- protected:
-  inline void InternalSwap(RepeatedPtrFieldBase* other);
-
-  template <typename TypeHandler>
-  void AddAllocatedInternal(typename TypeHandler::Type* value, google::protobuf::internal::true_type);
-  template <typename TypeHandler>
-  void AddAllocatedInternal(typename TypeHandler::Type* value, google::protobuf::internal::false_type);
-
-  template <typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
-  void AddAllocatedSlowWithCopy(typename TypeHandler::Type* value,
-                                Arena* value_arena,
-                                Arena* my_arena);
-  template <typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
-  void AddAllocatedSlowWithoutCopy(typename TypeHandler::Type* value);
-
-  template <typename TypeHandler>
-  typename TypeHandler::Type* ReleaseLastInternal(google::protobuf::internal::true_type);
-  template <typename TypeHandler>
-  typename TypeHandler::Type* ReleaseLastInternal(google::protobuf::internal::false_type);
-
-  template<typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
-  void SwapFallback(RepeatedPtrFieldBase* other);
-
-  inline Arena* GetArenaNoVirtual() const {
-    return arena_;
-  }
+template <typename Element>
+inline void RepeatedField<Element>::Set(int index, const Element& value) {
+  GOOGLE_DCHECK_GE(index, 0);
+  GOOGLE_DCHECK_LT(index, current_size_);
+  elements()[index] = value;
+}
 
- private:
-  static const int kInitialSize = 0;
-  // A few notes on internal representation:
-  //
-  // We use an indirected approach, with struct Rep, to keep
-  // sizeof(RepeatedPtrFieldBase) equivalent to what it was before arena support
-  // was added, namely, 3 8-byte machine words on x86-64. An instance of Rep is
-  // allocated only when the repeated field is non-empty, and it is a
-  // dynamically-sized struct (the header is directly followed by elements[]).
-  // We place arena_ and current_size_ directly in the object to avoid cache
-  // misses due to the indirection, because these fields are checked frequently.
-  // Placing all fields directly in the RepeatedPtrFieldBase instance costs
-  // significant performance for memory-sensitive workloads.
-  Arena* arena_;
-  int    current_size_;
-  int    total_size_;
-  struct Rep {
-    int    allocated_size;
-    void*  elements[1];
-  };
-  static const size_t kRepHeaderSize = sizeof(Rep) - sizeof(void*);
-  // Contains arena ptr and the elements array. We also keep the invariant that
-  // if rep_ is NULL, then arena is NULL.
-  Rep* rep_;
-
-  template <typename TypeHandler>
-  static inline typename TypeHandler::Type* cast(void* element) {
-    return reinterpret_cast<typename TypeHandler::Type*>(element);
-  }
-  template <typename TypeHandler>
-  static inline const typename TypeHandler::Type* cast(const void* element) {
-    return reinterpret_cast<const typename TypeHandler::Type*>(element);
+template <typename Element>
+inline void RepeatedField<Element>::Add(const Element& value) {
+  uint32_t size = current_size_;
+  if (static_cast<int>(size) == total_size_) {
+    // value could reference an element of the array. Reserving new space will
+    // invalidate the reference. So we must make a copy first.
+    auto tmp = value;
+    Reserve(total_size_ + 1);
+    elements()[size] = std::move(tmp);
+  } else {
+    elements()[size] = value;
   }
+  current_size_ = size + 1;
+}
 
-  // Non-templated inner function to avoid code duplication. Takes a function
-  // pointer to the type-specific (templated) inner allocate/merge loop.
-  void MergeFromInternal(
-      const RepeatedPtrFieldBase& other,
-      void (RepeatedPtrFieldBase::*inner_loop)(void**, void**, int, int));
+template <typename Element>
+inline Element* RepeatedField<Element>::Add() {
+  uint32_t size = current_size_;
+  if (static_cast<int>(size) == total_size_) Reserve(total_size_ + 1);
+  auto ptr = &elements()[size];
+  current_size_ = size + 1;
+  return ptr;
+}
 
-  template<typename TypeHandler>
-  void MergeFromInnerLoop(
-      void** our_elems, void** other_elems, int length, int already_allocated);
+template <typename Element>
+template <typename Iter>
+inline void RepeatedField<Element>::Add(Iter begin, Iter end) {
+  int reserve = internal::CalculateReserve(begin, end);
+  if (reserve != -1) {
+    if (reserve == 0) {
+      return;
+    }
 
-  // Internal helper: extend array space if necessary to contain |extend_amount|
-  // more elements, and return a pointer to the element immediately following
-  // the old list of elements.  This interface factors out common behavior from
-  // Reserve() and MergeFrom() to reduce code size. |extend_amount| must be > 0.
-  void** InternalExtend(int extend_amount);
+    Reserve(reserve + size());
+    // TODO(ckennelly):  The compiler loses track of the buffer freshly
+    // allocated by Reserve() by the time we call elements, so it cannot
+    // guarantee that elements does not alias [begin(), end()).
+    //
+    // If restrict is available, annotating the pointer obtained from elements()
+    // causes this to lower to memcpy instead of memmove.
+    std::copy(begin, end, elements() + size());
+    current_size_ = reserve + size();
+  } else {
+    FastAdder fast_adder(this);
+    for (; begin != end; ++begin) fast_adder.Add(*begin);
+  }
+}
 
-  friend class AccessorHelper;
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPtrFieldBase);
-};
+template <typename Element>
+inline void RepeatedField<Element>::RemoveLast() {
+  GOOGLE_DCHECK_GT(current_size_, 0);
+  current_size_--;
+}
 
-template <typename GenericType>
-class GenericTypeHandler {
- public:
-  typedef GenericType Type;
-#if LANG_CXX11
-  static const bool Moveable = false;
-#endif
+template <typename Element>
+void RepeatedField<Element>::ExtractSubrange(int start, int num,
+                                             Element* elements) {
+  GOOGLE_DCHECK_GE(start, 0);
+  GOOGLE_DCHECK_GE(num, 0);
+  GOOGLE_DCHECK_LE(start + num, this->current_size_);
 
-  static inline GenericType* New(Arena* arena) {
-    return ::google::protobuf::Arena::CreateMaybeMessage<Type>(arena);
-  }
-  static inline GenericType* NewFromPrototype(
-      const GenericType* prototype, ::google::protobuf::Arena* arena = NULL);
-  static inline void Delete(GenericType* value, Arena* arena) {
-    if (arena == NULL) {
-      delete value;
-    }
-  }
-  static inline ::google::protobuf::Arena* GetArena(GenericType* value) {
-    return ::google::protobuf::Arena::GetArena<Type>(value);
-  }
-  static inline void* GetMaybeArenaPointer(GenericType* value) {
-    return ::google::protobuf::Arena::GetArena<Type>(value);
+  // Save the values of the removed elements if requested.
+  if (elements != nullptr) {
+    for (int i = 0; i < num; ++i) elements[i] = this->Get(i + start);
   }
 
-  static inline void Clear(GenericType* value) { value->Clear(); }
-  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
-  static void Merge(const GenericType& from, GenericType* to);
-  static inline size_t SpaceUsedLong(const GenericType& value) {
-    return value.SpaceUsedLong();
-  }
-  static inline const Type& default_instance() {
-    return Type::default_instance();
+  // Slide remaining elements down to fill the gap.
+  if (num > 0) {
+    for (int i = start + num; i < this->current_size_; ++i)
+      this->Set(i - num, this->Get(i));
+    this->Truncate(this->current_size_ - num);
   }
-};
+}
 
-template <typename GenericType>
-GenericType* GenericTypeHandler<GenericType>::NewFromPrototype(
-    const GenericType* /* prototype */, ::google::protobuf::Arena* arena) {
-  return New(arena);
+template <typename Element>
+inline void RepeatedField<Element>::Clear() {
+  current_size_ = 0;
 }
-template <typename GenericType>
-void GenericTypeHandler<GenericType>::Merge(const GenericType& from,
-                                            GenericType* to) {
-  to->MergeFrom(from);
+
+template <typename Element>
+inline void RepeatedField<Element>::MergeFrom(const RepeatedField& other) {
+  GOOGLE_DCHECK_NE(&other, this);
+  if (other.current_size_ != 0) {
+    int existing_size = size();
+    Reserve(existing_size + other.size());
+    AddNAlreadyReserved(other.size());
+    CopyArray(Mutable(existing_size), &other.Get(0), other.size());
+  }
 }
 
-// NewFromPrototype() and Merge() are not defined inline here, as we will need
-// to do a virtual function dispatch anyways to go from Message* to call
-// New/Merge.
-template<>
-MessageLite* GenericTypeHandler<MessageLite>::NewFromPrototype(
-    const MessageLite* prototype, google::protobuf::Arena* arena);
-template<>
-inline google::protobuf::Arena* GenericTypeHandler<MessageLite>::GetArena(
-    MessageLite* value) {
-  return value->GetArena();
+template <typename Element>
+inline void RepeatedField<Element>::CopyFrom(const RepeatedField& other) {
+  if (&other == this) return;
+  Clear();
+  MergeFrom(other);
 }
-template<>
-inline void* GenericTypeHandler<MessageLite>::GetMaybeArenaPointer(
-    MessageLite* value) {
-  return value->GetMaybeArenaPointer();
+
+template <typename Element>
+template <typename Iter>
+inline void RepeatedField<Element>::Assign(Iter begin, Iter end) {
+  Clear();
+  Add(begin, end);
 }
-template <>
-void GenericTypeHandler<MessageLite>::Merge(const MessageLite& from,
-                                            MessageLite* to);
-template<>
-inline void GenericTypeHandler<string>::Clear(string* value) {
-  value->clear();
+
+template <typename Element>
+inline typename RepeatedField<Element>::iterator RepeatedField<Element>::erase(
+    const_iterator position) {
+  return erase(position, position + 1);
 }
-template<>
-void GenericTypeHandler<string>::Merge(const string& from,
-                                       string* to);
-
-// Declarations of the specialization as we cannot define them here, as the
-// header that defines ProtocolMessage depends on types defined in this header.
-#define DECLARE_SPECIALIZATIONS_FOR_BASE_PROTO_TYPES(TypeName)                 \
-    template<>                                                                 \
-    TypeName* GenericTypeHandler<TypeName>::NewFromPrototype(                  \
-        const TypeName* prototype, google::protobuf::Arena* arena);                      \
-    template<>                                                                 \
-    google::protobuf::Arena* GenericTypeHandler<TypeName>::GetArena(                     \
-        TypeName* value);                                                      \
-    template<>                                                                 \
-    void* GenericTypeHandler<TypeName>::GetMaybeArenaPointer(                  \
-        TypeName* value);
-
-// Message specialization bodies defined in message.cc. This split is necessary
-// to allow proto2-lite (which includes this header) to be independent of
-// Message.
-DECLARE_SPECIALIZATIONS_FOR_BASE_PROTO_TYPES(Message)
-
-
-#undef DECLARE_SPECIALIZATIONS_FOR_BASE_PROTO_TYPES
-
-template <>
-inline const MessageLite& GenericTypeHandler<MessageLite>::default_instance() {
-  // Yes, the behavior of the code is undefined, but this function is only
-  // called when we're already deep into the world of undefined, because the
-  // caller called Get(index) out of bounds.
-  MessageLite* null = NULL;
-  return *null;
+
+template <typename Element>
+inline typename RepeatedField<Element>::iterator RepeatedField<Element>::erase(
+    const_iterator first, const_iterator last) {
+  size_type first_offset = first - cbegin();
+  if (first != last) {
+    Truncate(std::copy(last, cend(), begin() + first_offset) - cbegin());
+  }
+  return begin() + first_offset;
 }
 
-template <>
-inline const Message& GenericTypeHandler<Message>::default_instance() {
-  // Yes, the behavior of the code is undefined, but this function is only
-  // called when we're already deep into the world of undefined, because the
-  // caller called Get(index) out of bounds.
-  Message* null = NULL;
-  return *null;
+template <typename Element>
+inline Element* RepeatedField<Element>::mutable_data() {
+  return unsafe_elements();
 }
 
-
-class StringTypeHandler {
- public:
-  typedef string Type;
-#if LANG_CXX11
-  static const bool Moveable =
-      std::is_move_constructible<Type>::value &&
-      std::is_move_assignable<Type>::value;
-#endif
-
-  static inline string* New(Arena* arena) {
-    return Arena::Create<string>(arena);
-  }
-#if LANG_CXX11
-  static inline string* New(Arena* arena, string&& value) {
-    return Arena::Create<string>(arena, std::move(value));
-  }
-#endif
-  static inline string* NewFromPrototype(const string*,
-                                         ::google::protobuf::Arena* arena) {
-    return New(arena);
-  }
-  static inline ::google::protobuf::Arena* GetArena(string*) {
-    return NULL;
-  }
-  static inline void* GetMaybeArenaPointer(string* /* value */) {
-    return NULL;
-  }
-  static inline void Delete(string* value, Arena* arena) {
-    if (arena == NULL) {
-      delete value;
-    }
-  }
-  static inline void Clear(string* value) { value->clear(); }
-  static inline void Merge(const string& from, string* to) { *to = from; }
-  static inline const Type& default_instance() {
-    return ::google::protobuf::internal::GetEmptyString();
-  }
-  static size_t SpaceUsedLong(const string& value)  {
-    return sizeof(value) + StringSpaceUsedExcludingSelfLong(value);
-  }
-};
-
-}  // namespace internal
-
-// RepeatedPtrField is like RepeatedField, but used for repeated strings or
-// Messages.
-template <typename Element>
-class RepeatedPtrField PROTOBUF_FINAL : public internal::RepeatedPtrFieldBase {
- public:
-  RepeatedPtrField();
-  explicit RepeatedPtrField(::google::protobuf::Arena* arena);
-
-  RepeatedPtrField(const RepeatedPtrField& other);
-  template <typename Iter>
-  RepeatedPtrField(Iter begin, const Iter& end);
-  ~RepeatedPtrField();
-
-  RepeatedPtrField& operator=(const RepeatedPtrField& other);
-
-#if LANG_CXX11
-  RepeatedPtrField(RepeatedPtrField&& other) noexcept;
-  RepeatedPtrField& operator=(RepeatedPtrField&& other) noexcept;
-#endif
-
-  bool empty() const;
-  int size() const;
-
-  const Element& Get(int index) const;
-  Element* Mutable(int index);
-  Element* Add();
-#if LANG_CXX11
-  void Add(Element&& value);
-#endif
-
-  const Element& operator[](int index) const { return Get(index); }
-  Element& operator[](int index) { return *Mutable(index); }
-
-  // Remove the last element in the array.
-  // Ownership of the element is retained by the array.
-  void RemoveLast();
-
-  // Delete elements with indices in the range [start .. start+num-1].
-  // Caution: implementation moves all elements with indices [start+num .. ].
-  // Calling this routine inside a loop can cause quadratic behavior.
-  void DeleteSubrange(int start, int num);
-
-  void Clear();
-  void MergeFrom(const RepeatedPtrField& other);
-  void CopyFrom(const RepeatedPtrField& other);
-
-  // Reserve space to expand the field to at least the given size.  This only
-  // resizes the pointer array; it doesn't allocate any objects.  If the
-  // array is grown, it will always be at least doubled in size.
-  void Reserve(int new_size);
-
-  int Capacity() const;
-
-  // Gets the underlying array.  This pointer is possibly invalidated by
-  // any add or remove operation.
-  Element** mutable_data();
-  const Element* const* data() const;
-
-  // Swap entire contents with "other". If they are on separate arenas, then
-  // copies data.
-  void Swap(RepeatedPtrField* other);
-
-  // Swap entire contents with "other". Caller should guarantee that either both
-  // fields are on the same arena or both are on the heap. Swapping between
-  // different arenas with this function is disallowed and is caught via
-  // GOOGLE_DCHECK.
-  void UnsafeArenaSwap(RepeatedPtrField* other);
-
-  // Swap two elements.
-  void SwapElements(int index1, int index2);
-
-  // STL-like iterator support
-  typedef internal::RepeatedPtrIterator<Element> iterator;
-  typedef internal::RepeatedPtrIterator<const Element> const_iterator;
-  typedef Element value_type;
-  typedef value_type& reference;
-  typedef const value_type& const_reference;
-  typedef value_type* pointer;
-  typedef const value_type* const_pointer;
-  typedef int size_type;
-  typedef ptrdiff_t difference_type;
-
-  iterator begin();
-  const_iterator begin() const;
-  const_iterator cbegin() const;
-  iterator end();
-  const_iterator end() const;
-  const_iterator cend() const;
-
-  // Reverse iterator support
-  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-  typedef std::reverse_iterator<iterator> reverse_iterator;
-  reverse_iterator rbegin() {
-    return reverse_iterator(end());
-  }
-  const_reverse_iterator rbegin() const {
-    return const_reverse_iterator(end());
-  }
-  reverse_iterator rend() {
-    return reverse_iterator(begin());
-  }
-  const_reverse_iterator rend() const {
-    return const_reverse_iterator(begin());
-  }
-
-  // Custom STL-like iterator that iterates over and returns the underlying
-  // pointers to Element rather than Element itself.
-  typedef internal::RepeatedPtrOverPtrsIterator<Element*, void*>
-      pointer_iterator;
-  typedef internal::RepeatedPtrOverPtrsIterator<const Element* const,
-                                                const void* const>
-      const_pointer_iterator;
-  pointer_iterator pointer_begin();
-  const_pointer_iterator pointer_begin() const;
-  pointer_iterator pointer_end();
-  const_pointer_iterator pointer_end() const;
-
-  // Returns (an estimate of) the number of bytes used by the repeated field,
-  // excluding sizeof(*this).
-  size_t SpaceUsedExcludingSelfLong() const;
-
-  int SpaceUsedExcludingSelf() const {
-    return internal::ToIntSize(SpaceUsedExcludingSelfLong());
-  }
-
-  // Advanced memory management --------------------------------------
-  // When hardcore memory management becomes necessary -- as it sometimes
-  // does here at Google -- the following methods may be useful.
-
-  // Add an already-allocated object, passing ownership to the
-  // RepeatedPtrField.
-  //
-  // Note that some special behavior occurs with respect to arenas:
-  //
-  //   (i) if this field holds submessages, the new submessage will be copied if
-  //   the original is in an arena and this RepeatedPtrField is either in a
-  //   different arena, or on the heap.
-  //   (ii) if this field holds strings, the passed-in string *must* be
-  //   heap-allocated, not arena-allocated. There is no way to dynamically check
-  //   this at runtime, so User Beware.
-  void AddAllocated(Element* value);
-
-  // Remove the last element and return it, passing ownership to the caller.
-  // Requires:  size() > 0
-  //
-  // If this RepeatedPtrField is on an arena, an object copy is required to pass
-  // ownership back to the user (for compatible semantics). Use
-  // UnsafeArenaReleaseLast() if this behavior is undesired.
-  Element* ReleaseLast();
-
-  // Add an already-allocated object, skipping arena-ownership checks. The user
-  // must guarantee that the given object is in the same arena as this
-  // RepeatedPtrField.
-  // It is also useful in legacy code that uses temporary ownership to avoid
-  // copies. Example:
-  //   RepeatedPtrField<T> temp_field;
-  //   temp_field.AddAllocated(new T);
-  //   ... // Do something with temp_field
-  //   temp_field.ExtractSubrange(0, temp_field.size(), NULL);
-  // If you put temp_field on the arena this fails, because the ownership
-  // transfers to the arena at the "AddAllocated" call and is not released
-  // anymore causing a double delete. UnsafeArenaAddAllocated prevents this.
-  void UnsafeArenaAddAllocated(Element* value);
-
-  // Remove the last element and return it.  Works only when operating on an
-  // arena. The returned pointer is to the original object in the arena, hence
-  // has the arena's lifetime.
-  // Requires:  current_size_ > 0
-  Element* UnsafeArenaReleaseLast();
-
-  // Extract elements with indices in the range "[start .. start+num-1]".
-  // The caller assumes ownership of the extracted elements and is responsible
-  // for deleting them when they are no longer needed.
-  // If "elements" is non-NULL, then pointers to the extracted elements
-  // are stored in "elements[0 .. num-1]" for the convenience of the caller.
-  // If "elements" is NULL, then the caller must use some other mechanism
-  // to perform any further operations (like deletion) on these elements.
-  // Caution: implementation also moves elements with indices [start+num ..].
-  // Calling this routine inside a loop can cause quadratic behavior.
-  //
-  // Memory copying behavior is identical to ReleaseLast(), described above: if
-  // this RepeatedPtrField is on an arena, an object copy is performed for each
-  // returned element, so that all returned element pointers are to
-  // heap-allocated copies. If this copy is not desired, the user should call
-  // UnsafeArenaExtractSubrange().
-  void ExtractSubrange(int start, int num, Element** elements);
-
-  // Identical to ExtractSubrange() described above, except that when this
-  // repeated field is on an arena, no object copies are performed. Instead, the
-  // raw object pointers are returned. Thus, if on an arena, the returned
-  // objects must not be freed, because they will not be heap-allocated objects.
-  void UnsafeArenaExtractSubrange(int start, int num, Element** elements);
-
-  // When elements are removed by calls to RemoveLast() or Clear(), they
-  // are not actually freed.  Instead, they are cleared and kept so that
-  // they can be reused later.  This can save lots of CPU time when
-  // repeatedly reusing a protocol message for similar purposes.
-  //
-  // Hardcore programs may choose to manipulate these cleared objects
-  // to better optimize memory management using the following routines.
-
-  // Get the number of cleared objects that are currently being kept
-  // around for reuse.
-  int ClearedCount() const;
-  // Add an element to the pool of cleared objects, passing ownership to
-  // the RepeatedPtrField.  The element must be cleared prior to calling
-  // this method.
-  //
-  // This method cannot be called when the repeated field is on an arena or when
-  // |value| is; both cases will trigger a GOOGLE_DCHECK-failure.
-  void AddCleared(Element* value);
-  // Remove a single element from the cleared pool and return it, passing
-  // ownership to the caller.  The element is guaranteed to be cleared.
-  // Requires:  ClearedCount() > 0
-  //
-  //
-  // This method cannot be called when the repeated field is on an arena; doing
-  // so will trigger a GOOGLE_DCHECK-failure.
-  Element* ReleaseCleared();
-
-  // Removes the element referenced by position.
-  //
-  // Returns an iterator to the element immediately following the removed
-  // element.
-  //
-  // Invalidates all iterators at or after the removed element, including end().
-  iterator erase(const_iterator position);
-
-  // Removes the elements in the range [first, last).
-  //
-  // Returns an iterator to the element immediately following the removed range.
-  //
-  // Invalidates all iterators at or after the removed range, including end().
-  iterator erase(const_iterator first, const_iterator last);
-
-  // Gets the arena on which this RepeatedPtrField stores its elements.
-  ::google::protobuf::Arena* GetArena() const {
-    return GetArenaNoVirtual();
-  }
-
-  // For internal use only.
-  //
-  // This is public due to it being called by generated code.
-  using RepeatedPtrFieldBase::InternalSwap;
-
- private:
-  // Note:  RepeatedPtrField SHOULD NOT be subclassed by users.
-  class TypeHandler;
-
-  // Internal arena accessor expected by helpers in Arena.
-  inline Arena* GetArenaNoVirtual() const;
-
-  // Implementations for ExtractSubrange(). The copying behavior must be
-  // included only if the type supports the necessary operations (e.g.,
-  // MergeFrom()), so we must resolve this at compile time. ExtractSubrange()
-  // uses SFINAE to choose one of the below implementations.
-  void ExtractSubrangeInternal(int start, int num, Element** elements,
-                               google::protobuf::internal::true_type);
-  void ExtractSubrangeInternal(int start, int num, Element** elements,
-                               google::protobuf::internal::false_type);
-
-  friend class Arena;
-  typedef void InternalArenaConstructable_;
-
-};
-
-// implementation ====================================================
-
-template <typename Element>
-inline RepeatedField<Element>::RepeatedField()
-  : current_size_(0),
-    total_size_(0),
-    rep_(NULL) {
-}
-
-template <typename Element>
-inline RepeatedField<Element>::RepeatedField(Arena* arena)
-  : current_size_(0),
-    total_size_(0),
-    rep_(NULL) {
-  // In case arena is NULL, then we do not create rep_, as code has an invariant
-  // `rep_ == NULL then arena == NULL`.
-  if (arena != NULL) {
-    rep_ = reinterpret_cast<Rep*>(
-        ::google::protobuf::Arena::CreateArray<char>(arena, kRepHeaderSize));
-    rep_->arena = arena;
-  }
-}
-
-template <typename Element>
-inline RepeatedField<Element>::RepeatedField(const RepeatedField& other)
-  : current_size_(0),
-    total_size_(0),
-    rep_(NULL) {
-  if (other.current_size_ != 0) {
-    Reserve(other.current_size_);
-    CopyArray(rep_->elements,
-              other.rep_->elements, other.current_size_);
-    current_size_ = other.current_size_;
-  }
-}
-
-template <typename Element>
-template <typename Iter>
-RepeatedField<Element>::RepeatedField(Iter begin, const Iter& end)
-  : current_size_(0),
-    total_size_(0),
-    rep_(NULL) {
-  int reserve = internal::CalculateReserve(begin, end);
-  if (reserve != -1) {
-    Reserve(reserve);
-    for (; begin != end; ++begin) {
-      AddAlreadyReserved(*begin);
-    }
-  } else {
-    for (; begin != end; ++begin) {
-      Add(*begin);
-    }
-  }
-}
-
-template <typename Element>
-RepeatedField<Element>::~RepeatedField() {
-  // See explanation in Reserve(): we need to invoke destructors here for the
-  // case that Element has a non-trivial destructor.
-  InternalDeallocate(rep_, total_size_);
-}
-
-template <typename Element>
-inline RepeatedField<Element>&
-RepeatedField<Element>::operator=(const RepeatedField& other) {
-  if (this != &other)
-    CopyFrom(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;
-}
-
-template <typename Element>
-inline int RepeatedField<Element>::size() const {
-  return current_size_;
-}
-
-template <typename Element>
-inline int RepeatedField<Element>::Capacity() const {
-  return total_size_;
-}
-
-template<typename Element>
-inline void RepeatedField<Element>::AddAlreadyReserved(const Element& value) {
-  GOOGLE_DCHECK_LT(current_size_, total_size_);
-  rep_->elements[current_size_++] = value;
-}
-
-template<typename Element>
-inline Element* RepeatedField<Element>::AddAlreadyReserved() {
-  GOOGLE_DCHECK_LT(current_size_, total_size_);
-  return &rep_->elements[current_size_++];
-}
-
-template<typename Element>
-inline Element* RepeatedField<Element>::AddNAlreadyReserved(int elements) {
-  GOOGLE_DCHECK_LE(current_size_ + elements, total_size_);
-  Element* ret = &rep_->elements[current_size_];
-  current_size_ += elements;
-  return ret;
-}
-
-template<typename Element>
-inline void RepeatedField<Element>::Resize(int new_size, const Element& value) {
-  GOOGLE_DCHECK_GE(new_size, 0);
-  if (new_size > current_size_) {
-    Reserve(new_size);
-    std::fill(&rep_->elements[current_size_],
-              &rep_->elements[new_size], value);
-  }
-  current_size_ = new_size;
-}
-
-template <typename Element>
-inline const Element& RepeatedField<Element>::Get(int index) const {
-  GOOGLE_DCHECK_GE(index, 0);
-  GOOGLE_DCHECK_LT(index, current_size_);
-  return rep_->elements[index];
-}
-
-template <typename Element>
-inline Element* RepeatedField<Element>::Mutable(int index) {
-  GOOGLE_DCHECK_GE(index, 0);
-  GOOGLE_DCHECK_LT(index, current_size_);
-  return &rep_->elements[index];
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::Set(int index, const Element& value) {
-  GOOGLE_DCHECK_GE(index, 0);
-  GOOGLE_DCHECK_LT(index, current_size_);
-  rep_->elements[index] = value;
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::Add(const Element& value) {
-  if (current_size_ == total_size_) Reserve(total_size_ + 1);
-  rep_->elements[current_size_++] = value;
-}
-
-template <typename Element>
-inline Element* RepeatedField<Element>::Add() {
-  if (current_size_ == total_size_) Reserve(total_size_ + 1);
-  return &rep_->elements[current_size_++];
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::RemoveLast() {
-  GOOGLE_DCHECK_GT(current_size_, 0);
-  current_size_--;
-}
-
-template <typename Element>
-void RepeatedField<Element>::ExtractSubrange(
-    int start, int num, Element* elements) {
-  GOOGLE_DCHECK_GE(start, 0);
-  GOOGLE_DCHECK_GE(num, 0);
-  GOOGLE_DCHECK_LE(start + num, this->current_size_);
-
-  // Save the values of the removed elements if requested.
-  if (elements != NULL) {
-    for (int i = 0; i < num; ++i)
-      elements[i] = this->Get(i + start);
-  }
-
-  // Slide remaining elements down to fill the gap.
-  if (num > 0) {
-    for (int i = start + num; i < this->current_size_; ++i)
-      this->Set(i - num, this->Get(i));
-    this->Truncate(this->current_size_ - num);
-  }
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::Clear() {
-  current_size_ = 0;
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::MergeFrom(const RepeatedField& other) {
-  GOOGLE_DCHECK_NE(&other, this);
-  if (other.current_size_ != 0) {
-    Reserve(current_size_ + other.current_size_);
-    CopyArray(rep_->elements + current_size_,
-              other.rep_->elements, other.current_size_);
-    current_size_ += other.current_size_;
-  }
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::CopyFrom(const RepeatedField& other) {
-  if (&other == this) return;
-  Clear();
-  MergeFrom(other);
-}
-
-template <typename Element>
-inline typename RepeatedField<Element>::iterator RepeatedField<Element>::erase(
-    const_iterator position) {
-  return erase(position, position + 1);
-}
-
-template <typename Element>
-inline typename RepeatedField<Element>::iterator RepeatedField<Element>::erase(
-    const_iterator first, const_iterator last) {
-  size_type first_offset = first - cbegin();
-  if (first != last) {
-    Truncate(std::copy(last, cend(), begin() + first_offset) - cbegin());
-  }
-  return begin() + first_offset;
-}
-
-template <typename Element>
-inline Element* RepeatedField<Element>::mutable_data() {
-  return rep_ ? rep_->elements : NULL;
-}
-
-template <typename Element>
-inline const Element* RepeatedField<Element>::data() const {
-  return rep_ ? rep_->elements : NULL;
-}
-
-template <typename Element>
-inline const Element* RepeatedField<Element>::unsafe_data() const {
-  GOOGLE_DCHECK(rep_);
-  return rep_->elements;
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::InternalSwap(RepeatedField* other) {
-  GOOGLE_DCHECK(this != other);
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-
-  std::swap(rep_, other->rep_);
-  std::swap(current_size_, other->current_size_);
-  std::swap(total_size_, other->total_size_);
-}
-
-template <typename Element>
-void RepeatedField<Element>::Swap(RepeatedField* other) {
-  if (this == other) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    RepeatedField<Element> temp(other->GetArenaNoVirtual());
-    temp.MergeFrom(*this);
-    CopyFrom(*other);
-    other->UnsafeArenaSwap(&temp);
-  }
-}
-
-template <typename Element>
-void RepeatedField<Element>::UnsafeArenaSwap(RepeatedField* other) {
-  if (this == other) return;
-  InternalSwap(other);
-}
-
-template <typename Element>
-void RepeatedField<Element>::SwapElements(int index1, int index2) {
-  using std::swap;  // enable ADL with fallback
-  swap(rep_->elements[index1], rep_->elements[index2]);
-}
-
-template <typename Element>
-inline typename RepeatedField<Element>::iterator
-RepeatedField<Element>::begin() {
-  return rep_ ? rep_->elements : NULL;
-}
-template <typename Element>
-inline typename RepeatedField<Element>::const_iterator
-RepeatedField<Element>::begin() const {
-  return rep_ ? rep_->elements : NULL;
-}
-template <typename Element>
-inline typename RepeatedField<Element>::const_iterator
-RepeatedField<Element>::cbegin() const {
-  return rep_ ? rep_->elements : NULL;
-}
-template <typename Element>
-inline typename RepeatedField<Element>::iterator
-RepeatedField<Element>::end() {
-  return rep_ ? rep_->elements + current_size_ : NULL;
-}
-template <typename Element>
-inline typename RepeatedField<Element>::const_iterator
-RepeatedField<Element>::end() const {
-  return rep_ ? rep_->elements + current_size_ : NULL;
-}
-template <typename Element>
-inline typename RepeatedField<Element>::const_iterator
-RepeatedField<Element>::cend() const {
-  return rep_ ? rep_->elements + current_size_ : NULL;
-}
-
-template <typename Element>
-inline size_t RepeatedField<Element>::SpaceUsedExcludingSelfLong() const {
-  return rep_ ? (total_size_ * sizeof(Element) + kRepHeaderSize) : 0;
-}
-
-// Avoid inlining of Reserve(): new, copy, and delete[] lead to a significant
-// amount of code bloat.
-template <typename Element>
-void RepeatedField<Element>::Reserve(int new_size) {
-  if (total_size_ >= new_size) return;
-  Rep* old_rep = rep_;
-  Arena* arena = GetArenaNoVirtual();
-  new_size = std::max(google::protobuf::internal::kMinRepeatedFieldAllocationSize,
-                      std::max(total_size_ * 2, new_size));
-  GOOGLE_DCHECK_LE(
-      static_cast<size_t>(new_size),
-      (std::numeric_limits<size_t>::max() - kRepHeaderSize) / sizeof(Element))
-      << "Requested size is too large to fit into size_t.";
-  size_t bytes = kRepHeaderSize + sizeof(Element) * static_cast<size_t>(new_size);
-  if (arena == NULL) {
-    rep_ = static_cast<Rep*>(::operator new(bytes));
-  } else {
-    rep_ = reinterpret_cast<Rep*>(
-            ::google::protobuf::Arena::CreateArray<char>(arena, bytes));
-  }
-  rep_->arena = arena;
-  int old_total_size = total_size_;
-  total_size_ = new_size;
-  // Invoke placement-new on newly allocated elements. We shouldn't have to do
-  // this, since Element is supposed to be POD, but a previous version of this
-  // code allocated storage with "new Element[size]" and some code uses
-  // RepeatedField with non-POD types, relying on constructor invocation. If
-  // Element has a trivial constructor (e.g., int32), gcc (tested with -O2)
-  // completely removes this loop because the loop body is empty, so this has no
-  // effect unless its side-effects are required for correctness.
-  // Note that we do this before MoveArray() below because Element's copy
-  // assignment implementation will want an initialized instance first.
-  Element* e = &rep_->elements[0];
-  Element* limit = &rep_->elements[total_size_];
-  for (; e < limit; e++) {
-    new (e) Element;
-  }
-  if (current_size_ > 0) {
-    MoveArray(rep_->elements, old_rep->elements, current_size_);
-  }
-
-  // Likewise, we need to invoke destructors on the old array.
-  InternalDeallocate(old_rep, old_total_size);
-
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::Truncate(int new_size) {
-  GOOGLE_DCHECK_LE(new_size, current_size_);
-  if (current_size_ > 0) {
-    current_size_ = new_size;
-  }
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::MoveArray(
-  Element* to, Element* from, int array_size) {
-  CopyArray(to, from, array_size);
-}
-
-template <typename Element>
-inline void RepeatedField<Element>::CopyArray(
-  Element* to, const Element* from, int array_size) {
-  internal::ElementCopier<Element>()(to, from, array_size);
-}
-
-namespace internal {
-
-template <typename Element, bool HasTrivialCopy>
-void ElementCopier<Element, HasTrivialCopy>::operator()(
-  Element* to, const Element* from, int array_size) {
-  std::copy(from, from + array_size, to);
-}
-
-template <typename Element>
-struct ElementCopier<Element, true> {
-  void operator()(Element* to, const Element* from, int array_size) {
-    memcpy(to, from, static_cast<size_t>(array_size) * sizeof(Element));
-  }
-};
-
-}  // namespace internal
-
-
-// -------------------------------------------------------------------
-
-namespace internal {
-
-inline RepeatedPtrFieldBase::RepeatedPtrFieldBase()
-  : arena_(NULL),
-    current_size_(0),
-    total_size_(0),
-    rep_(NULL) {
-}
-
-inline RepeatedPtrFieldBase::RepeatedPtrFieldBase(::google::protobuf::Arena* arena)
-  : arena_(arena),
-    current_size_(0),
-    total_size_(0),
-    rep_(NULL) {
-}
-
-template <typename TypeHandler>
-void RepeatedPtrFieldBase::Destroy() {
-  if (rep_ != NULL && arena_ == NULL) {
-    int n = rep_->allocated_size;
-    void* const* elements = rep_->elements;
-    for (int i = 0; i < n; i++) {
-      TypeHandler::Delete(cast<TypeHandler>(elements[i]), NULL);
-    }
-#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
-    const size_t size = total_size_ * sizeof(elements[0]) + kRepHeaderSize;
-    ::operator delete(static_cast<void*>(rep_), size);
-#else
-    ::operator delete(static_cast<void*>(rep_));
-#endif
-  }
-  rep_ = NULL;
-}
-
-template <typename TypeHandler>
-inline void RepeatedPtrFieldBase::Swap(RepeatedPtrFieldBase* other) {
-  if (other->GetArenaNoVirtual() == GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    SwapFallback<TypeHandler>(other);
-  }
-}
-
-template <typename TypeHandler>
-void RepeatedPtrFieldBase::SwapFallback(RepeatedPtrFieldBase* other) {
-  GOOGLE_DCHECK(other->GetArenaNoVirtual() != GetArenaNoVirtual());
-
-  // Copy semantics in this case. We try to improve efficiency by placing the
-  // temporary on |other|'s arena so that messages are copied cross-arena only
-  // once, not twice.
-  RepeatedPtrFieldBase temp(other->GetArenaNoVirtual());
-  temp.MergeFrom<TypeHandler>(*this);
-  this->Clear<TypeHandler>();
-  this->MergeFrom<TypeHandler>(*other);
-  other->Clear<TypeHandler>();
-  other->InternalSwap(&temp);
-  temp.Destroy<TypeHandler>();  // Frees rep_ if `other` had no arena.
-}
-
-inline bool RepeatedPtrFieldBase::empty() const {
-  return current_size_ == 0;
-}
-
-inline int RepeatedPtrFieldBase::size() const {
-  return current_size_;
-}
-
-template <typename TypeHandler>
-inline const typename TypeHandler::Type&
-RepeatedPtrFieldBase::Get(int index) const {
-  GOOGLE_DCHECK_GE(index, 0);
-  GOOGLE_DCHECK_LT(index, current_size_);
-  return *cast<TypeHandler>(rep_->elements[index]);
-}
-
-
-template <typename TypeHandler>
-inline typename TypeHandler::Type*
-RepeatedPtrFieldBase::Mutable(int index) {
-  GOOGLE_DCHECK_GE(index, 0);
-  GOOGLE_DCHECK_LT(index, current_size_);
-  return cast<TypeHandler>(rep_->elements[index]);
-}
-
-template <typename TypeHandler>
-inline void RepeatedPtrFieldBase::Delete(int index) {
-  GOOGLE_DCHECK_GE(index, 0);
-  GOOGLE_DCHECK_LT(index, current_size_);
-  TypeHandler::Delete(cast<TypeHandler>(rep_->elements[index]), arena_);
-}
-
-template <typename TypeHandler>
-inline typename TypeHandler::Type* RepeatedPtrFieldBase::Add(
-    typename TypeHandler::Type* prototype) {
-  if (rep_ != NULL && current_size_ < rep_->allocated_size) {
-    return cast<TypeHandler>(rep_->elements[current_size_++]);
-  }
-  if (!rep_ || rep_->allocated_size == total_size_) {
-    Reserve(total_size_ + 1);
-  }
-  ++rep_->allocated_size;
-  typename TypeHandler::Type* result =
-      TypeHandler::NewFromPrototype(prototype, arena_);
-  rep_->elements[current_size_++] = result;
-  return result;
-}
-
-#if LANG_CXX11
-template <typename TypeHandler>
-inline void RepeatedPtrFieldBase::Add(
-    typename TypeHandler::Type&& value,
-    internal::enable_if<TypeHandler::Moveable>*) {
-  if (rep_ != NULL && current_size_ < rep_->allocated_size) {
-    *cast<TypeHandler>(rep_->elements[current_size_++]) = std::move(value);
-    return;
-  }
-  if (!rep_ || rep_->allocated_size == total_size_) {
-    Reserve(total_size_ + 1);
-  }
-  ++rep_->allocated_size;
-  typename TypeHandler::Type* result =
-      TypeHandler::New(arena_, std::move(value));
-  rep_->elements[current_size_++] = result;
-}
-#endif
-
-template <typename TypeHandler>
-inline void RepeatedPtrFieldBase::RemoveLast() {
-  GOOGLE_DCHECK_GT(current_size_, 0);
-  TypeHandler::Clear(cast<TypeHandler>(rep_->elements[--current_size_]));
-}
-
-template <typename TypeHandler>
-void RepeatedPtrFieldBase::Clear() {
-  const int n = current_size_;
-  GOOGLE_DCHECK_GE(n, 0);
-  if (n > 0) {
-    void* const* elements = rep_->elements;
-    int i = 0;
-    do {
-      TypeHandler::Clear(cast<TypeHandler>(elements[i++]));
-    } while (i < n);
-    current_size_ = 0;
-  }
-}
-
-// To avoid unnecessary code duplication and reduce binary size, we use a
-// layered approach to implementing MergeFrom(). The toplevel method is
-// templated, so we get a small thunk per concrete message type in the binary.
-// This calls a shared implementation with most of the logic, passing a function
-// pointer to another type-specific piece of code that calls the object-allocate
-// and merge handlers.
-template <typename TypeHandler>
-inline void RepeatedPtrFieldBase::MergeFrom(const RepeatedPtrFieldBase& other) {
-  GOOGLE_DCHECK_NE(&other, this);
-  if (other.current_size_ == 0) return;
-  MergeFromInternal(
-      other, &RepeatedPtrFieldBase::MergeFromInnerLoop<TypeHandler>);
-}
-
-inline void RepeatedPtrFieldBase::MergeFromInternal(
-    const RepeatedPtrFieldBase& other,
-    void (RepeatedPtrFieldBase::*inner_loop)(void**, void**, int, int)) {
-  // Note: wrapper has already guaranteed that other.rep_ != NULL here.
-  int other_size = other.current_size_;
-  void** other_elements = other.rep_->elements;
-  void** new_elements = InternalExtend(other_size);
-  int allocated_elems = rep_->allocated_size - current_size_;
-  (this->*inner_loop)(new_elements, other_elements,
-                      other_size, allocated_elems);
-  current_size_ += other_size;
-  if (rep_->allocated_size < current_size_) {
-    rep_->allocated_size = current_size_;
-  }
-}
-
-// Merges other_elems to our_elems.
-template<typename TypeHandler>
-void RepeatedPtrFieldBase::MergeFromInnerLoop(
-    void** our_elems, void** other_elems, int length, int already_allocated) {
-  // Split into two loops, over ranges [0, allocated) and [allocated, length),
-  // to avoid a branch within the loop.
-  for (int i = 0; i < already_allocated && i < length; i++) {
-    // Already allocated: use existing element.
-    typename TypeHandler::Type* other_elem =
-        reinterpret_cast<typename TypeHandler::Type*>(other_elems[i]);
-    typename TypeHandler::Type* new_elem =
-        reinterpret_cast<typename TypeHandler::Type*>(our_elems[i]);
-    TypeHandler::Merge(*other_elem, new_elem);
-  }
-  Arena* arena = GetArenaNoVirtual();
-  for (int i = already_allocated; i < length; i++) {
-    // Not allocated: alloc a new element first, then merge it.
-    typename TypeHandler::Type* other_elem =
-        reinterpret_cast<typename TypeHandler::Type*>(other_elems[i]);
-    typename TypeHandler::Type* new_elem =
-        TypeHandler::NewFromPrototype(other_elem, arena);
-    TypeHandler::Merge(*other_elem, new_elem);
-    our_elems[i] = new_elem;
-  }
-}
-
-template <typename TypeHandler>
-inline void RepeatedPtrFieldBase::CopyFrom(const RepeatedPtrFieldBase& other) {
-  if (&other == this) return;
-  RepeatedPtrFieldBase::Clear<TypeHandler>();
-  RepeatedPtrFieldBase::MergeFrom<TypeHandler>(other);
-}
-
-inline int RepeatedPtrFieldBase::Capacity() const {
-  return total_size_;
-}
-
-inline void* const* RepeatedPtrFieldBase::raw_data() const {
-  return rep_ ? rep_->elements : NULL;
-}
-
-inline void** RepeatedPtrFieldBase::raw_mutable_data() const {
-  return rep_ ? const_cast<void**>(rep_->elements) : NULL;
-}
-
-template <typename TypeHandler>
-inline typename TypeHandler::Type** RepeatedPtrFieldBase::mutable_data() {
-  // TODO(kenton):  Breaks C++ aliasing rules.  We should probably remove this
-  //   method entirely.
-  return reinterpret_cast<typename TypeHandler::Type**>(raw_mutable_data());
-}
-
-template <typename TypeHandler>
-inline const typename TypeHandler::Type* const*
-RepeatedPtrFieldBase::data() const {
-  // TODO(kenton):  Breaks C++ aliasing rules.  We should probably remove this
-  //   method entirely.
-  return reinterpret_cast<const typename TypeHandler::Type* const*>(raw_data());
-}
-
-inline void RepeatedPtrFieldBase::SwapElements(int index1, int index2) {
-  using std::swap;  // enable ADL with fallback
-  swap(rep_->elements[index1], rep_->elements[index2]);
-}
-
-template <typename TypeHandler>
-inline size_t RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong() const {
-  size_t allocated_bytes = static_cast<size_t>(total_size_) * sizeof(void*);
-  if (rep_ != NULL) {
-    for (int i = 0; i < rep_->allocated_size; ++i) {
-      allocated_bytes += TypeHandler::SpaceUsedLong(
-          *cast<TypeHandler>(rep_->elements[i]));
-    }
-    allocated_bytes += kRepHeaderSize;
-  }
-  return allocated_bytes;
-}
-
-template <typename TypeHandler>
-inline typename TypeHandler::Type* RepeatedPtrFieldBase::AddFromCleared() {
-  if (rep_ != NULL && current_size_ < rep_->allocated_size) {
-    return cast<TypeHandler>(rep_->elements[current_size_++]);
-  } else {
-    return NULL;
-  }
-}
-
-// AddAllocated version that implements arena-safe copying behavior.
-template <typename TypeHandler>
-void RepeatedPtrFieldBase::AddAllocatedInternal(
-    typename TypeHandler::Type* value,
-    google::protobuf::internal::true_type) {
-  Arena* element_arena = reinterpret_cast<Arena*>(
-      TypeHandler::GetMaybeArenaPointer(value));
-  Arena* arena = GetArenaNoVirtual();
-  if (arena == element_arena && rep_ &&
-      rep_->allocated_size < total_size_) {
-    // Fast path: underlying arena representation (tagged pointer) is equal to
-    // our arena pointer, and we can add to array without resizing it (at least
-    // one slot that is not allocated).
-    void** elems = rep_->elements;
-    if (current_size_ < rep_->allocated_size) {
-      // Make space at [current] by moving first allocated element to end of
-      // allocated list.
-      elems[rep_->allocated_size] = elems[current_size_];
-    }
-    elems[current_size_] = value;
-    current_size_ = current_size_ + 1;
-    rep_->allocated_size = rep_->allocated_size + 1;
-  } else {
-    AddAllocatedSlowWithCopy<TypeHandler>(
-        value, TypeHandler::GetArena(value), arena);
-  }
-}
-
-// Slowpath handles all cases, copying if necessary.
-template<typename TypeHandler>
-void RepeatedPtrFieldBase::AddAllocatedSlowWithCopy(
-    // Pass value_arena and my_arena to avoid duplicate virtual call (value) or
-    // load (mine).
-    typename TypeHandler::Type* value, Arena* value_arena, Arena* my_arena) {
-  // Ensure that either the value is in the same arena, or if not, we do the
-  // appropriate thing: Own() it (if it's on heap and we're in an arena) or copy
-  // it to our arena/heap (otherwise).
-  if (my_arena != NULL && value_arena == NULL) {
-    my_arena->Own(value);
-  } else if (my_arena != value_arena) {
-    typename TypeHandler::Type* new_value =
-        TypeHandler::NewFromPrototype(value, my_arena);
-    TypeHandler::Merge(*value, new_value);
-    TypeHandler::Delete(value, value_arena);
-    value = new_value;
-  }
-
-  UnsafeArenaAddAllocated<TypeHandler>(value);
-}
-
-// AddAllocated version that does not implement arena-safe copying behavior.
-template <typename TypeHandler>
-void RepeatedPtrFieldBase::AddAllocatedInternal(
-    typename TypeHandler::Type* value,
-    google::protobuf::internal::false_type) {
-  if (rep_ &&  rep_->allocated_size < total_size_) {
-    // Fast path: underlying arena representation (tagged pointer) is equal to
-    // our arena pointer, and we can add to array without resizing it (at least
-    // one slot that is not allocated).
-    void** elems = rep_->elements;
-    if (current_size_ < rep_->allocated_size) {
-      // Make space at [current] by moving first allocated element to end of
-      // allocated list.
-      elems[rep_->allocated_size] = elems[current_size_];
-    }
-    elems[current_size_] = value;
-    current_size_ = current_size_ + 1;
-    ++rep_->allocated_size;
-  } else {
-    UnsafeArenaAddAllocated<TypeHandler>(value);
-  }
-}
-
-template <typename TypeHandler>
-void RepeatedPtrFieldBase::UnsafeArenaAddAllocated(
-    typename TypeHandler::Type* value) {
-  // Make room for the new pointer.
-  if (!rep_ || current_size_ == total_size_) {
-    // The array is completely full with no cleared objects, so grow it.
-    Reserve(total_size_ + 1);
-    ++rep_->allocated_size;
-  } else if (rep_->allocated_size == total_size_) {
-    // There is no more space in the pointer array because it contains some
-    // cleared objects awaiting reuse.  We don't want to grow the array in this
-    // case because otherwise a loop calling AddAllocated() followed by Clear()
-    // would leak memory.
-    TypeHandler::Delete(
-        cast<TypeHandler>(rep_->elements[current_size_]), arena_);
-  } else if (current_size_ < rep_->allocated_size) {
-    // We have some cleared objects.  We don't care about their order, so we
-    // can just move the first one to the end to make space.
-    rep_->elements[rep_->allocated_size] = rep_->elements[current_size_];
-    ++rep_->allocated_size;
-  } else {
-    // There are no cleared objects.
-    ++rep_->allocated_size;
-  }
-
-  rep_->elements[current_size_++] = value;
-}
-
-// ReleaseLast() for types that implement merge/copy behavior.
-template <typename TypeHandler>
-inline typename TypeHandler::Type*
-RepeatedPtrFieldBase::ReleaseLastInternal(google::protobuf::internal::true_type) {
-  // First, release an element.
-  typename TypeHandler::Type* result = UnsafeArenaReleaseLast<TypeHandler>();
-  // Now perform a copy if we're on an arena.
-  Arena* arena = GetArenaNoVirtual();
-  if (arena == NULL) {
-    return result;
-  } else {
-    typename TypeHandler::Type* new_result =
-        TypeHandler::NewFromPrototype(result, NULL);
-    TypeHandler::Merge(*result, new_result);
-    return new_result;
-  }
-}
-
-// ReleaseLast() for types that *do not* implement merge/copy behavior -- this
-// is the same as UnsafeArenaReleaseLast(). Note that we GOOGLE_DCHECK-fail if we're on
-// an arena, since the user really should implement the copy operation in this
-// case.
-template <typename TypeHandler>
-inline typename TypeHandler::Type*
-RepeatedPtrFieldBase::ReleaseLastInternal(google::protobuf::internal::false_type) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL)
-      << "ReleaseLast() called on a RepeatedPtrField that is on an arena, "
-      << "with a type that does not implement MergeFrom. This is unsafe; "
-      << "please implement MergeFrom for your type.";
-  return UnsafeArenaReleaseLast<TypeHandler>();
-}
-
-template <typename TypeHandler>
-inline typename TypeHandler::Type*
-  RepeatedPtrFieldBase::UnsafeArenaReleaseLast() {
-  GOOGLE_DCHECK_GT(current_size_, 0);
-  typename TypeHandler::Type* result =
-      cast<TypeHandler>(rep_->elements[--current_size_]);
-  --rep_->allocated_size;
-  if (current_size_ < rep_->allocated_size) {
-    // There are cleared elements on the end; replace the removed element
-    // with the last allocated element.
-    rep_->elements[current_size_] = rep_->elements[rep_->allocated_size];
-  }
-  return result;
-}
-
-inline int RepeatedPtrFieldBase::ClearedCount() const {
-  return rep_ ? (rep_->allocated_size - current_size_) : 0;
-}
-
-template <typename TypeHandler>
-inline void RepeatedPtrFieldBase::AddCleared(
-    typename TypeHandler::Type* value) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL)
-      << "AddCleared() can only be used on a RepeatedPtrField not on an arena.";
-  GOOGLE_DCHECK(TypeHandler::GetArena(value) == NULL)
-      << "AddCleared() can only accept values not on an arena.";
-  if (!rep_ || rep_->allocated_size == total_size_) {
-    Reserve(total_size_ + 1);
-  }
-  rep_->elements[rep_->allocated_size++] = value;
-}
-
-template <typename TypeHandler>
-inline typename TypeHandler::Type* RepeatedPtrFieldBase::ReleaseCleared() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL)
-      << "ReleaseCleared() can only be used on a RepeatedPtrField not on "
-      << "an arena.";
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  GOOGLE_DCHECK(rep_ != NULL);
-  GOOGLE_DCHECK_GT(rep_->allocated_size, current_size_);
-  return cast<TypeHandler>(rep_->elements[--rep_->allocated_size]);
-}
-
-}  // namespace internal
-
-// -------------------------------------------------------------------
-
-template <typename Element>
-class RepeatedPtrField<Element>::TypeHandler
-    : public internal::GenericTypeHandler<Element> {
-};
-
-template <>
-class RepeatedPtrField<string>::TypeHandler
-    : public internal::StringTypeHandler {
-};
-
-template <typename Element>
-inline RepeatedPtrField<Element>::RepeatedPtrField()
-  : RepeatedPtrFieldBase() {}
-
-template <typename Element>
-inline RepeatedPtrField<Element>::RepeatedPtrField(::google::protobuf::Arena* arena) :
-  RepeatedPtrFieldBase(arena) {}
-
-template <typename Element>
-inline RepeatedPtrField<Element>::RepeatedPtrField(
-    const RepeatedPtrField& other)
-  : RepeatedPtrFieldBase() {
-  MergeFrom(other);
-}
-
-template <typename Element>
-template <typename Iter>
-inline RepeatedPtrField<Element>::RepeatedPtrField(
-    Iter begin, const Iter& end) {
-  int reserve = internal::CalculateReserve(begin, end);
-  if (reserve != -1) {
-    Reserve(reserve);
-  }
-  for (; begin != end; ++begin) {
-    *Add() = *begin;
-  }
-}
-
-template <typename Element>
-RepeatedPtrField<Element>::~RepeatedPtrField() {
-  Destroy<TypeHandler>();
-}
-
-template <typename Element>
-inline RepeatedPtrField<Element>& RepeatedPtrField<Element>::operator=(
-    const RepeatedPtrField& other) {
-  if (this != &other)
-    CopyFrom(other);
-  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();
-}
-
-template <typename Element>
-inline int RepeatedPtrField<Element>::size() const {
-  return RepeatedPtrFieldBase::size();
-}
-
-template <typename Element>
-inline const Element& RepeatedPtrField<Element>::Get(int index) const {
-  return RepeatedPtrFieldBase::Get<TypeHandler>(index);
-}
-
-
 template <typename Element>
-inline Element* RepeatedPtrField<Element>::Mutable(int index) {
-  return RepeatedPtrFieldBase::Mutable<TypeHandler>(index);
-}
-
-template <typename Element>
-inline Element* RepeatedPtrField<Element>::Add() {
-  return RepeatedPtrFieldBase::Add<TypeHandler>();
-}
-
-#if LANG_CXX11
-template <typename Element>
-inline void RepeatedPtrField<Element>::Add(Element&& value) {
-  RepeatedPtrFieldBase::Add<TypeHandler>(std::move(value));
-}
-#endif
-
-template <typename Element>
-inline void RepeatedPtrField<Element>::RemoveLast() {
-  RepeatedPtrFieldBase::RemoveLast<TypeHandler>();
-}
-
-template <typename Element>
-inline void RepeatedPtrField<Element>::DeleteSubrange(int start, int num) {
-  GOOGLE_DCHECK_GE(start, 0);
-  GOOGLE_DCHECK_GE(num, 0);
-  GOOGLE_DCHECK_LE(start + num, size());
-  for (int i = 0; i < num; ++i) {
-    RepeatedPtrFieldBase::Delete<TypeHandler>(start + i);
-  }
-  ExtractSubrange(start, num, NULL);
-}
-
-template <typename Element>
-inline void RepeatedPtrField<Element>::ExtractSubrange(
-    int start, int num, Element** elements) {
-  typename internal::TypeImplementsMergeBehavior<
-      typename TypeHandler::Type>::type t;
-  ExtractSubrangeInternal(start, num, elements, t);
+inline const Element* RepeatedField<Element>::data() const {
+  return unsafe_elements();
 }
 
-// ExtractSubrange() implementation for types that implement merge/copy
-// behavior.
 template <typename Element>
-inline void RepeatedPtrField<Element>::ExtractSubrangeInternal(
-    int start, int num, Element** elements, google::protobuf::internal::true_type) {
-  GOOGLE_DCHECK_GE(start, 0);
-  GOOGLE_DCHECK_GE(num, 0);
-  GOOGLE_DCHECK_LE(start + num, size());
-
-  if (num > 0) {
-    // Save the values of the removed elements if requested.
-    if (elements != NULL) {
-      if (GetArenaNoVirtual() != NULL) {
-        // If we're on an arena, we perform a copy for each element so that the
-        // returned elements are heap-allocated.
-        for (int i = 0; i < num; ++i) {
-          Element* element = RepeatedPtrFieldBase::
-              Mutable<TypeHandler>(i + start);
-          typename TypeHandler::Type* new_value =
-              TypeHandler::NewFromPrototype(element, NULL);
-          TypeHandler::Merge(*element, new_value);
-          elements[i] = new_value;
-        }
-      } else {
-        for (int i = 0; i < num; ++i) {
-          elements[i] = RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start);
-        }
-      }
-    }
-    CloseGap(start, num);
-  }
-}
+inline void RepeatedField<Element>::InternalSwap(RepeatedField* other) {
+  GOOGLE_DCHECK(this != other);
 
-// ExtractSubrange() implementation for types that do not implement merge/copy
-// behavior.
-template<typename Element>
-inline void RepeatedPtrField<Element>::ExtractSubrangeInternal(
-    int start, int num, Element** elements, google::protobuf::internal::false_type) {
-  // This case is identical to UnsafeArenaExtractSubrange(). However, since
-  // ExtractSubrange() must return heap-allocated objects by contract, and we
-  // cannot fulfill this contract if we are an on arena, we must GOOGLE_DCHECK() that
-  // we are not on an arena.
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL)
-      << "ExtractSubrange() when arena is non-NULL is only supported when "
-      << "the Element type supplies a MergeFrom() operation to make copies.";
-  UnsafeArenaExtractSubrange(start, num, elements);
+  // Swap all fields at once.
+  static_assert(std::is_standard_layout<RepeatedField<Element>>::value,
+                "offsetof() requires standard layout before c++17");
+  internal::memswap<offsetof(RepeatedField, arena_or_elements_) +
+                    sizeof(this->arena_or_elements_) -
+                    offsetof(RepeatedField, current_size_)>(
+      reinterpret_cast<char*>(this) + offsetof(RepeatedField, current_size_),
+      reinterpret_cast<char*>(other) + offsetof(RepeatedField, current_size_));
 }
 
 template <typename Element>
-inline void RepeatedPtrField<Element>::UnsafeArenaExtractSubrange(
-    int start, int num, Element** elements) {
-  GOOGLE_DCHECK_GE(start, 0);
-  GOOGLE_DCHECK_GE(num, 0);
-  GOOGLE_DCHECK_LE(start + num, size());
-
-  if (num > 0) {
-    // Save the values of the removed elements if requested.
-    if (elements != NULL) {
-      for (int i = 0; i < num; ++i) {
-        elements[i] = RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start);
-      }
-    }
-    CloseGap(start, num);
+void RepeatedField<Element>::Swap(RepeatedField* other) {
+  if (this == other) return;
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+  if (GetArena() != nullptr && GetArena() == other->GetArena()) {
+#else   // PROTOBUF_FORCE_COPY_IN_SWAP
+  if (GetArena() == other->GetArena()) {
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+    InternalSwap(other);
+  } else {
+    RepeatedField<Element> temp(other->GetArena());
+    temp.MergeFrom(*this);
+    CopyFrom(*other);
+    other->UnsafeArenaSwap(&temp);
   }
 }
 
 template <typename Element>
-inline void RepeatedPtrField<Element>::Clear() {
-  RepeatedPtrFieldBase::Clear<TypeHandler>();
-}
-
-template <typename Element>
-inline void RepeatedPtrField<Element>::MergeFrom(
-    const RepeatedPtrField& other) {
-  RepeatedPtrFieldBase::MergeFrom<TypeHandler>(other);
-}
-
-template <typename Element>
-inline void RepeatedPtrField<Element>::CopyFrom(
-    const RepeatedPtrField& other) {
-  RepeatedPtrFieldBase::CopyFrom<TypeHandler>(other);
+void RepeatedField<Element>::UnsafeArenaSwap(RepeatedField* other) {
+  if (this == other) return;
+  InternalSwap(other);
 }
 
 template <typename Element>
-inline typename RepeatedPtrField<Element>::iterator
-RepeatedPtrField<Element>::erase(const_iterator position) {
-  return erase(position, position + 1);
+void RepeatedField<Element>::SwapElements(int index1, int index2) {
+  using std::swap;  // enable ADL with fallback
+  swap(elements()[index1], elements()[index2]);
 }
 
 template <typename Element>
-inline typename RepeatedPtrField<Element>::iterator
-RepeatedPtrField<Element>::erase(const_iterator first, const_iterator last) {
-  size_type pos_offset = std::distance(cbegin(), first);
-  size_type last_offset = std::distance(cbegin(), last);
-  DeleteSubrange(pos_offset, last_offset - pos_offset);
-  return begin() + pos_offset;
+inline typename RepeatedField<Element>::iterator
+RepeatedField<Element>::begin() {
+  return unsafe_elements();
 }
-
 template <typename Element>
-inline Element** RepeatedPtrField<Element>::mutable_data() {
-  return RepeatedPtrFieldBase::mutable_data<TypeHandler>();
+inline typename RepeatedField<Element>::const_iterator
+RepeatedField<Element>::begin() const {
+  return unsafe_elements();
 }
-
 template <typename Element>
-inline const Element* const* RepeatedPtrField<Element>::data() const {
-  return RepeatedPtrFieldBase::data<TypeHandler>();
+inline typename RepeatedField<Element>::const_iterator
+RepeatedField<Element>::cbegin() const {
+  return unsafe_elements();
 }
-
 template <typename Element>
-inline void RepeatedPtrField<Element>::Swap(RepeatedPtrField* other) {
-  if (this == other)
-    return;
-  RepeatedPtrFieldBase::Swap<TypeHandler>(other);
+inline typename RepeatedField<Element>::iterator RepeatedField<Element>::end() {
+  return unsafe_elements() + current_size_;
 }
-
 template <typename Element>
-inline void RepeatedPtrField<Element>::UnsafeArenaSwap(
-    RepeatedPtrField* other) {
-  if (this == other)
-      return;
-  RepeatedPtrFieldBase::InternalSwap(other);
+inline typename RepeatedField<Element>::const_iterator
+RepeatedField<Element>::end() const {
+  return unsafe_elements() + current_size_;
 }
-
 template <typename Element>
-inline void RepeatedPtrField<Element>::SwapElements(int index1, int index2) {
-  RepeatedPtrFieldBase::SwapElements(index1, index2);
+inline typename RepeatedField<Element>::const_iterator
+RepeatedField<Element>::cend() const {
+  return unsafe_elements() + current_size_;
 }
 
 template <typename Element>
-inline Arena* RepeatedPtrField<Element>::GetArenaNoVirtual() const {
-  return RepeatedPtrFieldBase::GetArenaNoVirtual();
+inline size_t RepeatedField<Element>::SpaceUsedExcludingSelfLong() const {
+  return total_size_ > 0 ? (total_size_ * sizeof(Element) + kRepHeaderSize) : 0;
 }
 
-template <typename Element>
-inline size_t RepeatedPtrField<Element>::SpaceUsedExcludingSelfLong() const {
-  return RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong<TypeHandler>();
+namespace internal {
+// Returns the new size for a reserved field based on its 'total_size' and the
+// requested 'new_size'. The result is clamped to the closed interval:
+//   [internal::kMinRepeatedFieldAllocationSize,
+//    std::numeric_limits<int>::max()]
+// Requires:
+//     new_size > total_size &&
+//     (total_size == 0 ||
+//      total_size >= kRepeatedFieldLowerClampLimit)
+inline int CalculateReserveSize(int total_size, int new_size) {
+  if (new_size < kRepeatedFieldLowerClampLimit) {
+    // Clamp to smallest allowed size.
+    return kRepeatedFieldLowerClampLimit;
+  }
+  if (total_size < kRepeatedFieldUpperClampLimit) {
+    return std::max(total_size * 2, new_size);
+  } else {
+    // Clamp to largest allowed size.
+    GOOGLE_DCHECK_GT(new_size, kRepeatedFieldUpperClampLimit);
+    return std::numeric_limits<int>::max();
+  }
 }
+}  // namespace internal
 
+// Avoid inlining of Reserve(): new, copy, and delete[] lead to a significant
+// amount of code bloat.
 template <typename Element>
-inline void RepeatedPtrField<Element>::AddAllocated(Element* value) {
-  RepeatedPtrFieldBase::AddAllocated<TypeHandler>(value);
-}
+void RepeatedField<Element>::Reserve(int new_size) {
+  if (total_size_ >= new_size) return;
+  Rep* old_rep = total_size_ > 0 ? rep() : nullptr;
+  Rep* new_rep;
+  Arena* arena = GetArena();
+  new_size = internal::CalculateReserveSize(total_size_, new_size);
+  GOOGLE_DCHECK_LE(
+      static_cast<size_t>(new_size),
+      (std::numeric_limits<size_t>::max() - kRepHeaderSize) / sizeof(Element))
+      << "Requested size is too large to fit into size_t.";
+  size_t bytes =
+      kRepHeaderSize + sizeof(Element) * static_cast<size_t>(new_size);
+  if (arena == nullptr) {
+    new_rep = static_cast<Rep*>(::operator new(bytes));
+  } else {
+    new_rep = reinterpret_cast<Rep*>(Arena::CreateArray<char>(arena, bytes));
+  }
+  new_rep->arena = arena;
+  int old_total_size = total_size_;
+  // Already known: new_size >= internal::kMinRepeatedFieldAllocationSize
+  // Maintain invariant:
+  //     total_size_ == 0 ||
+  //     total_size_ >= internal::kMinRepeatedFieldAllocationSize
+  total_size_ = new_size;
+  arena_or_elements_ = new_rep->elements;
+  // Invoke placement-new on newly allocated elements. We shouldn't have to do
+  // this, since Element is supposed to be POD, but a previous version of this
+  // code allocated storage with "new Element[size]" and some code uses
+  // RepeatedField with non-POD types, relying on constructor invocation. If
+  // Element has a trivial constructor (e.g., int32_t), gcc (tested with -O2)
+  // completely removes this loop because the loop body is empty, so this has no
+  // effect unless its side-effects are required for correctness.
+  // Note that we do this before MoveArray() below because Element's copy
+  // assignment implementation will want an initialized instance first.
+  Element* e = &elements()[0];
+  Element* limit = e + total_size_;
+  for (; e < limit; e++) {
+    new (e) Element;
+  }
+  if (current_size_ > 0) {
+    MoveArray(&elements()[0], old_rep->elements, current_size_);
+  }
 
-template <typename Element>
-inline void RepeatedPtrField<Element>::UnsafeArenaAddAllocated(Element* value) {
-  RepeatedPtrFieldBase::UnsafeArenaAddAllocated<TypeHandler>(value);
-}
+  // Likewise, we need to invoke destructors on the old array.
+  InternalDeallocate(old_rep, old_total_size);
 
-template <typename Element>
-inline Element* RepeatedPtrField<Element>::ReleaseLast() {
-  return RepeatedPtrFieldBase::ReleaseLast<TypeHandler>();
 }
 
 template <typename Element>
-inline Element* RepeatedPtrField<Element>::UnsafeArenaReleaseLast() {
-  return RepeatedPtrFieldBase::UnsafeArenaReleaseLast<TypeHandler>();
+inline void RepeatedField<Element>::Truncate(int new_size) {
+  GOOGLE_DCHECK_LE(new_size, current_size_);
+  if (current_size_ > 0) {
+    current_size_ = new_size;
+  }
 }
 
 template <typename Element>
-inline int RepeatedPtrField<Element>::ClearedCount() const {
-  return RepeatedPtrFieldBase::ClearedCount();
+inline void RepeatedField<Element>::MoveArray(Element* to, Element* from,
+                                              int array_size) {
+  CopyArray(to, from, array_size);
 }
 
 template <typename Element>
-inline void RepeatedPtrField<Element>::AddCleared(Element* value) {
-  return RepeatedPtrFieldBase::AddCleared<TypeHandler>(value);
+inline void RepeatedField<Element>::CopyArray(Element* to, const Element* from,
+                                              int array_size) {
+  internal::ElementCopier<Element>()(to, from, array_size);
 }
 
-template <typename Element>
-inline Element* RepeatedPtrField<Element>::ReleaseCleared() {
-  return RepeatedPtrFieldBase::ReleaseCleared<TypeHandler>();
-}
+namespace internal {
 
-template <typename Element>
-inline void RepeatedPtrField<Element>::Reserve(int new_size) {
-  return RepeatedPtrFieldBase::Reserve(new_size);
+template <typename Element, bool HasTrivialCopy>
+void ElementCopier<Element, HasTrivialCopy>::operator()(Element* to,
+                                                        const Element* from,
+                                                        int array_size) {
+  std::copy(from, from + array_size, to);
 }
 
 template <typename Element>
-inline int RepeatedPtrField<Element>::Capacity() const {
-  return RepeatedPtrFieldBase::Capacity();
-}
-
-// -------------------------------------------------------------------
-
-namespace internal {
-
-// STL-like iterator implementation for RepeatedPtrField.  You should not
-// refer to this class directly; use RepeatedPtrField<T>::iterator instead.
-//
-// The iterator for RepeatedPtrField<T>, RepeatedPtrIterator<T>, is
-// very similar to iterator_ptr<T**> in util/gtl/iterator_adaptors.h,
-// but adds random-access operators and is modified to wrap a void** base
-// iterator (since RepeatedPtrField stores its array as a void* array and
-// casting void** to T** would violate C++ aliasing rules).
-//
-// This code based on net/proto/proto-array-internal.h by Jeffrey Yasskin
-// (jyasskin@google.com).
-template<typename Element>
-class RepeatedPtrIterator
-    : public std::iterator<
-          std::random_access_iterator_tag, Element> {
- public:
-  typedef RepeatedPtrIterator<Element> iterator;
-  typedef std::iterator<
-          std::random_access_iterator_tag, Element> superclass;
-
-  // Shadow the value_type in std::iterator<> because const_iterator::value_type
-  // needs to be T, not const T.
-  typedef typename remove_const<Element>::type value_type;
-
-  // Let the compiler know that these are type names, so we don't have to
-  // write "typename" in front of them everywhere.
-  typedef typename superclass::reference reference;
-  typedef typename superclass::pointer pointer;
-  typedef typename superclass::difference_type difference_type;
-
-  RepeatedPtrIterator() : it_(NULL) {}
-  explicit RepeatedPtrIterator(void* const* it) : it_(it) {}
-
-  // Allow "upcasting" from RepeatedPtrIterator<T**> to
-  // RepeatedPtrIterator<const T*const*>.
-  template<typename OtherElement>
-  RepeatedPtrIterator(const RepeatedPtrIterator<OtherElement>& other)
-      : it_(other.it_) {
-    // Force a compiler error if the other type is not convertible to ours.
-    if (false) {
-      implicit_cast<Element*>(static_cast<OtherElement*>(NULL));
-    }
-  }
-
-  // dereferenceable
-  reference operator*() const { return *reinterpret_cast<Element*>(*it_); }
-  pointer   operator->() const { return &(operator*()); }
-
-  // {inc,dec}rementable
-  iterator& operator++() { ++it_; return *this; }
-  iterator  operator++(int) { return iterator(it_++); }
-  iterator& operator--() { --it_; return *this; }
-  iterator  operator--(int) { return iterator(it_--); }
-
-  // equality_comparable
-  bool operator==(const iterator& x) const { return it_ == x.it_; }
-  bool operator!=(const iterator& x) const { return it_ != x.it_; }
-
-  // less_than_comparable
-  bool operator<(const iterator& x) const { return it_ < x.it_; }
-  bool operator<=(const iterator& x) const { return it_ <= x.it_; }
-  bool operator>(const iterator& x) const { return it_ > x.it_; }
-  bool operator>=(const iterator& x) const { return it_ >= x.it_; }
-
-  // addable, subtractable
-  iterator& operator+=(difference_type d) {
-    it_ += d;
-    return *this;
-  }
-  friend iterator operator+(iterator it, const difference_type d) {
-    it += d;
-    return it;
-  }
-  friend iterator operator+(const difference_type d, iterator it) {
-    it += d;
-    return it;
-  }
-  iterator& operator-=(difference_type d) {
-    it_ -= d;
-    return *this;
-  }
-  friend iterator operator-(iterator it, difference_type d) {
-    it -= d;
-    return it;
-  }
-
-  // indexable
-  reference operator[](difference_type d) const { return *(*this + d); }
-
-  // random access iterator
-  difference_type operator-(const iterator& x) const { return it_ - x.it_; }
-
- private:
-  template<typename OtherElement>
-  friend class RepeatedPtrIterator;
-
-  // The internal iterator.
-  void* const* it_;
-};
-
-// Provide an iterator that operates on pointers to the underlying objects
-// rather than the objects themselves as RepeatedPtrIterator does.
-// Consider using this when working with stl algorithms that change
-// the array.
-// The VoidPtr template parameter holds the type-agnostic pointer value
-// referenced by the iterator.  It should either be "void *" for a mutable
-// iterator, or "const void* const" for a constant iterator.
-template <typename Element, typename VoidPtr>
-class RepeatedPtrOverPtrsIterator
-    : public std::iterator<std::random_access_iterator_tag, Element> {
- public:
-  typedef RepeatedPtrOverPtrsIterator<Element, VoidPtr> iterator;
-  typedef std::iterator<std::random_access_iterator_tag, Element> superclass;
-
-  // Shadow the value_type in std::iterator<> because const_iterator::value_type
-  // needs to be T, not const T.
-  typedef typename remove_const<Element>::type value_type;
-
-  // Let the compiler know that these are type names, so we don't have to
-  // write "typename" in front of them everywhere.
-  typedef typename superclass::reference reference;
-  typedef typename superclass::pointer pointer;
-  typedef typename superclass::difference_type difference_type;
-
-  RepeatedPtrOverPtrsIterator() : it_(NULL) {}
-  explicit RepeatedPtrOverPtrsIterator(VoidPtr* it) : it_(it) {}
-
-  // dereferenceable
-  reference operator*() const { return *reinterpret_cast<Element*>(it_); }
-  pointer   operator->() const { return &(operator*()); }
-
-  // {inc,dec}rementable
-  iterator& operator++() { ++it_; return *this; }
-  iterator  operator++(int) { return iterator(it_++); }
-  iterator& operator--() { --it_; return *this; }
-  iterator  operator--(int) { return iterator(it_--); }
-
-  // equality_comparable
-  bool operator==(const iterator& x) const { return it_ == x.it_; }
-  bool operator!=(const iterator& x) const { return it_ != x.it_; }
-
-  // less_than_comparable
-  bool operator<(const iterator& x) const { return it_ < x.it_; }
-  bool operator<=(const iterator& x) const { return it_ <= x.it_; }
-  bool operator>(const iterator& x) const { return it_ > x.it_; }
-  bool operator>=(const iterator& x) const { return it_ >= x.it_; }
-
-  // addable, subtractable
-  iterator& operator+=(difference_type d) {
-    it_ += d;
-    return *this;
-  }
-  friend iterator operator+(iterator it, difference_type d) {
-    it += d;
-    return it;
-  }
-  friend iterator operator+(difference_type d, iterator it) {
-    it += d;
-    return it;
-  }
-  iterator& operator-=(difference_type d) {
-    it_ -= d;
-    return *this;
-  }
-  friend iterator operator-(iterator it, difference_type d) {
-    it -= d;
-    return it;
+struct ElementCopier<Element, true> {
+  void operator()(Element* to, const Element* from, int array_size) {
+    memcpy(to, from, static_cast<size_t>(array_size) * sizeof(Element));
   }
-
-  // indexable
-  reference operator[](difference_type d) const { return *(*this + d); }
-
-  // random access iterator
-  difference_type operator-(const iterator& x) const { return it_ - x.it_; }
-
- private:
-  template<typename OtherElement>
-  friend class RepeatedPtrIterator;
-
-  // The internal iterator.
-  VoidPtr* it_;
 };
 
-void RepeatedPtrFieldBase::InternalSwap(RepeatedPtrFieldBase* other) {
-  GOOGLE_DCHECK(this != other);
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-
-  std::swap(rep_, other->rep_);
-  std::swap(current_size_, other->current_size_);
-  std::swap(total_size_, other->total_size_);
-}
-
 }  // namespace internal
 
-template <typename Element>
-inline typename RepeatedPtrField<Element>::iterator
-RepeatedPtrField<Element>::begin() {
-  return iterator(raw_data());
-}
-template <typename Element>
-inline typename RepeatedPtrField<Element>::const_iterator
-RepeatedPtrField<Element>::begin() const {
-  return iterator(raw_data());
-}
-template <typename Element>
-inline typename RepeatedPtrField<Element>::const_iterator
-RepeatedPtrField<Element>::cbegin() const {
-  return begin();
-}
-template <typename Element>
-inline typename RepeatedPtrField<Element>::iterator
-RepeatedPtrField<Element>::end() {
-  return iterator(raw_data() + size());
-}
-template <typename Element>
-inline typename RepeatedPtrField<Element>::const_iterator
-RepeatedPtrField<Element>::end() const {
-  return iterator(raw_data() + size());
-}
-template <typename Element>
-inline typename RepeatedPtrField<Element>::const_iterator
-RepeatedPtrField<Element>::cend() const {
-  return end();
-}
-
-template <typename Element>
-inline typename RepeatedPtrField<Element>::pointer_iterator
-RepeatedPtrField<Element>::pointer_begin() {
-  return pointer_iterator(raw_mutable_data());
-}
-template <typename Element>
-inline typename RepeatedPtrField<Element>::const_pointer_iterator
-RepeatedPtrField<Element>::pointer_begin() const {
-  return const_pointer_iterator(const_cast<const void* const*>(raw_data()));
-}
-template <typename Element>
-inline typename RepeatedPtrField<Element>::pointer_iterator
-RepeatedPtrField<Element>::pointer_end() {
-  return pointer_iterator(raw_mutable_data() + size());
-}
-template <typename Element>
-inline typename RepeatedPtrField<Element>::const_pointer_iterator
-RepeatedPtrField<Element>::pointer_end() const {
-  return const_pointer_iterator(
-      const_cast<const void* const*>(raw_data() + size()));
-}
 
+// -------------------------------------------------------------------
 
 // Iterators and helper functions that follow the spirit of the STL
 // std::back_insert_iterator and std::back_inserter but are tailor-made
 // for RepeatedField and RepeatedPtrField. Typical usage would be:
 //
 //   std::copy(some_sequence.begin(), some_sequence.end(),
-//             google::protobuf::RepeatedFieldBackInserter(proto.mutable_sequence()));
+//             RepeatedFieldBackInserter(proto.mutable_sequence()));
 //
 // Ported by johannes from util/gtl/proto-array-iterators.h
 
 namespace internal {
 // A back inserter for RepeatedField objects.
-template<typename T> class RepeatedFieldBackInsertIterator
-    : public std::iterator<std::output_iterator_tag, T> {
+template <typename T>
+class RepeatedFieldBackInsertIterator {
  public:
+  using iterator_category = std::output_iterator_tag;
+  using value_type = T;
+  using pointer = void;
+  using reference = void;
+  using difference_type = std::ptrdiff_t;
+
   explicit RepeatedFieldBackInsertIterator(
       RepeatedField<T>* const mutable_field)
-      : field_(mutable_field) {
-  }
+      : field_(mutable_field) {}
   RepeatedFieldBackInsertIterator<T>& operator=(const T& value) {
     field_->Add(value);
     return *this;
   }
-  RepeatedFieldBackInsertIterator<T>& operator*() {
-    return *this;
-  }
-  RepeatedFieldBackInsertIterator<T>& operator++() {
-    return *this;
-  }
+  RepeatedFieldBackInsertIterator<T>& operator*() { return *this; }
+  RepeatedFieldBackInsertIterator<T>& operator++() { return *this; }
   RepeatedFieldBackInsertIterator<T>& operator++(int /* unused */) {
     return *this;
   }
@@ -2502,156 +1030,28 @@ template<typename T> class RepeatedFieldBackInsertIterator
   RepeatedField<T>* field_;
 };
 
-// A back inserter for RepeatedPtrField objects.
-template<typename T> class RepeatedPtrFieldBackInsertIterator
-    : public std::iterator<std::output_iterator_tag, T> {
- public:
-  RepeatedPtrFieldBackInsertIterator(
-      RepeatedPtrField<T>* const mutable_field)
-      : field_(mutable_field) {
-  }
-  RepeatedPtrFieldBackInsertIterator<T>& operator=(const T& value) {
-    *field_->Add() = value;
-    return *this;
-  }
-  RepeatedPtrFieldBackInsertIterator<T>& operator=(
-      const T* const ptr_to_value) {
-    *field_->Add() = *ptr_to_value;
-    return *this;
-  }
-#if LANG_CXX11
-  RepeatedPtrFieldBackInsertIterator<T>& operator=(T&& value) {
-    *field_->Add() = std::move(value);
-    return *this;
-  }
-#endif
-  RepeatedPtrFieldBackInsertIterator<T>& operator*() {
-    return *this;
-  }
-  RepeatedPtrFieldBackInsertIterator<T>& operator++() {
-    return *this;
-  }
-  RepeatedPtrFieldBackInsertIterator<T>& operator++(int /* unused */) {
-    return *this;
-  }
-
- private:
-  RepeatedPtrField<T>* field_;
-};
-
-// A back inserter for RepeatedPtrFields that inserts by transferring ownership
-// of a pointer.
-template<typename T> class AllocatedRepeatedPtrFieldBackInsertIterator
-    : public std::iterator<std::output_iterator_tag, T> {
- public:
-  explicit AllocatedRepeatedPtrFieldBackInsertIterator(
-      RepeatedPtrField<T>* const mutable_field)
-      : field_(mutable_field) {
-  }
-  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator=(
-      T* const ptr_to_value) {
-    field_->AddAllocated(ptr_to_value);
-    return *this;
-  }
-  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator*() {
-    return *this;
-  }
-  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++() {
-    return *this;
-  }
-  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++(
-      int /* unused */) {
-    return *this;
-  }
-
- private:
-  RepeatedPtrField<T>* field_;
-};
-
-// Almost identical to AllocatedRepeatedPtrFieldBackInsertIterator. This one
-// uses the UnsafeArenaAddAllocated instead.
-template<typename T>
-class UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator
-    : public std::iterator<std::output_iterator_tag, T> {
- public:
-  explicit UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator(
-    ::google::protobuf::RepeatedPtrField<T>* const mutable_field)
-  : field_(mutable_field) {
-  }
-  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator=(
-    T const* const ptr_to_value) {
-    field_->UnsafeArenaAddAllocated(const_cast<T*>(ptr_to_value));
-    return *this;
-  }
-  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator*() {
-    return *this;
-  }
-  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++() {
-    return *this;
-  }
-  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++(
-      int /* unused */) {
-    return *this;
-  }
-
- private:
-  ::google::protobuf::RepeatedPtrField<T>* field_;
-};
-
 }  // namespace internal
 
 // Provides a back insert iterator for RepeatedField instances,
 // similar to std::back_inserter().
-template<typename T> internal::RepeatedFieldBackInsertIterator<T>
-RepeatedFieldBackInserter(RepeatedField<T>* const mutable_field) {
+template <typename T>
+internal::RepeatedFieldBackInsertIterator<T> RepeatedFieldBackInserter(
+    RepeatedField<T>* const mutable_field) {
   return internal::RepeatedFieldBackInsertIterator<T>(mutable_field);
 }
 
-// Provides a back insert iterator for RepeatedPtrField instances,
-// similar to std::back_inserter().
-template<typename T> internal::RepeatedPtrFieldBackInsertIterator<T>
-RepeatedPtrFieldBackInserter(RepeatedPtrField<T>* const mutable_field) {
-  return internal::RepeatedPtrFieldBackInsertIterator<T>(mutable_field);
-}
-
-// Special back insert iterator for RepeatedPtrField instances, just in
-// case someone wants to write generic template code that can access both
-// RepeatedFields and RepeatedPtrFields using a common name.
-template<typename T> internal::RepeatedPtrFieldBackInsertIterator<T>
-RepeatedFieldBackInserter(RepeatedPtrField<T>* const mutable_field) {
-  return internal::RepeatedPtrFieldBackInsertIterator<T>(mutable_field);
-}
-
-// Provides a back insert iterator for RepeatedPtrField instances
-// similar to std::back_inserter() which transfers the ownership while
-// copying elements.
-template<typename T> internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>
-AllocatedRepeatedPtrFieldBackInserter(
-    RepeatedPtrField<T>* const mutable_field) {
-  return internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>(
-      mutable_field);
-}
-
-// Similar to AllocatedRepeatedPtrFieldBackInserter, using
-// UnsafeArenaAddAllocated instead of AddAllocated.
-// This is slightly faster if that matters. It is also useful in legacy code
-// that uses temporary ownership to avoid copies. Example:
-//   RepeatedPtrField<T> temp_field;
-//   temp_field.AddAllocated(new T);
-//   ... // Do something with temp_field
-//   temp_field.ExtractSubrange(0, temp_field.size(), NULL);
-// If you put temp_field on the arena this fails, because the ownership
-// transfers to the arena at the "AddAllocated" call and is not released anymore
-// causing a double delete. Using UnsafeArenaAddAllocated prevents this.
-template<typename T>
-internal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>
-UnsafeArenaAllocatedRepeatedPtrFieldBackInserter(
-    ::google::protobuf::RepeatedPtrField<T>* const mutable_field) {
-  return internal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>(
-      mutable_field);
-}
+// Extern declarations of common instantiations to reduce library bloat.
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<bool>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<int32_t>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<uint32_t>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<int64_t>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<uint64_t>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<float>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<double>;
 
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_REPEATED_FIELD_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/repeated_ptr_field.cc b/3rdparty/protobuf/src/google/protobuf/repeated_ptr_field.cc
new file mode 100644 (file)
index 0000000..0f0b3e2
--- /dev/null
@@ -0,0 +1,157 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Author: kenton@google.com (Kenton Varda)
+//  Based on original Protocol Buffers design by
+//  Sanjay Ghemawat, Jeff Dean, and others.
+
+#include <google/protobuf/repeated_field.h>
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/implicit_weak_message.h>
+
+#include <google/protobuf/port_def.inc>
+
+namespace google {
+namespace protobuf {
+
+namespace internal {
+
+void** RepeatedPtrFieldBase::InternalExtend(int extend_amount) {
+  int new_size = current_size_ + extend_amount;
+  if (total_size_ >= new_size) {
+    // N.B.: rep_ is non-nullptr because extend_amount is always > 0, hence
+    // total_size must be non-zero since it is lower-bounded by new_size.
+    return &rep_->elements[current_size_];
+  }
+  Rep* old_rep = rep_;
+  Arena* arena = GetArena();
+  new_size = std::max(internal::kRepeatedFieldLowerClampLimit,
+                      std::max(total_size_ * 2, new_size));
+  GOOGLE_CHECK_LE(static_cast<int64_t>(new_size),
+           static_cast<int64_t>(
+               (std::numeric_limits<size_t>::max() - kRepHeaderSize) /
+               sizeof(old_rep->elements[0])))
+      << "Requested size is too large to fit into size_t.";
+  size_t bytes = kRepHeaderSize + sizeof(old_rep->elements[0]) * new_size;
+  if (arena == nullptr) {
+    rep_ = reinterpret_cast<Rep*>(::operator new(bytes));
+  } else {
+    rep_ = reinterpret_cast<Rep*>(Arena::CreateArray<char>(arena, bytes));
+  }
+#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
+  const int old_total_size = total_size_;
+#endif
+  total_size_ = new_size;
+  if (old_rep && old_rep->allocated_size > 0) {
+    memcpy(rep_->elements, old_rep->elements,
+           old_rep->allocated_size * sizeof(rep_->elements[0]));
+    rep_->allocated_size = old_rep->allocated_size;
+  } else {
+    rep_->allocated_size = 0;
+  }
+  if (arena == nullptr) {
+#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
+    const size_t old_size =
+        old_total_size * sizeof(rep_->elements[0]) + kRepHeaderSize;
+    ::operator delete(static_cast<void*>(old_rep), old_size);
+#else
+    ::operator delete(static_cast<void*>(old_rep));
+#endif
+  }
+  return &rep_->elements[current_size_];
+}
+
+void RepeatedPtrFieldBase::Reserve(int new_size) {
+  if (new_size > current_size_) {
+    InternalExtend(new_size - current_size_);
+  }
+}
+
+void RepeatedPtrFieldBase::DestroyProtos() {
+  GOOGLE_DCHECK(rep_);
+  GOOGLE_DCHECK(arena_ == nullptr);
+  int n = rep_->allocated_size;
+  void* const* elements = rep_->elements;
+  for (int i = 0; i < n; i++) {
+    delete static_cast<MessageLite*>(elements[i]);
+  }
+#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
+  const size_t size = total_size_ * sizeof(elements[0]) + kRepHeaderSize;
+  ::operator delete(static_cast<void*>(rep_), size);
+  rep_ = nullptr;
+#else
+  ::operator delete(static_cast<void*>(rep_));
+  rep_ = nullptr;
+#endif
+}
+
+void* RepeatedPtrFieldBase::AddOutOfLineHelper(void* obj) {
+  if (!rep_ || rep_->allocated_size == total_size_) {
+    InternalExtend(1);  // Equivalent to "Reserve(total_size_ + 1)"
+  }
+  ++rep_->allocated_size;
+  rep_->elements[current_size_++] = obj;
+  return obj;
+}
+
+void RepeatedPtrFieldBase::CloseGap(int start, int num) {
+  if (rep_ == nullptr) return;
+  // Close up a gap of "num" elements starting at offset "start".
+  for (int i = start + num; i < rep_->allocated_size; ++i)
+    rep_->elements[i - num] = rep_->elements[i];
+  current_size_ -= num;
+  rep_->allocated_size -= num;
+}
+
+MessageLite* RepeatedPtrFieldBase::AddWeak(const MessageLite* prototype) {
+  if (rep_ != nullptr && current_size_ < rep_->allocated_size) {
+    return reinterpret_cast<MessageLite*>(rep_->elements[current_size_++]);
+  }
+  if (!rep_ || rep_->allocated_size == total_size_) {
+    Reserve(total_size_ + 1);
+  }
+  ++rep_->allocated_size;
+  MessageLite* result = prototype
+                            ? prototype->New(arena_)
+                            : Arena::CreateMessage<ImplicitWeakMessage>(arena_);
+  rep_->elements[current_size_++] = result;
+  return result;
+}
+
+}  // namespace internal
+
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
diff --git a/3rdparty/protobuf/src/google/protobuf/repeated_ptr_field.h b/3rdparty/protobuf/src/google/protobuf/repeated_ptr_field.h
new file mode 100644 (file)
index 0000000..7d635e3
--- /dev/null
@@ -0,0 +1,2014 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Author: kenton@google.com (Kenton Varda)
+//  Based on original Protocol Buffers design by
+//  Sanjay Ghemawat, Jeff Dean, and others.
+//
+// RepeatedField and RepeatedPtrField are used by generated protocol message
+// classes to manipulate repeated fields.  These classes are very similar to
+// STL's vector, but include a number of optimizations found to be useful
+// specifically in the case of Protocol Buffers.  RepeatedPtrField is
+// particularly different from STL vector as it manages ownership of the
+// pointers that it contains.
+//
+// Typically, clients should not need to access RepeatedField objects directly,
+// but should instead use the accessor functions generated automatically by the
+// protocol compiler.
+//
+// This header covers RepeatedPtrField.
+
+#ifndef GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__
+#define GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__
+
+#include <utility>
+#ifdef _MSC_VER
+// This is required for min/max on VS2013 only.
+#include <algorithm>
+#endif
+
+#include <iterator>
+#include <limits>
+#include <string>
+#include <type_traits>
+
+#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/port.h>
+
+
+// Must be included last.
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+namespace google {
+namespace protobuf {
+
+class Message;
+class Reflection;
+
+template <typename T>
+struct WeakRepeatedPtrField;
+
+namespace internal {
+
+class MergePartialFromCodedStreamHelper;
+class SwapFieldHelper;
+
+
+}  // namespace internal
+
+namespace internal {
+template <typename It>
+class RepeatedPtrIterator;
+template <typename It, typename VoidPtr>
+class RepeatedPtrOverPtrsIterator;
+}  // namespace internal
+
+namespace internal {
+
+// type-traits helper for RepeatedPtrFieldBase: we only want to invoke
+// arena-related "copy if on different arena" behavior if the necessary methods
+// exist on the contained type. In particular, we rely on MergeFrom() existing
+// as a general proxy for the fact that a copy will work, and we also provide a
+// specific override for std::string*.
+template <typename T>
+struct TypeImplementsMergeBehaviorProbeForMergeFrom {
+  typedef char HasMerge;
+  typedef long HasNoMerge;
+
+  // We accept either of:
+  // - void MergeFrom(const T& other)
+  // - bool MergeFrom(const T& other)
+  //
+  // We mangle these names a bit to avoid compatibility issues in 'unclean'
+  // include environments that may have, e.g., "#define test ..." (yes, this
+  // exists).
+  template <typename U, typename RetType, RetType (U::*)(const U& arg)>
+  struct CheckType;
+  template <typename U>
+  static HasMerge Check(CheckType<U, void, &U::MergeFrom>*);
+  template <typename U>
+  static HasMerge Check(CheckType<U, bool, &U::MergeFrom>*);
+  template <typename U>
+  static HasNoMerge Check(...);
+
+  // Resolves to either std::true_type or std::false_type.
+  typedef std::integral_constant<bool,
+                                 (sizeof(Check<T>(0)) == sizeof(HasMerge))>
+      type;
+};
+
+template <typename T, typename = void>
+struct TypeImplementsMergeBehavior
+    : TypeImplementsMergeBehaviorProbeForMergeFrom<T> {};
+
+
+template <>
+struct TypeImplementsMergeBehavior<std::string> {
+  typedef std::true_type type;
+};
+
+template <typename T>
+struct IsMovable
+    : std::integral_constant<bool, std::is_move_constructible<T>::value &&
+                                       std::is_move_assignable<T>::value> {};
+
+// This is the common base class for RepeatedPtrFields.  It deals only in void*
+// pointers.  Users should not use this interface directly.
+//
+// The methods of this interface correspond to the methods of RepeatedPtrField,
+// but may have a template argument called TypeHandler.  Its signature is:
+//   class TypeHandler {
+//    public:
+//     typedef MyType Type;
+//     static Type* New();
+//     static Type* NewFromPrototype(const Type* prototype,
+//                                       Arena* arena);
+//     static void Delete(Type*);
+//     static void Clear(Type*);
+//     static void Merge(const Type& from, Type* to);
+//
+//     // Only needs to be implemented if SpaceUsedExcludingSelf() is called.
+//     static int SpaceUsedLong(const Type&);
+//   };
+class PROTOBUF_EXPORT RepeatedPtrFieldBase {
+ protected:
+  constexpr RepeatedPtrFieldBase();
+  explicit RepeatedPtrFieldBase(Arena* arena);
+  ~RepeatedPtrFieldBase() {
+#ifndef NDEBUG
+    // Try to trigger segfault / asan failure in non-opt builds. If arena_
+    // lifetime has ended before the destructor.
+    if (arena_) (void)arena_->SpaceAllocated();
+#endif
+  }
+
+  // Must be called from destructor.
+  template <typename TypeHandler>
+  void Destroy();
+  bool NeedsDestroy() const { return rep_ != nullptr && arena_ == nullptr; }
+  void DestroyProtos();
+
+  bool empty() const;
+  int size() const;
+
+  template <typename TypeHandler>
+  const typename TypeHandler::Type& at(int index) const;
+  template <typename TypeHandler>
+  typename TypeHandler::Type& at(int index);
+
+  template <typename TypeHandler>
+  typename TypeHandler::Type* Mutable(int index);
+  template <typename TypeHandler>
+  void Delete(int index);
+  template <typename TypeHandler>
+  typename TypeHandler::Type* Add(
+      typename TypeHandler::Type* prototype = nullptr);
+
+ public:
+  // The next few methods are public so that they can be called from generated
+  // code when implicit weak fields are used, but they should never be called by
+  // application code.
+
+  template <typename TypeHandler>
+  const typename TypeHandler::Type& Get(int index) const;
+
+  // Creates and adds an element using the given prototype, without introducing
+  // a link-time dependency on the concrete message type. This method is used to
+  // implement implicit weak fields. The prototype may be nullptr, in which case
+  // an ImplicitWeakMessage will be used as a placeholder.
+  MessageLite* AddWeak(const MessageLite* prototype);
+
+  template <typename TypeHandler>
+  void Clear();
+
+  template <typename TypeHandler>
+  void MergeFrom(const RepeatedPtrFieldBase& other);
+
+  inline void InternalSwap(RepeatedPtrFieldBase*);
+
+ protected:
+  template <
+      typename TypeHandler,
+      typename std::enable_if<TypeHandler::Movable::value>::type* = nullptr>
+  void Add(typename TypeHandler::Type&& value);
+
+  template <typename TypeHandler>
+  void RemoveLast();
+  template <typename TypeHandler>
+  void CopyFrom(const RepeatedPtrFieldBase& other);
+
+  void CloseGap(int start, int num);
+
+  void Reserve(int new_size);
+
+  int Capacity() const;
+
+  template <typename TypeHandler>
+  static inline typename TypeHandler::Type* copy(
+      typename TypeHandler::Type* value) {
+    auto* new_value = TypeHandler::NewFromPrototype(value, nullptr);
+    TypeHandler::Merge(*value, new_value);
+    return new_value;
+  }
+
+  // Used for constructing iterators.
+  void* const* raw_data() const;
+  void** raw_mutable_data() const;
+
+  template <typename TypeHandler>
+  typename TypeHandler::Type** mutable_data();
+  template <typename TypeHandler>
+  const typename TypeHandler::Type* const* data() const;
+
+  template <typename TypeHandler>
+  PROTOBUF_NDEBUG_INLINE void Swap(RepeatedPtrFieldBase* other);
+
+  void SwapElements(int index1, int index2);
+
+  template <typename TypeHandler>
+  size_t SpaceUsedExcludingSelfLong() const;
+
+  // Advanced memory management --------------------------------------
+
+  // Like Add(), but if there are no cleared objects to use, returns nullptr.
+  template <typename TypeHandler>
+  typename TypeHandler::Type* AddFromCleared();
+
+  template <typename TypeHandler>
+  void AddAllocated(typename TypeHandler::Type* value) {
+    typename TypeImplementsMergeBehavior<typename TypeHandler::Type>::type t;
+    AddAllocatedInternal<TypeHandler>(value, t);
+  }
+
+  template <typename TypeHandler>
+  void UnsafeArenaAddAllocated(typename TypeHandler::Type* value);
+
+  template <typename TypeHandler>
+  PROTOBUF_NODISCARD typename TypeHandler::Type* ReleaseLast() {
+    typename TypeImplementsMergeBehavior<typename TypeHandler::Type>::type t;
+    return ReleaseLastInternal<TypeHandler>(t);
+  }
+
+  // Releases last element and returns it, but does not do out-of-arena copy.
+  // And just returns the raw pointer to the contained element in the arena.
+  template <typename TypeHandler>
+  typename TypeHandler::Type* UnsafeArenaReleaseLast();
+
+  int ClearedCount() const;
+  template <typename TypeHandler>
+  void AddCleared(typename TypeHandler::Type* value);
+  template <typename TypeHandler>
+  PROTOBUF_NODISCARD typename TypeHandler::Type* ReleaseCleared();
+
+  template <typename TypeHandler>
+  void AddAllocatedInternal(typename TypeHandler::Type* value, std::true_type);
+  template <typename TypeHandler>
+  void AddAllocatedInternal(typename TypeHandler::Type* value, std::false_type);
+
+  template <typename TypeHandler>
+  PROTOBUF_NOINLINE void AddAllocatedSlowWithCopy(
+      typename TypeHandler::Type* value, Arena* value_arena, Arena* my_arena);
+  template <typename TypeHandler>
+  PROTOBUF_NOINLINE void AddAllocatedSlowWithoutCopy(
+      typename TypeHandler::Type* value);
+
+  template <typename TypeHandler>
+  typename TypeHandler::Type* ReleaseLastInternal(std::true_type);
+  template <typename TypeHandler>
+  typename TypeHandler::Type* ReleaseLastInternal(std::false_type);
+
+  template <typename TypeHandler>
+  PROTOBUF_NOINLINE void SwapFallback(RepeatedPtrFieldBase* other);
+
+  inline Arena* GetArena() const { return arena_; }
+
+ private:
+  static constexpr int kInitialSize = 0;
+  // A few notes on internal representation:
+  //
+  // We use an indirected approach, with struct Rep, to keep
+  // sizeof(RepeatedPtrFieldBase) equivalent to what it was before arena support
+  // was added, namely, 3 8-byte machine words on x86-64. An instance of Rep is
+  // allocated only when the repeated field is non-empty, and it is a
+  // dynamically-sized struct (the header is directly followed by elements[]).
+  // We place arena_ and current_size_ directly in the object to avoid cache
+  // misses due to the indirection, because these fields are checked frequently.
+  // Placing all fields directly in the RepeatedPtrFieldBase instance costs
+  // significant performance for memory-sensitive workloads.
+  Arena* arena_;
+  int current_size_;
+  int total_size_;
+  struct Rep {
+    int allocated_size;
+    // Here we declare a huge array as a way of approximating C's "flexible
+    // array member" feature without relying on undefined behavior.
+    void* elements[(std::numeric_limits<int>::max() - 2 * sizeof(int)) /
+                   sizeof(void*)];
+  };
+  static constexpr size_t kRepHeaderSize = offsetof(Rep, elements);
+  Rep* rep_;
+
+  template <typename TypeHandler>
+  static inline typename TypeHandler::Type* cast(void* element) {
+    return reinterpret_cast<typename TypeHandler::Type*>(element);
+  }
+  template <typename TypeHandler>
+  static inline const typename TypeHandler::Type* cast(const void* element) {
+    return reinterpret_cast<const typename TypeHandler::Type*>(element);
+  }
+
+  // Non-templated inner function to avoid code duplication. Takes a function
+  // pointer to the type-specific (templated) inner allocate/merge loop.
+  void MergeFromInternal(const RepeatedPtrFieldBase& other,
+                         void (RepeatedPtrFieldBase::*inner_loop)(void**,
+                                                                  void**, int,
+                                                                  int));
+
+  template <typename TypeHandler>
+  PROTOBUF_NOINLINE void MergeFromInnerLoop(void** our_elems,
+                                            void** other_elems, int length,
+                                            int already_allocated);
+
+  // Internal helper: extend array space if necessary to contain |extend_amount|
+  // more elements, and return a pointer to the element immediately following
+  // the old list of elements.  This interface factors out common behavior from
+  // Reserve() and MergeFrom() to reduce code size. |extend_amount| must be > 0.
+  void** InternalExtend(int extend_amount);
+
+  // Internal helper for Add: add "obj" as the next element in the
+  // array, including potentially resizing the array with Reserve if
+  // needed
+  void* AddOutOfLineHelper(void* obj);
+
+  // The reflection implementation needs to call protected methods directly,
+  // reinterpreting pointers as being to Message instead of a specific Message
+  // subclass.
+  friend class ::PROTOBUF_NAMESPACE_ID::Reflection;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::SwapFieldHelper;
+
+  // ExtensionSet stores repeated message extensions as
+  // RepeatedPtrField<MessageLite>, but non-lite ExtensionSets need to implement
+  // SpaceUsedLong(), and thus need to call SpaceUsedExcludingSelfLong()
+  // reinterpreting MessageLite as Message.  ExtensionSet also needs to make use
+  // of AddFromCleared(), which is not part of the public interface.
+  friend class ExtensionSet;
+
+  // The MapFieldBase implementation needs to call protected methods directly,
+  // reinterpreting pointers as being to Message instead of a specific Message
+  // subclass.
+  friend class MapFieldBase;
+  friend class MapFieldBaseStub;
+
+  // The table-driven MergePartialFromCodedStream implementation needs to
+  // operate on RepeatedPtrField<MessageLite>.
+  friend class MergePartialFromCodedStreamHelper;
+  friend class AccessorHelper;
+  template <typename T>
+  friend struct google::protobuf::WeakRepeatedPtrField;
+
+  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPtrFieldBase);
+};
+
+template <typename GenericType>
+class GenericTypeHandler {
+ public:
+  typedef GenericType Type;
+  using Movable = IsMovable<GenericType>;
+
+  static inline GenericType* New(Arena* arena) {
+    return Arena::CreateMaybeMessage<Type>(arena);
+  }
+  static inline GenericType* New(Arena* arena, GenericType&& value) {
+    return Arena::Create<GenericType>(arena, std::move(value));
+  }
+  static inline GenericType* NewFromPrototype(const GenericType* prototype,
+                                              Arena* arena = nullptr);
+  static inline void Delete(GenericType* value, Arena* arena) {
+    if (arena == nullptr) {
+      delete value;
+    }
+  }
+  static inline Arena* GetOwningArena(GenericType* value) {
+    return Arena::GetOwningArena<Type>(value);
+  }
+
+  static inline void Clear(GenericType* value) { value->Clear(); }
+  PROTOBUF_NOINLINE
+  static void Merge(const GenericType& from, GenericType* to);
+  static inline size_t SpaceUsedLong(const GenericType& value) {
+    return value.SpaceUsedLong();
+  }
+};
+
+template <typename GenericType>
+GenericType* GenericTypeHandler<GenericType>::NewFromPrototype(
+    const GenericType* /* prototype */, Arena* arena) {
+  return New(arena);
+}
+template <typename GenericType>
+void GenericTypeHandler<GenericType>::Merge(const GenericType& from,
+                                            GenericType* to) {
+  to->MergeFrom(from);
+}
+
+// NewFromPrototype() and Merge() are not defined inline here, as we will need
+// to do a virtual function dispatch anyways to go from Message* to call
+// New/Merge.
+template <>
+MessageLite* GenericTypeHandler<MessageLite>::NewFromPrototype(
+    const MessageLite* prototype, Arena* arena);
+template <>
+inline Arena* GenericTypeHandler<MessageLite>::GetOwningArena(
+    MessageLite* value) {
+  return value->GetOwningArena();
+}
+template <>
+void GenericTypeHandler<MessageLite>::Merge(const MessageLite& from,
+                                            MessageLite* to);
+template <>
+inline void GenericTypeHandler<std::string>::Clear(std::string* value) {
+  value->clear();
+}
+template <>
+void GenericTypeHandler<std::string>::Merge(const std::string& from,
+                                            std::string* to);
+
+// Message specialization bodies defined in message.cc. This split is necessary
+// to allow proto2-lite (which includes this header) to be independent of
+// Message.
+template <>
+PROTOBUF_EXPORT Message* GenericTypeHandler<Message>::NewFromPrototype(
+    const Message* prototype, Arena* arena);
+template <>
+PROTOBUF_EXPORT Arena* GenericTypeHandler<Message>::GetOwningArena(
+    Message* value);
+
+class StringTypeHandler {
+ public:
+  typedef std::string Type;
+  using Movable = IsMovable<Type>;
+
+  static inline std::string* New(Arena* arena) {
+    return Arena::Create<std::string>(arena);
+  }
+  static inline std::string* New(Arena* arena, std::string&& value) {
+    return Arena::Create<std::string>(arena, std::move(value));
+  }
+  static inline std::string* NewFromPrototype(const std::string*,
+                                              Arena* arena) {
+    return New(arena);
+  }
+  static inline Arena* GetOwningArena(std::string*) { return nullptr; }
+  static inline void Delete(std::string* value, Arena* arena) {
+    if (arena == nullptr) {
+      delete value;
+    }
+  }
+  static inline void Clear(std::string* value) { value->clear(); }
+  static inline void Merge(const std::string& from, std::string* to) {
+    *to = from;
+  }
+  static size_t SpaceUsedLong(const std::string& value) {
+    return sizeof(value) + StringSpaceUsedExcludingSelfLong(value);
+  }
+};
+
+}  // namespace internal
+
+// RepeatedPtrField is like RepeatedField, but used for repeated strings or
+// Messages.
+template <typename Element>
+class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
+ public:
+  constexpr RepeatedPtrField();
+  explicit RepeatedPtrField(Arena* arena);
+
+  RepeatedPtrField(const RepeatedPtrField& other);
+
+  template <typename Iter,
+            typename = typename std::enable_if<std::is_constructible<
+                Element, decltype(*std::declval<Iter>())>::value>::type>
+  RepeatedPtrField(Iter begin, Iter end);
+
+  ~RepeatedPtrField();
+
+  RepeatedPtrField& operator=(const RepeatedPtrField& other);
+
+  RepeatedPtrField(RepeatedPtrField&& other) noexcept;
+  RepeatedPtrField& operator=(RepeatedPtrField&& other) noexcept;
+
+  bool empty() const;
+  int size() const;
+
+  const Element& Get(int index) const;
+  Element* Mutable(int index);
+  Element* Add();
+  void Add(Element&& value);
+  // Append elements in the range [begin, end) after reserving
+  // the appropriate number of elements.
+  template <typename Iter>
+  void Add(Iter begin, Iter end);
+
+  const Element& operator[](int index) const { return Get(index); }
+  Element& operator[](int index) { return *Mutable(index); }
+
+  const Element& at(int index) const;
+  Element& at(int index);
+
+  // Remove the last element in the array.
+  // Ownership of the element is retained by the array.
+  void RemoveLast();
+
+  // Delete elements with indices in the range [start .. start+num-1].
+  // Caution: implementation moves all elements with indices [start+num .. ].
+  // Calling this routine inside a loop can cause quadratic behavior.
+  void DeleteSubrange(int start, int num);
+
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear();
+  void MergeFrom(const RepeatedPtrField& other);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void CopyFrom(const RepeatedPtrField& other);
+
+  // Replaces the contents with RepeatedPtrField(begin, end).
+  template <typename Iter>
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Assign(Iter begin, Iter end);
+
+  // Reserve space to expand the field to at least the given size.  This only
+  // resizes the pointer array; it doesn't allocate any objects.  If the
+  // array is grown, it will always be at least doubled in size.
+  void Reserve(int new_size);
+
+  int Capacity() const;
+
+  // Gets the underlying array.  This pointer is possibly invalidated by
+  // any add or remove operation.
+  Element** mutable_data();
+  const Element* const* data() const;
+
+  // Swap entire contents with "other". If they are on separate arenas, then
+  // copies data.
+  void Swap(RepeatedPtrField* other);
+
+  // Swap entire contents with "other". Caller should guarantee that either both
+  // fields are on the same arena or both are on the heap. Swapping between
+  // different arenas with this function is disallowed and is caught via
+  // GOOGLE_DCHECK.
+  void UnsafeArenaSwap(RepeatedPtrField* other);
+
+  // Swap two elements.
+  void SwapElements(int index1, int index2);
+
+  // STL-like iterator support
+  typedef internal::RepeatedPtrIterator<Element> iterator;
+  typedef internal::RepeatedPtrIterator<const Element> const_iterator;
+  typedef Element value_type;
+  typedef value_type& reference;
+  typedef const value_type& const_reference;
+  typedef value_type* pointer;
+  typedef const value_type* const_pointer;
+  typedef int size_type;
+  typedef ptrdiff_t difference_type;
+
+  iterator begin();
+  const_iterator begin() const;
+  const_iterator cbegin() const;
+  iterator end();
+  const_iterator end() const;
+  const_iterator cend() const;
+
+  // Reverse iterator support
+  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+  typedef std::reverse_iterator<iterator> reverse_iterator;
+  reverse_iterator rbegin() { return reverse_iterator(end()); }
+  const_reverse_iterator rbegin() const {
+    return const_reverse_iterator(end());
+  }
+  reverse_iterator rend() { return reverse_iterator(begin()); }
+  const_reverse_iterator rend() const {
+    return const_reverse_iterator(begin());
+  }
+
+  // Custom STL-like iterator that iterates over and returns the underlying
+  // pointers to Element rather than Element itself.
+  typedef internal::RepeatedPtrOverPtrsIterator<Element*, void*>
+      pointer_iterator;
+  typedef internal::RepeatedPtrOverPtrsIterator<const Element* const,
+                                                const void* const>
+      const_pointer_iterator;
+  pointer_iterator pointer_begin();
+  const_pointer_iterator pointer_begin() const;
+  pointer_iterator pointer_end();
+  const_pointer_iterator pointer_end() const;
+
+  // Returns (an estimate of) the number of bytes used by the repeated field,
+  // excluding sizeof(*this).
+  size_t SpaceUsedExcludingSelfLong() const;
+
+  int SpaceUsedExcludingSelf() const {
+    return internal::ToIntSize(SpaceUsedExcludingSelfLong());
+  }
+
+  // Advanced memory management --------------------------------------
+  // When hardcore memory management becomes necessary -- as it sometimes
+  // does here at Google -- the following methods may be useful.
+
+  // Add an already-allocated object, passing ownership to the
+  // RepeatedPtrField.
+  //
+  // Note that some special behavior occurs with respect to arenas:
+  //
+  //   (i) if this field holds submessages, the new submessage will be copied if
+  //   the original is in an arena and this RepeatedPtrField is either in a
+  //   different arena, or on the heap.
+  //   (ii) if this field holds strings, the passed-in string *must* be
+  //   heap-allocated, not arena-allocated. There is no way to dynamically check
+  //   this at runtime, so User Beware.
+  void AddAllocated(Element* value);
+
+  // Remove the last element and return it, passing ownership to the caller.
+  // Requires:  size() > 0
+  //
+  // If this RepeatedPtrField is on an arena, an object copy is required to pass
+  // ownership back to the user (for compatible semantics). Use
+  // UnsafeArenaReleaseLast() if this behavior is undesired.
+  PROTOBUF_NODISCARD Element* ReleaseLast();
+
+  // Add an already-allocated object, skipping arena-ownership checks. The user
+  // must guarantee that the given object is in the same arena as this
+  // RepeatedPtrField.
+  // It is also useful in legacy code that uses temporary ownership to avoid
+  // copies. Example:
+  //   RepeatedPtrField<T> temp_field;
+  //   temp_field.UnsafeArenaAddAllocated(new T);
+  //   ... // Do something with temp_field
+  //   temp_field.UnsafeArenaExtractSubrange(0, temp_field.size(), nullptr);
+  // If you put temp_field on the arena this fails, because the ownership
+  // transfers to the arena at the "AddAllocated" call and is not released
+  // anymore causing a double delete. UnsafeArenaAddAllocated prevents this.
+  void UnsafeArenaAddAllocated(Element* value);
+
+  // Remove the last element and return it.  Unlike ReleaseLast, the returned
+  // pointer is always to the original object.  This may be in an arena, and
+  // therefore have the arena's lifetime.
+  // Requires: current_size_ > 0
+  Element* UnsafeArenaReleaseLast();
+
+  // Extract elements with indices in the range "[start .. start+num-1]".
+  // The caller assumes ownership of the extracted elements and is responsible
+  // for deleting them when they are no longer needed.
+  // If "elements" is non-nullptr, then pointers to the extracted elements
+  // are stored in "elements[0 .. num-1]" for the convenience of the caller.
+  // If "elements" is nullptr, then the caller must use some other mechanism
+  // to perform any further operations (like deletion) on these elements.
+  // Caution: implementation also moves elements with indices [start+num ..].
+  // Calling this routine inside a loop can cause quadratic behavior.
+  //
+  // Memory copying behavior is identical to ReleaseLast(), described above: if
+  // this RepeatedPtrField is on an arena, an object copy is performed for each
+  // returned element, so that all returned element pointers are to
+  // heap-allocated copies. If this copy is not desired, the user should call
+  // UnsafeArenaExtractSubrange().
+  void ExtractSubrange(int start, int num, Element** elements);
+
+  // Identical to ExtractSubrange() described above, except that no object
+  // copies are ever performed. Instead, the raw object pointers are returned.
+  // Thus, if on an arena, the returned objects must not be freed, because they
+  // will not be heap-allocated objects.
+  void UnsafeArenaExtractSubrange(int start, int num, Element** elements);
+
+  // When elements are removed by calls to RemoveLast() or Clear(), they
+  // are not actually freed.  Instead, they are cleared and kept so that
+  // they can be reused later.  This can save lots of CPU time when
+  // repeatedly reusing a protocol message for similar purposes.
+  //
+  // Hardcore programs may choose to manipulate these cleared objects
+  // to better optimize memory management using the following routines.
+
+  // Get the number of cleared objects that are currently being kept
+  // around for reuse.
+  int ClearedCount() const;
+#ifndef PROTOBUF_FUTURE_BREAKING_CHANGES
+  // Add an element to the pool of cleared objects, passing ownership to
+  // the RepeatedPtrField.  The element must be cleared prior to calling
+  // this method.
+  //
+  // This method cannot be called when the repeated field is on an arena or when
+  // |value| is; both cases will trigger a GOOGLE_DCHECK-failure.
+  void AddCleared(Element* value);
+  // Remove a single element from the cleared pool and return it, passing
+  // ownership to the caller.  The element is guaranteed to be cleared.
+  // Requires:  ClearedCount() > 0
+  //
+  //
+  // This method cannot be called when the repeated field is on an arena; doing
+  // so will trigger a GOOGLE_DCHECK-failure.
+  PROTOBUF_NODISCARD Element* ReleaseCleared();
+#endif  // !PROTOBUF_FUTURE_BREAKING_CHANGES
+
+  // Removes the element referenced by position.
+  //
+  // Returns an iterator to the element immediately following the removed
+  // element.
+  //
+  // Invalidates all iterators at or after the removed element, including end().
+  iterator erase(const_iterator position);
+
+  // Removes the elements in the range [first, last).
+  //
+  // Returns an iterator to the element immediately following the removed range.
+  //
+  // Invalidates all iterators at or after the removed range, including end().
+  iterator erase(const_iterator first, const_iterator last);
+
+  // Gets the arena on which this RepeatedPtrField stores its elements.
+  inline Arena* GetArena() const;
+
+  // For internal use only.
+  //
+  // This is public due to it being called by generated code.
+  void InternalSwap(RepeatedPtrField* other) {
+    internal::RepeatedPtrFieldBase::InternalSwap(other);
+  }
+
+ private:
+  // Note:  RepeatedPtrField SHOULD NOT be subclassed by users.
+  class TypeHandler;
+
+  // Implementations for ExtractSubrange(). The copying behavior must be
+  // included only if the type supports the necessary operations (e.g.,
+  // MergeFrom()), so we must resolve this at compile time. ExtractSubrange()
+  // uses SFINAE to choose one of the below implementations.
+  void ExtractSubrangeInternal(int start, int num, Element** elements,
+                               std::true_type);
+  void ExtractSubrangeInternal(int start, int num, Element** elements,
+                               std::false_type);
+
+  friend class Arena;
+
+  template <typename T>
+  friend struct WeakRepeatedPtrField;
+
+  typedef void InternalArenaConstructable_;
+
+};
+
+// implementation ====================================================
+
+namespace internal {
+
+constexpr RepeatedPtrFieldBase::RepeatedPtrFieldBase()
+    : arena_(nullptr), current_size_(0), total_size_(0), rep_(nullptr) {}
+
+inline RepeatedPtrFieldBase::RepeatedPtrFieldBase(Arena* arena)
+    : arena_(arena), current_size_(0), total_size_(0), rep_(nullptr) {}
+
+template <typename TypeHandler>
+void RepeatedPtrFieldBase::Destroy() {
+  if (rep_ != nullptr && arena_ == nullptr) {
+    int n = rep_->allocated_size;
+    void* const* elements = rep_->elements;
+    for (int i = 0; i < n; i++) {
+      TypeHandler::Delete(cast<TypeHandler>(elements[i]), nullptr);
+    }
+#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
+    const size_t size = total_size_ * sizeof(elements[0]) + kRepHeaderSize;
+    ::operator delete(static_cast<void*>(rep_), size);
+#else
+    ::operator delete(static_cast<void*>(rep_));
+#endif
+  }
+  rep_ = nullptr;
+}
+
+template <typename TypeHandler>
+inline void RepeatedPtrFieldBase::Swap(RepeatedPtrFieldBase* other) {
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+  if (GetArena() != nullptr && GetArena() == other->GetArena()) {
+#else   // PROTOBUF_FORCE_COPY_IN_SWAP
+  if (GetArena() == other->GetArena()) {
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+    InternalSwap(other);
+  } else {
+    SwapFallback<TypeHandler>(other);
+  }
+}
+
+template <typename TypeHandler>
+void RepeatedPtrFieldBase::SwapFallback(RepeatedPtrFieldBase* other) {
+#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+  GOOGLE_DCHECK(GetArena() == nullptr || other->GetArena() != GetArena());
+#else   // PROTOBUF_FORCE_COPY_IN_SWAP
+  GOOGLE_DCHECK(other->GetArena() != GetArena());
+#endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+
+  // Copy semantics in this case. We try to improve efficiency by placing the
+  // temporary on |other|'s arena so that messages are copied twice rather than
+  // three times.
+  RepeatedPtrFieldBase temp(other->GetArena());
+  temp.MergeFrom<TypeHandler>(*this);
+  this->Clear<TypeHandler>();
+  this->MergeFrom<TypeHandler>(*other);
+  other->InternalSwap(&temp);
+  temp.Destroy<TypeHandler>();  // Frees rep_ if `other` had no arena.
+}
+
+inline bool RepeatedPtrFieldBase::empty() const { return current_size_ == 0; }
+
+inline int RepeatedPtrFieldBase::size() const { return current_size_; }
+
+template <typename TypeHandler>
+inline const typename TypeHandler::Type& RepeatedPtrFieldBase::Get(
+    int index) const {
+  GOOGLE_DCHECK_GE(index, 0);
+  GOOGLE_DCHECK_LT(index, current_size_);
+  return *cast<TypeHandler>(rep_->elements[index]);
+}
+
+template <typename TypeHandler>
+inline const typename TypeHandler::Type& RepeatedPtrFieldBase::at(
+    int index) const {
+  GOOGLE_CHECK_GE(index, 0);
+  GOOGLE_CHECK_LT(index, current_size_);
+  return *cast<TypeHandler>(rep_->elements[index]);
+}
+
+template <typename TypeHandler>
+inline typename TypeHandler::Type& RepeatedPtrFieldBase::at(int index) {
+  GOOGLE_CHECK_GE(index, 0);
+  GOOGLE_CHECK_LT(index, current_size_);
+  return *cast<TypeHandler>(rep_->elements[index]);
+}
+
+template <typename TypeHandler>
+inline typename TypeHandler::Type* RepeatedPtrFieldBase::Mutable(int index) {
+  GOOGLE_DCHECK_GE(index, 0);
+  GOOGLE_DCHECK_LT(index, current_size_);
+  return cast<TypeHandler>(rep_->elements[index]);
+}
+
+template <typename TypeHandler>
+inline void RepeatedPtrFieldBase::Delete(int index) {
+  GOOGLE_DCHECK_GE(index, 0);
+  GOOGLE_DCHECK_LT(index, current_size_);
+  TypeHandler::Delete(cast<TypeHandler>(rep_->elements[index]), arena_);
+}
+
+template <typename TypeHandler>
+inline typename TypeHandler::Type* RepeatedPtrFieldBase::Add(
+    typename TypeHandler::Type* prototype) {
+  if (rep_ != nullptr && current_size_ < rep_->allocated_size) {
+    return cast<TypeHandler>(rep_->elements[current_size_++]);
+  }
+  typename TypeHandler::Type* result =
+      TypeHandler::NewFromPrototype(prototype, arena_);
+  return reinterpret_cast<typename TypeHandler::Type*>(
+      AddOutOfLineHelper(result));
+}
+
+template <typename TypeHandler,
+          typename std::enable_if<TypeHandler::Movable::value>::type*>
+inline void RepeatedPtrFieldBase::Add(typename TypeHandler::Type&& value) {
+  if (rep_ != nullptr && current_size_ < rep_->allocated_size) {
+    *cast<TypeHandler>(rep_->elements[current_size_++]) = std::move(value);
+    return;
+  }
+  if (!rep_ || rep_->allocated_size == total_size_) {
+    Reserve(total_size_ + 1);
+  }
+  ++rep_->allocated_size;
+  typename TypeHandler::Type* result =
+      TypeHandler::New(arena_, std::move(value));
+  rep_->elements[current_size_++] = result;
+}
+
+template <typename TypeHandler>
+inline void RepeatedPtrFieldBase::RemoveLast() {
+  GOOGLE_DCHECK_GT(current_size_, 0);
+  TypeHandler::Clear(cast<TypeHandler>(rep_->elements[--current_size_]));
+}
+
+template <typename TypeHandler>
+void RepeatedPtrFieldBase::Clear() {
+  const int n = current_size_;
+  GOOGLE_DCHECK_GE(n, 0);
+  if (n > 0) {
+    void* const* elements = rep_->elements;
+    int i = 0;
+    do {
+      TypeHandler::Clear(cast<TypeHandler>(elements[i++]));
+    } while (i < n);
+    current_size_ = 0;
+  }
+}
+
+// To avoid unnecessary code duplication and reduce binary size, we use a
+// layered approach to implementing MergeFrom(). The toplevel method is
+// templated, so we get a small thunk per concrete message type in the binary.
+// This calls a shared implementation with most of the logic, passing a function
+// pointer to another type-specific piece of code that calls the object-allocate
+// and merge handlers.
+template <typename TypeHandler>
+inline void RepeatedPtrFieldBase::MergeFrom(const RepeatedPtrFieldBase& other) {
+  GOOGLE_DCHECK_NE(&other, this);
+  if (other.current_size_ == 0) return;
+  MergeFromInternal(other,
+                    &RepeatedPtrFieldBase::MergeFromInnerLoop<TypeHandler>);
+}
+
+inline void RepeatedPtrFieldBase::MergeFromInternal(
+    const RepeatedPtrFieldBase& other,
+    void (RepeatedPtrFieldBase::*inner_loop)(void**, void**, int, int)) {
+  // Note: wrapper has already guaranteed that other.rep_ != nullptr here.
+  int other_size = other.current_size_;
+  void** other_elements = other.rep_->elements;
+  void** new_elements = InternalExtend(other_size);
+  int allocated_elems = rep_->allocated_size - current_size_;
+  (this->*inner_loop)(new_elements, other_elements, other_size,
+                      allocated_elems);
+  current_size_ += other_size;
+  if (rep_->allocated_size < current_size_) {
+    rep_->allocated_size = current_size_;
+  }
+}
+
+// Merges other_elems to our_elems.
+template <typename TypeHandler>
+void RepeatedPtrFieldBase::MergeFromInnerLoop(void** our_elems,
+                                              void** other_elems, int length,
+                                              int already_allocated) {
+  if (already_allocated < length) {
+    Arena* arena = GetArena();
+    typename TypeHandler::Type* elem_prototype =
+        reinterpret_cast<typename TypeHandler::Type*>(other_elems[0]);
+    for (int i = already_allocated; i < length; i++) {
+      // Allocate a new empty element that we'll merge into below
+      typename TypeHandler::Type* new_elem =
+          TypeHandler::NewFromPrototype(elem_prototype, arena);
+      our_elems[i] = new_elem;
+    }
+  }
+  // Main loop that does the actual merging
+  for (int i = 0; i < length; i++) {
+    // Already allocated: use existing element.
+    typename TypeHandler::Type* other_elem =
+        reinterpret_cast<typename TypeHandler::Type*>(other_elems[i]);
+    typename TypeHandler::Type* new_elem =
+        reinterpret_cast<typename TypeHandler::Type*>(our_elems[i]);
+    TypeHandler::Merge(*other_elem, new_elem);
+  }
+}
+
+template <typename TypeHandler>
+inline void RepeatedPtrFieldBase::CopyFrom(const RepeatedPtrFieldBase& other) {
+  if (&other == this) return;
+  RepeatedPtrFieldBase::Clear<TypeHandler>();
+  RepeatedPtrFieldBase::MergeFrom<TypeHandler>(other);
+}
+
+inline int RepeatedPtrFieldBase::Capacity() const { return total_size_; }
+
+inline void* const* RepeatedPtrFieldBase::raw_data() const {
+  return rep_ ? rep_->elements : nullptr;
+}
+
+inline void** RepeatedPtrFieldBase::raw_mutable_data() const {
+  return rep_ ? const_cast<void**>(rep_->elements) : nullptr;
+}
+
+template <typename TypeHandler>
+inline typename TypeHandler::Type** RepeatedPtrFieldBase::mutable_data() {
+  // TODO(kenton):  Breaks C++ aliasing rules.  We should probably remove this
+  //   method entirely.
+  return reinterpret_cast<typename TypeHandler::Type**>(raw_mutable_data());
+}
+
+template <typename TypeHandler>
+inline const typename TypeHandler::Type* const* RepeatedPtrFieldBase::data()
+    const {
+  // TODO(kenton):  Breaks C++ aliasing rules.  We should probably remove this
+  //   method entirely.
+  return reinterpret_cast<const typename TypeHandler::Type* const*>(raw_data());
+}
+
+inline void RepeatedPtrFieldBase::SwapElements(int index1, int index2) {
+  using std::swap;  // enable ADL with fallback
+  swap(rep_->elements[index1], rep_->elements[index2]);
+}
+
+template <typename TypeHandler>
+inline size_t RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong() const {
+  size_t allocated_bytes = static_cast<size_t>(total_size_) * sizeof(void*);
+  if (rep_ != nullptr) {
+    for (int i = 0; i < rep_->allocated_size; ++i) {
+      allocated_bytes +=
+          TypeHandler::SpaceUsedLong(*cast<TypeHandler>(rep_->elements[i]));
+    }
+    allocated_bytes += kRepHeaderSize;
+  }
+  return allocated_bytes;
+}
+
+template <typename TypeHandler>
+inline typename TypeHandler::Type* RepeatedPtrFieldBase::AddFromCleared() {
+  if (rep_ != nullptr && current_size_ < rep_->allocated_size) {
+    return cast<TypeHandler>(rep_->elements[current_size_++]);
+  } else {
+    return nullptr;
+  }
+}
+
+// AddAllocated version that implements arena-safe copying behavior.
+template <typename TypeHandler>
+void RepeatedPtrFieldBase::AddAllocatedInternal(
+    typename TypeHandler::Type* value, std::true_type) {
+  Arena* element_arena =
+      reinterpret_cast<Arena*>(TypeHandler::GetOwningArena(value));
+  Arena* arena = GetArena();
+  if (arena == element_arena && rep_ && rep_->allocated_size < total_size_) {
+    // Fast path: underlying arena representation (tagged pointer) is equal to
+    // our arena pointer, and we can add to array without resizing it (at least
+    // one slot that is not allocated).
+    void** elems = rep_->elements;
+    if (current_size_ < rep_->allocated_size) {
+      // Make space at [current] by moving first allocated element to end of
+      // allocated list.
+      elems[rep_->allocated_size] = elems[current_size_];
+    }
+    elems[current_size_] = value;
+    current_size_ = current_size_ + 1;
+    rep_->allocated_size = rep_->allocated_size + 1;
+  } else {
+    AddAllocatedSlowWithCopy<TypeHandler>(value, element_arena, arena);
+  }
+}
+
+// Slowpath handles all cases, copying if necessary.
+template <typename TypeHandler>
+void RepeatedPtrFieldBase::AddAllocatedSlowWithCopy(
+    // Pass value_arena and my_arena to avoid duplicate virtual call (value) or
+    // load (mine).
+    typename TypeHandler::Type* value, Arena* value_arena, Arena* my_arena) {
+  // Ensure that either the value is in the same arena, or if not, we do the
+  // appropriate thing: Own() it (if it's on heap and we're in an arena) or copy
+  // it to our arena/heap (otherwise).
+  if (my_arena != nullptr && value_arena == nullptr) {
+    my_arena->Own(value);
+  } else if (my_arena != value_arena) {
+    typename TypeHandler::Type* new_value =
+        TypeHandler::NewFromPrototype(value, my_arena);
+    TypeHandler::Merge(*value, new_value);
+    TypeHandler::Delete(value, value_arena);
+    value = new_value;
+  }
+
+  UnsafeArenaAddAllocated<TypeHandler>(value);
+}
+
+// AddAllocated version that does not implement arena-safe copying behavior.
+template <typename TypeHandler>
+void RepeatedPtrFieldBase::AddAllocatedInternal(
+    typename TypeHandler::Type* value, std::false_type) {
+  if (rep_ && rep_->allocated_size < total_size_) {
+    // Fast path: underlying arena representation (tagged pointer) is equal to
+    // our arena pointer, and we can add to array without resizing it (at least
+    // one slot that is not allocated).
+    void** elems = rep_->elements;
+    if (current_size_ < rep_->allocated_size) {
+      // Make space at [current] by moving first allocated element to end of
+      // allocated list.
+      elems[rep_->allocated_size] = elems[current_size_];
+    }
+    elems[current_size_] = value;
+    current_size_ = current_size_ + 1;
+    ++rep_->allocated_size;
+  } else {
+    UnsafeArenaAddAllocated<TypeHandler>(value);
+  }
+}
+
+template <typename TypeHandler>
+void RepeatedPtrFieldBase::UnsafeArenaAddAllocated(
+    typename TypeHandler::Type* value) {
+  // Make room for the new pointer.
+  if (!rep_ || current_size_ == total_size_) {
+    // The array is completely full with no cleared objects, so grow it.
+    Reserve(total_size_ + 1);
+    ++rep_->allocated_size;
+  } else if (rep_->allocated_size == total_size_) {
+    // There is no more space in the pointer array because it contains some
+    // cleared objects awaiting reuse.  We don't want to grow the array in this
+    // case because otherwise a loop calling AddAllocated() followed by Clear()
+    // would leak memory.
+    TypeHandler::Delete(cast<TypeHandler>(rep_->elements[current_size_]),
+                        arena_);
+  } else if (current_size_ < rep_->allocated_size) {
+    // We have some cleared objects.  We don't care about their order, so we
+    // can just move the first one to the end to make space.
+    rep_->elements[rep_->allocated_size] = rep_->elements[current_size_];
+    ++rep_->allocated_size;
+  } else {
+    // There are no cleared objects.
+    ++rep_->allocated_size;
+  }
+
+  rep_->elements[current_size_++] = value;
+}
+
+// ReleaseLast() for types that implement merge/copy behavior.
+template <typename TypeHandler>
+inline typename TypeHandler::Type* RepeatedPtrFieldBase::ReleaseLastInternal(
+    std::true_type) {
+  // First, release an element.
+  typename TypeHandler::Type* result = UnsafeArenaReleaseLast<TypeHandler>();
+  // Now perform a copy if we're on an arena.
+  Arena* arena = GetArena();
+
+  typename TypeHandler::Type* new_result;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  new_result = copy<TypeHandler>(result);
+  if (arena == nullptr) delete result;
+#else   // PROTOBUF_FORCE_COPY_IN_RELEASE
+  new_result = (arena == nullptr) ? result : copy<TypeHandler>(result);
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return new_result;
+}
+
+// ReleaseLast() for types that *do not* implement merge/copy behavior -- this
+// is the same as UnsafeArenaReleaseLast(). Note that we GOOGLE_DCHECK-fail if we're on
+// an arena, since the user really should implement the copy operation in this
+// case.
+template <typename TypeHandler>
+inline typename TypeHandler::Type* RepeatedPtrFieldBase::ReleaseLastInternal(
+    std::false_type) {
+  GOOGLE_DCHECK(GetArena() == nullptr)
+      << "ReleaseLast() called on a RepeatedPtrField that is on an arena, "
+      << "with a type that does not implement MergeFrom. This is unsafe; "
+      << "please implement MergeFrom for your type.";
+  return UnsafeArenaReleaseLast<TypeHandler>();
+}
+
+template <typename TypeHandler>
+inline typename TypeHandler::Type*
+RepeatedPtrFieldBase::UnsafeArenaReleaseLast() {
+  GOOGLE_DCHECK_GT(current_size_, 0);
+  typename TypeHandler::Type* result =
+      cast<TypeHandler>(rep_->elements[--current_size_]);
+  --rep_->allocated_size;
+  if (current_size_ < rep_->allocated_size) {
+    // There are cleared elements on the end; replace the removed element
+    // with the last allocated element.
+    rep_->elements[current_size_] = rep_->elements[rep_->allocated_size];
+  }
+  return result;
+}
+
+inline int RepeatedPtrFieldBase::ClearedCount() const {
+  return rep_ ? (rep_->allocated_size - current_size_) : 0;
+}
+
+template <typename TypeHandler>
+inline void RepeatedPtrFieldBase::AddCleared(
+    typename TypeHandler::Type* value) {
+  GOOGLE_DCHECK(GetArena() == nullptr)
+      << "AddCleared() can only be used on a RepeatedPtrField not on an arena.";
+  GOOGLE_DCHECK(TypeHandler::GetOwningArena(value) == nullptr)
+      << "AddCleared() can only accept values not on an arena.";
+  if (!rep_ || rep_->allocated_size == total_size_) {
+    Reserve(total_size_ + 1);
+  }
+  rep_->elements[rep_->allocated_size++] = value;
+}
+
+template <typename TypeHandler>
+inline typename TypeHandler::Type* RepeatedPtrFieldBase::ReleaseCleared() {
+  GOOGLE_DCHECK(GetArena() == nullptr)
+      << "ReleaseCleared() can only be used on a RepeatedPtrField not on "
+      << "an arena.";
+  GOOGLE_DCHECK(GetArena() == nullptr);
+  GOOGLE_DCHECK(rep_ != nullptr);
+  GOOGLE_DCHECK_GT(rep_->allocated_size, current_size_);
+  return cast<TypeHandler>(rep_->elements[--rep_->allocated_size]);
+}
+
+}  // namespace internal
+
+// -------------------------------------------------------------------
+
+template <typename Element>
+class RepeatedPtrField<Element>::TypeHandler
+    : public internal::GenericTypeHandler<Element> {};
+
+template <>
+class RepeatedPtrField<std::string>::TypeHandler
+    : public internal::StringTypeHandler {};
+
+template <typename Element>
+constexpr RepeatedPtrField<Element>::RepeatedPtrField()
+    : RepeatedPtrFieldBase() {}
+
+template <typename Element>
+inline RepeatedPtrField<Element>::RepeatedPtrField(Arena* arena)
+    : RepeatedPtrFieldBase(arena) {}
+
+template <typename Element>
+inline RepeatedPtrField<Element>::RepeatedPtrField(
+    const RepeatedPtrField& other)
+    : RepeatedPtrFieldBase() {
+  MergeFrom(other);
+}
+
+template <typename Element>
+template <typename Iter, typename>
+inline RepeatedPtrField<Element>::RepeatedPtrField(Iter begin, Iter end) {
+  Add(begin, end);
+}
+
+template <typename Element>
+RepeatedPtrField<Element>::~RepeatedPtrField() {
+#ifdef __cpp_if_constexpr
+  if constexpr (std::is_base_of<MessageLite, Element>::value) {
+#else
+  if (std::is_base_of<MessageLite, Element>::value) {
+#endif
+    if (NeedsDestroy()) DestroyProtos();
+  } else {
+    Destroy<TypeHandler>();
+  }
+}
+
+template <typename Element>
+inline RepeatedPtrField<Element>& RepeatedPtrField<Element>::operator=(
+    const RepeatedPtrField& other) {
+  if (this != &other) CopyFrom(other);
+  return *this;
+}
+
+template <typename Element>
+inline RepeatedPtrField<Element>::RepeatedPtrField(
+    RepeatedPtrField&& other) noexcept
+    : RepeatedPtrField() {
+#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+  CopyFrom(other);
+#else   // PROTOBUF_FORCE_COPY_IN_MOVE
+  // We don't just call Swap(&other) here because it would perform 3 copies if
+  // other is on an arena. This field can't be on an arena because arena
+  // construction always uses the Arena* accepting constructor.
+  if (other.GetArena()) {
+    CopyFrom(other);
+  } else {
+    InternalSwap(&other);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+}
+
+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 (GetArena() != other.GetArena()
+#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        || GetArena() == nullptr
+#endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      CopyFrom(other);
+    } else {
+      InternalSwap(&other);
+    }
+  }
+  return *this;
+}
+
+template <typename Element>
+inline bool RepeatedPtrField<Element>::empty() const {
+  return RepeatedPtrFieldBase::empty();
+}
+
+template <typename Element>
+inline int RepeatedPtrField<Element>::size() const {
+  return RepeatedPtrFieldBase::size();
+}
+
+template <typename Element>
+inline const Element& RepeatedPtrField<Element>::Get(int index) const {
+  return RepeatedPtrFieldBase::Get<TypeHandler>(index);
+}
+
+template <typename Element>
+inline const Element& RepeatedPtrField<Element>::at(int index) const {
+  return RepeatedPtrFieldBase::at<TypeHandler>(index);
+}
+
+template <typename Element>
+inline Element& RepeatedPtrField<Element>::at(int index) {
+  return RepeatedPtrFieldBase::at<TypeHandler>(index);
+}
+
+
+template <typename Element>
+inline Element* RepeatedPtrField<Element>::Mutable(int index) {
+  return RepeatedPtrFieldBase::Mutable<TypeHandler>(index);
+}
+
+template <typename Element>
+inline Element* RepeatedPtrField<Element>::Add() {
+  return RepeatedPtrFieldBase::Add<TypeHandler>();
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::Add(Element&& value) {
+  RepeatedPtrFieldBase::Add<TypeHandler>(std::move(value));
+}
+
+template <typename Element>
+template <typename Iter>
+inline void RepeatedPtrField<Element>::Add(Iter begin, Iter end) {
+  if (std::is_base_of<
+          std::forward_iterator_tag,
+          typename std::iterator_traits<Iter>::iterator_category>::value) {
+    int reserve = std::distance(begin, end);
+    Reserve(size() + reserve);
+  }
+  for (; begin != end; ++begin) {
+    *Add() = *begin;
+  }
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::RemoveLast() {
+  RepeatedPtrFieldBase::RemoveLast<TypeHandler>();
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::DeleteSubrange(int start, int num) {
+  GOOGLE_DCHECK_GE(start, 0);
+  GOOGLE_DCHECK_GE(num, 0);
+  GOOGLE_DCHECK_LE(start + num, size());
+  for (int i = 0; i < num; ++i) {
+    RepeatedPtrFieldBase::Delete<TypeHandler>(start + i);
+  }
+  UnsafeArenaExtractSubrange(start, num, nullptr);
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::ExtractSubrange(int start, int num,
+                                                       Element** elements) {
+  typename internal::TypeImplementsMergeBehavior<
+      typename TypeHandler::Type>::type t;
+  ExtractSubrangeInternal(start, num, elements, t);
+}
+
+// ExtractSubrange() implementation for types that implement merge/copy
+// behavior.
+template <typename Element>
+inline void RepeatedPtrField<Element>::ExtractSubrangeInternal(
+    int start, int num, Element** elements, std::true_type) {
+  GOOGLE_DCHECK_GE(start, 0);
+  GOOGLE_DCHECK_GE(num, 0);
+  GOOGLE_DCHECK_LE(start + num, size());
+
+  if (num == 0) return;
+
+  GOOGLE_DCHECK_NE(elements, nullptr)
+      << "Releasing elements without transferring ownership is an unsafe "
+         "operation.  Use UnsafeArenaExtractSubrange.";
+  if (elements == nullptr) {
+    CloseGap(start, num);
+    return;
+  }
+
+  Arena* arena = GetArena();
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  // Always copy.
+  for (int i = 0; i < num; ++i) {
+    elements[i] = copy<TypeHandler>(
+        RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start));
+  }
+  if (arena == nullptr) {
+    for (int i = 0; i < num; ++i) {
+      delete RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start);
+    }
+  }
+#else   // PROTOBUF_FORCE_COPY_IN_RELEASE
+  // If we're on an arena, we perform a copy for each element so that the
+  // returned elements are heap-allocated. Otherwise, just forward it.
+  if (arena != nullptr) {
+    for (int i = 0; i < num; ++i) {
+      elements[i] = copy<TypeHandler>(
+          RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start));
+    }
+  } else {
+    for (int i = 0; i < num; ++i) {
+      elements[i] = RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start);
+    }
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  CloseGap(start, num);
+}
+
+// ExtractSubrange() implementation for types that do not implement merge/copy
+// behavior.
+template <typename Element>
+inline void RepeatedPtrField<Element>::ExtractSubrangeInternal(
+    int start, int num, Element** elements, std::false_type) {
+  // This case is identical to UnsafeArenaExtractSubrange(). However, since
+  // ExtractSubrange() must return heap-allocated objects by contract, and we
+  // cannot fulfill this contract if we are an on arena, we must GOOGLE_DCHECK() that
+  // we are not on an arena.
+  GOOGLE_DCHECK(GetArena() == nullptr)
+      << "ExtractSubrange() when arena is non-nullptr is only supported when "
+      << "the Element type supplies a MergeFrom() operation to make copies.";
+  UnsafeArenaExtractSubrange(start, num, elements);
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::UnsafeArenaExtractSubrange(
+    int start, int num, Element** elements) {
+  GOOGLE_DCHECK_GE(start, 0);
+  GOOGLE_DCHECK_GE(num, 0);
+  GOOGLE_DCHECK_LE(start + num, size());
+
+  if (num > 0) {
+    // Save the values of the removed elements if requested.
+    if (elements != nullptr) {
+      for (int i = 0; i < num; ++i) {
+        elements[i] = RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start);
+      }
+    }
+    CloseGap(start, num);
+  }
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::Clear() {
+  RepeatedPtrFieldBase::Clear<TypeHandler>();
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::MergeFrom(
+    const RepeatedPtrField& other) {
+  RepeatedPtrFieldBase::MergeFrom<TypeHandler>(other);
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::CopyFrom(const RepeatedPtrField& other) {
+  RepeatedPtrFieldBase::CopyFrom<TypeHandler>(other);
+}
+
+template <typename Element>
+template <typename Iter>
+inline void RepeatedPtrField<Element>::Assign(Iter begin, Iter end) {
+  Clear();
+  Add(begin, end);
+}
+
+template <typename Element>
+inline typename RepeatedPtrField<Element>::iterator
+RepeatedPtrField<Element>::erase(const_iterator position) {
+  return erase(position, position + 1);
+}
+
+template <typename Element>
+inline typename RepeatedPtrField<Element>::iterator
+RepeatedPtrField<Element>::erase(const_iterator first, const_iterator last) {
+  size_type pos_offset = std::distance(cbegin(), first);
+  size_type last_offset = std::distance(cbegin(), last);
+  DeleteSubrange(pos_offset, last_offset - pos_offset);
+  return begin() + pos_offset;
+}
+
+template <typename Element>
+inline Element** RepeatedPtrField<Element>::mutable_data() {
+  return RepeatedPtrFieldBase::mutable_data<TypeHandler>();
+}
+
+template <typename Element>
+inline const Element* const* RepeatedPtrField<Element>::data() const {
+  return RepeatedPtrFieldBase::data<TypeHandler>();
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::Swap(RepeatedPtrField* other) {
+  if (this == other) return;
+  RepeatedPtrFieldBase::Swap<TypeHandler>(other);
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::UnsafeArenaSwap(
+    RepeatedPtrField* other) {
+  if (this == other) return;
+  RepeatedPtrFieldBase::InternalSwap(other);
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::SwapElements(int index1, int index2) {
+  RepeatedPtrFieldBase::SwapElements(index1, index2);
+}
+
+template <typename Element>
+inline Arena* RepeatedPtrField<Element>::GetArena() const {
+  return RepeatedPtrFieldBase::GetArena();
+}
+
+template <typename Element>
+inline size_t RepeatedPtrField<Element>::SpaceUsedExcludingSelfLong() const {
+  return RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong<TypeHandler>();
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::AddAllocated(Element* value) {
+  RepeatedPtrFieldBase::AddAllocated<TypeHandler>(value);
+}
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::UnsafeArenaAddAllocated(Element* value) {
+  RepeatedPtrFieldBase::UnsafeArenaAddAllocated<TypeHandler>(value);
+}
+
+template <typename Element>
+inline Element* RepeatedPtrField<Element>::ReleaseLast() {
+  return RepeatedPtrFieldBase::ReleaseLast<TypeHandler>();
+}
+
+template <typename Element>
+inline Element* RepeatedPtrField<Element>::UnsafeArenaReleaseLast() {
+  return RepeatedPtrFieldBase::UnsafeArenaReleaseLast<TypeHandler>();
+}
+
+template <typename Element>
+inline int RepeatedPtrField<Element>::ClearedCount() const {
+  return RepeatedPtrFieldBase::ClearedCount();
+}
+
+#ifndef PROTOBUF_FUTURE_BREAKING_CHANGES
+template <typename Element>
+inline void RepeatedPtrField<Element>::AddCleared(Element* value) {
+  return RepeatedPtrFieldBase::AddCleared<TypeHandler>(value);
+}
+
+template <typename Element>
+inline Element* RepeatedPtrField<Element>::ReleaseCleared() {
+  return RepeatedPtrFieldBase::ReleaseCleared<TypeHandler>();
+}
+#endif  // !PROTOBUF_FUTURE_BREAKING_CHANGES
+
+template <typename Element>
+inline void RepeatedPtrField<Element>::Reserve(int new_size) {
+  return RepeatedPtrFieldBase::Reserve(new_size);
+}
+
+template <typename Element>
+inline int RepeatedPtrField<Element>::Capacity() const {
+  return RepeatedPtrFieldBase::Capacity();
+}
+
+// -------------------------------------------------------------------
+
+namespace internal {
+
+// STL-like iterator implementation for RepeatedPtrField.  You should not
+// refer to this class directly; use RepeatedPtrField<T>::iterator instead.
+//
+// The iterator for RepeatedPtrField<T>, RepeatedPtrIterator<T>, is
+// very similar to iterator_ptr<T**> in util/gtl/iterator_adaptors.h,
+// but adds random-access operators and is modified to wrap a void** base
+// iterator (since RepeatedPtrField stores its array as a void* array and
+// casting void** to T** would violate C++ aliasing rules).
+//
+// This code based on net/proto/proto-array-internal.h by Jeffrey Yasskin
+// (jyasskin@google.com).
+template <typename Element>
+class RepeatedPtrIterator {
+ public:
+  using iterator = RepeatedPtrIterator<Element>;
+  using iterator_category = std::random_access_iterator_tag;
+  using value_type = typename std::remove_const<Element>::type;
+  using difference_type = std::ptrdiff_t;
+  using pointer = Element*;
+  using reference = Element&;
+
+  RepeatedPtrIterator() : it_(nullptr) {}
+  explicit RepeatedPtrIterator(void* const* it) : it_(it) {}
+
+  // Allow "upcasting" from RepeatedPtrIterator<T**> to
+  // RepeatedPtrIterator<const T*const*>.
+  template <typename OtherElement>
+  RepeatedPtrIterator(const RepeatedPtrIterator<OtherElement>& other)
+      : it_(other.it_) {
+    // Force a compiler error if the other type is not convertible to ours.
+    if (false) {
+      static_cast<void>([](OtherElement* from) -> Element* { return from; });
+    }
+  }
+
+  // dereferenceable
+  reference operator*() const { return *reinterpret_cast<Element*>(*it_); }
+  pointer operator->() const { return &(operator*()); }
+
+  // {inc,dec}rementable
+  iterator& operator++() {
+    ++it_;
+    return *this;
+  }
+  iterator operator++(int) { return iterator(it_++); }
+  iterator& operator--() {
+    --it_;
+    return *this;
+  }
+  iterator operator--(int) { return iterator(it_--); }
+
+  // equality_comparable
+  bool operator==(const iterator& x) const { return it_ == x.it_; }
+  bool operator!=(const iterator& x) const { return it_ != x.it_; }
+
+  // less_than_comparable
+  bool operator<(const iterator& x) const { return it_ < x.it_; }
+  bool operator<=(const iterator& x) const { return it_ <= x.it_; }
+  bool operator>(const iterator& x) const { return it_ > x.it_; }
+  bool operator>=(const iterator& x) const { return it_ >= x.it_; }
+
+  // addable, subtractable
+  iterator& operator+=(difference_type d) {
+    it_ += d;
+    return *this;
+  }
+  friend iterator operator+(iterator it, const difference_type d) {
+    it += d;
+    return it;
+  }
+  friend iterator operator+(const difference_type d, iterator it) {
+    it += d;
+    return it;
+  }
+  iterator& operator-=(difference_type d) {
+    it_ -= d;
+    return *this;
+  }
+  friend iterator operator-(iterator it, difference_type d) {
+    it -= d;
+    return it;
+  }
+
+  // indexable
+  reference operator[](difference_type d) const { return *(*this + d); }
+
+  // random access iterator
+  difference_type operator-(const iterator& x) const { return it_ - x.it_; }
+
+ private:
+  template <typename OtherElement>
+  friend class RepeatedPtrIterator;
+
+  // The internal iterator.
+  void* const* it_;
+};
+
+// Provide an iterator that operates on pointers to the underlying objects
+// rather than the objects themselves as RepeatedPtrIterator does.
+// Consider using this when working with stl algorithms that change
+// the array.
+// The VoidPtr template parameter holds the type-agnostic pointer value
+// referenced by the iterator.  It should either be "void *" for a mutable
+// iterator, or "const void* const" for a constant iterator.
+template <typename Element, typename VoidPtr>
+class RepeatedPtrOverPtrsIterator {
+ public:
+  using iterator = RepeatedPtrOverPtrsIterator<Element, VoidPtr>;
+  using iterator_category = std::random_access_iterator_tag;
+  using value_type = typename std::remove_const<Element>::type;
+  using difference_type = std::ptrdiff_t;
+  using pointer = Element*;
+  using reference = Element&;
+
+  RepeatedPtrOverPtrsIterator() : it_(nullptr) {}
+  explicit RepeatedPtrOverPtrsIterator(VoidPtr* it) : it_(it) {}
+
+  // dereferenceable
+  reference operator*() const { return *reinterpret_cast<Element*>(it_); }
+  pointer operator->() const { return &(operator*()); }
+
+  // {inc,dec}rementable
+  iterator& operator++() {
+    ++it_;
+    return *this;
+  }
+  iterator operator++(int) { return iterator(it_++); }
+  iterator& operator--() {
+    --it_;
+    return *this;
+  }
+  iterator operator--(int) { return iterator(it_--); }
+
+  // equality_comparable
+  bool operator==(const iterator& x) const { return it_ == x.it_; }
+  bool operator!=(const iterator& x) const { return it_ != x.it_; }
+
+  // less_than_comparable
+  bool operator<(const iterator& x) const { return it_ < x.it_; }
+  bool operator<=(const iterator& x) const { return it_ <= x.it_; }
+  bool operator>(const iterator& x) const { return it_ > x.it_; }
+  bool operator>=(const iterator& x) const { return it_ >= x.it_; }
+
+  // addable, subtractable
+  iterator& operator+=(difference_type d) {
+    it_ += d;
+    return *this;
+  }
+  friend iterator operator+(iterator it, difference_type d) {
+    it += d;
+    return it;
+  }
+  friend iterator operator+(difference_type d, iterator it) {
+    it += d;
+    return it;
+  }
+  iterator& operator-=(difference_type d) {
+    it_ -= d;
+    return *this;
+  }
+  friend iterator operator-(iterator it, difference_type d) {
+    it -= d;
+    return it;
+  }
+
+  // indexable
+  reference operator[](difference_type d) const { return *(*this + d); }
+
+  // random access iterator
+  difference_type operator-(const iterator& x) const { return it_ - x.it_; }
+
+ private:
+  template <typename OtherElement>
+  friend class RepeatedPtrIterator;
+
+  // The internal iterator.
+  VoidPtr* it_;
+};
+
+void RepeatedPtrFieldBase::InternalSwap(RepeatedPtrFieldBase* rhs) {
+  GOOGLE_DCHECK(this != rhs);
+
+  // Swap all fields at once.
+  auto temp = std::make_tuple(rhs->arena_, rhs->current_size_, rhs->total_size_,
+                              rhs->rep_);
+  std::tie(rhs->arena_, rhs->current_size_, rhs->total_size_, rhs->rep_) =
+      std::make_tuple(arena_, current_size_, total_size_, rep_);
+  std::tie(arena_, current_size_, total_size_, rep_) = temp;
+}
+
+}  // namespace internal
+
+template <typename Element>
+inline typename RepeatedPtrField<Element>::iterator
+RepeatedPtrField<Element>::begin() {
+  return iterator(raw_data());
+}
+template <typename Element>
+inline typename RepeatedPtrField<Element>::const_iterator
+RepeatedPtrField<Element>::begin() const {
+  return iterator(raw_data());
+}
+template <typename Element>
+inline typename RepeatedPtrField<Element>::const_iterator
+RepeatedPtrField<Element>::cbegin() const {
+  return begin();
+}
+template <typename Element>
+inline typename RepeatedPtrField<Element>::iterator
+RepeatedPtrField<Element>::end() {
+  return iterator(raw_data() + size());
+}
+template <typename Element>
+inline typename RepeatedPtrField<Element>::const_iterator
+RepeatedPtrField<Element>::end() const {
+  return iterator(raw_data() + size());
+}
+template <typename Element>
+inline typename RepeatedPtrField<Element>::const_iterator
+RepeatedPtrField<Element>::cend() const {
+  return end();
+}
+
+template <typename Element>
+inline typename RepeatedPtrField<Element>::pointer_iterator
+RepeatedPtrField<Element>::pointer_begin() {
+  return pointer_iterator(raw_mutable_data());
+}
+template <typename Element>
+inline typename RepeatedPtrField<Element>::const_pointer_iterator
+RepeatedPtrField<Element>::pointer_begin() const {
+  return const_pointer_iterator(const_cast<const void* const*>(raw_data()));
+}
+template <typename Element>
+inline typename RepeatedPtrField<Element>::pointer_iterator
+RepeatedPtrField<Element>::pointer_end() {
+  return pointer_iterator(raw_mutable_data() + size());
+}
+template <typename Element>
+inline typename RepeatedPtrField<Element>::const_pointer_iterator
+RepeatedPtrField<Element>::pointer_end() const {
+  return const_pointer_iterator(
+      const_cast<const void* const*>(raw_data() + size()));
+}
+
+// Iterators and helper functions that follow the spirit of the STL
+// std::back_insert_iterator and std::back_inserter but are tailor-made
+// for RepeatedField and RepeatedPtrField. Typical usage would be:
+//
+//   std::copy(some_sequence.begin(), some_sequence.end(),
+//             RepeatedFieldBackInserter(proto.mutable_sequence()));
+//
+// Ported by johannes from util/gtl/proto-array-iterators.h
+
+namespace internal {
+
+// A back inserter for RepeatedPtrField objects.
+template <typename T>
+class RepeatedPtrFieldBackInsertIterator {
+ public:
+  using iterator_category = std::output_iterator_tag;
+  using value_type = T;
+  using pointer = void;
+  using reference = void;
+  using difference_type = std::ptrdiff_t;
+
+  RepeatedPtrFieldBackInsertIterator(RepeatedPtrField<T>* const mutable_field)
+      : field_(mutable_field) {}
+  RepeatedPtrFieldBackInsertIterator<T>& operator=(const T& value) {
+    *field_->Add() = value;
+    return *this;
+  }
+  RepeatedPtrFieldBackInsertIterator<T>& operator=(
+      const T* const ptr_to_value) {
+    *field_->Add() = *ptr_to_value;
+    return *this;
+  }
+  RepeatedPtrFieldBackInsertIterator<T>& operator=(T&& value) {
+    *field_->Add() = std::move(value);
+    return *this;
+  }
+  RepeatedPtrFieldBackInsertIterator<T>& operator*() { return *this; }
+  RepeatedPtrFieldBackInsertIterator<T>& operator++() { return *this; }
+  RepeatedPtrFieldBackInsertIterator<T>& operator++(int /* unused */) {
+    return *this;
+  }
+
+ private:
+  RepeatedPtrField<T>* field_;
+};
+
+// A back inserter for RepeatedPtrFields that inserts by transferring ownership
+// of a pointer.
+template <typename T>
+class AllocatedRepeatedPtrFieldBackInsertIterator {
+ public:
+  using iterator_category = std::output_iterator_tag;
+  using value_type = T;
+  using pointer = void;
+  using reference = void;
+  using difference_type = std::ptrdiff_t;
+
+  explicit AllocatedRepeatedPtrFieldBackInsertIterator(
+      RepeatedPtrField<T>* const mutable_field)
+      : field_(mutable_field) {}
+  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator=(
+      T* const ptr_to_value) {
+    field_->AddAllocated(ptr_to_value);
+    return *this;
+  }
+  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator*() { return *this; }
+  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++() { return *this; }
+  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++(int /* unused */) {
+    return *this;
+  }
+
+ private:
+  RepeatedPtrField<T>* field_;
+};
+
+// Almost identical to AllocatedRepeatedPtrFieldBackInsertIterator. This one
+// uses the UnsafeArenaAddAllocated instead.
+template <typename T>
+class UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator {
+ public:
+  using iterator_category = std::output_iterator_tag;
+  using value_type = T;
+  using pointer = void;
+  using reference = void;
+  using difference_type = std::ptrdiff_t;
+
+  explicit UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator(
+      RepeatedPtrField<T>* const mutable_field)
+      : field_(mutable_field) {}
+  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator=(
+      T const* const ptr_to_value) {
+    field_->UnsafeArenaAddAllocated(const_cast<T*>(ptr_to_value));
+    return *this;
+  }
+  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator*() {
+    return *this;
+  }
+  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++() {
+    return *this;
+  }
+  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++(
+      int /* unused */) {
+    return *this;
+  }
+
+ private:
+  RepeatedPtrField<T>* field_;
+};
+
+}  // namespace internal
+
+// Provides a back insert iterator for RepeatedPtrField instances,
+// similar to std::back_inserter().
+template <typename T>
+internal::RepeatedPtrFieldBackInsertIterator<T> RepeatedPtrFieldBackInserter(
+    RepeatedPtrField<T>* const mutable_field) {
+  return internal::RepeatedPtrFieldBackInsertIterator<T>(mutable_field);
+}
+
+// Special back insert iterator for RepeatedPtrField instances, just in
+// case someone wants to write generic template code that can access both
+// RepeatedFields and RepeatedPtrFields using a common name.
+template <typename T>
+internal::RepeatedPtrFieldBackInsertIterator<T> RepeatedFieldBackInserter(
+    RepeatedPtrField<T>* const mutable_field) {
+  return internal::RepeatedPtrFieldBackInsertIterator<T>(mutable_field);
+}
+
+// Provides a back insert iterator for RepeatedPtrField instances
+// similar to std::back_inserter() which transfers the ownership while
+// copying elements.
+template <typename T>
+internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>
+AllocatedRepeatedPtrFieldBackInserter(
+    RepeatedPtrField<T>* const mutable_field) {
+  return internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>(
+      mutable_field);
+}
+
+// Similar to AllocatedRepeatedPtrFieldBackInserter, using
+// UnsafeArenaAddAllocated instead of AddAllocated.
+// This is slightly faster if that matters. It is also useful in legacy code
+// that uses temporary ownership to avoid copies. Example:
+//   RepeatedPtrField<T> temp_field;
+//   temp_field.UnsafeArenaAddAllocated(new T);
+//   ... // Do something with temp_field
+//   temp_field.UnsafeArenaExtractSubrange(0, temp_field.size(), nullptr);
+// If you put temp_field on the arena this fails, because the ownership
+// transfers to the arena at the "AddAllocated" call and is not released anymore
+// causing a double delete. Using UnsafeArenaAddAllocated prevents this.
+template <typename T>
+internal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>
+UnsafeArenaAllocatedRepeatedPtrFieldBackInserter(
+    RepeatedPtrField<T>* const mutable_field) {
+  return internal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>(
+      mutable_field);
+}
+
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE
+    RepeatedPtrField<std::string>;
+
+}  // namespace protobuf
+}  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
+#endif  // GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/service.h b/3rdparty/protobuf/src/google/protobuf/service.h
deleted file mode 100644 (file)
index ad6f968..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-//
-// DEPRECATED:  This module declares the abstract interfaces underlying proto2
-// RPC services.  These are intented to be independent of any particular RPC
-// implementation, so that proto2 services can be used on top of a variety
-// of implementations.  Starting with version 2.3.0, RPC implementations should
-// not try to build on these, but should instead provide code generator plugins
-// which generate code specific to the particular RPC implementation.  This way
-// the generated code can be more appropriate for the implementation in use
-// and can avoid unnecessary layers of indirection.
-//
-//
-// When you use the protocol compiler to compile a service definition, it
-// generates two classes:  An abstract interface for the service (with
-// methods matching the service definition) and a "stub" implementation.
-// A stub is just a type-safe wrapper around an RpcChannel which emulates a
-// local implementation of the service.
-//
-// For example, the service definition:
-//   service MyService {
-//     rpc Foo(MyRequest) returns(MyResponse);
-//   }
-// will generate abstract interface "MyService" and class "MyService::Stub".
-// You could implement a MyService as follows:
-//   class MyServiceImpl : public MyService {
-//    public:
-//     MyServiceImpl() {}
-//     ~MyServiceImpl() {}
-//
-//     // implements MyService ---------------------------------------
-//
-//     void Foo(google::protobuf::RpcController* controller,
-//              const MyRequest* request,
-//              MyResponse* response,
-//              Closure* done) {
-//       // ... read request and fill in response ...
-//       done->Run();
-//     }
-//   };
-// You would then register an instance of MyServiceImpl with your RPC server
-// implementation.  (How to do that depends on the implementation.)
-//
-// To call a remote MyServiceImpl, first you need an RpcChannel connected to it.
-// How to construct a channel depends, again, on your RPC implementation.
-// Here we use a hypothetical "MyRpcChannel" as an example:
-//   MyRpcChannel channel("rpc:hostname:1234/myservice");
-//   MyRpcController controller;
-//   MyServiceImpl::Stub stub(&channel);
-//   FooRequest request;
-//   FooResponse response;
-//
-//   // ... fill in request ...
-//
-//   stub.Foo(&controller, request, &response, NewCallback(HandleResponse));
-//
-// On Thread-Safety:
-//
-// Different RPC implementations may make different guarantees about what
-// threads they may run callbacks on, and what threads the application is
-// allowed to use to call the RPC system.  Portable software should be ready
-// for callbacks to be called on any thread, but should not try to call the
-// RPC system from any thread except for the ones on which it received the
-// callbacks.  Realistically, though, simple software will probably want to
-// use a single-threaded RPC system while high-end software will want to
-// use multiple threads.  RPC implementations should provide multiple
-// choices.
-
-#ifndef GOOGLE_PROTOBUF_SERVICE_H__
-#define GOOGLE_PROTOBUF_SERVICE_H__
-
-#include <string>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/callback.h>
-
-namespace google {
-namespace protobuf {
-
-// Defined in this file.
-class Service;
-class RpcController;
-class RpcChannel;
-
-// Defined in other files.
-class Descriptor;            // descriptor.h
-class ServiceDescriptor;     // descriptor.h
-class MethodDescriptor;      // descriptor.h
-class Message;               // message.h
-
-// Abstract base interface for protocol-buffer-based RPC services.  Services
-// themselves are abstract interfaces (implemented either by servers or as
-// stubs), but they subclass this base interface.  The methods of this
-// interface can be used to call the methods of the Service without knowing
-// its exact type at compile time (analogous to Reflection).
-class LIBPROTOBUF_EXPORT Service {
- public:
-  inline Service() {}
-  virtual ~Service();
-
-  // When constructing a stub, you may pass STUB_OWNS_CHANNEL as the second
-  // parameter to the constructor to tell it to delete its RpcChannel when
-  // destroyed.
-  enum ChannelOwnership {
-    STUB_OWNS_CHANNEL,
-    STUB_DOESNT_OWN_CHANNEL
-  };
-
-  // Get the ServiceDescriptor describing this service and its methods.
-  virtual const ServiceDescriptor* GetDescriptor() = 0;
-
-  // Call a method of the service specified by MethodDescriptor.  This is
-  // normally implemented as a simple switch() that calls the standard
-  // definitions of the service's methods.
-  //
-  // Preconditions:
-  // * method->service() == GetDescriptor()
-  // * request and response are of the exact same classes as the objects
-  //   returned by GetRequestPrototype(method) and
-  //   GetResponsePrototype(method).
-  // * After the call has started, the request must not be modified and the
-  //   response must not be accessed at all until "done" is called.
-  // * "controller" is of the correct type for the RPC implementation being
-  //   used by this Service.  For stubs, the "correct type" depends on the
-  //   RpcChannel which the stub is using.  Server-side Service
-  //   implementations are expected to accept whatever type of RpcController
-  //   the server-side RPC implementation uses.
-  //
-  // Postconditions:
-  // * "done" will be called when the method is complete.  This may be
-  //   before CallMethod() returns or it may be at some point in the future.
-  // * If the RPC succeeded, "response" contains the response returned by
-  //   the server.
-  // * If the RPC failed, "response"'s contents are undefined.  The
-  //   RpcController can be queried to determine if an error occurred and
-  //   possibly to get more information about the error.
-  virtual void CallMethod(const MethodDescriptor* method,
-                          RpcController* controller,
-                          const Message* request,
-                          Message* response,
-                          Closure* done) = 0;
-
-  // CallMethod() requires that the request and response passed in are of a
-  // particular subclass of Message.  GetRequestPrototype() and
-  // GetResponsePrototype() get the default instances of these required types.
-  // You can then call Message::New() on these instances to construct mutable
-  // objects which you can then pass to CallMethod().
-  //
-  // Example:
-  //   const MethodDescriptor* method =
-  //     service->GetDescriptor()->FindMethodByName("Foo");
-  //   Message* request  = stub->GetRequestPrototype (method)->New();
-  //   Message* response = stub->GetResponsePrototype(method)->New();
-  //   request->ParseFromString(input);
-  //   service->CallMethod(method, *request, response, callback);
-  virtual const Message& GetRequestPrototype(
-    const MethodDescriptor* method) const = 0;
-  virtual const Message& GetResponsePrototype(
-    const MethodDescriptor* method) const = 0;
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Service);
-};
-
-// An RpcController mediates a single method call.  The primary purpose of
-// the controller is to provide a way to manipulate settings specific to the
-// RPC implementation and to find out about RPC-level errors.
-//
-// The methods provided by the RpcController interface are intended to be a
-// "least common denominator" set of features which we expect all
-// implementations to support.  Specific implementations may provide more
-// advanced features (e.g. deadline propagation).
-class LIBPROTOBUF_EXPORT RpcController {
- public:
-  inline RpcController() {}
-  virtual ~RpcController();
-
-  // Client-side methods ---------------------------------------------
-  // These calls may be made from the client side only.  Their results
-  // are undefined on the server side (may crash).
-
-  // Resets the RpcController to its initial state so that it may be reused in
-  // a new call.  Must not be called while an RPC is in progress.
-  virtual void Reset() = 0;
-
-  // After a call has finished, returns true if the call failed.  The possible
-  // reasons for failure depend on the RPC implementation.  Failed() must not
-  // be called before a call has finished.  If Failed() returns true, the
-  // contents of the response message are undefined.
-  virtual bool Failed() const = 0;
-
-  // If Failed() is true, returns a human-readable description of the error.
-  virtual string ErrorText() const = 0;
-
-  // Advises the RPC system that the caller desires that the RPC call be
-  // canceled.  The RPC system may cancel it immediately, may wait awhile and
-  // then cancel it, or may not even cancel the call at all.  If the call is
-  // canceled, the "done" callback will still be called and the RpcController
-  // will indicate that the call failed at that time.
-  virtual void StartCancel() = 0;
-
-  // Server-side methods ---------------------------------------------
-  // These calls may be made from the server side only.  Their results
-  // are undefined on the client side (may crash).
-
-  // Causes Failed() to return true on the client side.  "reason" will be
-  // incorporated into the message returned by ErrorText().  If you find
-  // you need to return machine-readable information about failures, you
-  // should incorporate it into your response protocol buffer and should
-  // NOT call SetFailed().
-  virtual void SetFailed(const string& reason) = 0;
-
-  // If true, indicates that the client canceled the RPC, so the server may
-  // as well give up on replying to it.  The server should still call the
-  // final "done" callback.
-  virtual bool IsCanceled() const = 0;
-
-  // Asks that the given callback be called when the RPC is canceled.  The
-  // callback will always be called exactly once.  If the RPC completes without
-  // being canceled, the callback will be called after completion.  If the RPC
-  // has already been canceled when NotifyOnCancel() is called, the callback
-  // will be called immediately.
-  //
-  // NotifyOnCancel() must be called no more than once per request.
-  virtual void NotifyOnCancel(Closure* callback) = 0;
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RpcController);
-};
-
-// Abstract interface for an RPC channel.  An RpcChannel represents a
-// communication line to a Service which can be used to call that Service's
-// methods.  The Service may be running on another machine.  Normally, you
-// should not call an RpcChannel directly, but instead construct a stub Service
-// wrapping it.  Example:
-//   RpcChannel* channel = new MyRpcChannel("remotehost.example.com:1234");
-//   MyService* service = new MyService::Stub(channel);
-//   service->MyMethod(request, &response, callback);
-class LIBPROTOBUF_EXPORT RpcChannel {
- public:
-  inline RpcChannel() {}
-  virtual ~RpcChannel();
-
-  // Call the given method of the remote service.  The signature of this
-  // procedure looks the same as Service::CallMethod(), but the requirements
-  // are less strict in one important way:  the request and response objects
-  // need not be of any specific class as long as their descriptors are
-  // method->input_type() and method->output_type().
-  virtual void CallMethod(const MethodDescriptor* method,
-                          RpcController* controller,
-                          const Message* request,
-                          Message* response,
-                          Closure* done) = 0;
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RpcChannel);
-};
-
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_SERVICE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/source_context.pb.cc b/3rdparty/protobuf/src/google/protobuf/source_context.pb.cc
deleted file mode 100644 (file)
index 4a290e1..0000000
+++ /dev/null
@@ -1,381 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/source_context.proto
-
-#include <google/protobuf/source_context.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class SourceContextDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_SourceContext_default_instance_;
-    new (ptr) ::google::protobuf::SourceContext();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::google::protobuf::SourceContext::InitAsDefaultInstance();
-}
-
-void InitDefaultsSourceContext() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSourceContextImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[1];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::SourceContext, file_name_),
-};
-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*>(&::google::protobuf::_SourceContext_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/source_context.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "rceContextProtoP\001ZAgoogle.golang.org/gen"
-      "proto/protobuf/source_context;source_con"
-      "text\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTy"
-      "pesb\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 251);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/source_context.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_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
-
-SourceContext::SourceContext()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContext();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.SourceContext)
-}
-SourceContext::SourceContext(const SourceContext& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.file_name().size() > 0) {
-    file_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.file_name_);
-  }
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceContext)
-}
-
-void SourceContext::SharedCtor() {
-  file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
-}
-
-SourceContext::~SourceContext() {
-  // @@protoc_insertion_point(destructor:google.protobuf.SourceContext)
-  SharedDtor();
-}
-
-void SourceContext::SharedDtor() {
-  file_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void SourceContext::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const SourceContext& SourceContext::default_instance() {
-  ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContext();
-  return *internal_default_instance();
-}
-
-SourceContext* SourceContext::New(::google::protobuf::Arena* arena) const {
-  SourceContext* n = new SourceContext;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void SourceContext::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.SourceContext)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _internal_metadata_.Clear();
-}
-
-bool SourceContext::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.SourceContext)
-  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)) {
-      // string file_name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_file_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->file_name().data(), static_cast<int>(this->file_name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.SourceContext.file_name"));
-        } 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.SourceContext)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.SourceContext)
-  return false;
-#undef DO_
-}
-
-void SourceContext::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.SourceContext)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string file_name = 1;
-  if (this->file_name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->file_name().data(), static_cast<int>(this->file_name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.SourceContext.file_name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->file_name(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.SourceContext)
-}
-
-::google::protobuf::uint8* SourceContext::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceContext)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string file_name = 1;
-  if (this->file_name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->file_name().data(), static_cast<int>(this->file_name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.SourceContext.file_name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->file_name(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceContext)
-  return target;
-}
-
-size_t SourceContext::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.SourceContext)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // string file_name = 1;
-  if (this->file_name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->file_name());
-  }
-
-  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 SourceContext::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.SourceContext)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SourceContext* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SourceContext>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceContext)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.SourceContext)
-    MergeFrom(*source);
-  }
-}
-
-void SourceContext::MergeFrom(const SourceContext& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.SourceContext)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.file_name().size() > 0) {
-
-    file_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.file_name_);
-  }
-}
-
-void SourceContext::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.SourceContext)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void SourceContext::CopyFrom(const SourceContext& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.SourceContext)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool SourceContext::IsInitialized() const {
-  return true;
-}
-
-void SourceContext::Swap(SourceContext* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void SourceContext::InternalSwap(SourceContext* other) {
-  using std::swap;
-  file_name_.Swap(&other->file_name_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::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];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/source_context.pb.h b/3rdparty/protobuf/src/google/protobuf/source_context.pb.h
deleted file mode 100644 (file)
index dfa2444..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/source_context.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/unknown_field_set.h>
-// @@protoc_insertion_point(includes)
-
-namespace protobuf_google_2fprotobuf_2fsource_5fcontext_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[1];
-  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 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 {
-
-// ===================================================================
-
-class LIBPROTOBUF_EXPORT SourceContext : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceContext) */ {
- public:
-  SourceContext();
-  virtual ~SourceContext();
-
-  SourceContext(const SourceContext& from);
-
-  inline SourceContext& operator=(const SourceContext& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  SourceContext(SourceContext&& from) noexcept
-    : SourceContext() {
-    *this = ::std::move(from);
-  }
-
-  inline SourceContext& operator=(SourceContext&& 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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void Swap(SourceContext* other);
-  friend void swap(SourceContext& a, SourceContext& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline SourceContext* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SourceContext* 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 SourceContext& from);
-  void MergeFrom(const SourceContext& 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(SourceContext* other);
-  private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
-  }
-  public:
-
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
-
-  // nested types ----------------------------------------------------
-
-  // accessors -------------------------------------------------------
-
-  // string file_name = 1;
-  void clear_file_name();
-  static const int kFileNameFieldNumber = 1;
-  const ::std::string& file_name() const;
-  void set_file_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_file_name(::std::string&& value);
-  #endif
-  void set_file_name(const char* value);
-  void set_file_name(const char* value, size_t size);
-  ::std::string* mutable_file_name();
-  ::std::string* release_file_name();
-  void set_allocated_file_name(::std::string* file_name);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.SourceContext)
- private:
-
-  ::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 void ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContextImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// SourceContext
-
-// string file_name = 1;
-inline void SourceContext::clear_file_name() {
-  file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline const ::std::string& SourceContext::file_name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.SourceContext.file_name)
-  return file_name_.GetNoArena();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* SourceContext::mutable_file_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.SourceContext.file_name)
-  return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* SourceContext::release_file_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.SourceContext.file_name)
-  
-  return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline 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)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto__INCLUDED
diff --git a/3rdparty/protobuf/src/google/protobuf/struct.pb.cc b/3rdparty/protobuf/src/google/protobuf/struct.pb.cc
deleted file mode 100644 (file)
index fe3ba32..0000000
+++ /dev/null
@@ -1,1475 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/struct.proto
-
-#include <google/protobuf/struct.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-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;
-} _Struct_default_instance_;
-class ValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Value>
-      _instance;
-  int null_value_;
-  double number_value_;
-  ::google::protobuf::internal::ArenaStringPtr string_value_;
-  bool bool_value_;
-  const ::google::protobuf::Struct* struct_value_;
-  const ::google::protobuf::ListValue* list_value_;
-} _Value_default_instance_;
-class ListValueDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_;
-    new (ptr) ::google::protobuf::Struct_FieldsEntry_DoNotUse();
-  }
-  {
-    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();
-}
-
-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];
-
-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(::google::protobuf::Struct, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct, fields_),
-  ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, _internal_metadata_),
-  ~0u,  // no _extensions_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, _oneof_case_[0]),
-  ~0u,  // no _weak_field_map_
-  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(::google::protobuf::ListValue, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ListValue, values_),
-};
-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*>(&::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_),
-};
-
-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);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo"
-      "gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull"
-      "_value\030\001 \001(\0162\032.google.protobuf.NullValue"
-      "H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val"
-      "ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru"
-      "ct_value\030\005 \001(\0132\027.google.protobuf.StructH"
-      "\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf."
-      "ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu"
-      "es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull"
-      "Value\022\016\n\nNULL_VALUE\020\000B\201\001\n\023com.google.pro"
-      "tobufB\013StructProtoP\001Z1github.com/golang/"
-      "protobuf/ptypes/struct;structpb\370\001\001\242\002\003GPB"
-      "\252\002\036Google.Protobuf.WellKnownTypesb\006proto"
-      "3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 641);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/struct.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_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];
-}
-bool NullValue_IsValid(int value) {
-  switch (value) {
-    case 0:
-      return true;
-    default:
-      return false;
-  }
-}
-
-
-// ===================================================================
-
-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);
-}
-::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::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Struct::kFieldsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Struct::Struct()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Struct)
-}
-Struct::Struct(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
-  fields_(arena) {
-  ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Struct)
-}
-Struct::Struct(const Struct& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  fields_.MergeFrom(from.fields_);
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct)
-}
-
-void Struct::SharedCtor() {
-  _cached_size_ = 0;
-}
-
-Struct::~Struct() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Struct)
-  SharedDtor();
-}
-
-void Struct::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void Struct::ArenaDtor(void* object) {
-  Struct* _this = reinterpret_cast< Struct* >(object);
-  (void)_this;
-}
-void Struct::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Struct::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* Struct::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::InitDefaultsListValue();
-  return *internal_default_instance();
-}
-
-Struct* Struct::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Struct>(arena);
-}
-
-void Struct::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Struct)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  fields_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool Struct::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.Struct)
-  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)) {
-      // map<string, .google.protobuf.Value> fields = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          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,
-              0 >,
-            ::google::protobuf::Map< ::std::string, ::google::protobuf::Value > > parser(&fields_);
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
-              input, &parser));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            parser.key().data(), static_cast<int>(parser.key().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Struct.FieldsEntry.key"));
-        } 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.Struct)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Struct)
-  return false;
-#undef DO_
-}
-
-void Struct::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Struct)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // map<string, .google.protobuf.Value> fields = 1;
-  if (!this->fields().empty()) {
-    typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_pointer
-        ConstPtr;
-    typedef ConstPtr SortItem;
-    typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
-    struct Utf8Check {
-      static void Check(ConstPtr p) {
-        ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-          p->first.data(), static_cast<int>(p->first.length()),
-          ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-          "google.protobuf.Struct.FieldsEntry.key");
-      }
-    };
-
-    if (output->IsSerializationDeterministic() &&
-        this->fields().size() > 1) {
-      ::google::protobuf::scoped_array<SortItem> items(
-          new SortItem[this->fields().size()]);
-      typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type;
-      size_type n = 0;
-      for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
-          it = this->fields().begin();
-          it != this->fields().end(); ++it, ++n) {
-        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
-      }
-      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
-      ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry;
-      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));
-        ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-            1, *entry, output);
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
-      }
-    } else {
-      ::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) {
-        entry.reset(fields_.NewEntryWrapper(
-            it->first, it->second));
-        ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-            1, *entry, output);
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(&*it);
-      }
-    }
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Struct)
-}
-
-::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // map<string, .google.protobuf.Value> fields = 1;
-  if (!this->fields().empty()) {
-    typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_pointer
-        ConstPtr;
-    typedef ConstPtr SortItem;
-    typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
-    struct Utf8Check {
-      static void Check(ConstPtr p) {
-        ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-          p->first.data(), static_cast<int>(p->first.length()),
-          ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-          "google.protobuf.Struct.FieldsEntry.key");
-      }
-    };
-
-    if (deterministic &&
-        this->fields().size() > 1) {
-      ::google::protobuf::scoped_array<SortItem> items(
-          new SortItem[this->fields().size()]);
-      typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type;
-      size_type n = 0;
-      for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
-          it = this->fields().begin();
-          it != this->fields().end(); ++it, ++n) {
-        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
-      }
-      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
-      ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry;
-      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));
-        target = ::google::protobuf::internal::WireFormatLite::
-                   InternalWriteMessageNoVirtualToArray(
-                       1, *entry, deterministic, target);
-;
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
-      }
-    } else {
-      ::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) {
-        entry.reset(fields_.NewEntryWrapper(
-            it->first, it->second));
-        target = ::google::protobuf::internal::WireFormatLite::
-                   InternalWriteMessageNoVirtualToArray(
-                       1, *entry, deterministic, target);
-;
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(&*it);
-      }
-    }
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Struct)
-  return target;
-}
-
-size_t Struct::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Struct)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // map<string, .google.protobuf.Value> fields = 1;
-  total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->fields_size());
-  {
-    ::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) {
-      if (entry.get() != NULL && entry->GetArena() != NULL) {
-        entry.release();
-      }
-      entry.reset(fields_.NewEntryWrapper(it->first, it->second));
-      total_size += ::google::protobuf::internal::WireFormatLite::
-          MessageSizeNoVirtual(*entry);
-    }
-    if (entry.get() != NULL && entry->GetArena() != NULL) {
-      entry.release();
-    }
-  }
-
-  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 Struct::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Struct)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Struct* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Struct>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Struct)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Struct)
-    MergeFrom(*source);
-  }
-}
-
-void Struct::MergeFrom(const Struct& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Struct)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  fields_.MergeFrom(from.fields_);
-}
-
-void Struct::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Struct)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Struct::CopyFrom(const Struct& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Struct)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Struct::IsInitialized() const {
-  return true;
-}
-
-void Struct::Swap(Struct* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Struct* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Struct::UnsafeArenaSwap(Struct* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Struct::InternalSwap(Struct* other) {
-  using std::swap;
-  fields_.Swap(&other->fields_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Struct::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-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());
-}
-void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  clear_kind();
-  if (struct_value) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(struct_value);
-    if (message_arena != submessage_arena) {
-      struct_value = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, struct_value, submessage_arena);
-    }
-    set_has_struct_value();
-    kind_.struct_value_ = struct_value;
-  }
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value)
-}
-void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  clear_kind();
-  if (list_value) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(list_value);
-    if (message_arena != submessage_arena) {
-      list_value = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, list_value, submessage_arena);
-    }
-    set_has_list_value();
-    kind_.list_value_ = list_value;
-  }
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Value::kNullValueFieldNumber;
-const int Value::kNumberValueFieldNumber;
-const int Value::kStringValueFieldNumber;
-const int Value::kBoolValueFieldNumber;
-const int Value::kStructValueFieldNumber;
-const int Value::kListValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Value::Value()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Value)
-}
-Value::Value(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Value)
-}
-Value::Value(const Value& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  clear_has_kind();
-  switch (from.kind_case()) {
-    case kNullValue: {
-      set_null_value(from.null_value());
-      break;
-    }
-    case kNumberValue: {
-      set_number_value(from.number_value());
-      break;
-    }
-    case kStringValue: {
-      set_string_value(from.string_value());
-      break;
-    }
-    case kBoolValue: {
-      set_bool_value(from.bool_value());
-      break;
-    }
-    case kStructValue: {
-      mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value());
-      break;
-    }
-    case kListValue: {
-      mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value());
-      break;
-    }
-    case KIND_NOT_SET: {
-      break;
-    }
-  }
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Value)
-}
-
-void Value::SharedCtor() {
-  clear_has_kind();
-  _cached_size_ = 0;
-}
-
-Value::~Value() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Value)
-  SharedDtor();
-}
-
-void Value::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  if (has_kind()) {
-    clear_kind();
-  }
-}
-
-void Value::ArenaDtor(void* object) {
-  Value* _this = reinterpret_cast< Value* >(object);
-  (void)_this;
-}
-void Value::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Value::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* Value::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::InitDefaultsListValue();
-  return *internal_default_instance();
-}
-
-Value* Value::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Value>(arena);
-}
-
-void Value::clear_kind() {
-// @@protoc_insertion_point(one_of_clear_start:google.protobuf.Value)
-  switch (kind_case()) {
-    case kNullValue: {
-      // No need to clear
-      break;
-    }
-    case kNumberValue: {
-      // No need to clear
-      break;
-    }
-    case kStringValue: {
-      kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-          GetArenaNoVirtual());
-      break;
-    }
-    case kBoolValue: {
-      // No need to clear
-      break;
-    }
-    case kStructValue: {
-      if (GetArenaNoVirtual() == NULL) {
-        delete kind_.struct_value_;
-      }
-      break;
-    }
-    case kListValue: {
-      if (GetArenaNoVirtual() == NULL) {
-        delete kind_.list_value_;
-      }
-      break;
-    }
-    case KIND_NOT_SET: {
-      break;
-    }
-  }
-  _oneof_case_[0] = KIND_NOT_SET;
-}
-
-
-void Value::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  clear_kind();
-  _internal_metadata_.Clear();
-}
-
-bool Value::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.Value)
-  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)) {
-      // .google.protobuf.NullValue null_value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_null_value(static_cast< ::google::protobuf::NullValue >(value));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // double number_value = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) {
-          clear_kind();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 input, &kind_.number_value_)));
-          set_has_number_value();
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string string_value = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_string_value()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->string_value().data(), static_cast<int>(this->string_value().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Value.string_value"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // bool bool_value = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          clear_kind();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &kind_.bool_value_)));
-          set_has_bool_value();
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.Struct struct_value = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_struct_value()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.ListValue list_value = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_list_value()));
-        } 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.Value)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Value)
-  return false;
-#undef DO_
-}
-
-void Value::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // .google.protobuf.NullValue null_value = 1;
-  if (has_null_value()) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->null_value(), output);
-  }
-
-  // double number_value = 2;
-  if (has_number_value()) {
-    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->number_value(), output);
-  }
-
-  // string string_value = 3;
-  if (has_string_value()) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->string_value().data(), static_cast<int>(this->string_value().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Value.string_value");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->string_value(), output);
-  }
-
-  // bool bool_value = 4;
-  if (has_bool_value()) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bool_value(), output);
-  }
-
-  // .google.protobuf.Struct struct_value = 5;
-  if (has_struct_value()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, *kind_.struct_value_, output);
-  }
-
-  // .google.protobuf.ListValue list_value = 6;
-  if (has_list_value()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, *kind_.list_value_, output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Value)
-}
-
-::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // .google.protobuf.NullValue null_value = 1;
-  if (has_null_value()) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->null_value(), target);
-  }
-
-  // double number_value = 2;
-  if (has_number_value()) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->number_value(), target);
-  }
-
-  // string string_value = 3;
-  if (has_string_value()) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->string_value().data(), static_cast<int>(this->string_value().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Value.string_value");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->string_value(), target);
-  }
-
-  // bool bool_value = 4;
-  if (has_bool_value()) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bool_value(), target);
-  }
-
-  // .google.protobuf.Struct struct_value = 5;
-  if (has_struct_value()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, *kind_.struct_value_, deterministic, target);
-  }
-
-  // .google.protobuf.ListValue list_value = 6;
-  if (has_list_value()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, *kind_.list_value_, deterministic, target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Value)
-  return target;
-}
-
-size_t Value::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Value)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  switch (kind_case()) {
-    // .google.protobuf.NullValue null_value = 1;
-    case kNullValue: {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->null_value());
-      break;
-    }
-    // double number_value = 2;
-    case kNumberValue: {
-      total_size += 1 + 8;
-      break;
-    }
-    // string string_value = 3;
-    case kStringValue: {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->string_value());
-      break;
-    }
-    // bool bool_value = 4;
-    case kBoolValue: {
-      total_size += 1 + 1;
-      break;
-    }
-    // .google.protobuf.Struct struct_value = 5;
-    case kStructValue: {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *kind_.struct_value_);
-      break;
-    }
-    // .google.protobuf.ListValue list_value = 6;
-    case kListValue: {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *kind_.list_value_);
-      break;
-    }
-    case KIND_NOT_SET: {
-      break;
-    }
-  }
-  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 Value::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Value* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Value>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Value)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Value)
-    MergeFrom(*source);
-  }
-}
-
-void Value::MergeFrom(const Value& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  switch (from.kind_case()) {
-    case kNullValue: {
-      set_null_value(from.null_value());
-      break;
-    }
-    case kNumberValue: {
-      set_number_value(from.number_value());
-      break;
-    }
-    case kStringValue: {
-      set_string_value(from.string_value());
-      break;
-    }
-    case kBoolValue: {
-      set_bool_value(from.bool_value());
-      break;
-    }
-    case kStructValue: {
-      mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value());
-      break;
-    }
-    case kListValue: {
-      mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value());
-      break;
-    }
-    case KIND_NOT_SET: {
-      break;
-    }
-  }
-}
-
-void Value::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Value::CopyFrom(const Value& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Value::IsInitialized() const {
-  return true;
-}
-
-void Value::Swap(Value* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Value* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Value::UnsafeArenaSwap(Value* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Value::InternalSwap(Value* other) {
-  using std::swap;
-  swap(kind_, other->kind_);
-  swap(_oneof_case_[0], other->_oneof_case_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Value::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void ListValue::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ListValue::kValuesFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ListValue::ListValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.ListValue)
-}
-ListValue::ListValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
-  values_(arena) {
-  ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.ListValue)
-}
-ListValue::ListValue(const ListValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      values_(from.values_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue)
-}
-
-void ListValue::SharedCtor() {
-  _cached_size_ = 0;
-}
-
-ListValue::~ListValue() {
-  // @@protoc_insertion_point(destructor:google.protobuf.ListValue)
-  SharedDtor();
-}
-
-void ListValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void ListValue::ArenaDtor(void* object) {
-  ListValue* _this = reinterpret_cast< ListValue* >(object);
-  (void)_this;
-}
-void ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void ListValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ListValue::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::InitDefaultsListValue();
-  return *internal_default_instance();
-}
-
-ListValue* ListValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<ListValue>(arena);
-}
-
-void ListValue::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.ListValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  values_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ListValue::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.ListValue)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated .google.protobuf.Value values = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_values()));
-        } 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.ListValue)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.ListValue)
-  return false;
-#undef DO_
-}
-
-void ListValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.ListValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .google.protobuf.Value values = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->values(static_cast<int>(i)), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.ListValue)
-}
-
-::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .google.protobuf.Value values = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->values(static_cast<int>(i)), deterministic, target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ListValue)
-  return target;
-}
-
-size_t ListValue::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.ListValue)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // repeated .google.protobuf.Value values = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->values_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->values(static_cast<int>(i)));
-    }
-  }
-
-  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = cached_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void ListValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ListValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ListValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ListValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ListValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ListValue)
-    MergeFrom(*source);
-  }
-}
-
-void ListValue::MergeFrom(const ListValue& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ListValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  values_.MergeFrom(from.values_);
-}
-
-void ListValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ListValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void ListValue::CopyFrom(const ListValue& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.ListValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool ListValue::IsInitialized() const {
-  return true;
-}
-
-void ListValue::Swap(ListValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    ListValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void ListValue::UnsafeArenaSwap(ListValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void ListValue::InternalSwap(ListValue* other) {
-  using std::swap;
-  values_.InternalSwap(&other->values_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata ListValue::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/struct.pb.h b/3rdparty/protobuf/src/google/protobuf/struct.pb.h
deleted file mode 100644 (file)
index cdc00dc..0000000
+++ /dev/null
@@ -1,1030 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/struct.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2fstruct_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fstruct_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/map.h>  // IWYU pragma: export
-#include <google/protobuf/map_entry.h>
-#include <google/protobuf/map_field_inl.h>
-#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;
-class ListValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern ListValueDefaultTypeInternal _ListValue_default_instance_;
-class Struct;
-class StructDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern StructDefaultTypeInternal _Struct_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 {
-
-enum NullValue {
-  NULL_VALUE = 0,
-  NullValue_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
-  NullValue_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
-};
-LIBPROTOBUF_EXPORT bool NullValue_IsValid(int value);
-const NullValue NullValue_MIN = NULL_VALUE;
-const NullValue NullValue_MAX = NULL_VALUE;
-const int NullValue_ARRAYSIZE = NullValue_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* NullValue_descriptor();
-inline const ::std::string& NullValue_Name(NullValue value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    NullValue_descriptor(), value);
-}
-inline bool NullValue_Parse(
-    const ::std::string& name, NullValue* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<NullValue>(
-    NullValue_descriptor(), name, value);
-}
-// ===================================================================
-
-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;
-};
-
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Struct : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Struct) */ {
- public:
-  Struct();
-  virtual ~Struct();
-
-  Struct(const Struct& from);
-
-  inline Struct& operator=(const Struct& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Struct(Struct&& from) noexcept
-    : Struct() {
-    *this = ::std::move(from);
-  }
-
-  inline Struct& operator=(Struct&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
-
-  void UnsafeArenaSwap(Struct* other);
-  void Swap(Struct* other);
-  friend void swap(Struct& a, Struct& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Struct* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Struct* 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 Struct& from);
-  void MergeFrom(const Struct& 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(Struct* other);
-  protected:
-  explicit Struct(::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 -------------------------------------------------------
-
-  // map<string, .google.protobuf.Value> fields = 1;
-  int fields_size() const;
-  void clear_fields();
-  static const int kFieldsFieldNumber = 1;
-  const ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >&
-      fields() const;
-  ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >*
-      mutable_fields();
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Struct)
- 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::MapField<
-      Struct_FieldsEntry_DoNotUse,
-      ::std::string, ::google::protobuf::Value,
-      ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-      ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-      0 > fields_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Value) */ {
- public:
-  Value();
-  virtual ~Value();
-
-  Value(const Value& from);
-
-  inline Value& operator=(const Value& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Value(Value&& from) noexcept
-    : Value() {
-    *this = ::std::move(from);
-  }
-
-  inline Value& operator=(Value&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 Value& default_instance();
-
-  enum KindCase {
-    kNullValue = 1,
-    kNumberValue = 2,
-    kStringValue = 3,
-    kBoolValue = 4,
-    kStructValue = 5,
-    kListValue = 6,
-    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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    2;
-
-  void UnsafeArenaSwap(Value* other);
-  void Swap(Value* other);
-  friend void swap(Value& a, Value& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Value* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Value* 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 Value& from);
-  void MergeFrom(const Value& 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(Value* other);
-  protected:
-  explicit Value(::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 -------------------------------------------------------
-
-  // .google.protobuf.NullValue null_value = 1;
-  private:
-  bool has_null_value() const;
-  public:
-  void clear_null_value();
-  static const int kNullValueFieldNumber = 1;
-  ::google::protobuf::NullValue null_value() const;
-  void set_null_value(::google::protobuf::NullValue value);
-
-  // double number_value = 2;
-  private:
-  bool has_number_value() const;
-  public:
-  void clear_number_value();
-  static const int kNumberValueFieldNumber = 2;
-  double number_value() const;
-  void set_number_value(double value);
-
-  // string string_value = 3;
-  private:
-  bool has_string_value() const;
-  public:
-  void clear_string_value();
-  static const int kStringValueFieldNumber = 3;
-  const ::std::string& string_value() const;
-  void set_string_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_string_value(::std::string&& value);
-  #endif
-  void set_string_value(const char* value);
-  void set_string_value(const char* value, size_t size);
-  ::std::string* mutable_string_value();
-  ::std::string* release_string_value();
-  void set_allocated_string_value(::std::string* string_value);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_string_value();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_string_value(
-      ::std::string* string_value);
-
-  // bool bool_value = 4;
-  private:
-  bool has_bool_value() const;
-  public:
-  void clear_bool_value();
-  static const int kBoolValueFieldNumber = 4;
-  bool bool_value() const;
-  void set_bool_value(bool value);
-
-  // .google.protobuf.Struct struct_value = 5;
-  bool has_struct_value() const;
-  void clear_struct_value();
-  static const int kStructValueFieldNumber = 5;
-  private:
-  void _slow_mutable_struct_value();
-  public:
-  const ::google::protobuf::Struct& struct_value() const;
-  ::google::protobuf::Struct* release_struct_value();
-  ::google::protobuf::Struct* mutable_struct_value();
-  void set_allocated_struct_value(::google::protobuf::Struct* struct_value);
-  void unsafe_arena_set_allocated_struct_value(
-      ::google::protobuf::Struct* struct_value);
-  ::google::protobuf::Struct* unsafe_arena_release_struct_value();
-
-  // .google.protobuf.ListValue list_value = 6;
-  bool has_list_value() const;
-  void clear_list_value();
-  static const int kListValueFieldNumber = 6;
-  private:
-  void _slow_mutable_list_value();
-  public:
-  const ::google::protobuf::ListValue& list_value() const;
-  ::google::protobuf::ListValue* release_list_value();
-  ::google::protobuf::ListValue* mutable_list_value();
-  void set_allocated_list_value(::google::protobuf::ListValue* list_value);
-  void unsafe_arena_set_allocated_list_value(
-      ::google::protobuf::ListValue* list_value);
-  ::google::protobuf::ListValue* unsafe_arena_release_list_value();
-
-  KindCase kind_case() const;
-  // @@protoc_insertion_point(class_scope:google.protobuf.Value)
- private:
-  void set_has_null_value();
-  void set_has_number_value();
-  void set_has_string_value();
-  void set_has_bool_value();
-  void set_has_struct_value();
-  void set_has_list_value();
-
-  inline bool has_kind() const;
-  void clear_kind();
-  inline void clear_has_kind();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  union KindUnion {
-    KindUnion() {}
-    int null_value_;
-    double number_value_;
-    ::google::protobuf::internal::ArenaStringPtr string_value_;
-    bool bool_value_;
-    ::google::protobuf::Struct* struct_value_;
-    ::google::protobuf::ListValue* list_value_;
-  } kind_;
-  mutable int _cached_size_;
-  ::google::protobuf::uint32 _oneof_case_[1];
-
-  friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT ListValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ListValue) */ {
- public:
-  ListValue();
-  virtual ~ListValue();
-
-  ListValue(const ListValue& from);
-
-  inline ListValue& operator=(const ListValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  ListValue(ListValue&& from) noexcept
-    : ListValue() {
-    *this = ::std::move(from);
-  }
-
-  inline ListValue& operator=(ListValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    3;
-
-  void UnsafeArenaSwap(ListValue* other);
-  void Swap(ListValue* other);
-  friend void swap(ListValue& a, ListValue& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline ListValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ListValue* 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 ListValue& from);
-  void MergeFrom(const ListValue& 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(ListValue* other);
-  protected:
-  explicit ListValue(::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 -------------------------------------------------------
-
-  // repeated .google.protobuf.Value values = 1;
-  int values_size() const;
-  void clear_values();
-  static const int kValuesFieldNumber = 1;
-  const ::google::protobuf::Value& values(int index) const;
-  ::google::protobuf::Value* mutable_values(int index);
-  ::google::protobuf::Value* add_values();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >*
-      mutable_values();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >&
-      values() const;
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.ListValue)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value > values_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValueImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// -------------------------------------------------------------------
-
-// Struct
-
-// map<string, .google.protobuf.Value> fields = 1;
-inline int Struct::fields_size() const {
-  return fields_.size();
-}
-inline void Struct::clear_fields() {
-  fields_.Clear();
-}
-inline const ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >&
-Struct::fields() const {
-  // @@protoc_insertion_point(field_map:google.protobuf.Struct.fields)
-  return fields_.GetMap();
-}
-inline ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >*
-Struct::mutable_fields() {
-  // @@protoc_insertion_point(field_mutable_map:google.protobuf.Struct.fields)
-  return fields_.MutableMap();
-}
-
-// -------------------------------------------------------------------
-
-// Value
-
-// .google.protobuf.NullValue null_value = 1;
-inline bool Value::has_null_value() const {
-  return kind_case() == kNullValue;
-}
-inline void Value::set_has_null_value() {
-  _oneof_case_[0] = kNullValue;
-}
-inline void Value::clear_null_value() {
-  if (has_null_value()) {
-    kind_.null_value_ = 0;
-    clear_has_kind();
-  }
-}
-inline ::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);
-}
-inline 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;
-inline bool Value::has_number_value() const {
-  return kind_case() == kNumberValue;
-}
-inline void Value::set_has_number_value() {
-  _oneof_case_[0] = kNumberValue;
-}
-inline void Value::clear_number_value() {
-  if (has_number_value()) {
-    kind_.number_value_ = 0;
-    clear_has_kind();
-  }
-}
-inline 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;
-}
-inline 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;
-inline bool Value::has_string_value() const {
-  return kind_case() == kStringValue;
-}
-inline void Value::set_has_string_value() {
-  _oneof_case_[0] = kStringValue;
-}
-inline void Value::clear_string_value() {
-  if (has_string_value()) {
-    kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-        GetArenaNoVirtual());
-    clear_has_kind();
-  }
-}
-inline 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();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::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)
-}
-inline ::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;
-  }
-}
-inline 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)
-}
-inline ::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;
-  }
-}
-inline 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;
-inline bool Value::has_bool_value() const {
-  return kind_case() == kBoolValue;
-}
-inline void Value::set_has_bool_value() {
-  _oneof_case_[0] = kBoolValue;
-}
-inline void Value::clear_bool_value() {
-  if (has_bool_value()) {
-    kind_.bool_value_ = false;
-    clear_has_kind();
-  }
-}
-inline 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;
-}
-inline 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;
-inline bool Value::has_struct_value() const {
-  return kind_case() == kStructValue;
-}
-inline void Value::set_has_struct_value() {
-  _oneof_case_[0] = kStructValue;
-}
-inline void Value::clear_struct_value() {
-  if (has_struct_value()) {
-    if (GetArenaNoVirtual() == NULL) {
-      delete kind_.struct_value_;
-    }
-    clear_has_kind();
-  }
-}
-inline ::google::protobuf::Struct* Value::release_struct_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Value.struct_value)
-  if (has_struct_value()) {
-    clear_has_kind();
-      ::google::protobuf::Struct* temp = kind_.struct_value_;
-    if (GetArenaNoVirtual() != NULL) {
-      temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
-    }
-    kind_.struct_value_ = NULL;
-    return temp;
-  } else {
-    return NULL;
-  }
-}
-inline 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_
-      : *reinterpret_cast< ::google::protobuf::Struct*>(&::google::protobuf::_Struct_default_instance_);
-}
-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();
-    ::google::protobuf::Struct* temp = kind_.struct_value_;
-    kind_.struct_value_ = NULL;
-    return temp;
-  } else {
-    return NULL;
-  }
-}
-inline 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)
-}
-inline ::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.ListValue list_value = 6;
-inline bool Value::has_list_value() const {
-  return kind_case() == kListValue;
-}
-inline void Value::set_has_list_value() {
-  _oneof_case_[0] = kListValue;
-}
-inline void Value::clear_list_value() {
-  if (has_list_value()) {
-    if (GetArenaNoVirtual() == NULL) {
-      delete kind_.list_value_;
-    }
-    clear_has_kind();
-  }
-}
-inline ::google::protobuf::ListValue* Value::release_list_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Value.list_value)
-  if (has_list_value()) {
-    clear_has_kind();
-      ::google::protobuf::ListValue* temp = kind_.list_value_;
-    if (GetArenaNoVirtual() != NULL) {
-      temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
-    }
-    kind_.list_value_ = NULL;
-    return temp;
-  } else {
-    return NULL;
-  }
-}
-inline 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_
-      : *reinterpret_cast< ::google::protobuf::ListValue*>(&::google::protobuf::_ListValue_default_instance_);
-}
-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();
-    ::google::protobuf::ListValue* temp = kind_.list_value_;
-    kind_.list_value_ = NULL;
-    return temp;
-  } else {
-    return NULL;
-  }
-}
-inline 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)
-}
-inline ::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_;
-}
-
-inline bool Value::has_kind() const {
-  return kind_case() != KIND_NOT_SET;
-}
-inline void Value::clear_has_kind() {
-  _oneof_case_[0] = KIND_NOT_SET;
-}
-inline Value::KindCase Value::kind_case() const {
-  return Value::KindCase(_oneof_case_[0]);
-}
-// -------------------------------------------------------------------
-
-// ListValue
-
-// repeated .google.protobuf.Value values = 1;
-inline int ListValue::values_size() const {
-  return values_.size();
-}
-inline void ListValue::clear_values() {
-  values_.Clear();
-}
-inline const ::google::protobuf::Value& ListValue::values(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.ListValue.values)
-  return values_.Get(index);
-}
-inline ::google::protobuf::Value* ListValue::mutable_values(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.ListValue.values)
-  return values_.Mutable(index);
-}
-inline ::google::protobuf::Value* ListValue::add_values() {
-  // @@protoc_insertion_point(field_add:google.protobuf.ListValue.values)
-  return values_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >*
-ListValue::mutable_values() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.ListValue.values)
-  return &values_;
-}
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >&
-ListValue::values() const {
-  // @@protoc_insertion_point(field_list:google.protobuf.ListValue.values)
-  return values_;
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-namespace google {
-namespace protobuf {
-
-template <> struct is_proto_enum< ::google::protobuf::NullValue> : ::google::protobuf::internal::true_type {};
-template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::NullValue>() {
-  return ::google::protobuf::NullValue_descriptor();
-}
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2fstruct_2eproto__INCLUDED
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomic_sequence_num.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomic_sequence_num.h
deleted file mode 100644 (file)
index bb20942..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2014 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_ATOMIC_SEQUENCE_NUM_H_
-#define GOOGLE_PROTOBUF_ATOMIC_SEQUENCE_NUM_H_
-
-#include <google/protobuf/stubs/atomicops.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-class SequenceNumber {
- public:
-  SequenceNumber() : word_(0) {}
-
-  AtomicWord GetNext() {
-    return NoBarrier_AtomicIncrement(&word_, 1) - 1;
-  }
- private:
-  AtomicWord word_;
-};
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMIC_SEQUENCE_NUM_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops.h
deleted file mode 100644 (file)
index cb4553b..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// The routines exported by this module are subtle.  If you use them, even if
-// you get the code right, it will depend on careful reasoning about atomicity
-// and memory ordering; it will be less readable, and harder to maintain.  If
-// you plan to use these routines, you should have a good reason, such as solid
-// evidence that performance would otherwise suffer, or there being no
-// alternative.  You should assume only properties explicitly guaranteed by the
-// specifications in this file.  You are almost certainly _not_ writing code
-// just for the x86; if you assume x86 semantics, x86 hardware bugs and
-// implementations on other archtectures will cause your code to break.  If you
-// do not know what you are doing, avoid these routines, and use a Mutex.
-//
-// It is incorrect to make direct assignments to/from an atomic variable.
-// You should use one of the Load or Store routines.  The NoBarrier
-// versions are provided when no barriers are needed:
-//   NoBarrier_Store()
-//   NoBarrier_Load()
-// Although there are currently no compiler enforcement, you are encouraged
-// to use these.
-
-// This header and the implementations for each platform (located in
-// atomicops_internals_*) must be kept in sync with the upstream code (V8).
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_H_
-
-// Don't include this file for people not concerned about thread safety.
-#ifndef GOOGLE_PROTOBUF_NO_THREAD_SAFETY
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/platform_macros.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-#ifdef GOOGLE_PROTOBUF_ARCH_32_BIT
-  typedef intptr_t Atomic32;
-  typedef int64 Atomic64;
-#else
-  // We need to be able to go between Atomic64 and AtomicWord implicitly.  This
-  // means Atomic64 and AtomicWord should be the same type on 64-bit.
-  #if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL)
-  // NaCl's intptr_t is not actually 64-bits on 64-bit!
-  // http://code.google.com/p/nativeclient/issues/detail?id=1162
-  // sparcv9's pointer type is 32bits
-  typedef intptr_t Atomic32;
-  typedef int64 Atomic64;
-  #else
-  typedef int32 Atomic32;
-  typedef intptr_t Atomic64;
-  #endif
-#endif
-
-// Use AtomicWord for a machine-sized pointer.  It will use the Atomic32 or
-// Atomic64 routines below, depending on your architecture.
-typedef intptr_t AtomicWord;
-
-// Atomically execute:
-//      result = *ptr;
-//      if (*ptr == old_value)
-//        *ptr = new_value;
-//      return result;
-//
-// I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value".
-// Always return the old value of "*ptr"
-//
-// This routine implies no memory barriers.
-Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                  Atomic32 old_value,
-                                  Atomic32 new_value);
-
-// Atomically store new_value into *ptr, returning the previous value held in
-// *ptr.  This routine implies no memory barriers.
-Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);
-
-// Atomically increment *ptr by "increment".  Returns the new value of
-// *ptr with the increment applied.  This routine implies no memory barriers.
-Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
-
-Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                 Atomic32 increment);
-
-// These following lower-level operations are typically useful only to people
-// implementing higher-level synchronization operations like spinlocks,
-// mutexes, and condition-variables.  They combine CompareAndSwap(), a load, or
-// a store with appropriate memory-ordering instructions.  "Acquire" operations
-// ensure that no later memory access can be reordered ahead of the operation.
-// "Release" operations ensure that no previous memory access can be reordered
-// after the operation.  "Barrier" operations have both "Acquire" and "Release"
-// semantics.   A MemoryBarrierInternal() has "Barrier" semantics, but does no
-// memory access.
-Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                Atomic32 old_value,
-                                Atomic32 new_value);
-Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                Atomic32 old_value,
-                                Atomic32 new_value);
-
-// This function was renamed from MemoryBarrier to MemoryBarrierInternal
-// because MemoryBarrier is a define in Windows ARM builds and we do not
-// undefine it because we call it from this function.
-void MemoryBarrierInternal();
-void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value);
-void Acquire_Store(volatile Atomic32* ptr, Atomic32 value);
-void Release_Store(volatile Atomic32* ptr, Atomic32 value);
-
-Atomic32 NoBarrier_Load(volatile const Atomic32* ptr);
-Atomic32 Acquire_Load(volatile const Atomic32* ptr);
-Atomic32 Release_Load(volatile const Atomic32* ptr);
-
-// 64-bit atomic operations (only available on 64-bit processors).
-#ifdef GOOGLE_PROTOBUF_ARCH_64_BIT
-Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                  Atomic64 old_value,
-                                  Atomic64 new_value);
-Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value);
-Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);
-Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);
-
-Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                Atomic64 old_value,
-                                Atomic64 new_value);
-Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                Atomic64 old_value,
-                                Atomic64 new_value);
-void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value);
-void Acquire_Store(volatile Atomic64* ptr, Atomic64 value);
-void Release_Store(volatile Atomic64* ptr, Atomic64 value);
-Atomic64 NoBarrier_Load(volatile const Atomic64* ptr);
-Atomic64 Acquire_Load(volatile const Atomic64* ptr);
-Atomic64 Release_Load(volatile const Atomic64* ptr);
-#endif  // GOOGLE_PROTOBUF_ARCH_64_BIT
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-// Include our platform specific implementation.
-#define GOOGLE_PROTOBUF_ATOMICOPS_ERROR \
-"Atomic operations are not supported on your platform"
-
-// ThreadSanitizer, http://clang.llvm.org/docs/ThreadSanitizer.html.
-#if defined(THREAD_SANITIZER)
-#include <google/protobuf/stubs/atomicops_internals_tsan.h>
-// MSVC.
-#elif defined(_MSC_VER)
-#if defined(GOOGLE_PROTOBUF_ARCH_IA32) || defined(GOOGLE_PROTOBUF_ARCH_X64) || defined(GOOGLE_PROTOBUF_ARCH_ARM)
-#include <google/protobuf/stubs/atomicops_internals_x86_msvc.h>
-#else
-#error GOOGLE_PROTOBUF_ATOMICOPS_ERROR
-#endif
-
-// Solaris
-#elif defined(GOOGLE_PROTOBUF_OS_SOLARIS)
-#include <google/protobuf/stubs/atomicops_internals_solaris.h>
-
-// AIX
-#elif defined(GOOGLE_PROTOBUF_OS_AIX)
-#include <google/protobuf/stubs/atomicops_internals_power.h>
-
-// GCC.
-#elif defined(__GNUC__)
-#if defined(GOOGLE_PROTOBUF_ARCH_IA32) || defined(GOOGLE_PROTOBUF_ARCH_X64)
-#include <google/protobuf/stubs/atomicops_internals_x86_gcc.h>
-#elif defined(GOOGLE_PROTOBUF_ARCH_ARM) && defined(__linux__)
-#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4))
-#include <google/protobuf/stubs/atomicops_internals_generic_gcc.h>
-#else
-#include <google/protobuf/stubs/atomicops_internals_arm_gcc.h>
-#endif
-#elif defined(GOOGLE_PROTOBUF_ARCH_AARCH64)
-#include <google/protobuf/stubs/atomicops_internals_arm64_gcc.h>
-#elif defined(GOOGLE_PROTOBUF_ARCH_ARM_QNX)
-#include <google/protobuf/stubs/atomicops_internals_arm_qnx.h>
-#elif defined(GOOGLE_PROTOBUF_ARCH_MIPS) || defined(GOOGLE_PROTOBUF_ARCH_MIPS64)
-#include <google/protobuf/stubs/atomicops_internals_mips_gcc.h>
-#elif defined(GOOGLE_PROTOBUF_ARCH_POWER)
-#include <google/protobuf/stubs/atomicops_internals_power.h>
-#elif defined(__native_client__)
-// The static_asserts in the C++11 atomics implementation cause it to fail
-// with certain compilers, e.g. nvcc on macOS. Don't use elsewhere unless
-// the TODO in that file is addressed.
-#include <google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h>
-#elif defined(GOOGLE_PROTOBUF_ARCH_PPC)
-#include <google/protobuf/stubs/atomicops_internals_ppc_gcc.h>
-#elif (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4))
-#include <google/protobuf/stubs/atomicops_internals_generic_gcc.h>
-#elif defined(__clang__)
-#if __has_extension(c_atomic)
-#include <google/protobuf/stubs/atomicops_internals_generic_gcc.h>
-#else
-#error GOOGLE_PROTOBUF_ATOMICOPS_ERROR
-#endif
-#else
-#error GOOGLE_PROTOBUF_ATOMICOPS_ERROR
-#endif
-
-// Unknown.
-#else
-#error GOOGLE_PROTOBUF_ATOMICOPS_ERROR
-#endif
-
-#undef GOOGLE_PROTOBUF_ATOMICOPS_ERROR
-
-#endif  // GOOGLE_PROTOBUF_NO_THREAD_SAFETY
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h
deleted file mode 100644 (file)
index 9a69d21..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM64_GCC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM64_GCC_H_
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline void MemoryBarrierInternal() {
-  __asm__ __volatile__ ("dmb ish" ::: "memory");  // NOLINT
-}
-
-// NoBarrier versions of the operation include "memory" in the clobber list.
-// This is not required for direct usage of the NoBarrier versions of the
-// operations. However this is required for correctness when they are used as
-// part of the Acquire or Release versions, to ensure that nothing from outside
-// the call is reordered between the operation and the memory barrier. This does
-// not change the code generated, so has no or minimal impact on the
-// NoBarrier operations.
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  Atomic32 prev;
-  int32_t temp;
-
-  __asm__ __volatile__ (  // NOLINT
-    "0:                                    \n\t"
-    "ldxr %w[prev], %[ptr]                 \n\t"  // Load the previous value.
-    "cmp %w[prev], %w[old_value]           \n\t"
-    "bne 1f                                \n\t"
-    "stxr %w[temp], %w[new_value], %[ptr]  \n\t"  // Try to store the new value.
-    "cbnz %w[temp], 0b                     \n\t"  // Retry if it did not work.
-    "1:                                    \n\t"
-    : [prev]"=&r" (prev),
-      [temp]"=&r" (temp),
-      [ptr]"+Q" (*ptr)
-    : [old_value]"IJr" (old_value),
-      [new_value]"r" (new_value)
-    : "cc", "memory"
-  );  // NOLINT
-
-  return prev;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  Atomic32 result;
-  int32_t temp;
-
-  __asm__ __volatile__ (  // NOLINT
-    "0:                                    \n\t"
-    "ldxr %w[result], %[ptr]               \n\t"  // Load the previous value.
-    "stxr %w[temp], %w[new_value], %[ptr]  \n\t"  // Try to store the new value.
-    "cbnz %w[temp], 0b                     \n\t"  // Retry if it did not work.
-    : [result]"=&r" (result),
-      [temp]"=&r" (temp),
-      [ptr]"+Q" (*ptr)
-    : [new_value]"r" (new_value)
-    : "memory"
-  );  // NOLINT
-
-  return result;
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  Atomic32 result;
-  int32_t temp;
-
-  __asm__ __volatile__ (  // NOLINT
-    "0:                                       \n\t"
-    "ldxr %w[result], %[ptr]                  \n\t"  // Load the previous value.
-    "add %w[result], %w[result], %w[increment]\n\t"
-    "stxr %w[temp], %w[result], %[ptr]        \n\t"  // Try to store the result.
-    "cbnz %w[temp], 0b                        \n\t"  // Retry on failure.
-    : [result]"=&r" (result),
-      [temp]"=&r" (temp),
-      [ptr]"+Q" (*ptr)
-    : [increment]"IJr" (increment)
-    : "memory"
-  );  // NOLINT
-
-  return result;
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  MemoryBarrierInternal();
-  Atomic32 result = NoBarrier_AtomicIncrement(ptr, increment);
-  MemoryBarrierInternal();
-
-  return result;
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  Atomic32 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  MemoryBarrierInternal();
-
-  return prev;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  MemoryBarrierInternal();
-  Atomic32 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-
-  return prev;
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  __asm__ __volatile__ (  // NOLINT
-    "stlr %w[value], %[ptr]  \n\t"
-    : [ptr]"=Q" (*ptr)
-    : [value]"r" (value)
-    : "memory"
-  );  // NOLINT
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return *ptr;
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  Atomic32 value;
-
-  __asm__ __volatile__ (  // NOLINT
-    "ldar %w[value], %[ptr]  \n\t"
-    : [value]"=r" (value)
-    : [ptr]"Q" (*ptr)
-    : "memory"
-  );  // NOLINT
-
-  return value;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-// 64-bit versions of the operations.
-// See the 32-bit versions for comments.
-
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                         Atomic64 old_value,
-                                         Atomic64 new_value) {
-  Atomic64 prev;
-  int32_t temp;
-
-  __asm__ __volatile__ (  // NOLINT
-    "0:                                    \n\t"
-    "ldxr %[prev], %[ptr]                  \n\t"
-    "cmp %[prev], %[old_value]             \n\t"
-    "bne 1f                                \n\t"
-    "stxr %w[temp], %[new_value], %[ptr]   \n\t"
-    "cbnz %w[temp], 0b                     \n\t"
-    "1:                                    \n\t"
-    : [prev]"=&r" (prev),
-      [temp]"=&r" (temp),
-      [ptr]"+Q" (*ptr)
-    : [old_value]"IJr" (old_value),
-      [new_value]"r" (new_value)
-    : "cc", "memory"
-  );  // NOLINT
-
-  return prev;
-}
-
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
-                                         Atomic64 new_value) {
-  Atomic64 result;
-  int32_t temp;
-
-  __asm__ __volatile__ (  // NOLINT
-    "0:                                    \n\t"
-    "ldxr %[result], %[ptr]                \n\t"
-    "stxr %w[temp], %[new_value], %[ptr]   \n\t"
-    "cbnz %w[temp], 0b                     \n\t"
-    : [result]"=&r" (result),
-      [temp]"=&r" (temp),
-      [ptr]"+Q" (*ptr)
-    : [new_value]"r" (new_value)
-    : "memory"
-  );  // NOLINT
-
-  return result;
-}
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
-                                          Atomic64 increment) {
-  Atomic64 result;
-  int32_t temp;
-
-  __asm__ __volatile__ (  // NOLINT
-    "0:                                     \n\t"
-    "ldxr %[result], %[ptr]                 \n\t"
-    "add %[result], %[result], %[increment] \n\t"
-    "stxr %w[temp], %[result], %[ptr]       \n\t"
-    "cbnz %w[temp], 0b                      \n\t"
-    : [result]"=&r" (result),
-      [temp]"=&r" (temp),
-      [ptr]"+Q" (*ptr)
-    : [increment]"IJr" (increment)
-    : "memory"
-  );  // NOLINT
-
-  return result;
-}
-
-inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
-                                        Atomic64 increment) {
-  MemoryBarrierInternal();
-  Atomic64 result = NoBarrier_AtomicIncrement(ptr, increment);
-  MemoryBarrierInternal();
-
-  return result;
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  Atomic64 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  MemoryBarrierInternal();
-
-  return prev;
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  MemoryBarrierInternal();
-  Atomic64 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-
-  return prev;
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
-  __asm__ __volatile__ (  // NOLINT
-    "stlr %x[value], %[ptr]  \n\t"
-    : [ptr]"=Q" (*ptr)
-    : [value]"r" (value)
-    : "memory"
-  );  // NOLINT
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
-  return *ptr;
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
-  Atomic64 value;
-
-  __asm__ __volatile__ (  // NOLINT
-    "ldar %x[value], %[ptr]  \n\t"
-    : [value]"=r" (value)
-    : [ptr]"Q" (*ptr)
-    : "memory"
-  );  // NOLINT
-
-  return value;
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM64_GCC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_gcc.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_gcc.h
deleted file mode 100644 (file)
index 6e2de67..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-//
-// LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google Gears.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_GCC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_GCC_H_
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// 0xffff0fc0 is the hard coded address of a function provided by
-// the kernel which implements an atomic compare-exchange. On older
-// ARM architecture revisions (pre-v6) this may be implemented using
-// a syscall. This address is stable, and in active use (hard coded)
-// by at least glibc-2.7 and the Android C library.
-typedef Atomic32 (*LinuxKernelCmpxchgFunc)(Atomic32 old_value,
-                                           Atomic32 new_value,
-                                           volatile Atomic32* ptr);
-LinuxKernelCmpxchgFunc pLinuxKernelCmpxchg __attribute__((weak)) =
-    (LinuxKernelCmpxchgFunc) 0xffff0fc0;
-
-typedef void (*LinuxKernelMemoryBarrierFunc)(void);
-LinuxKernelMemoryBarrierFunc pLinuxKernelMemoryBarrier __attribute__((weak)) =
-    (LinuxKernelMemoryBarrierFunc) 0xffff0fa0;
-
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  Atomic32 prev_value = *ptr;
-  do {
-    if (!pLinuxKernelCmpxchg(old_value, new_value,
-                             const_cast<Atomic32*>(ptr))) {
-      return old_value;
-    }
-    prev_value = *ptr;
-  } while (prev_value == old_value);
-  return prev_value;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  Atomic32 old_value;
-  do {
-    old_value = *ptr;
-  } while (pLinuxKernelCmpxchg(old_value, new_value,
-                               const_cast<Atomic32*>(ptr)));
-  return old_value;
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  return Barrier_AtomicIncrement(ptr, increment);
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  for (;;) {
-    // Atomic exchange the old value with an incremented one.
-    Atomic32 old_value = *ptr;
-    Atomic32 new_value = old_value + increment;
-    if (pLinuxKernelCmpxchg(old_value, new_value,
-                            const_cast<Atomic32*>(ptr)) == 0) {
-      // The exchange took place as expected.
-      return new_value;
-    }
-    // Otherwise, *ptr changed mid-loop and we need to retry.
-  }
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-inline void MemoryBarrierInternal() {
-  pLinuxKernelMemoryBarrier();
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  MemoryBarrierInternal();
-  *ptr = value;
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return *ptr;
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  Atomic32 value = *ptr;
-  MemoryBarrierInternal();
-  return value;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_GCC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_qnx.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_arm_qnx.h
deleted file mode 100644 (file)
index cd97e0c..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_
-
-// For _smp_cmpxchg()
-#include <pthread.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline Atomic32 QNXCmpxchg(Atomic32 old_value,
-                           Atomic32 new_value,
-                           volatile Atomic32* ptr) {
-  return static_cast<Atomic32>(
-      _smp_cmpxchg((volatile unsigned *)ptr,
-                   (unsigned)old_value,
-                   (unsigned)new_value));
-}
-
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  Atomic32 prev_value = *ptr;
-  do {
-    if (!QNXCmpxchg(old_value, new_value,
-                    const_cast<Atomic32*>(ptr))) {
-      return old_value;
-    }
-    prev_value = *ptr;
-  } while (prev_value == old_value);
-  return prev_value;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  Atomic32 old_value;
-  do {
-    old_value = *ptr;
-  } while (QNXCmpxchg(old_value, new_value,
-                      const_cast<Atomic32*>(ptr)));
-  return old_value;
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  return Barrier_AtomicIncrement(ptr, increment);
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  for (;;) {
-    // Atomic exchange the old value with an incremented one.
-    Atomic32 old_value = *ptr;
-    Atomic32 new_value = old_value + increment;
-    if (QNXCmpxchg(old_value, new_value,
-                   const_cast<Atomic32*>(ptr)) == 0) {
-      // The exchange took place as expected.
-      return new_value;
-    }
-    // Otherwise, *ptr changed mid-loop and we need to retry.
-  }
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-inline void MemoryBarrierInternal() {
-  __sync_synchronize();
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  MemoryBarrierInternal();
-  *ptr = value;
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return *ptr;
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  Atomic32 value = *ptr;
-  MemoryBarrierInternal();
-  return value;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h
deleted file mode 100644 (file)
index 44ef9c9..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_C11_ATOMIC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_C11_ATOMIC_H_
-
-#include <atomic>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// This implementation is transitional and maintains the original API for
-// atomicops.h. This requires casting memory locations to the atomic types, and
-// assumes that the API and the C++11 implementation are layout-compatible,
-// which isn't true for all implementations or hardware platforms. The static
-// assertion should detect this issue, were it to fire then this header
-// shouldn't be used.
-//
-// TODO(jfb) If this header manages to stay committed then the API should be
-//           modified, and all call sites updated.
-typedef volatile std::atomic<Atomic32>* AtomicLocation32;
-static_assert(sizeof(*(AtomicLocation32) nullptr) == sizeof(Atomic32),
-              "incompatible 32-bit atomic layout");
-
-inline void MemoryBarrierInternal() {
-#if defined(__GLIBCXX__)
-  // Work around libstdc++ bug 51038 where atomic_thread_fence was declared but
-  // not defined, leading to the linker complaining about undefined references.
-  __atomic_thread_fence(std::memory_order_seq_cst);
-#else
-  std::atomic_thread_fence(std::memory_order_seq_cst);
-#endif
-}
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  ((AtomicLocation32)ptr)
-      ->compare_exchange_strong(old_value,
-                                new_value,
-                                std::memory_order_relaxed,
-                                std::memory_order_relaxed);
-  return old_value;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  return ((AtomicLocation32)ptr)
-      ->exchange(new_value, std::memory_order_relaxed);
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  return increment +
-         ((AtomicLocation32)ptr)
-             ->fetch_add(increment, std::memory_order_relaxed);
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  return increment + ((AtomicLocation32)ptr)->fetch_add(increment);
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  ((AtomicLocation32)ptr)
-      ->compare_exchange_strong(old_value,
-                                new_value,
-                                std::memory_order_acquire,
-                                std::memory_order_acquire);
-  return old_value;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  ((AtomicLocation32)ptr)
-      ->compare_exchange_strong(old_value,
-                                new_value,
-                                std::memory_order_release,
-                                std::memory_order_relaxed);
-  return old_value;
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  ((AtomicLocation32)ptr)->store(value, std::memory_order_relaxed);
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  ((AtomicLocation32)ptr)->store(value, std::memory_order_relaxed);
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  ((AtomicLocation32)ptr)->store(value, std::memory_order_release);
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return ((AtomicLocation32)ptr)->load(std::memory_order_relaxed);
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  return ((AtomicLocation32)ptr)->load(std::memory_order_acquire);
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  MemoryBarrierInternal();
-  return ((AtomicLocation32)ptr)->load(std::memory_order_relaxed);
-}
-
-#if defined(GOOGLE_PROTOBUF_ARCH_64_BIT)
-
-typedef volatile std::atomic<Atomic64>* AtomicLocation64;
-static_assert(sizeof(*(AtomicLocation64) nullptr) == sizeof(Atomic64),
-              "incompatible 64-bit atomic layout");
-
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                         Atomic64 old_value,
-                                         Atomic64 new_value) {
-  ((AtomicLocation64)ptr)
-      ->compare_exchange_strong(old_value,
-                                new_value,
-                                std::memory_order_relaxed,
-                                std::memory_order_relaxed);
-  return old_value;
-}
-
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
-                                         Atomic64 new_value) {
-  return ((AtomicLocation64)ptr)
-      ->exchange(new_value, std::memory_order_relaxed);
-}
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
-                                          Atomic64 increment) {
-  return increment +
-         ((AtomicLocation64)ptr)
-             ->fetch_add(increment, std::memory_order_relaxed);
-}
-
-inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
-                                        Atomic64 increment) {
-  return increment + ((AtomicLocation64)ptr)->fetch_add(increment);
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  ((AtomicLocation64)ptr)
-      ->compare_exchange_strong(old_value,
-                                new_value,
-                                std::memory_order_acquire,
-                                std::memory_order_acquire);
-  return old_value;
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  ((AtomicLocation64)ptr)
-      ->compare_exchange_strong(old_value,
-                                new_value,
-                                std::memory_order_release,
-                                std::memory_order_relaxed);
-  return old_value;
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
-  ((AtomicLocation64)ptr)->store(value, std::memory_order_relaxed);
-}
-
-inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
-  ((AtomicLocation64)ptr)->store(value, std::memory_order_relaxed);
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
-  ((AtomicLocation64)ptr)->store(value, std::memory_order_release);
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
-  return ((AtomicLocation64)ptr)->load(std::memory_order_relaxed);
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
-  return ((AtomicLocation64)ptr)->load(std::memory_order_acquire);
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
-  MemoryBarrierInternal();
-  return ((AtomicLocation64)ptr)->load(std::memory_order_relaxed);
-}
-
-#endif  // defined(GOOGLE_PROTOBUF_ARCH_64_BIT)
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_C11_ATOMIC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
deleted file mode 100644 (file)
index 075c406..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright 2013 Red Hat Inc.  All rights reserved.
-//
-// 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 Red Hat 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_GCC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_GCC_H_
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  __atomic_compare_exchange_n(ptr, &old_value, new_value, false,
-                              __ATOMIC_RELAXED, __ATOMIC_RELAXED);
-  return old_value;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  return __atomic_exchange_n(ptr, new_value, __ATOMIC_RELAXED);
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  return __atomic_add_fetch(ptr, increment, __ATOMIC_RELAXED);
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  return __atomic_add_fetch(ptr, increment, __ATOMIC_SEQ_CST);
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  __atomic_compare_exchange_n(ptr, &old_value, new_value, false,
-                              __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE);
-  return old_value;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  __atomic_compare_exchange_n(ptr, &old_value, new_value, false,
-                              __ATOMIC_RELEASE, __ATOMIC_ACQUIRE);
-  return old_value;
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  __atomic_store_n(ptr, value, __ATOMIC_RELAXED);
-}
-
-inline void MemoryBarrierInternal() {
-  __sync_synchronize();
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  __atomic_store_n(ptr, value, __ATOMIC_SEQ_CST);
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  __atomic_store_n(ptr, value, __ATOMIC_RELEASE);
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return __atomic_load_n(ptr, __ATOMIC_RELAXED);
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  return __atomic_load_n(ptr, __ATOMIC_ACQUIRE);
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  return __atomic_load_n(ptr, __ATOMIC_SEQ_CST);
-}
-
-#ifdef __LP64__
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
-  __atomic_store_n(ptr, value, __ATOMIC_RELEASE);
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
-  return __atomic_load_n(ptr, __ATOMIC_ACQUIRE);
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  __atomic_compare_exchange_n(ptr, &old_value, new_value, false,
-                              __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE);
-  return old_value;
-}
-
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                         Atomic64 old_value,
-                                         Atomic64 new_value) {
-  __atomic_compare_exchange_n(ptr, &old_value, new_value, false,
-                              __ATOMIC_RELAXED, __ATOMIC_RELAXED);
-  return old_value;
-}
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
-                                          Atomic64 increment) {
-  return __atomic_add_fetch(ptr, increment, __ATOMIC_RELAXED);
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
-  __atomic_store_n(ptr, value, __ATOMIC_RELAXED);
-}
-
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
-                                         Atomic64 new_value) {
-  return __atomic_exchange_n(ptr, new_value, __ATOMIC_RELAXED);
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
-  return __atomic_load_n(ptr, __ATOMIC_RELAXED);
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  __atomic_compare_exchange_n(ptr, &old_value, new_value, false,
-                              __ATOMIC_RELEASE, __ATOMIC_ACQUIRE);
-  return old_value;
-}
-
-#endif // defined(__LP64__)
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_GCC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_mips_gcc.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_mips_gcc.h
deleted file mode 100644 (file)
index 6ce6820..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MIPS_GCC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MIPS_GCC_H_
-
-#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// Atomically execute:
-//      result = *ptr;
-//      if (*ptr == old_value)
-//        *ptr = new_value;
-//      return result;
-//
-// I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value".
-// Always return the old value of "*ptr"
-//
-// This routine implies no memory barriers.
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  Atomic32 prev, tmp;
-  __asm__ __volatile__(".set push\n"
-                       ".set noreorder\n"
-                       "1:\n"
-                       "ll %0, %5\n"  // prev = *ptr
-                       "bne %0, %3, 2f\n"  // if (prev != old_value) goto 2
-                       "move %2, %4\n"  // tmp = new_value
-                       "sc %2, %1\n"  // *ptr = tmp (with atomic check)
-                       "beqz %2, 1b\n"  // start again on atomic error
-                       "nop\n"  // delay slot nop
-                       "2:\n"
-                       ".set pop\n"
-                       : "=&r" (prev), "=m" (*ptr), "=&r" (tmp)
-                       : "r" (old_value), "r" (new_value), "m" (*ptr)
-                       : "memory");
-  return prev;
-}
-
-// Atomically store new_value into *ptr, returning the previous value held in
-// *ptr.  This routine implies no memory barriers.
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  Atomic32 temp, old;
-  __asm__ __volatile__(".set push\n"
-                       ".set noreorder\n"
-                       "1:\n"
-                       "ll %1, %4\n"  // old = *ptr
-                       "move %0, %3\n"  // temp = new_value
-                       "sc %0, %2\n"  // *ptr = temp (with atomic check)
-                       "beqz %0, 1b\n"  // start again on atomic error
-                       "nop\n"  // delay slot nop
-                       ".set pop\n"
-                       : "=&r" (temp), "=&r" (old), "=m" (*ptr)
-                       : "r" (new_value), "m" (*ptr)
-                       : "memory");
-
-  return old;
-}
-
-// Atomically increment *ptr by "increment".  Returns the new value of
-// *ptr with the increment applied.  This routine implies no memory barriers.
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  Atomic32 temp, temp2;
-
-  __asm__ __volatile__(".set push\n"
-                       ".set noreorder\n"
-                       "1:\n"
-                       "ll %0, %4\n"  // temp = *ptr
-                       "addu %1, %0, %3\n"  // temp2 = temp + increment
-                       "sc %1, %2\n"  // *ptr = temp2 (with atomic check)
-                       "beqz %1, 1b\n"  // start again on atomic error
-                       "addu %1, %0, %3\n"  // temp2 = temp + increment
-                       ".set pop\n"
-                       : "=&r" (temp), "=&r" (temp2), "=m" (*ptr)
-                       : "Ir" (increment), "m" (*ptr)
-                       : "memory");
-  // temp2 now holds the final value.
-  return temp2;
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  ATOMICOPS_COMPILER_BARRIER();
-  Atomic32 res = NoBarrier_AtomicIncrement(ptr, increment);
-  ATOMICOPS_COMPILER_BARRIER();
-  return res;
-}
-
-// "Acquire" operations
-// ensure that no later memory access can be reordered ahead of the operation.
-// "Release" operations ensure that no previous memory access can be reordered
-// after the operation.  "Barrier" operations have both "Acquire" and "Release"
-// semantics.   A MemoryBarrierInternal() has "Barrier" semantics, but does no
-// memory access.
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  ATOMICOPS_COMPILER_BARRIER();
-  Atomic32 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  ATOMICOPS_COMPILER_BARRIER();
-  return res;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  ATOMICOPS_COMPILER_BARRIER();
-  Atomic32 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  ATOMICOPS_COMPILER_BARRIER();
-  return res;
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-inline void MemoryBarrierInternal() {
-  __asm__ __volatile__("sync" : : : "memory");
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  MemoryBarrierInternal();
-  *ptr = value;
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return *ptr;
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  Atomic32 value = *ptr;
-  MemoryBarrierInternal();
-  return value;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-#if defined(__LP64__)
-// 64-bit versions of the atomic ops.
-
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                         Atomic64 old_value,
-                                         Atomic64 new_value) {
-  Atomic64 prev, tmp;
-  __asm__ __volatile__(".set push\n"
-                       ".set noreorder\n"
-                       "1:\n"
-                       "lld %0, %5\n"  // prev = *ptr
-                       "bne %0, %3, 2f\n"  // if (prev != old_value) goto 2
-                       "move %2, %4\n"  // tmp = new_value
-                       "scd %2, %1\n"  // *ptr = tmp (with atomic check)
-                       "beqz %2, 1b\n"  // start again on atomic error
-                       "nop\n"  // delay slot nop
-                       "2:\n"
-                       ".set pop\n"
-                       : "=&r" (prev), "=m" (*ptr), "=&r" (tmp)
-                       : "r" (old_value), "r" (new_value), "m" (*ptr)
-                       : "memory");
-  return prev;
-}
-
-// Atomically store new_value into *ptr, returning the previous value held in
-// *ptr.  This routine implies no memory barriers.
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
-                                         Atomic64 new_value) {
-  Atomic64 temp, old;
-  __asm__ __volatile__(".set push\n"
-                       ".set noreorder\n"
-                       "1:\n"
-                       "lld %1, %4\n"  // old = *ptr
-                       "move %0, %3\n"  // temp = new_value
-                       "scd %0, %2\n"  // *ptr = temp (with atomic check)
-                       "beqz %0, 1b\n"  // start again on atomic error
-                       "nop\n"  // delay slot nop
-                       ".set pop\n"
-                       : "=&r" (temp), "=&r" (old), "=m" (*ptr)
-                       : "r" (new_value), "m" (*ptr)
-                       : "memory");
-
-  return old;
-}
-
-// Atomically increment *ptr by "increment".  Returns the new value of
-// *ptr with the increment applied.  This routine implies no memory barriers.
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
-                                          Atomic64 increment) {
-  Atomic64 temp, temp2;
-
-  __asm__ __volatile__(".set push\n"
-                       ".set noreorder\n"
-                       "1:\n"
-                       "lld %0, %4\n"  // temp = *ptr
-                       "daddu %1, %0, %3\n"  // temp2 = temp + increment
-                       "scd %1, %2\n"  // *ptr = temp2 (with atomic check)
-                       "beqz %1, 1b\n"  // start again on atomic error
-                       "daddu %1, %0, %3\n"  // temp2 = temp + increment
-                       ".set pop\n"
-                       : "=&r" (temp), "=&r" (temp2), "=m" (*ptr)
-                       : "Ir" (increment), "m" (*ptr)
-                       : "memory");
-  // temp2 now holds the final value.
-  return temp2;
-}
-
-inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
-                                        Atomic64 increment) {
-  MemoryBarrierInternal();
-  Atomic64 res = NoBarrier_AtomicIncrement(ptr, increment);
-  MemoryBarrierInternal();
-  return res;
-}
-
-// "Acquire" operations
-// ensure that no later memory access can be reordered ahead of the operation.
-// "Release" operations ensure that no previous memory access can be reordered
-// after the operation.  "Barrier" operations have both "Acquire" and "Release"
-// semantics.   A MemoryBarrierInternal() has "Barrier" semantics, but does no
-// memory access.
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  Atomic64 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  MemoryBarrierInternal();
-  return res;
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  MemoryBarrierInternal();
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
-  MemoryBarrierInternal();
-  *ptr = value;
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
-  return *ptr;
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
-  Atomic64 value = *ptr;
-  MemoryBarrierInternal();
-  return value;
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-#endif
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#undef ATOMICOPS_COMPILER_BARRIER
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MIPS_GCC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_power.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_power.h
deleted file mode 100644 (file)
index cad9f1e..0000000
+++ /dev/null
@@ -1,440 +0,0 @@
-// Copyright 2014 Bloomberg Finance LP. All rights reserved.
-//
-// 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 Bloomberg Finance LP. 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_AIX_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_AIX_H_
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  Atomic32 result;
-
-  asm volatile (
-      "1:     lwarx %[res], %[zero], %[obj]   \n\t"  // load and reserve
-      "       cmpw %[cmp], %[res]             \n\t"  // compare values
-      "       bne- 2f                         \n\t"
-      "       stwcx. %[val], %[zero], %[obj]  \n\t"  // store new value
-      "       bne- 1b                         \n\t"
-      "2:                                     \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [cmp]  "b"   (old_value),
-                [val]  "b"   (new_value),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  Atomic32 result;
-
-  asm volatile (
-      "1:     lwarx %[res], %[zero], %[obj]       \n\t"
-      "       stwcx. %[val], %[zero], %[obj]      \n\t"
-      "       bne- 1b                             \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [val]  "b"   (new_value),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  Atomic32 result;
-
-  asm volatile (
-      "1:     lwarx %[res], %[zero], %[obj]   \n\t"  // load and reserve
-      "       add %[res], %[val], %[res]      \n\t"  // add the operand
-      "       stwcx. %[res], %[zero], %[obj]  \n\t"  // store old value
-                                                     // if still reserved
-      "       bne- 1b                         \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [val]  "b"   (increment),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline void MemoryBarrierInternal(void) {
-  asm volatile (
-      "       lwsync                          \n\t"
-      "       isync                           \n\t"
-              :
-              :
-              : "memory");
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  Atomic32 result;
-
-  asm volatile (
-      "       lwsync                          \n\t"
-
-      "1:     lwarx %[res], %[zero], %[obj]   \n\t"  // load and reserve
-      "       add %[res], %[val], %[res]      \n\t"  // add the operand
-      "       stwcx. %[res], %[zero], %[obj]  \n\t"  // store old value
-                                                     // if still reserved
-      "       bne- 1b                         \n\t"
-      "       isync                           \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [val]  "b"   (increment),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  Atomic32 result;
-
-  asm volatile (
-      "1:     lwarx %[res], %[zero], %[obj]   \n\t"  // load and reserve
-      "       cmpw %[cmp], %[res]             \n\t"  // compare values
-      "       bne- 2f                         \n\t"
-      "       stwcx. %[val], %[zero], %[obj]  \n\t"  // store new value
-      "       bne- 1b                         \n\t"
-
-      "       isync                           \n\t"
-      "2:                                     \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [cmp]  "b"   (old_value),
-                [val]  "b"   (new_value),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  Atomic32 result;
-
-  asm volatile (
-      "       lwsync                          \n\t"
-
-      "1:     lwarx %[res], %[zero], %[obj]   \n\t"  // load and reserve
-      "       cmpw %[cmp], %[res]             \n\t"  // compare values
-      "       bne- 2f                         \n\t"
-      "       stwcx. %[val], %[zero], %[obj]  \n\t"  // store new value
-      "       bne- 1b                         \n\t"
-
-      "2:                                     \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [cmp]  "b"   (old_value),
-                [val]  "b"   (new_value),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  asm volatile (
-      "       stw %[val], %[obj]      \n\t"
-      "       isync                   \n\t"
-              : [obj] "=m" (*ptr)
-              : [val]  "b"  (value));
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  asm volatile (
-      "       lwsync                  \n\t"
-      "       stw %[val], %[obj]      \n\t"
-              : [obj] "=m" (*ptr)
-              : [val]  "b"  (value));
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return *ptr;
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  Atomic32 result;
-
-  asm volatile (
-      "1:     lwz %[res], %[obj]              \n\t"
-      "       cmpw %[res], %[res]             \n\t" // create data
-                                                    // dependency for
-                                                    // load/load ordering
-      "       bne- 1b                         \n\t" // never taken
-
-      "       isync                           \n\t"
-              : [res]  "=b" (result)
-              : [obj]  "m"  (*ptr),
-                [zero] "i"  (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  Atomic32 result;
-
-  asm volatile (
-      "       lwsync                          \n\t"
-
-      "1:     lwz %[res], %[obj]              \n\t"
-      "       cmpw %[res], %[res]             \n\t" // create data
-                                                    // dependency for
-                                                    // load/load ordering
-      "       bne- 1b                         \n\t" // never taken
-              : [res]  "=b" (result)
-              : [obj]  "m"  (*ptr),
-                [zero] "i"  (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-#ifdef GOOGLE_PROTOBUF_ARCH_64_BIT
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                         Atomic64 old_value,
-                                         Atomic64 new_value) {
-  Atomic64 result;
-
-  asm volatile (
-      "1:     ldarx %[res], %[zero], %[obj]   \n\t"  // load and reserve
-      "       cmpd %[cmp], %[res]             \n\t"  // compare values
-      "       bne- 2f                         \n\t"
-
-      "       stdcx. %[val], %[zero], %[obj]  \n\t"  // store the new value
-      "       bne- 1b                         \n\t"
-      "2:                                     \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [cmp]  "b"   (old_value),
-                [val]  "b"   (new_value),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
-                                         Atomic64 new_value) {
-  Atomic64 result;
-
-  asm volatile (
-      "1:     ldarx %[res], %[zero], %[obj]       \n\t"
-      "       stdcx. %[val], %[zero], %[obj]      \n\t"
-      "       bne- 1b                             \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [val]  "b"   (new_value),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
-                                          Atomic64 increment) {
-  Atomic64 result;
-
-  asm volatile (
-      "1:     ldarx %[res], %[zero], %[obj]   \n\t" // load and reserve
-      "       add %[res], %[res], %[val]      \n\t" // add the operand
-      "       stdcx. %[res], %[zero], %[obj]  \n\t" // store old value if
-                                                    // still reserved
-
-      "       bne- 1b                         \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [val]  "b"   (increment),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
-                                        Atomic64 increment) {
-
-  Atomic64 result;
-
-  asm volatile (
-      "       lwsync                          \n\t"
-
-      "1:     ldarx %[res], %[zero], %[obj]   \n\t" // load and reserve
-      "       add %[res], %[res], %[val]      \n\t" // add the operand
-      "       stdcx. %[res], %[zero], %[obj]  \n\t" // store old value if
-                                                    // still reserved
-
-      "       bne- 1b                         \n\t"
-
-      "       isync                           \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [val]  "b"   (increment),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  Atomic64 result;
-
-  asm volatile (
-      "1:     ldarx %[res], %[zero], %[obj]   \n\t"  // load and reserve
-      "       cmpd %[cmp], %[res]             \n\t"  // compare values
-      "       bne- 2f                         \n\t"
-
-      "       stdcx. %[val], %[zero], %[obj]  \n\t"  // store the new value
-      "       bne- 1b                         \n\t"
-      "       isync                           \n\t"
-      "2:                                     \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [cmp]  "b"   (old_value),
-                [val]  "b"   (new_value),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  Atomic64 result;
-
-  asm volatile (
-      "       lwsync                          \n\t"
-
-      "1:     ldarx %[res], %[zero], %[obj]   \n\t"  // load and reserve
-      "       cmpd %[cmp], %[res]             \n\t"  // compare values
-      "       bne- 2f                         \n\t"
-
-      "       stdcx. %[val], %[zero], %[obj]  \n\t"  // store the new value
-      "       bne- 1b                         \n\t"
-      "2:                                     \n\t"
-              : [res]  "=&b" (result)
-              : [obj]  "b"   (ptr),
-                [cmp]  "b"   (old_value),
-                [val]  "b"   (new_value),
-                [zero] "i"   (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
-  asm volatile (
-      "       std %[val], %[obj]          \n\t"
-      "       isync                       \n\t"
-              : [obj] "=m" (*ptr)
-              : [val] "b"  (value));
-}
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
-  asm volatile (
-      "       lwsync                      \n\t"
-      "       std %[val], %[obj]          \n\t"
-              : [obj] "=m" (*ptr)
-              : [val] "b"  (value));
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
-  return *ptr;
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
-  Atomic64 result;
-
-  asm volatile (
-      "1:     ld %[res], %[obj]                   \n\t"
-      "       cmpd %[res], %[res]                 \n\t" // create data
-                                                        // dependency for
-                                                        // load/load ordering
-      "       bne- 1b                             \n\t" // never taken
-
-      "       isync                               \n\t"
-              : [res]  "=b" (result)
-              : [obj]  "m"  (*ptr),
-                [zero] "i"  (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
-  Atomic64 result;
-
-  asm volatile (
-      "       lwsync                              \n\t"
-
-      "1:     ld %[res], %[obj]                   \n\t"
-      "       cmpd %[res], %[res]                 \n\t" // create data
-                                                        // dependency for
-                                                        // load/load ordering
-      "       bne- 1b                             \n\t" // never taken
-              : [res]  "=b" (result)
-              : [obj]  "m"  (*ptr),
-                [zero] "i"  (0)
-              : "cr0", "ctr");
-
-  return result;
-}
-#endif
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_SPARC_GCC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_ppc_gcc.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_ppc_gcc.h
deleted file mode 100644 (file)
index d477dc6..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 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: ogabbay@advaoptical.com (Oded Gabbay)
-// Cleaned up by: bsilver16384@gmail.com (Brian Silverman)
-//
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PPC_GCC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PPC_GCC_H_
-
-#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32 *ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  Atomic32 prev;
-
-  __asm__ __volatile__(
-      "0:                                  \n\t"
-      "lwarx %[prev],0,%[ptr]              \n\t"
-      "cmpw 0,%[prev],%[old_value]         \n\t"
-      "bne- 1f                             \n\t"
-      "stwcx. %[new_value],0,%[ptr]        \n\t"
-      "bne- 0b                             \n\t"
-      "1:                                  \n\t"
-      : [prev] "=&r"(prev), "+m"(*ptr)
-      : [ptr] "r"(ptr), [old_value] "r"(old_value), [new_value] "r"(new_value)
-      : "cc", "memory");
-
-  return prev;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32 *ptr,
-                                         Atomic32 new_value) {
-  Atomic32 old;
-
-  __asm__ __volatile__(
-      "0:                                  \n\t"
-      "lwarx %[old],0,%[ptr]               \n\t"
-      "stwcx. %[new_value],0,%[ptr]        \n\t"
-      "bne- 0b                             \n\t"
-      : [old] "=&r"(old), "+m"(*ptr)
-      : [ptr] "r"(ptr), [new_value] "r"(new_value)
-      : "cc", "memory");
-
-  return old;
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32 *ptr,
-                                          Atomic32 increment) {
-  Atomic32 temp;
-
-  __asm__ __volatile__(
-      "0:                                  \n\t"
-      "lwarx %[temp],0,%[ptr]              \n\t"
-      "add %[temp],%[increment],%[temp]    \n\t"
-      "stwcx. %[temp],0,%[ptr]             \n\t"
-      "bne- 0b                             \n\t"
-      : [temp] "=&r"(temp)
-      : [increment] "r"(increment), [ptr] "r"(ptr)
-      : "cc", "memory");
-
-  return temp;
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32 *ptr,
-                                        Atomic32 increment) {
-  MemoryBarrierInternal();
-  Atomic32 res = NoBarrier_AtomicIncrement(ptr, increment);
-  MemoryBarrierInternal();
-  return res;
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32 *ptr,
-                                       Atomic32 old_value, Atomic32 new_value) {
-  Atomic32 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  MemoryBarrierInternal();
-  return res;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32 *ptr,
-                                       Atomic32 old_value, Atomic32 new_value) {
-  MemoryBarrierInternal();
-  Atomic32 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  return res;
-}
-
-inline void NoBarrier_Store(volatile Atomic32 *ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-inline void MemoryBarrierInternal() { __asm__ __volatile__("sync" : : : "memory"); }
-
-inline void Acquire_Store(volatile Atomic32 *ptr, Atomic32 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic32 *ptr, Atomic32 value) {
-  MemoryBarrierInternal();
-  *ptr = value;
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32 *ptr) { return *ptr; }
-
-inline Atomic32 Acquire_Load(volatile const Atomic32 *ptr) {
-  Atomic32 value = *ptr;
-  MemoryBarrierInternal();
-  return value;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32 *ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#undef ATOMICOPS_COMPILER_BARRIER
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PPC_GCC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_solaris.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_solaris.h
deleted file mode 100644 (file)
index baecb99..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright 2014 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_SPARC_GCC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_SPARC_GCC_H_
-
-#include <atomic.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  return (Atomic32)atomic_cas_32((volatile uint32_t*)ptr, (uint32_t)old_value, (uint32_t)new_value);
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  return (Atomic32)atomic_swap_32((volatile uint32_t*)ptr, (uint32_t)new_value);
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  return (Atomic32)atomic_add_32_nv((volatile uint32_t*)ptr, (uint32_t)increment);
-}
-
-inline void MemoryBarrierInternal(void) {
-       membar_producer();
-       membar_consumer();
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  MemoryBarrierInternal();
-  Atomic32 ret = NoBarrier_AtomicIncrement(ptr, increment);
-  MemoryBarrierInternal();
-
-  return ret;
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  Atomic32 ret = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  MemoryBarrierInternal();
-
-  return ret;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  MemoryBarrierInternal();
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-  membar_producer();
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  membar_consumer();
-  *ptr = value;
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return *ptr;
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  Atomic32 val = *ptr;
-  membar_consumer();
-  return val;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  membar_producer();
-  return *ptr;
-}
-
-#ifdef GOOGLE_PROTOBUF_ARCH_64_BIT
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                         Atomic64 old_value,
-                                         Atomic64 new_value) {
-  return atomic_cas_64((volatile uint64_t*)ptr, (uint64_t)old_value, (uint64_t)new_value);
-}
-
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value) {
-  return atomic_swap_64((volatile uint64_t*)ptr, (uint64_t)new_value);
-}
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) {
-  return atomic_add_64_nv((volatile uint64_t*)ptr, increment);
-}
-
-inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment) {
-  MemoryBarrierInternal();
-  Atomic64 ret = atomic_add_64_nv((volatile uint64_t*)ptr, increment);
-  MemoryBarrierInternal();
-  return ret;
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  Atomic64 ret = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  MemoryBarrierInternal();
-  return ret;
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  MemoryBarrierInternal();
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-  membar_producer();
-}
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
-  membar_consumer();
-  *ptr = value;
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
-  return *ptr;
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
-  Atomic64 ret = *ptr;
-  membar_consumer();
-  return ret;
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
-  membar_producer();
-  return *ptr;
-}
-#endif
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_SPARC_GCC_H_
-
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_tsan.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_tsan.h
deleted file mode 100644 (file)
index 676380b..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2013 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.
-
-// This file is an internal atomic implementation for compiler-based
-// ThreadSanitizer (http://clang.llvm.org/docs/ThreadSanitizer.html).
-// Use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_TSAN_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_TSAN_H_
-
-#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
-
-#include <sanitizer/tsan_interface_atomic.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32 *ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  Atomic32 cmp = old_value;
-  __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
-      __tsan_memory_order_relaxed, __tsan_memory_order_relaxed);
-  return cmp;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32 *ptr,
-                                         Atomic32 new_value) {
-  return __tsan_atomic32_exchange(ptr, new_value,
-      __tsan_memory_order_relaxed);
-}
-
-inline Atomic32 Acquire_AtomicExchange(volatile Atomic32 *ptr,
-                                       Atomic32 new_value) {
-  return __tsan_atomic32_exchange(ptr, new_value,
-      __tsan_memory_order_acquire);
-}
-
-inline Atomic32 Release_AtomicExchange(volatile Atomic32 *ptr,
-                                       Atomic32 new_value) {
-  return __tsan_atomic32_exchange(ptr, new_value,
-      __tsan_memory_order_release);
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32 *ptr,
-                                          Atomic32 increment) {
-  return increment + __tsan_atomic32_fetch_add(ptr, increment,
-      __tsan_memory_order_relaxed);
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32 *ptr,
-                                        Atomic32 increment) {
-  return increment + __tsan_atomic32_fetch_add(ptr, increment,
-      __tsan_memory_order_acq_rel);
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32 *ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  Atomic32 cmp = old_value;
-  __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
-      __tsan_memory_order_acquire, __tsan_memory_order_acquire);
-  return cmp;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32 *ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  Atomic32 cmp = old_value;
-  __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
-      __tsan_memory_order_release, __tsan_memory_order_relaxed);
-  return cmp;
-}
-
-inline void NoBarrier_Store(volatile Atomic32 *ptr, Atomic32 value) {
-  __tsan_atomic32_store(ptr, value, __tsan_memory_order_relaxed);
-}
-
-inline void Acquire_Store(volatile Atomic32 *ptr, Atomic32 value) {
-  __tsan_atomic32_store(ptr, value, __tsan_memory_order_relaxed);
-  __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
-}
-
-inline void Release_Store(volatile Atomic32 *ptr, Atomic32 value) {
-  __tsan_atomic32_store(ptr, value, __tsan_memory_order_release);
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32 *ptr) {
-  return __tsan_atomic32_load(ptr, __tsan_memory_order_relaxed);
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32 *ptr) {
-  return __tsan_atomic32_load(ptr, __tsan_memory_order_acquire);
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32 *ptr) {
-  __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
-  return __tsan_atomic32_load(ptr, __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64 *ptr,
-                                         Atomic64 old_value,
-                                         Atomic64 new_value) {
-  Atomic64 cmp = old_value;
-  __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
-      __tsan_memory_order_relaxed, __tsan_memory_order_relaxed);
-  return cmp;
-}
-
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64 *ptr,
-                                         Atomic64 new_value) {
-  return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 Acquire_AtomicExchange(volatile Atomic64 *ptr,
-                                       Atomic64 new_value) {
-  return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_acquire);
-}
-
-inline Atomic64 Release_AtomicExchange(volatile Atomic64 *ptr,
-                                       Atomic64 new_value) {
-  return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_release);
-}
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64 *ptr,
-                                          Atomic64 increment) {
-  return increment + __tsan_atomic64_fetch_add(ptr, increment,
-      __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64 *ptr,
-                                        Atomic64 increment) {
-  return increment + __tsan_atomic64_fetch_add(ptr, increment,
-      __tsan_memory_order_acq_rel);
-}
-
-inline void NoBarrier_Store(volatile Atomic64 *ptr, Atomic64 value) {
-  __tsan_atomic64_store(ptr, value, __tsan_memory_order_relaxed);
-}
-
-inline void Acquire_Store(volatile Atomic64 *ptr, Atomic64 value) {
-  __tsan_atomic64_store(ptr, value, __tsan_memory_order_relaxed);
-  __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
-}
-
-inline void Release_Store(volatile Atomic64 *ptr, Atomic64 value) {
-  __tsan_atomic64_store(ptr, value, __tsan_memory_order_release);
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64 *ptr) {
-  return __tsan_atomic64_load(ptr, __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64 *ptr) {
-  return __tsan_atomic64_load(ptr, __tsan_memory_order_acquire);
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64 *ptr) {
-  __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
-  return __tsan_atomic64_load(ptr, __tsan_memory_order_relaxed);
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64 *ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  Atomic64 cmp = old_value;
-  __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
-      __tsan_memory_order_acquire, __tsan_memory_order_acquire);
-  return cmp;
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64 *ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  Atomic64 cmp = old_value;
-  __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
-      __tsan_memory_order_release, __tsan_memory_order_relaxed);
-  return cmp;
-}
-
-inline void MemoryBarrierInternal() {
-  __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#undef ATOMICOPS_COMPILER_BARRIER
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_TSAN_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc
deleted file mode 100644 (file)
index 53c9eae..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// This module gets enough CPU information to optimize the
-// atomicops module on x86.
-
-#include <cstring>
-
-#include <google/protobuf/stubs/atomicops.h>
-
-// This file only makes sense with atomicops_internals_x86_gcc.h -- it
-// depends on structs that are defined in that file.  If atomicops.h
-// doesn't sub-include that file, then we aren't needed, and shouldn't
-// try to do anything.
-#ifdef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_GCC_H_
-
-// Inline cpuid instruction.  In PIC compilations, %ebx contains the address
-// of the global offset table.  To avoid breaking such executables, this code
-// must preserve that register's value across cpuid instructions.
-#if defined(__i386__)
-#define cpuid(a, b, c, d, inp) \
-  asm("mov %%ebx, %%edi\n"     \
-      "cpuid\n"                \
-      "xchg %%edi, %%ebx\n"    \
-      : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
-#elif defined(__x86_64__)
-#define cpuid(a, b, c, d, inp) \
-  asm("mov %%rbx, %%rdi\n"     \
-      "cpuid\n"                \
-      "xchg %%rdi, %%rbx\n"    \
-      : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp))
-#endif
-
-#if defined(cpuid)        // initialize the struct only on x86
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// Set the flags so that code will run correctly and conservatively, so even
-// if we haven't been initialized yet, we're probably single threaded, and our
-// default values should hopefully be pretty safe.
-struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = {
-  false,          // bug can't exist before process spawns multiple threads
-  false,          // no SSE2
-};
-
-namespace {
-
-// Initialize the AtomicOps_Internalx86CPUFeatures struct.
-void AtomicOps_Internalx86CPUFeaturesInit() {
-  uint32_t eax;
-  uint32_t ebx;
-  uint32_t ecx;
-  uint32_t edx;
-
-  // Get vendor string (issue CPUID with eax = 0)
-  cpuid(eax, ebx, ecx, edx, 0);
-  char vendor[13];
-  memcpy(vendor, &ebx, 4);
-  memcpy(vendor + 4, &edx, 4);
-  memcpy(vendor + 8, &ecx, 4);
-  vendor[12] = 0;
-
-  // get feature flags in ecx/edx, and family/model in eax
-  cpuid(eax, ebx, ecx, edx, 1);
-
-  int family = (eax >> 8) & 0xf;        // family and model fields
-  int model = (eax >> 4) & 0xf;
-  if (family == 0xf) {                  // use extended family and model fields
-    family += (eax >> 20) & 0xff;
-    model += ((eax >> 16) & 0xf) << 4;
-  }
-
-  // Opteron Rev E has a bug in which on very rare occasions a locked
-  // instruction doesn't act as a read-acquire barrier if followed by a
-  // non-locked read-modify-write instruction.  Rev F has this bug in
-  // pre-release versions, but not in versions released to customers,
-  // so we test only for Rev E, which is family 15, model 32..63 inclusive.
-  if (strcmp(vendor, "AuthenticAMD") == 0 &&       // AMD
-      family == 15 &&
-      32 <= model && model <= 63) {
-    AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = true;
-  } else {
-    AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = false;
-  }
-
-  // edx bit 26 is SSE2 which we use to tell use whether we can use mfence
-  AtomicOps_Internalx86CPUFeatures.has_sse2 = ((edx >> 26) & 1);
-}
-
-class AtomicOpsx86Initializer {
- public:
-  AtomicOpsx86Initializer() {
-    AtomicOps_Internalx86CPUFeaturesInit();
-  }
-};
-
-// A global to get use initialized on startup via static initialization :/
-AtomicOpsx86Initializer g_initer;
-
-}  // namespace
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // __i386__
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_GCC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.h
deleted file mode 100644 (file)
index e80121f..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_GCC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_GCC_H_
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// This struct is not part of the public API of this module; clients may not
-// use it.
-// Features of this x86.  Values may not be correct before main() is run,
-// but are set conservatively.
-struct AtomicOps_x86CPUFeatureStruct {
-  bool has_amd_lock_mb_bug;  // Processor has AMD memory-barrier bug; do lfence
-                             // after acquire compare-and-swap.
-  bool has_sse2;             // Processor has SSE2.
-};
-extern struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures;
-
-#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
-
-// 32-bit low-level operations on any platform.
-
-inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                         Atomic32 old_value,
-                                         Atomic32 new_value) {
-  Atomic32 prev;
-  __asm__ __volatile__("lock; cmpxchgl %1,%2"
-                       : "=a" (prev)
-                       : "q" (new_value), "m" (*ptr), "0" (old_value)
-                       : "memory");
-  return prev;
-}
-
-inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                         Atomic32 new_value) {
-  __asm__ __volatile__("xchgl %1,%0"  // The lock prefix is implicit for xchg.
-                       : "=r" (new_value)
-                       : "m" (*ptr), "0" (new_value)
-                       : "memory");
-  return new_value;  // Now it's the previous value.
-}
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  Atomic32 temp = increment;
-  __asm__ __volatile__("lock; xaddl %0,%1"
-                       : "+r" (temp), "+m" (*ptr)
-                       : : "memory");
-  // temp now holds the old value of *ptr
-  return temp + increment;
-}
-
-inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                        Atomic32 increment) {
-  Atomic32 temp = increment;
-  __asm__ __volatile__("lock; xaddl %0,%1"
-                       : "+r" (temp), "+m" (*ptr)
-                       : : "memory");
-  // temp now holds the old value of *ptr
-  if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
-    __asm__ __volatile__("lfence" : : : "memory");
-  }
-  return temp + increment;
-}
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  Atomic32 x = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
-    __asm__ __volatile__("lfence" : : : "memory");
-  }
-  return x;
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-#if defined(__x86_64__)
-
-// 64-bit implementations of memory barrier can be simpler, because it
-// "mfence" is guaranteed to exist.
-inline void MemoryBarrierInternal() {
-  __asm__ __volatile__("mfence" : : : "memory");
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-#else
-
-inline void MemoryBarrierInternal() {
-  if (AtomicOps_Internalx86CPUFeatures.has_sse2) {
-    __asm__ __volatile__("mfence" : : : "memory");
-  } else {  // mfence is faster but not present on PIII
-    Atomic32 x = 0;
-    NoBarrier_AtomicExchange(&x, 0);  // acts as a barrier on PIII
-  }
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  if (AtomicOps_Internalx86CPUFeatures.has_sse2) {
-    *ptr = value;
-    __asm__ __volatile__("mfence" : : : "memory");
-  } else {
-    NoBarrier_AtomicExchange(ptr, value);
-                          // acts as a barrier on PIII
-  }
-}
-#endif
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  ATOMICOPS_COMPILER_BARRIER();
-  *ptr = value;  // An x86 store acts as a release barrier.
-  // See comments in Atomic64 version of Release_Store(), below.
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return *ptr;
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  Atomic32 value = *ptr;  // An x86 load acts as a acquire barrier.
-  // See comments in Atomic64 version of Release_Store(), below.
-  ATOMICOPS_COMPILER_BARRIER();
-  return value;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-#if defined(__x86_64__)
-
-// 64-bit low-level operations on 64-bit platform.
-
-inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                         Atomic64 old_value,
-                                         Atomic64 new_value) {
-  Atomic64 prev;
-  __asm__ __volatile__("lock; cmpxchgq %1,%2"
-                       : "=a" (prev)
-                       : "q" (new_value), "m" (*ptr), "0" (old_value)
-                       : "memory");
-  return prev;
-}
-
-inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
-                                         Atomic64 new_value) {
-  __asm__ __volatile__("xchgq %1,%0"  // The lock prefix is implicit for xchg.
-                       : "=r" (new_value)
-                       : "m" (*ptr), "0" (new_value)
-                       : "memory");
-  return new_value;  // Now it's the previous value.
-}
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
-                                          Atomic64 increment) {
-  Atomic64 temp = increment;
-  __asm__ __volatile__("lock; xaddq %0,%1"
-                       : "+r" (temp), "+m" (*ptr)
-                       : : "memory");
-  // temp now contains the previous value of *ptr
-  return temp + increment;
-}
-
-inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
-                                        Atomic64 increment) {
-  Atomic64 temp = increment;
-  __asm__ __volatile__("lock; xaddq %0,%1"
-                       : "+r" (temp), "+m" (*ptr)
-                       : : "memory");
-  // temp now contains the previous value of *ptr
-  if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
-    __asm__ __volatile__("lfence" : : : "memory");
-  }
-  return temp + increment;
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-  MemoryBarrierInternal();
-}
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
-  ATOMICOPS_COMPILER_BARRIER();
-
-  *ptr = value;  // An x86 store acts as a release barrier
-                 // for current AMD/Intel chips as of Jan 2008.
-                 // See also Acquire_Load(), below.
-
-  // When new chips come out, check:
-  //  IA-32 Intel Architecture Software Developer's Manual, Volume 3:
-  //  System Programming Guide, Chatper 7: Multiple-processor management,
-  //  Section 7.2, Memory Ordering.
-  // Last seen at:
-  //   http://developer.intel.com/design/pentium4/manuals/index_new.htm
-  //
-  // x86 stores/loads fail to act as barriers for a few instructions (clflush
-  // maskmovdqu maskmovq movntdq movnti movntpd movntps movntq) but these are
-  // not generated by the compiler, and are rare.  Users of these instructions
-  // need to know about cache behaviour in any case since all of these involve
-  // either flushing cache lines or non-temporal cache hints.
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
-  return *ptr;
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
-  Atomic64 value = *ptr;  // An x86 load acts as a acquire barrier,
-                          // for current AMD/Intel chips as of Jan 2008.
-                          // See also Release_Store(), above.
-  ATOMICOPS_COMPILER_BARRIER();
-  return value;
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  Atomic64 x = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-  if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
-    __asm__ __volatile__("lfence" : : : "memory");
-  }
-  return x;
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-#endif  // defined(__x86_64__)
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#undef ATOMICOPS_COMPILER_BARRIER
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_GCC_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc
deleted file mode 100644 (file)
index 74a1bd4..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// The compilation of extension_set.cc fails when windows.h is included.
-// Therefore we move the code depending on windows.h to this separate cc file.
-
-// Don't compile this file for people not concerned about thread safety.
-#ifndef GOOGLE_PROTOBUF_NO_THREAD_SAFETY
-
-#include <google/protobuf/stubs/atomicops.h>
-
-#ifdef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
-
-#include <windows.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline void MemoryBarrierInternal() {
-  // On ARM this is a define while on x86/x64 this is
-  // a function declared in WinNT.h
-  MemoryBarrier();
-}
-
-Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-                                  Atomic32 old_value,
-                                  Atomic32 new_value) {
-  LONG result = InterlockedCompareExchange(
-      reinterpret_cast<volatile LONG*>(ptr),
-      static_cast<LONG>(new_value),
-      static_cast<LONG>(old_value));
-  return static_cast<Atomic32>(result);
-}
-
-Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-                                  Atomic32 new_value) {
-  LONG result = InterlockedExchange(
-      reinterpret_cast<volatile LONG*>(ptr),
-      static_cast<LONG>(new_value));
-  return static_cast<Atomic32>(result);
-}
-
-Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-                                 Atomic32 increment) {
-  return InterlockedExchangeAdd(
-      reinterpret_cast<volatile LONG*>(ptr),
-      static_cast<LONG>(increment)) + increment;
-}
-
-#if defined(_WIN64)
-
-// 64-bit low-level operations on 64-bit platform.
-
-Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
-                                  Atomic64 old_value,
-                                  Atomic64 new_value) {
-  PVOID result = InterlockedCompareExchangePointer(
-    reinterpret_cast<volatile PVOID*>(ptr),
-    reinterpret_cast<PVOID>(new_value), reinterpret_cast<PVOID>(old_value));
-  return reinterpret_cast<Atomic64>(result);
-}
-
-Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
-                                  Atomic64 new_value) {
-  PVOID result = InterlockedExchangePointer(
-    reinterpret_cast<volatile PVOID*>(ptr),
-    reinterpret_cast<PVOID>(new_value));
-  return reinterpret_cast<Atomic64>(result);
-}
-
-Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
-                                 Atomic64 increment) {
-  return InterlockedExchangeAdd64(
-      reinterpret_cast<volatile LONGLONG*>(ptr),
-      static_cast<LONGLONG>(increment)) + increment;
-}
-
-#endif  // defined(_WIN64)
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
-#endif  // GOOGLE_PROTOBUF_NO_THREAD_SAFETY
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.h b/3rdparty/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.h
deleted file mode 100644 (file)
index 34d60d9..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2012 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.
-
-// This file is an internal atomic implementation, use atomicops.h instead.
-
-#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
-#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-                                          Atomic32 increment) {
-  return Barrier_AtomicIncrement(ptr, increment);
-}
-
-#if !(defined(_MSC_VER) && _MSC_VER >= 1400)
-#error "We require at least vs2005 for MemoryBarrier"
-#endif
-
-inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-                                       Atomic32 old_value,
-                                       Atomic32 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  NoBarrier_AtomicExchange(ptr, value);
-              // acts as a barrier in this implementation
-}
-
-inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-  *ptr = value;  // works w/o barrier for current Intel chips as of June 2005
-  // See comments in Atomic64 version of Release_Store() below.
-}
-
-inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-  return *ptr;
-}
-
-inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-  Atomic32 value = *ptr;
-  return value;
-}
-
-inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-#if defined(_WIN64)
-
-// 64-bit low-level operations on 64-bit platform.
-
-inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
-                                          Atomic64 increment) {
-  return Barrier_AtomicIncrement(ptr, increment);
-}
-
-inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;
-}
-
-inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
-  NoBarrier_AtomicExchange(ptr, value);
-              // acts as a barrier in this implementation
-}
-
-inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
-  *ptr = value;  // works w/o barrier for current Intel chips as of June 2005
-
-  // When new chips come out, check:
-  //  IA-32 Intel Architecture Software Developer's Manual, Volume 3:
-  //  System Programming Guide, Chatper 7: Multiple-processor management,
-  //  Section 7.2, Memory Ordering.
-  // Last seen at:
-  //   http://developer.intel.com/design/pentium4/manuals/index_new.htm
-}
-
-inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
-  return *ptr;
-}
-
-inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
-  Atomic64 value = *ptr;
-  return value;
-}
-
-inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
-  MemoryBarrierInternal();
-  return *ptr;
-}
-
-inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
-                                       Atomic64 old_value,
-                                       Atomic64 new_value) {
-  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-}
-
-#endif  // defined(_WIN64)
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
index f4af6a5..980d6f6 100644 (file)
@@ -33,6 +33,8 @@
 #include <string.h>
 #include <algorithm>
 
+#include <google/protobuf/stubs/logging.h>
+
 namespace google {
 namespace protobuf {
 namespace strings {
@@ -113,7 +115,7 @@ char* GrowingArrayByteSink::GetBuffer(size_t* nbytes) {
   ShrinkToFit();
   char* b = buf_;
   *nbytes = size_;
-  buf_ = NULL;
+  buf_ = nullptr;
   size_ = capacity_ = 0;
   return b;
 }
@@ -171,12 +173,8 @@ size_t LimitByteSource::Available() const {
 }
 
 StringPiece LimitByteSource::Peek() {
-  StringPiece piece(source_->Peek());
-  if (piece.size() > limit_) {
-    piece.set(piece.data(), limit_);
-  }
-
-  return piece;
+  StringPiece piece = source_->Peek();
+  return StringPiece(piece.data(), std::min(piece.size(), limit_));
 }
 
 void LimitByteSource::Skip(size_t n) {
index 86510d1..c7a48de 100644 (file)
@@ -56,8 +56,9 @@
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/stringpiece.h>
 
+#include <google/protobuf/port_def.inc>
+
 class CordByteSink;
-class MemBlock;
 
 namespace google {
 namespace protobuf {
@@ -74,7 +75,7 @@ namespace strings {
 //   sink->Append(my_data.data(), my_data.size());
 //   sink->Flush();
 //
-class LIBPROTOBUF_EXPORT ByteSink {
+class PROTOBUF_EXPORT ByteSink {
  public:
   ByteSink() {}
   virtual ~ByteSink() {}
@@ -82,7 +83,7 @@ class LIBPROTOBUF_EXPORT ByteSink {
   // Appends the "n" bytes starting at "bytes".
   virtual void Append(const char* bytes, size_t n) = 0;
 
-  // Flushes internal buffers. The default implemenation does nothing. ByteSink
+  // Flushes internal buffers. The default implementation does nothing. ByteSink
   // subclasses may use internal buffers that require calling Flush() at the end
   // of the stream.
   virtual void Flush();
@@ -103,7 +104,7 @@ class LIBPROTOBUF_EXPORT ByteSink {
 //     source->Skip(data.length());
 //   }
 //
-class LIBPROTOBUF_EXPORT ByteSource {
+class PROTOBUF_EXPORT ByteSource {
  public:
   ByteSource() {}
   virtual ~ByteSource() {}
@@ -159,10 +160,10 @@ class LIBPROTOBUF_EXPORT ByteSource {
 //   sink.Append("hi", 2);    // OK
 //   sink.Append(data, 100);  // WOOPS! Overflows buf[10].
 //
-class LIBPROTOBUF_EXPORT UncheckedArrayByteSink : public ByteSink {
+class PROTOBUF_EXPORT UncheckedArrayByteSink : public ByteSink {
  public:
   explicit UncheckedArrayByteSink(char* dest) : dest_(dest) {}
-  virtual void Append(const char* data, size_t n);
+  virtual void Append(const char* data, size_t n) override;
 
   // Returns the current output pointer so that a caller can see how many bytes
   // were produced.
@@ -187,10 +188,10 @@ class LIBPROTOBUF_EXPORT UncheckedArrayByteSink : public ByteSink {
 //   sink.Append("hi", 2);    // OK
 //   sink.Append(data, 100);  // Will only write 8 more bytes
 //
-class LIBPROTOBUF_EXPORT CheckedArrayByteSink : public ByteSink {
+class PROTOBUF_EXPORT CheckedArrayByteSink : public ByteSink {
  public:
   CheckedArrayByteSink(char* outbuf, size_t capacity);
-  virtual void Append(const char* bytes, size_t n);
+  virtual void Append(const char* bytes, size_t n) override;
 
   // Returns the number of bytes actually written to the sink.
   size_t NumberOfBytesWritten() const { return size_; }
@@ -223,11 +224,11 @@ class LIBPROTOBUF_EXPORT CheckedArrayByteSink : public ByteSink {
 //   const char* buf = sink.GetBuffer();  // Ownership transferred
 //   delete[] buf;
 //
-class LIBPROTOBUF_EXPORT GrowingArrayByteSink : public strings::ByteSink {
+class PROTOBUF_EXPORT GrowingArrayByteSink : public strings::ByteSink {
  public:
   explicit GrowingArrayByteSink(size_t estimated_size);
   virtual ~GrowingArrayByteSink();
-  virtual void Append(const char* bytes, size_t n);
+  virtual void Append(const char* bytes, size_t n) override;
 
   // Returns the allocated buffer, and sets nbytes to its size. The caller takes
   // ownership of the buffer and must delete it with delete[].
@@ -253,13 +254,13 @@ class LIBPROTOBUF_EXPORT GrowingArrayByteSink : public strings::ByteSink {
 //   sink.Append("World", 5);
 //   assert(dest == "Hello World");
 //
-class LIBPROTOBUF_EXPORT StringByteSink : public ByteSink {
+class PROTOBUF_EXPORT StringByteSink : public ByteSink {
  public:
-  explicit StringByteSink(string* dest) : dest_(dest) {}
-  virtual void Append(const char* data, size_t n);
+  explicit StringByteSink(std::string* dest) : dest_(dest) {}
+  virtual void Append(const char* data, size_t n) override;
 
  private:
-  string* dest_;
+  std::string* dest_;
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringByteSink);
 };
 
@@ -270,10 +271,10 @@ class LIBPROTOBUF_EXPORT StringByteSink : public ByteSink {
 //   NullByteSink sink;
 //   sink.Append(data, data.size());  // All data ignored.
 //
-class LIBPROTOBUF_EXPORT NullByteSink : public ByteSink {
+class PROTOBUF_EXPORT NullByteSink : public ByteSink {
  public:
   NullByteSink() {}
-  virtual void Append(const char *data, size_t n) {}
+  void Append(const char* /*data*/, size_t /*n*/) override {}
 
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(NullByteSink);
@@ -292,13 +293,13 @@ class LIBPROTOBUF_EXPORT NullByteSink : public ByteSink {
 //   assert(source.Available() == 5);
 //   assert(source.Peek() == "Hello");
 //
-class LIBPROTOBUF_EXPORT ArrayByteSource : public ByteSource {
+class PROTOBUF_EXPORT ArrayByteSource : public ByteSource {
  public:
   explicit ArrayByteSource(StringPiece s) : input_(s) {}
 
-  virtual size_t Available() const;
-  virtual StringPiece Peek();
-  virtual void Skip(size_t n);
+  virtual size_t Available() const override;
+  virtual StringPiece Peek() override;
+  virtual void Skip(size_t n) override;
 
  private:
   StringPiece   input_;
@@ -323,18 +324,18 @@ class LIBPROTOBUF_EXPORT ArrayByteSource : public ByteSource {
 //   assert(limit.Available() == 5);
 //   assert(limit.Peek() == "Hello");
 //
-class LIBPROTOBUF_EXPORT LimitByteSource : public ByteSource {
+class PROTOBUF_EXPORT LimitByteSource : public ByteSource {
  public:
   // Returns at most "limit" bytes from "source".
   LimitByteSource(ByteSource* source, size_t limit);
 
-  virtual size_t Available() const;
-  virtual StringPiece Peek();
-  virtual void Skip(size_t n);
+  virtual size_t Available() const override;
+  virtual StringPiece Peek() override;
+  virtual void Skip(size_t n) override;
 
   // We override CopyTo so that we can forward to the underlying source, in
   // case it has an efficient implementation of CopyTo.
-  virtual void CopyTo(ByteSink* sink, size_t n);
+  virtual void CopyTo(ByteSink* sink, size_t n) override;
 
  private:
   ByteSource* source_;
@@ -345,4 +346,6 @@ class LIBPROTOBUF_EXPORT LimitByteSource : public ByteSource {
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_BYTESTREAM_H_
index 9ec0497..43d546d 100644 (file)
@@ -1,8 +1,11 @@
 #ifndef GOOGLE_PROTOBUF_STUBS_CALLBACK_H_
 #define GOOGLE_PROTOBUF_STUBS_CALLBACK_H_
 
+#include <type_traits>
+
 #include <google/protobuf/stubs/macros.h>
-#include <google/protobuf/stubs/type_traits.h>
+
+#include <google/protobuf/port_def.inc>
 
 // ===================================================================
 // emulates google3/base/callback.h
@@ -59,15 +62,15 @@ namespace protobuf {
 // Note that NewCallback() is a bit touchy regarding argument types.  Generally,
 // the values you provide for the parameter bindings must exactly match the
 // types accepted by the callback function.  For example:
-//   void Foo(string s);
+//   void Foo(std::string s);
 //   NewCallback(&Foo, "foo");          // WON'T WORK:  const char* != string
-//   NewCallback(&Foo, string("foo"));  // WORKS
+//   NewCallback(&Foo, std::string("foo"));  // WORKS
 // Also note that the arguments cannot be references:
-//   void Foo(const string& s);
-//   string my_str;
-//   NewCallback(&Foo, my_str);  // WON'T WORK:  Can't use referecnes.
+//   void Foo(const std::string& s);
+//   std::string my_str;
+//   NewCallback(&Foo, my_str);  // WON'T WORK:  Can't use references.
 // However, correctly-typed pointers will work just fine.
-class LIBPROTOBUF_EXPORT Closure {
+class PROTOBUF_EXPORT Closure {
  public:
   Closure() {}
   virtual ~Closure();
@@ -90,8 +93,8 @@ class ResultCallback {
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ResultCallback);
 };
 
-template<typename R, typename A1>
-class LIBPROTOBUF_EXPORT ResultCallback1 {
+template <typename R, typename A1>
+class PROTOBUF_EXPORT ResultCallback1 {
  public:
   ResultCallback1() {}
   virtual ~ResultCallback1() {}
@@ -102,8 +105,8 @@ class LIBPROTOBUF_EXPORT ResultCallback1 {
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ResultCallback1);
 };
 
-template<typename R, typename A1, typename A2>
-class LIBPROTOBUF_EXPORT ResultCallback2 {
+template <typename R, typename A1, typename A2>
+class PROTOBUF_EXPORT ResultCallback2 {
  public:
   ResultCallback2() {}
   virtual ~ResultCallback2() {}
@@ -116,7 +119,7 @@ class LIBPROTOBUF_EXPORT ResultCallback2 {
 
 namespace internal {
 
-class LIBPROTOBUF_EXPORT FunctionClosure0 : public Closure {
+class PROTOBUF_EXPORT FunctionClosure0 : public Closure {
  public:
   typedef void (*FunctionType)();
 
@@ -124,7 +127,7 @@ class LIBPROTOBUF_EXPORT FunctionClosure0 : public Closure {
     : function_(function), self_deleting_(self_deleting) {}
   ~FunctionClosure0();
 
-  void Run() {
+  void Run() override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     function_();
     if (needs_delete) delete this;
@@ -144,7 +147,7 @@ class MethodClosure0 : public Closure {
     : object_(object), method_(method), self_deleting_(self_deleting) {}
   ~MethodClosure0() {}
 
-  void Run() {
+  void Run() override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     (object_->*method_)();
     if (needs_delete) delete this;
@@ -167,7 +170,7 @@ class FunctionClosure1 : public Closure {
       arg1_(arg1) {}
   ~FunctionClosure1() {}
 
-  void Run() {
+  void Run() override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     function_(arg1_);
     if (needs_delete) delete this;
@@ -190,7 +193,7 @@ class MethodClosure1 : public Closure {
       arg1_(arg1) {}
   ~MethodClosure1() {}
 
-  void Run() {
+  void Run() override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     (object_->*method_)(arg1_);
     if (needs_delete) delete this;
@@ -214,7 +217,7 @@ class FunctionClosure2 : public Closure {
       arg1_(arg1), arg2_(arg2) {}
   ~FunctionClosure2() {}
 
-  void Run() {
+  void Run() override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     function_(arg1_, arg2_);
     if (needs_delete) delete this;
@@ -238,7 +241,7 @@ class MethodClosure2 : public Closure {
       arg1_(arg1), arg2_(arg2) {}
   ~MethodClosure2() {}
 
-  void Run() {
+  void Run() override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     (object_->*method_)(arg1_, arg2_);
     if (needs_delete) delete this;
@@ -261,7 +264,7 @@ class FunctionResultCallback_0_0 : public ResultCallback<R> {
       : function_(function), self_deleting_(self_deleting) {}
   ~FunctionResultCallback_0_0() {}
 
-  R Run() {
+  R Run() override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     R result = function_();
     if (needs_delete) delete this;
@@ -283,7 +286,7 @@ class FunctionResultCallback_1_0 : public ResultCallback<R> {
       : function_(function), self_deleting_(self_deleting), p1_(p1) {}
   ~FunctionResultCallback_1_0() {}
 
-  R Run() {
+  R Run() override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     R result = function_(p1_);
     if (needs_delete) delete this;
@@ -305,7 +308,7 @@ class FunctionResultCallback_0_1 : public ResultCallback1<R, Arg1> {
       : function_(function), self_deleting_(self_deleting) {}
   ~FunctionResultCallback_0_1() {}
 
-  R Run(Arg1 a1) {
+  R Run(Arg1 a1) override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     R result = function_(a1);
     if (needs_delete) delete this;
@@ -327,7 +330,7 @@ class FunctionResultCallback_1_1 : public ResultCallback1<R, A1> {
       : function_(function), self_deleting_(self_deleting), p1_(p1) {}
   ~FunctionResultCallback_1_1() {}
 
-  R Run(A1 a1) {
+  R Run(A1 a1) override {
     bool needs_delete = self_deleting_;  // read in case callback deletes
     R result = function_(p1_, a1);
     if (needs_delete) delete this;
@@ -342,7 +345,7 @@ class FunctionResultCallback_1_1 : public ResultCallback1<R, A1> {
 
 template <typename T>
 struct InternalConstRef {
-  typedef typename remove_reference<T>::type base_type;
+  typedef typename std::remove_reference<T>::type base_type;
   typedef const base_type& type;
 };
 
@@ -370,12 +373,12 @@ class MethodResultCallback_0_0 : public ResultCallback<R> {
 };
 
 template <typename R, typename T, typename P1, typename P2, typename P3,
-          typename P4, typename P5, typename A1, typename A2>
-class MethodResultCallback_5_2 : public ResultCallback2<R, A1, A2> {
+          typename P4, typename P5, typename P6, typename A1, typename A2>
+class MethodResultCallback_6_2 : public ResultCallback2<R, A1, A2> {
  public:
-  typedef R (T::*MethodType)(P1, P2, P3, P4, P5, A1, A2);
-  MethodResultCallback_5_2(T* object, MethodType method, bool self_deleting,
-                           P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
+  typedef R (T::*MethodType)(P1, P2, P3, P4, P5, P6, A1, A2);
+  MethodResultCallback_6_2(T* object, MethodType method, bool self_deleting,
+                           P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
       : object_(object),
         method_(method),
         self_deleting_(self_deleting),
@@ -383,12 +386,13 @@ class MethodResultCallback_5_2 : public ResultCallback2<R, A1, A2> {
         p2_(p2),
         p3_(p3),
         p4_(p4),
-        p5_(p5) {}
-  ~MethodResultCallback_5_2() {}
+        p5_(p5),
+        p6_(p6) {}
+  ~MethodResultCallback_6_2() {}
 
-  R Run(A1 a1, A2 a2) {
+  R Run(A1 a1, A2 a2) override {
     bool needs_delete = self_deleting_;
-    R result = (object_->*method_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
+    R result = (object_->*method_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
     if (needs_delete) delete this;
     return result;
   }
@@ -397,11 +401,12 @@ class MethodResultCallback_5_2 : public ResultCallback2<R, A1, A2> {
   T* object_;
   MethodType method_;
   bool self_deleting_;
-  typename remove_reference<P1>::type p1_;
-  typename remove_reference<P2>::type p2_;
-  typename remove_reference<P3>::type p3_;
-  typename remove_reference<P4>::type p4_;
-  typename remove_reference<P5>::type p5_;
+  typename std::remove_reference<P1>::type p1_;
+  typename std::remove_reference<P2>::type p2_;
+  typename std::remove_reference<P3>::type p3_;
+  typename std::remove_reference<P4>::type p4_;
+  typename std::remove_reference<P5>::type p5_;
+  typename std::remove_reference<P6>::type p6_;
 };
 
 }  // namespace internal
@@ -550,27 +555,29 @@ inline ResultCallback<R>* NewPermanentCallback(
   return new internal::MethodResultCallback_0_0<R, T1>(object, function, false);
 }
 
-// See MethodResultCallback_5_2
+// See MethodResultCallback_6_2
 template <typename R, typename T, typename P1, typename P2, typename P3,
-          typename P4, typename P5, typename A1, typename A2>
+          typename P4, typename P5, typename P6, typename A1, typename A2>
 inline ResultCallback2<R, A1, A2>* NewPermanentCallback(
-    T* object, R (T::*function)(P1, P2, P3, P4, P5, A1, A2),
+    T* object, R (T::*function)(P1, P2, P3, P4, P5, P6, A1, A2),
     typename internal::InternalConstRef<P1>::type p1,
     typename internal::InternalConstRef<P2>::type p2,
     typename internal::InternalConstRef<P3>::type p3,
     typename internal::InternalConstRef<P4>::type p4,
-    typename internal::InternalConstRef<P5>::type p5) {
-  return new internal::MethodResultCallback_5_2<R, T, P1, P2, P3, P4, P5, A1,
-                                                A2>(object, function, false, p1,
-                                                    p2, p3, p4, p5);
+    typename internal::InternalConstRef<P5>::type p5,
+    typename internal::InternalConstRef<P6>::type p6) {
+  return new internal::MethodResultCallback_6_2<R, T, P1, P2, P3, P4, P5, P6,
+                                                A1, A2>(object, function, false,
+                                                        p1, p2, p3, p4, p5, p6);
 }
 
 // A function which does nothing.  Useful for creating no-op callbacks, e.g.:
 //   Closure* nothing = NewCallback(&DoNothing);
-void LIBPROTOBUF_EXPORT DoNothing();
-
+void PROTOBUF_EXPORT DoNothing();
 
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_CALLBACK_H_
index be65284..ad29dac 100644 (file)
 #define GOOGLE_PROTOBUF_CASTS_H__
 
 #include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/type_traits.h>
+
+#include <google/protobuf/port_def.inc>
+#include <type_traits>
 
 namespace google {
 namespace protobuf {
 namespace internal {
+
 // Use implicit_cast as a safe version of static_cast or const_cast
 // for upcasting in the type hierarchy (i.e. casting a pointer to Foo
 // to a pointer to SuperclassOfFoo or casting a pointer to Foo to
@@ -44,7 +47,7 @@ namespace internal {
 // When you use implicit_cast, the compiler checks that the cast is safe.
 // Such explicit implicit_casts are necessary in surprisingly many
 // situations where C++ demands an exact type match instead of an
-// argument type convertable to a target type.
+// argument type convertible to a target type.
 //
 // The From type can be inferred, so the preferred syntax for using
 // implicit_cast is the same as for static_cast etc.:
@@ -87,15 +90,15 @@ inline To down_cast(From* f) {                   // so we only accept pointers
     implicit_cast<From*, To>(0);
   }
 
-#if !defined(NDEBUG) && !defined(GOOGLE_PROTOBUF_NO_RTTI)
-  assert(f == NULL || dynamic_cast<To>(f) != NULL);  // RTTI: debug mode only!
+#if !defined(NDEBUG) && PROTOBUF_RTTI
+  assert(f == nullptr || dynamic_cast<To>(f) != nullptr);  // RTTI: debug mode only!
 #endif
   return static_cast<To>(f);
 }
 
 template<typename To, typename From>    // use like this: down_cast<T&>(foo);
 inline To down_cast(From& f) {
-  typedef typename remove_reference<To>::type* ToAsPointer;
+  typedef typename std::remove_reference<To>::type* ToAsPointer;
   // Ensures that To is a sub-type of From *.  This test is here only
   // for compile-time type checking, and has no overhead in an
   // optimized build at run-time, as it will be optimized away
@@ -104,17 +107,16 @@ inline To down_cast(From& f) {
     implicit_cast<From*, ToAsPointer>(0);
   }
 
-#if !defined(NDEBUG) && !defined(GOOGLE_PROTOBUF_NO_RTTI)
+#if !defined(NDEBUG) && PROTOBUF_RTTI
   // RTTI: debug mode only!
-  assert(dynamic_cast<ToAsPointer>(&f) != NULL);
+  assert(dynamic_cast<ToAsPointer>(&f) != nullptr);
 #endif
   return *static_cast<ToAsPointer>(&f);
 }
 
 template<typename To, typename From>
 inline To bit_cast(const From& from) {
-  GOOGLE_COMPILE_ASSERT(sizeof(From) == sizeof(To),
-                        bit_cast_with_different_sizes);
+  static_assert(sizeof(From) == sizeof(To), "bit_cast_with_different_sizes");
   To dest;
   memcpy(&dest, &from, sizeof(dest));
   return dest;
@@ -130,4 +132,7 @@ using internal::bit_cast;
 
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_CASTS_H__
index 7382216..82d4653 100644 (file)
 
 // Author: kenton@google.com (Kenton Varda)
 
-#include <google/protobuf/message_lite.h>  // TODO(gerbens) ideally remove this.
 #include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/stubs/status.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/int128.h>
+
+#include <atomic>
 #include <errno.h>
 #include <sstream>
 #include <stdio.h>
 #include <vector>
 
 #ifdef _WIN32
+#ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN  // We only need minimal includes
+#endif
 #include <windows.h>
 #define snprintf _snprintf    // see comment in strutil.cc
-#elif defined(HAVE_PTHREAD)
-#include <pthread.h>
-#else
-#error "No suitable threading library available."
 #endif
 #if defined(__ANDROID__)
 #include <android/log.h>
 #endif
 
+#include <google/protobuf/stubs/callback.h>
+#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/stubs/status.h>
+#include <google/protobuf/stubs/stringpiece.h>
+#include <google/protobuf/stubs/strutil.h>
+#include <google/protobuf/stubs/int128.h>
+
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 
@@ -88,7 +92,7 @@ void VerifyVersion(int headerVersion,
   }
 }
 
-string VersionString(int version) {
+std::string VersionString(int version) {
   int major = version / 1000000;
   int minor = (version / 1000) % 1000;
   int micro = version % 1000;
@@ -119,7 +123,7 @@ namespace internal {
 
 #if defined(__ANDROID__)
 inline void DefaultLogHandler(LogLevel level, const char* filename, int line,
-                              const string& message) {
+                              const std::string& message) {
   if (level < GOOGLE_PROTOBUF_MIN_LOG_LEVEL) {
     return;
   }
@@ -154,7 +158,7 @@ inline void DefaultLogHandler(LogLevel level, const char* filename, int line,
 
 #else
 void DefaultLogHandler(LogLevel level, const char* filename, int line,
-                       const string& message) {
+                       const std::string& message) {
   if (level < GOOGLE_PROTOBUF_MIN_LOG_LEVEL) {
     return;
   }
@@ -169,29 +173,14 @@ void DefaultLogHandler(LogLevel level, const char* filename, int line,
 #endif
 
 void NullLogHandler(LogLevel /* level */, const char* /* filename */,
-                    int /* line */, const string& /* message */) {
+                    int /* line */, const std::string& /* message */) {
   // Nothing.
 }
 
 static LogHandler* log_handler_ = &DefaultLogHandler;
-static int log_silencer_count_ = 0;
+static std::atomic<int> log_silencer_count_ = ATOMIC_VAR_INIT(0);
 
-static Mutex* log_silencer_count_mutex_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(log_silencer_count_init_);
-
-void DeleteLogSilencerCount() {
-  delete log_silencer_count_mutex_;
-  log_silencer_count_mutex_ = NULL;
-}
-void InitLogSilencerCount() {
-  log_silencer_count_mutex_ = new Mutex;
-  OnShutdown(&DeleteLogSilencerCount);
-}
-void InitLogSilencerCountOnce() {
-  GoogleOnceInit(&log_silencer_count_init_, &InitLogSilencerCount);
-}
-
-LogMessage& LogMessage::operator<<(const string& value) {
+LogMessage& LogMessage::operator<<(const std::string& value) {
   message_ += value;
   return *this;
 }
@@ -206,8 +195,7 @@ LogMessage& LogMessage::operator<<(const StringPiece& value) {
   return *this;
 }
 
-LogMessage& LogMessage::operator<<(
-    const ::google::protobuf::util::Status& status) {
+LogMessage& LogMessage::operator<<(const util::Status& status) {
   message_ += status.ToString();
   return *this;
 }
@@ -219,32 +207,29 @@ LogMessage& LogMessage::operator<<(const uint128& value) {
   return *this;
 }
 
-// Since this is just for logging, we don't care if the current locale changes
-// the results -- in fact, we probably prefer that.  So we use snprintf()
-// instead of Simple*toa().
+LogMessage& LogMessage::operator<<(char value) {
+  return *this << StringPiece(&value, 1);
+}
+
+LogMessage& LogMessage::operator<<(void* value) {
+  StrAppend(&message_, strings::Hex(reinterpret_cast<uintptr_t>(value)));
+  return *this;
+}
+
 #undef DECLARE_STREAM_OPERATOR
-#define DECLARE_STREAM_OPERATOR(TYPE, FORMAT)                       \
-  LogMessage& LogMessage::operator<<(TYPE value) {                  \
-    /* 128 bytes should be big enough for any of the primitive */   \
-    /* values which we print with this, but well use snprintf() */  \
-    /* anyway to be extra safe. */                                  \
-    char buffer[128];                                               \
-    snprintf(buffer, sizeof(buffer), FORMAT, value);                \
-    /* Guard against broken MSVC snprintf(). */                     \
-    buffer[sizeof(buffer)-1] = '\0';                                \
-    message_ += buffer;                                             \
-    return *this;                                                   \
+#define DECLARE_STREAM_OPERATOR(TYPE)              \
+  LogMessage& LogMessage::operator<<(TYPE value) { \
+    StrAppend(&message_, value);                   \
+    return *this;                                  \
   }
 
-DECLARE_STREAM_OPERATOR(char         , "%c" )
-DECLARE_STREAM_OPERATOR(int          , "%d" )
-DECLARE_STREAM_OPERATOR(unsigned int , "%u" )
-DECLARE_STREAM_OPERATOR(long         , "%ld")
-DECLARE_STREAM_OPERATOR(unsigned long, "%lu")
-DECLARE_STREAM_OPERATOR(double       , "%g" )
-DECLARE_STREAM_OPERATOR(void*        , "%p" )
-DECLARE_STREAM_OPERATOR(long long         , "%" GOOGLE_LL_FORMAT "d")
-DECLARE_STREAM_OPERATOR(unsigned long long, "%" GOOGLE_LL_FORMAT "u")
+DECLARE_STREAM_OPERATOR(int)
+DECLARE_STREAM_OPERATOR(unsigned int)
+DECLARE_STREAM_OPERATOR(long)           // NOLINT(runtime/int)
+DECLARE_STREAM_OPERATOR(unsigned long)  // NOLINT(runtime/int)
+DECLARE_STREAM_OPERATOR(double)
+DECLARE_STREAM_OPERATOR(long long)           // NOLINT(runtime/int)
+DECLARE_STREAM_OPERATOR(unsigned long long)  // NOLINT(runtime/int)
 #undef DECLARE_STREAM_OPERATOR
 
 LogMessage::LogMessage(LogLevel level, const char* filename, int line)
@@ -255,8 +240,6 @@ void LogMessage::Finish() {
   bool suppress = false;
 
   if (level_ != LOGLEVEL_FATAL) {
-    InitLogSilencerCountOnce();
-    MutexLock lock(log_silencer_count_mutex_);
     suppress = log_silencer_count_ > 0;
   }
 
@@ -282,9 +265,9 @@ void LogFinisher::operator=(LogMessage& other) {
 LogHandler* SetLogHandler(LogHandler* new_func) {
   LogHandler* old = internal::log_handler_;
   if (old == &internal::NullLogHandler) {
-    old = NULL;
+    old = nullptr;
   }
-  if (new_func == NULL) {
+  if (new_func == nullptr) {
     internal::log_handler_ = &internal::NullLogHandler;
   } else {
     internal::log_handler_ = new_func;
@@ -293,14 +276,10 @@ LogHandler* SetLogHandler(LogHandler* new_func) {
 }
 
 LogSilencer::LogSilencer() {
-  internal::InitLogSilencerCountOnce();
-  MutexLock lock(internal::log_silencer_count_mutex_);
   ++internal::log_silencer_count_;
 };
 
 LogSilencer::~LogSilencer() {
-  internal::InitLogSilencerCountOnce();
-  MutexLock lock(internal::log_silencer_count_mutex_);
   --internal::log_silencer_count_;
 };
 
@@ -314,91 +293,11 @@ namespace internal { FunctionClosure0::~FunctionClosure0() {} }
 void DoNothing() {}
 
 // ===================================================================
-// emulates google3/base/mutex.cc
-
-#ifdef _WIN32
-
-struct Mutex::Internal {
-  CRITICAL_SECTION mutex;
-#ifndef NDEBUG
-  // Used only to implement AssertHeld().
-  DWORD thread_id;
-#endif
-};
-
-Mutex::Mutex()
-  : mInternal(new Internal) {
-  InitializeCriticalSection(&mInternal->mutex);
-}
-
-Mutex::~Mutex() {
-  DeleteCriticalSection(&mInternal->mutex);
-  delete mInternal;
-}
-
-void Mutex::Lock() {
-  EnterCriticalSection(&mInternal->mutex);
-#ifndef NDEBUG
-  mInternal->thread_id = GetCurrentThreadId();
-#endif
-}
-
-void Mutex::Unlock() {
-#ifndef NDEBUG
-  mInternal->thread_id = 0;
-#endif
-  LeaveCriticalSection(&mInternal->mutex);
-}
-
-void Mutex::AssertHeld() {
-#ifndef NDEBUG
-  GOOGLE_DCHECK_EQ(mInternal->thread_id, GetCurrentThreadId());
-#endif
-}
-
-#elif defined(HAVE_PTHREAD)
-
-struct Mutex::Internal {
-  pthread_mutex_t mutex;
-};
-
-Mutex::Mutex()
-  : mInternal(new Internal) {
-  pthread_mutex_init(&mInternal->mutex, NULL);
-}
-
-Mutex::~Mutex() {
-  pthread_mutex_destroy(&mInternal->mutex);
-  delete mInternal;
-}
-
-void Mutex::Lock() {
-  int result = pthread_mutex_lock(&mInternal->mutex);
-  if (result != 0) {
-    GOOGLE_LOG(FATAL) << "pthread_mutex_lock: " << strerror(result);
-  }
-}
-
-void Mutex::Unlock() {
-  int result = pthread_mutex_unlock(&mInternal->mutex);
-  if (result != 0) {
-    GOOGLE_LOG(FATAL) << "pthread_mutex_unlock: " << strerror(result);
-  }
-}
-
-void Mutex::AssertHeld() {
-  // pthreads dosn't provide a way to check which thread holds the mutex.
-  // TODO(kenton):  Maybe keep track of locking thread ID like with WIN32?
-}
-
-#endif
-
-// ===================================================================
 // emulates google3/util/endian/endian.h
 //
 // TODO(xiaofeng): PROTOBUF_LITTLE_ENDIAN is unfortunately defined in
 // google/protobuf/io/coded_stream.h and therefore can not be used here.
-// Maybe move that macro definition here in the furture.
+// Maybe move that macro definition here in the future.
 uint32 ghtonl(uint32 x) {
   union {
     uint32 result;
@@ -411,76 +310,6 @@ uint32 ghtonl(uint32 x) {
   return result;
 }
 
-// ===================================================================
-// Shutdown support.
-
-namespace internal {
-
-typedef void OnShutdownFunc();
-struct ShutdownData {
-  ~ShutdownData() {
-    for (int i = 0; i < functions.size(); i++) {
-      functions[i]();
-    }
-    for (int i = 0; i < strings.size(); i++) {
-      strings[i]->~string();
-    }
-    for (int i = 0; i < messages.size(); i++) {
-      messages[i]->~MessageLite();
-    }
-  }
-
-  vector<void (*)()> functions;
-  vector<const std::string*> strings;
-  vector<const MessageLite*> messages;
-  Mutex mutex;
-};
-
-ShutdownData* shutdown_data = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(shutdown_functions_init);
-
-void InitShutdownFunctions() {
-  shutdown_data = new ShutdownData;
-}
-
-inline void InitShutdownFunctionsOnce() {
-  GoogleOnceInit(&shutdown_functions_init, &InitShutdownFunctions);
-}
-
-void OnShutdown(void (*func)()) {
-  InitShutdownFunctionsOnce();
-  MutexLock lock(&shutdown_data->mutex);
-  shutdown_data->functions.push_back(func);
-}
-
-void OnShutdownDestroyString(const std::string* ptr) {
-  InitShutdownFunctionsOnce();
-  MutexLock lock(&shutdown_data->mutex);
-  shutdown_data->strings.push_back(ptr);
-}
-
-void OnShutdownDestroyMessage(const void* ptr) {
-  InitShutdownFunctionsOnce();
-  MutexLock lock(&shutdown_data->mutex);
-  shutdown_data->messages.push_back(static_cast<const MessageLite*>(ptr));
-}
-
-}  // namespace internal
-
-void ShutdownProtobufLibrary() {
-  internal::InitShutdownFunctionsOnce();
-
-  // We don't need to lock shutdown_functions_mutex because it's up to the
-  // caller to make sure that no one is using the library before this is
-  // called.
-
-  // Make it safe to call this multiple times.
-  if (internal::shutdown_data == NULL) return;
-
-  delete internal::shutdown_data;
-  internal::shutdown_data = NULL;
-}
-
 #if PROTOBUF_USE_EXCEPTIONS
 FatalException::~FatalException() throw() {}
 
@@ -491,3 +320,5 @@ const char* FatalException::what() const throw() {
 
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index d11b810..c32503a 100644 (file)
 #include <algorithm>
 #include <iostream>
 #include <map>
+#include <memory>
 #include <set>
 #include <string>
 #include <vector>
 
-#include <google/protobuf/stubs/port.h>
 #include <google/protobuf/stubs/macros.h>
 #include <google/protobuf/stubs/platform_macros.h>
-
-// TODO(liujisi): Remove the following includes after the include clean-up.
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/scoped_ptr.h>
-#include <google/protobuf/stubs/mutex.h>
-#include <google/protobuf/stubs/callback.h>
+#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/stringpiece.h>
 
 #ifndef PROTOBUF_USE_EXCEPTIONS
 #if defined(_MSC_VER) && defined(_CPPUNWIND)
 #include <pthread.h>
 #endif
 
-#if defined(_WIN32) && defined(GetMessage)
-// Allow GetMessage to be used as a valid method name in protobuf classes.
-// windows.h defines GetMessage() as a macro.  Let's re-define it as an inline
-// function.  The inline function should be equivalent for C++ users.
-inline BOOL GetMessage_Win32(
-    LPMSG lpMsg, HWND hWnd,
-    UINT wMsgFilterMin, UINT wMsgFilterMax) {
-  return GetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
-}
-#undef GetMessage
-inline BOOL GetMessage(
-    LPMSG lpMsg, HWND hWnd,
-    UINT wMsgFilterMin, UINT wMsgFilterMax) {
-  return GetMessage_Win32(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
-}
-#endif
+#include <google/protobuf/port_def.inc>
 
 namespace std {}
 
@@ -101,35 +82,31 @@ namespace internal {
 
 // The current version, represented as a single integer to make comparison
 // easier:  major * 10^6 + minor * 10^3 + micro
-#define GOOGLE_PROTOBUF_VERSION 3005001
+#define GOOGLE_PROTOBUF_VERSION 3019001
 
 // A suffix string for alpha, beta or rc releases. Empty for stable releases.
 #define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
 
-// The minimum library version which works with the current version of the
-// headers.
-#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3005000
-
 // The minimum header version which works with the current version of
 // the library.  This constant should only be used by protoc's C++ code
 // generator.
-static const int kMinHeaderVersionForLibrary = 3005000;
+static const int kMinHeaderVersionForLibrary = 3019000;
 
 // The minimum protoc version which works with the current version of the
 // headers.
-#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3005000
+#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3019000
 
 // The minimum header version which works with the current version of
 // protoc.  This constant should only be used in VerifyVersion().
-static const int kMinHeaderVersionForProtoc = 3005000;
+static const int kMinHeaderVersionForProtoc = 3019000;
 
 // Verifies that the headers and libraries are compatible.  Use the macro
 // below to call this.
-void LIBPROTOBUF_EXPORT VerifyVersion(int headerVersion, int minLibraryVersion,
-                                      const char* filename);
+void PROTOBUF_EXPORT VerifyVersion(int headerVersion, int minLibraryVersion,
+                                   const char* filename);
 
 // Converts a numeric version number to a string.
-std::string LIBPROTOBUF_EXPORT VersionString(int version);
+std::string PROTOBUF_EXPORT VersionString(int version);
 
 }  // namespace internal
 
@@ -146,19 +123,18 @@ std::string LIBPROTOBUF_EXPORT VersionString(int version);
 // ===================================================================
 // from google3/util/utf8/public/unilib.h
 
-class StringPiece;
 namespace internal {
 
 // Checks if the buffer contains structurally-valid UTF-8.  Implemented in
 // structurally_valid.cc.
-LIBPROTOBUF_EXPORT bool IsStructurallyValidUTF8(const char* buf, int len);
+PROTOBUF_EXPORT bool IsStructurallyValidUTF8(const char* buf, int len);
 
-inline bool IsStructurallyValidUTF8(const std::string& str) {
+inline bool IsStructurallyValidUTF8(StringPiece str) {
   return IsStructurallyValidUTF8(str.data(), static_cast<int>(str.length()));
 }
 
-// Returns initial number of bytes of structually valid UTF-8.
-LIBPROTOBUF_EXPORT int UTF8SpnStructurallyValid(const StringPiece& str);
+// Returns initial number of bytes of structurally valid UTF-8.
+PROTOBUF_EXPORT int UTF8SpnStructurallyValid(StringPiece str);
 
 // Coerce UTF-8 byte string in src_str to be
 // a structurally-valid equal-length string by selectively
@@ -172,38 +148,24 @@ LIBPROTOBUF_EXPORT int UTF8SpnStructurallyValid(const StringPiece& str);
 //
 // Optimized for: all structurally valid and no byte copying is done.
 //
-LIBPROTOBUF_EXPORT char* UTF8CoerceToStructurallyValid(
-    const StringPiece& str, char* dst, char replace_char);
+PROTOBUF_EXPORT char* UTF8CoerceToStructurallyValid(StringPiece str, char* dst,
+                                                    char replace_char);
 
 }  // namespace internal
 
-
-// ===================================================================
-// Shutdown support.
-
-// Shut down the entire protocol buffers library, deleting all static-duration
-// objects allocated by the library or by generated .pb.cc files.
-//
-// There are two reasons you might want to call this:
-// * You use a draconian definition of "memory leak" in which you expect
-//   every single malloc() to have a corresponding free(), even for objects
-//   which live until program exit.
-// * You are writing a dynamically-loaded library which needs to clean up
-//   after itself when the library is unloaded.
-//
-// It is safe to call this multiple times.  However, it is not safe to use
-// any other part of the protocol buffers library after
-// ShutdownProtobufLibrary() has been called.
-LIBPROTOBUF_EXPORT void ShutdownProtobufLibrary();
+// This lives in message_lite.h now, but we leave this here for any users that
+// #include common.h and not message_lite.h.
+PROTOBUF_EXPORT void ShutdownProtobufLibrary();
 
 namespace internal {
 
-// Register a function to be called when ShutdownProtocolBuffers() is called.
-LIBPROTOBUF_EXPORT void OnShutdown(void (*func)());
-// Destroy the string (call string destructor)
-LIBPROTOBUF_EXPORT void OnShutdownDestroyString(const std::string* ptr);
-// Destroy (not delete) the message
-LIBPROTOBUF_EXPORT void OnShutdownDestroyMessage(const void* ptr);
+// Strongly references the given variable such that the linker will be forced
+// to pull in this variable's translation unit.
+template <typename T>
+void StrongReference(const T& var) {
+  auto volatile unused = &var;
+  (void)&unused;  // Use address to avoid an extra load of "unused".
+}
 
 }  // namespace internal
 
@@ -214,7 +176,7 @@ class FatalException : public std::exception {
       : filename_(filename), line_(line), message_(message) {}
   virtual ~FatalException() throw();
 
-  virtual const char* what() const throw();
+  const char* what() const throw() override;
 
   const char* filename() const { return filename_; }
   int line() const { return line_; }
@@ -229,14 +191,11 @@ class FatalException : public std::exception {
 
 // This is at the end of the file instead of the beginning to work around a bug
 // in some versions of MSVC.
-// TODO(acozzette): remove these using statements
-using std::istream;
-using std::ostream;
-using std::pair;
 using std::string;
-using std::vector;
 
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_COMMON_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/fastmem.h b/3rdparty/protobuf/src/google/protobuf/stubs/fastmem.h
deleted file mode 100644 (file)
index 1f1f6ed..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2014 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.
-
-// Fast memory copying and comparison routines.
-//   strings::fastmemcmp_inlined() replaces memcmp()
-//   strings::memcpy_inlined() replaces memcpy()
-//   strings::memeq(a, b, n) replaces memcmp(a, b, n) == 0
-//
-// strings::*_inlined() routines are inline versions of the
-// routines exported by this module.  Sometimes using the inlined
-// versions is faster.  Measure before using the inlined versions.
-//
-// Performance measurement:
-//   strings::fastmemcmp_inlined
-//     Analysis: memcmp, fastmemcmp_inlined, fastmemcmp
-//     2012-01-30
-
-#ifndef GOOGLE_PROTOBUF_STUBS_FASTMEM_H_
-#define GOOGLE_PROTOBUF_STUBS_FASTMEM_H_
-
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <google/protobuf/stubs/common.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// Return true if the n bytes at a equal the n bytes at b.
-// The regions are allowed to overlap.
-//
-// The performance is similar to the performance memcmp(), but faster for
-// moderately-sized inputs, or inputs that share a common prefix and differ
-// somewhere in their last 8 bytes. Further optimizations can be added later
-// if it makes sense to do so.:w
-inline bool memeq(const char* a, const char* b, size_t n) {
-  size_t n_rounded_down = n & ~static_cast<size_t>(7);
-  if (GOOGLE_PREDICT_FALSE(n_rounded_down == 0)) {  // n <= 7
-    return memcmp(a, b, n) == 0;
-  }
-  // n >= 8
-  uint64 u = GOOGLE_UNALIGNED_LOAD64(a) ^ GOOGLE_UNALIGNED_LOAD64(b);
-  uint64 v = GOOGLE_UNALIGNED_LOAD64(a + n - 8) ^ GOOGLE_UNALIGNED_LOAD64(b + n - 8);
-  if ((u | v) != 0) {  // The first or last 8 bytes differ.
-    return false;
-  }
-  a += 8;
-  b += 8;
-  n = n_rounded_down - 8;
-  if (n > 128) {
-    // As of 2012, memcmp on x86-64 uses a big unrolled loop with SSE2
-    // instructions, and while we could try to do something faster, it
-    // doesn't seem worth pursuing.
-    return memcmp(a, b, n) == 0;
-  }
-  for (; n >= 16; n -= 16) {
-    uint64 x = GOOGLE_UNALIGNED_LOAD64(a) ^ GOOGLE_UNALIGNED_LOAD64(b);
-    uint64 y = GOOGLE_UNALIGNED_LOAD64(a + 8) ^ GOOGLE_UNALIGNED_LOAD64(b + 8);
-    if ((x | y) != 0) {
-      return false;
-    }
-    a += 16;
-    b += 16;
-  }
-  // n must be 0 or 8 now because it was a multiple of 8 at the top of the loop.
-  return n == 0 || GOOGLE_UNALIGNED_LOAD64(a) == GOOGLE_UNALIGNED_LOAD64(b);
-}
-
-inline int fastmemcmp_inlined(const char *a, const char *b, size_t n) {
-  if (n >= 64) {
-    return memcmp(a, b, n);
-  }
-  const char* a_limit = a + n;
-  while (a + sizeof(uint64) <= a_limit &&
-         GOOGLE_UNALIGNED_LOAD64(a) == GOOGLE_UNALIGNED_LOAD64(b)) {
-    a += sizeof(uint64);
-    b += sizeof(uint64);
-  }
-  if (a + sizeof(uint32) <= a_limit &&
-      GOOGLE_UNALIGNED_LOAD32(a) == GOOGLE_UNALIGNED_LOAD32(b)) {
-    a += sizeof(uint32);
-    b += sizeof(uint32);
-  }
-  while (a < a_limit) {
-    int d =
-        static_cast<int>(static_cast<uint32>(*a++) - static_cast<uint32>(*b++));
-    if (d) return d;
-  }
-  return 0;
-}
-
-// The standard memcpy operation is slow for variable small sizes.
-// This implementation inlines the optimal realization for sizes 1 to 16.
-// To avoid code bloat don't use it in case of not performance-critical spots,
-// nor when you don't expect very frequent values of size <= 16.
-inline void memcpy_inlined(char *dst, const char *src, size_t size) {
-  // Compiler inlines code with minimal amount of data movement when third
-  // parameter of memcpy is a constant.
-  switch (size) {
-    case  1: memcpy(dst, src, 1); break;
-    case  2: memcpy(dst, src, 2); break;
-    case  3: memcpy(dst, src, 3); break;
-    case  4: memcpy(dst, src, 4); break;
-    case  5: memcpy(dst, src, 5); break;
-    case  6: memcpy(dst, src, 6); break;
-    case  7: memcpy(dst, src, 7); break;
-    case  8: memcpy(dst, src, 8); break;
-    case  9: memcpy(dst, src, 9); break;
-    case 10: memcpy(dst, src, 10); break;
-    case 11: memcpy(dst, src, 11); break;
-    case 12: memcpy(dst, src, 12); break;
-    case 13: memcpy(dst, src, 13); break;
-    case 14: memcpy(dst, src, 14); break;
-    case 15: memcpy(dst, src, 15); break;
-    case 16: memcpy(dst, src, 16); break;
-    default: memcpy(dst, src, size); break;
-  }
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_STUBS_FASTMEM_H_
index 218cd94..a7ec068 100644 (file)
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 // Author: kenton@google.com (Kenton Varda)
-//
-// Deals with the fact that hash_map is not defined everywhere.
 
 #ifndef GOOGLE_PROTOBUF_STUBS_HASH_H__
 #define GOOGLE_PROTOBUF_STUBS_HASH_H__
 
-#include <string.h>
-#include <google/protobuf/stubs/common.h>
-
-#define GOOGLE_PROTOBUF_HAVE_HASH_MAP 1
-#define GOOGLE_PROTOBUF_HAVE_HASH_SET 1
-
-// Use C++11 unordered_{map|set} if available.
-#if ((defined(_LIBCPP_STD_VER) && _LIBCPP_STD_VER >= 11) || \
-    (((__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X)) && \
-    (__GLIBCXX__ > 20090421)))
-# define GOOGLE_PROTOBUF_HAS_CXX11_HASH
-
-// For XCode >= 4.6:  the compiler is clang with libc++.
-// For earlier XCode version: the compiler is gcc-4.2.1 with libstdc++.
-// libc++ provides <unordered_map> and friends even in non C++11 mode,
-// and it does not provide the tr1 library. Therefore the following macro
-// checks against this special case.
-// Note that we should not test the __APPLE_CC__ version number or the
-// __clang__ macro, since the new compiler can still use -stdlib=libstdc++, in
-// which case <unordered_map> is not compilable without -std=c++11
-#elif defined(__APPLE_CC__)
-# if __GNUC__ >= 4
-#  define GOOGLE_PROTOBUF_HAS_TR1
-# else
-// Not tested for gcc < 4... These setting can compile under 4.2.1 though.
-#  define GOOGLE_PROTOBUF_HASH_NAMESPACE __gnu_cxx
-#  include <ext/hash_map>
-#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map
-#  include <ext/hash_set>
-#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
-# endif
-
-// Version checks for gcc.
-#elif defined(__GNUC__)
-// For GCC 4.x+, use tr1::unordered_map/set; otherwise, follow the
-// instructions from:
-// https://gcc.gnu.org/onlinedocs/libstdc++/manual/backwards.html
-# if __GNUC__ >= 4
-#  define GOOGLE_PROTOBUF_HAS_TR1
-# elif __GNUC__ >= 3
-#  include <backward/hash_map>
-#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map
-#  include <backward/hash_set>
-#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
-#  if __GNUC__ == 3 && __GNUC_MINOR__ == 0
-#   define GOOGLE_PROTOBUF_HASH_NAMESPACE std       // GCC 3.0
-#  else
-#   define GOOGLE_PROTOBUF_HASH_NAMESPACE __gnu_cxx // GCC 3.1 and later
-#  endif
-# else
-#  define GOOGLE_PROTOBUF_HASH_NAMESPACE
-#  include <hash_map>
-#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map
-#  include <hash_set>
-#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
-# endif
-
-// GCC <= 4.1 does not define std::tr1::hash for `long long int` or `long long unsigned int`
-# 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.
-// Apparently Microsoft decided to move hash_map *back* to the std namespace in
-// MSVC 2010:
-// http://blogs.msdn.com/vcblog/archive/2009/05/25/stl-breaking-changes-in-visual-studio-2010-beta-1.aspx
-// And.. they are moved back to stdext in MSVC 2013 (haven't checked 2012). That
-// said, use unordered_map for MSVC 2010 and beyond is our safest bet.
-#elif defined(_MSC_VER)
-# if _MSC_VER >= 1600  // Since Visual Studio 2010
-#  define GOOGLE_PROTOBUF_HAS_CXX11_HASH
-#  define GOOGLE_PROTOBUF_HASH_COMPARE std::hash_compare
-# elif _MSC_VER >= 1500  // Since Visual Studio 2008
-#  define GOOGLE_PROTOBUF_HASH_NAMESPACE stdext
-#  include <hash_map>
-#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map
-#  include <hash_set>
-#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
-#  define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare
-#  define GOOGLE_PROTOBUF_CONTAINERS_NEED_HASH_COMPARE
-# elif _MSC_VER >= 1310
-#  define GOOGLE_PROTOBUF_HASH_NAMESPACE stdext
-#  include <hash_map>
-#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map
-#  include <hash_set>
-#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
-#  define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare
-# else
-#  define GOOGLE_PROTOBUF_HASH_NAMESPACE std
-#  include <hash_map>
-#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map
-#  include <hash_set>
-#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
-#  define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare
-# endif
-
-// **ADD NEW COMPILERS SUPPORT HERE.**
-// For other compilers, undefine the macro and fallback to use std::map, in
-// google/protobuf/stubs/hash.h
-#else
-# undef GOOGLE_PROTOBUF_HAVE_HASH_MAP
-# undef GOOGLE_PROTOBUF_HAVE_HASH_SET
-#endif
-
-#if defined(GOOGLE_PROTOBUF_HAS_CXX11_HASH)
-# define GOOGLE_PROTOBUF_HASH_NAMESPACE std
-# include <unordered_map>
-# define GOOGLE_PROTOBUF_HASH_MAP_CLASS unordered_map
-# include <unordered_set>
-# define GOOGLE_PROTOBUF_HASH_SET_CLASS unordered_set
-#elif defined(GOOGLE_PROTOBUF_HAS_TR1)
-# define GOOGLE_PROTOBUF_HASH_NAMESPACE std::tr1
-# include <tr1/unordered_map>
-# define GOOGLE_PROTOBUF_HASH_MAP_CLASS unordered_map
-# include <tr1/unordered_set>
-# define GOOGLE_PROTOBUF_HASH_SET_CLASS unordered_set
-#endif
+#include <cstring>
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
 
 # define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START \
   namespace google {                                      \
   namespace protobuf {
 # define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END }}
 
-#undef GOOGLE_PROTOBUF_HAS_CXX11_HASH
-#undef GOOGLE_PROTOBUF_HAS_TR1
-
-#if defined(GOOGLE_PROTOBUF_HAVE_HASH_MAP) && \
-    defined(GOOGLE_PROTOBUF_HAVE_HASH_SET)
-#else
-#define GOOGLE_PROTOBUF_MISSING_HASH
-#include <map>
-#include <set>
-#endif
-
 namespace google {
 namespace protobuf {
 
-#ifdef GOOGLE_PROTOBUF_MISSING_HASH
-#undef GOOGLE_PROTOBUF_MISSING_HASH
-
-// This system doesn't have hash_map or hash_set.  Emulate them using map and
-// set.
-
-// Make hash<T> be the same as less<T>.  Note that everywhere where custom
-// hash functions are defined in the protobuf code, they are also defined such
-// that they can be used as "less" functions, which is required by MSVC anyway.
 template <typename Key>
-struct hash {
-  // Dummy, just to make derivative hash functions compile.
-  int operator()(const Key& key) {
-    GOOGLE_LOG(FATAL) << "Should never be called.";
-    return 0;
-  }
-
-  inline bool operator()(const Key& a, const Key& b) const {
-    return a < b;
-  }
-};
-
-// Make sure char* is compared by value.
-template <>
-struct hash<const char*> {
-  // Dummy, just to make derivative hash functions compile.
-  int operator()(const char* key) {
-    GOOGLE_LOG(FATAL) << "Should never be called.";
-    return 0;
-  }
-
-  inline bool operator()(const char* a, const char* b) const {
-    return strcmp(a, b) < 0;
-  }
-};
-
-template <typename Key, typename Data,
-          typename HashFcn = hash<Key>,
-          typename EqualKey = std::equal_to<Key>,
-          typename Alloc = std::allocator< std::pair<const Key, Data> > >
-class hash_map : public std::map<Key, Data, HashFcn, Alloc> {
-  typedef std::map<Key, Data, HashFcn, Alloc> BaseClass;
-
- public:
-  hash_map(int a = 0, const HashFcn& b = HashFcn(),
-           const EqualKey& c = EqualKey(),
-           const Alloc& d = Alloc()) : BaseClass(b, d) {}
-
-  HashFcn hash_function() const { return HashFcn(); }
-};
-
-template <typename Key,
-          typename HashFcn = hash<Key>,
-          typename EqualKey = std::equal_to<Key> >
-class hash_set : public std::set<Key, HashFcn> {
- public:
-  hash_set(int = 0) {}
-
-  HashFcn hash_function() const { return HashFcn(); }
-};
-
-#elif defined(_MSC_VER) && !defined(_STLPORT_VERSION)
-
-template <typename Key>
-struct hash : public GOOGLE_PROTOBUF_HASH_COMPARE<Key> {
-};
-
-// MSVC's hash_compare<const char*> hashes based on the string contents but
-// compares based on the string pointer.  WTF?
-class CstringLess {
- public:
-  inline bool operator()(const char* a, const char* b) const {
-    return strcmp(a, b) < 0;
-  }
-};
-
-template <>
-struct hash<const char*>
-    : public GOOGLE_PROTOBUF_HASH_COMPARE<const char*, CstringLess> {};
-
-#ifdef GOOGLE_PROTOBUF_CONTAINERS_NEED_HASH_COMPARE
-
-template <typename Key, typename HashFcn, typename EqualKey>
-struct InternalHashCompare : public GOOGLE_PROTOBUF_HASH_COMPARE<Key> {
-  InternalHashCompare() {}
-  InternalHashCompare(HashFcn hashfcn, EqualKey equalkey)
-      : hashfcn_(hashfcn), equalkey_(equalkey) {}
-  size_t operator()(const Key& key) const { return hashfcn_(key); }
-  bool operator()(const Key& key1, const Key& key2) const {
-    return !equalkey_(key1, key2);
-  }
-  HashFcn hashfcn_;
-  EqualKey equalkey_;
-};
-
-template <typename Key, typename Data,
-          typename HashFcn = hash<Key>,
-          typename EqualKey = std::equal_to<Key>,
-          typename Alloc = std::allocator< std::pair<const Key, Data> > >
-class hash_map
-    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
-          Key, Data, InternalHashCompare<Key, HashFcn, EqualKey>, Alloc> {
-  typedef GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
-      Key, Data, InternalHashCompare<Key, HashFcn, EqualKey>, Alloc> BaseClass;
-
- public:
-  hash_map(int a = 0, const HashFcn& b = HashFcn(),
-           const EqualKey& c = EqualKey(), const Alloc& d = Alloc())
-      : BaseClass(InternalHashCompare<Key, HashFcn, EqualKey>(b, c), d) {}
-
-  HashFcn hash_function() const { return HashFcn(); }
-};
-
-template <typename Key, typename HashFcn = hash<Key>,
-          typename EqualKey = std::equal_to<Key> >
-class hash_set
-    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_SET_CLASS<
-          Key, InternalHashCompare<Key, HashFcn, EqualKey> > {
- public:
-  hash_set(int = 0) {}
-
-  HashFcn hash_function() const { return HashFcn(); }
-};
-
-#else  // GOOGLE_PROTOBUF_CONTAINERS_NEED_HASH_COMPARE
-
-template <typename Key, typename Data,
-          typename HashFcn = hash<Key>,
-          typename EqualKey = std::equal_to<Key>,
-          typename Alloc = std::allocator< std::pair<const Key, Data> > >
-class hash_map
-    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
-          Key, Data, HashFcn, EqualKey, Alloc> {
-  typedef GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
-      Key, Data, HashFcn, EqualKey, Alloc> BaseClass;
-
- public:
-  hash_map(int a = 0, const HashFcn& b = HashFcn(),
-           const EqualKey& c = EqualKey(),
-           const Alloc& d = Alloc()) : BaseClass(a, b, c, d) {}
-
-  HashFcn hash_function() const { return HashFcn(); }
-};
-
-template <typename Key, typename HashFcn = hash<Key>,
-          typename EqualKey = std::equal_to<Key> >
-class hash_set
-    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_SET_CLASS<
-          Key, HashFcn, EqualKey> {
- public:
-  hash_set(int = 0) {}
-
-  HashFcn hash_function() const { return HashFcn(); }
-};
-#endif  // GOOGLE_PROTOBUF_CONTAINERS_NEED_HASH_COMPARE
-
-#else  // defined(_MSC_VER) && !defined(_STLPORT_VERSION)
-
-template <typename Key>
-struct hash : public GOOGLE_PROTOBUF_HASH_NAMESPACE::hash<Key> {
-};
+struct hash : public std::hash<Key> {};
 
 template <typename Key>
 struct hash<const Key*> {
@@ -363,53 +76,22 @@ struct hash<bool> {
   }
 };
 
-template <typename Key, typename Data,
-          typename HashFcn = hash<Key>,
-          typename EqualKey = std::equal_to<Key>,
-          typename Alloc = std::allocator< std::pair<const Key, Data> > >
-class hash_map
-    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
-          Key, Data, HashFcn, EqualKey, Alloc> {
-  typedef GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
-      Key, Data, HashFcn, EqualKey, Alloc> BaseClass;
-
- public:
-  hash_map(int a = 0, const HashFcn& b = HashFcn(),
-           const EqualKey& c = EqualKey(),
-           const Alloc& d = Alloc()) : BaseClass(a, b, c, d) {}
-
-  HashFcn hash_function() const { return HashFcn(); }
-};
-
-template <typename Key, typename HashFcn = hash<Key>,
-          typename EqualKey = std::equal_to<Key> >
-class hash_set
-    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_SET_CLASS<
-          Key, HashFcn, EqualKey> {
- public:
-  hash_set(int = 0) {}
-
-  HashFcn hash_function() const { return HashFcn(); }
-};
-
-#endif  // !GOOGLE_PROTOBUF_MISSING_HASH
-
 template <>
-struct hash<string> {
-  inline size_t operator()(const string& key) const {
+struct hash<std::string> {
+  inline size_t operator()(const std::string& key) const {
     return hash<const char*>()(key.c_str());
   }
 
   static const size_t bucket_size = 4;
   static const size_t min_buckets = 8;
-  inline bool operator()(const string& a, const string& b) const {
+  inline bool operator()(const std::string& a, const std::string& b) const {
     return a < b;
   }
 };
 
 template <typename First, typename Second>
-struct hash<pair<First, Second> > {
-  inline size_t operator()(const pair<First, Second>& key) const {
+struct hash<std::pair<First, Second> > {
+  inline size_t operator()(const std::pair<First, Second>& key) const {
     size_t first_hash = hash<First>()(key.first);
     size_t second_hash = hash<Second>()(key.second);
 
@@ -420,20 +102,12 @@ struct hash<pair<First, Second> > {
 
   static const size_t bucket_size = 4;
   static const size_t min_buckets = 8;
-  inline bool operator()(const pair<First, Second>& a,
-                           const pair<First, Second>& b) const {
+  inline bool operator()(const std::pair<First, Second>& a,
+                           const std::pair<First, Second>& b) const {
     return a < b;
   }
 };
 
-// Used by GCC/SGI STL only.  (Why isn't this provided by the standard
-// library?  :( )
-struct streq {
-  inline bool operator()(const char* a, const char* b) const {
-    return strcmp(a, b) == 0;
-  }
-};
-
 }  // namespace protobuf
 }  // namespace google
 
index a509080..e5e159e 100644 (file)
 #include <ostream>  // NOLINT(readability/streams)
 #include <sstream>
 
+#include <google/protobuf/stubs/logging.h>
+
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 
-const uint128_pod kuint128max = {
-    static_cast<uint64>(GOOGLE_LONGLONG(0xFFFFFFFFFFFFFFFF)),
-    static_cast<uint64>(GOOGLE_LONGLONG(0xFFFFFFFFFFFFFFFF))
-};
+const uint128_pod kuint128max = {uint64_t{0xFFFFFFFFFFFFFFFFu},
+                                 uint64_t{0xFFFFFFFFFFFFFFFFu}};
 
 // Returns the 0-based position of the last set bit (i.e., most significant bit)
 // in the given uint64. The argument may not be 0.
@@ -63,7 +65,7 @@ static inline int Fls64(uint64 n) {
   STEP(uint32, n32, pos, 0x10);
   STEP(uint32, n32, pos, 0x08);
   STEP(uint32, n32, pos, 0x04);
-  return pos + ((GOOGLE_ULONGLONG(0x3333333322221100) >> (n32 << 2)) & 0x3);
+  return pos + ((uint64_t{0x3333333322221100u} >> (n32 << 2)) & 0x3);
 }
 #undef STEP
 
@@ -76,52 +78,36 @@ static inline int Fls128(uint128 n) {
   return Fls64(Uint128Low64(n));
 }
 
-// Long division/modulo for uint128 implemented using the shift-subtract
-// division algorithm adapted from:
-// http://stackoverflow.com/questions/5386377/division-without-using
 void uint128::DivModImpl(uint128 dividend, uint128 divisor,
                          uint128* quotient_ret, uint128* remainder_ret) {
   if (divisor == 0) {
     GOOGLE_LOG(FATAL) << "Division or mod by zero: dividend.hi=" << dividend.hi_
                       << ", lo=" << dividend.lo_;
-  }
-
-  if (divisor > dividend) {
+  } else if (dividend < divisor) {
     *quotient_ret = 0;
     *remainder_ret = dividend;
     return;
-  }
-
-  if (divisor == dividend) {
-    *quotient_ret = 1;
-    *remainder_ret = 0;
-    return;
-  }
-
-  uint128 denominator = divisor;
-  uint128 position = 1;
-  uint128 quotient = 0;
-
-  // Left aligns the MSB of the denominator and the dividend.
-  int shift = Fls128(dividend) - Fls128(denominator);
-  denominator <<= shift;
-  position <<= shift;
-
-  // Uses shift-subtract algorithm to divide dividend by denominator. The
-  // remainder will be left in dividend.
-  while (position > 0) {
-    if (dividend >= denominator) {
-      dividend -= denominator;
-      quotient |= position;
+  } else {
+    int dividend_bit_length = Fls128(dividend);
+    int divisor_bit_length = Fls128(divisor);
+    int difference = dividend_bit_length - divisor_bit_length;
+    uint128 quotient = 0;
+    while (difference >= 0) {
+      quotient <<= 1;
+      uint128 shifted_divisor = divisor << difference;
+      if (shifted_divisor <= dividend) {
+        dividend -= shifted_divisor;
+        quotient += 1;
+      }
+      difference -= 1;
     }
-    position >>= 1;
-    denominator >>= 1;
+    //record the final quotient and remainder
+    *quotient_ret = quotient;
+    *remainder_ret = dividend;
   }
-
-  *quotient_ret = quotient;
-  *remainder_ret = dividend;
 }
 
+
 uint128& uint128::operator/=(const uint128& divisor) {
   uint128 quotient = 0;
   uint128 remainder = 0;
@@ -145,15 +131,18 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) {
   std::streamsize div_base_log;
   switch (flags & std::ios::basefield) {
     case std::ios::hex:
-      div = static_cast<uint64>(GOOGLE_ULONGLONG(0x1000000000000000));  // 16^15
+      div =
+          static_cast<uint64>(uint64_t{0x1000000000000000u});  // 16^15
       div_base_log = 15;
       break;
     case std::ios::oct:
-      div = static_cast<uint64>(GOOGLE_ULONGLONG(01000000000000000000000));  // 8^21
+      div = static_cast<uint64>(
+          uint64_t{01000000000000000000000u});  // 8^21
       div_base_log = 21;
       break;
     default:  // std::ios::dec
-      div = static_cast<uint64>(GOOGLE_ULONGLONG(10000000000000000000));  // 10^19
+      div = static_cast<uint64>(
+          uint64_t{10000000000000000000u});  // 10^19
       div_base_log = 19;
       break;
   }
@@ -199,3 +188,5 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) {
 
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>  // NOLINT
index 1499bb7..dc70d96 100644 (file)
@@ -34,6 +34,8 @@
 
 #include <iosfwd>
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 
@@ -48,7 +50,7 @@ struct uint128_pod;
 #endif
 
 // An unsigned 128-bit integer type. Thread-compatible.
-class LIBPROTOBUF_EXPORT uint128 {
+class PROTOBUF_EXPORT uint128 {
  public:
   UINT128_CONSTEXPR uint128();  // Sets to 0, but don't trust on this behavior.
   UINT128_CONSTEXPR uint128(uint64 top, uint64 bottom);
@@ -84,8 +86,8 @@ class LIBPROTOBUF_EXPORT uint128 {
   friend uint64 Uint128High64(const uint128& v);
 
   // We add "std::" to avoid including all of port.h.
-  LIBPROTOBUF_EXPORT friend std::ostream& operator<<(std::ostream& o,
-                                                     const uint128& b);
+  PROTOBUF_EXPORT friend std::ostream& operator<<(std::ostream& o,
+                                                  const uint128& b);
 
  private:
   static void DivModImpl(uint128 dividend, uint128 divisor,
@@ -116,11 +118,11 @@ struct uint128_pod {
   uint64 lo;
 };
 
-LIBPROTOBUF_EXPORT extern const uint128_pod kuint128max;
+PROTOBUF_EXPORT extern const uint128_pod kuint128max;
 
 // allow uint128 to be logged
-LIBPROTOBUF_EXPORT extern std::ostream& operator<<(std::ostream& o,
-                                                   const uint128& b);
+PROTOBUF_EXPORT extern std::ostream& operator<<(std::ostream& o,
+                                                const uint128& b);
 
 // Methods to access low and high pieces of 128-bit value.
 // Defined externally from uint128 to facilitate conversion
@@ -380,4 +382,6 @@ inline uint128& uint128::operator--() {
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_INT128_H_
index f69605d..8ecc2fa 100644 (file)
 
 #include <google/protobuf/stubs/macros.h>
 #include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/status.h>
+#include <google/protobuf/stubs/stringpiece.h>
+
+#include <google/protobuf/port_def.inc>
 
 // ===================================================================
 // emulates google3/base/logging.h
@@ -61,16 +65,12 @@ enum LogLevel {
 #endif
 };
 
-class StringPiece;
-namespace util {
-class Status;
-}
 class uint128;
 namespace internal {
 
 class LogFinisher;
 
-class LIBPROTOBUF_EXPORT LogMessage {
+class PROTOBUF_EXPORT LogMessage {
  public:
   LogMessage(LogLevel level, const char* filename, int line);
   ~LogMessage();
@@ -87,7 +87,7 @@ class LIBPROTOBUF_EXPORT LogMessage {
   LogMessage& operator<<(double value);
   LogMessage& operator<<(void* value);
   LogMessage& operator<<(const StringPiece& value);
-  LogMessage& operator<<(const ::google::protobuf::util::Status& status);
+  LogMessage& operator<<(const util::Status& status);
   LogMessage& operator<<(const uint128& value);
 
  private:
@@ -102,7 +102,7 @@ class LIBPROTOBUF_EXPORT LogMessage {
 
 // Used to make the entire "LOG(BLAH) << etc." expression have a void return
 // type and print a newline after each message.
-class LIBPROTOBUF_EXPORT LogFinisher {
+class PROTOBUF_EXPORT LogFinisher {
  public:
   void operator=(LogMessage& other);
 };
@@ -141,10 +141,10 @@ inline bool IsOk(bool status) { return status; }
 #undef GOOGLE_DCHECK_GT
 #undef GOOGLE_DCHECK_GE
 
-#define GOOGLE_LOG(LEVEL)                                                 \
-  ::google::protobuf::internal::LogFinisher() =                           \
-    ::google::protobuf::internal::LogMessage(                             \
-      ::google::protobuf::LOGLEVEL_##LEVEL, __FILE__, __LINE__)
+#define GOOGLE_LOG(LEVEL)                          \
+  ::google::protobuf::internal::LogFinisher() = \
+      ::google::protobuf::internal::LogMessage( \
+          ::google::protobuf::LOGLEVEL_##LEVEL, __FILE__, __LINE__)
 #define GOOGLE_LOG_IF(LEVEL, CONDITION) \
   !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)
 
@@ -162,15 +162,15 @@ namespace internal {
 template<typename T>
 T* CheckNotNull(const char* /* file */, int /* line */,
                 const char* name, T* val) {
-  if (val == NULL) {
+  if (val == nullptr) {
     GOOGLE_LOG(FATAL) << name;
   }
   return val;
 }
 }  // namespace internal
-#define GOOGLE_CHECK_NOTNULL(A) \
-  ::google::protobuf::internal::CheckNotNull(\
-      __FILE__, __LINE__, "'" #A "' must not be NULL", (A))
+#define GOOGLE_CHECK_NOTNULL(A)               \
+  ::google::protobuf::internal::CheckNotNull( \
+      __FILE__, __LINE__, "'" #A "' must not be nullptr", (A))
 
 #ifdef NDEBUG
 
@@ -208,7 +208,7 @@ typedef void LogHandler(LogLevel level, const char* filename, int line,
 // also help end users figure out a problem.  If you would prefer that
 // these messages be sent somewhere other than stderr, call SetLogHandler()
 // to set your own handler.  This returns the old handler.  Set the handler
-// to NULL to ignore log messages (but see also LogSilencer, below).
+// to nullptr to ignore log messages (but see also LogSilencer, below).
 //
 // Obviously, SetLogHandler is not thread-safe.  You should only call it
 // at initialization time, and probably not from library code.  If you
@@ -216,7 +216,7 @@ typedef void LogHandler(LogLevel level, const char* filename, int line,
 // have some code that tends to trigger them frequently and you know
 // the warnings are not important to you), use the LogSilencer class
 // below.
-LIBPROTOBUF_EXPORT LogHandler* SetLogHandler(LogHandler* new_func);
+PROTOBUF_EXPORT LogHandler* SetLogHandler(LogHandler* new_func);
 
 // Create a LogSilencer if you want to temporarily suppress all log
 // messages.  As long as any LogSilencer objects exist, non-fatal
@@ -225,7 +225,7 @@ LIBPROTOBUF_EXPORT LogHandler* SetLogHandler(LogHandler* new_func);
 // accidentally suppress log messages occurring in another thread, but
 // since messages are generally for debugging purposes only, this isn't
 // a big deal.  If you want to intercept log messages, use SetLogHandler().
-class LIBPROTOBUF_EXPORT LogSilencer {
+class PROTOBUF_EXPORT LogSilencer {
  public:
   LogSilencer();
   ~LogSilencer();
@@ -234,4 +234,6 @@ class LIBPROTOBUF_EXPORT LogSilencer {
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_LOGGING_H_
index 0e9a9ec..ae9a8b9 100644 (file)
 #ifndef GOOGLE_PROTOBUF_MACROS_H__
 #define GOOGLE_PROTOBUF_MACROS_H__
 
-#include <google/protobuf/stubs/port.h>
-
 namespace google {
 namespace protobuf {
 
 #undef GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
-#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)    \
-  TypeName(const TypeName&);                           \
-  void operator=(const TypeName&)
+#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName) \
+  TypeName(const TypeName&) = delete;               \
+  void operator=(const TypeName&) = delete
 
 #undef GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS
 #define GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
-  TypeName();                                           \
-  TypeName(const TypeName&);                            \
-  void operator=(const TypeName&)
+  TypeName() = delete;                                  \
+  TypeName(const TypeName&) = delete;                   \
+  void operator=(const TypeName&) = delete
 
 // ===================================================================
 // from google3/base/basictypes.h
@@ -89,79 +87,6 @@ namespace protobuf {
   ((sizeof(a) / sizeof(*(a))) / \
    static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
 
-// The COMPILE_ASSERT macro can be used to verify that a compile time
-// expression is true. For example, you could use it to verify the
-// size of a static array:
-//
-//   COMPILE_ASSERT(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
-//                  content_type_names_incorrect_size);
-//
-// or to make sure a struct is smaller than a certain size:
-//
-//   COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);
-//
-// The second argument to the macro is the name of the variable. If
-// the expression is false, most compilers will issue a warning/error
-// containing the name of the variable.
-
-namespace internal {
-
-template <bool>
-struct CompileAssert {
-};
-
-}  // namespace internal
-
-#undef GOOGLE_COMPILE_ASSERT
-#if __cplusplus >= 201103L
-#define GOOGLE_COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)
-#else
-#define GOOGLE_COMPILE_ASSERT(expr, msg) \
-  ::google::protobuf::internal::CompileAssert<(bool(expr))> \
-          msg[bool(expr) ? 1 : -1]; \
-  (void)msg
-// Implementation details of COMPILE_ASSERT:
-//
-// - COMPILE_ASSERT works by defining an array type that has -1
-//   elements (and thus is invalid) when the expression is false.
-//
-// - The simpler definition
-//
-//     #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1]
-//
-//   does not work, as gcc supports variable-length arrays whose sizes
-//   are determined at run-time (this is gcc's extension and not part
-//   of the C++ standard).  As a result, gcc fails to reject the
-//   following code with the simple definition:
-//
-//     int foo;
-//     COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is
-//                               // not a compile-time constant.
-//
-// - By using the type CompileAssert<(bool(expr))>, we ensures that
-//   expr is a compile-time constant.  (Template arguments must be
-//   determined at compile-time.)
-//
-// - The outter parentheses in CompileAssert<(bool(expr))> are necessary
-//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
-//
-//     CompileAssert<bool(expr)>
-//
-//   instead, these compilers will refuse to compile
-//
-//     COMPILE_ASSERT(5 > 0, some_message);
-//
-//   (They seem to think the ">" in "5 > 0" marks the end of the
-//   template argument list.)
-//
-// - The array size is (bool(expr) ? 1 : -1), instead of simply
-//
-//     ((expr) ? 1 : -1).
-//
-//   This is to avoid running into a bug in MS VC 7.1, which
-//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
-#endif  // __cplusplus >= 201103L
-
 }  // namespace protobuf
 }  // namespace google
 
index 887f12a..24e098a 100644 (file)
@@ -131,7 +131,7 @@ FindWithDefault(const Collection& collection,
 }
 
 // Returns a pointer to the const value associated with the given key if it
-// exists, or NULL otherwise.
+// exists, or nullptr otherwise.
 template <class Collection>
 const typename Collection::value_type::second_type*
 FindOrNull(const Collection& collection,
@@ -156,11 +156,11 @@ FindOrNull(Collection& collection,  // NOLINT
 }
 
 // Returns the pointer value associated with the given key. If none is found,
-// NULL is returned. The function is designed to be used with a map of keys to
+// nullptr is returned. The function is designed to be used with a map of keys to
 // pointers.
 //
 // This function does not distinguish between a missing key and a key mapped
-// to a NULL value.
+// to nullptr.
 template <class Collection>
 typename Collection::value_type::second_type
 FindPtrOrNull(const Collection& collection,
@@ -188,7 +188,7 @@ FindPtrOrNull(Collection& collection,  // NOLINT
 }
 
 // Finds the pointer value associated with the given key in a map whose values
-// are linked_ptrs. Returns NULL if key is not found.
+// are linked_ptrs. Returns nullptr if key is not found.
 template <class Collection>
 typename Collection::value_type::second_type::element_type*
 FindLinkedPtrOrNull(const Collection& collection,
@@ -215,7 +215,7 @@ FindLinkedPtrOrDie(const Collection& collection,
 }
 
 // Finds the value associated with the given key and copies it to *value (if not
-// NULL). Returns false if the key was not found, true otherwise.
+// nullptr). Returns false if the key was not found, true otherwise.
 template <class Collection, class Key, class Value>
 bool FindCopy(const Collection& collection,
               const Key& key,
@@ -447,7 +447,7 @@ LookupOrInsertNew(Collection* const collection,
   std::pair<typename Collection::iterator, bool> ret =
       collection->insert(typename Collection::value_type(
           key,
-          static_cast<typename Collection::value_type::second_type>(NULL)));
+          static_cast<typename Collection::value_type::second_type>(nullptr)));
   if (ret.second) {
     ret.first->second = new Element();
   }
@@ -466,7 +466,7 @@ LookupOrInsertNew(Collection* const collection,
   std::pair<typename Collection::iterator, bool> ret =
       collection->insert(typename Collection::value_type(
           key,
-          static_cast<typename Collection::value_type::second_type>(NULL)));
+          static_cast<typename Collection::value_type::second_type>(nullptr)));
   if (ret.second) {
     ret.first->second = new Element(arg);
   }
@@ -612,7 +612,7 @@ bool UpdateReturnCopy(Collection* const collection,
   return false;
 }
 
-// Tries to insert the given key-value pair into the collection. Returns NULL if
+// Tries to insert the given key-value pair into the collection. Returns nullptr if
 // the insert succeeds. Otherwise, returns a pointer to the existing value.
 //
 // This complements UpdateReturnCopy in that it allows to update only after
@@ -620,12 +620,11 @@ bool UpdateReturnCopy(Collection* const collection,
 // twice. Unlike UpdateReturnCopy this also does not come with the issue of an
 // undefined previous* in case new data was inserted.
 template <class Collection>
-typename Collection::value_type::second_type* const
-InsertOrReturnExisting(Collection* const collection,
-                       const typename Collection::value_type& vt) {
+typename Collection::value_type::second_type* InsertOrReturnExisting(
+    Collection* const collection, const typename Collection::value_type& vt) {
   std::pair<typename Collection::iterator, bool> ret = collection->insert(vt);
   if (ret.second) {
-    return NULL;  // Inserted, no existing previous value.
+    return nullptr;  // Inserted, no existing previous value.
   } else {
     return &ret.first->second;  // Return address of already existing value.
   }
@@ -633,8 +632,7 @@ InsertOrReturnExisting(Collection* const collection,
 
 // Same as above, except for explicit key and data.
 template <class Collection>
-typename Collection::value_type::second_type* const
-InsertOrReturnExisting(
+typename Collection::value_type::second_type* InsertOrReturnExisting(
     Collection* const collection,
     const typename Collection::value_type::first_type& key,
     const typename Collection::value_type::second_type& data) {
@@ -644,7 +642,7 @@ InsertOrReturnExisting(
 
 // Erases the collection item identified by the given key, and returns the value
 // associated with that key. It is assumed that the value (i.e., the
-// mapped_type) is a pointer. Returns NULL if the key was not found in the
+// mapped_type) is a pointer. Returns nullptr if the key was not found in the
 // collection.
 //
 // Examples:
@@ -654,7 +652,8 @@ InsertOrReturnExisting(
 //     delete EraseKeyReturnValuePtr(&my_map, "abc");
 //
 // Use returned value:
-//     scoped_ptr<MyType> value_ptr(EraseKeyReturnValuePtr(&my_map, "abc"));
+//     std::unique_ptr<MyType> value_ptr(
+//         EraseKeyReturnValuePtr(&my_map, "abc"));
 //     if (value_ptr.get())
 //       value_ptr->DoSomething();
 //
@@ -664,7 +663,7 @@ typename Collection::value_type::second_type EraseKeyReturnValuePtr(
     const typename Collection::value_type::first_type& key) {
   typename Collection::iterator it = collection->find(key);
   if (it == collection->end()) {
-    return NULL;
+    return nullptr;
   }
   typename Collection::value_type::second_type v = it->second;
   collection->erase(it);
@@ -678,7 +677,7 @@ typename Collection::value_type::second_type EraseKeyReturnValuePtr(
 template <class MapContainer, class KeyContainer>
 void InsertKeysFromMap(const MapContainer& map_container,
                        KeyContainer* key_container) {
-  GOOGLE_CHECK(key_container != NULL);
+  GOOGLE_CHECK(key_container != nullptr);
   for (typename MapContainer::const_iterator it = map_container.begin();
        it != map_container.end(); ++it) {
     key_container->insert(it->first);
@@ -692,7 +691,7 @@ void InsertKeysFromMap(const MapContainer& map_container,
 template <class MapContainer, class KeyContainer>
 void AppendKeysFromMap(const MapContainer& map_container,
                        KeyContainer* key_container) {
-  GOOGLE_CHECK(key_container != NULL);
+  GOOGLE_CHECK(key_container != nullptr);
   for (typename MapContainer::const_iterator it = map_container.begin();
        it != map_container.end(); ++it) {
     key_container->push_back(it->first);
@@ -708,8 +707,8 @@ void AppendKeysFromMap(const MapContainer& map_container,
 // without the complexity of a SFINAE-based solution.)
 template <class MapContainer, class KeyType>
 void AppendKeysFromMap(const MapContainer& map_container,
-                       vector<KeyType>* key_container) {
-  GOOGLE_CHECK(key_container != NULL);
+                       std::vector<KeyType>* key_container) {
+  GOOGLE_CHECK(key_container != nullptr);
   // We now have the opportunity to call reserve(). Calling reserve() every
   // time is a bad idea for some use cases: libstdc++'s implementation of
   // vector<>::reserve() resizes the vector's backing store to exactly the
@@ -736,7 +735,7 @@ void AppendKeysFromMap(const MapContainer& map_container,
 template <class MapContainer, class ValueContainer>
 void AppendValuesFromMap(const MapContainer& map_container,
                          ValueContainer* value_container) {
-  GOOGLE_CHECK(value_container != NULL);
+  GOOGLE_CHECK(value_container != nullptr);
   for (typename MapContainer::const_iterator it = map_container.begin();
        it != map_container.end(); ++it) {
     value_container->push_back(it->second);
@@ -752,8 +751,8 @@ void AppendValuesFromMap(const MapContainer& map_container,
 // without the complexity of a SFINAE-based solution.)
 template <class MapContainer, class ValueType>
 void AppendValuesFromMap(const MapContainer& map_container,
-                         vector<ValueType>* value_container) {
-  GOOGLE_CHECK(value_container != NULL);
+                         std::vector<ValueType>* value_container) {
+  GOOGLE_CHECK(value_container != nullptr);
   // See AppendKeysFromMap for why this is done.
   if (value_container->empty()) {
     value_container->reserve(map_container.size());
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/mathlimits.cc b/3rdparty/protobuf/src/google/protobuf/stubs/mathlimits.cc
deleted file mode 100644 (file)
index 0373b2b..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// All Rights Reserved.
-//
-// Author: Maxim Lifantsev
-//
-
-#include <google/protobuf/stubs/mathlimits.h>
-
-#include <google/protobuf/stubs/common.h>
-
-namespace google {
-namespace protobuf {
-
-// MSVC++ 2005 and older compilers think the header declaration was a
-// definition, and erroneously flag these as a duplicate definition.
-#if defined(COMPILER_MSVC) || __cpluscplus < 201103L
-
-#define DEF_COMMON_LIMITS(Type)
-#define DEF_UNSIGNED_INT_LIMITS(Type)
-#define DEF_SIGNED_INT_LIMITS(Type)
-#define DEF_PRECISION_LIMITS(Type)
-
-#else
-
-#define DEF_COMMON_LIMITS(Type) \
-const bool MathLimits<Type>::kIsSigned; \
-const bool MathLimits<Type>::kIsInteger; \
-const int MathLimits<Type>::kMin10Exp; \
-const int MathLimits<Type>::kMax10Exp;
-
-#define DEF_UNSIGNED_INT_LIMITS(Type) \
-DEF_COMMON_LIMITS(Type) \
-const Type MathLimits<Type>::kPosMin; \
-const Type MathLimits<Type>::kPosMax; \
-const Type MathLimits<Type>::kMin; \
-const Type MathLimits<Type>::kMax; \
-const Type MathLimits<Type>::kEpsilon; \
-const Type MathLimits<Type>::kStdError;
-
-#define DEF_SIGNED_INT_LIMITS(Type) \
-DEF_UNSIGNED_INT_LIMITS(Type) \
-const Type MathLimits<Type>::kNegMin; \
-const Type MathLimits<Type>::kNegMax;
-
-#define DEF_PRECISION_LIMITS(Type) \
-const int MathLimits<Type>::kPrecisionDigits;
-
-#endif  // not COMPILER_MSVC
-
-// http://en.wikipedia.org/wiki/Quadruple_precision_floating-point_format#Double-double_arithmetic
-// With some compilers (gcc 4.6.x) on some platforms (powerpc64),
-// "long double" is implemented as a pair of double: "double double" format.
-// This causes a problem with epsilon (eps).
-// eps is the smallest positive number such that 1.0 + eps > 1.0
-//
-// Normal format:  1.0 + e = 1.0...01      // N-1 zeros for N fraction bits
-// D-D format:     1.0 + e = 1.000...0001  // epsilon can be very small
-//
-// In the normal format, 1.0 + e has to fit in one stretch of bits.
-// The maximum rounding error is half of eps.
-//
-// In the double-double format, 1.0 + e splits across two doubles:
-// 1.0 in the high double, e in the low double, and they do not have to
-// be contiguous.  The maximum rounding error on a value close to 1.0 is
-// much larger than eps.
-//
-// Some code checks for errors by comparing a computed value to a golden
-// value +/- some multiple of the maximum rounding error.  The maximum
-// rounding error is not available so we use eps as an approximation
-// instead.  That fails when long double is in the double-double format.
-// Therefore, we define kStdError as a multiple of
-// max(DBL_EPSILON * DBL_EPSILON, kEpsilon) rather than a multiple of kEpsilon.
-
-#define DEF_FP_LIMITS(Type, PREFIX) \
-DEF_COMMON_LIMITS(Type) \
-const Type MathLimits<Type>::kPosMin = PREFIX##_MIN; \
-const Type MathLimits<Type>::kPosMax = PREFIX##_MAX; \
-const Type MathLimits<Type>::kMin = -MathLimits<Type>::kPosMax; \
-const Type MathLimits<Type>::kMax = MathLimits<Type>::kPosMax; \
-const Type MathLimits<Type>::kNegMin = -MathLimits<Type>::kPosMin; \
-const Type MathLimits<Type>::kNegMax = -MathLimits<Type>::kPosMax; \
-const Type MathLimits<Type>::kEpsilon = PREFIX##_EPSILON; \
-/* 32 is 5 bits of mantissa error; should be adequate for common errors */ \
-const Type MathLimits<Type>::kStdError = \
-  32 * (DBL_EPSILON * DBL_EPSILON > MathLimits<Type>::kEpsilon \
-      ? DBL_EPSILON * DBL_EPSILON : MathLimits<Type>::kEpsilon); \
-DEF_PRECISION_LIMITS(Type) \
-const Type MathLimits<Type>::kNaN = HUGE_VAL - HUGE_VAL; \
-const Type MathLimits<Type>::kPosInf = HUGE_VAL; \
-const Type MathLimits<Type>::kNegInf = -HUGE_VAL;
-
-// The following are *not* casts!
-DEF_SIGNED_INT_LIMITS(int8)
-DEF_SIGNED_INT_LIMITS(int16)  // NOLINT(readability/casting)
-DEF_SIGNED_INT_LIMITS(int32)  // NOLINT(readability/casting)
-DEF_SIGNED_INT_LIMITS(int64)  // NOLINT(readability/casting)
-DEF_UNSIGNED_INT_LIMITS(uint8)
-DEF_UNSIGNED_INT_LIMITS(uint16)  // NOLINT(readability/casting)
-DEF_UNSIGNED_INT_LIMITS(uint32)  // NOLINT(readability/casting)
-DEF_UNSIGNED_INT_LIMITS(uint64)  // NOLINT(readability/casting)
-
-DEF_SIGNED_INT_LIMITS(long int)
-DEF_UNSIGNED_INT_LIMITS(unsigned long int)
-
-DEF_FP_LIMITS(float, FLT)
-DEF_FP_LIMITS(double, DBL)
-DEF_FP_LIMITS(long double, LDBL);
-
-#undef DEF_COMMON_LIMITS
-#undef DEF_SIGNED_INT_LIMITS
-#undef DEF_UNSIGNED_INT_LIMITS
-#undef DEF_FP_LIMITS
-#undef DEF_PRECISION_LIMITS
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/mathlimits.h b/3rdparty/protobuf/src/google/protobuf/stubs/mathlimits.h
deleted file mode 100644 (file)
index 2391ac4..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// All Rights Reserved.
-//
-// Author: Maxim Lifantsev
-//
-// Useful integer and floating point limits and type traits.
-//
-// This partially replaces/duplictes numeric_limits<> from <limits>.
-// We get a Google-style class that we have a greater control over
-// and thus can add new features to it or fix whatever happens to be broken in
-// numeric_limits for the compilers we use.
-//
-
-#ifndef UTIL_MATH_MATHLIMITS_H__
-#define UTIL_MATH_MATHLIMITS_H__
-
-// Note that for Windows we do something different because it does not support
-// the plain isinf and isnan.
-#if __cplusplus >= 201103L
-// GCC 4.9 has a bug that makes isinf and isnan ambigious when both <math.h>
-// and <cmath> get pulled into the same translation unit. We use the ones in
-// std:: namespace explicitly for C++11
-#include <cmath>
-#define GOOGLE_PROTOBUF_USE_STD_CMATH
-#elif _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
-// libstdc++ <cmath> header undefines the global macros and put functions in
-// std:: namespace even before C++11. Use the ones in std:: instead too.
-#include <cmath>
-#define GOOGLE_PROTOBUF_USE_STD_CMATH
-#else
-#include <math.h>
-#endif
-
-#include <string.h>
-
-#include <cfloat>
-
-#include <google/protobuf/stubs/common.h>
-
-// ========================================================================= //
-
-// Useful integer and floating point limits and type traits.
-// This is just for the documentation;
-// real members are defined in our specializations below.
-namespace google {
-namespace protobuf {
-template<typename T> struct MathLimits {
-  // Type name.
-  typedef T Type;
-  // Unsigned version of the Type with the same byte size.
-  // Same as Type for floating point and unsigned types.
-  typedef T UnsignedType;
-  // If the type supports negative values.
-  static const bool kIsSigned;
-  // If the type supports only integer values.
-  static const bool kIsInteger;
-  // Magnitude-wise smallest representable positive value.
-  static const Type kPosMin;
-  // Magnitude-wise largest representable positive value.
-  static const Type kPosMax;
-  // Smallest representable value.
-  static const Type kMin;
-  // Largest representable value.
-  static const Type kMax;
-  // Magnitude-wise smallest representable negative value.
-  // Present only if kIsSigned.
-  static const Type kNegMin;
-  // Magnitude-wise largest representable negative value.
-  // Present only if kIsSigned.
-  static const Type kNegMax;
-  // Smallest integer x such that 10^x is representable.
-  static const int kMin10Exp;
-  // Largest integer x such that 10^x is representable.
-  static const int kMax10Exp;
-  // Smallest positive value such that Type(1) + kEpsilon != Type(1)
-  static const Type kEpsilon;
-  // Typical rounding error that is enough to cover
-  // a few simple floating-point operations.
-  // Slightly larger than kEpsilon to account for a few rounding errors.
-  // Is zero if kIsInteger.
-  static const Type kStdError;
-  // Number of decimal digits of mantissa precision.
-  // Present only if !kIsInteger.
-  static const int kPrecisionDigits;
-  // Not a number, i.e. result of 0/0.
-  // Present only if !kIsInteger.
-  static const Type kNaN;
-  // Positive infinity, i.e. result of 1/0.
-  // Present only if !kIsInteger.
-  static const Type kPosInf;
-  // Negative infinity, i.e. result of -1/0.
-  // Present only if !kIsInteger.
-  static const Type kNegInf;
-
-  // NOTE: Special floating point values behave
-  // in a special (but mathematically-logical) way
-  // in terms of (in)equalty comparison and mathematical operations
-  // -- see out unittest for examples.
-
-  // Special floating point value testers.
-  // Present in integer types for convenience.
-  static bool IsFinite(const Type x);
-  static bool IsNaN(const Type x);
-  static bool IsInf(const Type x);
-  static bool IsPosInf(const Type x);
-  static bool IsNegInf(const Type x);
-};
-
-// ========================================================================= //
-
-// All #define-s below are simply to refactor the declarations of
-// MathLimits template specializations.
-// They are all #undef-ined below.
-
-// The hoop-jumping in *_INT_(MAX|MIN) below is so that the compiler does not
-// get an overflow while computing the constants.
-
-#define SIGNED_INT_MAX(Type) \
-  (((Type(1) << (sizeof(Type)*8 - 2)) - 1) + (Type(1) << (sizeof(Type)*8 - 2)))
-
-#define SIGNED_INT_MIN(Type) \
-  (-(Type(1) << (sizeof(Type)*8 - 2)) - (Type(1) << (sizeof(Type)*8 - 2)))
-
-#define UNSIGNED_INT_MAX(Type) \
-  (((Type(1) << (sizeof(Type)*8 - 1)) - 1) + (Type(1) << (sizeof(Type)*8 - 1)))
-
-// Compile-time selected log10-related constants for integer types.
-#define SIGNED_MAX_10_EXP(Type) \
-  (sizeof(Type) == 1 ? 2 : ( \
-    sizeof(Type) == 2 ? 4 : ( \
-      sizeof(Type) == 4 ? 9 : ( \
-        sizeof(Type) == 8 ? 18 : -1))))
-
-#define UNSIGNED_MAX_10_EXP(Type) \
-  (sizeof(Type) == 1 ? 2 : ( \
-    sizeof(Type) == 2 ? 4 : ( \
-      sizeof(Type) == 4 ? 9 : ( \
-        sizeof(Type) == 8 ? 19 : -1))))
-
-#define DECL_INT_LIMIT_FUNCS \
-  static bool IsFinite(const Type /*x*/) { return true; } \
-  static bool IsNaN(const Type /*x*/) { return false; } \
-  static bool IsInf(const Type /*x*/) { return false; } \
-  static bool IsPosInf(const Type /*x*/) { return false; } \
-  static bool IsNegInf(const Type /*x*/) { return false; }
-
-#define DECL_SIGNED_INT_LIMITS(IntType, UnsignedIntType) \
-template<> \
-struct LIBPROTOBUF_EXPORT MathLimits<IntType> { \
-  typedef IntType Type; \
-  typedef UnsignedIntType UnsignedType; \
-  static const bool kIsSigned = true; \
-  static const bool kIsInteger = true; \
-  static const Type kPosMin = 1; \
-  static const Type kPosMax = SIGNED_INT_MAX(Type); \
-  static const Type kMin = SIGNED_INT_MIN(Type); \
-  static const Type kMax = kPosMax; \
-  static const Type kNegMin = -1; \
-  static const Type kNegMax = kMin; \
-  static const int kMin10Exp = 0; \
-  static const int kMax10Exp = SIGNED_MAX_10_EXP(Type); \
-  static const Type kEpsilon = 1; \
-  static const Type kStdError = 0; \
-  DECL_INT_LIMIT_FUNCS \
-};
-
-#define DECL_UNSIGNED_INT_LIMITS(IntType) \
-template<> \
-struct LIBPROTOBUF_EXPORT MathLimits<IntType> { \
-  typedef IntType Type; \
-  typedef IntType UnsignedType; \
-  static const bool kIsSigned = false; \
-  static const bool kIsInteger = true; \
-  static const Type kPosMin = 1; \
-  static const Type kPosMax = UNSIGNED_INT_MAX(Type); \
-  static const Type kMin = 0; \
-  static const Type kMax = kPosMax; \
-  static const int kMin10Exp = 0; \
-  static const int kMax10Exp = UNSIGNED_MAX_10_EXP(Type); \
-  static const Type kEpsilon = 1; \
-  static const Type kStdError = 0; \
-  DECL_INT_LIMIT_FUNCS \
-};
-
-DECL_SIGNED_INT_LIMITS(signed char, unsigned char)
-DECL_SIGNED_INT_LIMITS(signed short int, unsigned short int)
-DECL_SIGNED_INT_LIMITS(signed int, unsigned int)
-DECL_SIGNED_INT_LIMITS(signed long int, unsigned long int)
-DECL_SIGNED_INT_LIMITS(signed long long int, unsigned long long int)
-DECL_UNSIGNED_INT_LIMITS(unsigned char)
-DECL_UNSIGNED_INT_LIMITS(unsigned short int)
-DECL_UNSIGNED_INT_LIMITS(unsigned int)
-DECL_UNSIGNED_INT_LIMITS(unsigned long int)
-DECL_UNSIGNED_INT_LIMITS(unsigned long long int)
-
-#undef DECL_SIGNED_INT_LIMITS
-#undef DECL_UNSIGNED_INT_LIMITS
-#undef SIGNED_INT_MAX
-#undef SIGNED_INT_MIN
-#undef UNSIGNED_INT_MAX
-#undef SIGNED_MAX_10_EXP
-#undef UNSIGNED_MAX_10_EXP
-#undef DECL_INT_LIMIT_FUNCS
-
-// For non-Windows builds we use the std:: versions of isinf and isnan if they
-// are available; see the comment about <cmath> at the top of this file for the
-// details on why we need to do this.
-#ifdef GOOGLE_PROTOBUF_USE_STD_CMATH
-#define ISINF std::isinf
-#define ISNAN std::isnan
-#else
-#define ISINF isinf
-#define ISNAN isnan
-#endif
-
-// ========================================================================= //
-#ifdef WIN32  // Lacks built-in isnan() and isinf()
-#define DECL_FP_LIMIT_FUNCS \
-  static bool IsFinite(const Type x) { return _finite(x); } \
-  static bool IsNaN(const Type x) { return _isnan(x); } \
-  static bool IsInf(const Type x) { return (_fpclass(x) & (_FPCLASS_NINF | _FPCLASS_PINF)) != 0; } \
-  static bool IsPosInf(const Type x) { return _fpclass(x) == _FPCLASS_PINF; } \
-  static bool IsNegInf(const Type x) { return _fpclass(x) == _FPCLASS_NINF; }
-#else
-#define DECL_FP_LIMIT_FUNCS \
-  static bool IsFinite(const Type x) { return !ISINF(x) && !ISNAN(x); } \
-  static bool IsNaN(const Type x) { return ISNAN(x); } \
-  static bool IsInf(const Type x) { return ISINF(x); } \
-  static bool IsPosInf(const Type x) { return ISINF(x) && x > 0; } \
-  static bool IsNegInf(const Type x) { return ISINF(x) && x < 0; }
-#endif
-
-// We can't put floating-point constant values in the header here because
-// such constants are not considered to be primitive-type constants by gcc.
-// CAVEAT: Hence, they are going to be initialized only during
-// the global objects construction time.
-#define DECL_FP_LIMITS(FP_Type, PREFIX) \
-template<> \
-struct LIBPROTOBUF_EXPORT MathLimits<FP_Type> { \
-  typedef FP_Type Type; \
-  typedef FP_Type UnsignedType; \
-  static const bool kIsSigned = true; \
-  static const bool kIsInteger = false; \
-  static const Type kPosMin; \
-  static const Type kPosMax; \
-  static const Type kMin; \
-  static const Type kMax; \
-  static const Type kNegMin; \
-  static const Type kNegMax; \
-  static const int kMin10Exp = PREFIX##_MIN_10_EXP; \
-  static const int kMax10Exp = PREFIX##_MAX_10_EXP; \
-  static const Type kEpsilon; \
-  static const Type kStdError; \
-  static const int kPrecisionDigits = PREFIX##_DIG; \
-  static const Type kNaN; \
-  static const Type kPosInf; \
-  static const Type kNegInf; \
-  DECL_FP_LIMIT_FUNCS \
-};
-
-DECL_FP_LIMITS(float, FLT)
-DECL_FP_LIMITS(double, DBL)
-DECL_FP_LIMITS(long double, LDBL)
-
-#undef ISINF
-#undef ISNAN
-#undef DECL_FP_LIMITS
-#undef DECL_FP_LIMIT_FUNCS
-
-// ========================================================================= //
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // UTIL_MATH_MATHLIMITS_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/mathutil.h b/3rdparty/protobuf/src/google/protobuf/stubs/mathutil.h
deleted file mode 100644 (file)
index 8a9f69a..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLE_PROTOBUF_STUBS_MATHUTIL_H_
-#define GOOGLE_PROTOBUF_STUBS_MATHUTIL_H_
-
-#include <float.h>
-#include <math.h>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/mathlimits.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-template<typename T>
-bool AlmostEquals(T a, T b) {
-  return a == b;
-}
-template<>
-inline bool AlmostEquals(float a, float b) {
-  return fabs(a - b) < 32 * FLT_EPSILON;
-}
-
-template<>
-inline bool AlmostEquals(double a, double b) {
-  return fabs(a - b) < 32 * DBL_EPSILON;
-}
-}  // namespace internal
-
-class MathUtil {
- public:
-  template<typename T>
-  static T Sign(T value) {
-    if (value == T(0) || MathLimits<T>::IsNaN(value)) {
-      return value;
-    }
-    return value > T(0) ? 1 : -1;
-  }
-
-  template<typename T>
-  static bool AlmostEquals(T a, T b) {
-    return ::google::protobuf::internal::AlmostEquals(a, b);
-  }
-
-  // Largest of two values.
-  // Works correctly for special floating point values.
-  // Note: 0.0 and -0.0 are not differentiated by Max (Max(0.0, -0.0) is -0.0),
-  // which should be OK because, although they (can) have different
-  // bit representation, they are observably the same when examined
-  // with arithmetic and (in)equality operators.
-  template<typename T>
-  static T Max(const T x, const T y) {
-    return MathLimits<T>::IsNaN(x) || x > y ? x : y;
-  }
-
-  // Absolute value of x
-  // Works correctly for unsigned types and
-  // for special floating point values.
-  // Note: 0.0 and -0.0 are not differentiated by Abs (Abs(0.0) is -0.0),
-  // which should be OK: see the comment for Max above.
-  template<typename T>
-  static T Abs(const T x) {
-    return x > T(0) ? x : -x;
-  }
-
-  // Absolute value of the difference between two numbers.
-  // Works correctly for signed types and special floating point values.
-  template<typename T>
-  static typename MathLimits<T>::UnsignedType AbsDiff(const T x, const T y) {
-    // Carries out arithmetic as unsigned to avoid overflow.
-    typedef typename MathLimits<T>::UnsignedType R;
-    return x > y ? R(x) - R(y) : R(y) - R(x);
-  }
-
-  // If two (usually floating point) numbers are within a certain
-  // fraction of their magnitude or within a certain absolute margin of error.
-  // This is the same as the following but faster:
-  //   WithinFraction(x, y, fraction)  ||  WithinMargin(x, y, margin)
-  // E.g. WithinFraction(0.0, 1e-10, 1e-5) is false but
-  //      WithinFractionOrMargin(0.0, 1e-10, 1e-5, 1e-5) is true.
-  template<typename T>
-  static bool WithinFractionOrMargin(const T x, const T y,
-                                     const T fraction, const T margin);
-};
-
-template<typename T>
-bool MathUtil::WithinFractionOrMargin(const T x, const T y,
-                                      const T fraction, const T margin) {
-  // Not just "0 <= fraction" to fool the compiler for unsigned types.
-  GOOGLE_DCHECK((T(0) < fraction || T(0) == fraction) &&
-         fraction < T(1) &&
-         margin >= T(0));
-
-  // Template specialization will convert the if() condition to a constant,
-  // which will cause the compiler to generate code for either the "if" part
-  // or the "then" part.  In this way we avoid a compiler warning
-  // about a potential integer overflow in crosstool v12 (gcc 4.3.1).
-  if (MathLimits<T>::kIsInteger) {
-    return x == y;
-  } else {
-    // IsFinite checks are to make kPosInf and kNegInf not within fraction
-    if (!MathLimits<T>::IsFinite(x) && !MathLimits<T>::IsFinite(y)) {
-      return false;
-    }
-    T relative_margin = static_cast<T>(fraction * Max(Abs(x), Abs(y)));
-    return AbsDiff(x, y) <= Max(margin, relative_margin);
-  }
-}
-
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_STUBS_MATHUTIL_H_
index 174290f..c459991 100644 (file)
 #ifndef GOOGLE_PROTOBUF_STUBS_MUTEX_H_
 #define GOOGLE_PROTOBUF_STUBS_MUTEX_H_
 
-#ifdef GOOGLE_PROTOBUF_NO_THREADLOCAL
-#include <pthread.h>
+#include <mutex>
+
+#ifdef GOOGLE_PROTOBUF_SUPPORT_WINDOWS_XP
+
+#include <windows.h>
+
+// GetMessage conflicts with GeneratedMessageReflection::GetMessage().
+#ifdef GetMessage
+#undef GetMessage
+#endif
+
 #endif
 
 #include <google/protobuf/stubs/macros.h>
 
+// Define thread-safety annotations for use below, if we are building with
+// Clang.
+#if defined(__clang__) && !defined(SWIG)
+#define GOOGLE_PROTOBUF_ACQUIRE(...) \
+  __attribute__((acquire_capability(__VA_ARGS__)))
+#define GOOGLE_PROTOBUF_RELEASE(...) \
+  __attribute__((release_capability(__VA_ARGS__)))
+#define GOOGLE_PROTOBUF_SCOPED_CAPABILITY __attribute__((scoped_lockable))
+#define GOOGLE_PROTOBUF_CAPABILITY(x) __attribute__((capability(x)))
+#else
+#define GOOGLE_PROTOBUF_ACQUIRE(...)
+#define GOOGLE_PROTOBUF_RELEASE(...)
+#define GOOGLE_PROTOBUF_SCOPED_CAPABILITY
+#define GOOGLE_PROTOBUF_CAPABILITY(x)
+#endif
+
+#include <google/protobuf/port_def.inc>
+
 // ===================================================================
 // emulates google3/base/mutex.h
 namespace google {
 namespace protobuf {
 namespace internal {
 
-// A Mutex is a non-reentrant (aka non-recursive) mutex.  At most one thread T
-// may hold a mutex at a given time.  If T attempts to Lock() the same Mutex
-// while holding it, T will deadlock.
-class LIBPROTOBUF_EXPORT Mutex {
+#define GOOGLE_PROTOBUF_LINKER_INITIALIZED
+
+#ifdef GOOGLE_PROTOBUF_SUPPORT_WINDOWS_XP
+
+// This class is a lightweight replacement for std::mutex on Windows platforms.
+// std::mutex does not work on Windows XP SP2 with the latest VC++ libraries,
+// because it utilizes the Concurrency Runtime that is only supported on Windows
+// XP SP3 and above.
+class PROTOBUF_EXPORT CriticalSectionLock {
  public:
-  // Create a Mutex that is not held by anybody.
-  Mutex();
+  CriticalSectionLock() { InitializeCriticalSection(&critical_section_); }
+  ~CriticalSectionLock() { DeleteCriticalSection(&critical_section_); }
+  void lock() { EnterCriticalSection(&critical_section_); }
+  void unlock() { LeaveCriticalSection(&critical_section_); }
+
+ private:
+  CRITICAL_SECTION critical_section_;
 
-  // Destructor
-  ~Mutex();
+  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CriticalSectionLock);
+};
+
+#endif
 
-  // Block if necessary until this Mutex is free, then acquire it exclusively.
-  void Lock();
+// In MSVC std::mutex does not have a constexpr constructor.
+// This wrapper makes the constructor constexpr.
+template <typename T>
+class CallOnceInitializedMutex {
+ public:
+  constexpr CallOnceInitializedMutex() : flag_{}, buf_{} {}
+  ~CallOnceInitializedMutex() { get().~T(); }
 
-  // Release this Mutex.  Caller must hold it exclusively.
-  void Unlock();
+  void lock() { get().lock(); }
+  void unlock() { get().unlock(); }
 
+ private:
+  T& get() {
+    std::call_once(flag_, [&] { ::new (static_cast<void*>(&buf_)) T(); });
+    return reinterpret_cast<T&>(buf_);
+  }
+
+  std::once_flag flag_;
+  alignas(T) char buf_[sizeof(T)];
+};
+
+// Mutex is a natural type to wrap. As both google and other organization have
+// specialized mutexes. gRPC also provides an injection mechanism for custom
+// mutexes.
+class GOOGLE_PROTOBUF_CAPABILITY("mutex") PROTOBUF_EXPORT WrappedMutex {
+ public:
+#if defined(__QNX__)
+  constexpr WrappedMutex() = default;
+#else
+  constexpr WrappedMutex() {}
+#endif
+  void Lock() GOOGLE_PROTOBUF_ACQUIRE() { mu_.lock(); }
+  void Unlock() GOOGLE_PROTOBUF_RELEASE() { mu_.unlock(); }
   // Crash if this Mutex is not held exclusively by this thread.
   // May fail to crash when it should; will never crash when it should not.
-  void AssertHeld();
+  void AssertHeld() const {}
 
  private:
-  struct Internal;
-  Internal* mInternal;
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Mutex);
+#if defined(GOOGLE_PROTOBUF_SUPPORT_WINDOWS_XP)
+  CallOnceInitializedMutex<CriticalSectionLock> mu_{};
+#elif defined(_WIN32)
+  CallOnceInitializedMutex<std::mutex> mu_{};
+#else
+  std::mutex mu_{};
+#endif
 };
 
+using Mutex = WrappedMutex;
+
 // MutexLock(mu) acquires mu when constructed and releases it when destroyed.
-class LIBPROTOBUF_EXPORT MutexLock {
+class GOOGLE_PROTOBUF_SCOPED_CAPABILITY PROTOBUF_EXPORT MutexLock {
  public:
-  explicit MutexLock(Mutex *mu) : mu_(mu) { this->mu_->Lock(); }
-  ~MutexLock() { this->mu_->Unlock(); }
+  explicit MutexLock(Mutex* mu) GOOGLE_PROTOBUF_ACQUIRE(mu) : mu_(mu) {
+    this->mu_->Lock();
+  }
+  ~MutexLock() GOOGLE_PROTOBUF_RELEASE() { this->mu_->Unlock(); }
+
  private:
   Mutex *const mu_;
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MutexLock);
@@ -84,12 +158,12 @@ class LIBPROTOBUF_EXPORT MutexLock {
 typedef MutexLock ReaderMutexLock;
 typedef MutexLock WriterMutexLock;
 
-// MutexLockMaybe is like MutexLock, but is a no-op when mu is NULL.
-class LIBPROTOBUF_EXPORT MutexLockMaybe {
+// MutexLockMaybe is like MutexLock, but is a no-op when mu is nullptr.
+class PROTOBUF_EXPORT MutexLockMaybe {
  public:
   explicit MutexLockMaybe(Mutex *mu) :
-    mu_(mu) { if (this->mu_ != NULL) { this->mu_->Lock(); } }
-  ~MutexLockMaybe() { if (this->mu_ != NULL) { this->mu_->Unlock(); } }
+    mu_(mu) { if (this->mu_ != nullptr) { this->mu_->Lock(); } }
+  ~MutexLockMaybe() { if (this->mu_ != nullptr) { this->mu_->Unlock(); } }
  private:
   Mutex *const mu_;
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MutexLockMaybe);
@@ -107,7 +181,7 @@ class ThreadLocalStorage {
   }
   T* Get() {
     T* result = static_cast<T*>(pthread_getspecific(key_));
-    if (result == NULL) {
+    if (result == nullptr) {
       result = new T();
       pthread_setspecific(key_, result);
     }
@@ -133,8 +207,12 @@ using internal::ReaderMutexLock;
 using internal::WriterMutexLock;
 using internal::MutexLockMaybe;
 
-
 }  // namespace protobuf
 }  // namespace google
 
+#undef GOOGLE_PROTOBUF_ACQUIRE
+#undef GOOGLE_PROTOBUF_RELEASE
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_MUTEX_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/once.cc b/3rdparty/protobuf/src/google/protobuf/stubs/once.cc
deleted file mode 100644 (file)
index 889c647..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//
-// emulates google3/base/once.h
-//
-// This header is intended to be included only by internal .cc files and
-// generated .pb.cc files.  Users should not use this directly.
-
-#include <google/protobuf/stubs/once.h>
-
-#ifndef GOOGLE_PROTOBUF_NO_THREAD_SAFETY
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <sched.h>
-#endif
-
-#include <google/protobuf/stubs/atomicops.h>
-
-namespace google {
-namespace protobuf {
-
-namespace {
-
-void SchedYield() {
-#ifdef _WIN32
-  Sleep(0);
-#else  // POSIX
-  sched_yield();
-#endif
-}
-
-}  // namespace
-
-void GoogleOnceInitImpl(ProtobufOnceType* once, Closure* closure) {
-  internal::AtomicWord state = internal::Acquire_Load(once);
-  // Fast path. The provided closure was already executed.
-  if (state == ONCE_STATE_DONE) {
-    return;
-  }
-  // The closure execution did not complete yet. The once object can be in one
-  // of the two following states:
-  //   - UNINITIALIZED: We are the first thread calling this function.
-  //   - EXECUTING_CLOSURE: Another thread is already executing the closure.
-  //
-  // First, try to change the state from UNINITIALIZED to EXECUTING_CLOSURE
-  // atomically.
-  state = internal::Acquire_CompareAndSwap(
-      once, ONCE_STATE_UNINITIALIZED, ONCE_STATE_EXECUTING_CLOSURE);
-  if (state == ONCE_STATE_UNINITIALIZED) {
-    // We are the first thread to call this function, so we have to call the
-    // closure.
-    closure->Run();
-    internal::Release_Store(once, ONCE_STATE_DONE);
-  } else {
-    // Another thread has already started executing the closure. We need to
-    // wait until it completes the initialization.
-    while (state == ONCE_STATE_EXECUTING_CLOSURE) {
-      // Note that futex() could be used here on Linux as an improvement.
-      SchedYield();
-      state = internal::Acquire_Load(once);
-    }
-  }
-}
-
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_NO_THREAD_SAFETY
index 1f082c3..070d36d 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Author: kenton@google.com (Kenton Varda)
-//
-// emulates google3/base/once.h
-//
-// This header is intended to be included only by internal .cc files and
-// generated .pb.cc files.  Users should not use this directly.
-//
-// This is basically a portable version of pthread_once().
-//
-// This header declares:
-// * A type called ProtobufOnceType.
-// * A macro GOOGLE_PROTOBUF_DECLARE_ONCE() which declares a variable of type
-//   ProtobufOnceType.  This is the only legal way to declare such a variable.
-//   The macro may only be used at the global scope (you cannot create local or
-//   class member variables of this type).
-// * A function GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()).
-//   This function, when invoked multiple times given the same ProtobufOnceType
-//   object, will invoke init_func on the first call only, and will make sure
-//   none of the calls return before that first call to init_func has finished.
-// * The user can provide a parameter which GoogleOnceInit() forwards to the
-//   user-provided function when it is called. Usage example:
-//     int a = 10;
-//     GoogleOnceInit(&my_once, &MyFunctionExpectingIntArgument, &a);
-// * This implementation guarantees that ProtobufOnceType is a POD (i.e. no
-//   static initializer generated).
-//
-// This implements a way to perform lazy initialization.  It's more efficient
-// than using mutexes as no lock is needed if initialization has already
-// happened.
-//
-// Example usage:
-//   void Init();
-//   GOOGLE_PROTOBUF_DECLARE_ONCE(once_init);
-//
-//   // Calls Init() exactly once.
-//   void InitOnce() {
-//     GoogleOnceInit(&once_init, &Init);
-//   }
-//
-// Note that if GoogleOnceInit() is called before main() has begun, it must
-// only be called by the thread that will eventually call main() -- that is,
-// the thread that performs dynamic initialization.  In general this is a safe
-// assumption since people don't usually construct threads before main() starts,
-// but it is technically not guaranteed.  Unfortunately, Win32 provides no way
-// whatsoever to statically-initialize its synchronization primitives, so our
-// only choice is to assume that dynamic initialization is single-threaded.
-
 #ifndef GOOGLE_PROTOBUF_STUBS_ONCE_H__
 #define GOOGLE_PROTOBUF_STUBS_ONCE_H__
 
-#include <google/protobuf/stubs/atomicops.h>
-#include <google/protobuf/stubs/callback.h>
-#include <google/protobuf/stubs/common.h>
+#include <mutex>
+#include <utility>
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
+namespace internal {
 
-#ifdef GOOGLE_PROTOBUF_NO_THREAD_SAFETY
-
-typedef bool ProtobufOnceType;
-
-#define GOOGLE_PROTOBUF_ONCE_INIT false
-
-inline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()) {
-  if (!*once) {
-    *once = true;
-    init_func();
-  }
-}
-
-template <typename Arg>
-inline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)(Arg),
-    Arg arg) {
-  if (!*once) {
-    *once = true;
-    init_func(arg);
-  }
+using once_flag = std::once_flag;
+template <typename... Args>
+void call_once(Args&&... args ) {
+  std::call_once(std::forward<Args>(args)...);
 }
 
-#else
-
-enum {
-  ONCE_STATE_UNINITIALIZED = 0,
-  ONCE_STATE_EXECUTING_CLOSURE = 1,
-  ONCE_STATE_DONE = 2
-};
-
-typedef internal::AtomicWord ProtobufOnceType;
-
-#define GOOGLE_PROTOBUF_ONCE_INIT ::google::protobuf::ONCE_STATE_UNINITIALIZED
-
-LIBPROTOBUF_EXPORT
-void GoogleOnceInitImpl(ProtobufOnceType* once, Closure* closure);
-
-inline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()) {
-  if (internal::Acquire_Load(once) != ONCE_STATE_DONE) {
-    internal::FunctionClosure0 func(init_func, false);
-    GoogleOnceInitImpl(once, &func);
-  }
-}
-
-template <typename Arg>
-inline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)(Arg*),
-    Arg* arg) {
-  if (internal::Acquire_Load(once) != ONCE_STATE_DONE) {
-    internal::FunctionClosure1<Arg*> func(init_func, false, arg);
-    GoogleOnceInitImpl(once, &func);
-  }
-}
-
-#endif  // GOOGLE_PROTOBUF_NO_THREAD_SAFETY
-
-class GoogleOnceDynamic {
- public:
-  GoogleOnceDynamic() : state_(GOOGLE_PROTOBUF_ONCE_INIT) { }
-
-  // If this->Init() has not been called before by any thread,
-  // execute (*func_with_arg)(arg) then return.
-  // Otherwise, wait until that prior invocation has finished
-  // executing its function, then return.
-  template<typename T>
-  void Init(void (*func_with_arg)(T*), T* arg) {
-    GoogleOnceInit<T>(&this->state_,
-                      func_with_arg,
-                      arg);
-  }
- private:
-  ProtobufOnceType state_;
-};
-
-#define GOOGLE_PROTOBUF_DECLARE_ONCE(NAME) \
-  ::google::protobuf::ProtobufOnceType NAME = GOOGLE_PROTOBUF_ONCE_INIT
-
+}  // namespace internal
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_ONCE_H__
index c3a64dd..2479960 100644 (file)
 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
 #elif defined(__QNX__)
 #define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1
+#if defined(__aarch64__)
+#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
+#else
 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
+#endif
 #elif defined(_M_ARM) || defined(__ARMEL__)
 #define GOOGLE_PROTOBUF_ARCH_ARM 1
 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
@@ -56,7 +60,7 @@
 #elif defined(__aarch64__)
 #define GOOGLE_PROTOBUF_ARCH_AARCH64 1
 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
-#elif defined(__MIPSEL__)
+#elif defined(__mips__)
 #if defined(__LP64__)
 #define GOOGLE_PROTOBUF_ARCH_MIPS64 1
 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
@@ -99,6 +103,7 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR
 
 #if defined(__APPLE__)
 #define GOOGLE_PROTOBUF_OS_APPLE
+#include <Availability.h>
 #include <TargetConditionals.h>
 #if TARGET_OS_IPHONE
 #define GOOGLE_PROTOBUF_OS_IPHONE
@@ -125,4 +130,9 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR
 #define GOOGLE_PROTOBUF_NO_THREADLOCAL
 #endif
 
+#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+// __thread keyword requires at least 10.7
+#define GOOGLE_PROTOBUF_NO_THREADLOCAL
+#endif
+
 #endif  // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_
index 658c969..045e25d 100644 (file)
 #define GOOGLE_PROTOBUF_STUBS_PORT_H_
 
 #include <assert.h>
+#include <cstdint>
 #include <stdlib.h>
 #include <cstddef>
 #include <string>
 #include <string.h>
-#if defined(__osf__)
-// Tru64 lacks stdint.h, but has inttypes.h which defines a superset of
-// what stdint.h would define.
-#include <inttypes.h>
-#elif !defined(_MSC_VER)
-#include <stdint.h>
-#endif
 
 #include <google/protobuf/stubs/platform_macros.h>
 
+#include <google/protobuf/port_def.inc>
+
 #undef PROTOBUF_LITTLE_ENDIAN
 #ifdef _WIN32
   // Assuming windows is always little-endian.
   #if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
     #define PROTOBUF_LITTLE_ENDIAN 1
   #endif
-  #if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
-    // If MSVC has "/RTCc" set, it will complain about truncating casts at
-    // runtime.  This file contains some intentional truncating casts.
-    #pragma runtime_checks("c", off)
-  #endif
+#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
+// If MSVC has "/RTCc" set, it will complain about truncating casts at
+// runtime.  This file contains some intentional truncating casts.
+#pragma runtime_checks("c", off)
+#endif
 #else
-  #include <sys/param.h>   // __BYTE_ORDER
-  #if defined(__OpenBSD__)
-    #include <endian.h>
-  #endif
-  #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
-         (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \
-         (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN)) && \
-      !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
-    #define PROTOBUF_LITTLE_ENDIAN 1
-  #endif
+#ifdef __APPLE__
+#include <machine/endian.h>  // __BYTE_ORDER
+#elif defined(__FreeBSD__)
+#include <sys/endian.h>  // __BYTE_ORDER
+#elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
+#include <sys/isa_defs.h>  // __BYTE_ORDER
+#elif defined(_AIX) || defined(__TOS_AIX__)
+#include <sys/machine.h>  // BYTE_ORDER
+#else
+#if !defined(__QNX__)
+#include <endian.h>  // __BYTE_ORDER
+#endif
+#endif
+#if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) ||   \
+     (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \
+     (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN)) &&      \
+    !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
+#define PROTOBUF_LITTLE_ENDIAN 1
+#endif
 #endif
+
+// These #includes are for the byte swap functions declared later on.
+#ifdef _MSC_VER
+#include <stdlib.h>  // NOLINT(build/include)
+#include <intrin.h>
+#elif defined(__APPLE__)
+#include <libkern/OSByteOrder.h>
+#elif defined(__linux__) || defined(__ANDROID__) || defined(__CYGWIN__)
+#include <byteswap.h>  // IWYU pragma: export
+#endif
+
+// Legacy: some users reference these (internal-only) macros even though we
+// don't need them any more.
 #if defined(_MSC_VER) && defined(PROTOBUF_USE_DLLS)
   #ifdef LIBPROTOBUF_EXPORTS
     #define LIBPROTOBUF_EXPORT __declspec(dllexport)
   #define LIBPROTOC_EXPORT
 #endif
 
-// These #includes are for the byte swap functions declared later on.
-#ifdef _MSC_VER
-#include <stdlib.h>  // NOLINT(build/include)
-#elif defined(__APPLE__)
-#include <libkern/OSByteOrder.h>
-#elif defined(__GLIBC__) || defined(__CYGWIN__)
-#include <byteswap.h>  // IWYU pragma: export
-#endif
-
-#define PROTOBUF_RUNTIME_DEPRECATED(message)
+#define PROTOBUF_RUNTIME_DEPRECATED(message) PROTOBUF_DEPRECATED_MSG(message)
+#define GOOGLE_PROTOBUF_RUNTIME_DEPRECATED(message) \
+  PROTOBUF_DEPRECATED_MSG(message)
 
 // ===================================================================
 // from google3/base/port.h
 // undefined otherwise.  Do NOT define it to 0 -- that causes
 // '#ifdef LANG_CXX11' to behave differently from '#if LANG_CXX11'.
 #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
+#error "Protobuf requires at least C++11."
 #endif
 
 namespace google {
 namespace protobuf {
 
+using ConstStringParam = const std::string &;
+
 typedef unsigned int uint;
 
-#ifdef _MSC_VER
-typedef signed __int8  int8;
-typedef __int16 int16;
-typedef __int32 int32;
-typedef __int64 int64;
-
-typedef unsigned __int8  uint8;
-typedef unsigned __int16 uint16;
-typedef unsigned __int32 uint32;
-typedef unsigned __int64 uint64;
-#else
 typedef int8_t int8;
 typedef int16_t int16;
 typedef int32_t int32;
@@ -147,123 +139,13 @@ typedef uint8_t uint8;
 typedef uint16_t uint16;
 typedef uint32_t uint32;
 typedef uint64_t uint64;
-#endif
-
-// long long macros to be used because gcc and vc++ use different suffixes,
-// and different size specifiers in format strings
-#undef GOOGLE_LONGLONG
-#undef GOOGLE_ULONGLONG
-#undef GOOGLE_LL_FORMAT
-
-#ifdef _MSC_VER
-#define GOOGLE_LONGLONG(x) x##I64
-#define GOOGLE_ULONGLONG(x) x##UI64
-#define GOOGLE_LL_FORMAT "I64"  // As in printf("%I64d", ...)
-#else
-// By long long, we actually mean int64.
-#define GOOGLE_LONGLONG(x) x##LL
-#define GOOGLE_ULONGLONG(x) x##ULL
-// Used to format real long long integers.
-#define GOOGLE_LL_FORMAT "ll"  // As in "%lld". Note that "q" is poor form also.
-#endif
 
 static const int32 kint32max = 0x7FFFFFFF;
 static const int32 kint32min = -kint32max - 1;
-static const int64 kint64max = GOOGLE_LONGLONG(0x7FFFFFFFFFFFFFFF);
+static const int64 kint64max = int64_t{0x7FFFFFFFFFFFFFFF};
 static const int64 kint64min = -kint64max - 1;
 static const uint32 kuint32max = 0xFFFFFFFFu;
-static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF);
-
-// -------------------------------------------------------------------
-// Annotations:  Some parts of the code have been annotated in ways that might
-//   be useful to some compilers or tools, but are not supported universally.
-//   You can #define these annotations yourself if the default implementation
-//   is not right for you.
-
-#ifndef GOOGLE_ATTRIBUTE_ALWAYS_INLINE
-#if defined(__GNUC__) && (__GNUC__ > 3 ||(__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
-// For functions we want to force inline.
-// Introduced in gcc 3.1.
-#define GOOGLE_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((always_inline))
-#else
-// Other compilers will have to figure it out for themselves.
-#define GOOGLE_ATTRIBUTE_ALWAYS_INLINE
-#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.
-// Introduced in gcc 3.1.
-#define GOOGLE_ATTRIBUTE_NOINLINE __attribute__ ((noinline))
-#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
-// Seems to have been around since at least Visual Studio 2005
-#define GOOGLE_ATTRIBUTE_NOINLINE __declspec(noinline)
-#else
-// Other compilers will have to figure it out for themselves.
-#define GOOGLE_ATTRIBUTE_NOINLINE
-#endif
-#endif
-
-#define GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE GOOGLE_ATTRIBUTE_NOINLINE
-
-#ifndef GOOGLE_PREDICT_TRUE
-#ifdef __GNUC__
-// Provided at least since GCC 3.0.
-#define GOOGLE_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
-#else
-#define GOOGLE_PREDICT_TRUE(x) (x)
-#endif
-#endif
-
-#ifndef GOOGLE_PREDICT_FALSE
-#ifdef __GNUC__
-// Provided at least since GCC 3.0.
-#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0))
-#else
-#define GOOGLE_PREDICT_FALSE(x) (x)
-#endif
-#endif
-
-// Delimits a block of code which may write to memory which is simultaneously
-// written by other threads, but which has been determined to be thread-safe
-// (e.g. because it is an idempotent write).
-#ifndef GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN
-#define GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN()
-#endif
-#ifndef GOOGLE_SAFE_CONCURRENT_WRITES_END
-#define GOOGLE_SAFE_CONCURRENT_WRITES_END()
-#endif
-
-#if defined(__clang__) && defined(__has_cpp_attribute) \
-    && !defined(GOOGLE_PROTOBUF_OS_APPLE)
-# if defined(GOOGLE_PROTOBUF_OS_NACL) || __has_cpp_attribute(clang::fallthrough)
-#  define GOOGLE_FALLTHROUGH_INTENDED [[clang::fallthrough]]
-# endif
-#elif defined(__GNUC__) && __GNUC__ > 6
-# define GOOGLE_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
-#endif
-
-#ifndef GOOGLE_FALLTHROUGH_INTENDED
-# define GOOGLE_FALLTHROUGH_INTENDED
-#endif
-
-#define GOOGLE_GUARDED_BY(x)
-#define GOOGLE_ATTRIBUTE_COLD
-
-#ifdef GOOGLE_PROTOBUF_DONT_USE_UNALIGNED
-# define GOOGLE_PROTOBUF_USE_UNALIGNED 0
-#else
-# if defined(_M_X64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__)
-#  define GOOGLE_PROTOBUF_USE_UNALIGNED 1
-# else
-#  define GOOGLE_PROTOBUF_USE_UNALIGNED 0
-# endif
-#endif
-
-#define GOOGLE_PROTOBUF_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_COLD
+static const uint64 kuint64max = uint64_t{0xFFFFFFFFFFFFFFFFu};
 
 #if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) ||\
     defined(MEMORY_SANITIZER)
@@ -305,7 +187,7 @@ inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) {
   __sanitizer_unaligned_store64(p, v);
 }
 
-#elif GOOGLE_PROTOBUF_USE_UNALIGNED
+#elif defined(GOOGLE_PROTOBUF_USE_UNALIGNED) && GOOGLE_PROTOBUF_USE_UNALIGNED
 
 #define GOOGLE_UNALIGNED_LOAD16(_p) (*reinterpret_cast<const uint16 *>(_p))
 #define GOOGLE_UNALIGNED_LOAD32(_p) (*reinterpret_cast<const uint32 *>(_p))
@@ -347,10 +229,11 @@ inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) {
 }
 #endif
 
-#if defined(_MSC_VER)
-#define GOOGLE_THREAD_LOCAL __declspec(thread)
-#else
-#define GOOGLE_THREAD_LOCAL __thread
+#if defined(GOOGLE_PROTOBUF_OS_NACL) \
+    || (defined(__ANDROID__) && defined(__clang__) \
+        && (__clang_major__ == 3 && __clang_minor__ == 8) \
+        && (__clang_patchlevel__ < 275480))
+# define GOOGLE_PROTOBUF_USE_PORTABLE_LOG2
 #endif
 
 // The following guarantees declaration of the byte swap functions.
@@ -365,12 +248,16 @@ inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) {
 #define bswap_32(x) OSSwapInt32(x)
 #define bswap_64(x) OSSwapInt64(x)
 
-#elif !defined(__GLIBC__) && !defined(__CYGWIN__)
+#elif !defined(__linux__) && !defined(__ANDROID__) && !defined(__CYGWIN__)
 
+#ifndef bswap_16
 static inline uint16 bswap_16(uint16 x) {
   return static_cast<uint16>(((x & 0xFF) << 8) | ((x & 0xFF00) >> 8));
 }
 #define bswap_16(x) bswap_16(x)
+#endif
+
+#ifndef bswap_32
 static inline uint32 bswap_32(uint32 x) {
   return (((x & 0xFF) << 24) |
           ((x & 0xFF00) << 8) |
@@ -378,17 +265,20 @@ static inline uint32 bswap_32(uint32 x) {
           ((x & 0xFF000000) >> 24));
 }
 #define bswap_32(x) bswap_32(x)
+#endif
+
+#ifndef bswap_64
 static inline uint64 bswap_64(uint64 x) {
-  return (((x & GOOGLE_ULONGLONG(0xFF)) << 56) |
-          ((x & GOOGLE_ULONGLONG(0xFF00)) << 40) |
-          ((x & GOOGLE_ULONGLONG(0xFF0000)) << 24) |
-          ((x & GOOGLE_ULONGLONG(0xFF000000)) << 8) |
-          ((x & GOOGLE_ULONGLONG(0xFF00000000)) >> 8) |
-          ((x & GOOGLE_ULONGLONG(0xFF0000000000)) >> 24) |
-          ((x & GOOGLE_ULONGLONG(0xFF000000000000)) >> 40) |
-          ((x & GOOGLE_ULONGLONG(0xFF00000000000000)) >> 56));
+  return (((x & uint64_t{0xFFu}) << 56) | ((x & uint64_t{0xFF00u}) << 40) |
+          ((x & uint64_t{0xFF0000u}) << 24) |
+          ((x & uint64_t{0xFF000000u}) << 8) |
+          ((x & uint64_t{0xFF00000000u}) >> 8) |
+          ((x & uint64_t{0xFF0000000000u}) >> 24) |
+          ((x & uint64_t{0xFF000000000000u}) >> 40) |
+          ((x & uint64_t{0xFF00000000000000u}) >> 56));
 }
 #define bswap_64(x) bswap_64(x)
+#endif
 
 #endif
 
@@ -400,25 +290,28 @@ class Bits {
   static uint32 Log2FloorNonZero(uint32 n) {
 #if defined(__GNUC__)
   return 31 ^ static_cast<uint32>(__builtin_clz(n));
-#elif defined(COMPILER_MSVC) && defined(_M_IX86)
-  _asm {
-    bsr ebx, n
-    mov n, ebx
-  }
-  return n;
+#elif defined(_MSC_VER)
+  unsigned long where;
+  _BitScanReverse(&where, n);
+  return where;
 #else
   return Log2FloorNonZero_Portable(n);
 #endif
   }
 
   static uint32 Log2FloorNonZero64(uint64 n) {
-    // arm-nacl-clang runs into an instruction-selection failure when it
-    // encounters __builtin_clzll:
+    // Older versions of clang run into an instruction-selection failure when
+    // it encounters __builtin_clzll:
     // https://bugs.chromium.org/p/nativeclient/issues/detail?id=4395
-    // To work around this, when we build for NaCl we use the portable
+    // This includes arm-nacl-clang and clang in older Android NDK versions.
+    // To work around this, when we build with those we use the portable
     // implementation instead.
-#if defined(__GNUC__) && !defined(GOOGLE_PROTOBUF_OS_NACL)
+#if defined(__GNUC__) && !defined(GOOGLE_PROTOBUF_USE_PORTABLE_LOG2)
   return 63 ^ static_cast<uint32>(__builtin_clzll(n));
+#elif defined(_MSC_VER) && defined(_M_X64)
+  unsigned long where;
+  _BitScanReverse64(&where, n);
+  return where;
 #else
   return Log2FloorNonZero64_Portable(n);
 #endif
@@ -454,7 +347,7 @@ class Bits {
 
 // ===================================================================
 // from google3/util/endian/endian.h
-LIBPROTOBUF_EXPORT uint32 ghtonl(uint32 x);
+PROTOBUF_EXPORT uint32 ghtonl(uint32 x);
 
 class BigEndian {
  public:
@@ -512,13 +405,9 @@ class BigEndian {
   }
 };
 
-#ifndef GOOGLE_ATTRIBUTE_SECTION_VARIABLE
-#define GOOGLE_ATTRIBUTE_SECTION_VARIABLE(name)
-#endif
-
-#define GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(name)
-
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_PORT_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/scoped_ptr.h b/3rdparty/protobuf/src/google/protobuf/stubs/scoped_ptr.h
deleted file mode 100644 (file)
index 4423c11..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_STUBS_SCOPED_PTR_H_
-#define GOOGLE_PROTOBUF_STUBS_SCOPED_PTR_H_
-
-#include <google/protobuf/stubs/port.h>
-
-namespace google {
-namespace protobuf {
-
-// ===================================================================
-// from google3/base/scoped_ptr.h
-
-namespace internal {
-
-//  This is an implementation designed to match the anticipated future TR2
-//  implementation of the scoped_ptr class, and its closely-related brethren,
-//  scoped_array, scoped_ptr_malloc, and make_scoped_ptr.
-
-template <class C> class scoped_ptr;
-template <class C> class scoped_array;
-
-// A scoped_ptr<T> is like a T*, except that the destructor of scoped_ptr<T>
-// automatically deletes the pointer it holds (if any).
-// That is, scoped_ptr<T> owns the T object that it points to.
-// Like a T*, a scoped_ptr<T> may hold either NULL or a pointer to a T object.
-//
-// The size of a scoped_ptr is small:
-// sizeof(scoped_ptr<C>) == sizeof(C*)
-template <class C>
-class scoped_ptr {
- public:
-
-  // The element type
-  typedef C element_type;
-
-  // Constructor.  Defaults to initializing with NULL.
-  // There is no way to create an uninitialized scoped_ptr.
-  // The input parameter must be allocated with new.
-  explicit scoped_ptr(C* p = NULL) : ptr_(p) { }
-
-  // Destructor.  If there is a C object, delete it.
-  // We don't need to test ptr_ == NULL because C++ does that for us.
-  ~scoped_ptr() {
-    enum { type_must_be_complete = sizeof(C) };
-    delete ptr_;
-  }
-
-  // Reset.  Deletes the current owned object, if any.
-  // Then takes ownership of a new object, if given.
-  // this->reset(this->get()) works.
-  void reset(C* p = NULL) {
-    if (p != ptr_) {
-      enum { type_must_be_complete = sizeof(C) };
-      delete ptr_;
-      ptr_ = p;
-    }
-  }
-
-  // Accessors to get the owned object.
-  // operator* and operator-> will assert() if there is no current object.
-  C& operator*() const {
-    assert(ptr_ != NULL);
-    return *ptr_;
-  }
-  C* operator->() const  {
-    assert(ptr_ != NULL);
-    return ptr_;
-  }
-  C* get() const { return ptr_; }
-
-  // Comparison operators.
-  // These return whether two scoped_ptr refer to the same object, not just to
-  // two different but equal objects.
-  bool operator==(C* p) const { return ptr_ == p; }
-  bool operator!=(C* p) const { return ptr_ != p; }
-
-  // Swap two scoped pointers.
-  void swap(scoped_ptr& p2) {
-    C* tmp = ptr_;
-    ptr_ = p2.ptr_;
-    p2.ptr_ = tmp;
-  }
-
-  // Release a pointer.
-  // The return value is the current pointer held by this object.
-  // If this object holds a NULL pointer, the return value is NULL.
-  // After this operation, this object will hold a NULL pointer,
-  // and will not own the object any more.
-  C* release() {
-    C* retVal = ptr_;
-    ptr_ = NULL;
-    return retVal;
-  }
-
- private:
-  C* ptr_;
-
-  // Forbid comparison of scoped_ptr types.  If C2 != C, it totally doesn't
-  // make sense, and if C2 == C, it still doesn't make sense because you should
-  // never have the same object owned by two different scoped_ptrs.
-  template <class C2> bool operator==(scoped_ptr<C2> const& p2) const;
-  template <class C2> bool operator!=(scoped_ptr<C2> const& p2) const;
-
-  // Disallow evil constructors
-  scoped_ptr(const scoped_ptr&);
-  void operator=(const scoped_ptr&);
-};
-
-// scoped_array<C> is like scoped_ptr<C>, except that the caller must allocate
-// with new [] and the destructor deletes objects with delete [].
-//
-// As with scoped_ptr<C>, a scoped_array<C> either points to an object
-// or is NULL.  A scoped_array<C> owns the object that it points to.
-//
-// Size: sizeof(scoped_array<C>) == sizeof(C*)
-template <class C>
-class scoped_array {
- public:
-
-  // The element type
-  typedef C element_type;
-
-  // Constructor.  Defaults to initializing with NULL.
-  // There is no way to create an uninitialized scoped_array.
-  // The input parameter must be allocated with new [].
-  explicit scoped_array(C* p = NULL) : array_(p) { }
-
-  // Destructor.  If there is a C object, delete it.
-  // We don't need to test ptr_ == NULL because C++ does that for us.
-  ~scoped_array() {
-    enum { type_must_be_complete = sizeof(C) };
-    delete[] array_;
-  }
-
-  // Reset.  Deletes the current owned object, if any.
-  // Then takes ownership of a new object, if given.
-  // this->reset(this->get()) works.
-  void reset(C* p = NULL) {
-    if (p != array_) {
-      enum { type_must_be_complete = sizeof(C) };
-      delete[] array_;
-      array_ = p;
-    }
-  }
-
-  // Get one element of the current object.
-  // Will assert() if there is no current object, or index i is negative.
-  C& operator[](std::ptrdiff_t i) const {
-    assert(i >= 0);
-    assert(array_ != NULL);
-    return array_[i];
-  }
-
-  // Get a pointer to the zeroth element of the current object.
-  // If there is no current object, return NULL.
-  C* get() const {
-    return array_;
-  }
-
-  // Comparison operators.
-  // These return whether two scoped_array refer to the same object, not just to
-  // two different but equal objects.
-  bool operator==(C* p) const { return array_ == p; }
-  bool operator!=(C* p) const { return array_ != p; }
-
-  // Swap two scoped arrays.
-  void swap(scoped_array& p2) {
-    C* tmp = array_;
-    array_ = p2.array_;
-    p2.array_ = tmp;
-  }
-
-  // Release an array.
-  // The return value is the current pointer held by this object.
-  // If this object holds a NULL pointer, the return value is NULL.
-  // After this operation, this object will hold a NULL pointer,
-  // and will not own the object any more.
-  C* release() {
-    C* retVal = array_;
-    array_ = NULL;
-    return retVal;
-  }
-
- private:
-  C* array_;
-
-  // Forbid comparison of different scoped_array types.
-  template <class C2> bool operator==(scoped_array<C2> const& p2) const;
-  template <class C2> bool operator!=(scoped_array<C2> const& p2) const;
-
-  // Disallow evil constructors
-  scoped_array(const scoped_array&);
-  void operator=(const scoped_array&);
-};
-
-}  // namespace internal
-
-// We made these internal so that they would show up as such in the docs,
-// but we don't want to stick "internal::" in front of them everywhere.
-using internal::scoped_ptr;
-using internal::scoped_array;
-
-
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_STUBS_SCOPED_PTR_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/shared_ptr.h b/3rdparty/protobuf/src/google/protobuf/stubs/shared_ptr.h
deleted file mode 100644 (file)
index 7da114e..0000000
+++ /dev/null
@@ -1,471 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2014 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.
-
-// from google3/util/gtl/shared_ptr.h
-
-#ifndef GOOGLE_PROTOBUF_STUBS_SHARED_PTR_H__
-#define GOOGLE_PROTOBUF_STUBS_SHARED_PTR_H__
-
-#include <google/protobuf/stubs/atomicops.h>
-
-#include <algorithm>  // for swap
-#include <stddef.h>
-#include <memory>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// Alias to std::shared_ptr for any C++11 platform,
-// and for any supported MSVC compiler.
-#if !defined(UTIL_GTL_USE_STD_SHARED_PTR) && \
-    (defined(COMPILER_MSVC) || defined(LANG_CXX11))
-#define UTIL_GTL_USE_STD_SHARED_PTR 1
-#endif
-
-#if defined(UTIL_GTL_USE_STD_SHARED_PTR) && UTIL_GTL_USE_STD_SHARED_PTR
-
-// These are transitional.  They will be going away soon.
-// Please just #include <memory> and just type std::shared_ptr yourself, instead
-// of relying on this file.
-//
-// Migration doc: http://go/std-shared-ptr-lsc
-using std::enable_shared_from_this;
-using std::shared_ptr;
-using std::static_pointer_cast;
-using std::weak_ptr;
-
-#else  // below, UTIL_GTL_USE_STD_SHARED_PTR not set or set to 0.
-
-// For everything else there is the google3 implementation.
-inline bool RefCountDec(volatile Atomic32 *ptr) {
-  return Barrier_AtomicIncrement(ptr, -1) != 0;
-}
-
-inline void RefCountInc(volatile Atomic32 *ptr) {
-  NoBarrier_AtomicIncrement(ptr, 1);
-}
-
-template <typename T> class shared_ptr;
-template <typename T> class weak_ptr;
-
-// This class is an internal implementation detail for shared_ptr. If two
-// shared_ptrs point to the same object, they also share a control block.
-// An "empty" shared_pointer refers to NULL and also has a NULL control block.
-// It contains all of the state that's needed for reference counting or any
-// other kind of resource management. In this implementation the control block
-// happens to consist of two atomic words, the reference count (the number
-// of shared_ptrs that share ownership of the object) and the weak count
-// (the number of weak_ptrs that observe the object, plus 1 if the
-// refcount is nonzero).
-//
-// The "plus 1" is to prevent a race condition in the shared_ptr and
-// weak_ptr destructors. We need to make sure the control block is
-// only deleted once, so we need to make sure that at most one
-// object sees the weak count decremented from 1 to 0.
-class SharedPtrControlBlock {
-  template <typename T> friend class shared_ptr;
-  template <typename T> friend class weak_ptr;
- private:
-  SharedPtrControlBlock() : refcount_(1), weak_count_(1) { }
-  Atomic32 refcount_;
-  Atomic32 weak_count_;
-};
-
-// Forward declaration. The class is defined below.
-template <typename T> class enable_shared_from_this;
-
-template <typename T>
-class shared_ptr {
-  template <typename U> friend class weak_ptr;
- public:
-  typedef T element_type;
-
-  shared_ptr() : ptr_(NULL), control_block_(NULL) {}
-
-  explicit shared_ptr(T* ptr)
-      : ptr_(ptr),
-        control_block_(ptr != NULL ? new SharedPtrControlBlock : NULL) {
-    // If p is non-null and T inherits from enable_shared_from_this, we
-    // set up the data that shared_from_this needs.
-    MaybeSetupWeakThis(ptr);
-  }
-
-  // Copy constructor: makes this object a copy of ptr, and increments
-  // the reference count.
-  template <typename U>
-  shared_ptr(const shared_ptr<U>& ptr)
-      : ptr_(NULL),
-        control_block_(NULL) {
-    Initialize(ptr);
-  }
-  // Need non-templated version to prevent the compiler-generated default
-  shared_ptr(const shared_ptr<T>& ptr)
-      : ptr_(NULL),
-        control_block_(NULL) {
-    Initialize(ptr);
-  }
-
-  // Assignment operator. Replaces the existing shared_ptr with ptr.
-  // Increment ptr's reference count and decrement the one being replaced.
-  template <typename U>
-  shared_ptr<T>& operator=(const shared_ptr<U>& ptr) {
-    if (ptr_ != ptr.ptr_) {
-      shared_ptr<T> me(ptr);   // will hold our previous state to be destroyed.
-      swap(me);
-    }
-    return *this;
-  }
-
-  // Need non-templated version to prevent the compiler-generated default
-  shared_ptr<T>& operator=(const shared_ptr<T>& ptr) {
-    if (ptr_ != ptr.ptr_) {
-      shared_ptr<T> me(ptr);   // will hold our previous state to be destroyed.
-      swap(me);
-    }
-    return *this;
-  }
-
-  // TODO(austern): Consider providing this constructor. The draft C++ standard
-  // (20.8.10.2.1) includes it. However, it says that this constructor throws
-  // a bad_weak_ptr exception when ptr is expired. Is it better to provide this
-  // constructor and make it do something else, like fail with a CHECK, or to
-  // leave this constructor out entirely?
-  //
-  // template <typename U>
-  // shared_ptr(const weak_ptr<U>& ptr);
-
-  ~shared_ptr() {
-    if (ptr_ != NULL) {
-      if (!RefCountDec(&control_block_->refcount_)) {
-        delete ptr_;
-
-        // weak_count_ is defined as the number of weak_ptrs that observe
-        // ptr_, plus 1 if refcount_ is nonzero.
-        if (!RefCountDec(&control_block_->weak_count_)) {
-          delete control_block_;
-        }
-      }
-    }
-  }
-
-  // Replaces underlying raw pointer with the one passed in.  The reference
-  // count is set to one (or zero if the pointer is NULL) for the pointer
-  // being passed in and decremented for the one being replaced.
-  //
-  // If you have a compilation error with this code, make sure you aren't
-  // passing NULL, nullptr, or 0 to this function.  Call reset without an
-  // argument to reset to a null ptr.
-  template <typename Y>
-  void reset(Y* p) {
-    if (p != ptr_) {
-      shared_ptr<T> tmp(p);
-      tmp.swap(*this);
-    }
-  }
-
-  void reset() {
-    reset(static_cast<T*>(NULL));
-  }
-
-  // Exchanges the contents of this with the contents of r.  This function
-  // supports more efficient swapping since it eliminates the need for a
-  // temporary shared_ptr object.
-  void swap(shared_ptr<T>& r) {
-    using std::swap;  // http://go/using-std-swap
-    swap(ptr_, r.ptr_);
-    swap(control_block_, r.control_block_);
-  }
-
-  // The following function is useful for gaining access to the underlying
-  // pointer when a shared_ptr remains in scope so the reference-count is
-  // known to be > 0 (e.g. for parameter passing).
-  T* get() const {
-    return ptr_;
-  }
-
-  T& operator*() const {
-    return *ptr_;
-  }
-
-  T* operator->() const {
-    return ptr_;
-  }
-
-  long use_count() const {
-    return control_block_ ? control_block_->refcount_ : 1;
-  }
-
-  bool unique() const {
-    return use_count() == 1;
-  }
-
- private:
-  // If r is non-empty, initialize *this to share ownership with r,
-  // increasing the underlying reference count.
-  // If r is empty, *this remains empty.
-  // Requires: this is empty, namely this->ptr_ == NULL.
-  template <typename U>
-  void Initialize(const shared_ptr<U>& r) {
-    // This performs a static_cast on r.ptr_ to U*, which is a no-op since it
-    // is already a U*. So initialization here requires that r.ptr_ is
-    // implicitly convertible to T*.
-    InitializeWithStaticCast<U>(r);
-  }
-
-  // Initializes *this as described in Initialize, but additionally performs a
-  // static_cast from r.ptr_ (V*) to U*.
-  // NOTE(gfc): We'd need a more general form to support const_pointer_cast and
-  // dynamic_pointer_cast, but those operations are sufficiently discouraged
-  // that supporting static_pointer_cast is sufficient.
-  template <typename U, typename V>
-  void InitializeWithStaticCast(const shared_ptr<V>& r) {
-    if (r.control_block_ != NULL) {
-      RefCountInc(&r.control_block_->refcount_);
-
-      ptr_ = static_cast<U*>(r.ptr_);
-      control_block_ = r.control_block_;
-    }
-  }
-
-  // Helper function for the constructor that takes a raw pointer. If T
-  // doesn't inherit from enable_shared_from_this<T> then we have nothing to
-  // do, so this function is trivial and inline. The other version is declared
-  // out of line, after the class definition of enable_shared_from_this.
-  void MaybeSetupWeakThis(enable_shared_from_this<T>* ptr);
-  void MaybeSetupWeakThis(...) { }
-
-  T* ptr_;
-  SharedPtrControlBlock* control_block_;
-
-#ifndef SWIG
-  template <typename U>
-  friend class shared_ptr;
-
-  template <typename U, typename V>
-  friend shared_ptr<U> static_pointer_cast(const shared_ptr<V>& rhs);
-#endif
-};
-
-// Matches the interface of std::swap as an aid to generic programming.
-template <typename T> void swap(shared_ptr<T>& r, shared_ptr<T>& s) {
-  r.swap(s);
-}
-
-template <typename T, typename U>
-shared_ptr<T> static_pointer_cast(const shared_ptr<U>& rhs) {
-  shared_ptr<T> lhs;
-  lhs.template InitializeWithStaticCast<T>(rhs);
-  return lhs;
-}
-
-// See comments at the top of the file for a description of why this
-// class exists, and the draft C++ standard (as of July 2009 the
-// latest draft is N2914) for the detailed specification.
-template <typename T>
-class weak_ptr {
-  template <typename U> friend class weak_ptr;
- public:
-  typedef T element_type;
-
-  // Create an empty (i.e. already expired) weak_ptr.
-  weak_ptr() : ptr_(NULL), control_block_(NULL) { }
-
-  // Create a weak_ptr that observes the same object that ptr points
-  // to.  Note that there is no race condition here: we know that the
-  // control block can't disappear while we're looking at it because
-  // it is owned by at least one shared_ptr, ptr.
-  template <typename U> weak_ptr(const shared_ptr<U>& ptr) {
-    CopyFrom(ptr.ptr_, ptr.control_block_);
-  }
-
-  // Copy a weak_ptr. The object it points to might disappear, but we
-  // don't care: we're only working with the control block, and it can't
-  // disappear while we're looking at because it's owned by at least one
-  // weak_ptr, ptr.
-  template <typename U> weak_ptr(const weak_ptr<U>& ptr) {
-    CopyFrom(ptr.ptr_, ptr.control_block_);
-  }
-
-  // Need non-templated version to prevent default copy constructor
-  weak_ptr(const weak_ptr& ptr) {
-    CopyFrom(ptr.ptr_, ptr.control_block_);
-  }
-
-  // Destroy the weak_ptr. If no shared_ptr owns the control block, and if
-  // we are the last weak_ptr to own it, then it can be deleted. Note that
-  // weak_count_ is defined as the number of weak_ptrs sharing this control
-  // block, plus 1 if there are any shared_ptrs. We therefore know that it's
-  // safe to delete the control block when weak_count_ reaches 0, without
-  // having to perform any additional tests.
-  ~weak_ptr() {
-    if (control_block_ != NULL &&
-        !RefCountDec(&control_block_->weak_count_)) {
-      delete control_block_;
-    }
-  }
-
-  weak_ptr& operator=(const weak_ptr& ptr) {
-    if (&ptr != this) {
-      weak_ptr tmp(ptr);
-      tmp.swap(*this);
-    }
-    return *this;
-  }
-  template <typename U> weak_ptr& operator=(const weak_ptr<U>& ptr) {
-    weak_ptr tmp(ptr);
-    tmp.swap(*this);
-    return *this;
-  }
-  template <typename U> weak_ptr& operator=(const shared_ptr<U>& ptr) {
-    weak_ptr tmp(ptr);
-    tmp.swap(*this);
-    return *this;
-  }
-
-  void swap(weak_ptr& ptr) {
-    using std::swap;  // http://go/using-std-swap
-    swap(ptr_, ptr.ptr_);
-    swap(control_block_, ptr.control_block_);
-  }
-
-  void reset() {
-    weak_ptr tmp;
-    tmp.swap(*this);
-  }
-
-  // Return the number of shared_ptrs that own the object we are observing.
-  // Note that this number can be 0 (if this pointer has expired).
-  long use_count() const {
-    return control_block_ != NULL ? control_block_->refcount_ : 0;
-  }
-
-  bool expired() const { return use_count() == 0; }
-
-  // Return a shared_ptr that owns the object we are observing. If we
-  // have expired, the shared_ptr will be empty. We have to be careful
-  // about concurrency, though, since some other thread might be
-  // destroying the last owning shared_ptr while we're in this
-  // function.  We want to increment the refcount only if it's nonzero
-  // and get the new value, and we want that whole operation to be
-  // atomic.
-  shared_ptr<T> lock() const {
-    shared_ptr<T> result;
-    if (control_block_ != NULL) {
-      Atomic32 old_refcount;
-      do {
-        old_refcount = control_block_->refcount_;
-        if (old_refcount == 0)
-          break;
-      } while (old_refcount !=
-               NoBarrier_CompareAndSwap(
-                   &control_block_->refcount_, old_refcount,
-                   old_refcount + 1));
-      if (old_refcount > 0) {
-        result.ptr_ = ptr_;
-        result.control_block_ = control_block_;
-      }
-    }
-
-    return result;
-  }
-
- private:
-  void CopyFrom(T* ptr, SharedPtrControlBlock* control_block) {
-    ptr_ = ptr;
-    control_block_ = control_block;
-    if (control_block_ != NULL)
-      RefCountInc(&control_block_->weak_count_);
-  }
-
- private:
-  element_type* ptr_;
-  SharedPtrControlBlock* control_block_;
-};
-
-template <typename T> void swap(weak_ptr<T>& r, weak_ptr<T>& s) {
-  r.swap(s);
-}
-
-// See comments at the top of the file for a description of why this class
-// exists, and section 20.8.10.5 of the draft C++ standard (as of July 2009
-// the latest draft is N2914) for the detailed specification.
-template <typename T>
-class enable_shared_from_this {
-  friend class shared_ptr<T>;
- public:
-  // Precondition: there must be a shared_ptr that owns *this and that was
-  // created, directly or indirectly, from a raw pointer of type T*. (The
-  // latter part of the condition is technical but not quite redundant; it
-  // rules out some complicated uses involving inheritance hierarchies.)
-  shared_ptr<T> shared_from_this() {
-    // Behavior is undefined if the precondition isn't satisfied; we choose
-    // to die with a CHECK failure.
-    GOOGLE_CHECK(!weak_this_.expired()) << "No shared_ptr owns this object";
-    return weak_this_.lock();
-  }
-  shared_ptr<const T> shared_from_this() const {
-    GOOGLE_CHECK(!weak_this_.expired()) << "No shared_ptr owns this object";
-    return weak_this_.lock();
-  }
-
- protected:
-  enable_shared_from_this() { }
-  enable_shared_from_this(const enable_shared_from_this& other) { }
-  enable_shared_from_this& operator=(const enable_shared_from_this& other) {
-    return *this;
-  }
-  ~enable_shared_from_this() { }
-
- private:
-  weak_ptr<T> weak_this_;
-};
-
-// This is a helper function called by shared_ptr's constructor from a raw
-// pointer. If T inherits from enable_shared_from_this<T>, it sets up
-// weak_this_ so that shared_from_this works correctly. If T does not inherit
-// from weak_this we get a different overload, defined inline, which does
-// nothing.
-template<typename T>
-void shared_ptr<T>::MaybeSetupWeakThis(enable_shared_from_this<T>* ptr) {
-  if (ptr) {
-    GOOGLE_CHECK(ptr->weak_this_.expired())
-        << "Object already owned by a shared_ptr";
-    ptr->weak_this_ = *this;
-  }
-}
-
-#endif  // UTIL_GTL_USE_STD_SHARED_PTR
-
-}  // internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_STUBS_SHARED_PTR_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/singleton.h b/3rdparty/protobuf/src/google/protobuf/stubs/singleton.h
deleted file mode 100644 (file)
index 9301f54..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2014 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_STUBS_SINGLETON_H__
-#define GOOGLE_PROTOBUF_STUBS_SINGLETON_H__
-
-#include <google/protobuf/stubs/atomicops.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/once.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-template<typename T>
-class Singleton {
- public:
-  static T* get() {
-    GoogleOnceInit(&once_, &Singleton<T>::Init);
-    return instance_;
-  }
-  static void ShutDown() {
-    delete instance_;
-    instance_ = NULL;
-  }
- private:
-  static void Init() {
-    instance_ = new T();
-  }
-  static ProtobufOnceType once_;
-  static T* instance_;
-};
-
-template<typename T>
-ProtobufOnceType Singleton<T>::once_;
-
-template<typename T>
-T* Singleton<T>::instance_ = NULL;
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_STUBS_SINGLETON_H__
index dd1bd61..f5c0fa4 100644 (file)
 namespace google {
 namespace protobuf {
 namespace util {
-namespace error {
-inline string CodeEnumToString(error::Code code) {
+namespace status_internal {
+namespace {
+
+inline std::string StatusCodeToString(StatusCode code) {
   switch (code) {
-    case OK:
+    case StatusCode::kOk:
       return "OK";
-    case CANCELLED:
+    case StatusCode::kCancelled:
       return "CANCELLED";
-    case UNKNOWN:
+    case StatusCode::kUnknown:
       return "UNKNOWN";
-    case INVALID_ARGUMENT:
+    case StatusCode::kInvalidArgument:
       return "INVALID_ARGUMENT";
-    case DEADLINE_EXCEEDED:
+    case StatusCode::kDeadlineExceeded:
       return "DEADLINE_EXCEEDED";
-    case NOT_FOUND:
+    case StatusCode::kNotFound:
       return "NOT_FOUND";
-    case ALREADY_EXISTS:
+    case StatusCode::kAlreadyExists:
       return "ALREADY_EXISTS";
-    case PERMISSION_DENIED:
+    case StatusCode::kPermissionDenied:
       return "PERMISSION_DENIED";
-    case UNAUTHENTICATED:
+    case StatusCode::kUnauthenticated:
       return "UNAUTHENTICATED";
-    case RESOURCE_EXHAUSTED:
+    case StatusCode::kResourceExhausted:
       return "RESOURCE_EXHAUSTED";
-    case FAILED_PRECONDITION:
+    case StatusCode::kFailedPrecondition:
       return "FAILED_PRECONDITION";
-    case ABORTED:
+    case StatusCode::kAborted:
       return "ABORTED";
-    case OUT_OF_RANGE:
+    case StatusCode::kOutOfRange:
       return "OUT_OF_RANGE";
-    case UNIMPLEMENTED:
+    case StatusCode::kUnimplemented:
       return "UNIMPLEMENTED";
-    case INTERNAL:
+    case StatusCode::kInternal:
       return "INTERNAL";
-    case UNAVAILABLE:
+    case StatusCode::kUnavailable:
       return "UNAVAILABLE";
-    case DATA_LOSS:
+    case StatusCode::kDataLoss:
       return "DATA_LOSS";
   }
 
@@ -80,18 +82,14 @@ inline string CodeEnumToString(error::Code code) {
   // above switch.
   return "UNKNOWN";
 }
-}  // namespace error.
 
-const Status Status::OK = Status();
-const Status Status::CANCELLED = Status(error::CANCELLED, "");
-const Status Status::UNKNOWN = Status(error::UNKNOWN, "");
+}  // namespace
 
-Status::Status() : error_code_(error::OK) {
-}
+Status::Status() : error_code_(StatusCode::kOk) {}
 
-Status::Status(error::Code error_code, StringPiece error_message)
+Status::Status(StatusCode error_code, StringPiece error_message)
     : error_code_(error_code) {
-  if (error_code != error::OK) {
+  if (error_code != StatusCode::kOk) {
     error_message_ = error_message.ToString();
   }
 }
@@ -111,24 +109,154 @@ bool Status::operator==(const Status& x) const {
       error_message_ == x.error_message_;
 }
 
-string Status::ToString() const {
-  if (error_code_ == error::OK) {
+std::string Status::ToString() const {
+  if (error_code_ == StatusCode::kOk) {
     return "OK";
   } else {
     if (error_message_.empty()) {
-      return error::CodeEnumToString(error_code_);
+      return StatusCodeToString(error_code_);
     } else {
-      return error::CodeEnumToString(error_code_) + ":" +
-          error_message_;
+      return StatusCodeToString(error_code_) + ":" + error_message_;
     }
   }
 }
 
-ostream& operator<<(ostream& os, const Status& x) {
+Status OkStatus() { return Status(); }
+
+std::ostream& operator<<(std::ostream& os, const Status& x) {
   os << x.ToString();
   return os;
 }
 
+bool IsAborted(const Status& status) {
+  return status.code() == StatusCode::kAborted;
+}
+
+bool IsAlreadyExists(const Status& status) {
+  return status.code() == StatusCode::kAlreadyExists;
+}
+
+bool IsCancelled(const Status& status) {
+  return status.code() == StatusCode::kCancelled;
+}
+
+bool IsDataLoss(const Status& status) {
+  return status.code() == StatusCode::kDataLoss;
+}
+
+bool IsDeadlineExceeded(const Status& status) {
+  return status.code() == StatusCode::kDeadlineExceeded;
+}
+
+bool IsFailedPrecondition(const Status& status) {
+  return status.code() == StatusCode::kFailedPrecondition;
+}
+
+bool IsInternal(const Status& status) {
+  return status.code() == StatusCode::kInternal;
+}
+
+bool IsInvalidArgument(const Status& status) {
+  return status.code() == StatusCode::kInvalidArgument;
+}
+
+bool IsNotFound(const Status& status) {
+  return status.code() == StatusCode::kNotFound;
+}
+
+bool IsOutOfRange(const Status& status) {
+  return status.code() == StatusCode::kOutOfRange;
+}
+
+bool IsPermissionDenied(const Status& status) {
+  return status.code() == StatusCode::kPermissionDenied;
+}
+
+bool IsResourceExhausted(const Status& status) {
+  return status.code() == StatusCode::kResourceExhausted;
+}
+
+bool IsUnauthenticated(const Status& status) {
+  return status.code() == StatusCode::kUnauthenticated;
+}
+
+bool IsUnavailable(const Status& status) {
+  return status.code() == StatusCode::kUnavailable;
+}
+
+bool IsUnimplemented(const Status& status) {
+  return status.code() == StatusCode::kUnimplemented;
+}
+
+bool IsUnknown(const Status& status) {
+  return status.code() == StatusCode::kUnknown;
+}
+
+Status AbortedError(StringPiece message) {
+  return Status(StatusCode::kAborted, message);
+}
+
+Status AlreadyExistsError(StringPiece message) {
+  return Status(StatusCode::kAlreadyExists, message);
+}
+
+Status CancelledError(StringPiece message) {
+  return Status(StatusCode::kCancelled, message);
+}
+
+Status DataLossError(StringPiece message) {
+  return Status(StatusCode::kDataLoss, message);
+}
+
+Status DeadlineExceededError(StringPiece message) {
+  return Status(StatusCode::kDeadlineExceeded, message);
+}
+
+Status FailedPreconditionError(StringPiece message) {
+  return Status(StatusCode::kFailedPrecondition, message);
+}
+
+Status InternalError(StringPiece message) {
+  return Status(StatusCode::kInternal, message);
+}
+
+Status InvalidArgumentError(StringPiece message) {
+  return Status(StatusCode::kInvalidArgument, message);
+}
+
+Status NotFoundError(StringPiece message) {
+  return Status(StatusCode::kNotFound, message);
+}
+
+Status OutOfRangeError(StringPiece message) {
+  return Status(StatusCode::kOutOfRange, message);
+}
+
+Status PermissionDeniedError(StringPiece message) {
+  return Status(StatusCode::kPermissionDenied, message);
+}
+
+Status ResourceExhaustedError(StringPiece message) {
+  return Status(StatusCode::kResourceExhausted, message);
+}
+
+Status UnauthenticatedError(StringPiece message) {
+  return Status(StatusCode::kUnauthenticated, message);
+}
+
+Status UnavailableError(StringPiece message) {
+  return Status(StatusCode::kUnavailable, message);
+}
+
+Status UnimplementedError(StringPiece message) {
+  return Status(StatusCode::kUnimplemented, message);
+}
+
+Status UnknownError(StringPiece message) {
+  return Status(StatusCode::kUnknown, message);
+}
+
+}  // namespace status_internal
 }  // namespace util
 }  // namespace protobuf
 }  // namespace google
index 614ab99..c858cf6 100644 (file)
 // 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_STUBS_STATUS_H_
 #define GOOGLE_PROTOBUF_STUBS_STATUS_H_
 
-#include <iosfwd>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/stringpiece.h>
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace util {
-namespace error {
+namespace status_internal {
+
 // These values must match error codes defined in google/rpc/code.proto.
-enum Code {
-  OK = 0,
-  CANCELLED = 1,
-  UNKNOWN = 2,
-  INVALID_ARGUMENT = 3,
-  DEADLINE_EXCEEDED = 4,
-  NOT_FOUND = 5,
-  ALREADY_EXISTS = 6,
-  PERMISSION_DENIED = 7,
-  UNAUTHENTICATED = 16,
-  RESOURCE_EXHAUSTED = 8,
-  FAILED_PRECONDITION = 9,
-  ABORTED = 10,
-  OUT_OF_RANGE = 11,
-  UNIMPLEMENTED = 12,
-  INTERNAL = 13,
-  UNAVAILABLE = 14,
-  DATA_LOSS = 15,
+enum class StatusCode : int {
+  kOk = 0,
+  kCancelled = 1,
+  kUnknown = 2,
+  kInvalidArgument = 3,
+  kDeadlineExceeded = 4,
+  kNotFound = 5,
+  kAlreadyExists = 6,
+  kPermissionDenied = 7,
+  kUnauthenticated = 16,
+  kResourceExhausted = 8,
+  kFailedPrecondition = 9,
+  kAborted = 10,
+  kOutOfRange = 11,
+  kUnimplemented = 12,
+  kInternal = 13,
+  kUnavailable = 14,
+  kDataLoss = 15,
 };
-}  // namespace error
 
-class LIBPROTOBUF_EXPORT Status {
+class PROTOBUF_EXPORT Status {
  public:
   // Creates a "successful" status.
   Status();
 
   // Create a status in the canonical error space with the specified
   // code, and error message.  If "code == 0", error_message is
-  // ignored and a Status object identical to Status::OK is
+  // ignored and a Status object identical to Status::kOk is
   // constructed.
-  Status(error::Code error_code, StringPiece error_message);
+  Status(StatusCode error_code, StringPiece error_message);
   Status(const Status&);
   Status& operator=(const Status& x);
   ~Status() {}
 
-  // Some pre-defined Status objects
-  static const Status OK;             // Identical to 0-arg constructor
-  static const Status CANCELLED;
-  static const Status UNKNOWN;
-
   // Accessor
-  bool ok() const {
-    return error_code_ == error::OK;
-  }
-  int error_code() const {
-    return error_code_;
-  }
-  StringPiece error_message() const {
+  bool ok() const { return error_code_ == StatusCode::kOk; }
+  StatusCode code() const { return error_code_; }
+  StringPiece message() const {
     return error_message_;
   }
 
@@ -98,19 +90,107 @@ class LIBPROTOBUF_EXPORT Status {
   }
 
   // Return a combination of the error code name and message.
-  string ToString() const;
+  std::string ToString() const;
 
  private:
-  error::Code error_code_;
-  string error_message_;
+  StatusCode error_code_;
+  std::string error_message_;
 };
 
+// Returns an OK status, equivalent to a default constructed instance. Prefer
+// usage of `OkStatus()` when constructing such an OK status.
+PROTOBUF_EXPORT Status OkStatus();
+
 // Prints a human-readable representation of 'x' to 'os'.
-LIBPROTOBUF_EXPORT ostream& operator<<(ostream& os, const Status& x);
+PROTOBUF_EXPORT std::ostream& operator<<(std::ostream& os, const Status& x);
 
-#define EXPECT_OK(value) EXPECT_TRUE((value).ok())
+// These convenience functions return `true` if a given status matches the
+// `StatusCode` error code of its associated function.
+PROTOBUF_EXPORT bool IsAborted(const Status& status);
+PROTOBUF_EXPORT bool IsAlreadyExists(const Status& status);
+PROTOBUF_EXPORT bool IsCancelled(const Status& status);
+PROTOBUF_EXPORT bool IsDataLoss(const Status& status);
+PROTOBUF_EXPORT bool IsDeadlineExceeded(const Status& status);
+PROTOBUF_EXPORT bool IsFailedPrecondition(const Status& status);
+PROTOBUF_EXPORT bool IsInternal(const Status& status);
+PROTOBUF_EXPORT bool IsInvalidArgument(const Status& status);
+PROTOBUF_EXPORT bool IsNotFound(const Status& status);
+PROTOBUF_EXPORT bool IsOutOfRange(const Status& status);
+PROTOBUF_EXPORT bool IsPermissionDenied(const Status& status);
+PROTOBUF_EXPORT bool IsResourceExhausted(const Status& status);
+PROTOBUF_EXPORT bool IsUnauthenticated(const Status& status);
+PROTOBUF_EXPORT bool IsUnavailable(const Status& status);
+PROTOBUF_EXPORT bool IsUnimplemented(const Status& status);
+PROTOBUF_EXPORT bool IsUnknown(const Status& status);
+
+// These convenience functions create an `Status` object with an error code as
+// indicated by the associated function name, using the error message passed in
+// `message`.
+//
+// These functions are intentionally named `*Error` rather than `*Status` to
+// match the names from Abseil:
+// https://github.com/abseil/abseil-cpp/blob/2e9532cc6c701a8323d0cffb468999ab804095ab/absl/status/status.h#L716
+PROTOBUF_EXPORT Status AbortedError(StringPiece message);
+PROTOBUF_EXPORT Status AlreadyExistsError(StringPiece message);
+PROTOBUF_EXPORT Status CancelledError(StringPiece message);
+PROTOBUF_EXPORT Status DataLossError(StringPiece message);
+PROTOBUF_EXPORT Status DeadlineExceededError(StringPiece message);
+PROTOBUF_EXPORT Status FailedPreconditionError(StringPiece message);
+PROTOBUF_EXPORT Status InternalError(StringPiece message);
+PROTOBUF_EXPORT Status InvalidArgumentError(StringPiece message);
+PROTOBUF_EXPORT Status NotFoundError(StringPiece message);
+PROTOBUF_EXPORT Status OutOfRangeError(StringPiece message);
+PROTOBUF_EXPORT Status PermissionDeniedError(StringPiece message);
+PROTOBUF_EXPORT Status ResourceExhaustedError(StringPiece message);
+PROTOBUF_EXPORT Status UnauthenticatedError(StringPiece message);
+PROTOBUF_EXPORT Status UnavailableError(StringPiece message);
+PROTOBUF_EXPORT Status UnimplementedError(StringPiece message);
+PROTOBUF_EXPORT Status UnknownError(StringPiece message);
+
+}  // namespace status_internal
+
+using ::google::protobuf::util::status_internal::Status;
+using ::google::protobuf::util::status_internal::StatusCode;
+
+using ::google::protobuf::util::status_internal::IsAborted;
+using ::google::protobuf::util::status_internal::IsAlreadyExists;
+using ::google::protobuf::util::status_internal::IsCancelled;
+using ::google::protobuf::util::status_internal::IsDataLoss;
+using ::google::protobuf::util::status_internal::IsDeadlineExceeded;
+using ::google::protobuf::util::status_internal::IsFailedPrecondition;
+using ::google::protobuf::util::status_internal::IsInternal;
+using ::google::protobuf::util::status_internal::IsInvalidArgument;
+using ::google::protobuf::util::status_internal::IsNotFound;
+using ::google::protobuf::util::status_internal::IsOutOfRange;
+using ::google::protobuf::util::status_internal::IsPermissionDenied;
+using ::google::protobuf::util::status_internal::IsResourceExhausted;
+using ::google::protobuf::util::status_internal::IsUnauthenticated;
+using ::google::protobuf::util::status_internal::IsUnavailable;
+using ::google::protobuf::util::status_internal::IsUnimplemented;
+using ::google::protobuf::util::status_internal::IsUnknown;
+
+using ::google::protobuf::util::status_internal::AbortedError;
+using ::google::protobuf::util::status_internal::AlreadyExistsError;
+using ::google::protobuf::util::status_internal::CancelledError;
+using ::google::protobuf::util::status_internal::DataLossError;
+using ::google::protobuf::util::status_internal::DeadlineExceededError;
+using ::google::protobuf::util::status_internal::FailedPreconditionError;
+using ::google::protobuf::util::status_internal::InternalError;
+using ::google::protobuf::util::status_internal::InvalidArgumentError;
+using ::google::protobuf::util::status_internal::NotFoundError;
+using ::google::protobuf::util::status_internal::OkStatus;
+using ::google::protobuf::util::status_internal::OutOfRangeError;
+using ::google::protobuf::util::status_internal::PermissionDeniedError;
+using ::google::protobuf::util::status_internal::ResourceExhaustedError;
+using ::google::protobuf::util::status_internal::UnauthenticatedError;
+using ::google::protobuf::util::status_internal::UnavailableError;
+using ::google::protobuf::util::status_internal::UnimplementedError;
+using ::google::protobuf::util::status_internal::UnknownError;
 
 }  // namespace util
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_STATUS_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/status_macros.h b/3rdparty/protobuf/src/google/protobuf/stubs/status_macros.h
deleted file mode 100644 (file)
index 743e79a..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// From: util/task/contrib/status_macros/status_macros.h
-
-#ifndef GOOGLE_PROTOBUF_STUBS_STATUS_MACROS_H_
-#define GOOGLE_PROTOBUF_STUBS_STATUS_MACROS_H_
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/status.h>
-#include <google/protobuf/stubs/statusor.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-// Run a command that returns a util::Status.  If the called code returns an
-// error status, return that status up out of this method too.
-//
-// Example:
-//   RETURN_IF_ERROR(DoThings(4));
-#define RETURN_IF_ERROR(expr) \
-  do { \
-    /* Using _status below to avoid capture problems if expr is "status". */ \
-    const ::google::protobuf::util::Status _status = (expr); \
-    if (GOOGLE_PREDICT_FALSE(!_status.ok())) return _status; \
-  } while (0)
-
-// Internal helper for concatenating macro values.
-#define STATUS_MACROS_CONCAT_NAME_INNER(x, y) x##y
-#define STATUS_MACROS_CONCAT_NAME(x, y) STATUS_MACROS_CONCAT_NAME_INNER(x, y)
-
-template<typename T>
-Status DoAssignOrReturn(T& lhs, StatusOr<T> result) {
-  if (result.ok()) {
-    lhs = result.ValueOrDie();
-  }
-  return result.status();
-}
-
-#define ASSIGN_OR_RETURN_IMPL(status, lhs, rexpr) \
-  Status status = DoAssignOrReturn(lhs, (rexpr)); \
-  if (GOOGLE_PREDICT_FALSE(!status.ok())) return status;
-
-// Executes an expression that returns a util::StatusOr, extracting its value
-// into the variable defined by lhs (or returning on error).
-//
-// Example: Assigning to an existing value
-//   ValueType value;
-//   ASSIGN_OR_RETURN(value, MaybeGetValue(arg));
-//
-// WARNING: ASSIGN_OR_RETURN expands into multiple statements; it cannot be used
-//  in a single statement (e.g. as the body of an if statement without {})!
-#define ASSIGN_OR_RETURN(lhs, rexpr) \
-  ASSIGN_OR_RETURN_IMPL( \
-      STATUS_MACROS_CONCAT_NAME(_status_or_value, __COUNTER__), lhs, rexpr);
-
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_STUBS_STATUS_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/statusor.h b/3rdparty/protobuf/src/google/protobuf/stubs/statusor.h
deleted file mode 100644 (file)
index 29f869a..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// StatusOr<T> is the union of a Status object and a T
-// object. StatusOr models the concept of an object that is either a
-// usable value, or an error Status explaining why such a value is
-// not present. To this end, StatusOr<T> does not allow its Status
-// value to be Status::OK. Further, StatusOr<T*> does not allow the
-// contained pointer to be NULL.
-//
-// The primary use-case for StatusOr<T> is as the return value of a
-// function which may fail.
-//
-// Example client usage for a StatusOr<T>, where T is not a pointer:
-//
-//  StatusOr<float> result = DoBigCalculationThatCouldFail();
-//  if (result.ok()) {
-//    float answer = result.ValueOrDie();
-//    printf("Big calculation yielded: %f", answer);
-//  } else {
-//    LOG(ERROR) << result.status();
-//  }
-//
-// Example client usage for a StatusOr<T*>:
-//
-//  StatusOr<Foo*> result = FooFactory::MakeNewFoo(arg);
-//  if (result.ok()) {
-//    std::unique_ptr<Foo> foo(result.ValueOrDie());
-//    foo->DoSomethingCool();
-//  } else {
-//    LOG(ERROR) << result.status();
-//  }
-//
-// Example client usage for a StatusOr<std::unique_ptr<T>>:
-//
-//  StatusOr<std::unique_ptr<Foo>> result = FooFactory::MakeNewFoo(arg);
-//  if (result.ok()) {
-//    std::unique_ptr<Foo> foo = result.ConsumeValueOrDie();
-//    foo->DoSomethingCool();
-//  } else {
-//    LOG(ERROR) << result.status();
-//  }
-//
-// Example factory implementation returning StatusOr<T*>:
-//
-//  StatusOr<Foo*> FooFactory::MakeNewFoo(int arg) {
-//    if (arg <= 0) {
-//      return ::util::Status(::util::error::INVALID_ARGUMENT,
-//                            "Arg must be positive");
-//    } else {
-//      return new Foo(arg);
-//    }
-//  }
-//
-
-#ifndef GOOGLE_PROTOBUF_STUBS_STATUSOR_H_
-#define GOOGLE_PROTOBUF_STUBS_STATUSOR_H_
-
-#include <new>
-#include <string>
-#include <utility>
-
-#include <google/protobuf/stubs/status.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-template<typename T>
-class StatusOr {
-  template<typename U> friend class StatusOr;
-
- public:
-  // Construct a new StatusOr with Status::UNKNOWN status
-  StatusOr();
-
-  // Construct a new StatusOr with the given non-ok status. After calling
-  // this constructor, calls to ValueOrDie() will CHECK-fail.
-  //
-  // NOTE: Not explicit - we want to use StatusOr<T> as a return
-  // value, so it is convenient and sensible to be able to do 'return
-  // Status()' when the return type is StatusOr<T>.
-  //
-  // REQUIRES: status != Status::OK. This requirement is DCHECKed.
-  // In optimized builds, passing Status::OK here will have the effect
-  // of passing PosixErrorSpace::EINVAL as a fallback.
-  StatusOr(const Status& status);  // NOLINT
-
-  // Construct a new StatusOr with the given value. If T is a plain pointer,
-  // value must not be NULL. After calling this constructor, calls to
-  // ValueOrDie() will succeed, and calls to status() will return OK.
-  //
-  // NOTE: Not explicit - we want to use StatusOr<T> as a return type
-  // so it is convenient and sensible to be able to do 'return T()'
-  // when when the return type is StatusOr<T>.
-  //
-  // REQUIRES: if T is a plain pointer, value != NULL. This requirement is
-  // DCHECKed. In optimized builds, passing a NULL pointer here will have
-  // the effect of passing PosixErrorSpace::EINVAL as a fallback.
-  StatusOr(const T& value);  // NOLINT
-
-  // Copy constructor.
-  StatusOr(const StatusOr& other);
-
-  // Conversion copy constructor, T must be copy constructible from U
-  template<typename U>
-  StatusOr(const StatusOr<U>& other);
-
-  // Assignment operator.
-  StatusOr& operator=(const StatusOr& other);
-
-  // Conversion assignment operator, T must be assignable from U
-  template<typename U>
-  StatusOr& operator=(const StatusOr<U>& other);
-
-  // Returns a reference to our status. If this contains a T, then
-  // returns Status::OK.
-  const Status& status() const;
-
-  // Returns this->status().ok()
-  bool ok() const;
-
-  // Returns a reference to our current value, or CHECK-fails if !this->ok().
-  // If you need to initialize a T object from the stored value,
-  // ConsumeValueOrDie() may be more efficient.
-  const T& ValueOrDie() const;
-
- private:
-  Status status_;
-  T value_;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-// Implementation details for StatusOr<T>
-
-namespace internal {
-
-class LIBPROTOBUF_EXPORT StatusOrHelper {
- public:
-  // Move type-agnostic error handling to the .cc.
-  static void Crash(const util::Status& status);
-
-  // Customized behavior for StatusOr<T> vs. StatusOr<T*>
-  template<typename T>
-  struct Specialize;
-};
-
-template<typename T>
-struct StatusOrHelper::Specialize {
-  // For non-pointer T, a reference can never be NULL.
-  static inline bool IsValueNull(const T& t) { return false; }
-};
-
-template<typename T>
-struct StatusOrHelper::Specialize<T*> {
-  static inline bool IsValueNull(const T* t) { return t == NULL; }
-};
-
-}  // namespace internal
-
-template<typename T>
-inline StatusOr<T>::StatusOr()
-    : status_(util::Status::UNKNOWN) {
-}
-
-template<typename T>
-inline StatusOr<T>::StatusOr(const Status& status) {
-  if (status.ok()) {
-    status_ = Status(error::INTERNAL, "Status::OK is not a valid argument.");
-  } else {
-    status_ = status;
-  }
-}
-
-template<typename T>
-inline StatusOr<T>::StatusOr(const T& value) {
-  if (internal::StatusOrHelper::Specialize<T>::IsValueNull(value)) {
-    status_ = Status(error::INTERNAL, "NULL is not a vaild argument.");
-  } else {
-    status_ = Status::OK;
-    value_ = value;
-  }
-}
-
-template<typename T>
-inline StatusOr<T>::StatusOr(const StatusOr<T>& other)
-    : status_(other.status_), value_(other.value_) {
-}
-
-template<typename T>
-inline StatusOr<T>& StatusOr<T>::operator=(const StatusOr<T>& other) {
-  status_ = other.status_;
-  value_ = other.value_;
-  return *this;
-}
-
-template<typename T>
-template<typename U>
-inline StatusOr<T>::StatusOr(const StatusOr<U>& other)
-    : status_(other.status_), value_(other.status_.ok() ? other.value_ : T()) {
-}
-
-template<typename T>
-template<typename U>
-inline StatusOr<T>& StatusOr<T>::operator=(const StatusOr<U>& other) {
-  status_ = other.status_;
-  if (status_.ok()) value_ = other.value_;
-  return *this;
-}
-
-template<typename T>
-inline const Status& StatusOr<T>::status() const {
-  return status_;
-}
-
-template<typename T>
-inline bool StatusOr<T>::ok() const {
-  return status().ok();
-}
-
-template<typename T>
-inline const T& StatusOr<T>::ValueOrDie() const {
-  if (!status_.ok()) {
-    internal::StatusOrHelper::Crash(status_);
-  }
-  return value_;
-}
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_STUBS_STATUSOR_H_
index 9e4c82a..3bc1dbf 100644 (file)
 
 #include <google/protobuf/stubs/common.h>
 
+#include <algorithm>
+
 namespace google {
 namespace protobuf {
 
-// STLDeleteContainerPointers()
-//  For a range within a container of pointers, calls delete
-//  (non-array version) on these pointers.
-// NOTE: for these three functions, we could just implement a DeleteObject
-// functor and then call for_each() on the range and functor, but this
-// requires us to pull in all of algorithm.h, which seems expensive.
-// For hash_[multi]set, it is important that this deletes behind the iterator
-// because the hash_set may call the hash function on the iterator when it is
-// advanced, which could result in the hash function trying to deference a
-// stale pointer.
-template <class ForwardIterator>
-void STLDeleteContainerPointers(ForwardIterator begin,
-                                ForwardIterator end) {
-  while (begin != end) {
-    ForwardIterator temp = begin;
-    ++begin;
-    delete *temp;
-  }
-}
-
 // Inside Google, this function implements a horrible, disgusting hack in which
 // we reach into the string's private implementation and resize it without
 // initializing the new bytes.  In some cases doing this can significantly
 // improve performance.  However, since it's totally non-portable it has no
 // place in open source code.  Feel free to fill this function in with your
 // own disgusting hack if you want the perf boost.
-inline void STLStringResizeUninitialized(string* s, size_t new_size) {
+inline void STLStringResizeUninitialized(std::string* s, size_t new_size) {
   s->resize(new_size);
 }
 
+// As above, but we make sure to follow amortized growth in which we always
+// increase the capacity by at least a constant factor >1.
+inline void STLStringResizeUninitializedAmortized(std::string* s,
+                                                  size_t new_size) {
+  const size_t cap = s->capacity();
+  if (new_size > cap) {
+    // Make sure to always grow by at least a factor of 2x.
+    s->reserve(std::max(new_size, 2 * cap));
+  }
+  STLStringResizeUninitialized(s, new_size);
+}
+
 // Return a mutable char* pointing to a string's internal buffer,
 // which may not be null-terminated. Writing through this pointer will
 // modify the string.
@@ -80,39 +74,9 @@ inline void STLStringResizeUninitialized(string* s, size_t new_size) {
 // (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#530)
 // proposes this as the method. According to Matt Austern, this should
 // already work on all current implementations.
-inline char* string_as_array(string* str) {
+inline char* string_as_array(std::string* str) {
   // DO NOT USE const_cast<char*>(str->data())! See the unittest for why.
-  return str->empty() ? NULL : &*str->begin();
-}
-
-// STLDeleteElements() deletes all the elements in an STL container and clears
-// the container.  This function is suitable for use with a vector, set,
-// hash_set, or any other STL container which defines sensible begin(), end(),
-// and clear() methods.
-//
-// If container is NULL, this function is a no-op.
-//
-// As an alternative to calling STLDeleteElements() directly, consider
-// ElementDeleter (defined below), which ensures that your container's elements
-// are deleted when the ElementDeleter goes out of scope.
-template <class T>
-void STLDeleteElements(T *container) {
-  if (!container) return;
-  STLDeleteContainerPointers(container->begin(), container->end());
-  container->clear();
-}
-
-// Given an STL container consisting of (key, value) pairs, STLDeleteValues
-// deletes all the "value" components and clears the container.  Does nothing
-// in the case it's given a NULL pointer.
-
-template <class T>
-void STLDeleteValues(T *v) {
-  if (!v) return;
-  for (typename T::iterator i = v->begin(); i != v->end(); ++i) {
-    delete i->second;
-  }
-  v->clear();
+  return str->empty() ? nullptr : &*str->begin();
 }
 
 }  // namespace protobuf
index 989474b..7188046 100644 (file)
 #include <string>
 #include <ostream>
 
+#include <google/protobuf/stubs/logging.h>
+
 namespace google {
 namespace protobuf {
+namespace stringpiece_internal {
+
 std::ostream& operator<<(std::ostream& o, StringPiece piece) {
   o.write(piece.data(), piece.size());
   return o;
 }
 
-// Out-of-line error path.
 void StringPiece::LogFatalSizeTooBig(size_t size, const char* details) {
   GOOGLE_LOG(FATAL) << "size too big: " << size << " details: " << details;
 }
 
-StringPiece::StringPiece(StringPiece x, stringpiece_ssize_type pos)
-    : ptr_(x.ptr_ + pos), length_(x.length_ - pos) {
-  GOOGLE_DCHECK_LE(0, pos);
-  GOOGLE_DCHECK_LE(pos, x.length_);
-}
-
-StringPiece::StringPiece(StringPiece x,
-                         stringpiece_ssize_type pos,
-                         stringpiece_ssize_type len)
-    : ptr_(x.ptr_ + pos), length_(std::min(len, x.length_ - pos)) {
-  GOOGLE_DCHECK_LE(0, pos);
-  GOOGLE_DCHECK_LE(pos, x.length_);
-  GOOGLE_DCHECK_GE(len, 0);
-}
-
-void StringPiece::CopyToString(string* target) const {
+void StringPiece::CopyToString(std::string* target) const {
   target->assign(ptr_, length_);
 }
 
-void StringPiece::AppendToString(string* target) const {
+void StringPiece::AppendToString(std::string* target) const {
   target->append(ptr_, length_);
 }
 
@@ -87,10 +75,9 @@ bool StringPiece::ConsumeFromEnd(StringPiece x) {
   return false;
 }
 
-stringpiece_ssize_type StringPiece::copy(char* buf,
-                                         size_type n,
+StringPiece::size_type StringPiece::copy(char* buf, size_type n,
                                          size_type pos) const {
-  stringpiece_ssize_type ret = std::min(length_ - pos, n);
+  size_type ret = std::min(length_ - pos, n);
   memcpy(buf, ptr_ + pos, ret);
   return ret;
 }
@@ -99,7 +86,7 @@ bool StringPiece::contains(StringPiece s) const {
   return find(s, 0) != npos;
 }
 
-stringpiece_ssize_type StringPiece::find(StringPiece s, size_type pos) const {
+StringPiece::size_type StringPiece::find(StringPiece s, size_type pos) const {
   if (length_ <= 0 || pos > static_cast<size_type>(length_)) {
     if (length_ == 0 && pos == 0 && s.length_ == 0) return 0;
     return npos;
@@ -109,16 +96,16 @@ stringpiece_ssize_type StringPiece::find(StringPiece s, size_type pos) const {
   return result == ptr_ + length_ ? npos : result - ptr_;
 }
 
-stringpiece_ssize_type StringPiece::find(char c, size_type pos) const {
+StringPiece::size_type StringPiece::find(char c, size_type pos) const {
   if (length_ <= 0 || pos >= static_cast<size_type>(length_)) {
     return npos;
   }
   const char* result = static_cast<const char*>(
       memchr(ptr_ + pos, c, length_ - pos));
-  return result != NULL ? result - ptr_ : npos;
+  return result != nullptr ? result - ptr_ : npos;
 }
 
-stringpiece_ssize_type StringPiece::rfind(StringPiece s, size_type pos) const {
+StringPiece::size_type StringPiece::rfind(StringPiece s, size_type pos) const {
   if (length_ < s.length_) return npos;
   const size_t ulen = length_;
   if (s.length_ == 0) return std::min(ulen, pos);
@@ -129,15 +116,14 @@ stringpiece_ssize_type StringPiece::rfind(StringPiece s, size_type pos) const {
 }
 
 // Search range is [0..pos] inclusive.  If pos == npos, search everything.
-stringpiece_ssize_type StringPiece::rfind(char c, size_type pos) const {
+StringPiece::size_type StringPiece::rfind(char c, size_type pos) const {
   // Note: memrchr() is not available on Windows.
-  if (length_ <= 0) return npos;
-  for (stringpiece_ssize_type i =
-      std::min(pos, static_cast<size_type>(length_ - 1));
-       i >= 0; --i) {
+  if (empty()) return npos;
+  for (size_type i = std::min(pos, length_ - 1);; --i) {
     if (ptr_[i] == c) {
       return i;
     }
+    if (i == 0) break;
   }
   return npos;
 }
@@ -152,16 +138,16 @@ stringpiece_ssize_type StringPiece::rfind(char c, size_type pos) const {
 //   bool table[UCHAR_MAX + 1]
 static inline void BuildLookupTable(StringPiece characters_wanted,
                                     bool* table) {
-  const stringpiece_ssize_type length = characters_wanted.length();
+  const StringPiece::size_type length = characters_wanted.length();
   const char* const data = characters_wanted.data();
-  for (stringpiece_ssize_type i = 0; i < length; ++i) {
+  for (StringPiece::size_type i = 0; i < length; ++i) {
     table[static_cast<unsigned char>(data[i])] = true;
   }
 }
 
-stringpiece_ssize_type StringPiece::find_first_of(StringPiece s,
+StringPiece::size_type StringPiece::find_first_of(StringPiece s,
                                                   size_type pos) const {
-  if (length_ <= 0 || s.length_ <= 0) {
+  if (empty() || s.empty()) {
     return npos;
   }
   // Avoid the cost of BuildLookupTable() for a single-character search.
@@ -169,7 +155,7 @@ stringpiece_ssize_type StringPiece::find_first_of(StringPiece s,
 
   bool lookup[UCHAR_MAX + 1] = { false };
   BuildLookupTable(s, lookup);
-  for (stringpiece_ssize_type i = pos; i < length_; ++i) {
+  for (size_type i = pos; i < length_; ++i) {
     if (lookup[static_cast<unsigned char>(ptr_[i])]) {
       return i;
     }
@@ -177,16 +163,16 @@ stringpiece_ssize_type StringPiece::find_first_of(StringPiece s,
   return npos;
 }
 
-stringpiece_ssize_type StringPiece::find_first_not_of(StringPiece s,
+StringPiece::size_type StringPiece::find_first_not_of(StringPiece s,
                                                       size_type pos) const {
-  if (length_ <= 0) return npos;
-  if (s.length_ <= 0) return 0;
+  if (empty()) return npos;
+  if (s.empty()) return 0;
   // Avoid the cost of BuildLookupTable() for a single-character search.
   if (s.length_ == 1) return find_first_not_of(s.ptr_[0], pos);
 
   bool lookup[UCHAR_MAX + 1] = { false };
   BuildLookupTable(s, lookup);
-  for (stringpiece_ssize_type i = pos; i < length_; ++i) {
+  for (size_type i = pos; i < length_; ++i) {
     if (!lookup[static_cast<unsigned char>(ptr_[i])]) {
       return i;
     }
@@ -194,9 +180,9 @@ stringpiece_ssize_type StringPiece::find_first_not_of(StringPiece s,
   return npos;
 }
 
-stringpiece_ssize_type StringPiece::find_first_not_of(char c,
+StringPiece::size_type StringPiece::find_first_not_of(char c,
                                                       size_type pos) const {
-  if (length_ <= 0) return npos;
+  if (empty()) return npos;
 
   for (; pos < static_cast<size_type>(length_); ++pos) {
     if (ptr_[pos] != c) {
@@ -206,63 +192,65 @@ stringpiece_ssize_type StringPiece::find_first_not_of(char c,
   return npos;
 }
 
-stringpiece_ssize_type StringPiece::find_last_of(StringPiece s,
+StringPiece::size_type StringPiece::find_last_of(StringPiece s,
                                                  size_type pos) const {
-  if (length_ <= 0 || s.length_ <= 0) return npos;
+  if (empty() || s.empty()) return npos;
   // Avoid the cost of BuildLookupTable() for a single-character search.
   if (s.length_ == 1) return find_last_of(s.ptr_[0], pos);
 
   bool lookup[UCHAR_MAX + 1] = { false };
   BuildLookupTable(s, lookup);
-  for (stringpiece_ssize_type i =
-       std::min(pos, static_cast<size_type>(length_ - 1)); i >= 0; --i) {
+  for (size_type i = std::min(pos, length_ - 1);; --i) {
     if (lookup[static_cast<unsigned char>(ptr_[i])]) {
       return i;
     }
+    if (i == 0) break;
   }
   return npos;
 }
 
-stringpiece_ssize_type StringPiece::find_last_not_of(StringPiece s,
+StringPiece::size_type StringPiece::find_last_not_of(StringPiece s,
                                                      size_type pos) const {
-  if (length_ <= 0) return npos;
+  if (empty()) return npos;
 
-  stringpiece_ssize_type i = std::min(pos, static_cast<size_type>(length_ - 1));
-  if (s.length_ <= 0) return i;
+  size_type i = std::min(pos, length() - 1);
+  if (s.empty()) return i;
 
   // Avoid the cost of BuildLookupTable() for a single-character search.
   if (s.length_ == 1) return find_last_not_of(s.ptr_[0], pos);
 
   bool lookup[UCHAR_MAX + 1] = { false };
   BuildLookupTable(s, lookup);
-  for (; i >= 0; --i) {
+  for (;; --i) {
     if (!lookup[static_cast<unsigned char>(ptr_[i])]) {
       return i;
     }
+    if (i == 0) break;
   }
   return npos;
 }
 
-stringpiece_ssize_type StringPiece::find_last_not_of(char c,
+StringPiece::size_type StringPiece::find_last_not_of(char c,
                                                      size_type pos) const {
-  if (length_ <= 0) return npos;
-
-  for (stringpiece_ssize_type i =
-       std::min(pos, static_cast<size_type>(length_ - 1)); i >= 0; --i) {
+  if (empty()) return npos;
+  size_type i = std::min(pos, length_ - 1);
+  for (;; --i) {
     if (ptr_[i] != c) {
       return i;
     }
+    if (i == 0) break;
   }
   return npos;
 }
 
 StringPiece StringPiece::substr(size_type pos, size_type n) const {
-  if (pos > length_) pos = length_;
-  if (n > length_ - pos) n = length_ - pos;
+  if (pos > length()) pos = length();
+  if (n > length_ - pos) n = length() - pos;
   return StringPiece(ptr_ + pos, n);
 }
 
 const StringPiece::size_type StringPiece::npos = size_type(-1);
 
+}  // namespace stringpiece_internal
 }  // namespace protobuf
 }  // namespace google
index 563ff75..c63e25b 100644 (file)
 //
 // There are several ways to create a null StringPiece:
 //   StringPiece()
-//   StringPiece(NULL)
-//   StringPiece(NULL, 0)
-// For all of the above, sp.data() == NULL, sp.length() == 0,
+//   StringPiece(nullptr)
+//   StringPiece(nullptr, 0)
+// For all of the above, sp.data() == nullptr, sp.length() == 0,
 // and sp.empty() == true.  Also, if you create a StringPiece with
-// a non-NULL pointer then sp.data() != NULL.  Once created,
-// sp.data() will stay either NULL or not-NULL, except if you call
+// a non-null pointer then sp.data() != nullptr.  Once created,
+// sp.data() will stay either nullptr or not-nullptr, except if you call
 // sp.clear() or sp.set().
 //
-// Thus, you can use StringPiece(NULL) to signal an out-of-band value
+// Thus, you can use StringPiece(nullptr) to signal an out-of-band value
 // that is different from other StringPiece values.  This is similar
-// to the way that const char* p1 = NULL; is different from
+// to the way that const char* p1 = nullptr; is different from
 // const char* p2 = "";.
 //
 // There are many ways to create an empty StringPiece:
 //   StringPiece()
-//   StringPiece(NULL)
-//   StringPiece(NULL, 0)
+//   StringPiece(nullptr)
+//   StringPiece(nullptr, 0)
 //   StringPiece("")
 //   StringPiece("", 0)
 //   StringPiece("abcdef", 0)
 //   StringPiece("abcdef"+6, 0)
 // For all of the above, sp.length() will be 0 and sp.empty() will be true.
-// For some empty StringPiece values, sp.data() will be NULL.
-// For some empty StringPiece values, sp.data() will not be NULL.
+// For some empty StringPiece values, sp.data() will be nullptr.
+// For some empty StringPiece values, sp.data() will not be nullptr.
 //
 // Be careful not to confuse: null StringPiece and empty StringPiece.
 // The set of empty StringPieces properly includes the set of null StringPieces.
 // All empty StringPiece values compare equal to each other.
 // Even a null StringPieces compares equal to a non-null empty StringPiece:
 //  StringPiece() == StringPiece("", 0)
-//  StringPiece(NULL) == StringPiece("abc", 0)
-//  StringPiece(NULL, 0) == StringPiece("abcdef"+6, 0)
+//  StringPiece(nullptr) == StringPiece("abc", 0)
+//  StringPiece(nullptr, 0) == StringPiece("abcdef"+6, 0)
 //
 // Look carefully at this example:
-//   StringPiece("") == NULL
+//   StringPiece("") == nullptr
 // True or false?  TRUE, because StringPiece::operator== converts
-// the right-hand side from NULL to StringPiece(NULL),
+// the right-hand side from nullptr to StringPiece(nullptr),
 // and then compares two zero-length spans of characters.
 // However, we are working to make this example produce a compile error.
 //
 // Suppose you want to write:
-//   bool TestWhat?(StringPiece sp) { return sp == NULL; }  // BAD
+//   bool TestWhat?(StringPiece sp) { return sp == nullptr; }  // BAD
 // Do not do that.  Write one of these instead:
-//   bool TestNull(StringPiece sp) { return sp.data() == NULL; }
+//   bool TestNull(StringPiece sp) { return sp.data() == nullptr; }
 //   bool TestEmpty(StringPiece sp) { return sp.empty(); }
 // The intent of TestWhat? is unclear.  Did you mean TestNull or TestEmpty?
 // Right now, TestWhat? behaves likes TestEmpty.
 #include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
+#if defined(__cpp_lib_string_view)
+#include <string_view>
+#endif
+
 #include <google/protobuf/stubs/hash.h>
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
-// StringPiece has *two* size types.
-// StringPiece::size_type
-//   is unsigned
-//   is 32 bits in LP32, 64 bits in LP64, 64 bits in LLP64
-//   no future changes intended
-// stringpiece_ssize_type
-//   is signed
-//   is 32 bits in LP32, 64 bits in LP64, 64 bits in LLP64
-//   future changes intended: http://go/64BitStringPiece
-//
-typedef string::difference_type stringpiece_ssize_type;
-
-// STRINGPIECE_CHECK_SIZE protects us from 32-bit overflows.
-// TODO(mec): delete this after stringpiece_ssize_type goes 64 bit.
-#if !defined(NDEBUG)
-#define STRINGPIECE_CHECK_SIZE 1
-#elif defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
-#define STRINGPIECE_CHECK_SIZE 1
-#else
-#define STRINGPIECE_CHECK_SIZE 0
-#endif
+namespace stringpiece_internal {
+
+class PROTOBUF_EXPORT StringPiece {
+ public:
+  using traits_type = std::char_traits<char>;
+  using value_type = char;
+  using pointer = char*;
+  using const_pointer = const char*;
+  using reference = char&;
+  using const_reference = const char&;
+  using const_iterator = const char*;
+  using iterator = const_iterator;
+  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+  using reverse_iterator = const_reverse_iterator;
+  using size_type = size_t;
+  using difference_type = std::ptrdiff_t;
 
-class LIBPROTOBUF_EXPORT StringPiece {
  private:
   const char* ptr_;
-  stringpiece_ssize_type length_;
-
-  // Prevent overflow in debug mode or fortified mode.
-  // sizeof(stringpiece_ssize_type) may be smaller than sizeof(size_t).
-  static stringpiece_ssize_type CheckedSsizeTFromSizeT(size_t size) {
-#if STRINGPIECE_CHECK_SIZE > 0
-#ifdef max
-#undef max
-#endif
-    if (size > static_cast<size_t>(
-        std::numeric_limits<stringpiece_ssize_type>::max())) {
+  size_type length_;
+
+  static constexpr size_type kMaxSize =
+      (std::numeric_limits<difference_type>::max)();
+
+  static size_type CheckSize(size_type size) {
+#if !defined(NDEBUG) || defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
+    if (PROTOBUF_PREDICT_FALSE(size > kMaxSize)) {
       // Some people grep for this message in logs
       // so take care if you ever change it.
-      LogFatalSizeTooBig(size, "size_t to int conversion");
+      LogFatalSizeTooBig(size, "string length exceeds max size");
     }
 #endif
-    return static_cast<stringpiece_ssize_type>(size);
+    return size;
   }
 
   // Out-of-line error path.
-  static void LogFatalSizeTooBig(size_t size, const char* details);
+  static void LogFatalSizeTooBig(size_type size, const char* details);
 
  public:
   // We provide non-explicit singleton constructors so users can pass
@@ -207,12 +203,12 @@ class LIBPROTOBUF_EXPORT StringPiece {
   //
   // Style guide exception granted:
   // http://goto/style-guide-exception-20978288
-  StringPiece() : ptr_(NULL), length_(0) {}
+  StringPiece() : ptr_(nullptr), length_(0) {}
 
   StringPiece(const char* str)  // NOLINT(runtime/explicit)
       : ptr_(str), length_(0) {
-    if (str != NULL) {
-      length_ = CheckedSsizeTFromSizeT(strlen(str));
+    if (str != nullptr) {
+      length_ = CheckSize(strlen(str));
     }
   }
 
@@ -220,78 +216,48 @@ class LIBPROTOBUF_EXPORT StringPiece {
   StringPiece(  // NOLINT(runtime/explicit)
       const std::basic_string<char, std::char_traits<char>, Allocator>& str)
       : ptr_(str.data()), length_(0) {
-    length_ = CheckedSsizeTFromSizeT(str.size());
+    length_ = CheckSize(str.size());
   }
 
-  StringPiece(const char* offset, stringpiece_ssize_type len)
-      : ptr_(offset), length_(len) {
-    assert(len >= 0);
+#if defined(__cpp_lib_string_view)
+  StringPiece(  // NOLINT(runtime/explicit)
+      std::string_view str)
+      : ptr_(str.data()), length_(0) {
+    length_ = CheckSize(str.size());
   }
+#endif
 
-  // Substring of another StringPiece.
-  // pos must be non-negative and <= x.length().
-  StringPiece(StringPiece x, stringpiece_ssize_type pos);
-  // Substring of another StringPiece.
-  // pos must be non-negative and <= x.length().
-  // len must be non-negative and will be pinned to at most x.length() - pos.
-  StringPiece(StringPiece x,
-              stringpiece_ssize_type pos,
-              stringpiece_ssize_type len);
+  StringPiece(const char* offset, size_type len)
+      : ptr_(offset), length_(CheckSize(len)) {}
 
   // data() may return a pointer to a buffer with embedded NULs, and the
   // returned buffer may or may not be null terminated.  Therefore it is
   // typically a mistake to pass data() to a routine that expects a NUL
   // terminated string.
-  const char* data() const { return ptr_; }
-  stringpiece_ssize_type size() const { return length_; }
-  stringpiece_ssize_type length() const { return length_; }
+  const_pointer data() const { return ptr_; }
+  size_type size() const { return length_; }
+  size_type length() const { return length_; }
   bool empty() const { return length_ == 0; }
 
-  void clear() {
-    ptr_ = NULL;
-    length_ = 0;
-  }
-
-  void set(const char* data, stringpiece_ssize_type len) {
-    assert(len >= 0);
-    ptr_ = data;
-    length_ = len;
-  }
-
-  void set(const char* str) {
-    ptr_ = str;
-    if (str != NULL)
-      length_ = CheckedSsizeTFromSizeT(strlen(str));
-    else
-      length_ = 0;
-  }
-
-  void set(const void* data, stringpiece_ssize_type len) {
-    ptr_ = reinterpret_cast<const char*>(data);
-    length_ = len;
-  }
-
-  char operator[](stringpiece_ssize_type i) const {
-    assert(0 <= i);
+  char operator[](size_type i) const {
     assert(i < length_);
     return ptr_[i];
   }
 
-  void remove_prefix(stringpiece_ssize_type n) {
+  void remove_prefix(size_type n) {
     assert(length_ >= n);
     ptr_ += n;
     length_ -= n;
   }
 
-  void remove_suffix(stringpiece_ssize_type n) {
+  void remove_suffix(size_type n) {
     assert(length_ >= n);
     length_ -= n;
   }
 
   // returns {-1, 0, 1}
   int compare(StringPiece x) const {
-    const stringpiece_ssize_type min_size =
-        length_ < x.length_ ? length_ : x.length_;
+    size_type min_size = length_ < x.length_ ? length_ : x.length_;
     int r = memcmp(ptr_, x.ptr_, static_cast<size_t>(min_size));
     if (r < 0) return -1;
     if (r > 0) return 1;
@@ -300,25 +266,21 @@ class LIBPROTOBUF_EXPORT StringPiece {
     return 0;
   }
 
-  string as_string() const {
-    return ToString();
-  }
+  std::string as_string() const { return ToString(); }
   // We also define ToString() here, since many other string-like
   // interfaces name the routine that converts to a C++ string
   // "ToString", and it's confusing to have the method that does that
   // for a StringPiece be called "as_string()".  We also leave the
   // "as_string()" method defined here for existing code.
-  string ToString() const {
-    if (ptr_ == NULL) return string();
-    return string(data(), static_cast<size_type>(size()));
+  std::string ToString() const {
+    if (ptr_ == nullptr) return "";
+    return std::string(data(), static_cast<size_type>(size()));
   }
 
-  operator string() const {
-    return ToString();
-  }
+  explicit operator std::string() const { return ToString(); }
 
-  void CopyToString(string* target) const;
-  void AppendToString(string* target) const;
+  void CopyToString(std::string* target) const;
+  void AppendToString(std::string* target) const;
 
   bool starts_with(StringPiece x) const {
     return (length_ >= x.length_) &&
@@ -339,53 +301,40 @@ class LIBPROTOBUF_EXPORT StringPiece {
   bool ConsumeFromEnd(StringPiece x);
 
   // standard STL container boilerplate
-  typedef char value_type;
-  typedef const char* pointer;
-  typedef const char& reference;
-  typedef const char& const_reference;
-  typedef size_t size_type;
-  typedef ptrdiff_t difference_type;
   static const size_type npos;
-  typedef const char* const_iterator;
-  typedef const char* iterator;
-  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
-  typedef std::reverse_iterator<iterator> reverse_iterator;
-  iterator begin() const { return ptr_; }
-  iterator end() const { return ptr_ + length_; }
+  const_iterator begin() const { return ptr_; }
+  const_iterator end() const { return ptr_ + length_; }
   const_reverse_iterator rbegin() const {
     return const_reverse_iterator(ptr_ + length_);
   }
   const_reverse_iterator rend() const {
     return const_reverse_iterator(ptr_);
   }
-  stringpiece_ssize_type max_size() const { return length_; }
-  stringpiece_ssize_type capacity() const { return length_; }
+  size_type max_size() const { return length_; }
+  size_type capacity() const { return length_; }
 
   // cpplint.py emits a false positive [build/include_what_you_use]
-  stringpiece_ssize_type copy(char* buf, size_type n, size_type pos = 0) const;  // NOLINT
+  size_type copy(char* buf, size_type n, size_type pos = 0) const;  // NOLINT
 
   bool contains(StringPiece s) const;
 
-  stringpiece_ssize_type find(StringPiece s, size_type pos = 0) const;
-  stringpiece_ssize_type find(char c, size_type pos = 0) const;
-  stringpiece_ssize_type rfind(StringPiece s, size_type pos = npos) const;
-  stringpiece_ssize_type rfind(char c, size_type pos = npos) const;
+  size_type find(StringPiece s, size_type pos = 0) const;
+  size_type find(char c, size_type pos = 0) const;
+  size_type rfind(StringPiece s, size_type pos = npos) const;
+  size_type rfind(char c, size_type pos = npos) const;
 
-  stringpiece_ssize_type find_first_of(StringPiece s, size_type pos = 0) const;
-  stringpiece_ssize_type find_first_of(char c, size_type pos = 0) const {
+  size_type find_first_of(StringPiece s, size_type pos = 0) const;
+  size_type find_first_of(char c, size_type pos = 0) const {
     return find(c, pos);
   }
-  stringpiece_ssize_type find_first_not_of(StringPiece s,
-                                           size_type pos = 0) const;
-  stringpiece_ssize_type find_first_not_of(char c, size_type pos = 0) const;
-  stringpiece_ssize_type find_last_of(StringPiece s,
-                                      size_type pos = npos) const;
-  stringpiece_ssize_type find_last_of(char c, size_type pos = npos) const {
+  size_type find_first_not_of(StringPiece s, size_type pos = 0) const;
+  size_type find_first_not_of(char c, size_type pos = 0) const;
+  size_type find_last_of(StringPiece s, size_type pos = npos) const;
+  size_type find_last_of(char c, size_type pos = npos) const {
     return rfind(c, pos);
   }
-  stringpiece_ssize_type find_last_not_of(StringPiece s,
-                                          size_type pos = npos) const;
-  stringpiece_ssize_type find_last_not_of(char c, size_type pos = npos) const;
+  size_type find_last_not_of(StringPiece s, size_type pos = npos) const;
+  size_type find_last_not_of(char c, size_type pos = npos) const;
 
   StringPiece substr(size_type pos, size_type n = npos) const;
 };
@@ -394,7 +343,7 @@ class LIBPROTOBUF_EXPORT StringPiece {
 // one of the arguments is a literal, the compiler can elide a lot of the
 // following comparisons.
 inline bool operator==(StringPiece x, StringPiece y) {
-  stringpiece_ssize_type len = x.size();
+  StringPiece::size_type len = x.size();
   if (len != y.size()) {
     return false;
   }
@@ -408,7 +357,7 @@ inline bool operator!=(StringPiece x, StringPiece y) {
 }
 
 inline bool operator<(StringPiece x, StringPiece y) {
-  const stringpiece_ssize_type min_size =
+  const StringPiece::size_type min_size =
       x.size() < y.size() ? x.size() : y.size();
   const int r = memcmp(x.data(), y.data(), static_cast<size_t>(min_size));
   return (r < 0) || (r == 0 && x.size() < y.size());
@@ -429,46 +378,10 @@ inline bool operator>=(StringPiece x, StringPiece y) {
 // allow StringPiece to be logged
 extern std::ostream& operator<<(std::ostream& o, StringPiece piece);
 
-namespace internal {
-// StringPiece is not a POD and can not be used in an union (pre C++11). We
-// need a POD version of it.
-struct StringPiecePod {
-  // Create from a StringPiece.
-  static StringPiecePod CreateFromStringPiece(StringPiece str) {
-    StringPiecePod pod;
-    pod.data_ = str.data();
-    pod.size_ = str.size();
-    return pod;
-  }
-
-  // Cast to StringPiece.
-  operator StringPiece() const { return StringPiece(data_, size_); }
+}  // namespace stringpiece_internal
 
-  bool operator==(const char* value) const {
-    return StringPiece(data_, size_) == StringPiece(value);
-  }
-
-  char operator[](stringpiece_ssize_type i) const {
-    assert(0 <= i);
-    assert(i < size_);
-    return data_[i];
-  }
+using ::google::protobuf::stringpiece_internal::StringPiece;
 
-  const char* data() const { return data_; }
-
-  stringpiece_ssize_type size() const {
-    return size_;
-  }
-
-  std::string ToString() const {
-    return std::string(data_, static_cast<size_t>(size_));
-  }
- private:
-  const char* data_;
-  stringpiece_ssize_type size_;
-};
-
-}  // namespace internal
 }  // namespace protobuf
 }  // namespace google
 
@@ -476,7 +389,7 @@ GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START
 template<> struct hash<StringPiece> {
   size_t operator()(const StringPiece& s) const {
     size_t result = 0;
-    for (const char *str = s.data(), *end = str + s.size(); str < end; str++) {  
+    for (const char *str = s.data(), *end = str + s.size(); str < end; str++) {
       result = 5 * result + static_cast<size_t>(*str);
     }
     return result;
@@ -484,4 +397,6 @@ template<> struct hash<StringPiece> {
 };
 GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // STRINGS_STRINGPIECE_H_
index 83fdfe4..a6ad4c0 100644 (file)
 #include <stdarg.h> // For va_list and related operations
 #include <stdio.h> // MSVC requires this for _vsnprintf
 #include <vector>
+
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/logging.h>
 
 namespace google {
 namespace protobuf {
 
 #ifdef _MSC_VER
-enum { IS_COMPILER_MSVC = 1 };
 #ifndef va_copy
 // Define va_copy for MSVC. This is a hack, assuming va_list is simply a
 // pointer into the stack and is safe to copy.
 #define va_copy(dest, src) ((dest) = (src))
 #endif
-#else
-enum { IS_COMPILER_MSVC = 0 };
 #endif
 
-void StringAppendV(string* dst, const char* format, va_list ap) {
+void StringAppendV(std::string* dst, const char* format, va_list ap) {
   // First try with a small fixed size buffer
   static const int kSpaceLength = 1024;
   char space[kSpaceLength];
@@ -72,13 +71,15 @@ void StringAppendV(string* dst, const char* format, va_list ap) {
       return;
     }
 
-    if (IS_COMPILER_MSVC) {
+#ifdef _MSC_VER
+    {
       // Error or MSVC running out of space.  MSVC 8.0 and higher
       // can be asked about space needed with the special idiom below:
       va_copy(backup_ap, ap);
-      result = vsnprintf(NULL, 0, format, backup_ap);
+      result = vsnprintf(nullptr, 0, format, backup_ap);
       va_end(backup_ap);
     }
+#endif
 
     if (result < 0) {
       // Just an error.
@@ -103,17 +104,16 @@ void StringAppendV(string* dst, const char* format, va_list ap) {
   delete[] buf;
 }
 
-
-string StringPrintf(const char* format, ...) {
+std::string StringPrintf(const char* format, ...) {
   va_list ap;
   va_start(ap, format);
-  string result;
+  std::string result;
   StringAppendV(&result, format, ap);
   va_end(ap);
   return result;
 }
 
-const string& SStringPrintf(string* dst, const char* format, ...) {
+const std::string& SStringPrintf(std::string* dst, const char* format, ...) {
   va_list ap;
   va_start(ap, format);
   dst->clear();
@@ -122,7 +122,7 @@ const string& SStringPrintf(string* dst, const char* format, ...) {
   return *dst;
 }
 
-void StringAppendF(string* dst, const char* format, ...) {
+void StringAppendF(std::string* dst, const char* format, ...) {
   va_list ap;
   va_start(ap, format);
   StringAppendV(dst, format, ap);
@@ -137,7 +137,8 @@ const int kStringPrintfVectorMaxArgs = 32;
 // and we can fix the problem or protect against an attack.
 static const char string_printf_empty_block[256] = { '\0' };
 
-string StringPrintfVector(const char* format, const vector<string>& v) {
+std::string StringPrintfVector(const char* format,
+                               const std::vector<std::string>& v) {
   GOOGLE_CHECK_LE(v.size(), kStringPrintfVectorMaxArgs)
       << "StringPrintfVector currently only supports up to "
       << kStringPrintfVectorMaxArgs << " arguments. "
@@ -160,7 +161,7 @@ string StringPrintfVector(const char* format, const vector<string>& v) {
   // that accepts an array of arguments.  The best I can do is stick
   // this COMPILE_ASSERT right next to the actual statement.
 
-  GOOGLE_COMPILE_ASSERT(kStringPrintfVectorMaxArgs == 32, arg_count_mismatch);
+  static_assert(kStringPrintfVectorMaxArgs == 32, "arg_count_mismatch");
   return StringPrintf(format,
                       cstr[0], cstr[1], cstr[2], cstr[3], cstr[4],
                       cstr[5], cstr[6], cstr[7], cstr[8], cstr[9],
index ab1ab55..e3858be 100644 (file)
 
 #include <google/protobuf/stubs/common.h>
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 
 // Return a C++ string
-LIBPROTOBUF_EXPORT extern string StringPrintf(const char* format, ...);
+PROTOBUF_EXPORT extern std::string StringPrintf(const char* format, ...);
 
 // Store result into a supplied string and return it
-LIBPROTOBUF_EXPORT extern const string& SStringPrintf(string* dst, const char* format, ...);
+PROTOBUF_EXPORT extern const std::string& SStringPrintf(std::string* dst,
+                                                        const char* format,
+                                                        ...);
 
 // Append result to a supplied string
-LIBPROTOBUF_EXPORT extern void StringAppendF(string* dst, const char* format, ...);
+PROTOBUF_EXPORT extern void StringAppendF(std::string* dst, const char* format,
+                                          ...);
 
 // Lower-level routine that takes a va_list and appends to a specified
 // string.  All other routines are just convenience wrappers around it.
-LIBPROTOBUF_EXPORT extern void StringAppendV(string* dst, const char* format, va_list ap);
+PROTOBUF_EXPORT extern void StringAppendV(std::string* dst, const char* format,
+                                          va_list ap);
 
 // The max arguments supported by StringPrintfVector
-LIBPROTOBUF_EXPORT extern const int kStringPrintfVectorMaxArgs;
+PROTOBUF_EXPORT extern const int kStringPrintfVectorMaxArgs;
 
 // You can use this version when all your arguments are strings, but
 // you don't know how many arguments you'll have at compile time.
 // StringPrintfVector will LOG(FATAL) if v.size() > kStringPrintfVectorMaxArgs
-LIBPROTOBUF_EXPORT extern string StringPrintfVector(const char* format, const vector<string>& v);
+PROTOBUF_EXPORT extern std::string StringPrintfVector(
+    const char* format, const std::vector<std::string>& v);
 
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_STRINGPRINTF_H
index d79a6ee..9a476c3 100644 (file)
@@ -1,4 +1,33 @@
-// Copyright 2005-2008 Google Inc. All Rights Reserved.
+// 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: jrm@google.com (Jim Meehan)
 
 #include <google/protobuf/stubs/common.h>
@@ -366,7 +395,7 @@ int UTF8GenericScan(const UTF8ScanObj* st,
   const uint8* isrc = reinterpret_cast<const uint8*>(str);
   const uint8* src = isrc;
   const uint8* srclimit = isrc + str_length;
-  const uint8* srclimit8 = srclimit - 7;
+  const uint8* srclimit8 = str_length < 7 ? isrc : srclimit - 7;
   const uint8* Tbl_0 = &st->state_table[st->state0];
 
  DoAgain:
@@ -427,8 +456,7 @@ int UTF8GenericScan(const UTF8ScanObj* st,
   }
   //----------------------------
 
-
-  // Exit posibilities:
+  // Exit possibilities:
   //  Some exit code, !state0, back up over last char
   //  Some exit code, state0, back up one byte exactly
   //  source consumed, !state0, back up over partial char
@@ -475,7 +503,7 @@ int UTF8GenericScanFastAscii(const UTF8ScanObj* st,
   const uint8* isrc =  reinterpret_cast<const uint8*>(str);
   const uint8* src = isrc;
   const uint8* srclimit = isrc + str_length;
-  const uint8* srclimit8 = srclimit - 7;
+  const uint8* srclimit8 = str_length < 7 ? isrc : srclimit - 7;
   int n;
   int rest_consumed;
   int exit_reason;
@@ -526,14 +554,14 @@ InitDetector init_detector;
 
 bool IsStructurallyValidUTF8(const char* buf, int len) {
   if (!module_initialized_) return true;
-  
+
   int bytes_consumed = 0;
   UTF8GenericScanFastAscii(&utf8acceptnonsurrogates_obj,
                            buf, len, &bytes_consumed);
   return (bytes_consumed == len);
 }
 
-int UTF8SpnStructurallyValid(const StringPiece& str) {
+int UTF8SpnStructurallyValid(StringPiece str) {
   if (!module_initialized_) return str.size();
 
   int bytes_consumed = 0;
@@ -554,8 +582,7 @@ int UTF8SpnStructurallyValid(const StringPiece& str) {
 //
 // Fast case: all is structurally valid and no byte copying is done.
 //
-char* UTF8CoerceToStructurallyValid(const StringPiece& src_str,
-                                    char* idst,
+char* UTF8CoerceToStructurallyValid(StringPiece src_str, char* idst,
                                     const char replace_char) {
   const char* isrc = src_str.data();
   const int len = src_str.length();
index 1a4d71c..6bead9a 100644 (file)
 // from google3/strings/strutil.cc
 
 #include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/mathlimits.h>
 
 #include <errno.h>
 #include <float.h>    // FLT_DIG and DBL_DIG
-#include <limits>
 #include <limits.h>
 #include <stdio.h>
+#include <cmath>
 #include <iterator>
+#include <limits>
 
+#include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/stl_util.h>
 
 #ifdef _WIN32
@@ -79,36 +80,21 @@ inline bool isprint(char c) {
 }
 
 // ----------------------------------------------------------------------
-// StripString
-//    Replaces any occurrence of the character 'remove' (or the characters
-//    in 'remove') with the character 'replacewith'.
-// ----------------------------------------------------------------------
-void StripString(string* s, const char* remove, char replacewith) {
-  const char * str_start = s->c_str();
-  const char * str = str_start;
-  for (str = strpbrk(str, remove);
-       str != NULL;
-       str = strpbrk(str + 1, remove)) {
-    (*s)[str - str_start] = replacewith;
-  }
-}
-
-// ----------------------------------------------------------------------
 // ReplaceCharacters
 //    Replaces any occurrence of the character 'remove' (or the characters
 //    in 'remove') with the character 'replacewith'.
 // ----------------------------------------------------------------------
-void ReplaceCharacters(string *s, const char *remove, char replacewith) {
+void ReplaceCharacters(std::string *s, const char *remove, char replacewith) {
   const char *str_start = s->c_str();
   const char *str = str_start;
   for (str = strpbrk(str, remove);
-       str != NULL;
+       str != nullptr;
        str = strpbrk(str + 1, remove)) {
     (*s)[str - str_start] = replacewith;
   }
 }
 
-void StripWhitespace(string* str) {
+void StripWhitespace(std::string *str) {
   int str_length = str->length();
 
   // Strip off leading whitespace.
@@ -132,7 +118,7 @@ void StripWhitespace(string* str) {
     --last;
   }
   if (last != (str_length - 1) && last >= 0) {
-    str->erase(last + 1, string::npos);
+    str->erase(last + 1, std::string::npos);
   }
 }
 
@@ -143,19 +129,19 @@ void StripWhitespace(string* str) {
 //    it only replaces the first instance of "old."
 // ----------------------------------------------------------------------
 
-void StringReplace(const string& s, const string& oldsub,
-                   const string& newsub, bool replace_all,
-                   string* res) {
+void StringReplace(const std::string &s, const std::string &oldsub,
+                   const std::string &newsub, bool replace_all,
+                   std::string *res) {
   if (oldsub.empty()) {
     res->append(s);  // if empty, append the given string.
     return;
   }
 
-  string::size_type start_pos = 0;
-  string::size_type pos;
+  std::string::size_type start_pos = 0;
+  std::string::size_type pos;
   do {
     pos = s.find(oldsub, start_pos);
-    if (pos == string::npos) {
+    if (pos == std::string::npos) {
       break;
     }
     res->append(s, start_pos, pos - start_pos);
@@ -174,9 +160,9 @@ void StringReplace(const string& s, const string& oldsub,
 //    happened or not.
 // ----------------------------------------------------------------------
 
-string StringReplace(const string& s, const string& oldsub,
-                     const string& newsub, bool replace_all) {
-  string ret;
+std::string StringReplace(const std::string &s, const std::string &oldsub,
+                          const std::string &newsub, bool replace_all) {
+  std::string ret;
   StringReplace(s, oldsub, newsub, replace_all, &ret);
   return ret;
 }
@@ -190,10 +176,8 @@ string StringReplace(const string& s, const string& oldsub,
 // the characters in the string, not the entire string as a single delimiter.
 // ----------------------------------------------------------------------
 template <typename ITR>
-static inline
-void SplitStringToIteratorUsing(const string& full,
-                                const char* delim,
-                                ITR& result) {
+static inline void SplitStringToIteratorUsing(StringPiece full,
+                                              const char *delim, ITR &result) {
   // Optimize the common case where delim is a single character.
   if (delim[0] != '\0' && delim[1] == '\0') {
     char c = delim[0];
@@ -205,29 +189,29 @@ void SplitStringToIteratorUsing(const string& full,
       } else {
         const char* start = p;
         while (++p != end && *p != c);
-        *result++ = string(start, p - start);
+        *result++ = std::string(start, p - start);
       }
     }
     return;
   }
 
-  string::size_type begin_index, end_index;
+  std::string::size_type begin_index, end_index;
   begin_index = full.find_first_not_of(delim);
-  while (begin_index != string::npos) {
+  while (begin_index != std::string::npos) {
     end_index = full.find_first_of(delim, begin_index);
-    if (end_index == string::npos) {
-      *result++ = full.substr(begin_index);
+    if (end_index == std::string::npos) {
+      *result++ = std::string(full.substr(begin_index));
       return;
     }
-    *result++ = full.substr(begin_index, (end_index - begin_index));
+    *result++ =
+        std::string(full.substr(begin_index, (end_index - begin_index)));
     begin_index = full.find_first_not_of(delim, end_index);
   }
 }
 
-void SplitStringUsing(const string& full,
-                      const char* delim,
-                      vector<string>* result) {
-  std::back_insert_iterator< vector<string> > it(*result);
+void SplitStringUsing(StringPiece full, const char *delim,
+                      std::vector<std::string> *result) {
+  std::back_insert_iterator<std::vector<std::string> > it(*result);
   SplitStringToIteratorUsing(full, delim, it);
 }
 
@@ -242,30 +226,29 @@ void SplitStringUsing(const string& full,
 //
 // If "pieces" is negative for some reason, it returns the whole string
 // ----------------------------------------------------------------------
-template <typename StringType, typename ITR>
-static inline
-void SplitStringToIteratorAllowEmpty(const StringType& full,
-                                     const char* delim,
-                                     int pieces,
-                                     ITR& result) {
-  string::size_type begin_index, end_index;
+template <typename ITR>
+static inline void SplitStringToIteratorAllowEmpty(StringPiece full,
+                                                   const char *delim,
+                                                   int pieces, ITR &result) {
+  std::string::size_type begin_index, end_index;
   begin_index = 0;
 
   for (int i = 0; (i < pieces-1) || (pieces == 0); i++) {
     end_index = full.find_first_of(delim, begin_index);
-    if (end_index == string::npos) {
-      *result++ = full.substr(begin_index);
+    if (end_index == std::string::npos) {
+      *result++ = std::string(full.substr(begin_index));
       return;
     }
-    *result++ = full.substr(begin_index, (end_index - begin_index));
+    *result++ =
+        std::string(full.substr(begin_index, (end_index - begin_index)));
     begin_index = end_index + 1;
   }
-  *result++ = full.substr(begin_index);
+  *result++ = std::string(full.substr(begin_index));
 }
 
-void SplitStringAllowEmpty(const string& full, const char* delim,
-                           vector<string>* result) {
-  std::back_insert_iterator<vector<string> > it(*result);
+void SplitStringAllowEmpty(StringPiece full, const char *delim,
+                           std::vector<std::string> *result) {
+  std::back_insert_iterator<std::vector<std::string> > it(*result);
   SplitStringToIteratorAllowEmpty(full, delim, 0, it);
 }
 
@@ -276,11 +259,9 @@ void SplitStringAllowEmpty(const string& full, const char* delim,
 //
 // ----------------------------------------------------------------------
 template <class ITERATOR>
-static void JoinStringsIterator(const ITERATOR& start,
-                                const ITERATOR& end,
-                                const char* delim,
-                                string* result) {
-  GOOGLE_CHECK(result != NULL);
+static void JoinStringsIterator(const ITERATOR &start, const ITERATOR &end,
+                                const char *delim, std::string *result) {
+  GOOGLE_CHECK(result != nullptr);
   result->clear();
   int delim_length = strlen(delim);
 
@@ -303,9 +284,8 @@ static void JoinStringsIterator(const ITERATOR& start,
   }
 }
 
-void JoinStrings(const vector<string>& components,
-                 const char* delim,
-                 string * result) {
+void JoinStrings(const std::vector<std::string> &components, const char *delim,
+                 std::string *result) {
   JoinStringsIterator(components.begin(), components.end(), delim, result);
 }
 
@@ -318,7 +298,7 @@ void JoinStrings(const vector<string>& components,
 //    result is truncated to 8 bits.
 //
 //    The second call stores its errors in a supplied string vector.
-//    If the string vector pointer is NULL, it reports the errors with LOG().
+//    If the string vector pointer is nullptr, it reports the errors with LOG().
 // ----------------------------------------------------------------------
 
 #define IS_OCTAL_DIGIT(c) (((c) >= '0') && ((c) <= '7'))
@@ -328,12 +308,12 @@ void JoinStrings(const vector<string>& components,
 #define LOG_STRING(LEVEL, VECTOR) GOOGLE_LOG_IF(LEVEL, false)
 
 int UnescapeCEscapeSequences(const char* source, char* dest) {
-  return UnescapeCEscapeSequences(source, dest, NULL);
+  return UnescapeCEscapeSequences(source, dest, nullptr);
 }
 
-int UnescapeCEscapeSequences(const char* source, char* dest,
-                             vector<string> *errors) {
-  GOOGLE_DCHECK(errors == NULL) << "Error reporting not implemented.";
+int UnescapeCEscapeSequences(const char *source, char *dest,
+                             std::vector<std::string> *errors) {
+  GOOGLE_DCHECK(errors == nullptr) << "Error reporting not implemented.";
 
   char* d = dest;
   const char* p = source;
@@ -387,8 +367,10 @@ int UnescapeCEscapeSequences(const char* source, char* dest,
           while (isxdigit(p[1]))  // arbitrarily many hex digits
             ch = (ch << 4) + hex_digit_to_int(*++p);
           if (ch > 0xFF)
-            LOG_STRING(ERROR, errors) << "Value of " <<
-              "\\" << string(hex_start, p+1-hex_start) << " exceeds 8 bits";
+            LOG_STRING(ERROR, errors)
+                << "Value of "
+                << "\\" << std::string(hex_start, p + 1 - hex_start)
+                << " exceeds 8 bits";
           *d++ = ch;
           break;
         }
@@ -403,7 +385,7 @@ int UnescapeCEscapeSequences(const char* source, char* dest,
             } else {
               LOG_STRING(ERROR, errors)
                 << "\\u must be followed by 4 hex digits: \\"
-                <<  string(hex_start, p+1-hex_start);
+                <<  std::string(hex_start, p+1-hex_start);
               break;
             }
           }
@@ -422,7 +404,7 @@ int UnescapeCEscapeSequences(const char* source, char* dest,
               if (newrune > 0x10FFFF) {
                 LOG_STRING(ERROR, errors)
                   << "Value of \\"
-                  << string(hex_start, p + 1 - hex_start)
+                  << std::string(hex_start, p + 1 - hex_start)
                   << " exceeds Unicode limit (0x10FFFF)";
                 break;
               } else {
@@ -431,7 +413,7 @@ int UnescapeCEscapeSequences(const char* source, char* dest,
             } else {
               LOG_STRING(ERROR, errors)
                 << "\\U must be followed by 8 hex digits: \\"
-                <<  string(hex_start, p+1-hex_start);
+                <<  std::string(hex_start, p+1-hex_start);
               break;
             }
           }
@@ -458,28 +440,28 @@ int UnescapeCEscapeSequences(const char* source, char* dest,
 //    to be the same.
 //
 //    The second call stores its errors in a supplied string vector.
-//    If the string vector pointer is NULL, it reports the errors with LOG().
+//    If the string vector pointer is nullptr, it reports the errors with LOG().
 //
 //    In the first and second calls, the length of dest is returned. In the
 //    the third call, the new string is returned.
 // ----------------------------------------------------------------------
-int UnescapeCEscapeString(const string& src, string* dest) {
-  return UnescapeCEscapeString(src, dest, NULL);
+int UnescapeCEscapeString(const std::string &src, std::string *dest) {
+  return UnescapeCEscapeString(src, dest, nullptr);
 }
 
-int UnescapeCEscapeString(const string& src, string* dest,
-                          vector<string> *errors) {
-  scoped_array<char> unescaped(new char[src.size() + 1]);
+int UnescapeCEscapeString(const std::string &src, std::string *dest,
+                          std::vector<std::string> *errors) {
+  std::unique_ptr<char[]> unescaped(new char[src.size() + 1]);
   int len = UnescapeCEscapeSequences(src.c_str(), unescaped.get(), errors);
   GOOGLE_CHECK(dest);
   dest->assign(unescaped.get(), len);
   return len;
 }
 
-string UnescapeCEscapeString(const string& src) {
-  scoped_array<char> unescaped(new char[src.size() + 1]);
-  int len = UnescapeCEscapeSequences(src.c_str(), unescaped.get(), NULL);
-  return string(unescaped.get(), len);
+std::string UnescapeCEscapeString(const std::string &src) {
+  std::unique_ptr<char[]> unescaped(new char[src.size() + 1]);
+  int len = UnescapeCEscapeSequences(src.c_str(), unescaped.get(), nullptr);
+  return std::string(unescaped.get(), len);
 }
 
 // ----------------------------------------------------------------------
@@ -563,7 +545,7 @@ static inline size_t CEscapedLength(StringPiece src) {
   };
 
   size_t escaped_len = 0;
-  for (int i = 0; i < src.size(); ++i) {
+  for (StringPiece::size_type i = 0; i < src.size(); ++i) {
     unsigned char c = static_cast<unsigned char>(src[i]);
     escaped_len += c_escaped_len[c];
   }
@@ -576,7 +558,7 @@ static inline size_t CEscapedLength(StringPiece src) {
 // the required space using a lookup table, and also does not do any special
 // handling for Hex or UTF-8 characters.
 // ----------------------------------------------------------------------
-void CEscapeAndAppend(StringPiece src, string* dest) {
+void CEscapeAndAppend(StringPiece src, std::string *dest) {
   size_t escaped_len = CEscapedLength(src);
   if (escaped_len == src.size()) {
     dest->append(src.data(), src.size());
@@ -587,7 +569,7 @@ void CEscapeAndAppend(StringPiece src, string* dest) {
   dest->resize(cur_dest_len + escaped_len);
   char* append_ptr = &(*dest)[cur_dest_len];
 
-  for (int i = 0; i < src.size(); ++i) {
+  for (StringPiece::size_type i = 0; i < src.size(); ++i) {
     unsigned char c = static_cast<unsigned char>(src[i]);
     switch (c) {
       case '\n': *append_ptr++ = '\\'; *append_ptr++ = 'n'; break;
@@ -610,30 +592,30 @@ void CEscapeAndAppend(StringPiece src, string* dest) {
   }
 }
 
-string CEscape(const string& src) {
-  string dest;
+std::string CEscape(const std::string &src) {
+  std::string dest;
   CEscapeAndAppend(src, &dest);
   return dest;
 }
 
 namespace strings {
 
-string Utf8SafeCEscape(const string& src) {
+std::string Utf8SafeCEscape(const std::string &src) {
   const int dest_length = src.size() * 4 + 1; // Maximum possible expansion
-  scoped_array<char> dest(new char[dest_length]);
+  std::unique_ptr<char[]> dest(new char[dest_length]);
   const int len = CEscapeInternal(src.data(), src.size(),
                                   dest.get(), dest_length, false, true);
   GOOGLE_DCHECK_GE(len, 0);
-  return string(dest.get(), len);
+  return std::string(dest.get(), len);
 }
 
-string CHexEscape(const string& src) {
+std::string CHexEscape(const std::string &src) {
   const int dest_length = src.size() * 4 + 1; // Maximum possible expansion
-  scoped_array<char> dest(new char[dest_length]);
+  std::unique_ptr<char[]> dest(new char[dest_length]);
   const int len = CEscapeInternal(src.data(), src.size(),
                                   dest.get(), dest_length, true, false);
   GOOGLE_DCHECK_GE(len, 0);
-  return string(dest.get(), len);
+  return std::string(dest.get(), len);
 }
 
 }  // namespace strings
@@ -681,8 +663,8 @@ uint32 strtou32_adaptor(const char *nptr, char **endptr, int base) {
   return static_cast<uint32>(result);
 }
 
-inline bool safe_parse_sign(string* text  /*inout*/,
-                            bool* negative_ptr  /*output*/) {
+inline bool safe_parse_sign(std::string *text /*inout*/,
+                            bool *negative_ptr /*output*/) {
   const char* start = text->data();
   const char* end = start + text->size();
 
@@ -709,9 +691,8 @@ inline bool safe_parse_sign(string* text  /*inout*/,
   return true;
 }
 
-template<typename IntType>
-bool safe_parse_positive_int(
-    string text, IntType* value_p) {
+template <typename IntType>
+bool safe_parse_positive_int(std::string text, IntType *value_p) {
   int base = 10;
   IntType value = 0;
   const IntType vmax = std::numeric_limits<IntType>::max();
@@ -743,9 +724,8 @@ bool safe_parse_positive_int(
   return true;
 }
 
-template<typename IntType>
-bool safe_parse_negative_int(
-    const string& text, IntType* value_p) {
+template <typename IntType>
+bool safe_parse_negative_int(const std::string &text, IntType *value_p) {
   int base = 10;
   IntType value = 0;
   const IntType vmin = std::numeric_limits<IntType>::min();
@@ -784,8 +764,8 @@ bool safe_parse_negative_int(
   return true;
 }
 
-template<typename IntType>
-bool safe_int_internal(string text, IntType* value_p) {
+template <typename IntType>
+bool safe_int_internal(std::string text, IntType *value_p) {
   *value_p = 0;
   bool negative;
   if (!safe_parse_sign(&text, &negative)) {
@@ -798,8 +778,8 @@ bool safe_int_internal(string text, IntType* value_p) {
   }
 }
 
-template<typename IntType>
-bool safe_uint_internal(string text, IntType* value_p) {
+template <typename IntType>
+bool safe_uint_internal(std::string text, IntType *value_p) {
   *value_p = 0;
   bool negative;
   if (!safe_parse_sign(&text, &negative) || negative) {
@@ -982,7 +962,7 @@ static const char two_ASCII_digits[100][2] = {
 
 char* FastUInt32ToBufferLeft(uint32 u, char* buffer) {
   uint32 digits;
-  const char *ASCII_digits = NULL;
+  const char *ASCII_digits = nullptr;
   // The idea of this implementation is to trim the number of divides to as few
   // as possible by using multiplication and subtraction rather than mod (%),
   // and by outputting two digits at a time rather than one.
@@ -1063,17 +1043,19 @@ done:
 }
 
 char* FastInt32ToBufferLeft(int32 i, char* buffer) {
-  uint32 u = i;
+  uint32 u = 0;
   if (i < 0) {
     *buffer++ = '-';
-    u = -i;
+    u -= i;
+  } else {
+    u = i;
   }
   return FastUInt32ToBufferLeft(u, buffer);
 }
 
 char* FastUInt64ToBufferLeft(uint64 u64, char* buffer) {
   int digits;
-  const char *ASCII_digits = NULL;
+  const char *ASCII_digits = nullptr;
 
   uint32 u = static_cast<uint32>(u64);
   if (u == u64) return FastUInt32ToBufferLeft(u, buffer);
@@ -1114,10 +1096,12 @@ char* FastUInt64ToBufferLeft(uint64 u64, char* buffer) {
 }
 
 char* FastInt64ToBufferLeft(int64 i, char* buffer) {
-  uint64 u = i;
+  uint64 u = 0;
   if (i < 0) {
     *buffer++ = '-';
-    u = -i;
+    u -= i;
+  } else {
+    u = i;
   }
   return FastUInt64ToBufferLeft(u, buffer);
 }
@@ -1129,46 +1113,46 @@ char* FastInt64ToBufferLeft(int64 i, char* buffer) {
 //    Return value: string
 // ----------------------------------------------------------------------
 
-string SimpleItoa(int i) {
+std::string SimpleItoa(int i) {
   char buffer[kFastToBufferSize];
   return (sizeof(i) == 4) ?
     FastInt32ToBuffer(i, buffer) :
     FastInt64ToBuffer(i, buffer);
 }
 
-string SimpleItoa(unsigned int i) {
+std::string SimpleItoa(unsigned int i) {
   char buffer[kFastToBufferSize];
-  return string(buffer, (sizeof(i) == 4) ?
-    FastUInt32ToBufferLeft(i, buffer) :
-    FastUInt64ToBufferLeft(i, buffer));
+  return std::string(buffer, (sizeof(i) == 4)
+                                 ? FastUInt32ToBufferLeft(i, buffer)
+                                 : FastUInt64ToBufferLeft(i, buffer));
 }
 
-string SimpleItoa(long i) {
+std::string SimpleItoa(long i) {
   char buffer[kFastToBufferSize];
   return (sizeof(i) == 4) ?
     FastInt32ToBuffer(i, buffer) :
     FastInt64ToBuffer(i, buffer);
 }
 
-string SimpleItoa(unsigned long i) {
+std::string SimpleItoa(unsigned long i) {
   char buffer[kFastToBufferSize];
-  return string(buffer, (sizeof(i) == 4) ?
-    FastUInt32ToBufferLeft(i, buffer) :
-    FastUInt64ToBufferLeft(i, buffer));
+  return std::string(buffer, (sizeof(i) == 4)
+                                 ? FastUInt32ToBufferLeft(i, buffer)
+                                 : FastUInt64ToBufferLeft(i, buffer));
 }
 
-string SimpleItoa(long long i) {
+std::string SimpleItoa(long long i) {
   char buffer[kFastToBufferSize];
   return (sizeof(i) == 4) ?
     FastInt32ToBuffer(i, buffer) :
     FastInt64ToBuffer(i, buffer);
 }
 
-string SimpleItoa(unsigned long long i) {
+std::string SimpleItoa(unsigned long long i) {
   char buffer[kFastToBufferSize];
-  return string(buffer, (sizeof(i) == 4) ?
-    FastUInt32ToBufferLeft(i, buffer) :
-    FastUInt64ToBufferLeft(i, buffer));
+  return std::string(buffer, (sizeof(i) == 4)
+                                 ? FastUInt32ToBufferLeft(i, buffer)
+                                 : FastUInt64ToBufferLeft(i, buffer));
 }
 
 // ----------------------------------------------------------------------
@@ -1212,12 +1196,12 @@ string SimpleItoa(unsigned long long i) {
 //    implementation.
 // ----------------------------------------------------------------------
 
-string SimpleDtoa(double value) {
+std::string SimpleDtoa(double value) {
   char buffer[kDoubleToBufferSize];
   return DoubleToBuffer(value, buffer);
 }
 
-string SimpleFtoa(float value) {
+std::string SimpleFtoa(float value) {
   char buffer[kFloatToBufferSize];
   return FloatToBuffer(value, buffer);
 }
@@ -1231,7 +1215,7 @@ static inline bool IsValidFloatChar(char c) {
 void DelocalizeRadix(char* buffer) {
   // Fast check:  if the buffer has a normal decimal point, assume no
   // translation is needed.
-  if (strchr(buffer, '.') != NULL) return;
+  if (strchr(buffer, '.') != nullptr) return;
 
   // Find the first unknown character.
   while (IsValidFloatChar(*buffer)) ++buffer;
@@ -1260,7 +1244,7 @@ char* DoubleToBuffer(double value, char* buffer) {
   // platforms these days.  Just in case some system exists where DBL_DIG
   // is significantly larger -- and risks overflowing our buffer -- we have
   // this assert.
-  GOOGLE_COMPILE_ASSERT(DBL_DIG < 20, DBL_DIG_is_too_big);
+  static_assert(DBL_DIG < 20, "DBL_DIG_is_too_big");
 
   if (value == std::numeric_limits<double>::infinity()) {
     strcpy(buffer, "inf");
@@ -1268,7 +1252,7 @@ char* DoubleToBuffer(double value, char* buffer) {
   } else if (value == -std::numeric_limits<double>::infinity()) {
     strcpy(buffer, "-inf");
     return buffer;
-  } else if (MathLimits<double>::IsNaN(value)) {
+  } else if (std::isnan(value)) {
     strcpy(buffer, "nan");
     return buffer;
   }
@@ -1286,10 +1270,10 @@ char* DoubleToBuffer(double value, char* buffer) {
   // of a double.  This long double may have extra bits that make it compare
   // unequal to "value" even though it would be exactly equal if it were
   // truncated to a double.
-  volatile double parsed_value = strtod(buffer, NULL);
+  volatile double parsed_value = internal::NoLocaleStrtod(buffer, nullptr);
   if (parsed_value != value) {
-    int snprintf_result =
-      snprintf(buffer, kDoubleToBufferSize, "%.*g", DBL_DIG+2, value);
+    snprintf_result =
+        snprintf(buffer, kDoubleToBufferSize, "%.*g", DBL_DIG + 2, value);
 
     // Should never overflow; see above.
     GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kDoubleToBufferSize);
@@ -1303,7 +1287,7 @@ static int memcasecmp(const char *s1, const char *s2, size_t len) {
   const unsigned char *us1 = reinterpret_cast<const unsigned char *>(s1);
   const unsigned char *us2 = reinterpret_cast<const unsigned char *>(s2);
 
-  for ( int i = 0; i < len; i++ ) {
+  for (size_t i = 0; i < len; i++) {
     const int diff =
       static_cast<int>(static_cast<unsigned char>(ascii_tolower(us1[i]))) -
       static_cast<int>(static_cast<unsigned char>(ascii_tolower(us2[i])));
@@ -1318,7 +1302,7 @@ inline bool CaseEqual(StringPiece s1, StringPiece s2) {
 }
 
 bool safe_strtob(StringPiece str, bool* value) {
-  GOOGLE_CHECK(value != NULL) << "NULL output boolean given.";
+  GOOGLE_CHECK(value != nullptr) << "nullptr output boolean given.";
   if (CaseEqual(str, "true") || CaseEqual(str, "t") ||
       CaseEqual(str, "yes") || CaseEqual(str, "y") ||
       CaseEqual(str, "1")) {
@@ -1338,7 +1322,7 @@ bool safe_strtof(const char* str, float* value) {
   char* endptr;
   errno = 0;  // errno only gets set on errors
 #if defined(_WIN32) || defined (__hpux)  // has no strtof()
-  *value = strtod(str, &endptr);
+  *value = internal::NoLocaleStrtod(str, &endptr);
 #else
   *value = strtof(str, &endptr);
 #endif
@@ -1347,7 +1331,7 @@ bool safe_strtof(const char* str, float* value) {
 
 bool safe_strtod(const char* str, double* value) {
   char* endptr;
-  *value = strtod(str, &endptr);
+  *value = internal::NoLocaleStrtod(str, &endptr);
   if (endptr != str) {
     while (ascii_isspace(*endptr)) ++endptr;
   }
@@ -1357,19 +1341,19 @@ bool safe_strtod(const char* str, double* value) {
   return *str != '\0' && *endptr == '\0';
 }
 
-bool safe_strto32(const string& str, int32* value) {
+bool safe_strto32(const std::string &str, int32 *value) {
   return safe_int_internal(str, value);
 }
 
-bool safe_strtou32(const string& str, uint32* value) {
+bool safe_strtou32(const std::string &str, uint32 *value) {
   return safe_uint_internal(str, value);
 }
 
-bool safe_strto64(const string& str, int64* value) {
+bool safe_strto64(const std::string &str, int64 *value) {
   return safe_int_internal(str, value);
 }
 
-bool safe_strtou64(const string& str, uint64* value) {
+bool safe_strtou64(const std::string &str, uint64 *value) {
   return safe_uint_internal(str, value);
 }
 
@@ -1378,7 +1362,7 @@ char* FloatToBuffer(float value, char* buffer) {
   // platforms these days.  Just in case some system exists where FLT_DIG
   // is significantly larger -- and risks overflowing our buffer -- we have
   // this assert.
-  GOOGLE_COMPILE_ASSERT(FLT_DIG < 10, FLT_DIG_is_too_big);
+  static_assert(FLT_DIG < 10, "FLT_DIG_is_too_big");
 
   if (value == std::numeric_limits<double>::infinity()) {
     strcpy(buffer, "inf");
@@ -1386,7 +1370,7 @@ char* FloatToBuffer(float value, char* buffer) {
   } else if (value == -std::numeric_limits<double>::infinity()) {
     strcpy(buffer, "-inf");
     return buffer;
-  } else if (MathLimits<float>::IsNaN(value)) {
+  } else if (std::isnan(value)) {
     strcpy(buffer, "nan");
     return buffer;
   }
@@ -1400,8 +1384,8 @@ char* FloatToBuffer(float value, char* buffer) {
 
   float parsed_value;
   if (!safe_strtof(buffer, &parsed_value) || parsed_value != value) {
-    int snprintf_result =
-      snprintf(buffer, kFloatToBufferSize, "%.*g", FLT_DIG+3, value);
+    snprintf_result =
+        snprintf(buffer, kFloatToBufferSize, "%.*g", FLT_DIG + 3, value);
 
     // Should never overflow; see above.
     GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kFloatToBufferSize);
@@ -1445,36 +1429,48 @@ AlphaNum::AlphaNum(strings::Hex hex) {
 // after the area just overwritten.  It comes in multiple flavors to minimize
 // call overhead.
 static char *Append1(char *out, const AlphaNum &x) {
-  memcpy(out, x.data(), x.size());
-  return out + x.size();
+  if (x.size() > 0) {
+    memcpy(out, x.data(), x.size());
+    out += x.size();
+  }
+  return out;
 }
 
 static char *Append2(char *out, const AlphaNum &x1, const AlphaNum &x2) {
-  memcpy(out, x1.data(), x1.size());
-  out += x1.size();
-
-  memcpy(out, x2.data(), x2.size());
-  return out + x2.size();
+  if (x1.size() > 0) {
+    memcpy(out, x1.data(), x1.size());
+    out += x1.size();
+  }
+  if (x2.size() > 0) {
+    memcpy(out, x2.data(), x2.size());
+    out += x2.size();
+  }
+  return out;
 }
 
-static char *Append4(char *out,
-                     const AlphaNum &x1, const AlphaNum &x2,
+static char *Append4(char *out, const AlphaNum &x1, const AlphaNum &x2,
                      const AlphaNum &x3, const AlphaNum &x4) {
-  memcpy(out, x1.data(), x1.size());
-  out += x1.size();
-
-  memcpy(out, x2.data(), x2.size());
-  out += x2.size();
-
-  memcpy(out, x3.data(), x3.size());
-  out += x3.size();
-
-  memcpy(out, x4.data(), x4.size());
-  return out + x4.size();
+  if (x1.size() > 0) {
+    memcpy(out, x1.data(), x1.size());
+    out += x1.size();
+  }
+  if (x2.size() > 0) {
+    memcpy(out, x2.data(), x2.size());
+    out += x2.size();
+  }
+  if (x3.size() > 0) {
+    memcpy(out, x3.data(), x3.size());
+    out += x3.size();
+  }
+  if (x4.size() > 0) {
+    memcpy(out, x4.data(), x4.size());
+    out += x4.size();
+  }
+  return out;
 }
 
-string StrCat(const AlphaNum &a, const AlphaNum &b) {
-  string result;
+std::string StrCat(const AlphaNum &a, const AlphaNum &b) {
+  std::string result;
   result.resize(a.size() + b.size());
   char *const begin = &*result.begin();
   char *out = Append2(begin, a, b);
@@ -1482,8 +1478,8 @@ string StrCat(const AlphaNum &a, const AlphaNum &b) {
   return result;
 }
 
-string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c) {
-  string result;
+std::string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c) {
+  std::string result;
   result.resize(a.size() + b.size() + c.size());
   char *const begin = &*result.begin();
   char *out = Append2(begin, a, b);
@@ -1492,9 +1488,9 @@ string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c) {
   return result;
 }
 
-string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
-              const AlphaNum &d) {
-  string result;
+std::string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
+                   const AlphaNum &d) {
+  std::string result;
   result.resize(a.size() + b.size() + c.size() + d.size());
   char *const begin = &*result.begin();
   char *out = Append4(begin, a, b, c, d);
@@ -1502,9 +1498,9 @@ string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
   return result;
 }
 
-string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
-              const AlphaNum &d, const AlphaNum &e) {
-  string result;
+std::string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
+                   const AlphaNum &d, const AlphaNum &e) {
+  std::string result;
   result.resize(a.size() + b.size() + c.size() + d.size() + e.size());
   char *const begin = &*result.begin();
   char *out = Append4(begin, a, b, c, d);
@@ -1513,9 +1509,9 @@ string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
   return result;
 }
 
-string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
-              const AlphaNum &d, const AlphaNum &e, const AlphaNum &f) {
-  string result;
+std::string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
+                   const AlphaNum &d, const AlphaNum &e, const AlphaNum &f) {
+  std::string result;
   result.resize(a.size() + b.size() + c.size() + d.size() + e.size() +
                 f.size());
   char *const begin = &*result.begin();
@@ -1525,10 +1521,10 @@ string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
   return result;
 }
 
-string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
-              const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
-              const AlphaNum &g) {
-  string result;
+std::string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
+                   const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
+                   const AlphaNum &g) {
+  std::string result;
   result.resize(a.size() + b.size() + c.size() + d.size() + e.size() +
                 f.size() + g.size());
   char *const begin = &*result.begin();
@@ -1539,10 +1535,10 @@ string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
   return result;
 }
 
-string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
-              const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
-              const AlphaNum &g, const AlphaNum &h) {
-  string result;
+std::string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
+                   const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
+                   const AlphaNum &g, const AlphaNum &h) {
+  std::string result;
   result.resize(a.size() + b.size() + c.size() + d.size() + e.size() +
                 f.size() + g.size() + h.size());
   char *const begin = &*result.begin();
@@ -1552,10 +1548,10 @@ string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
   return result;
 }
 
-string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
-              const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
-              const AlphaNum &g, const AlphaNum &h, const AlphaNum &i) {
-  string result;
+std::string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
+                   const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
+                   const AlphaNum &g, const AlphaNum &h, const AlphaNum &i) {
+  std::string result;
   result.resize(a.size() + b.size() + c.size() + d.size() + e.size() +
                 f.size() + g.size() + h.size() + i.size());
   char *const begin = &*result.begin();
@@ -1574,27 +1570,27 @@ string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
     GOOGLE_DCHECK_GT(uintptr_t((src).data() - (dest).data()), \
                      uintptr_t((dest).size()))
 
-void StrAppend(string *result, const AlphaNum &a) {
+void StrAppend(std::string *result, const AlphaNum &a) {
   GOOGLE_DCHECK_NO_OVERLAP(*result, a);
   result->append(a.data(), a.size());
 }
 
-void StrAppend(string *result, const AlphaNum &a, const AlphaNum &b) {
+void StrAppend(std::string *result, const AlphaNum &a, const AlphaNum &b) {
   GOOGLE_DCHECK_NO_OVERLAP(*result, a);
   GOOGLE_DCHECK_NO_OVERLAP(*result, b);
-  string::size_type old_size = result->size();
+  std::string::size_type old_size = result->size();
   result->resize(old_size + a.size() + b.size());
   char *const begin = &*result->begin();
   char *out = Append2(begin + old_size, a, b);
   GOOGLE_DCHECK_EQ(out, begin + result->size());
 }
 
-void StrAppend(string *result,
-               const AlphaNum &a, const AlphaNum &b, const AlphaNum &c) {
+void StrAppend(std::string *result, const AlphaNum &a, const AlphaNum &b,
+               const AlphaNum &c) {
   GOOGLE_DCHECK_NO_OVERLAP(*result, a);
   GOOGLE_DCHECK_NO_OVERLAP(*result, b);
   GOOGLE_DCHECK_NO_OVERLAP(*result, c);
-  string::size_type old_size = result->size();
+  std::string::size_type old_size = result->size();
   result->resize(old_size + a.size() + b.size() + c.size());
   char *const begin = &*result->begin();
   char *out = Append2(begin + old_size, a, b);
@@ -1602,33 +1598,32 @@ void StrAppend(string *result,
   GOOGLE_DCHECK_EQ(out, begin + result->size());
 }
 
-void StrAppend(string *result,
-               const AlphaNum &a, const AlphaNum &b,
+void StrAppend(std::string *result, const AlphaNum &a, const AlphaNum &b,
                const AlphaNum &c, const AlphaNum &d) {
   GOOGLE_DCHECK_NO_OVERLAP(*result, a);
   GOOGLE_DCHECK_NO_OVERLAP(*result, b);
   GOOGLE_DCHECK_NO_OVERLAP(*result, c);
   GOOGLE_DCHECK_NO_OVERLAP(*result, d);
-  string::size_type old_size = result->size();
+  std::string::size_type old_size = result->size();
   result->resize(old_size + a.size() + b.size() + c.size() + d.size());
   char *const begin = &*result->begin();
   char *out = Append4(begin + old_size, a, b, c, d);
   GOOGLE_DCHECK_EQ(out, begin + result->size());
 }
 
-int GlobalReplaceSubstring(const string& substring,
-                           const string& replacement,
-                           string* s) {
-  GOOGLE_CHECK(s != NULL);
+int GlobalReplaceSubstring(const std::string &substring,
+                           const std::string &replacement, std::string *s) {
+  GOOGLE_CHECK(s != nullptr);
   if (s->empty() || substring.empty())
     return 0;
-  string tmp;
+  std::string tmp;
   int num_replacements = 0;
   int pos = 0;
-  for (int match_pos = s->find(substring.data(), pos, substring.length());
-       match_pos != string::npos;
-       pos = match_pos + substring.length(),
-           match_pos = s->find(substring.data(), pos, substring.length())) {
+  for (StringPiece::size_type match_pos =
+           s->find(substring.data(), pos, substring.length());
+       match_pos != std::string::npos; pos = match_pos + substring.length(),
+                              match_pos = s->find(substring.data(), pos,
+                                                  substring.length())) {
     ++num_replacements;
     // Append the original content before the match.
     tmp.append(*s, pos, match_pos - pos);
@@ -1959,24 +1954,25 @@ int Base64UnescapeInternal(const char *src_param, int szsrc,
 // #include <sys/time.h>
 // #include <stdlib.h>
 // #include <string.h>
+// #include <stdio.h>
 // main()
 // {
 //   static const char Base64[] =
 //     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-//   char *pos;
+//   const char *pos;
 //   int idx, i, j;
 //   printf("    ");
 //   for (i = 0; i < 255; i += 8) {
 //     for (j = i; j < i + 8; j++) {
 //       pos = strchr(Base64, j);
-//       if ((pos == NULL) || (j == 0))
+//       if ((pos == nullptr) || (j == 0))
 //         idx = -1;
 //       else
 //         idx = pos - Base64;
 //       if (idx == -1)
 //         printf(" %2d,     ", idx);
 //       else
-//         printf(" %2d/*%c*/,", idx, j);
+//         printf(" %2d/""*%c*""/,", idx, j);
 //     }
 //     printf("\n    ");
 //   }
@@ -1994,7 +1990,7 @@ static const signed char kUnBase64[] = {
   52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/,
   60/*8*/, 61/*9*/, -1,      -1,      -1,      -1,      -1,      -1,
   -1,       0/*A*/,  1/*B*/,  2/*C*/,  3/*D*/,  4/*E*/,  5/*F*/,  6/*G*/,
-  07/*H*/,  8/*I*/,  9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
+   7/*H*/,  8/*I*/,  9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
   15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/,
   23/*X*/, 24/*Y*/, 25/*Z*/, -1,      -1,      -1,      -1,      -1,
   -1,      26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/,
@@ -2028,7 +2024,7 @@ static const signed char kUnWebSafeBase64[] = {
   52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/,
   60/*8*/, 61/*9*/, -1,      -1,      -1,      -1,      -1,      -1,
   -1,       0/*A*/,  1/*B*/,  2/*C*/,  3/*D*/,  4/*E*/,  5/*F*/,  6/*G*/,
-  07/*H*/,  8/*I*/,  9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
+   7/*H*/,  8/*I*/,  9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
   15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/,
   23/*X*/, 24/*Y*/, 25/*Z*/, -1,      -1,      -1,      -1,      63/*_*/,
   -1,      26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/,
@@ -2057,8 +2053,8 @@ int WebSafeBase64Unescape(const char *src, int szsrc, char *dest, int szdest) {
   return Base64UnescapeInternal(src, szsrc, dest, szdest, kUnWebSafeBase64);
 }
 
-static bool Base64UnescapeInternal(const char* src, int slen, string* dest,
-                                   const signed charunbase64) {
+static bool Base64UnescapeInternal(const char *src, int slen, std::string *dest,
+                                   const signed char *unbase64) {
   // Determine the size of the output string.  Base64 encodes every 3 bytes into
   // 4 characters.  any leftover chars are added directly for good measure.
   // This is documented in the base64 RFC: http://tools.ietf.org/html/rfc3548
@@ -2082,11 +2078,11 @@ static bool Base64UnescapeInternal(const char* src, int slen, string* dest,
   return true;
 }
 
-bool Base64Unescape(StringPiece src, string* dest) {
+bool Base64Unescape(StringPiece src, std::string *dest) {
   return Base64UnescapeInternal(src.data(), src.size(), dest, kUnBase64);
 }
 
-bool WebSafeBase64Unescape(StringPiece src, string* dest) {
+bool WebSafeBase64Unescape(StringPiece src, std::string *dest) {
   return Base64UnescapeInternal(src.data(), src.size(), dest, kUnWebSafeBase64);
 }
 
@@ -2105,7 +2101,7 @@ int Base64EscapeInternal(const unsigned char *src, int szsrc,
   char *limit_dest = dest + szdest;
   const unsigned char *limit_src = src + szsrc;
 
-  // Three bytes of data encodes to four characters of cyphertext.
+  // Three bytes of data encodes to four characters of ciphertext.
   // So we can pump through three-byte chunks atomically.
   while (cur_src < limit_src - 3) {  // keep going as long as we have >= 32 bits
     uint32 in = BigEndian::Load32(cur_src) >> 8;
@@ -2132,7 +2128,7 @@ int Base64EscapeInternal(const unsigned char *src, int szsrc,
       break;
     case 1: {
       // One byte left: this encodes to two characters, and (optionally)
-      // two pad characters to round out the four-character cypherblock.
+      // two pad characters to round out the four-character cipherblock.
       if ((szdest -= 2) < 0) return 0;
       uint32 in = cur_src[0];
       cur_dest[0] = base64[in >> 2];
@@ -2149,7 +2145,7 @@ int Base64EscapeInternal(const unsigned char *src, int szsrc,
     }
     case 2: {
       // Two bytes left: this encodes to three characters, and (optionally)
-      // one pad character to round out the four-character cypherblock.
+      // one pad character to round out the four-character cipherblock.
       if ((szdest -= 3) < 0) return 0;
       uint32 in = BigEndian::Load16(cur_src);
       cur_dest[0] = base64[in >> 10];
@@ -2205,9 +2201,9 @@ int WebSafeBase64Escape(const unsigned char *src, int szsrc, char *dest,
                               kWebSafeBase64Chars, do_padding);
 }
 
-void Base64EscapeInternal(const unsigned charsrc, int szsrc,
-                          string* dest, bool do_padding,
-                          const charbase64_chars) {
+void Base64EscapeInternal(const unsigned char *src, int szsrc,
+                          std::string *dest, bool do_padding,
+                          const char *base64_chars) {
   const int calc_escaped_size =
     CalculateBase64EscapedLen(szsrc, do_padding);
   dest->resize(calc_escaped_size);
@@ -2220,27 +2216,27 @@ void Base64EscapeInternal(const unsigned char* src, int szsrc,
   dest->erase(escaped_len);
 }
 
-void Base64Escape(const unsigned char *src, int szsrc,
-                  string* dest, bool do_padding) {
+void Base64Escape(const unsigned char *src, int szsrc, std::string *dest,
+                  bool do_padding) {
   Base64EscapeInternal(src, szsrc, dest, do_padding, kBase64Chars);
 }
 
-void WebSafeBase64Escape(const unsigned char *src, int szsrc,
-                         string *dest, bool do_padding) {
+void WebSafeBase64Escape(const unsigned char *src, int szsrc, std::string *dest,
+                         bool do_padding) {
   Base64EscapeInternal(src, szsrc, dest, do_padding, kWebSafeBase64Chars);
 }
 
-void Base64Escape(StringPiece src, string* dest) {
+void Base64Escape(StringPiece src, std::string *dest) {
   Base64Escape(reinterpret_cast<const unsigned char*>(src.data()),
                src.size(), dest, true);
 }
 
-void WebSafeBase64Escape(StringPiece src, string* dest) {
+void WebSafeBase64Escape(StringPiece src, std::string *dest) {
   WebSafeBase64Escape(reinterpret_cast<const unsigned char*>(src.data()),
                       src.size(), dest, false);
 }
 
-void WebSafeBase64EscapeWithPadding(StringPiece src, string* dest) {
+void WebSafeBase64EscapeWithPadding(StringPiece src, std::string *dest) {
   WebSafeBase64Escape(reinterpret_cast<const unsigned char*>(src.data()),
                       src.size(), dest, true);
 }
@@ -2281,16 +2277,19 @@ int EncodeAsUTF8Char(uint32 code_point, char* output) {
 
 // Table of UTF-8 character lengths, based on first byte
 static const unsigned char kUTF8LenTbl[256] = {
-  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
-  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
-  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
-  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
-
-  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
-  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
-  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,
-  3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4
-};
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+    3, 3, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
 
 // Return length of a single UTF-8 source character
 int UTF8FirstLetterNumBytes(const char* src, int len) {
@@ -2300,5 +2299,181 @@ int UTF8FirstLetterNumBytes(const char* src, int len) {
   return kUTF8LenTbl[*reinterpret_cast<const uint8*>(src)];
 }
 
+// ----------------------------------------------------------------------
+// CleanStringLineEndings()
+//   Clean up a multi-line string to conform to Unix line endings.
+//   Reads from src and appends to dst, so usually dst should be empty.
+//
+//   If there is no line ending at the end of a non-empty string, it can
+//   be added automatically.
+//
+//   Four different types of input are correctly handled:
+//
+//     - Unix/Linux files: line ending is LF: pass through unchanged
+//
+//     - DOS/Windows files: line ending is CRLF: convert to LF
+//
+//     - Legacy Mac files: line ending is CR: convert to LF
+//
+//     - Garbled files: random line endings: convert gracefully
+//                      lonely CR, lonely LF, CRLF: convert to LF
+//
+//   @param src The multi-line string to convert
+//   @param dst The converted string is appended to this string
+//   @param auto_end_last_line Automatically terminate the last line
+//
+//   Limitations:
+//
+//     This does not do the right thing for CRCRLF files created by
+//     broken programs that do another Unix->DOS conversion on files
+//     that are already in CRLF format.  For this, a two-pass approach
+//     brute-force would be needed that
+//
+//       (1) determines the presence of LF (first one is ok)
+//       (2) if yes, removes any CR, else convert every CR to LF
+
+void CleanStringLineEndings(const std::string &src, std::string *dst,
+                            bool auto_end_last_line) {
+  if (dst->empty()) {
+    dst->append(src);
+    CleanStringLineEndings(dst, auto_end_last_line);
+  } else {
+    std::string tmp = src;
+    CleanStringLineEndings(&tmp, auto_end_last_line);
+    dst->append(tmp);
+  }
+}
+
+void CleanStringLineEndings(std::string *str, bool auto_end_last_line) {
+  ptrdiff_t output_pos = 0;
+  bool r_seen = false;
+  ptrdiff_t len = str->size();
+
+  char *p = &(*str)[0];
+
+  for (ptrdiff_t input_pos = 0; input_pos < len;) {
+    if (!r_seen && input_pos + 8 < len) {
+      uint64_t v = GOOGLE_UNALIGNED_LOAD64(p + input_pos);
+      // Loop over groups of 8 bytes at a time until we come across
+      // a word that has a byte whose value is less than or equal to
+      // '\r' (i.e. could contain a \n (0x0a) or a \r (0x0d) ).
+      //
+      // We use a has_less macro that quickly tests a whole 64-bit
+      // word to see if any of the bytes has a value < N.
+      //
+      // For more details, see:
+      //   http://graphics.stanford.edu/~seander/bithacks.html#HasLessInWord
+#define has_less(x, n) (((x) - ~0ULL / 255 * (n)) & ~(x) & ~0ULL / 255 * 128)
+      if (!has_less(v, '\r' + 1)) {
+#undef has_less
+        // No byte in this word has a value that could be a \r or a \n
+        if (output_pos != input_pos) {
+          GOOGLE_UNALIGNED_STORE64(p + output_pos, v);
+        }
+        input_pos += 8;
+        output_pos += 8;
+        continue;
+      }
+    }
+    std::string::const_reference in = p[input_pos];
+    if (in == '\r') {
+      if (r_seen) p[output_pos++] = '\n';
+      r_seen = true;
+    } else if (in == '\n') {
+      if (input_pos != output_pos)
+        p[output_pos++] = '\n';
+      else
+        output_pos++;
+      r_seen = false;
+    } else {
+      if (r_seen) p[output_pos++] = '\n';
+      r_seen = false;
+      if (input_pos != output_pos)
+        p[output_pos++] = in;
+      else
+        output_pos++;
+    }
+    input_pos++;
+  }
+  if (r_seen ||
+      (auto_end_last_line && output_pos > 0 && p[output_pos - 1] != '\n')) {
+    str->resize(output_pos + 1);
+    str->operator[](output_pos) = '\n';
+  } else if (output_pos < len) {
+    str->resize(output_pos);
+  }
+}
+
+namespace internal {
+
+// ----------------------------------------------------------------------
+// NoLocaleStrtod()
+//   This code will make you cry.
+// ----------------------------------------------------------------------
+
+namespace {
+
+// Returns a string identical to *input except that the character pointed to
+// by radix_pos (which should be '.') is replaced with the locale-specific
+// radix character.
+std::string LocalizeRadix(const char *input, const char *radix_pos) {
+  // Determine the locale-specific radix character by calling sprintf() to
+  // print the number 1.5, then stripping off the digits.  As far as I can
+  // tell, this is the only portable, thread-safe way to get the C library
+  // to divuldge the locale's radix character.  No, localeconv() is NOT
+  // thread-safe.
+  char temp[16];
+  int size = snprintf(temp, sizeof(temp), "%.1f", 1.5);
+  GOOGLE_CHECK_EQ(temp[0], '1');
+  GOOGLE_CHECK_EQ(temp[size - 1], '5');
+  GOOGLE_CHECK_LE(size, 6);
+
+  // Now replace the '.' in the input with it.
+  std::string result;
+  result.reserve(strlen(input) + size - 3);
+  result.append(input, radix_pos);
+  result.append(temp + 1, size - 2);
+  result.append(radix_pos + 1);
+  return result;
+}
+
+}  // namespace
+
+double NoLocaleStrtod(const char *str, char **endptr) {
+  // We cannot simply set the locale to "C" temporarily with setlocale()
+  // as this is not thread-safe.  Instead, we try to parse in the current
+  // locale first.  If parsing stops at a '.' character, then this is a
+  // pretty good hint that we're actually in some other locale in which
+  // '.' is not the radix character.
+
+  char *temp_endptr;
+  double result = strtod(str, &temp_endptr);
+  if (endptr != NULL) *endptr = temp_endptr;
+  if (*temp_endptr != '.') return result;
+
+  // Parsing halted on a '.'.  Perhaps we're in a different locale?  Let's
+  // try to replace the '.' with a locale-specific radix character and
+  // try again.
+  std::string localized = LocalizeRadix(str, temp_endptr);
+  const char *localized_cstr = localized.c_str();
+  char *localized_endptr;
+  result = strtod(localized_cstr, &localized_endptr);
+  if ((localized_endptr - localized_cstr) > (temp_endptr - str)) {
+    // This attempt got further, so replacing the decimal must have helped.
+    // Update endptr to point at the right location.
+    if (endptr != NULL) {
+      // size_diff is non-zero if the localized radix has multiple bytes.
+      int size_diff = localized.size() - strlen(str);
+      // const_cast is necessary to match the strtod() interface.
+      *endptr = const_cast<char *>(
+          str + (localized_endptr - localized_cstr - size_diff));
+    }
+  }
+
+  return result;
+}
+
+}  // namespace internal
+
 }  // namespace protobuf
 }  // namespace google
index df28c94..84fc232 100644 (file)
 #ifndef GOOGLE_PROTOBUF_STUBS_STRUTIL_H__
 #define GOOGLE_PROTOBUF_STUBS_STRUTIL_H__
 
-#include <stdlib.h>
-#include <vector>
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/stringpiece.h>
+#include <stdlib.h>
+
+#include <cstring>
+#include <google/protobuf/port_def.inc>
+#include <vector>
 
 namespace google {
 namespace protobuf {
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 1800
 #define strtoll  _strtoi64
 #define strtoull _strtoui64
 #elif defined(__DECCXX) && defined(__osf__)
@@ -110,13 +113,13 @@ inline int hex_digit_to_int(char c) {
 //    prefix string if the prefix matches, otherwise the original
 //    string.
 // ----------------------------------------------------------------------
-inline bool HasPrefixString(const string& str,
-                            const string& prefix) {
+inline bool HasPrefixString(StringPiece str, StringPiece prefix) {
   return str.size() >= prefix.size() &&
-         str.compare(0, prefix.size(), prefix) == 0;
+         memcmp(str.data(), prefix.data(), prefix.size()) == 0;
 }
 
-inline string StripPrefixString(const string& str, const string& prefix) {
+inline std::string StripPrefixString(const std::string& str,
+                                     const std::string& prefix) {
   if (HasPrefixString(str, prefix)) {
     return str.substr(prefix.size());
   } else {
@@ -132,13 +135,14 @@ inline string StripPrefixString(const string& str, const string& prefix) {
 //    suffix string if the suffix matches, otherwise the original
 //    string.
 // ----------------------------------------------------------------------
-inline bool HasSuffixString(const string& str,
-                            const string& suffix) {
+inline bool HasSuffixString(StringPiece str, StringPiece suffix) {
   return str.size() >= suffix.size() &&
-         str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
+         memcmp(str.data() + str.size() - suffix.size(), suffix.data(),
+                suffix.size()) == 0;
 }
 
-inline string StripSuffixString(const string& str, const string& suffix) {
+inline std::string StripSuffixString(const std::string& str,
+                                     const std::string& suffix) {
   if (HasSuffixString(str, suffix)) {
     return str.substr(0, str.size() - suffix.size());
   } else {
@@ -155,13 +159,10 @@ inline string StripSuffixString(const string& str, const string& suffix) {
 // StripWhitespace
 //    Removes whitespaces from both ends of the given string.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT void ReplaceCharacters(string* s, const char* remove,
-                                          char replacewith);
-LIBPROTOBUF_EXPORT void StripString(string* s, const char* remove,
-                                    char replacewith);
-
-LIBPROTOBUF_EXPORT void StripWhitespace(string* s);
+PROTOBUF_EXPORT void ReplaceCharacters(std::string* s, const char* remove,
+                                       char replacewith);
 
+PROTOBUF_EXPORT void StripWhitespace(std::string* s);
 
 // ----------------------------------------------------------------------
 // LowerString()
@@ -173,24 +174,26 @@ LIBPROTOBUF_EXPORT void StripWhitespace(string* s);
 //    strings.
 // ----------------------------------------------------------------------
 
-inline void LowerString(string * s) {
-  string::iterator end = s->end();
-  for (string::iterator i = s->begin(); i != end; ++i) {
+inline void LowerString(std::string* s) {
+  std::string::iterator end = s->end();
+  for (std::string::iterator i = s->begin(); i != end; ++i) {
     // tolower() changes based on locale.  We don't want this!
     if ('A' <= *i && *i <= 'Z') *i += 'a' - 'A';
   }
 }
 
-inline void UpperString(string * s) {
-  string::iterator end = s->end();
-  for (string::iterator i = s->begin(); i != end; ++i) {
+inline void UpperString(std::string* s) {
+  std::string::iterator end = s->end();
+  for (std::string::iterator i = s->begin(); i != end; ++i) {
     // toupper() changes based on locale.  We don't want this!
     if ('a' <= *i && *i <= 'z') *i += 'A' - 'a';
   }
 }
 
-inline string ToUpper(const string& s) {
-  string out = s;
+inline void ToUpper(std::string* s) { UpperString(s); }
+
+inline std::string ToUpper(const std::string& s) {
+  std::string out = s;
   UpperString(&out);
   return out;
 }
@@ -203,8 +206,10 @@ inline string ToUpper(const string& s) {
 //    happened or not.
 // ----------------------------------------------------------------------
 
-LIBPROTOBUF_EXPORT string StringReplace(const string& s, const string& oldsub,
-                                        const string& newsub, bool replace_all);
+PROTOBUF_EXPORT std::string StringReplace(const std::string& s,
+                                          const std::string& oldsub,
+                                          const std::string& newsub,
+                                          bool replace_all);
 
 // ----------------------------------------------------------------------
 // SplitStringUsing()
@@ -212,8 +217,8 @@ LIBPROTOBUF_EXPORT string StringReplace(const string& s, const string& oldsub,
 //    to 'result'.  If there are consecutive delimiters, this function skips
 //    over all of them.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT void SplitStringUsing(const string& full, const char* delim,
-                                         vector<string>* res);
+PROTOBUF_EXPORT void SplitStringUsing(StringPiece full, const char* delim,
+                                      std::vector<std::string>* res);
 
 // Split a string using one or more byte delimiters, presented
 // as a nul-terminated c string. Append the components to 'result'.
@@ -223,17 +228,16 @@ LIBPROTOBUF_EXPORT void SplitStringUsing(const string& full, const char* delim,
 //
 // If "full" is the empty string, yields an empty string as the only value.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT void SplitStringAllowEmpty(const string& full,
-                                              const char* delim,
-                                              vector<string>* result);
+PROTOBUF_EXPORT void SplitStringAllowEmpty(StringPiece full, const char* delim,
+                                           std::vector<std::string>* result);
 
 // ----------------------------------------------------------------------
 // Split()
 //    Split a string using a character delimiter.
 // ----------------------------------------------------------------------
-inline vector<string> Split(
-    const string& full, const char* delim, bool skip_empty = true) {
-  vector<string> result;
+inline std::vector<std::string> Split(StringPiece full, const char* delim,
+                                      bool skip_empty = true) {
+  std::vector<std::string> result;
   if (skip_empty) {
     SplitStringUsing(full, delim, &result);
   } else {
@@ -250,12 +254,12 @@ inline vector<string> Split(
 //    another takes a pointer to the target string. In the latter case the
 //    target string is cleared and overwritten.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT void JoinStrings(const vector<string>& components,
-                                    const char* delim, string* result);
+PROTOBUF_EXPORT void JoinStrings(const std::vector<std::string>& components,
+                                 const char* delim, std::string* result);
 
-inline string JoinStrings(const vector<string>& components,
-                          const char* delim) {
-  string result;
+inline std::string JoinStrings(const std::vector<std::string>& components,
+                               const char* delim) {
+  std::string result;
   JoinStrings(components, delim, &result);
   return result;
 }
@@ -285,15 +289,15 @@ inline string JoinStrings(const vector<string>& components,
 //
 //    Errors: In the first form of the call, errors are reported with
 //    LOG(ERROR). The same is true for the second form of the call if
-//    the pointer to the string vector is NULL; otherwise, error
-//    messages are stored in the vector. In either case, the effect on
+//    the pointer to the string std::vector is nullptr; otherwise, error
+//    messages are stored in the std::vector. In either case, the effect on
 //    the dest array is not defined, but rest of the source will be
 //    processed.
 //    ----------------------------------------------------------------------
 
-LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest);
-LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest,
-                                                vector<string> *errors);
+PROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest);
+PROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest,
+                                             std::vector<std::string>* errors);
 
 // ----------------------------------------------------------------------
 // UnescapeCEscapeString()
@@ -304,16 +308,18 @@ LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest,
 //    to be the same.
 //
 //    The second call stores its errors in a supplied string vector.
-//    If the string vector pointer is NULL, it reports the errors with LOG().
+//    If the string vector pointer is nullptr, it reports the errors with LOG().
 //
 //    In the first and second calls, the length of dest is returned. In the
 //    the third call, the new string is returned.
 // ----------------------------------------------------------------------
 
-LIBPROTOBUF_EXPORT int UnescapeCEscapeString(const string& src, string* dest);
-LIBPROTOBUF_EXPORT int UnescapeCEscapeString(const string& src, string* dest,
-                                             vector<string> *errors);
-LIBPROTOBUF_EXPORT string UnescapeCEscapeString(const string& src);
+PROTOBUF_EXPORT int UnescapeCEscapeString(const std::string& src,
+                                          std::string* dest);
+PROTOBUF_EXPORT int UnescapeCEscapeString(const std::string& src,
+                                          std::string* dest,
+                                          std::vector<std::string>* errors);
+PROTOBUF_EXPORT std::string UnescapeCEscapeString(const std::string& src);
 
 // ----------------------------------------------------------------------
 // CEscape()
@@ -322,21 +328,21 @@ LIBPROTOBUF_EXPORT string UnescapeCEscapeString(const string& src);
 //
 //    Escaped chars: \n, \r, \t, ", ', \, and !isprint().
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT string CEscape(const string& src);
+PROTOBUF_EXPORT std::string CEscape(const std::string& src);
 
 // ----------------------------------------------------------------------
 // CEscapeAndAppend()
 //    Escapes 'src' using C-style escape sequences, and appends the escaped
 //    string to 'dest'.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT void CEscapeAndAppend(StringPiece src, string* dest);
+PROTOBUF_EXPORT void CEscapeAndAppend(StringPiece src, std::string* dest);
 
 namespace strings {
 // Like CEscape() but does not escape bytes with the upper bit set.
-LIBPROTOBUF_EXPORT string Utf8SafeCEscape(const string& src);
+PROTOBUF_EXPORT std::string Utf8SafeCEscape(const std::string& src);
 
 // Like CEscape() but uses hex (\x) escapes instead of octals.
-LIBPROTOBUF_EXPORT string CHexEscape(const string& src);
+PROTOBUF_EXPORT std::string CHexEscape(const std::string& src);
 }  // namespace strings
 
 // ----------------------------------------------------------------------
@@ -349,10 +355,10 @@ LIBPROTOBUF_EXPORT string CHexEscape(const string& src);
 //    platforms, so using these is safer, from the point of view of
 //    overflow behavior, than using the standard libc functions.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT int32 strto32_adaptor(const char *nptr, char **endptr,
-                                         int base);
-LIBPROTOBUF_EXPORT uint32 strtou32_adaptor(const char *nptr, char **endptr,
-                                           int base);
+PROTOBUF_EXPORT int32 strto32_adaptor(const char* nptr, char** endptr,
+                                      int base);
+PROTOBUF_EXPORT uint32 strtou32_adaptor(const char* nptr, char** endptr,
+                                        int base);
 
 inline int32 strto32(const char *nptr, char **endptr, int base) {
   if (sizeof(int32) == sizeof(long))
@@ -371,14 +377,14 @@ inline uint32 strtou32(const char *nptr, char **endptr, int base) {
 // For now, long long is 64-bit on all the platforms we care about, so these
 // functions can simply pass the call to strto[u]ll.
 inline int64 strto64(const char *nptr, char **endptr, int base) {
-  GOOGLE_COMPILE_ASSERT(sizeof(int64) == sizeof(long long),
-                        sizeof_int64_is_not_sizeof_long_long);
+  static_assert(sizeof(int64) == sizeof(long long),
+                "sizeof_int64_is_not_sizeof_long_long");
   return strtoll(nptr, endptr, base);
 }
 
 inline uint64 strtou64(const char *nptr, char **endptr, int base) {
-  GOOGLE_COMPILE_ASSERT(sizeof(uint64) == sizeof(unsigned long long),
-                        sizeof_uint64_is_not_sizeof_long_long);
+  static_assert(sizeof(uint64) == sizeof(unsigned long long),
+                "sizeof_uint64_is_not_sizeof_long_long");
   return strtoull(nptr, endptr, base);
 }
 
@@ -391,44 +397,44 @@ inline uint64 strtou64(const char *nptr, char **endptr, int base) {
 // safe_strtof()
 // safe_strtod()
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT bool safe_strtob(StringPiece str, bool* value);
+PROTOBUF_EXPORT bool safe_strtob(StringPiece str, bool* value);
 
-LIBPROTOBUF_EXPORT bool safe_strto32(const string& str, int32* value);
-LIBPROTOBUF_EXPORT bool safe_strtou32(const string& str, uint32* value);
+PROTOBUF_EXPORT bool safe_strto32(const std::string& str, int32* value);
+PROTOBUF_EXPORT bool safe_strtou32(const std::string& str, uint32* value);
 inline bool safe_strto32(const char* str, int32* value) {
-  return safe_strto32(string(str), value);
+  return safe_strto32(std::string(str), value);
 }
 inline bool safe_strto32(StringPiece str, int32* value) {
   return safe_strto32(str.ToString(), value);
 }
 inline bool safe_strtou32(const char* str, uint32* value) {
-  return safe_strtou32(string(str), value);
+  return safe_strtou32(std::string(str), value);
 }
 inline bool safe_strtou32(StringPiece str, uint32* value) {
   return safe_strtou32(str.ToString(), value);
 }
 
-LIBPROTOBUF_EXPORT bool safe_strto64(const string& str, int64* value);
-LIBPROTOBUF_EXPORT bool safe_strtou64(const string& str, uint64* value);
+PROTOBUF_EXPORT bool safe_strto64(const std::string& str, int64* value);
+PROTOBUF_EXPORT bool safe_strtou64(const std::string& str, uint64* value);
 inline bool safe_strto64(const char* str, int64* value) {
-  return safe_strto64(string(str), value);
+  return safe_strto64(std::string(str), value);
 }
 inline bool safe_strto64(StringPiece str, int64* value) {
   return safe_strto64(str.ToString(), value);
 }
 inline bool safe_strtou64(const char* str, uint64* value) {
-  return safe_strtou64(string(str), value);
+  return safe_strtou64(std::string(str), value);
 }
 inline bool safe_strtou64(StringPiece str, uint64* value) {
   return safe_strtou64(str.ToString(), value);
 }
 
-LIBPROTOBUF_EXPORT bool safe_strtof(const char* str, float* value);
-LIBPROTOBUF_EXPORT bool safe_strtod(const char* str, double* value);
-inline bool safe_strtof(const string& str, float* value) {
+PROTOBUF_EXPORT bool safe_strtof(const char* str, float* value);
+PROTOBUF_EXPORT bool safe_strtod(const char* str, double* value);
+inline bool safe_strtof(const std::string& str, float* value) {
   return safe_strtof(str.c_str(), value);
 }
-inline bool safe_strtod(const string& str, double* value) {
+inline bool safe_strtod(const std::string& str, double* value) {
   return safe_strtod(str.c_str(), value);
 }
 inline bool safe_strtof(StringPiece str, float* value) {
@@ -464,13 +470,13 @@ inline bool safe_strtod(StringPiece str, double* value) {
 // DoubleToBuffer() and FloatToBuffer().
 static const int kFastToBufferSize = 32;
 
-LIBPROTOBUF_EXPORT char* FastInt32ToBuffer(int32 i, char* buffer);
-LIBPROTOBUF_EXPORT char* FastInt64ToBuffer(int64 i, char* buffer);
+PROTOBUF_EXPORT char* FastInt32ToBuffer(int32 i, char* buffer);
+PROTOBUF_EXPORT char* FastInt64ToBuffer(int64 i, char* buffer);
 char* FastUInt32ToBuffer(uint32 i, char* buffer);  // inline below
 char* FastUInt64ToBuffer(uint64 i, char* buffer);  // inline below
-LIBPROTOBUF_EXPORT char* FastHexToBuffer(int i, char* buffer);
-LIBPROTOBUF_EXPORT char* FastHex64ToBuffer(uint64 i, char* buffer);
-LIBPROTOBUF_EXPORT char* FastHex32ToBuffer(uint32 i, char* buffer);
+PROTOBUF_EXPORT char* FastHexToBuffer(int i, char* buffer);
+PROTOBUF_EXPORT char* FastHex64ToBuffer(uint64 i, char* buffer);
+PROTOBUF_EXPORT char* FastHex32ToBuffer(uint32 i, char* buffer);
 
 // at least 22 bytes long
 inline char* FastIntToBuffer(int i, char* buffer) {
@@ -506,10 +512,10 @@ inline char* FastULongToBuffer(unsigned long i, char* buffer) {
 // terminating the string).
 // ----------------------------------------------------------------------
 
-LIBPROTOBUF_EXPORT char* FastInt32ToBufferLeft(int32 i, char* buffer);
-LIBPROTOBUF_EXPORT char* FastUInt32ToBufferLeft(uint32 i, char* buffer);
-LIBPROTOBUF_EXPORT char* FastInt64ToBufferLeft(int64 i, char* buffer);
-LIBPROTOBUF_EXPORT char* FastUInt64ToBufferLeft(uint64 i, char* buffer);
+PROTOBUF_EXPORT char* FastInt32ToBufferLeft(int32 i, char* buffer);
+PROTOBUF_EXPORT char* FastUInt32ToBufferLeft(uint32 i, char* buffer);
+PROTOBUF_EXPORT char* FastInt64ToBufferLeft(int64 i, char* buffer);
+PROTOBUF_EXPORT char* FastUInt64ToBufferLeft(uint64 i, char* buffer);
 
 // Just define these in terms of the above.
 inline char* FastUInt32ToBuffer(uint32 i, char* buffer) {
@@ -521,9 +527,7 @@ inline char* FastUInt64ToBuffer(uint64 i, char* buffer) {
   return buffer;
 }
 
-inline string SimpleBtoa(bool value) {
-  return value ? "true" : "false";
-}
+inline std::string SimpleBtoa(bool value) { return value ? "true" : "false"; }
 
 // ----------------------------------------------------------------------
 // SimpleItoa()
@@ -531,12 +535,12 @@ inline string SimpleBtoa(bool value) {
 //
 //    Return value: string
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT string SimpleItoa(int i);
-LIBPROTOBUF_EXPORT string SimpleItoa(unsigned int i);
-LIBPROTOBUF_EXPORT string SimpleItoa(long i);
-LIBPROTOBUF_EXPORT string SimpleItoa(unsigned long i);
-LIBPROTOBUF_EXPORT string SimpleItoa(long long i);
-LIBPROTOBUF_EXPORT string SimpleItoa(unsigned long long i);
+PROTOBUF_EXPORT std::string SimpleItoa(int i);
+PROTOBUF_EXPORT std::string SimpleItoa(unsigned int i);
+PROTOBUF_EXPORT std::string SimpleItoa(long i);
+PROTOBUF_EXPORT std::string SimpleItoa(unsigned long i);
+PROTOBUF_EXPORT std::string SimpleItoa(long long i);
+PROTOBUF_EXPORT std::string SimpleItoa(unsigned long long i);
 
 // ----------------------------------------------------------------------
 // SimpleDtoa()
@@ -557,11 +561,11 @@ LIBPROTOBUF_EXPORT string SimpleItoa(unsigned long long i);
 //
 //    Return value: string
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT string SimpleDtoa(double value);
-LIBPROTOBUF_EXPORT string SimpleFtoa(float value);
+PROTOBUF_EXPORT std::string SimpleDtoa(double value);
+PROTOBUF_EXPORT std::string SimpleFtoa(float value);
 
-LIBPROTOBUF_EXPORT char* DoubleToBuffer(double i, char* buffer);
-LIBPROTOBUF_EXPORT char* FloatToBuffer(float i, char* buffer);
+PROTOBUF_EXPORT char* DoubleToBuffer(double i, char* buffer);
+PROTOBUF_EXPORT char* FloatToBuffer(float i, char* buffer);
 
 // In practice, doubles should never need more than 24 bytes and floats
 // should never need more than 14 (including null terminators), but we
@@ -610,7 +614,7 @@ struct Hex {
   }
 };
 
-struct LIBPROTOBUF_EXPORT AlphaNum {
+struct PROTOBUF_EXPORT AlphaNum {
   const char *piece_data_;  // move these to string_ref eventually
   size_t piece_size_;       // move these to string_ref eventually
 
@@ -619,16 +623,26 @@ struct LIBPROTOBUF_EXPORT AlphaNum {
   // No bool ctor -- bools convert to an integral type.
   // A bool ctor would also convert incoming pointers (bletch).
 
-  AlphaNum(int32 i32)
+  AlphaNum(int i32)
       : piece_data_(digits),
         piece_size_(FastInt32ToBufferLeft(i32, digits) - &digits[0]) {}
-  AlphaNum(uint32 u32)
+  AlphaNum(unsigned int u32)
       : piece_data_(digits),
         piece_size_(FastUInt32ToBufferLeft(u32, digits) - &digits[0]) {}
-  AlphaNum(int64 i64)
+  AlphaNum(long long i64)
       : piece_data_(digits),
         piece_size_(FastInt64ToBufferLeft(i64, digits) - &digits[0]) {}
-  AlphaNum(uint64 u64)
+  AlphaNum(unsigned long long u64)
+      : piece_data_(digits),
+        piece_size_(FastUInt64ToBufferLeft(u64, digits) - &digits[0]) {}
+
+  // Note: on some architectures, "long" is only 32 bits, not 64, but the
+  // performance hit of using FastInt64ToBufferLeft to handle 32-bit values
+  // is quite minor.
+  AlphaNum(long i64)
+      : piece_data_(digits),
+        piece_size_(FastInt64ToBufferLeft(i64, digits) - &digits[0]) {}
+  AlphaNum(unsigned long u64)
       : piece_data_(digits),
         piece_size_(FastUInt64ToBufferLeft(u64, digits) - &digits[0]) {}
 
@@ -644,15 +658,12 @@ struct LIBPROTOBUF_EXPORT AlphaNum {
   // TODO: Add a string_ref constructor, eventually
   // AlphaNum(const StringPiece &pc) : piece(pc) {}
 
-  AlphaNum(const string& str)
+  AlphaNum(const std::string& str)
       : piece_data_(str.data()), piece_size_(str.size()) {}
 
   AlphaNum(StringPiece str)
       : piece_data_(str.data()), piece_size_(str.size()) {}
 
-  AlphaNum(internal::StringPiecePod str)
-      : piece_data_(str.data()), piece_size_(str.size()) {}
-
   size_t size() const { return piece_size_; }
   const char *data() const { return piece_data_; }
 
@@ -692,32 +703,34 @@ using strings::AlphaNum;
 //    be a reference into str.
 // ----------------------------------------------------------------------
 
-LIBPROTOBUF_EXPORT string StrCat(const AlphaNum& a, const AlphaNum& b);
-LIBPROTOBUF_EXPORT string StrCat(const AlphaNum& a, const AlphaNum& b,
-                                 const AlphaNum& c);
-LIBPROTOBUF_EXPORT string StrCat(const AlphaNum& a, const AlphaNum& b,
-                                 const AlphaNum& c, const AlphaNum& d);
-LIBPROTOBUF_EXPORT string StrCat(const AlphaNum& a, const AlphaNum& b,
-                                 const AlphaNum& c, const AlphaNum& d,
-                                 const AlphaNum& e);
-LIBPROTOBUF_EXPORT string StrCat(const AlphaNum& a, const AlphaNum& b,
-                                 const AlphaNum& c, const AlphaNum& d,
-                                 const AlphaNum& e, const AlphaNum& f);
-LIBPROTOBUF_EXPORT string StrCat(const AlphaNum& a, const AlphaNum& b,
-                                 const AlphaNum& c, const AlphaNum& d,
-                                 const AlphaNum& e, const AlphaNum& f,
-                                 const AlphaNum& g);
-LIBPROTOBUF_EXPORT string StrCat(const AlphaNum& a, const AlphaNum& b,
-                                 const AlphaNum& c, const AlphaNum& d,
-                                 const AlphaNum& e, const AlphaNum& f,
-                                 const AlphaNum& g, const AlphaNum& h);
-LIBPROTOBUF_EXPORT string StrCat(const AlphaNum& a, const AlphaNum& b,
-                                 const AlphaNum& c, const AlphaNum& d,
-                                 const AlphaNum& e, const AlphaNum& f,
-                                 const AlphaNum& g, const AlphaNum& h,
-                                 const AlphaNum& i);
-
-inline string StrCat(const AlphaNum& a) { return string(a.data(), a.size()); }
+PROTOBUF_EXPORT std::string StrCat(const AlphaNum& a, const AlphaNum& b);
+PROTOBUF_EXPORT std::string StrCat(const AlphaNum& a, const AlphaNum& b,
+                                   const AlphaNum& c);
+PROTOBUF_EXPORT std::string StrCat(const AlphaNum& a, const AlphaNum& b,
+                                   const AlphaNum& c, const AlphaNum& d);
+PROTOBUF_EXPORT std::string StrCat(const AlphaNum& a, const AlphaNum& b,
+                                   const AlphaNum& c, const AlphaNum& d,
+                                   const AlphaNum& e);
+PROTOBUF_EXPORT std::string StrCat(const AlphaNum& a, const AlphaNum& b,
+                                   const AlphaNum& c, const AlphaNum& d,
+                                   const AlphaNum& e, const AlphaNum& f);
+PROTOBUF_EXPORT std::string StrCat(const AlphaNum& a, const AlphaNum& b,
+                                   const AlphaNum& c, const AlphaNum& d,
+                                   const AlphaNum& e, const AlphaNum& f,
+                                   const AlphaNum& g);
+PROTOBUF_EXPORT std::string StrCat(const AlphaNum& a, const AlphaNum& b,
+                                   const AlphaNum& c, const AlphaNum& d,
+                                   const AlphaNum& e, const AlphaNum& f,
+                                   const AlphaNum& g, const AlphaNum& h);
+PROTOBUF_EXPORT std::string StrCat(const AlphaNum& a, const AlphaNum& b,
+                                   const AlphaNum& c, const AlphaNum& d,
+                                   const AlphaNum& e, const AlphaNum& f,
+                                   const AlphaNum& g, const AlphaNum& h,
+                                   const AlphaNum& i);
+
+inline std::string StrCat(const AlphaNum& a) {
+  return std::string(a.data(), a.size());
+}
 
 // ----------------------------------------------------------------------
 // StrAppend()
@@ -740,14 +753,14 @@ inline string StrCat(const AlphaNum& a) { return string(a.data(), a.size()); }
 //    worked around as consecutive calls to StrAppend are quite efficient.
 // ----------------------------------------------------------------------
 
-LIBPROTOBUF_EXPORT void StrAppend(string* dest, const AlphaNum& a);
-LIBPROTOBUF_EXPORT void StrAppend(string* dest, const AlphaNum& a,
-                                  const AlphaNum& b);
-LIBPROTOBUF_EXPORT void StrAppend(string* dest, const AlphaNum& a,
-                                  const AlphaNum& b, const AlphaNum& c);
-LIBPROTOBUF_EXPORT void StrAppend(string* dest, const AlphaNum& a,
-                                  const AlphaNum& b, const AlphaNum& c,
-                                  const AlphaNum& d);
+PROTOBUF_EXPORT void StrAppend(std::string* dest, const AlphaNum& a);
+PROTOBUF_EXPORT void StrAppend(std::string* dest, const AlphaNum& a,
+                               const AlphaNum& b);
+PROTOBUF_EXPORT void StrAppend(std::string* dest, const AlphaNum& a,
+                               const AlphaNum& b, const AlphaNum& c);
+PROTOBUF_EXPORT void StrAppend(std::string* dest, const AlphaNum& a,
+                               const AlphaNum& b, const AlphaNum& c,
+                               const AlphaNum& d);
 
 // ----------------------------------------------------------------------
 // Join()
@@ -755,8 +768,8 @@ LIBPROTOBUF_EXPORT void StrAppend(string* dest, const AlphaNum& a,
 //    the C-string "delim" as a separator between components.
 // ----------------------------------------------------------------------
 template <typename Iterator>
-void Join(Iterator start, Iterator end,
-          const char* delim, string* result) {
+void Join(Iterator start, Iterator end, const char* delim,
+          std::string* result) {
   for (Iterator it = start; it != end; ++it) {
     if (it != start) {
       result->append(delim);
@@ -766,9 +779,8 @@ void Join(Iterator start, Iterator end,
 }
 
 template <typename Range>
-string Join(const Range& components,
-            const char* delim) {
-  string result;
+std::string Join(const Range& components, const char* delim) {
+  std::string result;
   Join(components.begin(), components.end(), delim, &result);
   return result;
 }
@@ -777,7 +789,7 @@ string Join(const Range& components,
 // ToHex()
 //    Return a lower-case hex string representation of the given integer.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT string ToHex(uint64 num);
+PROTOBUF_EXPORT std::string ToHex(uint64 num);
 
 // ----------------------------------------------------------------------
 // GlobalReplaceSubstring()
@@ -786,9 +798,9 @@ LIBPROTOBUF_EXPORT string ToHex(uint64 num);
 //
 //    NOTE: The string pieces must not overlap s.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT int GlobalReplaceSubstring(const string& substring,
-                                              const string& replacement,
-                                              string* s);
+PROTOBUF_EXPORT int GlobalReplaceSubstring(const std::string& substring,
+                                           const std::string& replacement,
+                                           std::string* s);
 
 // ----------------------------------------------------------------------
 // Base64Unescape()
@@ -796,7 +808,7 @@ LIBPROTOBUF_EXPORT int GlobalReplaceSubstring(const string& substring,
 //    writes it to "dest". If src contains invalid characters, dest is cleared
 //    and the function returns false. Returns true on success.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT bool Base64Unescape(StringPiece src, string* dest);
+PROTOBUF_EXPORT bool Base64Unescape(StringPiece src, std::string* dest);
 
 // ----------------------------------------------------------------------
 // WebSafeBase64Unescape()
@@ -809,18 +821,17 @@ LIBPROTOBUF_EXPORT bool Base64Unescape(StringPiece src, string* dest);
 //    returns false (with dest empty) if src contains invalid chars; for
 //    this version src and dest must be different strings.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT int WebSafeBase64Unescape(const char* src, int slen,
-                                             char* dest, int szdest);
-LIBPROTOBUF_EXPORT bool WebSafeBase64Unescape(StringPiece src, string* dest);
+PROTOBUF_EXPORT int WebSafeBase64Unescape(const char* src, int slen, char* dest,
+                                          int szdest);
+PROTOBUF_EXPORT bool WebSafeBase64Unescape(StringPiece src, std::string* dest);
 
 // Return the length to use for the output buffer given to the base64 escape
 // routines. Make sure to use the same value for do_padding in both.
 // This function may return incorrect results if given input_len values that
 // are extremely high, which should happen rarely.
-LIBPROTOBUF_EXPORT int CalculateBase64EscapedLen(int input_len,
-                                                 bool do_padding);
+PROTOBUF_EXPORT int CalculateBase64EscapedLen(int input_len, bool do_padding);
 // Use this version when calling Base64Escape without a do_padding arg.
-LIBPROTOBUF_EXPORT int CalculateBase64EscapedLen(int input_len);
+PROTOBUF_EXPORT int CalculateBase64EscapedLen(int input_len);
 
 // ----------------------------------------------------------------------
 // Base64Escape()
@@ -834,23 +845,23 @@ LIBPROTOBUF_EXPORT int CalculateBase64EscapedLen(int input_len);
 //    to escape them.  It also has an extra parameter "do_padding",
 //    which when set to false will prevent padding with "=".
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT int Base64Escape(const unsigned char* src, int slen,
-                                    char* dest, int szdest);
-LIBPROTOBUF_EXPORT int WebSafeBase64Escape(
-    const unsigned char* src, int slen, char* dest,
-    int szdest, bool do_padding);
+PROTOBUF_EXPORT int Base64Escape(const unsigned char* src, int slen, char* dest,
+                                 int szdest);
+PROTOBUF_EXPORT int WebSafeBase64Escape(const unsigned char* src, int slen,
+                                        char* dest, int szdest,
+                                        bool do_padding);
 // Encode src into dest with padding.
-LIBPROTOBUF_EXPORT void Base64Escape(StringPiece src, string* dest);
+PROTOBUF_EXPORT void Base64Escape(StringPiece src, std::string* dest);
 // Encode src into dest web-safely without padding.
-LIBPROTOBUF_EXPORT void WebSafeBase64Escape(StringPiece src, string* dest);
+PROTOBUF_EXPORT void WebSafeBase64Escape(StringPiece src, std::string* dest);
 // Encode src into dest web-safely with padding.
-LIBPROTOBUF_EXPORT void WebSafeBase64EscapeWithPadding(StringPiece src,
-                                                       string* dest);
+PROTOBUF_EXPORT void WebSafeBase64EscapeWithPadding(StringPiece src,
+                                                    std::string* dest);
 
-LIBPROTOBUF_EXPORT void Base64Escape(const unsigned char* src, int szsrc,
-                                     string* dest, bool do_padding);
-LIBPROTOBUF_EXPORT void WebSafeBase64Escape(const unsigned char* src, int szsrc,
-                                            string* dest, bool do_padding);
+PROTOBUF_EXPORT void Base64Escape(const unsigned char* src, int szsrc,
+                                  std::string* dest, bool do_padding);
+PROTOBUF_EXPORT void WebSafeBase64Escape(const unsigned char* src, int szsrc,
+                                         std::string* dest, bool do_padding);
 
 inline bool IsValidCodePoint(uint32 code_point) {
   return code_point < 0xD800 ||
@@ -864,15 +875,76 @@ static const int UTFmax = 4;
 //  in any external dependencies. The output buffer must be as least 4 bytes
 //  large.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT int EncodeAsUTF8Char(uint32 code_point, char* output);
+PROTOBUF_EXPORT int EncodeAsUTF8Char(uint32 code_point, char* output);
 
 // ----------------------------------------------------------------------
 // UTF8FirstLetterNumBytes()
 //   Length of the first UTF-8 character.
 // ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT int UTF8FirstLetterNumBytes(const char* src, int len);
+PROTOBUF_EXPORT int UTF8FirstLetterNumBytes(const char* src, int len);
+
+// From google3/third_party/absl/strings/escaping.h
+
+// ----------------------------------------------------------------------
+// CleanStringLineEndings()
+//   Clean up a multi-line string to conform to Unix line endings.
+//   Reads from src and appends to dst, so usually dst should be empty.
+//
+//   If there is no line ending at the end of a non-empty string, it can
+//   be added automatically.
+//
+//   Four different types of input are correctly handled:
+//
+//     - Unix/Linux files: line ending is LF: pass through unchanged
+//
+//     - DOS/Windows files: line ending is CRLF: convert to LF
+//
+//     - Legacy Mac files: line ending is CR: convert to LF
+//
+//     - Garbled files: random line endings: convert gracefully
+//                      lonely CR, lonely LF, CRLF: convert to LF
+//
+//   @param src The multi-line string to convert
+//   @param dst The converted string is appended to this string
+//   @param auto_end_last_line Automatically terminate the last line
+//
+//   Limitations:
+//
+//     This does not do the right thing for CRCRLF files created by
+//     broken programs that do another Unix->DOS conversion on files
+//     that are already in CRLF format.  For this, a two-pass approach
+//     brute-force would be needed that
+//
+//       (1) determines the presence of LF (first one is ok)
+//       (2) if yes, removes any CR, else convert every CR to LF
+PROTOBUF_EXPORT void CleanStringLineEndings(const std::string& src,
+                                            std::string* dst,
+                                            bool auto_end_last_line);
+
+// Same as above, but transforms the argument in place.
+PROTOBUF_EXPORT void CleanStringLineEndings(std::string* str,
+                                            bool auto_end_last_line);
+
+namespace strings {
+inline bool EndsWith(StringPiece text, StringPiece suffix) {
+  return suffix.empty() ||
+      (text.size() >= suffix.size() &&
+       memcmp(text.data() + (text.size() - suffix.size()), suffix.data(),
+              suffix.size()) == 0);
+}
+}  // namespace strings
+
+namespace internal {
+
+// A locale-independent version of the standard strtod(), which always
+// uses a dot as the decimal separator.
+double NoLocaleStrtod(const char* str, char** endptr);
+
+}  // namespace internal
 
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_STUBS_STRUTIL_H__
index 7194a5b..d301682 100644 (file)
@@ -31,6 +31,8 @@
 // Author: kenton@google.com (Kenton Varda)
 
 #include <google/protobuf/stubs/substitute.h>
+
+#include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/strutil.h>
 #include <google/protobuf/stubs/stl_util.h>
 
@@ -44,34 +46,32 @@ using internal::SubstituteArg;
 // to Substitute().
 static int CountSubstituteArgs(const SubstituteArg* const* args_array) {
   int count = 0;
-  while (args_array[count] != NULL && args_array[count]->size() != -1) {
+  while (args_array[count] != nullptr && args_array[count]->size() != -1) {
     ++count;
   }
   return count;
 }
 
-string Substitute(
-    const char* format,
-    const SubstituteArg& arg0, const SubstituteArg& arg1,
-    const SubstituteArg& arg2, const SubstituteArg& arg3,
-    const SubstituteArg& arg4, const SubstituteArg& arg5,
-    const SubstituteArg& arg6, const SubstituteArg& arg7,
-    const SubstituteArg& arg8, const SubstituteArg& arg9) {
-  string result;
-  SubstituteAndAppend(&result, format, arg0, arg1, arg2, arg3, arg4,
-                                       arg5, arg6, arg7, arg8, arg9);
+std::string Substitute(const std::string& format, const SubstituteArg& arg0,
+                       const SubstituteArg& arg1, const SubstituteArg& arg2,
+                       const SubstituteArg& arg3, const SubstituteArg& arg4,
+                       const SubstituteArg& arg5, const SubstituteArg& arg6,
+                       const SubstituteArg& arg7, const SubstituteArg& arg8,
+                       const SubstituteArg& arg9) {
+  std::string result;
+  SubstituteAndAppend(&result, format.c_str(), arg0, arg1, arg2, arg3, arg4,
+                      arg5, arg6, arg7, arg8, arg9);
   return result;
 }
 
-void SubstituteAndAppend(
-    string* output, const char* format,
-    const SubstituteArg& arg0, const SubstituteArg& arg1,
-    const SubstituteArg& arg2, const SubstituteArg& arg3,
-    const SubstituteArg& arg4, const SubstituteArg& arg5,
-    const SubstituteArg& arg6, const SubstituteArg& arg7,
-    const SubstituteArg& arg8, const SubstituteArg& arg9) {
+void SubstituteAndAppend(std::string* output, const char* format,
+                         const SubstituteArg& arg0, const SubstituteArg& arg1,
+                         const SubstituteArg& arg2, const SubstituteArg& arg3,
+                         const SubstituteArg& arg4, const SubstituteArg& arg5,
+                         const SubstituteArg& arg6, const SubstituteArg& arg7,
+                         const SubstituteArg& arg8, const SubstituteArg& arg9) {
   const SubstituteArg* const args_array[] = {
-    &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, NULL
+    &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, nullptr
   };
 
   // Determine total size needed.
index 7ee442a..0f851de 100644 (file)
 // Author: kenton@google.com (Kenton Varda)
 // from google3/strings/substitute.h
 
-#include <string>
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/stringpiece.h>
 #include <google/protobuf/stubs/strutil.h>
 
+#include <string>
+
 #ifndef GOOGLE_PROTOBUF_STUBS_SUBSTITUTE_H_
 #define GOOGLE_PROTOBUF_STUBS_SUBSTITUTE_H_
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace strings {
@@ -88,12 +92,14 @@ class SubstituteArg {
  public:
   inline SubstituteArg(const char* value)
     : text_(value), size_(strlen(text_)) {}
-  inline SubstituteArg(const string& value)
-    : text_(value.data()), size_(value.size()) {}
+  inline SubstituteArg(const std::string& value)
+      : text_(value.data()), size_(value.size()) {}
+  inline SubstituteArg(const StringPiece value)
+      : text_(value.data()), size_(value.size()) {}
 
   // Indicates that no argument was given.
   inline explicit SubstituteArg()
-    : text_(NULL), size_(-1) {}
+    : text_(nullptr), size_(-1) {}
 
   // Primitives
   // We don't overload for signed and unsigned char because if people are
@@ -137,34 +143,36 @@ class SubstituteArg {
 
 }  // namespace internal
 
-LIBPROTOBUF_EXPORT string Substitute(
-  const char* format,
-  const internal::SubstituteArg& arg0 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg1 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg2 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg3 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg4 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg5 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg6 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg7 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg8 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg9 = internal::SubstituteArg());
-
-LIBPROTOBUF_EXPORT void SubstituteAndAppend(
-  string* output, const char* format,
-  const internal::SubstituteArg& arg0 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg1 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg2 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg3 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg4 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg5 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg6 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg7 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg8 = internal::SubstituteArg(),
-  const internal::SubstituteArg& arg9 = internal::SubstituteArg());
+PROTOBUF_EXPORT std::string Substitute(
+    const std::string& format,
+    const internal::SubstituteArg& arg0 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg1 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg2 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg3 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg4 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg5 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg6 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg7 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg8 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg9 = internal::SubstituteArg());
+
+PROTOBUF_EXPORT void SubstituteAndAppend(
+    std::string* output, const char* format,
+    const internal::SubstituteArg& arg0 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg1 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg2 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg3 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg4 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg5 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg6 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg7 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg8 = internal::SubstituteArg(),
+    const internal::SubstituteArg& arg9 = internal::SubstituteArg());
 
 }  // namespace strings
 }  // namespace protobuf
 }  // namespace google
 
+#include <google/protobuf/port_undef.inc>
+
 #endif // GOOGLE_PROTOBUF_STUBS_SUBSTITUTE_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/template_util.h b/3rdparty/protobuf/src/google/protobuf/stubs/template_util.h
deleted file mode 100644 (file)
index feef904..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright 2005 Google Inc.
-// All rights reserved.
-//
-// 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: lar@google.com (Laramie Leavitt)
-//
-// Template metaprogramming utility functions.
-//
-// This code is compiled directly on many platforms, including client
-// platforms like Windows, Mac, and embedded systems.  Before making
-// any changes here, make sure that you're not breaking any platforms.
-//
-//
-// The names chosen here reflect those used in tr1 and the boost::mpl
-// library, there are similar operations used in the Loki library as
-// well.  I prefer the boost names for 2 reasons:
-// 1.  I think that portions of the Boost libraries are more likely to
-// be included in the c++ standard.
-// 2.  It is not impossible that some of the boost libraries will be
-// included in our own build in the future.
-// Both of these outcomes means that we may be able to directly replace
-// some of these with boost equivalents.
-//
-#ifndef GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_
-#define GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// Types small_ and big_ are guaranteed such that sizeof(small_) <
-// sizeof(big_)
-typedef char small_;
-
-struct big_ {
-  char dummy[2];
-};
-
-// Identity metafunction.
-template <class T>
-struct identity_ {
-  typedef T type;
-};
-
-// integral_constant, defined in tr1, is a wrapper for an integer
-// value. We don't really need this generality; we could get away
-// with hardcoding the integer type to bool. We use the fully
-// general integer_constant for compatibility with tr1.
-
-template<class T, T v>
-struct integral_constant {
-  static const T value = v;
-  typedef T value_type;
-  typedef integral_constant<T, v> type;
-};
-
-template <class T, T v> const T integral_constant<T, v>::value;
-
-
-// Abbreviations: true_type and false_type are structs that represent boolean
-// true and false values. Also define the boost::mpl versions of those names,
-// true_ and false_.
-typedef integral_constant<bool, true>  true_type;
-typedef integral_constant<bool, false> false_type;
-typedef true_type  true_;
-typedef false_type false_;
-
-// if_ is a templatized conditional statement.
-// if_<cond, A, B> is a compile time evaluation of cond.
-// if_<>::type contains A if cond is true, B otherwise.
-template<bool cond, typename A, typename B>
-struct if_{
-  typedef A type;
-};
-
-template<typename A, typename B>
-struct if_<false, A, B> {
-  typedef B type;
-};
-
-
-// type_equals_ is a template type comparator, similar to Loki IsSameType.
-// type_equals_<A, B>::value is true iff "A" is the same type as "B".
-//
-// New code should prefer base::is_same, defined in base/type_traits.h.
-// It is functionally identical, but is_same is the standard spelling.
-template<typename A, typename B>
-struct type_equals_ : public false_ {
-};
-
-template<typename A>
-struct type_equals_<A, A> : public true_ {
-};
-
-// and_ is a template && operator.
-// and_<A, B>::value evaluates "A::value && B::value".
-template<typename A, typename B>
-struct and_ : public integral_constant<bool, (A::value && B::value)> {
-};
-
-// or_ is a template || operator.
-// or_<A, B>::value evaluates "A::value || B::value".
-template<typename A, typename B>
-struct or_ : public integral_constant<bool, (A::value || B::value)> {
-};
-
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/time.cc b/3rdparty/protobuf/src/google/protobuf/stubs/time.cc
deleted file mode 100644 (file)
index 49c0412..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-#include <google/protobuf/stubs/time.h>
-
-#include <ctime>
-
-#include <google/protobuf/stubs/stringprintf.h>
-#include <google/protobuf/stubs/strutil.h>
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-namespace {
-static const int64 kSecondsPerMinute = 60;
-static const int64 kSecondsPerHour = 3600;
-static const int64 kSecondsPerDay = kSecondsPerHour * 24;
-static const int64 kSecondsPer400Years =
-    kSecondsPerDay * (400 * 365 + 400 / 4 - 3);
-// Seconds from 0001-01-01T00:00:00 to 1970-01-01T:00:00:00
-static const int64 kSecondsFromEraToEpoch = 62135596800LL;
-// The range of timestamp values we support.
-static const int64 kMinTime = -62135596800LL;  // 0001-01-01T00:00:00
-static const int64 kMaxTime = 253402300799LL;  // 9999-12-31T23:59:59
-
-static const int kNanosPerMillisecond = 1000000;
-static const int kNanosPerMicrosecond = 1000;
-
-// Count the seconds from the given year (start at Jan 1, 00:00) to 100 years
-// after.
-int64 SecondsPer100Years(int year) {
-  if (year % 400 == 0 || year % 400 > 300) {
-    return kSecondsPerDay * (100 * 365 + 100 / 4);
-  } else {
-    return kSecondsPerDay * (100 * 365 + 100 / 4 - 1);
-  }
-}
-
-// Count the seconds from the given year (start at Jan 1, 00:00) to 4 years
-// after.
-int64 SecondsPer4Years(int year) {
-  if ((year % 100 == 0 || year % 100 > 96) &&
-      !(year % 400 == 0 || year % 400 > 396)) {
-    // No leap years.
-    return kSecondsPerDay * (4 * 365);
-  } else {
-    // One leap years.
-    return kSecondsPerDay * (4 * 365 + 1);
-  }
-}
-
-bool IsLeapYear(int year) {
-  return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);
-}
-
-int64 SecondsPerYear(int year) {
-  return kSecondsPerDay * (IsLeapYear(year) ? 366 : 365);
-}
-
-static const int kDaysInMonth[13] = {
-  0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-};
-
-int64 SecondsPerMonth(int month, bool leap) {
-  if (month == 2 && leap) {
-    return kSecondsPerDay * (kDaysInMonth[month] + 1);
-  }
-  return kSecondsPerDay * kDaysInMonth[month];
-}
-
-static const int kDaysSinceJan[13] = {
-  0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,
-};
-
-bool ValidateDateTime(const DateTime& time) {
-  if (time.year < 1 || time.year > 9999 ||
-      time.month < 1 || time.month > 12 ||
-      time.day < 1 || time.day > 31 ||
-      time.hour < 0 || time.hour > 23 ||
-      time.minute < 0 || time.minute > 59 ||
-      time.second < 0 || time.second > 59) {
-    return false;
-  }
-  if (time.month == 2 && IsLeapYear(time.year)) {
-    return time.month <= kDaysInMonth[time.month] + 1;
-  } else {
-    return time.month <= kDaysInMonth[time.month];
-  }
-}
-
-// Count the number of seconds elapsed from 0001-01-01T00:00:00 to the given
-// time.
-int64 SecondsSinceCommonEra(const DateTime& time) {
-  int64 result = 0;
-  // Years should be between 1 and 9999.
-  assert(time.year >= 1 && time.year <= 9999);
-  int year = 1;
-  if ((time.year - year) >= 400) {
-    int count_400years = (time.year - year) / 400;
-    result += kSecondsPer400Years * count_400years;
-    year += count_400years * 400;
-  }
-  while ((time.year - year) >= 100) {
-    result += SecondsPer100Years(year);
-    year += 100;
-  }
-  while ((time.year - year) >= 4) {
-    result += SecondsPer4Years(year);
-    year += 4;
-  }
-  while (time.year > year) {
-    result += SecondsPerYear(year);
-    ++year;
-  }
-  // Months should be between 1 and 12.
-  assert(time.month >= 1 && time.month <= 12);
-  int month = time.month;
-  result += kSecondsPerDay * kDaysSinceJan[month];
-  if (month > 2 && IsLeapYear(year)) {
-    result += kSecondsPerDay;
-  }
-  assert(time.day >= 1 &&
-         time.day <= (month == 2 && IsLeapYear(year)
-                          ? kDaysInMonth[month] + 1
-                          : kDaysInMonth[month]));
-  result += kSecondsPerDay * (time.day - 1);
-  result += kSecondsPerHour * time.hour +
-      kSecondsPerMinute * time.minute +
-      time.second;
-  return result;
-}
-
-// Format nanoseconds with either 3, 6, or 9 digits depending on the required
-// precision to represent the exact value.
-string FormatNanos(int32 nanos) {
-  if (nanos % kNanosPerMillisecond == 0) {
-    return StringPrintf("%03d", nanos / kNanosPerMillisecond);
-  } else if (nanos % kNanosPerMicrosecond == 0) {
-    return StringPrintf("%06d", nanos / kNanosPerMicrosecond);
-  } else {
-    return StringPrintf("%09d", nanos);
-  }
-}
-
-// Parses an integer from a null-terminated char sequence. The method
-// consumes at most "width" chars. Returns a pointer after the consumed
-// integer, or NULL if the data does not start with an integer or the
-// integer value does not fall in the range of [min_value, max_value].
-const char* ParseInt(const char* data, int width, int min_value,
-                     int max_value, int* result) {
-  if (!ascii_isdigit(*data)) {
-    return NULL;
-  }
-  int value = 0;
-  for (int i = 0; i < width; ++i, ++data) {
-    if (ascii_isdigit(*data)) {
-      value = value * 10 + (*data - '0');
-    } else {
-      break;
-    }
-  }
-  if (value >= min_value && value <= max_value) {
-    *result = value;
-    return data;
-  } else {
-    return NULL;
-  }
-}
-
-// Consumes the fractional parts of a second into nanos. For example,
-// "010" will be parsed to 10000000 nanos.
-const char* ParseNanos(const char* data, int32* nanos) {
-  if (!ascii_isdigit(*data)) {
-    return NULL;
-  }
-  int value = 0;
-  int len = 0;
-  // Consume as many digits as there are but only take the first 9 into
-  // account.
-  while (ascii_isdigit(*data)) {
-    if (len < 9) {
-      value = value * 10 + *data - '0';
-    }
-    ++len;
-    ++data;
-  }
-  while (len < 9) {
-    value = value * 10;
-    ++len;
-  }
-  *nanos = value;
-  return data;
-}
-
-const char* ParseTimezoneOffset(const char* data, int64* offset) {
-  // Accept format "HH:MM". E.g., "08:00"
-  int hour;
-  if ((data = ParseInt(data, 2, 0, 23, &hour)) == NULL) {
-    return NULL;
-  }
-  if (*data++ != ':') {
-    return NULL;
-  }
-  int minute;
-  if ((data = ParseInt(data, 2, 0, 59, &minute)) == NULL) {
-    return NULL;
-  }
-  *offset = (hour * 60 + minute) * 60;
-  return data;
-}
-}  // namespace
-
-bool SecondsToDateTime(int64 seconds, DateTime* time) {
-  if (seconds < kMinTime || seconds > kMaxTime) {
-    return false;
-  }
-  // It's easier to calcuate the DateTime starting from 0001-01-01T00:00:00
-  seconds = seconds + kSecondsFromEraToEpoch;
-  int year = 1;
-  if (seconds >= kSecondsPer400Years) {
-    int count_400years = seconds / kSecondsPer400Years;
-    year += 400 * count_400years;
-    seconds %= kSecondsPer400Years;
-  }
-  while (seconds >= SecondsPer100Years(year)) {
-    seconds -= SecondsPer100Years(year);
-    year += 100;
-  }
-  while (seconds >= SecondsPer4Years(year)) {
-    seconds -= SecondsPer4Years(year);
-    year += 4;
-  }
-  while (seconds >= SecondsPerYear(year)) {
-    seconds -= SecondsPerYear(year);
-    year += 1;
-  }
-  bool leap = IsLeapYear(year);
-  int month = 1;
-  while (seconds >= SecondsPerMonth(month, leap)) {
-    seconds -= SecondsPerMonth(month, leap);
-    ++month;
-  }
-  int day = 1 + seconds / kSecondsPerDay;
-  seconds %= kSecondsPerDay;
-  int hour = seconds / kSecondsPerHour;
-  seconds %= kSecondsPerHour;
-  int minute = seconds / kSecondsPerMinute;
-  seconds %= kSecondsPerMinute;
-  time->year = year;
-  time->month = month;
-  time->day = day;
-  time->hour = hour;
-  time->minute = minute;
-  time->second = static_cast<int>(seconds);
-  return true;
-}
-
-bool DateTimeToSeconds(const DateTime& time, int64* seconds) {
-  if (!ValidateDateTime(time)) {
-    return false;
-  }
-  *seconds = SecondsSinceCommonEra(time) - kSecondsFromEraToEpoch;
-  return true;
-}
-
-void GetCurrentTime(int64* seconds, int32* nanos) {
-  // TODO(xiaofeng): Improve the accuracy of this implementation (or just
-  // remove this method from protobuf).
-  *seconds = time(NULL);
-  *nanos = 0;
-}
-
-string FormatTime(int64 seconds, int32 nanos) {
-  DateTime time;
-  if (nanos < 0 || nanos > 999999999 || !SecondsToDateTime(seconds, &time)) {
-    return "InvalidTime";
-  }
-  string result = StringPrintf("%04d-%02d-%02dT%02d:%02d:%02d",
-                               time.year, time.month, time.day,
-                               time.hour, time.minute, time.second);
-  if (nanos != 0) {
-    result += "." + FormatNanos(nanos);
-  }
-  return result + "Z";
-}
-
-bool ParseTime(const string& value, int64* seconds, int32* nanos) {
-  DateTime time;
-  const char* data = value.c_str();
-  // We only accept:
-  //   Z-normalized: 2015-05-20T13:29:35.120Z
-  //   With UTC offset: 2015-05-20T13:29:35.120-08:00
-
-  // Parse year
-  if ((data = ParseInt(data, 4, 1, 9999, &time.year)) == NULL) {
-    return false;
-  }
-  // Expect '-'
-  if (*data++ != '-') return false;
-  // Parse month
-  if ((data = ParseInt(data, 2, 1, 12, &time.month)) == NULL) {
-    return false;
-  }
-  // Expect '-'
-  if (*data++ != '-') return false;
-  // Parse day
-  if ((data = ParseInt(data, 2, 1, 31, &time.day)) == NULL) {
-    return false;
-  }
-  // Expect 'T'
-  if (*data++ != 'T') return false;
-  // Parse hour
-  if ((data = ParseInt(data, 2, 0, 23, &time.hour)) == NULL) {
-    return false;
-  }
-  // Expect ':'
-  if (*data++ != ':') return false;
-  // Parse minute
-  if ((data = ParseInt(data, 2, 0, 59, &time.minute)) == NULL) {
-    return false;
-  }
-  // Expect ':'
-  if (*data++ != ':') return false;
-  // Parse second
-  if ((data = ParseInt(data, 2, 0, 59, &time.second)) == NULL) {
-    return false;
-  }
-  if (!DateTimeToSeconds(time, seconds)) {
-    return false;
-  }
-  // Parse nanoseconds.
-  if (*data == '.') {
-    ++data;
-    // Parse nanoseconds.
-    if ((data = ParseNanos(data, nanos)) == NULL) {
-      return false;
-    }
-  } else {
-    *nanos = 0;
-  }
-  // Parse UTC offsets.
-  if (*data == 'Z') {
-    ++data;
-  } else if (*data == '+') {
-    ++data;
-    int64 offset;
-    if ((data = ParseTimezoneOffset(data, &offset)) == NULL) {
-      return false;
-    }
-    *seconds -= offset;
-  } else if (*data == '-') {
-    ++data;
-    int64 offset;
-    if ((data = ParseTimezoneOffset(data, &offset)) == NULL) {
-      return false;
-    }
-    *seconds += offset;
-  } else {
-    return false;
-  }
-  // Done with parsing.
-  return *data == 0;
-}
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/stubs/type_traits.h b/3rdparty/protobuf/src/google/protobuf/stubs/type_traits.h
deleted file mode 100644 (file)
index 3ab5ea7..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// 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: Matt Austern
-//
-// This code is compiled directly on many platforms, including client
-// platforms like Windows, Mac, and embedded systems.  Before making
-// any changes here, make sure that you're not breaking any platforms.
-//
-// Define a small subset of tr1 type traits. The traits we define are:
-//   enable_if
-//   is_integral
-//   is_floating_point
-//   is_pointer
-//   is_enum
-//   is_reference
-//   is_pod
-//   has_trivial_constructor
-//   has_trivial_copy
-//   has_trivial_assign
-//   has_trivial_destructor
-//   remove_const
-//   remove_volatile
-//   remove_cv
-//   remove_reference
-//   add_reference
-//   remove_pointer
-//   is_same
-//   is_convertible
-// We can add more type traits as required.
-
-#ifndef GOOGLE_PROTOBUF_TYPE_TRAITS_H_
-#define GOOGLE_PROTOBUF_TYPE_TRAITS_H_
-
-#include <cstddef>                  // for NULL
-#include <utility>                  // For pair
-
-#include <google/protobuf/stubs/template_util.h>  // For true_type and false_type
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-template<typename B, typename D>
-struct is_base_of {
-  typedef char (&yes)[1];
-  typedef char (&no)[2];
-
-  // BEGIN GOOGLE LOCAL MODIFICATION -- check is a #define on Mac.
-  #undef check
-  // END GOOGLE LOCAL MODIFICATION
-
-  static yes check(const B*);
-  static no check(const void*);
-
-  enum {
-    value = sizeof(check(static_cast<const D*>(NULL))) == sizeof(yes),
-  };
-};
-
-template <bool cond, class T = void> struct enable_if;
-template <class T> struct is_integral;
-template <class T> struct is_floating_point;
-template <class T> struct is_pointer;
-// MSVC can't compile this correctly, and neither can gcc 3.3.5 (at least)
-#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
-// is_enum uses is_convertible, which is not available on MSVC.
-template <class T> struct is_enum;
-#endif
-template <class T> struct is_reference;
-template <class T> struct is_pod;
-template <class T> struct has_trivial_constructor;
-template <class T> struct has_trivial_copy;
-template <class T> struct has_trivial_assign;
-template <class T> struct has_trivial_destructor;
-template <class T> struct remove_const;
-template <class T> struct remove_volatile;
-template <class T> struct remove_cv;
-template <class T> struct remove_reference;
-template <class T> struct add_reference;
-template <class T> struct remove_pointer;
-template <class T, class U> struct is_same;
-#if !(defined(__GNUC__) && __GNUC__ <= 3)
-template <class From, class To> struct is_convertible;
-#endif
-
-// enable_if, equivalent semantics to c++11 std::enable_if, specifically:
-//   "If B is true, the member typedef type shall equal T; otherwise, there
-//    shall be no member typedef type."
-// Specified by 20.9.7.6 [Other transformations]
-
-template<bool cond, class T> struct enable_if { typedef T type; };
-template<class T> struct enable_if<false, T> {};
-// is_integral is false except for the built-in integer types. A
-// cv-qualified type is integral if and only if the underlying type is.
-template <class T> struct is_integral : false_type { };
-template<> struct is_integral<bool> : true_type { };
-template<> struct is_integral<char> : true_type { };
-template<> struct is_integral<unsigned char> : true_type { };
-template<> struct is_integral<signed char> : true_type { };
-#if defined(_MSC_VER)
-// wchar_t is not by default a distinct type from unsigned short in
-// Microsoft C.
-// See http://msdn2.microsoft.com/en-us/library/dh8che7s(VS.80).aspx
-template<> struct is_integral<__wchar_t> : true_type { };
-#else
-template<> struct is_integral<wchar_t> : true_type { };
-#endif
-template<> struct is_integral<short> : true_type { };
-template<> struct is_integral<unsigned short> : true_type { };
-template<> struct is_integral<int> : true_type { };
-template<> struct is_integral<unsigned int> : true_type { };
-template<> struct is_integral<long> : true_type { };
-template<> struct is_integral<unsigned long> : true_type { };
-#if defined(HAVE_LONG_LONG) || defined(_MSC_VER)
-template<> struct is_integral<long long> : true_type { };
-template<> struct is_integral<unsigned long long> : true_type { };
-#endif
-template <class T> struct is_integral<const T> : is_integral<T> { };
-template <class T> struct is_integral<volatile T> : is_integral<T> { };
-template <class T> struct is_integral<const volatile T> : is_integral<T> { };
-
-// is_floating_point is false except for the built-in floating-point types.
-// A cv-qualified type is integral if and only if the underlying type is.
-template <class T> struct is_floating_point : false_type { };
-template<> struct is_floating_point<float> : true_type { };
-template<> struct is_floating_point<double> : true_type { };
-template<> struct is_floating_point<long double> : true_type { };
-template <class T> struct is_floating_point<const T>
-    : is_floating_point<T> { };
-template <class T> struct is_floating_point<volatile T>
-    : is_floating_point<T> { };
-template <class T> struct is_floating_point<const volatile T>
-    : is_floating_point<T> { };
-
-// is_pointer is false except for pointer types. A cv-qualified type (e.g.
-// "int* const", as opposed to "int const*") is cv-qualified if and only if
-// the underlying type is.
-template <class T> struct is_pointer : false_type { };
-template <class T> struct is_pointer<T*> : true_type { };
-template <class T> struct is_pointer<const T> : is_pointer<T> { };
-template <class T> struct is_pointer<volatile T> : is_pointer<T> { };
-template <class T> struct is_pointer<const volatile T> : is_pointer<T> { };
-
-#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
-
-namespace type_traits_internal {
-
-template <class T> struct is_class_or_union {
-  template <class U> static small_ tester(void (U::*)());
-  template <class U> static big_ tester(...);
-  static const bool value = sizeof(tester<T>(0)) == sizeof(small_);
-};
-
-// is_convertible chokes if the first argument is an array. That's why
-// we use add_reference here.
-template <bool NotUnum, class T> struct is_enum_impl
-    : is_convertible<typename add_reference<T>::type, int> { };
-
-template <class T> struct is_enum_impl<true, T> : false_type { };
-
-}  // namespace type_traits_internal
-
-// Specified by TR1 [4.5.1] primary type categories.
-
-// Implementation note:
-//
-// Each type is either void, integral, floating point, array, pointer,
-// reference, member object pointer, member function pointer, enum,
-// union or class. Out of these, only integral, floating point, reference,
-// class and enum types are potentially convertible to int. Therefore,
-// if a type is not a reference, integral, floating point or class and
-// is convertible to int, it's a enum. Adding cv-qualification to a type
-// does not change whether it's an enum.
-//
-// Is-convertible-to-int check is done only if all other checks pass,
-// because it can't be used with some types (e.g. void or classes with
-// inaccessible conversion operators).
-template <class T> struct is_enum
-    : type_traits_internal::is_enum_impl<
-          is_same<T, void>::value ||
-              is_integral<T>::value ||
-              is_floating_point<T>::value ||
-              is_reference<T>::value ||
-              type_traits_internal::is_class_or_union<T>::value,
-          T> { };
-
-template <class T> struct is_enum<const T> : is_enum<T> { };
-template <class T> struct is_enum<volatile T> : is_enum<T> { };
-template <class T> struct is_enum<const volatile T> : is_enum<T> { };
-
-#endif
-
-// is_reference is false except for reference types.
-template<typename T> struct is_reference : false_type {};
-template<typename T> struct is_reference<T&> : true_type {};
-
-
-// We can't get is_pod right without compiler help, so fail conservatively.
-// We will assume it's false except for arithmetic types, enumerations,
-// pointers and cv-qualified versions thereof. Note that std::pair<T,U>
-// is not a POD even if T and U are PODs.
-template <class T> struct is_pod
- : integral_constant<bool, (is_integral<T>::value ||
-                            is_floating_point<T>::value ||
-#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
-                            // is_enum is not available on MSVC.
-                            is_enum<T>::value ||
-#endif
-                            is_pointer<T>::value)> { };
-template <class T> struct is_pod<const T> : is_pod<T> { };
-template <class T> struct is_pod<volatile T> : is_pod<T> { };
-template <class T> struct is_pod<const volatile T> : is_pod<T> { };
-
-
-// We can't get has_trivial_constructor right without compiler help, so
-// fail conservatively. We will assume it's false except for: (1) types
-// for which is_pod is true. (2) std::pair of types with trivial
-// constructors. (3) array of a type with a trivial constructor.
-// (4) const versions thereof.
-template <class T> struct has_trivial_constructor : is_pod<T> { };
-template <class T, class U> struct has_trivial_constructor<std::pair<T, U> >
-  : integral_constant<bool,
-                      (has_trivial_constructor<T>::value &&
-                       has_trivial_constructor<U>::value)> { };
-template <class A, int N> struct has_trivial_constructor<A[N]>
-  : has_trivial_constructor<A> { };
-template <class T> struct has_trivial_constructor<const T>
-  : has_trivial_constructor<T> { };
-
-// We can't get has_trivial_copy right without compiler help, so fail
-// conservatively. We will assume it's false except for: (1) types
-// for which is_pod is true. (2) std::pair of types with trivial copy
-// constructors. (3) array of a type with a trivial copy constructor.
-// (4) const versions thereof.
-template <class T> struct has_trivial_copy : is_pod<T> { };
-template <class T, class U> struct has_trivial_copy<std::pair<T, U> >
-  : integral_constant<bool,
-                      (has_trivial_copy<T>::value &&
-                       has_trivial_copy<U>::value)> { };
-template <class A, int N> struct has_trivial_copy<A[N]>
-  : has_trivial_copy<A> { };
-template <class T> struct has_trivial_copy<const T> : has_trivial_copy<T> { };
-
-// We can't get has_trivial_assign right without compiler help, so fail
-// conservatively. We will assume it's false except for: (1) types
-// for which is_pod is true. (2) std::pair of types with trivial copy
-// constructors. (3) array of a type with a trivial assign constructor.
-template <class T> struct has_trivial_assign : is_pod<T> { };
-template <class T, class U> struct has_trivial_assign<std::pair<T, U> >
-  : integral_constant<bool,
-                      (has_trivial_assign<T>::value &&
-                       has_trivial_assign<U>::value)> { };
-template <class A, int N> struct has_trivial_assign<A[N]>
-  : has_trivial_assign<A> { };
-
-// We can't get has_trivial_destructor right without compiler help, so
-// fail conservatively. We will assume it's false except for: (1) types
-// for which is_pod is true. (2) std::pair of types with trivial
-// destructors. (3) array of a type with a trivial destructor.
-// (4) const versions thereof.
-template <class T> struct has_trivial_destructor : is_pod<T> { };
-template <class T, class U> struct has_trivial_destructor<std::pair<T, U> >
-  : integral_constant<bool,
-                      (has_trivial_destructor<T>::value &&
-                       has_trivial_destructor<U>::value)> { };
-template <class A, int N> struct has_trivial_destructor<A[N]>
-  : has_trivial_destructor<A> { };
-template <class T> struct has_trivial_destructor<const T>
-  : has_trivial_destructor<T> { };
-
-// Specified by TR1 [4.7.1]
-template<typename T> struct remove_const { typedef T type; };
-template<typename T> struct remove_const<T const> { typedef T type; };
-template<typename T> struct remove_volatile { typedef T type; };
-template<typename T> struct remove_volatile<T volatile> { typedef T type; };
-template<typename T> struct remove_cv {
-  typedef typename remove_const<typename remove_volatile<T>::type>::type type;
-};
-
-
-// Specified by TR1 [4.7.2] Reference modifications.
-template<typename T> struct remove_reference { typedef T type; };
-template<typename T> struct remove_reference<T&> { typedef T type; };
-
-template <typename T> struct add_reference { typedef T& type; };
-template <typename T> struct add_reference<T&> { typedef T& type; };
-
-// Specified by TR1 [4.7.4] Pointer modifications.
-template<typename T> struct remove_pointer { typedef T type; };
-template<typename T> struct remove_pointer<T*> { typedef T type; };
-template<typename T> struct remove_pointer<T* const> { typedef T type; };
-template<typename T> struct remove_pointer<T* volatile> { typedef T type; };
-template<typename T> struct remove_pointer<T* const volatile> {
-  typedef T type; };
-
-// Specified by TR1 [4.6] Relationships between types
-template<typename T, typename U> struct is_same : public false_type { };
-template<typename T> struct is_same<T, T> : public true_type { };
-
-// Specified by TR1 [4.6] Relationships between types
-#if !(defined(__GNUC__) && __GNUC__ <= 3)
-namespace type_traits_internal {
-
-// This class is an implementation detail for is_convertible, and you
-// don't need to know how it works to use is_convertible. For those
-// who care: we declare two different functions, one whose argument is
-// of type To and one with a variadic argument list. We give them
-// return types of different size, so we can use sizeof to trick the
-// compiler into telling us which function it would have chosen if we
-// had called it with an argument of type From.  See Alexandrescu's
-// _Modern C++ Design_ for more details on this sort of trick.
-
-template <typename From, typename To>
-struct ConvertHelper {
-  static small_ Test(To);
-  static big_ Test(...);
-  static From Create();
-  enum {
-    value = sizeof(Test(Create())) == sizeof(small_)
-  };
-};
-}  // namespace type_traits_internal
-
-// Inherits from true_type if From is convertible to To, false_type otherwise.
-template <typename From, typename To>
-struct is_convertible
-    : integral_constant<bool,
-                        type_traits_internal::ConvertHelper<From, To>::value> {
-};
-#endif
-
-}  // namespace internal
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_TYPE_TRAITS_H_
index eec6dff..fcdde82 100644 (file)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
-#include <algorithm>
+#include <google/protobuf/text_format.h>
+
 #include <float.h>
-#include <math.h>
 #include <stdio.h>
-#include <stack>
+
+#include <algorithm>
+#include <atomic>
+#include <climits>
+#include <cmath>
 #include <limits>
 #include <vector>
 
-#include <google/protobuf/text_format.h>
-
 #include <google/protobuf/stubs/stringprintf.h>
 #include <google/protobuf/any.h>
-#include <google/protobuf/io/strtod.h>
+#include <google/protobuf/descriptor.pb.h>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/io/tokenizer.h>
 #include <google/protobuf/io/zero_copy_stream.h>
 #include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/descriptor.pb.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/dynamic_message.h>
+#include <google/protobuf/map_field.h>
+#include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>
 #include <google/protobuf/unknown_field_set.h>
 #include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/stubs/strutil.h>
-
+#include <google/protobuf/io/strtod.h>
 #include <google/protobuf/stubs/map_util.h>
 #include <google/protobuf/stubs/stl_util.h>
 
+// Must be included last.
+#include <google/protobuf/port_def.inc>
+
+#define DEBUG_STRING_SILENT_MARKER "\t "
+
 namespace google {
 namespace protobuf {
 
 namespace {
 
-inline bool IsHexNumber(const string& str) {
+inline bool IsHexNumber(const std::string& str) {
   return (str.length() >= 2 && str[0] == '0' &&
           (str[1] == 'x' || str[1] == 'X'));
 }
 
-inline bool IsOctNumber(const string& str) {
+inline bool IsOctNumber(const std::string& str) {
   return (str.length() >= 2 && str[0] == '0' &&
           (str[1] >= '0' && str[1] < '8'));
 }
 
 }  // namespace
 
-string Message::DebugString() const {
-  string debug_string;
+namespace internal {
+// Controls insertion of DEBUG_STRING_SILENT_MARKER.
+PROTOBUF_EXPORT std::atomic<bool> enable_debug_text_format_marker;
+}  // namespace internal
+
+std::string Message::DebugString() const {
+  std::string debug_string;
 
   TextFormat::Printer printer;
   printer.SetExpandAny(true);
+  printer.SetInsertSilentMarker(internal::enable_debug_text_format_marker.load(
+      std::memory_order_relaxed));
 
   printer.PrintToString(*this, &debug_string);
 
   return debug_string;
 }
 
-string Message::ShortDebugString() const {
-  string debug_string;
+std::string Message::ShortDebugString() const {
+  std::string debug_string;
 
   TextFormat::Printer printer;
   printer.SetSingleLineMode(true);
   printer.SetExpandAny(true);
+  printer.SetInsertSilentMarker(internal::enable_debug_text_format_marker.load(
+      std::memory_order_relaxed));
 
   printer.PrintToString(*this, &debug_string);
   // Single line mode currently might have an extra space at the end.
-  if (debug_string.size() > 0 &&
-      debug_string[debug_string.size() - 1] == ' ') {
+  if (!debug_string.empty() && debug_string[debug_string.size() - 1] == ' ') {
     debug_string.resize(debug_string.size() - 1);
   }
 
   return debug_string;
 }
 
-string Message::Utf8DebugString() const {
-  string debug_string;
+std::string Message::Utf8DebugString() const {
+  std::string debug_string;
 
   TextFormat::Printer printer;
   printer.SetUseUtf8StringEscaping(true);
   printer.SetExpandAny(true);
+  printer.SetInsertSilentMarker(internal::enable_debug_text_format_marker.load(
+      std::memory_order_relaxed));
 
   printer.PrintToString(*this, &debug_string);
 
   return debug_string;
 }
 
-void Message::PrintDebugString() const {
-  printf("%s", DebugString().c_str());
-}
+void Message::PrintDebugString() const { printf("%s", DebugString().c_str()); }
 
 
 // ===========================================================================
 // Implementation of the parse information tree class.
-TextFormat::ParseInfoTree::ParseInfoTree() { }
-
-TextFormat::ParseInfoTree::~ParseInfoTree() {
-  // Remove any nested information trees, as they are owned by this tree.
-  for (NestedMap::iterator it = nested_.begin(); it != nested_.end(); ++it) {
-    STLDeleteElements(&(it->second));
-  }
-}
-
 void TextFormat::ParseInfoTree::RecordLocation(
-    const FieldDescriptor* field,
-    TextFormat::ParseLocation location) {
-  locations_[field].push_back(location);
+    const FieldDescriptor* field, TextFormat::ParseLocationRange range) {
+  locations_[field].push_back(range);
 }
 
 TextFormat::ParseInfoTree* TextFormat::ParseInfoTree::CreateNested(
     const FieldDescriptor* field) {
   // Owned by us in the map.
-  TextFormat::ParseInfoTree* instance = new TextFormat::ParseInfoTree();
-  std::vector<TextFormat::ParseInfoTree*>* trees = &nested_[field];
-  GOOGLE_CHECK(trees);
-  trees->push_back(instance);
-  return instance;
+  auto& vec = nested_[field];
+  vec.emplace_back(new TextFormat::ParseInfoTree());
+  return vec.back().get();
 }
 
 void CheckFieldIndex(const FieldDescriptor* field, int index) {
-  if (field == NULL) { return; }
+  if (field == nullptr) {
+    return;
+  }
 
   if (field->is_repeated() && index == -1) {
     GOOGLE_LOG(DFATAL) << "Index must be in range of repeated field values. "
@@ -161,15 +167,18 @@ void CheckFieldIndex(const FieldDescriptor* field, int index) {
   }
 }
 
-TextFormat::ParseLocation TextFormat::ParseInfoTree::GetLocation(
+TextFormat::ParseLocationRange TextFormat::ParseInfoTree::GetLocationRange(
     const FieldDescriptor* field, int index) const {
   CheckFieldIndex(field, index);
-  if (index == -1) { index = 0; }
+  if (index == -1) {
+    index = 0;
+  }
 
-  const std::vector<TextFormat::ParseLocation>* locations =
+  const std::vector<TextFormat::ParseLocationRange>* locations =
       FindOrNull(locations_, field);
-  if (locations == NULL || index >= locations->size()) {
-    return TextFormat::ParseLocation();
+  if (locations == nullptr ||
+      index >= static_cast<int64_t>(locations->size())) {
+    return TextFormat::ParseLocationRange();
   }
 
   return (*locations)[index];
@@ -178,33 +187,62 @@ TextFormat::ParseLocation TextFormat::ParseInfoTree::GetLocation(
 TextFormat::ParseInfoTree* TextFormat::ParseInfoTree::GetTreeForNested(
     const FieldDescriptor* field, int index) const {
   CheckFieldIndex(field, index);
-  if (index == -1) { index = 0; }
+  if (index == -1) {
+    index = 0;
+  }
 
-  const std::vector<TextFormat::ParseInfoTree*>* trees =
-      FindOrNull(nested_, field);
-  if (trees == NULL || index >= trees->size()) {
-    return NULL;
+  auto it = nested_.find(field);
+  if (it == nested_.end() || index >= static_cast<int64_t>(it->second.size())) {
+    return nullptr;
   }
 
-  return (*trees)[index];
+  return it->second[index].get();
 }
 
+namespace {
+// These functions implement the behavior of the "default" TextFormat::Finder,
+// they are defined as standalone to be called when finder_ is nullptr.
+const FieldDescriptor* DefaultFinderFindExtension(Message* message,
+                                                  const std::string& name) {
+  const Descriptor* descriptor = message->GetDescriptor();
+  return descriptor->file()->pool()->FindExtensionByPrintableName(descriptor,
+                                                                  name);
+}
+
+const FieldDescriptor* DefaultFinderFindExtensionByNumber(
+    const Descriptor* descriptor, int number) {
+  return descriptor->file()->pool()->FindExtensionByNumber(descriptor, number);
+}
+
+const Descriptor* DefaultFinderFindAnyType(const Message& message,
+                                           const std::string& prefix,
+                                           const std::string& name) {
+  if (prefix != internal::kTypeGoogleApisComPrefix &&
+      prefix != internal::kTypeGoogleProdComPrefix) {
+    return nullptr;
+  }
+  return message.GetDescriptor()->file()->pool()->FindMessageTypeByName(name);
+}
+}  // namespace
 
 // ===========================================================================
 // Internal class for parsing an ASCII representation of a Protocol Message.
 // This class makes use of the Protocol Message compiler's tokenizer found
-// in //google/protobuf/io/tokenizer.h. Note that class's Parse
+// in //net/proto2/io/public/tokenizer.h. Note that class's Parse
 // method is *not* thread-safe and should only be used in a single thread at
 // a time.
 
 // Makes code slightly more readable.  The meaning of "DO(foo)" is
 // "Execute foo and fail if it fails.", where failure is indicated by
 // returning false. Borrowed from parser.cc (Thanks Kenton!).
-#define DO(STATEMENT) if (STATEMENT) {} else return false
+#define DO(STATEMENT) \
+  if (STATEMENT) {    \
+  } else {            \
+    return false;     \
+  }
 
 class TextFormat::Parser::ParserImpl {
  public:
-
   // Determines if repeated values for non-repeated fields and
   // oneofs are permitted, e.g., the string "foo: 1 foo: 2" for a
   // required/optional field named "foo", or "baz: 1 qux: 2"
@@ -217,32 +255,28 @@ class TextFormat::Parser::ParserImpl {
   ParserImpl(const Descriptor* root_message_type,
              io::ZeroCopyInputStream* input_stream,
              io::ErrorCollector* error_collector,
-             TextFormat::Finder* finder,
-             ParseInfoTree* parse_info_tree,
+             const TextFormat::Finder* finder, ParseInfoTree* parse_info_tree,
              SingularOverwritePolicy singular_overwrite_policy,
-             bool allow_case_insensitive_field,
-             bool allow_unknown_field,
-             bool allow_unknown_enum,
-             bool allow_field_number,
-             bool allow_relaxed_whitespace,
-             bool allow_partial,
-             int recursion_limit  // backported from 3.8.0
-    )
-    : error_collector_(error_collector),
-      finder_(finder),
-      parse_info_tree_(parse_info_tree),
-      tokenizer_error_collector_(this),
-      tokenizer_(input_stream, &tokenizer_error_collector_),
-      root_message_type_(root_message_type),
-      singular_overwrite_policy_(singular_overwrite_policy),
-      allow_case_insensitive_field_(allow_case_insensitive_field),
-      allow_unknown_field_(allow_unknown_field),
-      allow_unknown_enum_(allow_unknown_enum),
-      allow_field_number_(allow_field_number),
-      allow_partial_(allow_partial),
-      had_errors_(false),
-      recursion_limit_(recursion_limit)  // backported from 3.8.0
-    {
+             bool allow_case_insensitive_field, bool allow_unknown_field,
+             bool allow_unknown_extension, bool allow_unknown_enum,
+             bool allow_field_number, bool allow_relaxed_whitespace,
+             bool allow_partial, int recursion_limit)
+      : error_collector_(error_collector),
+        finder_(finder),
+        parse_info_tree_(parse_info_tree),
+        tokenizer_error_collector_(this),
+        tokenizer_(input_stream, &tokenizer_error_collector_),
+        root_message_type_(root_message_type),
+        singular_overwrite_policy_(singular_overwrite_policy),
+        allow_case_insensitive_field_(allow_case_insensitive_field),
+        allow_unknown_field_(allow_unknown_field),
+        allow_unknown_extension_(allow_unknown_extension),
+        allow_unknown_enum_(allow_unknown_enum),
+        allow_field_number_(allow_field_number),
+        allow_partial_(allow_partial),
+        initial_recursion_limit_(recursion_limit),
+        recursion_limit_(recursion_limit),
+        had_errors_(false) {
     // For backwards-compatibility with proto1, we need to allow the 'f' suffix
     // for floats.
     tokenizer_.set_allow_f_after_float(true);
@@ -258,7 +292,7 @@ class TextFormat::Parser::ParserImpl {
     // Consume the starting token.
     tokenizer_.Next();
   }
-  ~ParserImpl() { }
+  ~ParserImpl() {}
 
   // Parses the ASCII representation specified in input and saves the
   // information into the output pointer (a Message). Returns
@@ -268,6 +302,15 @@ class TextFormat::Parser::ParserImpl {
     // Consume fields until we cannot do so anymore.
     while (true) {
       if (LookingAtType(io::Tokenizer::TYPE_END)) {
+        // Ensures recursion limit properly unwinded, but only for success
+        // cases. This implicitly avoids the check when `Parse` returns false
+        // via `DO(...)`.
+        GOOGLE_DCHECK(had_errors_ || recursion_limit_ == initial_recursion_limit_)
+            << "Recursion limit at end of parse should be "
+            << initial_recursion_limit_ << ", but was " << recursion_limit_
+            << ". Difference of " << initial_recursion_limit_ - recursion_limit_
+            << " stack frames not accounted for stack unwind.";
+
         return !had_errors_;
       }
 
@@ -285,35 +328,31 @@ class TextFormat::Parser::ParserImpl {
     return suc && LookingAtType(io::Tokenizer::TYPE_END);
   }
 
-  void ReportError(int line, int col, const string& message) {
+  void ReportError(int line, int col, const std::string& message) {
     had_errors_ = true;
-    if (error_collector_ == NULL) {
+    if (error_collector_ == nullptr) {
       if (line >= 0) {
         GOOGLE_LOG(ERROR) << "Error parsing text-format "
-                   << root_message_type_->full_name()
-                   << ": " << (line + 1) << ":"
-                   << (col + 1) << ": " << message;
+                   << root_message_type_->full_name() << ": " << (line + 1)
+                   << ":" << (col + 1) << ": " << message;
       } else {
         GOOGLE_LOG(ERROR) << "Error parsing text-format "
-                   << root_message_type_->full_name()
-                   << ": " << message;
+                   << root_message_type_->full_name() << ": " << message;
       }
     } else {
       error_collector_->AddError(line, col, message);
     }
   }
 
-  void ReportWarning(int line, int col, const string& message) {
-    if (error_collector_ == NULL) {
+  void ReportWarning(int line, int col, const std::string& message) {
+    if (error_collector_ == nullptr) {
       if (line >= 0) {
         GOOGLE_LOG(WARNING) << "Warning parsing text-format "
-                     << root_message_type_->full_name()
-                     << ": " << (line + 1) << ":"
-                     << (col + 1) << ": " << message;
+                     << root_message_type_->full_name() << ": " << (line + 1)
+                     << ":" << (col + 1) << ": " << message;
       } else {
         GOOGLE_LOG(WARNING) << "Warning parsing text-format "
-                     << root_message_type_->full_name()
-                     << ": " << message;
+                     << root_message_type_->full_name() << ": " << message;
       }
     } else {
       error_collector_->AddWarning(line, col, message);
@@ -321,18 +360,24 @@ class TextFormat::Parser::ParserImpl {
   }
 
  private:
+  static constexpr int32_t kint32max = std::numeric_limits<int32_t>::max();
+  static constexpr uint32_t kuint32max = std::numeric_limits<uint32_t>::max();
+  static constexpr int64_t kint64min = std::numeric_limits<int64_t>::min();
+  static constexpr int64_t kint64max = std::numeric_limits<int64_t>::max();
+  static constexpr uint64_t kuint64max = std::numeric_limits<uint64_t>::max();
+
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ParserImpl);
 
   // Reports an error with the given message with information indicating
   // the position (as derived from the current token).
-  void ReportError(const string& message) {
+  void ReportError(const std::string& message) {
     ReportError(tokenizer_.current().line, tokenizer_.current().column,
                 message);
   }
 
   // Reports a warning with the given message with information indicating
   // the position (as derived from the current token).
-  void ReportWarning(const string& message) {
+  void ReportWarning(const std::string& message) {
     ReportWarning(tokenizer_.current().line, tokenizer_.current().column,
                   message);
   }
@@ -340,8 +385,8 @@ class TextFormat::Parser::ParserImpl {
   // Consumes the specified message with the given starting delimiter.
   // This method checks to see that the end delimiter at the conclusion of
   // the consumption matches the starting delimiter passed in here.
-  bool ConsumeMessage(Message* message, const string delimiter) {
-    while (!LookingAt(">") &&  !LookingAt("}")) {
+  bool ConsumeMessage(Message* message, const std::string delimiter) {
+    while (!LookingAt(">") && !LookingAt("}")) {
       DO(ConsumeField(message));
     }
 
@@ -351,7 +396,7 @@ class TextFormat::Parser::ParserImpl {
   }
 
   // Consume either "<" or "{".
-  bool ConsumeMessageDelimiter(string* delimiter) {
+  bool ConsumeMessageDelimiter(std::string* delimiter) {
     if (TryConsume("<")) {
       *delimiter = ">";
     } else {
@@ -368,9 +413,9 @@ class TextFormat::Parser::ParserImpl {
     const Reflection* reflection = message->GetReflection();
     const Descriptor* descriptor = message->GetDescriptor();
 
-    string field_name;
+    std::string field_name;
     bool reserved_field = false;
-    const FieldDescriptor* field = NULL;
+    const FieldDescriptor* field = nullptr;
     int start_line = tokenizer_.current().line;
     int start_column = tokenizer_.current().column;
 
@@ -379,14 +424,25 @@ class TextFormat::Parser::ParserImpl {
     if (internal::GetAnyFieldDescriptors(*message, &any_type_url_field,
                                          &any_value_field) &&
         TryConsume("[")) {
-      string full_type_name, prefix;
+      std::string full_type_name, prefix;
       DO(ConsumeAnyTypeUrl(&full_type_name, &prefix));
-      DO(Consume("]"));
-      TryConsume(":");  // ':' is optional between message labels and values.
-      string serialized_value;
-      DO(ConsumeAnyValue(full_type_name,
-                         message->GetDescriptor()->file()->pool(),
-                         &serialized_value));
+      std::string prefix_and_full_type_name =
+          StrCat(prefix, full_type_name);
+      DO(ConsumeBeforeWhitespace("]"));
+      TryConsumeWhitespace(prefix_and_full_type_name, "Any");
+      // ':' is optional between message labels and values.
+      TryConsumeBeforeWhitespace(":");
+      TryConsumeWhitespace(prefix_and_full_type_name, "Any");
+      std::string serialized_value;
+      const Descriptor* value_descriptor =
+          finder_ ? finder_->FindAnyType(*message, prefix, full_type_name)
+                  : DefaultFinderFindAnyType(*message, prefix, full_type_name);
+      if (value_descriptor == nullptr) {
+        ReportError("Could not find type \"" + prefix_and_full_type_name +
+                    "\" stored in google.protobuf.Any.");
+        return false;
+      }
+      DO(ConsumeAnyValue(value_descriptor, &serialized_value));
       if (singular_overwrite_policy_ == FORBID_SINGULAR_OVERWRITES) {
         // Fail if any_type_url_field has already been specified.
         if ((!any_type_url_field->is_repeated() &&
@@ -397,40 +453,44 @@ class TextFormat::Parser::ParserImpl {
           return false;
         }
       }
-      reflection->SetString(
-          message, any_type_url_field,
-          string(prefix + full_type_name));
+      reflection->SetString(message, any_type_url_field,
+                            prefix_and_full_type_name);
       reflection->SetString(message, any_value_field, serialized_value);
       return true;
     }
     if (TryConsume("[")) {
       // Extension.
       DO(ConsumeFullTypeName(&field_name));
-      DO(Consume("]"));
+      DO(ConsumeBeforeWhitespace("]"));
+      TryConsumeWhitespace(message->GetTypeName(), "Extension");
 
-      field = (finder_ != NULL
-               ? finder_->FindExtension(message, field_name)
-               : reflection->FindKnownExtensionByName(field_name));
+      field = finder_ ? finder_->FindExtension(message, field_name)
+                      : DefaultFinderFindExtension(message, field_name);
 
-      if (field == NULL) {
-        if (!allow_unknown_field_) {
-          ReportError("Extension \"" + field_name + "\" is not defined or "
+      if (field == nullptr) {
+        if (!allow_unknown_field_ && !allow_unknown_extension_) {
+          ReportError("Extension \"" + field_name +
+                      "\" is not defined or "
                       "is not an extension of \"" +
                       descriptor->full_name() + "\".");
           return false;
         } else {
-          ReportWarning("Extension \"" + field_name + "\" is not defined or "
-                        "is not an extension of \"" +
+          ReportWarning("Ignoring extension \"" + field_name +
+                        "\" which is not defined or is not an extension of \"" +
                         descriptor->full_name() + "\".");
         }
       }
     } else {
-      DO(ConsumeIdentifier(&field_name));
+      DO(ConsumeIdentifierBeforeWhitespace(&field_name));
+      TryConsumeWhitespace(message->GetTypeName(), "Normal");
 
-      int32 field_number;
+      int32_t field_number;
       if (allow_field_number_ && safe_strto32(field_name, &field_number)) {
         if (descriptor->IsExtensionNumber(field_number)) {
-          field = reflection->FindKnownExtensionByNumber(field_number);
+          field = finder_
+                      ? finder_->FindExtensionByNumber(descriptor, field_number)
+                      : DefaultFinderFindExtensionByNumber(descriptor,
+                                                           field_number);
         } else if (descriptor->IsReservedNumber(field_number)) {
           reserved_field = true;
         } else {
@@ -441,33 +501,34 @@ class TextFormat::Parser::ParserImpl {
         // Group names are expected to be capitalized as they appear in the
         // .proto file, which actually matches their type names, not their
         // field names.
-        if (field == NULL) {
-          string lower_field_name = field_name;
+        if (field == nullptr) {
+          std::string lower_field_name = field_name;
           LowerString(&lower_field_name);
           field = descriptor->FindFieldByName(lower_field_name);
           // If the case-insensitive match worked but the field is NOT a group,
-          if (field != NULL && field->type() != FieldDescriptor::TYPE_GROUP) {
-            field = NULL;
+          if (field != nullptr &&
+              field->type() != FieldDescriptor::TYPE_GROUP) {
+            field = nullptr;
           }
         }
         // Again, special-case group names as described above.
-        if (field != NULL && field->type() == FieldDescriptor::TYPE_GROUP
-            && field->message_type()->name() != field_name) {
-          field = NULL;
+        if (field != nullptr && field->type() == FieldDescriptor::TYPE_GROUP &&
+            field->message_type()->name() != field_name) {
+          field = nullptr;
         }
 
-        if (field == NULL && allow_case_insensitive_field_) {
-          string lower_field_name = field_name;
+        if (field == nullptr && allow_case_insensitive_field_) {
+          std::string lower_field_name = field_name;
           LowerString(&lower_field_name);
           field = descriptor->FindFieldByLowercaseName(lower_field_name);
         }
 
-        if (field == NULL) {
+        if (field == nullptr) {
           reserved_field = descriptor->IsReservedName(field_name);
         }
       }
 
-      if (field == NULL && !reserved_field) {
+      if (field == nullptr && !reserved_field) {
         if (!allow_unknown_field_) {
           ReportError("Message type \"" + descriptor->full_name() +
                       "\" has no field named \"" + field_name + "\".");
@@ -481,8 +542,8 @@ class TextFormat::Parser::ParserImpl {
     }
 
     // Skips unknown or reserved fields.
-    if (field == NULL) {
-      GOOGLE_CHECK(allow_unknown_field_ || reserved_field);
+    if (field == nullptr) {
+      GOOGLE_CHECK(allow_unknown_field_ || allow_unknown_extension_ || reserved_field);
 
       // Try to guess the type of this field.
       // If this field is not a message, there should be a ":" between the
@@ -491,13 +552,15 @@ class TextFormat::Parser::ParserImpl {
       // If there is no ":" or there is a "{" or "<" after ":", this field has
       // to be a message or the input is ill-formed.
       UnknownFieldSet* unknown_fields = reflection->MutableUnknownFields(message);
-      if (TryConsume(":") && !LookingAt("{") && !LookingAt("<")) {
-        UnknownFieldSet* unknown_field = unknown_fields->AddGroup(unknown_fields->field_count());
-        unknown_field->AddLengthDelimited(0, field_name);  // Add a field's name.
-        return SkipFieldValue(unknown_field, recursion_limit_);
-      } else {
-        return SkipFieldMessage(unknown_fields, recursion_limit_);
+      if (TryConsumeBeforeWhitespace(":")) {
+        TryConsumeWhitespace(message->GetTypeName(), "Unknown/Reserved");
+        if (!LookingAt("{") && !LookingAt("<")) {
+          UnknownFieldSet* unknown_field = unknown_fields->AddGroup(unknown_fields->field_count());
+          unknown_field->AddLengthDelimited(0, field_name);  // Add a field's name.
+          return SkipFieldValue(unknown_field);
+        }
       }
+      return SkipFieldMessage(unknown_fields);
     }
 
     if (singular_overwrite_policy_ == FORBID_SINGULAR_OVERWRITES) {
@@ -510,12 +573,16 @@ class TextFormat::Parser::ParserImpl {
       // Fail if the field is a member of a oneof and another member has already
       // been specified.
       const OneofDescriptor* oneof = field->containing_oneof();
-      if (oneof != NULL && reflection->HasOneof(*message, oneof)) {
+      if (oneof != nullptr && reflection->HasOneof(*message, oneof)) {
         const FieldDescriptor* other_field =
             reflection->GetOneofFieldDescriptor(*message, oneof);
-        ReportError("Field \"" + field_name + "\" is specified along with "
-                    "field \"" + other_field->name() + "\", another member "
-                    "of oneof \"" + oneof->name() + "\".");
+        ReportError("Field \"" + field_name +
+                    "\" is specified along with "
+                    "field \"" +
+                    other_field->name() +
+                    "\", another member "
+                    "of oneof \"" +
+                    oneof->name() + "\".");
         return false;
       }
     }
@@ -523,17 +590,23 @@ class TextFormat::Parser::ParserImpl {
     // Perform special handling for embedded message types.
     if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
       // ':' is optional here.
-      bool consumed_semicolon = TryConsume(":");
-      if (consumed_semicolon && field->options().weak() && LookingAtType(io::Tokenizer::TYPE_STRING)) {
+      bool consumed_semicolon = TryConsumeBeforeWhitespace(":");
+      TryConsumeWhitespace(message->GetTypeName(), "Normal");
+      if (consumed_semicolon && field->options().weak() &&
+          LookingAtType(io::Tokenizer::TYPE_STRING)) {
         // we are getting a bytes string for a weak field.
-        string tmp;
+        std::string tmp;
         DO(ConsumeString(&tmp));
-        reflection->MutableMessage(message, field)->ParseFromString(tmp);
+        MessageFactory* factory =
+            finder_ ? finder_->FindExtensionFactory(field) : nullptr;
+        reflection->MutableMessage(message, field, factory)
+            ->ParseFromString(tmp);
         goto label_skip_parsing;
       }
     } else {
       // ':' is required here.
-      DO(Consume(":"));
+      DO(ConsumeBeforeWhitespace(":"));
+      TryConsumeWhitespace(message->GetTypeName(), "Normal");
     }
 
     if (field->is_repeated() && TryConsume("[")) {
@@ -558,43 +631,41 @@ class TextFormat::Parser::ParserImpl {
     } else {
       DO(ConsumeFieldValue(message, reflection, field));
     }
-label_skip_parsing:
+  label_skip_parsing:
     // For historical reasons, fields may optionally be separated by commas or
     // semicolons.
     TryConsume(";") || TryConsume(",");
 
     if (field->options().deprecated()) {
-      ReportWarning("text format contains deprecated field \""
-                    + field_name + "\"");
+      ReportWarning("text format contains deprecated field \"" + field_name +
+                    "\"");
     }
 
     // If a parse info tree exists, add the location for the parsed
     // field.
-    if (parse_info_tree_ != NULL) {
+    if (parse_info_tree_ != nullptr) {
+      int end_line = tokenizer_.previous().line;
+      int end_column = tokenizer_.previous().end_column;
+
       RecordLocation(parse_info_tree_, field,
-                     ParseLocation(start_line, start_column));
+                     ParseLocationRange(ParseLocation(start_line, start_column),
+                                        ParseLocation(end_line, end_column)));
     }
 
     return true;
   }
 
   // Skips the next field including the field's name and value.
-  bool SkipField(UnknownFieldSet* unknown_fields, int recursion_limit) {
-
-    // OpenCV specific
-    if (--recursion_limit < 0) {
-      ReportError("Message is too deep (SkipField)");
-      return false;
-    }
-
-    string field_name;
+  bool SkipField(UnknownFieldSet* unknown_fields) {
+    std::string field_name;
     if (TryConsume("[")) {
-      // Extension name.
-      DO(ConsumeFullTypeName(&field_name));
-      DO(Consume("]"));
+      // Extension name or type URL.
+      DO(ConsumeTypeUrlOrFullTypeName(&field_name));
+      DO(ConsumeBeforeWhitespace("]"));
     } else {
-      DO(ConsumeIdentifier(&field_name));
+      DO(ConsumeIdentifierBeforeWhitespace(&field_name));
     }
+    TryConsumeWhitespace("Unknown/Reserved", "n/a");
 
     // Try to guess the type of this field.
     // If this field is not a message, there should be a ":" between the
@@ -602,12 +673,17 @@ label_skip_parsing:
     // start with "{" or "<" which indicates the beginning of a message body.
     // If there is no ":" or there is a "{" or "<" after ":", this field has
     // to be a message or the input is ill-formed.
-    if (TryConsume(":") && !LookingAt("{") && !LookingAt("<")) {
-      UnknownFieldSet* unknown_field = unknown_fields->AddGroup(unknown_fields->field_count());
-      unknown_field->AddLengthDelimited(0, field_name);  // Add a field's name.
-      DO(SkipFieldValue(unknown_field, recursion_limit));
+    if (TryConsumeBeforeWhitespace(":")) {
+      TryConsumeWhitespace("Unknown/Reserved", "n/a");
+      if (!LookingAt("{") && !LookingAt("<")) {
+        UnknownFieldSet* unknown_field = unknown_fields->AddGroup(unknown_fields->field_count());
+        unknown_field->AddLengthDelimited(0, field_name);  // Add a field's name.
+        DO(SkipFieldValue(unknown_field));
+      } else {
+        DO(SkipFieldMessage(unknown_fields));
+      }
     } else {
-      DO(SkipFieldMessage(unknown_fields, recursion_limit));
+      DO(SkipFieldMessage(unknown_fields));
     }
     // For historical reasons, fields may optionally be separated by commas or
     // semicolons.
@@ -615,33 +691,34 @@ label_skip_parsing:
     return true;
   }
 
-  bool ConsumeFieldMessage(Message* message,
-                           const Reflection* reflection,
+  bool ConsumeFieldMessage(Message* message, const Reflection* reflection,
                            const FieldDescriptor* field) {
-
-    // backported from 3.8.0
     if (--recursion_limit_ < 0) {
-      ReportError("Message is too deep");
+      ReportError(
+          StrCat("Message is too deep, the parser exceeded the "
+                       "configured recursion limit of ",
+                       initial_recursion_limit_, "."));
       return false;
     }
-
-    // If the parse information tree is not NULL, create a nested one
+    // If the parse information tree is not nullptr, create a nested one
     // for the nested message.
     ParseInfoTree* parent = parse_info_tree_;
-    if (parent != NULL) {
+    if (parent != nullptr) {
       parse_info_tree_ = CreateNested(parent, field);
     }
 
-    string delimiter;
+    std::string delimiter;
     DO(ConsumeMessageDelimiter(&delimiter));
+    MessageFactory* factory =
+        finder_ ? finder_->FindExtensionFactory(field) : nullptr;
     if (field->is_repeated()) {
-      DO(ConsumeMessage(reflection->AddMessage(message, field), delimiter));
+      DO(ConsumeMessage(reflection->AddMessage(message, field, factory),
+                        delimiter));
     } else {
-      DO(ConsumeMessage(reflection->MutableMessage(message, field),
+      DO(ConsumeMessage(reflection->MutableMessage(message, field, factory),
                         delimiter));
     }
 
-    // backported from 3.8.0
     ++recursion_limit_;
 
     // Reset the parse information tree.
@@ -651,60 +728,62 @@ label_skip_parsing:
 
   // Skips the whole body of a message including the beginning delimiter and
   // the ending delimiter.
-  bool SkipFieldMessage(UnknownFieldSet* unknown_fields, int recursion_limit) {
-    // OpenCV specific
-    if (--recursion_limit < 0) {
-      ReportError("Message is too deep (SkipFieldMessage)");
+  bool SkipFieldMessage(UnknownFieldSet* unknown_fields) {
+    if (--recursion_limit_ < 0) {
+      ReportError(
+          StrCat("Message is too deep, the parser exceeded the "
+                       "configured recursion limit of ",
+                       initial_recursion_limit_, "."));
       return false;
     }
 
-    string delimiter;
+    std::string delimiter;
     DO(ConsumeMessageDelimiter(&delimiter));
-    while (!LookingAt(">") &&  !LookingAt("}")) {
-      DO(SkipField(unknown_fields, recursion_limit));
+    while (!LookingAt(">") && !LookingAt("}")) {
+      DO(SkipField(unknown_fields));
     }
     DO(Consume(delimiter));
+
+    ++recursion_limit_;
     return true;
   }
 
-  bool ConsumeFieldValue(Message* message,
-                         const Reflection* reflection,
+  bool ConsumeFieldValue(Message* message, const Reflection* reflection,
                          const FieldDescriptor* field) {
-
 // Define an easy to use macro for setting fields. This macro checks
 // to see if the field is repeated (in which case we need to use the Add
 // methods or not (in which case we need to use the Set methods).
-#define SET_FIELD(CPPTYPE, VALUE)                                  \
-        if (field->is_repeated()) {                                \
-          reflection->Add##CPPTYPE(message, field, VALUE);         \
-        } else {                                                   \
-          reflection->Set##CPPTYPE(message, field, VALUE);         \
-        }                                                          \
-
-    switch(field->cpp_type()) {
+#define SET_FIELD(CPPTYPE, VALUE)                    \
+  if (field->is_repeated()) {                        \
+    reflection->Add##CPPTYPE(message, field, VALUE); \
+  } else {                                           \
+    reflection->Set##CPPTYPE(message, field, VALUE); \
+  }
+
+    switch (field->cpp_type()) {
       case FieldDescriptor::CPPTYPE_INT32: {
-        int64 value;
+        int64_t value;
         DO(ConsumeSignedInteger(&value, kint32max));
-        SET_FIELD(Int32, static_cast<int32>(value));
+        SET_FIELD(Int32, static_cast<int32_t>(value));
         break;
       }
 
       case FieldDescriptor::CPPTYPE_UINT32: {
-        uint64 value;
+        uint64_t value;
         DO(ConsumeUnsignedInteger(&value, kuint32max));
-        SET_FIELD(UInt32, static_cast<uint32>(value));
+        SET_FIELD(UInt32, static_cast<uint32_t>(value));
         break;
       }
 
       case FieldDescriptor::CPPTYPE_INT64: {
-        int64 value;
+        int64_t value;
         DO(ConsumeSignedInteger(&value, kint64max));
         SET_FIELD(Int64, value);
         break;
       }
 
       case FieldDescriptor::CPPTYPE_UINT64: {
-        uint64 value;
+        uint64_t value;
         DO(ConsumeUnsignedInteger(&value, kuint64max));
         SET_FIELD(UInt64, value);
         break;
@@ -725,7 +804,7 @@ label_skip_parsing:
       }
 
       case FieldDescriptor::CPPTYPE_STRING: {
-        string value;
+        std::string value;
         DO(ConsumeString(&value));
         SET_FIELD(String, value);
         break;
@@ -733,19 +812,19 @@ label_skip_parsing:
 
       case FieldDescriptor::CPPTYPE_BOOL: {
         if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
-          uint64 value;
+          uint64_t value;
           DO(ConsumeUnsignedInteger(&value, 1));
           SET_FIELD(Bool, value);
         } else {
-          string value;
+          std::string value;
           DO(ConsumeIdentifier(&value));
           if (value == "true" || value == "True" || value == "t") {
             SET_FIELD(Bool, true);
           } else if (value == "false" || value == "False" || value == "f") {
             SET_FIELD(Bool, false);
           } else {
-            ReportError("Invalid value for boolean field \"" + field->name()
-                        + "\". Value: \"" + value  + "\".");
+            ReportError("Invalid value for boolean field \"" + field->name() +
+                        "\". Value: \"" + value + "\".");
             return false;
           }
         }
@@ -753,9 +832,10 @@ label_skip_parsing:
       }
 
       case FieldDescriptor::CPPTYPE_ENUM: {
-        string value;
+        std::string value;
+        int64_t int_value = kint64max;
         const EnumDescriptor* enum_type = field->enum_type();
-        const EnumValueDescriptor* enum_value = NULL;
+        const EnumValueDescriptor* enum_value = nullptr;
 
         if (LookingAtType(io::Tokenizer::TYPE_IDENTIFIER)) {
           DO(ConsumeIdentifier(&value));
@@ -764,9 +844,8 @@ label_skip_parsing:
 
         } else if (LookingAt("-") ||
                    LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
-          int64 int_value;
           DO(ConsumeSignedInteger(&int_value, kint32max));
-          value = SimpleItoa(int_value);        // for error reporting
+          value = StrCat(int_value);  // for error reporting
           enum_value = enum_type->FindValueByNumber(int_value);
         } else {
           ReportError("Expected integer or identifier, got: " +
@@ -774,14 +853,22 @@ label_skip_parsing:
           return false;
         }
 
-        if (enum_value == NULL) {
-          if (!allow_unknown_enum_) {
-            ReportError("Unknown enumeration value of \"" + value  + "\" for "
-                        "field \"" + field->name() + "\".");
+        if (enum_value == nullptr) {
+          if (int_value != kint64max &&
+              reflection->SupportsUnknownEnumValues()) {
+            SET_FIELD(EnumValue, int_value);
+            return true;
+          } else if (!allow_unknown_enum_) {
+            ReportError("Unknown enumeration value of \"" + value +
+                        "\" for "
+                        "field \"" +
+                        field->name() + "\".");
             return false;
           } else {
-            ReportWarning("Unknown enumeration value of \"" + value  + "\" for "
-                          "field \"" + field->name() + "\".");
+            ReportWarning("Unknown enumeration value of \"" + value +
+                          "\" for "
+                          "field \"" +
+                          field->name() + "\".");
             return true;
           }
         }
@@ -801,11 +888,12 @@ label_skip_parsing:
     return true;
   }
 
-  bool SkipFieldValue(UnknownFieldSet* unknown_field, int recursion_limit) {
-
-    // OpenCV specific
-    if (--recursion_limit < 0) {
-      ReportError("Message is too deep (SkipFieldValue)");
+  bool SkipFieldValue(UnknownFieldSet* unknown_field) {
+    if (--recursion_limit_ < 0) {
+      ReportError(
+          StrCat("Message is too deep, the parser exceeded the "
+                       "configured recursion limit of ",
+                       initial_recursion_limit_, "."));
       return false;
     }
 
@@ -813,20 +901,22 @@ label_skip_parsing:
       while (LookingAtType(io::Tokenizer::TYPE_STRING)) {
         tokenizer_.Next();
       }
+      ++recursion_limit_;
       return true;
     }
     if (TryConsume("[")) {
       while (true) {
         if (!LookingAt("{") && !LookingAt("<")) {
-          DO(SkipFieldValue(unknown_field, recursion_limit));
+          DO(SkipFieldValue(unknown_field));
         } else {
-          DO(SkipFieldMessage(unknown_field, recursion_limit));
+          DO(SkipFieldMessage(unknown_field));
         }
         if (TryConsume("]")) {
           break;
         }
         DO(Consume(","));
       }
+      ++recursion_limit_;
       return true;
     }
     // Possible field values other than string:
@@ -854,6 +944,9 @@ label_skip_parsing:
     if (!LookingAtType(io::Tokenizer::TYPE_INTEGER) &&
         !LookingAtType(io::Tokenizer::TYPE_FLOAT) &&
         !LookingAtType(io::Tokenizer::TYPE_IDENTIFIER)) {
+      std::string text = tokenizer_.current().text;
+      ReportError("Cannot skip field value, unexpected token: " + text);
+      ++recursion_limit_;
       return false;
     }
     // Combination of '-' and TYPE_IDENTIFIER may result in an invalid field
@@ -863,23 +956,24 @@ label_skip_parsing:
     // below:
     //   inf, inff, infinity, nan
     if (has_minus && LookingAtType(io::Tokenizer::TYPE_IDENTIFIER)) {
-      string text = tokenizer_.current().text;
+      std::string text = tokenizer_.current().text;
       LowerString(&text);
       if (text != "inf" &&
-          text != "infinity" &&
-          text != "nan") {
+          text != "infinity" && text != "nan") {
         ReportError("Invalid float number: " + text);
+        ++recursion_limit_;
         return false;
       }
     }
     // Use a tag 1 because tag 0 is used for field's name.
     unknown_field->AddLengthDelimited(1, tokenizer_.current().text);
     tokenizer_.Next();
+    ++recursion_limit_;
     return true;
   }
 
   // Returns true if the current token's text is equal to that specified.
-  bool LookingAt(const string& text) {
+  bool LookingAt(const std::string& text) {
     return tokenizer_.current().text == text;
   }
 
@@ -890,7 +984,7 @@ label_skip_parsing:
 
   // Consumes an identifier and saves its value in the identifier parameter.
   // Returns false if the token is not of type IDENTFIER.
-  bool ConsumeIdentifier(string* identifier) {
+  bool ConsumeIdentifier(std::string* identifier) {
     if (LookingAtType(io::Tokenizer::TYPE_IDENTIFIER)) {
       *identifier = tokenizer_.current().text;
       tokenizer_.Next();
@@ -899,8 +993,9 @@ label_skip_parsing:
 
     // If allow_field_numer_ or allow_unknown_field_ is true, we should able
     // to parse integer identifiers.
-    if ((allow_field_number_ || allow_unknown_field_)
-        && LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
+    if ((allow_field_number_ || allow_unknown_field_ ||
+         allow_unknown_extension_) &&
+        LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
       *identifier = tokenizer_.current().text;
       tokenizer_.Next();
       return true;
@@ -910,11 +1005,20 @@ label_skip_parsing:
     return false;
   }
 
+  // Similar to `ConsumeIdentifier`, but any following whitespace token may
+  // be reported.
+  bool ConsumeIdentifierBeforeWhitespace(std::string* identifier) {
+    tokenizer_.set_report_whitespace(true);
+    bool result = ConsumeIdentifier(identifier);
+    tokenizer_.set_report_whitespace(false);
+    return result;
+  }
+
   // Consume a string of form "<id1>.<id2>....<idN>".
-  bool ConsumeFullTypeName(string* name) {
+  bool ConsumeFullTypeName(std::string* name) {
     DO(ConsumeIdentifier(name));
     while (TryConsume(".")) {
-      string part;
+      std::string part;
       DO(ConsumeIdentifier(&part));
       *name += ".";
       *name += part;
@@ -922,9 +1026,36 @@ label_skip_parsing:
     return true;
   }
 
+  bool ConsumeTypeUrlOrFullTypeName() {
+    std::string discarded;
+    DO(ConsumeIdentifier(&discarded));
+    while (TryConsume(".") || TryConsume("/")) {
+      DO(ConsumeIdentifier(&discarded));
+    }
+    return true;
+  }
+
+  bool ConsumeTypeUrlOrFullTypeName(std::string* name) {
+    DO(ConsumeIdentifier(name));
+    while (true) {
+      char delim = 0;
+      if (TryConsume("."))
+          delim = '.';
+      else if(TryConsume("/"))
+          delim = '/';
+      else
+          break;
+      std::string part;
+      DO(ConsumeIdentifier(&part));
+      *name += delim;
+      *name += part;
+    }
+    return true;
+  }
+
   // Consumes a string and saves its value in the text parameter.
   // Returns false if the token is not of type STRING.
-  bool ConsumeString(string* text) {
+  bool ConsumeString(std::string* text) {
     if (!LookingAtType(io::Tokenizer::TYPE_STRING)) {
       ReportError("Expected string, got: " + tokenizer_.current().text);
       return false;
@@ -940,16 +1071,16 @@ label_skip_parsing:
     return true;
   }
 
-  // Consumes a uint64 and saves its value in the value parameter.
+  // Consumes a uint64_t and saves its value in the value parameter.
   // Returns false if the token is not of type INTEGER.
-  bool ConsumeUnsignedInteger(uint64* value, uint64 max_value) {
+  bool ConsumeUnsignedInteger(uint64_t* value, uint64_t max_value) {
     if (!LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
       ReportError("Expected integer, got: " + tokenizer_.current().text);
       return false;
     }
 
-    if (!io::Tokenizer::ParseInteger(tokenizer_.current().text,
-                                     max_value, value)) {
+    if (!io::Tokenizer::ParseInteger(tokenizer_.current().text, max_value,
+                                     value)) {
       ReportError("Integer out of range (" + tokenizer_.current().text + ")");
       return false;
     }
@@ -958,12 +1089,12 @@ label_skip_parsing:
     return true;
   }
 
-  // Consumes an int64 and saves its value in the value parameter.
+  // Consumes an int64_t and saves its value in the value parameter.
   // Note that since the tokenizer does not support negative numbers,
   // we actually may consume an additional token (for the minus sign) in this
   // method. Returns false if the token is not an integer
   // (signed or otherwise).
-  bool ConsumeSignedInteger(int64* value, uint64 max_value) {
+  bool ConsumeSignedInteger(int64_t* value, uint64_t max_value) {
     bool negative = false;
 
     if (TryConsume("-")) {
@@ -973,40 +1104,43 @@ label_skip_parsing:
       ++max_value;
     }
 
-    uint64 unsigned_value;
+    uint64_t unsigned_value;
 
     DO(ConsumeUnsignedInteger(&unsigned_value, max_value));
 
     if (negative) {
-      if ((static_cast<uint64>(kint64max) + 1) == unsigned_value) {
+      if ((static_cast<uint64_t>(kint64max) + 1) == unsigned_value) {
         *value = kint64min;
       } else {
-        *value = -static_cast<int64>(unsigned_value);
+        *value = -static_cast<int64_t>(unsigned_value);
       }
     } else {
-      *value = static_cast<int64>(unsigned_value);
+      *value = static_cast<int64_t>(unsigned_value);
     }
 
     return true;
   }
 
-  // Consumes a uint64 and saves its value in the value parameter.
+  // Consumes a double and saves its value in the value parameter.
   // Accepts decimal numbers only, rejects hex or oct numbers.
-  bool ConsumeUnsignedDecimalInteger(uint64* value, uint64 max_value) {
+  bool ConsumeUnsignedDecimalAsDouble(double* value, uint64_t max_value) {
     if (!LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
       ReportError("Expected integer, got: " + tokenizer_.current().text);
       return false;
     }
 
-    const string& text = tokenizer_.current().text;
+    const std::string& text = tokenizer_.current().text;
     if (IsHexNumber(text) || IsOctNumber(text)) {
       ReportError("Expect a decimal number, got: " + text);
       return false;
     }
 
-    if (!io::Tokenizer::ParseInteger(text, max_value, value)) {
-      ReportError("Integer out of range (" + text + ")");
-      return false;
+    uint64_t uint64_value;
+    if (io::Tokenizer::ParseInteger(text, max_value, &uint64_value)) {
+      *value = static_cast<double>(uint64_value);
+    } else {
+      // Uint64 overflow, attempt to parse as a double instead.
+      *value = io::Tokenizer::ParseFloat(text);
     }
 
     tokenizer_.Next();
@@ -1029,10 +1163,7 @@ label_skip_parsing:
     // Therefore, we must check both cases here.
     if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) {
       // We have found an integer value for the double.
-      uint64 integer_value;
-      DO(ConsumeUnsignedDecimalInteger(&integer_value, kuint64max));
-
-      *value = static_cast<double>(integer_value);
+      DO(ConsumeUnsignedDecimalAsDouble(value, kuint64max));
     } else if (LookingAtType(io::Tokenizer::TYPE_FLOAT)) {
       // We have found a float value for the double.
       *value = io::Tokenizer::ParseFloat(tokenizer_.current().text);
@@ -1040,7 +1171,7 @@ label_skip_parsing:
       // Mark the current token as consumed.
       tokenizer_.Next();
     } else if (LookingAtType(io::Tokenizer::TYPE_IDENTIFIER)) {
-      string text = tokenizer_.current().text;
+      std::string text = tokenizer_.current().text;
       LowerString(&text);
       if (text == "inf" ||
           text == "infinity") {
@@ -1067,48 +1198,33 @@ label_skip_parsing:
 
   // Consumes Any::type_url value, of form "type.googleapis.com/full.type.Name"
   // or "type.googleprod.com/full.type.Name"
-  bool ConsumeAnyTypeUrl(string* full_type_name, string* prefix) {
+  bool ConsumeAnyTypeUrl(std::string* full_type_name, std::string* prefix) {
     // TODO(saito) Extend Consume() to consume multiple tokens at once, so that
     // this code can be written as just DO(Consume(kGoogleApisTypePrefix)).
-    string url1, url2, url3;
-    DO(ConsumeIdentifier(&url1));  // type
-    DO(Consume("."));
-    DO(ConsumeIdentifier(&url2));  // googleapis
-    DO(Consume("."));
-    DO(ConsumeIdentifier(&url3));  // com
+    DO(ConsumeIdentifier(prefix));
+    while (TryConsume(".")) {
+      std::string url;
+      DO(ConsumeIdentifier(&url));
+      *prefix += "." + url;
+    }
     DO(Consume("/"));
+    *prefix += "/";
     DO(ConsumeFullTypeName(full_type_name));
 
-    *prefix = url1 + "." + url2 + "." + url3 + "/";
-    if (*prefix != internal::kTypeGoogleApisComPrefix &&
-        *prefix != internal::kTypeGoogleProdComPrefix) {
-      ReportError("TextFormat::Parser for Any supports only "
-                  "type.googleapis.com and type.googleprod.com, "
-                  "but found \"" + *prefix + "\"");
-      return false;
-    }
     return true;
   }
 
   // A helper function for reconstructing Any::value. Consumes a text of
-  // full_type_name, then serializes it into serialized_value. "pool" is used to
-  // look up and create a temporary object with full_type_name.
-  bool ConsumeAnyValue(const string& full_type_name, const DescriptorPool* pool,
-                       string* serialized_value) {
-    const Descriptor* value_descriptor =
-        pool->FindMessageTypeByName(full_type_name);
-    if (value_descriptor == NULL) {
-      ReportError("Could not find type \"" + full_type_name +
-                  "\" stored in google.protobuf.Any.");
-      return false;
-    }
+  // full_type_name, then serializes it into serialized_value.
+  bool ConsumeAnyValue(const Descriptor* value_descriptor,
+                       std::string* serialized_value) {
     DynamicMessageFactory factory;
     const Message* value_prototype = factory.GetPrototype(value_descriptor);
-    if (value_prototype == NULL) {
+    if (value_prototype == nullptr) {
       return false;
     }
-    google::protobuf::scoped_ptr<Message> value(value_prototype->New());
-    string sub_delimiter;
+    std::unique_ptr<Message> value(value_prototype->New());
+    std::string sub_delimiter;
     DO(ConsumeMessageDelimiter(&sub_delimiter));
     DO(ConsumeMessage(value.get(), sub_delimiter));
 
@@ -1117,7 +1233,7 @@ label_skip_parsing:
     } else {
       if (!value->IsInitialized()) {
         ReportError(
-            "Value of type \"" + full_type_name +
+            "Value of type \"" + value_descriptor->full_name() +
             "\" stored in google.protobuf.Any has missing required fields");
         return false;
       }
@@ -1129,12 +1245,12 @@ label_skip_parsing:
   // Consumes a token and confirms that it matches that specified in the
   // value parameter. Returns false if the token found does not match that
   // which was specified.
-  bool Consume(const string& value) {
-    const string& current_value = tokenizer_.current().text;
+  bool Consume(const std::string& value) {
+    const std::string& current_value = tokenizer_.current().text;
 
     if (current_value != value) {
-      ReportError("Expected \"" + value + "\", found \"" + current_value
-                  "\".");
+      ReportError("Expected \"" + value + "\", found \"" + current_value +
+                  "\".");
       return false;
     }
 
@@ -1143,9 +1259,19 @@ label_skip_parsing:
     return true;
   }
 
+  // Similar to `Consume`, but the following token may be tokenized as
+  // TYPE_WHITESPACE.
+  bool ConsumeBeforeWhitespace(const std::string& value) {
+    // Report whitespace after this token, but only once.
+    tokenizer_.set_report_whitespace(true);
+    bool result = Consume(value);
+    tokenizer_.set_report_whitespace(false);
+    return result;
+  }
+
   // Attempts to consume the supplied value. Returns false if a the
   // token found does not match the value specified.
-  bool TryConsume(const string& value) {
+  bool TryConsume(const std::string& value) {
     if (tokenizer_.current().text == value) {
       tokenizer_.Next();
       return true;
@@ -1154,20 +1280,40 @@ label_skip_parsing:
     }
   }
 
+  // Similar to `TryConsume`, but the following token may be tokenized as
+  // TYPE_WHITESPACE.
+  bool TryConsumeBeforeWhitespace(const std::string& value) {
+    // Report whitespace after this token, but only once.
+    tokenizer_.set_report_whitespace(true);
+    bool result = TryConsume(value);
+    tokenizer_.set_report_whitespace(false);
+    return result;
+  }
+
+  bool TryConsumeWhitespace(const std::string& message_type,
+                            const char* field_type) {
+    if (LookingAtType(io::Tokenizer::TYPE_WHITESPACE)) {
+      tokenizer_.Next();
+      return true;
+    }
+
+    return false;
+  }
+
   // An internal instance of the Tokenizer's error collector, used to
   // collect any base-level parse errors and feed them to the ParserImpl.
   class ParserErrorCollector : public io::ErrorCollector {
    public:
-    explicit ParserErrorCollector(TextFormat::Parser::ParserImpl* parser) :
-        parser_(parser) { }
+    explicit ParserErrorCollector(TextFormat::Parser::ParserImpl* parser)
+        : parser_(parser) {}
 
-    virtual ~ParserErrorCollector() { }
+    ~ParserErrorCollector() override {}
 
-    virtual void AddError(int line, int column, const string& message) {
+    void AddError(int line, int column, const std::string& message) override {
       parser_->ReportError(line, column, message);
     }
 
-    virtual void AddWarning(int line, int column, const string& message) {
+    void AddWarning(int line, int column, const std::string& message) override {
       parser_->ReportWarning(line, column, message);
     }
 
@@ -1177,7 +1323,7 @@ label_skip_parsing:
   };
 
   io::ErrorCollector* error_collector_;
-  TextFormat::Finder* finder_;
+  const TextFormat::Finder* finder_;
   ParseInfoTree* parse_info_tree_;
   ParserErrorCollector tokenizer_error_collector_;
   io::Tokenizer tokenizer_;
@@ -1185,31 +1331,42 @@ label_skip_parsing:
   SingularOverwritePolicy singular_overwrite_policy_;
   const bool allow_case_insensitive_field_;
   const bool allow_unknown_field_;
+  const bool allow_unknown_extension_;
   const bool allow_unknown_enum_;
   const bool allow_field_number_;
   const bool allow_partial_;
+  const int initial_recursion_limit_;
+  int recursion_limit_;
   bool had_errors_;
-  int recursion_limit_;  // backported from 3.8.0
 };
 
-#undef DO
-
 // ===========================================================================
 // Internal class for writing text to the io::ZeroCopyOutputStream. Adapted
-// from the Printer found in //google/protobuf/io/printer.h
+// from the Printer found in //net/proto2/io/public/printer.h
 class TextFormat::Printer::TextGenerator
     : public TextFormat::BaseTextGenerator {
  public:
   explicit TextGenerator(io::ZeroCopyOutputStream* output,
                          int initial_indent_level)
-    : output_(output),
-      buffer_(NULL),
-      buffer_size_(0),
-      at_start_of_line_(true),
-      failed_(false),
-      indent_level_(initial_indent_level),
-      initial_indent_level_(initial_indent_level) {
-  }
+      : output_(output),
+        buffer_(nullptr),
+        buffer_size_(0),
+        at_start_of_line_(true),
+        failed_(false),
+        insert_silent_marker_(false),
+        indent_level_(initial_indent_level),
+        initial_indent_level_(initial_indent_level) {}
+
+  explicit TextGenerator(io::ZeroCopyOutputStream* output,
+                         bool insert_silent_marker, int initial_indent_level)
+      : output_(output),
+        buffer_(nullptr),
+        buffer_size_(0),
+        at_start_of_line_(true),
+        failed_(false),
+        insert_silent_marker_(insert_silent_marker),
+        indent_level_(initial_indent_level),
+        initial_indent_level_(initial_indent_level) {}
 
   ~TextGenerator() {
     // Only BackUp() if we're sure we've successfully called Next() at least
@@ -1222,15 +1379,12 @@ class TextFormat::Printer::TextGenerator
   // Indent text by two spaces.  After calling Indent(), two spaces will be
   // inserted at the beginning of each line of text.  Indent() may be called
   // multiple times to produce deeper indents.
-  void Indent() {
-    ++indent_level_;
-  }
+  void Indent() override { ++indent_level_; }
 
   // Reduces the current indent level by two spaces, or crashes if the indent
   // level is zero.
-  void Outdent() {
-    if (indent_level_ == 0 ||
-        indent_level_ < initial_indent_level_) {
+  void Outdent() override {
+    if (indent_level_ == 0 || indent_level_ < initial_indent_level_) {
       GOOGLE_LOG(DFATAL) << " Outdent() without matching Indent().";
       return;
     }
@@ -1238,8 +1392,12 @@ class TextFormat::Printer::TextGenerator
     --indent_level_;
   }
 
+  size_t GetCurrentIndentationSize() const override {
+    return 2 * indent_level_;
+  }
+
   // Print text to the output stream.
-  void Print(const char* text, size_t size) {
+  void Print(const char* text, size_t size) override {
     if (indent_level_ > 0) {
       size_t pos = 0;  // The number of bytes we've written so far.
       for (size_t i = 0; i < size; i++) {
@@ -1269,6 +1427,22 @@ class TextFormat::Printer::TextGenerator
   // error.)
   bool failed() const { return failed_; }
 
+  void PrintMaybeWithMarker(StringPiece text) {
+    Print(text.data(), text.size());
+    if (ConsumeInsertSilentMarker()) {
+      PrintLiteral(DEBUG_STRING_SILENT_MARKER);
+    }
+  }
+
+  void PrintMaybeWithMarker(StringPiece text_head,
+                            StringPiece text_tail) {
+    Print(text_head.data(), text_head.size());
+    if (ConsumeInsertSilentMarker()) {
+      PrintLiteral(DEBUG_STRING_SILENT_MARKER);
+    }
+    Print(text_tail.data(), text_tail.size());
+  }
+
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TextGenerator);
 
@@ -1283,7 +1457,7 @@ class TextFormat::Printer::TextGenerator
       if (failed_) return;
     }
 
-    while (size > buffer_size_) {
+    while (static_cast<int64_t>(size) > buffer_size_) {
       // Data exceeds space in the buffer.  Copy what we can and request a
       // new buffer.
       if (buffer_size_ > 0) {
@@ -1291,7 +1465,7 @@ class TextFormat::Printer::TextGenerator
         data += buffer_size_;
         size -= buffer_size_;
       }
-      void* void_buffer = NULL;
+      void* void_buffer = nullptr;
       failed_ = !output_->Next(&void_buffer, &buffer_size_);
       if (failed_) return;
       buffer_ = reinterpret_cast<char*>(void_buffer);
@@ -1304,14 +1478,18 @@ class TextFormat::Printer::TextGenerator
   }
 
   void WriteIndent() {
-    if (indent_level_ == 0) { return; }
+    if (indent_level_ == 0) {
+      return;
+    }
     GOOGLE_DCHECK(!failed_);
-    int size = 2 * indent_level_;
+    int size = GetCurrentIndentationSize();
 
     while (size > buffer_size_) {
       // Data exceeds space in the buffer. Write what we can and request a new
       // buffer.
-      memset(buffer_, ' ', buffer_size_);
+      if (buffer_size_ > 0) {
+        memset(buffer_, ' ', buffer_size_);
+      }
       size -= buffer_size_;
       void* void_buffer;
       failed_ = !output_->Next(&void_buffer, &buffer_size_);
@@ -1325,76 +1503,165 @@ class TextFormat::Printer::TextGenerator
     buffer_size_ -= size;
   }
 
+  // Return the current value of insert_silent_marker_. If it is true, set it
+  // to false as we assume that a silent marker is inserted after a call to this
+  // function.
+  bool ConsumeInsertSilentMarker() {
+    if (insert_silent_marker_) {
+      insert_silent_marker_ = false;
+      return true;
+    }
+    return false;
+  }
+
   io::ZeroCopyOutputStream* const output_;
   char* buffer_;
   int buffer_size_;
   bool at_start_of_line_;
   bool failed_;
+  // This flag is false when inserting silent marker is disabled or a silent
+  // marker has been inserted.
+  bool insert_silent_marker_;
 
   int indent_level_;
   int initial_indent_level_;
 };
 
 // ===========================================================================
+//  An internal field value printer that may insert a silent marker in
+//  DebugStrings.
+class TextFormat::Printer::DebugStringFieldValuePrinter
+    : public TextFormat::FastFieldValuePrinter {
+ public:
+  void PrintMessageStart(const Message& /*message*/, int /*field_index*/,
+                         int /*field_count*/, bool single_line_mode,
+                         BaseTextGenerator* generator) const override {
+    // This is safe as only TextGenerator is used with
+    // DebugStringFieldValuePrinter.
+    TextGenerator* text_generator = static_cast<TextGenerator*>(generator);
+    if (single_line_mode) {
+      text_generator->PrintMaybeWithMarker(" ", "{ ");
+    } else {
+      text_generator->PrintMaybeWithMarker(" ", "{\n");
+    }
+  }
+};
 
-TextFormat::Finder::~Finder() {
+// ===========================================================================
+//  An internal field value printer that escape UTF8 strings.
+class TextFormat::Printer::FastFieldValuePrinterUtf8Escaping
+    : public TextFormat::Printer::DebugStringFieldValuePrinter {
+ public:
+  void PrintString(const std::string& val,
+                   TextFormat::BaseTextGenerator* generator) const override {
+    generator->PrintLiteral("\"");
+    generator->PrintString(strings::Utf8SafeCEscape(val));
+    generator->PrintLiteral("\"");
+  }
+  void PrintBytes(const std::string& val,
+                  TextFormat::BaseTextGenerator* generator) const override {
+    return FastFieldValuePrinter::PrintString(val, generator);
+  }
+};
+
+// ===========================================================================
+// Implementation of the default Finder for extensions.
+TextFormat::Finder::~Finder() {}
+
+const FieldDescriptor* TextFormat::Finder::FindExtension(
+    Message* message, const std::string& name) const {
+  return DefaultFinderFindExtension(message, name);
 }
 
-TextFormat::Parser::Parser()
-  : error_collector_(NULL),
-    finder_(NULL),
-    parse_info_tree_(NULL),
-    allow_partial_(false),
-    allow_case_insensitive_field_(false),
-    allow_unknown_field_(false),
-    allow_unknown_enum_(false),
-    allow_field_number_(false),
-    allow_relaxed_whitespace_(false),
-    allow_singular_overwrites_(false),
-    recursion_limit_(std::numeric_limits<int>::max())
-{
+const FieldDescriptor* TextFormat::Finder::FindExtensionByNumber(
+    const Descriptor* descriptor, int number) const {
+  return DefaultFinderFindExtensionByNumber(descriptor, number);
+}
+
+const Descriptor* TextFormat::Finder::FindAnyType(
+    const Message& message, const std::string& prefix,
+    const std::string& name) const {
+  return DefaultFinderFindAnyType(message, prefix, name);
+}
+
+MessageFactory* TextFormat::Finder::FindExtensionFactory(
+    const FieldDescriptor* /*field*/) const {
+  return nullptr;
 }
 
+// ===========================================================================
+
+TextFormat::Parser::Parser()
+    : error_collector_(nullptr),
+      finder_(nullptr),
+      parse_info_tree_(nullptr),
+      allow_partial_(false),
+      allow_case_insensitive_field_(false),
+      allow_unknown_field_(false),
+      allow_unknown_extension_(false),
+      allow_unknown_enum_(false),
+      allow_field_number_(false),
+      allow_relaxed_whitespace_(false),
+      allow_singular_overwrites_(false),
+      recursion_limit_(std::numeric_limits<int>::max()) {}
+
 TextFormat::Parser::~Parser() {}
 
+namespace {
+
+bool CheckParseInputSize(StringPiece input,
+                         io::ErrorCollector* error_collector) {
+  if (input.size() > INT_MAX) {
+    error_collector->AddError(
+        -1, 0,
+        StrCat(
+            "Input size too large: ", static_cast<int64_t>(input.size()),
+            " bytes", " > ", INT_MAX, " bytes."));
+    return false;
+  }
+  return true;
+}
+
+}  // namespace
+
 bool TextFormat::Parser::Parse(io::ZeroCopyInputStream* input,
                                Message* output) {
   output->Clear();
 
   ParserImpl::SingularOverwritePolicy overwrites_policy =
-      allow_singular_overwrites_
-      ? ParserImpl::ALLOW_SINGULAR_OVERWRITES
-      : ParserImpl::FORBID_SINGULAR_OVERWRITES;
+      allow_singular_overwrites_ ? ParserImpl::ALLOW_SINGULAR_OVERWRITES
+                                 : ParserImpl::FORBID_SINGULAR_OVERWRITES;
 
-  ParserImpl parser(output->GetDescriptor(), input, error_collector_,
-                    finder_, parse_info_tree_,
-                    overwrites_policy,
+  ParserImpl parser(output->GetDescriptor(), input, error_collector_, finder_,
+                    parse_info_tree_, overwrites_policy,
                     allow_case_insensitive_field_, allow_unknown_field_,
-                    allow_unknown_enum_, allow_field_number_,
-                    allow_relaxed_whitespace_, allow_partial_, recursion_limit_);
+                    allow_unknown_extension_, allow_unknown_enum_,
+                    allow_field_number_, allow_relaxed_whitespace_,
+                    allow_partial_, recursion_limit_);
   return MergeUsingImpl(input, output, &parser);
 }
 
-bool TextFormat::Parser::ParseFromString(const string& input,
+bool TextFormat::Parser::ParseFromString(ConstStringParam input,
                                          Message* output) {
+  DO(CheckParseInputSize(input, error_collector_));
   io::ArrayInputStream input_stream(input.data(), input.size());
   return Parse(&input_stream, output);
 }
 
-
 bool TextFormat::Parser::Merge(io::ZeroCopyInputStream* input,
                                Message* output) {
-  ParserImpl parser(output->GetDescriptor(), input, error_collector_,
-                    finder_, parse_info_tree_,
-                    ParserImpl::ALLOW_SINGULAR_OVERWRITES,
+  ParserImpl parser(output->GetDescriptor(), input, error_collector_, finder_,
+                    parse_info_tree_, ParserImpl::ALLOW_SINGULAR_OVERWRITES,
                     allow_case_insensitive_field_, allow_unknown_field_,
-                    allow_unknown_enum_, allow_field_number_,
-                    allow_relaxed_whitespace_, allow_partial_, recursion_limit_);
+                    allow_unknown_extension_, allow_unknown_enum_,
+                    allow_field_number_, allow_relaxed_whitespace_,
+                    allow_partial_, recursion_limit_);
   return MergeUsingImpl(input, output, &parser);
 }
 
-bool TextFormat::Parser::MergeFromString(const string& input,
+bool TextFormat::Parser::MergeFromString(ConstStringParam input,
                                          Message* output) {
+  DO(CheckParseInputSize(input, error_collector_));
   io::ArrayInputStream input_stream(input.data(), input.size());
   return Merge(&input_stream, output);
 }
@@ -1405,26 +1672,26 @@ bool TextFormat::Parser::MergeUsingImpl(io::ZeroCopyInputStream* /* input */,
                                         ParserImpl* parser_impl) {
   if (!parser_impl->Parse(output)) return false;
   if (!allow_partial_ && !output->IsInitialized()) {
-    std::vector<string> missing_fields;
+    std::vector<std::string> missing_fields;
     output->FindInitializationErrors(&missing_fields);
-    parser_impl->ReportError(-1, 0, "Message missing required fields: " +
-                                        Join(missing_fields, ", "));
+    parser_impl->ReportError(-1, 0,
+                             "Message missing required fields: " +
+                                 Join(missing_fields, ", "));
     return false;
   }
   return true;
 }
 
-bool TextFormat::Parser::ParseFieldValueFromString(
-    const string& input,
-    const FieldDescriptor* field,
-    Message* output) {
+bool TextFormat::Parser::ParseFieldValueFromString(const std::string& input,
+                                                   const FieldDescriptor* field,
+                                                   Message* output) {
   io::ArrayInputStream input_stream(input.data(), input.size());
-  ParserImpl parser(output->GetDescriptor(), &input_stream, error_collector_,
-                    finder_, parse_info_tree_,
-                    ParserImpl::ALLOW_SINGULAR_OVERWRITES,
-                    allow_case_insensitive_field_, allow_unknown_field_,
-                    allow_unknown_enum_, allow_field_number_,
-                    allow_relaxed_whitespace_, allow_partial_, recursion_limit_);
+  ParserImpl parser(
+      output->GetDescriptor(), &input_stream, error_collector_, finder_,
+      parse_info_tree_, ParserImpl::ALLOW_SINGULAR_OVERWRITES,
+      allow_case_insensitive_field_, allow_unknown_field_,
+      allow_unknown_extension_, allow_unknown_enum_, allow_field_number_,
+      allow_relaxed_whitespace_, allow_partial_, recursion_limit_);
   return parser.ParseField(field, output);
 }
 
@@ -1438,17 +1705,19 @@ bool TextFormat::Parser::ParseFieldValueFromString(
   return Parser().Merge(input, output);
 }
 
-/* static */ bool TextFormat::ParseFromString(const string& input,
+/* static */ bool TextFormat::ParseFromString(ConstStringParam input,
                                               Message* output) {
   return Parser().ParseFromString(input, output);
 }
 
-/* static */ bool TextFormat::MergeFromString(const string& input,
+/* static */ bool TextFormat::MergeFromString(ConstStringParam input,
                                               Message* output) {
   return Parser().MergeFromString(input, output);
 }
 
 
+#undef DO
+
 // ===========================================================================
 
 TextFormat::BaseTextGenerator::~BaseTextGenerator() {}
@@ -1458,18 +1727,20 @@ namespace {
 // A BaseTextGenerator that writes to a string.
 class StringBaseTextGenerator : public TextFormat::BaseTextGenerator {
  public:
-  void Print(const char* text, size_t size) { output_.append(text, size); }
+  void Print(const char* text, size_t size) override {
+    output_.append(text, size);
+  }
 
 // Some compilers do not support ref-qualifiers even in C++11 mode.
 // Disable the optimization for now and revisit it later.
-#if 0 // LANG_CXX11
-  string Consume() && { return std::move(output_); }
-#else   // !LANG_CXX11
-  const string& Get() { return output_; }
+#if 0  // LANG_CXX11
+  std::string Consume() && { return std::move(output_); }
+#else  // !LANG_CXX11
+  const std::string& Get() { return output_; }
 #endif  // LANG_CXX11
 
  private:
-  string output_;
+  std::string output_;
 };
 
 }  // namespace
@@ -1480,7 +1751,7 @@ class StringBaseTextGenerator : public TextFormat::BaseTextGenerator {
 TextFormat::FieldValuePrinter::FieldValuePrinter() {}
 TextFormat::FieldValuePrinter::~FieldValuePrinter() {}
 
-#if 0 // LANG_CXX11
+#if 0  // LANG_CXX11
 #define FORWARD_IMPL(fn, ...)            \
   StringBaseTextGenerator generator;     \
   delegate_.fn(__VA_ARGS__, &generator); \
@@ -1492,55 +1763,52 @@ TextFormat::FieldValuePrinter::~FieldValuePrinter() {}
   return generator.Get()
 #endif  // LANG_CXX11
 
-string TextFormat::FieldValuePrinter::PrintBool(bool val) const {
+std::string TextFormat::FieldValuePrinter::PrintBool(bool val) const {
   FORWARD_IMPL(PrintBool, val);
 }
-string TextFormat::FieldValuePrinter::PrintInt32(int32 val) const {
+std::string TextFormat::FieldValuePrinter::PrintInt32(int32_t val) const {
   FORWARD_IMPL(PrintInt32, val);
 }
-string TextFormat::FieldValuePrinter::PrintUInt32(uint32 val) const {
+std::string TextFormat::FieldValuePrinter::PrintUInt32(uint32_t val) const {
   FORWARD_IMPL(PrintUInt32, val);
 }
-string TextFormat::FieldValuePrinter::PrintInt64(int64 val) const {
+std::string TextFormat::FieldValuePrinter::PrintInt64(int64_t val) const {
   FORWARD_IMPL(PrintInt64, val);
 }
-string TextFormat::FieldValuePrinter::PrintUInt64(uint64 val) const {
+std::string TextFormat::FieldValuePrinter::PrintUInt64(uint64_t val) const {
   FORWARD_IMPL(PrintUInt64, val);
 }
-string TextFormat::FieldValuePrinter::PrintFloat(float val) const {
+std::string TextFormat::FieldValuePrinter::PrintFloat(float val) const {
   FORWARD_IMPL(PrintFloat, val);
 }
-string TextFormat::FieldValuePrinter::PrintDouble(double val) const {
+std::string TextFormat::FieldValuePrinter::PrintDouble(double val) const {
   FORWARD_IMPL(PrintDouble, val);
 }
-string TextFormat::FieldValuePrinter::PrintString(const string& val) const {
+std::string TextFormat::FieldValuePrinter::PrintString(
+    const std::string& val) const {
   FORWARD_IMPL(PrintString, val);
 }
-string TextFormat::FieldValuePrinter::PrintBytes(const string& val) const {
+std::string TextFormat::FieldValuePrinter::PrintBytes(
+    const std::string& val) const {
   return PrintString(val);
 }
-string TextFormat::FieldValuePrinter::PrintEnum(int32 val,
-                                                const string& name) const {
+std::string TextFormat::FieldValuePrinter::PrintEnum(
+    int32_t val, const std::string& name) const {
   FORWARD_IMPL(PrintEnum, val, name);
 }
-string TextFormat::FieldValuePrinter::PrintFieldName(
-    const Message& message,
-    const Reflection* reflection,
+std::string TextFormat::FieldValuePrinter::PrintFieldName(
+    const Message& message, const Reflection* reflection,
     const FieldDescriptor* field) const {
   FORWARD_IMPL(PrintFieldName, message, reflection, field);
 }
-string TextFormat::FieldValuePrinter::PrintMessageStart(
-    const Message& message,
-    int field_index,
-    int field_count,
+std::string TextFormat::FieldValuePrinter::PrintMessageStart(
+    const Message& message, int field_index, int field_count,
     bool single_line_mode) const {
   FORWARD_IMPL(PrintMessageStart, message, field_index, field_count,
                single_line_mode);
 }
-string TextFormat::FieldValuePrinter::PrintMessageEnd(
-    const Message& message,
-    int field_index,
-    int field_count,
+std::string TextFormat::FieldValuePrinter::PrintMessageEnd(
+    const Message& message, int field_index, int field_count,
     bool single_line_mode) const {
   FORWARD_IMPL(PrintMessageEnd, message, field_index, field_count,
                single_line_mode);
@@ -1558,58 +1826,57 @@ void TextFormat::FastFieldValuePrinter::PrintBool(
   }
 }
 void TextFormat::FastFieldValuePrinter::PrintInt32(
-    int32 val, BaseTextGenerator* generator) const {
-  generator->PrintString(SimpleItoa(val));
+    int32_t val, BaseTextGenerator* generator) const {
+  generator->PrintString(StrCat(val));
 }
 void TextFormat::FastFieldValuePrinter::PrintUInt32(
-    uint32 val, BaseTextGenerator* generator) const {
-  generator->PrintString(SimpleItoa(val));
+    uint32_t val, BaseTextGenerator* generator) const {
+  generator->PrintString(StrCat(val));
 }
 void TextFormat::FastFieldValuePrinter::PrintInt64(
-    int64 val, BaseTextGenerator* generator) const {
-  generator->PrintString(SimpleItoa(val));
+    int64_t val, BaseTextGenerator* generator) const {
+  generator->PrintString(StrCat(val));
 }
 void TextFormat::FastFieldValuePrinter::PrintUInt64(
-    uint64 val, BaseTextGenerator* generator) const {
-  generator->PrintString(SimpleItoa(val));
+    uint64_t val, BaseTextGenerator* generator) const {
+  generator->PrintString(StrCat(val));
 }
 void TextFormat::FastFieldValuePrinter::PrintFloat(
     float val, BaseTextGenerator* generator) const {
-  generator->PrintString(SimpleFtoa(val));
+  generator->PrintString(!std::isnan(val) ? SimpleFtoa(val) : "nan");
 }
 void TextFormat::FastFieldValuePrinter::PrintDouble(
     double val, BaseTextGenerator* generator) const {
-  generator->PrintString(SimpleDtoa(val));
+  generator->PrintString(!std::isnan(val) ? SimpleDtoa(val) : "nan");
 }
 void TextFormat::FastFieldValuePrinter::PrintEnum(
-    int32 val, const string& name, BaseTextGenerator* generator) const {
+    int32_t /*val*/, const std::string& name,
+    BaseTextGenerator* generator) const {
   generator->PrintString(name);
 }
 
 void TextFormat::FastFieldValuePrinter::PrintString(
-    const string& val, BaseTextGenerator* generator) const {
+    const std::string& val, BaseTextGenerator* generator) const {
   generator->PrintLiteral("\"");
   generator->PrintString(CEscape(val));
   generator->PrintLiteral("\"");
 }
 void TextFormat::FastFieldValuePrinter::PrintBytes(
-    const string& val, BaseTextGenerator* generator) const {
+    const std::string& val, BaseTextGenerator* generator) const {
   PrintString(val, generator);
 }
 void TextFormat::FastFieldValuePrinter::PrintFieldName(
-    const Message& message, const Reflection* reflection,
+    const Message& message, int /*field_index*/, int /*field_count*/,
+    const Reflection* reflection, const FieldDescriptor* field,
+    BaseTextGenerator* generator) const {
+  PrintFieldName(message, reflection, field, generator);
+}
+void TextFormat::FastFieldValuePrinter::PrintFieldName(
+    const Message& /*message*/, const Reflection* /*reflection*/,
     const FieldDescriptor* field, BaseTextGenerator* generator) const {
   if (field->is_extension()) {
     generator->PrintLiteral("[");
-    // We special-case MessageSet elements for compatibility with proto1.
-    if (field->containing_type()->options().message_set_wire_format() &&
-        field->type() == FieldDescriptor::TYPE_MESSAGE &&
-        field->is_optional() &&
-        field->extension_scope() == field->message_type()) {
-      generator->PrintString(field->message_type()->full_name());
-    } else {
-      generator->PrintString(field->full_name());
-    }
+    generator->PrintString(field->PrintableNameForExtension());
     generator->PrintLiteral("]");
   } else if (field->type() == FieldDescriptor::TYPE_GROUP) {
     // Groups must be serialized with their original capitalization.
@@ -1619,7 +1886,7 @@ void TextFormat::FastFieldValuePrinter::PrintFieldName(
   }
 }
 void TextFormat::FastFieldValuePrinter::PrintMessageStart(
-    const Message& message, int field_index, int field_count,
+    const Message& /*message*/, int /*field_index*/, int /*field_count*/,
     bool single_line_mode, BaseTextGenerator* generator) const {
   if (single_line_mode) {
     generator->PrintLiteral(" { ");
@@ -1627,8 +1894,13 @@ void TextFormat::FastFieldValuePrinter::PrintMessageStart(
     generator->PrintLiteral(" {\n");
   }
 }
+bool TextFormat::FastFieldValuePrinter::PrintMessageContent(
+    const Message& /*message*/, int /*field_index*/, int /*field_count*/,
+    bool /*single_line_mode*/, BaseTextGenerator* /*generator*/) const {
+  return false;  // Use the default printing function.
+}
 void TextFormat::FastFieldValuePrinter::PrintMessageEnd(
-    const Message& message, int field_index, int field_count,
+    const Message& /*message*/, int /*field_index*/, int /*field_count*/,
     bool single_line_mode, BaseTextGenerator* generator) const {
   if (single_line_mode) {
     generator->PrintLiteral("} ");
@@ -1650,99 +1922,100 @@ class FieldValuePrinterWrapper : public TextFormat::FastFieldValuePrinter {
     delegate_.reset(delegate);
   }
 
-  void PrintBool(bool val, TextFormat::BaseTextGenerator* generator) const {
+  void PrintBool(bool val,
+                 TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintBool(val));
   }
-  void PrintInt32(int32 val, TextFormat::BaseTextGenerator* generator) const {
+  void PrintInt32(int32_t val,
+                  TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintInt32(val));
   }
-  void PrintUInt32(uint32 val, TextFormat::BaseTextGenerator* generator) const {
+  void PrintUInt32(uint32_t val,
+                   TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintUInt32(val));
   }
-  void PrintInt64(int64 val, TextFormat::BaseTextGenerator* generator) const {
+  void PrintInt64(int64_t val,
+                  TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintInt64(val));
   }
-  void PrintUInt64(uint64 val, TextFormat::BaseTextGenerator* generator) const {
+  void PrintUInt64(uint64_t val,
+                   TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintUInt64(val));
   }
-  void PrintFloat(float val, TextFormat::BaseTextGenerator* generator) const {
+  void PrintFloat(float val,
+                  TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintFloat(val));
   }
-  void PrintDouble(double val, TextFormat::BaseTextGenerator* generator) const {
+  void PrintDouble(double val,
+                   TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintDouble(val));
   }
-  void PrintString(const string& val,
-                   TextFormat::BaseTextGenerator* generator) const {
+  void PrintString(const std::string& val,
+                   TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintString(val));
   }
-  void PrintBytes(const string& val,
-                  TextFormat::BaseTextGenerator* generator) const {
+  void PrintBytes(const std::string& val,
+                  TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintBytes(val));
   }
-  void PrintEnum(int32 val, const string& name,
-                 TextFormat::BaseTextGenerator* generator) const {
+  void PrintEnum(int32_t val, const std::string& name,
+                 TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintEnum(val, name));
   }
+  void PrintFieldName(const Message& message, int /*field_index*/,
+                      int /*field_count*/, const Reflection* reflection,
+                      const FieldDescriptor* field,
+                      TextFormat::BaseTextGenerator* generator) const override {
+    generator->PrintString(
+        delegate_->PrintFieldName(message, reflection, field));
+  }
   void PrintFieldName(const Message& message, const Reflection* reflection,
                       const FieldDescriptor* field,
-                      TextFormat::BaseTextGenerator* generator) const {
+                      TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(
         delegate_->PrintFieldName(message, reflection, field));
   }
-  void PrintMessageStart(const Message& message, int field_index,
-                         int field_count, bool single_line_mode,
-                         TextFormat::BaseTextGenerator* generator) const {
+  void PrintMessageStart(
+      const Message& message, int field_index, int field_count,
+      bool single_line_mode,
+      TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintMessageStart(
         message, field_index, field_count, single_line_mode));
   }
-  void PrintMessageEnd(const Message& message, int field_index, int field_count,
-                       bool single_line_mode,
-                       TextFormat::BaseTextGenerator* generator) const {
+  void PrintMessageEnd(
+      const Message& message, int field_index, int field_count,
+      bool single_line_mode,
+      TextFormat::BaseTextGenerator* generator) const override {
     generator->PrintString(delegate_->PrintMessageEnd(
         message, field_index, field_count, single_line_mode));
   }
 
  private:
-  google::protobuf::scoped_ptr<const TextFormat::FieldValuePrinter> delegate_;
-};
-
-// Our own specialization: for UTF8 escaped strings.
-class FastFieldValuePrinterUtf8Escaping
-    : public TextFormat::FastFieldValuePrinter {
- public:
-  void PrintString(const string& val,
-                   TextFormat::BaseTextGenerator* generator) const {
-    generator->PrintLiteral("\"");
-    generator->PrintString(strings::Utf8SafeCEscape(val));
-    generator->PrintLiteral("\"");
-  }
-  void PrintBytes(const string& val,
-                  TextFormat::BaseTextGenerator* generator) const {
-    return FastFieldValuePrinter::PrintString(val, generator);
-  }
+  std::unique_ptr<const TextFormat::FieldValuePrinter> delegate_;
 };
 
 }  // namespace
 
+const char* const TextFormat::Printer::kDoNotParse =
+    "DO NOT PARSE: fields may be stripped and missing.\n";
+
 TextFormat::Printer::Printer()
-  : initial_indent_level_(0),
-    single_line_mode_(false),
-    use_field_number_(false),
-    use_short_repeated_primitives_(false),
-    hide_unknown_fields_(false),
-    print_message_fields_in_index_order_(false),
-    expand_any_(false),
-    truncate_string_field_longer_than_(0LL) {
+    : initial_indent_level_(0),
+      single_line_mode_(false),
+      use_field_number_(false),
+      use_short_repeated_primitives_(false),
+      insert_silent_marker_(false),
+      hide_unknown_fields_(false),
+      print_message_fields_in_index_order_(false),
+      expand_any_(false),
+      truncate_string_field_longer_than_(0LL),
+      finder_(nullptr) {
   SetUseUtf8StringEscaping(false);
 }
 
-TextFormat::Printer::~Printer() {
-  STLDeleteValues(&custom_printers_);
-}
-
 void TextFormat::Printer::SetUseUtf8StringEscaping(bool as_utf8) {
   SetDefaultFieldValuePrinter(as_utf8 ? new FastFieldValuePrinterUtf8Escaping()
-                                      : new FastFieldValuePrinter());
+                                      : new DebugStringFieldValuePrinter());
 }
 
 void TextFormat::Printer::SetDefaultFieldValuePrinter(
@@ -1756,31 +2029,54 @@ void TextFormat::Printer::SetDefaultFieldValuePrinter(
 }
 
 bool TextFormat::Printer::RegisterFieldValuePrinter(
-    const FieldDescriptor* field,
-    const FieldValuePrinter* printer) {
-  if (field == NULL || printer == NULL) {
+    const FieldDescriptor* field, const FieldValuePrinter* printer) {
+  if (field == nullptr || printer == nullptr) {
     return false;
   }
-  FieldValuePrinterWrapper* const wrapper =
-      new FieldValuePrinterWrapper(NULL);
-  if (custom_printers_.insert(std::make_pair(field, wrapper)).second) {
+  std::unique_ptr<FieldValuePrinterWrapper> wrapper(
+      new FieldValuePrinterWrapper(nullptr));
+  auto pair = custom_printers_.insert(std::make_pair(field, nullptr));
+  if (pair.second) {
     wrapper->SetDelegate(printer);
+    pair.first->second = std::move(wrapper);
     return true;
   } else {
-    delete wrapper;
     return false;
   }
 }
 
 bool TextFormat::Printer::RegisterFieldValuePrinter(
     const FieldDescriptor* field, const FastFieldValuePrinter* printer) {
-  return field != NULL && printer != NULL &&
-         custom_printers_.insert(std::make_pair(field, printer)).second;
+  if (field == nullptr || printer == nullptr) {
+    return false;
+  }
+  auto pair = custom_printers_.insert(std::make_pair(field, nullptr));
+  if (pair.second) {
+    pair.first->second.reset(printer);
+    return true;
+  } else {
+    return false;
+  }
+}
+
+bool TextFormat::Printer::RegisterMessagePrinter(
+    const Descriptor* descriptor, const MessagePrinter* printer) {
+  if (descriptor == nullptr || printer == nullptr) {
+    return false;
+  }
+  auto pair =
+      custom_message_printers_.insert(std::make_pair(descriptor, nullptr));
+  if (pair.second) {
+    pair.first->second.reset(printer);
+    return true;
+  } else {
+    return false;
+  }
 }
 
 bool TextFormat::Printer::PrintToString(const Message& message,
-                                        string* output) const {
-  GOOGLE_DCHECK(output) << "output specified is NULL";
+                                        std::string* output) const {
+  GOOGLE_DCHECK(output) << "output specified is nullptr";
 
   output->clear();
   io::StringOutputStream output_stream(output);
@@ -1789,9 +2085,8 @@ bool TextFormat::Printer::PrintToString(const Message& message,
 }
 
 bool TextFormat::Printer::PrintUnknownFieldsToString(
-    const UnknownFieldSet& unknown_fields,
-    string* output) const {
-  GOOGLE_DCHECK(output) << "output specified is NULL";
+    const UnknownFieldSet& unknown_fields, std::string* output) const {
+  GOOGLE_DCHECK(output) << "output specified is nullptr";
 
   output->clear();
   io::StringOutputStream output_stream(output);
@@ -1800,7 +2095,7 @@ bool TextFormat::Printer::PrintUnknownFieldsToString(
 
 bool TextFormat::Printer::Print(const Message& message,
                                 io::ZeroCopyOutputStream* output) const {
-  TextGenerator generator(output, initial_indent_level_);
+  TextGenerator generator(output, insert_silent_marker_, initial_indent_level_);
 
   Print(message, &generator);
 
@@ -1808,12 +2103,16 @@ bool TextFormat::Printer::Print(const Message& message,
   return !generator.failed();
 }
 
+// Maximum recursion depth for heuristically printing out length-delimited
+// unknown fields as messages.
+static constexpr int kUnknownFieldRecursionLimit = 10;
+
 bool TextFormat::Printer::PrintUnknownFields(
     const UnknownFieldSet& unknown_fields,
     io::ZeroCopyOutputStream* output) const {
   TextGenerator generator(output, initial_indent_level_);
 
-  PrintUnknownFields(unknown_fields, &generator);
+  PrintUnknownFields(unknown_fields, &generator, kUnknownFieldRecursionLimit);
 
   // Output false if the generator failed internally.
   return !generator.failed();
@@ -1821,10 +2120,19 @@ bool TextFormat::Printer::PrintUnknownFields(
 
 namespace {
 // Comparison functor for sorting FieldDescriptors by field index.
+// Normal fields have higher precedence than extensions.
 struct FieldIndexSorter {
   bool operator()(const FieldDescriptor* left,
                   const FieldDescriptor* right) const {
-    return left->index() < right->index();
+    if (left->is_extension() && right->is_extension()) {
+      return left->number() < right->number();
+    } else if (left->is_extension()) {
+      return false;
+    } else if (right->is_extension()) {
+      return true;
+    } else {
+      return left->index() < right->index();
+    }
   }
 };
 
@@ -1842,24 +2150,26 @@ bool TextFormat::Printer::PrintAny(const Message& message,
   const Reflection* reflection = message.GetReflection();
 
   // Extract the full type name from the type_url field.
-  const string& type_url = reflection->GetString(message, type_url_field);
-  string full_type_name;
-  if (!internal::ParseAnyTypeUrl(type_url, &full_type_name)) {
+  const std::string& type_url = reflection->GetString(message, type_url_field);
+  std::string url_prefix;
+  std::string full_type_name;
+  if (!internal::ParseAnyTypeUrl(type_url, &url_prefix, &full_type_name)) {
     return false;
   }
 
   // Print the "value" in text.
-  const google::protobuf::Descriptor* value_descriptor =
-      message.GetDescriptor()->file()->pool()->FindMessageTypeByName(
-          full_type_name);
-  if (value_descriptor == NULL) {
-    GOOGLE_LOG(WARNING) << "Proto type " << type_url << " not found";
+  const Descriptor* value_descriptor =
+      finder_ ? finder_->FindAnyType(message, url_prefix, full_type_name)
+              : DefaultFinderFindAnyType(message, url_prefix, full_type_name);
+  if (value_descriptor == nullptr) {
+    GOOGLE_LOG(WARNING) << "Can't print proto content: proto type " << type_url
+                 << " not found";
     return false;
   }
   DynamicMessageFactory factory;
-  google::protobuf::scoped_ptr<google::protobuf::Message> value_message(
+  std::unique_ptr<Message> value_message(
       factory.GetPrototype(value_descriptor)->New());
-  string serialized_value = reflection->GetString(message, value_field);
+  std::string serialized_value = reflection->GetString(message, value_field);
   if (!value_message->ParseFromString(serialized_value)) {
     GOOGLE_LOG(WARNING) << type_url << ": failed to parse contents";
     return false;
@@ -1867,8 +2177,7 @@ bool TextFormat::Printer::PrintAny(const Message& message,
   generator->PrintLiteral("[");
   generator->PrintString(type_url);
   generator->PrintLiteral("]");
-  const FastFieldValuePrinter* printer = FindWithDefault(
-      custom_printers_, value_field, default_field_value_printer_.get());
+  const FastFieldValuePrinter* printer = GetFieldPrinter(value_field);
   printer->PrintMessageStart(message, -1, 0, single_line_mode_, generator);
   generator->Indent();
   Print(*value_message, generator);
@@ -1879,32 +2188,57 @@ bool TextFormat::Printer::PrintAny(const Message& message,
 
 void TextFormat::Printer::Print(const Message& message,
                                 TextGenerator* generator) const {
-  const Descriptor* descriptor = message.GetDescriptor();
   const Reflection* reflection = message.GetReflection();
+  if (!reflection) {
+    // This message does not provide any way to describe its structure.
+    // Parse it again in an UnknownFieldSet, and display this instead.
+    UnknownFieldSet unknown_fields;
+    {
+      std::string serialized = message.SerializeAsString();
+      io::ArrayInputStream input(serialized.data(), serialized.size());
+      unknown_fields.ParseFromZeroCopyStream(&input);
+    }
+    PrintUnknownFields(unknown_fields, generator, kUnknownFieldRecursionLimit);
+    return;
+  }
+  const Descriptor* descriptor = message.GetDescriptor();
+  auto itr = custom_message_printers_.find(descriptor);
+  if (itr != custom_message_printers_.end()) {
+    itr->second->Print(message, single_line_mode_, generator);
+    return;
+  }
   if (descriptor->full_name() == internal::kAnyFullTypeName && expand_any_ &&
       PrintAny(message, generator)) {
     return;
   }
   std::vector<const FieldDescriptor*> fields;
-  reflection->ListFields(message, &fields);
+  if (descriptor->options().map_entry()) {
+    fields.push_back(descriptor->field(0));
+    fields.push_back(descriptor->field(1));
+  } else {
+    reflection->ListFieldsOmitStripped(message, &fields);
+    if (reflection->IsMessageStripped(message.GetDescriptor())) {
+      generator->Print(kDoNotParse, std::strlen(kDoNotParse));
+    }
+  }
+
   if (print_message_fields_in_index_order_) {
     std::sort(fields.begin(), fields.end(), FieldIndexSorter());
   }
-  for (int i = 0; i < fields.size(); i++) {
-    PrintField(message, reflection, fields[i], generator);
+  for (const FieldDescriptor* field : fields) {
+    PrintField(message, reflection, field, generator);
   }
   if (!hide_unknown_fields_) {
-    PrintUnknownFields(reflection->GetUnknownFields(message), generator);
+    PrintUnknownFields(reflection->GetUnknownFields(message), generator,
+                       kUnknownFieldRecursionLimit);
   }
 }
 
-void TextFormat::Printer::PrintFieldValueToString(
-    const Message& message,
-    const FieldDescriptor* field,
-    int index,
-    string* output) const {
-
-  GOOGLE_DCHECK(output) << "output specified is NULL";
+void TextFormat::Printer::PrintFieldValueToString(const Message& message,
+                                                  const FieldDescriptor* field,
+                                                  int index,
+                                                  std::string* output) const {
+  GOOGLE_DCHECK(output) << "output specified is nullptr";
 
   output->clear();
   io::StringOutputStream output_stream(output);
@@ -1913,12 +2247,186 @@ void TextFormat::Printer::PrintFieldValueToString(
   PrintFieldValue(message, message.GetReflection(), field, index, &generator);
 }
 
+class MapEntryMessageComparator {
+ public:
+  explicit MapEntryMessageComparator(const Descriptor* descriptor)
+      : field_(descriptor->field(0)) {}
+
+  bool operator()(const Message* a, const Message* b) {
+    const Reflection* reflection = a->GetReflection();
+    switch (field_->cpp_type()) {
+      case FieldDescriptor::CPPTYPE_BOOL: {
+        bool first = reflection->GetBool(*a, field_);
+        bool second = reflection->GetBool(*b, field_);
+        return first < second;
+      }
+      case FieldDescriptor::CPPTYPE_INT32: {
+        int32_t first = reflection->GetInt32(*a, field_);
+        int32_t second = reflection->GetInt32(*b, field_);
+        return first < second;
+      }
+      case FieldDescriptor::CPPTYPE_INT64: {
+        int64_t first = reflection->GetInt64(*a, field_);
+        int64_t second = reflection->GetInt64(*b, field_);
+        return first < second;
+      }
+      case FieldDescriptor::CPPTYPE_UINT32: {
+        uint32_t first = reflection->GetUInt32(*a, field_);
+        uint32_t second = reflection->GetUInt32(*b, field_);
+        return first < second;
+      }
+      case FieldDescriptor::CPPTYPE_UINT64: {
+        uint64_t first = reflection->GetUInt64(*a, field_);
+        uint64_t second = reflection->GetUInt64(*b, field_);
+        return first < second;
+      }
+      case FieldDescriptor::CPPTYPE_STRING: {
+        std::string first = reflection->GetString(*a, field_);
+        std::string second = reflection->GetString(*b, field_);
+        return first < second;
+      }
+      default:
+        GOOGLE_LOG(DFATAL) << "Invalid key for map field.";
+        return true;
+    }
+  }
+
+ private:
+  const FieldDescriptor* field_;
+};
+
+namespace internal {
+class MapFieldPrinterHelper {
+ public:
+  // DynamicMapSorter::Sort cannot be used because it enfores syncing with
+  // repeated field.
+  static bool SortMap(const Message& message, const Reflection* reflection,
+                      const FieldDescriptor* field,
+                      std::vector<const Message*>* sorted_map_field);
+  static void CopyKey(const MapKey& key, Message* message,
+                      const FieldDescriptor* field_desc);
+  static void CopyValue(const MapValueRef& value, Message* message,
+                        const FieldDescriptor* field_desc);
+};
+
+// Returns true if elements contained in sorted_map_field need to be released.
+bool MapFieldPrinterHelper::SortMap(
+    const Message& message, const Reflection* reflection,
+    const FieldDescriptor* field,
+    std::vector<const Message*>* sorted_map_field) {
+  bool need_release = false;
+  const MapFieldBase& base = *reflection->GetMapData(message, field);
+
+  if (base.IsRepeatedFieldValid()) {
+    const RepeatedPtrField<Message>& map_field =
+        reflection->GetRepeatedPtrFieldInternal<Message>(message, field);
+    for (int i = 0; i < map_field.size(); ++i) {
+      sorted_map_field->push_back(
+          const_cast<RepeatedPtrField<Message>*>(&map_field)->Mutable(i));
+    }
+  } else {
+    // TODO(teboring): For performance, instead of creating map entry message
+    // for each element, just store map keys and sort them.
+    const Descriptor* map_entry_desc = field->message_type();
+    const Message* prototype =
+        reflection->GetMessageFactory()->GetPrototype(map_entry_desc);
+    for (MapIterator iter =
+             reflection->MapBegin(const_cast<Message*>(&message), field);
+         iter != reflection->MapEnd(const_cast<Message*>(&message), field);
+         ++iter) {
+      Message* map_entry_message = prototype->New();
+      CopyKey(iter.GetKey(), map_entry_message, map_entry_desc->field(0));
+      CopyValue(iter.GetValueRef(), map_entry_message,
+                map_entry_desc->field(1));
+      sorted_map_field->push_back(map_entry_message);
+    }
+    need_release = true;
+  }
+
+  MapEntryMessageComparator comparator(field->message_type());
+  std::stable_sort(sorted_map_field->begin(), sorted_map_field->end(),
+                   comparator);
+  return need_release;
+}
+
+void MapFieldPrinterHelper::CopyKey(const MapKey& key, Message* message,
+                                    const FieldDescriptor* field_desc) {
+  const Reflection* reflection = message->GetReflection();
+  switch (field_desc->cpp_type()) {
+    case FieldDescriptor::CPPTYPE_DOUBLE:
+    case FieldDescriptor::CPPTYPE_FLOAT:
+    case FieldDescriptor::CPPTYPE_ENUM:
+    case FieldDescriptor::CPPTYPE_MESSAGE:
+      GOOGLE_LOG(ERROR) << "Not supported.";
+      break;
+    case FieldDescriptor::CPPTYPE_STRING:
+      reflection->SetString(message, field_desc, key.GetStringValue());
+      return;
+    case FieldDescriptor::CPPTYPE_INT64:
+      reflection->SetInt64(message, field_desc, key.GetInt64Value());
+      return;
+    case FieldDescriptor::CPPTYPE_INT32:
+      reflection->SetInt32(message, field_desc, key.GetInt32Value());
+      return;
+    case FieldDescriptor::CPPTYPE_UINT64:
+      reflection->SetUInt64(message, field_desc, key.GetUInt64Value());
+      return;
+    case FieldDescriptor::CPPTYPE_UINT32:
+      reflection->SetUInt32(message, field_desc, key.GetUInt32Value());
+      return;
+    case FieldDescriptor::CPPTYPE_BOOL:
+      reflection->SetBool(message, field_desc, key.GetBoolValue());
+      return;
+  }
+}
+
+void MapFieldPrinterHelper::CopyValue(const MapValueRef& value,
+                                      Message* message,
+                                      const FieldDescriptor* field_desc) {
+  const Reflection* reflection = message->GetReflection();
+  switch (field_desc->cpp_type()) {
+    case FieldDescriptor::CPPTYPE_DOUBLE:
+      reflection->SetDouble(message, field_desc, value.GetDoubleValue());
+      return;
+    case FieldDescriptor::CPPTYPE_FLOAT:
+      reflection->SetFloat(message, field_desc, value.GetFloatValue());
+      return;
+    case FieldDescriptor::CPPTYPE_ENUM:
+      reflection->SetEnumValue(message, field_desc, value.GetEnumValue());
+      return;
+    case FieldDescriptor::CPPTYPE_MESSAGE: {
+      Message* sub_message = value.GetMessageValue().New();
+      sub_message->CopyFrom(value.GetMessageValue());
+      reflection->SetAllocatedMessage(message, sub_message, field_desc);
+      return;
+    }
+    case FieldDescriptor::CPPTYPE_STRING:
+      reflection->SetString(message, field_desc, value.GetStringValue());
+      return;
+    case FieldDescriptor::CPPTYPE_INT64:
+      reflection->SetInt64(message, field_desc, value.GetInt64Value());
+      return;
+    case FieldDescriptor::CPPTYPE_INT32:
+      reflection->SetInt32(message, field_desc, value.GetInt32Value());
+      return;
+    case FieldDescriptor::CPPTYPE_UINT64:
+      reflection->SetUInt64(message, field_desc, value.GetUInt64Value());
+      return;
+    case FieldDescriptor::CPPTYPE_UINT32:
+      reflection->SetUInt32(message, field_desc, value.GetUInt32Value());
+      return;
+    case FieldDescriptor::CPPTYPE_BOOL:
+      reflection->SetBool(message, field_desc, value.GetBoolValue());
+      return;
+  }
+}
+}  // namespace internal
+
 void TextFormat::Printer::PrintField(const Message& message,
                                      const Reflection* reflection,
                                      const FieldDescriptor* field,
                                      TextGenerator* generator) const {
-  if (use_short_repeated_primitives_ &&
-      field->is_repeated() &&
+  if (use_short_repeated_primitives_ && field->is_repeated() &&
       field->cpp_type() != FieldDescriptor::CPPTYPE_STRING &&
       field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) {
     PrintShortRepeatedField(message, reflection, field, generator);
@@ -1929,38 +2437,43 @@ void TextFormat::Printer::PrintField(const Message& message,
 
   if (field->is_repeated()) {
     count = reflection->FieldSize(message, field);
-  } else if (reflection->HasField(message, field)) {
+  } else if (reflection->HasField(message, field) ||
+             field->containing_type()->options().map_entry()) {
     count = 1;
   }
 
-  std::vector<const Message*> map_entries;
-  const bool is_map = field->is_map();
+  std::vector<const Message*> sorted_map_field;
+  bool need_release = false;
+  bool is_map = field->is_map();
   if (is_map) {
-    map_entries = DynamicMapSorter::Sort(message, count, reflection, field);
+    need_release = internal::MapFieldPrinterHelper::SortMap(
+        message, reflection, field, &sorted_map_field);
   }
 
   for (int j = 0; j < count; ++j) {
     const int field_index = field->is_repeated() ? j : -1;
 
-    PrintFieldName(message, reflection, field, generator);
+    PrintFieldName(message, field_index, count, reflection, field, generator);
 
     if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-      const FastFieldValuePrinter* printer = FindWithDefault(
-          custom_printers_, field, default_field_value_printer_.get());
+      const FastFieldValuePrinter* printer = GetFieldPrinter(field);
       const Message& sub_message =
           field->is_repeated()
-              ? (is_map ? *map_entries[j]
+              ? (is_map ? *sorted_map_field[j]
                         : reflection->GetRepeatedMessage(message, field, j))
               : reflection->GetMessage(message, field);
       printer->PrintMessageStart(sub_message, field_index, count,
                                  single_line_mode_, generator);
       generator->Indent();
-      Print(sub_message, generator);
+      if (!printer->PrintMessageContent(sub_message, field_index, count,
+                                        single_line_mode_, generator)) {
+        Print(sub_message, generator);
+      }
       generator->Outdent();
       printer->PrintMessageEnd(sub_message, field_index, count,
                                single_line_mode_, generator);
     } else {
-      generator->PrintLiteral(": ");
+      generator->PrintMaybeWithMarker(": ");
       // Write the field value.
       PrintFieldValue(message, reflection, field, field_index, generator);
       if (single_line_mode_) {
@@ -1970,16 +2483,22 @@ void TextFormat::Printer::PrintField(const Message& message,
       }
     }
   }
+
+  if (need_release) {
+    for (const Message* message_to_delete : sorted_map_field) {
+      delete message_to_delete;
+    }
+  }
 }
 
 void TextFormat::Printer::PrintShortRepeatedField(
     const Message& message, const Reflection* reflection,
     const FieldDescriptor* field, TextGenerator* generator) const {
   // Print primitive repeated field in short form.
-  PrintFieldName(message, reflection, field, generator);
-
   int size = reflection->FieldSize(message, field);
-  generator->PrintLiteral(": [");
+  PrintFieldName(message, /*field_index=*/-1, /*field_count=*/size, reflection,
+                 field, generator);
+  generator->PrintMaybeWithMarker(": ", "[");
   for (int i = 0; i < size; i++) {
     if (i > 0) generator->PrintLiteral(", ");
     PrintFieldValue(message, reflection, field, i, generator);
@@ -1992,19 +2511,20 @@ void TextFormat::Printer::PrintShortRepeatedField(
 }
 
 void TextFormat::Printer::PrintFieldName(const Message& message,
+                                         int field_index, int field_count,
                                          const Reflection* reflection,
                                          const FieldDescriptor* field,
                                          TextGenerator* generator) const {
   // if use_field_number_ is true, prints field number instead
   // of field name.
   if (use_field_number_) {
-    generator->PrintString(SimpleItoa(field->number()));
+    generator->PrintString(StrCat(field->number()));
     return;
   }
 
-  const FastFieldValuePrinter* printer = FindWithDefault(
-      custom_printers_, field, default_field_value_printer_.get());
-  printer->PrintFieldName(message, reflection, field, generator);
+  const FastFieldValuePrinter* printer = GetFieldPrinter(field);
+  printer->PrintFieldName(message, field_index, field_count, reflection, field,
+                          generator);
 }
 
 void TextFormat::Printer::PrintFieldValue(const Message& message,
@@ -2015,8 +2535,7 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
   GOOGLE_DCHECK(field->is_repeated() || (index == -1))
       << "Index must be -1 for non-repeated fields";
 
-  const FastFieldValuePrinter* printer = FindWithDefault(
-      custom_printers_, field, default_field_value_printer_.get());
+  const FastFieldValuePrinter* printer = GetFieldPrinter(field);
 
   switch (field->cpp_type()) {
 #define OUTPUT_FIELD(CPPTYPE, METHOD)                                \
@@ -2028,25 +2547,27 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
         generator);                                                  \
     break
 
-    OUTPUT_FIELD( INT32,  Int32);
-    OUTPUT_FIELD( INT64,  Int64);
+    OUTPUT_FIELD(INT32, Int32);
+    OUTPUT_FIELD(INT64, Int64);
     OUTPUT_FIELD(UINT32, UInt32);
     OUTPUT_FIELD(UINT64, UInt64);
-    OUTPUT_FIELD( FLOAT,  Float);
+    OUTPUT_FIELD(FLOAT, Float);
     OUTPUT_FIELD(DOUBLE, Double);
-    OUTPUT_FIELD(  BOOL,   Bool);
+    OUTPUT_FIELD(BOOL, Bool);
 #undef OUTPUT_FIELD
 
     case FieldDescriptor::CPPTYPE_STRING: {
-      string scratch;
-      const string& value = field->is_repeated()
-          ? reflection->GetRepeatedStringReference(
-              message, field, index, &scratch)
-          : reflection->GetStringReference(message, field, &scratch);
-      const string* value_to_print = &value;
-      string truncated_value;
+      std::string scratch;
+      const std::string& value =
+          field->is_repeated()
+              ? reflection->GetRepeatedStringReference(message, field, index,
+                                                       &scratch)
+              : reflection->GetStringReference(message, field, &scratch);
+      const std::string* value_to_print = &value;
+      std::string truncated_value;
       if (truncate_string_field_longer_than_ > 0 &&
-          truncate_string_field_longer_than_ < value.size()) {
+          static_cast<size_t>(truncate_string_field_longer_than_) <
+              value.size()) {
         truncated_value = value.substr(0, truncate_string_field_longer_than_) +
                           "...<truncated>...";
         value_to_print = &truncated_value;
@@ -2061,12 +2582,13 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
     }
 
     case FieldDescriptor::CPPTYPE_ENUM: {
-      int enum_value = field->is_repeated()
-          ? reflection->GetRepeatedEnumValue(message, field, index)
-          : reflection->GetEnumValue(message, field);
+      int enum_value =
+          field->is_repeated()
+              ? reflection->GetRepeatedEnumValue(message, field, index)
+              : reflection->GetEnumValue(message, field);
       const EnumValueDescriptor* enum_desc =
           field->enum_type()->FindValueByNumber(enum_value);
-      if (enum_desc != NULL) {
+      if (enum_desc != nullptr) {
         printer->PrintEnum(enum_value, enum_desc->name(), generator);
       } else {
         // Ordinarily, enum_desc should not be null, because proto2 has the
@@ -2075,16 +2597,15 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
         // it is possible for the user to force an unknown integer value.  So we
         // simply use the integer value itself as the enum value name in this
         // case.
-        printer->PrintEnum(enum_value, StringPrintf("%d", enum_value),
-                           generator);
+        printer->PrintEnum(enum_value, StrCat(enum_value), generator);
       }
       break;
     }
 
     case FieldDescriptor::CPPTYPE_MESSAGE:
       Print(field->is_repeated()
-            ? reflection->GetRepeatedMessage(message, field, index)
-            : reflection->GetMessage(message, field),
+                ? reflection->GetRepeatedMessage(message, field, index)
+                : reflection->GetMessage(message, field),
             generator);
       break;
   }
@@ -2096,59 +2617,43 @@ void TextFormat::Printer::PrintFieldValue(const Message& message,
 }
 
 /* static */ bool TextFormat::PrintUnknownFields(
-    const UnknownFieldSet& unknown_fields,
-    io::ZeroCopyOutputStream* output) {
+    const UnknownFieldSet& unknown_fields, io::ZeroCopyOutputStream* output) {
   return Printer().PrintUnknownFields(unknown_fields, output);
 }
 
-/* static */ bool TextFormat::PrintToString(
-    const Message& message, string* output) {
+/* static */ bool TextFormat::PrintToString(const Message& message,
+                                            std::string* output) {
   return Printer().PrintToString(message, output);
 }
 
 /* static */ bool TextFormat::PrintUnknownFieldsToString(
-    const UnknownFieldSet& unknown_fields, string* output) {
+    const UnknownFieldSet& unknown_fields, std::string* output) {
   return Printer().PrintUnknownFieldsToString(unknown_fields, output);
 }
 
 /* static */ void TextFormat::PrintFieldValueToString(
-    const Message& message,
-    const FieldDescriptor* field,
-    int index,
-    string* output) {
+    const Message& message, const FieldDescriptor* field, int index,
+    std::string* output) {
   return Printer().PrintFieldValueToString(message, field, index, output);
 }
 
 /* static */ bool TextFormat::ParseFieldValueFromString(
-    const string& input,
-    const FieldDescriptor* field,
-    Message* message) {
+    const std::string& input, const FieldDescriptor* field, Message* message) {
   return Parser().ParseFieldValueFromString(input, field, message);
 }
 
-// Prints an integer as hex with a fixed number of digits dependent on the
-// integer type.
-template<typename IntType>
-static string PaddedHex(IntType value) {
-  string result;
-  result.reserve(sizeof(value) * 2);
-  for (int i = sizeof(value) * 2 - 1; i >= 0; i--) {
-    result.push_back(int_to_hex_digit(value >> (i*4) & 0x0F));
-  }
-  return result;
-}
-
 void TextFormat::Printer::PrintUnknownFields(
-    const UnknownFieldSet& unknown_fields, TextGenerator* generator) const {
+    const UnknownFieldSet& unknown_fields, TextGenerator* generator,
+    int recursion_budget) const {
   for (int i = 0; i < unknown_fields.field_count(); i++) {
     const UnknownField& field = unknown_fields.field(i);
-    string field_number = SimpleItoa(field.number());
+    std::string field_number = StrCat(field.number());
 
     switch (field.type()) {
       case UnknownField::TYPE_VARINT:
         generator->PrintString(field_number);
-        generator->PrintLiteral(": ");
-        generator->PrintString(SimpleItoa(field.varint()));
+        generator->PrintMaybeWithMarker(": ");
+        generator->PrintString(StrCat(field.varint()));
         if (single_line_mode_) {
           generator->PrintLiteral(" ");
         } else {
@@ -2157,7 +2662,7 @@ void TextFormat::Printer::PrintUnknownFields(
         break;
       case UnknownField::TYPE_FIXED32: {
         generator->PrintString(field_number);
-        generator->PrintLiteral(": 0x");
+        generator->PrintMaybeWithMarker(": ", "0x");
         generator->PrintString(
             StrCat(strings::Hex(field.fixed32(), strings::ZERO_PAD_8)));
         if (single_line_mode_) {
@@ -2169,7 +2674,7 @@ void TextFormat::Printer::PrintUnknownFields(
       }
       case UnknownField::TYPE_FIXED64: {
         generator->PrintString(field_number);
-        generator->PrintLiteral(": 0x");
+        generator->PrintMaybeWithMarker(": ", "0x");
         generator->PrintString(
             StrCat(strings::Hex(field.fixed64(), strings::ZERO_PAD_16)));
         if (single_line_mode_) {
@@ -2181,18 +2686,26 @@ void TextFormat::Printer::PrintUnknownFields(
       }
       case UnknownField::TYPE_LENGTH_DELIMITED: {
         generator->PrintString(field_number);
-        const string& value = field.length_delimited();
+        const std::string& value = field.length_delimited();
+        // We create a CodedInputStream so that we can adhere to our recursion
+        // budget when we attempt to parse the data. UnknownFieldSet parsing is
+        // recursive because of groups.
+        io::CodedInputStream input_stream(
+            reinterpret_cast<const uint8_t*>(value.data()), value.size());
+        input_stream.SetRecursionLimit(recursion_budget);
         UnknownFieldSet embedded_unknown_fields;
-        if (!value.empty() && embedded_unknown_fields.ParseFromString(value)) {
+        if (!value.empty() && recursion_budget > 0 &&
+            embedded_unknown_fields.ParseFromCodedStream(&input_stream)) {
           // This field is parseable as a Message.
           // So it is probably an embedded message.
           if (single_line_mode_) {
-            generator->PrintLiteral(" { ");
+            generator->PrintMaybeWithMarker(" ", "{ ");
           } else {
-            generator->PrintLiteral(" {\n");
+            generator->PrintMaybeWithMarker(" ", "{\n");
             generator->Indent();
           }
-          PrintUnknownFields(embedded_unknown_fields, generator);
+          PrintUnknownFields(embedded_unknown_fields, generator,
+                             recursion_budget - 1);
           if (single_line_mode_) {
             generator->PrintLiteral("} ");
           } else {
@@ -2200,9 +2713,9 @@ void TextFormat::Printer::PrintUnknownFields(
             generator->PrintLiteral("}\n");
           }
         } else {
-          // This field is not parseable as a Message.
-          // So it is probably just a plain string.
-          generator->PrintLiteral(": \"");
+          // This field is not parseable as a Message (or we ran out of
+          // recursion budget). So it is probably just a plain string.
+          generator->PrintMaybeWithMarker(": ", "\"");
           generator->PrintString(CEscape(value));
           if (single_line_mode_) {
             generator->PrintLiteral("\" ");
@@ -2215,12 +2728,15 @@ void TextFormat::Printer::PrintUnknownFields(
       case UnknownField::TYPE_GROUP:
         generator->PrintString(field_number);
         if (single_line_mode_) {
-          generator->PrintLiteral(" { ");
+          generator->PrintMaybeWithMarker(" ", "{ ");
         } else {
-          generator->PrintLiteral(" {\n");
+          generator->PrintMaybeWithMarker(" ", "{\n");
           generator->Indent();
         }
-        PrintUnknownFields(field.group(), generator);
+        // For groups, we recurse without checking the budget. This is OK,
+        // because if the groups were too deeply nested then we would have
+        // already rejected the message when we originally parsed it.
+        PrintUnknownFields(field.group(), generator, recursion_budget - 1);
         if (single_line_mode_) {
           generator->PrintLiteral("} ");
         } else {
@@ -2234,3 +2750,5 @@ void TextFormat::Printer::PrintUnknownFields(
 
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index a20a68d..f2c8dc3 100644 (file)
@@ -40,9 +40,6 @@
 
 #include <map>
 #include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
 #include <string>
 #include <vector>
 
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/message_lite.h>
+#include <google/protobuf/port.h>
+
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
 
 namespace io {
-  class ErrorCollector;      // tokenizer.h
+class ErrorCollector;  // tokenizer.h
 }
 
-// This class implements protocol buffer text format.  Printing and parsing
-// protocol messages in text format is useful for debugging and human editing
-// of messages.
+// This class implements protocol buffer text format, colloquially known as text
+// proto.  Printing and parsing protocol messages in text format is useful for
+// debugging and human editing of messages.
 //
 // This class is really a namespace that contains only static methods.
-class LIBPROTOBUF_EXPORT TextFormat {
+class PROTOBUF_EXPORT TextFormat {
  public:
   // Outputs a textual representation of the given message to the given
   // output stream. Returns false if printing fails.
@@ -78,29 +82,34 @@ class LIBPROTOBUF_EXPORT TextFormat {
   // Like Print(), but outputs directly to a string.
   // Note: output will be cleared prior to printing, and will be left empty
   // even if printing fails. Returns false if printing fails.
-  static bool PrintToString(const Message& message, string* output);
+  static bool PrintToString(const Message& message, std::string* output);
 
-  // Like PrintUnknownFields(), but outputs directly to a string. Returns false
-  // if printing fails.
+  // Like PrintUnknownFields(), but outputs directly to a string. Returns
+  // false if printing fails.
   static bool PrintUnknownFieldsToString(const UnknownFieldSet& unknown_fields,
-                                         string* output);
+                                         std::string* output);
 
   // Outputs a textual representation of the value of the field supplied on
   // the message supplied. For non-repeated fields, an index of -1 must
   // be supplied. Note that this method will print the default value for a
   // field if it is not set.
   static void PrintFieldValueToString(const Message& message,
-                                      const FieldDescriptor* field,
-                                      int index,
-                                      string* output);
+                                      const FieldDescriptor* field, int index,
+                                      std::string* output);
 
-  class LIBPROTOBUF_EXPORT BaseTextGenerator {
+  class PROTOBUF_EXPORT BaseTextGenerator {
    public:
     virtual ~BaseTextGenerator();
+
+    virtual void Indent() {}
+    virtual void Outdent() {}
+    // Returns the current indentation size in characters.
+    virtual size_t GetCurrentIndentationSize() const { return 0; }
+
     // Print text to the output stream.
     virtual void Print(const char* text, size_t size) = 0;
 
-    void PrintString(const string& str) { Print(str.data(), str.size()); }
+    void PrintString(const std::string& str) { Print(str.data(), str.size()); }
 
     template <size_t n>
     void PrintLiteral(const char (&text)[n]) {
@@ -112,23 +121,27 @@ class LIBPROTOBUF_EXPORT TextFormat {
   // string representation.
   // You can derive from this FastFieldValuePrinter if you want to have fields
   // to be printed in a different way and register it at the Printer.
-  class LIBPROTOBUF_EXPORT FastFieldValuePrinter {
+  class PROTOBUF_EXPORT FastFieldValuePrinter {
    public:
     FastFieldValuePrinter();
     virtual ~FastFieldValuePrinter();
     virtual void PrintBool(bool val, BaseTextGenerator* generator) const;
-    virtual void PrintInt32(int32 val, BaseTextGenerator* generator) const;
-    virtual void PrintUInt32(uint32 val, BaseTextGenerator* generator) const;
-    virtual void PrintInt64(int64 val, BaseTextGenerator* generator) const;
-    virtual void PrintUInt64(uint64 val, BaseTextGenerator* generator) const;
+    virtual void PrintInt32(int32_t val, BaseTextGenerator* generator) const;
+    virtual void PrintUInt32(uint32_t val, BaseTextGenerator* generator) const;
+    virtual void PrintInt64(int64_t val, BaseTextGenerator* generator) const;
+    virtual void PrintUInt64(uint64_t val, BaseTextGenerator* generator) const;
     virtual void PrintFloat(float val, BaseTextGenerator* generator) const;
     virtual void PrintDouble(double val, BaseTextGenerator* generator) const;
-    virtual void PrintString(const string& val,
+    virtual void PrintString(const std::string& val,
                              BaseTextGenerator* generator) const;
-    virtual void PrintBytes(const string& val,
+    virtual void PrintBytes(const std::string& val,
                             BaseTextGenerator* generator) const;
-    virtual void PrintEnum(int32 val, const string& name,
+    virtual void PrintEnum(int32_t val, const std::string& name,
                            BaseTextGenerator* generator) const;
+    virtual void PrintFieldName(const Message& message, int field_index,
+                                int field_count, const Reflection* reflection,
+                                const FieldDescriptor* field,
+                                BaseTextGenerator* generator) const;
     virtual void PrintFieldName(const Message& message,
                                 const Reflection* reflection,
                                 const FieldDescriptor* field,
@@ -136,6 +149,14 @@ class LIBPROTOBUF_EXPORT TextFormat {
     virtual void PrintMessageStart(const Message& message, int field_index,
                                    int field_count, bool single_line_mode,
                                    BaseTextGenerator* generator) const;
+    // Allows to override the logic on how to print the content of a message.
+    // Return false to use the default printing logic. Note that it is legal for
+    // this function to print something and then return false to use the default
+    // content printing (although at that point it would behave similarly to
+    // PrintMessageStart).
+    virtual bool PrintMessageContent(const Message& message, int field_index,
+                                     int field_count, bool single_line_mode,
+                                     BaseTextGenerator* generator) const;
     virtual void PrintMessageEnd(const Message& message, int field_index,
                                  int field_count, bool single_line_mode,
                                  BaseTextGenerator* generator) const;
@@ -144,44 +165,85 @@ class LIBPROTOBUF_EXPORT TextFormat {
     GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FastFieldValuePrinter);
   };
 
-  class LIBPROTOBUF_EXPORT PROTOBUF_RUNTIME_DEPRECATED("Please use FastFieldValuePrinter")
-      FieldValuePrinter {
+  // Deprecated: please use FastFieldValuePrinter instead.
+  class PROTOBUF_EXPORT FieldValuePrinter {
    public:
     FieldValuePrinter();
     virtual ~FieldValuePrinter();
-    virtual string PrintBool(bool val) const;
-    virtual string PrintInt32(int32 val) const;
-    virtual string PrintUInt32(uint32 val) const;
-    virtual string PrintInt64(int64 val) const;
-    virtual string PrintUInt64(uint64 val) const;
-    virtual string PrintFloat(float val) const;
-    virtual string PrintDouble(double val) const;
-    virtual string PrintString(const string& val) const;
-    virtual string PrintBytes(const string& val) const;
-    virtual string PrintEnum(int32 val, const string& name) const;
-    virtual string PrintFieldName(const Message& message,
-                                  const Reflection* reflection,
-                                  const FieldDescriptor* field) const;
-    virtual string PrintMessageStart(const Message& message,
-                                     int field_index,
-                                     int field_count,
-                                     bool single_line_mode) const;
-    virtual string PrintMessageEnd(const Message& message,
-                                   int field_index,
-                                   int field_count,
-                                   bool single_line_mode) const;
+    virtual std::string PrintBool(bool val) const;
+    virtual std::string PrintInt32(int32_t val) const;
+    virtual std::string PrintUInt32(uint32_t val) const;
+    virtual std::string PrintInt64(int64_t val) const;
+    virtual std::string PrintUInt64(uint64_t val) const;
+    virtual std::string PrintFloat(float val) const;
+    virtual std::string PrintDouble(double val) const;
+    virtual std::string PrintString(const std::string& val) const;
+    virtual std::string PrintBytes(const std::string& val) const;
+    virtual std::string PrintEnum(int32_t val, const std::string& name) const;
+    virtual std::string PrintFieldName(const Message& message,
+                                       const Reflection* reflection,
+                                       const FieldDescriptor* field) const;
+    virtual std::string PrintMessageStart(const Message& message,
+                                          int field_index, int field_count,
+                                          bool single_line_mode) const;
+    virtual std::string PrintMessageEnd(const Message& message, int field_index,
+                                        int field_count,
+                                        bool single_line_mode) const;
 
    private:
     FastFieldValuePrinter delegate_;
     GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldValuePrinter);
   };
 
+  class PROTOBUF_EXPORT MessagePrinter {
+   public:
+    MessagePrinter() {}
+    virtual ~MessagePrinter() {}
+    virtual void Print(const Message& message, bool single_line_mode,
+                       BaseTextGenerator* generator) const = 0;
+
+   private:
+    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessagePrinter);
+  };
+
+  // Interface that Printers or Parsers can use to find extensions, or types
+  // referenced in Any messages.
+  class PROTOBUF_EXPORT Finder {
+   public:
+    virtual ~Finder();
+
+    // Try to find an extension of *message by fully-qualified field
+    // name.  Returns nullptr if no extension is known for this name or number.
+    // The base implementation uses the extensions already known by the message.
+    virtual const FieldDescriptor* FindExtension(Message* message,
+                                                 const std::string& name) const;
+
+    // Similar to FindExtension, but uses a Descriptor and the extension number
+    // instead of using a Message and the name when doing the look up.
+    virtual const FieldDescriptor* FindExtensionByNumber(
+        const Descriptor* descriptor, int number) const;
+
+    // Find the message type for an Any proto.
+    // Returns nullptr if no message is known for this name.
+    // The base implementation only accepts prefixes of type.googleprod.com/ or
+    // type.googleapis.com/, and searches the DescriptorPool of the parent
+    // message.
+    virtual const Descriptor* FindAnyType(const Message& message,
+                                          const std::string& prefix,
+                                          const std::string& name) const;
+
+    // Find the message factory for the given extension field. This can be used
+    // to generalize the Parser to add extension fields to a message in the same
+    // way as the "input" message for the Parser.
+    virtual MessageFactory* FindExtensionFactory(
+        const FieldDescriptor* field) const;
+  };
+
   // Class for those users which require more fine-grained control over how
   // a protobuffer message is printed out.
-  class LIBPROTOBUF_EXPORT Printer {
+  class PROTOBUF_EXPORT Printer {
    public:
     Printer();
-    ~Printer();
 
     // Like TextFormat::Print
     bool Print(const Message& message, io::ZeroCopyOutputStream* output) const;
@@ -189,15 +251,14 @@ class LIBPROTOBUF_EXPORT TextFormat {
     bool PrintUnknownFields(const UnknownFieldSet& unknown_fields,
                             io::ZeroCopyOutputStream* output) const;
     // Like TextFormat::PrintToString
-    bool PrintToString(const Message& message, string* output) const;
+    bool PrintToString(const Message& message, std::string* output) const;
     // Like TextFormat::PrintUnknownFieldsToString
     bool PrintUnknownFieldsToString(const UnknownFieldSet& unknown_fields,
-                                    string* output) const;
+                                    std::string* output) const;
     // Like TextFormat::PrintFieldValueToString
     void PrintFieldValueToString(const Message& message,
-                                 const FieldDescriptor* field,
-                                 int index,
-                                 string* output) const;
+                                 const FieldDescriptor* field, int index,
+                                 std::string* output) const;
 
     // Adjust the initial indent level of all output.  Each indent level is
     // equal to two spaces.
@@ -211,9 +272,7 @@ class LIBPROTOBUF_EXPORT TextFormat {
       single_line_mode_ = single_line_mode;
     }
 
-    bool IsInSingleLineMode() const {
-      return single_line_mode_;
-    }
+    bool IsInSingleLineMode() const { return single_line_mode_; }
 
     // If use_field_number is true, uses field number instead of field name.
     void SetUseFieldNumber(bool use_field_number) {
@@ -235,10 +294,12 @@ class LIBPROTOBUF_EXPORT TextFormat {
     // sequences. This will change the default FastFieldValuePrinter.
     void SetUseUtf8StringEscaping(bool as_utf8);
 
-    // Set the default (Fast)FieldValuePrinter that is used for all fields that
+    // Set the default FastFieldValuePrinter that is used for all fields that
     // don't have a field-specific printer registered.
     // Takes ownership of the printer.
     void SetDefaultFieldValuePrinter(const FastFieldValuePrinter* printer);
+
+    PROTOBUF_DEPRECATED_MSG("Please use FastFieldValuePrinter")
     void SetDefaultFieldValuePrinter(const FieldValuePrinter* printer);
 
     // Sets whether we want to hide unknown fields or not.
@@ -247,13 +308,13 @@ class LIBPROTOBUF_EXPORT TextFormat {
     // is useful to be able to print the message without unknown fields (e.g.
     // for the python protobuf version to maintain consistency between its pure
     // python and c++ implementations).
-    void SetHideUnknownFields(bool hide) {
-      hide_unknown_fields_ = hide;
-    }
+    void SetHideUnknownFields(bool hide) { hide_unknown_fields_ = hide; }
 
-    // If print_message_fields_in_index_order is true, print fields of a proto
-    // message using the order defined in source code instead of the field
-    // number. By default, use the field number order.
+    // If print_message_fields_in_index_order is true, fields of a proto message
+    // will be printed using the order defined in source code instead of the
+    // field number, extensions will be printed at the end of the message
+    // and their relative order is determined by the extension number.
+    // By default, use the field number order.
     void SetPrintMessageFieldsInIndexOrder(
         bool print_message_fields_in_index_order) {
       print_message_fields_in_index_order_ =
@@ -267,37 +328,64 @@ class LIBPROTOBUF_EXPORT TextFormat {
     // If expand==false, print Any using the default printer. The output will
     // look like
     //    type_url: "<type_url>"  value: "serialized_content"
-    void SetExpandAny(bool expand) {
-      expand_any_ = expand;
-    }
+    void SetExpandAny(bool expand) { expand_any_ = expand; }
 
-    // If non-zero, we truncate all string fields that are  longer than this
-    // threshold.  This is useful when the proto message has very long strings,
-    // e.g., dump of encoded image file.
+    // Set how parser finds message for Any payloads.
+    void SetFinder(const Finder* finder) { finder_ = finder; }
+
+    // If non-zero, we truncate all string fields that are  longer than
+    // this threshold.  This is useful when the proto message has very long
+    // strings, e.g., dump of encoded image file.
     //
     // NOTE(hfgong):  Setting a non-zero value breaks round-trip safe
     // property of TextFormat::Printer.  That is, from the printed message, we
     // cannot fully recover the original string field any more.
     void SetTruncateStringFieldLongerThan(
-        const int64 truncate_string_field_longer_than) {
+        const int64_t truncate_string_field_longer_than) {
       truncate_string_field_longer_than_ = truncate_string_field_longer_than;
     }
 
-    // Register a custom field-specific (Fast)FieldValuePrinter for fields
+    // Register a custom field-specific FastFieldValuePrinter for fields
     // with a particular FieldDescriptor.
     // Returns "true" if the registration succeeded, or "false", if there is
     // already a printer for that FieldDescriptor.
     // Takes ownership of the printer on successful registration.
     bool RegisterFieldValuePrinter(const FieldDescriptor* field,
-                                   const FieldValuePrinter* printer);
-    bool RegisterFieldValuePrinter(const FieldDescriptor* field,
                                    const FastFieldValuePrinter* printer);
 
+    PROTOBUF_DEPRECATED_MSG("Please use FastFieldValuePrinter")
+    bool RegisterFieldValuePrinter(const FieldDescriptor* field,
+                                   const FieldValuePrinter* printer);
+
+    // Register a custom message-specific MessagePrinter for messages with a
+    // particular Descriptor.
+    // Returns "true" if the registration succeeded, or "false" if there is
+    // already a printer for that Descriptor.
+    bool RegisterMessagePrinter(const Descriptor* descriptor,
+                                const MessagePrinter* printer);
+
    private:
+    friend std::string Message::DebugString() const;
+    friend std::string Message::ShortDebugString() const;
+    friend std::string Message::Utf8DebugString() const;
+
+    // Sets whether *DebugString should insert a silent marker.
+    void SetInsertSilentMarker(bool v) { insert_silent_marker_ = v; }
+
     // Forward declaration of an internal class used to print the text
     // output to the OutputStream (see text_format.cc for implementation).
     class TextGenerator;
 
+    // Forward declaration of an internal class used to print field values for
+    // DebugString APIs (see text_format.cc for implementation).
+    class DebugStringFieldValuePrinter;
+
+    // Forward declaration of an internal class used to print UTF-8 escaped
+    // strings (see text_format.cc for implementation).
+    class FastFieldValuePrinterUtf8Escaping;
+
+    static const char* const kDoNotParse;
+
     // Internal Print method, used for writing to the OutputStream via
     // the TextGenerator class.
     void Print(const Message& message, TextGenerator* generator) const;
@@ -315,7 +403,8 @@ class LIBPROTOBUF_EXPORT TextFormat {
 
     // Print the name of a field -- i.e. everything that comes before the
     // ':' for a single name/value pair.
-    void PrintFieldName(const Message& message, const Reflection* reflection,
+    void PrintFieldName(const Message& message, int field_index,
+                        int field_count, const Reflection* reflection,
                         const FieldDescriptor* field,
                         TextGenerator* generator) const;
 
@@ -327,32 +416,41 @@ class LIBPROTOBUF_EXPORT TextFormat {
 
     // Print the fields in an UnknownFieldSet.  They are printed by tag number
     // only.  Embedded messages are heuristically identified by attempting to
-    // parse them.
+    // parse them (subject to the recursion budget).
     void PrintUnknownFields(const UnknownFieldSet& unknown_fields,
-                            TextGenerator* generator) const;
+                            TextGenerator* generator,
+                            int recursion_budget) const;
 
     bool PrintAny(const Message& message, TextGenerator* generator) const;
 
-    int initial_indent_level_;
+    const FastFieldValuePrinter* GetFieldPrinter(
+        const FieldDescriptor* field) const {
+      auto it = custom_printers_.find(field);
+      return it == custom_printers_.end() ? default_field_value_printer_.get()
+                                          : it->second.get();
+    }
 
+    int initial_indent_level_;
     bool single_line_mode_;
-
     bool use_field_number_;
-
     bool use_short_repeated_primitives_;
-
+    bool insert_silent_marker_;
     bool hide_unknown_fields_;
-
     bool print_message_fields_in_index_order_;
-
     bool expand_any_;
+    int64_t truncate_string_field_longer_than_;
 
-    int64 truncate_string_field_longer_than_;
-
-    google::protobuf::scoped_ptr<const FastFieldValuePrinter> default_field_value_printer_;
-    typedef std::map<const FieldDescriptor*, const FastFieldValuePrinter*>
+    std::unique_ptr<const FastFieldValuePrinter> default_field_value_printer_;
+    typedef std::map<const FieldDescriptor*,
+                     std::unique_ptr<const FastFieldValuePrinter>>
         CustomPrinterMap;
     CustomPrinterMap custom_printers_;
+
+    typedef std::map<const Descriptor*, std::unique_ptr<const MessagePrinter>>
+        CustomMessagePrinterMap;
+    CustomMessagePrinterMap custom_message_printers_;
+
+    const Finder* finder_;
   };
 
   // Parses a text-format protocol message from the given input stream to
@@ -372,35 +470,21 @@ class LIBPROTOBUF_EXPORT TextFormat {
   // google::protobuf::MessageLite::ParseFromString().
   static bool Parse(io::ZeroCopyInputStream* input, Message* output);
   // Like Parse(), but reads directly from a string.
-  static bool ParseFromString(const string& input, Message* output);
+  static bool ParseFromString(ConstStringParam input, Message* output);
 
   // Like Parse(), but the data is merged into the given message, as if
   // using Message::MergeFrom().
   static bool Merge(io::ZeroCopyInputStream* input, Message* output);
   // Like Merge(), but reads directly from a string.
-  static bool MergeFromString(const string& input, Message* output);
+  static bool MergeFromString(ConstStringParam input, Message* output);
 
   // Parse the given text as a single field value and store it into the
   // given field of the given message. If the field is a repeated field,
   // the new value will be added to the end
-  static bool ParseFieldValueFromString(const string& input,
+  static bool ParseFieldValueFromString(const std::string& input,
                                         const FieldDescriptor* field,
                                         Message* message);
 
-  // Interface that TextFormat::Parser can use to find extensions.
-  // This class may be extended in the future to find more information
-  // like fields, etc.
-  class LIBPROTOBUF_EXPORT Finder {
-   public:
-    virtual ~Finder();
-
-    // Try to find an extension of *message by fully-qualified field
-    // name.  Returns NULL if no extension is known for this name or number.
-    virtual const FieldDescriptor* FindExtension(
-        Message* message,
-        const string& name) const = 0;
-  };
-
   // A location in the parsed text.
   struct ParseLocation {
     int line;
@@ -411,17 +495,36 @@ class LIBPROTOBUF_EXPORT TextFormat {
         : line(line_param), column(column_param) {}
   };
 
+  // A range of locations in the parsed text, including `start` and excluding
+  // `end`.
+  struct ParseLocationRange {
+    ParseLocation start;
+    ParseLocation end;
+    ParseLocationRange() : start(), end() {}
+    ParseLocationRange(ParseLocation start_param, ParseLocation end_param)
+        : start(start_param), end(end_param) {}
+  };
+
   // Data structure which is populated with the locations of each field
   // value parsed from the text.
-  class LIBPROTOBUF_EXPORT ParseInfoTree {
+  class PROTOBUF_EXPORT ParseInfoTree {
    public:
-    ParseInfoTree();
-    ~ParseInfoTree();
-
-    // Returns the parse location for index-th value of the field in the parsed
-    // text. If none exists, returns a location with line = -1. Index should be
-    // -1 for not-repeated fields.
-    ParseLocation GetLocation(const FieldDescriptor* field, int index) const;
+    ParseInfoTree() = default;
+    ParseInfoTree(const ParseInfoTree&) = delete;
+    ParseInfoTree& operator=(const ParseInfoTree&) = delete;
+
+    // Returns the parse location range for index-th value of the field in
+    // the parsed text. If none exists, returns a location with start and end
+    // line -1. Index should be -1 for not-repeated fields.
+    ParseLocationRange GetLocationRange(const FieldDescriptor* field,
+                                        int index) const;
+
+    // Returns the starting parse location for index-th value of the field in
+    // the parsed text. If none exists, returns a location with line = -1. Index
+    // should be -1 for not-repeated fields.
+    ParseLocation GetLocation(const FieldDescriptor* field, int index) const {
+      return GetLocationRange(field, index).start;
+    }
 
     // Returns the parse info tree for the given field, which must be a message
     // type. The nested information tree is owned by the root tree and will be
@@ -433,29 +536,28 @@ class LIBPROTOBUF_EXPORT TextFormat {
     // Allow the text format parser to record information into the tree.
     friend class TextFormat;
 
-    // Records the starting location of a single value for a field.
-    void RecordLocation(const FieldDescriptor* field, ParseLocation location);
+    // Records the starting and ending locations of a single value for a field.
+    void RecordLocation(const FieldDescriptor* field, ParseLocationRange range);
 
     // Create and records a nested tree for a nested message field.
     ParseInfoTree* CreateNested(const FieldDescriptor* field);
 
     // Defines the map from the index-th field descriptor to its parse location.
-    typedef std::map<const FieldDescriptor*,
-                     std::vector<ParseLocation> > LocationMap;
+    typedef std::map<const FieldDescriptor*, std::vector<ParseLocationRange>>
+        LocationMap;
 
     // Defines the map from the index-th field descriptor to the nested parse
     // info tree.
     typedef std::map<const FieldDescriptor*,
-                     std::vector<ParseInfoTree*> > NestedMap;
+                     std::vector<std::unique_ptr<ParseInfoTree>>>
+        NestedMap;
 
     LocationMap locations_;
     NestedMap nested_;
-
-    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ParseInfoTree);
   };
 
   // For more control over parsing, use this class.
-  class LIBPROTOBUF_EXPORT Parser {
+  class PROTOBUF_EXPORT Parser {
    public:
     Parser();
     ~Parser();
@@ -463,36 +565,31 @@ class LIBPROTOBUF_EXPORT TextFormat {
     // Like TextFormat::Parse().
     bool Parse(io::ZeroCopyInputStream* input, Message* output);
     // Like TextFormat::ParseFromString().
-    bool ParseFromString(const string& input, Message* output);
+    bool ParseFromString(ConstStringParam input, Message* output);
     // Like TextFormat::Merge().
     bool Merge(io::ZeroCopyInputStream* input, Message* output);
     // Like TextFormat::MergeFromString().
-    bool MergeFromString(const string& input, Message* output);
+    bool MergeFromString(ConstStringParam input, Message* output);
 
-    // Set where to report parse errors.  If NULL (the default), errors will
+    // Set where to report parse errors.  If nullptr (the default), errors will
     // be printed to stderr.
     void RecordErrorsTo(io::ErrorCollector* error_collector) {
       error_collector_ = error_collector;
     }
 
-    // Set how parser finds extensions.  If NULL (the default), the
+    // Set how parser finds extensions.  If nullptr (the default), the
     // parser will use the standard Reflection object associated with
     // the message being parsed.
-    void SetFinder(Finder* finder) {
-      finder_ = finder;
-    }
+    void SetFinder(const Finder* finder) { finder_ = finder; }
 
-    // Sets where location information about the parse will be written. If NULL
+    // Sets where location information about the parse will be written. If
+    // nullptr
     // (the default), then no location will be written.
-    void WriteLocationsTo(ParseInfoTree* tree) {
-      parse_info_tree_ = tree;
-    }
+    void WriteLocationsTo(ParseInfoTree* tree) { parse_info_tree_ = tree; }
 
     // Normally parsing fails if, after parsing, output->IsInitialized()
     // returns false.  Call AllowPartialMessage(true) to skip this check.
-    void AllowPartialMessage(bool allow) {
-      allow_partial_ = allow;
-    }
+    void AllowPartialMessage(bool allow) { allow_partial_ = allow; }
 
     // Allow field names to be matched case-insensitively.
     // This is not advisable if there are fields that only differ in case, or
@@ -503,25 +600,31 @@ class LIBPROTOBUF_EXPORT TextFormat {
     }
 
     // Like TextFormat::ParseFieldValueFromString
-    bool ParseFieldValueFromString(const string& input,
+    bool ParseFieldValueFromString(const std::string& input,
                                    const FieldDescriptor* field,
                                    Message* output);
 
+    // When an unknown extension is met, parsing will fail if this option is
+    // set to false (the default). If true, unknown extensions will be ignored
+    // and a warning message will be generated.
+    // Beware! Setting this option true may hide some errors (e.g. spelling
+    // error on extension name).  This allows data loss; unlike binary format,
+    // text format cannot preserve unknown extensions.  Avoid using this option
+    // if possible.
+    void AllowUnknownExtension(bool allow) { allow_unknown_extension_ = allow; }
 
-    // backported from 3.8.0
     // When an unknown field is met, parsing will fail if this option is set
-    // to false(the default). If true, unknown fields will be ignored and
+    // to false (the default). If true, unknown fields will be ignored and
     // a warning message will be generated.
-    // Please aware that set this option true may hide some errors (e.g.
-    // spelling error on field name). Avoid to use this option if possible.
+    // Beware! Setting this option true may hide some errors (e.g. spelling
+    // error on field name). This allows data loss; unlike binary format, text
+    // format cannot preserve unknown fields.  Avoid using this option
+    // if possible.
     void AllowUnknownField(bool allow) { allow_unknown_field_ = allow; }
 
 
-    void AllowFieldNumber(bool allow) {
-      allow_field_number_ = allow;
-    }
+    void AllowFieldNumber(bool allow) { allow_field_number_ = allow; }
 
-    // backported from 3.8.0
     // Sets maximum recursion depth which parser can use. This is effectively
     // the maximum allowed nesting of proto messages.
     void SetRecursionLimit(int limit) { recursion_limit_ = limit; }
@@ -533,21 +636,21 @@ class LIBPROTOBUF_EXPORT TextFormat {
 
     // Like TextFormat::Merge().  The provided implementation is used
     // to do the parsing.
-    bool MergeUsingImpl(io::ZeroCopyInputStream* input,
-                        Message* output,
+    bool MergeUsingImpl(io::ZeroCopyInputStream* input, Message* output,
                         ParserImpl* parser_impl);
 
     io::ErrorCollector* error_collector_;
-    Finder* finder_;
+    const Finder* finder_;
     ParseInfoTree* parse_info_tree_;
     bool allow_partial_;
     bool allow_case_insensitive_field_;
     bool allow_unknown_field_;
+    bool allow_unknown_extension_;
     bool allow_unknown_enum_;
     bool allow_field_number_;
     bool allow_relaxed_whitespace_;
     bool allow_singular_overwrites_;
-    int recursion_limit_;  // backported from 3.8.0
+    int recursion_limit_;
   };
 
 
@@ -558,7 +661,7 @@ class LIBPROTOBUF_EXPORT TextFormat {
   // helpers for ParserImpl to call methods of ParseInfoTree.
   static inline void RecordLocation(ParseInfoTree* info_tree,
                                     const FieldDescriptor* field,
-                                    ParseLocation location);
+                                    ParseLocationRange location);
   static inline ParseInfoTree* CreateNested(ParseInfoTree* info_tree,
                                             const FieldDescriptor* field);
 
@@ -567,17 +670,18 @@ class LIBPROTOBUF_EXPORT TextFormat {
 
 inline void TextFormat::RecordLocation(ParseInfoTree* info_tree,
                                        const FieldDescriptor* field,
-                                       ParseLocation location) {
+                                       ParseLocationRange location) {
   info_tree->RecordLocation(field, location);
 }
 
-
 inline TextFormat::ParseInfoTree* TextFormat::CreateNested(
     ParseInfoTree* info_tree, const FieldDescriptor* field) {
   return info_tree->CreateNested(field);
 }
 
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_TEXT_FORMAT_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/timestamp.pb.cc b/3rdparty/protobuf/src/google/protobuf/timestamp.pb.cc
deleted file mode 100644 (file)
index 36e3bb3..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/timestamp.proto
-
-#include <google/protobuf/timestamp.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class TimestampDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_Timestamp_default_instance_;
-    new (ptr) ::google::protobuf::Timestamp();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::google::protobuf::Timestamp::InitAsDefaultInstance();
-}
-
-void InitDefaultsTimestamp() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTimestampImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[1];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::Timestamp, seconds_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Timestamp, nanos_),
-};
-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*>(&::google::protobuf::_Timestamp_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/timestamp.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "TimestampProtoP\001Z+github.com/golang/prot"
-      "obuf/ptypes/timestamp\370\001\001\242\002\003GPB\252\002\036Google."
-      "Protobuf.WellKnownTypesb\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 231);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/timestamp.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto
-namespace google {
-namespace protobuf {
-
-// ===================================================================
-
-void Timestamp::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Timestamp::kSecondsFieldNumber;
-const int Timestamp::kNanosFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Timestamp::Timestamp()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Timestamp)
-}
-Timestamp::Timestamp(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp)
-}
-Timestamp::Timestamp(const Timestamp& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::memcpy(&seconds_, &from.seconds_,
-    static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
-    reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Timestamp)
-}
-
-void Timestamp::SharedCtor() {
-  ::memset(&seconds_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&nanos_) -
-      reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
-  _cached_size_ = 0;
-}
-
-Timestamp::~Timestamp() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Timestamp)
-  SharedDtor();
-}
-
-void Timestamp::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void Timestamp::ArenaDtor(void* object) {
-  Timestamp* _this = reinterpret_cast< Timestamp* >(object);
-  (void)_this;
-}
-void Timestamp::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Timestamp::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Timestamp& Timestamp::default_instance() {
-  ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
-  return *internal_default_instance();
-}
-
-Timestamp* Timestamp::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Timestamp>(arena);
-}
-
-void Timestamp::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Timestamp)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  ::memset(&seconds_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&nanos_) -
-      reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
-  _internal_metadata_.Clear();
-}
-
-bool Timestamp::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.Timestamp)
-  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)) {
-      // int64 seconds = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &seconds_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // int32 nanos = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &nanos_)));
-        } 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.Timestamp)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Timestamp)
-  return false;
-#undef DO_
-}
-
-void Timestamp::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Timestamp)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int64 seconds = 1;
-  if (this->seconds() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(), output);
-  }
-
-  // int32 nanos = 2;
-  if (this->nanos() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Timestamp)
-}
-
-::google::protobuf::uint8* Timestamp::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int64 seconds = 1;
-  if (this->seconds() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->seconds(), target);
-  }
-
-  // int32 nanos = 2;
-  if (this->nanos() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Timestamp)
-  return target;
-}
-
-size_t Timestamp::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Timestamp)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // int64 seconds = 1;
-  if (this->seconds() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->seconds());
-  }
-
-  // int32 nanos = 2;
-  if (this->nanos() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->nanos());
-  }
-
-  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 Timestamp::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Timestamp)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Timestamp* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Timestamp>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Timestamp)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Timestamp)
-    MergeFrom(*source);
-  }
-}
-
-void Timestamp::MergeFrom(const Timestamp& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Timestamp)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.seconds() != 0) {
-    set_seconds(from.seconds());
-  }
-  if (from.nanos() != 0) {
-    set_nanos(from.nanos());
-  }
-}
-
-void Timestamp::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Timestamp)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Timestamp::CopyFrom(const Timestamp& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Timestamp)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Timestamp::IsInitialized() const {
-  return true;
-}
-
-void Timestamp::Swap(Timestamp* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Timestamp* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Timestamp::UnsafeArenaSwap(Timestamp* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Timestamp::InternalSwap(Timestamp* other) {
-  using std::swap;
-  swap(seconds_, other->seconds_);
-  swap(nanos_, other->nanos_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Timestamp::GetMetadata() const {
-  protobuf_google_2fprotobuf_2ftimestamp_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/timestamp.pb.h b/3rdparty/protobuf/src/google/protobuf/timestamp.pb.h
deleted file mode 100644 (file)
index 6c7136e..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/timestamp.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/unknown_field_set.h>
-// @@protoc_insertion_point(includes)
-
-namespace protobuf_google_2fprotobuf_2ftimestamp_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[1];
-  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 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 {
-
-// ===================================================================
-
-class LIBPROTOBUF_EXPORT Timestamp : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Timestamp) */ {
- public:
-  Timestamp();
-  virtual ~Timestamp();
-
-  Timestamp(const Timestamp& from);
-
-  inline Timestamp& operator=(const Timestamp& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Timestamp(Timestamp&& from) noexcept
-    : Timestamp() {
-    *this = ::std::move(from);
-  }
-
-  inline Timestamp& operator=(Timestamp&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void UnsafeArenaSwap(Timestamp* other);
-  void Swap(Timestamp* other);
-  friend void swap(Timestamp& a, Timestamp& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Timestamp* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Timestamp* 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 Timestamp& from);
-  void MergeFrom(const Timestamp& 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(Timestamp* other);
-  protected:
-  explicit Timestamp(::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 -------------------------------------------------------
-
-  // int64 seconds = 1;
-  void clear_seconds();
-  static const int kSecondsFieldNumber = 1;
-  ::google::protobuf::int64 seconds() const;
-  void set_seconds(::google::protobuf::int64 value);
-
-  // int32 nanos = 2;
-  void clear_nanos();
-  static const int kNanosFieldNumber = 2;
-  ::google::protobuf::int32 nanos() const;
-  void set_nanos(::google::protobuf::int32 value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Timestamp)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::int64 seconds_;
-  ::google::protobuf::int32 nanos_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestampImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// Timestamp
-
-// int64 seconds = 1;
-inline void Timestamp::clear_seconds() {
-  seconds_ = GOOGLE_LONGLONG(0);
-}
-inline ::google::protobuf::int64 Timestamp::seconds() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds)
-  return seconds_;
-}
-inline void Timestamp::set_seconds(::google::protobuf::int64 value) {
-  
-  seconds_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.seconds)
-}
-
-// int32 nanos = 2;
-inline void Timestamp::clear_nanos() {
-  nanos_ = 0;
-}
-inline ::google::protobuf::int32 Timestamp::nanos() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos)
-  return nanos_;
-}
-inline void Timestamp::set_nanos(::google::protobuf::int32 value) {
-  
-  nanos_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.nanos)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto__INCLUDED
diff --git a/3rdparty/protobuf/src/google/protobuf/type.pb.cc b/3rdparty/protobuf/src/google/protobuf/type.pb.cc
deleted file mode 100644 (file)
index 92f6589..0000000
+++ /dev/null
@@ -1,2844 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/type.proto
-
-#include <google/protobuf/type.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class TypeDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Type>
-      _instance;
-} _Type_default_instance_;
-class FieldDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Field>
-      _instance;
-} _Field_default_instance_;
-class EnumDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Enum>
-      _instance;
-} _Enum_default_instance_;
-class EnumValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<EnumValue>
-      _instance;
-} _EnumValue_default_instance_;
-class OptionDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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();
-}
-
-void InitDefaultsType() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTypeImpl);
-}
-
-void InitDefaultsFieldImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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();
-}
-
-void InitDefaultsField() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFieldImpl);
-}
-
-void InitDefaultsEnumImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  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();
-}
-
-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(::google::protobuf::Type, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  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(::google::protobuf::Field, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  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(::google::protobuf::Enum, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  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(::google::protobuf::EnumValue, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  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(::google::protobuf::Option, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  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_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*>(&::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_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/type.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, file_level_enum_descriptors, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "\014\n\004name\030\001 \001(\t\022&\n\006fields\030\002 \003(\0132\026.google.p"
-      "rotobuf.Field\022\016\n\006oneofs\030\003 \003(\t\022(\n\007options"
-      "\030\004 \003(\0132\027.google.protobuf.Option\0226\n\016sourc"
-      "e_context\030\005 \001(\0132\036.google.protobuf.Source"
-      "Context\022\'\n\006syntax\030\006 \001(\0162\027.google.protobu"
-      "f.Syntax\"\325\005\n\005Field\022)\n\004kind\030\001 \001(\0162\033.googl"
-      "e.protobuf.Field.Kind\0227\n\013cardinality\030\002 \001"
-      "(\0162\".google.protobuf.Field.Cardinality\022\016"
-      "\n\006number\030\003 \001(\005\022\014\n\004name\030\004 \001(\t\022\020\n\010type_url"
-      "\030\006 \001(\t\022\023\n\013oneof_index\030\007 \001(\005\022\016\n\006packed\030\010 "
-      "\001(\010\022(\n\007options\030\t \003(\0132\027.google.protobuf.O"
-      "ption\022\021\n\tjson_name\030\n \001(\t\022\025\n\rdefault_valu"
-      "e\030\013 \001(\t\"\310\002\n\004Kind\022\020\n\014TYPE_UNKNOWN\020\000\022\017\n\013TY"
-      "PE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTYPE_INT6"
-      "4\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT32\020\005\022\020\n\014"
-      "TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022\r\n\tTYPE"
-      "_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_GROUP\020\n"
-      "\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020\014\022\017\n\013TY"
-      "PE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYPE_SFIXE"
-      "D32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_SINT32\020"
-      "\021\022\017\n\013TYPE_SINT64\020\022\"t\n\013Cardinality\022\027\n\023CAR"
-      "DINALITY_UNKNOWN\020\000\022\030\n\024CARDINALITY_OPTION"
-      "AL\020\001\022\030\n\024CARDINALITY_REQUIRED\020\002\022\030\n\024CARDIN"
-      "ALITY_REPEATED\020\003\"\316\001\n\004Enum\022\014\n\004name\030\001 \001(\t\022"
-      "-\n\tenumvalue\030\002 \003(\0132\032.google.protobuf.Enu"
-      "mValue\022(\n\007options\030\003 \003(\0132\027.google.protobu"
-      "f.Option\0226\n\016source_context\030\004 \001(\0132\036.googl"
-      "e.protobuf.SourceContext\022\'\n\006syntax\030\005 \001(\016"
-      "2\027.google.protobuf.Syntax\"S\n\tEnumValue\022\014"
-      "\n\004name\030\001 \001(\t\022\016\n\006number\030\002 \001(\005\022(\n\007options\030"
-      "\003 \003(\0132\027.google.protobuf.Option\";\n\006Option"
-      "\022\014\n\004name\030\001 \001(\t\022#\n\005value\030\002 \001(\0132\024.google.p"
-      "rotobuf.Any*.\n\006Syntax\022\021\n\rSYNTAX_PROTO2\020\000"
-      "\022\021\n\rSYNTAX_PROTO3\020\001B}\n\023com.google.protob"
-      "ufB\tTypeProtoP\001Z/google.golang.org/genpr"
-      "oto/protobuf/ptype;ptype\370\001\001\242\002\003GPB\252\002\036Goog"
-      "le.Protobuf.WellKnownTypesb\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 1594);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/type.proto", &protobuf_RegisterTypes);
-  ::protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptors();
-  ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors();
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_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];
-}
-bool Field_Kind_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-    case 5:
-    case 6:
-    case 7:
-    case 8:
-    case 9:
-    case 10:
-    case 11:
-    case 12:
-    case 13:
-    case 14:
-    case 15:
-    case 16:
-    case 17:
-    case 18:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const Field_Kind Field::TYPE_UNKNOWN;
-const Field_Kind Field::TYPE_DOUBLE;
-const Field_Kind Field::TYPE_FLOAT;
-const Field_Kind Field::TYPE_INT64;
-const Field_Kind Field::TYPE_UINT64;
-const Field_Kind Field::TYPE_INT32;
-const Field_Kind Field::TYPE_FIXED64;
-const Field_Kind Field::TYPE_FIXED32;
-const Field_Kind Field::TYPE_BOOL;
-const Field_Kind Field::TYPE_STRING;
-const Field_Kind Field::TYPE_GROUP;
-const Field_Kind Field::TYPE_MESSAGE;
-const Field_Kind Field::TYPE_BYTES;
-const Field_Kind Field::TYPE_UINT32;
-const Field_Kind Field::TYPE_ENUM;
-const Field_Kind Field::TYPE_SFIXED32;
-const Field_Kind Field::TYPE_SFIXED64;
-const Field_Kind Field::TYPE_SINT32;
-const Field_Kind Field::TYPE_SINT64;
-const Field_Kind Field::Kind_MIN;
-const Field_Kind Field::Kind_MAX;
-const int Field::Kind_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* Field_Cardinality_descriptor() {
-  protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_enum_descriptors[1];
-}
-bool Field_Cardinality_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const Field_Cardinality Field::CARDINALITY_UNKNOWN;
-const Field_Cardinality Field::CARDINALITY_OPTIONAL;
-const Field_Cardinality Field::CARDINALITY_REQUIRED;
-const Field_Cardinality Field::CARDINALITY_REPEATED;
-const Field_Cardinality Field::Cardinality_MIN;
-const Field_Cardinality Field::Cardinality_MAX;
-const int Field::Cardinality_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* Syntax_descriptor() {
-  protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_enum_descriptors[2];
-}
-bool Syntax_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-
-// ===================================================================
-
-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());
-}
-void Type::unsafe_arena_set_allocated_source_context(
-    ::google::protobuf::SourceContext* source_context) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete source_context_;
-  }
-  source_context_ = source_context;
-  if (source_context) {
-    
-  } else {
-    
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Type.source_context)
-}
-void Type::clear_source_context() {
-  if (GetArenaNoVirtual() == NULL && source_context_ != NULL) {
-    delete source_context_;
-  }
-  source_context_ = NULL;
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Type::kNameFieldNumber;
-const int Type::kFieldsFieldNumber;
-const int Type::kOneofsFieldNumber;
-const int Type::kOptionsFieldNumber;
-const int Type::kSourceContextFieldNumber;
-const int Type::kSyntaxFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Type::Type()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsType();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Type)
-}
-Type::Type(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
-  fields_(arena),
-  oneofs_(arena),
-  options_(arena) {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsType();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Type)
-}
-Type::Type(const Type& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      fields_(from.fields_),
-      oneofs_(from.oneofs_),
-      options_(from.options_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_source_context()) {
-    source_context_ = new ::google::protobuf::SourceContext(*from.source_context_);
-  } else {
-    source_context_ = NULL;
-  }
-  syntax_ = from.syntax_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Type)
-}
-
-void Type::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&source_context_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&syntax_) -
-      reinterpret_cast<char*>(&source_context_)) + sizeof(syntax_));
-  _cached_size_ = 0;
-}
-
-Type::~Type() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Type)
-  SharedDtor();
-}
-
-void Type::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (this != internal_default_instance()) delete source_context_;
-}
-
-void Type::ArenaDtor(void* object) {
-  Type* _this = reinterpret_cast< Type* >(object);
-  (void)_this;
-}
-void Type::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Type::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Type& Type::default_instance() {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsType();
-  return *internal_default_instance();
-}
-
-Type* Type::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Type>(arena);
-}
-
-void Type::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Type)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  fields_.Clear();
-  oneofs_.Clear();
-  options_.Clear();
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  if (GetArenaNoVirtual() == NULL && source_context_ != NULL) {
-    delete source_context_;
-  }
-  source_context_ = NULL;
-  syntax_ = 0;
-  _internal_metadata_.Clear();
-}
-
-bool Type::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.Type)
-  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)) {
-      // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Type.name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Field fields = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_fields()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated string oneofs = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_oneofs()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->oneofs(this->oneofs_size() - 1).data(),
-            static_cast<int>(this->oneofs(this->oneofs_size() - 1).length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Type.oneofs"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Option options = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_options()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.SourceContext source_context = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_source_context()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.Syntax syntax = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_syntax(static_cast< ::google::protobuf::Syntax >(value));
-        } 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.Type)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Type)
-  return false;
-#undef DO_
-}
-
-void Type::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Type)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Type.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // repeated .google.protobuf.Field fields = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->fields_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->fields(static_cast<int>(i)), output);
-  }
-
-  // repeated string oneofs = 3;
-  for (int i = 0, n = this->oneofs_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->oneofs(i).data(), static_cast<int>(this->oneofs(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Type.oneofs");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      3, this->oneofs(i), output);
-  }
-
-  // repeated .google.protobuf.Option options = 4;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, this->options(static_cast<int>(i)), output);
-  }
-
-  // .google.protobuf.SourceContext source_context = 5;
-  if (this->has_source_context()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, *this->source_context_, output);
-  }
-
-  // .google.protobuf.Syntax syntax = 6;
-  if (this->syntax() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      6, this->syntax(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Type)
-}
-
-::google::protobuf::uint8* Type::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Type)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Type.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // repeated .google.protobuf.Field fields = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->fields_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->fields(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated string oneofs = 3;
-  for (int i = 0, n = this->oneofs_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->oneofs(i).data(), static_cast<int>(this->oneofs(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Type.oneofs");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(3, this->oneofs(i), target);
-  }
-
-  // repeated .google.protobuf.Option options = 4;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, this->options(static_cast<int>(i)), deterministic, target);
-  }
-
-  // .google.protobuf.SourceContext source_context = 5;
-  if (this->has_source_context()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, *this->source_context_, deterministic, target);
-  }
-
-  // .google.protobuf.Syntax syntax = 6;
-  if (this->syntax() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      6, this->syntax(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Type)
-  return target;
-}
-
-size_t Type::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Type)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // repeated .google.protobuf.Field fields = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->fields_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->fields(static_cast<int>(i)));
-    }
-  }
-
-  // repeated string oneofs = 3;
-  total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->oneofs_size());
-  for (int i = 0, n = this->oneofs_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->oneofs(i));
-  }
-
-  // repeated .google.protobuf.Option options = 4;
-  {
-    unsigned int count = static_cast<unsigned int>(this->options_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->options(static_cast<int>(i)));
-    }
-  }
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
-  }
-
-  // .google.protobuf.SourceContext source_context = 5;
-  if (this->has_source_context()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->source_context_);
-  }
-
-  // .google.protobuf.Syntax syntax = 6;
-  if (this->syntax() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->syntax());
-  }
-
-  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 Type::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Type)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Type* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Type>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Type)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Type)
-    MergeFrom(*source);
-  }
-}
-
-void Type::MergeFrom(const Type& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Type)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  fields_.MergeFrom(from.fields_);
-  oneofs_.MergeFrom(from.oneofs_);
-  options_.MergeFrom(from.options_);
-  if (from.name().size() > 0) {
-    set_name(from.name());
-  }
-  if (from.has_source_context()) {
-    mutable_source_context()->::google::protobuf::SourceContext::MergeFrom(from.source_context());
-  }
-  if (from.syntax() != 0) {
-    set_syntax(from.syntax());
-  }
-}
-
-void Type::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Type)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Type::CopyFrom(const Type& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Type)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Type::IsInitialized() const {
-  return true;
-}
-
-void Type::Swap(Type* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Type* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Type::UnsafeArenaSwap(Type* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Type::InternalSwap(Type* other) {
-  using std::swap;
-  fields_.InternalSwap(&other->fields_);
-  oneofs_.InternalSwap(&other->oneofs_);
-  options_.InternalSwap(&other->options_);
-  name_.Swap(&other->name_);
-  swap(source_context_, other->source_context_);
-  swap(syntax_, other->syntax_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Type::GetMetadata() const {
-  protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void Field::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Field::kKindFieldNumber;
-const int Field::kCardinalityFieldNumber;
-const int Field::kNumberFieldNumber;
-const int Field::kNameFieldNumber;
-const int Field::kTypeUrlFieldNumber;
-const int Field::kOneofIndexFieldNumber;
-const int Field::kPackedFieldNumber;
-const int Field::kOptionsFieldNumber;
-const int Field::kJsonNameFieldNumber;
-const int Field::kDefaultValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Field::Field()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsField();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Field)
-}
-Field::Field(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
-  options_(arena) {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsField();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Field)
-}
-Field::Field(const Field& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      options_(from.options_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.type_url().size() > 0) {
-    type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url(),
-      GetArenaNoVirtual());
-  }
-  json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.json_name().size() > 0) {
-    json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name(),
-      GetArenaNoVirtual());
-  }
-  default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.default_value().size() > 0) {
-    default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.default_value(),
-      GetArenaNoVirtual());
-  }
-  ::memcpy(&kind_, &from.kind_,
-    static_cast<size_t>(reinterpret_cast<char*>(&packed_) -
-    reinterpret_cast<char*>(&kind_)) + sizeof(packed_));
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Field)
-}
-
-void Field::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&kind_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&packed_) -
-      reinterpret_cast<char*>(&kind_)) + sizeof(packed_));
-  _cached_size_ = 0;
-}
-
-Field::~Field() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Field)
-  SharedDtor();
-}
-
-void Field::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  json_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  default_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void Field::ArenaDtor(void* object) {
-  Field* _this = reinterpret_cast< Field* >(object);
-  (void)_this;
-}
-void Field::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Field::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Field& Field::default_instance() {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsField();
-  return *internal_default_instance();
-}
-
-Field* Field::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Field>(arena);
-}
-
-void Field::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Field)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  options_.Clear();
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  type_url_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  ::memset(&kind_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&packed_) -
-      reinterpret_cast<char*>(&kind_)) + sizeof(packed_));
-  _internal_metadata_.Clear();
-}
-
-bool Field::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.Field)
-  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)) {
-      // .google.protobuf.Field.Kind kind = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_kind(static_cast< ::google::protobuf::Field_Kind >(value));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.Field.Cardinality cardinality = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_cardinality(static_cast< ::google::protobuf::Field_Cardinality >(value));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // int32 number = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &number_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string name = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Field.name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string type_url = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type_url()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->type_url().data(), static_cast<int>(this->type_url().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Field.type_url"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // int32 oneof_index = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &oneof_index_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // bool packed = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &packed_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Option options = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_options()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string json_name = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_json_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->json_name().data(), static_cast<int>(this->json_name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Field.json_name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // string default_value = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_default_value()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->default_value().data(), static_cast<int>(this->default_value().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Field.default_value"));
-        } 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.Field)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Field)
-  return false;
-#undef DO_
-}
-
-void Field::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Field)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // .google.protobuf.Field.Kind kind = 1;
-  if (this->kind() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->kind(), output);
-  }
-
-  // .google.protobuf.Field.Cardinality cardinality = 2;
-  if (this->cardinality() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      2, this->cardinality(), output);
-  }
-
-  // int32 number = 3;
-  if (this->number() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->number(), output);
-  }
-
-  // string name = 4;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Field.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->name(), output);
-  }
-
-  // string type_url = 6;
-  if (this->type_url().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type_url().data(), static_cast<int>(this->type_url().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Field.type_url");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      6, this->type_url(), output);
-  }
-
-  // int32 oneof_index = 7;
-  if (this->oneof_index() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->oneof_index(), output);
-  }
-
-  // bool packed = 8;
-  if (this->packed() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->packed(), output);
-  }
-
-  // repeated .google.protobuf.Option options = 9;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      9, this->options(static_cast<int>(i)), output);
-  }
-
-  // string json_name = 10;
-  if (this->json_name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->json_name().data(), static_cast<int>(this->json_name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Field.json_name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      10, this->json_name(), output);
-  }
-
-  // string default_value = 11;
-  if (this->default_value().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->default_value().data(), static_cast<int>(this->default_value().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Field.default_value");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      11, this->default_value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Field)
-}
-
-::google::protobuf::uint8* Field::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Field)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // .google.protobuf.Field.Kind kind = 1;
-  if (this->kind() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->kind(), target);
-  }
-
-  // .google.protobuf.Field.Cardinality cardinality = 2;
-  if (this->cardinality() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      2, this->cardinality(), target);
-  }
-
-  // int32 number = 3;
-  if (this->number() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->number(), target);
-  }
-
-  // string name = 4;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Field.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->name(), target);
-  }
-
-  // string type_url = 6;
-  if (this->type_url().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type_url().data(), static_cast<int>(this->type_url().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Field.type_url");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        6, this->type_url(), target);
-  }
-
-  // int32 oneof_index = 7;
-  if (this->oneof_index() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->oneof_index(), target);
-  }
-
-  // bool packed = 8;
-  if (this->packed() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->packed(), target);
-  }
-
-  // repeated .google.protobuf.Option options = 9;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        9, this->options(static_cast<int>(i)), deterministic, target);
-  }
-
-  // string json_name = 10;
-  if (this->json_name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->json_name().data(), static_cast<int>(this->json_name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Field.json_name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        10, this->json_name(), target);
-  }
-
-  // string default_value = 11;
-  if (this->default_value().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->default_value().data(), static_cast<int>(this->default_value().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Field.default_value");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        11, this->default_value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Field)
-  return target;
-}
-
-size_t Field::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Field)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // repeated .google.protobuf.Option options = 9;
-  {
-    unsigned int count = static_cast<unsigned int>(this->options_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->options(static_cast<int>(i)));
-    }
-  }
-
-  // string name = 4;
-  if (this->name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
-  }
-
-  // string type_url = 6;
-  if (this->type_url().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->type_url());
-  }
-
-  // string json_name = 10;
-  if (this->json_name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->json_name());
-  }
-
-  // string default_value = 11;
-  if (this->default_value().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->default_value());
-  }
-
-  // .google.protobuf.Field.Kind kind = 1;
-  if (this->kind() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->kind());
-  }
-
-  // .google.protobuf.Field.Cardinality cardinality = 2;
-  if (this->cardinality() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->cardinality());
-  }
-
-  // int32 number = 3;
-  if (this->number() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->number());
-  }
-
-  // int32 oneof_index = 7;
-  if (this->oneof_index() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->oneof_index());
-  }
-
-  // bool packed = 8;
-  if (this->packed() != 0) {
-    total_size += 1 + 1;
-  }
-
-  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 Field::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Field)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Field* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Field>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Field)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Field)
-    MergeFrom(*source);
-  }
-}
-
-void Field::MergeFrom(const Field& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Field)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  options_.MergeFrom(from.options_);
-  if (from.name().size() > 0) {
-    set_name(from.name());
-  }
-  if (from.type_url().size() > 0) {
-    set_type_url(from.type_url());
-  }
-  if (from.json_name().size() > 0) {
-    set_json_name(from.json_name());
-  }
-  if (from.default_value().size() > 0) {
-    set_default_value(from.default_value());
-  }
-  if (from.kind() != 0) {
-    set_kind(from.kind());
-  }
-  if (from.cardinality() != 0) {
-    set_cardinality(from.cardinality());
-  }
-  if (from.number() != 0) {
-    set_number(from.number());
-  }
-  if (from.oneof_index() != 0) {
-    set_oneof_index(from.oneof_index());
-  }
-  if (from.packed() != 0) {
-    set_packed(from.packed());
-  }
-}
-
-void Field::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Field)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Field::CopyFrom(const Field& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Field)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Field::IsInitialized() const {
-  return true;
-}
-
-void Field::Swap(Field* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Field* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Field::UnsafeArenaSwap(Field* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Field::InternalSwap(Field* other) {
-  using std::swap;
-  options_.InternalSwap(&other->options_);
-  name_.Swap(&other->name_);
-  type_url_.Swap(&other->type_url_);
-  json_name_.Swap(&other->json_name_);
-  default_value_.Swap(&other->default_value_);
-  swap(kind_, other->kind_);
-  swap(cardinality_, other->cardinality_);
-  swap(number_, other->number_);
-  swap(oneof_index_, other->oneof_index_);
-  swap(packed_, other->packed_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Field::GetMetadata() const {
-  protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-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());
-}
-void Enum::unsafe_arena_set_allocated_source_context(
-    ::google::protobuf::SourceContext* source_context) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete source_context_;
-  }
-  source_context_ = source_context;
-  if (source_context) {
-    
-  } else {
-    
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Enum.source_context)
-}
-void Enum::clear_source_context() {
-  if (GetArenaNoVirtual() == NULL && source_context_ != NULL) {
-    delete source_context_;
-  }
-  source_context_ = NULL;
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Enum::kNameFieldNumber;
-const int Enum::kEnumvalueFieldNumber;
-const int Enum::kOptionsFieldNumber;
-const int Enum::kSourceContextFieldNumber;
-const int Enum::kSyntaxFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Enum::Enum()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnum();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Enum)
-}
-Enum::Enum(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
-  enumvalue_(arena),
-  options_(arena) {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnum();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Enum)
-}
-Enum::Enum(const Enum& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      enumvalue_(from.enumvalue_),
-      options_(from.options_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_source_context()) {
-    source_context_ = new ::google::protobuf::SourceContext(*from.source_context_);
-  } else {
-    source_context_ = NULL;
-  }
-  syntax_ = from.syntax_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Enum)
-}
-
-void Enum::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&source_context_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&syntax_) -
-      reinterpret_cast<char*>(&source_context_)) + sizeof(syntax_));
-  _cached_size_ = 0;
-}
-
-Enum::~Enum() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Enum)
-  SharedDtor();
-}
-
-void Enum::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (this != internal_default_instance()) delete source_context_;
-}
-
-void Enum::ArenaDtor(void* object) {
-  Enum* _this = reinterpret_cast< Enum* >(object);
-  (void)_this;
-}
-void Enum::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Enum::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Enum& Enum::default_instance() {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnum();
-  return *internal_default_instance();
-}
-
-Enum* Enum::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Enum>(arena);
-}
-
-void Enum::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Enum)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  enumvalue_.Clear();
-  options_.Clear();
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  if (GetArenaNoVirtual() == NULL && source_context_ != NULL) {
-    delete source_context_;
-  }
-  source_context_ = NULL;
-  syntax_ = 0;
-  _internal_metadata_.Clear();
-}
-
-bool Enum::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.Enum)
-  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)) {
-      // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Enum.name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.EnumValue enumvalue = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_enumvalue()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Option options = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_options()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.SourceContext source_context = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_source_context()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.Syntax syntax = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_syntax(static_cast< ::google::protobuf::Syntax >(value));
-        } 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.Enum)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Enum)
-  return false;
-#undef DO_
-}
-
-void Enum::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Enum)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Enum.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // repeated .google.protobuf.EnumValue enumvalue = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->enumvalue_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->enumvalue(static_cast<int>(i)), output);
-  }
-
-  // repeated .google.protobuf.Option options = 3;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, this->options(static_cast<int>(i)), output);
-  }
-
-  // .google.protobuf.SourceContext source_context = 4;
-  if (this->has_source_context()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, *this->source_context_, output);
-  }
-
-  // .google.protobuf.Syntax syntax = 5;
-  if (this->syntax() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      5, this->syntax(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Enum)
-}
-
-::google::protobuf::uint8* Enum::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Enum)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Enum.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // repeated .google.protobuf.EnumValue enumvalue = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->enumvalue_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->enumvalue(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated .google.protobuf.Option options = 3;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, this->options(static_cast<int>(i)), deterministic, target);
-  }
-
-  // .google.protobuf.SourceContext source_context = 4;
-  if (this->has_source_context()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, *this->source_context_, deterministic, target);
-  }
-
-  // .google.protobuf.Syntax syntax = 5;
-  if (this->syntax() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      5, this->syntax(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Enum)
-  return target;
-}
-
-size_t Enum::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Enum)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // repeated .google.protobuf.EnumValue enumvalue = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->enumvalue_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->enumvalue(static_cast<int>(i)));
-    }
-  }
-
-  // repeated .google.protobuf.Option options = 3;
-  {
-    unsigned int count = static_cast<unsigned int>(this->options_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->options(static_cast<int>(i)));
-    }
-  }
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
-  }
-
-  // .google.protobuf.SourceContext source_context = 4;
-  if (this->has_source_context()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->source_context_);
-  }
-
-  // .google.protobuf.Syntax syntax = 5;
-  if (this->syntax() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->syntax());
-  }
-
-  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 Enum::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Enum)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Enum* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Enum>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Enum)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Enum)
-    MergeFrom(*source);
-  }
-}
-
-void Enum::MergeFrom(const Enum& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Enum)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  enumvalue_.MergeFrom(from.enumvalue_);
-  options_.MergeFrom(from.options_);
-  if (from.name().size() > 0) {
-    set_name(from.name());
-  }
-  if (from.has_source_context()) {
-    mutable_source_context()->::google::protobuf::SourceContext::MergeFrom(from.source_context());
-  }
-  if (from.syntax() != 0) {
-    set_syntax(from.syntax());
-  }
-}
-
-void Enum::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Enum)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Enum::CopyFrom(const Enum& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Enum)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Enum::IsInitialized() const {
-  return true;
-}
-
-void Enum::Swap(Enum* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Enum* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Enum::UnsafeArenaSwap(Enum* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Enum::InternalSwap(Enum* other) {
-  using std::swap;
-  enumvalue_.InternalSwap(&other->enumvalue_);
-  options_.InternalSwap(&other->options_);
-  name_.Swap(&other->name_);
-  swap(source_context_, other->source_context_);
-  swap(syntax_, other->syntax_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Enum::GetMetadata() const {
-  protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void EnumValue::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int EnumValue::kNameFieldNumber;
-const int EnumValue::kNumberFieldNumber;
-const int EnumValue::kOptionsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-EnumValue::EnumValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.EnumValue)
-}
-EnumValue::EnumValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
-  options_(arena) {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValue)
-}
-EnumValue::EnumValue(const EnumValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      options_(from.options_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  number_ = from.number_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumValue)
-}
-
-void EnumValue::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  number_ = 0;
-  _cached_size_ = 0;
-}
-
-EnumValue::~EnumValue() {
-  // @@protoc_insertion_point(destructor:google.protobuf.EnumValue)
-  SharedDtor();
-}
-
-void EnumValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void EnumValue::ArenaDtor(void* object) {
-  EnumValue* _this = reinterpret_cast< EnumValue* >(object);
-  (void)_this;
-}
-void EnumValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void EnumValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const EnumValue& EnumValue::default_instance() {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValue();
-  return *internal_default_instance();
-}
-
-EnumValue* EnumValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<EnumValue>(arena);
-}
-
-void EnumValue::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.EnumValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  options_.Clear();
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  number_ = 0;
-  _internal_metadata_.Clear();
-}
-
-bool EnumValue::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.EnumValue)
-  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)) {
-      // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.EnumValue.name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // int32 number = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &number_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .google.protobuf.Option options = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_options()));
-        } 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.EnumValue)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.EnumValue)
-  return false;
-#undef DO_
-}
-
-void EnumValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.EnumValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.EnumValue.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // int32 number = 2;
-  if (this->number() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->number(), output);
-  }
-
-  // repeated .google.protobuf.Option options = 3;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, this->options(static_cast<int>(i)), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValue)
-}
-
-::google::protobuf::uint8* EnumValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.EnumValue.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // int32 number = 2;
-  if (this->number() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->number(), target);
-  }
-
-  // repeated .google.protobuf.Option options = 3;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->options_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, this->options(static_cast<int>(i)), deterministic, target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValue)
-  return target;
-}
-
-size_t EnumValue::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumValue)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // repeated .google.protobuf.Option options = 3;
-  {
-    unsigned int count = static_cast<unsigned int>(this->options_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->options(static_cast<int>(i)));
-    }
-  }
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
-  }
-
-  // int32 number = 2;
-  if (this->number() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->number());
-  }
-
-  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 EnumValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const EnumValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const EnumValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumValue)
-    MergeFrom(*source);
-  }
-}
-
-void EnumValue::MergeFrom(const EnumValue& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  options_.MergeFrom(from.options_);
-  if (from.name().size() > 0) {
-    set_name(from.name());
-  }
-  if (from.number() != 0) {
-    set_number(from.number());
-  }
-}
-
-void EnumValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void EnumValue::CopyFrom(const EnumValue& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.EnumValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool EnumValue::IsInitialized() const {
-  return true;
-}
-
-void EnumValue::Swap(EnumValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    EnumValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void EnumValue::UnsafeArenaSwap(EnumValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void EnumValue::InternalSwap(EnumValue* other) {
-  using std::swap;
-  options_.InternalSwap(&other->options_);
-  name_.Swap(&other->name_);
-  swap(number_, other->number_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata EnumValue::GetMetadata() const {
-  protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-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());
-}
-void Option::unsafe_arena_set_allocated_value(
-    ::google::protobuf::Any* value) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete value_;
-  }
-  value_ = value;
-  if (value) {
-    
-  } else {
-    
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Option.value)
-}
-void Option::clear_value() {
-  if (GetArenaNoVirtual() == NULL && value_ != NULL) {
-    delete value_;
-  }
-  value_ = NULL;
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Option::kNameFieldNumber;
-const int Option::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Option::Option()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Option)
-}
-Option::Option(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Option)
-}
-Option::Option(const Option& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_value()) {
-    value_ = new ::google::protobuf::Any(*from.value_);
-  } else {
-    value_ = NULL;
-  }
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Option)
-}
-
-void Option::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  value_ = NULL;
-  _cached_size_ = 0;
-}
-
-Option::~Option() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Option)
-  SharedDtor();
-}
-
-void Option::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (this != internal_default_instance()) delete value_;
-}
-
-void Option::ArenaDtor(void* object) {
-  Option* _this = reinterpret_cast< Option* >(object);
-  (void)_this;
-}
-void Option::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Option::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Option& Option::default_instance() {
-  ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
-  return *internal_default_instance();
-}
-
-Option* Option::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Option>(arena);
-}
-
-void Option::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Option)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  if (GetArenaNoVirtual() == NULL && value_ != NULL) {
-    delete value_;
-  }
-  value_ = NULL;
-  _internal_metadata_.Clear();
-}
-
-bool Option::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.Option)
-  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)) {
-      // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.Option.name"));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // .google.protobuf.Any value = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_value()));
-        } 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.Option)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Option)
-  return false;
-#undef DO_
-}
-
-void Option::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Option)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Option.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // .google.protobuf.Any value = 2;
-  if (this->has_value()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->value_, output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Option)
-}
-
-::google::protobuf::uint8* Option::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Option)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.Option.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // .google.protobuf.Any value = 2;
-  if (this->has_value()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, *this->value_, deterministic, target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Option)
-  return target;
-}
-
-size_t Option::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Option)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // string name = 1;
-  if (this->name().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
-  }
-
-  // .google.protobuf.Any value = 2;
-  if (this->has_value()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->value_);
-  }
-
-  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 Option::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Option)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Option* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Option>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Option)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Option)
-    MergeFrom(*source);
-  }
-}
-
-void Option::MergeFrom(const Option& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Option)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.name().size() > 0) {
-    set_name(from.name());
-  }
-  if (from.has_value()) {
-    mutable_value()->::google::protobuf::Any::MergeFrom(from.value());
-  }
-}
-
-void Option::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Option)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Option::CopyFrom(const Option& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Option)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Option::IsInitialized() const {
-  return true;
-}
-
-void Option::Swap(Option* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Option* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Option::UnsafeArenaSwap(Option* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Option::InternalSwap(Option* other) {
-  using std::swap;
-  name_.Swap(&other->name_);
-  swap(value_, other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Option::GetMetadata() const {
-  protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/type.pb.h b/3rdparty/protobuf/src/google/protobuf/type.pb.h
deleted file mode 100644 (file)
index 8ee74a1..0000000
+++ /dev/null
@@ -1,2383 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/type.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2ftype_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2ftype_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/generated_enum_reflection.h>
-#include <google/protobuf/unknown_field_set.h>
-#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;
-class EnumDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern EnumDefaultTypeInternal _Enum_default_instance_;
-class EnumValue;
-class EnumValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern EnumValueDefaultTypeInternal _EnumValue_default_instance_;
-class Field;
-class FieldDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern FieldDefaultTypeInternal _Field_default_instance_;
-class Option;
-class OptionDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern OptionDefaultTypeInternal _Option_default_instance_;
-class Type;
-class TypeDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern TypeDefaultTypeInternal _Type_default_instance_;
-}  // namespace protobuf
-}  // namespace google
-namespace google {
-namespace protobuf {
-
-enum Field_Kind {
-  Field_Kind_TYPE_UNKNOWN = 0,
-  Field_Kind_TYPE_DOUBLE = 1,
-  Field_Kind_TYPE_FLOAT = 2,
-  Field_Kind_TYPE_INT64 = 3,
-  Field_Kind_TYPE_UINT64 = 4,
-  Field_Kind_TYPE_INT32 = 5,
-  Field_Kind_TYPE_FIXED64 = 6,
-  Field_Kind_TYPE_FIXED32 = 7,
-  Field_Kind_TYPE_BOOL = 8,
-  Field_Kind_TYPE_STRING = 9,
-  Field_Kind_TYPE_GROUP = 10,
-  Field_Kind_TYPE_MESSAGE = 11,
-  Field_Kind_TYPE_BYTES = 12,
-  Field_Kind_TYPE_UINT32 = 13,
-  Field_Kind_TYPE_ENUM = 14,
-  Field_Kind_TYPE_SFIXED32 = 15,
-  Field_Kind_TYPE_SFIXED64 = 16,
-  Field_Kind_TYPE_SINT32 = 17,
-  Field_Kind_TYPE_SINT64 = 18,
-  Field_Kind_Field_Kind_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
-  Field_Kind_Field_Kind_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
-};
-LIBPROTOBUF_EXPORT bool Field_Kind_IsValid(int value);
-const Field_Kind Field_Kind_Kind_MIN = Field_Kind_TYPE_UNKNOWN;
-const Field_Kind Field_Kind_Kind_MAX = Field_Kind_TYPE_SINT64;
-const int Field_Kind_Kind_ARRAYSIZE = Field_Kind_Kind_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* Field_Kind_descriptor();
-inline const ::std::string& Field_Kind_Name(Field_Kind value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    Field_Kind_descriptor(), value);
-}
-inline bool Field_Kind_Parse(
-    const ::std::string& name, Field_Kind* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<Field_Kind>(
-    Field_Kind_descriptor(), name, value);
-}
-enum Field_Cardinality {
-  Field_Cardinality_CARDINALITY_UNKNOWN = 0,
-  Field_Cardinality_CARDINALITY_OPTIONAL = 1,
-  Field_Cardinality_CARDINALITY_REQUIRED = 2,
-  Field_Cardinality_CARDINALITY_REPEATED = 3,
-  Field_Cardinality_Field_Cardinality_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
-  Field_Cardinality_Field_Cardinality_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
-};
-LIBPROTOBUF_EXPORT bool Field_Cardinality_IsValid(int value);
-const Field_Cardinality Field_Cardinality_Cardinality_MIN = Field_Cardinality_CARDINALITY_UNKNOWN;
-const Field_Cardinality Field_Cardinality_Cardinality_MAX = Field_Cardinality_CARDINALITY_REPEATED;
-const int Field_Cardinality_Cardinality_ARRAYSIZE = Field_Cardinality_Cardinality_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* Field_Cardinality_descriptor();
-inline const ::std::string& Field_Cardinality_Name(Field_Cardinality value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    Field_Cardinality_descriptor(), value);
-}
-inline bool Field_Cardinality_Parse(
-    const ::std::string& name, Field_Cardinality* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<Field_Cardinality>(
-    Field_Cardinality_descriptor(), name, value);
-}
-enum Syntax {
-  SYNTAX_PROTO2 = 0,
-  SYNTAX_PROTO3 = 1,
-  Syntax_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
-  Syntax_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
-};
-LIBPROTOBUF_EXPORT bool Syntax_IsValid(int value);
-const Syntax Syntax_MIN = SYNTAX_PROTO2;
-const Syntax Syntax_MAX = SYNTAX_PROTO3;
-const int Syntax_ARRAYSIZE = Syntax_MAX + 1;
-
-LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* Syntax_descriptor();
-inline const ::std::string& Syntax_Name(Syntax value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    Syntax_descriptor(), value);
-}
-inline bool Syntax_Parse(
-    const ::std::string& name, Syntax* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<Syntax>(
-    Syntax_descriptor(), name, value);
-}
-// ===================================================================
-
-class LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Type) */ {
- public:
-  Type();
-  virtual ~Type();
-
-  Type(const Type& from);
-
-  inline Type& operator=(const Type& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Type(Type&& from) noexcept
-    : Type() {
-    *this = ::std::move(from);
-  }
-
-  inline Type& operator=(Type&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void UnsafeArenaSwap(Type* other);
-  void Swap(Type* other);
-  friend void swap(Type& a, Type& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Type* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Type* 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 Type& from);
-  void MergeFrom(const Type& 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(Type* other);
-  protected:
-  explicit Type(::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 -------------------------------------------------------
-
-  // repeated .google.protobuf.Field fields = 2;
-  int fields_size() const;
-  void clear_fields();
-  static const int kFieldsFieldNumber = 2;
-  const ::google::protobuf::Field& fields(int index) const;
-  ::google::protobuf::Field* mutable_fields(int index);
-  ::google::protobuf::Field* add_fields();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >*
-      mutable_fields();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >&
-      fields() const;
-
-  // repeated string oneofs = 3;
-  int oneofs_size() const;
-  void clear_oneofs();
-  static const int kOneofsFieldNumber = 3;
-  const ::std::string& oneofs(int index) const;
-  ::std::string* mutable_oneofs(int index);
-  void set_oneofs(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_oneofs(int index, ::std::string&& value);
-  #endif
-  void set_oneofs(int index, const char* value);
-  void set_oneofs(int index, const char* value, size_t size);
-  ::std::string* add_oneofs();
-  void add_oneofs(const ::std::string& value);
-  #if LANG_CXX11
-  void add_oneofs(::std::string&& value);
-  #endif
-  void add_oneofs(const char* value);
-  void add_oneofs(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& oneofs() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_oneofs();
-
-  // repeated .google.protobuf.Option options = 4;
-  int options_size() const;
-  void clear_options();
-  static const int kOptionsFieldNumber = 4;
-  const ::google::protobuf::Option& options(int index) const;
-  ::google::protobuf::Option* mutable_options(int index);
-  ::google::protobuf::Option* add_options();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-      mutable_options();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-      options() const;
-
-  // string name = 1;
-  void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
-
-  // .google.protobuf.SourceContext source_context = 5;
-  bool has_source_context() const;
-  void clear_source_context();
-  static const int kSourceContextFieldNumber = 5;
-  private:
-  void _slow_mutable_source_context();
-  public:
-  const ::google::protobuf::SourceContext& source_context() const;
-  ::google::protobuf::SourceContext* release_source_context();
-  ::google::protobuf::SourceContext* mutable_source_context();
-  void set_allocated_source_context(::google::protobuf::SourceContext* source_context);
-  void unsafe_arena_set_allocated_source_context(
-      ::google::protobuf::SourceContext* source_context);
-  ::google::protobuf::SourceContext* unsafe_arena_release_source_context();
-
-  // .google.protobuf.Syntax syntax = 6;
-  void clear_syntax();
-  static const int kSyntaxFieldNumber = 6;
-  ::google::protobuf::Syntax syntax() const;
-  void set_syntax(::google::protobuf::Syntax value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Type)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field > fields_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> oneofs_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::SourceContext* source_context_;
-  int syntax_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsTypeImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Field) */ {
- public:
-  Field();
-  virtual ~Field();
-
-  Field(const Field& from);
-
-  inline Field& operator=(const Field& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Field(Field&& from) noexcept
-    : Field() {
-    *this = ::std::move(from);
-  }
-
-  inline Field& operator=(Field&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
-
-  void UnsafeArenaSwap(Field* other);
-  void Swap(Field* other);
-  friend void swap(Field& a, Field& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Field* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Field* 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 Field& from);
-  void MergeFrom(const Field& 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(Field* other);
-  protected:
-  explicit Field(::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 ----------------------------------------------------
-
-  typedef Field_Kind Kind;
-  static const Kind TYPE_UNKNOWN =
-    Field_Kind_TYPE_UNKNOWN;
-  static const Kind TYPE_DOUBLE =
-    Field_Kind_TYPE_DOUBLE;
-  static const Kind TYPE_FLOAT =
-    Field_Kind_TYPE_FLOAT;
-  static const Kind TYPE_INT64 =
-    Field_Kind_TYPE_INT64;
-  static const Kind TYPE_UINT64 =
-    Field_Kind_TYPE_UINT64;
-  static const Kind TYPE_INT32 =
-    Field_Kind_TYPE_INT32;
-  static const Kind TYPE_FIXED64 =
-    Field_Kind_TYPE_FIXED64;
-  static const Kind TYPE_FIXED32 =
-    Field_Kind_TYPE_FIXED32;
-  static const Kind TYPE_BOOL =
-    Field_Kind_TYPE_BOOL;
-  static const Kind TYPE_STRING =
-    Field_Kind_TYPE_STRING;
-  static const Kind TYPE_GROUP =
-    Field_Kind_TYPE_GROUP;
-  static const Kind TYPE_MESSAGE =
-    Field_Kind_TYPE_MESSAGE;
-  static const Kind TYPE_BYTES =
-    Field_Kind_TYPE_BYTES;
-  static const Kind TYPE_UINT32 =
-    Field_Kind_TYPE_UINT32;
-  static const Kind TYPE_ENUM =
-    Field_Kind_TYPE_ENUM;
-  static const Kind TYPE_SFIXED32 =
-    Field_Kind_TYPE_SFIXED32;
-  static const Kind TYPE_SFIXED64 =
-    Field_Kind_TYPE_SFIXED64;
-  static const Kind TYPE_SINT32 =
-    Field_Kind_TYPE_SINT32;
-  static const Kind TYPE_SINT64 =
-    Field_Kind_TYPE_SINT64;
-  static inline bool Kind_IsValid(int value) {
-    return Field_Kind_IsValid(value);
-  }
-  static const Kind Kind_MIN =
-    Field_Kind_Kind_MIN;
-  static const Kind Kind_MAX =
-    Field_Kind_Kind_MAX;
-  static const int Kind_ARRAYSIZE =
-    Field_Kind_Kind_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
-  Kind_descriptor() {
-    return Field_Kind_descriptor();
-  }
-  static inline const ::std::string& Kind_Name(Kind value) {
-    return Field_Kind_Name(value);
-  }
-  static inline bool Kind_Parse(const ::std::string& name,
-      Kind* value) {
-    return Field_Kind_Parse(name, value);
-  }
-
-  typedef Field_Cardinality Cardinality;
-  static const Cardinality CARDINALITY_UNKNOWN =
-    Field_Cardinality_CARDINALITY_UNKNOWN;
-  static const Cardinality CARDINALITY_OPTIONAL =
-    Field_Cardinality_CARDINALITY_OPTIONAL;
-  static const Cardinality CARDINALITY_REQUIRED =
-    Field_Cardinality_CARDINALITY_REQUIRED;
-  static const Cardinality CARDINALITY_REPEATED =
-    Field_Cardinality_CARDINALITY_REPEATED;
-  static inline bool Cardinality_IsValid(int value) {
-    return Field_Cardinality_IsValid(value);
-  }
-  static const Cardinality Cardinality_MIN =
-    Field_Cardinality_Cardinality_MIN;
-  static const Cardinality Cardinality_MAX =
-    Field_Cardinality_Cardinality_MAX;
-  static const int Cardinality_ARRAYSIZE =
-    Field_Cardinality_Cardinality_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
-  Cardinality_descriptor() {
-    return Field_Cardinality_descriptor();
-  }
-  static inline const ::std::string& Cardinality_Name(Cardinality value) {
-    return Field_Cardinality_Name(value);
-  }
-  static inline bool Cardinality_Parse(const ::std::string& name,
-      Cardinality* value) {
-    return Field_Cardinality_Parse(name, value);
-  }
-
-  // accessors -------------------------------------------------------
-
-  // repeated .google.protobuf.Option options = 9;
-  int options_size() const;
-  void clear_options();
-  static const int kOptionsFieldNumber = 9;
-  const ::google::protobuf::Option& options(int index) const;
-  ::google::protobuf::Option* mutable_options(int index);
-  ::google::protobuf::Option* add_options();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-      mutable_options();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-      options() const;
-
-  // string name = 4;
-  void clear_name();
-  static const int kNameFieldNumber = 4;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
-
-  // string type_url = 6;
-  void clear_type_url();
-  static const int kTypeUrlFieldNumber = 6;
-  const ::std::string& type_url() const;
-  void set_type_url(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type_url(::std::string&& value);
-  #endif
-  void set_type_url(const char* value);
-  void set_type_url(const char* value, size_t size);
-  ::std::string* mutable_type_url();
-  ::std::string* release_type_url();
-  void set_allocated_type_url(::std::string* type_url);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_type_url();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_type_url(
-      ::std::string* type_url);
-
-  // string json_name = 10;
-  void clear_json_name();
-  static const int kJsonNameFieldNumber = 10;
-  const ::std::string& json_name() const;
-  void set_json_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_json_name(::std::string&& value);
-  #endif
-  void set_json_name(const char* value);
-  void set_json_name(const char* value, size_t size);
-  ::std::string* mutable_json_name();
-  ::std::string* release_json_name();
-  void set_allocated_json_name(::std::string* json_name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_json_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_json_name(
-      ::std::string* json_name);
-
-  // string default_value = 11;
-  void clear_default_value();
-  static const int kDefaultValueFieldNumber = 11;
-  const ::std::string& default_value() const;
-  void set_default_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_default_value(::std::string&& value);
-  #endif
-  void set_default_value(const char* value);
-  void set_default_value(const char* value, size_t size);
-  ::std::string* mutable_default_value();
-  ::std::string* release_default_value();
-  void set_allocated_default_value(::std::string* default_value);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_default_value();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_default_value(
-      ::std::string* default_value);
-
-  // .google.protobuf.Field.Kind kind = 1;
-  void clear_kind();
-  static const int kKindFieldNumber = 1;
-  ::google::protobuf::Field_Kind kind() const;
-  void set_kind(::google::protobuf::Field_Kind value);
-
-  // .google.protobuf.Field.Cardinality cardinality = 2;
-  void clear_cardinality();
-  static const int kCardinalityFieldNumber = 2;
-  ::google::protobuf::Field_Cardinality cardinality() const;
-  void set_cardinality(::google::protobuf::Field_Cardinality value);
-
-  // int32 number = 3;
-  void clear_number();
-  static const int kNumberFieldNumber = 3;
-  ::google::protobuf::int32 number() const;
-  void set_number(::google::protobuf::int32 value);
-
-  // int32 oneof_index = 7;
-  void clear_oneof_index();
-  static const int kOneofIndexFieldNumber = 7;
-  ::google::protobuf::int32 oneof_index() const;
-  void set_oneof_index(::google::protobuf::int32 value);
-
-  // bool packed = 8;
-  void clear_packed();
-  static const int kPackedFieldNumber = 8;
-  bool packed() const;
-  void set_packed(bool value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Field)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr type_url_;
-  ::google::protobuf::internal::ArenaStringPtr json_name_;
-  ::google::protobuf::internal::ArenaStringPtr default_value_;
-  int kind_;
-  int cardinality_;
-  ::google::protobuf::int32 number_;
-  ::google::protobuf::int32 oneof_index_;
-  bool packed_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsFieldImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Enum : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Enum) */ {
- public:
-  Enum();
-  virtual ~Enum();
-
-  Enum(const Enum& from);
-
-  inline Enum& operator=(const Enum& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Enum(Enum&& from) noexcept
-    : Enum() {
-    *this = ::std::move(from);
-  }
-
-  inline Enum& operator=(Enum&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    2;
-
-  void UnsafeArenaSwap(Enum* other);
-  void Swap(Enum* other);
-  friend void swap(Enum& a, Enum& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Enum* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Enum* 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 Enum& from);
-  void MergeFrom(const Enum& 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(Enum* other);
-  protected:
-  explicit Enum(::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 -------------------------------------------------------
-
-  // repeated .google.protobuf.EnumValue enumvalue = 2;
-  int enumvalue_size() const;
-  void clear_enumvalue();
-  static const int kEnumvalueFieldNumber = 2;
-  const ::google::protobuf::EnumValue& enumvalue(int index) const;
-  ::google::protobuf::EnumValue* mutable_enumvalue(int index);
-  ::google::protobuf::EnumValue* add_enumvalue();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >*
-      mutable_enumvalue();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >&
-      enumvalue() const;
-
-  // repeated .google.protobuf.Option options = 3;
-  int options_size() const;
-  void clear_options();
-  static const int kOptionsFieldNumber = 3;
-  const ::google::protobuf::Option& options(int index) const;
-  ::google::protobuf::Option* mutable_options(int index);
-  ::google::protobuf::Option* add_options();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-      mutable_options();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-      options() const;
-
-  // string name = 1;
-  void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
-
-  // .google.protobuf.SourceContext source_context = 4;
-  bool has_source_context() const;
-  void clear_source_context();
-  static const int kSourceContextFieldNumber = 4;
-  private:
-  void _slow_mutable_source_context();
-  public:
-  const ::google::protobuf::SourceContext& source_context() const;
-  ::google::protobuf::SourceContext* release_source_context();
-  ::google::protobuf::SourceContext* mutable_source_context();
-  void set_allocated_source_context(::google::protobuf::SourceContext* source_context);
-  void unsafe_arena_set_allocated_source_context(
-      ::google::protobuf::SourceContext* source_context);
-  ::google::protobuf::SourceContext* unsafe_arena_release_source_context();
-
-  // .google.protobuf.Syntax syntax = 5;
-  void clear_syntax();
-  static const int kSyntaxFieldNumber = 5;
-  ::google::protobuf::Syntax syntax() const;
-  void set_syntax(::google::protobuf::Syntax value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Enum)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue > enumvalue_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::SourceContext* source_context_;
-  int syntax_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT EnumValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValue) */ {
- public:
-  EnumValue();
-  virtual ~EnumValue();
-
-  EnumValue(const EnumValue& from);
-
-  inline EnumValue& operator=(const EnumValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  EnumValue(EnumValue&& from) noexcept
-    : EnumValue() {
-    *this = ::std::move(from);
-  }
-
-  inline EnumValue& operator=(EnumValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    3;
-
-  void UnsafeArenaSwap(EnumValue* other);
-  void Swap(EnumValue* other);
-  friend void swap(EnumValue& a, EnumValue& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline EnumValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  EnumValue* 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 EnumValue& from);
-  void MergeFrom(const EnumValue& 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(EnumValue* other);
-  protected:
-  explicit EnumValue(::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 -------------------------------------------------------
-
-  // repeated .google.protobuf.Option options = 3;
-  int options_size() const;
-  void clear_options();
-  static const int kOptionsFieldNumber = 3;
-  const ::google::protobuf::Option& options(int index) const;
-  ::google::protobuf::Option* mutable_options(int index);
-  ::google::protobuf::Option* add_options();
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-      mutable_options();
-  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-      options() const;
-
-  // string name = 1;
-  void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
-
-  // int32 number = 2;
-  void clear_number();
-  static const int kNumberFieldNumber = 2;
-  ::google::protobuf::int32 number() const;
-  void set_number(::google::protobuf::int32 value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.EnumValue)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::int32 number_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Option : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Option) */ {
- public:
-  Option();
-  virtual ~Option();
-
-  Option(const Option& from);
-
-  inline Option& operator=(const Option& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Option(Option&& from) noexcept
-    : Option() {
-    *this = ::std::move(from);
-  }
-
-  inline Option& operator=(Option&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    4;
-
-  void UnsafeArenaSwap(Option* other);
-  void Swap(Option* other);
-  friend void swap(Option& a, Option& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Option* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Option* 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 Option& from);
-  void MergeFrom(const Option& 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(Option* other);
-  protected:
-  explicit Option(::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 -------------------------------------------------------
-
-  // string name = 1;
-  void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
-
-  // .google.protobuf.Any value = 2;
-  bool has_value() const;
-  void clear_value();
-  static const int kValueFieldNumber = 2;
-  private:
-  void _slow_mutable_value();
-  public:
-  const ::google::protobuf::Any& value() const;
-  ::google::protobuf::Any* release_value();
-  ::google::protobuf::Any* mutable_value();
-  void set_allocated_value(::google::protobuf::Any* value);
-  void unsafe_arena_set_allocated_value(
-      ::google::protobuf::Any* value);
-  ::google::protobuf::Any* unsafe_arena_release_value();
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Option)
- 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::ArenaStringPtr name_;
-  ::google::protobuf::Any* value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOptionImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// Type
-
-// string name = 1;
-inline void Type::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& Type::name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Type.name)
-  return name_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Type::mutable_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline ::std::string* Type::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Type.name)
-  
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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;
-inline int Type::fields_size() const {
-  return fields_.size();
-}
-inline void Type::clear_fields() {
-  fields_.Clear();
-}
-inline const ::google::protobuf::Field& Type::fields(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Type.fields)
-  return fields_.Get(index);
-}
-inline ::google::protobuf::Field* Type::mutable_fields(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.fields)
-  return fields_.Mutable(index);
-}
-inline ::google::protobuf::Field* Type::add_fields() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Type.fields)
-  return fields_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >*
-Type::mutable_fields() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.fields)
-  return &fields_;
-}
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >&
-Type::fields() const {
-  // @@protoc_insertion_point(field_list:google.protobuf.Type.fields)
-  return fields_;
-}
-
-// repeated string oneofs = 3;
-inline int Type::oneofs_size() const {
-  return oneofs_.size();
-}
-inline void Type::clear_oneofs() {
-  oneofs_.Clear();
-}
-inline const ::std::string& Type::oneofs(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Type.oneofs)
-  return oneofs_.Get(index);
-}
-inline ::std::string* Type::mutable_oneofs(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.oneofs)
-  return oneofs_.Mutable(index);
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Type::add_oneofs() {
-  // @@protoc_insertion_point(field_add_mutable:google.protobuf.Type.oneofs)
-  return oneofs_.Add();
-}
-inline void Type::add_oneofs(const ::std::string& value) {
-  oneofs_.Add()->assign(value);
-  // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs)
-}
-#if LANG_CXX11
-inline void Type::add_oneofs(::std::string&& value) {
-  oneofs_.Add(std::move(value));
-  // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs)
-}
-#endif
-inline 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)
-}
-inline 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)
-}
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
-Type::oneofs() const {
-  // @@protoc_insertion_point(field_list:google.protobuf.Type.oneofs)
-  return oneofs_;
-}
-inline ::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;
-inline int Type::options_size() const {
-  return options_.size();
-}
-inline void Type::clear_options() {
-  options_.Clear();
-}
-inline const ::google::protobuf::Option& Type::options(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Type.options)
-  return options_.Get(index);
-}
-inline ::google::protobuf::Option* Type::mutable_options(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.options)
-  return options_.Mutable(index);
-}
-inline ::google::protobuf::Option* Type::add_options() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Type.options)
-  return options_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-Type::mutable_options() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.options)
-  return &options_;
-}
-inline 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;
-inline bool Type::has_source_context() const {
-  return this != internal_default_instance() && source_context_ != NULL;
-}
-inline 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_);
-}
-inline ::google::protobuf::SourceContext* Type::release_source_context() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Type.source_context)
-  
-  ::google::protobuf::SourceContext* temp = source_context_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
-  }
-  source_context_ = NULL;
-  return temp;
-}
-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;
-}
-inline ::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_;
-}
-inline void Type::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_context_);
-  }
-  if (source_context) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      source_context = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, source_context, submessage_arena);
-    }
-    
-  } else {
-    
-  }
-  source_context_ = source_context;
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.source_context)
-}
-
-// .google.protobuf.Syntax syntax = 6;
-inline void Type::clear_syntax() {
-  syntax_ = 0;
-}
-inline ::google::protobuf::Syntax Type::syntax() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Type.syntax)
-  return static_cast< ::google::protobuf::Syntax >(syntax_);
-}
-inline void Type::set_syntax(::google::protobuf::Syntax value) {
-  
-  syntax_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Type.syntax)
-}
-
-// -------------------------------------------------------------------
-
-// Field
-
-// .google.protobuf.Field.Kind kind = 1;
-inline void Field::clear_kind() {
-  kind_ = 0;
-}
-inline ::google::protobuf::Field_Kind Field::kind() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.kind)
-  return static_cast< ::google::protobuf::Field_Kind >(kind_);
-}
-inline 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;
-inline void Field::clear_cardinality() {
-  cardinality_ = 0;
-}
-inline ::google::protobuf::Field_Cardinality Field::cardinality() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.cardinality)
-  return static_cast< ::google::protobuf::Field_Cardinality >(cardinality_);
-}
-inline void Field::set_cardinality(::google::protobuf::Field_Cardinality value) {
-  
-  cardinality_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Field.cardinality)
-}
-
-// int32 number = 3;
-inline void Field::clear_number() {
-  number_ = 0;
-}
-inline ::google::protobuf::int32 Field::number() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.number)
-  return number_;
-}
-inline void Field::set_number(::google::protobuf::int32 value) {
-  
-  number_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Field.number)
-}
-
-// string name = 4;
-inline void Field::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& Field::name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.name)
-  return name_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Field::mutable_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Field.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline ::std::string* Field::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Field.name)
-  
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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;
-inline void Field::clear_type_url() {
-  type_url_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& Field::type_url() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.type_url)
-  return type_url_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::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());
-}
-inline ::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());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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;
-inline void Field::clear_oneof_index() {
-  oneof_index_ = 0;
-}
-inline ::google::protobuf::int32 Field::oneof_index() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.oneof_index)
-  return oneof_index_;
-}
-inline 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;
-inline void Field::clear_packed() {
-  packed_ = false;
-}
-inline bool Field::packed() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.packed)
-  return packed_;
-}
-inline void Field::set_packed(bool value) {
-  
-  packed_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Field.packed)
-}
-
-// repeated .google.protobuf.Option options = 9;
-inline int Field::options_size() const {
-  return options_.size();
-}
-inline void Field::clear_options() {
-  options_.Clear();
-}
-inline const ::google::protobuf::Option& Field::options(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.options)
-  return options_.Get(index);
-}
-inline ::google::protobuf::Option* Field::mutable_options(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Field.options)
-  return options_.Mutable(index);
-}
-inline ::google::protobuf::Option* Field::add_options() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Field.options)
-  return options_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-Field::mutable_options() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Field.options)
-  return &options_;
-}
-inline 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;
-inline void Field::clear_json_name() {
-  json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& Field::json_name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.json_name)
-  return json_name_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::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());
-}
-inline ::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());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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;
-inline void Field::clear_default_value() {
-  default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& Field::default_value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Field.default_value)
-  return default_value_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::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());
-}
-inline ::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());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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)
-}
-
-// -------------------------------------------------------------------
-
-// Enum
-
-// string name = 1;
-inline void Enum::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& Enum::name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Enum.name)
-  return name_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Enum::mutable_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline ::std::string* Enum::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Enum.name)
-  
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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;
-inline int Enum::enumvalue_size() const {
-  return enumvalue_.size();
-}
-inline void Enum::clear_enumvalue() {
-  enumvalue_.Clear();
-}
-inline const ::google::protobuf::EnumValue& Enum::enumvalue(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Enum.enumvalue)
-  return enumvalue_.Get(index);
-}
-inline ::google::protobuf::EnumValue* Enum::mutable_enumvalue(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.enumvalue)
-  return enumvalue_.Mutable(index);
-}
-inline ::google::protobuf::EnumValue* Enum::add_enumvalue() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Enum.enumvalue)
-  return enumvalue_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >*
-Enum::mutable_enumvalue() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.enumvalue)
-  return &enumvalue_;
-}
-inline 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;
-inline int Enum::options_size() const {
-  return options_.size();
-}
-inline void Enum::clear_options() {
-  options_.Clear();
-}
-inline const ::google::protobuf::Option& Enum::options(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Enum.options)
-  return options_.Get(index);
-}
-inline ::google::protobuf::Option* Enum::mutable_options(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.options)
-  return options_.Mutable(index);
-}
-inline ::google::protobuf::Option* Enum::add_options() {
-  // @@protoc_insertion_point(field_add:google.protobuf.Enum.options)
-  return options_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-Enum::mutable_options() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.options)
-  return &options_;
-}
-inline 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;
-inline bool Enum::has_source_context() const {
-  return this != internal_default_instance() && source_context_ != NULL;
-}
-inline 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_);
-}
-inline ::google::protobuf::SourceContext* Enum::release_source_context() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Enum.source_context)
-  
-  ::google::protobuf::SourceContext* temp = source_context_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
-  }
-  source_context_ = NULL;
-  return temp;
-}
-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;
-}
-inline ::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_;
-}
-inline void Enum::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_context_);
-  }
-  if (source_context) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      source_context = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, source_context, submessage_arena);
-    }
-    
-  } else {
-    
-  }
-  source_context_ = source_context;
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.source_context)
-}
-
-// .google.protobuf.Syntax syntax = 5;
-inline void Enum::clear_syntax() {
-  syntax_ = 0;
-}
-inline ::google::protobuf::Syntax Enum::syntax() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Enum.syntax)
-  return static_cast< ::google::protobuf::Syntax >(syntax_);
-}
-inline void Enum::set_syntax(::google::protobuf::Syntax value) {
-  
-  syntax_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Enum.syntax)
-}
-
-// -------------------------------------------------------------------
-
-// EnumValue
-
-// string name = 1;
-inline void EnumValue::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& EnumValue::name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.name)
-  return name_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* EnumValue::mutable_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline ::std::string* EnumValue::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.EnumValue.name)
-  
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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;
-inline void EnumValue::clear_number() {
-  number_ = 0;
-}
-inline ::google::protobuf::int32 EnumValue::number() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.number)
-  return number_;
-}
-inline 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;
-inline int EnumValue::options_size() const {
-  return options_.size();
-}
-inline void EnumValue::clear_options() {
-  options_.Clear();
-}
-inline const ::google::protobuf::Option& EnumValue::options(int index) const {
-  // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.options)
-  return options_.Get(index);
-}
-inline ::google::protobuf::Option* EnumValue::mutable_options(int index) {
-  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.options)
-  return options_.Mutable(index);
-}
-inline ::google::protobuf::Option* EnumValue::add_options() {
-  // @@protoc_insertion_point(field_add:google.protobuf.EnumValue.options)
-  return options_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-EnumValue::mutable_options() {
-  // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValue.options)
-  return &options_;
-}
-inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-EnumValue::options() const {
-  // @@protoc_insertion_point(field_list:google.protobuf.EnumValue.options)
-  return options_;
-}
-
-// -------------------------------------------------------------------
-
-// Option
-
-// string name = 1;
-inline void Option::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& Option::name() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Option.name)
-  return name_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* Option::mutable_name() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Option.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline ::std::string* Option::release_name() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Option.name)
-  
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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;
-inline bool Option::has_value() const {
-  return this != internal_default_instance() && value_ != NULL;
-}
-inline 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_);
-}
-inline ::google::protobuf::Any* Option::release_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.Option.value)
-  
-  ::google::protobuf::Any* temp = value_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
-  }
-  value_ = NULL;
-  return temp;
-}
-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;
-}
-inline ::google::protobuf::Any* Option::mutable_value() {
-  
-  if (value_ == NULL) {
-    _slow_mutable_value();
-  }
-  // @@protoc_insertion_point(field_mutable:google.protobuf.Option.value)
-  return value_;
-}
-inline void Option::set_allocated_value(::google::protobuf::Any* value) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(value_);
-  }
-  if (value) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      value = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, value, submessage_arena);
-    }
-    
-  } else {
-    
-  }
-  value_ = value;
-  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.value)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-namespace google {
-namespace protobuf {
-
-template <> struct is_proto_enum< ::google::protobuf::Field_Kind> : ::google::protobuf::internal::true_type {};
-template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::Field_Kind>() {
-  return ::google::protobuf::Field_Kind_descriptor();
-}
-template <> struct is_proto_enum< ::google::protobuf::Field_Cardinality> : ::google::protobuf::internal::true_type {};
-template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::Field_Cardinality>() {
-  return ::google::protobuf::Field_Cardinality_descriptor();
-}
-template <> struct is_proto_enum< ::google::protobuf::Syntax> : ::google::protobuf::internal::true_type {};
-template <>
-inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::Syntax>() {
-  return ::google::protobuf::Syntax_descriptor();
-}
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2ftype_2eproto__INCLUDED
index 0ada85e..423f3e7 100644 (file)
 
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/parse_context.h>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/io/zero_copy_stream.h>
 #include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/generated_message_tctable_decl.h>
+#include <google/protobuf/generated_message_tctable_impl.h>
 #include <google/protobuf/wire_format.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/stubs/stl_util.h>
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 
-namespace {
-// This global instance is returned by unknown_fields() on any message class
-// when the object has no unknown fields. This is necessary because we now
-// instantiate the UnknownFieldSet dynamically only when required.
-UnknownFieldSet* default_unknown_field_set_instance_ = NULL;
-
-void DeleteDefaultUnknownFieldSet() {
-  delete default_unknown_field_set_instance_;
-}
-
-void InitDefaultUnknownFieldSet() {
-  default_unknown_field_set_instance_ = new UnknownFieldSet();
-  internal::OnShutdown(&DeleteDefaultUnknownFieldSet);
-}
-
-GOOGLE_PROTOBUF_DECLARE_ONCE(default_unknown_field_set_once_init_);
-}
-
-const UnknownFieldSet* UnknownFieldSet::default_instance() {
-  ::google::protobuf::GoogleOnceInit(&default_unknown_field_set_once_init_,
-                 &InitDefaultUnknownFieldSet);
-  return default_unknown_field_set_instance_;
+const UnknownFieldSet& UnknownFieldSet::default_instance() {
+  static auto instance = internal::OnShutdownDelete(new UnknownFieldSet());
+  return *instance;
 }
 
 void UnknownFieldSet::ClearFallback() {
-  GOOGLE_DCHECK(fields_ != NULL && fields_->size() > 0);
-  int n = fields_->size();
+  GOOGLE_DCHECK(!fields_.empty());
+  int n = fields_.size();
   do {
-    (*fields_)[--n].Delete();
+    (fields_)[--n].Delete();
   } while (n > 0);
-  delete fields_;
-  fields_ = NULL;
+  fields_.clear();
 }
 
 void UnknownFieldSet::InternalMergeFrom(const UnknownFieldSet& other) {
   int other_field_count = other.field_count();
   if (other_field_count > 0) {
-    fields_ = new std::vector<UnknownField>();
+    fields_.reserve(fields_.size() + other_field_count);
     for (int i = 0; i < other_field_count; i++) {
-      fields_->push_back((*other.fields_)[i]);
-      fields_->back().DeepCopy((*other.fields_)[i]);
+      fields_.push_back((other.fields_)[i]);
+      fields_.back().DeepCopy((other.fields_)[i]);
     }
   }
 }
@@ -94,10 +80,10 @@ void UnknownFieldSet::InternalMergeFrom(const UnknownFieldSet& other) {
 void UnknownFieldSet::MergeFrom(const UnknownFieldSet& other) {
   int other_field_count = other.field_count();
   if (other_field_count > 0) {
-    if (fields_ == NULL) fields_ = new std::vector<UnknownField>();
+    fields_.reserve(fields_.size() + other_field_count);
     for (int i = 0; i < other_field_count; i++) {
-      fields_->push_back((*other.fields_)[i]);
-      fields_->back().DeepCopy((*other.fields_)[i]);
+      fields_.push_back((other.fields_)[i]);
+      fields_.back().DeepCopy((other.fields_)[i]);
     }
   }
 }
@@ -105,36 +91,32 @@ void UnknownFieldSet::MergeFrom(const UnknownFieldSet& other) {
 // A specialized MergeFrom for performance when we are merging from an UFS that
 // is temporary and can be destroyed in the process.
 void UnknownFieldSet::MergeFromAndDestroy(UnknownFieldSet* other) {
-  int other_field_count = other->field_count();
-  if (other_field_count > 0) {
-    if (fields_ == NULL) fields_ = new std::vector<UnknownField>();
-    for (int i = 0; i < other_field_count; i++) {
-      fields_->push_back((*other->fields_)[i]);
-      (*other->fields_)[i].Reset();
-    }
+  if (fields_.empty()) {
+    fields_ = std::move(other->fields_);
+  } else {
+    fields_.insert(fields_.end(),
+                   std::make_move_iterator(other->fields_.begin()),
+                   std::make_move_iterator(other->fields_.end()));
   }
-  delete other->fields_;
-  other->fields_ = NULL;
+  other->fields_.clear();
 }
 
-void UnknownFieldSet::MergeToInternalMetdata(
-    const UnknownFieldSet& other,
-    internal::InternalMetadataWithArena* metadata) {
-  metadata->mutable_unknown_fields()->MergeFrom(other);
+void UnknownFieldSet::MergeToInternalMetadata(
+    const UnknownFieldSet& other, internal::InternalMetadata* metadata) {
+  metadata->mutable_unknown_fields<UnknownFieldSet>()->MergeFrom(other);
 }
 
 size_t UnknownFieldSet::SpaceUsedExcludingSelfLong() const {
-  if (fields_ == NULL) return 0;
+  if (fields_.empty()) return 0;
 
-  size_t total_size = sizeof(*fields_) + sizeof(UnknownField) * fields_->size();
+  size_t total_size = sizeof(fields_) + sizeof(UnknownField) * fields_.size();
 
-  for (int i = 0; i < fields_->size(); i++) {
-    const UnknownField& field = (*fields_)[i];
+  for (const UnknownField& field : fields_) {
     switch (field.type()) {
       case UnknownField::TYPE_LENGTH_DELIMITED:
-        total_size += sizeof(*field.data_.length_delimited_.string_value_) +
+        total_size += sizeof(*field.data_.length_delimited_.string_value) +
                       internal::StringSpaceUsedExcludingSelfLong(
-                          *field.data_.length_delimited_.string_value_);
+                          *field.data_.length_delimited_.string_value);
         break;
       case UnknownField::TYPE_GROUP:
         total_size += field.data_.group_->SpaceUsedLong();
@@ -150,41 +132,37 @@ size_t UnknownFieldSet::SpaceUsedLong() const {
   return sizeof(*this) + SpaceUsedExcludingSelf();
 }
 
-void UnknownFieldSet::AddVarint(int number, uint64 value) {
+void UnknownFieldSet::AddVarint(int number, uint64_t value) {
   UnknownField field;
   field.number_ = number;
   field.SetType(UnknownField::TYPE_VARINT);
   field.data_.varint_ = value;
-  if (fields_ == NULL) fields_ = new std::vector<UnknownField>();
-  fields_->push_back(field);
+  fields_.push_back(field);
 }
 
-void UnknownFieldSet::AddFixed32(int number, uint32 value) {
+void UnknownFieldSet::AddFixed32(int number, uint32_t value) {
   UnknownField field;
   field.number_ = number;
   field.SetType(UnknownField::TYPE_FIXED32);
   field.data_.fixed32_ = value;
-  if (fields_ == NULL) fields_ = new std::vector<UnknownField>();
-  fields_->push_back(field);
+  fields_.push_back(field);
 }
 
-void UnknownFieldSet::AddFixed64(int number, uint64 value) {
+void UnknownFieldSet::AddFixed64(int number, uint64_t value) {
   UnknownField field;
   field.number_ = number;
   field.SetType(UnknownField::TYPE_FIXED64);
   field.data_.fixed64_ = value;
-  if (fields_ == NULL) fields_ = new std::vector<UnknownField>();
-  fields_->push_back(field);
+  fields_.push_back(field);
 }
 
-string* UnknownFieldSet::AddLengthDelimited(int number) {
+std::string* UnknownFieldSet::AddLengthDelimited(int number) {
   UnknownField field;
   field.number_ = number;
   field.SetType(UnknownField::TYPE_LENGTH_DELIMITED);
-  field.data_.length_delimited_.string_value_ = new string;
-  if (fields_ == NULL) fields_ = new std::vector<UnknownField>();
-  fields_->push_back(field);
-  return field.data_.length_delimited_.string_value_;
+  field.data_.length_delimited_.string_value = new std::string;
+  fields_.push_back(field);
+  return field.data_.length_delimited_.string_value;
 }
 
 
@@ -193,57 +171,44 @@ UnknownFieldSet* UnknownFieldSet::AddGroup(int number) {
   field.number_ = number;
   field.SetType(UnknownField::TYPE_GROUP);
   field.data_.group_ = new UnknownFieldSet;
-  if (fields_ == NULL) fields_ = new std::vector<UnknownField>();
-  fields_->push_back(field);
+  fields_.push_back(field);
   return field.data_.group_;
 }
 
 void UnknownFieldSet::AddField(const UnknownField& field) {
-  if (fields_ == NULL) fields_ = new std::vector<UnknownField>();
-  fields_->push_back(field);
-  fields_->back().DeepCopy(field);
+  fields_.push_back(field);
+  fields_.back().DeepCopy(field);
 }
 
 void UnknownFieldSet::DeleteSubrange(int start, int num) {
   // Delete the specified fields.
   for (int i = 0; i < num; ++i) {
-    (*fields_)[i + start].Delete();
+    (fields_)[i + start].Delete();
   }
   // Slide down the remaining fields.
-  for (int i = start + num; i < fields_->size(); ++i) {
-    (*fields_)[i - num] = (*fields_)[i];
+  for (size_t i = start + num; i < fields_.size(); ++i) {
+    (fields_)[i - num] = (fields_)[i];
   }
   // Pop off the # of deleted fields.
   for (int i = 0; i < num; ++i) {
-    fields_->pop_back();
-  }
-  if (fields_ && fields_->size() == 0) {
-    // maintain invariant: never hold fields_ if empty.
-    delete fields_;
-    fields_ = NULL;
+    fields_.pop_back();
   }
 }
 
 void UnknownFieldSet::DeleteByNumber(int number) {
-  if (fields_ == NULL) return;
-  int left = 0;  // The number of fields left after deletion.
-  for (int i = 0; i < fields_->size(); ++i) {
-    UnknownField* field = &(*fields_)[i];
+  size_t left = 0;  // The number of fields left after deletion.
+  for (size_t i = 0; i < fields_.size(); ++i) {
+    UnknownField* field = &(fields_)[i];
     if (field->number() == number) {
       field->Delete();
     } else {
       if (i != left) {
-        (*fields_)[left] = (*fields_)[i];
+        (fields_)[left] = (fields_)[i];
       }
       ++left;
     }
   }
-  fields_->resize(left);
-  if (left == 0) {
-    // maintain invariant: never hold fields_ if empty.
-    delete fields_;
-    fields_ = NULL;
-  }
+  fields_.resize(left);
 }
 
 bool UnknownFieldSet::MergeFromCodedStream(io::CodedInputStream* input) {
@@ -276,7 +241,7 @@ bool UnknownFieldSet::ParseFromArray(const void* data, int size) {
 void UnknownField::Delete() {
   switch (type()) {
     case UnknownField::TYPE_LENGTH_DELIMITED:
-      delete data_.length_delimited_.string_value_;
+      delete data_.length_delimited_.string_value;
       break;
     case UnknownField::TYPE_GROUP:
       delete data_.group_;
@@ -286,27 +251,12 @@ void UnknownField::Delete() {
   }
 }
 
-// Reset all owned ptrs, a special function for performance, to avoid double
-// owning the ptrs, when we merge from a temporary UnknownFieldSet objects.
-void UnknownField::Reset() {
-  switch (type()) {
-    case UnknownField::TYPE_LENGTH_DELIMITED:
-      data_.length_delimited_.string_value_ = NULL;
-      break;
-    case UnknownField::TYPE_GROUP: {
-      data_.group_ = NULL;
-      break;
-    }
-    default:
-      break;
-  }
-}
-
 void UnknownField::DeepCopy(const UnknownField& other) {
+  (void)other;  // Parameter is used by Google-internal code.
   switch (type()) {
     case UnknownField::TYPE_LENGTH_DELIMITED:
-      data_.length_delimited_.string_value_ = new string(
-          *data_.length_delimited_.string_value_);
+      data_.length_delimited_.string_value =
+          new std::string(*data_.length_delimited_.string_value);
       break;
     case UnknownField::TYPE_GROUP: {
       UnknownFieldSet* group = new UnknownFieldSet();
@@ -320,21 +270,65 @@ void UnknownField::DeepCopy(const UnknownField& other) {
 }
 
 
-void UnknownField::SerializeLengthDelimitedNoTag(
-    io::CodedOutputStream* output) const {
-  GOOGLE_DCHECK_EQ(TYPE_LENGTH_DELIMITED, type());
-  const string& data = *data_.length_delimited_.string_value_;
-  output->WriteVarint32(data.size());
-  output->WriteRawMaybeAliased(data.data(), data.size());
-}
-
-uint8* UnknownField::SerializeLengthDelimitedNoTagToArray(uint8* target) const {
+uint8_t* UnknownField::InternalSerializeLengthDelimitedNoTag(
+    uint8_t* target, io::EpsCopyOutputStream* stream) const {
   GOOGLE_DCHECK_EQ(TYPE_LENGTH_DELIMITED, type());
-  const string& data = *data_.length_delimited_.string_value_;
+  const std::string& data = *data_.length_delimited_.string_value;
   target = io::CodedOutputStream::WriteVarint32ToArray(data.size(), target);
-  target = io::CodedOutputStream::WriteStringToArray(data, target);
+  target = stream->WriteRaw(data.data(), data.size(), target);
   return target;
 }
 
+namespace internal {
+
+class UnknownFieldParserHelper {
+ public:
+  explicit UnknownFieldParserHelper(UnknownFieldSet* unknown)
+      : unknown_(unknown) {}
+
+  void AddVarint(uint32_t num, uint64_t value) {
+    unknown_->AddVarint(num, value);
+  }
+  void AddFixed64(uint32_t num, uint64_t value) {
+    unknown_->AddFixed64(num, value);
+  }
+  const char* ParseLengthDelimited(uint32_t num, const char* ptr,
+                                   ParseContext* ctx) {
+    std::string* s = unknown_->AddLengthDelimited(num);
+    int size = ReadSize(&ptr);
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+    return ctx->ReadString(ptr, size, s);
+  }
+  const char* ParseGroup(uint32_t num, const char* ptr, ParseContext* ctx) {
+    UnknownFieldParserHelper child(unknown_->AddGroup(num));
+    return ctx->ParseGroup(&child, ptr, num * 8 + 3);
+  }
+  void AddFixed32(uint32_t num, uint32_t value) {
+    unknown_->AddFixed32(num, value);
+  }
+
+  const char* _InternalParse(const char* ptr, ParseContext* ctx) {
+    return WireFormatParser(*this, ptr, ctx);
+  }
+
+ private:
+  UnknownFieldSet* unknown_;
+};
+
+const char* UnknownGroupParse(UnknownFieldSet* unknown, const char* ptr,
+                              ParseContext* ctx) {
+  UnknownFieldParserHelper field_parser(unknown);
+  return WireFormatParser(field_parser, ptr, ctx);
+}
+
+const char* UnknownFieldParse(uint64_t tag, UnknownFieldSet* unknown,
+                              const char* ptr, ParseContext* ctx) {
+  UnknownFieldParserHelper field_parser(unknown);
+  return FieldParser(tag, field_parser, ptr, ctx);
+}
+
+}  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index 619855e..c5ca06b 100644 (file)
 #define GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__
 
 #include <assert.h>
+
 #include <string>
 #include <vector>
+
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
 #include <google/protobuf/message_lite.h>
+#include <google/protobuf/port.h>
+
+#include <google/protobuf/port_def.inc>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
 
 namespace google {
 namespace protobuf {
-  namespace io {
-    class CodedInputStream;         // coded_stream.h
-    class CodedOutputStream;        // coded_stream.h
-    class ZeroCopyInputStream;      // zero_copy_stream.h
-  }
-  namespace internal {
-    class InternalMetadataWithArena;  // metadata.h
-    class WireFormat;               // wire_format.h
-    class MessageSetFieldSkipperUsingCord;
-                                    // extension_set_heavy.cc
-  }
+namespace internal {
+class InternalMetadata;           // metadata_lite.h
+class WireFormat;                 // wire_format.h
+class MessageSetFieldSkipperUsingCord;
+// extension_set_heavy.cc
+}  // namespace internal
 
-class Message;                      // message.h
-class UnknownField;                 // below
+class Message;       // message.h
+class UnknownField;  // below
 
 // An UnknownFieldSet contains fields that were encountered while parsing a
 // message but were not defined by its type.  Keeping track of these can be
@@ -74,7 +81,7 @@ class UnknownField;                 // below
 //
 // This class is necessarily tied to the protocol buffer wire format, unlike
 // the Reflection interface which is independent of any serialization scheme.
-class LIBPROTOBUF_EXPORT UnknownFieldSet {
+class PROTOBUF_EXPORT UnknownFieldSet {
  public:
   UnknownFieldSet();
   ~UnknownFieldSet();
@@ -97,9 +104,8 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet {
   // Merge the contents an UnknownFieldSet with the UnknownFieldSet in
   // *metadata, if there is one.  If *metadata doesn't have an UnknownFieldSet
   // then add one to it and make it be a copy of the first arg.
-  static void MergeToInternalMetdata(
-      const UnknownFieldSet& other,
-      internal::InternalMetadataWithArena* metadata);
+  static void MergeToInternalMetadata(const UnknownFieldSet& other,
+                                      internal::InternalMetadata* metadata);
 
   // Swaps the contents of some other UnknownFieldSet with this one.
   inline void Swap(UnknownFieldSet* x);
@@ -116,9 +122,7 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet {
   // Version of SpaceUsed() including sizeof(*this).
   size_t SpaceUsedLong() const;
 
-  int SpaceUsed() const {
-    return internal::ToIntSize(SpaceUsedLong());
-  }
+  int SpaceUsed() const { return internal::ToIntSize(SpaceUsedLong()); }
 
   // Returns the number of fields present in the UnknownFieldSet.
   inline int field_count() const;
@@ -132,11 +136,11 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet {
 
   // Adding fields ---------------------------------------------------
 
-  void AddVarint(int number, uint64 value);
-  void AddFixed32(int number, uint32 value);
-  void AddFixed64(int number, uint64 value);
-  void AddLengthDelimited(int number, const string& value);
-  string* AddLengthDelimited(int number);
+  void AddVarint(int number, uint64_t value);
+  void AddFixed32(int number, uint32_t value);
+  void AddFixed64(int number, uint64_t value);
+  void AddLengthDelimited(int number, const std::string& value);
+  std::string* AddLengthDelimited(int number);
   UnknownFieldSet* AddGroup(int number);
 
   // Adds an unknown field from another set.
@@ -158,31 +162,72 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet {
   bool ParseFromCodedStream(io::CodedInputStream* input);
   bool ParseFromZeroCopyStream(io::ZeroCopyInputStream* input);
   bool ParseFromArray(const void* data, int size);
-  inline bool ParseFromString(const string& data) {
+  inline bool ParseFromString(const std::string& data) {
     return ParseFromArray(data.data(), static_cast<int>(data.size()));
   }
 
-  static const UnknownFieldSet* default_instance();
+  // Merges this message's unknown field data (if any).  This works whether
+  // the message is a lite or full proto (for legacy reasons, lite and full
+  // return different types for MessageType::unknown_fields()).
+  template <typename MessageType>
+  bool MergeFromMessage(const MessageType& message);
+
+  static const UnknownFieldSet& default_instance();
+
  private:
   // For InternalMergeFrom
   friend class UnknownField;
   // Merges from other UnknownFieldSet. This method assumes, that this object
-  // is newly created and has fields_ == NULL;
+  // is newly created and has no fields.
   void InternalMergeFrom(const UnknownFieldSet& other);
   void ClearFallback();
 
-  // fields_ is either NULL, or a pointer to a vector that is *non-empty*. We
-  // never hold the empty vector because we want the 'do we have any unknown
-  // fields' check to be fast, and avoid a cache miss: the UFS instance gets
-  // embedded in the message object, so 'fields_ != NULL' tests a member
-  // variable hot in the cache, without the need to go touch a vector somewhere
-  // else in memory.
-  std::vector<UnknownField>* fields_;
+  template <typename MessageType,
+            typename std::enable_if<
+                std::is_base_of<Message, MessageType>::value, int>::type = 0>
+  bool InternalMergeFromMessage(const MessageType& message) {
+    MergeFrom(message.GetReflection()->GetUnknownFields(message));
+    return true;
+  }
+
+  template <typename MessageType,
+            typename std::enable_if<
+                std::is_base_of<MessageLite, MessageType>::value &&
+                    !std::is_base_of<Message, MessageType>::value,
+                int>::type = 0>
+  bool InternalMergeFromMessage(const MessageType& message) {
+    const auto& unknown_fields = message.unknown_fields();
+    io::ArrayInputStream array_stream(unknown_fields.data(),
+                                      unknown_fields.size());
+    io::CodedInputStream coded_stream(&array_stream);
+    return MergeFromCodedStream(&coded_stream);
+  }
+
+  std::vector<UnknownField> fields_;
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(UnknownFieldSet);
 };
 
+namespace internal {
+
+inline void WriteVarint(uint32_t num, uint64_t val, UnknownFieldSet* unknown) {
+  unknown->AddVarint(num, val);
+}
+inline void WriteLengthDelimited(uint32_t num, StringPiece val,
+                                 UnknownFieldSet* unknown) {
+  unknown->AddLengthDelimited(num)->assign(val.data(), val.size());
+}
+
+PROTOBUF_EXPORT
+const char* UnknownGroupParse(UnknownFieldSet* unknown, const char* ptr,
+                              ParseContext* ctx);
+PROTOBUF_EXPORT
+const char* UnknownFieldParse(uint64_t tag, UnknownFieldSet* unknown,
+                              const char* ptr, ParseContext* ctx);
+
+}  // namespace internal
+
 // Represents one field in an UnknownFieldSet.
-class LIBPROTOBUF_EXPORT UnknownField {
+class PROTOBUF_EXPORT UnknownField {
  public:
   enum Type {
     TYPE_VARINT,
@@ -201,36 +246,36 @@ class LIBPROTOBUF_EXPORT UnknownField {
   // Accessors -------------------------------------------------------
   // Each method works only for UnknownFields of the corresponding type.
 
-  inline uint64 varint() const;
-  inline uint32 fixed32() const;
-  inline uint64 fixed64() const;
-  inline const string& length_delimited() const;
+  inline uint64_t varint() const;
+  inline uint32_t fixed32() const;
+  inline uint64_t fixed64() const;
+  inline const std::string& length_delimited() const;
   inline const UnknownFieldSet& group() const;
 
-  inline void set_varint(uint64 value);
-  inline void set_fixed32(uint32 value);
-  inline void set_fixed64(uint64 value);
-  inline void set_length_delimited(const string& value);
-  inline string* mutable_length_delimited();
+  inline void set_varint(uint64_t value);
+  inline void set_fixed32(uint32_t value);
+  inline void set_fixed64(uint64_t value);
+  inline void set_length_delimited(const std::string& value);
+  inline std::string* mutable_length_delimited();
   inline UnknownFieldSet* mutable_group();
 
   // Serialization API.
   // These methods can take advantage of the underlying implementation and may
   // archieve a better performance than using getters to retrieve the data and
   // do the serialization yourself.
-  void SerializeLengthDelimitedNoTag(io::CodedOutputStream* output) const;
-  uint8* SerializeLengthDelimitedNoTagToArray(uint8* target) const;
+  void SerializeLengthDelimitedNoTag(io::CodedOutputStream* output) const {
+    output->SetCur(InternalSerializeLengthDelimitedNoTag(output->Cur(),
+                                                         output->EpsCopy()));
+  }
 
   inline size_t GetLengthDelimitedSize() const;
+  uint8_t* InternalSerializeLengthDelimitedNoTag(
+      uint8_t* target, io::EpsCopyOutputStream* stream) const;
 
 
   // If this UnknownField contains a pointer, delete it.
   void Delete();
 
-  // Reset all the underlying pointers to NULL. A special function to be only
-  // used while merging from a temporary UFS.
-  void Reset();
-
   // Make a deep copy of any pointers in this UnknownField.
   void DeepCopy(const UnknownField& other);
 
@@ -239,15 +284,15 @@ class LIBPROTOBUF_EXPORT UnknownField {
   inline void SetType(Type type);
 
   union LengthDelimited {
-    string* string_value_;
+    std::string* string_value;
   };
 
-  uint32 number_;
-  uint32 type_;
+  uint32_t number_;
+  uint32_t type_;
   union {
-    uint64 varint_;
-    uint32 fixed32_;
-    uint64 fixed64_;
+    uint64_t varint_;
+    uint32_t fixed32_;
+    uint64_t fixed64_;
     mutable union LengthDelimited length_delimited_;
     UnknownFieldSet* group_;
   } data_;
@@ -256,40 +301,36 @@ class LIBPROTOBUF_EXPORT UnknownField {
 // ===================================================================
 // inline implementations
 
-inline UnknownFieldSet::UnknownFieldSet() : fields_(NULL) {}
+inline UnknownFieldSet::UnknownFieldSet() {}
 
 inline UnknownFieldSet::~UnknownFieldSet() { Clear(); }
 
 inline void UnknownFieldSet::ClearAndFreeMemory() { Clear(); }
 
 inline void UnknownFieldSet::Clear() {
-  if (fields_ != NULL) {
+  if (!fields_.empty()) {
     ClearFallback();
   }
 }
 
-inline bool UnknownFieldSet::empty() const {
-  // Invariant: fields_ is never empty if present.
-  return !fields_;
-}
+inline bool UnknownFieldSet::empty() const { return fields_.empty(); }
 
 inline void UnknownFieldSet::Swap(UnknownFieldSet* x) {
-  std::swap(fields_, x->fields_);
+  fields_.swap(x->fields_);
 }
 
 inline int UnknownFieldSet::field_count() const {
-  return fields_ ? static_cast<int>(fields_->size()) : 0;
+  return static_cast<int>(fields_.size());
 }
 inline const UnknownField& UnknownFieldSet::field(int index) const {
-  GOOGLE_DCHECK(fields_ != NULL);
-  return (*fields_)[static_cast<size_t>(index)];
+  return (fields_)[static_cast<size_t>(index)];
 }
 inline UnknownField* UnknownFieldSet::mutable_field(int index) {
-  return &(*fields_)[static_cast<size_t>(index)];
+  return &(fields_)[static_cast<size_t>(index)];
 }
 
-inline void UnknownFieldSet::AddLengthDelimited(
-    int number, const string& value) {
+inline void UnknownFieldSet::AddLengthDelimited(int number,
+                                                const std::string& value) {
   AddLengthDelimited(number)->assign(value);
 }
 
@@ -301,55 +342,61 @@ inline UnknownField::Type UnknownField::type() const {
   return static_cast<Type>(type_);
 }
 
-inline uint64 UnknownField::varint() const {
+inline uint64_t UnknownField::varint() const {
   assert(type() == TYPE_VARINT);
   return data_.varint_;
 }
-inline uint32 UnknownField::fixed32() const {
+inline uint32_t UnknownField::fixed32() const {
   assert(type() == TYPE_FIXED32);
   return data_.fixed32_;
 }
-inline uint64 UnknownField::fixed64() const {
+inline uint64_t UnknownField::fixed64() const {
   assert(type() == TYPE_FIXED64);
   return data_.fixed64_;
 }
-inline const string& UnknownField::length_delimited() const {
+inline const std::string& UnknownField::length_delimited() const {
   assert(type() == TYPE_LENGTH_DELIMITED);
-  return *data_.length_delimited_.string_value_;
+  return *data_.length_delimited_.string_value;
 }
 inline const UnknownFieldSet& UnknownField::group() const {
   assert(type() == TYPE_GROUP);
   return *data_.group_;
 }
 
-inline void UnknownField::set_varint(uint64 value) {
+inline void UnknownField::set_varint(uint64_t value) {
   assert(type() == TYPE_VARINT);
   data_.varint_ = value;
 }
-inline void UnknownField::set_fixed32(uint32 value) {
+inline void UnknownField::set_fixed32(uint32_t value) {
   assert(type() == TYPE_FIXED32);
   data_.fixed32_ = value;
 }
-inline void UnknownField::set_fixed64(uint64 value) {
+inline void UnknownField::set_fixed64(uint64_t value) {
   assert(type() == TYPE_FIXED64);
   data_.fixed64_ = value;
 }
-inline void UnknownField::set_length_delimited(const string& value) {
+inline void UnknownField::set_length_delimited(const std::string& value) {
   assert(type() == TYPE_LENGTH_DELIMITED);
-  data_.length_delimited_.string_value_->assign(value);
+  data_.length_delimited_.string_value->assign(value);
 }
-inline string* UnknownField::mutable_length_delimited() {
+inline std::string* UnknownField::mutable_length_delimited() {
   assert(type() == TYPE_LENGTH_DELIMITED);
-  return data_.length_delimited_.string_value_;
+  return data_.length_delimited_.string_value;
 }
 inline UnknownFieldSet* UnknownField::mutable_group() {
   assert(type() == TYPE_GROUP);
   return data_.group_;
 }
+template <typename MessageType>
+bool UnknownFieldSet::MergeFromMessage(const MessageType& message) {
+  // SFINAE will route to the right version.
+  return InternalMergeFromMessage(message);
+}
+
 
 inline size_t UnknownField::GetLengthDelimitedSize() const {
   GOOGLE_DCHECK_EQ(TYPE_LENGTH_DELIMITED, type());
-  return data_.length_delimited_.string_value_->size();
+  return data_.length_delimited_.string_value->size();
 }
 
 inline void UnknownField::SetType(Type type) {
@@ -358,6 +405,7 @@ inline void UnknownField::SetType(Type type) {
 
 
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
 #endif  // GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/delimited_message_util.cc b/3rdparty/protobuf/src/google/protobuf/util/delimited_message_util.cc
deleted file mode 100644 (file)
index 1637878..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// Adapted from the patch of kenton@google.com (Kenton Varda)
-// See https://github.com/google/protobuf/pull/710 for details.
-
-#include <google/protobuf/util/delimited_message_util.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-bool SerializeDelimitedToFileDescriptor(const MessageLite& message, int file_descriptor) {
-  io::FileOutputStream output(file_descriptor);
-  return SerializeDelimitedToZeroCopyStream(message, &output);
-}
-
-bool SerializeDelimitedToOstream(const MessageLite& message, ostream* output) {
-  {
-    io::OstreamOutputStream zero_copy_output(output);
-    if (!SerializeDelimitedToZeroCopyStream(message, &zero_copy_output)) return false;
-  }
-  return output->good();
-}
-
-bool ParseDelimitedFromZeroCopyStream(MessageLite* message, io::ZeroCopyInputStream* input, bool* clean_eof) {
-  google::protobuf::io::CodedInputStream coded_input(input);
-  return ParseDelimitedFromCodedStream(message, &coded_input, clean_eof);
-}
-
-bool ParseDelimitedFromCodedStream(MessageLite* message, io::CodedInputStream* input, bool* clean_eof) {
-  if (clean_eof != NULL) *clean_eof = false;
-  int start = input->CurrentPosition();
-
-  // Read the size.
-  uint32 size;
-  if (!input->ReadVarint32(&size)) {
-    if (clean_eof != NULL) *clean_eof = input->CurrentPosition() == start;
-    return false;
-  }
-
-  // Tell the stream not to read beyond that size.
-  google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(size);
-
-  // Parse the message.
-  if (!message->MergeFromCodedStream(input)) return false;
-  if (!input->ConsumedEntireMessage()) return false;
-
-  // Release the limit.
-  input->PopLimit(limit);
-
-  return true;
-}
-
-bool SerializeDelimitedToZeroCopyStream(const MessageLite& message, io::ZeroCopyOutputStream* output) {
-  google::protobuf::io::CodedOutputStream coded_output(output);
-  return SerializeDelimitedToCodedStream(message, &coded_output);
-}
-
-bool SerializeDelimitedToCodedStream(const MessageLite& message, io::CodedOutputStream* output) {
-  // Write the size.
-  int size = message.ByteSize();
-  output->WriteVarint32(size);
-
-  // Write the content.
-  uint8* buffer = output->GetDirectBufferForNBytesAndAdvance(size);
-  if (buffer != NULL) {
-    // Optimization: The message fits in one buffer, so use the faster
-    // direct-to-array serialization path.
-    message.SerializeWithCachedSizesToArray(buffer);
-  } else {
-    // Slightly-slower path when the message is multiple buffers.
-    message.SerializeWithCachedSizes(output);
-    if (output->HadError()) return false;
-  }
-
-  return true;
-}
-
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/delimited_message_util.h b/3rdparty/protobuf/src/google/protobuf/util/delimited_message_util.h
deleted file mode 100644 (file)
index 302d478..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// Adapted from the patch of kenton@google.com (Kenton Varda)
-// See https://github.com/google/protobuf/pull/710 for details.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_DELIMITED_MESSAGE_UTIL_H__
-#define GOOGLE_PROTOBUF_UTIL_DELIMITED_MESSAGE_UTIL_H__
-
-#include <ostream>
-
-#include <google/protobuf/message_lite.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-// Write a single size-delimited message from the given stream. Delimited
-// format allows a single file or stream to contain multiple messages,
-// whereas normally writing multiple non-delimited messages to the same
-// stream would cause them to be merged. A delimited message is a varint
-// encoding the message size followed by a message of exactly that size.
-//
-// Note that if you want to *read* a delimited message from a file descriptor
-// or istream, you will need to construct an io::FileInputStream or
-// io::OstreamInputStream (implementations of io::ZeroCopyStream) and use the
-// utility function ParseDelimitedFromZeroCopyStream(). You must then
-// continue to use the same ZeroCopyInputStream to read all further data from
-// the stream until EOF. This is because these ZeroCopyInputStream
-// implementations are buffered: they read a big chunk of data at a time,
-// then parse it. As a result, they may read past the end of the delimited
-// message. There is no way for them to push the extra data back into the
-// underlying source, so instead you must keep using the same stream object.
-bool LIBPROTOBUF_EXPORT SerializeDelimitedToFileDescriptor(const MessageLite& message, int file_descriptor);
-
-bool LIBPROTOBUF_EXPORT SerializeDelimitedToOstream(const MessageLite& message, ostream* output);
-
-// Read a single size-delimited message from the given stream. Delimited
-// format allows a single file or stream to contain multiple messages,
-// whereas normally parsing consumes the entire input. A delimited message
-// is a varint encoding the message size followed by a message of exactly
-// that size.
-//
-// If |clean_eof| is not NULL, then it will be set to indicate whether the
-// stream ended cleanly. That is, if the stream ends without this method
-// having read any data at all from it, then *clean_eof will be set true,
-// otherwise it will be set false. Note that these methods return false
-// on EOF, but they also return false on other errors, so |clean_eof| is
-// needed to distinguish a clean end from errors.
-bool LIBPROTOBUF_EXPORT ParseDelimitedFromZeroCopyStream(MessageLite* message, io::ZeroCopyInputStream* input, bool* clean_eof);
-
-bool LIBPROTOBUF_EXPORT ParseDelimitedFromCodedStream(MessageLite* message, io::CodedInputStream* input, bool* clean_eof);
-
-// Write a single size-delimited message from the given stream. Delimited
-// format allows a single file or stream to contain multiple messages,
-// whereas normally writing multiple non-delimited messages to the same
-// stream would cause them to be merged. A delimited message is a varint
-// encoding the message size followed by a message of exactly that size.
-bool LIBPROTOBUF_EXPORT SerializeDelimitedToZeroCopyStream(const MessageLite& message, io::ZeroCopyOutputStream* output);
-
-bool LIBPROTOBUF_EXPORT SerializeDelimitedToCodedStream(const MessageLite& message, io::CodedOutputStream* output);
-
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // GOOGLE_PROTOBUF_UTIL_DELIMITED_MESSAGE_UTIL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/field_comparator.cc b/3rdparty/protobuf/src/google/protobuf/util/field_comparator.cc
deleted file mode 100644 (file)
index a1a56ee..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: ksroka@google.com (Krzysztof Sroka)
-
-#include <google/protobuf/util/field_comparator.h>
-
-#include <string>
-
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/stubs/map_util.h>
-#include <google/protobuf/stubs/mathlimits.h>
-#include <google/protobuf/stubs/mathutil.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-FieldComparator::FieldComparator() {}
-FieldComparator::~FieldComparator() {}
-
-DefaultFieldComparator::DefaultFieldComparator()
-    : float_comparison_(EXACT),
-      treat_nan_as_equal_(false),
-      has_default_tolerance_(false) {
-}
-
-DefaultFieldComparator::~DefaultFieldComparator() {}
-
-FieldComparator::ComparisonResult DefaultFieldComparator::Compare(
-      const google::protobuf::Message& message_1,
-      const google::protobuf::Message& message_2,
-      const google::protobuf::FieldDescriptor* field,
-      int index_1, int index_2,
-      const google::protobuf::util::FieldContext* field_context) {
-  const Reflection* reflection_1 = message_1.GetReflection();
-  const Reflection* reflection_2 = message_2.GetReflection();
-
-  switch (field->cpp_type()) {
-#define COMPARE_FIELD(METHOD)                                              \
-    if (field->is_repeated()) {                                            \
-      return ResultFromBoolean(Compare##METHOD(                            \
-          *field,                                                          \
-          reflection_1->GetRepeated##METHOD(message_1, field, index_1),    \
-          reflection_2->GetRepeated##METHOD(message_2, field, index_2)));  \
-    } else {                                                               \
-      return ResultFromBoolean(Compare##METHOD(                            \
-          *field,                                                          \
-          reflection_1->Get##METHOD(message_1, field),                     \
-          reflection_2->Get##METHOD(message_2, field)));                   \
-    }                                                                      \
-    break;  // Make sure no fall-through is introduced.
-
-    case FieldDescriptor::CPPTYPE_BOOL:
-      COMPARE_FIELD(Bool);
-    case FieldDescriptor::CPPTYPE_DOUBLE:
-      COMPARE_FIELD(Double);
-    case FieldDescriptor::CPPTYPE_ENUM:
-      COMPARE_FIELD(Enum);
-    case FieldDescriptor::CPPTYPE_FLOAT:
-      COMPARE_FIELD(Float);
-    case FieldDescriptor::CPPTYPE_INT32:
-      COMPARE_FIELD(Int32);
-    case FieldDescriptor::CPPTYPE_INT64:
-      COMPARE_FIELD(Int64);
-    case FieldDescriptor::CPPTYPE_STRING:
-      if (field->is_repeated()) {
-        // Allocate scratch strings to store the result if a conversion is
-        // needed.
-        string scratch1;
-        string scratch2;
-        return ResultFromBoolean(
-            CompareString(*field, reflection_1->GetRepeatedStringReference(
-                                      message_1, field, index_1, &scratch1),
-                          reflection_2->GetRepeatedStringReference(
-                              message_2, field, index_2, &scratch2)));
-      } else {
-        // Allocate scratch strings to store the result if a conversion is
-        // needed.
-        string scratch1;
-        string scratch2;
-        return ResultFromBoolean(CompareString(
-            *field,
-            reflection_1->GetStringReference(message_1, field, &scratch1),
-            reflection_2->GetStringReference(message_2, field, &scratch2)));
-      }
-      break;
-    case FieldDescriptor::CPPTYPE_UINT32:
-      COMPARE_FIELD(UInt32);
-    case FieldDescriptor::CPPTYPE_UINT64:
-      COMPARE_FIELD(UInt64);
-
-#undef COMPARE_FIELD
-
-    case FieldDescriptor::CPPTYPE_MESSAGE:
-      return RECURSE;
-
-    default:
-      GOOGLE_LOG(FATAL) << "No comparison code for field " << field->full_name()
-                 << " of CppType = " << field->cpp_type();
-      return DIFFERENT;
-  }
-}
-
-void DefaultFieldComparator::SetDefaultFractionAndMargin(double fraction,
-                                                         double margin) {
-  default_tolerance_ = Tolerance(fraction, margin);
-  has_default_tolerance_ = true;
-}
-
-void DefaultFieldComparator::SetFractionAndMargin(const FieldDescriptor* field,
-                                                  double fraction,
-                                                  double margin) {
-  GOOGLE_CHECK(FieldDescriptor::CPPTYPE_FLOAT == field->cpp_type() ||
-        FieldDescriptor::CPPTYPE_DOUBLE == field->cpp_type())
-      << "Field has to be float or double type. Field name is: "
-      << field->full_name();
-  map_tolerance_[field] = Tolerance(fraction, margin);
-}
-
-bool DefaultFieldComparator::CompareDouble(const FieldDescriptor& field,
-                                           double value_1, double value_2) {
-  return CompareDoubleOrFloat(field, value_1, value_2);
-}
-
-bool DefaultFieldComparator::CompareEnum(const FieldDescriptor& field,
-                                         const EnumValueDescriptor* value_1,
-                                         const EnumValueDescriptor* value_2) {
-  return value_1->number() == value_2->number();
-}
-
-bool DefaultFieldComparator::CompareFloat(const FieldDescriptor& field,
-                                          float value_1, float value_2) {
-  return CompareDoubleOrFloat(field, value_1, value_2);
-}
-
-template<typename T>
-bool DefaultFieldComparator::CompareDoubleOrFloat(const FieldDescriptor& field,
-                                                  T value_1, T value_2) {
-  if (value_1 == value_2) {
-    // Covers +inf and -inf (which are not within margin or fraction of
-    // themselves), and is a shortcut for finite values.
-    return true;
-  } else if (float_comparison_ == EXACT) {
-    if (treat_nan_as_equal_ &&
-        MathLimits<T>::IsNaN(value_1) && MathLimits<T>::IsNaN(value_2)) {
-      return true;
-    }
-    return false;
-  } else {
-    if (treat_nan_as_equal_ &&
-        MathLimits<T>::IsNaN(value_1) && MathLimits<T>::IsNaN(value_2)) {
-      return true;
-    }
-    // float_comparison_ == APPROXIMATE covers two use cases.
-    Tolerance* tolerance = FindOrNull(map_tolerance_, &field);
-    if (tolerance == NULL && has_default_tolerance_) {
-      tolerance = &default_tolerance_;
-    }
-    if (tolerance == NULL) {
-      return MathUtil::AlmostEquals(value_1, value_2);
-    } else {
-      // Use user-provided fraction and margin. Since they are stored as
-      // doubles, we explicitly cast them to types of values provided. This
-      // is very likely to fail if provided values are not numeric.
-      return MathUtil::WithinFractionOrMargin(
-          value_1, value_2, static_cast<T>(tolerance->fraction),
-          static_cast<T>(tolerance->margin));
-    }
-  }
-}
-
-FieldComparator::ComparisonResult DefaultFieldComparator::ResultFromBoolean(
-    bool boolean_result) const {
-  return boolean_result ? FieldComparator::SAME : FieldComparator::DIFFERENT;
-}
-
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/field_comparator.h b/3rdparty/protobuf/src/google/protobuf/util/field_comparator.h
deleted file mode 100644 (file)
index 26a7ba4..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Defines classes for field comparison.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__
-#define GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__
-
-#include <map>
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-namespace google {
-namespace protobuf {
-
-class Message;
-class EnumValueDescriptor;
-class FieldDescriptor;
-
-namespace util {
-
-class FieldContext;
-
-// Base class specifying the interface for comparing protocol buffer fields.
-// Regular users should consider using or subclassing DefaultFieldComparator
-// rather than this interface.
-// Currently, this does not support comparing unknown fields.
-class LIBPROTOBUF_EXPORT FieldComparator {
- public:
-  FieldComparator();
-  virtual ~FieldComparator();
-
-  enum ComparisonResult {
-    SAME,       // Compared fields are equal. In case of comparing submessages,
-                // user should not recursively compare their contents.
-    DIFFERENT,  // Compared fields are different. In case of comparing
-                // submessages, user should not recursively compare their
-                // contents.
-    RECURSE,    // Compared submessages need to be compared recursively.
-                // FieldComparator does not specify the semantics of recursive
-                // comparison. This value should not be returned for simple
-                // values.
-  };
-
-  // Compares the values of a field in two protocol buffer messages.
-  // Returns SAME or DIFFERENT for simple values, and SAME, DIFFERENT or RECURSE
-  // for submessages. Returning RECURSE for fields not being submessages is
-  // illegal.
-  // In case the given FieldDescriptor points to a repeated field, the indices
-  // need to be valid. Otherwise they should be ignored.
-  //
-  // FieldContext contains information about the specific instances of the
-  // fields being compared, versus FieldDescriptor which only contains general
-  // type information about the fields.
-  virtual ComparisonResult Compare(
-      const google::protobuf::Message& message_1,
-      const google::protobuf::Message& message_2,
-      const google::protobuf::FieldDescriptor* field,
-      int index_1, int index_2,
-      const google::protobuf::util::FieldContext* field_context) = 0;
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldComparator);
-};
-
-// Basic implementation of FieldComparator.  Supports three modes of floating
-// point value comparison: exact, approximate using MathUtil::AlmostEqual
-// method, and arbitrarily precise using MathUtil::WithinFractionOrMargin.
-class LIBPROTOBUF_EXPORT DefaultFieldComparator : public FieldComparator {
- public:
-  enum FloatComparison {
-     EXACT,               // Floats and doubles are compared exactly.
-     APPROXIMATE,         // Floats and doubles are compared using the
-                          // MathUtil::AlmostEqual method or
-                          // MathUtil::WithinFractionOrMargin method.
-     // TODO(ksroka): Introduce third value to differenciate uses of AlmostEqual
-     //               and WithinFractionOrMargin.
-  };
-
-  // Creates new comparator with float comparison set to EXACT.
-  DefaultFieldComparator();
-
-  virtual ~DefaultFieldComparator();
-
-  virtual ComparisonResult Compare(
-      const google::protobuf::Message& message_1,
-      const google::protobuf::Message& message_2,
-      const google::protobuf::FieldDescriptor* field,
-      int index_1, int index_2,
-      const google::protobuf::util::FieldContext* field_context);
-
-  void set_float_comparison(FloatComparison float_comparison) {
-    float_comparison_ = float_comparison;
-  }
-
-  FloatComparison float_comparison() const {
-    return float_comparison_;
-  }
-
-  // Set whether the FieldComparator shall treat floats or doubles that are both
-  // NaN as equal (treat_nan_as_equal = true) or as different
-  // (treat_nan_as_equal = false). Default is treating NaNs always as different.
-  void set_treat_nan_as_equal(bool treat_nan_as_equal) {
-    treat_nan_as_equal_ = treat_nan_as_equal;
-  }
-
-  bool treat_nan_as_equal() const {
-    return treat_nan_as_equal_;
-  }
-
-  // Sets the fraction and margin for the float comparison of a given field.
-  // Uses MathUtil::WithinFractionOrMargin to compare the values.
-  //
-  // REQUIRES: field->cpp_type == FieldDescriptor::CPPTYPE_DOUBLE or
-  //           field->cpp_type == FieldDescriptor::CPPTYPE_FLOAT
-  // REQUIRES: float_comparison_ == APPROXIMATE
-  void SetFractionAndMargin(const FieldDescriptor* field, double fraction,
-                            double margin);
-
-  // Sets the fraction and margin for the float comparison of all float and
-  // double fields, unless a field has been given a specific setting via
-  // SetFractionAndMargin() above.
-  // Uses MathUtil::WithinFractionOrMargin to compare the values.
-  //
-  // REQUIRES: float_comparison_ == APPROXIMATE
-  void SetDefaultFractionAndMargin(double fraction, double margin);
-
- private:
-  // Defines the tolerance for floating point comparison (fraction and margin).
-  struct Tolerance {
-    double fraction;
-    double margin;
-    Tolerance()
-        : fraction(0.0),
-          margin(0.0) {}
-    Tolerance(double f, double m)
-        : fraction(f),
-          margin(m) {}
-  };
-
-  // Defines the map to store the tolerances for floating point comparison.
-  typedef std::map<const FieldDescriptor*, Tolerance> ToleranceMap;
-
-  // The following methods get executed when CompareFields is called for the
-  // basic types (instead of submessages). They return true on success. One
-  // can use ResultFromBoolean() to convert that boolean to a ComparisonResult
-  // value.
-  bool CompareBool(const google::protobuf::FieldDescriptor& field,
-                   bool value_1, bool value_2) {
-    return value_1 == value_2;
-  }
-
-  // Uses CompareDoubleOrFloat, a helper function used by both CompareDouble and
-  // CompareFloat.
-  bool CompareDouble(const google::protobuf::FieldDescriptor& field,
-                     double value_1, double value_2);
-
-  bool CompareEnum(const google::protobuf::FieldDescriptor& field,
-                   const EnumValueDescriptor* value_1,
-                   const EnumValueDescriptor* value_2);
-
-  // Uses CompareDoubleOrFloat, a helper function used by both CompareDouble and
-  // CompareFloat.
-  bool CompareFloat(const google::protobuf::FieldDescriptor& field,
-                    float value_1, float value_2);
-
-  bool CompareInt32(const google::protobuf::FieldDescriptor& field,
-                    int32 value_1, int32 value_2) {
-    return value_1 == value_2;
-  }
-
-  bool CompareInt64(const google::protobuf::FieldDescriptor& field,
-                    int64 value_1, int64 value_2) {
-    return value_1 == value_2;
-  }
-
-  bool CompareString(const google::protobuf::FieldDescriptor& field,
-                     const string& value_1, const string& value_2) {
-    return value_1 == value_2;
-  }
-
-  bool CompareUInt32(const google::protobuf::FieldDescriptor& field,
-                     uint32 value_1, uint32 value_2) {
-    return value_1 == value_2;
-  }
-
-  bool CompareUInt64(const google::protobuf::FieldDescriptor& field,
-                     uint64 value_1, uint64 value_2) {
-    return value_1 == value_2;
-  }
-
-  // This function is used by CompareDouble and CompareFloat to avoid code
-  // duplication. There are no checks done against types of the values passed,
-  // but it's likely to fail if passed non-numeric arguments.
-  template<typename T>
-  bool CompareDoubleOrFloat(const google::protobuf::FieldDescriptor& field,
-                            T value_1, T value_2);
-
-  // Returns FieldComparator::SAME if boolean_result is true and
-  // FieldComparator::DIFFERENT otherwise.
-  ComparisonResult ResultFromBoolean(bool boolean_result) const;
-
-  FloatComparison float_comparison_;
-
-  // If true, floats and doubles that are both NaN are considered to be
-  // equal. Otherwise, two floats or doubles that are NaN are considered to be
-  // different.
-  bool treat_nan_as_equal_;
-
-  // True iff default_tolerance_ has been explicitly set.
-  //
-  // If false, then the default tolerance for floats and doubles is that which
-  // is used by MathUtil::AlmostEquals().
-  bool has_default_tolerance_;
-
-  // Default float/double tolerance. Only meaningful if
-  // has_default_tolerance_ == true.
-  Tolerance default_tolerance_;
-
-  // Field-specific float/double tolerances, which override any default for
-  // those particular fields.
-  ToleranceMap map_tolerance_;
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DefaultFieldComparator);
-};
-
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/field_mask_util.cc b/3rdparty/protobuf/src/google/protobuf/util/field_mask_util.cc
deleted file mode 100644 (file)
index 8a41349..0000000
+++ /dev/null
@@ -1,690 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/field_mask_util.h>
-
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/map_util.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-using google::protobuf::FieldMask;
-
-string FieldMaskUtil::ToString(const FieldMask& mask) {
-  return Join(mask.paths(), ",");
-}
-
-void FieldMaskUtil::FromString(StringPiece str, FieldMask* out) {
-  out->Clear();
-  std::vector<string> paths = Split(str, ",");
-  for (int i = 0; i < paths.size(); ++i) {
-    if (paths[i].empty()) continue;
-    out->add_paths(paths[i]);
-  }
-}
-
-bool FieldMaskUtil::SnakeCaseToCamelCase(StringPiece input, string* output) {
-  output->clear();
-  bool after_underscore = false;
-  for (int i = 0; i < input.size(); ++i) {
-    if (input[i] >= 'A' && input[i] <= 'Z') {
-      // The field name must not contain uppercase letters.
-      return false;
-    }
-    if (after_underscore) {
-      if (input[i] >= 'a' && input[i] <= 'z') {
-        output->push_back(input[i] + 'A' - 'a');
-        after_underscore = false;
-      } else {
-        // The character after a "_" must be a lowercase letter.
-        return false;
-      }
-    } else if (input[i] == '_') {
-      after_underscore = true;
-    } else {
-      output->push_back(input[i]);
-    }
-  }
-  if (after_underscore) {
-    // Trailing "_".
-    return false;
-  }
-  return true;
-}
-
-bool FieldMaskUtil::CamelCaseToSnakeCase(StringPiece input, string* output) {
-  output->clear();
-  for (int i = 0; i < input.size(); ++i) {
-    if (input[i] == '_') {
-      // The field name must not contain "_"s.
-      return false;
-    }
-    if (input[i] >= 'A' && input[i] <= 'Z') {
-      output->push_back('_');
-      output->push_back(input[i] + 'a' - 'A');
-    } else {
-      output->push_back(input[i]);
-    }
-  }
-  return true;
-}
-
-bool FieldMaskUtil::ToJsonString(const FieldMask& mask, string* out) {
-  out->clear();
-  for (int i = 0; i < mask.paths_size(); ++i) {
-    const string& path = mask.paths(i);
-    string camelcase_path;
-    if (!SnakeCaseToCamelCase(path, &camelcase_path)) {
-      return false;
-    }
-    if (i > 0) {
-      out->push_back(',');
-    }
-    out->append(camelcase_path);
-  }
-  return true;
-}
-
-bool FieldMaskUtil::FromJsonString(StringPiece str, FieldMask* out) {
-  out->Clear();
-  std::vector<string> paths = Split(str, ",");
-  for (int i = 0; i < paths.size(); ++i) {
-    if (paths[i].empty()) continue;
-    string snakecase_path;
-    if (!CamelCaseToSnakeCase(paths[i], &snakecase_path)) {
-      return false;
-    }
-    out->add_paths(snakecase_path);
-  }
-  return true;
-}
-
-bool FieldMaskUtil::GetFieldDescriptors(
-    const Descriptor* descriptor, StringPiece path,
-    std::vector<const FieldDescriptor*>* field_descriptors) {
-  if (field_descriptors != NULL) {
-    field_descriptors->clear();
-  }
-  std::vector<string> parts = Split(path, ".");
-  for (int i = 0; i < parts.size(); ++i) {
-    const string& field_name = parts[i];
-    if (descriptor == NULL) {
-      return false;
-    }
-    const FieldDescriptor* field = descriptor->FindFieldByName(field_name);
-    if (field == NULL) {
-      return false;
-    }
-    if (field_descriptors != NULL) {
-      field_descriptors->push_back(field);
-    }
-    if (!field->is_repeated() &&
-        field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-      descriptor = field->message_type();
-    } else {
-      descriptor = NULL;
-    }
-  }
-  return true;
-}
-
-void FieldMaskUtil::InternalGetFieldMaskForAllFields(
-    const Descriptor* descriptor, FieldMask* out) {
-  for (int i = 0; i < descriptor->field_count(); ++i) {
-    out->add_paths(descriptor->field(i)->name());
-  }
-}
-
-namespace {
-// A FieldMaskTree represents a FieldMask in a tree structure. For example,
-// given a FieldMask "foo.bar,foo.baz,bar.baz", the FieldMaskTree will be:
-//
-//   [root] -+- foo -+- bar
-//           |       |
-//           |       +- baz
-//           |
-//           +- bar --- baz
-//
-// In the tree, each leaf node represents a field path.
-class FieldMaskTree {
- public:
-  FieldMaskTree();
-  ~FieldMaskTree();
-
-  void MergeFromFieldMask(const FieldMask& mask);
-  void MergeToFieldMask(FieldMask* mask);
-
-  // Add a field path into the tree. In a FieldMask, each field path matches
-  // the specified field and also all its sub-fields. If the field path to
-  // add is a sub-path of an existing field path in the tree (i.e., a leaf
-  // node), it means the tree already matches the given path so nothing will
-  // be added to the tree. If the path matches an existing non-leaf node in the
-  // tree, that non-leaf node will be turned into a leaf node with all its
-  // children removed because the path matches all the node's children.
-  void AddPath(const string& path);
-
-  // Remove a path from the tree.
-  // If the path is a sub-path of an existing field path in the tree, it means
-  // we need remove the existing fied path and add all sub-paths except
-  // specified path. If the path matches an existing node in the tree, this node
-  // will be moved.
-  void RemovePath(const string& path, const Descriptor* descriptor);
-
-  // Calculate the intersection part of a field path with this tree and add
-  // the intersection field path into out.
-  void IntersectPath(const string& path, FieldMaskTree* out);
-
-  // Merge all fields specified by this tree from one message to another.
-  void MergeMessage(const Message& source,
-                    const FieldMaskUtil::MergeOptions& options,
-                    Message* destination) {
-    // Do nothing if the tree is empty.
-    if (root_.children.empty()) {
-      return;
-    }
-    MergeMessage(&root_, source, options, destination);
-  }
-
-  // Add required field path of the message to this tree based on current tree
-  // structure. If a message is present in the tree, add the path of its
-  // required field to the tree. This is to make sure that after trimming a
-  // message with required fields are set, check IsInitialized() will not fail.
-  void AddRequiredFieldPath(const Descriptor* descriptor) {
-    // Do nothing if the tree is empty.
-    if (root_.children.empty()) {
-      return;
-    }
-    AddRequiredFieldPath(&root_, descriptor);
-  }
-
-  // Trims all fields not specified by this tree from the given message.
-  void TrimMessage(Message* message) {
-    // Do nothing if the tree is empty.
-    if (root_.children.empty()) {
-      return;
-    }
-    TrimMessage(&root_, message);
-  }
-
- private:
-  struct Node {
-    Node() {}
-
-    ~Node() { ClearChildren(); }
-
-    void ClearChildren() {
-      for (std::map<string, Node*>::iterator it = children.begin();
-           it != children.end(); ++it) {
-        delete it->second;
-      }
-      children.clear();
-    }
-
-    std::map<string, Node*> children;
-
-   private:
-    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Node);
-  };
-
-  // Merge a sub-tree to mask. This method adds the field paths represented
-  // by all leaf nodes descended from "node" to mask.
-  void MergeToFieldMask(const string& prefix, const Node* node, FieldMask* out);
-
-  // Merge all leaf nodes of a sub-tree to another tree.
-  void MergeLeafNodesToTree(const string& prefix, const Node* node,
-                            FieldMaskTree* out);
-
-  // Merge all fields specified by a sub-tree from one message to another.
-  void MergeMessage(const Node* node, const Message& source,
-                    const FieldMaskUtil::MergeOptions& options,
-                    Message* destination);
-
-  // Add required field path of the message to this tree based on current tree
-  // structure. If a message is present in the tree, add the path of its
-  // required field to the tree. This is to make sure that after trimming a
-  // message with required fields are set, check IsInitialized() will not fail.
-  void AddRequiredFieldPath(Node* node, const Descriptor* descriptor);
-
-  // Trims all fields not specified by this sub-tree from the given message.
-  void TrimMessage(const Node* node, Message* message);
-
-  Node root_;
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldMaskTree);
-};
-
-FieldMaskTree::FieldMaskTree() {}
-
-FieldMaskTree::~FieldMaskTree() {}
-
-void FieldMaskTree::MergeFromFieldMask(const FieldMask& mask) {
-  for (int i = 0; i < mask.paths_size(); ++i) {
-    AddPath(mask.paths(i));
-  }
-}
-
-void FieldMaskTree::MergeToFieldMask(FieldMask* mask) {
-  MergeToFieldMask("", &root_, mask);
-}
-
-void FieldMaskTree::MergeToFieldMask(const string& prefix, const Node* node,
-                                     FieldMask* out) {
-  if (node->children.empty()) {
-    if (prefix.empty()) {
-      // This is the root node.
-      return;
-    }
-    out->add_paths(prefix);
-    return;
-  }
-  for (std::map<string, Node*>::const_iterator it = node->children.begin();
-       it != node->children.end(); ++it) {
-    string current_path = prefix.empty() ? it->first : prefix + "." + it->first;
-    MergeToFieldMask(current_path, it->second, out);
-  }
-}
-
-void FieldMaskTree::AddPath(const string& path) {
-  std::vector<string> parts = Split(path, ".");
-  if (parts.empty()) {
-    return;
-  }
-  bool new_branch = false;
-  Node* node = &root_;
-  for (int i = 0; i < parts.size(); ++i) {
-    if (!new_branch && node != &root_ && node->children.empty()) {
-      // Path matches an existing leaf node. This means the path is already
-      // coverred by this tree (for example, adding "foo.bar.baz" to a tree
-      // which already contains "foo.bar").
-      return;
-    }
-    const string& node_name = parts[i];
-    Node*& child = node->children[node_name];
-    if (child == NULL) {
-      new_branch = true;
-      child = new Node();
-    }
-    node = child;
-  }
-  if (!node->children.empty()) {
-    node->ClearChildren();
-  }
-}
-
-void FieldMaskTree::RemovePath(const string& path,
-                               const Descriptor* descriptor) {
-  std::vector<string> parts = Split(path, ".");
-  if (parts.empty()) {
-    return;
-  }
-  std::vector<Node*> nodes(parts.size());
-  Node* node = &root_;
-  const Descriptor* current_descriptor = descriptor;
-  Node* new_branch_node = NULL;
-  for (int i = 0; i < parts.size(); ++i) {
-    nodes[i] = node;
-    const FieldDescriptor* field_descriptor =
-        current_descriptor->FindFieldByName(parts[i]);
-    if (field_descriptor == NULL ||
-        (field_descriptor->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE &&
-         i != parts.size() - 1)) {
-      // Invalid path.
-      if (new_branch_node != NULL) {
-        // If add any new nodes, cleanup.
-        new_branch_node->ClearChildren();
-      }
-      return;
-    }
-
-    if (node->children.empty()) {
-      if (new_branch_node == NULL) {
-        new_branch_node = node;
-      }
-      for (int i = 0; i < current_descriptor->field_count(); ++i) {
-        node->children[current_descriptor->field(i)->name()] = new Node();
-      }
-    }
-    if (ContainsKey(node->children, parts[i])) {
-      node = node->children[parts[i]];
-      if (field_descriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-        current_descriptor = field_descriptor->message_type();
-      }
-    } else {
-      // Path does not exist.
-      return;
-    }
-  }
-  // Remove path.
-  for (int i = parts.size() - 1; i >= 0; i--) {
-    delete nodes[i]->children[parts[i]];
-    nodes[i]->children.erase(parts[i]);
-    if (!nodes[i]->children.empty()) {
-      break;
-    }
-  }
-}
-
-void FieldMaskTree::IntersectPath(const string& path, FieldMaskTree* out) {
-  std::vector<string> parts = Split(path, ".");
-  if (parts.empty()) {
-    return;
-  }
-  const Node* node = &root_;
-  for (int i = 0; i < parts.size(); ++i) {
-    if (node->children.empty()) {
-      if (node != &root_) {
-        out->AddPath(path);
-      }
-      return;
-    }
-    const string& node_name = parts[i];
-    const Node* result = FindPtrOrNull(node->children, node_name);
-    if (result == NULL) {
-      // No intersection found.
-      return;
-    }
-    node = result;
-  }
-  // Now we found a matching node with the given path. Add all leaf nodes
-  // to out.
-  MergeLeafNodesToTree(path, node, out);
-}
-
-void FieldMaskTree::MergeLeafNodesToTree(const string& prefix, const Node* node,
-                                         FieldMaskTree* out) {
-  if (node->children.empty()) {
-    out->AddPath(prefix);
-  }
-  for (std::map<string, Node*>::const_iterator it = node->children.begin();
-       it != node->children.end(); ++it) {
-    string current_path = prefix.empty() ? it->first : prefix + "." + it->first;
-    MergeLeafNodesToTree(current_path, it->second, out);
-  }
-}
-
-void FieldMaskTree::MergeMessage(const Node* node, const Message& source,
-                                 const FieldMaskUtil::MergeOptions& options,
-                                 Message* destination) {
-  GOOGLE_DCHECK(!node->children.empty());
-  const Reflection* source_reflection = source.GetReflection();
-  const Reflection* destination_reflection = destination->GetReflection();
-  const Descriptor* descriptor = source.GetDescriptor();
-  for (std::map<string, Node*>::const_iterator it = node->children.begin();
-       it != node->children.end(); ++it) {
-    const string& field_name = it->first;
-    const Node* child = it->second;
-    const FieldDescriptor* field = descriptor->FindFieldByName(field_name);
-    if (field == NULL) {
-      GOOGLE_LOG(ERROR) << "Cannot find field \"" << field_name << "\" in message "
-                 << descriptor->full_name();
-      continue;
-    }
-    if (!child->children.empty()) {
-      // Sub-paths are only allowed for singular message fields.
-      if (field->is_repeated() ||
-          field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) {
-        GOOGLE_LOG(ERROR) << "Field \"" << field_name << "\" in message "
-                   << descriptor->full_name()
-                   << " is not a singular message field and cannot "
-                   << "have sub-fields.";
-        continue;
-      }
-      MergeMessage(child, source_reflection->GetMessage(source, field), options,
-                   destination_reflection->MutableMessage(destination, field));
-      continue;
-    }
-    if (!field->is_repeated()) {
-      switch (field->cpp_type()) {
-#define COPY_VALUE(TYPE, Name)                                              \
-  case FieldDescriptor::CPPTYPE_##TYPE: {                                   \
-    if (source_reflection->HasField(source, field)) {                       \
-      destination_reflection->Set##Name(                                    \
-          destination, field, source_reflection->Get##Name(source, field)); \
-    } else {                                                                \
-      destination_reflection->ClearField(destination, field);               \
-    }                                                                       \
-    break;                                                                  \
-  }
-        COPY_VALUE(BOOL, Bool)
-        COPY_VALUE(INT32, Int32)
-        COPY_VALUE(INT64, Int64)
-        COPY_VALUE(UINT32, UInt32)
-        COPY_VALUE(UINT64, UInt64)
-        COPY_VALUE(FLOAT, Float)
-        COPY_VALUE(DOUBLE, Double)
-        COPY_VALUE(ENUM, Enum)
-        COPY_VALUE(STRING, String)
-#undef COPY_VALUE
-        case FieldDescriptor::CPPTYPE_MESSAGE: {
-          if (options.replace_message_fields()) {
-            destination_reflection->ClearField(destination, field);
-          }
-          if (source_reflection->HasField(source, field)) {
-            destination_reflection->MutableMessage(destination, field)
-                ->MergeFrom(source_reflection->GetMessage(source, field));
-          }
-          break;
-        }
-      }
-    } else {
-      if (options.replace_repeated_fields()) {
-        destination_reflection->ClearField(destination, field);
-      }
-      switch (field->cpp_type()) {
-#define COPY_REPEATED_VALUE(TYPE, Name)                            \
-  case FieldDescriptor::CPPTYPE_##TYPE: {                          \
-    int size = source_reflection->FieldSize(source, field);        \
-    for (int i = 0; i < size; ++i) {                               \
-      destination_reflection->Add##Name(                           \
-          destination, field,                                      \
-          source_reflection->GetRepeated##Name(source, field, i)); \
-    }                                                              \
-    break;                                                         \
-  }
-        COPY_REPEATED_VALUE(BOOL, Bool)
-        COPY_REPEATED_VALUE(INT32, Int32)
-        COPY_REPEATED_VALUE(INT64, Int64)
-        COPY_REPEATED_VALUE(UINT32, UInt32)
-        COPY_REPEATED_VALUE(UINT64, UInt64)
-        COPY_REPEATED_VALUE(FLOAT, Float)
-        COPY_REPEATED_VALUE(DOUBLE, Double)
-        COPY_REPEATED_VALUE(ENUM, Enum)
-        COPY_REPEATED_VALUE(STRING, String)
-#undef COPY_REPEATED_VALUE
-        case FieldDescriptor::CPPTYPE_MESSAGE: {
-          int size = source_reflection->FieldSize(source, field);
-          for (int i = 0; i < size; ++i) {
-            destination_reflection->AddMessage(destination, field)
-                ->MergeFrom(
-                    source_reflection->GetRepeatedMessage(source, field, i));
-          }
-          break;
-        }
-      }
-    }
-  }
-}
-
-void FieldMaskTree::AddRequiredFieldPath(
-    Node* node, const Descriptor* descriptor) {
-  const int32 field_count = descriptor->field_count();
-  for (int index = 0; index < field_count; ++index) {
-    const FieldDescriptor* field = descriptor->field(index);
-    if (field->is_required()) {
-      const string& node_name = field->name();
-      Node*& child = node->children[node_name];
-      if (child == NULL) {
-        // Add required field path to the tree
-        child = new Node();
-      } else if (child->children.empty()){
-        // If the required field is in the tree and does not have any children,
-        // do nothing.
-        continue;
-      }
-      // Add required field in the children to the tree if the field is message.
-      if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-        AddRequiredFieldPath(child, field->message_type());
-      }
-    } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-      std::map<string, Node*>::const_iterator it =
-          node->children.find(field->name());
-      if (it != node->children.end()) {
-        // Add required fields in the children to the
-        // tree if the field is a message and present in the tree.
-        Node* child = it->second;
-        if (!child->children.empty()) {
-          AddRequiredFieldPath(child, field->message_type());
-        }
-      }
-    }
-  }
-}
-
-void FieldMaskTree::TrimMessage(const Node* node, Message* message) {
-  GOOGLE_DCHECK(!node->children.empty());
-  const Reflection* reflection = message->GetReflection();
-  const Descriptor* descriptor = message->GetDescriptor();
-  const int32 field_count = descriptor->field_count();
-  for (int index = 0; index < field_count; ++index) {
-    const FieldDescriptor* field = descriptor->field(index);
-    std::map<string, Node*>::const_iterator it =
-        node->children.find(field->name());
-    if (it == node->children.end()) {
-      reflection->ClearField(message, field);
-    } else {
-      if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-        Node* child = it->second;
-        if (!child->children.empty() && reflection->HasField(*message, field)) {
-          TrimMessage(child, reflection->MutableMessage(message, field));
-        }
-      }
-    }
-  }
-}
-
-}  // namespace
-
-void FieldMaskUtil::ToCanonicalForm(const FieldMask& mask, FieldMask* out) {
-  FieldMaskTree tree;
-  tree.MergeFromFieldMask(mask);
-  out->Clear();
-  tree.MergeToFieldMask(out);
-}
-
-void FieldMaskUtil::Union(const FieldMask& mask1, const FieldMask& mask2,
-                          FieldMask* out) {
-  FieldMaskTree tree;
-  tree.MergeFromFieldMask(mask1);
-  tree.MergeFromFieldMask(mask2);
-  out->Clear();
-  tree.MergeToFieldMask(out);
-}
-
-void FieldMaskUtil::Intersect(const FieldMask& mask1, const FieldMask& mask2,
-                              FieldMask* out) {
-  FieldMaskTree tree, intersection;
-  tree.MergeFromFieldMask(mask1);
-  for (int i = 0; i < mask2.paths_size(); ++i) {
-    tree.IntersectPath(mask2.paths(i), &intersection);
-  }
-  out->Clear();
-  intersection.MergeToFieldMask(out);
-}
-
-void FieldMaskUtil::InternalSubtract(const Descriptor* descriptor,
-                                     const FieldMask& mask1,
-                                     const FieldMask& mask2, FieldMask* out) {
-  if (mask1.paths().empty()) {
-    out->Clear();
-    return;
-  }
-  FieldMaskTree tree;
-  tree.MergeFromFieldMask(mask1);
-  for (int i = 0; i < mask2.paths_size(); ++i) {
-    tree.RemovePath(mask2.paths(i), descriptor);
-  }
-  out->Clear();
-  tree.MergeToFieldMask(out);
-}
-
-bool FieldMaskUtil::IsPathInFieldMask(StringPiece path, const FieldMask& mask) {
-  for (int i = 0; i < mask.paths_size(); ++i) {
-    const string& mask_path = mask.paths(i);
-    if (path == mask_path) {
-      return true;
-    } else if (mask_path.length() < path.length()) {
-      // Also check whether mask.paths(i) is a prefix of path.
-      if (path.substr(0, mask_path.length() + 1).compare(mask_path + ".") ==
-          0) {
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-void FieldMaskUtil::MergeMessageTo(const Message& source, const FieldMask& mask,
-                                   const MergeOptions& options,
-                                   Message* destination) {
-  GOOGLE_CHECK(source.GetDescriptor() == destination->GetDescriptor());
-  // Build a FieldMaskTree and walk through the tree to merge all specified
-  // fields.
-  FieldMaskTree tree;
-  tree.MergeFromFieldMask(mask);
-  tree.MergeMessage(source, options, destination);
-}
-
-void FieldMaskUtil::TrimMessage(const FieldMask& mask, Message* destination) {
-  // Build a FieldMaskTree and walk through the tree to merge all specified
-  // fields.
-  FieldMaskTree tree;
-  tree.MergeFromFieldMask(mask);
-  tree.TrimMessage(GOOGLE_CHECK_NOTNULL(destination));
-}
-
-void FieldMaskUtil::TrimMessage(const FieldMask& mask, Message* destination,
-                                const TrimOptions& options) {
-  // Build a FieldMaskTree and walk through the tree to merge all specified
-  // fields.
-  FieldMaskTree tree;
-  tree.MergeFromFieldMask(mask);
-  // If keep_required_fields is true, implicitely add required fields of
-  // a message present in the tree to prevent from trimming.
-  if (options.keep_required_fields()) {
-    tree.AddRequiredFieldPath(GOOGLE_CHECK_NOTNULL(destination->GetDescriptor()));
-  }
-  tree.TrimMessage(GOOGLE_CHECK_NOTNULL(destination));
-}
-
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/field_mask_util.h b/3rdparty/protobuf/src/google/protobuf/util/field_mask_util.h
deleted file mode 100644 (file)
index 01642c6..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Defines utilities for the FieldMask well known type.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__
-#define GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__
-
-#include <string>
-
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/field_mask.pb.h>
-#include <google/protobuf/stubs/stringpiece.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-class LIBPROTOBUF_EXPORT FieldMaskUtil {
-  typedef google::protobuf::FieldMask FieldMask;
-
- public:
-  // Converts FieldMask to/from string, formatted by separating each path
-  // with a comma (e.g., "foo_bar,baz.quz").
-  static string ToString(const FieldMask& mask);
-  static void FromString(StringPiece str, FieldMask* out);
-
-  // Converts FieldMask to/from string, formatted according to proto3 JSON
-  // spec for FieldMask (e.g., "fooBar,baz.quz"). If the field name is not
-  // style conforming (i.e., not snake_case when converted to string, or not
-  // camelCase when converted from string), the conversion will fail.
-  static bool ToJsonString(const FieldMask& mask, string* out);
-  static bool FromJsonString(StringPiece str, FieldMask* out);
-
-  // Get the descriptors of the fields which the given path from the message
-  // descriptor traverses, if field_descriptors is not null.
-  // Return false if the path is not valid, and the content of field_descriptors
-  // is unspecified.
-  static bool GetFieldDescriptors(
-      const Descriptor* descriptor, StringPiece path,
-      std::vector<const FieldDescriptor*>* field_descriptors);
-
-  // Checks whether the given path is valid for type T.
-  template <typename T>
-  static bool IsValidPath(StringPiece path) {
-    return GetFieldDescriptors(T::descriptor(), path, NULL);
-  }
-
-  // Checks whether the given FieldMask is valid for type T.
-  template <typename T>
-  static bool IsValidFieldMask(const FieldMask& mask) {
-    for (int i = 0; i < mask.paths_size(); ++i) {
-      if (!GetFieldDescriptors(T::descriptor(), mask.paths(i), NULL))
-        return false;
-    }
-    return true;
-  }
-
-  // Adds a path to FieldMask after checking whether the given path is valid.
-  // This method check-fails if the path is not a valid path for type T.
-  template <typename T>
-  static void AddPathToFieldMask(StringPiece path, FieldMask* mask) {
-    GOOGLE_CHECK(IsValidPath<T>(path));
-    mask->add_paths(path);
-  }
-
-  // Creates a FieldMask with all fields of type T. This FieldMask only
-  // contains fields of T but not any sub-message fields.
-  template <typename T>
-  static void GetFieldMaskForAllFields(FieldMask* out) {
-    InternalGetFieldMaskForAllFields(T::descriptor(), out);
-  }
-
-  // Converts a FieldMask to the canonical form. It will:
-  //   1. Remove paths that are covered by another path. For example,
-  //      "foo.bar" is covered by "foo" and will be removed if "foo"
-  //      is also in the FieldMask.
-  //   2. Sort all paths in alphabetical order.
-  static void ToCanonicalForm(const FieldMask& mask, FieldMask* out);
-
-  // Creates an union of two FieldMasks.
-  static void Union(const FieldMask& mask1, const FieldMask& mask2,
-                    FieldMask* out);
-
-  // Creates an intersection of two FieldMasks.
-  static void Intersect(const FieldMask& mask1, const FieldMask& mask2,
-                        FieldMask* out);
-
-  // Subtracts mask2 from mask1 base of type T.
-  template <typename T>
-  static void Subtract(const FieldMask& mask1, const FieldMask& mask2,
-                       FieldMask* out) {
-    InternalSubtract(T::descriptor(), mask1, mask2, out);
-  }
-
-  // Returns true if path is covered by the given FieldMask. Note that path
-  // "foo.bar" covers all paths like "foo.bar.baz", "foo.bar.quz.x", etc.
-  static bool IsPathInFieldMask(StringPiece path, const FieldMask& mask);
-
-  class MergeOptions;
-  // Merges fields specified in a FieldMask into another message. See the
-  // comments in MergeOptions regarding compatibility with
-  // google/protobuf/field_mask.proto
-  static void MergeMessageTo(const Message& source, const FieldMask& mask,
-                             const MergeOptions& options, Message* destination);
-
-  class TrimOptions;
-  // Removes from 'message' any field that is not represented in the given
-  // FieldMask. If the FieldMask is empty, does nothing.
-  static void TrimMessage(const FieldMask& mask, Message* message);
-
-  // Removes from 'message' any field that is not represented in the given
-  // FieldMask with customized TrimOptions.
-  // If the FieldMask is empty, does nothing.
-  static void TrimMessage(const FieldMask& mask, Message* message,
-                          const TrimOptions& options);
-
- private:
-  friend class SnakeCaseCamelCaseTest;
-  // Converts a field name from snake_case to camelCase:
-  //   1. Every character after "_" will be converted to uppercase.
-  //   2. All "_"s are removed.
-  // The conversion will fail if:
-  //   1. The field name contains uppercase letters.
-  //   2. Any character after a "_" is not a lowercase letter.
-  // If the conversion succeeds, it's guaranteed that the resulted
-  // camelCase name will yield the original snake_case name when
-  // converted using CamelCaseToSnakeCase().
-  //
-  // Note that the input can contain characters not allowed in C identifiers.
-  // For example, "foo_bar,baz_quz" will be converted to "fooBar,bazQuz"
-  // successfully.
-  static bool SnakeCaseToCamelCase(StringPiece input, string* output);
-  // Converts a field name from camelCase to snake_case:
-  //   1. Every uppercase letter is converted to lowercase with a additional
-  //      preceding "-".
-  // The conversion will fail if:
-  //   1. The field name contains "_"s.
-  // If the conversion succeeds, it's guaranteed that the resulted
-  // snake_case name will yield the original camelCase name when
-  // converted using SnakeCaseToCamelCase().
-  //
-  // Note that the input can contain characters not allowed in C identifiers.
-  // For example, "fooBar,bazQuz" will be converted to "foo_bar,baz_quz"
-  // successfully.
-  static bool CamelCaseToSnakeCase(StringPiece input, string* output);
-
-  static void InternalGetFieldMaskForAllFields(const Descriptor* descriptor,
-                                               FieldMask* out);
-
-  static void InternalSubtract(const Descriptor* descriptor,
-                               const FieldMask& mask1, const FieldMask& mask2,
-                               FieldMask* out);
-};
-
-// Note that for compatibility with the defined behaviour for FieldMask in
-// google/protobuf/field_mask.proto, set replace_message_fields and
-// replace_repeated_fields to 'true'. The default options are not compatible
-// with google/protobuf/field_mask.proto.
-class LIBPROTOBUF_EXPORT FieldMaskUtil::MergeOptions {
- public:
-  MergeOptions()
-      : replace_message_fields_(false), replace_repeated_fields_(false) {}
-  // When merging message fields, the default behavior is to merge the
-  // content of two message fields together. If you instead want to use
-  // the field from the source message to replace the corresponding field
-  // in the destination message, set this flag to true. When this flag is set,
-  // specified submessage fields that are missing in source will be cleared in
-  // destination.
-  void set_replace_message_fields(bool value) {
-    replace_message_fields_ = value;
-  }
-  bool replace_message_fields() const { return replace_message_fields_; }
-  // The default merging behavior will append entries from the source
-  // repeated field to the destination repeated field. If you only want
-  // to keep the entries from the source repeated field, set this flag
-  // to true.
-  void set_replace_repeated_fields(bool value) {
-    replace_repeated_fields_ = value;
-  }
-  bool replace_repeated_fields() const { return replace_repeated_fields_; }
-
- private:
-  bool replace_message_fields_;
-  bool replace_repeated_fields_;
-};
-
-class LIBPROTOBUF_EXPORT FieldMaskUtil::TrimOptions {
- public:
-  TrimOptions()
-      : keep_required_fields_(false) {}
-  // When trimming message fields, the default behavior is to trim required
-  // fields of the present message if they are not specified in the field mask.
-  // If you instead want to keep required fields of the present message even
-  // they are not speicifed in the field mask, set this flag to true.
-  void set_keep_required_fields(bool value) {
-    keep_required_fields_ = value;
-  }
-  bool keep_required_fields() const { return keep_required_fields_; }
-
- private:
-  bool keep_required_fields_;
-};
-
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/constants.h b/3rdparty/protobuf/src/google/protobuf/util/internal/constants.h
deleted file mode 100644 (file)
index a018a09..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_CONSTANTS_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_CONSTANTS_H__
-
-#include <google/protobuf/stubs/common.h>
-
-// This file contains constants used by //net/proto2/util/converter.
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-// Prefix for type URLs.
-const char kTypeServiceBaseUrl[] = "type.googleapis.com";
-
-// Format string for RFC3339 timestamp formatting.
-const char kRfc3339TimeFormat[] = "%E4Y-%m-%dT%H:%M:%S";
-
-// Same as above, but the year value is not zero-padded i.e. this accepts
-// timestamps like "1-01-0001T23:59:59Z" instead of "0001-01-0001T23:59:59Z".
-const char kRfc3339TimeFormatNoPadding[] = "%Y-%m-%dT%H:%M:%S";
-
-// Minimun seconds allowed in a google.protobuf.Timestamp value.
-const int64 kTimestampMinSeconds = -62135596800LL;
-
-// Maximum seconds allowed in a google.protobuf.Timestamp value.
-const int64 kTimestampMaxSeconds = 253402300799LL;
-
-// Minimum seconds allowed in a google.protobuf.Duration value.
-const int64 kDurationMinSeconds = -315576000000LL;
-
-// Maximum seconds allowed in a google.protobuf.Duration value.
-const int64 kDurationMaxSeconds = 315576000000LL;
-
-// Nano seconds in a second.
-const int32 kNanosPerSecond = 1000000000;
-
-// Type url representing NULL values in google.protobuf.Struct type.
-const char kStructNullValueTypeUrl[] =
-    "type.googleapis.com/google.protobuf.NullValue";
-
-// Type string for google.protobuf.Struct
-const char kStructType[] = "google.protobuf.Struct";
-
-// Type string for struct.proto's google.protobuf.Value value type.
-const char kStructValueType[] = "google.protobuf.Value";
-
-// Type string for struct.proto's google.protobuf.ListValue value type.
-const char kStructListValueType[] = "google.protobuf.ListValue";
-
-// Type string for google.protobuf.Timestamp
-const char kTimestampType[] = "google.protobuf.Timestamp";
-
-// Type string for google.protobuf.Duration
-const char kDurationType[] = "google.protobuf.Duration";
-
-// Type URL for struct value type google.protobuf.Value
-const char kStructValueTypeUrl[] = "type.googleapis.com/google.protobuf.Value";
-
-// Type URL for struct value type google.protobuf.Value
-const char kStructTypeUrl[] = "type.googleapis.com/google.protobuf.Struct";
-
-// Type string for google.protobuf.Any
-const char kAnyType[] = "google.protobuf.Any";
-
-// The type URL of google.protobuf.FieldMask;
-const char kFieldMaskTypeUrl[] =
-    "type.googleapis.com/google.protobuf.FieldMask";
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_CONSTANTS_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/datapiece.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/datapiece.cc
deleted file mode 100644 (file)
index 213c2c4..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/datapiece.h>
-
-#include <google/protobuf/struct.pb.h>
-#include <google/protobuf/type.pb.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/mathlimits.h>
-#include <google/protobuf/stubs/mathutil.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-using google::protobuf::EnumDescriptor;
-using google::protobuf::EnumValueDescriptor;
-;
-;
-;
-using util::error::Code;
-using util::Status;
-using util::StatusOr;
-
-namespace {
-
-inline Status InvalidArgument(StringPiece value_str) {
-  return Status(util::error::INVALID_ARGUMENT, value_str);
-}
-
-template <typename To, typename From>
-StatusOr<To> ValidateNumberConversion(To after, From before) {
-  if (after == before &&
-      MathUtil::Sign<From>(before) == MathUtil::Sign<To>(after)) {
-    return after;
-  } else {
-    return InvalidArgument(::google::protobuf::internal::is_integral<From>::value
-                               ? ValueAsString(before)
-                               : ::google::protobuf::internal::is_same<From, double>::value
-                                     ? DoubleAsString(before)
-                                     : FloatAsString(before));
-  }
-}
-
-// For general conversion between
-//     int32, int64, uint32, uint64, double and float
-// except conversion between double and float.
-template <typename To, typename From>
-StatusOr<To> NumberConvertAndCheck(From before) {
-  if (::google::protobuf::internal::is_same<From, To>::value) return before;
-
-  To after = static_cast<To>(before);
-  return ValidateNumberConversion(after, before);
-}
-
-// For conversion to integer types (int32, int64, uint32, uint64) from floating
-// point types (double, float) only.
-template <typename To, typename From>
-StatusOr<To> FloatingPointToIntConvertAndCheck(From before) {
-  if (::google::protobuf::internal::is_same<From, To>::value) return before;
-
-  To after = static_cast<To>(before);
-  return ValidateNumberConversion(after, before);
-}
-
-// For conversion between double and float only.
-StatusOr<double> FloatToDouble(float before) {
-  // Casting float to double should just work as double has more precision
-  // than float.
-  return static_cast<double>(before);
-}
-
-StatusOr<float> DoubleToFloat(double before) {
-  if (MathLimits<double>::IsNaN(before)) {
-    return std::numeric_limits<float>::quiet_NaN();
-  } else if (!MathLimits<double>::IsFinite(before)) {
-    // Converting a double +inf/-inf to float should just work.
-    return static_cast<float>(before);
-  } else if (before > std::numeric_limits<float>::max() ||
-             before < -std::numeric_limits<float>::max()) {
-    // Double value outside of the range of float.
-    return InvalidArgument(DoubleAsString(before));
-  } else {
-    return static_cast<float>(before);
-  }
-}
-
-}  // namespace
-
-StatusOr<int32> DataPiece::ToInt32() const {
-  if (type_ == TYPE_STRING) return StringToNumber<int32>(safe_strto32);
-
-  if (type_ == TYPE_DOUBLE)
-    return FloatingPointToIntConvertAndCheck<int32, double>(double_);
-
-  if (type_ == TYPE_FLOAT)
-    return FloatingPointToIntConvertAndCheck<int32, float>(float_);
-
-  return GenericConvert<int32>();
-}
-
-StatusOr<uint32> DataPiece::ToUint32() const {
-  if (type_ == TYPE_STRING) return StringToNumber<uint32>(safe_strtou32);
-
-  if (type_ == TYPE_DOUBLE)
-    return FloatingPointToIntConvertAndCheck<uint32, double>(double_);
-
-  if (type_ == TYPE_FLOAT)
-    return FloatingPointToIntConvertAndCheck<uint32, float>(float_);
-
-  return GenericConvert<uint32>();
-}
-
-StatusOr<int64> DataPiece::ToInt64() const {
-  if (type_ == TYPE_STRING) return StringToNumber<int64>(safe_strto64);
-
-  if (type_ == TYPE_DOUBLE)
-    return FloatingPointToIntConvertAndCheck<int64, double>(double_);
-
-  if (type_ == TYPE_FLOAT)
-    return FloatingPointToIntConvertAndCheck<int64, float>(float_);
-
-  return GenericConvert<int64>();
-}
-
-StatusOr<uint64> DataPiece::ToUint64() const {
-  if (type_ == TYPE_STRING) return StringToNumber<uint64>(safe_strtou64);
-
-  if (type_ == TYPE_DOUBLE)
-    return FloatingPointToIntConvertAndCheck<uint64, double>(double_);
-
-  if (type_ == TYPE_FLOAT)
-    return FloatingPointToIntConvertAndCheck<uint64, float>(float_);
-
-  return GenericConvert<uint64>();
-}
-
-StatusOr<double> DataPiece::ToDouble() const {
-  if (type_ == TYPE_FLOAT) {
-    return FloatToDouble(float_);
-  }
-  if (type_ == TYPE_STRING) {
-    if (str_ == "Infinity") return std::numeric_limits<double>::infinity();
-    if (str_ == "-Infinity") return -std::numeric_limits<double>::infinity();
-    if (str_ == "NaN") return std::numeric_limits<double>::quiet_NaN();
-    StatusOr<double> value = StringToNumber<double>(safe_strtod);
-    if (value.ok() && !MathLimits<double>::IsFinite(value.ValueOrDie())) {
-      // safe_strtod converts out-of-range values to +inf/-inf, but we want
-      // to report them as errors.
-      return InvalidArgument(StrCat("\"", str_, "\""));
-    } else {
-      return value;
-    }
-  }
-  return GenericConvert<double>();
-}
-
-StatusOr<float> DataPiece::ToFloat() const {
-  if (type_ == TYPE_DOUBLE) {
-    return DoubleToFloat(double_);
-  }
-  if (type_ == TYPE_STRING) {
-    if (str_ == "Infinity") return std::numeric_limits<float>::infinity();
-    if (str_ == "-Infinity") return -std::numeric_limits<float>::infinity();
-    if (str_ == "NaN") return std::numeric_limits<float>::quiet_NaN();
-    // SafeStrToFloat() is used instead of safe_strtof() because the later
-    // does not fail on inputs like SimpleDtoa(DBL_MAX).
-    return StringToNumber<float>(SafeStrToFloat);
-  }
-  return GenericConvert<float>();
-}
-
-StatusOr<bool> DataPiece::ToBool() const {
-  switch (type_) {
-    case TYPE_BOOL:
-      return bool_;
-    case TYPE_STRING:
-      return StringToNumber<bool>(safe_strtob);
-    default:
-      return InvalidArgument(
-          ValueAsStringOrDefault("Wrong type. Cannot convert to Bool."));
-  }
-}
-
-StatusOr<string> DataPiece::ToString() const {
-  switch (type_) {
-    case TYPE_STRING:
-      return str_.ToString();
-    case TYPE_BYTES: {
-      string base64;
-      Base64Escape(str_, &base64);
-      return base64;
-    }
-    default:
-      return InvalidArgument(
-          ValueAsStringOrDefault("Cannot convert to string."));
-  }
-}
-
-string DataPiece::ValueAsStringOrDefault(StringPiece default_string) const {
-  switch (type_) {
-    case TYPE_INT32:
-      return SimpleItoa(i32_);
-    case TYPE_INT64:
-      return SimpleItoa(i64_);
-    case TYPE_UINT32:
-      return SimpleItoa(u32_);
-    case TYPE_UINT64:
-      return SimpleItoa(u64_);
-    case TYPE_DOUBLE:
-      return DoubleAsString(double_);
-    case TYPE_FLOAT:
-      return FloatAsString(float_);
-    case TYPE_BOOL:
-      return SimpleBtoa(bool_);
-    case TYPE_STRING:
-      return StrCat("\"", str_.ToString(), "\"");
-    case TYPE_BYTES: {
-      string base64;
-      WebSafeBase64Escape(str_, &base64);
-      return StrCat("\"", base64, "\"");
-    }
-    case TYPE_NULL:
-      return "null";
-    default:
-      return default_string.ToString();
-  }
-}
-
-StatusOr<string> DataPiece::ToBytes() const {
-  if (type_ == TYPE_BYTES) return str_.ToString();
-  if (type_ == TYPE_STRING) {
-    string decoded;
-    if (!DecodeBase64(str_, &decoded)) {
-      return InvalidArgument(ValueAsStringOrDefault("Invalid data in input."));
-    }
-    return decoded;
-  } else {
-    return InvalidArgument(ValueAsStringOrDefault(
-        "Wrong type. Only String or Bytes can be converted to Bytes."));
-  }
-}
-
-StatusOr<int> DataPiece::ToEnum(const google::protobuf::Enum* enum_type,
-                                bool use_lower_camel_for_enums) const {
-  if (type_ == TYPE_NULL) return google::protobuf::NULL_VALUE;
-
-  if (type_ == TYPE_STRING) {
-    // First try the given value as a name.
-    string enum_name = str_.ToString();
-    const google::protobuf::EnumValue* value =
-        FindEnumValueByNameOrNull(enum_type, enum_name);
-    if (value != NULL) return value->number();
-
-    // Check if int version of enum is sent as string.
-    StatusOr<int32> int_value = ToInt32();
-    if (int_value.ok()) {
-      if (const google::protobuf::EnumValue* enum_value =
-              FindEnumValueByNumberOrNull(enum_type, int_value.ValueOrDie())) {
-        return enum_value->number();
-      }
-    }
-
-    // Next try a normalized name.
-    for (string::iterator it = enum_name.begin(); it != enum_name.end(); ++it) {
-      *it = *it == '-' ? '_' : ascii_toupper(*it);
-    }
-    value = FindEnumValueByNameOrNull(enum_type, enum_name);
-    if (value != NULL) return value->number();
-
-    // If use_lower_camel_for_enums is true try with enum name without
-    // underscore. This will also accept camel case names as the enum_name has
-    // been normalized before.
-    if (use_lower_camel_for_enums) {
-      value = FindEnumValueByNameWithoutUnderscoreOrNull(enum_type, enum_name);
-      if (value != NULL) return value->number();
-    }
-  } else {
-    // We don't need to check whether the value is actually declared in the
-    // enum because we preserve unknown enum values as well.
-    return ToInt32();
-  }
-  return InvalidArgument(
-      ValueAsStringOrDefault("Cannot find enum with given value."));
-}
-
-template <typename To>
-StatusOr<To> DataPiece::GenericConvert() const {
-  switch (type_) {
-    case TYPE_INT32:
-      return NumberConvertAndCheck<To, int32>(i32_);
-    case TYPE_INT64:
-      return NumberConvertAndCheck<To, int64>(i64_);
-    case TYPE_UINT32:
-      return NumberConvertAndCheck<To, uint32>(u32_);
-    case TYPE_UINT64:
-      return NumberConvertAndCheck<To, uint64>(u64_);
-    case TYPE_DOUBLE:
-      return NumberConvertAndCheck<To, double>(double_);
-    case TYPE_FLOAT:
-      return NumberConvertAndCheck<To, float>(float_);
-    default:  // TYPE_ENUM, TYPE_STRING, TYPE_CORD, TYPE_BOOL
-      return InvalidArgument(ValueAsStringOrDefault(
-          "Wrong type. Bool, Enum, String and Cord not supported in "
-          "GenericConvert."));
-  }
-}
-
-template <typename To>
-StatusOr<To> DataPiece::StringToNumber(bool (*func)(StringPiece, To*)) const {
-  if (str_.size() > 0 && (str_[0] == ' ' || str_[str_.size() - 1] == ' ')) {
-    return InvalidArgument(StrCat("\"", str_, "\""));
-  }
-  To result;
-  if (func(str_, &result)) return result;
-  return InvalidArgument(StrCat("\"", str_.ToString(), "\""));
-}
-
-bool DataPiece::DecodeBase64(StringPiece src, string* dest) const {
-  // Try web-safe decode first, if it fails, try the non-web-safe decode.
-  if (WebSafeBase64Unescape(src, dest)) {
-    if (use_strict_base64_decoding_) {
-      // In strict mode, check if the escaped version gives us the same value as
-      // unescaped.
-      string encoded;
-      // WebSafeBase64Escape does no padding by default.
-      WebSafeBase64Escape(*dest, &encoded);
-      // Remove trailing padding '=' characters before comparison.
-      StringPiece src_no_padding = StringPiece(src).substr(
-          0, src.ends_with("=") ? src.find_last_not_of('=') + 1 : src.length());
-      return encoded == src_no_padding;
-    }
-    return true;
-  }
-
-  if (Base64Unescape(src, dest)) {
-    if (use_strict_base64_decoding_) {
-      string encoded;
-      Base64Escape(
-          reinterpret_cast<const unsigned char*>(dest->data()), dest->length(),
-          &encoded, false);
-      StringPiece src_no_padding = StringPiece(src).substr(
-          0, src.ends_with("=") ? src.find_last_not_of('=') + 1 : src.length());
-      return encoded == src_no_padding;
-    }
-    return true;
-  }
-
-  return false;
-}
-
-void DataPiece::InternalCopy(const DataPiece& other) {
-  type_ = other.type_;
-  use_strict_base64_decoding_ = other.use_strict_base64_decoding_;
-  switch (type_) {
-    case TYPE_INT32:
-    case TYPE_INT64:
-    case TYPE_UINT32:
-    case TYPE_UINT64:
-    case TYPE_DOUBLE:
-    case TYPE_FLOAT:
-    case TYPE_BOOL:
-    case TYPE_ENUM:
-    case TYPE_NULL:
-    case TYPE_BYTES:
-    case TYPE_STRING: {
-      str_ = other.str_;
-      break;
-    }
-  }
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/datapiece.h b/3rdparty/protobuf/src/google/protobuf/util/internal/datapiece.h
deleted file mode 100644 (file)
index 83516d0..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_DATAPIECE_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_DATAPIECE_H__
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/statusor.h>
-
-
-namespace google {
-namespace protobuf {
-class Enum;
-}  // namespace protobuf
-
-
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// Container for a single piece of data together with its data type.
-//
-// For primitive types (int32, int64, uint32, uint64, double, float, bool),
-// the data is stored by value.
-//
-// For string, a StringPiece is stored. For Cord, a pointer to Cord is stored.
-// Just like StringPiece, the DataPiece class does not own the storage for
-// the actual string or Cord, so it is the user's responsiblity to guarantee
-// that the underlying storage is still valid when the DataPiece is accessed.
-class LIBPROTOBUF_EXPORT DataPiece {
- public:
-  // Identifies data type of the value.
-  // These are the types supported by DataPiece.
-  enum Type {
-    TYPE_INT32 = 1,
-    TYPE_INT64 = 2,
-    TYPE_UINT32 = 3,
-    TYPE_UINT64 = 4,
-    TYPE_DOUBLE = 5,
-    TYPE_FLOAT = 6,
-    TYPE_BOOL = 7,
-    TYPE_ENUM = 8,
-    TYPE_STRING = 9,
-    TYPE_BYTES = 10,
-    TYPE_NULL = 11,  // explicit NULL type
-  };
-
-  // Constructors and Destructor
-  explicit DataPiece(const int32 value)
-      : type_(TYPE_INT32), i32_(value), use_strict_base64_decoding_(false) {}
-  explicit DataPiece(const int64 value)
-      : type_(TYPE_INT64), i64_(value), use_strict_base64_decoding_(false) {}
-  explicit DataPiece(const uint32 value)
-      : type_(TYPE_UINT32), u32_(value), use_strict_base64_decoding_(false) {}
-  explicit DataPiece(const uint64 value)
-      : type_(TYPE_UINT64), u64_(value), use_strict_base64_decoding_(false) {}
-  explicit DataPiece(const double value)
-      : type_(TYPE_DOUBLE),
-        double_(value),
-        use_strict_base64_decoding_(false) {}
-  explicit DataPiece(const float value)
-      : type_(TYPE_FLOAT), float_(value), use_strict_base64_decoding_(false) {}
-  explicit DataPiece(const bool value)
-      : type_(TYPE_BOOL), bool_(value), use_strict_base64_decoding_(false) {}
-  DataPiece(StringPiece value, bool use_strict_base64_decoding)
-      : type_(TYPE_STRING),
-        str_(StringPiecePod::CreateFromStringPiece(value)),
-        use_strict_base64_decoding_(use_strict_base64_decoding) {}
-  // Constructor for bytes. The second parameter is not used.
-  DataPiece(StringPiece value, bool dummy, bool use_strict_base64_decoding)
-      : type_(TYPE_BYTES),
-        str_(StringPiecePod::CreateFromStringPiece(value)),
-        use_strict_base64_decoding_(use_strict_base64_decoding) {}
-
-  DataPiece(const DataPiece& r) : type_(r.type_) { InternalCopy(r); }
-
-  DataPiece& operator=(const DataPiece& x) {
-    InternalCopy(x);
-    return *this;
-  }
-
-  static DataPiece NullData() { return DataPiece(TYPE_NULL, 0); }
-
-  virtual ~DataPiece() {
-  }
-
-  // Accessors
-  Type type() const { return type_; }
-
-  bool use_strict_base64_decoding() { return use_strict_base64_decoding_; }
-
-  StringPiece str() const {
-    GOOGLE_LOG_IF(DFATAL, type_ != TYPE_STRING) << "Not a string type.";
-    return str_;
-  }
-
-
-  // Parses, casts or converts the value stored in the DataPiece into an int32.
-  util::StatusOr<int32> ToInt32() const;
-
-  // Parses, casts or converts the value stored in the DataPiece into a uint32.
-  util::StatusOr<uint32> ToUint32() const;
-
-  // Parses, casts or converts the value stored in the DataPiece into an int64.
-  util::StatusOr<int64> ToInt64() const;
-
-  // Parses, casts or converts the value stored in the DataPiece into a uint64.
-  util::StatusOr<uint64> ToUint64() const;
-
-  // Parses, casts or converts the value stored in the DataPiece into a double.
-  util::StatusOr<double> ToDouble() const;
-
-  // Parses, casts or converts the value stored in the DataPiece into a float.
-  util::StatusOr<float> ToFloat() const;
-
-  // Parses, casts or converts the value stored in the DataPiece into a bool.
-  util::StatusOr<bool> ToBool() const;
-
-  // Parses, casts or converts the value stored in the DataPiece into a string.
-  util::StatusOr<string> ToString() const;
-
-  // Tries to convert the value contained in this datapiece to string. If the
-  // conversion fails, it returns the default_string.
-  string ValueAsStringOrDefault(StringPiece default_string) const;
-
-  util::StatusOr<string> ToBytes() const;
-
-  // Converts a value into protocol buffer enum number. If the value is a
-  // string, first attempts conversion by name, trying names as follows:
-  //   1) the directly provided string value.
-  //   2) the value upper-cased and replacing '-' by '_'
-  //   3) if use_lower_camel_for_enums is true it also attempts by comparing
-  //   enum name without underscore with the value upper cased above.
-  // If the value is not a string, attempts to convert to a 32-bit integer.
-  // If none of these succeeds, returns a conversion error status.
-  util::StatusOr<int> ToEnum(const google::protobuf::Enum* enum_type,
-                               bool use_lower_camel_for_enums) const;
-
- private:
-  // Disallow implicit constructor.
-  DataPiece();
-
-  // Helper to create NULL or ENUM types.
-  DataPiece(Type type, int32 val)
-      : type_(type), i32_(val), use_strict_base64_decoding_(false) {}
-
-  // For numeric conversion between
-  //     int32, int64, uint32, uint64, double, float and bool
-  template <typename To>
-  util::StatusOr<To> GenericConvert() const;
-
-  // For conversion from string to
-  //     int32, int64, uint32, uint64, double, float and bool
-  template <typename To>
-  util::StatusOr<To> StringToNumber(bool (*func)(StringPiece, To*)) const;
-
-  // Decodes a base64 string. Returns true on success.
-  bool DecodeBase64(StringPiece src, string* dest) const;
-
-  // Helper function to initialize this DataPiece with 'other'.
-  void InternalCopy(const DataPiece& other);
-
-  // Data type for this piece of data.
-  Type type_;
-
-  typedef ::google::protobuf::internal::StringPiecePod StringPiecePod;
-
-  // Stored piece of data.
-  union {
-    int32 i32_;
-    int64 i64_;
-    uint32 u32_;
-    uint64 u64_;
-    double double_;
-    float float_;
-    bool bool_;
-    StringPiecePod str_;
-  };
-
-  // Uses a stricter version of base64 decoding for byte fields.
-  bool use_strict_base64_decoding_;
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_DATAPIECE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc
deleted file mode 100644 (file)
index 95b3a17..0000000
+++ /dev/null
@@ -1,647 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/default_value_objectwriter.h>
-
-#include <google/protobuf/stubs/hash.h>
-
-#include <google/protobuf/util/internal/constants.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/stubs/map_util.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-using util::Status;
-using util::StatusOr;
-namespace converter {
-
-namespace {
-// Helper function to convert string value to given data type by calling the
-// passed converter function on the DataPiece created from "value" argument.
-// If value is empty or if conversion fails, the default_value is returned.
-template <typename T>
-T ConvertTo(StringPiece value, StatusOr<T> (DataPiece::*converter_fn)() const,
-            T default_value) {
-  if (value.empty()) return default_value;
-  StatusOr<T> result = (DataPiece(value, true).*converter_fn)();
-  return result.ok() ? result.ValueOrDie() : default_value;
-}
-}  // namespace
-
-DefaultValueObjectWriter::DefaultValueObjectWriter(
-    TypeResolver* type_resolver, const google::protobuf::Type& type,
-    ObjectWriter* ow)
-    : typeinfo_(TypeInfo::NewTypeInfo(type_resolver)),
-      own_typeinfo_(true),
-      type_(type),
-      current_(NULL),
-      root_(NULL),
-      suppress_empty_list_(false),
-      preserve_proto_field_names_(false),
-      field_scrub_callback_(NULL),
-      ow_(ow) {}
-
-DefaultValueObjectWriter::~DefaultValueObjectWriter() {
-  for (int i = 0; i < string_values_.size(); ++i) {
-    delete string_values_[i];
-  }
-  if (own_typeinfo_) {
-    delete typeinfo_;
-  }
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderBool(StringPiece name,
-                                                               bool value) {
-  if (current_ == NULL) {
-    ow_->RenderBool(name, value);
-  } else {
-    RenderDataPiece(name, DataPiece(value));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderInt32(
-    StringPiece name, int32 value) {
-  if (current_ == NULL) {
-    ow_->RenderInt32(name, value);
-  } else {
-    RenderDataPiece(name, DataPiece(value));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderUint32(
-    StringPiece name, uint32 value) {
-  if (current_ == NULL) {
-    ow_->RenderUint32(name, value);
-  } else {
-    RenderDataPiece(name, DataPiece(value));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderInt64(
-    StringPiece name, int64 value) {
-  if (current_ == NULL) {
-    ow_->RenderInt64(name, value);
-  } else {
-    RenderDataPiece(name, DataPiece(value));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderUint64(
-    StringPiece name, uint64 value) {
-  if (current_ == NULL) {
-    ow_->RenderUint64(name, value);
-  } else {
-    RenderDataPiece(name, DataPiece(value));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderDouble(
-    StringPiece name, double value) {
-  if (current_ == NULL) {
-    ow_->RenderDouble(name, value);
-  } else {
-    RenderDataPiece(name, DataPiece(value));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderFloat(
-    StringPiece name, float value) {
-  if (current_ == NULL) {
-    ow_->RenderBool(name, value);
-  } else {
-    RenderDataPiece(name, DataPiece(value));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderString(
-    StringPiece name, StringPiece value) {
-  if (current_ == NULL) {
-    ow_->RenderString(name, value);
-  } else {
-    // Since StringPiece is essentially a pointer, takes a copy of "value" to
-    // avoid ownership issues.
-    string_values_.push_back(new string(value.ToString()));
-    RenderDataPiece(name, DataPiece(*string_values_.back(), true));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderBytes(
-    StringPiece name, StringPiece value) {
-  if (current_ == NULL) {
-    ow_->RenderBytes(name, value);
-  } else {
-    // Since StringPiece is essentially a pointer, takes a copy of "value" to
-    // avoid ownership issues.
-    string_values_.push_back(new string(value.ToString()));
-    RenderDataPiece(name, DataPiece(*string_values_.back(), false, true));
-  }
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::RenderNull(
-    StringPiece name) {
-  if (current_ == NULL) {
-    ow_->RenderNull(name);
-  } else {
-    RenderDataPiece(name, DataPiece::NullData());
-  }
-  return this;
-}
-
-void DefaultValueObjectWriter::RegisterFieldScrubCallBack(
-    FieldScrubCallBackPtr field_scrub_callback) {
-  field_scrub_callback_.reset(field_scrub_callback.release());
-}
-
-DefaultValueObjectWriter::Node* DefaultValueObjectWriter::CreateNewNode(
-    const string& name, const google::protobuf::Type* type, NodeKind kind,
-    const DataPiece& data, bool is_placeholder, const std::vector<string>& path,
-    bool suppress_empty_list, FieldScrubCallBack* field_scrub_callback) {
-  return new Node(name, type, kind, data, is_placeholder, path,
-                  suppress_empty_list, field_scrub_callback);
-}
-
-DefaultValueObjectWriter::Node* DefaultValueObjectWriter::CreateNewNode(
-    const string& name, const google::protobuf::Type* type, NodeKind kind,
-    const DataPiece& data, bool is_placeholder, const std::vector<string>& path,
-    bool suppress_empty_list, bool preserve_proto_field_names,
-    FieldScrubCallBack* field_scrub_callback) {
-  return new Node(name, type, kind, data, is_placeholder, path,
-                  suppress_empty_list, preserve_proto_field_names,
-                  field_scrub_callback);
-}
-
-DefaultValueObjectWriter::Node::Node(
-    const string& name, const google::protobuf::Type* type, NodeKind kind,
-    const DataPiece& data, bool is_placeholder, const std::vector<string>& path,
-    bool suppress_empty_list, FieldScrubCallBack* field_scrub_callback)
-    : name_(name),
-      type_(type),
-      kind_(kind),
-      is_any_(false),
-      data_(data),
-      is_placeholder_(is_placeholder),
-      path_(path),
-      suppress_empty_list_(suppress_empty_list),
-      preserve_proto_field_names_(false),
-      field_scrub_callback_(field_scrub_callback) {}
-
-DefaultValueObjectWriter::Node::Node(
-    const string& name, const google::protobuf::Type* type, NodeKind kind,
-    const DataPiece& data, bool is_placeholder, const std::vector<string>& path,
-    bool suppress_empty_list, bool preserve_proto_field_names,
-    FieldScrubCallBack* field_scrub_callback)
-    : name_(name),
-      type_(type),
-      kind_(kind),
-      is_any_(false),
-      data_(data),
-      is_placeholder_(is_placeholder),
-      path_(path),
-      suppress_empty_list_(suppress_empty_list),
-      preserve_proto_field_names_(preserve_proto_field_names),
-      field_scrub_callback_(field_scrub_callback) {}
-
-DefaultValueObjectWriter::Node* DefaultValueObjectWriter::Node::FindChild(
-    StringPiece name) {
-  if (name.empty() || kind_ != OBJECT) {
-    return NULL;
-  }
-  for (int i = 0; i < children_.size(); ++i) {
-    Node* child = children_[i];
-    if (child->name() == name) {
-      return child;
-    }
-  }
-  return NULL;
-}
-
-void DefaultValueObjectWriter::Node::WriteTo(ObjectWriter* ow) {
-  if (kind_ == PRIMITIVE) {
-    ObjectWriter::RenderDataPieceTo(data_, name_, ow);
-    return;
-  }
-
-  // Render maps. Empty maps are rendered as "{}".
-  if (kind_ == MAP) {
-    ow->StartObject(name_);
-    WriteChildren(ow);
-    ow->EndObject();
-    return;
-  }
-
-  // Write out lists. If we didn't have any list in response, write out empty
-  // list.
-  if (kind_ == LIST) {
-    // Suppress empty lists if requested.
-    if (suppress_empty_list_ && is_placeholder_) return;
-
-    ow->StartList(name_);
-    WriteChildren(ow);
-    ow->EndList();
-    return;
-  }
-
-  // If is_placeholder_ = true, we didn't see this node in the response, so
-  // skip output.
-  if (is_placeholder_) return;
-
-  ow->StartObject(name_);
-  WriteChildren(ow);
-  ow->EndObject();
-}
-
-void DefaultValueObjectWriter::Node::WriteChildren(ObjectWriter* ow) {
-  for (int i = 0; i < children_.size(); ++i) {
-    Node* child = children_[i];
-    child->WriteTo(ow);
-  }
-}
-
-const google::protobuf::Type* DefaultValueObjectWriter::Node::GetMapValueType(
-    const google::protobuf::Type& found_type, const TypeInfo* typeinfo) {
-  // If this field is a map, we should use the type of its "Value" as
-  // the type of the child node.
-  for (int i = 0; i < found_type.fields_size(); ++i) {
-    const google::protobuf::Field& sub_field = found_type.fields(i);
-    if (sub_field.number() != 2) {
-      continue;
-    }
-    if (sub_field.kind() != google::protobuf::Field_Kind_TYPE_MESSAGE) {
-      // This map's value type is not a message type. We don't need to
-      // get the field_type in this case.
-      break;
-    }
-    util::StatusOr<const google::protobuf::Type*> sub_type =
-        typeinfo->ResolveTypeUrl(sub_field.type_url());
-    if (!sub_type.ok()) {
-      GOOGLE_LOG(WARNING) << "Cannot resolve type '" << sub_field.type_url() << "'.";
-    } else {
-      return sub_type.ValueOrDie();
-    }
-    break;
-  }
-  return NULL;
-}
-
-void DefaultValueObjectWriter::Node::PopulateChildren(
-    const TypeInfo* typeinfo) {
-  // Ignores well known types that don't require automatically populating their
-  // primitive children. For type "Any", we only populate its children when the
-  // "@type" field is set.
-  // TODO(tsun): remove "kStructValueType" from the list. It's being checked
-  //     now because of a bug in the tool-chain that causes the "oneof_index"
-  //     of kStructValueType to not be set correctly.
-  if (type_ == NULL || type_->name() == kAnyType ||
-      type_->name() == kStructType || type_->name() == kTimestampType ||
-      type_->name() == kDurationType || type_->name() == kStructValueType) {
-    return;
-  }
-  std::vector<Node*> new_children;
-  hash_map<string, int> orig_children_map;
-
-  // Creates a map of child nodes to speed up lookup.
-  for (int i = 0; i < children_.size(); ++i) {
-    InsertIfNotPresent(&orig_children_map, children_[i]->name_, i);
-  }
-
-  for (int i = 0; i < type_->fields_size(); ++i) {
-    const google::protobuf::Field& field = type_->fields(i);
-
-    // This code is checking if the field to be added to the tree should be
-    // scrubbed or not by calling the field_scrub_callback_ callback function.
-    std::vector<string> path;
-    if (!path_.empty()) {
-      path.insert(path.begin(), path_.begin(), path_.end());
-    }
-    path.push_back(field.name());
-    if (field_scrub_callback_ != NULL &&
-        field_scrub_callback_->Run(path, &field)) {
-      continue;
-    }
-
-    hash_map<string, int>::iterator found =
-        orig_children_map.find(field.name());
-    // If the child field has already been set, we just add it to the new list
-    // of children.
-    if (found != orig_children_map.end()) {
-      new_children.push_back(children_[found->second]);
-      children_[found->second] = NULL;
-      continue;
-    }
-
-    const google::protobuf::Type* field_type = NULL;
-    bool is_map = false;
-    NodeKind kind = PRIMITIVE;
-
-    if (field.kind() == google::protobuf::Field_Kind_TYPE_MESSAGE) {
-      kind = OBJECT;
-      util::StatusOr<const google::protobuf::Type*> found_result =
-          typeinfo->ResolveTypeUrl(field.type_url());
-      if (!found_result.ok()) {
-        // "field" is of an unknown type.
-        GOOGLE_LOG(WARNING) << "Cannot resolve type '" << field.type_url() << "'.";
-      } else {
-        const google::protobuf::Type* found_type = found_result.ValueOrDie();
-        is_map = IsMap(field, *found_type);
-
-        if (!is_map) {
-          field_type = found_type;
-        } else {
-          // If this field is a map, we should use the type of its "Value" as
-          // the type of the child node.
-          field_type = GetMapValueType(*found_type, typeinfo);
-          kind = MAP;
-        }
-      }
-    }
-
-    if (!is_map &&
-        field.cardinality() ==
-            google::protobuf::Field_Cardinality_CARDINALITY_REPEATED) {
-      kind = LIST;
-    }
-
-    // If oneof_index() != 0, the child field is part of a "oneof", which means
-    // the child field is optional and we shouldn't populate its default
-    // primitive value.
-    if (field.oneof_index() != 0 && kind == PRIMITIVE) continue;
-
-    // If the child field is of primitive type, sets its data to the default
-    // value of its type.
-    google::protobuf::scoped_ptr<Node> child(new Node(
-        preserve_proto_field_names_ ? field.name() : field.json_name(),
-        field_type, kind,
-        kind == PRIMITIVE ? CreateDefaultDataPieceForField(field, typeinfo)
-                          : DataPiece::NullData(),
-        true, path, suppress_empty_list_, preserve_proto_field_names_,
-        field_scrub_callback_));
-    new_children.push_back(child.release());
-  }
-  // Adds all leftover nodes in children_ to the beginning of new_child.
-  for (int i = 0; i < children_.size(); ++i) {
-    if (children_[i] == NULL) {
-      continue;
-    }
-    new_children.insert(new_children.begin(), children_[i]);
-    children_[i] = NULL;
-  }
-  children_.swap(new_children);
-}
-
-void DefaultValueObjectWriter::MaybePopulateChildrenOfAny(Node* node) {
-  // If this is an "Any" node with "@type" already given and no other children
-  // have been added, populates its children.
-  if (node != NULL && node->is_any() && node->type() != NULL &&
-      node->type()->name() != kAnyType && node->number_of_children() == 1) {
-    node->PopulateChildren(typeinfo_);
-  }
-}
-
-DataPiece DefaultValueObjectWriter::FindEnumDefault(
-    const google::protobuf::Field& field, const TypeInfo* typeinfo) {
-  if (!field.default_value().empty())
-    return DataPiece(field.default_value(), true);
-
-  const google::protobuf::Enum* enum_type =
-      typeinfo->GetEnumByTypeUrl(field.type_url());
-  if (!enum_type) {
-    GOOGLE_LOG(WARNING) << "Could not find enum with type '" << field.type_url()
-                 << "'";
-    return DataPiece::NullData();
-  }
-  // We treat the first value as the default if none is specified.
-  return enum_type->enumvalue_size() > 0
-             ? DataPiece(enum_type->enumvalue(0).name(), true)
-             : DataPiece::NullData();
-}
-
-DataPiece DefaultValueObjectWriter::CreateDefaultDataPieceForField(
-    const google::protobuf::Field& field, const TypeInfo* typeinfo) {
-  switch (field.kind()) {
-    case google::protobuf::Field_Kind_TYPE_DOUBLE: {
-      return DataPiece(ConvertTo<double>(
-          field.default_value(), &DataPiece::ToDouble, static_cast<double>(0)));
-    }
-    case google::protobuf::Field_Kind_TYPE_FLOAT: {
-      return DataPiece(ConvertTo<float>(
-          field.default_value(), &DataPiece::ToFloat, static_cast<float>(0)));
-    }
-    case google::protobuf::Field_Kind_TYPE_INT64:
-    case google::protobuf::Field_Kind_TYPE_SINT64:
-    case google::protobuf::Field_Kind_TYPE_SFIXED64: {
-      return DataPiece(ConvertTo<int64>(
-          field.default_value(), &DataPiece::ToInt64, static_cast<int64>(0)));
-    }
-    case google::protobuf::Field_Kind_TYPE_UINT64:
-    case google::protobuf::Field_Kind_TYPE_FIXED64: {
-      return DataPiece(ConvertTo<uint64>(
-          field.default_value(), &DataPiece::ToUint64, static_cast<uint64>(0)));
-    }
-    case google::protobuf::Field_Kind_TYPE_INT32:
-    case google::protobuf::Field_Kind_TYPE_SINT32:
-    case google::protobuf::Field_Kind_TYPE_SFIXED32: {
-      return DataPiece(ConvertTo<int32>(
-          field.default_value(), &DataPiece::ToInt32, static_cast<int32>(0)));
-    }
-    case google::protobuf::Field_Kind_TYPE_BOOL: {
-      return DataPiece(
-          ConvertTo<bool>(field.default_value(), &DataPiece::ToBool, false));
-    }
-    case google::protobuf::Field_Kind_TYPE_STRING: {
-      return DataPiece(field.default_value(), true);
-    }
-    case google::protobuf::Field_Kind_TYPE_BYTES: {
-      return DataPiece(field.default_value(), false, true);
-    }
-    case google::protobuf::Field_Kind_TYPE_UINT32:
-    case google::protobuf::Field_Kind_TYPE_FIXED32: {
-      return DataPiece(ConvertTo<uint32>(
-          field.default_value(), &DataPiece::ToUint32, static_cast<uint32>(0)));
-    }
-    case google::protobuf::Field_Kind_TYPE_ENUM: {
-      return FindEnumDefault(field, typeinfo);
-    }
-    default: { return DataPiece::NullData(); }
-  }
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::StartObject(
-    StringPiece name) {
-  if (current_ == NULL) {
-    std::vector<string> path;
-    root_.reset(CreateNewNode(string(name), &type_, OBJECT,
-                              DataPiece::NullData(), false, path,
-                              suppress_empty_list_, preserve_proto_field_names_,
-                              field_scrub_callback_.get()));
-    root_->PopulateChildren(typeinfo_);
-    current_ = root_.get();
-    return this;
-  }
-  MaybePopulateChildrenOfAny(current_);
-  Node* child = current_->FindChild(name);
-  if (current_->kind() == LIST || current_->kind() == MAP || child == NULL) {
-    // If current_ is a list or a map node, we should create a new child and use
-    // the type of current_ as the type of the new child.
-    google::protobuf::scoped_ptr<Node> node(
-        CreateNewNode(string(name),
-                      ((current_->kind() == LIST || current_->kind() == MAP)
-                           ? current_->type()
-                           : NULL),
-                      OBJECT, DataPiece::NullData(), false,
-                      child == NULL ? current_->path() : child->path(),
-                      suppress_empty_list_, preserve_proto_field_names_,
-                      field_scrub_callback_.get()));
-    child = node.get();
-    current_->AddChild(node.release());
-  }
-
-  child->set_is_placeholder(false);
-  if (child->kind() == OBJECT && child->number_of_children() == 0) {
-    child->PopulateChildren(typeinfo_);
-  }
-
-  stack_.push(current_);
-  current_ = child;
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::EndObject() {
-  if (stack_.empty()) {
-    // The root object ends here. Writes out the tree.
-    WriteRoot();
-    return this;
-  }
-  current_ = stack_.top();
-  stack_.pop();
-  return this;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::StartList(
-    StringPiece name) {
-  if (current_ == NULL) {
-    std::vector<string> path;
-    root_.reset(CreateNewNode(string(name), &type_, LIST, DataPiece::NullData(),
-                              false, path, suppress_empty_list_,
-                              preserve_proto_field_names_,
-                              field_scrub_callback_.get()));
-    current_ = root_.get();
-    return this;
-  }
-  MaybePopulateChildrenOfAny(current_);
-  Node* child = current_->FindChild(name);
-  if (child == NULL || child->kind() != LIST) {
-    google::protobuf::scoped_ptr<Node> node(
-        CreateNewNode(string(name), NULL, LIST, DataPiece::NullData(), false,
-                      child == NULL ? current_->path() : child->path(),
-                      suppress_empty_list_, preserve_proto_field_names_,
-                      field_scrub_callback_.get()));
-    child = node.get();
-    current_->AddChild(node.release());
-  }
-  child->set_is_placeholder(false);
-
-  stack_.push(current_);
-  current_ = child;
-  return this;
-}
-
-void DefaultValueObjectWriter::WriteRoot() {
-  root_->WriteTo(ow_);
-  root_.reset(NULL);
-  current_ = NULL;
-}
-
-DefaultValueObjectWriter* DefaultValueObjectWriter::EndList() {
-  if (stack_.empty()) {
-    WriteRoot();
-    return this;
-  }
-  current_ = stack_.top();
-  stack_.pop();
-  return this;
-}
-
-void DefaultValueObjectWriter::RenderDataPiece(StringPiece name,
-                                               const DataPiece& data) {
-  MaybePopulateChildrenOfAny(current_);
-  if (current_->type() != NULL && current_->type()->name() == kAnyType &&
-      name == "@type") {
-    util::StatusOr<string> data_string = data.ToString();
-    if (data_string.ok()) {
-      const string& string_value = data_string.ValueOrDie();
-      // If the type of current_ is "Any" and its "@type" field is being set
-      // here, sets the type of current_ to be the type specified by the
-      // "@type".
-      util::StatusOr<const google::protobuf::Type*> found_type =
-          typeinfo_->ResolveTypeUrl(string_value);
-      if (!found_type.ok()) {
-        GOOGLE_LOG(WARNING) << "Failed to resolve type '" << string_value << "'.";
-      } else {
-        current_->set_type(found_type.ValueOrDie());
-      }
-      current_->set_is_any(true);
-      // If the "@type" field is placed after other fields, we should populate
-      // other children of primitive type now. Otherwise, we should wait until
-      // the first value field is rendered before we populate the children,
-      // because the "value" field of a Any message could be omitted.
-      if (current_->number_of_children() > 1 && current_->type() != NULL) {
-        current_->PopulateChildren(typeinfo_);
-      }
-    }
-  }
-  Node* child = current_->FindChild(name);
-  if (child == NULL || child->kind() != PRIMITIVE) {
-    // No children are found, creates a new child.
-    google::protobuf::scoped_ptr<Node> node(
-        CreateNewNode(string(name), NULL, PRIMITIVE, data, false,
-                      child == NULL ? current_->path() : child->path(),
-                      suppress_empty_list_, preserve_proto_field_names_,
-                      field_scrub_callback_.get()));
-    current_->AddChild(node.release());
-  } else {
-    child->set_data(data);
-    child->set_is_placeholder(false);
-  }
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.h b/3rdparty/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.h
deleted file mode 100644 (file)
index 09c6d23..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_DEFAULT_VALUE_OBJECTWRITER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_DEFAULT_VALUE_OBJECTWRITER_H__
-
-#include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
-#include <stack>
-#include <vector>
-
-#include <google/protobuf/stubs/callback.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/util/internal/type_info.h>
-#include <google/protobuf/util/internal/datapiece.h>
-#include <google/protobuf/util/internal/object_writer.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/util/type_resolver.h>
-#include <google/protobuf/stubs/stringpiece.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// An ObjectWriter that renders non-repeated primitive fields of proto messages
-// with their default values. DefaultValueObjectWriter holds objects, lists and
-// fields it receives in a tree structure and writes them out to another
-// ObjectWriter when EndObject() is called on the root object. It also writes
-// out all non-repeated primitive fields that haven't been explicitly rendered
-// with their default values (0 for numbers, "" for strings, etc).
-class LIBPROTOBUF_EXPORT DefaultValueObjectWriter : public ObjectWriter {
- public:
-  // A Callback function to check whether a field needs to be scrubbed.
-  //
-  // Returns true if the field should not be present in the output. Returns
-  // false otherwise.
-  //
-  // The 'path' parameter is a vector of path to the field from root. For
-  // example: if a nested field "a.b.c" (b is the parent message field of c and
-  // a is the parent message field of b), then the vector should contain { "a",
-  // "b", "c" }.
-  //
-  // The Field* should point to the google::protobuf::Field of "c".
-  typedef ResultCallback2<bool /*return*/,
-                          const std::vector<string>& /*path of the field*/,
-                          const google::protobuf::Field* /*field*/>
-      FieldScrubCallBack;
-
-  // A unique pointer to a DefaultValueObjectWriter::FieldScrubCallBack.
-  typedef google::protobuf::scoped_ptr<FieldScrubCallBack> FieldScrubCallBackPtr;
-
-  DefaultValueObjectWriter(TypeResolver* type_resolver,
-                           const google::protobuf::Type& type,
-                           ObjectWriter* ow);
-
-  virtual ~DefaultValueObjectWriter();
-
-  // ObjectWriter methods.
-  virtual DefaultValueObjectWriter* StartObject(StringPiece name);
-
-  virtual DefaultValueObjectWriter* EndObject();
-
-  virtual DefaultValueObjectWriter* StartList(StringPiece name);
-
-  virtual DefaultValueObjectWriter* EndList();
-
-  virtual DefaultValueObjectWriter* RenderBool(StringPiece name, bool value);
-
-  virtual DefaultValueObjectWriter* RenderInt32(StringPiece name, int32 value);
-
-  virtual DefaultValueObjectWriter* RenderUint32(StringPiece name,
-                                                 uint32 value);
-
-  virtual DefaultValueObjectWriter* RenderInt64(StringPiece name, int64 value);
-
-  virtual DefaultValueObjectWriter* RenderUint64(StringPiece name,
-                                                 uint64 value);
-
-  virtual DefaultValueObjectWriter* RenderDouble(StringPiece name,
-                                                 double value);
-
-  virtual DefaultValueObjectWriter* RenderFloat(StringPiece name, float value);
-
-  virtual DefaultValueObjectWriter* RenderString(StringPiece name,
-                                                 StringPiece value);
-  virtual DefaultValueObjectWriter* RenderBytes(StringPiece name,
-                                                StringPiece value);
-
-  virtual DefaultValueObjectWriter* RenderNull(StringPiece name);
-
-  // Register the callback for scrubbing of fields. Owership of
-  // field_scrub_callback pointer is also transferred to this class
-  void RegisterFieldScrubCallBack(FieldScrubCallBackPtr field_scrub_callback);
-
-  // If set to true, empty lists are suppressed from output when default values
-  // are written.
-  void set_suppress_empty_list(bool value) { suppress_empty_list_ = value; }
-
-  // If set to true, original proto field names are used
-  void set_preserve_proto_field_names(bool value) {
-    preserve_proto_field_names_ = value;
-  }
-
- protected:
-  enum NodeKind {
-    PRIMITIVE = 0,
-    OBJECT = 1,
-    LIST = 2,
-    MAP = 3,
-  };
-
-  // "Node" represents a node in the tree that holds the input of
-  // DefaultValueObjectWriter.
-  class LIBPROTOBUF_EXPORT Node {
-   public:
-    Node(const string& name, const google::protobuf::Type* type, NodeKind kind,
-         const DataPiece& data, bool is_placeholder,
-         const std::vector<string>& path, bool suppress_empty_list,
-         FieldScrubCallBack* field_scrub_callback);
-    Node(const string& name, const google::protobuf::Type* type, NodeKind kind,
-         const DataPiece& data, bool is_placeholder,
-         const std::vector<string>& path, bool suppress_empty_list,
-         bool preserve_proto_field_names,
-         FieldScrubCallBack* field_scrub_callback);
-    virtual ~Node() {
-      for (int i = 0; i < children_.size(); ++i) {
-        delete children_[i];
-      }
-    }
-
-    // Adds a child to this node. Takes ownership of this child.
-    void AddChild(Node* child) { children_.push_back(child); }
-
-    // Finds the child given its name.
-    Node* FindChild(StringPiece name);
-
-    // Populates children of this Node based on its type. If there are already
-    // children created, they will be merged to the result. Caller should pass
-    // in TypeInfo for looking up types of the children.
-    virtual void PopulateChildren(const TypeInfo* typeinfo);
-
-    // If this node is a leaf (has data), writes the current node to the
-    // ObjectWriter; if not, then recursively writes the children to the
-    // ObjectWriter.
-    virtual void WriteTo(ObjectWriter* ow);
-
-    // Accessors
-    const string& name() const { return name_; }
-
-    const std::vector<string>& path() const { return path_; }
-
-    const google::protobuf::Type* type() const { return type_; }
-
-    void set_type(const google::protobuf::Type* type) { type_ = type; }
-
-    NodeKind kind() const { return kind_; }
-
-    int number_of_children() const { return children_.size(); }
-
-    void set_data(const DataPiece& data) { data_ = data; }
-
-    bool is_any() const { return is_any_; }
-
-    void set_is_any(bool is_any) { is_any_ = is_any; }
-
-    void set_is_placeholder(bool is_placeholder) {
-      is_placeholder_ = is_placeholder;
-    }
-
-   protected:
-    // Returns the Value Type of a map given the Type of the map entry and a
-    // TypeInfo instance.
-    const google::protobuf::Type* GetMapValueType(
-        const google::protobuf::Type& entry_type, const TypeInfo* typeinfo);
-
-    // Calls WriteTo() on every child in children_.
-    void WriteChildren(ObjectWriter* ow);
-
-    // The name of this node.
-    string name_;
-    // google::protobuf::Type of this node. Owned by TypeInfo.
-    const google::protobuf::Type* type_;
-    // The kind of this node.
-    NodeKind kind_;
-    // Whether this is a node for "Any".
-    bool is_any_;
-    // The data of this node when it is a leaf node.
-    DataPiece data_;
-    // Children of this node.
-    std::vector<Node*> children_;
-    // Whether this node is a placeholder for an object or list automatically
-    // generated when creating the parent node. Should be set to false after
-    // the parent node's StartObject()/StartList() method is called with this
-    // node's name.
-    bool is_placeholder_;
-
-    // Path of the field of this node
-    std::vector<string> path_;
-
-    // Whether to suppress empty list output.
-    bool suppress_empty_list_;
-
-    // Whether to preserve original proto field names
-    bool preserve_proto_field_names_;
-
-    // Pointer to function for determining whether a field needs to be scrubbed
-    // or not. This callback is owned by the creator of this node.
-    FieldScrubCallBack* field_scrub_callback_;
-
-   private:
-    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Node);
-  };
-
-  // Creates a new Node and returns it. Caller owns memory of returned object.
-  virtual Node* CreateNewNode(const string& name,
-                              const google::protobuf::Type* type, NodeKind kind,
-                              const DataPiece& data, bool is_placeholder,
-                              const std::vector<string>& path,
-                              bool suppress_empty_list,
-                              FieldScrubCallBack* field_scrub_callback);
-
-  // Creates a new Node and returns it. Caller owns memory of returned object.
-  virtual Node* CreateNewNode(const string& name,
-                              const google::protobuf::Type* type, NodeKind kind,
-                              const DataPiece& data, bool is_placeholder,
-                              const std::vector<string>& path,
-                              bool suppress_empty_list,
-                              bool preserve_proto_field_names,
-                              FieldScrubCallBack* field_scrub_callback);
-
-  // Creates a DataPiece containing the default value of the type of the field.
-  static DataPiece CreateDefaultDataPieceForField(
-      const google::protobuf::Field& field, const TypeInfo* typeinfo);
-
- protected:
-  // Returns a pointer to current Node in tree.
-  Node* current() { return current_; }
-
- private:
-  // Populates children of "node" if it is an "any" Node and its real type has
-  // been given.
-  void MaybePopulateChildrenOfAny(Node* node);
-
-  // Writes the root_ node to ow_ and resets the root_ and current_ pointer to
-  // NULL.
-  void WriteRoot();
-
-  // Adds or replaces the data_ of a primitive child node.
-  void RenderDataPiece(StringPiece name, const DataPiece& data);
-
-  // Returns the default enum value as a DataPiece, or the first enum value if
-  // there is no default. For proto3, where we cannot specify an explicit
-  // default, a zero value will always be returned.
-  static DataPiece FindEnumDefault(const google::protobuf::Field& field,
-                                   const TypeInfo* typeinfo);
-
-  // Type information for all the types used in the descriptor. Used to find
-  // google::protobuf::Type of nested messages/enums.
-  const TypeInfo* typeinfo_;
-  // Whether the TypeInfo object is owned by this class.
-  bool own_typeinfo_;
-  // google::protobuf::Type of the root message type.
-  const google::protobuf::Type& type_;
-  // Holds copies of strings passed to RenderString.
-  std::vector<string*> string_values_;
-
-  // The current Node. Owned by its parents.
-  Node* current_;
-  // The root Node.
-  google::protobuf::scoped_ptr<Node> root_;
-  // The stack to hold the path of Nodes from current_ to root_;
-  std::stack<Node*> stack_;
-
-  // Whether to suppress output of empty lists.
-  bool suppress_empty_list_;
-
-  // Whether to preserve original proto field names
-  bool preserve_proto_field_names_;
-
-  // Unique Pointer to function for determining whether a field needs to be
-  // scrubbed or not.
-  FieldScrubCallBackPtr field_scrub_callback_;
-
-  ObjectWriter* ow_;
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DefaultValueObjectWriter);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_DEFAULT_VALUE_OBJECTWRITER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/error_listener.h b/3rdparty/protobuf/src/google/protobuf/util/internal/error_listener.h
deleted file mode 100644 (file)
index 1dc814a..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_ERROR_LISTENER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_ERROR_LISTENER_H__
-
-#include <algorithm>
-#include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
-#include <string>
-#include <vector>
-
-#include <google/protobuf/stubs/callback.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/util/internal/location_tracker.h>
-#include <google/protobuf/stubs/stringpiece.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// Interface for error listener.
-class LIBPROTOBUF_EXPORT ErrorListener {
- public:
-  virtual ~ErrorListener() {}
-
-  // Reports an invalid name at the given location.
-  virtual void InvalidName(const LocationTrackerInterface& loc,
-                           StringPiece invalid_name, StringPiece message) = 0;
-
-  // Reports an invalid value for a field.
-  virtual void InvalidValue(const LocationTrackerInterface& loc,
-                            StringPiece type_name, StringPiece value) = 0;
-
-  // Reports a missing required field.
-  virtual void MissingField(const LocationTrackerInterface& loc,
-                            StringPiece missing_name) = 0;
-
- protected:
-  ErrorListener() {}
-
- private:
-  // Do not add any data members to this class.
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorListener);
-};
-
-// An error listener that ignores all errors.
-class LIBPROTOBUF_EXPORT NoopErrorListener : public ErrorListener {
- public:
-  NoopErrorListener() {}
-  virtual ~NoopErrorListener() {}
-
-  virtual void InvalidName(const LocationTrackerInterface& loc,
-                           StringPiece invalid_name, StringPiece message) {}
-
-  virtual void InvalidValue(const LocationTrackerInterface& loc,
-                            StringPiece type_name, StringPiece value) {}
-
-  virtual void MissingField(const LocationTrackerInterface& loc,
-                            StringPiece missing_name) {}
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(NoopErrorListener);
-};
-
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_ERROR_LISTENER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/expecting_objectwriter.h b/3rdparty/protobuf/src/google/protobuf/util/internal/expecting_objectwriter.h
deleted file mode 100644 (file)
index ae98ddd..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_EXPECTING_OBJECTWRITER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_EXPECTING_OBJECTWRITER_H__
-
-// An implementation of ObjectWriter that automatically sets the
-// gmock expectations for the response to a method. Every method
-// returns the object itself for chaining.
-//
-// Usage:
-//   // Setup
-//   MockObjectWriter mock;
-//   ExpectingObjectWriter ow(&mock);
-//
-//   // Set expectation
-//   ow.StartObject("")
-//       ->RenderString("key", "value")
-//     ->EndObject();
-//
-//   // Actual testing
-//   mock.StartObject(StringPiece())
-//         ->RenderString("key", "value")
-//       ->EndObject();
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/util/internal/object_writer.h>
-#include <gmock/gmock.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-using testing::IsEmpty;
-using testing::NanSensitiveDoubleEq;
-using testing::NanSensitiveFloatEq;
-using testing::Return;
-using testing::StrEq;
-using testing::TypedEq;
-
-class MockObjectWriter : public ObjectWriter {
- public:
-  MockObjectWriter() {}
-
-  MOCK_METHOD1(StartObject, ObjectWriter*(StringPiece));
-  MOCK_METHOD0(EndObject, ObjectWriter*());
-  MOCK_METHOD1(StartList, ObjectWriter*(StringPiece));
-  MOCK_METHOD0(EndList, ObjectWriter*());
-  MOCK_METHOD2(RenderBool, ObjectWriter*(StringPiece, bool));
-  MOCK_METHOD2(RenderInt32, ObjectWriter*(StringPiece, int32));
-  MOCK_METHOD2(RenderUint32, ObjectWriter*(StringPiece, uint32));
-  MOCK_METHOD2(RenderInt64, ObjectWriter*(StringPiece, int64));
-  MOCK_METHOD2(RenderUint64, ObjectWriter*(StringPiece, uint64));
-  MOCK_METHOD2(RenderDouble, ObjectWriter*(StringPiece, double));
-  MOCK_METHOD2(RenderFloat, ObjectWriter*(StringPiece, float));
-  MOCK_METHOD2(RenderString, ObjectWriter*(StringPiece, StringPiece));
-  MOCK_METHOD2(RenderBytes, ObjectWriter*(StringPiece, StringPiece));
-  MOCK_METHOD1(RenderNull, ObjectWriter*(StringPiece));
-};
-
-class ExpectingObjectWriter : public ObjectWriter {
- public:
-  explicit ExpectingObjectWriter(MockObjectWriter* mock) : mock_(mock) {}
-
-  virtual ObjectWriter* StartObject(StringPiece name) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, StartObject(IsEmpty()))
-         : EXPECT_CALL(*mock_, StartObject(StrEq(name.ToString()))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* EndObject() {
-    EXPECT_CALL(*mock_, EndObject())
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* StartList(StringPiece name) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, StartList(IsEmpty()))
-         : EXPECT_CALL(*mock_, StartList(StrEq(name.ToString()))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* EndList() {
-    EXPECT_CALL(*mock_, EndList())
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderBool(StringPiece name, bool value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderBool(IsEmpty(), TypedEq<bool>(value)))
-         : EXPECT_CALL(*mock_, RenderBool(StrEq(name.ToString()),
-                                          TypedEq<bool>(value))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderInt32(StringPiece name, int32 value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderInt32(IsEmpty(), TypedEq<int32>(value)))
-         : EXPECT_CALL(*mock_, RenderInt32(StrEq(name.ToString()),
-                                           TypedEq<int32>(value))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderUint32(StringPiece name, uint32 value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderUint32(IsEmpty(), TypedEq<uint32>(value)))
-         : EXPECT_CALL(*mock_, RenderUint32(StrEq(name.ToString()),
-                                            TypedEq<uint32>(value))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderInt64(StringPiece name, int64 value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderInt64(IsEmpty(), TypedEq<int64>(value)))
-         : EXPECT_CALL(*mock_, RenderInt64(StrEq(name.ToString()),
-                                           TypedEq<int64>(value))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderUint64(StringPiece name, uint64 value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderUint64(IsEmpty(), TypedEq<uint64>(value)))
-         : EXPECT_CALL(*mock_, RenderUint64(StrEq(name.ToString()),
-                                            TypedEq<uint64>(value))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderDouble(StringPiece name, double value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderDouble(IsEmpty(),
-                                            NanSensitiveDoubleEq(value)))
-         : EXPECT_CALL(*mock_, RenderDouble(StrEq(name.ToString()),
-                                            NanSensitiveDoubleEq(value))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderFloat(StringPiece name, float value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderFloat(IsEmpty(),
-                                           NanSensitiveFloatEq(value)))
-         : EXPECT_CALL(*mock_, RenderFloat(StrEq(name.ToString()),
-                                           NanSensitiveFloatEq(value))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderString(StringPiece name, StringPiece value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderString(IsEmpty(),
-               TypedEq<StringPiece>(value.ToString())))
-         : EXPECT_CALL(*mock_, RenderString(StrEq(name.ToString()),
-               TypedEq<StringPiece>(value.ToString()))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-  virtual ObjectWriter* RenderBytes(StringPiece name, StringPiece value) {
-    (name.empty()
-         ? EXPECT_CALL(*mock_, RenderBytes(IsEmpty(), TypedEq<StringPiece>(
-                                                          value.ToString())))
-         : EXPECT_CALL(*mock_,
-                       RenderBytes(StrEq(name.ToString()),
-                                   TypedEq<StringPiece>(value.ToString()))))
-        .WillOnce(Return(mock_))
-        .RetiresOnSaturation();
-    return this;
-  }
-
-  virtual ObjectWriter* RenderNull(StringPiece name) {
-    (name.empty() ? EXPECT_CALL(*mock_, RenderNull(IsEmpty()))
-                  : EXPECT_CALL(*mock_, RenderNull(StrEq(name.ToString())))
-                        .WillOnce(Return(mock_))
-                        .RetiresOnSaturation());
-    return this;
-  }
-
- private:
-  MockObjectWriter* mock_;
-
-  GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(ExpectingObjectWriter);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_EXPECTING_OBJECTWRITER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc
deleted file mode 100644 (file)
index 38835f6..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/field_mask_utility.h>
-
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/status_macros.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-namespace {
-inline util::Status CallPathSink(PathSinkCallback path_sink,
-                                   StringPiece arg) {
-  return path_sink->Run(arg);
-}
-
-// Appends a FieldMask path segment to a prefix.
-string AppendPathSegmentToPrefix(StringPiece prefix, StringPiece segment) {
-  if (prefix.empty()) {
-    return segment.ToString();
-  }
-  if (segment.empty()) {
-    return prefix.ToString();
-  }
-  // If the segment is a map key, appends it to the prefix without the ".".
-  if (segment.starts_with("[\"")) {
-    return StrCat(prefix, segment);
-  }
-  return StrCat(prefix, ".", segment);
-}
-
-}  // namespace
-
-string ConvertFieldMaskPath(const StringPiece path,
-                            ConverterCallback converter) {
-  string result;
-  result.reserve(path.size() << 1);
-
-  bool is_quoted = false;
-  bool is_escaping = false;
-  int current_segment_start = 0;
-
-  // Loops until 1 passed the end of the input to make handling the last
-  // segment easier.
-  for (size_t i = 0; i <= path.size(); ++i) {
-    // Outputs quoted string as-is.
-    if (is_quoted) {
-      if (i == path.size()) {
-        break;
-      }
-      result.push_back(path[i]);
-      if (is_escaping) {
-        is_escaping = false;
-      } else if (path[i] == '\\') {
-        is_escaping = true;
-      } else if (path[i] == '\"') {
-        current_segment_start = i + 1;
-        is_quoted = false;
-      }
-      continue;
-    }
-    if (i == path.size() || path[i] == '.' || path[i] == '(' ||
-        path[i] == ')' || path[i] == '\"') {
-      result += converter(
-          path.substr(current_segment_start, i - current_segment_start));
-      if (i < path.size()) {
-        result.push_back(path[i]);
-      }
-      current_segment_start = i + 1;
-    }
-    if (i < path.size() && path[i] == '\"') {
-      is_quoted = true;
-    }
-  }
-  return result;
-}
-
-util::Status DecodeCompactFieldMaskPaths(StringPiece paths,
-                                           PathSinkCallback path_sink) {
-  std::stack<string> prefix;
-  int length = paths.length();
-  int previous_position = 0;
-  bool in_map_key = false;
-  bool is_escaping = false;
-  // Loops until 1 passed the end of the input to make the handle of the last
-  // segment easier.
-  for (int i = 0; i <= length; ++i) {
-    if (i != length) {
-      // Skips everything in a map key until we hit the end of it, which is
-      // marked by an un-escaped '"' immediately followed by a ']'.
-      if (in_map_key) {
-        if (is_escaping) {
-          is_escaping = false;
-          continue;
-        }
-        if (paths[i] == '\\') {
-          is_escaping = true;
-          continue;
-        }
-        if (paths[i] != '\"') {
-          continue;
-        }
-        // Un-escaped '"' must be followed with a ']'.
-        if (i >= length - 1 || paths[i + 1] != ']') {
-          return util::Status(
-              util::error::INVALID_ARGUMENT,
-              StrCat("Invalid FieldMask '", paths,
-                     "'. Map keys should be represented as [\"some_key\"]."));
-        }
-        // The end of the map key ("\"]") has been found.
-        in_map_key = false;
-        // Skips ']'.
-        i++;
-        // Checks whether the key ends at the end of a path segment.
-        if (i < length - 1 && paths[i + 1] != '.' && paths[i + 1] != ',' &&
-            paths[i + 1] != ')' && paths[i + 1] != '(') {
-          return util::Status(
-              util::error::INVALID_ARGUMENT,
-              StrCat("Invalid FieldMask '", paths,
-                     "'. Map keys should be at the end of a path segment."));
-        }
-        is_escaping = false;
-        continue;
-      }
-
-      // We are not in a map key, look for the start of one.
-      if (paths[i] == '[') {
-        if (i >= length - 1 || paths[i + 1] != '\"') {
-          return util::Status(
-              util::error::INVALID_ARGUMENT,
-              StrCat("Invalid FieldMask '", paths,
-                     "'. Map keys should be represented as [\"some_key\"]."));
-        }
-        // "[\"" starts a map key.
-        in_map_key = true;
-        i++;  // Skips the '\"'.
-        continue;
-      }
-      // If the current character is not a special character (',', '(' or ')'),
-      // continue to the next.
-      if (paths[i] != ',' && paths[i] != ')' && paths[i] != '(') {
-        continue;
-      }
-    }
-    // Gets the current segment - sub-string between previous position (after
-    // '(', ')', ',', or the beginning of the input) and the current position.
-    StringPiece segment =
-        paths.substr(previous_position, i - previous_position);
-    string current_prefix = prefix.empty() ? "" : prefix.top();
-
-    if (i < length && paths[i] == '(') {
-      // Builds a prefix and save it into the stack.
-      prefix.push(AppendPathSegmentToPrefix(current_prefix, segment));
-    } else if (!segment.empty()) {
-      // When the current charactor is ')', ',' or the current position has
-      // passed the end of the input, builds and outputs a new paths by
-      // concatenating the last prefix with the current segment.
-      RETURN_IF_ERROR(CallPathSink(
-          path_sink, AppendPathSegmentToPrefix(current_prefix, segment)));
-    }
-
-    // Removes the last prefix after seeing a ')'.
-    if (i < length && paths[i] == ')') {
-      if (prefix.empty()) {
-        return util::Status(
-            util::error::INVALID_ARGUMENT,
-            StrCat("Invalid FieldMask '", paths,
-                   "'. Cannot find matching '(' for all ')'."));
-      }
-      prefix.pop();
-    }
-    previous_position = i + 1;
-  }
-  if (in_map_key) {
-    return util::Status(util::error::INVALID_ARGUMENT,
-                          StrCat("Invalid FieldMask '", paths,
-                                 "'. Cannot find matching ']' for all '['."));
-  }
-  if (!prefix.empty()) {
-    return util::Status(util::error::INVALID_ARGUMENT,
-                          StrCat("Invalid FieldMask '", paths,
-                                 "'. Cannot find matching ')' for all '('."));
-  }
-  return util::Status();
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/field_mask_utility.h b/3rdparty/protobuf/src/google/protobuf/util/internal/field_mask_utility.h
deleted file mode 100644 (file)
index 59f36f7..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// FieldMask related utility methods.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_FIELD_MASK_UTILITY_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_FIELD_MASK_UTILITY_H__
-
-#include <functional>
-#include <stack>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/status.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-typedef string (*ConverterCallback)(StringPiece);
-typedef ResultCallback1<util::Status, StringPiece>* PathSinkCallback;
-
-// Applies a 'converter' to each segment of a FieldMask path and returns the
-// result. Quoted strings in the 'path' are copied to the output as-is without
-// converting their content. Escaping is supported within quoted strings.
-// For example, "ab\"_c" will be returned as "ab\"_c" without any changes.
-string ConvertFieldMaskPath(const StringPiece path,
-                            ConverterCallback converter);
-
-// Decodes a compact list of FieldMasks. For example, "a.b,a.c.d,a.c.e" will be
-// decoded into a list of field paths - "a.b", "a.c.d", "a.c.e". And the results
-// will be sent to 'path_sink', i.e. 'path_sink' will be called once per
-// resulting path.
-// Note that we also support Apiary style FieldMask form. The above example in
-// the Apiary style will look like "a.b,a.c(d,e)".
-util::Status DecodeCompactFieldMaskPaths(StringPiece paths,
-                                           PathSinkCallback path_sink);
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_FIELD_MASK_UTILITY_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/json_escaping.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/json_escaping.cc
deleted file mode 100644 (file)
index 06b9a7f..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/json_escaping.h>
-
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/common.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-namespace {
-
-// Array of hex characters for conversion to hex.
-static const char kHex[] = "0123456789abcdef";
-
-// Characters 0x00 to 0x9f are very commonly used, so we provide a special
-// table lookup.
-//
-// For unicode code point ch < 0xa0:
-// kCommonEscapes[ch] is the escaped string of ch, if escaping is needed;
-//                    or an empty string, if escaping is not needed.
-static const char kCommonEscapes[160][7] = {
-  // C0 (ASCII and derivatives) control characters
-  "\\u0000", "\\u0001", "\\u0002", "\\u0003",  // 0x00
-  "\\u0004", "\\u0005", "\\u0006", "\\u0007",
-  "\\b",     "\\t",     "\\n",     "\\u000b",
-  "\\f",     "\\r",     "\\u000e", "\\u000f",
-  "\\u0010", "\\u0011", "\\u0012", "\\u0013",  // 0x10
-  "\\u0014", "\\u0015", "\\u0016", "\\u0017",
-  "\\u0018", "\\u0019", "\\u001a", "\\u001b",
-  "\\u001c", "\\u001d", "\\u001e", "\\u001f",
-  // Escaping of " and \ are required by www.json.org string definition.
-  // Escaping of < and > are required for HTML security.
-  "", "", "\\\"", "", "",        "", "",        "",  // 0x20
-  "", "", "",     "", "",        "", "",        "",
-  "", "", "",     "", "",        "", "",        "",  // 0x30
-  "", "", "",     "", "\\u003c", "", "\\u003e", "",
-  "", "", "",     "", "",        "", "",        "",  // 0x40
-  "", "", "",     "", "",        "", "",        "",
-  "", "", "",     "", "",        "", "",        "",  // 0x50
-  "", "", "",     "", "\\\\",    "", "",        "",
-  "", "", "",     "", "",        "", "",        "",  // 0x60
-  "", "", "",     "", "",        "", "",        "",
-  "", "", "",     "", "",        "", "",        "",  // 0x70
-  "", "", "",     "", "",        "", "",        "\\u007f",
-  // C1 (ISO 8859 and Unicode) extended control characters
-  "\\u0080", "\\u0081", "\\u0082", "\\u0083",  // 0x80
-  "\\u0084", "\\u0085", "\\u0086", "\\u0087",
-  "\\u0088", "\\u0089", "\\u008a", "\\u008b",
-  "\\u008c", "\\u008d", "\\u008e", "\\u008f",
-  "\\u0090", "\\u0091", "\\u0092", "\\u0093",  // 0x90
-  "\\u0094", "\\u0095", "\\u0096", "\\u0097",
-  "\\u0098", "\\u0099", "\\u009a", "\\u009b",
-  "\\u009c", "\\u009d", "\\u009e", "\\u009f"
-};
-
-// Determines if the given char value is a unicode surrogate code unit (either
-// high-surrogate or low-surrogate).
-inline bool IsSurrogate(uint32 c) {
-  // Optimized form of:
-  // return c >= kMinHighSurrogate && c <= kMaxLowSurrogate;
-  // (Reduced from 3 ALU instructions to 2 ALU instructions)
-  return (c & 0xfffff800) == JsonEscaping::kMinHighSurrogate;
-}
-
-// Returns true if the given unicode code point cp is a valid
-// unicode code point (i.e. in the range 0 <= cp <= kMaxCodePoint).
-inline bool IsValidCodePoint(uint32 cp) {
-  return cp <= JsonEscaping::kMaxCodePoint;
-}
-
-// Returns the low surrogate for the given unicode code point. The result is
-// meaningless if the given code point is not a supplementary character.
-inline uint16 ToLowSurrogate(uint32 cp) {
-  return (cp & (JsonEscaping::kMaxLowSurrogate
-                - JsonEscaping::kMinLowSurrogate))
-      + JsonEscaping::kMinLowSurrogate;
-}
-
-// Returns the high surrogate for the given unicode code point. The result is
-// meaningless if the given code point is not a supplementary character.
-inline uint16 ToHighSurrogate(uint32 cp) {
-  return (cp >> 10) + (JsonEscaping::kMinHighSurrogate -
-                       (JsonEscaping::kMinSupplementaryCodePoint >> 10));
-}
-
-// Input str is encoded in UTF-8. A unicode code point could be encoded in
-// UTF-8 using anywhere from 1 to 4 characters, and it could span multiple
-// reads of the ByteSource.
-//
-// This function reads the next unicode code point from the input (str) at
-// the given position (index), taking into account any left-over partial
-// code point from the previous iteration (cp), together with the number
-// of characters left to read to complete this code point (num_left).
-//
-// This function assumes that the input (str) is valid at the given position
-// (index). In order words, at least one character could be read successfully.
-//
-// The code point read (partial or complete) is stored in (cp). Upon return,
-// (num_left) stores the number of characters that has yet to be read in
-// order to complete the current unicode code point. If the read is complete,
-// then (num_left) is 0. Also, (num_read) is the number of characters read.
-//
-// Returns false if we encounter an invalid UTF-8 string. Returns true
-// otherwise, including the case when we reach the end of the input (str)
-// before a complete unicode code point is read.
-bool ReadCodePoint(StringPiece str, int index,
-                   uint32 *cp, int* num_left, int *num_read) {
-  if (*num_left == 0) {
-    // Last read was complete. Start reading a new unicode code point.
-    *cp = static_cast<uint8>(str[index++]);
-    *num_read = 1;
-    // The length of the code point is determined from reading the first byte.
-    //
-    // If the first byte is between:
-    //    0..0x7f: that's the value of the code point.
-    // 0x80..0xbf: <invalid>
-    // 0xc0..0xdf: 11-bit code point encoded in 2 bytes.
-    //                                   bit 10-6, bit 5-0
-    // 0xe0..0xef: 16-bit code point encoded in 3 bytes.
-    //                        bit 15-12, bit 11-6, bit 5-0
-    // 0xf0..0xf7: 21-bit code point encoded in 4 bytes.
-    //             bit 20-18, bit 17-12, bit 11-6, bit 5-0
-    // 0xf8..0xff: <invalid>
-    //
-    // Meaning of each bit:
-    // <msb> bit 7: 0 - single byte code point: bits 6-0 are values.
-    //              1 - multibyte code point
-    //       bit 6: 0 - subsequent bytes of multibyte code point:
-    //                  bits 5-0 are values.
-    //              1 - first byte of multibyte code point
-    //       bit 5: 0 - first byte of 2-byte code point: bits 4-0 are values.
-    //              1 - first byte of code point with >= 3 bytes.
-    //       bit 4: 0 - first byte of 3-byte code point: bits 3-0 are values.
-    //              1 - first byte of code point with >= 4 bytes.
-    //       bit 3: 0 - first byte of 4-byte code point: bits 2-0 are values.
-    //              1 - reserved for future expansion.
-    if (*cp <= 0x7f) {
-      return true;
-    } else if (*cp <= 0xbf) {
-      return false;
-    } else if (*cp <= 0xdf) {
-      *cp &= 0x1f;
-      *num_left = 1;
-    } else if (*cp <= 0xef) {
-      *cp &= 0x0f;
-      *num_left = 2;
-    } else if (*cp <= 0xf7) {
-      *cp &= 0x07;
-      *num_left = 3;
-    } else {
-      return false;
-    }
-  } else {
-    // Last read was partial. Initialize num_read to 0 and continue reading
-    // the last unicode code point.
-    *num_read = 0;
-  }
-  while (*num_left > 0 && index < str.size()) {
-    uint32 ch = static_cast<uint8>(str[index++]);
-    --(*num_left);
-    ++(*num_read);
-    *cp = (*cp << 6) | (ch & 0x3f);
-    if (ch < 0x80 || ch > 0xbf) return false;
-  }
-  return *num_left > 0 || (!IsSurrogate(*cp) && IsValidCodePoint(*cp));
-}
-
-// Stores the 16-bit unicode code point as its hexadecimal digits in buffer
-// and returns a StringPiece that points to this buffer. The input buffer needs
-// to be at least 6 bytes long.
-StringPiece ToHex(uint16 cp, char* buffer) {
-  buffer[5] = kHex[cp & 0x0f];
-  cp >>= 4;
-  buffer[4] = kHex[cp & 0x0f];
-  cp >>= 4;
-  buffer[3] = kHex[cp & 0x0f];
-  cp >>= 4;
-  buffer[2] = kHex[cp & 0x0f];
-  return StringPiece(buffer, 6);
-}
-
-// Stores the 32-bit unicode code point as its hexadecimal digits in buffer
-// and returns a StringPiece that points to this buffer. The input buffer needs
-// to be at least 12 bytes long.
-StringPiece ToSurrogateHex(uint32 cp, char* buffer) {
-  uint16 low = ToLowSurrogate(cp);
-  uint16 high = ToHighSurrogate(cp);
-
-  buffer[11] = kHex[low & 0x0f];
-  low >>= 4;
-  buffer[10] = kHex[low & 0x0f];
-  low >>= 4;
-  buffer[9] = kHex[low & 0x0f];
-  low >>= 4;
-  buffer[8] = kHex[low & 0x0f];
-
-  buffer[5] = kHex[high & 0x0f];
-  high >>= 4;
-  buffer[4] = kHex[high & 0x0f];
-  high >>= 4;
-  buffer[3] = kHex[high & 0x0f];
-  high >>= 4;
-  buffer[2] = kHex[high & 0x0f];
-
-  return StringPiece(buffer, 12);
-}
-
-// If the given unicode code point needs escaping, then returns the
-// escaped form. The returned StringPiece either points to statically
-// pre-allocated char[] or to the given buffer. The input buffer needs
-// to be at least 12 bytes long.
-//
-// If the given unicode code point does not need escaping, an empty
-// StringPiece is returned.
-StringPiece EscapeCodePoint(uint32 cp, char* buffer) {
-  if (cp < 0xa0) return kCommonEscapes[cp];
-  switch (cp) {
-    // These are not required by json spec
-    // but used to prevent security bugs in javascript.
-    case 0xfeff:  // Zero width no-break space
-    case 0xfff9:  // Interlinear annotation anchor
-    case 0xfffa:  // Interlinear annotation separator
-    case 0xfffb:  // Interlinear annotation terminator
-
-    case 0x00ad:  // Soft-hyphen
-    case 0x06dd:  // Arabic end of ayah
-    case 0x070f:  // Syriac abbreviation mark
-    case 0x17b4:  // Khmer vowel inherent Aq
-    case 0x17b5:  // Khmer vowel inherent Aa
-      return ToHex(cp, buffer);
-
-    default:
-      if ((cp >= 0x0600 && cp <= 0x0603) ||  // Arabic signs
-          (cp >= 0x200b && cp <= 0x200f) ||  // Zero width etc.
-          (cp >= 0x2028 && cp <= 0x202e) ||  // Separators etc.
-          (cp >= 0x2060 && cp <= 0x2064) ||  // Invisible etc.
-          (cp >= 0x206a && cp <= 0x206f)) {  // Shaping etc.
-        return ToHex(cp, buffer);
-      }
-
-      if (cp == 0x000e0001 ||                        // Language tag
-          (cp >= 0x0001d173 && cp <= 0x0001d17a) ||  // Music formatting
-          (cp >= 0x000e0020 && cp <= 0x000e007f)) {  // TAG symbols
-        return ToSurrogateHex(cp, buffer);
-      }
-  }
-  return StringPiece();
-}
-
-// Tries to escape the given code point first. If the given code point
-// does not need to be escaped, but force_output is true, then render
-// the given multi-byte code point in UTF8 in the buffer and returns it.
-StringPiece EscapeCodePoint(uint32 cp, char* buffer, bool force_output) {
-  StringPiece sp = EscapeCodePoint(cp, buffer);
-  if (force_output && sp.empty()) {
-    buffer[5] = (cp & 0x3f) | 0x80;
-    cp >>= 6;
-    if (cp <= 0x1f) {
-      buffer[4] = cp | 0xc0;
-      sp = StringPiece(buffer + 4, 2);
-      return sp;
-    }
-    buffer[4] = (cp & 0x3f) | 0x80;
-    cp >>= 6;
-    if (cp <= 0x0f) {
-      buffer[3] = cp | 0xe0;
-      sp = StringPiece(buffer + 3, 3);
-      return sp;
-    }
-    buffer[3] = (cp & 0x3f) | 0x80;
-    buffer[2] = ((cp >> 6) & 0x07) | 0xf0;
-    sp = StringPiece(buffer + 2, 4);
-  }
-  return sp;
-}
-
-}  // namespace
-
-void JsonEscaping::Escape(strings::ByteSource* input,
-                          strings::ByteSink* output) {
-  char buffer[12] = "\\udead\\ubee";
-  uint32 cp = 0;     // Current unicode code point.
-  int num_left = 0;  // Num of chars to read to complete the code point.
-  while (input->Available() > 0) {
-    StringPiece str = input->Peek();
-    StringPiece escaped;
-    int i = 0;
-    int num_read;
-    bool ok;
-    bool cp_was_split = num_left > 0;
-    // Loop until we encounter either
-    //   i) a code point that needs to be escaped; or
-    //  ii) a split code point is completely read; or
-    // iii) a character that is not a valid utf8; or
-    //  iv) end of the StringPiece str is reached.
-    do {
-      ok = ReadCodePoint(str, i, &cp, &num_left, &num_read);
-      if (num_left > 0 || !ok) break;  // case iii or iv
-      escaped = EscapeCodePoint(cp, buffer, cp_was_split);
-      if (!escaped.empty()) break;     // case i or ii
-      i += num_read;
-      num_read = 0;
-    } while (i < str.length());        // case iv
-    // First copy the un-escaped prefix, if any, to the output ByteSink.
-    if (i > 0) input->CopyTo(output, i);
-    if (num_read > 0) input->Skip(num_read);
-    if (!ok) {
-      // Case iii: Report error.
-      // TODO(wpoon): Add error reporting.
-      num_left = 0;
-    } else if (num_left == 0 && !escaped.empty()) {
-      // Case i or ii: Append the escaped code point to the output ByteSink.
-      output->Append(escaped.data(), escaped.size());
-    }
-  }
-  if (num_left > 0) {
-    // Treat as case iii: report error.
-    // TODO(wpoon): Add error reporting.
-  }
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/json_escaping.h b/3rdparty/protobuf/src/google/protobuf/util/internal/json_escaping.h
deleted file mode 100644 (file)
index 9b8b2af..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef NET_PROTO2_UTIL_CONVERTER_STRINGS_JSON_ESCAPING_H_
-#define NET_PROTO2_UTIL_CONVERTER_STRINGS_JSON_ESCAPING_H_
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/bytestream.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-class JsonEscaping {
- public:
-  // The minimum value of a unicode high-surrogate code unit in the utf-16
-  // encoding. A high-surrogate is also known as a leading-surrogate.
-  // See http://www.unicode.org/glossary/#high_surrogate_code_unit
-  static const uint16 kMinHighSurrogate = 0xd800;
-
-  // The maximum value of a unicide high-surrogate code unit in the utf-16
-  // encoding. A high-surrogate is also known as a leading-surrogate.
-  // See http://www.unicode.org/glossary/#high_surrogate_code_unit
-  static const uint16 kMaxHighSurrogate = 0xdbff;
-
-  // The minimum value of a unicode low-surrogate code unit in the utf-16
-  // encoding. A low-surrogate is also known as a trailing-surrogate.
-  // See http://www.unicode.org/glossary/#low_surrogate_code_unit
-  static const uint16 kMinLowSurrogate = 0xdc00;
-
-  // The maximum value of a unicode low-surrogate code unit in the utf-16
-  // encoding. A low-surrogate is also known as a trailing surrogate.
-  // See http://www.unicode.org/glossary/#low_surrogate_code_unit
-  static const uint16 kMaxLowSurrogate = 0xdfff;
-
-  // The minimum value of a unicode supplementary code point.
-  // See http://www.unicode.org/glossary/#supplementary_code_point
-  static const uint32 kMinSupplementaryCodePoint = 0x010000;
-
-  // The minimum value of a unicode code point.
-  // See http://www.unicode.org/glossary/#code_point
-  static const uint32 kMinCodePoint = 0x000000;
-
-  // The maximum value of a unicode code point.
-  // See http://www.unicode.org/glossary/#code_point
-  static const uint32 kMaxCodePoint = 0x10ffff;
-
-  JsonEscaping() {}
-  virtual ~JsonEscaping() {}
-
-  // Escape the given ByteSource to the given ByteSink.
-  static void Escape(strings::ByteSource* input, strings::ByteSink* output);
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JsonEscaping);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
-
-#endif  // NET_PROTO2_UTIL_CONVERTER_STRINGS_JSON_ESCAPING_H_
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc
deleted file mode 100644 (file)
index 6e4edd8..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/json_objectwriter.h>
-
-#include <math.h>
-
-#include <google/protobuf/stubs/casts.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/util/internal/json_escaping.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/mathlimits.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-using strings::ArrayByteSource;
-;
-
-JsonObjectWriter::~JsonObjectWriter() {
-  if (!element_->is_root()) {
-    GOOGLE_LOG(WARNING) << "JsonObjectWriter was not fully closed.";
-  }
-}
-
-JsonObjectWriter* JsonObjectWriter::StartObject(StringPiece name) {
-  WritePrefix(name);
-  WriteChar('{');
-  Push();
-  return this;
-}
-
-JsonObjectWriter* JsonObjectWriter::EndObject() {
-  Pop();
-  WriteChar('}');
-  if (element()->is_root()) NewLine();
-  return this;
-}
-
-JsonObjectWriter* JsonObjectWriter::StartList(StringPiece name) {
-  WritePrefix(name);
-  WriteChar('[');
-  Push();
-  return this;
-}
-
-JsonObjectWriter* JsonObjectWriter::EndList() {
-  Pop();
-  WriteChar(']');
-  if (element()->is_root()) NewLine();
-  return this;
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderBool(StringPiece name, bool value) {
-  return RenderSimple(name, value ? "true" : "false");
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderInt32(StringPiece name, int32 value) {
-  return RenderSimple(name, SimpleItoa(value));
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderUint32(StringPiece name,
-                                                 uint32 value) {
-  return RenderSimple(name, SimpleItoa(value));
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderInt64(StringPiece name, int64 value) {
-  WritePrefix(name);
-  WriteChar('"');
-  stream_->WriteString(SimpleItoa(value));
-  WriteChar('"');
-  return this;
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderUint64(StringPiece name,
-                                                 uint64 value) {
-  WritePrefix(name);
-  WriteChar('"');
-  stream_->WriteString(SimpleItoa(value));
-  WriteChar('"');
-  return this;
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderDouble(StringPiece name,
-                                                 double value) {
-  if (MathLimits<double>::IsFinite(value)) {
-    return RenderSimple(name, SimpleDtoa(value));
-  }
-
-  // Render quoted with NaN/Infinity-aware DoubleAsString.
-  return RenderString(name, DoubleAsString(value));
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderFloat(StringPiece name, float value) {
-  if (MathLimits<float>::IsFinite(value)) {
-    return RenderSimple(name, SimpleFtoa(value));
-  }
-
-  // Render quoted with NaN/Infinity-aware FloatAsString.
-  return RenderString(name, FloatAsString(value));
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderString(StringPiece name,
-                                                 StringPiece value) {
-  WritePrefix(name);
-  WriteChar('"');
-  ArrayByteSource source(value);
-  JsonEscaping::Escape(&source, &sink_);
-  WriteChar('"');
-  return this;
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderBytes(StringPiece name,
-                                                StringPiece value) {
-  WritePrefix(name);
-  string base64;
-
-  if (use_websafe_base64_for_bytes_)
-    WebSafeBase64EscapeWithPadding(value.ToString(), &base64);
-  else
-    Base64Escape(value, &base64);
-
-  WriteChar('"');
-  // TODO(wpoon): Consider a ByteSink solution that writes the base64 bytes
-  //              directly to the stream, rather than first putting them
-  //              into a string and then writing them to the stream.
-  stream_->WriteRaw(base64.data(), base64.size());
-  WriteChar('"');
-  return this;
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderNull(StringPiece name) {
-  return RenderSimple(name, "null");
-}
-
-JsonObjectWriter* JsonObjectWriter::RenderNullAsEmpty(StringPiece name) {
-  return RenderSimple(name, "");
-}
-
-void JsonObjectWriter::WritePrefix(StringPiece name) {
-  bool not_first = !element()->is_first();
-  if (not_first) WriteChar(',');
-  if (not_first || !element()->is_root()) NewLine();
-  bool empty_key_ok = GetAndResetEmptyKeyOk();
-  if (!name.empty() || empty_key_ok) {
-    WriteChar('"');
-    if (!name.empty()) {
-      ArrayByteSource source(name);
-      JsonEscaping::Escape(&source, &sink_);
-    }
-    stream_->WriteString("\":");
-    if (!indent_string_.empty()) WriteChar(' ');
-  }
-}
-
-bool JsonObjectWriter::GetAndResetEmptyKeyOk() {
-  bool retval = empty_name_ok_for_next_key_;
-  empty_name_ok_for_next_key_ = false;
-  return retval;
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/json_objectwriter.h b/3rdparty/protobuf/src/google/protobuf/util/internal/json_objectwriter.h
deleted file mode 100644 (file)
index 31edc29..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__
-
-#include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
-#include <string>
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/util/internal/structured_objectwriter.h>
-#include <google/protobuf/stubs/bytestream.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// An ObjectWriter implementation that outputs JSON. This ObjectWriter
-// supports writing a compact form or a pretty printed form.
-//
-// Sample usage:
-//   string output;
-//   StringOutputStream* str_stream = new StringOutputStream(&output);
-//   CodedOutputStream* out_stream = new CodedOutputStream(str_stream);
-//   JsonObjectWriter* ow = new JsonObjectWriter("  ", out_stream);
-//   ow->StartObject("")
-//       ->RenderString("name", "value")
-//       ->RenderString("emptystring", string())
-//       ->StartObject("nested")
-//         ->RenderInt64("light", 299792458);
-//         ->RenderDouble("pi", 3.141592653589793);
-//       ->EndObject()
-//       ->StartList("empty")
-//       ->EndList()
-//     ->EndObject();
-//
-// And then the output string would become:
-// {
-//   "name": "value",
-//   "emptystring": "",
-//   "nested": {
-//     "light": "299792458",
-//     "pi": 3.141592653589793
-//   },
-//   "empty": []
-// }
-//
-// JsonObjectWriter does not validate if calls actually result in valid JSON.
-// For example, passing an empty name when one would be required won't result
-// in an error, just an invalid output.
-//
-// Note that all int64 and uint64 are rendered as strings instead of numbers.
-// This is because JavaScript parses numbers as 64-bit float thus int64 and
-// uint64 would lose precision if rendered as numbers.
-//
-// JsonObjectWriter is thread-unsafe.
-class LIBPROTOBUF_EXPORT JsonObjectWriter : public StructuredObjectWriter {
- public:
-  JsonObjectWriter(StringPiece indent_string,
-                   google::protobuf::io::CodedOutputStream* out)
-      : element_(new Element(NULL)),
-        stream_(out),
-        sink_(out),
-        indent_string_(indent_string.ToString()),
-        use_websafe_base64_for_bytes_(false),
-        empty_name_ok_for_next_key_(false) {}
-  virtual ~JsonObjectWriter();
-
-  // ObjectWriter methods.
-  virtual JsonObjectWriter* StartObject(StringPiece name);
-  virtual JsonObjectWriter* EndObject();
-  virtual JsonObjectWriter* StartList(StringPiece name);
-  virtual JsonObjectWriter* EndList();
-  virtual JsonObjectWriter* RenderBool(StringPiece name, bool value);
-  virtual JsonObjectWriter* RenderInt32(StringPiece name, int32 value);
-  virtual JsonObjectWriter* RenderUint32(StringPiece name, uint32 value);
-  virtual JsonObjectWriter* RenderInt64(StringPiece name, int64 value);
-  virtual JsonObjectWriter* RenderUint64(StringPiece name, uint64 value);
-  virtual JsonObjectWriter* RenderDouble(StringPiece name, double value);
-  virtual JsonObjectWriter* RenderFloat(StringPiece name, float value);
-  virtual JsonObjectWriter* RenderString(StringPiece name, StringPiece value);
-  virtual JsonObjectWriter* RenderBytes(StringPiece name, StringPiece value);
-  virtual JsonObjectWriter* RenderNull(StringPiece name);
-  virtual JsonObjectWriter* RenderNullAsEmpty(StringPiece name);
-
-  void set_use_websafe_base64_for_bytes(bool value) {
-    use_websafe_base64_for_bytes_ = value;
-  }
-
-  // Whether empty strings should be rendered for the next JSON key. This
-  // setting is only valid until the next key is rendered, after which it gets
-  // reset to false.
-  virtual void empty_name_ok_for_next_key() {
-    empty_name_ok_for_next_key_ = true;
-  }
-
- protected:
-  class LIBPROTOBUF_EXPORT Element : public BaseElement {
-   public:
-    explicit Element(Element* parent) : BaseElement(parent), is_first_(true) {}
-
-    // Called before each field of the Element is to be processed.
-    // Returns true if this is the first call (processing the first field).
-    bool is_first() {
-      if (is_first_) {
-        is_first_ = false;
-        return true;
-      }
-      return false;
-    }
-
-   private:
-    bool is_first_;
-
-    GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(Element);
-  };
-
-  virtual Element* element() { return element_.get(); }
-
- private:
-  class LIBPROTOBUF_EXPORT ByteSinkWrapper : public strings::ByteSink {
-   public:
-    explicit ByteSinkWrapper(google::protobuf::io::CodedOutputStream* stream)
-        : stream_(stream) {}
-    virtual ~ByteSinkWrapper() {}
-
-    // ByteSink methods.
-    virtual void Append(const char* bytes, size_t n) {
-      stream_->WriteRaw(bytes, n);
-    }
-
-   private:
-    google::protobuf::io::CodedOutputStream* stream_;
-
-    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ByteSinkWrapper);
-  };
-
-  // Renders a simple value as a string. By default all non-string Render
-  // methods convert their argument to a string and call this method. This
-  // method can then be used to render the simple value without escaping it.
-  JsonObjectWriter* RenderSimple(StringPiece name, const string& value) {
-    WritePrefix(name);
-    stream_->WriteString(value);
-    return this;
-  }
-
-  // Pushes a new element to the stack.
-  void Push() { element_.reset(new Element(element_.release())); }
-
-  // Pops an element off of the stack and deletes the popped element.
-  void Pop() {
-    bool needs_newline = !element_->is_first();
-    element_.reset(element_->pop<Element>());
-    if (needs_newline) NewLine();
-  }
-
-  // If pretty printing is enabled, this will write a newline to the output,
-  // followed by optional indentation. Otherwise this method is a noop.
-  void NewLine() {
-    if (!indent_string_.empty()) {
-      WriteChar('\n');
-      for (int i = 0; i < element()->level(); i++) {
-        stream_->WriteString(indent_string_);
-      }
-    }
-  }
-
-  // Writes a prefix. This will write out any pretty printing and
-  // commas that are required, followed by the name and a ':' if
-  // the name is not null.
-  void WritePrefix(StringPiece name);
-
-  // Writes an individual character to the output.
-  void WriteChar(const char c) { stream_->WriteRaw(&c, sizeof(c)); }
-
-  // Returns the current value of empty_name_ok_for_next_key_ and resets it to
-  // false.
-  bool GetAndResetEmptyKeyOk();
-
-  google::protobuf::scoped_ptr<Element> element_;
-  google::protobuf::io::CodedOutputStream* stream_;
-  ByteSinkWrapper sink_;
-  const string indent_string_;
-
-  // Whether to use regular or websafe base64 encoding for byte fields. Defaults
-  // to regular base64 encoding.
-  bool use_websafe_base64_for_bytes_;
-
-  // Whether empty strings should be rendered for the next JSON key. This
-  // setting is only valid until the next key is rendered, after which it gets
-  // reset to false.
-  bool empty_name_ok_for_next_key_;
-
-  GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(JsonObjectWriter);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc
deleted file mode 100644 (file)
index 2ada358..0000000
+++ /dev/null
@@ -1,864 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/json_stream_parser.h>
-
-#include <algorithm>
-#include <cctype>
-#include <cerrno>
-#include <cstdlib>
-#include <cstring>
-#include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
-
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/util/internal/object_writer.h>
-#include <google/protobuf/util/internal/json_escaping.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/mathlimits.h>
-
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-// Allow these symbols to be referenced as util::Status, util::error::* in
-// this file.
-using util::Status;
-namespace error {
-using util::error::CANCELLED;
-using util::error::INTERNAL;
-using util::error::INVALID_ARGUMENT;
-}  // namespace error
-
-namespace converter {
-
-// Number of digits in an escaped UTF-16 code unit ('\\' 'u' X X X X)
-static const int kUnicodeEscapedLength = 6;
-
-// Length of the true, false, and null literals.
-static const int true_len = strlen("true");
-static const int false_len = strlen("false");
-static const int null_len = strlen("null");
-
-inline bool IsLetter(char c) {
-  return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || (c == '_') ||
-         (c == '$');
-}
-
-inline bool IsAlphanumeric(char c) {
-  return IsLetter(c) || ('0' <= c && c <= '9');
-}
-
-static bool ConsumeKey(StringPiece* input, StringPiece* key) {
-  if (input->empty() || !IsLetter((*input)[0])) return false;
-  int len = 1;
-  for (; len < input->size(); ++len) {
-    if (!IsAlphanumeric((*input)[len])) {
-      break;
-    }
-  }
-  *key = StringPiece(input->data(), len);
-  *input = StringPiece(input->data() + len, input->size() - len);
-  return true;
-}
-
-static bool MatchKey(StringPiece input) {
-  return !input.empty() && IsLetter(input[0]);
-}
-
-JsonStreamParser::JsonStreamParser(ObjectWriter* ow)
-    : ow_(ow),
-      stack_(),
-      leftover_(),
-      json_(),
-      p_(),
-      key_(),
-      key_storage_(),
-      finishing_(false),
-      parsed_(),
-      parsed_storage_(),
-      string_open_(0),
-      chunk_storage_(),
-      coerce_to_utf8_(false),
-      allow_empty_null_(false),
-      loose_float_number_conversion_(false) {
-  // Initialize the stack with a single value to be parsed.
-  stack_.push(VALUE);
-}
-
-JsonStreamParser::~JsonStreamParser() {}
-
-
-util::Status JsonStreamParser::Parse(StringPiece json) {
-  StringPiece chunk = json;
-  // If we have leftovers from a previous chunk, append the new chunk to it
-  // and create a new StringPiece pointing at the string's data. This could
-  // be large but we rely on the chunks to be small, assuming they are
-  // fragments of a Cord.
-  if (!leftover_.empty()) {
-    // Don't point chunk to leftover_ because leftover_ will be updated in
-    // ParseChunk(chunk).
-    chunk_storage_.swap(leftover_);
-    StrAppend(&chunk_storage_, json);
-    chunk = StringPiece(chunk_storage_);
-  }
-
-  // Find the structurally valid UTF8 prefix and parse only that.
-  int n = internal::UTF8SpnStructurallyValid(chunk);
-  if (n > 0) {
-    util::Status status = ParseChunk(chunk.substr(0, n));
-
-    // Any leftover characters are stashed in leftover_ for later parsing when
-    // there is more data available.
-    StrAppend(&leftover_, chunk.substr(n));
-    return status;
-  } else {
-    leftover_.assign(chunk.data(), chunk.size());
-    return util::Status();
-  }
-}
-
-util::Status JsonStreamParser::FinishParse() {
-  // If we do not expect anything and there is nothing left to parse we're all
-  // done.
-  if (stack_.empty() && leftover_.empty()) {
-    return util::Status();
-  }
-
-  // Storage for UTF8-coerced string.
-  google::protobuf::scoped_array<char> utf8;
-  if (coerce_to_utf8_) {
-    utf8.reset(new char[leftover_.size()]);
-    char* coerced = internal::UTF8CoerceToStructurallyValid(leftover_, utf8.get(), ' ');
-    p_ = json_ = StringPiece(coerced, leftover_.size());
-  } else {
-    p_ = json_ = leftover_;
-    if (!internal::IsStructurallyValidUTF8(leftover_)) {
-      return ReportFailure("Encountered non UTF-8 code points.");
-    }
-  }
-
-  // Parse the remainder in finishing mode, which reports errors for things like
-  // unterminated strings or unknown tokens that would normally be retried.
-  finishing_ = true;
-  util::Status result = RunParser();
-  if (result.ok()) {
-    SkipWhitespace();
-    if (!p_.empty()) {
-      result = ReportFailure("Parsing terminated before end of input.");
-    }
-  }
-  return result;
-}
-
-util::Status JsonStreamParser::ParseChunk(StringPiece chunk) {
-  // Do not do any work if the chunk is empty.
-  if (chunk.empty()) return util::Status();
-
-  p_ = json_ = chunk;
-
-  finishing_ = false;
-  util::Status result = RunParser();
-  if (!result.ok()) return result;
-
-  SkipWhitespace();
-  if (p_.empty()) {
-    // If we parsed everything we had, clear the leftover.
-    leftover_.clear();
-  } else {
-    // If we do not expect anything i.e. stack is empty, and we have non-empty
-    // string left to parse, we report an error.
-    if (stack_.empty()) {
-      return ReportFailure("Parsing terminated before end of input.");
-    }
-    // If we expect future data i.e. stack is non-empty, and we have some
-    // unparsed data left, we save it for later parse.
-    leftover_ = p_.ToString();
-  }
-  return util::Status();
-}
-
-util::Status JsonStreamParser::RunParser() {
-  while (!stack_.empty()) {
-    ParseType type = stack_.top();
-    TokenType t = (string_open_ == 0) ? GetNextTokenType() : BEGIN_STRING;
-    stack_.pop();
-    util::Status result;
-    switch (type) {
-      case VALUE:
-        result = ParseValue(t);
-        break;
-
-      case OBJ_MID:
-        result = ParseObjectMid(t);
-        break;
-
-      case ENTRY:
-        result = ParseEntry(t);
-        break;
-
-      case ENTRY_MID:
-        result = ParseEntryMid(t);
-        break;
-
-      case ARRAY_VALUE:
-        result = ParseArrayValue(t);
-        break;
-
-      case ARRAY_MID:
-        result = ParseArrayMid(t);
-        break;
-
-      default:
-        result = util::Status(util::error::INTERNAL,
-                              StrCat("Unknown parse type: ", type));
-        break;
-    }
-    if (!result.ok()) {
-      // If we were cancelled, save our state and try again later.
-      if (!finishing_ && result == util::Status(error::CANCELLED, "")) {
-        stack_.push(type);
-        // If we have a key we still need to render, make sure to save off the
-        // contents in our own storage.
-        if (!key_.empty() && key_storage_.empty()) {
-          StrAppend(&key_storage_, key_);
-          key_ = StringPiece(key_storage_);
-        }
-        result = util::Status();
-      }
-      return result;
-    }
-  }
-  return util::Status();
-}
-
-util::Status JsonStreamParser::ParseValue(TokenType type) {
-  switch (type) {
-    case BEGIN_OBJECT:
-      return HandleBeginObject();
-    case BEGIN_ARRAY:
-      return HandleBeginArray();
-    case BEGIN_STRING:
-      return ParseString();
-    case BEGIN_NUMBER:
-      return ParseNumber();
-    case BEGIN_TRUE:
-      return ParseTrue();
-    case BEGIN_FALSE:
-      return ParseFalse();
-    case BEGIN_NULL:
-      return ParseNull();
-    case UNKNOWN:
-      return ReportUnknown("Expected a value.");
-    default: {
-      if (allow_empty_null_ && IsEmptyNullAllowed(type)) {
-        return ParseEmptyNull();
-      }
-
-      // Special case for having been cut off while parsing, wait for more data.
-      // This handles things like 'fals' being at the end of the string, we
-      // don't know if the next char would be e, completing it, or something
-      // else, making it invalid.
-      if (!finishing_ && p_.length() < false_len) {
-        return util::Status(error::CANCELLED, "");
-      }
-      return ReportFailure("Unexpected token.");
-    }
-  }
-}
-
-util::Status JsonStreamParser::ParseString() {
-  util::Status result = ParseStringHelper();
-  if (result.ok()) {
-    ow_->RenderString(key_, parsed_);
-    key_ = StringPiece();
-    parsed_ = StringPiece();
-    parsed_storage_.clear();
-  }
-  return result;
-}
-
-util::Status JsonStreamParser::ParseStringHelper() {
-  // If we haven't seen the start quote, grab it and remember it for later.
-  if (string_open_ == 0) {
-    string_open_ = *p_.data();
-    GOOGLE_DCHECK(string_open_ == '\"' || string_open_ == '\'');
-    Advance();
-  }
-  // Track where we last copied data from so we can minimize copying.
-  const char* last = p_.data();
-  while (!p_.empty()) {
-    const char* data = p_.data();
-    if (*data == '\\') {
-      // We're about to handle an escape, copy all bytes from last to data.
-      if (last < data) {
-        parsed_storage_.append(last, data - last);
-      }
-      // If we ran out of string after the \, cancel or report an error
-      // depending on if we expect more data later.
-      if (p_.length() == 1) {
-        if (!finishing_) {
-          return util::Status(error::CANCELLED, "");
-        }
-        return ReportFailure("Closing quote expected in string.");
-      }
-      // Parse a unicode escape if we found \u in the string.
-      if (data[1] == 'u') {
-        util::Status result = ParseUnicodeEscape();
-        if (!result.ok()) {
-          return result;
-        }
-        // Move last pointer past the unicode escape and continue.
-        last = p_.data();
-        continue;
-      }
-      // Handle the standard set of backslash-escaped characters.
-      switch (data[1]) {
-        case 'b':
-          parsed_storage_.push_back('\b');
-          break;
-        case 'f':
-          parsed_storage_.push_back('\f');
-          break;
-        case 'n':
-          parsed_storage_.push_back('\n');
-          break;
-        case 'r':
-          parsed_storage_.push_back('\r');
-          break;
-        case 't':
-          parsed_storage_.push_back('\t');
-          break;
-        case 'v':
-          parsed_storage_.push_back('\v');
-          break;
-        default:
-          parsed_storage_.push_back(data[1]);
-      }
-      // We handled two characters, so advance past them and continue.
-      p_.remove_prefix(2);
-      last = p_.data();
-      continue;
-    }
-    // If we found the closing quote note it, advance past it, and return.
-    if (*data == string_open_) {
-      // If we didn't copy anything, reuse the input buffer.
-      if (parsed_storage_.empty()) {
-        parsed_ = StringPiece(last, data - last);
-      } else {
-        if (last < data) {
-          parsed_storage_.append(last, data - last);
-        }
-        parsed_ = StringPiece(parsed_storage_);
-      }
-      // Clear the quote char so next time we try to parse a string we'll
-      // start fresh.
-      string_open_ = 0;
-      Advance();
-      return util::Status();
-    }
-    // Normal character, just advance past it.
-    Advance();
-  }
-  // If we ran out of characters, copy over what we have so far.
-  if (last < p_.data()) {
-    parsed_storage_.append(last, p_.data() - last);
-  }
-  // If we didn't find the closing quote but we expect more data, cancel for now
-  if (!finishing_) {
-    return util::Status(error::CANCELLED, "");
-  }
-  // End of string reached without a closing quote, report an error.
-  string_open_ = 0;
-  return ReportFailure("Closing quote expected in string.");
-}
-
-// Converts a unicode escaped character to a decimal value stored in a char32
-// for use in UTF8 encoding utility.  We assume that str begins with \uhhhh and
-// convert that from the hex number to a decimal value.
-//
-// There are some security exploits with UTF-8 that we should be careful of:
-//   - http://www.unicode.org/reports/tr36/#UTF-8_Exploit
-//   - http://sites/intl-eng/design-guide/core-application
-util::Status JsonStreamParser::ParseUnicodeEscape() {
-  if (p_.length() < kUnicodeEscapedLength) {
-    if (!finishing_) {
-      return util::Status(error::CANCELLED, "");
-    }
-    return ReportFailure("Illegal hex string.");
-  }
-  GOOGLE_DCHECK_EQ('\\', p_.data()[0]);
-  GOOGLE_DCHECK_EQ('u', p_.data()[1]);
-  uint32 code = 0;
-  for (int i = 2; i < kUnicodeEscapedLength; ++i) {
-    if (!isxdigit(p_.data()[i])) {
-      return ReportFailure("Invalid escape sequence.");
-    }
-    code = (code << 4) + hex_digit_to_int(p_.data()[i]);
-  }
-  if (code >= JsonEscaping::kMinHighSurrogate &&
-      code <= JsonEscaping::kMaxHighSurrogate) {
-    if (p_.length() < 2 * kUnicodeEscapedLength) {
-      if (!finishing_) {
-        return util::Status(error::CANCELLED, "");
-      }
-      if (!coerce_to_utf8_) {
-        return ReportFailure("Missing low surrogate.");
-      }
-    } else if (p_.data()[kUnicodeEscapedLength] == '\\' &&
-               p_.data()[kUnicodeEscapedLength + 1] == 'u') {
-      uint32 low_code = 0;
-      for (int i = kUnicodeEscapedLength + 2; i < 2 * kUnicodeEscapedLength;
-           ++i) {
-        if (!isxdigit(p_.data()[i])) {
-          return ReportFailure("Invalid escape sequence.");
-        }
-        low_code = (low_code << 4) + hex_digit_to_int(p_.data()[i]);
-      }
-      if (low_code >= JsonEscaping::kMinLowSurrogate &&
-          low_code <= JsonEscaping::kMaxLowSurrogate) {
-        // Convert UTF-16 surrogate pair to 21-bit Unicode codepoint.
-        code = (((code & 0x3FF) << 10) | (low_code & 0x3FF)) +
-               JsonEscaping::kMinSupplementaryCodePoint;
-        // Advance past the first code unit escape.
-        p_.remove_prefix(kUnicodeEscapedLength);
-      } else if (!coerce_to_utf8_) {
-        return ReportFailure("Invalid low surrogate.");
-      }
-    } else if (!coerce_to_utf8_) {
-      return ReportFailure("Missing low surrogate.");
-    }
-  }
-  if (!coerce_to_utf8_ && !IsValidCodePoint(code)) {
-    return ReportFailure("Invalid unicode code point.");
-  }
-  char buf[UTFmax];
-  int len = EncodeAsUTF8Char(code, buf);
-  // Advance past the [final] code unit escape.
-  p_.remove_prefix(kUnicodeEscapedLength);
-  parsed_storage_.append(buf, len);
-  return util::Status();
-}
-
-util::Status JsonStreamParser::ParseNumber() {
-  NumberResult number;
-  util::Status result = ParseNumberHelper(&number);
-  if (result.ok()) {
-    switch (number.type) {
-      case NumberResult::DOUBLE:
-        ow_->RenderDouble(key_, number.double_val);
-        key_ = StringPiece();
-        break;
-
-      case NumberResult::INT:
-        ow_->RenderInt64(key_, number.int_val);
-        key_ = StringPiece();
-        break;
-
-      case NumberResult::UINT:
-        ow_->RenderUint64(key_, number.uint_val);
-        key_ = StringPiece();
-        break;
-
-      default:
-        return ReportFailure("Unable to parse number.");
-    }
-  }
-  return result;
-}
-
-util::Status JsonStreamParser::ParseDoubleHelper(
-    const string& number, NumberResult* result) {
-  if (!safe_strtod(number, &result->double_val)) {
-    return ReportFailure("Unable to parse number.");
-  }
-  if (!loose_float_number_conversion_ &&
-      !MathLimits<double>::IsFinite(result->double_val)) {
-    return ReportFailure("Number exceeds the range of double.");
-  }
-  result->type = NumberResult::DOUBLE;
-  return util::Status();
-}
-
-util::Status JsonStreamParser::ParseNumberHelper(NumberResult* result) {
-  const char* data = p_.data();
-  int length = p_.length();
-
-  // Look for the first non-numeric character, or the end of the string.
-  int index = 0;
-  bool floating = false;
-  bool negative = data[index] == '-';
-  // Find the first character that cannot be part of the number. Along the way
-  // detect if the number needs to be parsed as a double.
-  // Note that this restricts numbers to the JSON specification, so for example
-  // we do not support hex or octal notations.
-  for (; index < length; ++index) {
-    char c = data[index];
-    if (isdigit(c)) continue;
-    if (c == '.' || c == 'e' || c == 'E') {
-      floating = true;
-      continue;
-    }
-    if (c == '+' || c == '-' || c == 'x') continue;
-    // Not a valid number character, break out.
-    break;
-  }
-
-  // If the entire input is a valid number, and we may have more content in the
-  // future, we abort for now and resume when we know more.
-  if (index == length && !finishing_) {
-    return util::Status(error::CANCELLED, "");
-  }
-
-  // Create a string containing just the number, so we can use safe_strtoX
-  string number = p_.substr(0, index).ToString();
-
-  // Floating point number, parse as a double.
-  if (floating) {
-    util::Status status = ParseDoubleHelper(number, result);
-    if (status.ok()) {
-      p_.remove_prefix(index);
-    }
-    return status;
-  }
-
-  // Positive non-floating point number, parse as a uint64.
-  if (!negative) {
-    // Octal/Hex numbers are not valid JSON values.
-    if (number.length() >= 2 && number[0] == '0') {
-      return ReportFailure("Octal/hex numbers are not valid JSON values.");
-    }
-    if (safe_strtou64(number, &result->uint_val)) {
-      result->type = NumberResult::UINT;
-      p_.remove_prefix(index);
-      return util::Status();
-    } else {
-      // If the value is too large, parse it as double.
-      util::Status status = ParseDoubleHelper(number, result);
-      if (status.ok()) {
-        p_.remove_prefix(index);
-      }
-      return status;
-    }
-  }
-
-  // Octal/Hex numbers are not valid JSON values.
-  if (number.length() >= 3 && number[1] == '0') {
-    return ReportFailure("Octal/hex numbers are not valid JSON values.");
-  }
-  // Negative non-floating point number, parse as an int64.
-  if (safe_strto64(number, &result->int_val)) {
-    result->type = NumberResult::INT;
-    p_.remove_prefix(index);
-    return util::Status();
-  } else {
-    // If the value is too large, parse it as double.
-    util::Status status = ParseDoubleHelper(number, result);
-    if (status.ok()) {
-      p_.remove_prefix(index);
-    }
-    return status;
-  }
-}
-
-util::Status JsonStreamParser::HandleBeginObject() {
-  GOOGLE_DCHECK_EQ('{', *p_.data());
-  Advance();
-  ow_->StartObject(key_);
-  key_ = StringPiece();
-  stack_.push(ENTRY);
-  return util::Status();
-}
-
-util::Status JsonStreamParser::ParseObjectMid(TokenType type) {
-  if (type == UNKNOWN) {
-    return ReportUnknown("Expected , or } after key:value pair.");
-  }
-
-  // Object is complete, advance past the comma and render the EndObject.
-  if (type == END_OBJECT) {
-    Advance();
-    ow_->EndObject();
-    return util::Status();
-  }
-  // Found a comma, advance past it and get ready for an entry.
-  if (type == VALUE_SEPARATOR) {
-    Advance();
-    stack_.push(ENTRY);
-    return util::Status();
-  }
-  // Illegal token after key:value pair.
-  return ReportFailure("Expected , or } after key:value pair.");
-}
-
-util::Status JsonStreamParser::ParseEntry(TokenType type) {
-  if (type == UNKNOWN) {
-    return ReportUnknown("Expected an object key or }.");
-  }
-
-  // Close the object and return. This allows for trailing commas.
-  if (type == END_OBJECT) {
-    ow_->EndObject();
-    Advance();
-    return util::Status();
-  }
-
-  util::Status result;
-  if (type == BEGIN_STRING) {
-    // Key is a string (standard JSON), parse it and store the string.
-    result = ParseStringHelper();
-    if (result.ok()) {
-      key_storage_.clear();
-      if (!parsed_storage_.empty()) {
-        parsed_storage_.swap(key_storage_);
-        key_ = StringPiece(key_storage_);
-      } else {
-        key_ = parsed_;
-      }
-      parsed_ = StringPiece();
-    }
-  } else if (type == BEGIN_KEY) {
-    // Key is a bare key (back compat), create a StringPiece pointing to it.
-    result = ParseKey();
-  } else {
-    // Unknown key type, report an error.
-    result = ReportFailure("Expected an object key or }.");
-  }
-  // On success we next expect an entry mid ':' then an object mid ',' or '}'
-  if (result.ok()) {
-    stack_.push(OBJ_MID);
-    stack_.push(ENTRY_MID);
-  }
-  return result;
-}
-
-util::Status JsonStreamParser::ParseEntryMid(TokenType type) {
-  if (type == UNKNOWN) {
-    return ReportUnknown("Expected : between key:value pair.");
-  }
-  if (type == ENTRY_SEPARATOR) {
-    Advance();
-    stack_.push(VALUE);
-    return util::Status();
-  }
-  return ReportFailure("Expected : between key:value pair.");
-}
-
-util::Status JsonStreamParser::HandleBeginArray() {
-  GOOGLE_DCHECK_EQ('[', *p_.data());
-  Advance();
-  ow_->StartList(key_);
-  key_ = StringPiece();
-  stack_.push(ARRAY_VALUE);
-  return util::Status();
-}
-
-util::Status JsonStreamParser::ParseArrayValue(TokenType type) {
-  if (type == UNKNOWN) {
-    return ReportUnknown("Expected a value or ] within an array.");
-  }
-
-  if (type == END_ARRAY) {
-    ow_->EndList();
-    Advance();
-    return util::Status();
-  }
-
-  // The ParseValue call may push something onto the stack so we need to make
-  // sure an ARRAY_MID is after it, so we push it on now. Also, the parsing of
-  // empty-null array value is relying on this ARRAY_MID token.
-  stack_.push(ARRAY_MID);
-  util::Status result = ParseValue(type);
-  if (result == util::Status(error::CANCELLED, "")) {
-    // If we were cancelled, pop back off the ARRAY_MID so we don't try to
-    // push it on again when we try over.
-    stack_.pop();
-  }
-  return result;
-}
-
-util::Status JsonStreamParser::ParseArrayMid(TokenType type) {
-  if (type == UNKNOWN) {
-    return ReportUnknown("Expected , or ] after array value.");
-  }
-
-  if (type == END_ARRAY) {
-    ow_->EndList();
-    Advance();
-    return util::Status();
-  }
-
-  // Found a comma, advance past it and expect an array value next.
-  if (type == VALUE_SEPARATOR) {
-    Advance();
-    stack_.push(ARRAY_VALUE);
-    return util::Status();
-  }
-  // Illegal token after array value.
-  return ReportFailure("Expected , or ] after array value.");
-}
-
-util::Status JsonStreamParser::ParseTrue() {
-  ow_->RenderBool(key_, true);
-  key_ = StringPiece();
-  p_.remove_prefix(true_len);
-  return util::Status();
-}
-
-util::Status JsonStreamParser::ParseFalse() {
-  ow_->RenderBool(key_, false);
-  key_ = StringPiece();
-  p_.remove_prefix(false_len);
-  return util::Status();
-}
-
-util::Status JsonStreamParser::ParseNull() {
-  ow_->RenderNull(key_);
-  key_ = StringPiece();
-  p_.remove_prefix(null_len);
-  return util::Status();
-}
-
-util::Status JsonStreamParser::ParseEmptyNull() {
-  ow_->RenderNull(key_);
-  key_ = StringPiece();
-  return util::Status();
-}
-
-bool JsonStreamParser::IsEmptyNullAllowed(TokenType type) {
-  if (stack_.empty()) return false;
-  return (stack_.top() == ARRAY_MID && type == VALUE_SEPARATOR) ||
-         stack_.top() == OBJ_MID;
-}
-
-util::Status JsonStreamParser::ReportFailure(StringPiece message) {
-  static const int kContextLength = 20;
-  const char* p_start = p_.data();
-  const char* json_start = json_.data();
-  const char* begin = std::max(p_start - kContextLength, json_start);
-  const char* end =
-      std::min(p_start + kContextLength, json_start + json_.size());
-  StringPiece segment(begin, end - begin);
-  string location(p_start - begin, ' ');
-  location.push_back('^');
-  return util::Status(util::error::INVALID_ARGUMENT,
-                      StrCat(message, "\n", segment, "\n", location));
-}
-
-util::Status JsonStreamParser::ReportUnknown(StringPiece message) {
-  // If we aren't finishing the parse, cancel parsing and try later.
-  if (!finishing_) {
-    return util::Status(error::CANCELLED, "");
-  }
-  if (p_.empty()) {
-    return ReportFailure(StrCat("Unexpected end of string. ", message));
-  }
-  return ReportFailure(message);
-}
-
-void JsonStreamParser::SkipWhitespace() {
-  while (!p_.empty() && ascii_isspace(*p_.data())) {
-    Advance();
-  }
-}
-
-void JsonStreamParser::Advance() {
-  // Advance by moving one UTF8 character while making sure we don't go beyond
-  // the length of StringPiece.
-  p_.remove_prefix(std::min<int>(
-      p_.length(), UTF8FirstLetterNumBytes(p_.data(), p_.length())));
-}
-
-util::Status JsonStreamParser::ParseKey() {
-  StringPiece original = p_;
-  if (!ConsumeKey(&p_, &key_)) {
-    return ReportFailure("Invalid key or variable name.");
-  }
-  // If we consumed everything but expect more data, reset p_ and cancel since
-  // we can't know if the key was complete or not.
-  if (!finishing_ && p_.empty()) {
-    p_ = original;
-    return util::Status(error::CANCELLED, "");
-  }
-  // Since we aren't using the key storage, clear it out.
-  key_storage_.clear();
-  return util::Status();
-}
-
-JsonStreamParser::TokenType JsonStreamParser::GetNextTokenType() {
-  SkipWhitespace();
-
-  int size = p_.size();
-  if (size == 0) {
-    // If we ran out of data, report unknown and we'll place the previous parse
-    // type onto the stack and try again when we have more data.
-    return UNKNOWN;
-  }
-  // TODO(sven): Split this method based on context since different contexts
-  // support different tokens. Would slightly speed up processing?
-  const char* data = p_.data();
-  if (*data == '\"' || *data == '\'') return BEGIN_STRING;
-  if (*data == '-' || ('0' <= *data && *data <= '9')) {
-    return BEGIN_NUMBER;
-  }
-  if (size >= true_len && !strncmp(data, "true", true_len)) {
-    return BEGIN_TRUE;
-  }
-  if (size >= false_len && !strncmp(data, "false", false_len)) {
-    return BEGIN_FALSE;
-  }
-  if (size >= null_len && !strncmp(data, "null", null_len)) {
-    return BEGIN_NULL;
-  }
-  if (*data == '{') return BEGIN_OBJECT;
-  if (*data == '}') return END_OBJECT;
-  if (*data == '[') return BEGIN_ARRAY;
-  if (*data == ']') return END_ARRAY;
-  if (*data == ':') return ENTRY_SEPARATOR;
-  if (*data == ',') return VALUE_SEPARATOR;
-  if (MatchKey(p_)) {
-    return BEGIN_KEY;
-  }
-
-  // We don't know that we necessarily have an invalid token here, just that we
-  // can't parse what we have so far. So we don't report an error and just
-  // return UNKNOWN so we can try again later when we have more data, or if we
-  // finish and we have leftovers.
-  return UNKNOWN;
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/json_stream_parser.h b/3rdparty/protobuf/src/google/protobuf/util/internal/json_stream_parser.h
deleted file mode 100644 (file)
index 31933b6..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_STREAM_PARSER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_STREAM_PARSER_H__
-
-#include <stack>
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/status.h>
-
-namespace google {
-namespace util {
-class Status;
-}  // namespace util
-
-namespace protobuf {
-namespace util {
-namespace converter {
-
-class ObjectWriter;
-
-// A JSON parser that can parse a stream of JSON chunks rather than needing the
-// entire JSON string up front. It is a modified version of the parser in
-// //net/proto/json/json-parser.h that has been changed in the following ways:
-// - Changed from recursion to an explicit stack to allow resumption
-// - Added support for int64 and uint64 numbers
-// - Removed support for octal and decimal escapes
-// - Removed support for numeric keys
-// - Removed support for functions (javascript)
-// - Removed some lax-comma support (but kept trailing comma support)
-// - Writes directly to an ObjectWriter rather than using subclassing
-//
-// Here is an example usage:
-// JsonStreamParser parser(ow_.get());
-// util::Status result = parser.Parse(chunk1);
-// result.Update(parser.Parse(chunk2));
-// result.Update(parser.FinishParse());
-// GOOGLE_DCHECK(result.ok()) << "Failed to parse JSON";
-//
-// This parser is thread-compatible as long as only one thread is calling a
-// Parse() method at a time.
-class LIBPROTOBUF_EXPORT JsonStreamParser {
- public:
-  // Creates a JsonStreamParser that will write to the given ObjectWriter.
-  explicit JsonStreamParser(ObjectWriter* ow);
-  virtual ~JsonStreamParser();
-
-  // Parses a UTF-8 encoded JSON string from a StringPiece.
-  util::Status Parse(StringPiece json);
-
-
-  // Finish parsing the JSON string.
-  util::Status FinishParse();
-
-
- private:
-  enum TokenType {
-    BEGIN_STRING,     // " or '
-    BEGIN_NUMBER,     // - or digit
-    BEGIN_TRUE,       // true
-    BEGIN_FALSE,      // false
-    BEGIN_NULL,       // null
-    BEGIN_OBJECT,     // {
-    END_OBJECT,       // }
-    BEGIN_ARRAY,      // [
-    END_ARRAY,        // ]
-    ENTRY_SEPARATOR,  // :
-    VALUE_SEPARATOR,  // ,
-    BEGIN_KEY,        // letter, _, $ or digit.  Must begin with non-digit
-    UNKNOWN           // Unknown token or we ran out of the stream.
-  };
-
-  enum ParseType {
-    VALUE,        // Expects a {, [, true, false, null, string or number
-    OBJ_MID,      // Expects a ',' or }
-    ENTRY,        // Expects a key or }
-    ENTRY_MID,    // Expects a :
-    ARRAY_VALUE,  // Expects a value or ]
-    ARRAY_MID     // Expects a ',' or ]
-  };
-
-  // Holds the result of parsing a number
-  struct NumberResult {
-    enum Type { DOUBLE, INT, UINT };
-    Type type;
-    union {
-      double double_val;
-      int64 int_val;
-      uint64 uint_val;
-    };
-  };
-
-  // Parses a single chunk of JSON, returning an error if the JSON was invalid.
-  util::Status ParseChunk(StringPiece json);
-
-  // Runs the parser based on stack_ and p_, until the stack is empty or p_ runs
-  // out of data. If we unexpectedly run out of p_ we push the latest back onto
-  // the stack and return.
-  util::Status RunParser();
-
-  // Parses a value from p_ and writes it to ow_.
-  // A value may be an object, array, true, false, null, string or number.
-  util::Status ParseValue(TokenType type);
-
-  // Parses a string and writes it out to the ow_.
-  util::Status ParseString();
-
-  // Parses a string, storing the result in parsed_.
-  util::Status ParseStringHelper();
-
-  // This function parses unicode escape sequences in strings. It returns an
-  // error when there's a parsing error, either the size is not the expected
-  // size or a character is not a hex digit.  When it returns str will contain
-  // what has been successfully parsed so far.
-  util::Status ParseUnicodeEscape();
-
-  // Expects p_ to point to a JSON number, writes the number to the writer using
-  // the appropriate Render method based on the type of number.
-  util::Status ParseNumber();
-
-  // Parse a number into a NumberResult, reporting an error if no number could
-  // be parsed. This method will try to parse into a uint64, int64, or double
-  // based on whether the number was positive or negative or had a decimal
-  // component.
-  util::Status ParseNumberHelper(NumberResult* result);
-
-  // Parse a number as double into a NumberResult.
-  util::Status ParseDoubleHelper(const string& number, NumberResult* result);
-
-  // Handles a { during parsing of a value.
-  util::Status HandleBeginObject();
-
-  // Parses from the ENTRY state.
-  util::Status ParseEntry(TokenType type);
-
-  // Parses from the ENTRY_MID state.
-  util::Status ParseEntryMid(TokenType type);
-
-  // Parses from the OBJ_MID state.
-  util::Status ParseObjectMid(TokenType type);
-
-  // Handles a [ during parsing of a value.
-  util::Status HandleBeginArray();
-
-  // Parses from the ARRAY_VALUE state.
-  util::Status ParseArrayValue(TokenType type);
-
-  // Parses from the ARRAY_MID state.
-  util::Status ParseArrayMid(TokenType type);
-
-  // Expects p_ to point to an unquoted literal
-  util::Status ParseTrue();
-  util::Status ParseFalse();
-  util::Status ParseNull();
-  util::Status ParseEmptyNull();
-
-  // Whether an empty-null is allowed in the current state.
-  bool IsEmptyNullAllowed(TokenType type);
-
-  // Report a failure as a util::Status.
-  util::Status ReportFailure(StringPiece message);
-
-  // Report a failure due to an UNKNOWN token type. We check if we hit the
-  // end of the stream and if we're finishing or not to detect what type of
-  // status to return in this case.
-  util::Status ReportUnknown(StringPiece message);
-
-  // Advance p_ past all whitespace or until the end of the string.
-  void SkipWhitespace();
-
-  // Advance p_ one UTF-8 character
-  void Advance();
-
-  // Expects p_ to point to the beginning of a key.
-  util::Status ParseKey();
-
-  // Return the type of the next token at p_.
-  TokenType GetNextTokenType();
-
-  // The object writer to write parse events to.
-  ObjectWriter* ow_;
-
-  // The stack of parsing we still need to do. When the stack runs empty we will
-  // have parsed a single value from the root (e.g. an object or list).
-  std::stack<ParseType> stack_;
-
-  // Contains any leftover text from a previous chunk that we weren't able to
-  // fully parse, for example the start of a key or number.
-  string leftover_;
-
-  // The current chunk of JSON being parsed. Primarily used for providing
-  // context during error reporting.
-  StringPiece json_;
-
-  // A pointer within the current JSON being parsed, used to track location.
-  StringPiece p_;
-
-  // Stores the last key read, as we separate parsing of keys and values.
-  StringPiece key_;
-
-  // Storage for key_ if we need to keep ownership, for example between chunks
-  // or if the key was unescaped from a JSON string.
-  string key_storage_;
-
-  // True during the FinishParse() call, so we know that any errors are fatal.
-  // For example an unterminated string will normally result in cancelling and
-  // trying during the next chunk, but during FinishParse() it is an error.
-  bool finishing_;
-
-  // String we parsed during a call to ParseStringHelper().
-  StringPiece parsed_;
-
-  // Storage for the string we parsed. This may be empty if the string was able
-  // to be parsed directly from the input.
-  string parsed_storage_;
-
-  // The character that opened the string, either ' or ".
-  // A value of 0 indicates that string parsing is not in process.
-  char string_open_;
-
-  // Storage for the chunk that are being parsed in ParseChunk().
-  string chunk_storage_;
-
-  // Whether to allow non UTF-8 encoded input and replace invalid code points.
-  bool coerce_to_utf8_;
-
-  // Whether allows empty string represented null array value or object entry
-  // value.
-  bool allow_empty_null_;
-
-  // Whether allows out-of-range floating point numbers or reject them.
-  bool loose_float_number_conversion_;
-
-  GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(JsonStreamParser);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_STREAM_PARSER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/location_tracker.h b/3rdparty/protobuf/src/google/protobuf/util/internal/location_tracker.h
deleted file mode 100644 (file)
index 0864b05..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_LOCATION_TRACKER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_LOCATION_TRACKER_H__
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// LocationTrackerInterface is an interface for classes that track
-// the location information for the purpose of error reporting.
-class LIBPROTOBUF_EXPORT LocationTrackerInterface {
- public:
-  virtual ~LocationTrackerInterface() {}
-
-  // Returns the object location as human readable string.
-  virtual string ToString() const = 0;
-
- protected:
-  LocationTrackerInterface() {}
-
- private:
-  // Please do not add any data members to this class.
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(LocationTrackerInterface);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_LOCATION_TRACKER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/mock_error_listener.h b/3rdparty/protobuf/src/google/protobuf/util/internal/mock_error_listener.h
deleted file mode 100644 (file)
index 591c35d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_MOCK_ERROR_LISTENER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_MOCK_ERROR_LISTENER_H__
-
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/util/internal/error_listener.h>
-#include <google/protobuf/util/internal/location_tracker.h>
-#include <gmock/gmock.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-class MockErrorListener : public ErrorListener {
- public:
-  MockErrorListener() {}
-  virtual ~MockErrorListener() {}
-
-  MOCK_METHOD3(InvalidName, void(const LocationTrackerInterface& loc,
-                                 StringPiece unknown_name,
-                                 StringPiece message));
-  MOCK_METHOD3(InvalidValue, void(const LocationTrackerInterface& loc,
-                                  StringPiece type_name, StringPiece value));
-  MOCK_METHOD2(MissingField, void(const LocationTrackerInterface& loc,
-                                  StringPiece missing_name));
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_MOCK_ERROR_LISTENER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/object_location_tracker.h b/3rdparty/protobuf/src/google/protobuf/util/internal/object_location_tracker.h
deleted file mode 100644 (file)
index 8586cec..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_LOCATION_TRACKER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_LOCATION_TRACKER_H__
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/util/internal/location_tracker.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// An empty concrete implementation of LocationTrackerInterface.
-class ObjectLocationTracker : public LocationTrackerInterface {
- public:
-  // Creates an empty location tracker.
-  ObjectLocationTracker() {}
-
-  virtual ~ObjectLocationTracker() {}
-
-  // Returns empty because nothing is tracked.
-  virtual string ToString() const { return ""; }
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectLocationTracker);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_LOCATION_TRACKER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/object_source.h b/3rdparty/protobuf/src/google/protobuf/util/internal/object_source.h
deleted file mode 100644 (file)
index 2c31cfb..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_SOURCE_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_SOURCE_H__
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/status.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-class ObjectWriter;
-
-// An ObjectSource is anything that can write to an ObjectWriter.
-// Implementation of this interface typically provide constructors or
-// factory methods to create an instance based on some source data, for
-// example, a character stream, or protobuf.
-//
-// Derived classes could be thread-unsafe.
-class LIBPROTOBUF_EXPORT ObjectSource {
- public:
-  virtual ~ObjectSource() {}
-
-  // Writes to the ObjectWriter
-  virtual util::Status WriteTo(ObjectWriter* ow) const {
-    return NamedWriteTo("", ow);
-  }
-
-  // Writes to the ObjectWriter with a custom name for the message.
-  // This is useful when you chain ObjectSource together by embedding one
-  // within another.
-  virtual util::Status NamedWriteTo(StringPiece name,
-                                      ObjectWriter* ow) const = 0;
-
- protected:
-  ObjectSource() {}
-
- private:
-  // Do not add any data members to this class.
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectSource);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_SOURCE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/object_writer.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/object_writer.cc
deleted file mode 100644 (file)
index 57cc08a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/object_writer.h>
-
-#include <google/protobuf/util/internal/datapiece.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// static
-void ObjectWriter::RenderDataPieceTo(const DataPiece& data, StringPiece name,
-                                     ObjectWriter* ow) {
-  switch (data.type()) {
-    case DataPiece::TYPE_INT32: {
-      ow->RenderInt32(name, data.ToInt32().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_INT64: {
-      ow->RenderInt64(name, data.ToInt64().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_UINT32: {
-      ow->RenderUint32(name, data.ToUint32().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_UINT64: {
-      ow->RenderUint64(name, data.ToUint64().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_DOUBLE: {
-      ow->RenderDouble(name, data.ToDouble().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_FLOAT: {
-      ow->RenderFloat(name, data.ToFloat().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_BOOL: {
-      ow->RenderBool(name, data.ToBool().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_STRING: {
-      ow->RenderString(name, data.ToString().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_BYTES: {
-      ow->RenderBytes(name, data.ToBytes().ValueOrDie());
-      break;
-    }
-    case DataPiece::TYPE_NULL: {
-      ow->RenderNull(name);
-      break;
-    }
-    default:
-      break;
-  }
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/object_writer.h b/3rdparty/protobuf/src/google/protobuf/util/internal/object_writer.h
deleted file mode 100644 (file)
index b6fbd19..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_WRITER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_WRITER_H__
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/stringpiece.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-class DataPiece;
-
-// An ObjectWriter is an interface for writing a stream of events
-// representing objects and collections. Implementation of this
-// interface can be used to write an object stream to an in-memory
-// structure, protobufs, JSON, XML, or any other output format
-// desired. The ObjectSource interface is typically used as the
-// source of an object stream.
-//
-// See JsonObjectWriter for a sample implementation of ObjectWriter
-// and its use.
-//
-// Derived classes could be thread-unsafe.
-//
-// TODO(xinb): seems like a prime candidate to apply the RAII paradigm
-// and get rid the need to call EndXXX().
-class LIBPROTOBUF_EXPORT ObjectWriter {
- public:
-  virtual ~ObjectWriter() {}
-
-  // Starts an object. If the name is empty, the object will not be named.
-  virtual ObjectWriter* StartObject(StringPiece name) = 0;
-
-  // Ends an object.
-  virtual ObjectWriter* EndObject() = 0;
-
-  // Starts a list. If the name is empty, the list will not be named.
-  virtual ObjectWriter* StartList(StringPiece name) = 0;
-
-  // Ends a list.
-  virtual ObjectWriter* EndList() = 0;
-
-  // Renders a boolean value.
-  virtual ObjectWriter* RenderBool(StringPiece name, bool value) = 0;
-
-  // Renders an 32-bit integer value.
-  virtual ObjectWriter* RenderInt32(StringPiece name, int32 value) = 0;
-
-  // Renders an 32-bit unsigned integer value.
-  virtual ObjectWriter* RenderUint32(StringPiece name, uint32 value) = 0;
-
-  // Renders a 64-bit integer value.
-  virtual ObjectWriter* RenderInt64(StringPiece name, int64 value) = 0;
-
-  // Renders an 64-bit unsigned integer value.
-  virtual ObjectWriter* RenderUint64(StringPiece name, uint64 value) = 0;
-
-  // Renders a double value.
-  virtual ObjectWriter* RenderDouble(StringPiece name, double value) = 0;
-
-  // Renders a float value.
-  virtual ObjectWriter* RenderFloat(StringPiece name, float value) = 0;
-
-  // Renders a StringPiece value. This is for rendering strings.
-  virtual ObjectWriter* RenderString(StringPiece name, StringPiece value) = 0;
-
-  // Renders a bytes value.
-  virtual ObjectWriter* RenderBytes(StringPiece name, StringPiece value) = 0;
-
-  // Renders a Null value.
-  virtual ObjectWriter* RenderNull(StringPiece name) = 0;
-
-
-  // Renders a DataPiece object to a ObjectWriter.
-  static void RenderDataPieceTo(const DataPiece& data, StringPiece name,
-                                ObjectWriter* ow);
-
-  // Indicates whether this ObjectWriter has completed writing the root message,
-  // usually this means writing of one complete object. Subclasses must override
-  // this behavior appropriately.
-  virtual bool done() { return false; }
-
-  void set_use_strict_base64_decoding(bool value) {
-    use_strict_base64_decoding_ = value;
-  }
-
-  bool use_strict_base64_decoding() const {
-    return use_strict_base64_decoding_;
-  }
-
-  // Whether empty strings should be rendered for the next name for Start/Render
-  // calls. This setting is only valid until the next key is rendered, after
-  // which it gets reset.
-  // It is up to the derived classes to interpret this and render accordingly.
-  // Default implementation ignores this setting.
-  virtual void empty_name_ok_for_next_key() {}
-
- protected:
-  ObjectWriter() : use_strict_base64_decoding_(true) {}
-
- private:
-  // If set to true, we use the stricter version of base64 decoding for byte
-  // fields by making sure decoded version encodes back to the original string.
-  bool use_strict_base64_decoding_;
-
-  // Do not add any data members to this class.
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectWriter);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_WRITER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/proto_writer.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/proto_writer.cc
deleted file mode 100644 (file)
index 8bebf2a..0000000
+++ /dev/null
@@ -1,799 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/proto_writer.h>
-
-#include <functional>
-#include <stack>
-
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/stubs/time.h>
-#include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/util/internal/field_mask_utility.h>
-#include <google/protobuf/util/internal/object_location_tracker.h>
-#include <google/protobuf/util/internal/constants.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/map_util.h>
-#include <google/protobuf/stubs/statusor.h>
-
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-using google::protobuf::internal::WireFormatLite;
-using google::protobuf::io::CodedOutputStream;
-using util::error::INVALID_ARGUMENT;
-using util::Status;
-using util::StatusOr;
-
-
-ProtoWriter::ProtoWriter(TypeResolver* type_resolver,
-                         const google::protobuf::Type& type,
-                         strings::ByteSink* output, ErrorListener* listener)
-    : master_type_(type),
-      typeinfo_(TypeInfo::NewTypeInfo(type_resolver)),
-      own_typeinfo_(true),
-      done_(false),
-      ignore_unknown_fields_(false),
-      use_lower_camel_for_enums_(false),
-      element_(NULL),
-      size_insert_(),
-      output_(output),
-      buffer_(),
-      adapter_(&buffer_),
-      stream_(new CodedOutputStream(&adapter_)),
-      listener_(listener),
-      invalid_depth_(0),
-      tracker_(new ObjectLocationTracker()) {}
-
-ProtoWriter::ProtoWriter(const TypeInfo* typeinfo,
-                         const google::protobuf::Type& type,
-                         strings::ByteSink* output, ErrorListener* listener)
-    : master_type_(type),
-      typeinfo_(typeinfo),
-      own_typeinfo_(false),
-      done_(false),
-      ignore_unknown_fields_(false),
-      use_lower_camel_for_enums_(false),
-      element_(NULL),
-      size_insert_(),
-      output_(output),
-      buffer_(),
-      adapter_(&buffer_),
-      stream_(new CodedOutputStream(&adapter_)),
-      listener_(listener),
-      invalid_depth_(0),
-      tracker_(new ObjectLocationTracker()) {}
-
-ProtoWriter::~ProtoWriter() {
-  if (own_typeinfo_) {
-    delete typeinfo_;
-  }
-  if (element_ == NULL) return;
-  // Cleanup explicitly in order to avoid destructor stack overflow when input
-  // is deeply nested.
-  // Cast to BaseElement to avoid doing additional checks (like missing fields)
-  // during pop().
-  google::protobuf::scoped_ptr<BaseElement> element(
-      static_cast<BaseElement*>(element_.get())->pop<BaseElement>());
-  while (element != NULL) {
-    element.reset(element->pop<BaseElement>());
-  }
-}
-
-namespace {
-
-// Writes an INT32 field, including tag to the stream.
-inline Status WriteInt32(int field_number, const DataPiece& data,
-                         CodedOutputStream* stream) {
-  StatusOr<int32> i32 = data.ToInt32();
-  if (i32.ok()) {
-    WireFormatLite::WriteInt32(field_number, i32.ValueOrDie(), stream);
-  }
-  return i32.status();
-}
-
-// writes an SFIXED32 field, including tag, to the stream.
-inline Status WriteSFixed32(int field_number, const DataPiece& data,
-                            CodedOutputStream* stream) {
-  StatusOr<int32> i32 = data.ToInt32();
-  if (i32.ok()) {
-    WireFormatLite::WriteSFixed32(field_number, i32.ValueOrDie(), stream);
-  }
-  return i32.status();
-}
-
-// Writes an SINT32 field, including tag, to the stream.
-inline Status WriteSInt32(int field_number, const DataPiece& data,
-                          CodedOutputStream* stream) {
-  StatusOr<int32> i32 = data.ToInt32();
-  if (i32.ok()) {
-    WireFormatLite::WriteSInt32(field_number, i32.ValueOrDie(), stream);
-  }
-  return i32.status();
-}
-
-// Writes a FIXED32 field, including tag, to the stream.
-inline Status WriteFixed32(int field_number, const DataPiece& data,
-                           CodedOutputStream* stream) {
-  StatusOr<uint32> u32 = data.ToUint32();
-  if (u32.ok()) {
-    WireFormatLite::WriteFixed32(field_number, u32.ValueOrDie(), stream);
-  }
-  return u32.status();
-}
-
-// Writes a UINT32 field, including tag, to the stream.
-inline Status WriteUInt32(int field_number, const DataPiece& data,
-                          CodedOutputStream* stream) {
-  StatusOr<uint32> u32 = data.ToUint32();
-  if (u32.ok()) {
-    WireFormatLite::WriteUInt32(field_number, u32.ValueOrDie(), stream);
-  }
-  return u32.status();
-}
-
-// Writes an INT64 field, including tag, to the stream.
-inline Status WriteInt64(int field_number, const DataPiece& data,
-                         CodedOutputStream* stream) {
-  StatusOr<int64> i64 = data.ToInt64();
-  if (i64.ok()) {
-    WireFormatLite::WriteInt64(field_number, i64.ValueOrDie(), stream);
-  }
-  return i64.status();
-}
-
-// Writes an SFIXED64 field, including tag, to the stream.
-inline Status WriteSFixed64(int field_number, const DataPiece& data,
-                            CodedOutputStream* stream) {
-  StatusOr<int64> i64 = data.ToInt64();
-  if (i64.ok()) {
-    WireFormatLite::WriteSFixed64(field_number, i64.ValueOrDie(), stream);
-  }
-  return i64.status();
-}
-
-// Writes an SINT64 field, including tag, to the stream.
-inline Status WriteSInt64(int field_number, const DataPiece& data,
-                          CodedOutputStream* stream) {
-  StatusOr<int64> i64 = data.ToInt64();
-  if (i64.ok()) {
-    WireFormatLite::WriteSInt64(field_number, i64.ValueOrDie(), stream);
-  }
-  return i64.status();
-}
-
-// Writes a FIXED64 field, including tag, to the stream.
-inline Status WriteFixed64(int field_number, const DataPiece& data,
-                           CodedOutputStream* stream) {
-  StatusOr<uint64> u64 = data.ToUint64();
-  if (u64.ok()) {
-    WireFormatLite::WriteFixed64(field_number, u64.ValueOrDie(), stream);
-  }
-  return u64.status();
-}
-
-// Writes a UINT64 field, including tag, to the stream.
-inline Status WriteUInt64(int field_number, const DataPiece& data,
-                          CodedOutputStream* stream) {
-  StatusOr<uint64> u64 = data.ToUint64();
-  if (u64.ok()) {
-    WireFormatLite::WriteUInt64(field_number, u64.ValueOrDie(), stream);
-  }
-  return u64.status();
-}
-
-// Writes a DOUBLE field, including tag, to the stream.
-inline Status WriteDouble(int field_number, const DataPiece& data,
-                          CodedOutputStream* stream) {
-  StatusOr<double> d = data.ToDouble();
-  if (d.ok()) {
-    WireFormatLite::WriteDouble(field_number, d.ValueOrDie(), stream);
-  }
-  return d.status();
-}
-
-// Writes a FLOAT field, including tag, to the stream.
-inline Status WriteFloat(int field_number, const DataPiece& data,
-                         CodedOutputStream* stream) {
-  StatusOr<float> f = data.ToFloat();
-  if (f.ok()) {
-    WireFormatLite::WriteFloat(field_number, f.ValueOrDie(), stream);
-  }
-  return f.status();
-}
-
-// Writes a BOOL field, including tag, to the stream.
-inline Status WriteBool(int field_number, const DataPiece& data,
-                        CodedOutputStream* stream) {
-  StatusOr<bool> b = data.ToBool();
-  if (b.ok()) {
-    WireFormatLite::WriteBool(field_number, b.ValueOrDie(), stream);
-  }
-  return b.status();
-}
-
-// Writes a BYTES field, including tag, to the stream.
-inline Status WriteBytes(int field_number, const DataPiece& data,
-                         CodedOutputStream* stream) {
-  StatusOr<string> c = data.ToBytes();
-  if (c.ok()) {
-    WireFormatLite::WriteBytes(field_number, c.ValueOrDie(), stream);
-  }
-  return c.status();
-}
-
-// Writes a STRING field, including tag, to the stream.
-inline Status WriteString(int field_number, const DataPiece& data,
-                          CodedOutputStream* stream) {
-  StatusOr<string> s = data.ToString();
-  if (s.ok()) {
-    WireFormatLite::WriteString(field_number, s.ValueOrDie(), stream);
-  }
-  return s.status();
-}
-
-// Writes an ENUM field, including tag, to the stream.
-inline Status WriteEnum(int field_number, const DataPiece& data,
-                        const google::protobuf::Enum* enum_type,
-                        CodedOutputStream* stream,
-                        bool use_lower_camel_for_enums) {
-  StatusOr<int> e = data.ToEnum(enum_type, use_lower_camel_for_enums);
-  if (e.ok()) {
-    WireFormatLite::WriteEnum(field_number, e.ValueOrDie(), stream);
-  }
-  return e.status();
-}
-
-// Given a google::protobuf::Type, returns the set of all required fields.
-std::set<const google::protobuf::Field*> GetRequiredFields(
-    const google::protobuf::Type& type) {
-  std::set<const google::protobuf::Field*> required;
-  for (int i = 0; i < type.fields_size(); i++) {
-    const google::protobuf::Field& field = type.fields(i);
-    if (field.cardinality() ==
-        google::protobuf::Field_Cardinality_CARDINALITY_REQUIRED) {
-      required.insert(&field);
-    }
-  }
-  return required;
-}
-
-}  // namespace
-
-ProtoWriter::ProtoElement::ProtoElement(const TypeInfo* typeinfo,
-                                        const google::protobuf::Type& type,
-                                        ProtoWriter* enclosing)
-    : BaseElement(NULL),
-      ow_(enclosing),
-      parent_field_(NULL),
-      typeinfo_(typeinfo),
-      proto3_(type.syntax() == google::protobuf::SYNTAX_PROTO3),
-      type_(type),
-      size_index_(-1),
-      array_index_(-1),
-      // oneof_indices_ values are 1-indexed (0 means not present).
-      oneof_indices_(type.oneofs_size() + 1) {
-  if (!proto3_) {
-    required_fields_ = GetRequiredFields(type_);
-  }
-}
-
-ProtoWriter::ProtoElement::ProtoElement(ProtoWriter::ProtoElement* parent,
-                                        const google::protobuf::Field* field,
-                                        const google::protobuf::Type& type,
-                                        bool is_list)
-    : BaseElement(parent),
-      ow_(this->parent()->ow_),
-      parent_field_(field),
-      typeinfo_(this->parent()->typeinfo_),
-      proto3_(type.syntax() == google::protobuf::SYNTAX_PROTO3),
-      type_(type),
-      size_index_(
-          !is_list && field->kind() == google::protobuf::Field_Kind_TYPE_MESSAGE
-              ? ow_->size_insert_.size()
-              : -1),
-      array_index_(is_list ? 0 : -1),
-      // oneof_indices_ values are 1-indexed (0 means not present).
-      oneof_indices_(type_.oneofs_size() + 1) {
-  if (!is_list) {
-    if (ow_->IsRepeated(*field)) {
-      // Update array_index_ if it is an explicit list.
-      if (this->parent()->array_index_ >= 0) this->parent()->array_index_++;
-    } else if (!proto3_) {
-      // For required fields tracking.
-      this->parent()->RegisterField(field);
-    }
-
-    if (field->kind() == google::protobuf::Field_Kind_TYPE_MESSAGE) {
-      if (!proto3_) {
-        required_fields_ = GetRequiredFields(type_);
-      }
-      int start_pos = ow_->stream_->ByteCount();
-      // length of serialized message is the final buffer position minus
-      // starting buffer position, plus length adjustments for size fields
-      // of any nested messages. We start with -start_pos here, so we only
-      // need to add the final buffer position to it at the end.
-      SizeInfo info = {start_pos, -start_pos};
-      ow_->size_insert_.push_back(info);
-    }
-  }
-}
-
-ProtoWriter::ProtoElement* ProtoWriter::ProtoElement::pop() {
-  if (!proto3_) {
-    // Calls the registered error listener for any required field(s) not yet
-    // seen.
-    for (std::set<const google::protobuf::Field*>::iterator it =
-             required_fields_.begin();
-         it != required_fields_.end(); ++it) {
-      ow_->MissingField((*it)->name());
-    }
-  }
-  // Computes the total number of proto bytes used by a message, also adjusts
-  // the size of all parent messages by the length of this size field.
-  // If size_index_ < 0, this is not a message, so no size field is added.
-  if (size_index_ >= 0) {
-    // Add the final buffer position to compute the total length of this
-    // serialized message. The stored value (before this addition) already
-    // contains the total length of the size fields of all nested messages
-    // minus the initial buffer position.
-    ow_->size_insert_[size_index_].size += ow_->stream_->ByteCount();
-    // Calculate the length required to serialize the size field of the
-    // message, and propagate this additional size information upward to
-    // all enclosing messages.
-    int size = ow_->size_insert_[size_index_].size;
-    int length = CodedOutputStream::VarintSize32(size);
-    for (ProtoElement* e = parent(); e != NULL; e = e->parent()) {
-      // Only nested messages have size field, lists do not have size field.
-      if (e->size_index_ >= 0) {
-        ow_->size_insert_[e->size_index_].size += length;
-      }
-    }
-  }
-  return BaseElement::pop<ProtoElement>();
-}
-
-void ProtoWriter::ProtoElement::RegisterField(
-    const google::protobuf::Field* field) {
-  if (!required_fields_.empty() &&
-      field->cardinality() ==
-          google::protobuf::Field_Cardinality_CARDINALITY_REQUIRED) {
-    required_fields_.erase(field);
-  }
-}
-
-string ProtoWriter::ProtoElement::ToString() const {
-  if (parent() == NULL) return "";
-  string loc = parent()->ToString();
-  if (!ow_->IsRepeated(*parent_field_) ||
-      parent()->parent_field_ != parent_field_) {
-    string name = parent_field_->name();
-    int i = 0;
-    while (i < name.size() && (ascii_isalnum(name[i]) || name[i] == '_')) ++i;
-    if (i > 0 && i == name.size()) {  // safe field name
-      if (loc.empty()) {
-        loc = name;
-      } else {
-        StrAppend(&loc, ".", name);
-      }
-    } else {
-      StrAppend(&loc, "[\"", CEscape(name), "\"]");
-    }
-  }
-  if (ow_->IsRepeated(*parent_field_) && array_index_ > 0) {
-    StrAppend(&loc, "[", array_index_ - 1, "]");
-  }
-  return loc.empty() ? "." : loc;
-}
-
-bool ProtoWriter::ProtoElement::IsOneofIndexTaken(int32 index) {
-  return oneof_indices_[index];
-}
-
-void ProtoWriter::ProtoElement::TakeOneofIndex(int32 index) {
-  oneof_indices_[index] = true;
-}
-
-void ProtoWriter::InvalidName(StringPiece unknown_name, StringPiece message) {
-  listener_->InvalidName(location(), ToSnakeCase(unknown_name), message);
-}
-
-void ProtoWriter::InvalidValue(StringPiece type_name, StringPiece value) {
-  listener_->InvalidValue(location(), type_name, value);
-}
-
-void ProtoWriter::MissingField(StringPiece missing_name) {
-  listener_->MissingField(location(), missing_name);
-}
-
-ProtoWriter* ProtoWriter::StartObject(StringPiece name) {
-  // Starting the root message. Create the root ProtoElement and return.
-  if (element_ == NULL) {
-    if (!name.empty()) {
-      InvalidName(name, "Root element should not be named.");
-    }
-    element_.reset(new ProtoElement(typeinfo_, master_type_, this));
-    return this;
-  }
-
-  const google::protobuf::Field* field = NULL;
-  field = BeginNamed(name, false);
-  if (field == NULL) return this;
-
-  // Check to see if this field is a oneof and that no oneof in that group has
-  // already been set.
-  if (!ValidOneof(*field, name)) {
-    ++invalid_depth_;
-    return this;
-  }
-
-  const google::protobuf::Type* type = LookupType(field);
-  if (type == NULL) {
-    ++invalid_depth_;
-    InvalidName(name,
-                StrCat("Missing descriptor for field: ", field->type_url()));
-    return this;
-  }
-
-  return StartObjectField(*field, *type);
-}
-
-ProtoWriter* ProtoWriter::EndObject() {
-  if (invalid_depth_ > 0) {
-    --invalid_depth_;
-    return this;
-  }
-
-  if (element_ != NULL) {
-    element_.reset(element_->pop());
-  }
-
-
-  // If ending the root element,
-  // then serialize the full message with calculated sizes.
-  if (element_ == NULL) {
-    WriteRootMessage();
-  }
-  return this;
-}
-
-ProtoWriter* ProtoWriter::StartList(StringPiece name) {
-  const google::protobuf::Field* field = BeginNamed(name, true);
-  if (field == NULL) return this;
-
-  if (!ValidOneof(*field, name)) {
-    ++invalid_depth_;
-    return this;
-  }
-
-  const google::protobuf::Type* type = LookupType(field);
-  if (type == NULL) {
-    ++invalid_depth_;
-    InvalidName(name,
-                StrCat("Missing descriptor for field: ", field->type_url()));
-    return this;
-  }
-
-  return StartListField(*field, *type);
-}
-
-ProtoWriter* ProtoWriter::EndList() {
-  if (invalid_depth_ > 0) {
-    --invalid_depth_;
-  } else if (element_ != NULL) {
-    element_.reset(element_->pop());
-  }
-  return this;
-}
-
-ProtoWriter* ProtoWriter::RenderDataPiece(StringPiece name,
-                                          const DataPiece& data) {
-  Status status;
-  if (invalid_depth_ > 0) return this;
-
-  const google::protobuf::Field* field = Lookup(name);
-  if (field == NULL) return this;
-
-  if (!ValidOneof(*field, name)) return this;
-
-  const google::protobuf::Type* type = LookupType(field);
-  if (type == NULL) {
-    InvalidName(name,
-                StrCat("Missing descriptor for field: ", field->type_url()));
-    return this;
-  }
-
-  return RenderPrimitiveField(*field, *type, data);
-}
-
-bool ProtoWriter::ValidOneof(const google::protobuf::Field& field,
-                             StringPiece unnormalized_name) {
-  if (element_ == NULL) return true;
-
-  if (field.oneof_index() > 0) {
-    if (element_->IsOneofIndexTaken(field.oneof_index())) {
-      InvalidValue(
-          "oneof",
-          StrCat("oneof field '",
-                 element_->type().oneofs(field.oneof_index() - 1),
-                 "' is already set. Cannot set '", unnormalized_name, "'"));
-      return false;
-    }
-    element_->TakeOneofIndex(field.oneof_index());
-  }
-  return true;
-}
-
-bool ProtoWriter::IsRepeated(const google::protobuf::Field& field) {
-  return field.cardinality() ==
-         google::protobuf::Field_Cardinality_CARDINALITY_REPEATED;
-}
-
-ProtoWriter* ProtoWriter::StartObjectField(const google::protobuf::Field& field,
-                                           const google::protobuf::Type& type) {
-    WriteTag(field);
-  element_.reset(new ProtoElement(element_.release(), &field, type, false));
-  return this;
-}
-
-ProtoWriter* ProtoWriter::StartListField(const google::protobuf::Field& field,
-                                         const google::protobuf::Type& type) {
-  element_.reset(new ProtoElement(element_.release(), &field, type, true));
-  return this;
-}
-
-ProtoWriter* ProtoWriter::RenderPrimitiveField(
-    const google::protobuf::Field& field, const google::protobuf::Type& type,
-    const DataPiece& data) {
-  Status status;
-
-  // Pushing a ProtoElement and then pop it off at the end for 2 purposes:
-  // error location reporting and required field accounting.
-  //
-  // For proto3, since there is no required field tracking, we only need to push
-  // ProtoElement for error cases.
-  if (!element_->proto3()) {
-    element_.reset(new ProtoElement(element_.release(), &field, type, false));
-  }
-
-  if (field.kind() == google::protobuf::Field_Kind_TYPE_UNKNOWN ||
-      field.kind() == google::protobuf::Field_Kind_TYPE_MESSAGE) {
-    // Push a ProtoElement for location reporting purposes.
-    if (element_->proto3()) {
-      element_.reset(new ProtoElement(element_.release(), &field, type, false));
-    }
-    InvalidValue(field.type_url().empty()
-                     ? google::protobuf::Field_Kind_Name(field.kind())
-                     : field.type_url(),
-                 data.ValueAsStringOrDefault(""));
-    element_.reset(element()->pop());
-    return this;
-  }
-
-  switch (field.kind()) {
-    case google::protobuf::Field_Kind_TYPE_INT32: {
-      status = WriteInt32(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SFIXED32: {
-      status = WriteSFixed32(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SINT32: {
-      status = WriteSInt32(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FIXED32: {
-      status = WriteFixed32(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_UINT32: {
-      status = WriteUInt32(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_INT64: {
-      status = WriteInt64(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SFIXED64: {
-      status = WriteSFixed64(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SINT64: {
-      status = WriteSInt64(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FIXED64: {
-      status = WriteFixed64(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_UINT64: {
-      status = WriteUInt64(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_DOUBLE: {
-      status = WriteDouble(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FLOAT: {
-      status = WriteFloat(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_BOOL: {
-      status = WriteBool(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_BYTES: {
-      status = WriteBytes(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_STRING: {
-      status = WriteString(field.number(), data, stream_.get());
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_ENUM: {
-      status = WriteEnum(field.number(), data,
-                         typeinfo_->GetEnumByTypeUrl(field.type_url()),
-                         stream_.get(), use_lower_camel_for_enums_);
-      break;
-    }
-    default:  // TYPE_GROUP or TYPE_MESSAGE
-      status = Status(INVALID_ARGUMENT, data.ToString().ValueOrDie());
-  }
-
-  if (!status.ok()) {
-    // Push a ProtoElement for location reporting purposes.
-    if (element_->proto3()) {
-      element_.reset(new ProtoElement(element_.release(), &field, type, false));
-    }
-    InvalidValue(google::protobuf::Field_Kind_Name(field.kind()),
-                 status.error_message());
-    element_.reset(element()->pop());
-    return this;
-  }
-
-  if (!element_->proto3()) element_.reset(element()->pop());
-
-  return this;
-}
-
-const google::protobuf::Field* ProtoWriter::BeginNamed(StringPiece name,
-                                                       bool is_list) {
-  if (invalid_depth_ > 0) {
-    ++invalid_depth_;
-    return NULL;
-  }
-  const google::protobuf::Field* field = Lookup(name);
-  if (field == NULL) {
-    ++invalid_depth_;
-    // InvalidName() already called in Lookup().
-    return NULL;
-  }
-  if (is_list && !IsRepeated(*field)) {
-    ++invalid_depth_;
-    InvalidName(name, "Proto field is not repeating, cannot start list.");
-    return NULL;
-  }
-  return field;
-}
-
-const google::protobuf::Field* ProtoWriter::Lookup(
-    StringPiece unnormalized_name) {
-  ProtoElement* e = element();
-  if (e == NULL) {
-    InvalidName(unnormalized_name, "Root element must be a message.");
-    return NULL;
-  }
-  if (unnormalized_name.empty()) {
-    // Objects in repeated field inherit the same field descriptor.
-    if (e->parent_field() == NULL) {
-      InvalidName(unnormalized_name, "Proto fields must have a name.");
-    } else if (!IsRepeated(*e->parent_field())) {
-      InvalidName(unnormalized_name, "Proto fields must have a name.");
-      return NULL;
-    }
-    return e->parent_field();
-  }
-  const google::protobuf::Field* field =
-      typeinfo_->FindField(&e->type(), unnormalized_name);
-  if (field == NULL && !ignore_unknown_fields_) {
-    InvalidName(unnormalized_name, "Cannot find field.");
-  }
-  return field;
-}
-
-const google::protobuf::Type* ProtoWriter::LookupType(
-    const google::protobuf::Field* field) {
-  return ((field->kind() == google::protobuf::Field_Kind_TYPE_MESSAGE ||
-           field->kind() == google::protobuf::Field_Kind_TYPE_GROUP)
-              ? typeinfo_->GetTypeByTypeUrl(field->type_url())
-              : &element_->type());
-}
-
-void ProtoWriter::WriteRootMessage() {
-  GOOGLE_DCHECK(!done_);
-  int curr_pos = 0;
-  // Calls the destructor of CodedOutputStream to remove any uninitialized
-  // memory from the Cord before we read it.
-  stream_.reset(NULL);
-  const void* data;
-  int length;
-  google::protobuf::io::ArrayInputStream input_stream(buffer_.data(), buffer_.size());
-  while (input_stream.Next(&data, &length)) {
-    if (length == 0) continue;
-    int num_bytes = length;
-    // Write up to where we need to insert the size field.
-    // The number of bytes we may write is the smaller of:
-    //   - the current fragment size
-    //   - the distance to the next position where a size field needs to be
-    //     inserted.
-    if (!size_insert_.empty() &&
-        size_insert_.front().pos - curr_pos < num_bytes) {
-      num_bytes = size_insert_.front().pos - curr_pos;
-    }
-    output_->Append(static_cast<const char*>(data), num_bytes);
-    if (num_bytes < length) {
-      input_stream.BackUp(length - num_bytes);
-    }
-    curr_pos += num_bytes;
-    // Insert the size field.
-    //   size_insert_.front():      the next <index, size> pair to be written.
-    //   size_insert_.front().pos:  position of the size field.
-    //   size_insert_.front().size: the size (integer) to be inserted.
-    if (!size_insert_.empty() && curr_pos == size_insert_.front().pos) {
-      // Varint32 occupies at most 10 bytes.
-      uint8 insert_buffer[10];
-      uint8* insert_buffer_pos = CodedOutputStream::WriteVarint32ToArray(
-          size_insert_.front().size, insert_buffer);
-      output_->Append(reinterpret_cast<const char*>(insert_buffer),
-                      insert_buffer_pos - insert_buffer);
-      size_insert_.pop_front();
-    }
-  }
-  output_->Flush();
-  stream_.reset(new CodedOutputStream(&adapter_));
-  done_ = true;
-}
-
-void ProtoWriter::WriteTag(const google::protobuf::Field& field) {
-  WireFormatLite::WireType wire_type = WireFormatLite::WireTypeForFieldType(
-      static_cast<WireFormatLite::FieldType>(field.kind()));
-  stream_->WriteTag(WireFormatLite::MakeTag(field.number(), wire_type));
-}
-
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/proto_writer.h b/3rdparty/protobuf/src/google/protobuf/util/internal/proto_writer.h
deleted file mode 100644 (file)
index 0db8485..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTO_WRITER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTO_WRITER_H__
-
-#include <deque>
-#include <string>
-#include <vector>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/util/internal/type_info.h>
-#include <google/protobuf/util/internal/datapiece.h>
-#include <google/protobuf/util/internal/error_listener.h>
-#include <google/protobuf/util/internal/structured_objectwriter.h>
-#include <google/protobuf/util/type_resolver.h>
-#include <google/protobuf/stubs/bytestream.h>
-#include <google/protobuf/stubs/hash.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-class CodedOutputStream;
-}  // namespace io
-}  // namespace protobuf
-
-
-namespace protobuf {
-class Type;
-class Field;
-}  // namespace protobuf
-
-
-namespace protobuf {
-namespace util {
-namespace converter {
-
-class ObjectLocationTracker;
-
-// An ObjectWriter that can write protobuf bytes directly from writer events.
-// This class does not support special types like Struct or Map. However, since
-// this class supports raw protobuf, it can be used to provide support for
-// special types by inheriting from it or by wrapping it.
-//
-// It also supports streaming.
-class LIBPROTOBUF_EXPORT ProtoWriter : public StructuredObjectWriter {
- public:
-// Constructor. Does not take ownership of any parameter passed in.
-  ProtoWriter(TypeResolver* type_resolver, const google::protobuf::Type& type,
-              strings::ByteSink* output, ErrorListener* listener);
-  virtual ~ProtoWriter();
-
-  // ObjectWriter methods.
-  ProtoWriter* StartObject(StringPiece name);
-  ProtoWriter* EndObject();
-  ProtoWriter* StartList(StringPiece name);
-  ProtoWriter* EndList();
-  ProtoWriter* RenderBool(StringPiece name, bool value) {
-    return RenderDataPiece(name, DataPiece(value));
-  }
-  ProtoWriter* RenderInt32(StringPiece name, int32 value) {
-    return RenderDataPiece(name, DataPiece(value));
-  }
-  ProtoWriter* RenderUint32(StringPiece name, uint32 value) {
-    return RenderDataPiece(name, DataPiece(value));
-  }
-  ProtoWriter* RenderInt64(StringPiece name, int64 value) {
-    return RenderDataPiece(name, DataPiece(value));
-  }
-  ProtoWriter* RenderUint64(StringPiece name, uint64 value) {
-    return RenderDataPiece(name, DataPiece(value));
-  }
-  ProtoWriter* RenderDouble(StringPiece name, double value) {
-    return RenderDataPiece(name, DataPiece(value));
-  }
-  ProtoWriter* RenderFloat(StringPiece name, float value) {
-    return RenderDataPiece(name, DataPiece(value));
-  }
-  ProtoWriter* RenderString(StringPiece name, StringPiece value) {
-    return RenderDataPiece(name,
-                           DataPiece(value, use_strict_base64_decoding()));
-  }
-  virtual ProtoWriter* RenderBytes(StringPiece name, StringPiece value) {
-    return RenderDataPiece(
-        name, DataPiece(value, false, use_strict_base64_decoding()));
-  }
-  ProtoWriter* RenderNull(StringPiece name) {
-    return RenderDataPiece(name, DataPiece::NullData());
-  }
-
-
-  // Renders a DataPiece 'value' into a field whose wire type is determined
-  // from the given field 'name'.
-  virtual ProtoWriter* RenderDataPiece(StringPiece name,
-                                       const DataPiece& value);
-
-  // Returns the location tracker to use for tracking locations for errors.
-  const LocationTrackerInterface& location() {
-    return element_ != NULL ? *element_ : *tracker_;
-  }
-
-  // When true, we finished writing to output a complete message.
-  bool done() { return done_; }
-
-  // Returns the proto stream object.
-  google::protobuf::io::CodedOutputStream* stream() { return stream_.get(); }
-
-  // Getters and mutators of invalid_depth_.
-  void IncrementInvalidDepth() { ++invalid_depth_; }
-  void DecrementInvalidDepth() { --invalid_depth_; }
-  int invalid_depth() { return invalid_depth_; }
-
-  ErrorListener* listener() { return listener_; }
-
-  const TypeInfo* typeinfo() { return typeinfo_; }
-
-  void set_ignore_unknown_fields(bool ignore_unknown_fields) {
-    ignore_unknown_fields_ = ignore_unknown_fields;
-  }
-
-  void set_use_lower_camel_for_enums(bool use_lower_camel_for_enums) {
-    use_lower_camel_for_enums_ = use_lower_camel_for_enums;
-  }
-
- protected:
-  class LIBPROTOBUF_EXPORT ProtoElement : public BaseElement, public LocationTrackerInterface {
-   public:
-    // Constructor for the root element. No parent nor field.
-    ProtoElement(const TypeInfo* typeinfo, const google::protobuf::Type& type,
-                 ProtoWriter* enclosing);
-
-    // Constructor for a field of an element.
-    ProtoElement(ProtoElement* parent, const google::protobuf::Field* field,
-                 const google::protobuf::Type& type, bool is_list);
-
-    virtual ~ProtoElement() {}
-
-    // Called just before the destructor for clean up:
-    //   - reports any missing required fields
-    //   - computes the space needed by the size field, and augment the
-    //     length of all parent messages by this additional space.
-    //   - releases and returns the parent pointer.
-    ProtoElement* pop();
-
-    // Accessors
-    // parent_field() may be NULL if we are at root.
-    const google::protobuf::Field* parent_field() const {
-      return parent_field_;
-    }
-    const google::protobuf::Type& type() const { return type_; }
-
-    // Registers field for accounting required fields.
-    void RegisterField(const google::protobuf::Field* field);
-
-    // To report location on error messages.
-    virtual string ToString() const;
-
-    virtual ProtoElement* parent() const {
-      return static_cast<ProtoElement*>(BaseElement::parent());
-    }
-
-    // Returns true if the index is already taken by a preceding oneof input.
-    bool IsOneofIndexTaken(int32 index);
-
-    // Marks the oneof 'index' as taken. Future inputs to this oneof will
-    // generate an error.
-    void TakeOneofIndex(int32 index);
-
-    bool proto3() { return proto3_; }
-
-   private:
-    // Used for access to variables of the enclosing instance of
-    // ProtoWriter.
-    ProtoWriter* ow_;
-
-    // Describes the element as a field in the parent message.
-    // parent_field_ is NULL if and only if this element is the root element.
-    const google::protobuf::Field* parent_field_;
-
-    // TypeInfo to lookup types.
-    const TypeInfo* typeinfo_;
-
-    // Whether the type_ is proto3 or not.
-    bool proto3_;
-
-    // Additional variables if this element is a message:
-    // (Root element is always a message).
-    // type_             : the type of this element.
-    // required_fields_  : set of required fields.
-    // size_index_       : index into ProtoWriter::size_insert_
-    //                     for later insertion of serialized message length.
-    const google::protobuf::Type& type_;
-    std::set<const google::protobuf::Field*> required_fields_;
-    const int size_index_;
-
-    // Tracks position in repeated fields, needed for LocationTrackerInterface.
-    int array_index_;
-
-    // Set of oneof indices already seen for the type_. Used to validate
-    // incoming messages so no more than one oneof is set.
-    std::vector<bool> oneof_indices_;
-
-    GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(ProtoElement);
-  };
-
-  // Container for inserting 'size' information at the 'pos' position.
-  struct SizeInfo {
-    const int pos;
-    int size;
-  };
-
-  ProtoWriter(const TypeInfo* typeinfo, const google::protobuf::Type& type,
-              strings::ByteSink* output, ErrorListener* listener);
-
-  ProtoElement* element() { return element_.get(); }
-
-  // Helper methods for calling ErrorListener. See error_listener.h.
-  void InvalidName(StringPiece unknown_name, StringPiece message);
-  void InvalidValue(StringPiece type_name, StringPiece value);
-  void MissingField(StringPiece missing_name);
-
-  // Common code for BeginObject() and BeginList() that does invalid_depth_
-  // bookkeeping associated with name lookup.
-  const google::protobuf::Field* BeginNamed(StringPiece name, bool is_list);
-
-  // Lookup the field in the current element. Looks in the base descriptor
-  // and in any extension. This will report an error if the field cannot be
-  // found when ignore_unknown_names_ is false or if multiple matching
-  // extensions are found.
-  const google::protobuf::Field* Lookup(StringPiece name);
-
-  // Lookup the field type in the type descriptor. Returns NULL if the type
-  // is not known.
-  const google::protobuf::Type* LookupType(
-      const google::protobuf::Field* field);
-
-  // Write serialized output to the final output ByteSink, inserting all
-  // the size information for nested messages that are missing from the
-  // intermediate Cord buffer.
-  void WriteRootMessage();
-
-  // Helper method to write proto tags based on the given field.
-  void WriteTag(const google::protobuf::Field& field);
-
-
-  // Returns true if the field for type_ can be set as a oneof. If field is not
-  // a oneof type, this function does nothing and returns true.
-  // If another field for this oneof is already set, this function returns
-  // false. It also calls the appropriate error callback.
-  // unnormalized_name is used for error string.
-  bool ValidOneof(const google::protobuf::Field& field,
-                  StringPiece unnormalized_name);
-
-  // Returns true if the field is repeated.
-  bool IsRepeated(const google::protobuf::Field& field);
-
-  // Starts an object given the field and the enclosing type.
-  ProtoWriter* StartObjectField(const google::protobuf::Field& field,
-                                const google::protobuf::Type& type);
-
-  // Starts a list given the field and the enclosing type.
-  ProtoWriter* StartListField(const google::protobuf::Field& field,
-                              const google::protobuf::Type& type);
-
-  // Renders a primitve field given the field and the enclosing type.
-  ProtoWriter* RenderPrimitiveField(const google::protobuf::Field& field,
-                                    const google::protobuf::Type& type,
-                                    const DataPiece& value);
-
- private:
-  // Variables for describing the structure of the input tree:
-  // master_type_: descriptor for the whole protobuf message.
-  // typeinfo_ : the TypeInfo object to lookup types.
-  const google::protobuf::Type& master_type_;
-  const TypeInfo* typeinfo_;
-  // Whether we own the typeinfo_ object.
-  bool own_typeinfo_;
-
-  // Indicates whether we finished writing root message completely.
-  bool done_;
-
-  // If true, don't report unknown field names to the listener.
-  bool ignore_unknown_fields_;
-
-  // If true, check if enum name in camel case or without underscore matches the
-  // field name.
-  bool use_lower_camel_for_enums_;
-
-  // Variable for internal state processing:
-  // element_    : the current element.
-  // size_insert_: sizes of nested messages.
-  //               pos  - position to insert the size field.
-  //               size - size value to be inserted.
-  google::protobuf::scoped_ptr<ProtoElement> element_;
-  std::deque<SizeInfo> size_insert_;
-
-  // Variables for output generation:
-  // output_  : pointer to an external ByteSink for final user-visible output.
-  // buffer_  : buffer holding partial message before being ready for output_.
-  // adapter_ : internal adapter between CodedOutputStream and buffer_.
-  // stream_  : wrapper for writing tags and other encodings in wire format.
-  strings::ByteSink* output_;
-  string buffer_;
-  google::protobuf::io::StringOutputStream adapter_;
-  google::protobuf::scoped_ptr<google::protobuf::io::CodedOutputStream> stream_;
-
-  // Variables for error tracking and reporting:
-  // listener_     : a place to report any errors found.
-  // invalid_depth_: number of enclosing invalid nested messages.
-  // tracker_      : the root location tracker interface.
-  ErrorListener* listener_;
-  int invalid_depth_;
-  google::protobuf::scoped_ptr<LocationTrackerInterface> tracker_;
-
-  GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(ProtoWriter);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTO_WRITER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc
deleted file mode 100644 (file)
index 02360a1..0000000
+++ /dev/null
@@ -1,1136 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/protostream_objectsource.h>
-
-#include <utility>
-
-#include <google/protobuf/stubs/casts.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/stringprintf.h>
-#include <google/protobuf/stubs/time.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/wire_format.h>
-#include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/util/internal/field_mask_utility.h>
-#include <google/protobuf/util/internal/constants.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/map_util.h>
-#include <google/protobuf/stubs/status_macros.h>
-
-
-namespace google {
-namespace protobuf {
-namespace util {
-using util::Status;
-using util::StatusOr;
-namespace error {
-using util::error::Code;
-using util::error::INTERNAL;
-}
-namespace converter {
-
-using google::protobuf::Descriptor;
-using google::protobuf::EnumValueDescriptor;
-using google::protobuf::FieldDescriptor;
-using google::protobuf::internal::WireFormat;
-using google::protobuf::internal::WireFormatLite;
-using util::Status;
-using util::StatusOr;
-
-namespace {
-
-static int kDefaultMaxRecursionDepth = 64;
-
-// Finds a field with the given number. NULL if none found.
-const google::protobuf::Field* FindFieldByNumber(
-    const google::protobuf::Type& type, int number);
-
-// Returns true if the field is packable.
-bool IsPackable(const google::protobuf::Field& field);
-
-// Finds an enum value with the given number. NULL if none found.
-const google::protobuf::EnumValue* FindEnumValueByNumber(
-    const google::protobuf::Enum& tech_enum, int number);
-
-// Utility function to format nanos.
-const string FormatNanos(uint32 nanos, bool with_trailing_zeros);
-
-StatusOr<string> MapKeyDefaultValueAsString(
-    const google::protobuf::Field& field) {
-  switch (field.kind()) {
-    case google::protobuf::Field_Kind_TYPE_BOOL:
-      return string("false");
-    case google::protobuf::Field_Kind_TYPE_INT32:
-    case google::protobuf::Field_Kind_TYPE_INT64:
-    case google::protobuf::Field_Kind_TYPE_UINT32:
-    case google::protobuf::Field_Kind_TYPE_UINT64:
-    case google::protobuf::Field_Kind_TYPE_SINT32:
-    case google::protobuf::Field_Kind_TYPE_SINT64:
-    case google::protobuf::Field_Kind_TYPE_SFIXED32:
-    case google::protobuf::Field_Kind_TYPE_SFIXED64:
-    case google::protobuf::Field_Kind_TYPE_FIXED32:
-    case google::protobuf::Field_Kind_TYPE_FIXED64:
-      return string("0");
-    case google::protobuf::Field_Kind_TYPE_STRING:
-      return string();
-    default:
-      return Status(util::error::INTERNAL, "Invalid map key type.");
-  }
-}
-}  // namespace
-
-
-ProtoStreamObjectSource::ProtoStreamObjectSource(
-    google::protobuf::io::CodedInputStream* stream, TypeResolver* type_resolver,
-    const google::protobuf::Type& type)
-    : stream_(stream),
-      typeinfo_(TypeInfo::NewTypeInfo(type_resolver)),
-      own_typeinfo_(true),
-      type_(type),
-      use_lower_camel_for_enums_(false),
-      use_ints_for_enums_(false),
-      preserve_proto_field_names_(false),
-      recursion_depth_(0),
-      max_recursion_depth_(kDefaultMaxRecursionDepth),
-      render_unknown_fields_(false),
-      render_unknown_enum_values_(true),
-      add_trailing_zeros_for_timestamp_and_duration_(false) {
-  GOOGLE_LOG_IF(DFATAL, stream == NULL) << "Input stream is NULL.";
-}
-
-ProtoStreamObjectSource::ProtoStreamObjectSource(
-    google::protobuf::io::CodedInputStream* stream, const TypeInfo* typeinfo,
-    const google::protobuf::Type& type)
-    : stream_(stream),
-      typeinfo_(typeinfo),
-      own_typeinfo_(false),
-      type_(type),
-      use_lower_camel_for_enums_(false),
-      use_ints_for_enums_(false),
-      preserve_proto_field_names_(false),
-      recursion_depth_(0),
-      max_recursion_depth_(kDefaultMaxRecursionDepth),
-      render_unknown_fields_(false),
-      render_unknown_enum_values_(true),
-      add_trailing_zeros_for_timestamp_and_duration_(false) {
-  GOOGLE_LOG_IF(DFATAL, stream == NULL) << "Input stream is NULL.";
-}
-
-ProtoStreamObjectSource::~ProtoStreamObjectSource() {
-  if (own_typeinfo_) {
-    delete typeinfo_;
-  }
-}
-
-Status ProtoStreamObjectSource::NamedWriteTo(StringPiece name,
-                                             ObjectWriter* ow) const {
-  return WriteMessage(type_, name, 0, true, ow);
-}
-
-const google::protobuf::Field* ProtoStreamObjectSource::FindAndVerifyField(
-    const google::protobuf::Type& type, uint32 tag) const {
-  // Lookup the new field in the type by tag number.
-  const google::protobuf::Field* field = FindFieldByNumber(type, tag >> 3);
-  // Verify if the field corresponds to the wire type in tag.
-  // If there is any discrepancy, mark the field as not found.
-  if (field != NULL) {
-    WireFormatLite::WireType expected_type =
-        WireFormatLite::WireTypeForFieldType(
-            static_cast<WireFormatLite::FieldType>(field->kind()));
-    WireFormatLite::WireType actual_type = WireFormatLite::GetTagWireType(tag);
-    if (actual_type != expected_type &&
-        (!IsPackable(*field) ||
-         actual_type != WireFormatLite::WIRETYPE_LENGTH_DELIMITED)) {
-      field = NULL;
-    }
-  }
-  return field;
-}
-
-Status ProtoStreamObjectSource::WriteMessage(const google::protobuf::Type& type,
-                                             StringPiece name,
-                                             const uint32 end_tag,
-                                             bool include_start_and_end,
-                                             ObjectWriter* ow) const {
-
-    const TypeRenderer* type_renderer = FindTypeRenderer(type.name());
-    if (type_renderer != NULL) {
-      return (*type_renderer)(this, type, name, ow);
-    }
-
-  const google::protobuf::Field* field = NULL;
-  string field_name;
-  // last_tag set to dummy value that is different from tag.
-  uint32 tag = stream_->ReadTag(), last_tag = tag + 1;
-  google::protobuf::UnknownFieldSet unknown_fields;
-
-  if (include_start_and_end) {
-    ow->StartObject(name);
-  }
-  while (tag != end_tag) {
-    if (tag != last_tag) {  // Update field only if tag is changed.
-      last_tag = tag;
-      field = FindAndVerifyField(type, tag);
-      if (field != NULL) {
-        if (preserve_proto_field_names_) {
-          field_name = field->name();
-        } else {
-          field_name = field->json_name();
-        }
-      }
-    }
-    if (field == NULL) {
-      // If we didn't find a field, skip this unknown tag.
-      // TODO(wpoon): Check return boolean value.
-      WireFormat::SkipField(stream_, tag,
-                            render_unknown_fields_ ? &unknown_fields : NULL);
-      tag = stream_->ReadTag();
-      continue;
-    }
-
-    if (field->cardinality() ==
-        google::protobuf::Field_Cardinality_CARDINALITY_REPEATED) {
-      bool check_maps = true;
-
-      if (check_maps && IsMap(*field)) {
-        ow->StartObject(field_name);
-        ASSIGN_OR_RETURN(tag, RenderMap(field, field_name, tag, ow));
-        ow->EndObject();
-      } else {
-        ASSIGN_OR_RETURN(tag, RenderList(field, field_name, tag, ow));
-      }
-    } else {
-      // Render the field.
-      RETURN_IF_ERROR(RenderField(field, field_name, ow));
-      tag = stream_->ReadTag();
-    }
-  }
-
-
-  if (include_start_and_end) {
-    ow->EndObject();
-  }
-  return util::Status();
-}
-
-StatusOr<uint32> ProtoStreamObjectSource::RenderList(
-    const google::protobuf::Field* field, StringPiece name, uint32 list_tag,
-    ObjectWriter* ow) const {
-  uint32 tag_to_return = 0;
-  ow->StartList(name);
-  if (IsPackable(*field) &&
-      list_tag ==
-          WireFormatLite::MakeTag(field->number(),
-                                  WireFormatLite::WIRETYPE_LENGTH_DELIMITED)) {
-    RETURN_IF_ERROR(RenderPacked(field, ow));
-    // Since packed fields have a single tag, read another tag from stream to
-    // return.
-    tag_to_return = stream_->ReadTag();
-  } else {
-    do {
-      RETURN_IF_ERROR(RenderField(field, "", ow));
-    } while ((tag_to_return = stream_->ReadTag()) == list_tag);
-  }
-  ow->EndList();
-  return tag_to_return;
-}
-
-StatusOr<uint32> ProtoStreamObjectSource::RenderMap(
-    const google::protobuf::Field* field, StringPiece name, uint32 list_tag,
-    ObjectWriter* ow) const {
-  const google::protobuf::Type* field_type =
-      typeinfo_->GetTypeByTypeUrl(field->type_url());
-  uint32 tag_to_return = 0;
-  do {
-    // Render map entry message type.
-    uint32 buffer32;
-    stream_->ReadVarint32(&buffer32);  // message length
-    int old_limit = stream_->PushLimit(buffer32);
-    string map_key;
-    for (uint32 tag = stream_->ReadTag(); tag != 0; tag = stream_->ReadTag()) {
-      const google::protobuf::Field* field =
-          FindAndVerifyField(*field_type, tag);
-      if (field == NULL) {
-        WireFormat::SkipField(stream_, tag, NULL);
-        continue;
-      }
-      // Map field numbers are key = 1 and value = 2
-      if (field->number() == 1) {
-        map_key = ReadFieldValueAsString(*field);
-      } else if (field->number() == 2) {
-        if (map_key.empty()) {
-          // An absent map key is treated as the default.
-          const google::protobuf::Field* key_field =
-              FindFieldByNumber(*field_type, 1);
-          if (key_field == NULL) {
-            // The Type info for this map entry is incorrect. It should always
-            // have a field named "key" and with field number 1.
-            return Status(util::error::INTERNAL, "Invalid map entry.");
-          }
-          ASSIGN_OR_RETURN(map_key, MapKeyDefaultValueAsString(*key_field));
-          // Key is empty, force it to render as empty (for string values).
-          ow->empty_name_ok_for_next_key();
-        }
-        RETURN_IF_ERROR(RenderField(field, map_key, ow));
-      } else {
-        // The Type info for this map entry is incorrect. It should contain
-        // exactly two fields with field number 1 and 2.
-        return Status(util::error::INTERNAL, "Invalid map entry.");
-      }
-    }
-    stream_->PopLimit(old_limit);
-  } while ((tag_to_return = stream_->ReadTag()) == list_tag);
-  return tag_to_return;
-}
-
-Status ProtoStreamObjectSource::RenderPacked(
-    const google::protobuf::Field* field, ObjectWriter* ow) const {
-  uint32 length;
-  stream_->ReadVarint32(&length);
-  int old_limit = stream_->PushLimit(length);
-  while (stream_->BytesUntilLimit() > 0) {
-    RETURN_IF_ERROR(RenderField(field, StringPiece(), ow));
-  }
-  stream_->PopLimit(old_limit);
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderTimestamp(
-    const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
-    StringPiece field_name, ObjectWriter* ow) {
-  std::pair<int64, int32> p = os->ReadSecondsAndNanos(type);
-  int64 seconds = p.first;
-  int32 nanos = p.second;
-  if (seconds > kTimestampMaxSeconds || seconds < kTimestampMinSeconds) {
-    return Status(
-        util::error::INTERNAL,
-        StrCat("Timestamp seconds exceeds limit for field: ", field_name));
-  }
-
-  if (nanos < 0 || nanos >= kNanosPerSecond) {
-    return Status(
-        util::error::INTERNAL,
-        StrCat("Timestamp nanos exceeds limit for field: ", field_name));
-  }
-
-  ow->RenderString(field_name,
-                   ::google::protobuf::internal::FormatTime(seconds, nanos));
-
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderDuration(
-    const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
-    StringPiece field_name, ObjectWriter* ow) {
-  std::pair<int64, int32> p = os->ReadSecondsAndNanos(type);
-  int64 seconds = p.first;
-  int32 nanos = p.second;
-  if (seconds > kDurationMaxSeconds || seconds < kDurationMinSeconds) {
-    return Status(
-        util::error::INTERNAL,
-        StrCat("Duration seconds exceeds limit for field: ", field_name));
-  }
-
-  if (nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) {
-    return Status(
-        util::error::INTERNAL,
-        StrCat("Duration nanos exceeds limit for field: ", field_name));
-  }
-
-  string sign = "";
-  if (seconds < 0) {
-    if (nanos > 0) {
-      return Status(util::error::INTERNAL,
-                    StrCat("Duration nanos is non-negative, but seconds is "
-                           "negative for field: ",
-                           field_name));
-    }
-    sign = "-";
-    seconds = -seconds;
-    nanos = -nanos;
-  } else if (seconds == 0 && nanos < 0) {
-    sign = "-";
-    nanos = -nanos;
-  }
-  string formatted_duration = StringPrintf(
-      "%s%lld%ss", sign.c_str(), seconds,
-      FormatNanos(nanos, os->add_trailing_zeros_for_timestamp_and_duration_)
-          .c_str());
-  ow->RenderString(field_name, formatted_duration);
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderDouble(const ProtoStreamObjectSource* os,
-                                             const google::protobuf::Type& type,
-                                             StringPiece field_name,
-                                             ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint64 buffer64 = 0;  // default value of Double wrapper value
-  if (tag != 0) {
-    os->stream_->ReadLittleEndian64(&buffer64);
-    os->stream_->ReadTag();
-  }
-  ow->RenderDouble(field_name, bit_cast<double>(buffer64));
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderFloat(const ProtoStreamObjectSource* os,
-                                            const google::protobuf::Type& type,
-                                            StringPiece field_name,
-                                            ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint32 buffer32 = 0;  // default value of Float wrapper value
-  if (tag != 0) {
-    os->stream_->ReadLittleEndian32(&buffer32);
-    os->stream_->ReadTag();
-  }
-  ow->RenderFloat(field_name, bit_cast<float>(buffer32));
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderInt64(const ProtoStreamObjectSource* os,
-                                            const google::protobuf::Type& type,
-                                            StringPiece field_name,
-                                            ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint64 buffer64 = 0;  // default value of Int64 wrapper value
-  if (tag != 0) {
-    os->stream_->ReadVarint64(&buffer64);
-    os->stream_->ReadTag();
-  }
-  ow->RenderInt64(field_name, bit_cast<int64>(buffer64));
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderUInt64(const ProtoStreamObjectSource* os,
-                                             const google::protobuf::Type& type,
-                                             StringPiece field_name,
-                                             ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint64 buffer64 = 0;  // default value of UInt64 wrapper value
-  if (tag != 0) {
-    os->stream_->ReadVarint64(&buffer64);
-    os->stream_->ReadTag();
-  }
-  ow->RenderUint64(field_name, bit_cast<uint64>(buffer64));
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderInt32(const ProtoStreamObjectSource* os,
-                                            const google::protobuf::Type& type,
-                                            StringPiece field_name,
-                                            ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint32 buffer32 = 0;  // default value of Int32 wrapper value
-  if (tag != 0) {
-    os->stream_->ReadVarint32(&buffer32);
-    os->stream_->ReadTag();
-  }
-  ow->RenderInt32(field_name, bit_cast<int32>(buffer32));
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderUInt32(const ProtoStreamObjectSource* os,
-                                             const google::protobuf::Type& type,
-                                             StringPiece field_name,
-                                             ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint32 buffer32 = 0;  // default value of UInt32 wrapper value
-  if (tag != 0) {
-    os->stream_->ReadVarint32(&buffer32);
-    os->stream_->ReadTag();
-  }
-  ow->RenderUint32(field_name, bit_cast<uint32>(buffer32));
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderBool(const ProtoStreamObjectSource* os,
-                                           const google::protobuf::Type& type,
-                                           StringPiece field_name,
-                                           ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint64 buffer64 = 0;  // results in 'false' value as default, which is the
-                        // default value of Bool wrapper
-  if (tag != 0) {
-    os->stream_->ReadVarint64(&buffer64);
-    os->stream_->ReadTag();
-  }
-  ow->RenderBool(field_name, buffer64 != 0);
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderString(const ProtoStreamObjectSource* os,
-                                             const google::protobuf::Type& type,
-                                             StringPiece field_name,
-                                             ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint32 buffer32;
-  string str;  // default value of empty for String wrapper
-  if (tag != 0) {
-    os->stream_->ReadVarint32(&buffer32);  // string size.
-    os->stream_->ReadString(&str, buffer32);
-    os->stream_->ReadTag();
-  }
-  ow->RenderString(field_name, str);
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderBytes(const ProtoStreamObjectSource* os,
-                                            const google::protobuf::Type& type,
-                                            StringPiece field_name,
-                                            ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-  uint32 buffer32;
-  string str;
-  if (tag != 0) {
-    os->stream_->ReadVarint32(&buffer32);
-    os->stream_->ReadString(&str, buffer32);
-    os->stream_->ReadTag();
-  }
-  ow->RenderBytes(field_name, str);
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderStruct(const ProtoStreamObjectSource* os,
-                                             const google::protobuf::Type& type,
-                                             StringPiece field_name,
-                                             ObjectWriter* ow) {
-  const google::protobuf::Field* field = NULL;
-  uint32 tag = os->stream_->ReadTag();
-  ow->StartObject(field_name);
-  while (tag != 0) {
-    field = os->FindAndVerifyField(type, tag);
-    // google.protobuf.Struct has only one field that is a map. Hence we use
-    // RenderMap to render that field.
-    if (os->IsMap(*field)) {
-      ASSIGN_OR_RETURN(tag, os->RenderMap(field, field_name, tag, ow));
-    }
-  }
-  ow->EndObject();
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderStructValue(
-    const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
-    StringPiece field_name, ObjectWriter* ow) {
-  const google::protobuf::Field* field = NULL;
-  for (uint32 tag = os->stream_->ReadTag(); tag != 0;
-       tag = os->stream_->ReadTag()) {
-    field = os->FindAndVerifyField(type, tag);
-    if (field == NULL) {
-      WireFormat::SkipField(os->stream_, tag, NULL);
-      continue;
-    }
-    RETURN_IF_ERROR(os->RenderField(field, field_name, ow));
-  }
-  return util::Status();
-}
-
-// TODO(skarvaje): Avoid code duplication of for loops and SkipField logic.
-Status ProtoStreamObjectSource::RenderStructListValue(
-    const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
-    StringPiece field_name, ObjectWriter* ow) {
-  uint32 tag = os->stream_->ReadTag();
-
-  // Render empty list when we find empty ListValue message.
-  if (tag == 0) {
-    ow->StartList(field_name);
-    ow->EndList();
-    return util::Status();
-  }
-
-  while (tag != 0) {
-    const google::protobuf::Field* field = os->FindAndVerifyField(type, tag);
-    if (field == NULL) {
-      WireFormat::SkipField(os->stream_, tag, NULL);
-      tag = os->stream_->ReadTag();
-      continue;
-    }
-    ASSIGN_OR_RETURN(tag, os->RenderList(field, field_name, tag, ow));
-  }
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderAny(const ProtoStreamObjectSource* os,
-                                          const google::protobuf::Type& type,
-                                          StringPiece field_name,
-                                          ObjectWriter* ow) {
-  // An Any is of the form { string type_url = 1; bytes value = 2; }
-  uint32 tag;
-  string type_url;
-  string value;
-
-  // First read out the type_url and value from the proto stream
-  for (tag = os->stream_->ReadTag(); tag != 0; tag = os->stream_->ReadTag()) {
-    const google::protobuf::Field* field = os->FindAndVerifyField(type, tag);
-    if (field == NULL) {
-      WireFormat::SkipField(os->stream_, tag, NULL);
-      continue;
-    }
-    // 'type_url' has field number of 1 and 'value' has field number 2
-    // //google/protobuf/any.proto
-    if (field->number() == 1) {
-      // read type_url
-      uint32 type_url_size;
-      os->stream_->ReadVarint32(&type_url_size);
-      os->stream_->ReadString(&type_url, type_url_size);
-    } else if (field->number() == 2) {
-      // read value
-      uint32 value_size;
-      os->stream_->ReadVarint32(&value_size);
-      os->stream_->ReadString(&value, value_size);
-    }
-  }
-
-  // If there is no value, we don't lookup the type, we just output it (if
-  // present). If both type and value are empty we output an empty object.
-  if (value.empty()) {
-    ow->StartObject(field_name);
-    if (!type_url.empty()) {
-      ow->RenderString("@type", type_url);
-    }
-    ow->EndObject();
-    return util::Status();
-  }
-
-  // If there is a value but no type, we cannot render it, so report an error.
-  if (type_url.empty()) {
-    // TODO(sven): Add an external message once those are ready.
-    return util::Status(util::error::INTERNAL,
-                        "Invalid Any, the type_url is missing.");
-  }
-
-  util::StatusOr<const google::protobuf::Type*> resolved_type =
-      os->typeinfo_->ResolveTypeUrl(type_url);
-
-  if (!resolved_type.ok()) {
-    // Convert into an internal error, since this means the backend gave us
-    // an invalid response (missing or invalid type information).
-    return util::Status(util::error::INTERNAL,
-                        resolved_type.status().error_message());
-  }
-  // nested_type cannot be null at this time.
-  const google::protobuf::Type* nested_type = resolved_type.ValueOrDie();
-
-  google::protobuf::io::ArrayInputStream zero_copy_stream(value.data(), value.size());
-  google::protobuf::io::CodedInputStream in_stream(&zero_copy_stream);
-  // We know the type so we can render it. Recursively parse the nested stream
-  // using a nested ProtoStreamObjectSource using our nested type information.
-  ProtoStreamObjectSource nested_os(&in_stream, os->typeinfo_, *nested_type);
-
-  // We manually call start and end object here so we can inject the @type.
-  ow->StartObject(field_name);
-  ow->RenderString("@type", type_url);
-  util::Status result =
-      nested_os.WriteMessage(nested_os.type_, "value", 0, false, ow);
-  ow->EndObject();
-  return result;
-}
-
-Status ProtoStreamObjectSource::RenderFieldMask(
-    const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
-    StringPiece field_name, ObjectWriter* ow) {
-  string combined;
-  uint32 buffer32;
-  uint32 paths_field_tag = 0;
-  for (uint32 tag = os->stream_->ReadTag(); tag != 0;
-       tag = os->stream_->ReadTag()) {
-    if (paths_field_tag == 0) {
-      const google::protobuf::Field* field = os->FindAndVerifyField(type, tag);
-      if (field != NULL && field->number() == 1 &&
-          field->name() == "paths") {
-        paths_field_tag = tag;
-      }
-    }
-    if (paths_field_tag != tag) {
-      return util::Status(util::error::INTERNAL,
-                          "Invalid FieldMask, unexpected field.");
-    }
-    string str;
-    os->stream_->ReadVarint32(&buffer32);  // string size.
-    os->stream_->ReadString(&str, buffer32);
-    if (!combined.empty()) {
-      combined.append(",");
-    }
-    combined.append(ConvertFieldMaskPath(str, &ToCamelCase));
-  }
-  ow->RenderString(field_name, combined);
-  return util::Status();
-}
-
-
-hash_map<string, ProtoStreamObjectSource::TypeRenderer>*
-    ProtoStreamObjectSource::renderers_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(source_renderers_init_);
-
-void ProtoStreamObjectSource::InitRendererMap() {
-  renderers_ = new hash_map<string, ProtoStreamObjectSource::TypeRenderer>();
-  (*renderers_)["google.protobuf.Timestamp"] =
-      &ProtoStreamObjectSource::RenderTimestamp;
-  (*renderers_)["google.protobuf.Duration"] =
-      &ProtoStreamObjectSource::RenderDuration;
-  (*renderers_)["google.protobuf.DoubleValue"] =
-      &ProtoStreamObjectSource::RenderDouble;
-  (*renderers_)["google.protobuf.FloatValue"] =
-      &ProtoStreamObjectSource::RenderFloat;
-  (*renderers_)["google.protobuf.Int64Value"] =
-      &ProtoStreamObjectSource::RenderInt64;
-  (*renderers_)["google.protobuf.UInt64Value"] =
-      &ProtoStreamObjectSource::RenderUInt64;
-  (*renderers_)["google.protobuf.Int32Value"] =
-      &ProtoStreamObjectSource::RenderInt32;
-  (*renderers_)["google.protobuf.UInt32Value"] =
-      &ProtoStreamObjectSource::RenderUInt32;
-  (*renderers_)["google.protobuf.BoolValue"] =
-      &ProtoStreamObjectSource::RenderBool;
-  (*renderers_)["google.protobuf.StringValue"] =
-      &ProtoStreamObjectSource::RenderString;
-  (*renderers_)["google.protobuf.BytesValue"] =
-      &ProtoStreamObjectSource::RenderBytes;
-  (*renderers_)["google.protobuf.Any"] = &ProtoStreamObjectSource::RenderAny;
-  (*renderers_)["google.protobuf.Struct"] =
-      &ProtoStreamObjectSource::RenderStruct;
-  (*renderers_)["google.protobuf.Value"] =
-      &ProtoStreamObjectSource::RenderStructValue;
-  (*renderers_)["google.protobuf.ListValue"] =
-      &ProtoStreamObjectSource::RenderStructListValue;
-  (*renderers_)["google.protobuf.FieldMask"] =
-      &ProtoStreamObjectSource::RenderFieldMask;
-  ::google::protobuf::internal::OnShutdown(&DeleteRendererMap);
-}
-
-void ProtoStreamObjectSource::DeleteRendererMap() {
-  delete ProtoStreamObjectSource::renderers_;
-  renderers_ = NULL;
-}
-
-// static
-ProtoStreamObjectSource::TypeRenderer*
-ProtoStreamObjectSource::FindTypeRenderer(const string& type_url) {
-  ::google::protobuf::GoogleOnceInit(&source_renderers_init_, &InitRendererMap);
-  return FindOrNull(*renderers_, type_url);
-}
-
-Status ProtoStreamObjectSource::RenderField(
-    const google::protobuf::Field* field, StringPiece field_name,
-    ObjectWriter* ow) const {
-  // Short-circuit message types as it tends to call WriteMessage recursively
-  // and ends up using a lot of stack space. Keep the stack usage of this
-  // message small in order to preserve stack space and not crash.
-  if (field->kind() == google::protobuf::Field_Kind_TYPE_MESSAGE) {
-    uint32 buffer32;
-    stream_->ReadVarint32(&buffer32);  // message length
-    int old_limit = stream_->PushLimit(buffer32);
-    // Get the nested message type for this field.
-    const google::protobuf::Type* type =
-        typeinfo_->GetTypeByTypeUrl(field->type_url());
-    if (type == NULL) {
-      return Status(util::error::INTERNAL,
-                    StrCat("Invalid configuration. Could not find the type: ",
-                           field->type_url()));
-    }
-
-    // Short-circuit any special type rendering to save call-stack space.
-    const TypeRenderer* type_renderer = FindTypeRenderer(type->name());
-
-    bool use_type_renderer = type_renderer != NULL;
-
-    if (use_type_renderer) {
-      RETURN_IF_ERROR((*type_renderer)(this, *type, field_name, ow));
-    } else {
-      RETURN_IF_ERROR(IncrementRecursionDepth(type->name(), field_name));
-      RETURN_IF_ERROR(WriteMessage(*type, field_name, 0, true, ow));
-      --recursion_depth_;
-    }
-    if (!stream_->ConsumedEntireMessage()) {
-      return Status(util::error::INVALID_ARGUMENT,
-                    "Nested protocol message not parsed in its entirety.");
-    }
-    stream_->PopLimit(old_limit);
-  } else {
-    // Render all other non-message types.
-    return RenderNonMessageField(field, field_name, ow);
-  }
-  return util::Status();
-}
-
-Status ProtoStreamObjectSource::RenderNonMessageField(
-    const google::protobuf::Field* field, StringPiece field_name,
-    ObjectWriter* ow) const {
-  // Temporary buffers of different types.
-  uint32 buffer32;
-  uint64 buffer64;
-  string strbuffer;
-  switch (field->kind()) {
-    case google::protobuf::Field_Kind_TYPE_BOOL: {
-      stream_->ReadVarint64(&buffer64);
-      ow->RenderBool(field_name, buffer64 != 0);
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_INT32: {
-      stream_->ReadVarint32(&buffer32);
-      ow->RenderInt32(field_name, bit_cast<int32>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_INT64: {
-      stream_->ReadVarint64(&buffer64);
-      ow->RenderInt64(field_name, bit_cast<int64>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_UINT32: {
-      stream_->ReadVarint32(&buffer32);
-      ow->RenderUint32(field_name, bit_cast<uint32>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_UINT64: {
-      stream_->ReadVarint64(&buffer64);
-      ow->RenderUint64(field_name, bit_cast<uint64>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SINT32: {
-      stream_->ReadVarint32(&buffer32);
-      ow->RenderInt32(field_name, WireFormatLite::ZigZagDecode32(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SINT64: {
-      stream_->ReadVarint64(&buffer64);
-      ow->RenderInt64(field_name, WireFormatLite::ZigZagDecode64(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SFIXED32: {
-      stream_->ReadLittleEndian32(&buffer32);
-      ow->RenderInt32(field_name, bit_cast<int32>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SFIXED64: {
-      stream_->ReadLittleEndian64(&buffer64);
-      ow->RenderInt64(field_name, bit_cast<int64>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FIXED32: {
-      stream_->ReadLittleEndian32(&buffer32);
-      ow->RenderUint32(field_name, bit_cast<uint32>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FIXED64: {
-      stream_->ReadLittleEndian64(&buffer64);
-      ow->RenderUint64(field_name, bit_cast<uint64>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FLOAT: {
-      stream_->ReadLittleEndian32(&buffer32);
-      ow->RenderFloat(field_name, bit_cast<float>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_DOUBLE: {
-      stream_->ReadLittleEndian64(&buffer64);
-      ow->RenderDouble(field_name, bit_cast<double>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_ENUM: {
-      stream_->ReadVarint32(&buffer32);
-
-      // If the field represents an explicit NULL value, render null.
-      if (field->type_url() == kStructNullValueTypeUrl) {
-        ow->RenderNull(field_name);
-        break;
-      }
-
-      // Get the nested enum type for this field.
-      // TODO(skarvaje): Avoid string manipulation. Find ways to speed this
-      // up.
-      const google::protobuf::Enum* en =
-          typeinfo_->GetEnumByTypeUrl(field->type_url());
-      // Lookup the name of the enum, and render that. Unknown enum values
-      // are printed as integers.
-      if (en != NULL) {
-        const google::protobuf::EnumValue* enum_value =
-            FindEnumValueByNumber(*en, buffer32);
-        if (enum_value != NULL) {
-          if (use_ints_for_enums_) {
-            ow->RenderInt32(field_name, buffer32);
-          } else if (use_lower_camel_for_enums_) {
-            ow->RenderString(field_name, ToCamelCase(enum_value->name()));
-          } else {
-            ow->RenderString(field_name, enum_value->name());
-          }
-        } else if (render_unknown_enum_values_) {
-          ow->RenderInt32(field_name, buffer32);
-        }
-      } else if (render_unknown_enum_values_) {
-        ow->RenderInt32(field_name, buffer32);
-      }
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_STRING: {
-      stream_->ReadVarint32(&buffer32);  // string size.
-      stream_->ReadString(&strbuffer, buffer32);
-      ow->RenderString(field_name, strbuffer);
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_BYTES: {
-      stream_->ReadVarint32(&buffer32);  // bytes size.
-      stream_->ReadString(&strbuffer, buffer32);
-      ow->RenderBytes(field_name, strbuffer);
-      break;
-    }
-    default:
-      break;
-  }
-  return util::Status();
-}
-
-// TODO(skarvaje): Fix this to avoid code duplication.
-const string ProtoStreamObjectSource::ReadFieldValueAsString(
-    const google::protobuf::Field& field) const {
-  string result;
-  switch (field.kind()) {
-    case google::protobuf::Field_Kind_TYPE_BOOL: {
-      uint64 buffer64;
-      stream_->ReadVarint64(&buffer64);
-      result = buffer64 != 0 ? "true" : "false";
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_INT32: {
-      uint32 buffer32;
-      stream_->ReadVarint32(&buffer32);
-      result = SimpleItoa(bit_cast<int32>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_INT64: {
-      uint64 buffer64;
-      stream_->ReadVarint64(&buffer64);
-      result = SimpleItoa(bit_cast<int64>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_UINT32: {
-      uint32 buffer32;
-      stream_->ReadVarint32(&buffer32);
-      result = SimpleItoa(bit_cast<uint32>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_UINT64: {
-      uint64 buffer64;
-      stream_->ReadVarint64(&buffer64);
-      result = SimpleItoa(bit_cast<uint64>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SINT32: {
-      uint32 buffer32;
-      stream_->ReadVarint32(&buffer32);
-      result = SimpleItoa(WireFormatLite::ZigZagDecode32(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SINT64: {
-      uint64 buffer64;
-      stream_->ReadVarint64(&buffer64);
-      result = SimpleItoa(WireFormatLite::ZigZagDecode64(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SFIXED32: {
-      uint32 buffer32;
-      stream_->ReadLittleEndian32(&buffer32);
-      result = SimpleItoa(bit_cast<int32>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_SFIXED64: {
-      uint64 buffer64;
-      stream_->ReadLittleEndian64(&buffer64);
-      result = SimpleItoa(bit_cast<int64>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FIXED32: {
-      uint32 buffer32;
-      stream_->ReadLittleEndian32(&buffer32);
-      result = SimpleItoa(bit_cast<uint32>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FIXED64: {
-      uint64 buffer64;
-      stream_->ReadLittleEndian64(&buffer64);
-      result = SimpleItoa(bit_cast<uint64>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_FLOAT: {
-      uint32 buffer32;
-      stream_->ReadLittleEndian32(&buffer32);
-      result = SimpleFtoa(bit_cast<float>(buffer32));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_DOUBLE: {
-      uint64 buffer64;
-      stream_->ReadLittleEndian64(&buffer64);
-      result = SimpleDtoa(bit_cast<double>(buffer64));
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_ENUM: {
-      uint32 buffer32;
-      stream_->ReadVarint32(&buffer32);
-      // Get the nested enum type for this field.
-      // TODO(skarvaje): Avoid string manipulation. Find ways to speed this
-      // up.
-      const google::protobuf::Enum* en =
-          typeinfo_->GetEnumByTypeUrl(field.type_url());
-      // Lookup the name of the enum, and render that. Skips unknown enums.
-      if (en != NULL) {
-        const google::protobuf::EnumValue* enum_value =
-            FindEnumValueByNumber(*en, buffer32);
-        if (enum_value != NULL) {
-          result = enum_value->name();
-        }
-      }
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_STRING: {
-      uint32 buffer32;
-      stream_->ReadVarint32(&buffer32);  // string size.
-      stream_->ReadString(&result, buffer32);
-      break;
-    }
-    case google::protobuf::Field_Kind_TYPE_BYTES: {
-      uint32 buffer32;
-      stream_->ReadVarint32(&buffer32);  // bytes size.
-      stream_->ReadString(&result, buffer32);
-      break;
-    }
-    default:
-      break;
-  }
-  return result;
-}
-
-// Field is a map if it is a repeated message and it has an option "map_type".
-// TODO(skarvaje): Consider pre-computing the IsMap() into Field directly.
-bool ProtoStreamObjectSource::IsMap(
-    const google::protobuf::Field& field) const {
-  const google::protobuf::Type* field_type =
-      typeinfo_->GetTypeByTypeUrl(field.type_url());
-  return field.kind() == google::protobuf::Field_Kind_TYPE_MESSAGE &&
-         google::protobuf::util::converter::IsMap(field, *field_type);
-}
-
-std::pair<int64, int32> ProtoStreamObjectSource::ReadSecondsAndNanos(
-    const google::protobuf::Type& type) const {
-  uint64 seconds = 0;
-  uint32 nanos = 0;
-  uint32 tag = 0;
-  int64 signed_seconds = 0;
-  int32 signed_nanos = 0;
-
-  for (tag = stream_->ReadTag(); tag != 0; tag = stream_->ReadTag()) {
-    const google::protobuf::Field* field = FindAndVerifyField(type, tag);
-    if (field == NULL) {
-      WireFormat::SkipField(stream_, tag, NULL);
-      continue;
-    }
-    // 'seconds' has field number of 1 and 'nanos' has field number 2
-    // //google/protobuf/timestamp.proto & duration.proto
-    if (field->number() == 1) {
-      // read seconds
-      stream_->ReadVarint64(&seconds);
-      signed_seconds = bit_cast<int64>(seconds);
-    } else if (field->number() == 2) {
-      // read nanos
-      stream_->ReadVarint32(&nanos);
-      signed_nanos = bit_cast<int32>(nanos);
-    }
-  }
-  return std::pair<int64, int32>(signed_seconds, signed_nanos);
-}
-
-Status ProtoStreamObjectSource::IncrementRecursionDepth(
-    StringPiece type_name, StringPiece field_name) const {
-  if (++recursion_depth_ > max_recursion_depth_) {
-    return Status(
-        util::error::INVALID_ARGUMENT,
-        StrCat("Message too deep. Max recursion depth reached for type '",
-               type_name, "', field '", field_name, "'"));
-  }
-  return util::Status();
-}
-
-namespace {
-// TODO(skarvaje): Speed this up by not doing a linear scan.
-const google::protobuf::Field* FindFieldByNumber(
-    const google::protobuf::Type& type, int number) {
-  for (int i = 0; i < type.fields_size(); ++i) {
-    if (type.fields(i).number() == number) {
-      return &type.fields(i);
-    }
-  }
-  return NULL;
-}
-
-// TODO(skarvaje): Replace FieldDescriptor by implementing IsTypePackable()
-// using tech Field.
-bool IsPackable(const google::protobuf::Field& field) {
-  return field.cardinality() ==
-             google::protobuf::Field_Cardinality_CARDINALITY_REPEATED &&
-         google::protobuf::FieldDescriptor::IsTypePackable(
-             static_cast<google::protobuf::FieldDescriptor::Type>(field.kind()));
-}
-
-// TODO(skarvaje): Speed this up by not doing a linear scan.
-const google::protobuf::EnumValue* FindEnumValueByNumber(
-    const google::protobuf::Enum& tech_enum, int number) {
-  for (int i = 0; i < tech_enum.enumvalue_size(); ++i) {
-    const google::protobuf::EnumValue& ev = tech_enum.enumvalue(i);
-    if (ev.number() == number) {
-      return &ev;
-    }
-  }
-  return NULL;
-}
-
-// TODO(skarvaje): Look into optimizing this by not doing computation on
-// double.
-const string FormatNanos(uint32 nanos, bool with_trailing_zeros) {
-  if (nanos == 0) {
-    return with_trailing_zeros ? ".000" : "";
-  }
-
-  const char* format =
-      (nanos % 1000 != 0) ? "%.9f" : (nanos % 1000000 != 0) ? "%.6f" : "%.3f";
-  string formatted =
-      StringPrintf(format, static_cast<double>(nanos) / kNanosPerSecond);
-  // remove the leading 0 before decimal.
-  return formatted.substr(1);
-}
-}  // namespace
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h b/3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h
deleted file mode 100644 (file)
index b56efdf..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTOSTREAM_OBJECTSOURCE_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTOSTREAM_OBJECTSOURCE_H__
-
-#include <functional>
-#include <google/protobuf/stubs/hash.h>
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/type.pb.h>
-#include <google/protobuf/util/internal/object_source.h>
-#include <google/protobuf/util/internal/object_writer.h>
-#include <google/protobuf/util/internal/type_info.h>
-#include <google/protobuf/util/type_resolver.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/status.h>
-#include <google/protobuf/stubs/statusor.h>
-
-
-namespace google {
-namespace protobuf {
-class Field;
-class Type;
-}  // namespace protobuf
-
-
-namespace protobuf {
-namespace util {
-namespace converter {
-
-class TypeInfo;
-
-// An ObjectSource that can parse a stream of bytes as a protocol buffer.
-// Its WriteTo() method can be given an ObjectWriter.
-// This implementation uses a google.protobuf.Type for tag and name lookup.
-// The field names are converted into lower camel-case when writing to the
-// ObjectWriter.
-//
-// Sample usage: (suppose input is: string proto)
-//   ArrayInputStream arr_stream(proto.data(), proto.size());
-//   CodedInputStream in_stream(&arr_stream);
-//   ProtoStreamObjectSource os(&in_stream, /*ServiceTypeInfo*/ typeinfo,
-//                              <your message google::protobuf::Type>);
-//
-//   Status status = os.WriteTo(<some ObjectWriter>);
-class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource {
- public:
-  ProtoStreamObjectSource(google::protobuf::io::CodedInputStream* stream,
-                          TypeResolver* type_resolver,
-                          const google::protobuf::Type& type);
-
-  virtual ~ProtoStreamObjectSource();
-
-  virtual util::Status NamedWriteTo(StringPiece name, ObjectWriter* ow) const;
-
-  // Sets whether or not to use lowerCamelCase casing for enum values. If set to
-  // false, enum values are output without any case conversions.
-  //
-  // For example, if we have an enum:
-  // enum Type {
-  //   ACTION_AND_ADVENTURE = 1;
-  // }
-  // Type type = 20;
-  //
-  // And this option is set to true. Then the rendered "type" field will have
-  // the string "actionAndAdventure".
-  // {
-  //   ...
-  //   "type": "actionAndAdventure",
-  //   ...
-  // }
-  //
-  // If set to false, the rendered "type" field will have the string
-  // "ACTION_AND_ADVENTURE".
-  // {
-  //   ...
-  //   "type": "ACTION_AND_ADVENTURE",
-  //   ...
-  // }
-  void set_use_lower_camel_for_enums(bool value) {
-    use_lower_camel_for_enums_ = value;
-  }
-
-  // Sets whether to always output enums as ints, by default this is off, and
-  // enums are rendered as strings.
-  void set_use_ints_for_enums(bool value) { use_ints_for_enums_ = value; }
-
-  // Sets whether to use original proto field names
-  void set_preserve_proto_field_names(bool value) {
-    preserve_proto_field_names_ = value;
-  }
-
-  // Sets the max recursion depth of proto message to be deserialized. Proto
-  // messages over this depth will fail to be deserialized.
-  // Default value is 64.
-  void set_max_recursion_depth(int max_depth) {
-    max_recursion_depth_ = max_depth;
-  }
-
-
- protected:
-  // Writes a proto2 Message to the ObjectWriter. When the given end_tag is
-  // found this method will complete, allowing it to be used for parsing both
-  // nested messages (end with 0) and nested groups (end with group end tag).
-  // The include_start_and_end parameter allows this method to be called when
-  // already inside of an object, and skip calling StartObject and EndObject.
-  virtual util::Status WriteMessage(const google::protobuf::Type& descriptor,
-                                      StringPiece name, const uint32 end_tag,
-                                      bool include_start_and_end,
-                                      ObjectWriter* ow) const;
-
-  // Renders a repeating field (packed or unpacked).  Returns the next tag after
-  // reading all sequential repeating elements. The caller should use this tag
-  // before reading more tags from the stream.
-  virtual util::StatusOr<uint32> RenderList(
-      const google::protobuf::Field* field, StringPiece name, uint32 list_tag,
-      ObjectWriter* ow) const;
-
-  // Looks up a field and verify its consistency with wire type in tag.
-  const google::protobuf::Field* FindAndVerifyField(
-      const google::protobuf::Type& type, uint32 tag) const;
-
-  // Renders a field value to the ObjectWriter.
-  util::Status RenderField(const google::protobuf::Field* field,
-                             StringPiece field_name, ObjectWriter* ow) const;
-
-  // Reads field value according to Field spec in 'field' and returns the read
-  // value as string. This only works for primitive datatypes (no message
-  // types).
-  const string ReadFieldValueAsString(
-      const google::protobuf::Field& field) const;
-
-
- private:
-  ProtoStreamObjectSource(google::protobuf::io::CodedInputStream* stream,
-                          const TypeInfo* typeinfo,
-                          const google::protobuf::Type& type);
-  // Function that renders a well known type with a modified behavior.
-  typedef util::Status (*TypeRenderer)(const ProtoStreamObjectSource*,
-                                         const google::protobuf::Type&,
-                                         StringPiece, ObjectWriter*);
-
-  // TODO(skarvaje): Mark these methods as non-const as they modify internal
-  // state (stream_).
-  //
-  // Renders a NWP map.
-  // Returns the next tag after reading all map entries. The caller should use
-  // this tag before reading more tags from the stream.
-  util::StatusOr<uint32> RenderMap(const google::protobuf::Field* field,
-                                     StringPiece name, uint32 list_tag,
-                                     ObjectWriter* ow) const;
-
-  // Renders a packed repeating field. A packed field is stored as:
-  // {tag length item1 item2 item3} instead of the less efficient
-  // {tag item1 tag item2 tag item3}.
-  util::Status RenderPacked(const google::protobuf::Field* field,
-                              ObjectWriter* ow) const;
-
-  // Renders a google.protobuf.Timestamp value to ObjectWriter
-  static util::Status RenderTimestamp(const ProtoStreamObjectSource* os,
-                                        const google::protobuf::Type& type,
-                                        StringPiece name, ObjectWriter* ow);
-
-  // Renders a google.protobuf.Duration value to ObjectWriter
-  static util::Status RenderDuration(const ProtoStreamObjectSource* os,
-                                       const google::protobuf::Type& type,
-                                       StringPiece name, ObjectWriter* ow);
-
-  // Following RenderTYPE functions render well known types in
-  // google/protobuf/wrappers.proto corresponding to TYPE.
-  static util::Status RenderDouble(const ProtoStreamObjectSource* os,
-                                     const google::protobuf::Type& type,
-                                     StringPiece name, ObjectWriter* ow);
-  static util::Status RenderFloat(const ProtoStreamObjectSource* os,
-                                    const google::protobuf::Type& type,
-                                    StringPiece name, ObjectWriter* ow);
-  static util::Status RenderInt64(const ProtoStreamObjectSource* os,
-                                    const google::protobuf::Type& type,
-                                    StringPiece name, ObjectWriter* ow);
-  static util::Status RenderUInt64(const ProtoStreamObjectSource* os,
-                                     const google::protobuf::Type& type,
-                                     StringPiece name, ObjectWriter* ow);
-  static util::Status RenderInt32(const ProtoStreamObjectSource* os,
-                                    const google::protobuf::Type& type,
-                                    StringPiece name, ObjectWriter* ow);
-  static util::Status RenderUInt32(const ProtoStreamObjectSource* os,
-                                     const google::protobuf::Type& type,
-                                     StringPiece name, ObjectWriter* ow);
-  static util::Status RenderBool(const ProtoStreamObjectSource* os,
-                                   const google::protobuf::Type& type,
-                                   StringPiece name, ObjectWriter* ow);
-  static util::Status RenderString(const ProtoStreamObjectSource* os,
-                                     const google::protobuf::Type& type,
-                                     StringPiece name, ObjectWriter* ow);
-  static util::Status RenderBytes(const ProtoStreamObjectSource* os,
-                                    const google::protobuf::Type& type,
-                                    StringPiece name, ObjectWriter* ow);
-
-  // Renders a google.protobuf.Struct to ObjectWriter.
-  static util::Status RenderStruct(const ProtoStreamObjectSource* os,
-                                     const google::protobuf::Type& type,
-                                     StringPiece name, ObjectWriter* ow);
-
-  // Helper to render google.protobuf.Struct's Value fields to ObjectWriter.
-  static util::Status RenderStructValue(const ProtoStreamObjectSource* os,
-                                          const google::protobuf::Type& type,
-                                          StringPiece name, ObjectWriter* ow);
-
-  // Helper to render google.protobuf.Struct's ListValue fields to ObjectWriter.
-  static util::Status RenderStructListValue(
-      const ProtoStreamObjectSource* os, const google::protobuf::Type& type,
-      StringPiece name, ObjectWriter* ow);
-
-  // Render the "Any" type.
-  static util::Status RenderAny(const ProtoStreamObjectSource* os,
-                                  const google::protobuf::Type& type,
-                                  StringPiece name, ObjectWriter* ow);
-
-  // Render the "FieldMask" type.
-  static util::Status RenderFieldMask(const ProtoStreamObjectSource* os,
-                                        const google::protobuf::Type& type,
-                                        StringPiece name, ObjectWriter* ow);
-
-  static hash_map<string, TypeRenderer>* renderers_;
-  static void InitRendererMap();
-  static void DeleteRendererMap();
-  static TypeRenderer* FindTypeRenderer(const string& type_url);
-
-  // Same as above but renders all non-message field types. Callers don't call
-  // this function directly. They just use RenderField.
-  util::Status RenderNonMessageField(const google::protobuf::Field* field,
-                                       StringPiece field_name,
-                                       ObjectWriter* ow) const;
-
-
-  // Utility function to detect proto maps. The 'field' MUST be repeated.
-  bool IsMap(const google::protobuf::Field& field) const;
-
-  // Utility to read int64 and int32 values from a message type in stream_.
-  // Used for reading google.protobuf.Timestamp and Duration messages.
-  std::pair<int64, int32> ReadSecondsAndNanos(
-      const google::protobuf::Type& type) const;
-
-  // Helper function to check recursion depth and increment it. It will return
-  // Status::OK if the current depth is allowed. Otherwise an error is returned.
-  // type_name and field_name are used for error reporting.
-  util::Status IncrementRecursionDepth(StringPiece type_name,
-                                         StringPiece field_name) const;
-
-  // Input stream to read from. Ownership rests with the caller.
-  google::protobuf::io::CodedInputStream* stream_;
-
-  // Type information for all the types used in the descriptor. Used to find
-  // google::protobuf::Type of nested messages/enums.
-  const TypeInfo* typeinfo_;
-
-  // Whether this class owns the typeinfo_ object. If true the typeinfo_ object
-  // should be deleted in the destructor.
-  bool own_typeinfo_;
-
-  // google::protobuf::Type of the message source.
-  const google::protobuf::Type& type_;
-
-
-  // Whether to render enums using lowerCamelCase. Defaults to false.
-  bool use_lower_camel_for_enums_;
-
-  // Whether to render enums as ints always. Defaults to false.
-  bool use_ints_for_enums_;
-
-  // Whether to preserve proto field names
-  bool preserve_proto_field_names_;
-
-  // Tracks current recursion depth.
-  mutable int recursion_depth_;
-
-  // Maximum allowed recursion depth.
-  int max_recursion_depth_;
-
-  // Whether to render unknown fields.
-  bool render_unknown_fields_;
-
-  // Whether to render unknown enum values.
-  bool render_unknown_enum_values_;
-
-  // Whether to add trailing zeros for timestamp and duration.
-  bool add_trailing_zeros_for_timestamp_and_duration_;
-
-  GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(ProtoStreamObjectSource);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTOSTREAM_OBJECTSOURCE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc
deleted file mode 100644 (file)
index 97f9681..0000000
+++ /dev/null
@@ -1,1274 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/protostream_objectwriter.h>
-
-#include <functional>
-#include <stack>
-
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/stubs/time.h>
-#include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/util/internal/field_mask_utility.h>
-#include <google/protobuf/util/internal/object_location_tracker.h>
-#include <google/protobuf/util/internal/constants.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/map_util.h>
-#include <google/protobuf/stubs/statusor.h>
-
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-using google::protobuf::internal::WireFormatLite;
-using util::error::INVALID_ARGUMENT;
-using util::Status;
-using util::StatusOr;
-
-
-ProtoStreamObjectWriter::ProtoStreamObjectWriter(
-    TypeResolver* type_resolver, const google::protobuf::Type& type,
-    strings::ByteSink* output, ErrorListener* listener,
-    const ProtoStreamObjectWriter::Options& options)
-    : ProtoWriter(type_resolver, type, output, listener),
-      master_type_(type),
-      current_(NULL),
-      options_(options) {
-  set_ignore_unknown_fields(options_.ignore_unknown_fields);
-  set_use_lower_camel_for_enums(options_.use_lower_camel_for_enums);
-}
-
-ProtoStreamObjectWriter::ProtoStreamObjectWriter(
-    const TypeInfo* typeinfo, const google::protobuf::Type& type,
-    strings::ByteSink* output, ErrorListener* listener)
-    : ProtoWriter(typeinfo, type, output, listener),
-      master_type_(type),
-      current_(NULL),
-      options_(ProtoStreamObjectWriter::Options::Defaults()) {}
-
-ProtoStreamObjectWriter::~ProtoStreamObjectWriter() {
-  if (current_ == NULL) return;
-  // Cleanup explicitly in order to avoid destructor stack overflow when input
-  // is deeply nested.
-  // Cast to BaseElement to avoid doing additional checks (like missing fields)
-  // during pop().
-  google::protobuf::scoped_ptr<BaseElement> element(
-      static_cast<BaseElement*>(current_.get())->pop<BaseElement>());
-  while (element != NULL) {
-    element.reset(element->pop<BaseElement>());
-  }
-}
-
-namespace {
-// Utility method to split a string representation of Timestamp or Duration and
-// return the parts.
-void SplitSecondsAndNanos(StringPiece input, StringPiece* seconds,
-                          StringPiece* nanos) {
-  size_t idx = input.rfind('.');
-  if (idx != string::npos) {
-    *seconds = input.substr(0, idx);
-    *nanos = input.substr(idx + 1);
-  } else {
-    *seconds = input;
-    *nanos = StringPiece();
-  }
-}
-
-Status GetNanosFromStringPiece(StringPiece s_nanos,
-                               const char* parse_failure_message,
-                               const char* exceeded_limit_message,
-                               int32* nanos) {
-  *nanos = 0;
-
-  // Count the number of leading 0s and consume them.
-  int num_leading_zeros = 0;
-  while (s_nanos.Consume("0")) {
-    num_leading_zeros++;
-  }
-  int32 i_nanos = 0;
-  // 's_nanos' contains fractional seconds -- i.e. 'nanos' is equal to
-  // "0." + s_nanos.ToString() seconds. An int32 is used for the
-  // conversion to 'nanos', rather than a double, so that there is no
-  // loss of precision.
-  if (!s_nanos.empty() && !safe_strto32(s_nanos.ToString(), &i_nanos)) {
-    return Status(INVALID_ARGUMENT, parse_failure_message);
-  }
-  if (i_nanos > kNanosPerSecond || i_nanos < 0) {
-    return Status(INVALID_ARGUMENT, exceeded_limit_message);
-  }
-  // s_nanos should only have digits. No whitespace.
-  if (s_nanos.find_first_not_of("0123456789") != StringPiece::npos) {
-    return Status(INVALID_ARGUMENT, parse_failure_message);
-  }
-
-  if (i_nanos > 0) {
-    // 'scale' is the number of digits to the right of the decimal
-    // point in "0." + s_nanos.ToString()
-    int32 scale = num_leading_zeros + s_nanos.size();
-    // 'conversion' converts i_nanos into nanoseconds.
-    // conversion = kNanosPerSecond / static_cast<int32>(std::pow(10, scale))
-    // For efficiency, we precompute the conversion factor.
-    int32 conversion = 0;
-    switch (scale) {
-      case 1:
-        conversion = 100000000;
-        break;
-      case 2:
-        conversion = 10000000;
-        break;
-      case 3:
-        conversion = 1000000;
-        break;
-      case 4:
-        conversion = 100000;
-        break;
-      case 5:
-        conversion = 10000;
-        break;
-      case 6:
-        conversion = 1000;
-        break;
-      case 7:
-        conversion = 100;
-        break;
-      case 8:
-        conversion = 10;
-        break;
-      case 9:
-        conversion = 1;
-        break;
-      default:
-        return Status(INVALID_ARGUMENT, exceeded_limit_message);
-    }
-    *nanos = i_nanos * conversion;
-  }
-
-  return Status();
-}
-
-}  // namespace
-
-ProtoStreamObjectWriter::AnyWriter::AnyWriter(ProtoStreamObjectWriter* parent)
-    : parent_(parent),
-      ow_(),
-      invalid_(false),
-      data_(),
-      output_(&data_),
-      depth_(0),
-      is_well_known_type_(false),
-      well_known_type_render_(NULL) {}
-
-ProtoStreamObjectWriter::AnyWriter::~AnyWriter() {}
-
-void ProtoStreamObjectWriter::AnyWriter::StartObject(StringPiece name) {
-  ++depth_;
-  // If an object writer is absent, that means we have not called StartAny()
-  // before reaching here, which happens when we have data before the "@type"
-  // field.
-  if (ow_ == NULL) {
-    // Save data before the "@type" field for later replay.
-    uninterpreted_events_.push_back(Event(Event::START_OBJECT, name));
-  } else if (is_well_known_type_ && depth_ == 1) {
-    // For well-known types, the only other field besides "@type" should be a
-    // "value" field.
-    if (name != "value" && !invalid_) {
-      parent_->InvalidValue("Any",
-                            "Expect a \"value\" field for well-known types.");
-      invalid_ = true;
-    }
-    ow_->StartObject("");
-  } else {
-    // Forward the call to the child writer if:
-    //   1. the type is not a well-known type.
-    //   2. or, we are in a nested Any, Struct, or Value object.
-    ow_->StartObject(name);
-  }
-}
-
-bool ProtoStreamObjectWriter::AnyWriter::EndObject() {
-  --depth_;
-  if (ow_ == NULL) {
-    if (depth_ >= 0) {
-      // Save data before the "@type" field for later replay.
-      uninterpreted_events_.push_back(Event(Event::END_OBJECT));
-    }
-  } else if (depth_ >= 0 || !is_well_known_type_) {
-    // As long as depth_ >= 0, we know we haven't reached the end of Any.
-    // Propagate these EndObject() calls to the contained ow_. For regular
-    // message types, we propagate the end of Any as well.
-    ow_->EndObject();
-  }
-  // A negative depth_ implies that we have reached the end of Any
-  // object. Now we write out its contents.
-  if (depth_ < 0) {
-    WriteAny();
-    return false;
-  }
-  return true;
-}
-
-void ProtoStreamObjectWriter::AnyWriter::StartList(StringPiece name) {
-  ++depth_;
-  if (ow_ == NULL) {
-    // Save data before the "@type" field for later replay.
-    uninterpreted_events_.push_back(Event(Event::START_LIST, name));
-  } else if (is_well_known_type_ && depth_ == 1) {
-    if (name != "value" && !invalid_) {
-      parent_->InvalidValue("Any",
-                            "Expect a \"value\" field for well-known types.");
-      invalid_ = true;
-    }
-    ow_->StartList("");
-  } else {
-    ow_->StartList(name);
-  }
-}
-
-void ProtoStreamObjectWriter::AnyWriter::EndList() {
-  --depth_;
-  if (depth_ < 0) {
-    GOOGLE_LOG(DFATAL) << "Mismatched EndList found, should not be possible";
-    depth_ = 0;
-  }
-  if (ow_ == NULL) {
-    // Save data before the "@type" field for later replay.
-    uninterpreted_events_.push_back(Event(Event::END_LIST));
-  } else {
-    ow_->EndList();
-  }
-}
-
-void ProtoStreamObjectWriter::AnyWriter::RenderDataPiece(
-    StringPiece name, const DataPiece& value) {
-  // Start an Any only at depth_ 0. Other RenderDataPiece calls with "@type"
-  // should go to the contained ow_ as they indicate nested Anys.
-  if (depth_ == 0 && ow_ == NULL && name == "@type") {
-    StartAny(value);
-  } else if (ow_ == NULL) {
-    // Save data before the "@type" field.
-    uninterpreted_events_.push_back(Event(name, value));
-  } else if (depth_ == 0 && is_well_known_type_) {
-    if (name != "value" && !invalid_) {
-      parent_->InvalidValue("Any",
-                            "Expect a \"value\" field for well-known types.");
-      invalid_ = true;
-    }
-    if (well_known_type_render_ == NULL) {
-      // Only Any and Struct don't have a special type render but both of
-      // them expect a JSON object (i.e., a StartObject() call).
-      if (value.type() != DataPiece::TYPE_NULL && !invalid_) {
-        parent_->InvalidValue("Any", "Expect a JSON object.");
-        invalid_ = true;
-      }
-    } else {
-      ow_->ProtoWriter::StartObject("");
-      Status status = (*well_known_type_render_)(ow_.get(), value);
-      if (!status.ok()) ow_->InvalidValue("Any", status.error_message());
-      ow_->ProtoWriter::EndObject();
-    }
-  } else {
-    ow_->RenderDataPiece(name, value);
-  }
-}
-
-void ProtoStreamObjectWriter::AnyWriter::StartAny(const DataPiece& value) {
-  // Figure out the type url. This is a copy-paste from WriteString but we also
-  // need the value, so we can't just call through to that.
-  if (value.type() == DataPiece::TYPE_STRING) {
-    type_url_ = value.str().ToString();
-  } else {
-    StatusOr<string> s = value.ToString();
-    if (!s.ok()) {
-      parent_->InvalidValue("String", s.status().error_message());
-      invalid_ = true;
-      return;
-    }
-    type_url_ = s.ValueOrDie();
-  }
-  // Resolve the type url, and report an error if we failed to resolve it.
-  StatusOr<const google::protobuf::Type*> resolved_type =
-      parent_->typeinfo()->ResolveTypeUrl(type_url_);
-  if (!resolved_type.ok()) {
-    parent_->InvalidValue("Any", resolved_type.status().error_message());
-    invalid_ = true;
-    return;
-  }
-  // At this point, type is never null.
-  const google::protobuf::Type* type = resolved_type.ValueOrDie();
-
-  well_known_type_render_ = FindTypeRenderer(type_url_);
-  if (well_known_type_render_ != NULL ||
-      // Explicitly list Any and Struct here because they don't have a
-      // custom renderer.
-      type->name() == kAnyType || type->name() == kStructType) {
-    is_well_known_type_ = true;
-  }
-
-  // Create our object writer and initialize it with the first StartObject
-  // call.
-  ow_.reset(new ProtoStreamObjectWriter(parent_->typeinfo(), *type, &output_,
-                                        parent_->listener()));
-
-  // Don't call StartObject() for well-known types yet. Depending on the
-  // type of actual data, we may not need to call StartObject(). For
-  // example:
-  // {
-  //   "@type": "type.googleapis.com/google.protobuf.Value",
-  //   "value": [1, 2, 3],
-  // }
-  // With the above JSON representation, we will only call StartList() on the
-  // contained ow_.
-  if (!is_well_known_type_) {
-    ow_->StartObject("");
-  }
-
-  // Now we know the proto type and can interpret all data fields we gathered
-  // before the "@type" field.
-  for (int i = 0; i < uninterpreted_events_.size(); ++i) {
-    uninterpreted_events_[i].Replay(this);
-  }
-}
-
-void ProtoStreamObjectWriter::AnyWriter::WriteAny() {
-  if (ow_ == NULL) {
-    if (uninterpreted_events_.empty()) {
-      // We never got any content, so just return immediately, which is
-      // equivalent to writing an empty Any.
-      return;
-    } else {
-      // There are uninterpreted data, but we never got a "@type" field.
-      if (!invalid_) {
-        parent_->InvalidValue("Any", StrCat("Missing @type for any field in ",
-                                            parent_->master_type_.name()));
-        invalid_ = true;
-      }
-      return;
-    }
-  }
-  // Render the type_url and value fields directly to the stream.
-  // type_url has tag 1 and value has tag 2.
-  WireFormatLite::WriteString(1, type_url_, parent_->stream());
-  if (!data_.empty()) {
-    WireFormatLite::WriteBytes(2, data_, parent_->stream());
-  }
-}
-
-void ProtoStreamObjectWriter::AnyWriter::Event::Replay(
-    AnyWriter* writer) const {
-  switch (type_) {
-    case START_OBJECT:
-      writer->StartObject(name_);
-      break;
-    case END_OBJECT:
-      writer->EndObject();
-      break;
-    case START_LIST:
-      writer->StartList(name_);
-      break;
-    case END_LIST:
-      writer->EndList();
-      break;
-    case RENDER_DATA_PIECE:
-      writer->RenderDataPiece(name_, value_);
-      break;
-  }
-}
-
-void ProtoStreamObjectWriter::AnyWriter::Event::DeepCopy() {
-  // DataPiece only contains a string reference. To make sure the referenced
-  // string value stays valid, we make a copy of the string value and update
-  // DataPiece to reference our own copy.
-  if (value_.type() == DataPiece::TYPE_STRING) {
-    StrAppend(&value_storage_, value_.str());
-    value_ = DataPiece(value_storage_, value_.use_strict_base64_decoding());
-  } else if (value_.type() == DataPiece::TYPE_BYTES) {
-    value_storage_ = value_.ToBytes().ValueOrDie();
-    value_ =
-        DataPiece(value_storage_, true, value_.use_strict_base64_decoding());
-  }
-}
-
-ProtoStreamObjectWriter::Item::Item(ProtoStreamObjectWriter* enclosing,
-                                    ItemType item_type, bool is_placeholder,
-                                    bool is_list)
-    : BaseElement(NULL),
-      ow_(enclosing),
-      any_(),
-      item_type_(item_type),
-      is_placeholder_(is_placeholder),
-      is_list_(is_list) {
-  if (item_type_ == ANY) {
-    any_.reset(new AnyWriter(ow_));
-  }
-  if (item_type == MAP) {
-    map_keys_.reset(new hash_set<string>);
-  }
-}
-
-ProtoStreamObjectWriter::Item::Item(ProtoStreamObjectWriter::Item* parent,
-                                    ItemType item_type, bool is_placeholder,
-                                    bool is_list)
-    : BaseElement(parent),
-      ow_(this->parent()->ow_),
-      any_(),
-      item_type_(item_type),
-      is_placeholder_(is_placeholder),
-      is_list_(is_list) {
-  if (item_type == ANY) {
-    any_.reset(new AnyWriter(ow_));
-  }
-  if (item_type == MAP) {
-    map_keys_.reset(new hash_set<string>);
-  }
-}
-
-bool ProtoStreamObjectWriter::Item::InsertMapKeyIfNotPresent(
-    StringPiece map_key) {
-  return InsertIfNotPresent(map_keys_.get(), map_key.ToString());
-}
-
-ProtoStreamObjectWriter* ProtoStreamObjectWriter::StartObject(
-    StringPiece name) {
-  if (invalid_depth() > 0) {
-    IncrementInvalidDepth();
-    return this;
-  }
-
-  // Starting the root message. Create the root Item and return.
-  // ANY message type does not need special handling, just set the ItemType
-  // to ANY.
-  if (current_ == NULL) {
-    ProtoWriter::StartObject(name);
-    current_.reset(new Item(
-        this, master_type_.name() == kAnyType ? Item::ANY : Item::MESSAGE,
-        false, false));
-
-    // If master type is a special type that needs extra values to be written to
-    // stream, we write those values.
-    if (master_type_.name() == kStructType) {
-      // Struct has a map<string, Value> field called "fields".
-      // https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto
-      // "fields": [
-      Push("fields", Item::MAP, true, true);
-      return this;
-    }
-
-    if (master_type_.name() == kStructValueType) {
-      // We got a StartObject call with google.protobuf.Value field. The only
-      // object within that type is a struct type. So start a struct.
-      //
-      // The struct field in Value type is named "struct_value"
-      // https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto
-      // Also start the map field "fields" within the struct.
-      // "struct_value": {
-      //   "fields": [
-      Push("struct_value", Item::MESSAGE, true, false);
-      Push("fields", Item::MAP, true, true);
-      return this;
-    }
-
-    if (master_type_.name() == kStructListValueType) {
-      InvalidValue(kStructListValueType,
-                   "Cannot start root message with ListValue.");
-    }
-
-    return this;
-  }
-
-  // Send all ANY events to AnyWriter.
-  if (current_->IsAny()) {
-    current_->any()->StartObject(name);
-    return this;
-  }
-
-  // If we are within a map, we render name as keys and send StartObject to the
-  // value field.
-  if (current_->IsMap()) {
-    if (!ValidMapKey(name)) {
-      IncrementInvalidDepth();
-      return this;
-    }
-
-    // Map is a repeated field of message type with a "key" and a "value" field.
-    // https://developers.google.com/protocol-buffers/docs/proto3?hl=en#maps
-    // message MapFieldEntry {
-    //   key_type key = 1;
-    //   value_type value = 2;
-    // }
-    //
-    // repeated MapFieldEntry map_field = N;
-    //
-    // That means, we render the following element within a list (hence no
-    // name):
-    // { "key": "<name>", "value": {
-    Push("", Item::MESSAGE, false, false);
-    ProtoWriter::RenderDataPiece("key",
-                                 DataPiece(name, use_strict_base64_decoding()));
-    Push("value", Item::MESSAGE, true, false);
-
-    // Make sure we are valid so far after starting map fields.
-    if (invalid_depth() > 0) return this;
-
-    // If top of stack is g.p.Struct type, start the struct the map field within
-    // it.
-    if (element() != NULL && IsStruct(*element()->parent_field())) {
-      // Render "fields": [
-      Push("fields", Item::MAP, true, true);
-      return this;
-    }
-
-    // If top of stack is g.p.Value type, start the Struct within it.
-    if (element() != NULL && IsStructValue(*element()->parent_field())) {
-      // Render
-      // "struct_value": {
-      //   "fields": [
-      Push("struct_value", Item::MESSAGE, true, false);
-      Push("fields", Item::MAP, true, true);
-    }
-    return this;
-  }
-
-  const google::protobuf::Field* field = BeginNamed(name, false);
-  if (field == NULL) return this;
-
-  if (IsStruct(*field)) {
-    // Start a struct object.
-    // Render
-    // "<name>": {
-    //   "fields": {
-    Push(name, Item::MESSAGE, false, false);
-    Push("fields", Item::MAP, true, true);
-    return this;
-  }
-
-  if (IsStructValue(*field)) {
-    // We got a StartObject call with google.protobuf.Value field.  The only
-    // object within that type is a struct type. So start a struct.
-    // Render
-    // "<name>": {
-    //   "struct_value": {
-    //     "fields": {
-    Push(name, Item::MESSAGE, false, false);
-    Push("struct_value", Item::MESSAGE, true, false);
-    Push("fields", Item::MAP, true, true);
-    return this;
-  }
-
-  if (IsMap(*field)) {
-    // Begin a map. A map is triggered by a StartObject() call if the current
-    // field has a map type.
-    // A map type is always repeated, hence set is_list to true.
-    // Render
-    // "<name>": [
-    Push(name, Item::MAP, false, true);
-    return this;
-  }
-
-  // A regular message type. Pass it directly to ProtoWriter.
-  // Render
-  // "<name>": {
-  Push(name, IsAny(*field) ? Item::ANY : Item::MESSAGE, false, false);
-  return this;
-}
-
-ProtoStreamObjectWriter* ProtoStreamObjectWriter::EndObject() {
-  if (invalid_depth() > 0) {
-    DecrementInvalidDepth();
-    return this;
-  }
-
-  if (current_ == NULL) return this;
-
-  if (current_->IsAny()) {
-    if (current_->any()->EndObject()) return this;
-  }
-
-  Pop();
-
-  return this;
-}
-
-ProtoStreamObjectWriter* ProtoStreamObjectWriter::StartList(StringPiece name) {
-  if (invalid_depth() > 0) {
-    IncrementInvalidDepth();
-    return this;
-  }
-
-  // Since we cannot have a top-level repeated item in protobuf, the only way
-  // this is valid is if we start a special type google.protobuf.ListValue or
-  // google.protobuf.Value.
-  if (current_ == NULL) {
-    if (!name.empty()) {
-      InvalidName(name, "Root element should not be named.");
-      IncrementInvalidDepth();
-      return this;
-    }
-
-    // If master type is a special type that needs extra values to be written to
-    // stream, we write those values.
-    if (master_type_.name() == kStructValueType) {
-      // We got a StartList with google.protobuf.Value master type. This means
-      // we have to start the "list_value" within google.protobuf.Value.
-      //
-      // See
-      // https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto
-      //
-      // Render
-      // "<name>": {
-      //   "list_value": {
-      //     "values": [  // Start this list.
-      ProtoWriter::StartObject(name);
-      current_.reset(new Item(this, Item::MESSAGE, false, false));
-      Push("list_value", Item::MESSAGE, true, false);
-      Push("values", Item::MESSAGE, true, true);
-      return this;
-    }
-
-    if (master_type_.name() == kStructListValueType) {
-      // We got a StartList with google.protobuf.ListValue master type. This
-      // means we have to start the "values" within google.protobuf.ListValue.
-      //
-      // Render
-      // "<name>": {
-      //   "values": [  // Start this list.
-      ProtoWriter::StartObject(name);
-      current_.reset(new Item(this, Item::MESSAGE, false, false));
-      Push("values", Item::MESSAGE, true, true);
-      return this;
-    }
-
-    // Send the event to ProtoWriter so proper errors can be reported.
-    //
-    // Render a regular list:
-    // "<name>": [
-    ProtoWriter::StartList(name);
-    current_.reset(new Item(this, Item::MESSAGE, false, true));
-    return this;
-  }
-
-  if (current_->IsAny()) {
-    current_->any()->StartList(name);
-    return this;
-  }
-
-  // If the top of stack is a map, we are starting a list value within a map.
-  // Since map does not allow repeated values, this can only happen when the map
-  // value is of a special type that renders a list in JSON.  These can be one
-  // of 3 cases:
-  // i. We are rendering a list value within google.protobuf.Struct
-  // ii. We are rendering a list value within google.protobuf.Value
-  // iii. We are rendering a list value with type google.protobuf.ListValue.
-  if (current_->IsMap()) {
-    if (!ValidMapKey(name)) {
-      IncrementInvalidDepth();
-      return this;
-    }
-
-    // Start the repeated map entry object.
-    // Render
-    // { "key": "<name>", "value": {
-    Push("", Item::MESSAGE, false, false);
-    ProtoWriter::RenderDataPiece("key",
-                                 DataPiece(name, use_strict_base64_decoding()));
-    Push("value", Item::MESSAGE, true, false);
-
-    // Make sure we are valid after pushing all above items.
-    if (invalid_depth() > 0) return this;
-
-    // case i and ii above. Start "list_value" field within g.p.Value
-    if (element() != NULL && element()->parent_field() != NULL) {
-      // Render
-      // "list_value": {
-      //   "values": [  // Start this list
-      if (IsStructValue(*element()->parent_field())) {
-        Push("list_value", Item::MESSAGE, true, false);
-        Push("values", Item::MESSAGE, true, true);
-        return this;
-      }
-
-      // Render
-      // "values": [
-      if (IsStructListValue(*element()->parent_field())) {
-        // case iii above. Bind directly to g.p.ListValue
-        Push("values", Item::MESSAGE, true, true);
-        return this;
-      }
-    }
-
-    // Report an error.
-    InvalidValue("Map", StrCat("Cannot have repeated items ('", name,
-                               "') within a map."));
-    return this;
-  }
-
-  // When name is empty and stack is not empty, we are rendering an item within
-  // a list.
-  if (name.empty()) {
-    if (element() != NULL && element()->parent_field() != NULL) {
-      if (IsStructValue(*element()->parent_field())) {
-        // Since it is g.p.Value, we bind directly to the list_value.
-        // Render
-        // {  // g.p.Value item within the list
-        //   "list_value": {
-        //     "values": [
-        Push("", Item::MESSAGE, false, false);
-        Push("list_value", Item::MESSAGE, true, false);
-        Push("values", Item::MESSAGE, true, true);
-        return this;
-      }
-
-      if (IsStructListValue(*element()->parent_field())) {
-        // Since it is g.p.ListValue, we bind to it directly.
-        // Render
-        // {  // g.p.ListValue item within the list
-        //   "values": [
-        Push("", Item::MESSAGE, false, false);
-        Push("values", Item::MESSAGE, true, true);
-        return this;
-      }
-    }
-
-    // Pass the event to underlying ProtoWriter.
-    Push(name, Item::MESSAGE, false, true);
-    return this;
-  }
-
-  // name is not empty
-  const google::protobuf::Field* field = Lookup(name);
-  if (field == NULL) {
-    IncrementInvalidDepth();
-    return this;
-  }
-
-  if (IsStructValue(*field)) {
-    // If g.p.Value is repeated, start that list. Otherwise, start the
-    // "list_value" within it.
-    if (IsRepeated(*field)) {
-      // Render it just like a regular repeated field.
-      // "<name>": [
-      Push(name, Item::MESSAGE, false, true);
-      return this;
-    }
-
-    // Start the "list_value" field.
-    // Render
-    // "<name>": {
-    //   "list_value": {
-    //     "values": [
-    Push(name, Item::MESSAGE, false, false);
-    Push("list_value", Item::MESSAGE, true, false);
-    Push("values", Item::MESSAGE, true, true);
-    return this;
-  }
-
-  if (IsStructListValue(*field)) {
-    // If g.p.ListValue is repeated, start that list. Otherwise, start the
-    // "values" within it.
-    if (IsRepeated(*field)) {
-      // Render it just like a regular repeated field.
-      // "<name>": [
-      Push(name, Item::MESSAGE, false, true);
-      return this;
-    }
-
-    // Start the "values" field within g.p.ListValue.
-    // Render
-    // "<name>": {
-    //   "values": [
-    Push(name, Item::MESSAGE, false, false);
-    Push("values", Item::MESSAGE, true, true);
-    return this;
-  }
-
-  // If we are here, the field should be repeated. Report an error otherwise.
-  if (!IsRepeated(*field)) {
-    IncrementInvalidDepth();
-    InvalidName(name, "Proto field is not repeating, cannot start list.");
-    return this;
-  }
-
-  if (IsMap(*field)) {
-    InvalidValue("Map",
-                 StrCat("Cannot bind a list to map for field '", name, "'."));
-    IncrementInvalidDepth();
-    return this;
-  }
-
-  // Pass the event to ProtoWriter.
-  // Render
-  // "<name>": [
-  Push(name, Item::MESSAGE, false, true);
-  return this;
-}
-
-ProtoStreamObjectWriter* ProtoStreamObjectWriter::EndList() {
-  if (invalid_depth() > 0) {
-    DecrementInvalidDepth();
-    return this;
-  }
-
-  if (current_ == NULL) return this;
-
-  if (current_->IsAny()) {
-    current_->any()->EndList();
-    return this;
-  }
-
-  Pop();
-  return this;
-}
-
-Status ProtoStreamObjectWriter::RenderStructValue(ProtoStreamObjectWriter* ow,
-                                                  const DataPiece& data) {
-  string struct_field_name;
-  switch (data.type()) {
-    // Our JSON parser parses numbers as either int64, uint64, or double.
-    case DataPiece::TYPE_INT64: {
-      // If the option to treat integers as strings is set, then render them as
-      // strings. Otherwise, fallback to rendering them as double.
-      if (ow->options_.struct_integers_as_strings) {
-        StatusOr<int64> int_value = data.ToInt64();
-        if (int_value.ok()) {
-          ow->ProtoWriter::RenderDataPiece(
-              "string_value",
-              DataPiece(SimpleItoa(int_value.ValueOrDie()), true));
-          return Status();
-        }
-      }
-      struct_field_name = "number_value";
-      break;
-    }
-    case DataPiece::TYPE_UINT64: {
-      // If the option to treat integers as strings is set, then render them as
-      // strings. Otherwise, fallback to rendering them as double.
-      if (ow->options_.struct_integers_as_strings) {
-        StatusOr<uint64> int_value = data.ToUint64();
-        if (int_value.ok()) {
-          ow->ProtoWriter::RenderDataPiece(
-              "string_value",
-              DataPiece(SimpleItoa(int_value.ValueOrDie()), true));
-          return Status();
-        }
-      }
-      struct_field_name = "number_value";
-      break;
-    }
-    case DataPiece::TYPE_DOUBLE: {
-      if (ow->options_.struct_integers_as_strings) {
-        StatusOr<double> double_value = data.ToDouble();
-        if (double_value.ok()) {
-          ow->ProtoWriter::RenderDataPiece(
-              "string_value",
-              DataPiece(SimpleDtoa(double_value.ValueOrDie()), true));
-          return Status();
-        }
-      }
-      struct_field_name = "number_value";
-      break;
-    }
-    case DataPiece::TYPE_STRING: {
-      struct_field_name = "string_value";
-      break;
-    }
-    case DataPiece::TYPE_BOOL: {
-      struct_field_name = "bool_value";
-      break;
-    }
-    case DataPiece::TYPE_NULL: {
-      struct_field_name = "null_value";
-      break;
-    }
-    default: {
-      return Status(INVALID_ARGUMENT,
-                    "Invalid struct data type. Only number, string, boolean or "
-                    "null values are supported.");
-    }
-  }
-  ow->ProtoWriter::RenderDataPiece(struct_field_name, data);
-  return Status();
-}
-
-Status ProtoStreamObjectWriter::RenderTimestamp(ProtoStreamObjectWriter* ow,
-                                                const DataPiece& data) {
-  if (data.type() == DataPiece::TYPE_NULL) return Status();
-  if (data.type() != DataPiece::TYPE_STRING) {
-    return Status(INVALID_ARGUMENT,
-                  StrCat("Invalid data type for timestamp, value is ",
-                         data.ValueAsStringOrDefault("")));
-  }
-
-  StringPiece value(data.str());
-
-  int64 seconds;
-  int32 nanos;
-  if (!::google::protobuf::internal::ParseTime(value.ToString(), &seconds,
-                                               &nanos)) {
-    return Status(INVALID_ARGUMENT, StrCat("Invalid time format: ", value));
-  }
-
-
-  ow->ProtoWriter::RenderDataPiece("seconds", DataPiece(seconds));
-  ow->ProtoWriter::RenderDataPiece("nanos", DataPiece(nanos));
-  return Status();
-}
-
-static inline util::Status RenderOneFieldPath(ProtoStreamObjectWriter* ow,
-                                                StringPiece path) {
-  ow->ProtoWriter::RenderDataPiece(
-      "paths", DataPiece(ConvertFieldMaskPath(path, &ToSnakeCase), true));
-  return Status();
-}
-
-Status ProtoStreamObjectWriter::RenderFieldMask(ProtoStreamObjectWriter* ow,
-                                                const DataPiece& data) {
-  if (data.type() == DataPiece::TYPE_NULL) return Status();
-  if (data.type() != DataPiece::TYPE_STRING) {
-    return Status(INVALID_ARGUMENT,
-                  StrCat("Invalid data type for field mask, value is ",
-                         data.ValueAsStringOrDefault("")));
-  }
-
-// TODO(tsun): figure out how to do proto descriptor based snake case
-// conversions as much as possible. Because ToSnakeCase sometimes returns the
-// wrong value.
-  google::protobuf::scoped_ptr<ResultCallback1<util::Status, StringPiece> > callback(
-      ::google::protobuf::NewPermanentCallback(&RenderOneFieldPath, ow));
-  return DecodeCompactFieldMaskPaths(data.str(), callback.get());
-}
-
-Status ProtoStreamObjectWriter::RenderDuration(ProtoStreamObjectWriter* ow,
-                                               const DataPiece& data) {
-  if (data.type() == DataPiece::TYPE_NULL) return Status();
-  if (data.type() != DataPiece::TYPE_STRING) {
-    return Status(INVALID_ARGUMENT,
-                  StrCat("Invalid data type for duration, value is ",
-                         data.ValueAsStringOrDefault("")));
-  }
-
-  StringPiece value(data.str());
-
-  if (!value.ends_with("s")) {
-    return Status(INVALID_ARGUMENT,
-                  "Illegal duration format; duration must end with 's'");
-  }
-  value = value.substr(0, value.size() - 1);
-  int sign = 1;
-  if (value.starts_with("-")) {
-    sign = -1;
-    value = value.substr(1);
-  }
-
-  StringPiece s_secs, s_nanos;
-  SplitSecondsAndNanos(value, &s_secs, &s_nanos);
-  uint64 unsigned_seconds;
-  if (!safe_strtou64(s_secs, &unsigned_seconds)) {
-    return Status(INVALID_ARGUMENT,
-                  "Invalid duration format, failed to parse seconds");
-  }
-
-  int32 nanos = 0;
-  Status nanos_status = GetNanosFromStringPiece(
-      s_nanos, "Invalid duration format, failed to parse nano seconds",
-      "Duration value exceeds limits", &nanos);
-  if (!nanos_status.ok()) {
-    return nanos_status;
-  }
-  nanos = sign * nanos;
-
-  int64 seconds = sign * unsigned_seconds;
-  if (seconds > kDurationMaxSeconds || seconds < kDurationMinSeconds ||
-      nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) {
-    return Status(INVALID_ARGUMENT, "Duration value exceeds limits");
-  }
-
-  ow->ProtoWriter::RenderDataPiece("seconds", DataPiece(seconds));
-  ow->ProtoWriter::RenderDataPiece("nanos", DataPiece(nanos));
-  return Status();
-}
-
-Status ProtoStreamObjectWriter::RenderWrapperType(ProtoStreamObjectWriter* ow,
-                                                  const DataPiece& data) {
-  if (data.type() == DataPiece::TYPE_NULL) return Status();
-  ow->ProtoWriter::RenderDataPiece("value", data);
-  return Status();
-}
-
-ProtoStreamObjectWriter* ProtoStreamObjectWriter::RenderDataPiece(
-    StringPiece name, const DataPiece& data) {
-  Status status;
-  if (invalid_depth() > 0) return this;
-
-  if (current_ == NULL) {
-    const TypeRenderer* type_renderer =
-        FindTypeRenderer(GetFullTypeWithUrl(master_type_.name()));
-    if (type_renderer == NULL) {
-      InvalidName(name, "Root element must be a message.");
-      return this;
-    }
-    // Render the special type.
-    // "<name>": {
-    //   ... Render special type ...
-    // }
-    ProtoWriter::StartObject(name);
-    status = (*type_renderer)(this, data);
-    if (!status.ok()) {
-      InvalidValue(master_type_.name(),
-                   StrCat("Field '", name, "', ", status.error_message()));
-    }
-    ProtoWriter::EndObject();
-    return this;
-  }
-
-  if (current_->IsAny()) {
-    current_->any()->RenderDataPiece(name, data);
-    return this;
-  }
-
-  const google::protobuf::Field* field = NULL;
-  if (current_->IsMap()) {
-    if (!ValidMapKey(name)) return this;
-
-    // Render an item in repeated map list.
-    // { "key": "<name>", "value":
-    Push("", Item::MESSAGE, false, false);
-    ProtoWriter::RenderDataPiece("key",
-                                 DataPiece(name, use_strict_base64_decoding()));
-    field = Lookup("value");
-    if (field == NULL) {
-      Pop();
-      GOOGLE_LOG(DFATAL) << "Map does not have a value field.";
-      return this;
-    }
-
-    const TypeRenderer* type_renderer = FindTypeRenderer(field->type_url());
-    if (type_renderer != NULL) {
-      // Map's value type is a special type. Render it like a message:
-      // "value": {
-      //   ... Render special type ...
-      // }
-      Push("value", Item::MESSAGE, true, false);
-      status = (*type_renderer)(this, data);
-      if (!status.ok()) {
-        InvalidValue(field->type_url(),
-                     StrCat("Field '", name, "', ", status.error_message()));
-      }
-      Pop();
-      return this;
-    }
-
-    // If we are rendering explicit null values and the backend proto field is
-    // not of the google.protobuf.NullType type, we do nothing.
-    if (data.type() == DataPiece::TYPE_NULL &&
-        field->type_url() != kStructNullValueTypeUrl) {
-      Pop();
-      return this;
-    }
-
-    // Render the map value as a primitive type.
-    ProtoWriter::RenderDataPiece("value", data);
-    Pop();
-    return this;
-  }
-
-  field = Lookup(name);
-  if (field == NULL) return this;
-
-  // Check if the field is of special type. Render it accordingly if so.
-  const TypeRenderer* type_renderer = FindTypeRenderer(field->type_url());
-  if (type_renderer != NULL) {
-    // Pass through null value only for google.protobuf.Value. For other
-    // types we ignore null value just like for regular field types.
-    if (data.type() != DataPiece::TYPE_NULL ||
-        field->type_url() == kStructValueTypeUrl) {
-      Push(name, Item::MESSAGE, false, false);
-      status = (*type_renderer)(this, data);
-      if (!status.ok()) {
-        InvalidValue(field->type_url(),
-                     StrCat("Field '", name, "', ", status.error_message()));
-      }
-      Pop();
-    }
-    return this;
-  }
-
-  // If we are rendering explicit null values and the backend proto field is
-  // not of the google.protobuf.NullType type, we do nothing.
-  if (data.type() == DataPiece::TYPE_NULL &&
-      field->type_url() != kStructNullValueTypeUrl) {
-    return this;
-  }
-
-  ProtoWriter::RenderDataPiece(name, data);
-  return this;
-}
-
-// Map of functions that are responsible for rendering well known type
-// represented by the key.
-hash_map<string, ProtoStreamObjectWriter::TypeRenderer>*
-    ProtoStreamObjectWriter::renderers_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(writer_renderers_init_);
-
-void ProtoStreamObjectWriter::InitRendererMap() {
-  renderers_ = new hash_map<string, ProtoStreamObjectWriter::TypeRenderer>();
-  (*renderers_)["type.googleapis.com/google.protobuf.Timestamp"] =
-      &ProtoStreamObjectWriter::RenderTimestamp;
-  (*renderers_)["type.googleapis.com/google.protobuf.Duration"] =
-      &ProtoStreamObjectWriter::RenderDuration;
-  (*renderers_)["type.googleapis.com/google.protobuf.FieldMask"] =
-      &ProtoStreamObjectWriter::RenderFieldMask;
-  (*renderers_)["type.googleapis.com/google.protobuf.Double"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.Float"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.Int64"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.UInt64"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.Int32"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.UInt32"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.Bool"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.String"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.Bytes"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.DoubleValue"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.FloatValue"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.Int64Value"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.UInt64Value"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.Int32Value"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.UInt32Value"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.BoolValue"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.StringValue"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.BytesValue"] =
-      &ProtoStreamObjectWriter::RenderWrapperType;
-  (*renderers_)["type.googleapis.com/google.protobuf.Value"] =
-      &ProtoStreamObjectWriter::RenderStructValue;
-  ::google::protobuf::internal::OnShutdown(&DeleteRendererMap);
-}
-
-void ProtoStreamObjectWriter::DeleteRendererMap() {
-  delete ProtoStreamObjectWriter::renderers_;
-  renderers_ = NULL;
-}
-
-ProtoStreamObjectWriter::TypeRenderer*
-ProtoStreamObjectWriter::FindTypeRenderer(const string& type_url) {
-  ::google::protobuf::GoogleOnceInit(&writer_renderers_init_, &InitRendererMap);
-  return FindOrNull(*renderers_, type_url);
-}
-
-bool ProtoStreamObjectWriter::ValidMapKey(StringPiece unnormalized_name) {
-  if (current_ == NULL) return true;
-
-  if (!current_->InsertMapKeyIfNotPresent(unnormalized_name)) {
-    listener()->InvalidName(
-        location(), unnormalized_name,
-        StrCat("Repeated map key: '", unnormalized_name, "' is already set."));
-    return false;
-  }
-
-  return true;
-}
-
-void ProtoStreamObjectWriter::Push(StringPiece name, Item::ItemType item_type,
-                                   bool is_placeholder, bool is_list) {
-  is_list ? ProtoWriter::StartList(name) : ProtoWriter::StartObject(name);
-
-  // invalid_depth == 0 means it is a successful StartObject or StartList.
-  if (invalid_depth() == 0)
-    current_.reset(
-        new Item(current_.release(), item_type, is_placeholder, is_list));
-}
-
-void ProtoStreamObjectWriter::Pop() {
-  // Pop all placeholder items sending StartObject or StartList events to
-  // ProtoWriter according to is_list value.
-  while (current_ != NULL && current_->is_placeholder()) {
-    PopOneElement();
-  }
-  if (current_ != NULL) {
-    PopOneElement();
-  }
-}
-
-void ProtoStreamObjectWriter::PopOneElement() {
-  current_->is_list() ? ProtoWriter::EndList() : ProtoWriter::EndObject();
-  current_.reset(current_->pop<Item>());
-}
-
-bool ProtoStreamObjectWriter::IsMap(const google::protobuf::Field& field) {
-  if (field.type_url().empty() ||
-      field.kind() != google::protobuf::Field_Kind_TYPE_MESSAGE ||
-      field.cardinality() !=
-          google::protobuf::Field_Cardinality_CARDINALITY_REPEATED) {
-    return false;
-  }
-  const google::protobuf::Type* field_type =
-      typeinfo()->GetTypeByTypeUrl(field.type_url());
-
-  return google::protobuf::util::converter::IsMap(field, *field_type);
-}
-
-bool ProtoStreamObjectWriter::IsAny(const google::protobuf::Field& field) {
-  return GetTypeWithoutUrl(field.type_url()) == kAnyType;
-}
-
-bool ProtoStreamObjectWriter::IsStruct(const google::protobuf::Field& field) {
-  return GetTypeWithoutUrl(field.type_url()) == kStructType;
-}
-
-bool ProtoStreamObjectWriter::IsStructValue(
-    const google::protobuf::Field& field) {
-  return GetTypeWithoutUrl(field.type_url()) == kStructValueType;
-}
-
-bool ProtoStreamObjectWriter::IsStructListValue(
-    const google::protobuf::Field& field) {
-  return GetTypeWithoutUrl(field.type_url()) == kStructListValueType;
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.h b/3rdparty/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.h
deleted file mode 100644 (file)
index ab53491..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTOSTREAM_OBJECTWRITER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTOSTREAM_OBJECTWRITER_H__
-
-#include <deque>
-#include <google/protobuf/stubs/hash.h>
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/util/internal/type_info.h>
-#include <google/protobuf/util/internal/datapiece.h>
-#include <google/protobuf/util/internal/error_listener.h>
-#include <google/protobuf/util/internal/proto_writer.h>
-#include <google/protobuf/util/internal/structured_objectwriter.h>
-#include <google/protobuf/util/type_resolver.h>
-#include <google/protobuf/stubs/bytestream.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-class CodedOutputStream;
-}  // namespace io
-}  // namespace protobuf
-
-
-namespace protobuf {
-class Type;
-class Field;
-}  // namespace protobuf
-
-
-namespace protobuf {
-namespace util {
-namespace converter {
-
-class ObjectLocationTracker;
-
-// An ObjectWriter that can write protobuf bytes directly from writer events.
-// This class supports all special types like Struct and Map. It uses
-// the ProtoWriter class to write raw proto bytes.
-//
-// It also supports streaming.
-class LIBPROTOBUF_EXPORT ProtoStreamObjectWriter : public ProtoWriter {
- public:
-  // Options that control ProtoStreamObjectWriter class's behavior.
-  struct Options {
-    // Treats numeric inputs in google.protobuf.Struct as strings. Normally,
-    // numeric values are returned in double field "number_value" of
-    // google.protobuf.Struct. However, this can cause precision loss for
-    // int64/uint64/double inputs. This option is provided for cases that want
-    // to preserve number precision.
-    //
-    // TODO(skarvaje): Rename to struct_numbers_as_strings as it covers double
-    // as well.
-    bool struct_integers_as_strings;
-
-    // Not treat unknown fields as an error. If there is an unknown fields,
-    // just ignore it and continue to process the rest.
-    bool ignore_unknown_fields;
-
-    // If true, check if enum name in camel case or without underscore matches
-    // the field name.
-    bool use_lower_camel_for_enums;
-
-    Options()
-        : struct_integers_as_strings(false),
-          ignore_unknown_fields(false),
-          use_lower_camel_for_enums(false) {}
-
-    // Default instance of Options with all options set to defaults.
-    static const Options& Defaults() {
-      static Options defaults;
-      return defaults;
-    }
-  };
-
-// Constructor. Does not take ownership of any parameter passed in.
-  ProtoStreamObjectWriter(TypeResolver* type_resolver,
-                          const google::protobuf::Type& type,
-                          strings::ByteSink* output, ErrorListener* listener,
-                          const ProtoStreamObjectWriter::Options& options =
-                              ProtoStreamObjectWriter::Options::Defaults());
-  virtual ~ProtoStreamObjectWriter();
-
-  // ObjectWriter methods.
-  virtual ProtoStreamObjectWriter* StartObject(StringPiece name);
-  virtual ProtoStreamObjectWriter* EndObject();
-  virtual ProtoStreamObjectWriter* StartList(StringPiece name);
-  virtual ProtoStreamObjectWriter* EndList();
-
-  // Renders a DataPiece 'value' into a field whose wire type is determined
-  // from the given field 'name'.
-  virtual ProtoStreamObjectWriter* RenderDataPiece(StringPiece name,
-                                                   const DataPiece& value);
-
- protected:
-  // Function that renders a well known type with modified behavior.
-  typedef util::Status (*TypeRenderer)(ProtoStreamObjectWriter*,
-                                         const DataPiece&);
-
-  // Handles writing Anys out using nested object writers and the like.
-  class LIBPROTOBUF_EXPORT AnyWriter {
-   public:
-    explicit AnyWriter(ProtoStreamObjectWriter* parent);
-    ~AnyWriter();
-
-    // Passes a StartObject call through to the Any writer.
-    void StartObject(StringPiece name);
-
-    // Passes an EndObject call through to the Any. Returns true if the any
-    // handled the EndObject call, false if the Any is now all done and is no
-    // longer needed.
-    bool EndObject();
-
-    // Passes a StartList call through to the Any writer.
-    void StartList(StringPiece name);
-
-    // Passes an EndList call through to the Any writer.
-    void EndList();
-
-    // Renders a data piece on the any.
-    void RenderDataPiece(StringPiece name, const DataPiece& value);
-
-   private:
-    // Before the "@type" field is encountered, we store all incoming data
-    // into this Event struct and replay them after we get the "@type" field.
-    class LIBPROTOBUF_EXPORT Event {
-     public:
-      enum Type {
-        START_OBJECT = 0,
-        END_OBJECT = 1,
-        START_LIST = 2,
-        END_LIST = 3,
-        RENDER_DATA_PIECE = 4,
-      };
-
-      // Constructor for END_OBJECT and END_LIST events.
-      explicit Event(Type type) : type_(type), value_(DataPiece::NullData()) {}
-
-      // Constructor for START_OBJECT and START_LIST events.
-      explicit Event(Type type, StringPiece name)
-          : type_(type),
-            name_(name.ToString()),
-            value_(DataPiece::NullData()) {}
-
-      // Constructor for RENDER_DATA_PIECE events.
-      explicit Event(StringPiece name, const DataPiece& value)
-          : type_(RENDER_DATA_PIECE), name_(name.ToString()), value_(value) {
-        DeepCopy();
-      }
-
-      Event(const Event& other)
-          : type_(other.type_), name_(other.name_), value_(other.value_) {
-        DeepCopy();
-      }
-
-      Event& operator=(const Event& other) {
-        type_ = other.type_;
-        name_ = other.name_;
-        value_ = other.value_;
-        DeepCopy();
-        return *this;
-      }
-
-      void Replay(AnyWriter* writer) const;
-
-     private:
-      void DeepCopy();
-
-      Type type_;
-      string name_;
-      DataPiece value_;
-      string value_storage_;
-    };
-
-    // Handles starting up the any once we have a type.
-    void StartAny(const DataPiece& value);
-
-    // Writes the Any out to the parent writer in its serialized form.
-    void WriteAny();
-
-    // The parent of this writer, needed for various bits such as type info and
-    // the listeners.
-    ProtoStreamObjectWriter* parent_;
-
-    // The nested object writer, used to write events.
-    google::protobuf::scoped_ptr<ProtoStreamObjectWriter> ow_;
-
-    // The type_url_ that this Any represents.
-    string type_url_;
-
-    // Whether this any is invalid. This allows us to only report an invalid
-    // Any message a single time rather than every time we get a nested field.
-    bool invalid_;
-
-    // The output data and wrapping ByteSink.
-    string data_;
-    strings::StringByteSink output_;
-
-    // The depth within the Any, so we can track when we're done.
-    int depth_;
-
-    // True if the type is a well-known type. Well-known types in Any
-    // has a special formating:
-    // {
-    //   "@type": "type.googleapis.com/google.protobuf.XXX",
-    //   "value": <JSON representation of the type>,
-    // }
-    bool is_well_known_type_;
-    TypeRenderer* well_known_type_render_;
-
-    // Store data before the "@type" field.
-    std::vector<Event> uninterpreted_events_;
-  };
-
-  // Represents an item in a stack of items used to keep state between
-  // ObjectWrier events.
-  class LIBPROTOBUF_EXPORT Item : public BaseElement {
-   public:
-    // Indicates the type of item.
-    enum ItemType {
-      MESSAGE,  // Simple message
-      MAP,      // Proto3 map type
-      ANY,      // Proto3 Any type
-    };
-
-    // Constructor for the root item.
-    Item(ProtoStreamObjectWriter* enclosing, ItemType item_type,
-         bool is_placeholder, bool is_list);
-
-    // Constructor for a field of a message.
-    Item(Item* parent, ItemType item_type, bool is_placeholder, bool is_list);
-
-    virtual ~Item() {}
-
-    // These functions return true if the element type is corresponding to the
-    // type in function name.
-    bool IsMap() { return item_type_ == MAP; }
-    bool IsAny() { return item_type_ == ANY; }
-
-    AnyWriter* any() const { return any_.get(); }
-
-    virtual Item* parent() const {
-      return static_cast<Item*>(BaseElement::parent());
-    }
-
-    // Inserts map key into hash set if and only if the key did NOT already
-    // exist in hash set.
-    // The hash set (map_keys_) is ONLY used to keep track of map keys.
-    // Return true if insert successfully; returns false if the map key was
-    // already present.
-    bool InsertMapKeyIfNotPresent(StringPiece map_key);
-
-    bool is_placeholder() const { return is_placeholder_; }
-    bool is_list() const { return is_list_; }
-
-   private:
-    // Used for access to variables of the enclosing instance of
-    // ProtoStreamObjectWriter.
-    ProtoStreamObjectWriter* ow_;
-
-    // A writer for Any objects, handles all Any-related nonsense.
-    google::protobuf::scoped_ptr<AnyWriter> any_;
-
-    // The type of this element, see enum for permissible types.
-    ItemType item_type_;
-
-    // Set of map keys already seen for the type_. Used to validate incoming
-    // messages so no map key appears more than once.
-    google::protobuf::scoped_ptr<hash_set<string> > map_keys_;
-
-    // Conveys whether this Item is a placeholder or not. Placeholder items are
-    // pushed to stack to account for special types.
-    bool is_placeholder_;
-
-    // Conveys whether this Item is a list or not. This is used to send
-    // StartList or EndList calls to underlying ObjectWriter.
-    bool is_list_;
-
-    GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(Item);
-  };
-
-  ProtoStreamObjectWriter(const TypeInfo* typeinfo,
-                          const google::protobuf::Type& type,
-                          strings::ByteSink* output, ErrorListener* listener);
-
-  // Returns true if the field is a map.
-  inline bool IsMap(const google::protobuf::Field& field);
-
-  // Returns true if the field is an any.
-  inline bool IsAny(const google::protobuf::Field& field);
-
-  // Returns true if the field is google.protobuf.Struct.
-  inline bool IsStruct(const google::protobuf::Field& field);
-
-  // Returns true if the field is google.protobuf.Value.
-  inline bool IsStructValue(const google::protobuf::Field& field);
-
-  // Returns true if the field is google.protobuf.ListValue.
-  inline bool IsStructListValue(const google::protobuf::Field& field);
-
-  // Renders google.protobuf.Value in struct.proto. It picks the right oneof
-  // type based on value's type.
-  static util::Status RenderStructValue(ProtoStreamObjectWriter* ow,
-                                          const DataPiece& value);
-
-  // Renders google.protobuf.Timestamp value.
-  static util::Status RenderTimestamp(ProtoStreamObjectWriter* ow,
-                                        const DataPiece& value);
-
-  // Renders google.protobuf.FieldMask value.
-  static util::Status RenderFieldMask(ProtoStreamObjectWriter* ow,
-                                        const DataPiece& value);
-
-  // Renders google.protobuf.Duration value.
-  static util::Status RenderDuration(ProtoStreamObjectWriter* ow,
-                                       const DataPiece& value);
-
-  // Renders wrapper message types for primitive types in
-  // google/protobuf/wrappers.proto.
-  static util::Status RenderWrapperType(ProtoStreamObjectWriter* ow,
-                                          const DataPiece& value);
-
-  static void InitRendererMap();
-  static void DeleteRendererMap();
-  static TypeRenderer* FindTypeRenderer(const string& type_url);
-
-  // Returns true if the map key for type_ is not duplicated key.
-  // If map key is duplicated key, this function returns false.
-  // Note that caller should make sure that the current proto element (current_)
-  // is of element type MAP or STRUCT_MAP.
-  // It also calls the appropriate error callback and unnormalzied_name is used
-  // for error string.
-  bool ValidMapKey(StringPiece unnormalized_name);
-
-  // Pushes an item on to the stack. Also calls either StartObject or StartList
-  // on the underlying ObjectWriter depending on whether is_list is false or
-  // not.
-  // is_placeholder conveys whether the item is a placeholder item or not.
-  // Placeholder items are pushed when adding auxillary types' StartObject or
-  // StartList calls.
-  void Push(StringPiece name, Item::ItemType item_type, bool is_placeholder,
-            bool is_list);
-
-  // Pops items from the stack. All placeholder items are popped until a
-  // non-placeholder item is found.
-  void Pop();
-
-  // Pops one element from the stack. Calls EndObject() or EndList() on the
-  // underlying ObjectWriter depending on the value of is_list_.
-  void PopOneElement();
-
- private:
-  // Helper functions to create the map and find functions responsible for
-  // rendering well known types, keyed by type URL.
-  static hash_map<string, TypeRenderer>* renderers_;
-
-  // Variables for describing the structure of the input tree:
-  // master_type_: descriptor for the whole protobuf message.
-  const google::protobuf::Type& master_type_;
-
-  // The current element, variable for internal state processing.
-  google::protobuf::scoped_ptr<Item> current_;
-
-  // Reference to the options that control this class's behavior.
-  const ProtoStreamObjectWriter::Options options_;
-
-  GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(ProtoStreamObjectWriter);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_PROTOSTREAM_OBJECTWRITER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/structured_objectwriter.h b/3rdparty/protobuf/src/google/protobuf/util/internal/structured_objectwriter.h
deleted file mode 100644 (file)
index 3f065d6..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_STRUCTURED_OBJECTWRITER_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_STRUCTURED_OBJECTWRITER_H__
-
-#include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
-
-#include <google/protobuf/stubs/casts.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/util/internal/object_writer.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// An StructuredObjectWriter is an ObjectWriter for writing
-// tree-structured data in a stream of events representing objects
-// and collections. Implementation of this interface can be used to
-// write an object stream to an in-memory structure, protobufs,
-// JSON, XML, or any other output format desired. The ObjectSource
-// interface is typically used as the source of an object stream.
-//
-// See JsonObjectWriter for a sample implementation of
-// StructuredObjectWriter and its use.
-//
-// Derived classes could be thread-unsafe.
-class LIBPROTOBUF_EXPORT StructuredObjectWriter : public ObjectWriter {
- public:
-  virtual ~StructuredObjectWriter() {}
-
- protected:
-  // A base element class for subclasses to extend, makes tracking state easier.
-  //
-  // StructuredObjectWriter behaves as a visitor. BaseElement represents a node
-  // in the input tree. Implementation of StructuredObjectWriter should also
-  // extend BaseElement to keep track of the location in the input tree.
-  class LIBPROTOBUF_EXPORT BaseElement {
-   public:
-    // Takes ownership of the parent Element.
-    explicit BaseElement(BaseElement* parent)
-        : parent_(parent), level_(parent == NULL ? 0 : parent->level() + 1) {}
-    virtual ~BaseElement() {}
-
-    // Releases ownership of the parent and returns a pointer to it.
-    template <typename ElementType>
-    ElementType* pop() {
-      return down_cast<ElementType*>(parent_.release());
-    }
-
-    // Returns true if this element is the root.
-    bool is_root() const { return parent_ == NULL; }
-
-    // Returns the number of hops from this element to the root element.
-    int level() const { return level_; }
-
-   protected:
-    // Returns pointer to parent element without releasing ownership.
-    virtual BaseElement* parent() const { return parent_.get(); }
-
-   private:
-    // Pointer to the parent Element.
-    google::protobuf::scoped_ptr<BaseElement> parent_;
-
-    // Number of hops to the root Element.
-    // The root Element has NULL parent_ and a level_ of 0.
-    const int level_;
-
-    GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(BaseElement);
-  };
-
-  StructuredObjectWriter() {}
-
-  // Returns the current element. Used for indentation and name overrides.
-  virtual BaseElement* element() = 0;
-
- private:
-  // Do not add any data members to this class.
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StructuredObjectWriter);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_STRUCTURED_OBJECTWRITER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/type_info.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/type_info.cc
deleted file mode 100644 (file)
index 85d0d5c..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/type_info.h>
-
-#include <map>
-#include <set>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/type.pb.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/map_util.h>
-#include <google/protobuf/stubs/status.h>
-#include <google/protobuf/stubs/statusor.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-namespace {
-// A TypeInfo that looks up information provided by a TypeResolver.
-class TypeInfoForTypeResolver : public TypeInfo {
- public:
-  explicit TypeInfoForTypeResolver(TypeResolver* type_resolver)
-      : type_resolver_(type_resolver) {}
-
-  virtual ~TypeInfoForTypeResolver() {
-    DeleteCachedTypes(&cached_types_);
-    DeleteCachedTypes(&cached_enums_);
-  }
-
-  virtual util::StatusOr<const google::protobuf::Type*> ResolveTypeUrl(
-      StringPiece type_url) const {
-    std::map<StringPiece, StatusOrType>::iterator it =
-        cached_types_.find(type_url);
-    if (it != cached_types_.end()) {
-      return it->second;
-    }
-    // Stores the string value so it can be referenced using StringPiece in the
-    // cached_types_ map.
-    const string& string_type_url =
-        *string_storage_.insert(type_url.ToString()).first;
-    google::protobuf::scoped_ptr<google::protobuf::Type> type(new google::protobuf::Type());
-    util::Status status =
-        type_resolver_->ResolveMessageType(string_type_url, type.get());
-    StatusOrType result =
-        status.ok() ? StatusOrType(type.release()) : StatusOrType(status);
-    cached_types_[string_type_url] = result;
-    return result;
-  }
-
-  virtual const google::protobuf::Type* GetTypeByTypeUrl(
-      StringPiece type_url) const {
-    StatusOrType result = ResolveTypeUrl(type_url);
-    return result.ok() ? result.ValueOrDie() : NULL;
-  }
-
-  virtual const google::protobuf::Enum* GetEnumByTypeUrl(
-      StringPiece type_url) const {
-    std::map<StringPiece, StatusOrEnum>::iterator it =
-        cached_enums_.find(type_url);
-    if (it != cached_enums_.end()) {
-      return it->second.ok() ? it->second.ValueOrDie() : NULL;
-    }
-    // Stores the string value so it can be referenced using StringPiece in the
-    // cached_enums_ map.
-    const string& string_type_url =
-        *string_storage_.insert(type_url.ToString()).first;
-    google::protobuf::scoped_ptr<google::protobuf::Enum> enum_type(
-        new google::protobuf::Enum());
-    util::Status status =
-        type_resolver_->ResolveEnumType(string_type_url, enum_type.get());
-    StatusOrEnum result =
-        status.ok() ? StatusOrEnum(enum_type.release()) : StatusOrEnum(status);
-    cached_enums_[string_type_url] = result;
-    return result.ok() ? result.ValueOrDie() : NULL;
-  }
-
-  virtual const google::protobuf::Field* FindField(
-      const google::protobuf::Type* type, StringPiece camel_case_name) const {
-    std::map<const google::protobuf::Type*, CamelCaseNameTable>::const_iterator
-        it = indexed_types_.find(type);
-    const CamelCaseNameTable& camel_case_name_table =
-        (it == indexed_types_.end())
-            ? PopulateNameLookupTable(type, &indexed_types_[type])
-            : it->second;
-    StringPiece name =
-        FindWithDefault(camel_case_name_table, camel_case_name, StringPiece());
-    if (name.empty()) {
-      // Didn't find a mapping. Use whatever provided.
-      name = camel_case_name;
-    }
-    return FindFieldInTypeOrNull(type, name);
-  }
-
- private:
-  typedef util::StatusOr<const google::protobuf::Type*> StatusOrType;
-  typedef util::StatusOr<const google::protobuf::Enum*> StatusOrEnum;
-  typedef std::map<StringPiece, StringPiece> CamelCaseNameTable;
-
-  template <typename T>
-  static void DeleteCachedTypes(std::map<StringPiece, T>* cached_types) {
-    for (typename std::map<StringPiece, T>::iterator it = cached_types->begin();
-         it != cached_types->end(); ++it) {
-      if (it->second.ok()) {
-        delete it->second.ValueOrDie();
-      }
-    }
-  }
-
-  const CamelCaseNameTable& PopulateNameLookupTable(
-      const google::protobuf::Type* type,
-      CamelCaseNameTable* camel_case_name_table) const {
-    for (int i = 0; i < type->fields_size(); ++i) {
-      const google::protobuf::Field& field = type->fields(i);
-      StringPiece name = field.name();
-      StringPiece camel_case_name = field.json_name();
-      const StringPiece* existing =
-          InsertOrReturnExisting(camel_case_name_table, camel_case_name, name);
-      if (existing && *existing != name) {
-        GOOGLE_LOG(WARNING) << "Field '" << name << "' and '" << *existing
-                     << "' map to the same camel case name '" << camel_case_name
-                     << "'.";
-      }
-    }
-    return *camel_case_name_table;
-  }
-
-  TypeResolver* type_resolver_;
-
-  // Stores string values that will be referenced by StringPieces in
-  // cached_types_, cached_enums_.
-  mutable std::set<string> string_storage_;
-
-  mutable std::map<StringPiece, StatusOrType> cached_types_;
-  mutable std::map<StringPiece, StatusOrEnum> cached_enums_;
-
-  mutable std::map<const google::protobuf::Type*, CamelCaseNameTable>
-      indexed_types_;
-};
-}  // namespace
-
-TypeInfo* TypeInfo::NewTypeInfo(TypeResolver* type_resolver) {
-  return new TypeInfoForTypeResolver(type_resolver);
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/type_info.h b/3rdparty/protobuf/src/google/protobuf/util/internal/type_info.h
deleted file mode 100644 (file)
index d813317..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_TYPE_INFO_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_TYPE_INFO_H__
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/type.pb.h>
-#include <google/protobuf/util/type_resolver.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/status.h>
-#include <google/protobuf/stubs/statusor.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-// Internal helper class for type resolving. Note that this class is not
-// thread-safe and should only be accessed in one thread.
-class LIBPROTOBUF_EXPORT TypeInfo {
- public:
-  TypeInfo() {}
-  virtual ~TypeInfo() {}
-
-  // Resolves a type url into a Type. If the type url is invalid, returns
-  // INVALID_ARGUMENT error status. If the type url is valid but the
-  // corresponding type cannot be found, returns a NOT_FOUND error status.
-  //
-  // This TypeInfo class retains the ownership of the returned pointer.
-  virtual util::StatusOr<const google::protobuf::Type*> ResolveTypeUrl(
-      StringPiece type_url) const = 0;
-
-  // Resolves a type url into a Type. Like ResolveTypeUrl() but returns
-  // NULL if the type url is invalid or the type cannot be found.
-  //
-  // This TypeInfo class retains the ownership of the returned pointer.
-  virtual const google::protobuf::Type* GetTypeByTypeUrl(
-      StringPiece type_url) const = 0;
-
-  // Resolves a type url for an enum. Returns NULL if the type url is
-  // invalid or the type cannot be found.
-  //
-  // This TypeInfo class retains the ownership of the returned pointer.
-  virtual const google::protobuf::Enum* GetEnumByTypeUrl(
-      StringPiece type_url) const = 0;
-
-  // Looks up a field in the specified type given a CamelCase name.
-  virtual const google::protobuf::Field* FindField(
-      const google::protobuf::Type* type,
-      StringPiece camel_case_name) const = 0;
-
-  // Creates a TypeInfo object that looks up type information from a
-  // TypeResolver. Caller takes ownership of the returned pointer.
-  static TypeInfo* NewTypeInfo(TypeResolver* type_resolver);
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeInfo);
-};
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_TYPE_INFO_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/utility.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/utility.cc
deleted file mode 100644 (file)
index 11780ee..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/internal/utility.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/callback.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/wrappers.pb.h>
-#include <google/protobuf/descriptor.pb.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/util/internal/constants.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/map_util.h>
-#include <google/protobuf/stubs/mathlimits.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace converter {
-
-bool GetBoolOptionOrDefault(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name, bool default_value) {
-  const google::protobuf::Option* opt = FindOptionOrNull(options, option_name);
-  if (opt == NULL) {
-    return default_value;
-  }
-  return GetBoolFromAny(opt->value());
-}
-
-int64 GetInt64OptionOrDefault(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name, int64 default_value) {
-  const google::protobuf::Option* opt = FindOptionOrNull(options, option_name);
-  if (opt == NULL) {
-    return default_value;
-  }
-  return GetInt64FromAny(opt->value());
-}
-
-double GetDoubleOptionOrDefault(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name, double default_value) {
-  const google::protobuf::Option* opt = FindOptionOrNull(options, option_name);
-  if (opt == NULL) {
-    return default_value;
-  }
-  return GetDoubleFromAny(opt->value());
-}
-
-string GetStringOptionOrDefault(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name, const string& default_value) {
-  const google::protobuf::Option* opt = FindOptionOrNull(options, option_name);
-  if (opt == NULL) {
-    return default_value;
-  }
-  return GetStringFromAny(opt->value());
-}
-
-template <typename T>
-void ParseFromAny(const string& data, T* result) {
-  result->ParseFromString(data);
-}
-
-// Returns a boolean value contained in Any type.
-// TODO(skarvaje): Add type checking & error messages here.
-bool GetBoolFromAny(const google::protobuf::Any& any) {
-  google::protobuf::BoolValue b;
-  ParseFromAny(any.value(), &b);
-  return b.value();
-}
-
-int64 GetInt64FromAny(const google::protobuf::Any& any) {
-  google::protobuf::Int64Value i;
-  ParseFromAny(any.value(), &i);
-  return i.value();
-}
-
-double GetDoubleFromAny(const google::protobuf::Any& any) {
-  google::protobuf::DoubleValue i;
-  ParseFromAny(any.value(), &i);
-  return i.value();
-}
-
-string GetStringFromAny(const google::protobuf::Any& any) {
-  google::protobuf::StringValue s;
-  ParseFromAny(any.value(), &s);
-  return s.value();
-}
-
-const StringPiece GetTypeWithoutUrl(StringPiece type_url) {
-  if (type_url.size() > kTypeUrlSize && type_url[kTypeUrlSize] == '/') {
-    return type_url.substr(kTypeUrlSize + 1);
-  } else {
-    size_t idx = type_url.rfind('/');
-    if (idx != type_url.npos) {
-      type_url.remove_prefix(idx + 1);
-    }
-    return type_url;
-  }
-}
-
-const string GetFullTypeWithUrl(StringPiece simple_type) {
-  return StrCat(kTypeServiceBaseUrl, "/", simple_type);
-}
-
-const google::protobuf::Option* FindOptionOrNull(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name) {
-  for (int i = 0; i < options.size(); ++i) {
-    const google::protobuf::Option& opt = options.Get(i);
-    if (opt.name() == option_name) {
-      return &opt;
-    }
-  }
-  return NULL;
-}
-
-const google::protobuf::Field* FindFieldInTypeOrNull(
-    const google::protobuf::Type* type, StringPiece field_name) {
-  if (type != NULL) {
-    for (int i = 0; i < type->fields_size(); ++i) {
-      const google::protobuf::Field& field = type->fields(i);
-      if (field.name() == field_name) {
-        return &field;
-      }
-    }
-  }
-  return NULL;
-}
-
-const google::protobuf::Field* FindJsonFieldInTypeOrNull(
-    const google::protobuf::Type* type, StringPiece json_name) {
-  if (type != NULL) {
-    for (int i = 0; i < type->fields_size(); ++i) {
-      const google::protobuf::Field& field = type->fields(i);
-      if (field.json_name() == json_name) {
-        return &field;
-      }
-    }
-  }
-  return NULL;
-}
-
-const google::protobuf::Field* FindFieldInTypeByNumberOrNull(
-    const google::protobuf::Type* type, int32 number) {
-  if (type != NULL) {
-    for (int i = 0; i < type->fields_size(); ++i) {
-      const google::protobuf::Field& field = type->fields(i);
-      if (field.number() == number) {
-        return &field;
-      }
-    }
-  }
-  return NULL;
-}
-
-const google::protobuf::EnumValue* FindEnumValueByNameOrNull(
-    const google::protobuf::Enum* enum_type, StringPiece enum_name) {
-  if (enum_type != NULL) {
-    for (int i = 0; i < enum_type->enumvalue_size(); ++i) {
-      const google::protobuf::EnumValue& enum_value = enum_type->enumvalue(i);
-      if (enum_value.name() == enum_name) {
-        return &enum_value;
-      }
-    }
-  }
-  return NULL;
-}
-
-const google::protobuf::EnumValue* FindEnumValueByNumberOrNull(
-    const google::protobuf::Enum* enum_type, int32 value) {
-  if (enum_type != NULL) {
-    for (int i = 0; i < enum_type->enumvalue_size(); ++i) {
-      const google::protobuf::EnumValue& enum_value = enum_type->enumvalue(i);
-      if (enum_value.number() == value) {
-        return &enum_value;
-      }
-    }
-  }
-  return NULL;
-}
-
-const google::protobuf::EnumValue* FindEnumValueByNameWithoutUnderscoreOrNull(
-    const google::protobuf::Enum* enum_type, StringPiece enum_name) {
-  if (enum_type != NULL) {
-    for (int i = 0; i < enum_type->enumvalue_size(); ++i) {
-      const google::protobuf::EnumValue& enum_value = enum_type->enumvalue(i);
-      string enum_name_without_underscore = enum_value.name();
-
-      // Remove underscore from the name.
-      enum_name_without_underscore.erase(
-          std::remove(enum_name_without_underscore.begin(),
-                      enum_name_without_underscore.end(), '_'),
-          enum_name_without_underscore.end());
-      // Make the name uppercase.
-      for (string::iterator it = enum_name_without_underscore.begin();
-           it != enum_name_without_underscore.end(); ++it) {
-        *it = ascii_toupper(*it);
-      }
-
-      if (enum_name_without_underscore == enum_name) {
-        return &enum_value;
-      }
-    }
-  }
-  return NULL;
-}
-
-string ToCamelCase(const StringPiece input) {
-  bool capitalize_next = false;
-  bool was_cap = true;
-  bool is_cap = false;
-  bool first_word = true;
-  string result;
-  result.reserve(input.size());
-
-  for (size_t i = 0; i < input.size(); ++i, was_cap = is_cap) {
-    is_cap = ascii_isupper(input[i]);
-    if (input[i] == '_') {
-      capitalize_next = true;
-      if (!result.empty()) first_word = false;
-      continue;
-    } else if (first_word) {
-      // Consider when the current character B is capitalized,
-      // first word ends when:
-      // 1) following a lowercase:   "...aB..."
-      // 2) followed by a lowercase: "...ABc..."
-      if (!result.empty() && is_cap &&
-          (!was_cap || (i + 1 < input.size() && ascii_islower(input[i + 1])))) {
-        first_word = false;
-        result.push_back(input[i]);
-      } else {
-        result.push_back(ascii_tolower(input[i]));
-        continue;
-      }
-    } else if (capitalize_next) {
-      capitalize_next = false;
-      if (ascii_islower(input[i])) {
-        result.push_back(ascii_toupper(input[i]));
-        continue;
-      } else {
-        result.push_back(input[i]);
-        continue;
-      }
-    } else {
-      result.push_back(ascii_tolower(input[i]));
-    }
-  }
-  return result;
-}
-
-string ToSnakeCase(StringPiece input) {
-  bool was_not_underscore = false;  // Initialize to false for case 1 (below)
-  bool was_not_cap = false;
-  string result;
-  result.reserve(input.size() << 1);
-
-  for (size_t i = 0; i < input.size(); ++i) {
-    if (ascii_isupper(input[i])) {
-      // Consider when the current character B is capitalized:
-      // 1) At beginning of input:   "B..." => "b..."
-      //    (e.g. "Biscuit" => "biscuit")
-      // 2) Following a lowercase:   "...aB..." => "...a_b..."
-      //    (e.g. "gBike" => "g_bike")
-      // 3) At the end of input:     "...AB" => "...ab"
-      //    (e.g. "GoogleLAB" => "google_lab")
-      // 4) Followed by a lowercase: "...ABc..." => "...a_bc..."
-      //    (e.g. "GBike" => "g_bike")
-      if (was_not_underscore &&               //            case 1 out
-          (was_not_cap ||                     // case 2 in, case 3 out
-           (i + 1 < input.size() &&           //            case 3 out
-            ascii_islower(input[i + 1])))) {  // case 4 in
-        // We add an underscore for case 2 and case 4.
-        result.push_back('_');
-      }
-      result.push_back(ascii_tolower(input[i]));
-      was_not_underscore = true;
-      was_not_cap = false;
-    } else {
-      result.push_back(input[i]);
-      was_not_underscore = input[i] != '_';
-      was_not_cap = true;
-    }
-  }
-  return result;
-}
-
-std::set<string>* well_known_types_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(well_known_types_init_);
-const char* well_known_types_name_array_[] = {
-    "google.protobuf.Timestamp",   "google.protobuf.Duration",
-    "google.protobuf.DoubleValue", "google.protobuf.FloatValue",
-    "google.protobuf.Int64Value",  "google.protobuf.UInt64Value",
-    "google.protobuf.Int32Value",  "google.protobuf.UInt32Value",
-    "google.protobuf.BoolValue",   "google.protobuf.StringValue",
-    "google.protobuf.BytesValue",  "google.protobuf.FieldMask"};
-
-void DeleteWellKnownTypes() { delete well_known_types_; }
-
-void InitWellKnownTypes() {
-  well_known_types_ = new std::set<string>;
-  for (int i = 0; i < GOOGLE_ARRAYSIZE(well_known_types_name_array_); ++i) {
-    well_known_types_->insert(well_known_types_name_array_[i]);
-  }
-  google::protobuf::internal::OnShutdown(&DeleteWellKnownTypes);
-}
-
-bool IsWellKnownType(const string& type_name) {
-  InitWellKnownTypes();
-  return ContainsKey(*well_known_types_, type_name);
-}
-
-bool IsValidBoolString(const string& bool_string) {
-  return bool_string == "true" || bool_string == "false" ||
-         bool_string == "1" || bool_string == "0";
-}
-
-bool IsMap(const google::protobuf::Field& field,
-           const google::protobuf::Type& type) {
-  return field.cardinality() ==
-             google::protobuf::Field_Cardinality_CARDINALITY_REPEATED &&
-         (GetBoolOptionOrDefault(type.options(), "map_entry", false) ||
-          GetBoolOptionOrDefault(type.options(),
-                                 "google.protobuf.MessageOptions.map_entry", false) ||
-          GetBoolOptionOrDefault(type.options(),
-                                 "google.protobuf.MessageOptions.map_entry",
-                                 false));
-}
-
-bool IsMessageSetWireFormat(const google::protobuf::Type& type) {
-  return GetBoolOptionOrDefault(type.options(), "message_set_wire_format",
-                                false) ||
-         GetBoolOptionOrDefault(type.options(),
-                                "google.protobuf.MessageOptions.message_set_wire_format",
-                                false) ||
-         GetBoolOptionOrDefault(
-             type.options(),
-             "google.protobuf.MessageOptions.message_set_wire_format", false);
-}
-
-string DoubleAsString(double value) {
-  if (MathLimits<double>::IsPosInf(value)) return "Infinity";
-  if (MathLimits<double>::IsNegInf(value)) return "-Infinity";
-  if (MathLimits<double>::IsNaN(value)) return "NaN";
-
-  return SimpleDtoa(value);
-}
-
-string FloatAsString(float value) {
-  if (MathLimits<float>::IsFinite(value)) return SimpleFtoa(value);
-  return DoubleAsString(value);
-}
-
-bool SafeStrToFloat(StringPiece str, float* value) {
-  double double_value;
-  if (!safe_strtod(str, &double_value)) {
-    return false;
-  }
-
-  if (MathLimits<double>::IsInf(double_value) ||
-      MathLimits<double>::IsNaN(double_value))
-    return false;
-
-  // Fail if the value is not representable in float.
-  if (double_value > std::numeric_limits<float>::max() ||
-      double_value < -std::numeric_limits<float>::max()) {
-    return false;
-  }
-
-  *value = static_cast<float>(double_value);
-  return true;
-}
-
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/utility.h b/3rdparty/protobuf/src/google/protobuf/util/internal/utility.h
deleted file mode 100644 (file)
index 667e660..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_UTILITY_H__
-#define GOOGLE_PROTOBUF_UTIL_CONVERTER_UTILITY_H__
-
-#include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
-#include <string>
-#include <utility>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/type.pb.h>
-#include <google/protobuf/repeated_field.h>
-#include <google/protobuf/stubs/stringpiece.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/status.h>
-#include <google/protobuf/stubs/statusor.h>
-
-
-namespace google {
-namespace protobuf {
-class Method;
-class Any;
-class Bool;
-class Option;
-class Field;
-class Type;
-class Enum;
-class EnumValue;
-}  // namespace protobuf
-
-
-namespace protobuf {
-namespace util {
-namespace converter {
-
-// Size of "type.googleapis.com"
-static const int64 kTypeUrlSize = 19;
-
-// Finds the tech option identified by option_name. Parses the boolean value and
-// returns it.
-// When the option with the given name is not found, default_value is returned.
-LIBPROTOBUF_EXPORT bool GetBoolOptionOrDefault(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name, bool default_value);
-
-// Returns int64 option value. If the option isn't found, returns the
-// default_value.
-LIBPROTOBUF_EXPORT int64 GetInt64OptionOrDefault(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name, int64 default_value);
-
-// Returns double option value. If the option isn't found, returns the
-// default_value.
-LIBPROTOBUF_EXPORT double GetDoubleOptionOrDefault(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name, double default_value);
-
-// Returns string option value. If the option isn't found, returns the
-// default_value.
-LIBPROTOBUF_EXPORT string GetStringOptionOrDefault(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name, const string& default_value);
-
-// Returns a boolean value contained in Any type.
-// TODO(skarvaje): Make these utilities dealing with Any types more generic,
-// add more error checking and move to a more public/sharable location so others
-// can use.
-LIBPROTOBUF_EXPORT bool GetBoolFromAny(const google::protobuf::Any& any);
-
-// Returns int64 value contained in Any type.
-LIBPROTOBUF_EXPORT int64 GetInt64FromAny(const google::protobuf::Any& any);
-
-// Returns double value contained in Any type.
-LIBPROTOBUF_EXPORT double GetDoubleFromAny(const google::protobuf::Any& any);
-
-// Returns string value contained in Any type.
-LIBPROTOBUF_EXPORT string GetStringFromAny(const google::protobuf::Any& any);
-
-// Returns the type string without the url prefix. e.g.: If the passed type is
-// 'type.googleapis.com/tech.type.Bool', the returned value is 'tech.type.Bool'.
-LIBPROTOBUF_EXPORT const StringPiece GetTypeWithoutUrl(StringPiece type_url);
-
-// Returns the simple_type with the base type url (kTypeServiceBaseUrl)
-// prefixed.
-//
-// E.g:
-// GetFullTypeWithUrl("google.protobuf.Timestamp") returns the string
-// "type.googleapis.com/google.protobuf.Timestamp".
-LIBPROTOBUF_EXPORT const string GetFullTypeWithUrl(StringPiece simple_type);
-
-// Finds and returns option identified by name and option_name within the
-// provided map. Returns NULL if none found.
-const google::protobuf::Option* FindOptionOrNull(
-    const google::protobuf::RepeatedPtrField<google::protobuf::Option>& options,
-    const string& option_name);
-
-// Finds and returns the field identified by field_name in the passed tech Type
-// object. Returns NULL if none found.
-const google::protobuf::Field* FindFieldInTypeOrNull(
-    const google::protobuf::Type* type, StringPiece field_name);
-
-// Similar to FindFieldInTypeOrNull, but this looks up fields with given
-// json_name.
-const google::protobuf::Field* FindJsonFieldInTypeOrNull(
-    const google::protobuf::Type* type, StringPiece json_name);
-
-// Similar to FindFieldInTypeOrNull, but this looks up fields by number.
-const google::protobuf::Field* FindFieldInTypeByNumberOrNull(
-    const google::protobuf::Type* type, int32 number);
-
-// Finds and returns the EnumValue identified by enum_name in the passed tech
-// Enum object. Returns NULL if none found.
-const google::protobuf::EnumValue* FindEnumValueByNameOrNull(
-    const google::protobuf::Enum* enum_type, StringPiece enum_name);
-
-// Finds and returns the EnumValue identified by value in the passed tech
-// Enum object. Returns NULL if none found.
-const google::protobuf::EnumValue* FindEnumValueByNumberOrNull(
-    const google::protobuf::Enum* enum_type, int32 value);
-
-// Finds and returns the EnumValue identified by enum_name without underscore in
-// the passed tech Enum object. Returns NULL if none found.
-// For Ex. if enum_name is ACTIONANDADVENTURE it can get accepted if
-// EnumValue's name is action_and_adventure or ACTION_AND_ADVENTURE.
-const google::protobuf::EnumValue* FindEnumValueByNameWithoutUnderscoreOrNull(
-    const google::protobuf::Enum* enum_type, StringPiece enum_name);
-
-// Converts input to camel-case and returns it.
-LIBPROTOBUF_EXPORT string ToCamelCase(const StringPiece input);
-
-// Converts input to snake_case and returns it.
-LIBPROTOBUF_EXPORT string ToSnakeCase(StringPiece input);
-
-// Returns true if type_name represents a well-known type.
-LIBPROTOBUF_EXPORT bool IsWellKnownType(const string& type_name);
-
-// Returns true if 'bool_string' represents a valid boolean value. Only "true",
-// "false", "0" and "1" are allowed.
-LIBPROTOBUF_EXPORT bool IsValidBoolString(const string& bool_string);
-
-// Returns true if "field" is a protobuf map field based on its type.
-LIBPROTOBUF_EXPORT bool IsMap(const google::protobuf::Field& field,
-           const google::protobuf::Type& type);
-
-// Returns true if the given type has special MessageSet wire format.
-bool IsMessageSetWireFormat(const google::protobuf::Type& type);
-
-// Infinity/NaN-aware conversion to string.
-LIBPROTOBUF_EXPORT string DoubleAsString(double value);
-LIBPROTOBUF_EXPORT string FloatAsString(float value);
-
-// Convert from int32, int64, uint32, uint64, double or float to string.
-template <typename T>
-string ValueAsString(T value) {
-  return SimpleItoa(value);
-}
-
-template <>
-inline string ValueAsString(float value) {
-  return FloatAsString(value);
-}
-
-template <>
-inline string ValueAsString(double value) {
-  return DoubleAsString(value);
-}
-
-// Converts a string to float. Unlike safe_strtof, conversion will fail if the
-// value fits into double but not float (e.g., DBL_MAX).
-LIBPROTOBUF_EXPORT bool SafeStrToFloat(StringPiece str, float* value);
-}  // namespace converter
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_CONVERTER_UTILITY_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/json_util.cc b/3rdparty/protobuf/src/google/protobuf/util/json_util.cc
deleted file mode 100644 (file)
index ce3569c..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/json_util.h>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream.h>
-#include <google/protobuf/util/internal/default_value_objectwriter.h>
-#include <google/protobuf/util/internal/error_listener.h>
-#include <google/protobuf/util/internal/json_objectwriter.h>
-#include <google/protobuf/util/internal/json_stream_parser.h>
-#include <google/protobuf/util/internal/protostream_objectsource.h>
-#include <google/protobuf/util/internal/protostream_objectwriter.h>
-#include <google/protobuf/util/type_resolver.h>
-#include <google/protobuf/util/type_resolver_util.h>
-#include <google/protobuf/stubs/bytestream.h>
-#include <google/protobuf/stubs/status_macros.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-namespace internal {
-ZeroCopyStreamByteSink::~ZeroCopyStreamByteSink() {
-  stream_->BackUp(buffer_size_);
-}
-
-void ZeroCopyStreamByteSink::Append(const char* bytes, size_t len) {
-  while (true) {
-    if (len <= buffer_size_) {
-      memcpy(buffer_, bytes, len);
-      buffer_ = static_cast<char*>(buffer_) + len;
-      buffer_size_ -= len;
-      return;
-    }
-    if (buffer_size_ > 0) {
-      memcpy(buffer_, bytes, buffer_size_);
-      bytes += buffer_size_;
-      len -= buffer_size_;
-    }
-    if (!stream_->Next(&buffer_, &buffer_size_)) {
-      // There isn't a way for ByteSink to report errors.
-      buffer_size_ = 0;
-      return;
-    }
-  }
-}
-}  // namespace internal
-
-util::Status BinaryToJsonStream(TypeResolver* resolver,
-                                  const string& type_url,
-                                  io::ZeroCopyInputStream* binary_input,
-                                  io::ZeroCopyOutputStream* json_output,
-                                  const JsonPrintOptions& options) {
-  io::CodedInputStream in_stream(binary_input);
-  google::protobuf::Type type;
-  RETURN_IF_ERROR(resolver->ResolveMessageType(type_url, &type));
-  converter::ProtoStreamObjectSource proto_source(&in_stream, resolver, type);
-  proto_source.set_use_ints_for_enums(options.always_print_enums_as_ints);
-  proto_source.set_preserve_proto_field_names(
-      options.preserve_proto_field_names);
-  io::CodedOutputStream out_stream(json_output);
-  converter::JsonObjectWriter json_writer(options.add_whitespace ? " " : "",
-                                          &out_stream);
-  if (options.always_print_primitive_fields) {
-    converter::DefaultValueObjectWriter default_value_writer(
-        resolver, type, &json_writer);
-    default_value_writer.set_preserve_proto_field_names(
-        options.preserve_proto_field_names);
-    return proto_source.WriteTo(&default_value_writer);
-  } else {
-    return proto_source.WriteTo(&json_writer);
-  }
-}
-
-util::Status BinaryToJsonString(TypeResolver* resolver,
-                                  const string& type_url,
-                                  const string& binary_input,
-                                  string* json_output,
-                                  const JsonPrintOptions& options) {
-  io::ArrayInputStream input_stream(binary_input.data(), binary_input.size());
-  io::StringOutputStream output_stream(json_output);
-  return BinaryToJsonStream(resolver, type_url, &input_stream, &output_stream,
-                            options);
-}
-
-namespace {
-class StatusErrorListener : public converter::ErrorListener {
- public:
-  StatusErrorListener() {}
-  virtual ~StatusErrorListener() {}
-
-  util::Status GetStatus() { return status_; }
-
-  virtual void InvalidName(const converter::LocationTrackerInterface& loc,
-                           StringPiece unknown_name, StringPiece message) {
-    status_ = util::Status(util::error::INVALID_ARGUMENT,
-                             loc.ToString() + ": " + message.ToString());
-  }
-
-  virtual void InvalidValue(const converter::LocationTrackerInterface& loc,
-                            StringPiece type_name, StringPiece value) {
-    status_ =
-        util::Status(util::error::INVALID_ARGUMENT,
-                       loc.ToString() + ": invalid value " + value.ToString() +
-                           " for type " + type_name.ToString());
-  }
-
-  virtual void MissingField(const converter::LocationTrackerInterface& loc,
-                            StringPiece missing_name) {
-    status_ = util::Status(
-        util::error::INVALID_ARGUMENT,
-        loc.ToString() + ": missing field " + missing_name.ToString());
-  }
-
- private:
-  util::Status status_;
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StatusErrorListener);
-};
-}  // namespace
-
-util::Status JsonToBinaryStream(TypeResolver* resolver,
-                                  const string& type_url,
-                                  io::ZeroCopyInputStream* json_input,
-                                  io::ZeroCopyOutputStream* binary_output,
-                                  const JsonParseOptions& options) {
-  google::protobuf::Type type;
-  RETURN_IF_ERROR(resolver->ResolveMessageType(type_url, &type));
-  internal::ZeroCopyStreamByteSink sink(binary_output);
-  StatusErrorListener listener;
-  converter::ProtoStreamObjectWriter::Options proto_writer_options;
-  proto_writer_options.ignore_unknown_fields = options.ignore_unknown_fields;
-  converter::ProtoStreamObjectWriter proto_writer(resolver, type, &sink,
-                                                  &listener,
-                                                  proto_writer_options);
-
-  converter::JsonStreamParser parser(&proto_writer);
-  const void* buffer;
-  int length;
-  while (json_input->Next(&buffer, &length)) {
-    if (length == 0) continue;
-    RETURN_IF_ERROR(
-        parser.Parse(StringPiece(static_cast<const char*>(buffer), length)));
-  }
-  RETURN_IF_ERROR(parser.FinishParse());
-
-  return listener.GetStatus();
-}
-
-util::Status JsonToBinaryString(TypeResolver* resolver,
-                                  const string& type_url,
-                                  const string& json_input,
-                                  string* binary_output,
-                                  const JsonParseOptions& options) {
-  io::ArrayInputStream input_stream(json_input.data(), json_input.size());
-  io::StringOutputStream output_stream(binary_output);
-  return JsonToBinaryStream(
-      resolver, type_url, &input_stream, &output_stream, options);
-}
-
-namespace {
-const char* kTypeUrlPrefix = "type.googleapis.com";
-TypeResolver* generated_type_resolver_ = NULL;
-GOOGLE_PROTOBUF_DECLARE_ONCE(generated_type_resolver_init_);
-
-string GetTypeUrl(const Message& message) {
-  return string(kTypeUrlPrefix) + "/" + message.GetDescriptor()->full_name();
-}
-
-void DeleteGeneratedTypeResolver() { delete generated_type_resolver_; }
-
-void InitGeneratedTypeResolver() {
-  generated_type_resolver_ = NewTypeResolverForDescriptorPool(
-      kTypeUrlPrefix, DescriptorPool::generated_pool());
-  ::google::protobuf::internal::OnShutdown(&DeleteGeneratedTypeResolver);
-}
-
-TypeResolver* GetGeneratedTypeResolver() {
-  ::google::protobuf::GoogleOnceInit(&generated_type_resolver_init_, &InitGeneratedTypeResolver);
-  return generated_type_resolver_;
-}
-}  // namespace
-
-util::Status MessageToJsonString(const Message& message, string* output,
-                                   const JsonOptions& options) {
-  const DescriptorPool* pool = message.GetDescriptor()->file()->pool();
-  TypeResolver* resolver =
-      pool == DescriptorPool::generated_pool()
-          ? GetGeneratedTypeResolver()
-          : NewTypeResolverForDescriptorPool(kTypeUrlPrefix, pool);
-  util::Status result =
-      BinaryToJsonString(resolver, GetTypeUrl(message),
-                         message.SerializeAsString(), output, options);
-  if (pool != DescriptorPool::generated_pool()) {
-    delete resolver;
-  }
-  return result;
-}
-
-util::Status JsonStringToMessage(const string& input, Message* message,
-                                   const JsonParseOptions& options) {
-  const DescriptorPool* pool = message->GetDescriptor()->file()->pool();
-  TypeResolver* resolver =
-      pool == DescriptorPool::generated_pool()
-          ? GetGeneratedTypeResolver()
-          : NewTypeResolverForDescriptorPool(kTypeUrlPrefix, pool);
-  string binary;
-  util::Status result = JsonToBinaryString(
-      resolver, GetTypeUrl(*message), input, &binary, options);
-  if (result.ok() && !message->ParseFromString(binary)) {
-    result =
-        util::Status(util::error::INVALID_ARGUMENT,
-                       "JSON transcoder produced invalid protobuf output.");
-  }
-  if (pool != DescriptorPool::generated_pool()) {
-    delete resolver;
-  }
-  return result;
-}
-
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/json_util.h b/3rdparty/protobuf/src/google/protobuf/util/json_util.h
deleted file mode 100644 (file)
index dee3ddb..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Utility functions to convert between protobuf binary format and proto3 JSON
-// format.
-#ifndef GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__
-#define GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__
-
-#include <google/protobuf/message.h>
-#include <google/protobuf/util/type_resolver.h>
-#include <google/protobuf/stubs/bytestream.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-class ZeroCopyInputStream;
-class ZeroCopyOutputStream;
-}  // namespace io
-namespace util {
-
-struct JsonParseOptions {
-  // Whether to ignore unknown JSON fields during parsing
-  bool ignore_unknown_fields;
-
-  JsonParseOptions() : ignore_unknown_fields(false) {}
-};
-
-struct JsonPrintOptions {
-  // Whether to add spaces, line breaks and indentation to make the JSON output
-  // easy to read.
-  bool add_whitespace;
-  // Whether to always print primitive fields. By default primitive fields with
-  // default values will be omitted in JSON joutput. For example, an int32 field
-  // set to 0 will be omitted. Set this flag to true will override the default
-  // behavior and print primitive fields regardless of their values.
-  bool always_print_primitive_fields;
-  // Whether to always print enums as ints. By default they are rendered as
-  // strings.
-  bool always_print_enums_as_ints;
-  // Whether to preserve proto field names
-  bool preserve_proto_field_names;
-
-  JsonPrintOptions()
-      : add_whitespace(false),
-        always_print_primitive_fields(false),
-        always_print_enums_as_ints(false),
-        preserve_proto_field_names(false) {}
-};
-
-// DEPRECATED. Use JsonPrintOptions instead.
-typedef JsonPrintOptions JsonOptions;
-
-// Converts from protobuf message to JSON. This is a simple wrapper of
-// BinaryToJsonString(). It will use the DescriptorPool of the passed-in
-// message to resolve Any types.
-LIBPROTOBUF_EXPORT util::Status MessageToJsonString(const Message& message,
-                                   string* output,
-                                   const JsonOptions& options);
-
-inline util::Status MessageToJsonString(const Message& message,
-                                          string* output) {
-  return MessageToJsonString(message, output, JsonOptions());
-}
-
-// Converts from JSON to protobuf message. This is a simple wrapper of
-// JsonStringToBinary(). It will use the DescriptorPool of the passed-in
-// message to resolve Any types.
-LIBPROTOBUF_EXPORT util::Status JsonStringToMessage(const string& input,
-                                   Message* message,
-                                   const JsonParseOptions& options);
-
-inline util::Status JsonStringToMessage(const string& input,
-                                          Message* message) {
-  return JsonStringToMessage(input, message, JsonParseOptions());
-}
-
-// Converts protobuf binary data to JSON.
-// The conversion will fail if:
-//   1. TypeResolver fails to resolve a type.
-//   2. input is not valid protobuf wire format, or conflicts with the type
-//      information returned by TypeResolver.
-// Note that unknown fields will be discarded silently.
-LIBPROTOBUF_EXPORT util::Status BinaryToJsonStream(
-    TypeResolver* resolver,
-    const string& type_url,
-    io::ZeroCopyInputStream* binary_input,
-    io::ZeroCopyOutputStream* json_output,
-    const JsonPrintOptions& options);
-
-inline util::Status BinaryToJsonStream(
-    TypeResolver* resolver, const string& type_url,
-    io::ZeroCopyInputStream* binary_input,
-    io::ZeroCopyOutputStream* json_output) {
-  return BinaryToJsonStream(resolver, type_url, binary_input, json_output,
-                            JsonPrintOptions());
-}
-
-LIBPROTOBUF_EXPORT util::Status BinaryToJsonString(
-    TypeResolver* resolver,
-    const string& type_url,
-    const string& binary_input,
-    string* json_output,
-    const JsonPrintOptions& options);
-
-inline util::Status BinaryToJsonString(TypeResolver* resolver,
-                                         const string& type_url,
-                                         const string& binary_input,
-                                         string* json_output) {
-  return BinaryToJsonString(resolver, type_url, binary_input, json_output,
-                            JsonPrintOptions());
-}
-
-// Converts JSON data to protobuf binary format.
-// The conversion will fail if:
-//   1. TypeResolver fails to resolve a type.
-//   2. input is not valid JSON format, or conflicts with the type
-//      information returned by TypeResolver.
-LIBPROTOBUF_EXPORT util::Status JsonToBinaryStream(
-    TypeResolver* resolver,
-    const string& type_url,
-    io::ZeroCopyInputStream* json_input,
-    io::ZeroCopyOutputStream* binary_output,
-    const JsonParseOptions& options);
-
-inline util::Status JsonToBinaryStream(
-    TypeResolver* resolver,
-    const string& type_url,
-    io::ZeroCopyInputStream* json_input,
-    io::ZeroCopyOutputStream* binary_output) {
-  return JsonToBinaryStream(resolver, type_url, json_input, binary_output,
-                            JsonParseOptions());
-}
-
-LIBPROTOBUF_EXPORT util::Status JsonToBinaryString(
-    TypeResolver* resolver,
-    const string& type_url,
-    const string& json_input,
-    string* binary_output,
-    const JsonParseOptions& options);
-
-inline util::Status JsonToBinaryString(
-    TypeResolver* resolver,
-    const string& type_url,
-    const string& json_input,
-    string* binary_output) {
-  return JsonToBinaryString(resolver, type_url, json_input, binary_output,
-                            JsonParseOptions());
-}
-
-namespace internal {
-// Internal helper class. Put in the header so we can write unit-tests for it.
-class LIBPROTOBUF_EXPORT ZeroCopyStreamByteSink : public strings::ByteSink {
- public:
-  explicit ZeroCopyStreamByteSink(io::ZeroCopyOutputStream* stream)
-      : stream_(stream), buffer_(NULL), buffer_size_(0) {}
-  ~ZeroCopyStreamByteSink();
-
-  virtual void Append(const char* bytes, size_t len);
-
- private:
-  io::ZeroCopyOutputStream* stream_;
-  void* buffer_;
-  int buffer_size_;
-
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ZeroCopyStreamByteSink);
-};
-}  // namespace internal
-
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/message_differencer.cc b/3rdparty/protobuf/src/google/protobuf/util/message_differencer.cc
deleted file mode 100644 (file)
index e964e04..0000000
+++ /dev/null
@@ -1,1756 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: jschorr@google.com (Joseph Schorr)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-//
-// This file defines static methods and classes for comparing Protocol
-// Messages (see //google/protobuf/util/message_differencer.h for more
-// information).
-
-#include <google/protobuf/util/message_differencer.h>
-
-#include <algorithm>
-#include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
-#include <utility>
-
-#include <google/protobuf/stubs/callback.h>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/stubs/stringprintf.h>
-#include <google/protobuf/any.h>
-#include <google/protobuf/io/printer.h>
-#include <google/protobuf/io/zero_copy_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/descriptor.pb.h>
-#include <google/protobuf/dynamic_message.h>
-#include <google/protobuf/text_format.h>
-#include <google/protobuf/util/field_comparator.h>
-#include <google/protobuf/stubs/strutil.h>
-
-namespace google {
-namespace protobuf {
-
-namespace util {
-
-// When comparing a repeated field as map, MultipleFieldMapKeyComparator can
-// be used to specify multiple fields as key for key comparison.
-// Two elements of a repeated field will be regarded as having the same key
-// iff they have the same value for every specified key field.
-// Note that you can also specify only one field as key.
-class MessageDifferencer::MultipleFieldsMapKeyComparator
-    : public MessageDifferencer::MapKeyComparator {
- public:
-  MultipleFieldsMapKeyComparator(
-      MessageDifferencer* message_differencer,
-      const std::vector<std::vector<const FieldDescriptor*> >& key_field_paths)
-        : message_differencer_(message_differencer),
-          key_field_paths_(key_field_paths) {
-    GOOGLE_CHECK(!key_field_paths_.empty());
-    for (int i = 0; i < key_field_paths_.size(); ++i) {
-      GOOGLE_CHECK(!key_field_paths_[i].empty());
-    }
-  }
-  MultipleFieldsMapKeyComparator(
-      MessageDifferencer* message_differencer,
-      const FieldDescriptor* key)
-        : message_differencer_(message_differencer) {
-    std::vector<const FieldDescriptor*> key_field_path;
-    key_field_path.push_back(key);
-    key_field_paths_.push_back(key_field_path);
-  }
-  virtual bool IsMatch(
-      const Message& message1,
-      const Message& message2,
-      const std::vector<SpecificField>& parent_fields) const {
-    for (int i = 0; i < key_field_paths_.size(); ++i) {
-      if (!IsMatchInternal(message1, message2, parent_fields,
-                           key_field_paths_[i], 0)) {
-        return false;
-      }
-    }
-    return true;
-  }
- private:
-  bool IsMatchInternal(
-      const Message& message1,
-      const Message& message2,
-      const std::vector<SpecificField>& parent_fields,
-      const std::vector<const FieldDescriptor*>& key_field_path,
-      int path_index) const {
-    const FieldDescriptor* field = key_field_path[path_index];
-    std::vector<SpecificField> current_parent_fields(parent_fields);
-    if (path_index == key_field_path.size() - 1) {
-      if (field->is_repeated()) {
-        if (!message_differencer_->CompareRepeatedField(
-            message1, message2, field, &current_parent_fields)) {
-          return false;
-        }
-      } else {
-        if (!message_differencer_->CompareFieldValueUsingParentFields(
-            message1, message2, field, -1, -1, &current_parent_fields)) {
-          return false;
-        }
-      }
-      return true;
-    } else {
-      const Reflection* reflection1 = message1.GetReflection();
-      const Reflection* reflection2 = message2.GetReflection();
-      bool has_field1 = reflection1->HasField(message1, field);
-      bool has_field2 = reflection2->HasField(message2, field);
-      if (!has_field1 && !has_field2) {
-        return true;
-      }
-      if (has_field1 != has_field2) {
-        return false;
-      }
-      SpecificField specific_field;
-      specific_field.field = field;
-      current_parent_fields.push_back(specific_field);
-      return IsMatchInternal(
-          reflection1->GetMessage(message1, field),
-          reflection2->GetMessage(message2, field),
-          current_parent_fields,
-          key_field_path,
-          path_index + 1);
-    }
-  }
-  MessageDifferencer* message_differencer_;
-  std::vector<std::vector<const FieldDescriptor*> > key_field_paths_;
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MultipleFieldsMapKeyComparator);
-};
-
-MessageDifferencer::MapEntryKeyComparator::MapEntryKeyComparator(
-    MessageDifferencer* message_differencer)
-    : message_differencer_(message_differencer) {}
-
-bool MessageDifferencer::MapEntryKeyComparator::IsMatch(
-    const Message& message1, const Message& message2,
-    const std::vector<SpecificField>& parent_fields) const {
-  // Map entry has its key in the field with tag 1.  See the comment for
-  // map_entry in MessageOptions.
-  const FieldDescriptor* key = message1.GetDescriptor()->FindFieldByNumber(1);
-  // If key is not present in message1 and we're doing partial comparison or if
-  // map key is explicitly ignored treat the field as set instead,
-  const bool treat_as_set =
-      (message_differencer_->scope() == PARTIAL &&
-       !message1.GetReflection()->HasField(message1, key)) ||
-      message_differencer_->IsIgnored(message1, message2, key, parent_fields);
-
-  std::vector<SpecificField> current_parent_fields(parent_fields);
-  if (treat_as_set) {
-    return message_differencer_->Compare(message1, message2,
-                                         &current_parent_fields);
-  }
-  return message_differencer_->CompareFieldValueUsingParentFields(
-      message1, message2, key, -1, -1, &current_parent_fields);
-}
-
-bool MessageDifferencer::Equals(const Message& message1,
-                                const Message& message2) {
-  MessageDifferencer differencer;
-
-  return differencer.Compare(message1, message2);
-}
-
-bool MessageDifferencer::Equivalent(const Message& message1,
-                                    const Message& message2) {
-  MessageDifferencer differencer;
-  differencer.set_message_field_comparison(MessageDifferencer::EQUIVALENT);
-
-  return differencer.Compare(message1, message2);
-}
-
-bool MessageDifferencer::ApproximatelyEquals(const Message& message1,
-                                             const Message& message2) {
-  MessageDifferencer differencer;
-  differencer.set_float_comparison(
-      MessageDifferencer::APPROXIMATE);
-
-  return differencer.Compare(message1, message2);
-}
-
-bool MessageDifferencer::ApproximatelyEquivalent(const Message& message1,
-                                                 const Message& message2) {
-  MessageDifferencer differencer;
-  differencer.set_message_field_comparison(MessageDifferencer::EQUIVALENT);
-  differencer.set_float_comparison(MessageDifferencer::APPROXIMATE);
-
-  return differencer.Compare(message1, message2);
-}
-
-// ===========================================================================
-
-MessageDifferencer::MessageDifferencer()
-    : reporter_(NULL),
-      field_comparator_(NULL),
-      message_field_comparison_(EQUAL),
-      scope_(FULL),
-      repeated_field_comparison_(AS_LIST),
-      map_entry_key_comparator_(this),
-      report_matches_(false),
-      report_moves_(true),
-      output_string_(NULL) {}
-
-MessageDifferencer::~MessageDifferencer() {
-  for (int i = 0; i < owned_key_comparators_.size(); ++i) {
-    delete owned_key_comparators_[i];
-  }
-  for (int i = 0; i < ignore_criteria_.size(); ++i) {
-    delete ignore_criteria_[i];
-  }
-}
-
-void MessageDifferencer::set_field_comparator(FieldComparator* comparator) {
-  GOOGLE_CHECK(comparator) << "Field comparator can't be NULL.";
-  field_comparator_ = comparator;
-}
-
-void MessageDifferencer::set_message_field_comparison(
-    MessageFieldComparison comparison) {
-  message_field_comparison_ = comparison;
-}
-
-void MessageDifferencer::set_scope(Scope scope) {
-  scope_ = scope;
-}
-
-MessageDifferencer::Scope MessageDifferencer::scope() {
-  return scope_;
-}
-
-void MessageDifferencer::set_float_comparison(FloatComparison comparison) {
-  default_field_comparator_.set_float_comparison(
-      comparison == EXACT ?
-      DefaultFieldComparator::EXACT : DefaultFieldComparator::APPROXIMATE);
-}
-
-void MessageDifferencer::set_repeated_field_comparison(
-    RepeatedFieldComparison comparison) {
-  repeated_field_comparison_ = comparison;
-}
-
-void MessageDifferencer::TreatAsSet(const FieldDescriptor* field) {
-  GOOGLE_CHECK(field->is_repeated()) << "Field must be repeated: "
-                               << field->full_name();
-  const MapKeyComparator* key_comparator = GetMapKeyComparator(field);
-  GOOGLE_CHECK(key_comparator == NULL)
-      << "Cannot treat this repeated field as both Map and Set for"
-      << " comparison.  Field name is: " << field->full_name();
-  GOOGLE_CHECK(list_fields_.find(field) == list_fields_.end())
-      << "Cannot treat the same field as both SET and LIST. Field name is: "
-      << field->full_name();
-  set_fields_.insert(field);
-}
-
-void MessageDifferencer::TreatAsList(const FieldDescriptor* field) {
-  GOOGLE_CHECK(field->is_repeated()) << "Field must be repeated: "
-                              << field->full_name();
-  const MapKeyComparator* key_comparator = GetMapKeyComparator(field);
-  GOOGLE_CHECK(key_comparator == NULL)
-      << "Cannot treat this repeated field as both Map and Set for"
-      << " comparison.  Field name is: " << field->full_name();
-  GOOGLE_CHECK(set_fields_.find(field) == set_fields_.end())
-      << "Cannot treat the same field as both SET and LIST. Field name is: "
-      << field->full_name();
-  list_fields_.insert(field);
-}
-
-void MessageDifferencer::TreatAsMap(const FieldDescriptor* field,
-                                    const FieldDescriptor* key) {
-  GOOGLE_CHECK(field->is_repeated()) << "Field must be repeated: "
-                               << field->full_name();
-  GOOGLE_CHECK_EQ(FieldDescriptor::CPPTYPE_MESSAGE, field->cpp_type())
-      << "Field has to be message type.  Field name is: "
-      << field->full_name();
-  GOOGLE_CHECK(key->containing_type() == field->message_type())
-      << key->full_name()
-      << " must be a direct subfield within the repeated field "
-      << field->full_name() << ", not " << key->containing_type()->full_name();
-  GOOGLE_CHECK(set_fields_.find(field) == set_fields_.end())
-      << "Cannot treat this repeated field as both Map and Set for "
-      << "comparison.";
-  GOOGLE_CHECK(list_fields_.find(field) == list_fields_.end())
-      << "Cannot treat this repeated field as both Map and List for "
-      << "comparison.";
-  MapKeyComparator* key_comparator =
-      new MultipleFieldsMapKeyComparator(this, key);
-  owned_key_comparators_.push_back(key_comparator);
-  map_field_key_comparator_[field] = key_comparator;
-}
-
-void MessageDifferencer::TreatAsMapWithMultipleFieldsAsKey(
-    const FieldDescriptor* field,
-    const std::vector<const FieldDescriptor*>& key_fields) {
-  std::vector<std::vector<const FieldDescriptor*> > key_field_paths;
-  for (int i = 0; i < key_fields.size(); ++i) {
-    std::vector<const FieldDescriptor*> key_field_path;
-    key_field_path.push_back(key_fields[i]);
-    key_field_paths.push_back(key_field_path);
-  }
-  TreatAsMapWithMultipleFieldPathsAsKey(field, key_field_paths);
-}
-
-void MessageDifferencer::TreatAsMapWithMultipleFieldPathsAsKey(
-    const FieldDescriptor* field,
-    const std::vector<std::vector<const FieldDescriptor*> >& key_field_paths) {
-  GOOGLE_CHECK(field->is_repeated()) << "Field must be repeated: "
-                              << field->full_name();
-  GOOGLE_CHECK_EQ(FieldDescriptor::CPPTYPE_MESSAGE, field->cpp_type())
-      << "Field has to be message type.  Field name is: "
-      << field->full_name();
-  for (int i = 0; i < key_field_paths.size(); ++i) {
-    const std::vector<const FieldDescriptor*>& key_field_path =
-        key_field_paths[i];
-    for (int j = 0; j < key_field_path.size(); ++j) {
-      const FieldDescriptor* parent_field =
-          j == 0 ? field : key_field_path[j - 1];
-      const FieldDescriptor* child_field = key_field_path[j];
-      GOOGLE_CHECK(child_field->containing_type() == parent_field->message_type())
-          << child_field->full_name()
-          << " must be a direct subfield within the field: "
-          << parent_field->full_name();
-      if (j != 0) {
-        GOOGLE_CHECK_EQ(FieldDescriptor::CPPTYPE_MESSAGE, parent_field->cpp_type())
-            << parent_field->full_name() << " has to be of type message.";
-        GOOGLE_CHECK(!parent_field->is_repeated())
-            << parent_field->full_name() << " cannot be a repeated field.";
-      }
-    }
-  }
-  GOOGLE_CHECK(set_fields_.find(field) == set_fields_.end())
-      << "Cannot treat this repeated field as both Map and Set for "
-      << "comparison.";
-  MapKeyComparator* key_comparator =
-      new MultipleFieldsMapKeyComparator(this, key_field_paths);
-  owned_key_comparators_.push_back(key_comparator);
-  map_field_key_comparator_[field] = key_comparator;
-}
-
-void MessageDifferencer::TreatAsMapUsingKeyComparator(
-    const FieldDescriptor* field,
-    const MapKeyComparator* key_comparator) {
-  GOOGLE_CHECK(field->is_repeated()) << "Field must be repeated: "
-                               << field->full_name();
-  GOOGLE_CHECK_EQ(FieldDescriptor::CPPTYPE_MESSAGE, field->cpp_type())
-      << "Field has to be message type.  Field name is: "
-      << field->full_name();
-  GOOGLE_CHECK(set_fields_.find(field) == set_fields_.end())
-      << "Cannot treat this repeated field as both Map and Set for "
-      << "comparison.";
-  map_field_key_comparator_[field] = key_comparator;
-}
-
-void MessageDifferencer::AddIgnoreCriteria(IgnoreCriteria* ignore_criteria) {
-  ignore_criteria_.push_back(ignore_criteria);
-}
-
-void MessageDifferencer::IgnoreField(const FieldDescriptor* field) {
-  ignored_fields_.insert(field);
-}
-
-void MessageDifferencer::SetFractionAndMargin(const FieldDescriptor* field,
-                                              double fraction, double margin) {
-  default_field_comparator_.SetFractionAndMargin(field, fraction, margin);
-}
-
-void MessageDifferencer::ReportDifferencesToString(string* output) {
-  GOOGLE_DCHECK(output) << "Specified output string was NULL";
-
-  output_string_ = output;
-  output_string_->clear();
-}
-
-void MessageDifferencer::ReportDifferencesTo(Reporter* reporter) {
-  // If an output string is set, clear it to prevent
-  // it superceding the specified reporter.
-  if (output_string_) {
-    output_string_ = NULL;
-  }
-
-  reporter_ = reporter;
-}
-
-bool MessageDifferencer::FieldBefore(const FieldDescriptor* field1,
-                                     const FieldDescriptor* field2) {
-  // Handle sentinel values (i.e. make sure NULLs are always ordered
-  // at the end of the list).
-  if (field1 == NULL) {
-    return false;
-  }
-
-  if (field2 == NULL) {
-    return true;
-  }
-
-  // Always order fields by their tag number
-  return (field1->number() < field2->number());
-}
-
-bool MessageDifferencer::Compare(const Message& message1,
-                                 const Message& message2) {
-  std::vector<SpecificField> parent_fields;
-
-  bool result = false;
-
-  // Setup the internal reporter if need be.
-  if (output_string_) {
-    io::StringOutputStream output_stream(output_string_);
-    StreamReporter reporter(&output_stream);
-    reporter_ = &reporter;
-    result = Compare(message1, message2, &parent_fields);
-    reporter_ = NULL;
-  } else {
-    result = Compare(message1, message2, &parent_fields);
-  }
-
-  return result;
-}
-
-bool MessageDifferencer::CompareWithFields(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<const FieldDescriptor*>& message1_fields_arg,
-    const std::vector<const FieldDescriptor*>& message2_fields_arg) {
-  if (message1.GetDescriptor() != message2.GetDescriptor()) {
-    GOOGLE_LOG(DFATAL) << "Comparison between two messages with different "
-                << "descriptors.";
-    return false;
-  }
-
-  std::vector<SpecificField> parent_fields;
-
-  bool result = false;
-
-  std::vector<const FieldDescriptor*> message1_fields(message1_fields_arg);
-  std::vector<const FieldDescriptor*> message2_fields(message2_fields_arg);
-
-  std::sort(message1_fields.begin(), message1_fields.end(), FieldBefore);
-  std::sort(message2_fields.begin(), message2_fields.end(), FieldBefore);
-  // Append NULL sentinel values.
-  message1_fields.push_back(NULL);
-  message2_fields.push_back(NULL);
-
-  // Setup the internal reporter if need be.
-  if (output_string_) {
-    io::StringOutputStream output_stream(output_string_);
-    StreamReporter reporter(&output_stream);
-    reporter_ = &reporter;
-    result = CompareRequestedFieldsUsingSettings(
-        message1, message2, message1_fields, message2_fields, &parent_fields);
-    reporter_ = NULL;
-  } else {
-    result = CompareRequestedFieldsUsingSettings(
-        message1, message2, message1_fields, message2_fields, &parent_fields);
-  }
-
-  return result;
-}
-
-bool MessageDifferencer::Compare(
-    const Message& message1,
-    const Message& message2,
-    std::vector<SpecificField>* parent_fields) {
-  const Descriptor* descriptor1 = message1.GetDescriptor();
-  const Descriptor* descriptor2 = message2.GetDescriptor();
-  if (descriptor1 != descriptor2) {
-    GOOGLE_LOG(DFATAL) << "Comparison between two messages with different "
-                << "descriptors. "
-                << descriptor1->full_name() << " vs "
-                << descriptor2->full_name();
-    return false;
-  }
-  // Expand google.protobuf.Any payload if possible.
-  if (descriptor1->full_name() == internal::kAnyFullTypeName) {
-    google::protobuf::scoped_ptr<Message> data1;
-    google::protobuf::scoped_ptr<Message> data2;
-    if (UnpackAny(message1, &data1) && UnpackAny(message2, &data2)) {
-      // Avoid DFATAL for different descriptors in google.protobuf.Any payloads.
-      if (data1->GetDescriptor() != data2->GetDescriptor()) {
-        return false;
-      }
-      return Compare(*data1, *data2, parent_fields);
-    }
-  }
-  const Reflection* reflection1 = message1.GetReflection();
-  const Reflection* reflection2 = message2.GetReflection();
-
-  // Retrieve all the set fields, including extensions.
-  std::vector<const FieldDescriptor*> message1_fields;
-  message1_fields.reserve(1 + message1.GetDescriptor()->field_count());
-
-  std::vector<const FieldDescriptor*> message2_fields;
-  message2_fields.reserve(1 + message2.GetDescriptor()->field_count());
-
-  if (descriptor1->options().map_entry()) {
-    if (scope_ == PARTIAL) {
-      reflection1->ListFields(message1, &message1_fields);
-    } else {
-      // Map entry fields are always considered present.
-      for (int i = 0; i < descriptor1->field_count(); i++) {
-        message1_fields.push_back(descriptor1->field(i));
-      }
-    }
-    for (int i = 0; i < descriptor1->field_count(); i++) {
-      message2_fields.push_back(descriptor1->field(i));
-    }
-  } else {
-    reflection1->ListFields(message1, &message1_fields);
-    reflection2->ListFields(message2, &message2_fields);
-  }
-
-  // Add sentinel values to deal with the
-  // case where the number of the fields in
-  // each list are different.
-  message1_fields.push_back(NULL);
-  message2_fields.push_back(NULL);
-
-  bool unknown_compare_result = true;
-  // Ignore unknown fields in EQUIVALENT mode
-  if (message_field_comparison_ != EQUIVALENT) {
-    const google::protobuf::UnknownFieldSet* unknown_field_set1 =
-        &reflection1->GetUnknownFields(message1);
-    const google::protobuf::UnknownFieldSet* unknown_field_set2 =
-        &reflection2->GetUnknownFields(message2);
-    if (!CompareUnknownFields(message1, message2,
-                              *unknown_field_set1, *unknown_field_set2,
-                              parent_fields)) {
-      if (reporter_ == NULL) {
-        return false;
-      };
-      unknown_compare_result = false;
-    }
-  }
-
-  return CompareRequestedFieldsUsingSettings(
-      message1, message2,
-      message1_fields, message2_fields,
-      parent_fields) && unknown_compare_result;
-}
-
-bool MessageDifferencer::CompareRequestedFieldsUsingSettings(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<const FieldDescriptor*>& message1_fields,
-    const std::vector<const FieldDescriptor*>& message2_fields,
-    std::vector<SpecificField>* parent_fields) {
-  if (scope_ == FULL) {
-    if (message_field_comparison_ == EQUIVALENT) {
-      // We need to merge the field lists of both messages (i.e.
-      // we are merely checking for a difference in field values,
-      // rather than the addition or deletion of fields).
-      std::vector<const FieldDescriptor*> fields_union;
-      CombineFields(message1_fields, FULL, message2_fields, FULL,
-                    &fields_union);
-      return CompareWithFieldsInternal(message1, message2, fields_union,
-                                       fields_union, parent_fields);
-    } else {
-      // Simple equality comparison, use the unaltered field lists.
-      return CompareWithFieldsInternal(message1, message2, message1_fields,
-                                       message2_fields, parent_fields);
-    }
-  } else {
-    if (message_field_comparison_ == EQUIVALENT) {
-      // We use the list of fields for message1 for both messages when
-      // comparing.  This way, extra fields in message2 are ignored,
-      // and missing fields in message2 use their default value.
-      return CompareWithFieldsInternal(message1, message2, message1_fields,
-                                       message1_fields, parent_fields);
-    } else {
-      // We need to consider the full list of fields for message1
-      // but only the intersection for message2.  This way, any fields
-      // only present in message2 will be ignored, but any fields only
-      // present in message1 will be marked as a difference.
-      std::vector<const FieldDescriptor*> fields_intersection;
-      CombineFields(message1_fields, PARTIAL, message2_fields, PARTIAL,
-                    &fields_intersection);
-      return CompareWithFieldsInternal(message1, message2, message1_fields,
-                                       fields_intersection, parent_fields);
-    }
-  }
-}
-
-void MessageDifferencer::CombineFields(
-    const std::vector<const FieldDescriptor*>& fields1,
-    Scope fields1_scope,
-    const std::vector<const FieldDescriptor*>& fields2,
-    Scope fields2_scope,
-    std::vector<const FieldDescriptor*>* combined_fields) {
-
-  int index1 = 0;
-  int index2 = 0;
-
-  while (index1 < fields1.size() && index2 < fields2.size()) {
-    const FieldDescriptor* field1 = fields1[index1];
-    const FieldDescriptor* field2 = fields2[index2];
-
-    if (FieldBefore(field1, field2)) {
-      if (fields1_scope == FULL) {
-        combined_fields->push_back(fields1[index1]);
-      }
-      ++index1;
-    } else if (FieldBefore(field2, field1)) {
-      if (fields2_scope == FULL) {
-        combined_fields->push_back(fields2[index2]);
-      }
-      ++index2;
-    } else {
-      combined_fields->push_back(fields1[index1]);
-      ++index1;
-      ++index2;
-    }
-  }
-}
-
-bool MessageDifferencer::CompareWithFieldsInternal(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<const FieldDescriptor*>& message1_fields,
-    const std::vector<const FieldDescriptor*>& message2_fields,
-    std::vector<SpecificField>* parent_fields) {
-  bool isDifferent = false;
-  int field_index1 = 0;
-  int field_index2 = 0;
-
-  const Reflection* reflection1 = message1.GetReflection();
-  const Reflection* reflection2 = message2.GetReflection();
-
-  while (true) {
-    const FieldDescriptor* field1 = message1_fields[field_index1];
-    const FieldDescriptor* field2 = message2_fields[field_index2];
-
-    // Once we have reached sentinel values, we are done the comparison.
-    if (field1 == NULL && field2 == NULL) {
-      break;
-    }
-
-    // Check for differences in the field itself.
-    if (FieldBefore(field1, field2)) {
-      // Field 1 is not in the field list for message 2.
-      if (IsIgnored(message1, message2, field1, *parent_fields)) {
-        // We are ignoring field1. Report the ignore and move on to
-        // the next field in message1_fields.
-        if (reporter_ != NULL) {
-          SpecificField specific_field;
-          specific_field.field = field1;
-
-          parent_fields->push_back(specific_field);
-          reporter_->ReportIgnored(message1, message2, *parent_fields);
-          parent_fields->pop_back();
-        }
-        ++field_index1;
-        continue;
-      }
-
-      if (reporter_ != NULL) {
-        assert(field1 != NULL);
-        int count = field1->is_repeated() ?
-            reflection1->FieldSize(message1, field1) : 1;
-
-        for (int i = 0; i < count; ++i) {
-          SpecificField specific_field;
-          specific_field.field = field1;
-          specific_field.index = field1->is_repeated() ? i : -1;
-
-          parent_fields->push_back(specific_field);
-          reporter_->ReportDeleted(message1, message2, *parent_fields);
-          parent_fields->pop_back();
-        }
-
-        isDifferent = true;
-      } else {
-        return false;
-      }
-
-      ++field_index1;
-      continue;
-    } else if (FieldBefore(field2, field1)) {
-      // Field 2 is not in the field list for message 1.
-      if (IsIgnored(message1, message2, field2, *parent_fields)) {
-        // We are ignoring field2. Report the ignore and move on to
-        // the next field in message2_fields.
-        if (reporter_ != NULL) {
-          SpecificField specific_field;
-          specific_field.field = field2;
-
-          parent_fields->push_back(specific_field);
-          reporter_->ReportIgnored(message1, message2, *parent_fields);
-          parent_fields->pop_back();
-        }
-        ++field_index2;
-        continue;
-      }
-
-      if (reporter_ != NULL) {
-        int count = field2->is_repeated() ?
-            reflection2->FieldSize(message2, field2) : 1;
-
-        for (int i = 0; i < count; ++i) {
-          SpecificField specific_field;
-          specific_field.field = field2;
-          specific_field.index = field2->is_repeated() ? i : -1;
-          specific_field.new_index = specific_field.index;
-
-          parent_fields->push_back(specific_field);
-          reporter_->ReportAdded(message1, message2, *parent_fields);
-          parent_fields->pop_back();
-        }
-
-        isDifferent = true;
-      } else {
-        return false;
-      }
-
-      ++field_index2;
-      continue;
-    }
-
-    // By this point, field1 and field2 are guarenteed to point to the same
-    // field, so we can now compare the values.
-    if (IsIgnored(message1, message2, field1, *parent_fields)) {
-      // Ignore this field. Report and move on.
-      if (reporter_ != NULL) {
-        SpecificField specific_field;
-        specific_field.field = field1;
-
-        parent_fields->push_back(specific_field);
-        reporter_->ReportIgnored(message1, message2, *parent_fields);
-        parent_fields->pop_back();
-      }
-
-      ++field_index1;
-      ++field_index2;
-      continue;
-    }
-
-    bool fieldDifferent = false;
-    assert(field1 != NULL);
-    if (field1->is_repeated()) {
-      fieldDifferent = !CompareRepeatedField(message1, message2, field1,
-                                             parent_fields);
-      if (fieldDifferent) {
-        if (reporter_ == NULL) return false;
-        isDifferent = true;
-      }
-    } else {
-      fieldDifferent = !CompareFieldValueUsingParentFields(
-          message1, message2, field1, -1, -1, parent_fields);
-
-      // If we have found differences, either report them or terminate if
-      // no reporter is present.
-      if (fieldDifferent && reporter_ == NULL) {
-        return false;
-      }
-
-      if (reporter_ != NULL) {
-        SpecificField specific_field;
-        specific_field.field = field1;
-        parent_fields->push_back(specific_field);
-        if (fieldDifferent) {
-          reporter_->ReportModified(message1, message2, *parent_fields);
-          isDifferent = true;
-        } else if (report_matches_) {
-          reporter_->ReportMatched(message1, message2, *parent_fields);
-        }
-        parent_fields->pop_back();
-      }
-    }
-    // Increment the field indicies.
-    ++field_index1;
-    ++field_index2;
-  }
-
-  return !isDifferent;
-}
-
-bool MessageDifferencer::IsMatch(
-    const FieldDescriptor* repeated_field,
-    const MapKeyComparator* key_comparator, const Message* message1,
-    const Message* message2, const std::vector<SpecificField>& parent_fields,
-    int index1, int index2) {
-  std::vector<SpecificField> current_parent_fields(parent_fields);
-  if (repeated_field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) {
-    return CompareFieldValueUsingParentFields(
-        *message1, *message2, repeated_field, index1, index2,
-        &current_parent_fields);
-  }
-  // Back up the Reporter and output_string_.  They will be reset in the
-  // following code.
-  Reporter* backup_reporter = reporter_;
-  string* output_string = output_string_;
-  reporter_ = NULL;
-  output_string_ = NULL;
-  bool match;
-
-  if (key_comparator == NULL) {
-    match = CompareFieldValueUsingParentFields(
-        *message1, *message2, repeated_field, index1, index2,
-        &current_parent_fields);
-  } else {
-    const Reflection* reflection1 = message1->GetReflection();
-    const Reflection* reflection2 = message2->GetReflection();
-    const Message& m1 =
-        reflection1->GetRepeatedMessage(*message1, repeated_field, index1);
-    const Message& m2 =
-        reflection2->GetRepeatedMessage(*message2, repeated_field, index2);
-    SpecificField specific_field;
-    specific_field.field = repeated_field;
-    specific_field.index = index1;
-    specific_field.new_index = index2;
-    current_parent_fields.push_back(specific_field);
-    match = key_comparator->IsMatch(m1, m2, current_parent_fields);
-  }
-
-  reporter_ = backup_reporter;
-  output_string_ = output_string;
-  return match;
-}
-
-bool MessageDifferencer::CompareRepeatedField(
-    const Message& message1,
-    const Message& message2,
-    const FieldDescriptor* repeated_field,
-    std::vector<SpecificField>* parent_fields) {
-  // the input FieldDescriptor is guaranteed to be repeated field.
-  const Reflection* reflection1 = message1.GetReflection();
-  const Reflection* reflection2 = message2.GetReflection();
-  const int count1 = reflection1->FieldSize(message1, repeated_field);
-  const int count2 = reflection2->FieldSize(message2, repeated_field);
-  const bool treated_as_subset = IsTreatedAsSubset(repeated_field);
-
-  // If the field is not treated as subset and no detailed reports is needed,
-  // we do a quick check on the number of the elements to avoid unnecessary
-  // comparison.
-  if (count1 != count2 && reporter_ == NULL && !treated_as_subset) {
-    return false;
-  }
-  // A match can never be found if message1 has more items than message2.
-  if (count1 > count2 && reporter_ == NULL) {
-    return false;
-  }
-
-  // These two list are used for store the index of the correspondent
-  // element in peer repeated field.
-  std::vector<int> match_list1;
-  std::vector<int> match_list2;
-
-  // Try to match indices of the repeated fields. Return false if match fails
-  // and there's no detailed report needed.
-  if (!MatchRepeatedFieldIndices(message1, message2, repeated_field,
-                                 *parent_fields, &match_list1, &match_list2) &&
-      reporter_ == NULL) {
-    return false;
-  }
-
-  bool fieldDifferent = false;
-  SpecificField specific_field;
-  specific_field.field = repeated_field;
-
-  // At this point, we have already matched pairs of fields (with the reporting
-  // to be done later). Now to check if the paired elements are different.
-  for (int i = 0; i < count1; i++) {
-    if (match_list1[i] == -1) continue;
-    specific_field.index = i;
-    specific_field.new_index = match_list1[i];
-
-    const bool result = CompareFieldValueUsingParentFields(
-        message1, message2, repeated_field, i, specific_field.new_index,
-        parent_fields);
-
-    // If we have found differences, either report them or terminate if
-    // no reporter is present. Note that ReportModified, ReportMoved, and
-    // ReportMatched are all mutually exclusive.
-    if (!result) {
-      if (reporter_ == NULL) return false;
-      parent_fields->push_back(specific_field);
-      reporter_->ReportModified(message1, message2, *parent_fields);
-      parent_fields->pop_back();
-      fieldDifferent = true;
-    } else if (reporter_ != NULL &&
-               specific_field.index != specific_field.new_index &&
-               !specific_field.field->is_map() && report_moves_) {
-      parent_fields->push_back(specific_field);
-      reporter_->ReportMoved(message1, message2, *parent_fields);
-      parent_fields->pop_back();
-    } else if (report_matches_ && reporter_ != NULL) {
-      parent_fields->push_back(specific_field);
-      reporter_->ReportMatched(message1, message2, *parent_fields);
-      parent_fields->pop_back();
-    }
-  }
-
-  // Report any remaining additions or deletions.
-  for (int i = 0; i < count2; ++i) {
-    if (match_list2[i] != -1) continue;
-    if (!treated_as_subset) {
-      fieldDifferent = true;
-    }
-
-    if (reporter_ == NULL) continue;
-    specific_field.index = i;
-    specific_field.new_index = i;
-    parent_fields->push_back(specific_field);
-    reporter_->ReportAdded(message1, message2, *parent_fields);
-    parent_fields->pop_back();
-  }
-
-  for (int i = 0; i < count1; ++i) {
-    if (match_list1[i] != -1) continue;
-    assert(reporter_ != NULL);
-    specific_field.index = i;
-    parent_fields->push_back(specific_field);
-    reporter_->ReportDeleted(message1, message2, *parent_fields);
-    parent_fields->pop_back();
-    fieldDifferent = true;
-  }
-  return !fieldDifferent;
-}
-
-bool MessageDifferencer::CompareFieldValue(const Message& message1,
-                                           const Message& message2,
-                                           const FieldDescriptor* field,
-                                           int index1,
-                                           int index2) {
-  return CompareFieldValueUsingParentFields(message1, message2, field, index1,
-                                            index2, NULL);
-}
-
-bool MessageDifferencer::CompareFieldValueUsingParentFields(
-    const Message& message1, const Message& message2,
-    const FieldDescriptor* field, int index1, int index2,
-    std::vector<SpecificField>* parent_fields) {
-  FieldContext field_context(parent_fields);
-  FieldComparator::ComparisonResult result = GetFieldComparisonResult(
-      message1, message2, field, index1, index2, &field_context);
-
-  if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE &&
-      result == FieldComparator::RECURSE) {
-    // Get the nested messages and compare them using one of the Compare
-    // methods.
-    const Reflection* reflection1 = message1.GetReflection();
-    const Reflection* reflection2 = message2.GetReflection();
-    const Message& m1 = field->is_repeated() ?
-        reflection1->GetRepeatedMessage(message1, field, index1) :
-        reflection1->GetMessage(message1, field);
-    const Message& m2 = field->is_repeated() ?
-        reflection2->GetRepeatedMessage(message2, field, index2) :
-        reflection2->GetMessage(message2, field);
-
-    // parent_fields is used in calls to Reporter methods.
-    if (parent_fields != NULL) {
-      // Append currently compared field to the end of parent_fields.
-      SpecificField specific_field;
-      specific_field.field = field;
-      specific_field.index = index1;
-      specific_field.new_index = index2;
-      parent_fields->push_back(specific_field);
-      const bool compare_result = Compare(m1, m2, parent_fields);
-      parent_fields->pop_back();
-      return compare_result;
-    } else {
-      // Recreates parent_fields as if m1 and m2 had no parents.
-      return Compare(m1, m2);
-    }
-  } else {
-    return (result == FieldComparator::SAME);
-  }
-}
-
-bool MessageDifferencer::CheckPathChanged(
-    const std::vector<SpecificField>& field_path) {
-  for (int i = 0; i < field_path.size(); ++i) {
-    // Don't check indexes for map entries -- maps are unordered.
-    if (field_path[i].field != NULL && field_path[i].field->is_map()) continue;
-    if (field_path[i].index != field_path[i].new_index) return true;
-  }
-  return false;
-}
-
-bool MessageDifferencer::IsTreatedAsSet(const FieldDescriptor* field) {
-  if (!field->is_repeated()) return false;
-  if (repeated_field_comparison_ == AS_SET)
-    return list_fields_.find(field) == list_fields_.end();
-  return (set_fields_.find(field) != set_fields_.end());
-}
-
-bool MessageDifferencer::IsTreatedAsSubset(const FieldDescriptor* field) {
-  return scope_ == PARTIAL &&
-      (IsTreatedAsSet(field) || GetMapKeyComparator(field) != NULL);
-}
-
-bool MessageDifferencer::IsIgnored(
-    const Message& message1,
-    const Message& message2,
-    const FieldDescriptor* field,
-    const std::vector<SpecificField>& parent_fields) {
-  if (ignored_fields_.find(field) != ignored_fields_.end()) {
-    return true;
-  }
-  for (int i = 0; i < ignore_criteria_.size(); ++i) {
-    if (ignore_criteria_[i]->IsIgnored(message1, message2, field,
-                                       parent_fields)) {
-      return true;
-    }
-  }
-  return false;
-}
-
-bool MessageDifferencer::IsUnknownFieldIgnored(
-    const Message& message1, const Message& message2,
-    const SpecificField& field,
-    const std::vector<SpecificField>& parent_fields) {
-  for (int i = 0; i < ignore_criteria_.size(); ++i) {
-    if (ignore_criteria_[i]->IsUnknownFieldIgnored(message1, message2, field,
-                                                   parent_fields)) {
-      return true;
-    }
-  }
-  return false;
-}
-
-const MessageDifferencer::MapKeyComparator*
-MessageDifferencer ::GetMapKeyComparator(const FieldDescriptor* field) const {
-  if (!field->is_repeated()) return NULL;
-  FieldKeyComparatorMap::const_iterator it =
-      map_field_key_comparator_.find(field);
-  if (it != map_field_key_comparator_.end()) {
-    return it->second;
-  }
-  if (field->is_map()) {
-    // field cannot already be treated as list or set since TreatAsList() and
-    // TreatAsSet() call GetMapKeyComparator() and fail if it returns non-NULL.
-    return &map_entry_key_comparator_;
-  }
-  return NULL;
-}
-
-namespace {
-
-typedef std::pair<int, const UnknownField*> IndexUnknownFieldPair;
-
-struct UnknownFieldOrdering {
-  inline bool operator()(const IndexUnknownFieldPair& a,
-                         const IndexUnknownFieldPair& b) const {
-    if (a.second->number() < b.second->number()) return true;
-    if (a.second->number() > b.second->number()) return false;
-    return a.second->type() < b.second->type();
-  }
-};
-
-}  // namespace
-
-bool MessageDifferencer::UnpackAny(const Message& any,
-                                   google::protobuf::scoped_ptr<Message>* data) {
-  const Reflection* reflection = any.GetReflection();
-  const FieldDescriptor* type_url_field;
-  const FieldDescriptor* value_field;
-  if (!internal::GetAnyFieldDescriptors(any, &type_url_field, &value_field)) {
-    return false;
-  }
-  const string& type_url = reflection->GetString(any, type_url_field);
-  string full_type_name;
-  if (!internal::ParseAnyTypeUrl(type_url, &full_type_name)) {
-    return false;
-  }
-
-  const google::protobuf::Descriptor* desc =
-      any.GetDescriptor()->file()->pool()->FindMessageTypeByName(
-          full_type_name);
-  if (desc == NULL) {
-    GOOGLE_DLOG(ERROR) << "Proto type '" << full_type_name << "' not found";
-    return false;
-  }
-
-  if (dynamic_message_factory_ == NULL) {
-    dynamic_message_factory_.reset(new DynamicMessageFactory());
-  }
-  data->reset(dynamic_message_factory_->GetPrototype(desc)->New());
-  string serialized_value = reflection->GetString(any, value_field);
-  if (!(*data)->ParseFromString(serialized_value)) {
-    GOOGLE_DLOG(ERROR) << "Failed to parse value for " << full_type_name;
-    return false;
-  }
-  return true;
-}
-
-bool MessageDifferencer::CompareUnknownFields(
-    const Message& message1, const Message& message2,
-    const google::protobuf::UnknownFieldSet& unknown_field_set1,
-    const google::protobuf::UnknownFieldSet& unknown_field_set2,
-    std::vector<SpecificField>* parent_field) {
-  // Ignore unknown fields in EQUIVALENT mode.
-  if (message_field_comparison_ == EQUIVALENT) return true;
-
-  if (unknown_field_set1.empty() && unknown_field_set2.empty()) {
-    return true;
-  }
-
-  bool is_different = false;
-
-  // We first sort the unknown fields by field number and type (in other words,
-  // in tag order), making sure to preserve ordering of values with the same
-  // tag.  This allows us to report only meaningful differences between the
-  // two sets -- that is, differing values for the same tag.  We use
-  // IndexUnknownFieldPairs to keep track of the field's original index for
-  // reporting purposes.
-  std::vector<IndexUnknownFieldPair> fields1;  // unknown_field_set1, sorted
-  std::vector<IndexUnknownFieldPair> fields2;  // unknown_field_set2, sorted
-  fields1.reserve(unknown_field_set1.field_count());
-  fields2.reserve(unknown_field_set2.field_count());
-
-  for (int i = 0; i < unknown_field_set1.field_count(); i++) {
-    fields1.push_back(std::make_pair(i, &unknown_field_set1.field(i)));
-  }
-  for (int i = 0; i < unknown_field_set2.field_count(); i++) {
-    fields2.push_back(std::make_pair(i, &unknown_field_set2.field(i)));
-  }
-
-  UnknownFieldOrdering is_before;
-  std::stable_sort(fields1.begin(), fields1.end(), is_before);
-  std::stable_sort(fields2.begin(), fields2.end(), is_before);
-
-  // In order to fill in SpecificField::index, we have to keep track of how
-  // many values we've seen with the same field number and type.
-  // current_repeated points at the first field in this range, and
-  // current_repeated_start{1,2} are the indexes of the first field in the
-  // range within fields1 and fields2.
-  const UnknownField* current_repeated = NULL;
-  int current_repeated_start1 = 0;
-  int current_repeated_start2 = 0;
-
-  // Now that we have two sorted lists, we can detect fields which appear only
-  // in one list or the other by traversing them simultaneously.
-  int index1 = 0;
-  int index2 = 0;
-  while (index1 < fields1.size() || index2 < fields2.size()) {
-    enum { ADDITION, DELETION, MODIFICATION, COMPARE_GROUPS,
-      NO_CHANGE } change_type;
-
-    // focus_field is the field we're currently reporting on.  (In the case
-    // of a modification, it's the field on the left side.)
-    const UnknownField* focus_field;
-    bool match = false;
-
-    if (index2 == fields2.size() ||
-        (index1 < fields1.size() &&
-          is_before(fields1[index1], fields2[index2]))) {
-      // fields1[index1] is not present in fields2.
-      change_type = DELETION;
-      focus_field = fields1[index1].second;
-    } else if (index1 == fields1.size() ||
-               is_before(fields2[index2], fields1[index1])) {
-      // fields2[index2] is not present in fields1.
-      if (scope_ == PARTIAL) {
-        // Ignore.
-        ++index2;
-        continue;
-      }
-      change_type = ADDITION;
-      focus_field = fields2[index2].second;
-    } else {
-      // Field type and number are the same.  See if the values differ.
-      change_type = MODIFICATION;
-      focus_field = fields1[index1].second;
-
-      switch (focus_field->type()) {
-        case UnknownField::TYPE_VARINT:
-          match = fields1[index1].second->varint() ==
-                  fields2[index2].second->varint();
-          break;
-        case UnknownField::TYPE_FIXED32:
-          match = fields1[index1].second->fixed32() ==
-                  fields2[index2].second->fixed32();
-          break;
-        case UnknownField::TYPE_FIXED64:
-          match = fields1[index1].second->fixed64() ==
-                  fields2[index2].second->fixed64();
-          break;
-        case UnknownField::TYPE_LENGTH_DELIMITED:
-          match = fields1[index1].second->length_delimited() ==
-                  fields2[index2].second->length_delimited();
-          break;
-        case UnknownField::TYPE_GROUP:
-          // We must deal with this later, after building the SpecificField.
-          change_type = COMPARE_GROUPS;
-          break;
-      }
-      if (match && change_type != COMPARE_GROUPS) {
-        change_type = NO_CHANGE;
-      }
-    }
-
-    if (current_repeated == NULL ||
-        focus_field->number() != current_repeated->number() ||
-        focus_field->type() != current_repeated->type()) {
-      // We've started a new repeated field.
-      current_repeated = focus_field;
-      current_repeated_start1 = index1;
-      current_repeated_start2 = index2;
-    }
-
-    if (change_type == NO_CHANGE && reporter_ == NULL) {
-      // Fields were already compared and matched and we have no reporter.
-      ++index1;
-      ++index2;
-      continue;
-    }
-
-    // Build the SpecificField.  This is slightly complicated.
-    SpecificField specific_field;
-    specific_field.unknown_field_number = focus_field->number();
-    specific_field.unknown_field_type = focus_field->type();
-
-    specific_field.unknown_field_set1 = &unknown_field_set1;
-    specific_field.unknown_field_set2 = &unknown_field_set2;
-
-    if (change_type != ADDITION) {
-      specific_field.unknown_field_index1 = fields1[index1].first;
-    }
-    if (change_type != DELETION) {
-      specific_field.unknown_field_index2 = fields2[index2].first;
-    }
-
-    // Calculate the field index.
-    if (change_type == ADDITION) {
-      specific_field.index = index2 - current_repeated_start2;
-      specific_field.new_index = index2 - current_repeated_start2;
-    } else {
-      specific_field.index = index1 - current_repeated_start1;
-      specific_field.new_index = index2 - current_repeated_start2;
-    }
-
-    if (IsUnknownFieldIgnored(message1, message2, specific_field,
-                              *parent_field)) {
-      if (reporter_ != NULL) {
-        parent_field->push_back(specific_field);
-        reporter_->ReportUnknownFieldIgnored(message1, message2, *parent_field);
-        parent_field->pop_back();
-      }
-      return true;
-    }
-
-    if (change_type == ADDITION || change_type == DELETION ||
-        change_type == MODIFICATION) {
-      if (reporter_ == NULL) {
-        // We found a difference and we have no reproter.
-        return false;
-      }
-      is_different = true;
-    }
-
-    parent_field->push_back(specific_field);
-
-    switch (change_type) {
-      case ADDITION:
-        reporter_->ReportAdded(message1, message2, *parent_field);
-        ++index2;
-        break;
-      case DELETION:
-        reporter_->ReportDeleted(message1, message2, *parent_field);
-        ++index1;
-        break;
-      case MODIFICATION:
-        reporter_->ReportModified(message1, message2, *parent_field);
-        ++index1;
-        ++index2;
-        break;
-      case COMPARE_GROUPS:
-        if (!CompareUnknownFields(message1, message2,
-                                  fields1[index1].second->group(),
-                                  fields2[index2].second->group(),
-                                  parent_field)) {
-          if (reporter_ == NULL) return false;
-          is_different = true;
-          reporter_->ReportModified(message1, message2, *parent_field);
-        }
-        ++index1;
-        ++index2;
-        break;
-      case NO_CHANGE:
-        ++index1;
-        ++index2;
-        if (report_matches_) {
-          reporter_->ReportMatched(message1, message2, *parent_field);
-        }
-    }
-
-    parent_field->pop_back();
-  }
-
-  return !is_different;
-}
-
-namespace {
-
-// Find maximum bipartite matching using the argumenting path algorithm.
-class MaximumMatcher {
- public:
-  typedef ResultCallback2<bool, int, int> NodeMatchCallback;
-  // MaximumMatcher takes ownership of the passed in callback and uses it to
-  // determine whether a node on the left side of the bipartial graph matches
-  // a node on the right side. count1 is the number of nodes on the left side
-  // of the graph and count2 to is the number of nodes on the right side.
-  // Every node is referred to using 0-based indices.
-  // If a maximum match is found, the result will be stored in match_list1 and
-  // match_list2. match_list1[i] == j means the i-th node on the left side is
-  // matched to the j-th node on the right side and match_list2[x] == y means
-  // the x-th node on the right side is matched to y-th node on the left side.
-  // match_list1[i] == -1 means the node is not matched. Same with match_list2.
-  MaximumMatcher(int count1, int count2, NodeMatchCallback* callback,
-                 std::vector<int>* match_list1, std::vector<int>* match_list2);
-  // Find a maximum match and return the number of matched node pairs.
-  // If early_return is true, this method will return 0 immediately when it
-  // finds that not all nodes on the left side can be matched.
-  int FindMaximumMatch(bool early_return);
- private:
-  // Determines whether the node on the left side of the bipartial graph
-  // matches the one on the right side.
-  bool Match(int left, int right);
-  // Find an argumenting path starting from the node v on the left side. If a
-  // path can be found, update match_list2_ to reflect the path and return
-  // true.
-  bool FindArgumentPathDFS(int v, std::vector<bool>* visited);
-
-  int count1_;
-  int count2_;
-  google::protobuf::scoped_ptr<NodeMatchCallback> match_callback_;
-  std::map<std::pair<int, int>, bool> cached_match_results_;
-  std::vector<int>* match_list1_;
-  std::vector<int>* match_list2_;
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MaximumMatcher);
-};
-
-MaximumMatcher::MaximumMatcher(int count1, int count2,
-                               NodeMatchCallback* callback,
-                               std::vector<int>* match_list1,
-                               std::vector<int>* match_list2)
-    : count1_(count1), count2_(count2), match_callback_(callback),
-      match_list1_(match_list1), match_list2_(match_list2) {
-  match_list1_->assign(count1, -1);
-  match_list2_->assign(count2, -1);
-}
-
-int MaximumMatcher::FindMaximumMatch(bool early_return) {
-  int result = 0;
-  for (int i = 0; i < count1_; ++i) {
-    std::vector<bool> visited(count1_);
-    if (FindArgumentPathDFS(i, &visited)) {
-      ++result;
-    } else if (early_return) {
-      return 0;
-    }
-  }
-  // Backfill match_list1_ as we only filled match_list2_ when finding
-  // argumenting pathes.
-  for (int i = 0; i < count2_; ++i) {
-    if ((*match_list2_)[i] != -1) {
-      (*match_list1_)[(*match_list2_)[i]] = i;
-    }
-  }
-  return result;
-}
-
-bool MaximumMatcher::Match(int left, int right) {
-  std::pair<int, int> p(left, right);
-  std::map<std::pair<int, int>, bool>::iterator it =
-      cached_match_results_.find(p);
-  if (it != cached_match_results_.end()) {
-    return it->second;
-  }
-  cached_match_results_[p] = match_callback_->Run(left, right);
-  return cached_match_results_[p];
-}
-
-bool MaximumMatcher::FindArgumentPathDFS(int v, std::vector<bool>* visited) {
-  (*visited)[v] = true;
-  // We try to match those un-matched nodes on the right side first. This is
-  // the step that the navie greedy matching algorithm uses. In the best cases
-  // where the greedy algorithm can find a maximum matching, we will always
-  // find a match in this step and the performance will be identical to the
-  // greedy algorithm.
-  for (int i = 0; i < count2_; ++i) {
-    int matched = (*match_list2_)[i];
-    if (matched == -1 && Match(v, i)) {
-      (*match_list2_)[i] = v;
-      return true;
-    }
-  }
-  // Then we try those already matched nodes and see if we can find an
-  // alternaive match for the node matched to them.
-  // The greedy algorithm will stop before this and fail to produce the
-  // correct result.
-  for (int i = 0; i < count2_; ++i) {
-    int matched = (*match_list2_)[i];
-    if (matched != -1 && Match(v, i)) {
-      if (!(*visited)[matched] && FindArgumentPathDFS(matched, visited)) {
-        (*match_list2_)[i] = v;
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-}  // namespace
-
-bool MessageDifferencer::MatchRepeatedFieldIndices(
-    const Message& message1,
-    const Message& message2,
-    const FieldDescriptor* repeated_field,
-    const std::vector<SpecificField>& parent_fields,
-    std::vector<int>* match_list1,
-    std::vector<int>* match_list2) {
-  const int count1 =
-      message1.GetReflection()->FieldSize(message1, repeated_field);
-  const int count2 =
-      message2.GetReflection()->FieldSize(message2, repeated_field);
-  const MapKeyComparator* key_comparator = GetMapKeyComparator(repeated_field);
-
-  match_list1->assign(count1, -1);
-  match_list2->assign(count2, -1);
-
-  bool success = true;
-  // Find potential match if this is a special repeated field.
-  if (key_comparator != NULL || IsTreatedAsSet(repeated_field)) {
-    if (scope_ == PARTIAL) {
-      // When partial matching is enabled, Compare(a, b) && Compare(a, c)
-      // doesn't necessarily imply Compare(b, c). Therefore a naive greedy
-      // algorithm will fail to find a maximum matching.
-      // Here we use the argumenting path algorithm.
-      MaximumMatcher::NodeMatchCallback* callback =
-          ::google::protobuf::NewPermanentCallback(
-              this, &MessageDifferencer::IsMatch,
-              repeated_field, key_comparator,
-              &message1, &message2, parent_fields);
-      MaximumMatcher matcher(count1, count2, callback, match_list1,
-                             match_list2);
-      // If diff info is not needed, we should end the matching process as
-      // soon as possible if not all items can be matched.
-      bool early_return = (reporter_ == NULL);
-      int match_count = matcher.FindMaximumMatch(early_return);
-      if (match_count != count1 && reporter_ == NULL) return false;
-      success = success && (match_count == count1);
-    } else {
-      for (int i = 0; i < count1; ++i) {
-        // Indicates any matched elements for this repeated field.
-        bool match = false;
-
-        for (int j = 0; j < count2; j++) {
-          if (match_list2->at(j) != -1) continue;
-
-          match = IsMatch(repeated_field, key_comparator,
-                          &message1, &message2, parent_fields, i, j);
-
-          if (match) {
-            match_list1->at(i) = j;
-            match_list2->at(j) = i;
-            break;
-          }
-        }
-        if (!match && reporter_ == NULL) return false;
-        success = success && match;
-      }
-    }
-  } else {
-    // If this field should be treated as list, just label the match_list.
-    for (int i = 0; i < count1 && i < count2; i++) {
-      match_list1->at(i) = i;
-      match_list2->at(i) = i;
-    }
-  }
-
-  return success;
-}
-
-FieldComparator::ComparisonResult MessageDifferencer::GetFieldComparisonResult(
-    const Message& message1, const Message& message2,
-    const FieldDescriptor* field, int index1, int index2,
-    const FieldContext* field_context) {
-  FieldComparator* comparator = field_comparator_ != NULL ?
-      field_comparator_ : &default_field_comparator_;
-  return comparator->Compare(message1, message2, field,
-                             index1, index2, field_context);
-}
-
-// ===========================================================================
-
-MessageDifferencer::Reporter::Reporter() { }
-MessageDifferencer::Reporter::~Reporter() {}
-
-// ===========================================================================
-
-MessageDifferencer::MapKeyComparator::MapKeyComparator() {}
-MessageDifferencer::MapKeyComparator::~MapKeyComparator() {}
-
-// ===========================================================================
-
-MessageDifferencer::IgnoreCriteria::IgnoreCriteria() {}
-MessageDifferencer::IgnoreCriteria::~IgnoreCriteria() {}
-
-// ===========================================================================
-
-// Note that the printer's delimiter is not used, because if we are given a
-// printer, we don't know its delimiter.
-MessageDifferencer::StreamReporter::StreamReporter(
-    io::ZeroCopyOutputStream* output) : printer_(new io::Printer(output, '$')),
-                                        delete_printer_(true),
-                                        report_modified_aggregates_(false) { }
-
-MessageDifferencer::StreamReporter::StreamReporter(
-    io::Printer* printer) : printer_(printer),
-                            delete_printer_(false),
-                            report_modified_aggregates_(false) { }
-
-MessageDifferencer::StreamReporter::~StreamReporter() {
-  if (delete_printer_) delete printer_;
-}
-
-void MessageDifferencer::StreamReporter::PrintPath(
-    const std::vector<SpecificField>& field_path, bool left_side) {
-  for (int i = 0; i < field_path.size(); ++i) {
-    if (i > 0) {
-      printer_->Print(".");
-    }
-
-    SpecificField specific_field = field_path[i];
-
-    if (specific_field.field != NULL) {
-      if (specific_field.field->is_extension()) {
-        printer_->Print("($name$)", "name",
-                        specific_field.field->full_name());
-      } else {
-        printer_->PrintRaw(specific_field.field->name());
-      }
-      if (specific_field.field->is_map()) {
-        // Don't print index in a map field; they are semantically unordered.
-        continue;
-      }
-    } else {
-      printer_->PrintRaw(SimpleItoa(specific_field.unknown_field_number));
-    }
-    if (left_side && specific_field.index >= 0) {
-      printer_->Print("[$name$]", "name", SimpleItoa(specific_field.index));
-    }
-    if (!left_side && specific_field.new_index >= 0) {
-      printer_->Print("[$name$]", "name", SimpleItoa(specific_field.new_index));
-    }
-  }
-}
-
-void MessageDifferencer::StreamReporter::PrintPath(
-    const std::vector<SpecificField>& field_path, bool left_side,
-    const Message& message) {
-  PrintPath(field_path, left_side);
-}
-
-void MessageDifferencer::
-StreamReporter::PrintValue(const Message& message,
-                           const std::vector<SpecificField>& field_path,
-                           bool left_side) {
-  const SpecificField& specific_field = field_path.back();
-  const FieldDescriptor* field = specific_field.field;
-  if (field != NULL) {
-    string output;
-    int index = left_side ? specific_field.index : specific_field.new_index;
-    if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
-      const Reflection* reflection = message.GetReflection();
-      const Message& field_message = field->is_repeated() ?
-          reflection->GetRepeatedMessage(message, field, index) :
-          reflection->GetMessage(message, field);
-      output = field_message.ShortDebugString();
-      if (output.empty()) {
-        printer_->Print("{ }");
-      } else {
-        printer_->Print("{ $name$ }", "name", output);
-      }
-    } else {
-      TextFormat::PrintFieldValueToString(message, field, index, &output);
-      printer_->PrintRaw(output);
-    }
-  } else {
-    const UnknownFieldSet* unknown_fields =
-        (left_side ?
-         specific_field.unknown_field_set1 :
-         specific_field.unknown_field_set2);
-    const UnknownField* unknown_field = &unknown_fields->field(
-        left_side ?
-        specific_field.unknown_field_index1 :
-        specific_field.unknown_field_index2);
-    PrintUnknownFieldValue(unknown_field);
-  }
-}
-
-void MessageDifferencer::
-StreamReporter::PrintUnknownFieldValue(const UnknownField* unknown_field) {
-  GOOGLE_CHECK(unknown_field != NULL) << " Cannot print NULL unknown_field.";
-
-  string output;
-  switch (unknown_field->type()) {
-    case UnknownField::TYPE_VARINT:
-      output = SimpleItoa(unknown_field->varint());
-      break;
-    case UnknownField::TYPE_FIXED32:
-      output = StrCat("0x", strings::Hex(unknown_field->fixed32(),
-                                         strings::ZERO_PAD_8));
-      break;
-    case UnknownField::TYPE_FIXED64:
-      output = StrCat("0x", strings::Hex(unknown_field->fixed64(),
-                                         strings::ZERO_PAD_16));
-      break;
-    case UnknownField::TYPE_LENGTH_DELIMITED:
-      output = StringPrintf("\"%s\"",
-          CEscape(unknown_field->length_delimited()).c_str());
-      break;
-    case UnknownField::TYPE_GROUP:
-      // TODO(kenton):  Print the contents of the group like we do for
-      //   messages.  Requires an equivalent of ShortDebugString() for
-      //   UnknownFieldSet.
-      output = "{ ... }";
-      break;
-  }
-  printer_->PrintRaw(output);
-}
-
-void MessageDifferencer::StreamReporter::Print(const string& str) {
-  printer_->Print(str.c_str());
-}
-
-void MessageDifferencer::StreamReporter::ReportAdded(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<SpecificField>& field_path) {
-  printer_->Print("added: ");
-  PrintPath(field_path, false, message2);
-  printer_->Print(": ");
-  PrintValue(message2, field_path, false);
-  printer_->Print("\n");  // Print for newlines.
-}
-
-void MessageDifferencer::StreamReporter::ReportDeleted(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<SpecificField>& field_path) {
-  printer_->Print("deleted: ");
-  PrintPath(field_path, true, message1);
-  printer_->Print(": ");
-  PrintValue(message1, field_path, true);
-  printer_->Print("\n");  // Print for newlines
-}
-
-void MessageDifferencer::StreamReporter::ReportModified(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<SpecificField>& field_path) {
-  if (!report_modified_aggregates_ && field_path.back().field == NULL) {
-    if (field_path.back().unknown_field_type == UnknownField::TYPE_GROUP) {
-      // Any changes to the subfields have already been printed.
-      return;
-    }
-  } else if (!report_modified_aggregates_) {
-    if (field_path.back().field->cpp_type() ==
-        FieldDescriptor::CPPTYPE_MESSAGE) {
-      // Any changes to the subfields have already been printed.
-      return;
-    }
-  }
-
-  printer_->Print("modified: ");
-  PrintPath(field_path, true, message1);
-  if (CheckPathChanged(field_path)) {
-    printer_->Print(" -> ");
-    PrintPath(field_path, false, message2);
-  }
-  printer_->Print(": ");
-  PrintValue(message1, field_path, true);
-  printer_->Print(" -> ");
-  PrintValue(message2, field_path, false);
-  printer_->Print("\n");  // Print for newlines.
-}
-
-void MessageDifferencer::StreamReporter::ReportMoved(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<SpecificField>& field_path) {
-  printer_->Print("moved: ");
-  PrintPath(field_path, true, message1);
-  printer_->Print(" -> ");
-  PrintPath(field_path, false, message2);
-  printer_->Print(" : ");
-  PrintValue(message1, field_path, true);
-  printer_->Print("\n");  // Print for newlines.
-}
-
-void MessageDifferencer::StreamReporter::ReportMatched(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<SpecificField>& field_path) {
-  printer_->Print("matched: ");
-  PrintPath(field_path, true, message1);
-  if (CheckPathChanged(field_path)) {
-    printer_->Print(" -> ");
-    PrintPath(field_path, false, message2);
-  }
-  printer_->Print(" : ");
-  PrintValue(message1, field_path, true);
-  printer_->Print("\n");  // Print for newlines.
-}
-
-void MessageDifferencer::StreamReporter::ReportIgnored(
-    const Message& message1,
-    const Message& message2,
-    const std::vector<SpecificField>& field_path) {
-  printer_->Print("ignored: ");
-  PrintPath(field_path, true, message1);
-  if (CheckPathChanged(field_path)) {
-    printer_->Print(" -> ");
-    PrintPath(field_path, false, message2);
-  }
-  printer_->Print("\n");  // Print for newlines.
-}
-
-void MessageDifferencer::StreamReporter::ReportUnknownFieldIgnored(
-    const Message& message1, const Message& message2,
-    const std::vector<SpecificField>& field_path) {
-  printer_->Print("ignored: ");
-  PrintPath(field_path, true, message1);
-  if (CheckPathChanged(field_path)) {
-    printer_->Print(" -> ");
-    PrintPath(field_path, false, message2);
-  }
-  printer_->Print("\n");  // Print for newlines.
-}
-
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/message_differencer.h b/3rdparty/protobuf/src/google/protobuf/util/message_differencer.h
deleted file mode 100644 (file)
index b7d4de0..0000000
+++ /dev/null
@@ -1,879 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: jschorr@google.com (Joseph Schorr)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-//
-// This file defines static methods and classes for comparing Protocol
-// Messages.
-//
-// Aug. 2008: Added Unknown Fields Comparison for messages.
-// Aug. 2009: Added different options to compare repeated fields.
-// Apr. 2010: Moved field comparison to FieldComparator.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__
-#define GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__
-
-#include <map>
-#include <set>
-#include <string>
-#include <vector>
-#include <google/protobuf/descriptor.h>  // FieldDescriptor
-#include <google/protobuf/message.h>  // Message
-#include <google/protobuf/unknown_field_set.h>
-#include <google/protobuf/util/field_comparator.h>
-
-namespace google {
-namespace protobuf {
-
-class DynamicMessageFactory;
-class FieldDescriptor;
-
-namespace io {
-class ZeroCopyOutputStream;
-class Printer;
-}
-
-namespace util {
-
-class FieldContext;  // declared below MessageDifferencer
-
-// A basic differencer that can be used to determine
-// the differences between two specified Protocol Messages. If any differences
-// are found, the Compare method will return false, and any differencer reporter
-// specified via ReportDifferencesTo will have its reporting methods called (see
-// below for implementation of the report). Based off of the original
-// ProtocolDifferencer implementation in //net/proto/protocol-differencer.h
-// (Thanks Todd!).
-//
-// MessageDifferencer REQUIRES that compared messages be the same type, defined
-// as messages that share the same descriptor.  If not, the behavior of this
-// class is undefined.
-//
-// People disagree on what MessageDifferencer should do when asked to compare
-// messages with different descriptors.  Some people think it should always
-// return false.  Others expect it to try to look for similar fields and
-// compare them anyway -- especially if the descriptors happen to be identical.
-// If we chose either of these behaviors, some set of people would find it
-// surprising, and could end up writing code expecting the other behavior
-// without realizing their error.  Therefore, we forbid that usage.
-//
-// This class is implemented based on the proto2 reflection. The performance
-// should be good enough for normal usages. However, for places where the
-// performance is extremely sensitive, there are several alternatives:
-// - Comparing serialized string
-// Downside: false negatives (there are messages that are the same but their
-// serialized strings are different).
-// - Equals code generator by compiler plugin (net/proto2/contrib/equals_plugin)
-// Downside: more generated code; maintenance overhead for the additional rule
-// (must be in sync with the original proto_library).
-//
-// Note on handling of google.protobuf.Any: MessageDifferencer automatically
-// unpacks Any::value into a Message and compares its individual fields.
-// Messages encoded in a repeated Any cannot be compared using TreatAsMap.
-//
-//
-// Note on thread-safety: MessageDifferencer is *not* thread-safe. You need to
-// guard it with a lock to use the same MessageDifferencer instance from
-// multiple threads. Note that it's fine to call static comparison methods
-// (like MessageDifferencer::Equals) concurrently.
-class LIBPROTOBUF_EXPORT MessageDifferencer {
- public:
-  // Determines whether the supplied messages are equal. Equality is defined as
-  // all fields within the two messages being set to the same value. Primitive
-  // fields and strings are compared by value while embedded messages/groups
-  // are compared as if via a recursive call. Use IgnoreField() and Compare()
-  // if some fields should be ignored in the comparison.
-  //
-  // This method REQUIRES that the two messages have the same
-  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).
-  static bool Equals(const Message& message1, const Message& message2);
-
-  // Determines whether the supplied messages are equivalent. Equivalency is
-  // defined as all fields within the two messages having the same value. This
-  // differs from the Equals method above in that fields with default values
-  // are considered set to said value automatically. For details on how default
-  // values are defined for each field type, see http://shortn/_x2Gv6XFrWt.
-  // Also, Equivalent() ignores unknown fields. Use IgnoreField() and Compare()
-  // if some fields should be ignored in the comparison.
-  //
-  // This method REQUIRES that the two messages have the same
-  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).
-  static bool Equivalent(const Message& message1, const Message& message2);
-
-  // Determines whether the supplied messages are approximately equal.
-  // Approximate equality is defined as all fields within the two messages
-  // being approximately equal.  Primitive (non-float) fields and strings are
-  // compared by value, floats are compared using MathUtil::AlmostEquals() and
-  // embedded messages/groups are compared as if via a recursive call. Use
-  // IgnoreField() and Compare() if some fields should be ignored in the
-  // comparison.
-  //
-  // This method REQUIRES that the two messages have the same
-  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).
-  static bool ApproximatelyEquals(const Message& message1,
-                                  const Message& message2);
-
-  // Determines whether the supplied messages are approximately equivalent.
-  // Approximate equivalency is defined as all fields within the two messages
-  // being approximately equivalent. As in
-  // MessageDifferencer::ApproximatelyEquals, primitive (non-float) fields and
-  // strings are compared by value, floats are compared using
-  // MathUtil::AlmostEquals() and embedded messages/groups are compared as if
-  // via a recursive call. However, fields with default values are considered
-  // set to said value, as per MessageDiffencer::Equivalent. Use IgnoreField()
-  // and Compare() if some fields should be ignored in the comparison.
-  //
-  // This method REQUIRES that the two messages have the same
-  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).
-  static bool ApproximatelyEquivalent(const Message& message1,
-                                      const Message& message2);
-
-  // Identifies an individual field in a message instance.  Used for field_path,
-  // below.
-  struct SpecificField {
-    // For known fields, "field" is filled in and "unknown_field_number" is -1.
-    // For unknown fields, "field" is NULL, "unknown_field_number" is the field
-    // number, and "unknown_field_type" is its type.
-    const FieldDescriptor* field;
-    int unknown_field_number;
-    UnknownField::Type unknown_field_type;
-
-    // If this a repeated field, "index" is the index within it.  For unknown
-    // fields, this is the index of the field among all unknown fields of the
-    // same field number and type.
-    int index;
-
-    // If "field" is a repeated field which is being treated as a map or
-    // a set (see TreatAsMap() and TreatAsSet(), below), new_index indicates
-    // the index the position to which the element has moved.  This only
-    // applies to ReportMoved() and (in the case of TreatAsMap())
-    // ReportModified().  In all other cases, "new_index" will have the same
-    // value as "index".
-    int new_index;
-
-    // For unknown fields, these are the pointers to the UnknownFieldSet
-    // containing the unknown fields. In certain cases (e.g. proto1's
-    // MessageSet, or nested groups of unknown fields), these may differ from
-    // the messages' internal UnknownFieldSets.
-    const UnknownFieldSet* unknown_field_set1;
-    const UnknownFieldSet* unknown_field_set2;
-
-    // For unknown fields, these are the index of the field within the
-    // UnknownFieldSets. One or the other will be -1 when
-    // reporting an addition or deletion.
-    int unknown_field_index1;
-    int unknown_field_index2;
-
-    SpecificField()
-        : field(NULL),
-          unknown_field_number(-1),
-          index(-1),
-          new_index(-1),
-          unknown_field_set1(NULL),
-          unknown_field_set2(NULL),
-          unknown_field_index1(-1),
-          unknown_field_index2(-1) {}
-  };
-
-  // Abstract base class from which all MessageDifferencer
-  // reporters derive. The five Report* methods below will be called when
-  // a field has been added, deleted, modified, moved, or matched. The third
-  // argument is a vector of FieldDescriptor pointers which describes the chain
-  // of fields that was taken to find the current field. For example, for a
-  // field found in an embedded message, the vector will contain two
-  // FieldDescriptors. The first will be the field of the embedded message
-  // itself and the second will be the actual field in the embedded message
-  // that was added/deleted/modified.
-  class LIBPROTOBUF_EXPORT Reporter {
-   public:
-    Reporter();
-    virtual ~Reporter();
-
-    // Reports that a field has been added into Message2.
-    virtual void ReportAdded(
-        const Message& message1, const Message& message2,
-        const std::vector<SpecificField>& field_path) = 0;
-
-    // Reports that a field has been deleted from Message1.
-    virtual void ReportDeleted(
-        const Message& message1,
-        const Message& message2,
-        const std::vector<SpecificField>& field_path) = 0;
-
-    // Reports that the value of a field has been modified.
-    virtual void ReportModified(
-        const Message& message1,
-        const Message& message2,
-        const std::vector<SpecificField>& field_path) = 0;
-
-    // Reports that a repeated field has been moved to another location.  This
-    // only applies when using TreatAsSet or TreatAsMap()  -- see below. Also
-    // note that for any given field, ReportModified and ReportMoved are
-    // mutually exclusive. If a field has been both moved and modified, then
-    // only ReportModified will be called.
-    virtual void ReportMoved(
-        const Message& /* message1 */,
-        const Message& /* message2 */,
-        const std::vector<SpecificField>& /* field_path */) { }
-
-    // Reports that two fields match. Useful for doing side-by-side diffs.
-    // This function is mutually exclusive with ReportModified and ReportMoved.
-    // Note that you must call set_report_matches(true) before calling Compare
-    // to make use of this function.
-    virtual void ReportMatched(
-        const Message& /* message1 */,
-        const Message& /* message2 */,
-        const std::vector<SpecificField>& /* field_path */) { }
-
-    // Reports that two fields would have been compared, but the
-    // comparison has been skipped because the field was marked as
-    // 'ignored' using IgnoreField().  This function is mutually
-    // exclusive with all the other Report() functions.
-    //
-    // The contract of ReportIgnored is slightly different than the
-    // other Report() functions, in that |field_path.back().index| is
-    // always equal to -1, even if the last field is repeated. This is
-    // because while the other Report() functions indicate where in a
-    // repeated field the action (Addition, Deletion, etc...)
-    // happened, when a repeated field is 'ignored', the differencer
-    // simply calls ReportIgnored on the repeated field as a whole and
-    // moves on without looking at its individual elements.
-    //
-    // Furthermore, ReportIgnored() does not indicate whether the
-    // fields were in fact equal or not, as Compare() does not inspect
-    // these fields at all. It is up to the Reporter to decide whether
-    // the fields are equal or not (perhaps with a second call to
-    // Compare()), if it cares.
-    virtual void ReportIgnored(
-        const Message& /* message1 */,
-        const Message& /* message2 */,
-        const std::vector<SpecificField>& /* field_path */) { }
-
-    // Report that an unknown field is ignored. (see comment above).
-    // Note this is a different function since the last SpecificField in field
-    // path has a null field.  This could break existing Reporter.
-    virtual void ReportUnknownFieldIgnored(
-        const Message& /* message1 */, const Message& /* message2 */,
-        const std::vector<SpecificField>& /* field_path */) {}
-
-   private:
-    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Reporter);
-  };
-
-  // MapKeyComparator is used to determine if two elements have the same key
-  // when comparing elements of a repeated field as a map.
-  class LIBPROTOBUF_EXPORT MapKeyComparator {
-   public:
-    MapKeyComparator();
-    virtual ~MapKeyComparator();
-
-    virtual bool IsMatch(
-        const Message& /* message1 */,
-        const Message& /* message2 */,
-        const std::vector<SpecificField>& /* parent_fields */) const {
-      GOOGLE_CHECK(false) << "IsMatch() is not implemented.";
-      return false;
-    }
-
-   private:
-    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapKeyComparator);
-  };
-
-  // Abstract base class from which all IgnoreCriteria derive.
-  // By adding IgnoreCriteria more complex ignore logic can be implemented.
-  // IgnoreCriteria are registed with AddIgnoreCriteria. For each compared
-  // field IsIgnored is called on each added IgnoreCriteria until one returns
-  // true or all return false.
-  // IsIgnored is called for fields where at least one side has a value.
-  class LIBPROTOBUF_EXPORT IgnoreCriteria {
-   public:
-    IgnoreCriteria();
-    virtual ~IgnoreCriteria();
-
-    // Returns true if the field should be ignored.
-    virtual bool IsIgnored(
-        const Message& /* message1 */,
-        const Message& /* message2 */,
-        const FieldDescriptor* /* field */,
-        const std::vector<SpecificField>& /* parent_fields */) = 0;
-
-    // Returns true if the unknown field should be ignored.
-    // Note: This will be called for unknown fields as well in which case
-    //       field.field will be null.
-    virtual bool IsUnknownFieldIgnored(
-        const Message& /* message1 */, const Message& /* message2 */,
-        const SpecificField& /* field */,
-        const std::vector<SpecificField>& /* parent_fields */) {
-      return false;
-    }
-  };
-
-  // To add a Reporter, construct default here, then use ReportDifferencesTo or
-  // ReportDifferencesToString.
-  explicit MessageDifferencer();
-
-  ~MessageDifferencer();
-
-  enum MessageFieldComparison {
-    EQUAL,       // Fields must be present in both messages
-                 // for the messages to be considered the same.
-    EQUIVALENT,  // Fields with default values are considered set
-                 // for comparison purposes even if not explicitly
-                 // set in the messages themselves.  Unknown fields
-                 // are ignored.
-  };
-
-  enum Scope {
-    FULL,    // All fields of both messages are considered in the comparison.
-    PARTIAL  // Only fields present in the first message are considered; fields
-             // set only in the second message will be skipped during
-             // comparison.
-  };
-
-  // DEPRECATED. Use FieldComparator::FloatComparison instead.
-  enum FloatComparison {
-    EXACT,       // Floats and doubles are compared exactly.
-    APPROXIMATE  // Floats and doubles are compared using the
-                 // MathUtil::AlmostEquals method.
-  };
-
-  enum RepeatedFieldComparison {
-    AS_LIST,     // Repeated fields are compared in order.  Differing values at
-                 // the same index are reported using ReportModified().  If the
-                 // repeated fields have different numbers of elements, the
-                 // unpaired elements are reported using ReportAdded() or
-                 // ReportDeleted().
-    AS_SET,      // Treat all the repeated fields as sets by default.
-                 // See TreatAsSet(), as below.
-  };
-
-  // The elements of the given repeated field will be treated as a set for
-  // diffing purposes, so different orderings of the same elements will be
-  // considered equal.  Elements which are present on both sides of the
-  // comparison but which have changed position will be reported with
-  // ReportMoved().  Elements which only exist on one side or the other are
-  // reported with ReportAdded() and ReportDeleted() regardless of their
-  // positions.  ReportModified() is never used for this repeated field.  If
-  // the only differences between the compared messages is that some fields
-  // have been moved, then the comparison returns true.
-  //
-  // If the scope of comparison is set to PARTIAL, then in addition to what's
-  // above, extra values added to repeated fields of the second message will
-  // not cause the comparison to fail.
-  //
-  // Note that set comparison is currently O(k * n^2) (where n is the total
-  // number of elements, and k is the average size of each element). In theory
-  // it could be made O(n * k) with a more complex hashing implementation. Feel
-  // free to contribute one if the current implementation is too slow for you.
-  // If partial matching is also enabled, the time complexity will be O(k * n^2
-  // + n^3) in which n^3 is the time complexity of the maximum matching
-  // algorithm.
-  //
-  // REQUIRES:  field->is_repeated() and field not registered with TreatAsList
-  void TreatAsSet(const FieldDescriptor* field);
-
-  // The elements of the given repeated field will be treated as a list for
-  // diffing purposes, so different orderings of the same elements will NOT be
-  // considered equal.
-  //
-  // REQUIRED: field->is_repeated() and field not registered with TreatAsSet
-  void TreatAsList(const FieldDescriptor* field);
-
-  // The elements of the given repeated field will be treated as a map for
-  // diffing purposes, with |key| being the map key.  Thus, elements with the
-  // same key will be compared even if they do not appear at the same index.
-  // Differences are reported similarly to TreatAsSet(), except that
-  // ReportModified() is used to report elements with the same key but
-  // different values.  Note that if an element is both moved and modified,
-  // only ReportModified() will be called.  As with TreatAsSet, if the only
-  // differences between the compared messages is that some fields have been
-  // moved, then the comparison returns true. See TreatAsSet for notes on
-  // performance.
-  //
-  // REQUIRES:  field->is_repeated()
-  // REQUIRES:  field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE
-  // REQUIRES:  key->containing_type() == field->message_type()
-  void TreatAsMap(const FieldDescriptor* field, const FieldDescriptor* key);
-  // Same as TreatAsMap except that this method will use multiple fields as
-  // the key in comparison. All specified fields in 'key_fields' should be
-  // present in the compared elements. Two elements will be treated as having
-  // the same key iff they have the same value for every specified field. There
-  // are two steps in the comparison process. The first one is key matching.
-  // Every element from one message will be compared to every element from
-  // the other message. Only fields in 'key_fields' are compared in this step
-  // to decide if two elements have the same key. The second step is value
-  // comparison. Those pairs of elements with the same key (with equal value
-  // for every field in 'key_fields') will be compared in this step.
-  // Time complexity of the first step is O(s * m * n ^ 2) where s is the
-  // average size of the fields specified in 'key_fields', m is the number of
-  // fields in 'key_fields' and n is the number of elements. If partial
-  // matching is enabled, an extra O(n^3) will be incured by the maximum
-  // matching algorithm. The second step is O(k * n) where k is the average
-  // size of each element.
-  void TreatAsMapWithMultipleFieldsAsKey(
-      const FieldDescriptor* field,
-      const std::vector<const FieldDescriptor*>& key_fields);
-  // Same as TreatAsMapWithMultipleFieldsAsKey, except that each of the field
-  // do not necessarily need to be a direct subfield. Each element in
-  // key_field_paths indicate a path from the message being compared, listing
-  // successive subfield to reach the key field.
-  //
-  // REQUIRES:
-  //   for key_field_path in key_field_paths:
-  //     key_field_path[0]->containing_type() == field->message_type()
-  //     for i in [0, key_field_path.size() - 1):
-  //       key_field_path[i+1]->containing_type() ==
-  //           key_field_path[i]->message_type()
-  //       key_field_path[i]->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE
-  //       !key_field_path[i]->is_repeated()
-  void TreatAsMapWithMultipleFieldPathsAsKey(
-      const FieldDescriptor* field,
-      const std::vector<std::vector<const FieldDescriptor*> >& key_field_paths);
-
-  // Uses a custom MapKeyComparator to determine if two elements have the same
-  // key when comparing a repeated field as a map.
-  // The caller is responsible to delete the key_comparator.
-  // This method varies from TreatAsMapWithMultipleFieldsAsKey only in the
-  // first key matching step. Rather than comparing some specified fields, it
-  // will invoke the IsMatch method of the given 'key_comparator' to decide if
-  // two elements have the same key.
-  void TreatAsMapUsingKeyComparator(
-      const FieldDescriptor* field,
-      const MapKeyComparator* key_comparator);
-
-  // Add a custom ignore criteria that is evaluated in addition to the
-  // ignored fields added with IgnoreField.
-  // Takes ownership of ignore_criteria.
-  void AddIgnoreCriteria(IgnoreCriteria* ignore_criteria);
-
-  // Indicates that any field with the given descriptor should be
-  // ignored for the purposes of comparing two messages. This applies
-  // to fields nested in the message structure as well as top level
-  // ones. When the MessageDifferencer encounters an ignored field,
-  // ReportIgnored is called on the reporter, if one is specified.
-  //
-  // The only place where the field's 'ignored' status is not applied is when
-  // it is being used as a key in a field passed to TreatAsMap or is one of
-  // the fields passed to TreatAsMapWithMultipleFieldsAsKey.
-  // In this case it is compared in key matching but after that it's ignored
-  // in value comparison.
-  void IgnoreField(const FieldDescriptor* field);
-
-  // Sets the field comparator used to determine differences between protocol
-  // buffer fields. By default it's set to a DefaultFieldComparator instance.
-  // MessageDifferencer doesn't take ownership over the passed object.
-  // Note that this method must be called before Compare for the comparator to
-  // be used.
-  void set_field_comparator(FieldComparator* comparator);
-
-  // DEPRECATED. Pass a DefaultFieldComparator instance instead.
-  // Sets the fraction and margin for the float comparison of a given field.
-  // Uses MathUtil::WithinFractionOrMargin to compare the values.
-  // NOTE: this method does nothing if differencer's field comparator has been
-  //       set to a custom object.
-  //
-  // REQUIRES: field->cpp_type == FieldDescriptor::CPPTYPE_DOUBLE or
-  //           field->cpp_type == FieldDescriptor::CPPTYPE_FLOAT
-  // REQUIRES: float_comparison_ == APPROXIMATE
-  void SetFractionAndMargin(const FieldDescriptor* field, double fraction,
-                            double margin);
-
-  // Sets the type of comparison (as defined in the MessageFieldComparison
-  // enumeration above) that is used by this differencer when determining how
-  // to compare fields in messages.
-  void set_message_field_comparison(MessageFieldComparison comparison);
-
-  // Tells the differencer whether or not to report matches. This method must
-  // be called before Compare. The default for a new differencer is false.
-  void set_report_matches(bool report_matches) {
-    report_matches_ = report_matches;
-  }
-
-  // Tells the differencer whether or not to report moves (in a set or map
-  // repeated field). This method must be called before Compare. The default for
-  // a new differencer is true.
-  void set_report_moves(bool report_moves) {
-    report_moves_ = report_moves;
-  }
-
-  // Sets the scope of the comparison (as defined in the Scope enumeration
-  // above) that is used by this differencer when determining which fields to
-  // compare between the messages.
-  void set_scope(Scope scope);
-
-  // Returns the current scope used by this differencer.
-  Scope scope();
-
-  // DEPRECATED. Pass a DefaultFieldComparator instance instead.
-  // Sets the type of comparison (as defined in the FloatComparison enumeration
-  // above) that is used by this differencer when comparing float (and double)
-  // fields in messages.
-  // NOTE: this method does nothing if differencer's field comparator has been
-  //       set to a custom object.
-  void set_float_comparison(FloatComparison comparison);
-
-  // Sets the type of comparison for repeated field (as defined in the
-  // RepeatedFieldComparison enumeration above) that is used by this
-  // differencer when compare repeated fields in messages.
-  void set_repeated_field_comparison(RepeatedFieldComparison comparison);
-
-  // Compares the two specified messages, returning true if they are the same,
-  // false otherwise. If this method returns false, any changes between the
-  // two messages will be reported if a Reporter was specified via
-  // ReportDifferencesTo (see also ReportDifferencesToString).
-  //
-  // This method REQUIRES that the two messages have the same
-  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).
-  bool Compare(const Message& message1, const Message& message2);
-
-  // Same as above, except comparing only the list of fields specified by the
-  // two vectors of FieldDescriptors.
-  bool CompareWithFields(
-      const Message& message1, const Message& message2,
-      const std::vector<const FieldDescriptor*>& message1_fields,
-      const std::vector<const FieldDescriptor*>& message2_fields);
-
-  // Automatically creates a reporter that will output the differences
-  // found (if any) to the specified output string pointer. Note that this
-  // method must be called before Compare.
-  void ReportDifferencesToString(string* output);
-
-  // Tells the MessageDifferencer to report differences via the specified
-  // reporter. Note that this method must be called before Compare for
-  // the reporter to be used. It is the responsibility of the caller to delete
-  // this object.
-  // If the provided pointer equals NULL, the MessageDifferencer stops reporting
-  // differences to any previously set reporters or output strings.
-  void ReportDifferencesTo(Reporter* reporter);
-
-  // An implementation of the MessageDifferencer Reporter that outputs
-  // any differences found in human-readable form to the supplied
-  // ZeroCopyOutputStream or Printer. If a printer is used, the delimiter
-  // *must* be '$'.
-  //
-  // WARNING: this reporter does not necessarily flush its output until it is
-  // destroyed. As a result, it is not safe to assume the output is valid or
-  // complete until after you destroy the reporter. For example, if you use a
-  // StreamReporter to write to a StringOutputStream, the target string may
-  // contain uninitialized data until the reporter is destroyed.
-  class LIBPROTOBUF_EXPORT StreamReporter : public Reporter {
-   public:
-    explicit StreamReporter(io::ZeroCopyOutputStream* output);
-    explicit StreamReporter(io::Printer* printer);  // delimiter '$'
-    virtual ~StreamReporter();
-
-    // When set to true, the stream reporter will also output aggregates nodes
-    // (i.e. messages and groups) whose subfields have been modified. When
-    // false, will only report the individual subfields. Defaults to false.
-    void set_report_modified_aggregates(bool report) {
-      report_modified_aggregates_ = report;
-    }
-
-    // The following are implementations of the methods described above.
-    virtual void ReportAdded(const Message& message1, const Message& message2,
-                             const std::vector<SpecificField>& field_path);
-
-    virtual void ReportDeleted(const Message& message1,
-                               const Message& message2,
-                               const std::vector<SpecificField>& field_path);
-
-    virtual void ReportModified(const Message& message1,
-                                const Message& message2,
-                                const std::vector<SpecificField>& field_path);
-
-    virtual void ReportMoved(const Message& message1,
-                             const Message& message2,
-                             const std::vector<SpecificField>& field_path);
-
-    virtual void ReportMatched(const Message& message1,
-                               const Message& message2,
-                               const std::vector<SpecificField>& field_path);
-
-    virtual void ReportIgnored(const Message& message1,
-                               const Message& message2,
-                               const std::vector<SpecificField>& field_path);
-
-    virtual void ReportUnknownFieldIgnored(
-        const Message& message1, const Message& message2,
-        const std::vector<SpecificField>& field_path);
-
-   protected:
-    // Prints the specified path of fields to the buffer.  message is used to
-    // print map keys.
-    virtual void PrintPath(const std::vector<SpecificField>& field_path,
-                           bool left_side, const Message& message);
-
-    // Prints the specified path of fields to the buffer.
-    virtual void PrintPath(const std::vector<SpecificField>& field_path,
-                           bool left_side);
-
-    // Prints the value of fields to the buffer.  left_side is true if the
-    // given message is from the left side of the comparison, false if it
-    // was the right.  This is relevant only to decide whether to follow
-    // unknown_field_index1 or unknown_field_index2 when an unknown field
-    // is encountered in field_path.
-    virtual void PrintValue(const Message& message,
-                            const std::vector<SpecificField>& field_path,
-                            bool left_side);
-
-    // Prints the specified path of unknown fields to the buffer.
-    virtual void PrintUnknownFieldValue(const UnknownField* unknown_field);
-
-    // Just print a string
-    void Print(const string& str);
-
-   private:
-    io::Printer* printer_;
-    bool delete_printer_;
-    bool report_modified_aggregates_;
-
-    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StreamReporter);
-  };
-
- private:
-  // A MapKeyComparator to be used in TreatAsMapUsingKeyComparator.
-  // Implementation of this class needs to do field value comparison which
-  // relies on some private methods of MessageDifferencer. That's why this
-  // class is declared as a nested class of MessageDifferencer.
-  class MultipleFieldsMapKeyComparator;
-
-  // A MapKeyComparator for use with map_entries.
-  class LIBPROTOBUF_EXPORT MapEntryKeyComparator : public MapKeyComparator {
-   public:
-    explicit MapEntryKeyComparator(MessageDifferencer* message_differencer);
-    virtual bool IsMatch(const Message& message1, const Message& message2,
-                         const std::vector<SpecificField>& parent_fields) const;
-
-   private:
-    MessageDifferencer* message_differencer_;
-  };
-
-  // Returns true if field1's number() is less than field2's.
-  static bool FieldBefore(const FieldDescriptor* field1,
-                          const FieldDescriptor* field2);
-
-  // Combine the two lists of fields into the combined_fields output vector.
-  // All fields present in both lists will always be included in the combined
-  // list.  Fields only present in one of the lists will only appear in the
-  // combined list if the corresponding fields_scope option is set to FULL.
-  void CombineFields(const std::vector<const FieldDescriptor*>& fields1,
-                     Scope fields1_scope,
-                     const std::vector<const FieldDescriptor*>& fields2,
-                     Scope fields2_scope,
-                     std::vector<const FieldDescriptor*>* combined_fields);
-
-  // Internal version of the Compare method which performs the actual
-  // comparison. The parent_fields vector is a vector containing field
-  // descriptors of all fields accessed to get to this comparison operation
-  // (i.e. if the current message is an embedded message, the parent_fields
-  // vector will contain the field that has this embedded message).
-  bool Compare(const Message& message1, const Message& message2,
-               std::vector<SpecificField>* parent_fields);
-
-  // Compares all the unknown fields in two messages.
-  bool CompareUnknownFields(const Message& message1, const Message& message2,
-                            const google::protobuf::UnknownFieldSet&,
-                            const google::protobuf::UnknownFieldSet&,
-                            std::vector<SpecificField>* parent_fields);
-
-  // Compares the specified messages for the requested field lists. The field
-  // lists are modified depending on comparison settings, and then passed to
-  // CompareWithFieldsInternal.
-  bool CompareRequestedFieldsUsingSettings(
-      const Message& message1, const Message& message2,
-      const std::vector<const FieldDescriptor*>& message1_fields,
-      const std::vector<const FieldDescriptor*>& message2_fields,
-      std::vector<SpecificField>* parent_fields);
-
-  // Compares the specified messages with the specified field lists.
-  bool CompareWithFieldsInternal(
-      const Message& message1, const Message& message2,
-      const std::vector<const FieldDescriptor*>& message1_fields,
-      const std::vector<const FieldDescriptor*>& message2_fields,
-      std::vector<SpecificField>* parent_fields);
-
-  // Compares the repeated fields, and report the error.
-  bool CompareRepeatedField(const Message& message1, const Message& message2,
-                            const FieldDescriptor* field,
-                            std::vector<SpecificField>* parent_fields);
-
-  // Shorthand for CompareFieldValueUsingParentFields with NULL parent_fields.
-  bool CompareFieldValue(const Message& message1,
-                         const Message& message2,
-                         const FieldDescriptor* field,
-                         int index1,
-                         int index2);
-
-  // Compares the specified field on the two messages, returning
-  // true if they are the same, false otherwise. For repeated fields,
-  // this method only compares the value in the specified index. This method
-  // uses Compare functions to recurse into submessages.
-  // The parent_fields vector is used in calls to a Reporter instance calls.
-  // It can be NULL, in which case the MessageDifferencer will create new
-  // list of parent messages if it needs to recursively compare the given field.
-  // To avoid confusing users you should not set it to NULL unless you modified
-  // Reporter to handle the change of parent_fields correctly.
-  bool CompareFieldValueUsingParentFields(
-      const Message& message1,
-      const Message& message2,
-      const FieldDescriptor* field,
-      int index1,
-      int index2,
-      std::vector<SpecificField>* parent_fields);
-
-  // Compares the specified field on the two messages, returning comparison
-  // result, as returned by appropriate FieldComparator.
-  FieldComparator::ComparisonResult GetFieldComparisonResult(
-      const Message& message1, const Message& message2,
-      const FieldDescriptor* field, int index1, int index2,
-      const FieldContext* field_context);
-
-  // Check if the two elements in the repeated field are match to each other.
-  // if the key_comprator is NULL, this function returns true when the two
-  // elements are equal.
-  bool IsMatch(const FieldDescriptor* repeated_field,
-               const MapKeyComparator* key_comparator,
-               const Message* message1, const Message* message2,
-               const std::vector<SpecificField>& parent_fields,
-               int index1, int index2);
-
-  // Returns true when this repeated field has been configured to be treated
-  // as a set.
-  bool IsTreatedAsSet(const FieldDescriptor* field);
-
-  // Returns true when this repeated field is to be compared as a subset, ie.
-  // has been configured to be treated as a set or map and scope is set to
-  // PARTIAL.
-  bool IsTreatedAsSubset(const FieldDescriptor* field);
-
-  // Returns true if this field is to be ignored when this
-  // MessageDifferencer compares messages.
-  bool IsIgnored(
-      const Message& message1,
-      const Message& message2,
-      const FieldDescriptor* field,
-      const std::vector<SpecificField>& parent_fields);
-
-  // Returns true if this unknown field is to be ignored when this
-  // MessageDifferencer compares messages.
-  bool IsUnknownFieldIgnored(const Message& message1, const Message& message2,
-                             const SpecificField& field,
-                             const std::vector<SpecificField>& parent_fields);
-
-  // Returns MapKeyComparator* when this field has been configured to be treated
-  // as a map or its is_map() return true.  If not, returns NULL.
-  const MapKeyComparator* GetMapKeyComparator(
-      const FieldDescriptor* field) const;
-
-  // Attempts to match indices of a repeated field, so that the contained values
-  // match. Clears output vectors and sets their values to indices of paired
-  // messages, ie. if message1[0] matches message2[1], then match_list1[0] == 1
-  // and match_list2[1] == 0. The unmatched indices are indicated by -1.
-  // This method returns false if the match failed. However, it doesn't mean
-  // that the comparison succeeds when this method returns true (you need to
-  // double-check in this case).
-  bool MatchRepeatedFieldIndices(
-      const Message& message1,
-      const Message& message2,
-      const FieldDescriptor* repeated_field,
-      const std::vector<SpecificField>& parent_fields,
-      std::vector<int>* match_list1,
-      std::vector<int>* match_list2);
-
-  // If "any" is of type google.protobuf.Any, extract its payload using
-  // DynamicMessageFactory and store in "data".
-  bool UnpackAny(const Message& any, google::protobuf::scoped_ptr<Message>* data);
-
-  // Checks if index is equal to new_index in all the specific fields.
-  static bool CheckPathChanged(const std::vector<SpecificField>& parent_fields);
-
-  // Defines a map between field descriptors and their MapKeyComparators.
-  // Used for repeated fields when they are configured as TreatAsMap.
-  typedef std::map<const FieldDescriptor*,
-              const MapKeyComparator*> FieldKeyComparatorMap;
-
-  // Defines a set to store field descriptors.  Used for repeated fields when
-  // they are configured as TreatAsSet.
-  typedef std::set<const FieldDescriptor*> FieldSet;
-
-  Reporter* reporter_;
-  DefaultFieldComparator default_field_comparator_;
-  FieldComparator* field_comparator_;
-  MessageFieldComparison message_field_comparison_;
-  Scope scope_;
-  RepeatedFieldComparison repeated_field_comparison_;
-
-  FieldSet set_fields_;
-  FieldSet list_fields_;
-  // Keeps track of MapKeyComparators that are created within
-  // MessageDifferencer. These MapKeyComparators should be deleted
-  // before MessageDifferencer is destroyed.
-  // When TreatAsMap or TreatAsMapWithMultipleFieldsAsKey is called, we don't
-  // store the supplied FieldDescriptors directly. Instead, a new
-  // MapKeyComparator is created for comparison purpose.
-  std::vector<MapKeyComparator*> owned_key_comparators_;
-  FieldKeyComparatorMap map_field_key_comparator_;
-  MapEntryKeyComparator map_entry_key_comparator_;
-  std::vector<IgnoreCriteria*> ignore_criteria_;
-
-  FieldSet ignored_fields_;
-
-  bool report_matches_;
-  bool report_moves_;
-
-  string* output_string_;
-
-  google::protobuf::scoped_ptr<DynamicMessageFactory> dynamic_message_factory_;
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageDifferencer);
-};
-
-// This class provides extra information to the FieldComparator::Compare
-// function.
-class LIBPROTOBUF_EXPORT FieldContext {
- public:
-  explicit FieldContext(
-      std::vector<MessageDifferencer::SpecificField>* parent_fields)
-      : parent_fields_(parent_fields) {}
-
-  std::vector<MessageDifferencer::SpecificField>* parent_fields() const {
-    return parent_fields_;
-  }
-
- private:
-  std::vector<MessageDifferencer::SpecificField>* parent_fields_;
-};
-
-}
-}
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/package_info.h b/3rdparty/protobuf/src/google/protobuf/util/package_info.h
deleted file mode 100644 (file)
index e37e6dc..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This file exists solely to document the google::protobuf::util namespace.
-// It is not compiled into anything, but it may be read by an automated
-// documentation generator.
-
-namespace google {
-
-namespace protobuf {
-
-// Utility classes.
-//
-// This package contains various utilities for message comprasion, JSON
-// conversion, well known types, etc.
-namespace util {}
-
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/time_util.cc b/3rdparty/protobuf/src/google/protobuf/util/time_util.cc
deleted file mode 100644 (file)
index 46a6f5a..0000000
+++ /dev/null
@@ -1,504 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/time_util.h>
-
-#include <google/protobuf/stubs/time.h>
-#include <google/protobuf/stubs/int128.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/stringprintf.h>
-#include <google/protobuf/duration.pb.h>
-#include <google/protobuf/timestamp.pb.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-using google::protobuf::Timestamp;
-using google::protobuf::Duration;
-
-namespace {
-static const int kNanosPerSecond = 1000000000;
-static const int kMicrosPerSecond = 1000000;
-static const int kMillisPerSecond = 1000;
-static const int kNanosPerMillisecond = 1000000;
-static const int kNanosPerMicrosecond = 1000;
-static const int kSecondsPerMinute = 60;  // Note that we ignore leap seconds.
-static const int kSecondsPerHour = 3600;
-
-template <typename T>
-T CreateNormalized(int64 seconds, int64 nanos);
-
-template <>
-Timestamp CreateNormalized(int64 seconds, int64 nanos) {
-  // Make sure nanos is in the range.
-  if (nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) {
-    seconds += nanos / kNanosPerSecond;
-    nanos = nanos % kNanosPerSecond;
-  }
-  // For Timestamp nanos should be in the range [0, 999999999]
-  if (nanos < 0) {
-    seconds -= 1;
-    nanos += kNanosPerSecond;
-  }
-  GOOGLE_DCHECK(seconds >= TimeUtil::kTimestampMinSeconds &&
-         seconds <= TimeUtil::kTimestampMaxSeconds);
-  Timestamp result;
-  result.set_seconds(seconds);
-  result.set_nanos(static_cast<int32>(nanos));
-  return result;
-}
-
-template <>
-Duration CreateNormalized(int64 seconds, int64 nanos) {
-  // Make sure nanos is in the range.
-  if (nanos <= -kNanosPerSecond || nanos >= kNanosPerSecond) {
-    seconds += nanos / kNanosPerSecond;
-    nanos = nanos % kNanosPerSecond;
-  }
-  // nanos should have the same sign as seconds.
-  if (seconds < 0 && nanos > 0) {
-    seconds += 1;
-    nanos -= kNanosPerSecond;
-  } else if (seconds > 0 && nanos < 0) {
-    seconds -= 1;
-    nanos += kNanosPerSecond;
-  }
-  GOOGLE_DCHECK(seconds >= TimeUtil::kDurationMinSeconds &&
-         seconds <= TimeUtil::kDurationMaxSeconds);
-  Duration result;
-  result.set_seconds(seconds);
-  result.set_nanos(static_cast<int32>(nanos));
-  return result;
-}
-
-// Format nanoseconds with either 3, 6, or 9 digits depending on the required
-// precision to represent the exact value.
-string FormatNanos(int32 nanos) {
-  if (nanos % kNanosPerMillisecond == 0) {
-    return StringPrintf("%03d", nanos / kNanosPerMillisecond);
-  } else if (nanos % kNanosPerMicrosecond == 0) {
-    return StringPrintf("%06d", nanos / kNanosPerMicrosecond);
-  } else {
-    return StringPrintf("%09d", nanos);
-  }
-}
-
-string FormatTime(int64 seconds, int32 nanos) {
-  return ::google::protobuf::internal::FormatTime(seconds, nanos);
-}
-
-bool ParseTime(const string& value, int64* seconds, int32* nanos) {
-  return ::google::protobuf::internal::ParseTime(value, seconds, nanos);
-}
-
-void CurrentTime(int64* seconds, int32* nanos) {
-  return ::google::protobuf::internal::GetCurrentTime(seconds, nanos);
-}
-
-// Truncates the remainder part after division.
-int64 RoundTowardZero(int64 value, int64 divider) {
-  int64 result = value / divider;
-  int64 remainder = value % divider;
-  // Before C++11, the sign of the remainder is implementation dependent if
-  // any of the operands is negative. Here we try to enforce C++11's "rounded
-  // toward zero" semantics. For example, for (-5) / 2 an implementation may
-  // give -3 as the result with the remainder being 1. This function ensures
-  // we always return -2 (closer to zero) regardless of the implementation.
-  if (result < 0 && remainder > 0) {
-    return result + 1;
-  } else {
-    return result;
-  }
-}
-}  // namespace
-
-// Actually define these static const integers. Required by C++ standard (but
-// some compilers don't like it).
-#ifndef _MSC_VER
-const int64 TimeUtil::kTimestampMinSeconds;
-const int64 TimeUtil::kTimestampMaxSeconds;
-const int64 TimeUtil::kDurationMaxSeconds;
-const int64 TimeUtil::kDurationMinSeconds;
-#endif  // !_MSC_VER
-
-string TimeUtil::ToString(const Timestamp& timestamp) {
-  return FormatTime(timestamp.seconds(), timestamp.nanos());
-}
-
-bool TimeUtil::FromString(const string& value, Timestamp* timestamp) {
-  int64 seconds;
-  int32 nanos;
-  if (!ParseTime(value, &seconds, &nanos)) {
-    return false;
-  }
-  *timestamp = CreateNormalized<Timestamp>(seconds, nanos);
-  return true;
-}
-
-Timestamp TimeUtil::GetCurrentTime() {
-  int64 seconds;
-  int32 nanos;
-  CurrentTime(&seconds, &nanos);
-  return CreateNormalized<Timestamp>(seconds, nanos);
-}
-
-Timestamp TimeUtil::GetEpoch() { return Timestamp(); }
-
-string TimeUtil::ToString(const Duration& duration) {
-  string result;
-  int64 seconds = duration.seconds();
-  int32 nanos = duration.nanos();
-  if (seconds < 0 || nanos < 0) {
-    result += "-";
-    seconds = -seconds;
-    nanos = -nanos;
-  }
-  result += SimpleItoa(seconds);
-  if (nanos != 0) {
-    result += "." + FormatNanos(nanos);
-  }
-  result += "s";
-  return result;
-}
-
-static int64 Pow(int64 x, int y) {
-  int64 result = 1;
-  for (int i = 0; i < y; ++i) {
-    result *= x;
-  }
-  return result;
-}
-
-bool TimeUtil::FromString(const string& value, Duration* duration) {
-  if (value.length() <= 1 || value[value.length() - 1] != 's') {
-    return false;
-  }
-  bool negative = (value[0] == '-');
-  int sign_length = (negative ? 1 : 0);
-  // Parse the duration value as two integers rather than a float value
-  // to avoid precision loss.
-  string seconds_part, nanos_part;
-  size_t pos = value.find_last_of(".");
-  if (pos == string::npos) {
-    seconds_part = value.substr(sign_length, value.length() - 1 - sign_length);
-    nanos_part = "0";
-  } else {
-    seconds_part = value.substr(sign_length, pos - sign_length);
-    nanos_part = value.substr(pos + 1, value.length() - pos - 2);
-  }
-  char* end;
-  int64 seconds = strto64(seconds_part.c_str(), &end, 10);
-  if (end != seconds_part.c_str() + seconds_part.length()) {
-    return false;
-  }
-  int64 nanos = strto64(nanos_part.c_str(), &end, 10);
-  if (end != nanos_part.c_str() + nanos_part.length()) {
-    return false;
-  }
-  nanos = nanos * Pow(10, 9 - nanos_part.length());
-  if (negative) {
-    // If a Duration is negative, both seconds and nanos should be negative.
-    seconds = -seconds;
-    nanos = -nanos;
-  }
-  duration->set_seconds(seconds);
-  duration->set_nanos(static_cast<int32>(nanos));
-  return true;
-}
-
-Duration TimeUtil::NanosecondsToDuration(int64 nanos) {
-  return CreateNormalized<Duration>(nanos / kNanosPerSecond,
-                                    nanos % kNanosPerSecond);
-}
-
-Duration TimeUtil::MicrosecondsToDuration(int64 micros) {
-  return CreateNormalized<Duration>(
-      micros / kMicrosPerSecond,
-      (micros % kMicrosPerSecond) * kNanosPerMicrosecond);
-}
-
-Duration TimeUtil::MillisecondsToDuration(int64 millis) {
-  return CreateNormalized<Duration>(
-      millis / kMillisPerSecond,
-      (millis % kMillisPerSecond) * kNanosPerMillisecond);
-}
-
-Duration TimeUtil::SecondsToDuration(int64 seconds) {
-  return CreateNormalized<Duration>(seconds, 0);
-}
-
-Duration TimeUtil::MinutesToDuration(int64 minutes) {
-  return CreateNormalized<Duration>(minutes * kSecondsPerMinute, 0);
-}
-
-Duration TimeUtil::HoursToDuration(int64 hours) {
-  return CreateNormalized<Duration>(hours * kSecondsPerHour, 0);
-}
-
-int64 TimeUtil::DurationToNanoseconds(const Duration& duration) {
-  return duration.seconds() * kNanosPerSecond + duration.nanos();
-}
-
-int64 TimeUtil::DurationToMicroseconds(const Duration& duration) {
-  return duration.seconds() * kMicrosPerSecond +
-         RoundTowardZero(duration.nanos(), kNanosPerMicrosecond);
-}
-
-int64 TimeUtil::DurationToMilliseconds(const Duration& duration) {
-  return duration.seconds() * kMillisPerSecond +
-         RoundTowardZero(duration.nanos(), kNanosPerMillisecond);
-}
-
-int64 TimeUtil::DurationToSeconds(const Duration& duration) {
-  return duration.seconds();
-}
-
-int64 TimeUtil::DurationToMinutes(const Duration& duration) {
-  return RoundTowardZero(duration.seconds(), kSecondsPerMinute);
-}
-
-int64 TimeUtil::DurationToHours(const Duration& duration) {
-  return RoundTowardZero(duration.seconds(), kSecondsPerHour);
-}
-
-Timestamp TimeUtil::NanosecondsToTimestamp(int64 nanos) {
-  return CreateNormalized<Timestamp>(nanos / kNanosPerSecond,
-                                     nanos % kNanosPerSecond);
-}
-
-Timestamp TimeUtil::MicrosecondsToTimestamp(int64 micros) {
-  return CreateNormalized<Timestamp>(
-      micros / kMicrosPerSecond,
-      micros % kMicrosPerSecond * kNanosPerMicrosecond);
-}
-
-Timestamp TimeUtil::MillisecondsToTimestamp(int64 millis) {
-  return CreateNormalized<Timestamp>(
-      millis / kMillisPerSecond,
-      millis % kMillisPerSecond * kNanosPerMillisecond);
-}
-
-Timestamp TimeUtil::SecondsToTimestamp(int64 seconds) {
-  return CreateNormalized<Timestamp>(seconds, 0);
-}
-
-int64 TimeUtil::TimestampToNanoseconds(const Timestamp& timestamp) {
-  return timestamp.seconds() * kNanosPerSecond + timestamp.nanos();
-}
-
-int64 TimeUtil::TimestampToMicroseconds(const Timestamp& timestamp) {
-  return timestamp.seconds() * kMicrosPerSecond +
-         RoundTowardZero(timestamp.nanos(), kNanosPerMicrosecond);
-}
-
-int64 TimeUtil::TimestampToMilliseconds(const Timestamp& timestamp) {
-  return timestamp.seconds() * kMillisPerSecond +
-         RoundTowardZero(timestamp.nanos(), kNanosPerMillisecond);
-}
-
-int64 TimeUtil::TimestampToSeconds(const Timestamp& timestamp) {
-  return timestamp.seconds();
-}
-
-Timestamp TimeUtil::TimeTToTimestamp(time_t value) {
-  return CreateNormalized<Timestamp>(static_cast<int64>(value), 0);
-}
-
-time_t TimeUtil::TimestampToTimeT(const Timestamp& value) {
-  return static_cast<time_t>(value.seconds());
-}
-
-Timestamp TimeUtil::TimevalToTimestamp(const timeval& value) {
-  return CreateNormalized<Timestamp>(value.tv_sec,
-                                     value.tv_usec * kNanosPerMicrosecond);
-}
-
-timeval TimeUtil::TimestampToTimeval(const Timestamp& value) {
-  timeval result;
-  result.tv_sec = value.seconds();
-  result.tv_usec = RoundTowardZero(value.nanos(), kNanosPerMicrosecond);
-  return result;
-}
-
-Duration TimeUtil::TimevalToDuration(const timeval& value) {
-  return CreateNormalized<Duration>(value.tv_sec,
-                                    value.tv_usec * kNanosPerMicrosecond);
-}
-
-timeval TimeUtil::DurationToTimeval(const Duration& value) {
-  timeval result;
-  result.tv_sec = value.seconds();
-  result.tv_usec = RoundTowardZero(value.nanos(), kNanosPerMicrosecond);
-  // timeval.tv_usec's range is [0, 1000000)
-  if (result.tv_usec < 0) {
-    result.tv_sec -= 1;
-    result.tv_usec += kMicrosPerSecond;
-  }
-  return result;
-}
-
-}  // namespace util
-}  // namespace protobuf
-
-
-namespace protobuf {
-namespace {
-using google::protobuf::util::kNanosPerSecond;
-using google::protobuf::util::CreateNormalized;
-
-// Convert a Duration to uint128.
-void ToUint128(const Duration& value, uint128* result, bool* negative) {
-  if (value.seconds() < 0 || value.nanos() < 0) {
-    *negative = true;
-    *result = static_cast<uint64>(-value.seconds());
-    *result = *result * kNanosPerSecond + static_cast<uint32>(-value.nanos());
-  } else {
-    *negative = false;
-    *result = static_cast<uint64>(value.seconds());
-    *result = *result * kNanosPerSecond + static_cast<uint32>(value.nanos());
-  }
-}
-
-void ToDuration(const uint128& value, bool negative, Duration* duration) {
-  int64 seconds = static_cast<int64>(Uint128Low64(value / kNanosPerSecond));
-  int32 nanos = static_cast<int32>(Uint128Low64(value % kNanosPerSecond));
-  if (negative) {
-    seconds = -seconds;
-    nanos = -nanos;
-  }
-  duration->set_seconds(seconds);
-  duration->set_nanos(nanos);
-}
-}  // namespace
-
-Duration& operator+=(Duration& d1, const Duration& d2) {
-  d1 = CreateNormalized<Duration>(d1.seconds() + d2.seconds(),
-                                  d1.nanos() + d2.nanos());
-  return d1;
-}
-
-Duration& operator-=(Duration& d1, const Duration& d2) {  // NOLINT
-  d1 = CreateNormalized<Duration>(d1.seconds() - d2.seconds(),
-                                  d1.nanos() - d2.nanos());
-  return d1;
-}
-
-Duration& operator*=(Duration& d, int64 r) {  // NOLINT
-  bool negative;
-  uint128 value;
-  ToUint128(d, &value, &negative);
-  if (r > 0) {
-    value *= static_cast<uint64>(r);
-  } else {
-    negative = !negative;
-    value *= static_cast<uint64>(-r);
-  }
-  ToDuration(value, negative, &d);
-  return d;
-}
-
-Duration& operator*=(Duration& d, double r) {  // NOLINT
-  double result = (d.seconds() * 1.0 + 1.0 * d.nanos() / kNanosPerSecond) * r;
-  int64 seconds = static_cast<int64>(result);
-  int32 nanos = static_cast<int32>((result - seconds) * kNanosPerSecond);
-  // Note that we normalize here not just because nanos can have a different
-  // sign from seconds but also that nanos can be any arbitrary value when
-  // overflow happens (i.e., the result is a much larger value than what
-  // int64 can represent).
-  d = CreateNormalized<Duration>(seconds, nanos);
-  return d;
-}
-
-Duration& operator/=(Duration& d, int64 r) {  // NOLINT
-  bool negative;
-  uint128 value;
-  ToUint128(d, &value, &negative);
-  if (r > 0) {
-    value /= static_cast<uint64>(r);
-  } else {
-    negative = !negative;
-    value /= static_cast<uint64>(-r);
-  }
-  ToDuration(value, negative, &d);
-  return d;
-}
-
-Duration& operator/=(Duration& d, double r) {  // NOLINT
-  return d *= 1.0 / r;
-}
-
-Duration& operator%=(Duration& d1, const Duration& d2) {  // NOLINT
-  bool negative1, negative2;
-  uint128 value1, value2;
-  ToUint128(d1, &value1, &negative1);
-  ToUint128(d2, &value2, &negative2);
-  uint128 result = value1 % value2;
-  // When negative values are involved in division, we round the division
-  // result towards zero. With this semantics, sign of the remainder is the
-  // same as the dividend. For example:
-  //     -5 / 10    = 0, -5 % 10    = -5
-  //     -5 / (-10) = 0, -5 % (-10) = -5
-  //      5 / (-10) = 0,  5 % (-10) = 5
-  ToDuration(result, negative1, &d1);
-  return d1;
-}
-
-int64 operator/(const Duration& d1, const Duration& d2) {
-  bool negative1, negative2;
-  uint128 value1, value2;
-  ToUint128(d1, &value1, &negative1);
-  ToUint128(d2, &value2, &negative2);
-  int64 result = Uint128Low64(value1 / value2);
-  if (negative1 != negative2) {
-    result = -result;
-  }
-  return result;
-}
-
-Timestamp& operator+=(Timestamp& t, const Duration& d) {  // NOLINT
-  t = CreateNormalized<Timestamp>(t.seconds() + d.seconds(),
-                                  t.nanos() + d.nanos());
-  return t;
-}
-
-Timestamp& operator-=(Timestamp& t, const Duration& d) {  // NOLINT
-  t = CreateNormalized<Timestamp>(t.seconds() - d.seconds(),
-                                  t.nanos() - d.nanos());
-  return t;
-}
-
-Duration operator-(const Timestamp& t1, const Timestamp& t2) {
-  return CreateNormalized<Duration>(t1.seconds() - t2.seconds(),
-                                    t1.nanos() - t2.nanos());
-}
-}  // namespace protobuf
-
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/time_util.h b/3rdparty/protobuf/src/google/protobuf/util/time_util.h
deleted file mode 100644 (file)
index b884693..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Defines utilities for the Timestamp and Duration well known types.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__
-#define GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__
-
-#include <ctime>
-#include <ostream>
-#include <string>
-#ifdef _MSC_VER
-#include <winsock2.h>
-#else
-#include <sys/time.h>
-#endif
-
-#include <google/protobuf/duration.pb.h>
-#include <google/protobuf/timestamp.pb.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-
-// Utility functions for Timestamp and Duration.
-class LIBPROTOBUF_EXPORT TimeUtil {
-  typedef google::protobuf::Timestamp Timestamp;
-  typedef google::protobuf::Duration Duration;
-
- public:
-  // The min/max Timestamp/Duration values we support.
-  //
-  // For "0001-01-01T00:00:00Z".
-  static const int64 kTimestampMinSeconds = -62135596800LL;
-  // For "9999-12-31T23:59:59.999999999Z".
-  static const int64 kTimestampMaxSeconds = 253402300799LL;
-  static const int64 kDurationMinSeconds = -315576000000LL;
-  static const int64 kDurationMaxSeconds = 315576000000LL;
-
-  // Converts Timestamp to/from RFC 3339 date string format.
-  // Generated output will always be Z-normalized and uses 3, 6 or 9
-  // fractional digits as required to represent the exact time. When
-  // parsing, any fractional digits (or none) and any offset are
-  // accepted as long as they fit into nano-seconds precision.
-  // Note that Timestamp can only represent time from
-  // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. Converting
-  // a Timestamp outside of this range is undefined behavior.
-  // See https://www.ietf.org/rfc/rfc3339.txt
-  //
-  // Example of generated format:
-  //   "1972-01-01T10:00:20.021Z"
-  //
-  // Example of accepted format:
-  //   "1972-01-01T10:00:20.021-05:00"
-  static string ToString(const Timestamp& timestamp);
-  static bool FromString(const string& value, Timestamp* timestamp);
-
-  // Converts Duration to/from string format. The string format will contains
-  // 3, 6, or 9 fractional digits depending on the precision required to
-  // represent the exact Duration value. For example:
-  //   "1s", "1.010s", "1.000000100s", "-3.100s"
-  // The range that can be represented by Duration is from -315,576,000,000
-  // to +315,576,000,000 inclusive (in seconds).
-  static string ToString(const Duration& duration);
-  static bool FromString(const string& value, Duration* timestamp);
-
-#ifdef GetCurrentTime
-#undef GetCurrentTime  // Visual Studio has macro GetCurrentTime
-#endif
-  // Gets the current UTC time.
-  static Timestamp GetCurrentTime();
-  // Returns the Time representing "1970-01-01 00:00:00".
-  static Timestamp GetEpoch();
-
-  // Converts between Duration and integer types. The behavior is undefined if
-  // the input value is not in the valid range of Duration.
-  static Duration NanosecondsToDuration(int64 nanos);
-  static Duration MicrosecondsToDuration(int64 micros);
-  static Duration MillisecondsToDuration(int64 millis);
-  static Duration SecondsToDuration(int64 seconds);
-  static Duration MinutesToDuration(int64 minutes);
-  static Duration HoursToDuration(int64 hours);
-  // Result will be truncated towards zero. For example, "-1.5s" will be
-  // truncated to "-1s", and "1.5s" to "1s" when converting to seconds.
-  // It's undefined behavior if the input duration is not valid or the result
-  // exceeds the range of int64. A duration is not valid if it's not in the
-  // valid range of Duration, or have an invalid nanos value (i.e., larger
-  // than 999999999, less than -999999999, or have a different sign from the
-  // seconds part).
-  static int64 DurationToNanoseconds(const Duration& duration);
-  static int64 DurationToMicroseconds(const Duration& duration);
-  static int64 DurationToMilliseconds(const Duration& duration);
-  static int64 DurationToSeconds(const Duration& duration);
-  static int64 DurationToMinutes(const Duration& duration);
-  static int64 DurationToHours(const Duration& duration);
-  // Creates Timestamp from integer types. The integer value indicates the
-  // time elapsed from Epoch time. The behavior is undefined if the input
-  // value is not in the valid range of Timestamp.
-  static Timestamp NanosecondsToTimestamp(int64 nanos);
-  static Timestamp MicrosecondsToTimestamp(int64 micros);
-  static Timestamp MillisecondsToTimestamp(int64 millis);
-  static Timestamp SecondsToTimestamp(int64 seconds);
-  // Result will be truncated down to the nearest integer value. For example,
-  // with "1969-12-31T23:59:59.9Z", TimestampToMilliseconds() returns -100
-  // and TimestampToSeconds() returns -1. It's undefined behavior if the input
-  // Timestamp is not valid (i.e., its seconds part or nanos part does not fall
-  // in the valid range) or the return value doesn't fit into int64.
-  static int64 TimestampToNanoseconds(const Timestamp& timestamp);
-  static int64 TimestampToMicroseconds(const Timestamp& timestamp);
-  static int64 TimestampToMilliseconds(const Timestamp& timestamp);
-  static int64 TimestampToSeconds(const Timestamp& timestamp);
-
-  // Conversion to/from other time/date types. Note that these types may
-  // have a different precision and time range from Timestamp/Duration.
-  // When converting to a lower precision type, the value will be truncated
-  // to the nearest value that can be represented. If the value is
-  // out of the range of the result type, the return value is undefined.
-  //
-  // Conversion to/from time_t
-  static Timestamp TimeTToTimestamp(time_t value);
-  static time_t TimestampToTimeT(const Timestamp& value);
-
-  // Conversion to/from timeval
-  static Timestamp TimevalToTimestamp(const timeval& value);
-  static timeval TimestampToTimeval(const Timestamp& value);
-  static Duration TimevalToDuration(const timeval& value);
-  static timeval DurationToTimeval(const Duration& value);
-};
-
-}  // namespace util
-}  // namespace protobuf
-
-
-namespace protobuf {
-// Overloaded operators for Duration.
-//
-// Assignment operators.
-LIBPROTOBUF_EXPORT Duration& operator+=(Duration& d1, const Duration& d2);  // NOLINT
-LIBPROTOBUF_EXPORT Duration& operator-=(Duration& d1, const Duration& d2);  // NOLINT
-LIBPROTOBUF_EXPORT Duration& operator*=(Duration& d, int64 r);  // NOLINT
-LIBPROTOBUF_EXPORT Duration& operator*=(Duration& d, double r);  // NOLINT
-LIBPROTOBUF_EXPORT Duration& operator/=(Duration& d, int64 r);  // NOLINT
-LIBPROTOBUF_EXPORT Duration& operator/=(Duration& d, double r);  // NOLINT
-// Overload for other integer types.
-template <typename T>
-Duration& operator*=(Duration& d, T r) {  // NOLINT
-  int64 x = r;
-  return d *= x;
-}
-template <typename T>
-Duration& operator/=(Duration& d, T r) {  // NOLINT
-  int64 x = r;
-  return d /= x;
-}
-LIBPROTOBUF_EXPORT Duration& operator%=(Duration& d1, const Duration& d2);  // NOLINT
-// Relational operators.
-inline bool operator<(const Duration& d1, const Duration& d2) {
-  if (d1.seconds() == d2.seconds()) {
-    return d1.nanos() < d2.nanos();
-  }
-  return d1.seconds() < d2.seconds();
-}
-inline bool operator>(const Duration& d1, const Duration& d2) {
-  return d2 < d1;
-}
-inline bool operator>=(const Duration& d1, const Duration& d2) {
-  return !(d1 < d2);
-}
-inline bool operator<=(const Duration& d1, const Duration& d2) {
-  return !(d2 < d1);
-}
-inline bool operator==(const Duration& d1, const Duration& d2) {
-  return d1.seconds() == d2.seconds() && d1.nanos() == d2.nanos();
-}
-inline bool operator!=(const Duration& d1, const Duration& d2) {
-  return !(d1 == d2);
-}
-// Additive operators
-inline Duration operator-(const Duration& d) {
-  Duration result;
-  result.set_seconds(-d.seconds());
-  result.set_nanos(-d.nanos());
-  return result;
-}
-inline Duration operator+(const Duration& d1, const Duration& d2) {
-  Duration result = d1;
-  return result += d2;
-}
-inline Duration operator-(const Duration& d1, const Duration& d2) {
-  Duration result = d1;
-  return result -= d2;
-}
-// Multiplicative operators
-template<typename T>
-inline Duration operator*(Duration d, T r) {
-  return d *= r;
-}
-template<typename T>
-inline Duration operator*(T r, Duration d) {
-  return d *= r;
-}
-template<typename T>
-inline Duration operator/(Duration d, T r) {
-  return d /= r;
-}
-LIBPROTOBUF_EXPORT int64 operator/(const Duration& d1, const Duration& d2);
-
-inline Duration operator%(const Duration& d1, const Duration& d2) {
-  Duration result = d1;
-  return result %= d2;
-}
-
-inline std::ostream& operator<<(std::ostream& out, const Duration& d) {
-  out << google::protobuf::util::TimeUtil::ToString(d);
-  return out;
-}
-
-// Overloaded operators for Timestamp
-//
-// Assignement operators.
-LIBPROTOBUF_EXPORT Timestamp& operator+=(Timestamp& t, const Duration& d);  // NOLINT
-LIBPROTOBUF_EXPORT Timestamp& operator-=(Timestamp& t, const Duration& d);  // NOLINT
-// Relational operators.
-inline bool operator<(const Timestamp& t1, const Timestamp& t2) {
-  if (t1.seconds() == t2.seconds()) {
-    return t1.nanos() < t2.nanos();
-  }
-  return t1.seconds() < t2.seconds();
-}
-inline bool operator>(const Timestamp& t1, const Timestamp& t2) {
-  return t2 < t1;
-}
-inline bool operator>=(const Timestamp& t1, const Timestamp& t2) {
-  return !(t1 < t2);
-}
-inline bool operator<=(const Timestamp& t1, const Timestamp& t2) {
-  return !(t2 < t1);
-}
-inline bool operator==(const Timestamp& t1, const Timestamp& t2) {
-  return t1.seconds() == t2.seconds() && t1.nanos() == t2.nanos();
-}
-inline bool operator!=(const Timestamp& t1, const Timestamp& t2) {
-  return !(t1 == t2);
-}
-// Additive operators.
-inline Timestamp operator+(const Timestamp& t, const Duration& d) {
-  Timestamp result = t;
-  return result += d;
-}
-inline Timestamp operator+(const Duration& d, const Timestamp& t) {
-  Timestamp result = t;
-  return result += d;
-}
-inline Timestamp operator-(const Timestamp& t, const Duration& d) {
-  Timestamp result = t;
-  return result -= d;
-}
-LIBPROTOBUF_EXPORT Duration operator-(const Timestamp& t1, const Timestamp& t2);
-
-inline std::ostream& operator<<(std::ostream& out, const Timestamp& t) {
-  out << google::protobuf::util::TimeUtil::ToString(t);
-  return out;
-}
-
-}  // namespace protobuf
-
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/type_resolver.h b/3rdparty/protobuf/src/google/protobuf/util/type_resolver.h
deleted file mode 100644 (file)
index 959f3c7..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Defines a TypeResolver for the Any message.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__
-#define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/status.h>
-
-
-namespace google {
-namespace protobuf {
-class Type;
-class Enum;
-}  // namespace protobuf
-
-
-namespace protobuf {
-class DescriptorPool;
-namespace util {
-
-// Abstract interface for a type resovler.
-//
-// Implementations of this interface must be thread-safe.
-class LIBPROTOBUF_EXPORT TypeResolver {
- public:
-  TypeResolver() {}
-  virtual ~TypeResolver() {}
-
-  // Resolves a type url for a message type.
-  virtual util::Status ResolveMessageType(
-      const string& type_url, google::protobuf::Type* message_type) = 0;
-
-  // Resolves a type url for an enum type.
-  virtual util::Status ResolveEnumType(const string& type_url,
-                                         google::protobuf::Enum* enum_type) = 0;
-
- private:
-  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeResolver);
-};
-
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/util/type_resolver_util.cc b/3rdparty/protobuf/src/google/protobuf/util/type_resolver_util.cc
deleted file mode 100644 (file)
index febaa41..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <google/protobuf/util/type_resolver_util.h>
-
-#include <google/protobuf/type.pb.h>
-#include <google/protobuf/wrappers.pb.h>
-#include <google/protobuf/descriptor.pb.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/util/internal/utility.h>
-#include <google/protobuf/util/type_resolver.h>
-#include <google/protobuf/stubs/strutil.h>
-#include <google/protobuf/stubs/status.h>
-
-namespace google {
-namespace protobuf {
-namespace util {
-namespace {
-using google::protobuf::BoolValue;
-using google::protobuf::Enum;
-using google::protobuf::EnumValue;
-using google::protobuf::Field;
-using google::protobuf::Option;
-using google::protobuf::Type;
-
-using util::Status;
-using util::error::INVALID_ARGUMENT;
-using util::error::NOT_FOUND;
-
-class DescriptorPoolTypeResolver : public TypeResolver {
- public:
-  DescriptorPoolTypeResolver(const string& url_prefix,
-                             const DescriptorPool* pool)
-      : url_prefix_(url_prefix), pool_(pool) {}
-
-  Status ResolveMessageType(const string& type_url, Type* type) {
-    string type_name;
-    Status status = ParseTypeUrl(type_url, &type_name);
-    if (!status.ok()) {
-      return status;
-    }
-
-    const Descriptor* descriptor = pool_->FindMessageTypeByName(type_name);
-    if (descriptor == NULL) {
-      return Status(NOT_FOUND, "Invalid type URL, unknown type: " + type_name);
-    }
-    ConvertDescriptor(descriptor, type);
-    return Status();
-  }
-
-  Status ResolveEnumType(const string& type_url, Enum* enum_type) {
-    string type_name;
-    Status status = ParseTypeUrl(type_url, &type_name);
-    if (!status.ok()) {
-      return status;
-    }
-
-    const EnumDescriptor* descriptor = pool_->FindEnumTypeByName(type_name);
-    if (descriptor == NULL) {
-      return Status(NOT_FOUND, "Invalid type URL, unknown type: " + type_name);
-    }
-    ConvertEnumDescriptor(descriptor, enum_type);
-    return Status();
-  }
-
- private:
-  void ConvertDescriptor(const Descriptor* descriptor, Type* type) {
-    type->Clear();
-    type->set_name(descriptor->full_name());
-    for (int i = 0; i < descriptor->field_count(); ++i) {
-      const FieldDescriptor* field = descriptor->field(i);
-      if (field->type() == FieldDescriptor::TYPE_GROUP) {
-        // Group fields cannot be represented with Type. We discard them.
-        continue;
-      }
-      ConvertFieldDescriptor(descriptor->field(i), type->add_fields());
-    }
-    for (int i = 0; i < descriptor->oneof_decl_count(); ++i) {
-      type->add_oneofs(descriptor->oneof_decl(i)->name());
-    }
-    type->mutable_source_context()->set_file_name(descriptor->file()->name());
-    ConvertMessageOptions(descriptor->options(), type->mutable_options());
-  }
-
-  void ConvertMessageOptions(const MessageOptions& options,
-                             RepeatedPtrField<Option>* output) {
-    if (options.map_entry()) {
-      Option* option = output->Add();
-      option->set_name("map_entry");
-      BoolValue value;
-      value.set_value(true);
-      option->mutable_value()->PackFrom(value);
-    }
-
-    // TODO(xiaofeng): Set other "options"?
-  }
-
-  void ConvertFieldDescriptor(const FieldDescriptor* descriptor, Field* field) {
-    field->set_kind(static_cast<Field::Kind>(descriptor->type()));
-    switch (descriptor->label()) {
-      case FieldDescriptor::LABEL_OPTIONAL:
-        field->set_cardinality(Field::CARDINALITY_OPTIONAL);
-        break;
-      case FieldDescriptor::LABEL_REPEATED:
-        field->set_cardinality(Field::CARDINALITY_REPEATED);
-        break;
-      case FieldDescriptor::LABEL_REQUIRED:
-        field->set_cardinality(Field::CARDINALITY_REQUIRED);
-        break;
-    }
-    field->set_number(descriptor->number());
-    field->set_name(descriptor->name());
-    field->set_json_name(descriptor->json_name());
-    if (descriptor->has_default_value()) {
-      field->set_default_value(DefaultValueAsString(descriptor));
-    }
-    if (descriptor->type() == FieldDescriptor::TYPE_MESSAGE) {
-      field->set_type_url(GetTypeUrl(descriptor->message_type()));
-    } else if (descriptor->type() == FieldDescriptor::TYPE_ENUM) {
-      field->set_type_url(GetTypeUrl(descriptor->enum_type()));
-    }
-    if (descriptor->containing_oneof() != NULL) {
-      field->set_oneof_index(descriptor->containing_oneof()->index() + 1);
-    }
-    if (descriptor->is_packed()) {
-      field->set_packed(true);
-    }
-
-    // TODO(xiaofeng): Set other field "options"?
-  }
-
-  void ConvertEnumDescriptor(const EnumDescriptor* descriptor,
-                             Enum* enum_type) {
-    enum_type->Clear();
-    enum_type->set_name(descriptor->full_name());
-    enum_type->mutable_source_context()->set_file_name(
-        descriptor->file()->name());
-    for (int i = 0; i < descriptor->value_count(); ++i) {
-      const EnumValueDescriptor* value_descriptor = descriptor->value(i);
-      EnumValue* value = enum_type->mutable_enumvalue()->Add();
-      value->set_name(value_descriptor->name());
-      value->set_number(value_descriptor->number());
-
-      // TODO(xiaofeng): Set EnumValue options.
-    }
-    // TODO(xiaofeng): Set Enum "options".
-  }
-
-  string GetTypeUrl(const Descriptor* descriptor) {
-    return url_prefix_ + "/" + descriptor->full_name();
-  }
-
-  string GetTypeUrl(const EnumDescriptor* descriptor) {
-    return url_prefix_ + "/" + descriptor->full_name();
-  }
-
-  Status ParseTypeUrl(const string& type_url, string* type_name) {
-    if (type_url.substr(0, url_prefix_.size() + 1) != url_prefix_ + "/") {
-      return Status(INVALID_ARGUMENT,
-                    StrCat("Invalid type URL, type URLs must be of the form '",
-                           url_prefix_, "/<typename>', got: ", type_url));
-    }
-    *type_name = type_url.substr(url_prefix_.size() + 1);
-    return Status();
-  }
-
-  string DefaultValueAsString(const FieldDescriptor* descriptor) {
-    switch (descriptor->cpp_type()) {
-      case FieldDescriptor::CPPTYPE_INT32:
-        return SimpleItoa(descriptor->default_value_int32());
-        break;
-      case FieldDescriptor::CPPTYPE_INT64:
-        return SimpleItoa(descriptor->default_value_int64());
-        break;
-      case FieldDescriptor::CPPTYPE_UINT32:
-        return SimpleItoa(descriptor->default_value_uint32());
-        break;
-      case FieldDescriptor::CPPTYPE_UINT64:
-        return SimpleItoa(descriptor->default_value_uint64());
-        break;
-      case FieldDescriptor::CPPTYPE_FLOAT:
-        return SimpleFtoa(descriptor->default_value_float());
-        break;
-      case FieldDescriptor::CPPTYPE_DOUBLE:
-        return SimpleDtoa(descriptor->default_value_double());
-        break;
-      case FieldDescriptor::CPPTYPE_BOOL:
-        return descriptor->default_value_bool() ? "true" : "false";
-        break;
-      case FieldDescriptor::CPPTYPE_STRING:
-        if (descriptor->type() == FieldDescriptor::TYPE_BYTES) {
-          return CEscape(descriptor->default_value_string());
-        } else {
-          return descriptor->default_value_string();
-        }
-        break;
-      case FieldDescriptor::CPPTYPE_ENUM:
-        return descriptor->default_value_enum()->name();
-        break;
-      case FieldDescriptor::CPPTYPE_MESSAGE:
-        GOOGLE_LOG(DFATAL) << "Messages can't have default values!";
-        break;
-    }
-    return "";
-  }
-
-  string url_prefix_;
-  const DescriptorPool* pool_;
-};
-
-}  // namespace
-
-TypeResolver* NewTypeResolverForDescriptorPool(const string& url_prefix,
-                                               const DescriptorPool* pool) {
-  return new DescriptorPoolTypeResolver(url_prefix, pool);
-}
-
-}  // namespace util
-}  // namespace protobuf
-}  // namespace google
diff --git a/3rdparty/protobuf/src/google/protobuf/util/type_resolver_util.h b/3rdparty/protobuf/src/google/protobuf/util/type_resolver_util.h
deleted file mode 100644 (file)
index c17366f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Defines utilities for the TypeResolver.
-
-#ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__
-#define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-namespace google {
-namespace protobuf {
-class DescriptorPool;
-namespace util {
-class TypeResolver;
-
-// Creates a TypeResolver that serves type information in the given descriptor
-// pool. Caller takes ownership of the returned TypeResolver.
-LIBPROTOBUF_EXPORT TypeResolver* NewTypeResolverForDescriptorPool(
-    const string& url_prefix, const DescriptorPool* pool);
-
-}  // namespace util
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__
index 01704c9..e68af89 100644 (file)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
+#include <google/protobuf/wire_format.h>
+
 #include <stack>
 #include <string>
 #include <vector>
 
-#include <google/protobuf/wire_format.h>
-
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/stringprintf.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/dynamic_message.h>
-#include <google/protobuf/map_field.h>
-#include <google/protobuf/wire_format_lite_inl.h>
 #include <google/protobuf/descriptor.pb.h>
+#include <google/protobuf/parse_context.h>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/io/zero_copy_stream.h>
 #include <google/protobuf/io/zero_copy_stream_impl.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/dynamic_message.h>
+#include <google/protobuf/map_field.h>
+#include <google/protobuf/map_field_inl.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/message_lite.h>
 #include <google/protobuf/unknown_field_set.h>
 
 
+#include <google/protobuf/port_def.inc>
 
-namespace google {
 const size_t kMapEntryTagByteSize = 2;
 
+namespace google {
 namespace protobuf {
 namespace internal {
 
 // Forward declare static functions
-static size_t MapKeyDataOnlyByteSize(const FieldDescriptor* field,
-                                     const MapKey& value);
 static size_t MapValueRefDataOnlyByteSize(const FieldDescriptor* field,
-                                          const MapValueRef& value);
+                                          const MapValueConstRef& value);
 
 // ===================================================================
 
-bool UnknownFieldSetFieldSkipper::SkipField(
-    io::CodedInputStream* input, uint32 tag) {
+bool UnknownFieldSetFieldSkipper::SkipField(io::CodedInputStream* input,
+                                            uint32_t tag) {
   return WireFormat::SkipField(input, tag, unknown_fields_);
 }
 
@@ -76,12 +78,11 @@ bool UnknownFieldSetFieldSkipper::SkipMessage(io::CodedInputStream* input) {
   return WireFormat::SkipMessage(input, unknown_fields_);
 }
 
-void UnknownFieldSetFieldSkipper::SkipUnknownEnum(
-    int field_number, int value) {
+void UnknownFieldSetFieldSkipper::SkipUnknownEnum(int field_number, int value) {
   unknown_fields_->AddVarint(field_number, value);
 }
 
-bool WireFormat::SkipField(io::CodedInputStream* input, uint32 tag,
+bool WireFormat::SkipField(io::CodedInputStream* input, uint32_t tag,
                            UnknownFieldSet* unknown_fields) {
   int number = WireFormatLite::GetTagFieldNumber(tag);
   // Field number 0 is illegal.
@@ -89,21 +90,21 @@ bool WireFormat::SkipField(io::CodedInputStream* input, uint32 tag,
 
   switch (WireFormatLite::GetTagWireType(tag)) {
     case WireFormatLite::WIRETYPE_VARINT: {
-      uint64 value;
+      uint64_t value;
       if (!input->ReadVarint64(&value)) return false;
-      if (unknown_fields != NULL) unknown_fields->AddVarint(number, value);
+      if (unknown_fields != nullptr) unknown_fields->AddVarint(number, value);
       return true;
     }
     case WireFormatLite::WIRETYPE_FIXED64: {
-      uint64 value;
+      uint64_t value;
       if (!input->ReadLittleEndian64(&value)) return false;
-      if (unknown_fields != NULL) unknown_fields->AddFixed64(number, value);
+      if (unknown_fields != nullptr) unknown_fields->AddFixed64(number, value);
       return true;
     }
     case WireFormatLite::WIRETYPE_LENGTH_DELIMITED: {
-      uint32 length;
+      uint32_t length;
       if (!input->ReadVarint32(&length)) return false;
-      if (unknown_fields == NULL) {
+      if (unknown_fields == nullptr) {
         if (!input->Skip(length)) return false;
       } else {
         if (!input->ReadString(unknown_fields->AddLengthDelimited(number),
@@ -115,15 +116,16 @@ bool WireFormat::SkipField(io::CodedInputStream* input, uint32 tag,
     }
     case WireFormatLite::WIRETYPE_START_GROUP: {
       if (!input->IncrementRecursionDepth()) return false;
-      if (!SkipMessage(input, (unknown_fields == NULL) ?
-                              NULL : unknown_fields->AddGroup(number))) {
+      if (!SkipMessage(input, (unknown_fields == nullptr)
+                                  ? nullptr
+                                  : unknown_fields->AddGroup(number))) {
         return false;
       }
       input->DecrementRecursionDepth();
       // Check that the ending tag matched the starting tag.
-      if (!input->LastTagWas(WireFormatLite::MakeTag(
-          WireFormatLite::GetTagFieldNumber(tag),
-          WireFormatLite::WIRETYPE_END_GROUP))) {
+      if (!input->LastTagWas(
+              WireFormatLite::MakeTag(WireFormatLite::GetTagFieldNumber(tag),
+                                      WireFormatLite::WIRETYPE_END_GROUP))) {
         return false;
       }
       return true;
@@ -132,9 +134,9 @@ bool WireFormat::SkipField(io::CodedInputStream* input, uint32 tag,
       return false;
     }
     case WireFormatLite::WIRETYPE_FIXED32: {
-      uint32 value;
+      uint32_t value;
       if (!input->ReadLittleEndian32(&value)) return false;
-      if (unknown_fields != NULL) unknown_fields->AddFixed32(number, value);
+      if (unknown_fields != nullptr) unknown_fields->AddFixed32(number, value);
       return true;
     }
     default: {
@@ -146,7 +148,7 @@ bool WireFormat::SkipField(io::CodedInputStream* input, uint32 tag,
 bool WireFormat::SkipMessage(io::CodedInputStream* input,
                              UnknownFieldSet* unknown_fields) {
   while (true) {
-    uint32 tag = input->ReadTag();
+    uint32_t tag = input->ReadTag();
     if (tag == 0) {
       // End of input.  This is a valid place to end, so return true.
       return true;
@@ -164,20 +166,20 @@ bool WireFormat::SkipMessage(io::CodedInputStream* input,
 }
 
 bool WireFormat::ReadPackedEnumPreserveUnknowns(io::CodedInputStream* input,
-                                                uint32 field_number,
+                                                uint32_t field_number,
                                                 bool (*is_valid)(int),
                                                 UnknownFieldSet* unknown_fields,
                                                 RepeatedField<int>* values) {
-  uint32 length;
+  uint32_t length;
   if (!input->ReadVarint32(&length)) return false;
   io::CodedInputStream::Limit limit = input->PushLimit(length);
   while (input->BytesUntilLimit() > 0) {
     int value;
-    if (!google::protobuf::internal::WireFormatLite::ReadPrimitive<
-        int, WireFormatLite::TYPE_ENUM>(input, &value)) {
+    if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
+            input, &value)) {
       return false;
     }
-    if (is_valid == NULL || is_valid(value)) {
+    if (is_valid == nullptr || is_valid(value)) {
       values->Add(value);
     } else {
       unknown_fields->AddVarint(field_number, value);
@@ -187,72 +189,36 @@ bool WireFormat::ReadPackedEnumPreserveUnknowns(io::CodedInputStream* input,
   return true;
 }
 
-
-void WireFormat::SerializeUnknownFields(const UnknownFieldSet& unknown_fields,
-                                        io::CodedOutputStream* output) {
-  for (int i = 0; i < unknown_fields.field_count(); i++) {
-    const UnknownField& field = unknown_fields.field(i);
-    switch (field.type()) {
-      case UnknownField::TYPE_VARINT:
-        output->WriteVarint32(WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_VARINT));
-        output->WriteVarint64(field.varint());
-        break;
-      case UnknownField::TYPE_FIXED32:
-        output->WriteVarint32(WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_FIXED32));
-        output->WriteLittleEndian32(field.fixed32());
-        break;
-      case UnknownField::TYPE_FIXED64:
-        output->WriteVarint32(WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_FIXED64));
-        output->WriteLittleEndian64(field.fixed64());
-        break;
-      case UnknownField::TYPE_LENGTH_DELIMITED:
-        output->WriteVarint32(WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_LENGTH_DELIMITED));
-        output->WriteVarint32(field.length_delimited().size());
-        output->WriteRawMaybeAliased(field.length_delimited().data(),
-                                     field.length_delimited().size());
-        break;
-      case UnknownField::TYPE_GROUP:
-        output->WriteVarint32(WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_START_GROUP));
-        SerializeUnknownFields(field.group(), output);
-        output->WriteVarint32(WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_END_GROUP));
-        break;
-    }
-  }
-}
-
-uint8* WireFormat::SerializeUnknownFieldsToArray(
-    const UnknownFieldSet& unknown_fields,
-    uint8* target) {
+uint8_t* WireFormat::InternalSerializeUnknownFieldsToArray(
+    const UnknownFieldSet& unknown_fields, uint8_t* target,
+    io::EpsCopyOutputStream* stream) {
   for (int i = 0; i < unknown_fields.field_count(); i++) {
     const UnknownField& field = unknown_fields.field(i);
 
+    target = stream->EnsureSpace(target);
     switch (field.type()) {
       case UnknownField::TYPE_VARINT:
-        target = WireFormatLite::WriteInt64ToArray(
-            field.number(), field.varint(), target);
+        target = WireFormatLite::WriteUInt64ToArray(field.number(),
+                                                    field.varint(), target);
         break;
       case UnknownField::TYPE_FIXED32:
-        target = WireFormatLite::WriteFixed32ToArray(
-            field.number(), field.fixed32(), target);
+        target = WireFormatLite::WriteFixed32ToArray(field.number(),
+                                                     field.fixed32(), target);
         break;
       case UnknownField::TYPE_FIXED64:
-        target = WireFormatLite::WriteFixed64ToArray(
-            field.number(), field.fixed64(), target);
+        target = WireFormatLite::WriteFixed64ToArray(field.number(),
+                                                     field.fixed64(), target);
         break;
       case UnknownField::TYPE_LENGTH_DELIMITED:
-        target = WireFormatLite::WriteBytesToArray(
-            field.number(), field.length_delimited(), target);
+        target = stream->WriteString(field.number(), field.length_delimited(),
+                                     target);
         break;
       case UnknownField::TYPE_GROUP:
         target = WireFormatLite::WriteTagToArray(
             field.number(), WireFormatLite::WIRETYPE_START_GROUP, target);
-        target = SerializeUnknownFieldsToArray(field.group(), target);
+        target = InternalSerializeUnknownFieldsToArray(field.group(), target,
+                                                       stream);
+        target = stream->EnsureSpace(target);
         target = WireFormatLite::WriteTagToArray(
             field.number(), WireFormatLite::WIRETYPE_END_GROUP, target);
         break;
@@ -261,40 +227,16 @@ uint8* WireFormat::SerializeUnknownFieldsToArray(
   return target;
 }
 
-void WireFormat::SerializeUnknownMessageSetItems(
-    const UnknownFieldSet& unknown_fields,
-    io::CodedOutputStream* output) {
-  for (int i = 0; i < unknown_fields.field_count(); i++) {
-    const UnknownField& field = unknown_fields.field(i);
-    // The only unknown fields that are allowed to exist in a MessageSet are
-    // messages, which are length-delimited.
-    if (field.type() == UnknownField::TYPE_LENGTH_DELIMITED) {
-      // Start group.
-      output->WriteVarint32(WireFormatLite::kMessageSetItemStartTag);
-
-      // Write type ID.
-      output->WriteVarint32(WireFormatLite::kMessageSetTypeIdTag);
-      output->WriteVarint32(field.number());
-
-      // Write message.
-      output->WriteVarint32(WireFormatLite::kMessageSetMessageTag);
-      field.SerializeLengthDelimitedNoTag(output);
-
-      // End group.
-      output->WriteVarint32(WireFormatLite::kMessageSetItemEndTag);
-    }
-  }
-}
-
-uint8* WireFormat::SerializeUnknownMessageSetItemsToArray(
-    const UnknownFieldSet& unknown_fields,
-    uint8* target) {
+uint8_t* WireFormat::InternalSerializeUnknownMessageSetItemsToArray(
+    const UnknownFieldSet& unknown_fields, uint8_t* target,
+    io::EpsCopyOutputStream* stream) {
   for (int i = 0; i < unknown_fields.field_count(); i++) {
     const UnknownField& field = unknown_fields.field(i);
 
     // The only unknown fields that are allowed to exist in a MessageSet are
     // messages, which are length-delimited.
     if (field.type() == UnknownField::TYPE_LENGTH_DELIMITED) {
+      target = stream->EnsureSpace(target);
       // Start group.
       target = io::CodedOutputStream::WriteTagToArray(
           WireFormatLite::kMessageSetItemStartTag, target);
@@ -302,14 +244,16 @@ uint8* WireFormat::SerializeUnknownMessageSetItemsToArray(
       // Write type ID.
       target = io::CodedOutputStream::WriteTagToArray(
           WireFormatLite::kMessageSetTypeIdTag, target);
-      target = io::CodedOutputStream::WriteVarint32ToArray(
-          field.number(), target);
+      target =
+          io::CodedOutputStream::WriteVarint32ToArray(field.number(), target);
 
       // Write message.
       target = io::CodedOutputStream::WriteTagToArray(
           WireFormatLite::kMessageSetMessageTag, target);
-      target = field.SerializeLengthDelimitedNoTagToArray(target);
 
+      target = field.InternalSerializeLengthDelimitedNoTag(target, stream);
+
+      target = stream->EnsureSpace(target);
       // End group.
       target = io::CodedOutputStream::WriteTagToArray(
           WireFormatLite::kMessageSetItemEndTag, target);
@@ -327,39 +271,33 @@ size_t WireFormat::ComputeUnknownFieldsSize(
 
     switch (field.type()) {
       case UnknownField::TYPE_VARINT:
-        size += io::CodedOutputStream::VarintSize32(
-            WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_VARINT));
+        size += io::CodedOutputStream::VarintSize32(WireFormatLite::MakeTag(
+            field.number(), WireFormatLite::WIRETYPE_VARINT));
         size += io::CodedOutputStream::VarintSize64(field.varint());
         break;
       case UnknownField::TYPE_FIXED32:
-        size += io::CodedOutputStream::VarintSize32(
-            WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_FIXED32));
-        size += sizeof(int32);
+        size += io::CodedOutputStream::VarintSize32(WireFormatLite::MakeTag(
+            field.number(), WireFormatLite::WIRETYPE_FIXED32));
+        size += sizeof(int32_t);
         break;
       case UnknownField::TYPE_FIXED64:
-        size += io::CodedOutputStream::VarintSize32(
-            WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_FIXED64));
-        size += sizeof(int64);
+        size += io::CodedOutputStream::VarintSize32(WireFormatLite::MakeTag(
+            field.number(), WireFormatLite::WIRETYPE_FIXED64));
+        size += sizeof(int64_t);
         break;
       case UnknownField::TYPE_LENGTH_DELIMITED:
-        size += io::CodedOutputStream::VarintSize32(
-            WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_LENGTH_DELIMITED));
+        size += io::CodedOutputStream::VarintSize32(WireFormatLite::MakeTag(
+            field.number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED));
         size += io::CodedOutputStream::VarintSize32(
             field.length_delimited().size());
         size += field.length_delimited().size();
         break;
       case UnknownField::TYPE_GROUP:
-        size += io::CodedOutputStream::VarintSize32(
-            WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_START_GROUP));
+        size += io::CodedOutputStream::VarintSize32(WireFormatLite::MakeTag(
+            field.number(), WireFormatLite::WIRETYPE_START_GROUP));
         size += ComputeUnknownFieldsSize(field.group());
-        size += io::CodedOutputStream::VarintSize32(
-            WireFormatLite::MakeTag(field.number(),
-            WireFormatLite::WIRETYPE_END_GROUP));
+        size += io::CodedOutputStream::VarintSize32(WireFormatLite::MakeTag(
+            field.number(), WireFormatLite::WIRETYPE_END_GROUP));
         break;
     }
   }
@@ -395,8 +333,8 @@ bool WireFormat::ParseAndMergePartial(io::CodedInputStream* input,
   const Descriptor* descriptor = message->GetDescriptor();
   const Reflection* message_reflection = message->GetReflection();
 
-  while(true) {
-    uint32 tag = input->ReadTag();
+  while (true) {
+    uint32_t tag = input->ReadTag();
     if (tag == 0) {
       // End of input.  This is a valid place to end, so return true.
       return true;
@@ -408,26 +346,25 @@ bool WireFormat::ParseAndMergePartial(io::CodedInputStream* input,
       return true;
     }
 
-    const FieldDescriptor* field = NULL;
+    const FieldDescriptor* field = nullptr;
 
-    if (descriptor != NULL) {
+    if (descriptor != nullptr) {
       int field_number = WireFormatLite::GetTagFieldNumber(tag);
       field = descriptor->FindFieldByNumber(field_number);
 
       // If that failed, check if the field is an extension.
-      if (field == NULL && descriptor->IsExtensionNumber(field_number)) {
-        if (input->GetExtensionPool() == NULL) {
+      if (field == nullptr && descriptor->IsExtensionNumber(field_number)) {
+        if (input->GetExtensionPool() == nullptr) {
           field = message_reflection->FindKnownExtensionByNumber(field_number);
         } else {
-          field = input->GetExtensionPool()
-                       ->FindExtensionByNumber(descriptor, field_number);
+          field = input->GetExtensionPool()->FindExtensionByNumber(
+              descriptor, field_number);
         }
       }
 
       // If that failed, but we're a MessageSet, and this is the tag for a
       // MessageSet item, then parse that.
-      if (field == NULL &&
-          descriptor->options().message_set_wire_format() &&
+      if (field == nullptr && descriptor->options().message_set_wire_format() &&
           tag == WireFormatLite::kMessageSetItemStartTag) {
         if (!ParseAndMergeMessageSetItem(input, message)) {
           return false;
@@ -443,20 +380,20 @@ bool WireFormat::ParseAndMergePartial(io::CodedInputStream* input,
 }
 
 bool WireFormat::SkipMessageSetField(io::CodedInputStream* input,
-                                     uint32 field_number,
+                                     uint32_t field_number,
                                      UnknownFieldSet* unknown_fields) {
-  uint32 length;
+  uint32_t length;
   if (!input->ReadVarint32(&length)) return false;
-  return input->ReadString(
-      unknown_fields->AddLengthDelimited(field_number), length);
+  return input->ReadString(unknown_fields->AddLengthDelimited(field_number),
+                           length);
 }
 
-bool WireFormat::ParseAndMergeMessageSetField(uint32 field_number,
+bool WireFormat::ParseAndMergeMessageSetField(uint32_t field_number,
                                               const FieldDescriptor* field,
                                               Message* message,
                                               io::CodedInputStream* input) {
   const Reflection* message_reflection = message->GetReflection();
-  if (field == NULL) {
+  if (field == nullptr) {
     // We store unknown MessageSet extensions as groups.
     return SkipMessageSetField(
         input, field_number, message_reflection->MutableUnknownFields(message));
@@ -478,22 +415,21 @@ static bool StrictUtf8Check(const FieldDescriptor* field) {
 }
 
 bool WireFormat::ParseAndMergeField(
-    uint32 tag,
-    const FieldDescriptor* field,        // May be NULL for unknown
-    Message* message,
-    io::CodedInputStream* input) {
+    uint32_t tag,
+    const FieldDescriptor* field,  // May be nullptr for unknown
+    Message* message, io::CodedInputStream* input) {
   const Reflection* message_reflection = message->GetReflection();
 
   enum { UNKNOWN, NORMAL_FORMAT, PACKED_FORMAT } value_format;
 
-  if (field == NULL) {
+  if (field == nullptr) {
     value_format = UNKNOWN;
   } else if (WireFormatLite::GetTagWireType(tag) ==
              WireTypeForFieldType(field->type())) {
     value_format = NORMAL_FORMAT;
   } else if (field->is_packable() &&
              WireFormatLite::GetTagWireType(tag) ==
-             WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+                 WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
     value_format = PACKED_FORMAT;
   } else {
     // We don't recognize this field. Either the field number is unknown
@@ -505,36 +441,37 @@ bool WireFormat::ParseAndMergeField(
     return SkipField(input, tag,
                      message_reflection->MutableUnknownFields(message));
   } else if (value_format == PACKED_FORMAT) {
-    uint32 length;
+    uint32_t length;
     if (!input->ReadVarint32(&length)) return false;
     io::CodedInputStream::Limit limit = input->PushLimit(length);
 
     switch (field->type()) {
 #define HANDLE_PACKED_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD)                      \
-      case FieldDescriptor::TYPE_##TYPE: {                                     \
-        while (input->BytesUntilLimit() > 0) {                                 \
-          CPPTYPE value;                                                       \
-          if (!WireFormatLite::ReadPrimitive<                                  \
-                CPPTYPE, WireFormatLite::TYPE_##TYPE>(input, &value))          \
-            return false;                                                      \
-          message_reflection->Add##CPPTYPE_METHOD(message, field, value);      \
-        }                                                                      \
-        break;                                                                 \
-      }
+  case FieldDescriptor::TYPE_##TYPE: {                                         \
+    while (input->BytesUntilLimit() > 0) {                                     \
+      CPPTYPE value;                                                           \
+      if (!WireFormatLite::ReadPrimitive<CPPTYPE,                              \
+                                         WireFormatLite::TYPE_##TYPE>(input,   \
+                                                                      &value)) \
+        return false;                                                          \
+      message_reflection->Add##CPPTYPE_METHOD(message, field, value);          \
+    }                                                                          \
+    break;                                                                     \
+  }
 
-      HANDLE_PACKED_TYPE( INT32,  int32,  Int32)
-      HANDLE_PACKED_TYPE( INT64,  int64,  Int64)
-      HANDLE_PACKED_TYPE(SINT32,  int32,  Int32)
-      HANDLE_PACKED_TYPE(SINT64,  int64,  Int64)
-      HANDLE_PACKED_TYPE(UINT32, uint32, UInt32)
-      HANDLE_PACKED_TYPE(UINT64, uint64, UInt64)
+      HANDLE_PACKED_TYPE(INT32, int32_t, Int32)
+      HANDLE_PACKED_TYPE(INT64, int64_t, Int64)
+      HANDLE_PACKED_TYPE(SINT32, int32_t, Int32)
+      HANDLE_PACKED_TYPE(SINT64, int64_t, Int64)
+      HANDLE_PACKED_TYPE(UINT32, uint32_t, UInt32)
+      HANDLE_PACKED_TYPE(UINT64, uint64_t, UInt64)
 
-      HANDLE_PACKED_TYPE( FIXED32, uint32, UInt32)
-      HANDLE_PACKED_TYPE( FIXED64, uint64, UInt64)
-      HANDLE_PACKED_TYPE(SFIXED32,  int32,  Int32)
-      HANDLE_PACKED_TYPE(SFIXED64,  int64,  Int64)
+      HANDLE_PACKED_TYPE(FIXED32, uint32_t, UInt32)
+      HANDLE_PACKED_TYPE(FIXED64, uint64_t, UInt64)
+      HANDLE_PACKED_TYPE(SFIXED32, int32_t, Int32)
+      HANDLE_PACKED_TYPE(SFIXED64, int64_t, Int64)
 
-      HANDLE_PACKED_TYPE(FLOAT , float , Float )
+      HANDLE_PACKED_TYPE(FLOAT, float, Float)
       HANDLE_PACKED_TYPE(DOUBLE, double, Double)
 
       HANDLE_PACKED_TYPE(BOOL, bool, Bool)
@@ -544,23 +481,22 @@ bool WireFormat::ParseAndMergeField(
         while (input->BytesUntilLimit() > 0) {
           int value;
           if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
-                  input, &value)) return false;
+                  input, &value))
+            return false;
           if (message->GetDescriptor()->file()->syntax() ==
               FileDescriptor::SYNTAX_PROTO3) {
             message_reflection->AddEnumValue(message, field, value);
           } else {
             const EnumValueDescriptor* enum_value =
                 field->enum_type()->FindValueByNumber(value);
-            if (enum_value != NULL) {
+            if (enum_value != nullptr) {
               message_reflection->AddEnum(message, field, enum_value);
             } else {
               // The enum value is not one of the known values.  Add it to the
               // UnknownFieldSet.
-              int64 sign_extended_value = static_cast<int64>(value);
-              message_reflection->MutableUnknownFields(message)
-                  ->AddVarint(
-                      WireFormatLite::GetTagFieldNumber(tag),
-                      sign_extended_value);
+              int64_t sign_extended_value = static_cast<int64_t>(value);
+              message_reflection->MutableUnknownFields(message)->AddVarint(
+                  WireFormatLite::GetTagFieldNumber(tag), sign_extended_value);
             }
           }
         }
@@ -583,32 +519,32 @@ bool WireFormat::ParseAndMergeField(
     // Non-packed value (value_format == NORMAL_FORMAT)
     switch (field->type()) {
 #define HANDLE_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD)                            \
-      case FieldDescriptor::TYPE_##TYPE: {                                    \
-        CPPTYPE value;                                                        \
-        if (!WireFormatLite::ReadPrimitive<                                   \
-                CPPTYPE, WireFormatLite::TYPE_##TYPE>(input, &value))         \
-          return false;                                                       \
-        if (field->is_repeated()) {                                           \
-          message_reflection->Add##CPPTYPE_METHOD(message, field, value);     \
-        } else {                                                              \
-          message_reflection->Set##CPPTYPE_METHOD(message, field, value);     \
-        }                                                                     \
-        break;                                                                \
-      }
+  case FieldDescriptor::TYPE_##TYPE: {                                        \
+    CPPTYPE value;                                                            \
+    if (!WireFormatLite::ReadPrimitive<CPPTYPE, WireFormatLite::TYPE_##TYPE>( \
+            input, &value))                                                   \
+      return false;                                                           \
+    if (field->is_repeated()) {                                               \
+      message_reflection->Add##CPPTYPE_METHOD(message, field, value);         \
+    } else {                                                                  \
+      message_reflection->Set##CPPTYPE_METHOD(message, field, value);         \
+    }                                                                         \
+    break;                                                                    \
+  }
 
-      HANDLE_TYPE( INT32,  int32,  Int32)
-      HANDLE_TYPE( INT64,  int64,  Int64)
-      HANDLE_TYPE(SINT32,  int32,  Int32)
-      HANDLE_TYPE(SINT64,  int64,  Int64)
-      HANDLE_TYPE(UINT32, uint32, UInt32)
-      HANDLE_TYPE(UINT64, uint64, UInt64)
+      HANDLE_TYPE(INT32, int32_t, Int32)
+      HANDLE_TYPE(INT64, int64_t, Int64)
+      HANDLE_TYPE(SINT32, int32_t, Int32)
+      HANDLE_TYPE(SINT64, int64_t, Int64)
+      HANDLE_TYPE(UINT32, uint32_t, UInt32)
+      HANDLE_TYPE(UINT64, uint64_t, UInt64)
 
-      HANDLE_TYPE( FIXED32, uint32, UInt32)
-      HANDLE_TYPE( FIXED64, uint64, UInt64)
-      HANDLE_TYPE(SFIXED32,  int32,  Int32)
-      HANDLE_TYPE(SFIXED64,  int64,  Int64)
+      HANDLE_TYPE(FIXED32, uint32_t, UInt32)
+      HANDLE_TYPE(FIXED64, uint64_t, UInt64)
+      HANDLE_TYPE(SFIXED32, int32_t, Int32)
+      HANDLE_TYPE(SFIXED64, int64_t, Int64)
 
-      HANDLE_TYPE(FLOAT , float , Float )
+      HANDLE_TYPE(FLOAT, float, Float)
       HANDLE_TYPE(DOUBLE, double, Double)
 
       HANDLE_TYPE(BOOL, bool, Bool)
@@ -617,32 +553,12 @@ bool WireFormat::ParseAndMergeField(
       case FieldDescriptor::TYPE_ENUM: {
         int value;
         if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
-                input, &value)) return false;
-        if (message->GetDescriptor()->file()->syntax() ==
-            FileDescriptor::SYNTAX_PROTO3) {
-          if (field->is_repeated()) {
-            message_reflection->AddEnumValue(message, field, value);
-          } else {
-            message_reflection->SetEnumValue(message, field, value);
-          }
+                input, &value))
+          return false;
+        if (field->is_repeated()) {
+          message_reflection->AddEnumValue(message, field, value);
         } else {
-          const EnumValueDescriptor* enum_value =
-              field->enum_type()->FindValueByNumber(value);
-          if (enum_value != NULL) {
-            if (field->is_repeated()) {
-              message_reflection->AddEnum(message, field, enum_value);
-            } else {
-              message_reflection->SetEnum(message, field, enum_value);
-            }
-          } else {
-            // The enum value is not one of the known values.  Add it to the
-            // UnknownFieldSet.
-            int64 sign_extended_value = static_cast<int64>(value);
-            message_reflection->MutableUnknownFields(message)
-                              ->AddVarint(
-                                  WireFormatLite::GetTagFieldNumber(tag),
-                                  sign_extended_value);
-          }
+          message_reflection->SetEnumValue(message, field, value);
         }
         break;
       }
@@ -650,12 +566,12 @@ bool WireFormat::ParseAndMergeField(
       // Handle strings separately so that we can optimize the ctype=CORD case.
       case FieldDescriptor::TYPE_STRING: {
         bool strict_utf8_check = StrictUtf8Check(field);
-        string value;
+        std::string value;
         if (!WireFormatLite::ReadString(input, &value)) return false;
         if (strict_utf8_check) {
-          if (!WireFormatLite::VerifyUtf8String(
-                  value.data(), value.length(), WireFormatLite::PARSE,
-                  field->full_name().c_str())) {
+          if (!WireFormatLite::VerifyUtf8String(value.data(), value.length(),
+                                                WireFormatLite::PARSE,
+                                                field->full_name().c_str())) {
             return false;
           }
         } else {
@@ -671,7 +587,7 @@ bool WireFormat::ParseAndMergeField(
       }
 
       case FieldDescriptor::TYPE_BYTES: {
-        string value;
+        std::string value;
         if (!WireFormatLite::ReadBytes(input, &value)) return false;
         if (field->is_repeated()) {
           message_reflection->AddString(message, field, value);
@@ -716,93 +632,408 @@ bool WireFormat::ParseAndMergeField(
   return true;
 }
 
-bool WireFormat::ParseAndMergeMessageSetItem(
-    io::CodedInputStream* input,
-    Message* message) {
-  const Reflection* message_reflection = message->GetReflection();
-
-  // This method parses a group which should contain two fields:
-  //   required int32 type_id = 2;
-  //   required data message = 3;
+bool WireFormat::ParseAndMergeMessageSetItem(io::CodedInputStream* input,
+                                             Message* message) {
+  struct MSReflective {
+    bool ParseField(int type_id, io::CodedInputStream* input) {
+      const FieldDescriptor* field =
+          message_reflection->FindKnownExtensionByNumber(type_id);
+      return ParseAndMergeMessageSetField(type_id, field, message, input);
+    }
 
-  uint32 last_type_id = 0;
+    bool SkipField(uint32_t tag, io::CodedInputStream* input) {
+      return WireFormat::SkipField(input, tag, nullptr);
+    }
 
-  // Once we see a type_id, we'll look up the FieldDescriptor for the
-  // extension.
-  const FieldDescriptor* field = NULL;
+    const Reflection* message_reflection;
+    Message* message;
+  };
 
-  // If we see message data before the type_id, we'll append it to this so
-  // we can parse it later.
-  string message_data;
+  return ParseMessageSetItemImpl(
+      input, MSReflective{message->GetReflection(), message});
+}
 
-  while (true) {
-    uint32 tag = input->ReadTag();
-    if (tag == 0) return false;
-
-    switch (tag) {
-      case WireFormatLite::kMessageSetTypeIdTag: {
-        uint32 type_id;
-        if (!input->ReadVarint32(&type_id)) return false;
-        last_type_id = type_id;
-        field = message_reflection->FindKnownExtensionByNumber(type_id);
-
-        if (!message_data.empty()) {
-          // We saw some message data before the type_id.  Have to parse it
-          // now.
-          io::ArrayInputStream raw_input(message_data.data(),
-                                         message_data.size());
-          io::CodedInputStream sub_input(&raw_input);
-          if (!ParseAndMergeMessageSetField(last_type_id, field, message,
-                                            &sub_input)) {
-            return false;
+struct WireFormat::MessageSetParser {
+  const char* _InternalParse(const char* ptr, internal::ParseContext* ctx) {
+    // Parse a MessageSetItem
+    auto metadata = reflection->MutableInternalMetadata(msg);
+    std::string payload;
+    uint32_t type_id = 0;
+    bool payload_read = false;
+    while (!ctx->Done(&ptr)) {
+      // We use 64 bit tags in order to allow typeid's that span the whole
+      // range of 32 bit numbers.
+      uint32_t tag = static_cast<uint8_t>(*ptr++);
+      if (tag == WireFormatLite::kMessageSetTypeIdTag) {
+        uint64_t tmp;
+        ptr = ParseBigVarint(ptr, &tmp);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        type_id = tmp;
+        if (payload_read) {
+          const FieldDescriptor* field;
+          if (ctx->data().pool == nullptr) {
+            field = reflection->FindKnownExtensionByNumber(type_id);
+          } else {
+            field =
+                ctx->data().pool->FindExtensionByNumber(descriptor, type_id);
+          }
+          if (field == nullptr || field->message_type() == nullptr) {
+            WriteLengthDelimited(
+                type_id, payload,
+                metadata->mutable_unknown_fields<UnknownFieldSet>());
+          } else {
+            Message* value =
+                field->is_repeated()
+                    ? reflection->AddMessage(msg, field, ctx->data().factory)
+                    : reflection->MutableMessage(msg, field,
+                                                 ctx->data().factory);
+            const char* p;
+            // We can't use regular parse from string as we have to track
+            // proper recursion depth and descriptor pools.
+            ParseContext tmp_ctx(ctx->depth(), false, &p, payload);
+            tmp_ctx.data().pool = ctx->data().pool;
+            tmp_ctx.data().factory = ctx->data().factory;
+            GOOGLE_PROTOBUF_PARSER_ASSERT(value->_InternalParse(p, &tmp_ctx) &&
+                                           tmp_ctx.EndedAtLimit());
           }
-          message_data.clear();
+          type_id = 0;
+        }
+        continue;
+      } else if (tag == WireFormatLite::kMessageSetMessageTag) {
+        if (type_id == 0) {
+          int32_t size = ReadSize(&ptr);
+          GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+          ptr = ctx->ReadString(ptr, size, &payload);
+          GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+          payload_read = true;
+        } else {
+          // We're now parsing the payload
+          const FieldDescriptor* field = nullptr;
+          if (descriptor->IsExtensionNumber(type_id)) {
+            if (ctx->data().pool == nullptr) {
+              field = reflection->FindKnownExtensionByNumber(type_id);
+            } else {
+              field =
+                  ctx->data().pool->FindExtensionByNumber(descriptor, type_id);
+            }
+          }
+          ptr = WireFormat::_InternalParseAndMergeField(
+              msg, ptr, ctx, static_cast<uint64_t>(type_id) * 8 + 2, reflection,
+              field);
+          type_id = 0;
+        }
+      } else {
+        // An unknown field in MessageSetItem.
+        ptr = ReadTag(ptr - 1, &tag);
+        if (tag == 0 || (tag & 7) == WireFormatLite::WIRETYPE_END_GROUP) {
+          ctx->SetLastTag(tag);
+          return ptr;
         }
+        // Skip field.
+        ptr = internal::UnknownFieldParse(
+            tag, static_cast<std::string*>(nullptr), ptr, ctx);
+      }
+      GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+    }
+    return ptr;
+  }
 
+  const char* ParseMessageSet(const char* ptr, internal::ParseContext* ctx) {
+    while (!ctx->Done(&ptr)) {
+      uint32_t tag;
+      ptr = ReadTag(ptr, &tag);
+      if (PROTOBUF_PREDICT_FALSE(ptr == nullptr)) return nullptr;
+      if (tag == 0 || (tag & 7) == WireFormatLite::WIRETYPE_END_GROUP) {
+        ctx->SetLastTag(tag);
         break;
       }
+      if (tag == WireFormatLite::kMessageSetItemStartTag) {
+        // A message set item starts
+        ptr = ctx->ParseGroup(this, ptr, tag);
+      } else {
+        // Parse other fields as normal extensions.
+        int field_number = WireFormatLite::GetTagFieldNumber(tag);
+        const FieldDescriptor* field = nullptr;
+        if (descriptor->IsExtensionNumber(field_number)) {
+          if (ctx->data().pool == nullptr) {
+            field = reflection->FindKnownExtensionByNumber(field_number);
+          } else {
+            field = ctx->data().pool->FindExtensionByNumber(descriptor,
+                                                            field_number);
+          }
+        }
+        ptr = WireFormat::_InternalParseAndMergeField(msg, ptr, ctx, tag,
+                                                      reflection, field);
+      }
+      if (PROTOBUF_PREDICT_FALSE(ptr == nullptr)) return nullptr;
+    }
+    return ptr;
+  }
 
-      case WireFormatLite::kMessageSetMessageTag: {
-        if (last_type_id == 0) {
-          // We haven't seen a type_id yet.  Append this data to message_data.
-          string temp;
-          uint32 length;
-          if (!input->ReadVarint32(&length)) return false;
-          if (!input->ReadString(&temp, length)) return false;
-          io::StringOutputStream output_stream(&message_data);
-          io::CodedOutputStream coded_output(&output_stream);
-          coded_output.WriteVarint32(length);
-          coded_output.WriteString(temp);
-        } else {
-          // Already saw type_id, so we can parse this directly.
-          if (!ParseAndMergeMessageSetField(last_type_id, field, message,
-                                            input)) {
-            return false;
+  Message* msg;
+  const Descriptor* descriptor;
+  const Reflection* reflection;
+};
+
+const char* WireFormat::_InternalParse(Message* msg, const char* ptr,
+                                       internal::ParseContext* ctx) {
+  const Descriptor* descriptor = msg->GetDescriptor();
+  const Reflection* reflection = msg->GetReflection();
+  GOOGLE_DCHECK(descriptor);
+  GOOGLE_DCHECK(reflection);
+  if (descriptor->options().message_set_wire_format()) {
+    MessageSetParser message_set{msg, descriptor, reflection};
+    return message_set.ParseMessageSet(ptr, ctx);
+  }
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ReadTag(ptr, &tag);
+    if (PROTOBUF_PREDICT_FALSE(ptr == nullptr)) return nullptr;
+    if (tag == 0 || (tag & 7) == WireFormatLite::WIRETYPE_END_GROUP) {
+      ctx->SetLastTag(tag);
+      break;
+    }
+    const FieldDescriptor* field = nullptr;
+
+    int field_number = WireFormatLite::GetTagFieldNumber(tag);
+    field = descriptor->FindFieldByNumber(field_number);
+
+    // If that failed, check if the field is an extension.
+    if (field == nullptr && descriptor->IsExtensionNumber(field_number)) {
+      if (ctx->data().pool == nullptr) {
+        field = reflection->FindKnownExtensionByNumber(field_number);
+      } else {
+        field =
+            ctx->data().pool->FindExtensionByNumber(descriptor, field_number);
+      }
+    }
+
+    ptr = _InternalParseAndMergeField(msg, ptr, ctx, tag, reflection, field);
+    if (PROTOBUF_PREDICT_FALSE(ptr == nullptr)) return nullptr;
+  }
+  return ptr;
+}
+
+const char* WireFormat::_InternalParseAndMergeField(
+    Message* msg, const char* ptr, internal::ParseContext* ctx, uint64_t tag,
+    const Reflection* reflection, const FieldDescriptor* field) {
+  if (field == nullptr) {
+    // unknown field set parser takes 64bit tags, because message set type ids
+    // span the full 32 bit range making the tag span [0, 2^35) range.
+    return internal::UnknownFieldParse(
+        tag, reflection->MutableUnknownFields(msg), ptr, ctx);
+  }
+  if (WireFormatLite::GetTagWireType(tag) !=
+      WireTypeForFieldType(field->type())) {
+    if (field->is_packable() && WireFormatLite::GetTagWireType(tag) ==
+                                    WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+      switch (field->type()) {
+#define HANDLE_PACKED_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD)                   \
+  case FieldDescriptor::TYPE_##TYPE: {                                      \
+    ptr = internal::Packed##CPPTYPE_METHOD##Parser(                         \
+        reflection->MutableRepeatedFieldInternal<CPPTYPE>(msg, field), ptr, \
+        ctx);                                                               \
+    return ptr;                                                             \
+  }
+
+        HANDLE_PACKED_TYPE(INT32, int32_t, Int32)
+        HANDLE_PACKED_TYPE(INT64, int64_t, Int64)
+        HANDLE_PACKED_TYPE(SINT32, int32_t, SInt32)
+        HANDLE_PACKED_TYPE(SINT64, int64_t, SInt64)
+        HANDLE_PACKED_TYPE(UINT32, uint32_t, UInt32)
+        HANDLE_PACKED_TYPE(UINT64, uint64_t, UInt64)
+
+        HANDLE_PACKED_TYPE(FIXED32, uint32_t, Fixed32)
+        HANDLE_PACKED_TYPE(FIXED64, uint64_t, Fixed64)
+        HANDLE_PACKED_TYPE(SFIXED32, int32_t, SFixed32)
+        HANDLE_PACKED_TYPE(SFIXED64, int64_t, SFixed64)
+
+        HANDLE_PACKED_TYPE(FLOAT, float, Float)
+        HANDLE_PACKED_TYPE(DOUBLE, double, Double)
+
+        HANDLE_PACKED_TYPE(BOOL, bool, Bool)
+#undef HANDLE_PACKED_TYPE
+
+        case FieldDescriptor::TYPE_ENUM: {
+          auto rep_enum =
+              reflection->MutableRepeatedFieldInternal<int>(msg, field);
+          bool open_enum = false;
+          if (field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ||
+              open_enum) {
+            ptr = internal::PackedEnumParser(rep_enum, ptr, ctx);
+          } else {
+            return ctx->ReadPackedVarint(
+                ptr, [rep_enum, field, reflection, msg](uint64_t val) {
+                  if (field->enum_type()->FindValueByNumber(val) != nullptr) {
+                    rep_enum->Add(val);
+                  } else {
+                    WriteVarint(field->number(), val,
+                                reflection->MutableUnknownFields(msg));
+                  }
+                });
           }
+          return ptr;
         }
 
-        break;
+        case FieldDescriptor::TYPE_STRING:
+        case FieldDescriptor::TYPE_GROUP:
+        case FieldDescriptor::TYPE_MESSAGE:
+        case FieldDescriptor::TYPE_BYTES:
+          GOOGLE_LOG(FATAL) << "Can't reach";
+          return nullptr;
+      }
+    } else {
+      // mismatched wiretype;
+      return internal::UnknownFieldParse(
+          tag, reflection->MutableUnknownFields(msg), ptr, ctx);
+    }
+  }
+
+  // Non-packed value
+  bool utf8_check = false;
+  bool strict_utf8_check = false;
+  switch (field->type()) {
+#define HANDLE_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD)        \
+  case FieldDescriptor::TYPE_##TYPE: {                    \
+    CPPTYPE value;                                        \
+    ptr = VarintParse(ptr, &value);                       \
+    if (ptr == nullptr) return nullptr;                   \
+    if (field->is_repeated()) {                           \
+      reflection->Add##CPPTYPE_METHOD(msg, field, value); \
+    } else {                                              \
+      reflection->Set##CPPTYPE_METHOD(msg, field, value); \
+    }                                                     \
+    return ptr;                                           \
+  }
+
+    HANDLE_TYPE(BOOL, uint64_t, Bool)
+    HANDLE_TYPE(INT32, uint32_t, Int32)
+    HANDLE_TYPE(INT64, uint64_t, Int64)
+    HANDLE_TYPE(UINT32, uint32_t, UInt32)
+    HANDLE_TYPE(UINT64, uint64_t, UInt64)
+
+    case FieldDescriptor::TYPE_SINT32: {
+      int32_t value = ReadVarintZigZag32(&ptr);
+      if (ptr == nullptr) return nullptr;
+      if (field->is_repeated()) {
+        reflection->AddInt32(msg, field, value);
+      } else {
+        reflection->SetInt32(msg, field, value);
+      }
+      return ptr;
+    }
+    case FieldDescriptor::TYPE_SINT64: {
+      int64_t value = ReadVarintZigZag64(&ptr);
+      if (ptr == nullptr) return nullptr;
+      if (field->is_repeated()) {
+        reflection->AddInt64(msg, field, value);
+      } else {
+        reflection->SetInt64(msg, field, value);
+      }
+      return ptr;
+    }
+#undef HANDLE_TYPE
+#define HANDLE_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD)        \
+  case FieldDescriptor::TYPE_##TYPE: {                    \
+    CPPTYPE value;                                        \
+    value = UnalignedLoad<CPPTYPE>(ptr);                  \
+    ptr += sizeof(CPPTYPE);                               \
+    if (field->is_repeated()) {                           \
+      reflection->Add##CPPTYPE_METHOD(msg, field, value); \
+    } else {                                              \
+      reflection->Set##CPPTYPE_METHOD(msg, field, value); \
+    }                                                     \
+    return ptr;                                           \
+  }
+
+      HANDLE_TYPE(FIXED32, uint32_t, UInt32)
+      HANDLE_TYPE(FIXED64, uint64_t, UInt64)
+      HANDLE_TYPE(SFIXED32, int32_t, Int32)
+      HANDLE_TYPE(SFIXED64, int64_t, Int64)
+
+      HANDLE_TYPE(FLOAT, float, Float)
+      HANDLE_TYPE(DOUBLE, double, Double)
+
+#undef HANDLE_TYPE
+
+    case FieldDescriptor::TYPE_ENUM: {
+      uint32_t value;
+      ptr = VarintParse(ptr, &value);
+      if (ptr == nullptr) return nullptr;
+      if (field->is_repeated()) {
+        reflection->AddEnumValue(msg, field, value);
+      } else {
+        reflection->SetEnumValue(msg, field, value);
       }
+      return ptr;
+    }
 
-      case WireFormatLite::kMessageSetItemEndTag: {
-        return true;
+    // Handle strings separately so that we can optimize the ctype=CORD case.
+    case FieldDescriptor::TYPE_STRING:
+      utf8_check = true;
+      strict_utf8_check = StrictUtf8Check(field);
+      PROTOBUF_FALLTHROUGH_INTENDED;
+    case FieldDescriptor::TYPE_BYTES: {
+      int size = ReadSize(&ptr);
+      if (ptr == nullptr) return nullptr;
+      std::string value;
+      ptr = ctx->ReadString(ptr, size, &value);
+      if (ptr == nullptr) return nullptr;
+      if (utf8_check) {
+        if (strict_utf8_check) {
+          if (!WireFormatLite::VerifyUtf8String(value.data(), value.length(),
+                                                WireFormatLite::PARSE,
+                                                field->full_name().c_str())) {
+            return nullptr;
+          }
+        } else {
+          VerifyUTF8StringNamedField(value.data(), value.length(), PARSE,
+                                     field->full_name().c_str());
+        }
+      }
+      if (field->is_repeated()) {
+        reflection->AddString(msg, field, std::move(value));
+      } else {
+        reflection->SetString(msg, field, std::move(value));
+      }
+      return ptr;
+    }
+
+    case FieldDescriptor::TYPE_GROUP: {
+      Message* sub_message;
+      if (field->is_repeated()) {
+        sub_message = reflection->AddMessage(msg, field, ctx->data().factory);
+      } else {
+        sub_message =
+            reflection->MutableMessage(msg, field, ctx->data().factory);
       }
 
-      default: {
-        if (!SkipField(input, tag, NULL)) return false;
+      return ctx->ParseGroup(sub_message, ptr, tag);
+    }
+
+    case FieldDescriptor::TYPE_MESSAGE: {
+      Message* sub_message;
+      if (field->is_repeated()) {
+        sub_message = reflection->AddMessage(msg, field, ctx->data().factory);
+      } else {
+        sub_message =
+            reflection->MutableMessage(msg, field, ctx->data().factory);
       }
+      return ctx->ParseMessage(sub_message, ptr);
     }
   }
+
+  // GCC 8 complains about control reaching end of non-void function here.
+  // Let's keep it happy by returning a nullptr.
+  return nullptr;
 }
 
 // ===================================================================
 
-void WireFormat::SerializeWithCachedSizes(
-    const Message& message,
-    int size, io::CodedOutputStream* output) {
+uint8_t* WireFormat::_InternalSerialize(const Message& message, uint8_t* target,
+                                        io::EpsCopyOutputStream* stream) {
   const Descriptor* descriptor = message.GetDescriptor();
   const Reflection* message_reflection = message.GetReflection();
-  int expected_endpoint = output->ByteCount() + size;
 
   std::vector<const FieldDescriptor*> fields;
 
@@ -815,27 +1046,23 @@ void WireFormat::SerializeWithCachedSizes(
     message_reflection->ListFields(message, &fields);
   }
 
-  for (int i = 0; i < fields.size(); i++) {
-    SerializeFieldWithCachedSizes(fields[i], message, output);
+  for (auto field : fields) {
+    target = InternalSerializeField(field, message, target, stream);
   }
 
   if (descriptor->options().message_set_wire_format()) {
-    SerializeUnknownMessageSetItems(
-        message_reflection->GetUnknownFields(message), output);
+    return InternalSerializeUnknownMessageSetItemsToArray(
+        message_reflection->GetUnknownFields(message), target, stream);
   } else {
-    SerializeUnknownFields(
-        message_reflection->GetUnknownFields(message), output);
+    return InternalSerializeUnknownFieldsToArray(
+        message_reflection->GetUnknownFields(message), target, stream);
   }
-
-  GOOGLE_CHECK_EQ(output->ByteCount(), expected_endpoint)
-    << ": Protocol message serialized to a size different from what was "
-       "originally expected.  Perhaps it was modified by another thread "
-       "during serialization?";
 }
 
-static void SerializeMapKeyWithCachedSizes(const FieldDescriptor* field,
-                                           const MapKey& value,
-                                           io::CodedOutputStream* output) {
+uint8_t* SerializeMapKeyWithCachedSizes(const FieldDescriptor* field,
+                                        const MapKey& value, uint8_t* target,
+                                        io::EpsCopyOutputStream* stream) {
+  target = stream->EnsureSpace(target);
   switch (field->type()) {
     case FieldDescriptor::TYPE_DOUBLE:
     case FieldDescriptor::TYPE_FLOAT:
@@ -845,10 +1072,10 @@ static void SerializeMapKeyWithCachedSizes(const FieldDescriptor* field,
     case FieldDescriptor::TYPE_ENUM:
       GOOGLE_LOG(FATAL) << "Unsupported";
       break;
-#define CASE_TYPE(FieldType, CamelFieldType, CamelCppType)                     \
-  case FieldDescriptor::TYPE_##FieldType:                                      \
-    WireFormatLite::Write##CamelFieldType(1, value.Get##CamelCppType##Value(), \
-                                          output);                             \
+#define CASE_TYPE(FieldType, CamelFieldType, CamelCppType)   \
+  case FieldDescriptor::TYPE_##FieldType:                    \
+    target = WireFormatLite::Write##CamelFieldType##ToArray( \
+        1, value.Get##CamelCppType##Value(), target);        \
     break;
       CASE_TYPE(INT64, Int64, Int64)
       CASE_TYPE(UINT64, UInt64, UInt64)
@@ -861,19 +1088,23 @@ static void SerializeMapKeyWithCachedSizes(const FieldDescriptor* field,
       CASE_TYPE(SFIXED64, SFixed64, Int64)
       CASE_TYPE(SINT32, SInt32, Int32)
       CASE_TYPE(SINT64, SInt64, Int64)
-      CASE_TYPE(STRING, String, String)
 #undef CASE_TYPE
+    case FieldDescriptor::TYPE_STRING:
+      target = stream->WriteString(1, value.GetStringValue(), target);
+      break;
   }
+  return target;
 }
 
-static void SerializeMapValueRefWithCachedSizes(const FieldDescriptor* field,
-                                                const MapValueRef& value,
-                                                io::CodedOutputStream* output) {
+static uint8_t* SerializeMapValueRefWithCachedSizes(
+    const FieldDescriptor* field, const MapValueConstRef& value,
+    uint8_t* target, io::EpsCopyOutputStream* stream) {
+  target = stream->EnsureSpace(target);
   switch (field->type()) {
-#define CASE_TYPE(FieldType, CamelFieldType, CamelCppType)                     \
-  case FieldDescriptor::TYPE_##FieldType:                                      \
-    WireFormatLite::Write##CamelFieldType(2, value.Get##CamelCppType##Value(), \
-                                          output);                             \
+#define CASE_TYPE(FieldType, CamelFieldType, CamelCppType)   \
+  case FieldDescriptor::TYPE_##FieldType:                    \
+    target = WireFormatLite::Write##CamelFieldType##ToArray( \
+        2, value.Get##CamelCppType##Value(), target);        \
     break;
     CASE_TYPE(INT64, Int64, Int64)
     CASE_TYPE(UINT64, UInt64, UInt64)
@@ -889,12 +1120,21 @@ static void SerializeMapValueRefWithCachedSizes(const FieldDescriptor* field,
     CASE_TYPE(ENUM, Enum, Enum)
     CASE_TYPE(DOUBLE, Double, Double)
     CASE_TYPE(FLOAT, Float, Float)
-    CASE_TYPE(STRING, String, String)
-    CASE_TYPE(BYTES, Bytes, String)
-    CASE_TYPE(MESSAGE, Message, Message)
-    CASE_TYPE(GROUP, Group, Message)
 #undef CASE_TYPE
+    case FieldDescriptor::TYPE_STRING:
+    case FieldDescriptor::TYPE_BYTES:
+      target = stream->WriteString(2, value.GetStringValue(), target);
+      break;
+    case FieldDescriptor::TYPE_MESSAGE:
+      target = WireFormatLite::InternalWriteMessage(2, value.GetMessageValue(),
+                                                    target, stream);
+      break;
+    case FieldDescriptor::TYPE_GROUP:
+      target = WireFormatLite::InternalWriteGroup(2, value.GetMessageValue(),
+                                                  target, stream);
+      break;
   }
+  return target;
 }
 
 class MapKeySorter {
@@ -940,34 +1180,38 @@ class MapKeySorter {
   };
 };
 
-static void SerializeMapEntry(const FieldDescriptor* field, const MapKey& key,
-                              const MapValueRef& value,
-                              io::CodedOutputStream* output) {
+static uint8_t* InternalSerializeMapEntry(const FieldDescriptor* field,
+                                          const MapKey& key,
+                                          const MapValueConstRef& value,
+                                          uint8_t* target,
+                                          io::EpsCopyOutputStream* stream) {
   const FieldDescriptor* key_field = field->message_type()->field(0);
   const FieldDescriptor* value_field = field->message_type()->field(1);
 
-  WireFormatLite::WriteTag(field->number(),
-                           WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
   size_t size = kMapEntryTagByteSize;
   size += MapKeyDataOnlyByteSize(key_field, key);
   size += MapValueRefDataOnlyByteSize(value_field, value);
-  output->WriteVarint32(size);
-  SerializeMapKeyWithCachedSizes(key_field, key, output);
-  SerializeMapValueRefWithCachedSizes(value_field, value, output);
+  target = stream->EnsureSpace(target);
+  target = WireFormatLite::WriteTagToArray(
+      field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target);
+  target = io::CodedOutputStream::WriteVarint32ToArray(size, target);
+  target = SerializeMapKeyWithCachedSizes(key_field, key, target, stream);
+  target =
+      SerializeMapValueRefWithCachedSizes(value_field, value, target, stream);
+  return target;
 }
 
-void WireFormat::SerializeFieldWithCachedSizes(
-    const FieldDescriptor* field,
-    const Message& message,
-    io::CodedOutputStream* output) {
+uint8_t* WireFormat::InternalSerializeField(const FieldDescriptor* field,
+                                            const Message& message,
+                                            uint8_t* target,
+                                            io::EpsCopyOutputStream* stream) {
   const Reflection* message_reflection = message.GetReflection();
 
   if (field->is_extension() &&
       field->containing_type()->options().message_set_wire_format() &&
       field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE &&
       !field->is_repeated()) {
-    SerializeMessageSetItemWithCachedSizes(field, message, output);
-    return;
+    return InternalSerializeMessageSetItem(field, message, target, stream);
   }
 
   // For map fields, we can use either repeated field reflection or map
@@ -985,18 +1229,18 @@ void WireFormat::SerializeFieldWithCachedSizes(
   // internal state and existing references that came from map reflection remain
   // valid for both reading and writing.
   if (field->is_map()) {
-    MapFieldBase* map_field =
-        message_reflection->MapData(const_cast<Message*>(&message), field);
+    const MapFieldBase* map_field =
+        message_reflection->GetMapData(message, field);
     if (map_field->IsMapValid()) {
-      if (output->IsSerializationDeterministic()) {
+      if (stream->IsSerializationDeterministic()) {
         std::vector<MapKey> sorted_key_list =
             MapKeySorter::SortKey(message, message_reflection, field);
         for (std::vector<MapKey>::iterator it = sorted_key_list.begin();
              it != sorted_key_list.end(); ++it) {
-          MapValueRef map_value;
-          message_reflection->InsertOrLookupMapValue(
-              const_cast<Message*>(&message), field, *it, &map_value);
-          SerializeMapEntry(field, *it, map_value, output);
+          MapValueConstRef map_value;
+          message_reflection->LookupMapValue(message, field, *it, &map_value);
+          target =
+              InternalSerializeMapEntry(field, *it, map_value, target, stream);
         }
       } else {
         for (MapIterator it = message_reflection->MapBegin(
@@ -1004,14 +1248,14 @@ void WireFormat::SerializeFieldWithCachedSizes(
              it !=
              message_reflection->MapEnd(const_cast<Message*>(&message), field);
              ++it) {
-          SerializeMapEntry(field, it.GetKey(), it.GetValueRef(), output);
+          target = InternalSerializeMapEntry(field, it.GetKey(),
+                                             it.GetValueRef(), target, stream);
         }
       }
 
-      return;
+      return target;
     }
   }
-
   int count = 0;
 
   if (field->is_repeated()) {
@@ -1025,80 +1269,114 @@ void WireFormat::SerializeFieldWithCachedSizes(
 
   // map_entries is for maps that'll be deterministically serialized.
   std::vector<const Message*> map_entries;
-  if (count > 1 && field->is_map() && output->IsSerializationDeterministic()) {
+  if (count > 1 && field->is_map() && stream->IsSerializationDeterministic()) {
     map_entries =
         DynamicMapSorter::Sort(message, count, message_reflection, field);
   }
 
-  const bool is_packed = field->is_packed();
-  if (is_packed && count > 0) {
-    WireFormatLite::WriteTag(field->number(),
-        WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    const size_t data_size = FieldDataOnlyByteSize(field, message);
-    output->WriteVarint32(data_size);
+  if (field->is_packed()) {
+    if (count == 0) return target;
+    target = stream->EnsureSpace(target);
+    switch (field->type()) {
+#define HANDLE_PRIMITIVE_TYPE(TYPE, CPPTYPE, TYPE_METHOD, CPPTYPE_METHOD)      \
+  case FieldDescriptor::TYPE_##TYPE: {                                         \
+    auto r =                                                                   \
+        message_reflection->GetRepeatedFieldInternal<CPPTYPE>(message, field); \
+    target = stream->Write##TYPE_METHOD##Packed(                               \
+        field->number(), r, FieldDataOnlyByteSize(field, message), target);    \
+    break;                                                                     \
+  }
+
+      HANDLE_PRIMITIVE_TYPE(INT32, int32_t, Int32, Int32)
+      HANDLE_PRIMITIVE_TYPE(INT64, int64_t, Int64, Int64)
+      HANDLE_PRIMITIVE_TYPE(SINT32, int32_t, SInt32, Int32)
+      HANDLE_PRIMITIVE_TYPE(SINT64, int64_t, SInt64, Int64)
+      HANDLE_PRIMITIVE_TYPE(UINT32, uint32_t, UInt32, UInt32)
+      HANDLE_PRIMITIVE_TYPE(UINT64, uint64_t, UInt64, UInt64)
+      HANDLE_PRIMITIVE_TYPE(ENUM, int, Enum, Enum)
+
+#undef HANDLE_PRIMITIVE_TYPE
+#define HANDLE_PRIMITIVE_TYPE(TYPE, CPPTYPE, TYPE_METHOD, CPPTYPE_METHOD)      \
+  case FieldDescriptor::TYPE_##TYPE: {                                         \
+    auto r =                                                                   \
+        message_reflection->GetRepeatedFieldInternal<CPPTYPE>(message, field); \
+    target = stream->WriteFixedPacked(field->number(), r, target);             \
+    break;                                                                     \
+  }
+
+      HANDLE_PRIMITIVE_TYPE(FIXED32, uint32_t, Fixed32, UInt32)
+      HANDLE_PRIMITIVE_TYPE(FIXED64, uint64_t, Fixed64, UInt64)
+      HANDLE_PRIMITIVE_TYPE(SFIXED32, int32_t, SFixed32, Int32)
+      HANDLE_PRIMITIVE_TYPE(SFIXED64, int64_t, SFixed64, Int64)
+
+      HANDLE_PRIMITIVE_TYPE(FLOAT, float, Float, Float)
+      HANDLE_PRIMITIVE_TYPE(DOUBLE, double, Double, Double)
+
+      HANDLE_PRIMITIVE_TYPE(BOOL, bool, Bool, Bool)
+#undef HANDLE_PRIMITIVE_TYPE
+      default:
+        GOOGLE_LOG(FATAL) << "Invalid descriptor";
+    }
+    return target;
   }
 
   for (int j = 0; j < count; j++) {
+    target = stream->EnsureSpace(target);
     switch (field->type()) {
-#define HANDLE_PRIMITIVE_TYPE(TYPE, CPPTYPE, TYPE_METHOD, CPPTYPE_METHOD)      \
-      case FieldDescriptor::TYPE_##TYPE: {                                     \
-        const CPPTYPE value = field->is_repeated() ?                           \
-                              message_reflection->GetRepeated##CPPTYPE_METHOD( \
-                                message, field, j) :                           \
-                              message_reflection->Get##CPPTYPE_METHOD(         \
-                                message, field);                               \
-        if (is_packed) {                                                       \
-          WireFormatLite::Write##TYPE_METHOD##NoTag(value, output);            \
-        } else {                                                               \
-          WireFormatLite::Write##TYPE_METHOD(field->number(), value, output);  \
-        }                                                                      \
-        break;                                                                 \
-      }
+#define HANDLE_PRIMITIVE_TYPE(TYPE, CPPTYPE, TYPE_METHOD, CPPTYPE_METHOD)     \
+  case FieldDescriptor::TYPE_##TYPE: {                                        \
+    const CPPTYPE value =                                                     \
+        field->is_repeated()                                                  \
+            ? message_reflection->GetRepeated##CPPTYPE_METHOD(message, field, \
+                                                              j)              \
+            : message_reflection->Get##CPPTYPE_METHOD(message, field);        \
+    target = WireFormatLite::Write##TYPE_METHOD##ToArray(field->number(),     \
+                                                         value, target);      \
+    break;                                                                    \
+  }
 
-      HANDLE_PRIMITIVE_TYPE( INT32,  int32,  Int32,  Int32)
-      HANDLE_PRIMITIVE_TYPE( INT64,  int64,  Int64,  Int64)
-      HANDLE_PRIMITIVE_TYPE(SINT32,  int32, SInt32,  Int32)
-      HANDLE_PRIMITIVE_TYPE(SINT64,  int64, SInt64,  Int64)
-      HANDLE_PRIMITIVE_TYPE(UINT32, uint32, UInt32, UInt32)
-      HANDLE_PRIMITIVE_TYPE(UINT64, uint64, UInt64, UInt64)
+      HANDLE_PRIMITIVE_TYPE(INT32, int32_t, Int32, Int32)
+      HANDLE_PRIMITIVE_TYPE(INT64, int64_t, Int64, Int64)
+      HANDLE_PRIMITIVE_TYPE(SINT32, int32_t, SInt32, Int32)
+      HANDLE_PRIMITIVE_TYPE(SINT64, int64_t, SInt64, Int64)
+      HANDLE_PRIMITIVE_TYPE(UINT32, uint32_t, UInt32, UInt32)
+      HANDLE_PRIMITIVE_TYPE(UINT64, uint64_t, UInt64, UInt64)
 
-      HANDLE_PRIMITIVE_TYPE( FIXED32, uint32,  Fixed32, UInt32)
-      HANDLE_PRIMITIVE_TYPE( FIXED64, uint64,  Fixed64, UInt64)
-      HANDLE_PRIMITIVE_TYPE(SFIXED32,  int32, SFixed32,  Int32)
-      HANDLE_PRIMITIVE_TYPE(SFIXED64,  int64, SFixed64,  Int64)
+      HANDLE_PRIMITIVE_TYPE(FIXED32, uint32_t, Fixed32, UInt32)
+      HANDLE_PRIMITIVE_TYPE(FIXED64, uint64_t, Fixed64, UInt64)
+      HANDLE_PRIMITIVE_TYPE(SFIXED32, int32_t, SFixed32, Int32)
+      HANDLE_PRIMITIVE_TYPE(SFIXED64, int64_t, SFixed64, Int64)
 
-      HANDLE_PRIMITIVE_TYPE(FLOAT , float , Float , Float )
+      HANDLE_PRIMITIVE_TYPE(FLOAT, float, Float, Float)
       HANDLE_PRIMITIVE_TYPE(DOUBLE, double, Double, Double)
 
       HANDLE_PRIMITIVE_TYPE(BOOL, bool, Bool, Bool)
 #undef HANDLE_PRIMITIVE_TYPE
 
-#define HANDLE_TYPE(TYPE, TYPE_METHOD, CPPTYPE_METHOD)                      \
-      case FieldDescriptor::TYPE_##TYPE:                                    \
-        WireFormatLite::Write##TYPE_METHOD(                                 \
-              field->number(),                                              \
-              field->is_repeated() ?                                        \
-                (map_entries.empty() ?                                      \
-                     message_reflection->GetRepeated##CPPTYPE_METHOD(       \
-                                     message, field, j) :                   \
-                     *map_entries[j]) :                                     \
-                message_reflection->Get##CPPTYPE_METHOD(message, field),    \
-              output);                                                      \
-        break;
+#define HANDLE_TYPE(TYPE, TYPE_METHOD, CPPTYPE_METHOD)                         \
+  case FieldDescriptor::TYPE_##TYPE:                                           \
+    target = WireFormatLite::InternalWrite##TYPE_METHOD(                       \
+        field->number(),                                                       \
+        field->is_repeated()                                                   \
+            ? (map_entries.empty()                                             \
+                   ? message_reflection->GetRepeated##CPPTYPE_METHOD(message,  \
+                                                                     field, j) \
+                   : *map_entries[j])                                          \
+            : message_reflection->Get##CPPTYPE_METHOD(message, field),         \
+        target, stream);                                                       \
+    break;
 
-      HANDLE_TYPE(GROUP  , Group  , Message)
+      HANDLE_TYPE(GROUP, Group, Message)
       HANDLE_TYPE(MESSAGE, Message, Message)
 #undef HANDLE_TYPE
 
       case FieldDescriptor::TYPE_ENUM: {
-        const EnumValueDescriptor* value = field->is_repeated() ?
-          message_reflection->GetRepeatedEnum(message, field, j) :
-          message_reflection->GetEnum(message, field);
-        if (is_packed) {
-          WireFormatLite::WriteEnumNoTag(value->number(), output);
-        } else {
-          WireFormatLite::WriteEnum(field->number(), value->number(), output);
-        }
+        const EnumValueDescriptor* value =
+            field->is_repeated()
+                ? message_reflection->GetRepeatedEnum(message, field, j)
+                : message_reflection->GetEnum(message, field);
+        target = WireFormatLite::WriteEnumToArray(field->number(),
+                                                  value->number(), target);
         break;
       }
 
@@ -1106,11 +1384,13 @@ void WireFormat::SerializeFieldWithCachedSizes(
       // instead of copying.
       case FieldDescriptor::TYPE_STRING: {
         bool strict_utf8_check = StrictUtf8Check(field);
-        string scratch;
-        const string& value = field->is_repeated() ?
-          message_reflection->GetRepeatedStringReference(
-            message, field, j, &scratch) :
-          message_reflection->GetStringReference(message, field, &scratch);
+        std::string scratch;
+        const std::string& value =
+            field->is_repeated()
+                ? message_reflection->GetRepeatedStringReference(message, field,
+                                                                 j, &scratch)
+                : message_reflection->GetStringReference(message, field,
+                                                         &scratch);
         if (strict_utf8_check) {
           WireFormatLite::VerifyUtf8String(value.data(), value.length(),
                                            WireFormatLite::SERIALIZE,
@@ -1119,45 +1399,47 @@ void WireFormat::SerializeFieldWithCachedSizes(
           VerifyUTF8StringNamedField(value.data(), value.length(), SERIALIZE,
                                      field->full_name().c_str());
         }
-        WireFormatLite::WriteString(field->number(), value, output);
+        target = stream->WriteString(field->number(), value, target);
         break;
       }
 
       case FieldDescriptor::TYPE_BYTES: {
-        string scratch;
-        const string& value = field->is_repeated() ?
-          message_reflection->GetRepeatedStringReference(
-            message, field, j, &scratch) :
-          message_reflection->GetStringReference(message, field, &scratch);
-        WireFormatLite::WriteBytes(field->number(), value, output);
+        std::string scratch;
+        const std::string& value =
+            field->is_repeated()
+                ? message_reflection->GetRepeatedStringReference(message, field,
+                                                                 j, &scratch)
+                : message_reflection->GetStringReference(message, field,
+                                                         &scratch);
+        target = stream->WriteString(field->number(), value, target);
         break;
       }
     }
   }
+  return target;
 }
 
-void WireFormat::SerializeMessageSetItemWithCachedSizes(
-    const FieldDescriptor* field,
-    const Message& message,
-    io::CodedOutputStream* output) {
+uint8_t* WireFormat::InternalSerializeMessageSetItem(
+    const FieldDescriptor* field, const Message& message, uint8_t* target,
+    io::EpsCopyOutputStream* stream) {
   const Reflection* message_reflection = message.GetReflection();
 
+  target = stream->EnsureSpace(target);
   // Start group.
-  output->WriteVarint32(WireFormatLite::kMessageSetItemStartTag);
-
+  target = io::CodedOutputStream::WriteTagToArray(
+      WireFormatLite::kMessageSetItemStartTag, target);
   // Write type ID.
-  output->WriteVarint32(WireFormatLite::kMessageSetTypeIdTag);
-  output->WriteVarint32(field->number());
-
+  target = WireFormatLite::WriteUInt32ToArray(
+      WireFormatLite::kMessageSetTypeIdNumber, field->number(), target);
   // Write message.
-  output->WriteVarint32(WireFormatLite::kMessageSetMessageTag);
-
-  const Message& sub_message = message_reflection->GetMessage(message, field);
-  output->WriteVarint32(sub_message.GetCachedSize());
-  sub_message.SerializeWithCachedSizes(output);
-
+  target = WireFormatLite::InternalWriteMessage(
+      WireFormatLite::kMessageSetMessageNumber,
+      message_reflection->GetMessage(message, field), target, stream);
   // End group.
-  output->WriteVarint32(WireFormatLite::kMessageSetItemEndTag);
+  target = stream->EnsureSpace(target);
+  target = io::CodedOutputStream::WriteTagToArray(
+      WireFormatLite::kMessageSetItemEndTag, target);
+  return target;
 }
 
 // ===================================================================
@@ -1179,24 +1461,23 @@ size_t WireFormat::ByteSize(const Message& message) {
     message_reflection->ListFields(message, &fields);
   }
 
-  for (int i = 0; i < fields.size(); i++) {
-    our_size += FieldByteSize(fields[i], message);
+  for (const FieldDescriptor* field : fields) {
+    our_size += FieldByteSize(field, message);
   }
 
   if (descriptor->options().message_set_wire_format()) {
     our_size += ComputeUnknownMessageSetItemsSize(
-      message_reflection->GetUnknownFields(message));
+        message_reflection->GetUnknownFields(message));
   } else {
-    our_size += ComputeUnknownFieldsSize(
-      message_reflection->GetUnknownFields(message));
+    our_size +=
+        ComputeUnknownFieldsSize(message_reflection->GetUnknownFields(message));
   }
 
   return our_size;
 }
 
-size_t WireFormat::FieldByteSize(
-    const FieldDescriptor* field,
-    const Message& message) {
+size_t WireFormat::FieldByteSize(const FieldDescriptor* field,
+                                 const Message& message) {
   const Reflection* message_reflection = message.GetReflection();
 
   if (field->is_extension() &&
@@ -1208,7 +1489,17 @@ size_t WireFormat::FieldByteSize(
 
   size_t count = 0;
   if (field->is_repeated()) {
-    count = FromIntSize(message_reflection->FieldSize(message, field));
+    if (field->is_map()) {
+      const MapFieldBase* map_field =
+          message_reflection->GetMapData(message, field);
+      if (map_field->IsMapValid()) {
+        count = FromIntSize(map_field->size());
+      } else {
+        count = FromIntSize(message_reflection->FieldSize(message, field));
+      }
+    } else {
+      count = FromIntSize(message_reflection->FieldSize(message, field));
+    }
   } else if (field->containing_type()->options().map_entry()) {
     // Map entry fields always need to be serialized.
     count = 1;
@@ -1232,8 +1523,8 @@ size_t WireFormat::FieldByteSize(
   return our_size;
 }
 
-static size_t MapKeyDataOnlyByteSize(const FieldDescriptor* field,
-                                     const MapKey& value) {
+size_t MapKeyDataOnlyByteSize(const FieldDescriptor* field,
+                              const MapKey& value) {
   GOOGLE_DCHECK_EQ(FieldDescriptor::TypeToCppType(field->type()), value.type());
   switch (field->type()) {
     case FieldDescriptor::TYPE_DOUBLE:
@@ -1274,7 +1565,7 @@ static size_t MapKeyDataOnlyByteSize(const FieldDescriptor* field,
 }
 
 static size_t MapValueRefDataOnlyByteSize(const FieldDescriptor* field,
-                                          const MapValueRef& value) {
+                                          const MapValueConstRef& value) {
   switch (field->type()) {
     case FieldDescriptor::TYPE_GROUP:
       GOOGLE_LOG(FATAL) << "Unsupported";
@@ -1313,16 +1604,15 @@ static size_t MapValueRefDataOnlyByteSize(const FieldDescriptor* field,
   return 0;
 }
 
-size_t WireFormat::FieldDataOnlyByteSize(
-    const FieldDescriptor* field,
-    const Message& message) {
+size_t WireFormat::FieldDataOnlyByteSize(const FieldDescriptor* field,
+                                         const Message& message) {
   const Reflection* message_reflection = message.GetReflection();
 
   size_t data_size = 0;
 
   if (field->is_map()) {
-    MapFieldBase* map_field =
-        message_reflection->MapData(const_cast<Message*>(&message), field);
+    const MapFieldBase* map_field =
+        message_reflection->GetMapData(message, field);
     if (map_field->IsMapValid()) {
       MapIterator iter(const_cast<Message*>(&message), field);
       MapIterator end(const_cast<Message*>(&message), field);
@@ -1351,56 +1641,56 @@ size_t WireFormat::FieldDataOnlyByteSize(
   }
 
   switch (field->type()) {
-#define HANDLE_TYPE(TYPE, TYPE_METHOD, CPPTYPE_METHOD)                     \
-    case FieldDescriptor::TYPE_##TYPE:                                     \
-      if (field->is_repeated()) {                                          \
-        for (int j = 0; j < count; j++) {                                  \
-          data_size += WireFormatLite::TYPE_METHOD##Size(                  \
-            message_reflection->GetRepeated##CPPTYPE_METHOD(               \
-              message, field, j));                                         \
-        }                                                                  \
-      } else {                                                             \
-        data_size += WireFormatLite::TYPE_METHOD##Size(                    \
-          message_reflection->Get##CPPTYPE_METHOD(message, field));        \
-      }                                                                    \
-      break;
+#define HANDLE_TYPE(TYPE, TYPE_METHOD, CPPTYPE_METHOD)                      \
+  case FieldDescriptor::TYPE_##TYPE:                                        \
+    if (field->is_repeated()) {                                             \
+      for (size_t j = 0; j < count; j++) {                                  \
+        data_size += WireFormatLite::TYPE_METHOD##Size(                     \
+            message_reflection->GetRepeated##CPPTYPE_METHOD(message, field, \
+                                                            j));            \
+      }                                                                     \
+    } else {                                                                \
+      data_size += WireFormatLite::TYPE_METHOD##Size(                       \
+          message_reflection->Get##CPPTYPE_METHOD(message, field));         \
+    }                                                                       \
+    break;
 
-#define HANDLE_FIXED_TYPE(TYPE, TYPE_METHOD)                               \
-    case FieldDescriptor::TYPE_##TYPE:                                     \
-      data_size += count * WireFormatLite::k##TYPE_METHOD##Size;           \
-      break;
+#define HANDLE_FIXED_TYPE(TYPE, TYPE_METHOD)                   \
+  case FieldDescriptor::TYPE_##TYPE:                           \
+    data_size += count * WireFormatLite::k##TYPE_METHOD##Size; \
+    break;
 
-    HANDLE_TYPE( INT32,  Int32,  Int32)
-    HANDLE_TYPE( INT64,  Int64,  Int64)
-    HANDLE_TYPE(SINT32, SInt32,  Int32)
-    HANDLE_TYPE(SINT64, SInt64,  Int64)
+    HANDLE_TYPE(INT32, Int32, Int32)
+    HANDLE_TYPE(INT64, Int64, Int64)
+    HANDLE_TYPE(SINT32, SInt32, Int32)
+    HANDLE_TYPE(SINT64, SInt64, Int64)
     HANDLE_TYPE(UINT32, UInt32, UInt32)
     HANDLE_TYPE(UINT64, UInt64, UInt64)
 
-    HANDLE_FIXED_TYPE( FIXED32,  Fixed32)
-    HANDLE_FIXED_TYPE( FIXED64,  Fixed64)
+    HANDLE_FIXED_TYPE(FIXED32, Fixed32)
+    HANDLE_FIXED_TYPE(FIXED64, Fixed64)
     HANDLE_FIXED_TYPE(SFIXED32, SFixed32)
     HANDLE_FIXED_TYPE(SFIXED64, SFixed64)
 
-    HANDLE_FIXED_TYPE(FLOAT , Float )
+    HANDLE_FIXED_TYPE(FLOAT, Float)
     HANDLE_FIXED_TYPE(DOUBLE, Double)
 
     HANDLE_FIXED_TYPE(BOOL, Bool)
 
-    HANDLE_TYPE(GROUP  , Group  , Message)
+    HANDLE_TYPE(GROUP, Group, Message)
     HANDLE_TYPE(MESSAGE, Message, Message)
 #undef HANDLE_TYPE
 #undef HANDLE_FIXED_TYPE
 
     case FieldDescriptor::TYPE_ENUM: {
       if (field->is_repeated()) {
-        for (int j = 0; j < count; j++) {
+        for (size_t j = 0; j < count; j++) {
           data_size += WireFormatLite::EnumSize(
-            message_reflection->GetRepeatedEnum(message, field, j)->number());
+              message_reflection->GetRepeatedEnum(message, field, j)->number());
         }
       } else {
         data_size += WireFormatLite::EnumSize(
-          message_reflection->GetEnum(message, field)->number());
+            message_reflection->GetEnum(message, field)->number());
       }
       break;
     }
@@ -1409,12 +1699,14 @@ size_t WireFormat::FieldDataOnlyByteSize(
     // instead of copying.
     case FieldDescriptor::TYPE_STRING:
     case FieldDescriptor::TYPE_BYTES: {
-      for (int j = 0; j < count; j++) {
-        string scratch;
-        const string& value = field->is_repeated() ?
-          message_reflection->GetRepeatedStringReference(
-            message, field, j, &scratch) :
-          message_reflection->GetStringReference(message, field, &scratch);
+      for (size_t j = 0; j < count; j++) {
+        std::string scratch;
+        const std::string& value =
+            field->is_repeated()
+                ? message_reflection->GetRepeatedStringReference(message, field,
+                                                                 j, &scratch)
+                : message_reflection->GetStringReference(message, field,
+                                                         &scratch);
         data_size += WireFormatLite::StringSize(value);
       }
       break;
@@ -1423,9 +1715,8 @@ size_t WireFormat::FieldDataOnlyByteSize(
   return data_size;
 }
 
-size_t WireFormat::MessageSetItemByteSize(
-    const FieldDescriptor* field,
-    const Message& message) {
+size_t WireFormat::MessageSetItemByteSize(const FieldDescriptor* field,
+                                          const Message& message) {
   const Reflection* message_reflection = message.GetReflection();
 
   size_t our_size = WireFormatLite::kMessageSetItemTagsSize;
@@ -1443,6 +1734,18 @@ size_t WireFormat::MessageSetItemByteSize(
   return our_size;
 }
 
+// Compute the size of the UnknownFieldSet on the wire.
+size_t ComputeUnknownFieldsSize(const InternalMetadata& metadata,
+                                size_t total_size, CachedSize* cached_size) {
+  total_size += WireFormat::ComputeUnknownFieldsSize(
+      metadata.unknown_fields<UnknownFieldSet>(
+          UnknownFieldSet::default_instance));
+  cached_size->Set(ToCachedSize(total_size));
+  return total_size;
+}
+
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index d602d21..3628be3 100644 (file)
 #define GOOGLE_PROTOBUF_WIRE_FORMAT_H__
 
 #include <string>
+
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/parse_context.h>
+#include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_util.h>
 #include <google/protobuf/message.h>
+#include <google/protobuf/metadata_lite.h>
 #include <google/protobuf/wire_format_lite.h>
+#include <google/protobuf/stubs/casts.h>
+
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
+#include <google/protobuf/port_def.inc>
 
 namespace google {
 namespace protobuf {
-  namespace io {
-    class CodedInputStream;      // coded_stream.h
-    class CodedOutputStream;     // coded_stream.h
-  }
-  class UnknownFieldSet;         // unknown_field_set.h
-}
+class MapKey;           // map_field.h
+class UnknownFieldSet;  // unknown_field_set.h
+}  // namespace protobuf
+}  // namespace google
 
+namespace google {
 namespace protobuf {
 namespace internal {
 
 // This class is for internal use by the protocol buffer library and by
-// protocol-complier-generated message classes.  It must not be called
+// protocol-compiler-generated message classes.  It must not be called
 // directly by clients.
 //
 // This class contains code for implementing the binary protocol buffer
@@ -66,9 +77,8 @@ namespace internal {
 // non-reflection based routines.
 //
 // This class is really a namespace that contains only static methods
-class LIBPROTOBUF_EXPORT WireFormat {
+class PROTOBUF_EXPORT WireFormat {
  public:
-
   // Given a field return its WireType
   static inline WireFormatLite::WireType WireTypeForField(
       const FieldDescriptor* field);
@@ -100,6 +110,11 @@ class LIBPROTOBUF_EXPORT WireFormat {
   static bool ParseAndMergePartial(io::CodedInputStream* input,
                                    Message* message);
 
+  // This is meant for internal protobuf use (WireFormat is an internal class).
+  // This is the reflective implementation of the _InternalParse functionality.
+  static const char* _InternalParse(Message* msg, const char* ptr,
+                                    internal::ParseContext* ctx);
+
   // Serialize a message in protocol buffer wire format.
   //
   // Any embedded messages within the message must have their correct sizes
@@ -107,9 +122,18 @@ class LIBPROTOBUF_EXPORT WireFormat {
   // a parameter to this procedure.
   //
   // These return false iff the underlying stream returns a write error.
-  static void SerializeWithCachedSizes(
-      const Message& message,
-      int size, io::CodedOutputStream* output);
+  static void SerializeWithCachedSizes(const Message& message, int size,
+                                       io::CodedOutputStream* output) {
+    int expected_endpoint = output->ByteCount() + size;
+    output->SetCur(
+        _InternalSerialize(message, output->Cur(), output->EpsCopy()));
+    GOOGLE_CHECK_EQ(output->ByteCount(), expected_endpoint)
+        << ": Protocol message serialized to a size different from what was "
+           "originally expected.  Perhaps it was modified by another thread "
+           "during serialization?";
+  }
+  static uint8_t* _InternalSerialize(const Message& message, uint8_t* target,
+                                     io::EpsCopyOutputStream* stream);
 
   // Implements Message::ByteSize() via reflection.  WARNING:  The result
   // of this method is *not* cached anywhere.  However, all embedded messages
@@ -122,49 +146,65 @@ class LIBPROTOBUF_EXPORT WireFormat {
   // Helpers for dealing with unknown fields
 
   // Skips a field value of the given WireType.  The input should start
-  // positioned immediately after the tag.  If unknown_fields is non-NULL,
+  // positioned immediately after the tag.  If unknown_fields is non-nullptr,
   // the contents of the field will be added to it.
-  static bool SkipField(io::CodedInputStream* input, uint32 tag,
+  static bool SkipField(io::CodedInputStream* input, uint32_t tag,
                         UnknownFieldSet* unknown_fields);
 
-  // Reads and ignores a message from the input.  If unknown_fields is non-NULL,
-  // the contents will be added to it.
+  // Reads and ignores a message from the input.  If unknown_fields is
+  // non-nullptr, the contents will be added to it.
   static bool SkipMessage(io::CodedInputStream* input,
                           UnknownFieldSet* unknown_fields);
 
-  // Read a packed enum field. If the is_valid function is not NULL, values for
-  // which is_valid(value) returns false are appended to unknown_fields_stream.
+  // Read a packed enum field. If the is_valid function is not nullptr, values
+  // for which is_valid(value) returns false are appended to
+  // unknown_fields_stream.
   static bool ReadPackedEnumPreserveUnknowns(io::CodedInputStream* input,
-                                             uint32 field_number,
+                                             uint32_t field_number,
                                              bool (*is_valid)(int),
                                              UnknownFieldSet* unknown_fields,
                                              RepeatedField<int>* values);
 
   // Write the contents of an UnknownFieldSet to the output.
   static void SerializeUnknownFields(const UnknownFieldSet& unknown_fields,
-                                     io::CodedOutputStream* output);
+                                     io::CodedOutputStream* output) {
+    output->SetCur(InternalSerializeUnknownFieldsToArray(
+        unknown_fields, output->Cur(), output->EpsCopy()));
+  }
   // Same as above, except writing directly to the provided buffer.
   // Requires that the buffer have sufficient capacity for
   // ComputeUnknownFieldsSize(unknown_fields).
   //
   // Returns a pointer past the last written byte.
-  static uint8* SerializeUnknownFieldsToArray(
-      const UnknownFieldSet& unknown_fields,
-      uint8* target);
+  static uint8_t* SerializeUnknownFieldsToArray(
+      const UnknownFieldSet& unknown_fields, uint8_t* target) {
+    io::EpsCopyOutputStream stream(
+        target, static_cast<int>(ComputeUnknownFieldsSize(unknown_fields)),
+        io::CodedOutputStream::IsDefaultSerializationDeterministic());
+    return InternalSerializeUnknownFieldsToArray(unknown_fields, target,
+                                                 &stream);
+  }
+  static uint8_t* InternalSerializeUnknownFieldsToArray(
+      const UnknownFieldSet& unknown_fields, uint8_t* target,
+      io::EpsCopyOutputStream* stream);
 
   // Same thing except for messages that have the message_set_wire_format
   // option.
   static void SerializeUnknownMessageSetItems(
-      const UnknownFieldSet& unknown_fields,
-      io::CodedOutputStream* output);
+      const UnknownFieldSet& unknown_fields, io::CodedOutputStream* output) {
+    output->SetCur(InternalSerializeUnknownMessageSetItemsToArray(
+        unknown_fields, output->Cur(), output->EpsCopy()));
+  }
   // Same as above, except writing directly to the provided buffer.
   // Requires that the buffer have sufficient capacity for
   // ComputeUnknownMessageSetItemsSize(unknown_fields).
   //
   // Returns a pointer past the last written byte.
-  static uint8* SerializeUnknownMessageSetItemsToArray(
-      const UnknownFieldSet& unknown_fields,
-      uint8* target);
+  static uint8_t* SerializeUnknownMessageSetItemsToArray(
+      const UnknownFieldSet& unknown_fields, uint8_t* target);
+  static uint8_t* InternalSerializeUnknownMessageSetItemsToArray(
+      const UnknownFieldSet& unknown_fields, uint8_t* target,
+      io::EpsCopyOutputStream* stream);
 
   // Compute the size of the UnknownFieldSet on the wire.
   static size_t ComputeUnknownFieldsSize(const UnknownFieldSet& unknown_fields);
@@ -174,54 +214,59 @@ class LIBPROTOBUF_EXPORT WireFormat {
   static size_t ComputeUnknownMessageSetItemsSize(
       const UnknownFieldSet& unknown_fields);
 
-
   // Helper functions for encoding and decoding tags.  (Inlined below and in
   // _inl.h)
   //
-  // This is different from MakeTag(field->number(), field->type()) in the case
-  // of packed repeated fields.
-  static uint32 MakeTag(const FieldDescriptor* field);
+  // This is different from MakeTag(field->number(), field->type()) in the
+  // case of packed repeated fields.
+  static uint32_t MakeTag(const FieldDescriptor* field);
 
   // Parse a single field.  The input should start out positioned immediately
   // after the tag.
   static bool ParseAndMergeField(
-      uint32 tag,
-      const FieldDescriptor* field,        // May be NULL for unknown
-      Message* message,
-      io::CodedInputStream* input);
+      uint32_t tag,
+      const FieldDescriptor* field,  // May be nullptr for unknown
+      Message* message, io::CodedInputStream* input);
 
   // Serialize a single field.
   static void SerializeFieldWithCachedSizes(
-      const FieldDescriptor* field,        // Cannot be NULL
-      const Message& message,
-      io::CodedOutputStream* output);
+      const FieldDescriptor* field,  // Cannot be nullptr
+      const Message& message, io::CodedOutputStream* output) {
+    output->SetCur(InternalSerializeField(field, message, output->Cur(),
+                                          output->EpsCopy()));
+  }
+  static uint8_t* InternalSerializeField(
+      const FieldDescriptor* field,  // Cannot be nullptr
+      const Message& message, uint8_t* target, io::EpsCopyOutputStream* stream);
 
   // Compute size of a single field.  If the field is a message type, this
   // will call ByteSize() for the embedded message, insuring that it caches
   // its size.
-  static size_t FieldByteSize(
-      const FieldDescriptor* field,        // Cannot be NULL
-      const Message& message);
+  static size_t FieldByteSize(const FieldDescriptor* field,  // Can't be nullptr
+                              const Message& message);
 
   // Parse/serialize a MessageSet::Item group.  Used with messages that use
-  // opion message_set_wire_format = true.
-  static bool ParseAndMergeMessageSetItem(
-      io::CodedInputStream* input,
-      Message* message);
+  // option message_set_wire_format = true.
+  static bool ParseAndMergeMessageSetItem(io::CodedInputStream* input,
+                                          Message* message);
   static void SerializeMessageSetItemWithCachedSizes(
-      const FieldDescriptor* field,
-      const Message& message,
-      io::CodedOutputStream* output);
-  static size_t MessageSetItemByteSize(
-      const FieldDescriptor* field,
-      const Message& message);
+      const FieldDescriptor* field, const Message& message,
+      io::CodedOutputStream* output) {
+    output->SetCur(InternalSerializeMessageSetItem(
+        field, message, output->Cur(), output->EpsCopy()));
+  }
+  static uint8_t* InternalSerializeMessageSetItem(
+      const FieldDescriptor* field, const Message& message, uint8_t* target,
+      io::EpsCopyOutputStream* stream);
+  static size_t MessageSetItemByteSize(const FieldDescriptor* field,
+                                       const Message& message);
 
   // Computes the byte size of a field, excluding tags. For packed fields, it
   // only includes the size of the raw data, and not the size of the total
   // length, but for other length-delimited types, the size of the length is
   // included.
   static size_t FieldDataOnlyByteSize(
-      const FieldDescriptor* field,        // Cannot be NULL
+      const FieldDescriptor* field,  // Cannot be nullptr
       const Message& message);
 
   enum Operation {
@@ -235,37 +280,42 @@ class LIBPROTOBUF_EXPORT WireFormat {
   static void VerifyUTF8String(const char* data, int size, Operation op);
   // The NamedField variant takes a field name in order to produce an
   // informative error message if verification fails.
-  static void VerifyUTF8StringNamedField(const char* data,
-                                         int size,
-                                         Operation op,
-                                         const char* field_name);
+  static void VerifyUTF8StringNamedField(const char* data, int size,
+                                         Operation op, const char* field_name);
 
  private:
+  struct MessageSetParser;
   // Skip a MessageSet field.
   static bool SkipMessageSetField(io::CodedInputStream* input,
-                                  uint32 field_number,
+                                  uint32_t field_number,
                                   UnknownFieldSet* unknown_fields);
 
   // Parse a MessageSet field.
-  static bool ParseAndMergeMessageSetField(uint32 field_number,
+  static bool ParseAndMergeMessageSetField(uint32_t field_number,
                                            const FieldDescriptor* field,
                                            Message* message,
                                            io::CodedInputStream* input);
+  // Parses the value from the wire that belongs to tag.
+  static const char* _InternalParseAndMergeField(Message* msg, const char* ptr,
+                                                 internal::ParseContext* ctx,
+                                                 uint64_t tag,
+                                                 const Reflection* reflection,
+                                                 const FieldDescriptor* field);
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(WireFormat);
 };
 
 // Subclass of FieldSkipper which saves skipped fields to an UnknownFieldSet.
-class LIBPROTOBUF_EXPORT UnknownFieldSetFieldSkipper : public FieldSkipper {
+class PROTOBUF_EXPORT UnknownFieldSetFieldSkipper : public FieldSkipper {
  public:
   UnknownFieldSetFieldSkipper(UnknownFieldSet* unknown_fields)
       : unknown_fields_(unknown_fields) {}
-  virtual ~UnknownFieldSetFieldSkipper() {}
+  ~UnknownFieldSetFieldSkipper() override {}
 
   // implements FieldSkipper -----------------------------------------
-  virtual bool SkipField(io::CodedInputStream* input, uint32 tag);
-  virtual bool SkipMessage(io::CodedInputStream* input);
-  virtual void SkipUnknownEnum(int field_number, int value);
+  bool SkipField(io::CodedInputStream* input, uint32_t tag) override;
+  bool SkipMessage(io::CodedInputStream* input) override;
+  void SkipUnknownEnum(int field_number, int value) override;
 
  protected:
   UnknownFieldSet* unknown_fields_;
@@ -287,11 +337,10 @@ inline WireFormatLite::WireType WireFormat::WireTypeForFieldType(
   // Some compilers don't like enum -> enum casts, so we implicit_cast to
   // int first.
   return WireFormatLite::WireTypeForFieldType(
-      static_cast<WireFormatLite::FieldType>(
-        implicit_cast<int>(type)));
+      static_cast<WireFormatLite::FieldType>(implicit_cast<int>(type)));
 }
 
-inline uint32 WireFormat::MakeTag(const FieldDescriptor* field) {
+inline uint32_t WireFormat::MakeTag(const FieldDescriptor* field) {
   return WireFormatLite::MakeTag(field->number(), WireTypeForField(field));
 }
 
@@ -299,37 +348,67 @@ inline size_t WireFormat::TagSize(int field_number,
                                   FieldDescriptor::Type type) {
   // Some compilers don't like enum -> enum casts, so we implicit_cast to
   // int first.
-  return WireFormatLite::TagSize(field_number,
-      static_cast<WireFormatLite::FieldType>(
-        implicit_cast<int>(type)));
+  return WireFormatLite::TagSize(
+      field_number,
+      static_cast<WireFormatLite::FieldType>(implicit_cast<int>(type)));
 }
 
 inline void WireFormat::VerifyUTF8String(const char* data, int size,
-    WireFormat::Operation op) {
+                                         WireFormat::Operation op) {
 #ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
   WireFormatLite::VerifyUtf8String(
-      data, size, static_cast<WireFormatLite::Operation>(op), NULL);
+      data, size, static_cast<WireFormatLite::Operation>(op), nullptr);
 #else
   // Avoid the compiler warning about unused variables.
-  (void)data; (void)size; (void)op;
+  (void)data;
+  (void)size;
+  (void)op;
 #endif
 }
 
-inline void WireFormat::VerifyUTF8StringNamedField(
-    const char* data, int size, WireFormat::Operation op,
-    const char* field_name) {
+inline void WireFormat::VerifyUTF8StringNamedField(const char* data, int size,
+                                                   WireFormat::Operation op,
+                                                   const char* field_name) {
 #ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
   WireFormatLite::VerifyUtf8String(
       data, size, static_cast<WireFormatLite::Operation>(op), field_name);
 #else
   // Avoid the compiler warning about unused variables.
-  (void)data; (void)size; (void)op; (void)field_name;
+  (void)data;
+  (void)size;
+  (void)op;
+  (void)field_name;
 #endif
 }
 
 
+inline uint8_t* InternalSerializeUnknownMessageSetItemsToArray(
+    const UnknownFieldSet& unknown_fields, uint8_t* target,
+    io::EpsCopyOutputStream* stream) {
+  return WireFormat::InternalSerializeUnknownMessageSetItemsToArray(
+      unknown_fields, target, stream);
+}
+
+inline size_t ComputeUnknownMessageSetItemsSize(
+    const UnknownFieldSet& unknown_fields) {
+  return WireFormat::ComputeUnknownMessageSetItemsSize(unknown_fields);
+}
+
+// Compute the size of the UnknownFieldSet on the wire.
+PROTOBUF_EXPORT
+size_t ComputeUnknownFieldsSize(const InternalMetadata& metadata, size_t size,
+                                CachedSize* cached_size);
+
+size_t MapKeyDataOnlyByteSize(const FieldDescriptor* field,
+                              const MapKey& value);
+
+uint8_t* SerializeMapKeyWithCachedSizes(const FieldDescriptor* field,
+                                        const MapKey& value, uint8_t* target,
+                                        io::EpsCopyOutputStream* stream);
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_WIRE_FORMAT_H__
index cd343b7..b16edb4 100644 (file)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/wire_format_lite.h>
 
-#ifdef __SSE_4_1__
-#include <immintrin.h>
-#endif
+#include <limits>
 #include <stack>
 #include <string>
 #include <vector>
+
 #include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/stringprintf.h>
-#include <google/protobuf/io/coded_stream_inl.h>
+#include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/io/zero_copy_stream.h>
 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
 
 
+#include <google/protobuf/port_def.inc>
+
 namespace google {
 namespace protobuf {
 namespace internal {
 
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
+#if !defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)
 // Old version of MSVC doesn't like definitions of inline constants, GCC
 // requires them.
 const int WireFormatLite::kMessageSetItemStartTag;
@@ -65,79 +65,78 @@ const int WireFormatLite::kMessageSetMessageTag;
 
 // IBM xlC requires prefixing constants with WireFormatLite::
 const size_t WireFormatLite::kMessageSetItemTagsSize =
-  io::CodedOutputStream::StaticVarintSize32<
-      WireFormatLite::kMessageSetItemStartTag>::value +
-  io::CodedOutputStream::StaticVarintSize32<
-      WireFormatLite::kMessageSetItemEndTag>::value +
-  io::CodedOutputStream::StaticVarintSize32<
-      WireFormatLite::kMessageSetTypeIdTag>::value +
-  io::CodedOutputStream::StaticVarintSize32<
-      WireFormatLite::kMessageSetMessageTag>::value;
+    io::CodedOutputStream::StaticVarintSize32<
+        WireFormatLite::kMessageSetItemStartTag>::value +
+    io::CodedOutputStream::StaticVarintSize32<
+        WireFormatLite::kMessageSetItemEndTag>::value +
+    io::CodedOutputStream::StaticVarintSize32<
+        WireFormatLite::kMessageSetTypeIdTag>::value +
+    io::CodedOutputStream::StaticVarintSize32<
+        WireFormatLite::kMessageSetMessageTag>::value;
 
 const WireFormatLite::CppType
-WireFormatLite::kFieldTypeToCppTypeMap[MAX_FIELD_TYPE + 1] = {
-  static_cast<CppType>(0),  // 0 is reserved for errors
-
-  CPPTYPE_DOUBLE,   // TYPE_DOUBLE
-  CPPTYPE_FLOAT,    // TYPE_FLOAT
-  CPPTYPE_INT64,    // TYPE_INT64
-  CPPTYPE_UINT64,   // TYPE_UINT64
-  CPPTYPE_INT32,    // TYPE_INT32
-  CPPTYPE_UINT64,   // TYPE_FIXED64
-  CPPTYPE_UINT32,   // TYPE_FIXED32
-  CPPTYPE_BOOL,     // TYPE_BOOL
-  CPPTYPE_STRING,   // TYPE_STRING
-  CPPTYPE_MESSAGE,  // TYPE_GROUP
-  CPPTYPE_MESSAGE,  // TYPE_MESSAGE
-  CPPTYPE_STRING,   // TYPE_BYTES
-  CPPTYPE_UINT32,   // TYPE_UINT32
-  CPPTYPE_ENUM,     // TYPE_ENUM
-  CPPTYPE_INT32,    // TYPE_SFIXED32
-  CPPTYPE_INT64,    // TYPE_SFIXED64
-  CPPTYPE_INT32,    // TYPE_SINT32
-  CPPTYPE_INT64,    // TYPE_SINT64
+    WireFormatLite::kFieldTypeToCppTypeMap[MAX_FIELD_TYPE + 1] = {
+        static_cast<CppType>(0),  // 0 is reserved for errors
+
+        CPPTYPE_DOUBLE,   // TYPE_DOUBLE
+        CPPTYPE_FLOAT,    // TYPE_FLOAT
+        CPPTYPE_INT64,    // TYPE_INT64
+        CPPTYPE_UINT64,   // TYPE_UINT64
+        CPPTYPE_INT32,    // TYPE_INT32
+        CPPTYPE_UINT64,   // TYPE_FIXED64
+        CPPTYPE_UINT32,   // TYPE_FIXED32
+        CPPTYPE_BOOL,     // TYPE_BOOL
+        CPPTYPE_STRING,   // TYPE_STRING
+        CPPTYPE_MESSAGE,  // TYPE_GROUP
+        CPPTYPE_MESSAGE,  // TYPE_MESSAGE
+        CPPTYPE_STRING,   // TYPE_BYTES
+        CPPTYPE_UINT32,   // TYPE_UINT32
+        CPPTYPE_ENUM,     // TYPE_ENUM
+        CPPTYPE_INT32,    // TYPE_SFIXED32
+        CPPTYPE_INT64,    // TYPE_SFIXED64
+        CPPTYPE_INT32,    // TYPE_SINT32
+        CPPTYPE_INT64,    // TYPE_SINT64
 };
 
 const WireFormatLite::WireType
-WireFormatLite::kWireTypeForFieldType[MAX_FIELD_TYPE + 1] = {
-  static_cast<WireFormatLite::WireType>(-1),  // invalid
-  WireFormatLite::WIRETYPE_FIXED64,           // TYPE_DOUBLE
-  WireFormatLite::WIRETYPE_FIXED32,           // TYPE_FLOAT
-  WireFormatLite::WIRETYPE_VARINT,            // TYPE_INT64
-  WireFormatLite::WIRETYPE_VARINT,            // TYPE_UINT64
-  WireFormatLite::WIRETYPE_VARINT,            // TYPE_INT32
-  WireFormatLite::WIRETYPE_FIXED64,           // TYPE_FIXED64
-  WireFormatLite::WIRETYPE_FIXED32,           // TYPE_FIXED32
-  WireFormatLite::WIRETYPE_VARINT,            // TYPE_BOOL
-  WireFormatLite::WIRETYPE_LENGTH_DELIMITED,  // TYPE_STRING
-  WireFormatLite::WIRETYPE_START_GROUP,       // TYPE_GROUP
-  WireFormatLite::WIRETYPE_LENGTH_DELIMITED,  // TYPE_MESSAGE
-  WireFormatLite::WIRETYPE_LENGTH_DELIMITED,  // TYPE_BYTES
-  WireFormatLite::WIRETYPE_VARINT,            // TYPE_UINT32
-  WireFormatLite::WIRETYPE_VARINT,            // TYPE_ENUM
-  WireFormatLite::WIRETYPE_FIXED32,           // TYPE_SFIXED32
-  WireFormatLite::WIRETYPE_FIXED64,           // TYPE_SFIXED64
-  WireFormatLite::WIRETYPE_VARINT,            // TYPE_SINT32
-  WireFormatLite::WIRETYPE_VARINT,            // TYPE_SINT64
+    WireFormatLite::kWireTypeForFieldType[MAX_FIELD_TYPE + 1] = {
+        static_cast<WireFormatLite::WireType>(-1),  // invalid
+        WireFormatLite::WIRETYPE_FIXED64,           // TYPE_DOUBLE
+        WireFormatLite::WIRETYPE_FIXED32,           // TYPE_FLOAT
+        WireFormatLite::WIRETYPE_VARINT,            // TYPE_INT64
+        WireFormatLite::WIRETYPE_VARINT,            // TYPE_UINT64
+        WireFormatLite::WIRETYPE_VARINT,            // TYPE_INT32
+        WireFormatLite::WIRETYPE_FIXED64,           // TYPE_FIXED64
+        WireFormatLite::WIRETYPE_FIXED32,           // TYPE_FIXED32
+        WireFormatLite::WIRETYPE_VARINT,            // TYPE_BOOL
+        WireFormatLite::WIRETYPE_LENGTH_DELIMITED,  // TYPE_STRING
+        WireFormatLite::WIRETYPE_START_GROUP,       // TYPE_GROUP
+        WireFormatLite::WIRETYPE_LENGTH_DELIMITED,  // TYPE_MESSAGE
+        WireFormatLite::WIRETYPE_LENGTH_DELIMITED,  // TYPE_BYTES
+        WireFormatLite::WIRETYPE_VARINT,            // TYPE_UINT32
+        WireFormatLite::WIRETYPE_VARINT,            // TYPE_ENUM
+        WireFormatLite::WIRETYPE_FIXED32,           // TYPE_SFIXED32
+        WireFormatLite::WIRETYPE_FIXED64,           // TYPE_SFIXED64
+        WireFormatLite::WIRETYPE_VARINT,            // TYPE_SINT32
+        WireFormatLite::WIRETYPE_VARINT,            // TYPE_SINT64
 };
 
-bool WireFormatLite::SkipField(
-    io::CodedInputStream* input, uint32 tag) {
+bool WireFormatLite::SkipField(io::CodedInputStream* input, uint32_t tag) {
   // Field number 0 is illegal.
   if (WireFormatLite::GetTagFieldNumber(tag) == 0) return false;
   switch (WireFormatLite::GetTagWireType(tag)) {
     case WireFormatLite::WIRETYPE_VARINT: {
-      uint64 value;
+      uint64_t value;
       if (!input->ReadVarint64(&value)) return false;
       return true;
     }
     case WireFormatLite::WIRETYPE_FIXED64: {
-      uint64 value;
+      uint64_t value;
       if (!input->ReadLittleEndian64(&value)) return false;
       return true;
     }
     case WireFormatLite::WIRETYPE_LENGTH_DELIMITED: {
-      uint32 length;
+      uint32_t length;
       if (!input->ReadVarint32(&length)) return false;
       if (!input->Skip(length)) return false;
       return true;
@@ -147,9 +146,9 @@ bool WireFormatLite::SkipField(
       if (!SkipMessage(input)) return false;
       input->DecrementRecursionDepth();
       // Check that the ending tag matched the starting tag.
-      if (!input->LastTagWas(WireFormatLite::MakeTag(
-          WireFormatLite::GetTagFieldNumber(tag),
-          WireFormatLite::WIRETYPE_END_GROUP))) {
+      if (!input->LastTagWas(
+              WireFormatLite::MakeTag(WireFormatLite::GetTagFieldNumber(tag),
+                                      WireFormatLite::WIRETYPE_END_GROUP))) {
         return false;
       }
       return true;
@@ -158,7 +157,7 @@ bool WireFormatLite::SkipField(
       return false;
     }
     case WireFormatLite::WIRETYPE_FIXED32: {
-      uint32 value;
+      uint32_t value;
       if (!input->ReadLittleEndian32(&value)) return false;
       return true;
     }
@@ -168,32 +167,32 @@ bool WireFormatLite::SkipField(
   }
 }
 
-bool WireFormatLite::SkipField(
-    io::CodedInputStream* input, uint32 tag, io::CodedOutputStream* output) {
+bool WireFormatLite::SkipField(io::CodedInputStream* input, uint32_t tag,
+                               io::CodedOutputStream* output) {
   // Field number 0 is illegal.
   if (WireFormatLite::GetTagFieldNumber(tag) == 0) return false;
   switch (WireFormatLite::GetTagWireType(tag)) {
     case WireFormatLite::WIRETYPE_VARINT: {
-      uint64 value;
+      uint64_t value;
       if (!input->ReadVarint64(&value)) return false;
       output->WriteVarint32(tag);
       output->WriteVarint64(value);
       return true;
     }
     case WireFormatLite::WIRETYPE_FIXED64: {
-      uint64 value;
+      uint64_t value;
       if (!input->ReadLittleEndian64(&value)) return false;
       output->WriteVarint32(tag);
       output->WriteLittleEndian64(value);
       return true;
     }
     case WireFormatLite::WIRETYPE_LENGTH_DELIMITED: {
-      uint32 length;
+      uint32_t length;
       if (!input->ReadVarint32(&length)) return false;
       output->WriteVarint32(tag);
       output->WriteVarint32(length);
       // TODO(mkilavuz): Provide API to prevent extra string copying.
-      string temp;
+      std::string temp;
       if (!input->ReadString(&temp, length)) return false;
       output->WriteString(temp);
       return true;
@@ -204,9 +203,9 @@ bool WireFormatLite::SkipField(
       if (!SkipMessage(input, output)) return false;
       input->DecrementRecursionDepth();
       // Check that the ending tag matched the starting tag.
-      if (!input->LastTagWas(WireFormatLite::MakeTag(
-          WireFormatLite::GetTagFieldNumber(tag),
-          WireFormatLite::WIRETYPE_END_GROUP))) {
+      if (!input->LastTagWas(
+              WireFormatLite::MakeTag(WireFormatLite::GetTagFieldNumber(tag),
+                                      WireFormatLite::WIRETYPE_END_GROUP))) {
         return false;
       }
       return true;
@@ -215,7 +214,7 @@ bool WireFormatLite::SkipField(
       return false;
     }
     case WireFormatLite::WIRETYPE_FIXED32: {
-      uint32 value;
+      uint32_t value;
       if (!input->ReadLittleEndian32(&value)) return false;
       output->WriteVarint32(tag);
       output->WriteLittleEndian32(value);
@@ -229,7 +228,7 @@ bool WireFormatLite::SkipField(
 
 bool WireFormatLite::SkipMessage(io::CodedInputStream* input) {
   while (true) {
-    uint32 tag = input->ReadTag();
+    uint32_t tag = input->ReadTag();
     if (tag == 0) {
       // End of input.  This is a valid place to end, so return true.
       return true;
@@ -247,9 +246,9 @@ bool WireFormatLite::SkipMessage(io::CodedInputStream* input) {
 }
 
 bool WireFormatLite::SkipMessage(io::CodedInputStream* input,
-    io::CodedOutputStream* output) {
+                                 io::CodedOutputStream* output) {
   while (true) {
-    uint32 tag = input->ReadTag();
+    uint32_t tag = input->ReadTag();
     if (tag == 0) {
       // End of input.  This is a valid place to end, so return true.
       return true;
@@ -267,8 +266,7 @@ bool WireFormatLite::SkipMessage(io::CodedInputStream* input,
   }
 }
 
-bool FieldSkipper::SkipField(
-    io::CodedInputStream* input, uint32 tag) {
+bool FieldSkipper::SkipField(io::CodedInputStream* input, uint32_t tag) {
   return WireFormatLite::SkipField(input, tag);
 }
 
@@ -276,13 +274,12 @@ bool FieldSkipper::SkipMessage(io::CodedInputStream* input) {
   return WireFormatLite::SkipMessage(input);
 }
 
-void FieldSkipper::SkipUnknownEnum(
-    int /* field_number */, int /* value */) {
+void FieldSkipper::SkipUnknownEnum(int /* field_number */, int /* value */) {
   // Nothing.
 }
 
-bool CodedOutputStreamFieldSkipper::SkipField(
-    io::CodedInputStream* input, uint32 tag) {
+bool CodedOutputStreamFieldSkipper::SkipField(io::CodedInputStream* input,
+                                              uint32_t tag) {
   return WireFormatLite::SkipField(input, tag, unknown_fields_);
 }
 
@@ -290,52 +287,28 @@ bool CodedOutputStreamFieldSkipper::SkipMessage(io::CodedInputStream* input) {
   return WireFormatLite::SkipMessage(input, unknown_fields_);
 }
 
-void CodedOutputStreamFieldSkipper::SkipUnknownEnum(
-    int field_number, int value) {
+void CodedOutputStreamFieldSkipper::SkipUnknownEnum(int field_number,
+                                                    int value) {
   unknown_fields_->WriteVarint32(field_number);
   unknown_fields_->WriteVarint64(value);
 }
 
-bool WireFormatLite::ReadPackedEnumNoInline(io::CodedInputStream* input,
-                                            bool (*is_valid)(int),
-                                            RepeatedField<int>* values) {
-  uint32 length;
-  if (!input->ReadVarint32(&length)) return false;
-  io::CodedInputStream::Limit limit = input->PushLimit(length);
-  while (input->BytesUntilLimit() > 0) {
-    int value;
-    if (!google::protobuf::internal::WireFormatLite::ReadPrimitive<
-        int, WireFormatLite::TYPE_ENUM>(input, &value)) {
-      return false;
-    }
-    if (is_valid == NULL || is_valid(value)) {
-      values->Add(value);
-    }
-  }
-  input->PopLimit(limit);
-  return true;
-}
-
 bool WireFormatLite::ReadPackedEnumPreserveUnknowns(
-    io::CodedInputStream* input,
-    int field_number,
-    bool (*is_valid)(int),
-    io::CodedOutputStream* unknown_fields_stream,
-    RepeatedField<int>* values) {
-  uint32 length;
+    io::CodedInputStream* input, int field_number, bool (*is_valid)(int),
+    io::CodedOutputStream* unknown_fields_stream, RepeatedField<int>* values) {
+  uint32_t length;
   if (!input->ReadVarint32(&length)) return false;
   io::CodedInputStream::Limit limit = input->PushLimit(length);
   while (input->BytesUntilLimit() > 0) {
     int value;
-    if (!google::protobuf::internal::WireFormatLite::ReadPrimitive<
-        int, WireFormatLite::TYPE_ENUM>(input, &value)) {
+    if (!ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(input, &value)) {
       return false;
     }
-    if (is_valid == NULL || is_valid(value)) {
+    if (is_valid == nullptr || is_valid(value)) {
       values->Add(value);
     } else {
-      uint32 tag = WireFormatLite::MakeTag(field_number,
-                                           WireFormatLite::WIRETYPE_VARINT);
+      uint32_t tag = WireFormatLite::MakeTag(field_number,
+                                             WireFormatLite::WIRETYPE_VARINT);
       unknown_fields_stream->WriteVarint32(tag);
       unknown_fields_stream->WriteVarint32(value);
     }
@@ -347,31 +320,31 @@ bool WireFormatLite::ReadPackedEnumPreserveUnknowns(
 #if !defined(PROTOBUF_LITTLE_ENDIAN)
 
 namespace {
-void EncodeFixedSizeValue(float v, uint8* dest) {
+void EncodeFixedSizeValue(float v, uint8_t* dest) {
   WireFormatLite::WriteFloatNoTagToArray(v, dest);
 }
 
-void EncodeFixedSizeValue(double v, uint8* dest) {
+void EncodeFixedSizeValue(double v, uint8_t* dest) {
   WireFormatLite::WriteDoubleNoTagToArray(v, dest);
 }
 
-void EncodeFixedSizeValue(uint32 v, uint8* dest) {
+void EncodeFixedSizeValue(uint32_t v, uint8_t* dest) {
   WireFormatLite::WriteFixed32NoTagToArray(v, dest);
 }
 
-void EncodeFixedSizeValue(uint64 v, uint8* dest) {
+void EncodeFixedSizeValue(uint64_t v, uint8_t* dest) {
   WireFormatLite::WriteFixed64NoTagToArray(v, dest);
 }
 
-void EncodeFixedSizeValue(int32 v, uint8* dest) {
+void EncodeFixedSizeValue(int32_t v, uint8_t* dest) {
   WireFormatLite::WriteSFixed32NoTagToArray(v, dest);
 }
 
-void EncodeFixedSizeValue(int64 v, uint8* dest) {
+void EncodeFixedSizeValue(int64_t v, uint8_t* dest) {
   WireFormatLite::WriteSFixed64NoTagToArray(v, dest);
 }
 
-void EncodeFixedSizeValue(bool v, uint8* dest) {
+void EncodeFixedSizeValue(bool v, uint8_t* dest) {
   WireFormatLite::WriteBoolNoTagToArray(v, dest);
 }
 }  // anonymous namespace
@@ -384,12 +357,12 @@ static void WriteArray(const CType* a, int n, io::CodedOutputStream* output) {
   output->WriteRaw(reinterpret_cast<const char*>(a), n * sizeof(a[0]));
 #else
   const int kAtATime = 128;
-  uint8 buf[sizeof(CType) * kAtATime];
+  uint8_t buf[sizeof(CType) * kAtATime];
   for (int i = 0; i < n; i += kAtATime) {
     int to_do = std::min(kAtATime, n - i);
-    uint8* ptr = buf;
+    uint8_t* ptr = buf;
     for (int j = 0; j < to_do; j++) {
-      EncodeFixedSizeValue(a[i+j], ptr);
+      EncodeFixedSizeValue(a[i + j], ptr);
       ptr += sizeof(a[0]);
     }
     output->WriteRaw(buf, to_do * sizeof(a[0]));
@@ -403,28 +376,28 @@ void WireFormatLite::WriteFloatArray(const float* a, int n,
 }
 
 void WireFormatLite::WriteDoubleArray(const double* a, int n,
-                                     io::CodedOutputStream* output) {
+                                      io::CodedOutputStream* output) {
   WriteArray<double>(a, n, output);
 }
 
-void WireFormatLite::WriteFixed32Array(const uint32* a, int n,
-                                     io::CodedOutputStream* output) {
-  WriteArray<uint32>(a, n, output);
+void WireFormatLite::WriteFixed32Array(const uint32_t* a, int n,
+                                       io::CodedOutputStream* output) {
+  WriteArray<uint32_t>(a, n, output);
 }
 
-void WireFormatLite::WriteFixed64Array(const uint64* a, int n,
+void WireFormatLite::WriteFixed64Array(const uint64_t* a, int n,
                                        io::CodedOutputStream* output) {
-  WriteArray<uint64>(a, n, output);
+  WriteArray<uint64_t>(a, n, output);
 }
 
-void WireFormatLite::WriteSFixed32Array(const int32* a, int n,
-                                       io::CodedOutputStream* output) {
-  WriteArray<int32>(a, n, output);
+void WireFormatLite::WriteSFixed32Array(const int32_t* a, int n,
+                                        io::CodedOutputStream* output) {
+  WriteArray<int32_t>(a, n, output);
 }
 
-void WireFormatLite::WriteSFixed64Array(const int64* a, int n,
-                                       io::CodedOutputStream* output) {
-  WriteArray<int64>(a, n, output);
+void WireFormatLite::WriteSFixed64Array(const int64_t* a, int n,
+                                        io::CodedOutputStream* output) {
+  WriteArray<int64_t>(a, n, output);
 }
 
 void WireFormatLite::WriteBoolArray(const bool* a, int n,
@@ -432,52 +405,52 @@ void WireFormatLite::WriteBoolArray(const bool* a, int n,
   WriteArray<bool>(a, n, output);
 }
 
-void WireFormatLite::WriteInt32(int field_number, int32 value,
+void WireFormatLite::WriteInt32(int field_number, int32_t value,
                                 io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_VARINT, output);
   WriteInt32NoTag(value, output);
 }
-void WireFormatLite::WriteInt64(int field_number, int64 value,
+void WireFormatLite::WriteInt64(int field_number, int64_t value,
                                 io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_VARINT, output);
   WriteInt64NoTag(value, output);
 }
-void WireFormatLite::WriteUInt32(int field_number, uint32 value,
+void WireFormatLite::WriteUInt32(int field_number, uint32_t value,
                                  io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_VARINT, output);
   WriteUInt32NoTag(value, output);
 }
-void WireFormatLite::WriteUInt64(int field_number, uint64 value,
+void WireFormatLite::WriteUInt64(int field_number, uint64_t value,
                                  io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_VARINT, output);
   WriteUInt64NoTag(value, output);
 }
-void WireFormatLite::WriteSInt32(int field_number, int32 value,
+void WireFormatLite::WriteSInt32(int field_number, int32_t value,
                                  io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_VARINT, output);
   WriteSInt32NoTag(value, output);
 }
-void WireFormatLite::WriteSInt64(int field_number, int64 value,
+void WireFormatLite::WriteSInt64(int field_number, int64_t value,
                                  io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_VARINT, output);
   WriteSInt64NoTag(value, output);
 }
-void WireFormatLite::WriteFixed32(int field_number, uint32 value,
+void WireFormatLite::WriteFixed32(int field_number, uint32_t value,
                                   io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_FIXED32, output);
   WriteFixed32NoTag(value, output);
 }
-void WireFormatLite::WriteFixed64(int field_number, uint64 value,
+void WireFormatLite::WriteFixed64(int field_number, uint64_t value,
                                   io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_FIXED64, output);
   WriteFixed64NoTag(value, output);
 }
-void WireFormatLite::WriteSFixed32(int field_number, int32 value,
+void WireFormatLite::WriteSFixed32(int field_number, int32_t value,
                                    io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_FIXED32, output);
   WriteSFixed32NoTag(value, output);
 }
-void WireFormatLite::WriteSFixed64(int field_number, int64 value,
+void WireFormatLite::WriteSFixed64(int field_number, int64_t value,
                                    io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_FIXED64, output);
   WriteSFixed64NoTag(value, output);
@@ -503,50 +476,50 @@ void WireFormatLite::WriteEnum(int field_number, int value,
   WriteEnumNoTag(value, output);
 }
 
-void WireFormatLite::WriteString(int field_number, const string& value,
+constexpr size_t kInt32MaxSize = std::numeric_limits<int32_t>::max();
+
+void WireFormatLite::WriteString(int field_number, const std::string& value,
                                  io::CodedOutputStream* output) {
   // String is for UTF-8 text only
   WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
-  GOOGLE_CHECK_LE(value.size(), kint32max);
+  GOOGLE_CHECK_LE(value.size(), kInt32MaxSize);
   output->WriteVarint32(value.size());
   output->WriteString(value);
 }
-void WireFormatLite::WriteStringMaybeAliased(
-    int field_number, const string& value,
-    io::CodedOutputStream* output) {
+void WireFormatLite::WriteStringMaybeAliased(int field_number,
+                                             const std::string& value,
+                                             io::CodedOutputStream* output) {
   // String is for UTF-8 text only
   WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
-  GOOGLE_CHECK_LE(value.size(), kint32max);
+  GOOGLE_CHECK_LE(value.size(), kInt32MaxSize);
   output->WriteVarint32(value.size());
   output->WriteRawMaybeAliased(value.data(), value.size());
 }
-void WireFormatLite::WriteBytes(int field_number, const string& value,
+void WireFormatLite::WriteBytes(int field_number, const std::string& value,
                                 io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
-  GOOGLE_CHECK_LE(value.size(), kint32max);
+  GOOGLE_CHECK_LE(value.size(), kInt32MaxSize);
   output->WriteVarint32(value.size());
   output->WriteString(value);
 }
-void WireFormatLite::WriteBytesMaybeAliased(
-    int field_number, const string& value,
-    io::CodedOutputStream* output) {
+void WireFormatLite::WriteBytesMaybeAliased(int field_number,
+                                            const std::string& value,
+                                            io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
-  GOOGLE_CHECK_LE(value.size(), kint32max);
+  GOOGLE_CHECK_LE(value.size(), kInt32MaxSize);
   output->WriteVarint32(value.size());
   output->WriteRawMaybeAliased(value.data(), value.size());
 }
 
 
-void WireFormatLite::WriteGroup(int field_number,
-                                const MessageLite& value,
+void WireFormatLite::WriteGroup(int field_number, const MessageLite& value,
                                 io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_START_GROUP, output);
   value.SerializeWithCachedSizes(output);
   WriteTag(field_number, WIRETYPE_END_GROUP, output);
 }
 
-void WireFormatLite::WriteMessage(int field_number,
-                                  const MessageLite& value,
+void WireFormatLite::WriteMessage(int field_number, const MessageLite& value,
                                   io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
   const int size = value.GetCachedSize();
@@ -554,19 +527,17 @@ void WireFormatLite::WriteMessage(int field_number,
   value.SerializeWithCachedSizes(output);
 }
 
+void WireFormatLite::WriteSubMessageMaybeToArray(
+    int /*size*/, const MessageLite& value, io::CodedOutputStream* output) {
+  output->SetCur(value._InternalSerialize(output->Cur(), output->EpsCopy()));
+}
+
 void WireFormatLite::WriteGroupMaybeToArray(int field_number,
                                             const MessageLite& value,
                                             io::CodedOutputStream* output) {
   WriteTag(field_number, WIRETYPE_START_GROUP, output);
   const int size = value.GetCachedSize();
-  uint8* target = output->GetDirectBufferForNBytesAndAdvance(size);
-  if (target != NULL) {
-    uint8* end = value.InternalSerializeWithCachedSizesToArray(
-        output->IsSerializationDeterministic(), target);
-    GOOGLE_DCHECK_EQ(end - target, size);
-  } else {
-    value.SerializeWithCachedSizes(output);
-  }
+  WriteSubMessageMaybeToArray(size, value, output);
   WriteTag(field_number, WIRETYPE_END_GROUP, output);
 }
 
@@ -576,42 +547,47 @@ void WireFormatLite::WriteMessageMaybeToArray(int field_number,
   WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
   const int size = value.GetCachedSize();
   output->WriteVarint32(size);
-  uint8* target = output->GetDirectBufferForNBytesAndAdvance(size);
-  if (target != NULL) {
-    uint8* end = value.InternalSerializeWithCachedSizesToArray(
-        output->IsSerializationDeterministic(), target);
-    GOOGLE_DCHECK_EQ(end - target, size);
-  } else {
-    value.SerializeWithCachedSizes(output);
-  }
+  WriteSubMessageMaybeToArray(size, value, output);
 }
 
-GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static bool ReadBytesToString(
-    io::CodedInputStream* input, string* value);
+PROTOBUF_NDEBUG_INLINE static bool ReadBytesToString(
+    io::CodedInputStream* input, std::string* value);
 inline static bool ReadBytesToString(io::CodedInputStream* input,
-                                     string* value) {
-  uint32 length;
-  return input->ReadVarint32(&length) &&
-      input->InternalReadStringInline(value, length);
+                                     std::string* value) {
+  uint32_t length;
+  return input->ReadVarint32(&length) && input->ReadString(value, length);
 }
 
-bool WireFormatLite::ReadBytes(io::CodedInputStream* input, string* value) {
+bool WireFormatLite::ReadBytes(io::CodedInputStream* input,
+                               std::string* value) {
   return ReadBytesToString(input, value);
 }
 
-bool WireFormatLite::ReadBytes(io::CodedInputStream* input, string** p) {
-  if (*p == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
-    *p = new ::std::string();
+bool WireFormatLite::ReadBytes(io::CodedInputStream* input, std::string** p) {
+  if (*p == &GetEmptyStringAlreadyInited()) {
+    *p = new std::string();
   }
   return ReadBytesToString(input, *p);
 }
 
-bool WireFormatLite::VerifyUtf8String(const char* data,
-                                      int size,
-                                      Operation op,
+void PrintUTF8ErrorLog(const char* field_name, const char* operation_str,
+                       bool emit_stacktrace) {
+  std::string stacktrace;
+  (void)emit_stacktrace;  // Parameter is used by Google-internal code.
+  std::string quoted_field_name = "";
+  if (field_name != nullptr) {
+    quoted_field_name = StringPrintf(" '%s'", field_name);
+  }
+  GOOGLE_LOG(ERROR) << "String field" << quoted_field_name << " contains invalid "
+             << "UTF-8 data when " << operation_str << " a protocol "
+             << "buffer. Use the 'bytes' type if you intend to send raw "
+             << "bytes. " << stacktrace;
+}
+
+bool WireFormatLite::VerifyUtf8String(const char* data, int size, Operation op,
                                       const char* field_name) {
   if (!IsStructurallyValidUTF8(data, size)) {
-    const char* operation_str = NULL;
+    const char* operation_str = nullptr;
     switch (op) {
       case PARSE:
         operation_str = "parsing";
@@ -619,132 +595,102 @@ bool WireFormatLite::VerifyUtf8String(const char* data,
       case SERIALIZE:
         operation_str = "serializing";
         break;
-      // no default case: have the compiler warn if a case is not covered.
-    }
-    string quoted_field_name = "";
-    if (field_name != NULL) {
-      quoted_field_name = StringPrintf(" '%s'", field_name);
+        // no default case: have the compiler warn if a case is not covered.
     }
-    // no space below to avoid double space when the field name is missing.
-    GOOGLE_LOG(ERROR) << "String field" << quoted_field_name << " contains invalid "
-               << "UTF-8 data when " << operation_str << " a protocol "
-               << "buffer. Use the 'bytes' type if you intend to send raw "
-               << "bytes. ";
+    PrintUTF8ErrorLog(field_name, operation_str, false);
     return false;
   }
   return true;
 }
 
-#ifdef __SSE_4_1__
-template<typename T, bool ZigZag, bool SignExtended>
-static size_t VarintSize(
-    const T* data, const int n,
-    const internal::enable_if<sizeof(T) == 4>::type* = NULL) {
-#if __cplusplus >= 201103L
+// this code is deliberately written such that clang makes it into really
+// efficient SSE code.
+template <bool ZigZag, bool SignExtended, typename T>
+static size_t VarintSize(const T* data, const int n) {
+  static_assert(sizeof(T) == 4, "This routine only works for 32 bit integers");
   // is_unsigned<T> => !ZigZag
-  static_assert((std::is_unsigned<T>::value ^ ZigZag) ||
-                std::is_signed<T>::value,
-                "Cannot ZigZag encode unsigned types");
+  static_assert(
+      (std::is_unsigned<T>::value ^ ZigZag) || std::is_signed<T>::value,
+      "Cannot ZigZag encode unsigned types");
   // is_unsigned<T> => !SignExtended
-  static_assert((std::is_unsigned<T>::value ^ SignExtended) ||
-                std::is_signed<T>::value,
-                "Cannot SignExtended unsigned types");
-#endif
-
-  union vus32 {
-    uint32  u[4];
-    int32   s[4];
-    __m128i v;
-  };
-
-  static const vus32 ones = {{1, 1, 1, 1}};
-
-  // CodedOutputStream::VarintSize32SignExtended returns 10 for negative
-  // numbers.  We can apply the UInt32Size algorithm, and simultaneously logical
-  // shift the MSB into the LSB to determine if it is negative.
-  static const vus32 fives = {{5, 5, 5, 5}};
-
-  // sum is the vectorized-output of calling CodedOutputStream::VarintSize32 on
-  // the processed elements.
-  //
-  // msb_sum is the count of set most-significant bits.  When computing the
-  // vectorized CodedOutputStream::VarintSize32SignExtended, negative values
-  // have the most significant bit set.  VarintSize32SignExtended returns 10 and
-  // VarintSize32 returns 5.  msb_sum allows us to compute:
-  //   VarintSize32SignExtended = msb_sum * 5 + VarintSize32
-  vus32 sum, v, msb_sum;
-  sum.v = _mm_setzero_si128();
-  msb_sum.v = _mm_setzero_si128();
-
-  int rounded = n & ~(3);
-  int i;
-  for (i = 0; i < rounded; i += 4) {
-    v.v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(&data[i]));
-
+  static_assert(
+      (std::is_unsigned<T>::value ^ SignExtended) || std::is_signed<T>::value,
+      "Cannot SignExtended unsigned types");
+  static_assert(!(SignExtended && ZigZag),
+                "Cannot SignExtended and ZigZag on the same type");
+  uint32_t sum = n;
+  uint32_t msb_sum = 0;
+  for (int i = 0; i < n; i++) {
+    uint32_t x = data[i];
     if (ZigZag) {
-      // Note:  the right-shift must be arithmetic
-      v.v = _mm_xor_si128(_mm_slli_epi32(v.v, 1), _mm_srai_epi32(v.v, 31));
-    }
-
-    sum.v = _mm_add_epi32(sum.v, ones.v);
-    if (SignExtended) {
-      msb_sum.v = _mm_add_epi32(msb_sum.v, _mm_srli_epi32(v.v, 31));
-    }
-
-    v.v = _mm_srli_epi32(v.v, 7);
-
-    for (int j = 0; j < 4; j++) {
-      __m128i min = _mm_min_epi32(v.v, ones.v);
-
-      sum.v = _mm_add_epi32(sum.v, min);
-      v.v   = _mm_srli_epi32(v.v, 7);
+      x = WireFormatLite::ZigZagEncode32(x);
+    } else if (SignExtended) {
+      msb_sum += x >> 31;
     }
+    // clang is so smart that it produces optimal SSE sequence unrolling
+    // the loop 8 ints at a time. With a sequence of 4
+    // cmpres = cmpgt x, sizeclass  ( -1 or 0)
+    // sum = sum - cmpres
+    if (x > 0x7F) sum++;
+    if (x > 0x3FFF) sum++;
+    if (x > 0x1FFFFF) sum++;
+    if (x > 0xFFFFFFF) sum++;
   }
+  if (SignExtended) sum += msb_sum * 5;
+  return sum;
+}
 
-  if (SignExtended) {
-    vus32 extensions;
-    extensions.v = _mm_mullo_epi32(msb_sum.v, fives.v);
-
-    sum.v = _mm_add_epi32(sum.v, extensions.v);
-  }
-
-  // TODO(ckennelly): Can we avoid the sign conversion?
-  size_t out = _mm_cvtsi128_si32(
-      _mm_hadd_epi32(_mm_hadd_epi32(sum.v, ones.v), ones.v));
-
-  // Finish tail.
-  for (; i < n; i++) {
+template <bool ZigZag, typename T>
+static size_t VarintSize64(const T* data, const int n) {
+  static_assert(sizeof(T) == 8, "This routine only works for 64 bit integers");
+  // is_unsigned<T> => !ZigZag
+  static_assert(!ZigZag || !std::is_unsigned<T>::value,
+                "Cannot ZigZag encode unsigned types");
+  uint64_t sum = n;
+  for (int i = 0; i < n; i++) {
+    uint64_t x = data[i];
     if (ZigZag) {
-      out += WireFormatLite::SInt32Size(data[i]);
-    } else if (SignExtended) {
-      out += WireFormatLite::Int32Size(data[i]);
-    } else {
-      out += WireFormatLite::UInt32Size(data[i]);
+      x = WireFormatLite::ZigZagEncode64(x);
     }
+    // First step is a binary search, we can't branch in sse so we use the
+    // result of the compare to adjust sum and appropriately. This code is
+    // written to make clang recognize the vectorization.
+    uint64_t tmp = x >= (static_cast<uint64_t>(1) << 35) ? -1 : 0;
+    sum += 5 & tmp;
+    x >>= 35 & tmp;
+    if (x > 0x7F) sum++;
+    if (x > 0x3FFF) sum++;
+    if (x > 0x1FFFFF) sum++;
+    if (x > 0xFFFFFFF) sum++;
   }
-
-  return out;
+  return sum;
 }
 
-size_t WireFormatLite::Int32Size(const RepeatedField<int32>& value) {
-  return VarintSize<int32, false, true>(value.data(), value.size());
+// GCC does not recognize the vectorization opportunity
+// and other platforms are untested, in those cases using the optimized
+// varint size routine for each element is faster.
+// Hence we enable it only for clang
+#if defined(__SSE__) && defined(__clang__)
+size_t WireFormatLite::Int32Size(const RepeatedField<int32_t>& value) {
+  return VarintSize<false, true>(value.data(), value.size());
 }
 
-size_t WireFormatLite::UInt32Size(const RepeatedField<uint32>& value) {
-  return VarintSize<uint32, false, false>(value.data(), value.size());
+size_t WireFormatLite::UInt32Size(const RepeatedField<uint32_t>& value) {
+  return VarintSize<false, false>(value.data(), value.size());
 }
 
-size_t WireFormatLite::SInt32Size(const RepeatedField<int32>& value) {
-  return VarintSize<int32, true, true>(value.data(), value.size());
+size_t WireFormatLite::SInt32Size(const RepeatedField<int32_t>& value) {
+  return VarintSize<true, false>(value.data(), value.size());
 }
 
 size_t WireFormatLite::EnumSize(const RepeatedField<int>& value) {
   // On ILP64, sizeof(int) == 8, which would require a different template.
-  return VarintSize<int, false, true>(value.data(), value.size());
+  return VarintSize<false, true>(value.data(), value.size());
 }
 
-#else  // !__SSE_4_1__
-size_t WireFormatLite::Int32Size(const RepeatedField<int32>& value) {
+#else  // !(defined(__SSE4_1__) && defined(__clang__))
+
+size_t WireFormatLite::Int32Size(const RepeatedField<int32_t>& value) {
   size_t out = 0;
   const int n = value.size();
   for (int i = 0; i < n; i++) {
@@ -753,7 +699,7 @@ size_t WireFormatLite::Int32Size(const RepeatedField<int32>& value) {
   return out;
 }
 
-size_t WireFormatLite::UInt32Size(const RepeatedField<uint32>& value) {
+size_t WireFormatLite::UInt32Size(const RepeatedField<uint32_t>& value) {
   size_t out = 0;
   const int n = value.size();
   for (int i = 0; i < n; i++) {
@@ -762,7 +708,7 @@ size_t WireFormatLite::UInt32Size(const RepeatedField<uint32>& value) {
   return out;
 }
 
-size_t WireFormatLite::SInt32Size(const RepeatedField<int32>& value) {
+size_t WireFormatLite::SInt32Size(const RepeatedField<int32_t>& value) {
   size_t out = 0;
   const int n = value.size();
   for (int i = 0; i < n; i++) {
@@ -779,8 +725,60 @@ size_t WireFormatLite::EnumSize(const RepeatedField<int>& value) {
   }
   return out;
 }
+
+#endif
+
+// Micro benchmarks show that the SSE improved loop only starts beating
+// the normal loop on Haswell platforms and then only for >32 ints. We
+// disable this for now. Some specialized users might find it worthwhile to
+// enable this.
+#define USE_SSE_FOR_64_BIT_INTEGER_ARRAYS 0
+#if USE_SSE_FOR_64_BIT_INTEGER_ARRAYS
+size_t WireFormatLite::Int64Size(const RepeatedField<int64_t>& value) {
+  return VarintSize64<false>(value.data(), value.size());
+}
+
+size_t WireFormatLite::UInt64Size(const RepeatedField<uint64_t>& value) {
+  return VarintSize64<false>(value.data(), value.size());
+}
+
+size_t WireFormatLite::SInt64Size(const RepeatedField<int64_t>& value) {
+  return VarintSize64<true>(value.data(), value.size());
+}
+
+#else
+
+size_t WireFormatLite::Int64Size(const RepeatedField<int64_t>& value) {
+  size_t out = 0;
+  const int n = value.size();
+  for (int i = 0; i < n; i++) {
+    out += Int64Size(value.Get(i));
+  }
+  return out;
+}
+
+size_t WireFormatLite::UInt64Size(const RepeatedField<uint64_t>& value) {
+  size_t out = 0;
+  const int n = value.size();
+  for (int i = 0; i < n; i++) {
+    out += UInt64Size(value.Get(i));
+  }
+  return out;
+}
+
+size_t WireFormatLite::SInt64Size(const RepeatedField<int64_t>& value) {
+  size_t out = 0;
+  const int n = value.size();
+  for (int i = 0; i < n; i++) {
+    out += SInt64Size(value.Get(i));
+  }
+  return out;
+}
+
 #endif
 
 }  // namespace internal
 }  // namespace protobuf
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
index cf614c0..b04d17b 100644 (file)
 #include <string>
 
 #include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/logging.h>
 #include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arenastring.h>
 #include <google/protobuf/message_lite.h>
-#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/port.h>
 #include <google/protobuf/repeated_field.h>
+#include <google/protobuf/stubs/casts.h>
 
 // Do UTF-8 validation on string type in Debug build only
 #ifndef NDEBUG
 
 // Avoid conflict with iOS where <ConditionalMacros.h> #defines TYPE_BOOL.
 //
-// If some one needs the macro TYPE_BOOL in a file that includes this header, it's
-// possible to bring it back using push/pop_macro as follows.
+// If some one needs the macro TYPE_BOOL in a file that includes this header,
+// it's possible to bring it back using push/pop_macro as follows.
 //
 // #pragma push_macro("TYPE_BOOL")
 // #include this header and/or all headers that need the macro to be undefined.
 // #pragma pop_macro("TYPE_BOOL")
 #undef TYPE_BOOL
 
-namespace google {
 
-namespace protobuf {
-  template <typename T> class RepeatedField;  // repeated_field.h
-}
+#include <google/protobuf/port_def.inc>
 
+namespace google {
 namespace protobuf {
 namespace internal {
 
-class StringPieceField;
-
 // This class is for internal use by the protocol buffer library and by
-// protocol-complier-generated message classes.  It must not be called
+// protocol-compiler-generated message classes.  It must not be called
 // directly by clients.
 //
 // This class contains helpers for implementing the binary protocol buffer
@@ -83,9 +82,8 @@ class StringPieceField;
 // reflection.
 //
 // This class is really a namespace that contains only static methods.
-class LIBPROTOBUF_EXPORT WireFormatLite {
+class PROTOBUF_EXPORT WireFormatLite {
  public:
-
   // -----------------------------------------------------------------
   // Helper constants and functions related to the format.  These are
   // mostly meant for internal and generated code to use.
@@ -102,50 +100,50 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   // unrecognized fields for forwards compatibility.
 
   enum WireType {
-    WIRETYPE_VARINT           = 0,
-    WIRETYPE_FIXED64          = 1,
+    WIRETYPE_VARINT = 0,
+    WIRETYPE_FIXED64 = 1,
     WIRETYPE_LENGTH_DELIMITED = 2,
-    WIRETYPE_START_GROUP      = 3,
-    WIRETYPE_END_GROUP        = 4,
-    WIRETYPE_FIXED32          = 5,
+    WIRETYPE_START_GROUP = 3,
+    WIRETYPE_END_GROUP = 4,
+    WIRETYPE_FIXED32 = 5,
   };
 
   // Lite alternative to FieldDescriptor::Type.  Must be kept in sync.
   enum FieldType {
-    TYPE_DOUBLE         = 1,
-    TYPE_FLOAT          = 2,
-    TYPE_INT64          = 3,
-    TYPE_UINT64         = 4,
-    TYPE_INT32          = 5,
-    TYPE_FIXED64        = 6,
-    TYPE_FIXED32        = 7,
-    TYPE_BOOL           = 8,
-    TYPE_STRING         = 9,
-    TYPE_GROUP          = 10,
-    TYPE_MESSAGE        = 11,
-    TYPE_BYTES          = 12,
-    TYPE_UINT32         = 13,
-    TYPE_ENUM           = 14,
-    TYPE_SFIXED32       = 15,
-    TYPE_SFIXED64       = 16,
-    TYPE_SINT32         = 17,
-    TYPE_SINT64         = 18,
-    MAX_FIELD_TYPE      = 18,
+    TYPE_DOUBLE = 1,
+    TYPE_FLOAT = 2,
+    TYPE_INT64 = 3,
+    TYPE_UINT64 = 4,
+    TYPE_INT32 = 5,
+    TYPE_FIXED64 = 6,
+    TYPE_FIXED32 = 7,
+    TYPE_BOOL = 8,
+    TYPE_STRING = 9,
+    TYPE_GROUP = 10,
+    TYPE_MESSAGE = 11,
+    TYPE_BYTES = 12,
+    TYPE_UINT32 = 13,
+    TYPE_ENUM = 14,
+    TYPE_SFIXED32 = 15,
+    TYPE_SFIXED64 = 16,
+    TYPE_SINT32 = 17,
+    TYPE_SINT64 = 18,
+    MAX_FIELD_TYPE = 18,
   };
 
   // Lite alternative to FieldDescriptor::CppType.  Must be kept in sync.
   enum CppType {
-    CPPTYPE_INT32       = 1,
-    CPPTYPE_INT64       = 2,
-    CPPTYPE_UINT32      = 3,
-    CPPTYPE_UINT64      = 4,
-    CPPTYPE_DOUBLE      = 5,
-    CPPTYPE_FLOAT       = 6,
-    CPPTYPE_BOOL        = 7,
-    CPPTYPE_ENUM        = 8,
-    CPPTYPE_STRING      = 9,
-    CPPTYPE_MESSAGE     = 10,
-    MAX_CPPTYPE         = 10,
+    CPPTYPE_INT32 = 1,
+    CPPTYPE_INT64 = 2,
+    CPPTYPE_UINT32 = 3,
+    CPPTYPE_UINT64 = 4,
+    CPPTYPE_DOUBLE = 5,
+    CPPTYPE_FLOAT = 6,
+    CPPTYPE_BOOL = 7,
+    CPPTYPE_ENUM = 8,
+    CPPTYPE_STRING = 9,
+    CPPTYPE_MESSAGE = 10,
+    MAX_CPPTYPE = 10,
   };
 
   // Helper method to get the CppType for a particular Type.
@@ -158,18 +156,18 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   }
 
   // Number of bits in a tag which identify the wire type.
-  static const int kTagTypeBits = 3;
+  static constexpr int kTagTypeBits = 3;
   // Mask for those bits.
-  static const uint32 kTagTypeMask = (1 << kTagTypeBits) - 1;
+  static constexpr uint32_t kTagTypeMask = (1 << kTagTypeBits) - 1;
 
   // Helper functions for encoding and decoding tags.  (Inlined below and in
   // _inl.h)
   //
-  // This is different from MakeTag(field->number(), field->type()) in the case
-  // of packed repeated fields.
-  static uint32 MakeTag(int field_number, WireType type);
-  static WireType GetTagWireType(uint32 tag);
-  static int GetTagFieldNumber(uint32 tag);
+  // This is different from MakeTag(field->number(), field->type()) in the
+  // case of packed repeated fields.
+  constexpr static uint32_t MakeTag(int field_number, WireType type);
+  static WireType GetTagWireType(uint32_t tag);
+  static int GetTagFieldNumber(uint32_t tag);
 
   // Compute the byte size of a tag.  For groups, this includes both the start
   // and end tags.
@@ -177,15 +175,15 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
                                WireFormatLite::FieldType type);
 
   // Skips a field value with the given tag.  The input should start
-  // positioned immediately after the tag.  Skipped values are simply discarded,
-  // not recorded anywhere.  See WireFormat::SkipField() for a version that
-  // records to an UnknownFieldSet.
-  static bool SkipField(io::CodedInputStream* input, uint32 tag);
+  // positioned immediately after the tag.  Skipped values are simply
+  // discarded, not recorded anywhere.  See WireFormat::SkipField() for a
+  // version that records to an UnknownFieldSet.
+  static bool SkipField(io::CodedInputStream* input, uint32_t tag);
 
   // Skips a field value with the given tag.  The input should start
   // positioned immediately after the tag. Skipped values are recorded to a
   // CodedOutputStream.
-  static bool SkipField(io::CodedInputStream* input, uint32 tag,
+  static bool SkipField(io::CodedInputStream* input, uint32_t tag,
                         io::CodedOutputStream* output);
 
   // Reads and ignores a message from the input.  Skipped values are simply
@@ -198,14 +196,12 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   static bool SkipMessage(io::CodedInputStream* input,
                           io::CodedOutputStream* output);
 
-// This macro does the same thing as WireFormatLite::MakeTag(), but the
-// result is usable as a compile-time constant, which makes it usable
-// as a switch case or a template input.  WireFormatLite::MakeTag() is more
-// type-safe, though, so prefer it if possible.
-#define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE)                  \
-  static_cast<uint32>(                                                   \
-    (static_cast<uint32>(FIELD_NUMBER) << ::google::protobuf::internal::WireFormatLite::kTagTypeBits) \
-      | (TYPE))
+  // This macro does the same thing as WireFormatLite::MakeTag(), but the
+  // result is usable as a compile-time constant, which makes it usable
+  // as a switch case or a template input.  WireFormatLite::MakeTag() is more
+  // type-safe, though, so prefer it if possible.
+#define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE) \
+  static_cast<uint32_t>((static_cast<uint32_t>(FIELD_NUMBER) << 3) | (TYPE))
 
   // These are the tags for the old MessageSet format, which was defined as:
   //   message MessageSet {
@@ -214,21 +210,17 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   //       required string message = 3;
   //     }
   //   }
-  static const int kMessageSetItemNumber = 1;
-  static const int kMessageSetTypeIdNumber = 2;
-  static const int kMessageSetMessageNumber = 3;
-  static const int kMessageSetItemStartTag =
-    GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetItemNumber,
-                                WireFormatLite::WIRETYPE_START_GROUP);
-  static const int kMessageSetItemEndTag =
-    GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetItemNumber,
-                                WireFormatLite::WIRETYPE_END_GROUP);
-  static const int kMessageSetTypeIdTag =
-    GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetTypeIdNumber,
-                                WireFormatLite::WIRETYPE_VARINT);
-  static const int kMessageSetMessageTag =
-    GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetMessageNumber,
-                                WireFormatLite::WIRETYPE_LENGTH_DELIMITED);
+  static constexpr int kMessageSetItemNumber = 1;
+  static constexpr int kMessageSetTypeIdNumber = 2;
+  static constexpr int kMessageSetMessageNumber = 3;
+  static const int kMessageSetItemStartTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
+      kMessageSetItemNumber, WireFormatLite::WIRETYPE_START_GROUP);
+  static const int kMessageSetItemEndTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
+      kMessageSetItemNumber, WireFormatLite::WIRETYPE_END_GROUP);
+  static const int kMessageSetTypeIdTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
+      kMessageSetTypeIdNumber, WireFormatLite::WIRETYPE_VARINT);
+  static const int kMessageSetMessageTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
+      kMessageSetMessageNumber, WireFormatLite::WIRETYPE_LENGTH_DELIMITED);
 
   // Byte size of all tags of a MessageSet::Item combined.
   static const size_t kMessageSetItemTagsSize;
@@ -236,10 +228,10 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   // Helper functions for converting between floats/doubles and IEEE-754
   // uint32s/uint64s so that they can be written.  (Assumes your platform
   // uses IEEE-754 floats.)
-  static uint32 EncodeFloat(float value);
-  static float DecodeFloat(uint32 value);
-  static uint64 EncodeDouble(double value);
-  static double DecodeDouble(uint64 value);
+  static uint32_t EncodeFloat(float value);
+  static float DecodeFloat(uint32_t value);
+  static uint64_t EncodeDouble(double value);
+  static double DecodeDouble(uint64_t value);
 
   // Helper functions for mapping signed integers to unsigned integers in
   // such a way that numbers with small magnitudes will encode to smaller
@@ -247,25 +239,13 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   // number and varint-encode it, it will always take 10 bytes, defeating
   // the purpose of varint.  So, for the "sint32" and "sint64" field types,
   // we ZigZag-encode the values.
-  static uint32 ZigZagEncode32(int32 n);
-  static int32  ZigZagDecode32(uint32 n);
-  static uint64 ZigZagEncode64(int64 n);
-  static int64  ZigZagDecode64(uint64 n);
+  static uint32_t ZigZagEncode32(int32_t n);
+  static int32_t ZigZagDecode32(uint32_t n);
+  static uint64_t ZigZagEncode64(int64_t n);
+  static int64_t ZigZagDecode64(uint64_t n);
 
   // =================================================================
-  // Methods for reading/writing individual field.  The implementations
-  // of these methods are defined in wire_format_lite_inl.h; you must #include
-  // that file to use these.
-
-#ifdef NDEBUG
-#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
-// functions, especially in the proto-generated serialization functions, produce
-// stack frames so large that many tests run into stack overflows (b/32192897).
-#define INL
-#endif
+  // Methods for reading/writing individual field.
 
   // Read fields, not including tags.  The assumption is that you already
   // read the tag to determine what field to read.
@@ -274,20 +254,21 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   // the represented type and the FieldType. These are specialized with the
   // appropriate definition for each declared type.
   template <typename CType, enum FieldType DeclaredType>
-  INL static bool ReadPrimitive(io::CodedInputStream* input, CType* value);
+  PROTOBUF_NDEBUG_INLINE static bool ReadPrimitive(io::CodedInputStream* input,
+                                                   CType* value);
 
   // Reads repeated primitive values, with optimizations for repeats.
   // tag_size and tag should both be compile-time constants provided by the
   // protocol compiler.
   template <typename CType, enum FieldType DeclaredType>
-  INL static bool ReadRepeatedPrimitive(int tag_size, uint32 tag,
-                                        io::CodedInputStream* input,
-                                        RepeatedField<CType>* value);
+  PROTOBUF_NDEBUG_INLINE static bool ReadRepeatedPrimitive(
+      int tag_size, uint32_t tag, io::CodedInputStream* input,
+      RepeatedField<CType>* value);
 
   // Identical to ReadRepeatedPrimitive, except will not inline the
   // implementation.
   template <typename CType, enum FieldType DeclaredType>
-  static bool ReadRepeatedPrimitiveNoInline(int tag_size, uint32 tag,
+  static bool ReadRepeatedPrimitiveNoInline(int tag_size, uint32_t tag,
                                             io::CodedInputStream* input,
                                             RepeatedField<CType>* value);
 
@@ -296,15 +277,16 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   //
   // This is only implemented for the types with fixed wire size, e.g.
   // float, double, and the (s)fixed* types.
-  template <typename CType, enum FieldType DeclaredType> INL
-  static const uint8* ReadPrimitiveFromArray(const uint8* buffer, CType* value);
+  template <typename CType, enum FieldType DeclaredType>
+  PROTOBUF_NDEBUG_INLINE static const uint8_t* ReadPrimitiveFromArray(
+      const uint8_t* buffer, CType* value);
 
   // Reads a primitive packed field.
   //
   // This is only implemented for packable types.
   template <typename CType, enum FieldType DeclaredType>
-  INL static bool ReadPackedPrimitive(io::CodedInputStream* input,
-                                      RepeatedField<CType>* value);
+  PROTOBUF_NDEBUG_INLINE static bool ReadPackedPrimitive(
+      io::CodedInputStream* input, RepeatedField<CType>* value);
 
   // Identical to ReadPackedPrimitive, except will not inline the
   // implementation.
@@ -312,29 +294,32 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   static bool ReadPackedPrimitiveNoInline(io::CodedInputStream* input,
                                           RepeatedField<CType>* value);
 
-  // Read a packed enum field. If the is_valid function is not NULL, values for
-  // which is_valid(value) returns false are silently dropped.
+  // Read a packed enum field. If the is_valid function is not nullptr, values
+  // for which is_valid(value) returns false are silently dropped.
   static bool ReadPackedEnumNoInline(io::CodedInputStream* input,
                                      bool (*is_valid)(int),
                                      RepeatedField<int>* values);
 
-  // Read a packed enum field. If the is_valid function is not NULL, values for
-  // which is_valid(value) returns false are appended to unknown_fields_stream.
+  // Read a packed enum field. If the is_valid function is not nullptr, values
+  // for which is_valid(value) returns false are appended to
+  // unknown_fields_stream.
   static bool ReadPackedEnumPreserveUnknowns(
       io::CodedInputStream* input, int field_number, bool (*is_valid)(int),
       io::CodedOutputStream* unknown_fields_stream, RepeatedField<int>* values);
 
-  // Read a string.  ReadString(..., string* value) requires an existing string.
-  static inline bool ReadString(io::CodedInputStream* input, string* value);
-  // ReadString(..., string** p) is internal-only, and should only be called
-  // from generated code. It starts by setting *p to "new string"
-  // if *p == &GetEmptyStringAlreadyInited().  It then invokes
+  // Read a string.  ReadString(..., std::string* value) requires an
+  // existing std::string.
+  static inline bool ReadString(io::CodedInputStream* input,
+                                std::string* value);
+  // ReadString(..., std::string** p) is internal-only, and should only be
+  // called from generated code. It starts by setting *p to "new std::string" if
+  // *p == &GetEmptyStringAlreadyInited().  It then invokes
   // ReadString(io::CodedInputStream* input, *p).  This is useful for reducing
   // code size.
-  static inline bool ReadString(io::CodedInputStream* input, string** p);
+  static inline bool ReadString(io::CodedInputStream* input, std::string** p);
   // Analogous to ReadString().
-  static bool ReadBytes(io::CodedInputStream* input, string* value);
-  static bool ReadBytes(io::CodedInputStream* input, string** p);
+  static bool ReadBytes(io::CodedInputStream* input, std::string* value);
+  static bool ReadBytes(io::CodedInputStream* input, std::string** p);
 
   enum Operation {
     PARSE = 0,
@@ -342,99 +327,95 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   };
 
   // Returns true if the data is valid UTF-8.
-  static bool VerifyUtf8String(const char* data, int size,
-                               Operation op,
+  static bool VerifyUtf8String(const char* data, int size, Operation op,
                                const char* field_name);
 
+  template <typename MessageType>
   static inline bool ReadGroup(int field_number, io::CodedInputStream* input,
-                               MessageLite* value);
+                               MessageType* value);
+
+  template <typename MessageType>
   static inline bool ReadMessage(io::CodedInputStream* input,
-                                 MessageLite* value);
+                                 MessageType* value);
 
-  // Like above, but de-virtualize the call to MergePartialFromCodedStream().
-  // The pointer must point at an instance of MessageType, *not* a subclass (or
-  // the subclass must not override MergePartialFromCodedStream()).
   template <typename MessageType>
-  static inline bool ReadGroupNoVirtual(int field_number,
-                                        io::CodedInputStream* input,
-                                        MessageType* value);
-  template<typename MessageType>
   static inline bool ReadMessageNoVirtual(io::CodedInputStream* input,
-                                          MessageType* value);
-
-  // The same, but do not modify input's recursion depth.  This is useful
-  // when reading a bunch of groups or messages in a loop, because then the
-  // recursion depth can be incremented before the loop and decremented after.
-  template<typename MessageType>
-  static inline bool ReadGroupNoVirtualNoRecursionDepth(
-      int field_number, io::CodedInputStream* input, MessageType* value);
-
-  template<typename MessageType>
-  static inline bool ReadMessageNoVirtualNoRecursionDepth(
-      io::CodedInputStream* input, MessageType* value);
+                                          MessageType* value) {
+    return ReadMessage(input, value);
+  }
 
   // Write a tag.  The Write*() functions typically include the tag, so
   // normally there's no need to call this unless using the Write*NoTag()
   // variants.
-  INL static void WriteTag(int field_number, WireType type,
-                           io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteTag(int field_number, WireType type,
+                                              io::CodedOutputStream* output);
 
   // Write fields, without tags.
-  INL static void WriteInt32NoTag(int32 value, io::CodedOutputStream* output);
-  INL static void WriteInt64NoTag(int64 value, io::CodedOutputStream* output);
-  INL static void WriteUInt32NoTag(uint32 value, io::CodedOutputStream* output);
-  INL static void WriteUInt64NoTag(uint64 value, io::CodedOutputStream* output);
-  INL static void WriteSInt32NoTag(int32 value, io::CodedOutputStream* output);
-  INL static void WriteSInt64NoTag(int64 value, io::CodedOutputStream* output);
-  INL static void WriteFixed32NoTag(uint32 value,
-                                    io::CodedOutputStream* output);
-  INL static void WriteFixed64NoTag(uint64 value,
-                                    io::CodedOutputStream* output);
-  INL static void WriteSFixed32NoTag(int32 value,
-                                     io::CodedOutputStream* output);
-  INL static void WriteSFixed64NoTag(int64 value,
-                                     io::CodedOutputStream* output);
-  INL static void WriteFloatNoTag(float value, io::CodedOutputStream* output);
-  INL static void WriteDoubleNoTag(double value, io::CodedOutputStream* output);
-  INL static void WriteBoolNoTag(bool value, io::CodedOutputStream* output);
-  INL static void WriteEnumNoTag(int value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteInt32NoTag(
+      int32_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteInt64NoTag(
+      int64_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteUInt32NoTag(
+      uint32_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteUInt64NoTag(
+      uint64_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteSInt32NoTag(
+      int32_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteSInt64NoTag(
+      int64_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteFixed32NoTag(
+      uint32_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteFixed64NoTag(
+      uint64_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteSFixed32NoTag(
+      int32_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteSFixed64NoTag(
+      int64_t value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteFloatNoTag(
+      float value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteDoubleNoTag(
+      double value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteBoolNoTag(
+      bool value, io::CodedOutputStream* output);
+  PROTOBUF_NDEBUG_INLINE static void WriteEnumNoTag(
+      int value, io::CodedOutputStream* output);
 
   // Write array of primitive fields, without tags
   static void WriteFloatArray(const float* a, int n,
                               io::CodedOutputStream* output);
   static void WriteDoubleArray(const double* a, int n,
                                io::CodedOutputStream* output);
-  static void WriteFixed32Array(const uint32* a, int n,
+  static void WriteFixed32Array(const uint32_t* a, int n,
                                 io::CodedOutputStream* output);
-  static void WriteFixed64Array(const uint64* a, int n,
+  static void WriteFixed64Array(const uint64_t* a, int n,
                                 io::CodedOutputStream* output);
-  static void WriteSFixed32Array(const int32* a, int n,
+  static void WriteSFixed32Array(const int32_t* a, int n,
                                  io::CodedOutputStream* output);
-  static void WriteSFixed64Array(const int64* a, int n,
+  static void WriteSFixed64Array(const int64_t* a, int n,
                                  io::CodedOutputStream* output);
   static void WriteBoolArray(const bool* a, int n,
                              io::CodedOutputStream* output);
 
   // Write fields, including tags.
-  static void WriteInt32(int field_number, int32 value,
+  static void WriteInt32(int field_number, int32_t value,
                          io::CodedOutputStream* output);
-  static void WriteInt64(int field_number, int64 value,
+  static void WriteInt64(int field_number, int64_t value,
                          io::CodedOutputStream* output);
-  static void WriteUInt32(int field_number, uint32 value,
+  static void WriteUInt32(int field_number, uint32_t value,
                           io::CodedOutputStream* output);
-  static void WriteUInt64(int field_number, uint64 value,
+  static void WriteUInt64(int field_number, uint64_t value,
                           io::CodedOutputStream* output);
-  static void WriteSInt32(int field_number, int32 value,
+  static void WriteSInt32(int field_number, int32_t value,
                           io::CodedOutputStream* output);
-  static void WriteSInt64(int field_number, int64 value,
+  static void WriteSInt64(int field_number, int64_t value,
                           io::CodedOutputStream* output);
-  static void WriteFixed32(int field_number, uint32 value,
+  static void WriteFixed32(int field_number, uint32_t value,
                            io::CodedOutputStream* output);
-  static void WriteFixed64(int field_number, uint64 value,
+  static void WriteFixed64(int field_number, uint64_t value,
                            io::CodedOutputStream* output);
-  static void WriteSFixed32(int field_number, int32 value,
+  static void WriteSFixed32(int field_number, int32_t value,
                             io::CodedOutputStream* output);
-  static void WriteSFixed64(int field_number, int64 value,
+  static void WriteSFixed64(int field_number, int64_t value,
                             io::CodedOutputStream* output);
   static void WriteFloat(int field_number, float value,
                          io::CodedOutputStream* output);
@@ -445,13 +426,14 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   static void WriteEnum(int field_number, int value,
                         io::CodedOutputStream* output);
 
-  static void WriteString(int field_number, const string& value,
+  static void WriteString(int field_number, const std::string& value,
                           io::CodedOutputStream* output);
-  static void WriteBytes(int field_number, const string& value,
+  static void WriteBytes(int field_number, const std::string& value,
                          io::CodedOutputStream* output);
-  static void WriteStringMaybeAliased(int field_number, const string& value,
+  static void WriteStringMaybeAliased(int field_number,
+                                      const std::string& value,
                                       io::CodedOutputStream* output);
-  static void WriteBytesMaybeAliased(int field_number, const string& value,
+  static void WriteBytesMaybeAliased(int field_number, const std::string& value,
                                      io::CodedOutputStream* output);
 
   static void WriteGroup(int field_number, const MessageLite& value,
@@ -479,230 +461,260 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
                                            io::CodedOutputStream* output);
 
   // Like above, but use only *ToArray methods of CodedOutputStream.
-  INL static uint8* WriteTagToArray(int field_number, WireType type,
-                                    uint8* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteTagToArray(int field_number,
+                                                         WireType type,
+                                                         uint8_t* target);
 
   // Write fields, without tags.
-  INL static uint8* WriteInt32NoTagToArray(int32 value, uint8* target);
-  INL static uint8* WriteInt64NoTagToArray(int64 value, uint8* target);
-  INL static uint8* WriteUInt32NoTagToArray(uint32 value, uint8* target);
-  INL static uint8* WriteUInt64NoTagToArray(uint64 value, uint8* target);
-  INL static uint8* WriteSInt32NoTagToArray(int32 value, uint8* target);
-  INL static uint8* WriteSInt64NoTagToArray(int64 value, uint8* target);
-  INL static uint8* WriteFixed32NoTagToArray(uint32 value, uint8* target);
-  INL static uint8* WriteFixed64NoTagToArray(uint64 value, uint8* target);
-  INL static uint8* WriteSFixed32NoTagToArray(int32 value, uint8* target);
-  INL static uint8* WriteSFixed64NoTagToArray(int64 value, uint8* target);
-  INL static uint8* WriteFloatNoTagToArray(float value, uint8* target);
-  INL static uint8* WriteDoubleNoTagToArray(double value, uint8* target);
-  INL static uint8* WriteBoolNoTagToArray(bool value, uint8* target);
-  INL static uint8* WriteEnumNoTagToArray(int value, uint8* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt32NoTagToArray(
+      int32_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt64NoTagToArray(
+      int64_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt32NoTagToArray(
+      uint32_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt64NoTagToArray(
+      uint64_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt32NoTagToArray(
+      int32_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt64NoTagToArray(
+      int64_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed32NoTagToArray(
+      uint32_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed64NoTagToArray(
+      uint64_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed32NoTagToArray(
+      int32_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed64NoTagToArray(
+      int64_t value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFloatNoTagToArray(
+      float value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteDoubleNoTagToArray(
+      double value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBoolNoTagToArray(bool value,
+                                                               uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteEnumNoTagToArray(int value,
+                                                               uint8_t* target);
 
   // Write fields, without tags.  These require that value.size() > 0.
-  template<typename T>
-  INL static uint8* WritePrimitiveNoTagToArray(
-      const RepeatedField<T>& value,
-      uint8* (*Writer)(T, uint8*), uint8* target);
-  template<typename T>
-  INL static uint8* WriteFixedNoTagToArray(
-      const RepeatedField<T>& value,
-      uint8* (*Writer)(T, uint8*), uint8* target);
-
-  INL static uint8* WriteInt32NoTagToArray(
-      const RepeatedField< int32>& value, uint8* output);
-  INL static uint8* WriteInt64NoTagToArray(
-      const RepeatedField< int64>& value, uint8* output);
-  INL static uint8* WriteUInt32NoTagToArray(
-      const RepeatedField<uint32>& value, uint8* output);
-  INL static uint8* WriteUInt64NoTagToArray(
-      const RepeatedField<uint64>& value, uint8* output);
-  INL static uint8* WriteSInt32NoTagToArray(
-      const RepeatedField< int32>& value, uint8* output);
-  INL static uint8* WriteSInt64NoTagToArray(
-      const RepeatedField< int64>& value, uint8* output);
-  INL static uint8* WriteFixed32NoTagToArray(
-      const RepeatedField<uint32>& value, uint8* output);
-  INL static uint8* WriteFixed64NoTagToArray(
-      const RepeatedField<uint64>& value, uint8* output);
-  INL static uint8* WriteSFixed32NoTagToArray(
-      const RepeatedField< int32>& value, uint8* output);
-  INL static uint8* WriteSFixed64NoTagToArray(
-      const RepeatedField< int64>& value, uint8* output);
-  INL static uint8* WriteFloatNoTagToArray(
-      const RepeatedField< float>& value, uint8* output);
-  INL static uint8* WriteDoubleNoTagToArray(
-      const RepeatedField<double>& value, uint8* output);
-  INL static uint8* WriteBoolNoTagToArray(
-      const RepeatedField<  bool>& value, uint8* output);
-  INL static uint8* WriteEnumNoTagToArray(
-      const RepeatedField<   int>& value, uint8* output);
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WritePrimitiveNoTagToArray(
+      const RepeatedField<T>& value, uint8_t* (*Writer)(T, uint8_t*),
+      uint8_t* target);
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixedNoTagToArray(
+      const RepeatedField<T>& value, uint8_t* (*Writer)(T, uint8_t*),
+      uint8_t* target);
+
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt32NoTagToArray(
+      const RepeatedField<int32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt64NoTagToArray(
+      const RepeatedField<int64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt32NoTagToArray(
+      const RepeatedField<uint32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt64NoTagToArray(
+      const RepeatedField<uint64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt32NoTagToArray(
+      const RepeatedField<int32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt64NoTagToArray(
+      const RepeatedField<int64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed32NoTagToArray(
+      const RepeatedField<uint32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed64NoTagToArray(
+      const RepeatedField<uint64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed32NoTagToArray(
+      const RepeatedField<int32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed64NoTagToArray(
+      const RepeatedField<int64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFloatNoTagToArray(
+      const RepeatedField<float>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteDoubleNoTagToArray(
+      const RepeatedField<double>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBoolNoTagToArray(
+      const RepeatedField<bool>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteEnumNoTagToArray(
+      const RepeatedField<int>& value, uint8_t* output);
 
   // Write fields, including tags.
-  INL static uint8* WriteInt32ToArray(int field_number, int32 value,
-                                      uint8* target);
-  INL static uint8* WriteInt64ToArray(int field_number, int64 value,
-                                      uint8* target);
-  INL static uint8* WriteUInt32ToArray(int field_number, uint32 value,
-                                       uint8* target);
-  INL static uint8* WriteUInt64ToArray(int field_number, uint64 value,
-                                       uint8* target);
-  INL static uint8* WriteSInt32ToArray(int field_number, int32 value,
-                                       uint8* target);
-  INL static uint8* WriteSInt64ToArray(int field_number, int64 value,
-                                       uint8* target);
-  INL static uint8* WriteFixed32ToArray(int field_number, uint32 value,
-                                        uint8* target);
-  INL static uint8* WriteFixed64ToArray(int field_number, uint64 value,
-                                        uint8* target);
-  INL static uint8* WriteSFixed32ToArray(int field_number, int32 value,
-                                         uint8* target);
-  INL static uint8* WriteSFixed64ToArray(int field_number, int64 value,
-                                         uint8* target);
-  INL static uint8* WriteFloatToArray(int field_number, float value,
-                                      uint8* target);
-  INL static uint8* WriteDoubleToArray(int field_number, double value,
-                                       uint8* target);
-  INL static uint8* WriteBoolToArray(int field_number, bool value,
-                                     uint8* target);
-  INL static uint8* WriteEnumToArray(int field_number, int value,
-                                     uint8* target);
-
-  template<typename T>
-  INL static uint8* WritePrimitiveToArray(
-      int field_number,
-      const RepeatedField<T>& value,
-      uint8* (*Writer)(int, T, uint8*), uint8* target);
-
-  INL static uint8* WriteInt32ToArray(
-      int field_number, const RepeatedField< int32>& value, uint8* output);
-  INL static uint8* WriteInt64ToArray(
-      int field_number, const RepeatedField< int64>& value, uint8* output);
-  INL static uint8* WriteUInt32ToArray(
-      int field_number, const RepeatedField<uint32>& value, uint8* output);
-  INL static uint8* WriteUInt64ToArray(
-      int field_number, const RepeatedField<uint64>& value, uint8* output);
-  INL static uint8* WriteSInt32ToArray(
-      int field_number, const RepeatedField< int32>& value, uint8* output);
-  INL static uint8* WriteSInt64ToArray(
-      int field_number, const RepeatedField< int64>& value, uint8* output);
-  INL static uint8* WriteFixed32ToArray(
-      int field_number, const RepeatedField<uint32>& value, uint8* output);
-  INL static uint8* WriteFixed64ToArray(
-      int field_number, const RepeatedField<uint64>& value, uint8* output);
-  INL static uint8* WriteSFixed32ToArray(
-      int field_number, const RepeatedField< int32>& value, uint8* output);
-  INL static uint8* WriteSFixed64ToArray(
-      int field_number, const RepeatedField< int64>& value, uint8* output);
-  INL static uint8* WriteFloatToArray(
-      int field_number, const RepeatedField< float>& value, uint8* output);
-  INL static uint8* WriteDoubleToArray(
-      int field_number, const RepeatedField<double>& value, uint8* output);
-  INL static uint8* WriteBoolToArray(
-      int field_number, const RepeatedField<  bool>& value, uint8* output);
-  INL static uint8* WriteEnumToArray(
-      int field_number, const RepeatedField<   int>& value, uint8* output);
-
-  INL static uint8* WriteStringToArray(int field_number, const string& value,
-                                       uint8* target);
-  INL static uint8* WriteBytesToArray(int field_number, const string& value,
-                                      uint8* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt32ToArray(int field_number,
+                                                           int32_t value,
+                                                           uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt64ToArray(int field_number,
+                                                           int64_t value,
+                                                           uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt32ToArray(int field_number,
+                                                            uint32_t value,
+                                                            uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt64ToArray(int field_number,
+                                                            uint64_t value,
+                                                            uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt32ToArray(int field_number,
+                                                            int32_t value,
+                                                            uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt64ToArray(int field_number,
+                                                            int64_t value,
+                                                            uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed32ToArray(int field_number,
+                                                             uint32_t value,
+                                                             uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed64ToArray(int field_number,
+                                                             uint64_t value,
+                                                             uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed32ToArray(int field_number,
+                                                              int32_t value,
+                                                              uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed64ToArray(int field_number,
+                                                              int64_t value,
+                                                              uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFloatToArray(int field_number,
+                                                           float value,
+                                                           uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteDoubleToArray(int field_number,
+                                                            double value,
+                                                            uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBoolToArray(int field_number,
+                                                          bool value,
+                                                          uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteEnumToArray(int field_number,
+                                                          int value,
+                                                          uint8_t* target);
+
+  template <typename T>
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WritePrimitiveToArray(
+      int field_number, const RepeatedField<T>& value,
+      uint8_t* (*Writer)(int, T, uint8_t*), uint8_t* target);
+
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt32ToArray(
+      int field_number, const RepeatedField<int32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteInt64ToArray(
+      int field_number, const RepeatedField<int64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt32ToArray(
+      int field_number, const RepeatedField<uint32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteUInt64ToArray(
+      int field_number, const RepeatedField<uint64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt32ToArray(
+      int field_number, const RepeatedField<int32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSInt64ToArray(
+      int field_number, const RepeatedField<int64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed32ToArray(
+      int field_number, const RepeatedField<uint32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFixed64ToArray(
+      int field_number, const RepeatedField<uint64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed32ToArray(
+      int field_number, const RepeatedField<int32_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteSFixed64ToArray(
+      int field_number, const RepeatedField<int64_t>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteFloatToArray(
+      int field_number, const RepeatedField<float>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteDoubleToArray(
+      int field_number, const RepeatedField<double>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBoolToArray(
+      int field_number, const RepeatedField<bool>& value, uint8_t* output);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteEnumToArray(
+      int field_number, const RepeatedField<int>& value, uint8_t* output);
+
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteStringToArray(
+      int field_number, const std::string& value, uint8_t* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteBytesToArray(
+      int field_number, const std::string& value, uint8_t* target);
 
   // Whether to serialize deterministically (e.g., map keys are
   // sorted) is a property of a CodedOutputStream, and in the process
   // of serialization, the "ToArray" variants may be invoked.  But they don't
   // have a CodedOutputStream available, so they get an additional parameter
   // telling them whether to serialize deterministically.
-  INL static uint8* InternalWriteGroupToArray(int field_number,
-                                              const MessageLite& value,
-                                              bool deterministic,
-                                              uint8* target);
-  INL static uint8* InternalWriteMessageToArray(int field_number,
-                                                const MessageLite& value,
-                                                bool deterministic,
-                                                uint8* target);
+  template <typename MessageType>
+  PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteGroup(
+      int field_number, const MessageType& value, uint8_t* target,
+      io::EpsCopyOutputStream* stream);
+  template <typename MessageType>
+  PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteMessage(
+      int field_number, const MessageType& value, uint8_t* target,
+      io::EpsCopyOutputStream* stream);
 
   // Like above, but de-virtualize the call to SerializeWithCachedSizes().  The
   // pointer must point at an instance of MessageType, *not* a subclass (or
   // the subclass must not override SerializeWithCachedSizes()).
   template <typename MessageType>
-  INL static uint8* InternalWriteGroupNoVirtualToArray(int field_number,
-                                                       const MessageType& value,
-                                                       bool deterministic,
-                                                       uint8* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteGroupNoVirtualToArray(
+      int field_number, const MessageType& value, uint8_t* target);
   template <typename MessageType>
-  INL static uint8* InternalWriteMessageNoVirtualToArray(
-      int field_number, const MessageType& value, bool deterministic,
-      uint8* target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteMessageNoVirtualToArray(
+      int field_number, const MessageType& value, uint8_t* target);
 
   // For backward-compatibility, the last four methods also have versions
   // that are non-deterministic always.
-  INL static uint8* WriteGroupToArray(int field_number,
-                                      const MessageLite& value, uint8* target) {
-    return InternalWriteGroupToArray(field_number, value, false, target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteGroupToArray(
+      int field_number, const MessageLite& value, uint8_t* target) {
+    io::EpsCopyOutputStream stream(
+        target,
+        value.GetCachedSize() +
+            static_cast<int>(2 * io::CodedOutputStream::VarintSize32(
+                                     static_cast<uint32_t>(field_number) << 3)),
+        io::CodedOutputStream::IsDefaultSerializationDeterministic());
+    return InternalWriteGroup(field_number, value, target, &stream);
   }
-  INL static uint8* WriteMessageToArray(int field_number,
-                                        const MessageLite& value,
-                                        uint8* target) {
-    return InternalWriteMessageToArray(field_number, value, false, target);
+  PROTOBUF_NDEBUG_INLINE static uint8_t* WriteMessageToArray(
+      int field_number, const MessageLite& value, uint8_t* target) {
+    int size = value.GetCachedSize();
+    io::EpsCopyOutputStream stream(
+        target,
+        size + static_cast<int>(io::CodedOutputStream::VarintSize32(
+                                    static_cast<uint32_t>(field_number) << 3) +
+                                io::CodedOutputStream::VarintSize32(size)),
+        io::CodedOutputStream::IsDefaultSerializationDeterministic());
+    return InternalWriteMessage(field_number, value, target, &stream);
   }
-  template <typename MessageType>
-  INL static uint8* WriteGroupNoVirtualToArray(int field_number,
-                                               const MessageType& value,
-                                               uint8* target) {
-    return InternalWriteGroupNoVirtualToArray(field_number, value, false,
-                                              target);
-  }
-  template <typename MessageType>
-  INL static uint8* WriteMessageNoVirtualToArray(int field_number,
-                                                 const MessageType& value,
-                                                 uint8* target) {
-    return InternalWriteMessageNoVirtualToArray(field_number, value, false,
-                                                target);
-  }
-
-#undef INL
 
   // Compute the byte size of a field.  The XxSize() functions do NOT include
   // the tag, so you must also call TagSize().  (This is because, for repeated
   // fields, you should only call TagSize() once and multiply it by the element
   // count, but you may have to call XxSize() for each individual element.)
-  static inline size_t Int32Size   ( int32 value);
-  static inline size_t Int64Size   ( int64 value);
-  static inline size_t UInt32Size  (uint32 value);
-  static inline size_t UInt64Size  (uint64 value);
-  static inline size_t SInt32Size  ( int32 value);
-  static inline size_t SInt64Size  ( int64 value);
-  static inline size_t EnumSize    (   int value);
-
-  static        size_t Int32Size (const RepeatedField< int32>& value);
-  static inline size_t Int64Size (const RepeatedField< int64>& value);
-  static        size_t UInt32Size(const RepeatedField<uint32>& value);
-  static inline size_t UInt64Size(const RepeatedField<uint64>& value);
-  static        size_t SInt32Size(const RepeatedField< int32>& value);
-  static inline size_t SInt64Size(const RepeatedField< int64>& value);
-  static        size_t EnumSize  (const RepeatedField<   int>& value);
+  static inline size_t Int32Size(int32_t value);
+  static inline size_t Int64Size(int64_t value);
+  static inline size_t UInt32Size(uint32_t value);
+  static inline size_t UInt64Size(uint64_t value);
+  static inline size_t SInt32Size(int32_t value);
+  static inline size_t SInt64Size(int64_t value);
+  static inline size_t EnumSize(int value);
+  static inline size_t Int32SizePlusOne(int32_t value);
+  static inline size_t Int64SizePlusOne(int64_t value);
+  static inline size_t UInt32SizePlusOne(uint32_t value);
+  static inline size_t UInt64SizePlusOne(uint64_t value);
+  static inline size_t SInt32SizePlusOne(int32_t value);
+  static inline size_t SInt64SizePlusOne(int64_t value);
+  static inline size_t EnumSizePlusOne(int value);
+
+  static size_t Int32Size(const RepeatedField<int32_t>& value);
+  static size_t Int64Size(const RepeatedField<int64_t>& value);
+  static size_t UInt32Size(const RepeatedField<uint32_t>& value);
+  static size_t UInt64Size(const RepeatedField<uint64_t>& value);
+  static size_t SInt32Size(const RepeatedField<int32_t>& value);
+  static size_t SInt64Size(const RepeatedField<int64_t>& value);
+  static size_t EnumSize(const RepeatedField<int>& value);
 
   // These types always have the same size.
-  static const size_t kFixed32Size  = 4;
-  static const size_t kFixed64Size  = 8;
-  static const size_t kSFixed32Size = 4;
-  static const size_t kSFixed64Size = 8;
-  static const size_t kFloatSize    = 4;
-  static const size_t kDoubleSize   = 8;
-  static const size_t kBoolSize     = 1;
+  static constexpr size_t kFixed32Size = 4;
+  static constexpr size_t kFixed64Size = 8;
+  static constexpr size_t kSFixed32Size = 4;
+  static constexpr size_t kSFixed64Size = 8;
+  static constexpr size_t kFloatSize = 4;
+  static constexpr size_t kDoubleSize = 8;
+  static constexpr size_t kBoolSize = 1;
 
-  static inline size_t StringSize(const string& value);
-  static inline size_t BytesSize (const string& value);
+  static inline size_t StringSize(const std::string& value);
+  static inline size_t BytesSize(const std::string& value);
 
-  static inline size_t GroupSize  (const MessageLite& value);
-  static inline size_t MessageSize(const MessageLite& value);
+  template <typename MessageType>
+  static inline size_t GroupSize(const MessageType& value);
+  template <typename MessageType>
+  static inline size_t MessageSize(const MessageType& value);
 
   // Like above, but de-virtualize the call to ByteSize().  The
   // pointer must point at an instance of MessageType, *not* a subclass (or
   // the subclass must not override ByteSize()).
-  template<typename MessageType>
-  static inline size_t GroupSizeNoVirtual  (const MessageType& value);
-  template<typename MessageType>
+  template <typename MessageType>
+  static inline size_t GroupSizeNoVirtual(const MessageType& value);
+  template <typename MessageType>
   static inline size_t MessageSizeNoVirtual(const MessageType& value);
 
   // Given the length of data, calculate the byte size of the data on the
@@ -714,21 +726,19 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
   // 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_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static bool ReadRepeatedFixedSizePrimitive(
-      int tag_size,
-      uint32 tag,
-      google::protobuf::io::CodedInputStream* input,
+  PROTOBUF_NDEBUG_INLINE static bool ReadRepeatedFixedSizePrimitive(
+      int tag_size, uint32_t tag, io::CodedInputStream* input,
       RepeatedField<CType>* value);
 
   // Like ReadRepeatedFixedSizePrimitive but for packed primitive fields.
   template <typename CType, enum FieldType DeclaredType>
-  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
-  static bool ReadPackedFixedSizePrimitive(
-      google::protobuf::io::CodedInputStream* input, RepeatedField<CType>* value);
+  PROTOBUF_NDEBUG_INLINE static bool ReadPackedFixedSizePrimitive(
+      io::CodedInputStream* input, RepeatedField<CType>* value);
 
   static const CppType kFieldTypeToCppTypeMap[];
   static const WireFormatLite::WireType kWireTypeForFieldType[];
+  static void WriteSubMessageMaybeToArray(int size, const MessageLite& value,
+                                          io::CodedOutputStream* output);
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(WireFormatLite);
 };
@@ -737,13 +747,13 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
 // discards them.  WireFormat defines a subclass which writes to an
 // UnknownFieldSet.  This class is used by ExtensionSet::ParseField(), since
 // ExtensionSet is part of the lite library but UnknownFieldSet is not.
-class LIBPROTOBUF_EXPORT FieldSkipper {
+class PROTOBUF_EXPORT FieldSkipper {
  public:
   FieldSkipper() {}
   virtual ~FieldSkipper() {}
 
   // Skip a field whose tag has already been consumed.
-  virtual bool SkipField(io::CodedInputStream* input, uint32 tag);
+  virtual bool SkipField(io::CodedInputStream* input, uint32_t tag);
 
   // Skip an entire message or group, up to an end-group tag (which is consumed)
   // or end-of-stream.
@@ -757,45 +767,45 @@ class LIBPROTOBUF_EXPORT FieldSkipper {
 
 // Subclass of FieldSkipper which saves skipped fields to a CodedOutputStream.
 
-class LIBPROTOBUF_EXPORT CodedOutputStreamFieldSkipper : public FieldSkipper {
+class PROTOBUF_EXPORT CodedOutputStreamFieldSkipper : public FieldSkipper {
  public:
   explicit CodedOutputStreamFieldSkipper(io::CodedOutputStream* unknown_fields)
       : unknown_fields_(unknown_fields) {}
-  virtual ~CodedOutputStreamFieldSkipper() {}
+  ~CodedOutputStreamFieldSkipper() override {}
 
   // implements FieldSkipper -----------------------------------------
-  virtual bool SkipField(io::CodedInputStream* input, uint32 tag);
-  virtual bool SkipMessage(io::CodedInputStream* input);
-  virtual void SkipUnknownEnum(int field_number, int value);
+  bool SkipField(io::CodedInputStream* input, uint32_t tag) override;
+  bool SkipMessage(io::CodedInputStream* input) override;
+  void SkipUnknownEnum(int field_number, int value) override;
 
  protected:
   io::CodedOutputStream* unknown_fields_;
 };
 
-
 // inline methods ====================================================
 
-inline WireFormatLite::CppType
-WireFormatLite::FieldTypeToCppType(FieldType type) {
+inline WireFormatLite::CppType WireFormatLite::FieldTypeToCppType(
+    FieldType type) {
   return kFieldTypeToCppTypeMap[type];
 }
 
-inline uint32 WireFormatLite::MakeTag(int field_number, WireType type) {
+constexpr inline uint32_t WireFormatLite::MakeTag(int field_number,
+                                                  WireType type) {
   return GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(field_number, type);
 }
 
-inline WireFormatLite::WireType WireFormatLite::GetTagWireType(uint32 tag) {
+inline WireFormatLite::WireType WireFormatLite::GetTagWireType(uint32_t tag) {
   return static_cast<WireType>(tag & kTagTypeMask);
 }
 
-inline int WireFormatLite::GetTagFieldNumber(uint32 tag) {
+inline int WireFormatLite::GetTagFieldNumber(uint32_t tag) {
   return static_cast<int>(tag >> kTagTypeBits);
 }
 
 inline size_t WireFormatLite::TagSize(int field_number,
                                       WireFormatLite::FieldType type) {
   size_t result = io::CodedOutputStream::VarintSize32(
-    static_cast<uint32>(field_number << kTagTypeBits));
+      static_cast<uint32_t>(field_number << kTagTypeBits));
   if (type == TYPE_GROUP) {
     // Groups have both a start and an end tag.
     return result * 2;
@@ -804,28 +814,20 @@ inline size_t WireFormatLite::TagSize(int field_number,
   }
 }
 
-inline uint32 WireFormatLite::EncodeFloat(float value) {
-  union {float f; uint32 i;};
-  f = value;
-  return i;
+inline uint32_t WireFormatLite::EncodeFloat(float value) {
+  return bit_cast<uint32_t>(value);
 }
 
-inline float WireFormatLite::DecodeFloat(uint32 value) {
-  union {float f; uint32 i;};
-  i = value;
-  return f;
+inline float WireFormatLite::DecodeFloat(uint32_t value) {
+  return bit_cast<float>(value);
 }
 
-inline uint64 WireFormatLite::EncodeDouble(double value) {
-  union {double f; uint64 i;};
-  f = value;
-  return i;
+inline uint64_t WireFormatLite::EncodeDouble(double value) {
+  return bit_cast<uint64_t>(value);
 }
 
-inline double WireFormatLite::DecodeDouble(uint64 value) {
-  union {double f; uint64 i;};
-  i = value;
-  return f;
+inline double WireFormatLite::DecodeDouble(uint64_t value) {
+  return bit_cast<double>(value);
 }
 
 // ZigZag Transform:  Encodes signed integers so that they can be
@@ -839,7 +841,7 @@ inline double WireFormatLite::DecodeDouble(uint64 value) {
 // in such a way that those with a small absolute value will have smaller
 // encoded values, making them appropriate for encoding using varint.
 //
-//       int32 ->     uint32
+//       int32_t ->     uint32_t
 // -------------------------
 //           0 ->          0
 //          -1 ->          1
@@ -852,43 +854,1062 @@ inline double WireFormatLite::DecodeDouble(uint64 value) {
 //        >> encode >>
 //        << decode <<
 
-inline uint32 WireFormatLite::ZigZagEncode32(int32 n) {
+inline uint32_t WireFormatLite::ZigZagEncode32(int32_t n) {
   // Note:  the right-shift must be arithmetic
   // Note:  left shift must be unsigned because of overflow
-  return (static_cast<uint32>(n) << 1) ^ static_cast<uint32>(n >> 31);
+  return (static_cast<uint32_t>(n) << 1) ^ static_cast<uint32_t>(n >> 31);
 }
 
-inline int32 WireFormatLite::ZigZagDecode32(uint32 n) {
+inline int32_t WireFormatLite::ZigZagDecode32(uint32_t n) {
   // Note:  Using unsigned types prevent undefined behavior
-  return static_cast<int32>((n >> 1) ^ -(n & 1));
+  return static_cast<int32_t>((n >> 1) ^ (~(n & 1) + 1));
 }
 
-inline uint64 WireFormatLite::ZigZagEncode64(int64 n) {
+inline uint64_t WireFormatLite::ZigZagEncode64(int64_t n) {
   // Note:  the right-shift must be arithmetic
   // Note:  left shift must be unsigned because of overflow
-  return (static_cast<uint64>(n) << 1) ^ static_cast<uint64>(n >> 63);
+  return (static_cast<uint64_t>(n) << 1) ^ static_cast<uint64_t>(n >> 63);
 }
 
-inline int64 WireFormatLite::ZigZagDecode64(uint64 n) {
+inline int64_t WireFormatLite::ZigZagDecode64(uint64_t n) {
   // Note:  Using unsigned types prevent undefined behavior
-  return static_cast<int64>((n >> 1) ^ -(n & 1));
+  return static_cast<int64_t>((n >> 1) ^ (~(n & 1) + 1));
 }
 
 // String is for UTF-8 text only, but, even so, ReadString() can simply
 // call ReadBytes().
 
 inline bool WireFormatLite::ReadString(io::CodedInputStream* input,
-                                       string* value) {
+                                       std::string* value) {
   return ReadBytes(input, value);
 }
 
 inline bool WireFormatLite::ReadString(io::CodedInputStream* input,
-                                       string** p) {
+                                       std::string** p) {
   return ReadBytes(input, p);
 }
 
+inline uint8_t* InternalSerializeUnknownMessageSetItemsToArray(
+    const std::string& unknown_fields, uint8_t* target,
+    io::EpsCopyOutputStream* stream) {
+  return stream->WriteRaw(unknown_fields.data(),
+                          static_cast<int>(unknown_fields.size()), target);
+}
+
+inline size_t ComputeUnknownMessageSetItemsSize(
+    const std::string& unknown_fields) {
+  return unknown_fields.size();
+}
+
+// Implementation details of ReadPrimitive.
+
+template <>
+inline bool WireFormatLite::ReadPrimitive<int32_t, WireFormatLite::TYPE_INT32>(
+    io::CodedInputStream* input, int32_t* value) {
+  uint32_t temp;
+  if (!input->ReadVarint32(&temp)) return false;
+  *value = static_cast<int32_t>(temp);
+  return true;
+}
+template <>
+inline bool WireFormatLite::ReadPrimitive<int64_t, WireFormatLite::TYPE_INT64>(
+    io::CodedInputStream* input, int64_t* value) {
+  uint64_t temp;
+  if (!input->ReadVarint64(&temp)) return false;
+  *value = static_cast<int64_t>(temp);
+  return true;
+}
+template <>
+inline bool
+WireFormatLite::ReadPrimitive<uint32_t, WireFormatLite::TYPE_UINT32>(
+    io::CodedInputStream* input, uint32_t* value) {
+  return input->ReadVarint32(value);
+}
+template <>
+inline bool
+WireFormatLite::ReadPrimitive<uint64_t, WireFormatLite::TYPE_UINT64>(
+    io::CodedInputStream* input, uint64_t* value) {
+  return input->ReadVarint64(value);
+}
+template <>
+inline bool WireFormatLite::ReadPrimitive<int32_t, WireFormatLite::TYPE_SINT32>(
+    io::CodedInputStream* input, int32_t* value) {
+  uint32_t temp;
+  if (!input->ReadVarint32(&temp)) return false;
+  *value = ZigZagDecode32(temp);
+  return true;
+}
+template <>
+inline bool WireFormatLite::ReadPrimitive<int64_t, WireFormatLite::TYPE_SINT64>(
+    io::CodedInputStream* input, int64_t* value) {
+  uint64_t temp;
+  if (!input->ReadVarint64(&temp)) return false;
+  *value = ZigZagDecode64(temp);
+  return true;
+}
+template <>
+inline bool
+WireFormatLite::ReadPrimitive<uint32_t, WireFormatLite::TYPE_FIXED32>(
+    io::CodedInputStream* input, uint32_t* value) {
+  return input->ReadLittleEndian32(value);
+}
+template <>
+inline bool
+WireFormatLite::ReadPrimitive<uint64_t, WireFormatLite::TYPE_FIXED64>(
+    io::CodedInputStream* input, uint64_t* value) {
+  return input->ReadLittleEndian64(value);
+}
+template <>
+inline bool
+WireFormatLite::ReadPrimitive<int32_t, WireFormatLite::TYPE_SFIXED32>(
+    io::CodedInputStream* input, int32_t* value) {
+  uint32_t temp;
+  if (!input->ReadLittleEndian32(&temp)) return false;
+  *value = static_cast<int32_t>(temp);
+  return true;
+}
+template <>
+inline bool
+WireFormatLite::ReadPrimitive<int64_t, WireFormatLite::TYPE_SFIXED64>(
+    io::CodedInputStream* input, int64_t* value) {
+  uint64_t temp;
+  if (!input->ReadLittleEndian64(&temp)) return false;
+  *value = static_cast<int64_t>(temp);
+  return true;
+}
+template <>
+inline bool WireFormatLite::ReadPrimitive<float, WireFormatLite::TYPE_FLOAT>(
+    io::CodedInputStream* input, float* value) {
+  uint32_t temp;
+  if (!input->ReadLittleEndian32(&temp)) return false;
+  *value = DecodeFloat(temp);
+  return true;
+}
+template <>
+inline bool WireFormatLite::ReadPrimitive<double, WireFormatLite::TYPE_DOUBLE>(
+    io::CodedInputStream* input, double* value) {
+  uint64_t temp;
+  if (!input->ReadLittleEndian64(&temp)) return false;
+  *value = DecodeDouble(temp);
+  return true;
+}
+template <>
+inline bool WireFormatLite::ReadPrimitive<bool, WireFormatLite::TYPE_BOOL>(
+    io::CodedInputStream* input, bool* value) {
+  uint64_t temp;
+  if (!input->ReadVarint64(&temp)) return false;
+  *value = temp != 0;
+  return true;
+}
+template <>
+inline bool WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
+    io::CodedInputStream* input, int* value) {
+  uint32_t temp;
+  if (!input->ReadVarint32(&temp)) return false;
+  *value = static_cast<int>(temp);
+  return true;
+}
+
+template <>
+inline const uint8_t*
+WireFormatLite::ReadPrimitiveFromArray<uint32_t, WireFormatLite::TYPE_FIXED32>(
+    const uint8_t* buffer, uint32_t* value) {
+  return io::CodedInputStream::ReadLittleEndian32FromArray(buffer, value);
+}
+template <>
+inline const uint8_t*
+WireFormatLite::ReadPrimitiveFromArray<uint64_t, WireFormatLite::TYPE_FIXED64>(
+    const uint8_t* buffer, uint64_t* value) {
+  return io::CodedInputStream::ReadLittleEndian64FromArray(buffer, value);
+}
+template <>
+inline const uint8_t*
+WireFormatLite::ReadPrimitiveFromArray<int32_t, WireFormatLite::TYPE_SFIXED32>(
+    const uint8_t* buffer, int32_t* value) {
+  uint32_t temp;
+  buffer = io::CodedInputStream::ReadLittleEndian32FromArray(buffer, &temp);
+  *value = static_cast<int32_t>(temp);
+  return buffer;
+}
+template <>
+inline const uint8_t*
+WireFormatLite::ReadPrimitiveFromArray<int64_t, WireFormatLite::TYPE_SFIXED64>(
+    const uint8_t* buffer, int64_t* value) {
+  uint64_t temp;
+  buffer = io::CodedInputStream::ReadLittleEndian64FromArray(buffer, &temp);
+  *value = static_cast<int64_t>(temp);
+  return buffer;
+}
+template <>
+inline const uint8_t*
+WireFormatLite::ReadPrimitiveFromArray<float, WireFormatLite::TYPE_FLOAT>(
+    const uint8_t* buffer, float* value) {
+  uint32_t temp;
+  buffer = io::CodedInputStream::ReadLittleEndian32FromArray(buffer, &temp);
+  *value = DecodeFloat(temp);
+  return buffer;
+}
+template <>
+inline const uint8_t*
+WireFormatLite::ReadPrimitiveFromArray<double, WireFormatLite::TYPE_DOUBLE>(
+    const uint8_t* buffer, double* value) {
+  uint64_t temp;
+  buffer = io::CodedInputStream::ReadLittleEndian64FromArray(buffer, &temp);
+  *value = DecodeDouble(temp);
+  return buffer;
+}
+
+template <typename CType, enum WireFormatLite::FieldType DeclaredType>
+inline bool WireFormatLite::ReadRepeatedPrimitive(
+    int,  // tag_size, unused.
+    uint32_t tag, io::CodedInputStream* input, RepeatedField<CType>* values) {
+  CType value;
+  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
+  values->Add(value);
+  int elements_already_reserved = values->Capacity() - values->size();
+  while (elements_already_reserved > 0 && input->ExpectTag(tag)) {
+    if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
+    values->AddAlreadyReserved(value);
+    elements_already_reserved--;
+  }
+  return true;
+}
+
+template <typename CType, enum WireFormatLite::FieldType DeclaredType>
+inline bool WireFormatLite::ReadRepeatedFixedSizePrimitive(
+    int tag_size, uint32_t tag, io::CodedInputStream* input,
+    RepeatedField<CType>* values) {
+  GOOGLE_DCHECK_EQ(UInt32Size(tag), static_cast<size_t>(tag_size));
+  CType value;
+  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
+  values->Add(value);
+
+  // For fixed size values, repeated values can be read more quickly by
+  // reading directly from a raw array.
+  //
+  // We can get a tight loop by only reading as many elements as can be
+  // added to the RepeatedField without having to do any resizing. Additionally,
+  // we only try to read as many elements as are available from the current
+  // buffer space. Doing so avoids having to perform boundary checks when
+  // reading the value: the maximum number of elements that can be read is
+  // known outside of the loop.
+  const void* void_pointer;
+  int size;
+  input->GetDirectBufferPointerInline(&void_pointer, &size);
+  if (size > 0) {
+    const uint8_t* buffer = reinterpret_cast<const uint8_t*>(void_pointer);
+    // The number of bytes each type occupies on the wire.
+    const int per_value_size = tag_size + static_cast<int>(sizeof(value));
+
+    // parentheses around (std::min) prevents macro expansion of min(...)
+    int elements_available =
+        (std::min)(values->Capacity() - values->size(), size / per_value_size);
+    int num_read = 0;
+    while (num_read < elements_available &&
+           (buffer = io::CodedInputStream::ExpectTagFromArray(buffer, tag)) !=
+               nullptr) {
+      buffer = ReadPrimitiveFromArray<CType, DeclaredType>(buffer, &value);
+      values->AddAlreadyReserved(value);
+      ++num_read;
+    }
+    const int read_bytes = num_read * per_value_size;
+    if (read_bytes > 0) {
+      input->Skip(read_bytes);
+    }
+  }
+  return true;
+}
+
+// Specializations of ReadRepeatedPrimitive for the fixed size types, which use
+// the optimized code path.
+#define READ_REPEATED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)        \
+  template <>                                                             \
+  inline bool WireFormatLite::ReadRepeatedPrimitive<                      \
+      CPPTYPE, WireFormatLite::DECLARED_TYPE>(                            \
+      int tag_size, uint32_t tag, io::CodedInputStream* input,            \
+      RepeatedField<CPPTYPE>* values) {                                   \
+    return ReadRepeatedFixedSizePrimitive<CPPTYPE,                        \
+                                          WireFormatLite::DECLARED_TYPE>( \
+        tag_size, tag, input, values);                                    \
+  }
+
+READ_REPEATED_FIXED_SIZE_PRIMITIVE(uint32_t, TYPE_FIXED32)
+READ_REPEATED_FIXED_SIZE_PRIMITIVE(uint64_t, TYPE_FIXED64)
+READ_REPEATED_FIXED_SIZE_PRIMITIVE(int32_t, TYPE_SFIXED32)
+READ_REPEATED_FIXED_SIZE_PRIMITIVE(int64_t, TYPE_SFIXED64)
+READ_REPEATED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT)
+READ_REPEATED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
+
+#undef READ_REPEATED_FIXED_SIZE_PRIMITIVE
+
+template <typename CType, enum WireFormatLite::FieldType DeclaredType>
+bool WireFormatLite::ReadRepeatedPrimitiveNoInline(
+    int tag_size, uint32_t tag, io::CodedInputStream* input,
+    RepeatedField<CType>* value) {
+  return ReadRepeatedPrimitive<CType, DeclaredType>(tag_size, tag, input,
+                                                    value);
+}
+
+template <typename CType, enum WireFormatLite::FieldType DeclaredType>
+inline bool WireFormatLite::ReadPackedPrimitive(io::CodedInputStream* input,
+                                                RepeatedField<CType>* values) {
+  int length;
+  if (!input->ReadVarintSizeAsInt(&length)) return false;
+  io::CodedInputStream::Limit limit = input->PushLimit(length);
+  while (input->BytesUntilLimit() > 0) {
+    CType value;
+    if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
+    values->Add(value);
+  }
+  input->PopLimit(limit);
+  return true;
+}
+
+template <typename CType, enum WireFormatLite::FieldType DeclaredType>
+inline bool WireFormatLite::ReadPackedFixedSizePrimitive(
+    io::CodedInputStream* input, RepeatedField<CType>* values) {
+  int length;
+  if (!input->ReadVarintSizeAsInt(&length)) return false;
+  const int old_entries = values->size();
+  const int new_entries = length / static_cast<int>(sizeof(CType));
+  const int new_bytes = new_entries * static_cast<int>(sizeof(CType));
+  if (new_bytes != length) return false;
+  // We would *like* to pre-allocate the buffer to write into (for
+  // speed), but *must* avoid performing a very large allocation due
+  // to a malicious user-supplied "length" above.  So we have a fast
+  // path that pre-allocates when the "length" is less than a bound.
+  // We determine the bound by calling BytesUntilTotalBytesLimit() and
+  // BytesUntilLimit().  These return -1 to mean "no limit set".
+  // There are four cases:
+  // TotalBytesLimit  Limit
+  // -1               -1     Use slow path.
+  // -1               >= 0   Use fast path if length <= Limit.
+  // >= 0             -1     Use slow path.
+  // >= 0             >= 0   Use fast path if length <= min(both limits).
+  int64_t bytes_limit = input->BytesUntilTotalBytesLimit();
+  if (bytes_limit == -1) {
+    bytes_limit = input->BytesUntilLimit();
+  } else {
+    // parentheses around (std::min) prevents macro expansion of min(...)
+    bytes_limit =
+        (std::min)(bytes_limit, static_cast<int64_t>(input->BytesUntilLimit()));
+  }
+  if (bytes_limit >= new_bytes) {
+    // Fast-path that pre-allocates *values to the final size.
+#if defined(PROTOBUF_LITTLE_ENDIAN)
+    values->Resize(old_entries + new_entries, 0);
+    // values->mutable_data() may change after Resize(), so do this after:
+    void* dest = reinterpret_cast<void*>(values->mutable_data() + old_entries);
+    if (!input->ReadRaw(dest, new_bytes)) {
+      values->Truncate(old_entries);
+      return false;
+    }
+#else
+    values->Reserve(old_entries + new_entries);
+    CType value;
+    for (int i = 0; i < new_entries; ++i) {
+      if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
+      values->AddAlreadyReserved(value);
+    }
+#endif
+  } else {
+    // This is the slow-path case where "length" may be too large to
+    // safely allocate.  We read as much as we can into *values
+    // without pre-allocating "length" bytes.
+    CType value;
+    for (int i = 0; i < new_entries; ++i) {
+      if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
+      values->Add(value);
+    }
+  }
+  return true;
+}
+
+// Specializations of ReadPackedPrimitive for the fixed size types, which use
+// an optimized code path.
+#define READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)      \
+  template <>                                                                  \
+  inline bool                                                                  \
+  WireFormatLite::ReadPackedPrimitive<CPPTYPE, WireFormatLite::DECLARED_TYPE>( \
+      io::CodedInputStream * input, RepeatedField<CPPTYPE> * values) {         \
+    return ReadPackedFixedSizePrimitive<CPPTYPE,                               \
+                                        WireFormatLite::DECLARED_TYPE>(        \
+        input, values);                                                        \
+  }
+
+READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(uint32_t, TYPE_FIXED32)
+READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(uint64_t, TYPE_FIXED64)
+READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(int32_t, TYPE_SFIXED32)
+READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(int64_t, TYPE_SFIXED64)
+READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT)
+READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
+
+#undef READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE
+
+template <typename CType, enum WireFormatLite::FieldType DeclaredType>
+bool WireFormatLite::ReadPackedPrimitiveNoInline(io::CodedInputStream* input,
+                                                 RepeatedField<CType>* values) {
+  return ReadPackedPrimitive<CType, DeclaredType>(input, values);
+}
+
+
+template <typename MessageType>
+inline bool WireFormatLite::ReadGroup(int field_number,
+                                      io::CodedInputStream* input,
+                                      MessageType* value) {
+  if (!input->IncrementRecursionDepth()) return false;
+  if (!value->MergePartialFromCodedStream(input)) return false;
+  input->UnsafeDecrementRecursionDepth();
+  // Make sure the last thing read was an end tag for this group.
+  if (!input->LastTagWas(MakeTag(field_number, WIRETYPE_END_GROUP))) {
+    return false;
+  }
+  return true;
+}
+template <typename MessageType>
+inline bool WireFormatLite::ReadMessage(io::CodedInputStream* input,
+                                        MessageType* value) {
+  int length;
+  if (!input->ReadVarintSizeAsInt(&length)) return false;
+  std::pair<io::CodedInputStream::Limit, int> p =
+      input->IncrementRecursionDepthAndPushLimit(length);
+  if (p.second < 0 || !value->MergePartialFromCodedStream(input)) return false;
+  // Make sure that parsing stopped when the limit was hit, not at an endgroup
+  // tag.
+  return input->DecrementRecursionDepthAndPopLimit(p.first);
+}
+
+// ===================================================================
+
+inline void WireFormatLite::WriteTag(int field_number, WireType type,
+                                     io::CodedOutputStream* output) {
+  output->WriteTag(MakeTag(field_number, type));
+}
+
+inline void WireFormatLite::WriteInt32NoTag(int32_t value,
+                                            io::CodedOutputStream* output) {
+  output->WriteVarint32SignExtended(value);
+}
+inline void WireFormatLite::WriteInt64NoTag(int64_t value,
+                                            io::CodedOutputStream* output) {
+  output->WriteVarint64(static_cast<uint64_t>(value));
+}
+inline void WireFormatLite::WriteUInt32NoTag(uint32_t value,
+                                             io::CodedOutputStream* output) {
+  output->WriteVarint32(value);
+}
+inline void WireFormatLite::WriteUInt64NoTag(uint64_t value,
+                                             io::CodedOutputStream* output) {
+  output->WriteVarint64(value);
+}
+inline void WireFormatLite::WriteSInt32NoTag(int32_t value,
+                                             io::CodedOutputStream* output) {
+  output->WriteVarint32(ZigZagEncode32(value));
+}
+inline void WireFormatLite::WriteSInt64NoTag(int64_t value,
+                                             io::CodedOutputStream* output) {
+  output->WriteVarint64(ZigZagEncode64(value));
+}
+inline void WireFormatLite::WriteFixed32NoTag(uint32_t value,
+                                              io::CodedOutputStream* output) {
+  output->WriteLittleEndian32(value);
+}
+inline void WireFormatLite::WriteFixed64NoTag(uint64_t value,
+                                              io::CodedOutputStream* output) {
+  output->WriteLittleEndian64(value);
+}
+inline void WireFormatLite::WriteSFixed32NoTag(int32_t value,
+                                               io::CodedOutputStream* output) {
+  output->WriteLittleEndian32(static_cast<uint32_t>(value));
+}
+inline void WireFormatLite::WriteSFixed64NoTag(int64_t value,
+                                               io::CodedOutputStream* output) {
+  output->WriteLittleEndian64(static_cast<uint64_t>(value));
+}
+inline void WireFormatLite::WriteFloatNoTag(float value,
+                                            io::CodedOutputStream* output) {
+  output->WriteLittleEndian32(EncodeFloat(value));
+}
+inline void WireFormatLite::WriteDoubleNoTag(double value,
+                                             io::CodedOutputStream* output) {
+  output->WriteLittleEndian64(EncodeDouble(value));
+}
+inline void WireFormatLite::WriteBoolNoTag(bool value,
+                                           io::CodedOutputStream* output) {
+  output->WriteVarint32(value ? 1 : 0);
+}
+inline void WireFormatLite::WriteEnumNoTag(int value,
+                                           io::CodedOutputStream* output) {
+  output->WriteVarint32SignExtended(value);
+}
+
+// See comment on ReadGroupNoVirtual to understand the need for this template
+// parameter name.
+template <typename MessageType_WorkAroundCppLookupDefect>
+inline void WireFormatLite::WriteGroupNoVirtual(
+    int field_number, const MessageType_WorkAroundCppLookupDefect& value,
+    io::CodedOutputStream* output) {
+  WriteTag(field_number, WIRETYPE_START_GROUP, output);
+  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);
+  WriteTag(field_number, WIRETYPE_END_GROUP, output);
+}
+template <typename MessageType_WorkAroundCppLookupDefect>
+inline void WireFormatLite::WriteMessageNoVirtual(
+    int field_number, const MessageType_WorkAroundCppLookupDefect& value,
+    io::CodedOutputStream* output) {
+  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
+  output->WriteVarint32(
+      value.MessageType_WorkAroundCppLookupDefect::GetCachedSize());
+  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);
+}
+
+// ===================================================================
+
+inline uint8_t* WireFormatLite::WriteTagToArray(int field_number, WireType type,
+                                                uint8_t* target) {
+  return io::CodedOutputStream::WriteTagToArray(MakeTag(field_number, type),
+                                                target);
+}
+
+inline uint8_t* WireFormatLite::WriteInt32NoTagToArray(int32_t value,
+                                                       uint8_t* target) {
+  return io::CodedOutputStream::WriteVarint32SignExtendedToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteInt64NoTagToArray(int64_t value,
+                                                       uint8_t* target) {
+  return io::CodedOutputStream::WriteVarint64ToArray(
+      static_cast<uint64_t>(value), target);
+}
+inline uint8_t* WireFormatLite::WriteUInt32NoTagToArray(uint32_t value,
+                                                        uint8_t* target) {
+  return io::CodedOutputStream::WriteVarint32ToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteUInt64NoTagToArray(uint64_t value,
+                                                        uint8_t* target) {
+  return io::CodedOutputStream::WriteVarint64ToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteSInt32NoTagToArray(int32_t value,
+                                                        uint8_t* target) {
+  return io::CodedOutputStream::WriteVarint32ToArray(ZigZagEncode32(value),
+                                                     target);
+}
+inline uint8_t* WireFormatLite::WriteSInt64NoTagToArray(int64_t value,
+                                                        uint8_t* target) {
+  return io::CodedOutputStream::WriteVarint64ToArray(ZigZagEncode64(value),
+                                                     target);
+}
+inline uint8_t* WireFormatLite::WriteFixed32NoTagToArray(uint32_t value,
+                                                         uint8_t* target) {
+  return io::CodedOutputStream::WriteLittleEndian32ToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteFixed64NoTagToArray(uint64_t value,
+                                                         uint8_t* target) {
+  return io::CodedOutputStream::WriteLittleEndian64ToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteSFixed32NoTagToArray(int32_t value,
+                                                          uint8_t* target) {
+  return io::CodedOutputStream::WriteLittleEndian32ToArray(
+      static_cast<uint32_t>(value), target);
+}
+inline uint8_t* WireFormatLite::WriteSFixed64NoTagToArray(int64_t value,
+                                                          uint8_t* target) {
+  return io::CodedOutputStream::WriteLittleEndian64ToArray(
+      static_cast<uint64_t>(value), target);
+}
+inline uint8_t* WireFormatLite::WriteFloatNoTagToArray(float value,
+                                                       uint8_t* target) {
+  return io::CodedOutputStream::WriteLittleEndian32ToArray(EncodeFloat(value),
+                                                           target);
+}
+inline uint8_t* WireFormatLite::WriteDoubleNoTagToArray(double value,
+                                                        uint8_t* target) {
+  return io::CodedOutputStream::WriteLittleEndian64ToArray(EncodeDouble(value),
+                                                           target);
+}
+inline uint8_t* WireFormatLite::WriteBoolNoTagToArray(bool value,
+                                                      uint8_t* target) {
+  return io::CodedOutputStream::WriteVarint32ToArray(value ? 1 : 0, target);
+}
+inline uint8_t* WireFormatLite::WriteEnumNoTagToArray(int value,
+                                                      uint8_t* target) {
+  return io::CodedOutputStream::WriteVarint32SignExtendedToArray(value, target);
+}
+
+template <typename T>
+inline uint8_t* WireFormatLite::WritePrimitiveNoTagToArray(
+    const RepeatedField<T>& value, uint8_t* (*Writer)(T, uint8_t*),
+    uint8_t* target) {
+  const int n = value.size();
+  GOOGLE_DCHECK_GT(n, 0);
+
+  const T* ii = value.data();
+  int i = 0;
+  do {
+    target = Writer(ii[i], target);
+  } while (++i < n);
+
+  return target;
+}
+
+template <typename T>
+inline uint8_t* WireFormatLite::WriteFixedNoTagToArray(
+    const RepeatedField<T>& value, uint8_t* (*Writer)(T, uint8_t*),
+    uint8_t* target) {
+#if defined(PROTOBUF_LITTLE_ENDIAN)
+  (void)Writer;
+
+  const int n = value.size();
+  GOOGLE_DCHECK_GT(n, 0);
+
+  const T* ii = value.data();
+  const int bytes = n * static_cast<int>(sizeof(ii[0]));
+  memcpy(target, ii, static_cast<size_t>(bytes));
+  return target + bytes;
+#else
+  return WritePrimitiveNoTagToArray(value, Writer, target);
+#endif
+}
+
+inline uint8_t* WireFormatLite::WriteInt32NoTagToArray(
+    const RepeatedField<int32_t>& value, uint8_t* target) {
+  return WritePrimitiveNoTagToArray(value, WriteInt32NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteInt64NoTagToArray(
+    const RepeatedField<int64_t>& value, uint8_t* target) {
+  return WritePrimitiveNoTagToArray(value, WriteInt64NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteUInt32NoTagToArray(
+    const RepeatedField<uint32_t>& value, uint8_t* target) {
+  return WritePrimitiveNoTagToArray(value, WriteUInt32NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteUInt64NoTagToArray(
+    const RepeatedField<uint64_t>& value, uint8_t* target) {
+  return WritePrimitiveNoTagToArray(value, WriteUInt64NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteSInt32NoTagToArray(
+    const RepeatedField<int32_t>& value, uint8_t* target) {
+  return WritePrimitiveNoTagToArray(value, WriteSInt32NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteSInt64NoTagToArray(
+    const RepeatedField<int64_t>& value, uint8_t* target) {
+  return WritePrimitiveNoTagToArray(value, WriteSInt64NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteFixed32NoTagToArray(
+    const RepeatedField<uint32_t>& value, uint8_t* target) {
+  return WriteFixedNoTagToArray(value, WriteFixed32NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteFixed64NoTagToArray(
+    const RepeatedField<uint64_t>& value, uint8_t* target) {
+  return WriteFixedNoTagToArray(value, WriteFixed64NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteSFixed32NoTagToArray(
+    const RepeatedField<int32_t>& value, uint8_t* target) {
+  return WriteFixedNoTagToArray(value, WriteSFixed32NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteSFixed64NoTagToArray(
+    const RepeatedField<int64_t>& value, uint8_t* target) {
+  return WriteFixedNoTagToArray(value, WriteSFixed64NoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteFloatNoTagToArray(
+    const RepeatedField<float>& value, uint8_t* target) {
+  return WriteFixedNoTagToArray(value, WriteFloatNoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteDoubleNoTagToArray(
+    const RepeatedField<double>& value, uint8_t* target) {
+  return WriteFixedNoTagToArray(value, WriteDoubleNoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteBoolNoTagToArray(
+    const RepeatedField<bool>& value, uint8_t* target) {
+  return WritePrimitiveNoTagToArray(value, WriteBoolNoTagToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteEnumNoTagToArray(
+    const RepeatedField<int>& value, uint8_t* target) {
+  return WritePrimitiveNoTagToArray(value, WriteEnumNoTagToArray, target);
+}
+
+inline uint8_t* WireFormatLite::WriteInt32ToArray(int field_number,
+                                                  int32_t value,
+                                                  uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
+  return WriteInt32NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteInt64ToArray(int field_number,
+                                                  int64_t value,
+                                                  uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
+  return WriteInt64NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteUInt32ToArray(int field_number,
+                                                   uint32_t value,
+                                                   uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
+  return WriteUInt32NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteUInt64ToArray(int field_number,
+                                                   uint64_t value,
+                                                   uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
+  return WriteUInt64NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteSInt32ToArray(int field_number,
+                                                   int32_t value,
+                                                   uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
+  return WriteSInt32NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteSInt64ToArray(int field_number,
+                                                   int64_t value,
+                                                   uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
+  return WriteSInt64NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteFixed32ToArray(int field_number,
+                                                    uint32_t value,
+                                                    uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
+  return WriteFixed32NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteFixed64ToArray(int field_number,
+                                                    uint64_t value,
+                                                    uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
+  return WriteFixed64NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteSFixed32ToArray(int field_number,
+                                                     int32_t value,
+                                                     uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
+  return WriteSFixed32NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteSFixed64ToArray(int field_number,
+                                                     int64_t value,
+                                                     uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
+  return WriteSFixed64NoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteFloatToArray(int field_number, float value,
+                                                  uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
+  return WriteFloatNoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteDoubleToArray(int field_number,
+                                                   double value,
+                                                   uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
+  return WriteDoubleNoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteBoolToArray(int field_number, bool value,
+                                                 uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
+  return WriteBoolNoTagToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteEnumToArray(int field_number, int value,
+                                                 uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
+  return WriteEnumNoTagToArray(value, target);
+}
+
+template <typename T>
+inline uint8_t* WireFormatLite::WritePrimitiveToArray(
+    int field_number, const RepeatedField<T>& value,
+    uint8_t* (*Writer)(int, T, uint8_t*), uint8_t* target) {
+  const int n = value.size();
+  if (n == 0) {
+    return target;
+  }
+
+  const T* ii = value.data();
+  int i = 0;
+  do {
+    target = Writer(field_number, ii[i], target);
+  } while (++i < n);
+
+  return target;
+}
+
+inline uint8_t* WireFormatLite::WriteInt32ToArray(
+    int field_number, const RepeatedField<int32_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteInt32ToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteInt64ToArray(
+    int field_number, const RepeatedField<int64_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteInt64ToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteUInt32ToArray(
+    int field_number, const RepeatedField<uint32_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteUInt32ToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteUInt64ToArray(
+    int field_number, const RepeatedField<uint64_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteUInt64ToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteSInt32ToArray(
+    int field_number, const RepeatedField<int32_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteSInt32ToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteSInt64ToArray(
+    int field_number, const RepeatedField<int64_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteSInt64ToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteFixed32ToArray(
+    int field_number, const RepeatedField<uint32_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteFixed32ToArray,
+                               target);
+}
+inline uint8_t* WireFormatLite::WriteFixed64ToArray(
+    int field_number, const RepeatedField<uint64_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteFixed64ToArray,
+                               target);
+}
+inline uint8_t* WireFormatLite::WriteSFixed32ToArray(
+    int field_number, const RepeatedField<int32_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteSFixed32ToArray,
+                               target);
+}
+inline uint8_t* WireFormatLite::WriteSFixed64ToArray(
+    int field_number, const RepeatedField<int64_t>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteSFixed64ToArray,
+                               target);
+}
+inline uint8_t* WireFormatLite::WriteFloatToArray(
+    int field_number, const RepeatedField<float>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteFloatToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteDoubleToArray(
+    int field_number, const RepeatedField<double>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteDoubleToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteBoolToArray(
+    int field_number, const RepeatedField<bool>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteBoolToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteEnumToArray(
+    int field_number, const RepeatedField<int>& value, uint8_t* target) {
+  return WritePrimitiveToArray(field_number, value, WriteEnumToArray, target);
+}
+inline uint8_t* WireFormatLite::WriteStringToArray(int field_number,
+                                                   const std::string& value,
+                                                   uint8_t* target) {
+  // String is for UTF-8 text only
+  // WARNING:  In wire_format.cc, both strings and bytes are handled by
+  //   WriteString() to avoid code duplication.  If the implementations become
+  //   different, you will need to update that usage.
+  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);
+  return io::CodedOutputStream::WriteStringWithSizeToArray(value, target);
+}
+inline uint8_t* WireFormatLite::WriteBytesToArray(int field_number,
+                                                  const std::string& value,
+                                                  uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);
+  return io::CodedOutputStream::WriteStringWithSizeToArray(value, target);
+}
+
+
+template <typename MessageType>
+inline uint8_t* WireFormatLite::InternalWriteGroup(
+    int field_number, const MessageType& value, uint8_t* target,
+    io::EpsCopyOutputStream* stream) {
+  target = WriteTagToArray(field_number, WIRETYPE_START_GROUP, target);
+  target = value._InternalSerialize(target, stream);
+  target = stream->EnsureSpace(target);
+  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);
+}
+template <typename MessageType>
+inline uint8_t* WireFormatLite::InternalWriteMessage(
+    int field_number, const MessageType& value, uint8_t* target,
+    io::EpsCopyOutputStream* stream) {
+  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);
+  target = io::CodedOutputStream::WriteVarint32ToArrayOutOfLine(
+      static_cast<uint32_t>(value.GetCachedSize()), target);
+  return value._InternalSerialize(target, stream);
+}
+
+// See comment on ReadGroupNoVirtual to understand the need for this template
+// parameter name.
+template <typename MessageType_WorkAroundCppLookupDefect>
+inline uint8_t* WireFormatLite::InternalWriteGroupNoVirtualToArray(
+    int field_number, const MessageType_WorkAroundCppLookupDefect& value,
+    uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_START_GROUP, target);
+  target = value.MessageType_WorkAroundCppLookupDefect::
+               SerializeWithCachedSizesToArray(target);
+  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);
+}
+template <typename MessageType_WorkAroundCppLookupDefect>
+inline uint8_t* WireFormatLite::InternalWriteMessageNoVirtualToArray(
+    int field_number, const MessageType_WorkAroundCppLookupDefect& value,
+    uint8_t* target) {
+  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);
+  target = io::CodedOutputStream::WriteVarint32ToArray(
+      static_cast<uint32_t>(
+          value.MessageType_WorkAroundCppLookupDefect::GetCachedSize()),
+      target);
+  return value
+      .MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizesToArray(
+          target);
+}
+
+// ===================================================================
+
+inline size_t WireFormatLite::Int32Size(int32_t value) {
+  return io::CodedOutputStream::VarintSize32SignExtended(value);
+}
+inline size_t WireFormatLite::Int64Size(int64_t value) {
+  return io::CodedOutputStream::VarintSize64(static_cast<uint64_t>(value));
+}
+inline size_t WireFormatLite::UInt32Size(uint32_t value) {
+  return io::CodedOutputStream::VarintSize32(value);
+}
+inline size_t WireFormatLite::UInt64Size(uint64_t value) {
+  return io::CodedOutputStream::VarintSize64(value);
+}
+inline size_t WireFormatLite::SInt32Size(int32_t value) {
+  return io::CodedOutputStream::VarintSize32(ZigZagEncode32(value));
+}
+inline size_t WireFormatLite::SInt64Size(int64_t value) {
+  return io::CodedOutputStream::VarintSize64(ZigZagEncode64(value));
+}
+inline size_t WireFormatLite::EnumSize(int value) {
+  return io::CodedOutputStream::VarintSize32SignExtended(value);
+}
+inline size_t WireFormatLite::Int32SizePlusOne(int32_t value) {
+  return io::CodedOutputStream::VarintSize32SignExtendedPlusOne(value);
+}
+inline size_t WireFormatLite::Int64SizePlusOne(int64_t value) {
+  return io::CodedOutputStream::VarintSize64PlusOne(
+      static_cast<uint64_t>(value));
+}
+inline size_t WireFormatLite::UInt32SizePlusOne(uint32_t value) {
+  return io::CodedOutputStream::VarintSize32PlusOne(value);
+}
+inline size_t WireFormatLite::UInt64SizePlusOne(uint64_t value) {
+  return io::CodedOutputStream::VarintSize64PlusOne(value);
+}
+inline size_t WireFormatLite::SInt32SizePlusOne(int32_t value) {
+  return io::CodedOutputStream::VarintSize32PlusOne(ZigZagEncode32(value));
+}
+inline size_t WireFormatLite::SInt64SizePlusOne(int64_t value) {
+  return io::CodedOutputStream::VarintSize64PlusOne(ZigZagEncode64(value));
+}
+inline size_t WireFormatLite::EnumSizePlusOne(int value) {
+  return io::CodedOutputStream::VarintSize32SignExtendedPlusOne(value);
+}
+
+inline size_t WireFormatLite::StringSize(const std::string& value) {
+  return LengthDelimitedSize(value.size());
+}
+inline size_t WireFormatLite::BytesSize(const std::string& value) {
+  return LengthDelimitedSize(value.size());
+}
+
+
+template <typename MessageType>
+inline size_t WireFormatLite::GroupSize(const MessageType& value) {
+  return value.ByteSizeLong();
+}
+template <typename MessageType>
+inline size_t WireFormatLite::MessageSize(const MessageType& value) {
+  return LengthDelimitedSize(value.ByteSizeLong());
+}
+
+// See comment on ReadGroupNoVirtual to understand the need for this template
+// parameter name.
+template <typename MessageType_WorkAroundCppLookupDefect>
+inline size_t WireFormatLite::GroupSizeNoVirtual(
+    const MessageType_WorkAroundCppLookupDefect& value) {
+  return value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong();
+}
+template <typename MessageType_WorkAroundCppLookupDefect>
+inline size_t WireFormatLite::MessageSizeNoVirtual(
+    const MessageType_WorkAroundCppLookupDefect& value) {
+  return LengthDelimitedSize(
+      value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong());
+}
+
+inline size_t WireFormatLite::LengthDelimitedSize(size_t length) {
+  // The static_cast here prevents an error in certain compiler configurations
+  // but is not technically correct--if length is too large to fit in a uint32_t
+  // then it will be silently truncated. We will need to fix this if we ever
+  // decide to start supporting serialized messages greater than 2 GiB in size.
+  return length +
+         io::CodedOutputStream::VarintSize32(static_cast<uint32_t>(length));
+}
+
+template <typename MS>
+bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) {
+  // This method parses a group which should contain two fields:
+  //   required int32 type_id = 2;
+  //   required data message = 3;
+
+  uint32_t last_type_id = 0;
+
+  // If we see message data before the type_id, we'll append it to this so
+  // we can parse it later.
+  std::string message_data;
+
+  while (true) {
+    const uint32_t tag = input->ReadTagNoLastTag();
+    if (tag == 0) return false;
+
+    switch (tag) {
+      case WireFormatLite::kMessageSetTypeIdTag: {
+        uint32_t type_id;
+        if (!input->ReadVarint32(&type_id)) return false;
+        last_type_id = type_id;
+
+        if (!message_data.empty()) {
+          // We saw some message data before the type_id.  Have to parse it
+          // now.
+          io::CodedInputStream sub_input(
+              reinterpret_cast<const uint8_t*>(message_data.data()),
+              static_cast<int>(message_data.size()));
+          sub_input.SetRecursionLimit(input->RecursionBudget());
+          if (!ms.ParseField(last_type_id, &sub_input)) {
+            return false;
+          }
+          message_data.clear();
+        }
+
+        break;
+      }
+
+      case WireFormatLite::kMessageSetMessageTag: {
+        if (last_type_id == 0) {
+          // We haven't seen a type_id yet.  Append this data to message_data.
+          uint32_t length;
+          if (!input->ReadVarint32(&length)) return false;
+          if (static_cast<int32_t>(length) < 0) return false;
+          uint32_t size = static_cast<uint32_t>(
+              length + io::CodedOutputStream::VarintSize32(length));
+          message_data.resize(size);
+          auto ptr = reinterpret_cast<uint8_t*>(&message_data[0]);
+          ptr = io::CodedOutputStream::WriteVarint32ToArray(length, ptr);
+          if (!input->ReadRaw(ptr, length)) return false;
+        } else {
+          // Already saw type_id, so we can parse this directly.
+          if (!ms.ParseField(last_type_id, input)) {
+            return false;
+          }
+        }
+
+        break;
+      }
+
+      case WireFormatLite::kMessageSetItemEndTag: {
+        return true;
+      }
+
+      default: {
+        if (!ms.SkipField(tag, input)) return false;
+      }
+    }
+  }
+}
+
 }  // namespace internal
 }  // namespace protobuf
-
 }  // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
 #endif  // GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/wire_format_lite_inl.h b/3rdparty/protobuf/src/google/protobuf/wire_format_lite_inl.h
deleted file mode 100644 (file)
index b264bd7..0000000
+++ /dev/null
@@ -1,1077 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//         wink@google.com (Wink Saville) (refactored from wire_format.h)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-
-#ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__
-#define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__
-
-#include <algorithm>
-#include <string>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/logging.h>
-#include <google/protobuf/message_lite.h>
-#include <google/protobuf/repeated_field.h>
-#include <google/protobuf/wire_format_lite.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arenastring.h>
-
-
-namespace google {
-namespace protobuf {
-namespace internal {
-
-// Implementation details of ReadPrimitive.
-
-template <>
-inline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_INT32>(
-    io::CodedInputStream* input,
-    int32* value) {
-  uint32 temp;
-  if (!input->ReadVarint32(&temp)) return false;
-  *value = static_cast<int32>(temp);
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_INT64>(
-    io::CodedInputStream* input,
-    int64* value) {
-  uint64 temp;
-  if (!input->ReadVarint64(&temp)) return false;
-  *value = static_cast<int64>(temp);
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<uint32, WireFormatLite::TYPE_UINT32>(
-    io::CodedInputStream* input,
-    uint32* value) {
-  return input->ReadVarint32(value);
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<uint64, WireFormatLite::TYPE_UINT64>(
-    io::CodedInputStream* input,
-    uint64* value) {
-  return input->ReadVarint64(value);
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_SINT32>(
-    io::CodedInputStream* input,
-    int32* value) {
-  uint32 temp;
-  if (!input->ReadVarint32(&temp)) return false;
-  *value = ZigZagDecode32(temp);
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_SINT64>(
-    io::CodedInputStream* input,
-    int64* value) {
-  uint64 temp;
-  if (!input->ReadVarint64(&temp)) return false;
-  *value = ZigZagDecode64(temp);
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<uint32, WireFormatLite::TYPE_FIXED32>(
-    io::CodedInputStream* input,
-    uint32* value) {
-  return input->ReadLittleEndian32(value);
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<uint64, WireFormatLite::TYPE_FIXED64>(
-    io::CodedInputStream* input,
-    uint64* value) {
-  return input->ReadLittleEndian64(value);
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_SFIXED32>(
-    io::CodedInputStream* input,
-    int32* value) {
-  uint32 temp;
-  if (!input->ReadLittleEndian32(&temp)) return false;
-  *value = static_cast<int32>(temp);
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_SFIXED64>(
-    io::CodedInputStream* input,
-    int64* value) {
-  uint64 temp;
-  if (!input->ReadLittleEndian64(&temp)) return false;
-  *value = static_cast<int64>(temp);
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<float, WireFormatLite::TYPE_FLOAT>(
-    io::CodedInputStream* input,
-    float* value) {
-  uint32 temp;
-  if (!input->ReadLittleEndian32(&temp)) return false;
-  *value = DecodeFloat(temp);
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<double, WireFormatLite::TYPE_DOUBLE>(
-    io::CodedInputStream* input,
-    double* value) {
-  uint64 temp;
-  if (!input->ReadLittleEndian64(&temp)) return false;
-  *value = DecodeDouble(temp);
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<bool, WireFormatLite::TYPE_BOOL>(
-    io::CodedInputStream* input,
-    bool* value) {
-  uint64 temp;
-  if (!input->ReadVarint64(&temp)) return false;
-  *value = temp != 0;
-  return true;
-}
-template <>
-inline bool WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
-    io::CodedInputStream* input,
-    int* value) {
-  uint32 temp;
-  if (!input->ReadVarint32(&temp)) return false;
-  *value = static_cast<int>(temp);
-  return true;
-}
-
-template <>
-inline const uint8* WireFormatLite::ReadPrimitiveFromArray<
-  uint32, WireFormatLite::TYPE_FIXED32>(
-    const uint8* buffer,
-    uint32* value) {
-  return io::CodedInputStream::ReadLittleEndian32FromArray(buffer, value);
-}
-template <>
-inline const uint8* WireFormatLite::ReadPrimitiveFromArray<
-  uint64, WireFormatLite::TYPE_FIXED64>(
-    const uint8* buffer,
-    uint64* value) {
-  return io::CodedInputStream::ReadLittleEndian64FromArray(buffer, value);
-}
-template <>
-inline const uint8* WireFormatLite::ReadPrimitiveFromArray<
-  int32, WireFormatLite::TYPE_SFIXED32>(
-    const uint8* buffer,
-    int32* value) {
-  uint32 temp;
-  buffer = io::CodedInputStream::ReadLittleEndian32FromArray(buffer, &temp);
-  *value = static_cast<int32>(temp);
-  return buffer;
-}
-template <>
-inline const uint8* WireFormatLite::ReadPrimitiveFromArray<
-  int64, WireFormatLite::TYPE_SFIXED64>(
-    const uint8* buffer,
-    int64* value) {
-  uint64 temp;
-  buffer = io::CodedInputStream::ReadLittleEndian64FromArray(buffer, &temp);
-  *value = static_cast<int64>(temp);
-  return buffer;
-}
-template <>
-inline const uint8* WireFormatLite::ReadPrimitiveFromArray<
-  float, WireFormatLite::TYPE_FLOAT>(
-    const uint8* buffer,
-    float* value) {
-  uint32 temp;
-  buffer = io::CodedInputStream::ReadLittleEndian32FromArray(buffer, &temp);
-  *value = DecodeFloat(temp);
-  return buffer;
-}
-template <>
-inline const uint8* WireFormatLite::ReadPrimitiveFromArray<
-  double, WireFormatLite::TYPE_DOUBLE>(
-    const uint8* buffer,
-    double* value) {
-  uint64 temp;
-  buffer = io::CodedInputStream::ReadLittleEndian64FromArray(buffer, &temp);
-  *value = DecodeDouble(temp);
-  return buffer;
-}
-
-template <typename CType, enum WireFormatLite::FieldType DeclaredType>
-inline bool WireFormatLite::ReadRepeatedPrimitive(
-    int,  // tag_size, unused.
-    uint32 tag,
-    io::CodedInputStream* input,
-    RepeatedField<CType>* values) {
-  CType value;
-  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
-  values->Add(value);
-  int elements_already_reserved = values->Capacity() - values->size();
-  while (elements_already_reserved > 0 && input->ExpectTag(tag)) {
-    if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
-    values->AddAlreadyReserved(value);
-    elements_already_reserved--;
-  }
-  return true;
-}
-
-template <typename CType, enum WireFormatLite::FieldType DeclaredType>
-inline bool WireFormatLite::ReadRepeatedFixedSizePrimitive(
-    int tag_size,
-    uint32 tag,
-    io::CodedInputStream* input,
-    RepeatedField<CType>* values) {
-  GOOGLE_DCHECK_EQ(UInt32Size(tag), static_cast<size_t>(tag_size));
-  CType value;
-  if (!ReadPrimitive<CType, DeclaredType>(input, &value))
-    return false;
-  values->Add(value);
-
-  // For fixed size values, repeated values can be read more quickly by
-  // reading directly from a raw array.
-  //
-  // We can get a tight loop by only reading as many elements as can be
-  // added to the RepeatedField without having to do any resizing. Additionally,
-  // we only try to read as many elements as are available from the current
-  // buffer space. Doing so avoids having to perform boundary checks when
-  // reading the value: the maximum number of elements that can be read is
-  // known outside of the loop.
-  const void* void_pointer;
-  int size;
-  input->GetDirectBufferPointerInline(&void_pointer, &size);
-  if (size > 0) {
-    const uint8* buffer = reinterpret_cast<const uint8*>(void_pointer);
-    // The number of bytes each type occupies on the wire.
-    const int per_value_size = tag_size + static_cast<int>(sizeof(value));
-
-    // parentheses around (std::min) prevents macro expansion of min(...)
-    int elements_available =
-        (std::min)(values->Capacity() - values->size(), size / per_value_size);
-    int num_read = 0;
-    while (num_read < elements_available &&
-           (buffer = io::CodedInputStream::ExpectTagFromArray(
-               buffer, tag)) != NULL) {
-      buffer = ReadPrimitiveFromArray<CType, DeclaredType>(buffer, &value);
-      values->AddAlreadyReserved(value);
-      ++num_read;
-    }
-    const int read_bytes = num_read * per_value_size;
-    if (read_bytes > 0) {
-      input->Skip(read_bytes);
-    }
-  }
-  return true;
-}
-
-// Specializations of ReadRepeatedPrimitive for the fixed size types, which use
-// the optimized code path.
-#define READ_REPEATED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)             \
-template <>                                                                    \
-inline bool WireFormatLite::ReadRepeatedPrimitive<                             \
-  CPPTYPE, WireFormatLite::DECLARED_TYPE>(                                     \
-    int tag_size,                                                              \
-    uint32 tag,                                                                \
-    io::CodedInputStream* input,                                               \
-    RepeatedField<CPPTYPE>* values) {                                          \
-  return ReadRepeatedFixedSizePrimitive<                                       \
-    CPPTYPE, WireFormatLite::DECLARED_TYPE>(                                   \
-      tag_size, tag, input, values);                                           \
-}
-
-READ_REPEATED_FIXED_SIZE_PRIMITIVE(uint32, TYPE_FIXED32)
-READ_REPEATED_FIXED_SIZE_PRIMITIVE(uint64, TYPE_FIXED64)
-READ_REPEATED_FIXED_SIZE_PRIMITIVE(int32, TYPE_SFIXED32)
-READ_REPEATED_FIXED_SIZE_PRIMITIVE(int64, TYPE_SFIXED64)
-READ_REPEATED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT)
-READ_REPEATED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
-
-#undef READ_REPEATED_FIXED_SIZE_PRIMITIVE
-
-template <typename CType, enum WireFormatLite::FieldType DeclaredType>
-bool WireFormatLite::ReadRepeatedPrimitiveNoInline(
-    int tag_size,
-    uint32 tag,
-    io::CodedInputStream* input,
-    RepeatedField<CType>* value) {
-  return ReadRepeatedPrimitive<CType, DeclaredType>(
-      tag_size, tag, input, value);
-}
-
-template <typename CType, enum WireFormatLite::FieldType DeclaredType>
-inline bool WireFormatLite::ReadPackedPrimitive(io::CodedInputStream* input,
-                                                RepeatedField<CType>* values) {
-  int length;
-  if (!input->ReadVarintSizeAsInt(&length)) return false;
-  io::CodedInputStream::Limit limit = input->PushLimit(length);
-  while (input->BytesUntilLimit() > 0) {
-    CType value;
-    if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
-    values->Add(value);
-  }
-  input->PopLimit(limit);
-  return true;
-}
-
-template <typename CType, enum WireFormatLite::FieldType DeclaredType>
-inline bool WireFormatLite::ReadPackedFixedSizePrimitive(
-    io::CodedInputStream* input, RepeatedField<CType>* values) {
-  int length;
-  if (!input->ReadVarintSizeAsInt(&length)) return false;
-  const int old_entries = values->size();
-  const int new_entries = length / static_cast<int>(sizeof(CType));
-  const int new_bytes = new_entries * static_cast<int>(sizeof(CType));
-  if (new_bytes != length) return false;
-  // We would *like* to pre-allocate the buffer to write into (for
-  // speed), but *must* avoid performing a very large allocation due
-  // to a malicious user-supplied "length" above.  So we have a fast
-  // path that pre-allocates when the "length" is less than a bound.
-  // We determine the bound by calling BytesUntilTotalBytesLimit() and
-  // BytesUntilLimit().  These return -1 to mean "no limit set".
-  // There are four cases:
-  // TotalBytesLimit  Limit
-  // -1               -1     Use slow path.
-  // -1               >= 0   Use fast path if length <= Limit.
-  // >= 0             -1     Use slow path.
-  // >= 0             >= 0   Use fast path if length <= min(both limits).
-  int64 bytes_limit = input->BytesUntilTotalBytesLimit();
-  if (bytes_limit == -1) {
-    bytes_limit = input->BytesUntilLimit();
-  } else {
-    // parentheses around (std::min) prevents macro expansion of min(...)
-    bytes_limit =
-        (std::min)(bytes_limit, static_cast<int64>(input->BytesUntilLimit()));
-  }
-  if (bytes_limit >= new_bytes) {
-    // Fast-path that pre-allocates *values to the final size.
-#if defined(PROTOBUF_LITTLE_ENDIAN)
-    values->Resize(old_entries + new_entries, 0);
-    // values->mutable_data() may change after Resize(), so do this after:
-    void* dest = reinterpret_cast<void*>(values->mutable_data() + old_entries);
-    if (!input->ReadRaw(dest, new_bytes)) {
-      values->Truncate(old_entries);
-      return false;
-    }
-#else
-    values->Reserve(old_entries + new_entries);
-    CType value;
-    for (int i = 0; i < new_entries; ++i) {
-      if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
-      values->AddAlreadyReserved(value);
-    }
-#endif
-  } else {
-    // This is the slow-path case where "length" may be too large to
-    // safely allocate.  We read as much as we can into *values
-    // without pre-allocating "length" bytes.
-    CType value;
-    for (int i = 0; i < new_entries; ++i) {
-      if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
-      values->Add(value);
-    }
-  }
-  return true;
-}
-
-// Specializations of ReadPackedPrimitive for the fixed size types, which use
-// an optimized code path.
-#define READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)      \
-template <>                                                                    \
-inline bool WireFormatLite::ReadPackedPrimitive<                               \
-  CPPTYPE, WireFormatLite::DECLARED_TYPE>(                                     \
-    io::CodedInputStream* input,                                               \
-    RepeatedField<CPPTYPE>* values) {                                          \
-  return ReadPackedFixedSizePrimitive<                                         \
-      CPPTYPE, WireFormatLite::DECLARED_TYPE>(input, values);                  \
-}
-
-READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(uint32, TYPE_FIXED32)
-READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(uint64, TYPE_FIXED64)
-READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(int32, TYPE_SFIXED32)
-READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(int64, TYPE_SFIXED64)
-READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT)
-READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
-
-#undef READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE
-
-template <typename CType, enum WireFormatLite::FieldType DeclaredType>
-bool WireFormatLite::ReadPackedPrimitiveNoInline(io::CodedInputStream* input,
-                                                 RepeatedField<CType>* values) {
-  return ReadPackedPrimitive<CType, DeclaredType>(input, values);
-}
-
-
-inline bool WireFormatLite::ReadGroup(int field_number,
-                                      io::CodedInputStream* input,
-                                      MessageLite* value) {
-  if (!input->IncrementRecursionDepth()) return false;
-  if (!value->MergePartialFromCodedStream(input)) return false;
-  input->DecrementRecursionDepth();
-  // Make sure the last thing read was an end tag for this group.
-  if (!input->LastTagWas(MakeTag(field_number, WIRETYPE_END_GROUP))) {
-    return false;
-  }
-  return true;
-}
-inline bool WireFormatLite::ReadMessage(io::CodedInputStream* input,
-                                        MessageLite* value) {
-  int length;
-  if (!input->ReadVarintSizeAsInt(&length)) return false;
-  std::pair<io::CodedInputStream::Limit, int> p =
-      input->IncrementRecursionDepthAndPushLimit(length);
-  if (p.second < 0 || !value->MergePartialFromCodedStream(input)) return false;
-  // Make sure that parsing stopped when the limit was hit, not at an endgroup
-  // tag.
- return input->DecrementRecursionDepthAndPopLimit(p.first);
-}
-
-// We name the template parameter something long and extremely unlikely to occur
-// elsewhere because a *qualified* member access expression designed to avoid
-// virtual dispatch, C++03 [basic.lookup.classref] 3.4.5/4 requires that the
-// name of the qualifying class to be looked up both in the context of the full
-// expression (finding the template parameter) and in the context of the object
-// whose member we are accessing. This could potentially find a nested type
-// within that object. The standard goes on to require these names to refer to
-// the same entity, which this collision would violate. The lack of a safe way
-// to avoid this collision appears to be a defect in the standard, but until it
-// is corrected, we choose the name to avoid accidental collisions.
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline bool WireFormatLite::ReadGroupNoVirtual(
-    int field_number, io::CodedInputStream* input,
-    MessageType_WorkAroundCppLookupDefect* value) {
-  if (!input->IncrementRecursionDepth()) return false;
-  if (!value->
-      MessageType_WorkAroundCppLookupDefect::MergePartialFromCodedStream(input))
-    return false;
-  input->UnsafeDecrementRecursionDepth();
-  // Make sure the last thing read was an end tag for this group.
-  if (!input->LastTagWas(MakeTag(field_number, WIRETYPE_END_GROUP))) {
-    return false;
-  }
-  return true;
-}
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline bool WireFormatLite::ReadGroupNoVirtualNoRecursionDepth(
-    int field_number, io::CodedInputStream* input,
-    MessageType_WorkAroundCppLookupDefect* value) {
-  return value->MessageType_WorkAroundCppLookupDefect::
-             MergePartialFromCodedStream(input) &&
-         input->LastTagWas(MakeTag(field_number, WIRETYPE_END_GROUP));
-}
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline bool WireFormatLite::ReadMessageNoVirtual(
-    io::CodedInputStream* input, MessageType_WorkAroundCppLookupDefect* value) {
-  int length;
-  if (!input->ReadVarintSizeAsInt(&length)) return false;
-  std::pair<io::CodedInputStream::Limit, int> p =
-      input->IncrementRecursionDepthAndPushLimit(length);
-  if (p.second < 0 || !value->
-      MessageType_WorkAroundCppLookupDefect::MergePartialFromCodedStream(input))
-    return false;
-  // Make sure that parsing stopped when the limit was hit, not at an endgroup
-  // tag.
-  return input->DecrementRecursionDepthAndPopLimit(p.first);
-}
-
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline bool WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
-    io::CodedInputStream* input, MessageType_WorkAroundCppLookupDefect* value) {
-  io::CodedInputStream::Limit old_limit = input->ReadLengthAndPushLimit();
-  if (!value->
-      MessageType_WorkAroundCppLookupDefect::MergePartialFromCodedStream(input))
-    return false;
-  // Make sure that parsing stopped when the limit was hit, not at an endgroup
-  // tag.
-  return input->CheckEntireMessageConsumedAndPopLimit(old_limit);
-}
-
-// ===================================================================
-
-inline void WireFormatLite::WriteTag(int field_number, WireType type,
-                                     io::CodedOutputStream* output) {
-  output->WriteTag(MakeTag(field_number, type));
-}
-
-inline void WireFormatLite::WriteInt32NoTag(int32 value,
-                                            io::CodedOutputStream* output) {
-  output->WriteVarint32SignExtended(value);
-}
-inline void WireFormatLite::WriteInt64NoTag(int64 value,
-                                            io::CodedOutputStream* output) {
-  output->WriteVarint64(static_cast<uint64>(value));
-}
-inline void WireFormatLite::WriteUInt32NoTag(uint32 value,
-                                             io::CodedOutputStream* output) {
-  output->WriteVarint32(value);
-}
-inline void WireFormatLite::WriteUInt64NoTag(uint64 value,
-                                             io::CodedOutputStream* output) {
-  output->WriteVarint64(value);
-}
-inline void WireFormatLite::WriteSInt32NoTag(int32 value,
-                                             io::CodedOutputStream* output) {
-  output->WriteVarint32(ZigZagEncode32(value));
-}
-inline void WireFormatLite::WriteSInt64NoTag(int64 value,
-                                             io::CodedOutputStream* output) {
-  output->WriteVarint64(ZigZagEncode64(value));
-}
-inline void WireFormatLite::WriteFixed32NoTag(uint32 value,
-                                              io::CodedOutputStream* output) {
-  output->WriteLittleEndian32(value);
-}
-inline void WireFormatLite::WriteFixed64NoTag(uint64 value,
-                                              io::CodedOutputStream* output) {
-  output->WriteLittleEndian64(value);
-}
-inline void WireFormatLite::WriteSFixed32NoTag(int32 value,
-                                               io::CodedOutputStream* output) {
-  output->WriteLittleEndian32(static_cast<uint32>(value));
-}
-inline void WireFormatLite::WriteSFixed64NoTag(int64 value,
-                                               io::CodedOutputStream* output) {
-  output->WriteLittleEndian64(static_cast<uint64>(value));
-}
-inline void WireFormatLite::WriteFloatNoTag(float value,
-                                            io::CodedOutputStream* output) {
-  output->WriteLittleEndian32(EncodeFloat(value));
-}
-inline void WireFormatLite::WriteDoubleNoTag(double value,
-                                             io::CodedOutputStream* output) {
-  output->WriteLittleEndian64(EncodeDouble(value));
-}
-inline void WireFormatLite::WriteBoolNoTag(bool value,
-                                           io::CodedOutputStream* output) {
-  output->WriteVarint32(value ? 1 : 0);
-}
-inline void WireFormatLite::WriteEnumNoTag(int value,
-                                           io::CodedOutputStream* output) {
-  output->WriteVarint32SignExtended(value);
-}
-
-// See comment on ReadGroupNoVirtual to understand the need for this template
-// parameter name.
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline void WireFormatLite::WriteGroupNoVirtual(
-    int field_number, const MessageType_WorkAroundCppLookupDefect& value,
-    io::CodedOutputStream* output) {
-  WriteTag(field_number, WIRETYPE_START_GROUP, output);
-  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);
-  WriteTag(field_number, WIRETYPE_END_GROUP, output);
-}
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline void WireFormatLite::WriteMessageNoVirtual(
-    int field_number, const MessageType_WorkAroundCppLookupDefect& value,
-    io::CodedOutputStream* output) {
-  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
-  output->WriteVarint32(
-      value.MessageType_WorkAroundCppLookupDefect::GetCachedSize());
-  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);
-}
-
-// ===================================================================
-
-inline uint8* WireFormatLite::WriteTagToArray(int field_number,
-                                              WireType type,
-                                              uint8* target) {
-  return io::CodedOutputStream::WriteTagToArray(MakeTag(field_number, type),
-                                                target);
-}
-
-inline uint8* WireFormatLite::WriteInt32NoTagToArray(int32 value,
-                                                     uint8* target) {
-  return io::CodedOutputStream::WriteVarint32SignExtendedToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteInt64NoTagToArray(int64 value,
-                                                     uint8* target) {
-  return io::CodedOutputStream::WriteVarint64ToArray(
-      static_cast<uint64>(value), target);
-}
-inline uint8* WireFormatLite::WriteUInt32NoTagToArray(uint32 value,
-                                                      uint8* target) {
-  return io::CodedOutputStream::WriteVarint32ToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteUInt64NoTagToArray(uint64 value,
-                                                      uint8* target) {
-  return io::CodedOutputStream::WriteVarint64ToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteSInt32NoTagToArray(int32 value,
-                                                      uint8* target) {
-  return io::CodedOutputStream::WriteVarint32ToArray(ZigZagEncode32(value),
-                                                     target);
-}
-inline uint8* WireFormatLite::WriteSInt64NoTagToArray(int64 value,
-                                                      uint8* target) {
-  return io::CodedOutputStream::WriteVarint64ToArray(ZigZagEncode64(value),
-                                                     target);
-}
-inline uint8* WireFormatLite::WriteFixed32NoTagToArray(uint32 value,
-                                                       uint8* target) {
-  return io::CodedOutputStream::WriteLittleEndian32ToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteFixed64NoTagToArray(uint64 value,
-                                                       uint8* target) {
-  return io::CodedOutputStream::WriteLittleEndian64ToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteSFixed32NoTagToArray(int32 value,
-                                                        uint8* target) {
-  return io::CodedOutputStream::WriteLittleEndian32ToArray(
-      static_cast<uint32>(value), target);
-}
-inline uint8* WireFormatLite::WriteSFixed64NoTagToArray(int64 value,
-                                                        uint8* target) {
-  return io::CodedOutputStream::WriteLittleEndian64ToArray(
-      static_cast<uint64>(value), target);
-}
-inline uint8* WireFormatLite::WriteFloatNoTagToArray(float value,
-                                                     uint8* target) {
-  return io::CodedOutputStream::WriteLittleEndian32ToArray(EncodeFloat(value),
-                                                           target);
-}
-inline uint8* WireFormatLite::WriteDoubleNoTagToArray(double value,
-                                                      uint8* target) {
-  return io::CodedOutputStream::WriteLittleEndian64ToArray(EncodeDouble(value),
-                                                           target);
-}
-inline uint8* WireFormatLite::WriteBoolNoTagToArray(bool value,
-                                                    uint8* target) {
-  return io::CodedOutputStream::WriteVarint32ToArray(value ? 1 : 0, target);
-}
-inline uint8* WireFormatLite::WriteEnumNoTagToArray(int value,
-                                                    uint8* target) {
-  return io::CodedOutputStream::WriteVarint32SignExtendedToArray(value, target);
-}
-
-template<typename T>
-inline uint8* WireFormatLite::WritePrimitiveNoTagToArray(
-      const RepeatedField<T>& value,
-      uint8* (*Writer)(T, uint8*), uint8* target) {
-  const int n = value.size();
-  GOOGLE_DCHECK_GT(n, 0);
-
-  const T* ii = value.unsafe_data();
-  int i = 0;
-  do {
-    target = Writer(ii[i], target);
-  } while (++i < n);
-
-  return target;
-}
-
-template<typename T>
-inline uint8* WireFormatLite::WriteFixedNoTagToArray(
-      const RepeatedField<T>& value,
-      uint8* (*Writer)(T, uint8*), uint8* target) {
-#if defined(PROTOBUF_LITTLE_ENDIAN)
-  (void) Writer;
-
-  const int n = value.size();
-  GOOGLE_DCHECK_GT(n, 0);
-
-  const T* ii = value.unsafe_data();
-  const int bytes = n * static_cast<int>(sizeof(ii[0]));
-  memcpy(target, ii, static_cast<size_t>(bytes));
-  return target + bytes;
-#else
-  return WritePrimitiveNoTagToArray(value, Writer, target);
-#endif
-}
-
-inline uint8* WireFormatLite::WriteInt32NoTagToArray(
-    const RepeatedField< int32>& value, uint8* target) {
-  return WritePrimitiveNoTagToArray(value, WriteInt32NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteInt64NoTagToArray(
-    const RepeatedField< int64>& value, uint8* target) {
-  return WritePrimitiveNoTagToArray(value, WriteInt64NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteUInt32NoTagToArray(
-    const RepeatedField<uint32>& value, uint8* target) {
-  return WritePrimitiveNoTagToArray(value, WriteUInt32NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteUInt64NoTagToArray(
-    const RepeatedField<uint64>& value, uint8* target) {
-  return WritePrimitiveNoTagToArray(value, WriteUInt64NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteSInt32NoTagToArray(
-    const RepeatedField< int32>& value, uint8* target) {
-  return WritePrimitiveNoTagToArray(value, WriteSInt32NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteSInt64NoTagToArray(
-    const RepeatedField< int64>& value, uint8* target) {
-  return WritePrimitiveNoTagToArray(value, WriteSInt64NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteFixed32NoTagToArray(
-    const RepeatedField<uint32>& value, uint8* target) {
-  return WriteFixedNoTagToArray(value, WriteFixed32NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteFixed64NoTagToArray(
-    const RepeatedField<uint64>& value, uint8* target) {
-  return WriteFixedNoTagToArray(value, WriteFixed64NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteSFixed32NoTagToArray(
-    const RepeatedField< int32>& value, uint8* target) {
-  return WriteFixedNoTagToArray(value, WriteSFixed32NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteSFixed64NoTagToArray(
-    const RepeatedField< int64>& value, uint8* target) {
-  return WriteFixedNoTagToArray(value, WriteSFixed64NoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteFloatNoTagToArray(
-    const RepeatedField< float>& value, uint8* target) {
-  return WriteFixedNoTagToArray(value, WriteFloatNoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteDoubleNoTagToArray(
-    const RepeatedField<double>& value, uint8* target) {
-  return WriteFixedNoTagToArray(value, WriteDoubleNoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteBoolNoTagToArray(
-    const RepeatedField<  bool>& value, uint8* target) {
-  return WritePrimitiveNoTagToArray(value, WriteBoolNoTagToArray, target);
-}
-inline uint8* WireFormatLite::WriteEnumNoTagToArray(
-    const RepeatedField<   int>& value, uint8* target) {
-  return WritePrimitiveNoTagToArray(value, WriteEnumNoTagToArray, target);
-}
-
-inline uint8* WireFormatLite::WriteInt32ToArray(int field_number,
-                                                int32 value,
-                                                uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
-  return WriteInt32NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteInt64ToArray(int field_number,
-                                                int64 value,
-                                                uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
-  return WriteInt64NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteUInt32ToArray(int field_number,
-                                                 uint32 value,
-                                                 uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
-  return WriteUInt32NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteUInt64ToArray(int field_number,
-                                                 uint64 value,
-                                                 uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
-  return WriteUInt64NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteSInt32ToArray(int field_number,
-                                                 int32 value,
-                                                 uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
-  return WriteSInt32NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteSInt64ToArray(int field_number,
-                                                 int64 value,
-                                                 uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
-  return WriteSInt64NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteFixed32ToArray(int field_number,
-                                                  uint32 value,
-                                                  uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
-  return WriteFixed32NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteFixed64ToArray(int field_number,
-                                                  uint64 value,
-                                                  uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
-  return WriteFixed64NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteSFixed32ToArray(int field_number,
-                                                   int32 value,
-                                                   uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
-  return WriteSFixed32NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteSFixed64ToArray(int field_number,
-                                                   int64 value,
-                                                   uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
-  return WriteSFixed64NoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteFloatToArray(int field_number,
-                                                float value,
-                                                uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
-  return WriteFloatNoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteDoubleToArray(int field_number,
-                                                 double value,
-                                                 uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
-  return WriteDoubleNoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteBoolToArray(int field_number,
-                                               bool value,
-                                               uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
-  return WriteBoolNoTagToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteEnumToArray(int field_number,
-                                               int value,
-                                               uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
-  return WriteEnumNoTagToArray(value, target);
-}
-
-template<typename T>
-inline uint8* WireFormatLite::WritePrimitiveToArray(
-    int field_number,
-    const RepeatedField<T>& value,
-    uint8* (*Writer)(int, T, uint8*), uint8* target) {
-  const int n = value.size();
-  if (n == 0) {
-    return target;
-  }
-
-  const T* ii = value.unsafe_data();
-  int i = 0;
-  do {
-    target = Writer(field_number, ii[i], target);
-  } while (++i < n);
-
-  return target;
-}
-
-inline uint8* WireFormatLite::WriteInt32ToArray(
-    int field_number, const RepeatedField< int32>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteInt32ToArray, target);
-}
-inline uint8* WireFormatLite::WriteInt64ToArray(
-    int field_number, const RepeatedField< int64>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteInt64ToArray, target);
-}
-inline uint8* WireFormatLite::WriteUInt32ToArray(
-    int field_number, const RepeatedField<uint32>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteUInt32ToArray, target);
-}
-inline uint8* WireFormatLite::WriteUInt64ToArray(
-    int field_number, const RepeatedField<uint64>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteUInt64ToArray, target);
-}
-inline uint8* WireFormatLite::WriteSInt32ToArray(
-    int field_number, const RepeatedField< int32>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteSInt32ToArray, target);
-}
-inline uint8* WireFormatLite::WriteSInt64ToArray(
-    int field_number, const RepeatedField< int64>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteSInt64ToArray, target);
-}
-inline uint8* WireFormatLite::WriteFixed32ToArray(
-    int field_number, const RepeatedField<uint32>& value, uint8* target) {
-  return WritePrimitiveToArray(
-      field_number, value, WriteFixed32ToArray, target);
-}
-inline uint8* WireFormatLite::WriteFixed64ToArray(
-    int field_number, const RepeatedField<uint64>& value, uint8* target) {
-  return WritePrimitiveToArray(
-      field_number, value, WriteFixed64ToArray, target);
-}
-inline uint8* WireFormatLite::WriteSFixed32ToArray(
-    int field_number, const RepeatedField< int32>& value, uint8* target) {
-  return WritePrimitiveToArray(
-      field_number, value, WriteSFixed32ToArray, target);
-}
-inline uint8* WireFormatLite::WriteSFixed64ToArray(
-    int field_number, const RepeatedField< int64>& value, uint8* target) {
-  return WritePrimitiveToArray(
-      field_number, value, WriteSFixed64ToArray, target);
-}
-inline uint8* WireFormatLite::WriteFloatToArray(
-    int field_number, const RepeatedField< float>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteFloatToArray, target);
-}
-inline uint8* WireFormatLite::WriteDoubleToArray(
-    int field_number, const RepeatedField<double>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteDoubleToArray, target);
-}
-inline uint8* WireFormatLite::WriteBoolToArray(
-    int field_number, const RepeatedField<  bool>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteBoolToArray, target);
-}
-inline uint8* WireFormatLite::WriteEnumToArray(
-    int field_number, const RepeatedField<   int>& value, uint8* target) {
-  return WritePrimitiveToArray(field_number, value, WriteEnumToArray, target);
-}
-inline uint8* WireFormatLite::WriteStringToArray(int field_number,
-                                                 const string& value,
-                                                 uint8* target) {
-  // String is for UTF-8 text only
-  // WARNING:  In wire_format.cc, both strings and bytes are handled by
-  //   WriteString() to avoid code duplication.  If the implementations become
-  //   different, you will need to update that usage.
-  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);
-  return io::CodedOutputStream::WriteStringWithSizeToArray(value, target);
-}
-inline uint8* WireFormatLite::WriteBytesToArray(int field_number,
-                                                const string& value,
-                                                uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);
-  return io::CodedOutputStream::WriteStringWithSizeToArray(value, target);
-}
-
-
-inline uint8* WireFormatLite::InternalWriteGroupToArray(
-    int field_number, const MessageLite& value, bool deterministic,
-    uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_START_GROUP, target);
-  target = value.InternalSerializeWithCachedSizesToArray(deterministic, target);
-  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);
-}
-inline uint8* WireFormatLite::InternalWriteMessageToArray(
-    int field_number, const MessageLite& value, bool deterministic,
-    uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);
-  target = io::CodedOutputStream::WriteVarint32ToArray(
-    static_cast<uint32>(value.GetCachedSize()), target);
-  return value.InternalSerializeWithCachedSizesToArray(deterministic, target);
-}
-
-// See comment on ReadGroupNoVirtual to understand the need for this template
-// parameter name.
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline uint8* WireFormatLite::InternalWriteGroupNoVirtualToArray(
-    int field_number, const MessageType_WorkAroundCppLookupDefect& value,
-    bool deterministic, uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_START_GROUP, target);
-  target = value.MessageType_WorkAroundCppLookupDefect::
-      InternalSerializeWithCachedSizesToArray(deterministic, target);
-  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);
-}
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline uint8* WireFormatLite::InternalWriteMessageNoVirtualToArray(
-    int field_number, const MessageType_WorkAroundCppLookupDefect& value,
-    bool deterministic, uint8* target) {
-  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);
-  target = io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast<uint32>(
-            value.MessageType_WorkAroundCppLookupDefect::GetCachedSize()),
-        target);
-  return value.MessageType_WorkAroundCppLookupDefect::
-      InternalSerializeWithCachedSizesToArray(deterministic, target);
-}
-
-// ===================================================================
-
-inline size_t WireFormatLite::Int32Size(int32 value) {
-  return io::CodedOutputStream::VarintSize32SignExtended(value);
-}
-inline size_t WireFormatLite::Int64Size(int64 value) {
-  return io::CodedOutputStream::VarintSize64(static_cast<uint64>(value));
-}
-inline size_t WireFormatLite::UInt32Size(uint32 value) {
-  return io::CodedOutputStream::VarintSize32(value);
-}
-inline size_t WireFormatLite::UInt64Size(uint64 value) {
-  return io::CodedOutputStream::VarintSize64(value);
-}
-inline size_t WireFormatLite::SInt32Size(int32 value) {
-  return io::CodedOutputStream::VarintSize32(ZigZagEncode32(value));
-}
-inline size_t WireFormatLite::SInt64Size(int64 value) {
-  return io::CodedOutputStream::VarintSize64(ZigZagEncode64(value));
-}
-inline size_t WireFormatLite::EnumSize(int value) {
-  return io::CodedOutputStream::VarintSize32SignExtended(value);
-}
-
-inline size_t WireFormatLite::StringSize(const string& value) {
-  return LengthDelimitedSize(value.size());
-}
-inline size_t WireFormatLite::BytesSize(const string& value) {
-  return LengthDelimitedSize(value.size());
-}
-
-
-inline size_t WireFormatLite::GroupSize(const MessageLite& value) {
-  return value.ByteSizeLong();
-}
-inline size_t WireFormatLite::MessageSize(const MessageLite& value) {
-  return LengthDelimitedSize(value.ByteSizeLong());
-}
-
-// See comment on ReadGroupNoVirtual to understand the need for this template
-// parameter name.
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline size_t WireFormatLite::GroupSizeNoVirtual(
-    const MessageType_WorkAroundCppLookupDefect& value) {
-  return value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong();
-}
-template<typename MessageType_WorkAroundCppLookupDefect>
-inline size_t WireFormatLite::MessageSizeNoVirtual(
-    const MessageType_WorkAroundCppLookupDefect& value) {
-  return LengthDelimitedSize(
-      value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong());
-}
-
-inline size_t WireFormatLite::LengthDelimitedSize(size_t length) {
-  // The static_cast here prevents an error in certain compiler configurations
-  // but is not technically correct--if length is too large to fit in a uint32
-  // then it will be silently truncated. We will need to fix this if we ever
-  // decide to start supporting serialized messages greater than 2 GiB in size.
-  return length + io::CodedOutputStream::VarintSize32(
-      static_cast<uint32>(length));
-}
-
-size_t WireFormatLite::Int64Size (const RepeatedField< int64>& value) {
-  size_t out = 0;
-  const int n = value.size();
-  for (int i = 0; i < n; i++) {
-    out += Int64Size(value.Get(i));
-  }
-  return out;
-}
-
-size_t WireFormatLite::UInt64Size(const RepeatedField<uint64>& value) {
-  size_t out = 0;
-  const int n = value.size();
-  for (int i = 0; i < n; i++) {
-    out += UInt64Size(value.Get(i));
-  }
-  return out;
-}
-
-size_t WireFormatLite::SInt64Size(const RepeatedField< int64>& value) {
-  size_t out = 0;
-  const int n = value.size();
-  for (int i = 0; i < n; i++) {
-    out += SInt64Size(value.Get(i));
-  }
-  return out;
-}
-
-}  // namespace internal
-}  // namespace protobuf
-
-}  // namespace google
-#endif  // GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__
diff --git a/3rdparty/protobuf/src/google/protobuf/wrappers.pb.cc b/3rdparty/protobuf/src/google/protobuf/wrappers.pb.cc
deleted file mode 100644 (file)
index 00e0125..0000000
+++ /dev/null
@@ -1,2796 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/wrappers.proto
-
-#include <google/protobuf/wrappers.pb.h>
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace google {
-namespace protobuf {
-class DoubleValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<DoubleValue>
-      _instance;
-} _DoubleValue_default_instance_;
-class FloatValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FloatValue>
-      _instance;
-} _FloatValue_default_instance_;
-class Int64ValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Int64Value>
-      _instance;
-} _Int64Value_default_instance_;
-class UInt64ValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<UInt64Value>
-      _instance;
-} _UInt64Value_default_instance_;
-class Int32ValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Int32Value>
-      _instance;
-} _Int32Value_default_instance_;
-class UInt32ValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<UInt32Value>
-      _instance;
-} _UInt32Value_default_instance_;
-class BoolValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<BoolValue>
-      _instance;
-} _BoolValue_default_instance_;
-class StringValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<StringValue>
-      _instance;
-} _StringValue_default_instance_;
-class BytesValueDefaultTypeInternal {
- 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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_DoubleValue_default_instance_;
-    new (ptr) ::google::protobuf::DoubleValue();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::google::protobuf::DoubleValue::InitAsDefaultInstance();
-}
-
-void InitDefaultsDoubleValue() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDoubleValueImpl);
-}
-
-void InitDefaultsFloatValueImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_FloatValue_default_instance_;
-    new (ptr) ::google::protobuf::FloatValue();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::google::protobuf::FloatValue::InitAsDefaultInstance();
-}
-
-void InitDefaultsFloatValue() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFloatValueImpl);
-}
-
-void InitDefaultsInt64ValueImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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);
-}
-
-void InitDefaultsUInt32ValueImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::google::protobuf::_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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    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(::google::protobuf::DoubleValue, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DoubleValue, value_),
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::FloatValue, value_),
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::Int64Value, value_),
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::UInt64Value, value_),
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::Int32Value, value_),
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::UInt32Value, value_),
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::BoolValue, value_),
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::StringValue, value_),
-  ~0u,  // no _has_bits_
-  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(::google::protobuf::BytesValue, value_),
-};
-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*>(&::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_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "google/protobuf/wrappers.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 9);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  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"
-      "ue\022\r\n\005value\030\001 \001(\003\"\034\n\013UInt64Value\022\r\n\005valu"
-      "e\030\001 \001(\004\"\033\n\nInt32Value\022\r\n\005value\030\001 \001(\005\"\034\n\013"
-      "UInt32Value\022\r\n\005value\030\001 \001(\r\"\032\n\tBoolValue\022"
-      "\r\n\005value\030\001 \001(\010\"\034\n\013StringValue\022\r\n\005value\030\001"
-      " \001(\t\"\033\n\nBytesValue\022\r\n\005value\030\001 \001(\014B|\n\023com"
-      ".google.protobufB\rWrappersProtoP\001Z*githu"
-      "b.com/golang/protobuf/ptypes/wrappers\370\001\001"
-      "\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTypesb"
-      "\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 447);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "google/protobuf/wrappers.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_google_2fprotobuf_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
-
-DoubleValue::DoubleValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsDoubleValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.DoubleValue)
-}
-DoubleValue::DoubleValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsDoubleValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.DoubleValue)
-}
-DoubleValue::DoubleValue(const DoubleValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_ = from.value_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.DoubleValue)
-}
-
-void DoubleValue::SharedCtor() {
-  value_ = 0;
-  _cached_size_ = 0;
-}
-
-DoubleValue::~DoubleValue() {
-  // @@protoc_insertion_point(destructor:google.protobuf.DoubleValue)
-  SharedDtor();
-}
-
-void DoubleValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void DoubleValue::ArenaDtor(void* object) {
-  DoubleValue* _this = reinterpret_cast< DoubleValue* >(object);
-  (void)_this;
-}
-void DoubleValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void DoubleValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const DoubleValue& DoubleValue::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsDoubleValue();
-  return *internal_default_instance();
-}
-
-DoubleValue* DoubleValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<DoubleValue>(arena);
-}
-
-void DoubleValue::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.DoubleValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_ = 0;
-  _internal_metadata_.Clear();
-}
-
-bool DoubleValue::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.DoubleValue)
-  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)) {
-      // double value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 input, &value_)));
-        } 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.DoubleValue)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.DoubleValue)
-  return false;
-#undef DO_
-}
-
-void DoubleValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.DoubleValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // double value = 1;
-  if (this->value() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.DoubleValue)
-}
-
-::google::protobuf::uint8* DoubleValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DoubleValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // double value = 1;
-  if (this->value() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DoubleValue)
-  return target;
-}
-
-size_t DoubleValue::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DoubleValue)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // double value = 1;
-  if (this->value() != 0) {
-    total_size += 1 + 8;
-  }
-
-  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 DoubleValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DoubleValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const DoubleValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const DoubleValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DoubleValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DoubleValue)
-    MergeFrom(*source);
-  }
-}
-
-void DoubleValue::MergeFrom(const DoubleValue& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DoubleValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value() != 0) {
-    set_value(from.value());
-  }
-}
-
-void DoubleValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DoubleValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void DoubleValue::CopyFrom(const DoubleValue& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DoubleValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool DoubleValue::IsInitialized() const {
-  return true;
-}
-
-void DoubleValue::Swap(DoubleValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    DoubleValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void DoubleValue::UnsafeArenaSwap(DoubleValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void DoubleValue::InternalSwap(DoubleValue* other) {
-  using std::swap;
-  swap(value_, other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata DoubleValue::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void FloatValue::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FloatValue::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FloatValue::FloatValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsFloatValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.FloatValue)
-}
-FloatValue::FloatValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsFloatValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.FloatValue)
-}
-FloatValue::FloatValue(const FloatValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_ = from.value_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.FloatValue)
-}
-
-void FloatValue::SharedCtor() {
-  value_ = 0;
-  _cached_size_ = 0;
-}
-
-FloatValue::~FloatValue() {
-  // @@protoc_insertion_point(destructor:google.protobuf.FloatValue)
-  SharedDtor();
-}
-
-void FloatValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void FloatValue::ArenaDtor(void* object) {
-  FloatValue* _this = reinterpret_cast< FloatValue* >(object);
-  (void)_this;
-}
-void FloatValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void FloatValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const FloatValue& FloatValue::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsFloatValue();
-  return *internal_default_instance();
-}
-
-FloatValue* FloatValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FloatValue>(arena);
-}
-
-void FloatValue::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.FloatValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_ = 0;
-  _internal_metadata_.Clear();
-}
-
-bool FloatValue::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.FloatValue)
-  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)) {
-      // float value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &value_)));
-        } 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.FloatValue)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.FloatValue)
-  return false;
-#undef DO_
-}
-
-void FloatValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.FloatValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // float value = 1;
-  if (this->value() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.FloatValue)
-}
-
-::google::protobuf::uint8* FloatValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FloatValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // float value = 1;
-  if (this->value() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FloatValue)
-  return target;
-}
-
-size_t FloatValue::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FloatValue)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // float value = 1;
-  if (this->value() != 0) {
-    total_size += 1 + 4;
-  }
-
-  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 FloatValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FloatValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FloatValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FloatValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FloatValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FloatValue)
-    MergeFrom(*source);
-  }
-}
-
-void FloatValue::MergeFrom(const FloatValue& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FloatValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value() != 0) {
-    set_value(from.value());
-  }
-}
-
-void FloatValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FloatValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void FloatValue::CopyFrom(const FloatValue& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FloatValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool FloatValue::IsInitialized() const {
-  return true;
-}
-
-void FloatValue::Swap(FloatValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    FloatValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void FloatValue::UnsafeArenaSwap(FloatValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void FloatValue::InternalSwap(FloatValue* other) {
-  using std::swap;
-  swap(value_, other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata FloatValue::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void Int64Value::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Int64Value::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Int64Value::Int64Value()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt64Value();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Int64Value)
-}
-Int64Value::Int64Value(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt64Value();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Int64Value)
-}
-Int64Value::Int64Value(const Int64Value& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_ = from.value_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Int64Value)
-}
-
-void Int64Value::SharedCtor() {
-  value_ = GOOGLE_LONGLONG(0);
-  _cached_size_ = 0;
-}
-
-Int64Value::~Int64Value() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Int64Value)
-  SharedDtor();
-}
-
-void Int64Value::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void Int64Value::ArenaDtor(void* object) {
-  Int64Value* _this = reinterpret_cast< Int64Value* >(object);
-  (void)_this;
-}
-void Int64Value::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Int64Value::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Int64Value& Int64Value::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt64Value();
-  return *internal_default_instance();
-}
-
-Int64Value* Int64Value::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Int64Value>(arena);
-}
-
-void Int64Value::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Int64Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_ = GOOGLE_LONGLONG(0);
-  _internal_metadata_.Clear();
-}
-
-bool Int64Value::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.Int64Value)
-  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)) {
-      // int64 value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &value_)));
-        } 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.Int64Value)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Int64Value)
-  return false;
-#undef DO_
-}
-
-void Int64Value::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Int64Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int64 value = 1;
-  if (this->value() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Int64Value)
-}
-
-::google::protobuf::uint8* Int64Value::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int64Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int64 value = 1;
-  if (this->value() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Int64Value)
-  return target;
-}
-
-size_t Int64Value::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Int64Value)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // int64 value = 1;
-  if (this->value() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->value());
-  }
-
-  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 Int64Value::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Int64Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Int64Value* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Int64Value>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Int64Value)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Int64Value)
-    MergeFrom(*source);
-  }
-}
-
-void Int64Value::MergeFrom(const Int64Value& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Int64Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value() != 0) {
-    set_value(from.value());
-  }
-}
-
-void Int64Value::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Int64Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Int64Value::CopyFrom(const Int64Value& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Int64Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Int64Value::IsInitialized() const {
-  return true;
-}
-
-void Int64Value::Swap(Int64Value* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Int64Value* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Int64Value::UnsafeArenaSwap(Int64Value* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Int64Value::InternalSwap(Int64Value* other) {
-  using std::swap;
-  swap(value_, other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Int64Value::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void UInt64Value::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int UInt64Value::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-UInt64Value::UInt64Value()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt64Value();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.UInt64Value)
-}
-UInt64Value::UInt64Value(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt64Value();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.UInt64Value)
-}
-UInt64Value::UInt64Value(const UInt64Value& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_ = from.value_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.UInt64Value)
-}
-
-void UInt64Value::SharedCtor() {
-  value_ = GOOGLE_ULONGLONG(0);
-  _cached_size_ = 0;
-}
-
-UInt64Value::~UInt64Value() {
-  // @@protoc_insertion_point(destructor:google.protobuf.UInt64Value)
-  SharedDtor();
-}
-
-void UInt64Value::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void UInt64Value::ArenaDtor(void* object) {
-  UInt64Value* _this = reinterpret_cast< UInt64Value* >(object);
-  (void)_this;
-}
-void UInt64Value::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void UInt64Value::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const UInt64Value& UInt64Value::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt64Value();
-  return *internal_default_instance();
-}
-
-UInt64Value* UInt64Value::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<UInt64Value>(arena);
-}
-
-void UInt64Value::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.UInt64Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_ = GOOGLE_ULONGLONG(0);
-  _internal_metadata_.Clear();
-}
-
-bool UInt64Value::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.UInt64Value)
-  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)) {
-      // uint64 value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
-                 input, &value_)));
-        } 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.UInt64Value)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.UInt64Value)
-  return false;
-#undef DO_
-}
-
-void UInt64Value::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.UInt64Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // uint64 value = 1;
-  if (this->value() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.UInt64Value)
-}
-
-::google::protobuf::uint8* UInt64Value::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt64Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // uint64 value = 1;
-  if (this->value() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.UInt64Value)
-  return target;
-}
-
-size_t UInt64Value::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.UInt64Value)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // uint64 value = 1;
-  if (this->value() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::UInt64Size(
-        this->value());
-  }
-
-  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 UInt64Value::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.UInt64Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  const UInt64Value* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const UInt64Value>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.UInt64Value)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.UInt64Value)
-    MergeFrom(*source);
-  }
-}
-
-void UInt64Value::MergeFrom(const UInt64Value& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.UInt64Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value() != 0) {
-    set_value(from.value());
-  }
-}
-
-void UInt64Value::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.UInt64Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void UInt64Value::CopyFrom(const UInt64Value& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.UInt64Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool UInt64Value::IsInitialized() const {
-  return true;
-}
-
-void UInt64Value::Swap(UInt64Value* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    UInt64Value* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void UInt64Value::UnsafeArenaSwap(UInt64Value* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void UInt64Value::InternalSwap(UInt64Value* other) {
-  using std::swap;
-  swap(value_, other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata UInt64Value::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void Int32Value::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Int32Value::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Int32Value::Int32Value()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt32Value();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.Int32Value)
-}
-Int32Value::Int32Value(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt32Value();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.Int32Value)
-}
-Int32Value::Int32Value(const Int32Value& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_ = from.value_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.Int32Value)
-}
-
-void Int32Value::SharedCtor() {
-  value_ = 0;
-  _cached_size_ = 0;
-}
-
-Int32Value::~Int32Value() {
-  // @@protoc_insertion_point(destructor:google.protobuf.Int32Value)
-  SharedDtor();
-}
-
-void Int32Value::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void Int32Value::ArenaDtor(void* object) {
-  Int32Value* _this = reinterpret_cast< Int32Value* >(object);
-  (void)_this;
-}
-void Int32Value::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void Int32Value::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const Int32Value& Int32Value::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt32Value();
-  return *internal_default_instance();
-}
-
-Int32Value* Int32Value::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<Int32Value>(arena);
-}
-
-void Int32Value::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.Int32Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_ = 0;
-  _internal_metadata_.Clear();
-}
-
-bool Int32Value::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.Int32Value)
-  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)) {
-      // int32 value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &value_)));
-        } 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.Int32Value)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.Int32Value)
-  return false;
-#undef DO_
-}
-
-void Int32Value::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.Int32Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int32 value = 1;
-  if (this->value() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.Int32Value)
-}
-
-::google::protobuf::uint8* Int32Value::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int32Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int32 value = 1;
-  if (this->value() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Int32Value)
-  return target;
-}
-
-size_t Int32Value::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Int32Value)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // int32 value = 1;
-  if (this->value() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->value());
-  }
-
-  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 Int32Value::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Int32Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Int32Value* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Int32Value>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Int32Value)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Int32Value)
-    MergeFrom(*source);
-  }
-}
-
-void Int32Value::MergeFrom(const Int32Value& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Int32Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value() != 0) {
-    set_value(from.value());
-  }
-}
-
-void Int32Value::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Int32Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Int32Value::CopyFrom(const Int32Value& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Int32Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Int32Value::IsInitialized() const {
-  return true;
-}
-
-void Int32Value::Swap(Int32Value* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    Int32Value* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void Int32Value::UnsafeArenaSwap(Int32Value* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void Int32Value::InternalSwap(Int32Value* other) {
-  using std::swap;
-  swap(value_, other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata Int32Value::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void UInt32Value::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int UInt32Value::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-UInt32Value::UInt32Value()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt32Value();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.UInt32Value)
-}
-UInt32Value::UInt32Value(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt32Value();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.UInt32Value)
-}
-UInt32Value::UInt32Value(const UInt32Value& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_ = from.value_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.UInt32Value)
-}
-
-void UInt32Value::SharedCtor() {
-  value_ = 0u;
-  _cached_size_ = 0;
-}
-
-UInt32Value::~UInt32Value() {
-  // @@protoc_insertion_point(destructor:google.protobuf.UInt32Value)
-  SharedDtor();
-}
-
-void UInt32Value::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void UInt32Value::ArenaDtor(void* object) {
-  UInt32Value* _this = reinterpret_cast< UInt32Value* >(object);
-  (void)_this;
-}
-void UInt32Value::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void UInt32Value::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const UInt32Value& UInt32Value::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt32Value();
-  return *internal_default_instance();
-}
-
-UInt32Value* UInt32Value::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<UInt32Value>(arena);
-}
-
-void UInt32Value::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.UInt32Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_ = 0u;
-  _internal_metadata_.Clear();
-}
-
-bool UInt32Value::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.UInt32Value)
-  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)) {
-      // uint32 value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &value_)));
-        } 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.UInt32Value)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.UInt32Value)
-  return false;
-#undef DO_
-}
-
-void UInt32Value::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.UInt32Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // uint32 value = 1;
-  if (this->value() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.UInt32Value)
-}
-
-::google::protobuf::uint8* UInt32Value::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt32Value)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // uint32 value = 1;
-  if (this->value() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.UInt32Value)
-  return target;
-}
-
-size_t UInt32Value::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.UInt32Value)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // uint32 value = 1;
-  if (this->value() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::UInt32Size(
-        this->value());
-  }
-
-  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 UInt32Value::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.UInt32Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  const UInt32Value* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const UInt32Value>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.UInt32Value)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.UInt32Value)
-    MergeFrom(*source);
-  }
-}
-
-void UInt32Value::MergeFrom(const UInt32Value& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.UInt32Value)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value() != 0) {
-    set_value(from.value());
-  }
-}
-
-void UInt32Value::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.UInt32Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void UInt32Value::CopyFrom(const UInt32Value& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.UInt32Value)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool UInt32Value::IsInitialized() const {
-  return true;
-}
-
-void UInt32Value::Swap(UInt32Value* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    UInt32Value* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void UInt32Value::UnsafeArenaSwap(UInt32Value* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void UInt32Value::InternalSwap(UInt32Value* other) {
-  using std::swap;
-  swap(value_, other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata UInt32Value::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void BoolValue::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int BoolValue::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-BoolValue::BoolValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBoolValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.BoolValue)
-}
-BoolValue::BoolValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBoolValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.BoolValue)
-}
-BoolValue::BoolValue(const BoolValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_ = from.value_;
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.BoolValue)
-}
-
-void BoolValue::SharedCtor() {
-  value_ = false;
-  _cached_size_ = 0;
-}
-
-BoolValue::~BoolValue() {
-  // @@protoc_insertion_point(destructor:google.protobuf.BoolValue)
-  SharedDtor();
-}
-
-void BoolValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-}
-
-void BoolValue::ArenaDtor(void* object) {
-  BoolValue* _this = reinterpret_cast< BoolValue* >(object);
-  (void)_this;
-}
-void BoolValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void BoolValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const BoolValue& BoolValue::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBoolValue();
-  return *internal_default_instance();
-}
-
-BoolValue* BoolValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<BoolValue>(arena);
-}
-
-void BoolValue::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.BoolValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_ = false;
-  _internal_metadata_.Clear();
-}
-
-bool BoolValue::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.BoolValue)
-  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)) {
-      // bool value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &value_)));
-        } 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.BoolValue)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.BoolValue)
-  return false;
-#undef DO_
-}
-
-void BoolValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.BoolValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // bool value = 1;
-  if (this->value() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.BoolValue)
-}
-
-::google::protobuf::uint8* BoolValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BoolValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // bool value = 1;
-  if (this->value() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.BoolValue)
-  return target;
-}
-
-size_t BoolValue::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.BoolValue)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // bool value = 1;
-  if (this->value() != 0) {
-    total_size += 1 + 1;
-  }
-
-  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 BoolValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.BoolValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const BoolValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const BoolValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.BoolValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.BoolValue)
-    MergeFrom(*source);
-  }
-}
-
-void BoolValue::MergeFrom(const BoolValue& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.BoolValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value() != 0) {
-    set_value(from.value());
-  }
-}
-
-void BoolValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.BoolValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void BoolValue::CopyFrom(const BoolValue& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.BoolValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool BoolValue::IsInitialized() const {
-  return true;
-}
-
-void BoolValue::Swap(BoolValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    BoolValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void BoolValue::UnsafeArenaSwap(BoolValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void BoolValue::InternalSwap(BoolValue* other) {
-  using std::swap;
-  swap(value_, other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata BoolValue::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void StringValue::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int StringValue::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-StringValue::StringValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsStringValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.StringValue)
-}
-StringValue::StringValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsStringValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.StringValue)
-}
-StringValue::StringValue(const StringValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.value().size() > 0) {
-    value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value(),
-      GetArenaNoVirtual());
-  }
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.StringValue)
-}
-
-void StringValue::SharedCtor() {
-  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
-}
-
-StringValue::~StringValue() {
-  // @@protoc_insertion_point(destructor:google.protobuf.StringValue)
-  SharedDtor();
-}
-
-void StringValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void StringValue::ArenaDtor(void* object) {
-  StringValue* _this = reinterpret_cast< StringValue* >(object);
-  (void)_this;
-}
-void StringValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void StringValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const StringValue& StringValue::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsStringValue();
-  return *internal_default_instance();
-}
-
-StringValue* StringValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<StringValue>(arena);
-}
-
-void StringValue::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.StringValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  _internal_metadata_.Clear();
-}
-
-bool StringValue::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.StringValue)
-  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)) {
-      // string value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_value()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->value().data(), static_cast<int>(this->value().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "google.protobuf.StringValue.value"));
-        } 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.StringValue)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.StringValue)
-  return false;
-#undef DO_
-}
-
-void StringValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.StringValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string value = 1;
-  if (this->value().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->value().data(), static_cast<int>(this->value().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.StringValue.value");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.StringValue)
-}
-
-::google::protobuf::uint8* StringValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.StringValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string value = 1;
-  if (this->value().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->value().data(), static_cast<int>(this->value().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "google.protobuf.StringValue.value");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.StringValue)
-  return target;
-}
-
-size_t StringValue::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.StringValue)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // string value = 1;
-  if (this->value().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->value());
-  }
-
-  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 StringValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.StringValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const StringValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const StringValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.StringValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.StringValue)
-    MergeFrom(*source);
-  }
-}
-
-void StringValue::MergeFrom(const StringValue& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.StringValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value().size() > 0) {
-    set_value(from.value());
-  }
-}
-
-void StringValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.StringValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void StringValue::CopyFrom(const StringValue& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.StringValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool StringValue::IsInitialized() const {
-  return true;
-}
-
-void StringValue::Swap(StringValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    StringValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void StringValue::UnsafeArenaSwap(StringValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void StringValue::InternalSwap(StringValue* other) {
-  using std::swap;
-  value_.Swap(&other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata StringValue::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void BytesValue::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int BytesValue::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-BytesValue::BytesValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBytesValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:google.protobuf.BytesValue)
-}
-BytesValue::BytesValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBytesValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
-  // @@protoc_insertion_point(arena_constructor:google.protobuf.BytesValue)
-}
-BytesValue::BytesValue(const BytesValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.value().size() > 0) {
-    value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value(),
-      GetArenaNoVirtual());
-  }
-  // @@protoc_insertion_point(copy_constructor:google.protobuf.BytesValue)
-}
-
-void BytesValue::SharedCtor() {
-  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
-}
-
-BytesValue::~BytesValue() {
-  // @@protoc_insertion_point(destructor:google.protobuf.BytesValue)
-  SharedDtor();
-}
-
-void BytesValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void BytesValue::ArenaDtor(void* object) {
-  BytesValue* _this = reinterpret_cast< BytesValue* >(object);
-  (void)_this;
-}
-void BytesValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
-}
-void BytesValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  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;
-}
-
-const BytesValue& BytesValue::default_instance() {
-  ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBytesValue();
-  return *internal_default_instance();
-}
-
-BytesValue* BytesValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<BytesValue>(arena);
-}
-
-void BytesValue::Clear() {
-// @@protoc_insertion_point(message_clear_start:google.protobuf.BytesValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  _internal_metadata_.Clear();
-}
-
-bool BytesValue::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.BytesValue)
-  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)) {
-      // bytes value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_value()));
-        } 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.BytesValue)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:google.protobuf.BytesValue)
-  return false;
-#undef DO_
-}
-
-void BytesValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:google.protobuf.BytesValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // bytes value = 1;
-  if (this->value().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      1, this->value(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:google.protobuf.BytesValue)
-}
-
-::google::protobuf::uint8* BytesValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BytesValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // bytes value = 1;
-  if (this->value().size() > 0) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        1, this->value(), target);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.BytesValue)
-  return target;
-}
-
-size_t BytesValue::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:google.protobuf.BytesValue)
-  size_t total_size = 0;
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
-  // bytes value = 1;
-  if (this->value().size() > 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::BytesSize(
-        this->value());
-  }
-
-  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 BytesValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.BytesValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const BytesValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const BytesValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.BytesValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.BytesValue)
-    MergeFrom(*source);
-  }
-}
-
-void BytesValue::MergeFrom(const BytesValue& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.BytesValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  if (from.value().size() > 0) {
-    set_value(from.value());
-  }
-}
-
-void BytesValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.BytesValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void BytesValue::CopyFrom(const BytesValue& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.BytesValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool BytesValue::IsInitialized() const {
-  return true;
-}
-
-void BytesValue::Swap(BytesValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    BytesValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void BytesValue::UnsafeArenaSwap(BytesValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
-void BytesValue::InternalSwap(BytesValue* other) {
-  using std::swap;
-  value_.Swap(&other->value_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata BytesValue::GetMetadata() const {
-  protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
diff --git a/3rdparty/protobuf/src/google/protobuf/wrappers.pb.h b/3rdparty/protobuf/src/google/protobuf/wrappers.pb.h
deleted file mode 100644 (file)
index a2f10c8..0000000
+++ /dev/null
@@ -1,1487 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: google/protobuf/wrappers.proto
-
-#ifndef PROTOBUF_google_2fprotobuf_2fwrappers_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fwrappers_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#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;
-class BoolValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern BoolValueDefaultTypeInternal _BoolValue_default_instance_;
-class BytesValue;
-class BytesValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern BytesValueDefaultTypeInternal _BytesValue_default_instance_;
-class DoubleValue;
-class DoubleValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern DoubleValueDefaultTypeInternal _DoubleValue_default_instance_;
-class FloatValue;
-class FloatValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern FloatValueDefaultTypeInternal _FloatValue_default_instance_;
-class Int32Value;
-class Int32ValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern Int32ValueDefaultTypeInternal _Int32Value_default_instance_;
-class Int64Value;
-class Int64ValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern Int64ValueDefaultTypeInternal _Int64Value_default_instance_;
-class StringValue;
-class StringValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern StringValueDefaultTypeInternal _StringValue_default_instance_;
-class UInt32Value;
-class UInt32ValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern UInt32ValueDefaultTypeInternal _UInt32Value_default_instance_;
-class UInt64Value;
-class UInt64ValueDefaultTypeInternal;
-LIBPROTOBUF_EXPORT extern UInt64ValueDefaultTypeInternal _UInt64Value_default_instance_;
-}  // namespace protobuf
-}  // namespace google
-namespace google {
-namespace protobuf {
-
-// ===================================================================
-
-class LIBPROTOBUF_EXPORT DoubleValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DoubleValue) */ {
- public:
-  DoubleValue();
-  virtual ~DoubleValue();
-
-  DoubleValue(const DoubleValue& from);
-
-  inline DoubleValue& operator=(const DoubleValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  DoubleValue(DoubleValue&& from) noexcept
-    : DoubleValue() {
-    *this = ::std::move(from);
-  }
-
-  inline DoubleValue& operator=(DoubleValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void UnsafeArenaSwap(DoubleValue* other);
-  void Swap(DoubleValue* other);
-  friend void swap(DoubleValue& a, DoubleValue& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline DoubleValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  DoubleValue* 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 DoubleValue& from);
-  void MergeFrom(const DoubleValue& 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(DoubleValue* other);
-  protected:
-  explicit DoubleValue(::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 -------------------------------------------------------
-
-  // double value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  double value() const;
-  void set_value(double value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.DoubleValue)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  double value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsDoubleValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT FloatValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FloatValue) */ {
- public:
-  FloatValue();
-  virtual ~FloatValue();
-
-  FloatValue(const FloatValue& from);
-
-  inline FloatValue& operator=(const FloatValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  FloatValue(FloatValue&& from) noexcept
-    : FloatValue() {
-    *this = ::std::move(from);
-  }
-
-  inline FloatValue& operator=(FloatValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
-
-  void UnsafeArenaSwap(FloatValue* other);
-  void Swap(FloatValue* other);
-  friend void swap(FloatValue& a, FloatValue& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline FloatValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FloatValue* 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 FloatValue& from);
-  void MergeFrom(const FloatValue& 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(FloatValue* other);
-  protected:
-  explicit FloatValue(::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 -------------------------------------------------------
-
-  // float value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  float value() const;
-  void set_value(float value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.FloatValue)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  float value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsFloatValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Int64Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int64Value) */ {
- public:
-  Int64Value();
-  virtual ~Int64Value();
-
-  Int64Value(const Int64Value& from);
-
-  inline Int64Value& operator=(const Int64Value& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Int64Value(Int64Value&& from) noexcept
-    : Int64Value() {
-    *this = ::std::move(from);
-  }
-
-  inline Int64Value& operator=(Int64Value&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    2;
-
-  void UnsafeArenaSwap(Int64Value* other);
-  void Swap(Int64Value* other);
-  friend void swap(Int64Value& a, Int64Value& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Int64Value* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Int64Value* 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 Int64Value& from);
-  void MergeFrom(const Int64Value& 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(Int64Value* other);
-  protected:
-  explicit Int64Value(::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 -------------------------------------------------------
-
-  // int64 value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  ::google::protobuf::int64 value() const;
-  void set_value(::google::protobuf::int64 value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Int64Value)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::int64 value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt64ValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT UInt64Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt64Value) */ {
- public:
-  UInt64Value();
-  virtual ~UInt64Value();
-
-  UInt64Value(const UInt64Value& from);
-
-  inline UInt64Value& operator=(const UInt64Value& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  UInt64Value(UInt64Value&& from) noexcept
-    : UInt64Value() {
-    *this = ::std::move(from);
-  }
-
-  inline UInt64Value& operator=(UInt64Value&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    3;
-
-  void UnsafeArenaSwap(UInt64Value* other);
-  void Swap(UInt64Value* other);
-  friend void swap(UInt64Value& a, UInt64Value& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline UInt64Value* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  UInt64Value* 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 UInt64Value& from);
-  void MergeFrom(const UInt64Value& 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(UInt64Value* other);
-  protected:
-  explicit UInt64Value(::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 -------------------------------------------------------
-
-  // uint64 value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  ::google::protobuf::uint64 value() const;
-  void set_value(::google::protobuf::uint64 value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.UInt64Value)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::uint64 value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt64ValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT Int32Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int32Value) */ {
- public:
-  Int32Value();
-  virtual ~Int32Value();
-
-  Int32Value(const Int32Value& from);
-
-  inline Int32Value& operator=(const Int32Value& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  Int32Value(Int32Value&& from) noexcept
-    : Int32Value() {
-    *this = ::std::move(from);
-  }
-
-  inline Int32Value& operator=(Int32Value&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    4;
-
-  void UnsafeArenaSwap(Int32Value* other);
-  void Swap(Int32Value* other);
-  friend void swap(Int32Value& a, Int32Value& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline Int32Value* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Int32Value* 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 Int32Value& from);
-  void MergeFrom(const Int32Value& 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(Int32Value* other);
-  protected:
-  explicit Int32Value(::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 -------------------------------------------------------
-
-  // int32 value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  ::google::protobuf::int32 value() const;
-  void set_value(::google::protobuf::int32 value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.Int32Value)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::int32 value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt32ValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT UInt32Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt32Value) */ {
- public:
-  UInt32Value();
-  virtual ~UInt32Value();
-
-  UInt32Value(const UInt32Value& from);
-
-  inline UInt32Value& operator=(const UInt32Value& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  UInt32Value(UInt32Value&& from) noexcept
-    : UInt32Value() {
-    *this = ::std::move(from);
-  }
-
-  inline UInt32Value& operator=(UInt32Value&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    5;
-
-  void UnsafeArenaSwap(UInt32Value* other);
-  void Swap(UInt32Value* other);
-  friend void swap(UInt32Value& a, UInt32Value& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline UInt32Value* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  UInt32Value* 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 UInt32Value& from);
-  void MergeFrom(const UInt32Value& 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(UInt32Value* other);
-  protected:
-  explicit UInt32Value(::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 -------------------------------------------------------
-
-  // uint32 value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  ::google::protobuf::uint32 value() const;
-  void set_value(::google::protobuf::uint32 value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.UInt32Value)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  ::google::protobuf::uint32 value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt32ValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT BoolValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BoolValue) */ {
- public:
-  BoolValue();
-  virtual ~BoolValue();
-
-  BoolValue(const BoolValue& from);
-
-  inline BoolValue& operator=(const BoolValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  BoolValue(BoolValue&& from) noexcept
-    : BoolValue() {
-    *this = ::std::move(from);
-  }
-
-  inline BoolValue& operator=(BoolValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    6;
-
-  void UnsafeArenaSwap(BoolValue* other);
-  void Swap(BoolValue* other);
-  friend void swap(BoolValue& a, BoolValue& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline BoolValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  BoolValue* 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 BoolValue& from);
-  void MergeFrom(const BoolValue& 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(BoolValue* other);
-  protected:
-  explicit BoolValue(::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 -------------------------------------------------------
-
-  // bool value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  bool value() const;
-  void set_value(bool value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.BoolValue)
- private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
-  typedef void InternalArenaConstructable_;
-  typedef void DestructorSkippable_;
-  bool value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBoolValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT StringValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.StringValue) */ {
- public:
-  StringValue();
-  virtual ~StringValue();
-
-  StringValue(const StringValue& from);
-
-  inline StringValue& operator=(const StringValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  StringValue(StringValue&& from) noexcept
-    : StringValue() {
-    *this = ::std::move(from);
-  }
-
-  inline StringValue& operator=(StringValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    7;
-
-  void UnsafeArenaSwap(StringValue* other);
-  void Swap(StringValue* other);
-  friend void swap(StringValue& a, StringValue& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline StringValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  StringValue* 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 StringValue& from);
-  void MergeFrom(const StringValue& 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(StringValue* other);
-  protected:
-  explicit StringValue(::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 -------------------------------------------------------
-
-  // string value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  const ::std::string& value() const;
-  void set_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_value(::std::string&& value);
-  #endif
-  void set_value(const char* value);
-  void set_value(const char* value, size_t size);
-  ::std::string* mutable_value();
-  ::std::string* release_value();
-  void set_allocated_value(::std::string* value);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_value();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_value(
-      ::std::string* value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.StringValue)
- 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::ArenaStringPtr value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsStringValueImpl();
-};
-// -------------------------------------------------------------------
-
-class LIBPROTOBUF_EXPORT BytesValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BytesValue) */ {
- public:
-  BytesValue();
-  virtual ~BytesValue();
-
-  BytesValue(const BytesValue& from);
-
-  inline BytesValue& operator=(const BytesValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  BytesValue(BytesValue&& from) noexcept
-    : BytesValue() {
-    *this = ::std::move(from);
-  }
-
-  inline BytesValue& operator=(BytesValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
-    } else {
-      CopyFrom(from);
-    }
-    return *this;
-  }
-  #endif
-  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 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_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    8;
-
-  void UnsafeArenaSwap(BytesValue* other);
-  void Swap(BytesValue* other);
-  friend void swap(BytesValue& a, BytesValue& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline BytesValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  BytesValue* 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 BytesValue& from);
-  void MergeFrom(const BytesValue& 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(BytesValue* other);
-  protected:
-  explicit BytesValue(::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 -------------------------------------------------------
-
-  // bytes value = 1;
-  void clear_value();
-  static const int kValueFieldNumber = 1;
-  const ::std::string& value() const;
-  void set_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_value(::std::string&& value);
-  #endif
-  void set_value(const char* value);
-  void set_value(const void* value, size_t size);
-  ::std::string* mutable_value();
-  ::std::string* release_value();
-  void set_allocated_value(::std::string* value);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_value();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_value(
-      ::std::string* value);
-
-  // @@protoc_insertion_point(class_scope:google.protobuf.BytesValue)
- 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::ArenaStringPtr value_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
-  friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBytesValueImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// DoubleValue
-
-// double value = 1;
-inline void DoubleValue::clear_value() {
-  value_ = 0;
-}
-inline double DoubleValue::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.DoubleValue.value)
-  return value_;
-}
-inline void DoubleValue::set_value(double value) {
-  
-  value_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.DoubleValue.value)
-}
-
-// -------------------------------------------------------------------
-
-// FloatValue
-
-// float value = 1;
-inline void FloatValue::clear_value() {
-  value_ = 0;
-}
-inline float FloatValue::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.FloatValue.value)
-  return value_;
-}
-inline void FloatValue::set_value(float value) {
-  
-  value_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.FloatValue.value)
-}
-
-// -------------------------------------------------------------------
-
-// Int64Value
-
-// int64 value = 1;
-inline void Int64Value::clear_value() {
-  value_ = GOOGLE_LONGLONG(0);
-}
-inline ::google::protobuf::int64 Int64Value::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Int64Value.value)
-  return value_;
-}
-inline void Int64Value::set_value(::google::protobuf::int64 value) {
-  
-  value_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Int64Value.value)
-}
-
-// -------------------------------------------------------------------
-
-// UInt64Value
-
-// uint64 value = 1;
-inline void UInt64Value::clear_value() {
-  value_ = GOOGLE_ULONGLONG(0);
-}
-inline ::google::protobuf::uint64 UInt64Value::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.UInt64Value.value)
-  return value_;
-}
-inline void UInt64Value::set_value(::google::protobuf::uint64 value) {
-  
-  value_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.UInt64Value.value)
-}
-
-// -------------------------------------------------------------------
-
-// Int32Value
-
-// int32 value = 1;
-inline void Int32Value::clear_value() {
-  value_ = 0;
-}
-inline ::google::protobuf::int32 Int32Value::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.Int32Value.value)
-  return value_;
-}
-inline void Int32Value::set_value(::google::protobuf::int32 value) {
-  
-  value_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.Int32Value.value)
-}
-
-// -------------------------------------------------------------------
-
-// UInt32Value
-
-// uint32 value = 1;
-inline void UInt32Value::clear_value() {
-  value_ = 0u;
-}
-inline ::google::protobuf::uint32 UInt32Value::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.UInt32Value.value)
-  return value_;
-}
-inline void UInt32Value::set_value(::google::protobuf::uint32 value) {
-  
-  value_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.UInt32Value.value)
-}
-
-// -------------------------------------------------------------------
-
-// BoolValue
-
-// bool value = 1;
-inline void BoolValue::clear_value() {
-  value_ = false;
-}
-inline bool BoolValue::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.BoolValue.value)
-  return value_;
-}
-inline void BoolValue::set_value(bool value) {
-  
-  value_ = value;
-  // @@protoc_insertion_point(field_set:google.protobuf.BoolValue.value)
-}
-
-// -------------------------------------------------------------------
-
-// StringValue
-
-// string value = 1;
-inline void StringValue::clear_value() {
-  value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& StringValue::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.StringValue.value)
-  return value_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* StringValue::mutable_value() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.StringValue.value)
-  return value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline ::std::string* StringValue::release_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.StringValue.value)
-  
-  return value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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)
-}
-
-// -------------------------------------------------------------------
-
-// BytesValue
-
-// bytes value = 1;
-inline void BytesValue::clear_value() {
-  value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline const ::std::string& BytesValue::value() const {
-  // @@protoc_insertion_point(field_get:google.protobuf.BytesValue.value)
-  return value_.Get();
-}
-inline 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
-inline 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
-inline 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)
-}
-inline 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)
-}
-inline ::std::string* BytesValue::mutable_value() {
-  
-  // @@protoc_insertion_point(field_mutable:google.protobuf.BytesValue.value)
-  return value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline ::std::string* BytesValue::release_value() {
-  // @@protoc_insertion_point(field_release:google.protobuf.BytesValue.value)
-  
-  return value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-inline 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)
-}
-inline ::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());
-}
-inline 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)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace protobuf
-}  // namespace google
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_google_2fprotobuf_2fwrappers_2eproto__INCLUDED
index f0f2918..398ed5b 100644 (file)
@@ -51,6 +51,13 @@ if(MSVC)
                                        /wd4305 /wd4127 /wd4100 /wd4512 /wd4125 /wd4389 /wd4510 /wd4610
                                        /wd4702 /wd4456 /wd4457 /wd4065 /wd4310 /wd4661 /wd4506
   )
+  if(MSVC_VERSION LESS 1910)  # MSVS 2015, .pb.cc generated files
+    ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4309)  # 'static_cast': truncation of constant value
+  endif()
+  if(MSVC_VERSION LESS 1920)  # <MSVS2019, .pb.cc generated files
+    ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4189)  # local variable is initialized but not referenced
+    ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4592)  # symbol will be dynamically initialized (implementation limitation)
+  endif()
 else()
   ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated -Wmissing-prototypes -Wmissing-declarations -Wshadow
                                        -Wunused-parameter -Wsign-compare
index c46752d..65feaf0 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_caffe {
-class BlobShapeDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<BlobShape>
-      _instance;
-} _BlobShape_default_instance_;
-class BlobProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<BlobProto>
-      _instance;
-} _BlobProto_default_instance_;
-class BlobProtoVectorDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<BlobProtoVector>
-      _instance;
-} _BlobProtoVector_default_instance_;
-class PermuteParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<PermuteParameter>
-      _instance;
-} _PermuteParameter_default_instance_;
-class NormalizeBBoxParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NormalizeBBoxParameter>
-      _instance;
-} _NormalizeBBoxParameter_default_instance_;
-class PriorBoxParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<PriorBoxParameter>
-      _instance;
-} _PriorBoxParameter_default_instance_;
-class DetectionOutputParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<DetectionOutputParameter>
-      _instance;
-} _DetectionOutputParameter_default_instance_;
-class DatumDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<Datum>
-      _instance;
-} _Datum_default_instance_;
-class FillerParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FillerParameter>
-      _instance;
-} _FillerParameter_default_instance_;
-class NetParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NetParameter>
-      _instance;
-} _NetParameter_default_instance_;
-class SolverParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SolverParameter>
-      _instance;
-} _SolverParameter_default_instance_;
-class SolverStateDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SolverState>
-      _instance;
-} _SolverState_default_instance_;
-class NetStateDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NetState>
-      _instance;
-} _NetState_default_instance_;
-class NetStateRuleDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NetStateRule>
-      _instance;
-} _NetStateRule_default_instance_;
-class ParamSpecDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ParamSpec>
-      _instance;
-} _ParamSpec_default_instance_;
-class LayerParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<LayerParameter>
-      _instance;
-} _LayerParameter_default_instance_;
-class TransformationParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TransformationParameter>
-      _instance;
-} _TransformationParameter_default_instance_;
-class LossParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<LossParameter>
-      _instance;
-} _LossParameter_default_instance_;
-class AccuracyParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<AccuracyParameter>
-      _instance;
-} _AccuracyParameter_default_instance_;
-class ArgMaxParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ArgMaxParameter>
-      _instance;
-} _ArgMaxParameter_default_instance_;
-class ConcatParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ConcatParameter>
-      _instance;
-} _ConcatParameter_default_instance_;
-class BatchNormParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<BatchNormParameter>
-      _instance;
-} _BatchNormParameter_default_instance_;
-class BiasParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<BiasParameter>
-      _instance;
-} _BiasParameter_default_instance_;
-class ContrastiveLossParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ContrastiveLossParameter>
-      _instance;
-} _ContrastiveLossParameter_default_instance_;
-class ConvolutionParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ConvolutionParameter>
-      _instance;
-} _ConvolutionParameter_default_instance_;
-class CropParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<CropParameter>
-      _instance;
-} _CropParameter_default_instance_;
-class DataParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<DataParameter>
-      _instance;
-} _DataParameter_default_instance_;
-class NonMaximumSuppressionParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NonMaximumSuppressionParameter>
-      _instance;
-} _NonMaximumSuppressionParameter_default_instance_;
-class SaveOutputParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SaveOutputParameter>
-      _instance;
-} _SaveOutputParameter_default_instance_;
-class DropoutParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<DropoutParameter>
-      _instance;
-} _DropoutParameter_default_instance_;
-class DummyDataParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<DummyDataParameter>
-      _instance;
-} _DummyDataParameter_default_instance_;
-class EltwiseParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<EltwiseParameter>
-      _instance;
-} _EltwiseParameter_default_instance_;
-class ELUParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ELUParameter>
-      _instance;
-} _ELUParameter_default_instance_;
-class EmbedParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<EmbedParameter>
-      _instance;
-} _EmbedParameter_default_instance_;
-class ExpParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ExpParameter>
-      _instance;
-} _ExpParameter_default_instance_;
-class FlattenParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FlattenParameter>
-      _instance;
-} _FlattenParameter_default_instance_;
-class HDF5DataParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<HDF5DataParameter>
-      _instance;
-} _HDF5DataParameter_default_instance_;
-class HDF5OutputParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<HDF5OutputParameter>
-      _instance;
-} _HDF5OutputParameter_default_instance_;
-class HingeLossParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<HingeLossParameter>
-      _instance;
-} _HingeLossParameter_default_instance_;
-class ImageDataParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ImageDataParameter>
-      _instance;
-} _ImageDataParameter_default_instance_;
-class InfogainLossParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<InfogainLossParameter>
-      _instance;
-} _InfogainLossParameter_default_instance_;
-class InnerProductParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<InnerProductParameter>
-      _instance;
-} _InnerProductParameter_default_instance_;
-class InputParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<InputParameter>
-      _instance;
-} _InputParameter_default_instance_;
-class LogParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<LogParameter>
-      _instance;
-} _LogParameter_default_instance_;
-class LRNParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<LRNParameter>
-      _instance;
-} _LRNParameter_default_instance_;
-class MemoryDataParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<MemoryDataParameter>
-      _instance;
-} _MemoryDataParameter_default_instance_;
-class MVNParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<MVNParameter>
-      _instance;
-} _MVNParameter_default_instance_;
-class ParameterParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ParameterParameter>
-      _instance;
-} _ParameterParameter_default_instance_;
-class PoolingParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<PoolingParameter>
-      _instance;
-} _PoolingParameter_default_instance_;
-class PowerParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<PowerParameter>
-      _instance;
-} _PowerParameter_default_instance_;
-class PythonParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<PythonParameter>
-      _instance;
-} _PythonParameter_default_instance_;
-class RecurrentParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<RecurrentParameter>
-      _instance;
-} _RecurrentParameter_default_instance_;
-class ReductionParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ReductionParameter>
-      _instance;
-} _ReductionParameter_default_instance_;
-class ReLUParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ReLUParameter>
-      _instance;
-} _ReLUParameter_default_instance_;
-class ReshapeParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ReshapeParameter>
-      _instance;
-} _ReshapeParameter_default_instance_;
-class ScaleParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ScaleParameter>
-      _instance;
-} _ScaleParameter_default_instance_;
-class SigmoidParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SigmoidParameter>
-      _instance;
-} _SigmoidParameter_default_instance_;
-class SliceParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SliceParameter>
-      _instance;
-} _SliceParameter_default_instance_;
-class SoftmaxParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SoftmaxParameter>
-      _instance;
-} _SoftmaxParameter_default_instance_;
-class TanHParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TanHParameter>
-      _instance;
-} _TanHParameter_default_instance_;
-class TileParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TileParameter>
-      _instance;
-} _TileParameter_default_instance_;
-class ThresholdParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ThresholdParameter>
-      _instance;
-} _ThresholdParameter_default_instance_;
-class WindowDataParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<WindowDataParameter>
-      _instance;
-} _WindowDataParameter_default_instance_;
-class SPPParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<SPPParameter>
-      _instance;
-} _SPPParameter_default_instance_;
-class V1LayerParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<V1LayerParameter>
-      _instance;
-} _V1LayerParameter_default_instance_;
-class V0LayerParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<V0LayerParameter>
-      _instance;
-} _V0LayerParameter_default_instance_;
-class PReLUParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<PReLUParameter>
-      _instance;
-} _PReLUParameter_default_instance_;
-class NormalizedBBoxDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NormalizedBBox>
-      _instance;
-} _NormalizedBBox_default_instance_;
-class ROIPoolingParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ROIPoolingParameter>
-      _instance;
-} _ROIPoolingParameter_default_instance_;
-class ProposalParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ProposalParameter>
-      _instance;
-} _ProposalParameter_default_instance_;
-class PSROIPoolingParameterDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<PSROIPoolingParameter>
-      _instance;
-} _PSROIPoolingParameter_default_instance_;
+constexpr BlobShape::BlobShape(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : dim_()
+  , _dim_cached_byte_size_(0){}
+struct BlobShapeDefaultTypeInternal {
+  constexpr BlobShapeDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~BlobShapeDefaultTypeInternal() {}
+  union {
+    BlobShape _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BlobShapeDefaultTypeInternal _BlobShape_default_instance_;
+constexpr BlobProto::BlobProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : data_()
+  , diff_()
+  , double_data_()
+  , double_diff_()
+  , raw_data_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , shape_(nullptr)
+  , num_(0)
+  , channels_(0)
+  , height_(0)
+  , width_(0)
+  , raw_data_type_(0)
+{}
+struct BlobProtoDefaultTypeInternal {
+  constexpr BlobProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~BlobProtoDefaultTypeInternal() {}
+  union {
+    BlobProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BlobProtoDefaultTypeInternal _BlobProto_default_instance_;
+constexpr BlobProtoVector::BlobProtoVector(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : blobs_(){}
+struct BlobProtoVectorDefaultTypeInternal {
+  constexpr BlobProtoVectorDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~BlobProtoVectorDefaultTypeInternal() {}
+  union {
+    BlobProtoVector _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BlobProtoVectorDefaultTypeInternal _BlobProtoVector_default_instance_;
+constexpr PermuteParameter::PermuteParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : order_(){}
+struct PermuteParameterDefaultTypeInternal {
+  constexpr PermuteParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~PermuteParameterDefaultTypeInternal() {}
+  union {
+    PermuteParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PermuteParameterDefaultTypeInternal _PermuteParameter_default_instance_;
+constexpr NormalizeBBoxParameter::NormalizeBBoxParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : scale_filler_(nullptr)
+  , across_spatial_(true)
+  , channel_shared_(true)
+  , eps_(1e-10f){}
+struct NormalizeBBoxParameterDefaultTypeInternal {
+  constexpr NormalizeBBoxParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NormalizeBBoxParameterDefaultTypeInternal() {}
+  union {
+    NormalizeBBoxParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NormalizeBBoxParameterDefaultTypeInternal _NormalizeBBoxParameter_default_instance_;
+constexpr PriorBoxParameter::PriorBoxParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : min_size_()
+  , max_size_()
+  , aspect_ratio_()
+  , variance_()
+  , offset_h_()
+  , offset_w_()
+  , width_()
+  , height_()
+  , img_size_(0u)
+  , img_h_(0u)
+  , img_w_(0u)
+  , step_(0)
+  , step_h_(0)
+  , step_w_(0)
+  , flip_(true)
+  , clip_(true)
+  , offset_(0.5f){}
+struct PriorBoxParameterDefaultTypeInternal {
+  constexpr PriorBoxParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~PriorBoxParameterDefaultTypeInternal() {}
+  union {
+    PriorBoxParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PriorBoxParameterDefaultTypeInternal _PriorBoxParameter_default_instance_;
+constexpr DetectionOutputParameter::DetectionOutputParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : nms_param_(nullptr)
+  , save_output_param_(nullptr)
+  , num_classes_(0u)
+  , background_label_id_(0)
+  , confidence_threshold_(0)
+  , variance_encoded_in_target_(false)
+  , clip_(false)
+  , keep_top_k_(-1)
+  , code_type_(1)
+
+  , share_location_(true)
+  , normalized_bbox_(true){}
+struct DetectionOutputParameterDefaultTypeInternal {
+  constexpr DetectionOutputParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~DetectionOutputParameterDefaultTypeInternal() {}
+  union {
+    DetectionOutputParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DetectionOutputParameterDefaultTypeInternal _DetectionOutputParameter_default_instance_;
+constexpr Datum::Datum(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : float_data_()
+  , data_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , channels_(0)
+  , height_(0)
+  , width_(0)
+  , label_(0)
+  , encoded_(false){}
+struct DatumDefaultTypeInternal {
+  constexpr DatumDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~DatumDefaultTypeInternal() {}
+  union {
+    Datum _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DatumDefaultTypeInternal _Datum_default_instance_;
+constexpr FillerParameter::FillerParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : type_(nullptr)
+  , value_(0)
+  , min_(0)
+  , mean_(0)
+  , variance_norm_(0)
+
+  , sparse_(-1)
+  , max_(1)
+  , std_(1){}
+struct FillerParameterDefaultTypeInternal {
+  constexpr FillerParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FillerParameterDefaultTypeInternal() {}
+  union {
+    FillerParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FillerParameterDefaultTypeInternal _FillerParameter_default_instance_;
+constexpr NetParameter::NetParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : layers_()
+  , input_()
+  , input_dim_()
+  , input_shape_()
+  , layer_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , state_(nullptr)
+  , force_backward_(false)
+  , debug_info_(false){}
+struct NetParameterDefaultTypeInternal {
+  constexpr NetParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NetParameterDefaultTypeInternal() {}
+  union {
+    NetParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NetParameterDefaultTypeInternal _NetParameter_default_instance_;
+constexpr SolverParameter::SolverParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : test_net_()
+  , test_iter_()
+  , test_net_param_()
+  , test_state_()
+  , stepvalue_()
+  , train_net_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , lr_policy_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , snapshot_prefix_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , net_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , regularization_type_(nullptr)
+  , type_(nullptr)
+  , train_net_param_(nullptr)
+  , net_param_(nullptr)
+  , train_state_(nullptr)
+  , test_interval_(0)
+  , base_lr_(0)
+  , display_(0)
+  , max_iter_(0)
+  , gamma_(0)
+  , power_(0)
+  , momentum_(0)
+  , weight_decay_(0)
+  , stepsize_(0)
+  , snapshot_(0)
+  , device_id_(0)
+  , test_compute_loss_(false)
+  , snapshot_diff_(false)
+  , debug_info_(false)
+  , solver_type_(0)
+
+  , momentum2_(0.999f)
+  , random_seed_(int64_t{-1})
+  , solver_mode_(1)
+
+  , test_initialization_(true)
+  , snapshot_after_train_(true)
+  , delta_(1e-08f)
+  , average_loss_(1)
+  , clip_gradients_(-1)
+  , iter_size_(1)
+  , snapshot_format_(1)
+
+  , rms_decay_(0.99f){}
+struct SolverParameterDefaultTypeInternal {
+  constexpr SolverParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SolverParameterDefaultTypeInternal() {}
+  union {
+    SolverParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SolverParameterDefaultTypeInternal _SolverParameter_default_instance_;
+constexpr SolverState::SolverState(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : history_()
+  , learned_net_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , iter_(0)
+  , current_step_(0){}
+struct SolverStateDefaultTypeInternal {
+  constexpr SolverStateDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SolverStateDefaultTypeInternal() {}
+  union {
+    SolverState _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SolverStateDefaultTypeInternal _SolverState_default_instance_;
+constexpr NetState::NetState(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : stage_()
+  , level_(0)
+  , phase_(1)
+{}
+struct NetStateDefaultTypeInternal {
+  constexpr NetStateDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NetStateDefaultTypeInternal() {}
+  union {
+    NetState _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NetStateDefaultTypeInternal _NetState_default_instance_;
+constexpr NetStateRule::NetStateRule(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : stage_()
+  , not_stage_()
+  , phase_(0)
+
+  , min_level_(0)
+  , max_level_(0){}
+struct NetStateRuleDefaultTypeInternal {
+  constexpr NetStateRuleDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NetStateRuleDefaultTypeInternal() {}
+  union {
+    NetStateRule _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NetStateRuleDefaultTypeInternal _NetStateRule_default_instance_;
+constexpr ParamSpec::ParamSpec(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , share_mode_(0)
+
+  , lr_mult_(1)
+  , decay_mult_(1){}
+struct ParamSpecDefaultTypeInternal {
+  constexpr ParamSpecDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ParamSpecDefaultTypeInternal() {}
+  union {
+    ParamSpec _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ParamSpecDefaultTypeInternal _ParamSpec_default_instance_;
+constexpr LayerParameter::LayerParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : bottom_()
+  , top_()
+  , loss_weight_()
+  , param_()
+  , blobs_()
+  , include_()
+  , exclude_()
+  , propagate_down_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , transform_param_(nullptr)
+  , loss_param_(nullptr)
+  , accuracy_param_(nullptr)
+  , argmax_param_(nullptr)
+  , concat_param_(nullptr)
+  , contrastive_loss_param_(nullptr)
+  , convolution_param_(nullptr)
+  , data_param_(nullptr)
+  , dropout_param_(nullptr)
+  , dummy_data_param_(nullptr)
+  , eltwise_param_(nullptr)
+  , exp_param_(nullptr)
+  , hdf5_data_param_(nullptr)
+  , hdf5_output_param_(nullptr)
+  , hinge_loss_param_(nullptr)
+  , image_data_param_(nullptr)
+  , infogain_loss_param_(nullptr)
+  , inner_product_param_(nullptr)
+  , lrn_param_(nullptr)
+  , memory_data_param_(nullptr)
+  , mvn_param_(nullptr)
+  , pooling_param_(nullptr)
+  , power_param_(nullptr)
+  , relu_param_(nullptr)
+  , sigmoid_param_(nullptr)
+  , softmax_param_(nullptr)
+  , slice_param_(nullptr)
+  , tanh_param_(nullptr)
+  , threshold_param_(nullptr)
+  , window_data_param_(nullptr)
+  , python_param_(nullptr)
+  , prelu_param_(nullptr)
+  , spp_param_(nullptr)
+  , reshape_param_(nullptr)
+  , log_param_(nullptr)
+  , flatten_param_(nullptr)
+  , reduction_param_(nullptr)
+  , embed_param_(nullptr)
+  , tile_param_(nullptr)
+  , batch_norm_param_(nullptr)
+  , elu_param_(nullptr)
+  , bias_param_(nullptr)
+  , scale_param_(nullptr)
+  , input_param_(nullptr)
+  , crop_param_(nullptr)
+  , parameter_param_(nullptr)
+  , recurrent_param_(nullptr)
+  , detection_output_param_(nullptr)
+  , permute_param_(nullptr)
+  , norm_param_(nullptr)
+  , prior_box_param_(nullptr)
+  , proposal_param_(nullptr)
+  , psroi_pooling_param_(nullptr)
+  , roi_pooling_param_(nullptr)
+  , phase_(0)
+{}
+struct LayerParameterDefaultTypeInternal {
+  constexpr LayerParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~LayerParameterDefaultTypeInternal() {}
+  union {
+    LayerParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LayerParameterDefaultTypeInternal _LayerParameter_default_instance_;
+constexpr TransformationParameter::TransformationParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : mean_value_()
+  , mean_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , crop_size_(0u)
+  , mirror_(false)
+  , force_color_(false)
+  , force_gray_(false)
+  , scale_(1){}
+struct TransformationParameterDefaultTypeInternal {
+  constexpr TransformationParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TransformationParameterDefaultTypeInternal() {}
+  union {
+    TransformationParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TransformationParameterDefaultTypeInternal _TransformationParameter_default_instance_;
+constexpr LossParameter::LossParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : ignore_label_(0)
+  , normalize_(false)
+  , normalization_(1)
+{}
+struct LossParameterDefaultTypeInternal {
+  constexpr LossParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~LossParameterDefaultTypeInternal() {}
+  union {
+    LossParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LossParameterDefaultTypeInternal _LossParameter_default_instance_;
+constexpr AccuracyParameter::AccuracyParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : ignore_label_(0)
+  , top_k_(1u)
+  , axis_(1){}
+struct AccuracyParameterDefaultTypeInternal {
+  constexpr AccuracyParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~AccuracyParameterDefaultTypeInternal() {}
+  union {
+    AccuracyParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AccuracyParameterDefaultTypeInternal _AccuracyParameter_default_instance_;
+constexpr ArgMaxParameter::ArgMaxParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : out_max_val_(false)
+  , axis_(0)
+  , top_k_(1u){}
+struct ArgMaxParameterDefaultTypeInternal {
+  constexpr ArgMaxParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ArgMaxParameterDefaultTypeInternal() {}
+  union {
+    ArgMaxParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ArgMaxParameterDefaultTypeInternal _ArgMaxParameter_default_instance_;
+constexpr ConcatParameter::ConcatParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : concat_dim_(1u)
+  , axis_(1){}
+struct ConcatParameterDefaultTypeInternal {
+  constexpr ConcatParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ConcatParameterDefaultTypeInternal() {}
+  union {
+    ConcatParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConcatParameterDefaultTypeInternal _ConcatParameter_default_instance_;
+constexpr BatchNormParameter::BatchNormParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : use_global_stats_(false)
+  , scale_bias_(false)
+  , moving_average_fraction_(0.999f)
+  , eps_(1e-05f){}
+struct BatchNormParameterDefaultTypeInternal {
+  constexpr BatchNormParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~BatchNormParameterDefaultTypeInternal() {}
+  union {
+    BatchNormParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BatchNormParameterDefaultTypeInternal _BatchNormParameter_default_instance_;
+constexpr BiasParameter::BiasParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : filler_(nullptr)
+  , axis_(1)
+  , num_axes_(1){}
+struct BiasParameterDefaultTypeInternal {
+  constexpr BiasParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~BiasParameterDefaultTypeInternal() {}
+  union {
+    BiasParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BiasParameterDefaultTypeInternal _BiasParameter_default_instance_;
+constexpr ContrastiveLossParameter::ContrastiveLossParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : legacy_version_(false)
+  , margin_(1){}
+struct ContrastiveLossParameterDefaultTypeInternal {
+  constexpr ContrastiveLossParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ContrastiveLossParameterDefaultTypeInternal() {}
+  union {
+    ContrastiveLossParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ContrastiveLossParameterDefaultTypeInternal _ContrastiveLossParameter_default_instance_;
+constexpr ConvolutionParameter::ConvolutionParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : pad_()
+  , kernel_size_()
+  , stride_()
+  , dilation_()
+  , weight_filler_(nullptr)
+  , bias_filler_(nullptr)
+  , num_output_(0u)
+  , pad_h_(0u)
+  , pad_w_(0u)
+  , kernel_h_(0u)
+  , kernel_w_(0u)
+  , stride_h_(0u)
+  , stride_w_(0u)
+  , engine_(0)
+
+  , force_nd_im2col_(false)
+  , axis_(1)
+  , bias_term_(true)
+  , group_(1u){}
+struct ConvolutionParameterDefaultTypeInternal {
+  constexpr ConvolutionParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ConvolutionParameterDefaultTypeInternal() {}
+  union {
+    ConvolutionParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ConvolutionParameterDefaultTypeInternal _ConvolutionParameter_default_instance_;
+constexpr CropParameter::CropParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : offset_()
+  , axis_(2){}
+struct CropParameterDefaultTypeInternal {
+  constexpr CropParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~CropParameterDefaultTypeInternal() {}
+  union {
+    CropParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CropParameterDefaultTypeInternal _CropParameter_default_instance_;
+constexpr DataParameter::DataParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : source_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , mean_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , batch_size_(0u)
+  , crop_size_(0u)
+  , rand_skip_(0u)
+  , mirror_(false)
+  , force_encoded_color_(false)
+  , backend_(0)
+
+  , scale_(1)
+  , prefetch_(4u){}
+struct DataParameterDefaultTypeInternal {
+  constexpr DataParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~DataParameterDefaultTypeInternal() {}
+  union {
+    DataParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DataParameterDefaultTypeInternal _DataParameter_default_instance_;
+constexpr NonMaximumSuppressionParameter::NonMaximumSuppressionParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : top_k_(0)
+  , nms_threshold_(0.3f)
+  , eta_(1){}
+struct NonMaximumSuppressionParameterDefaultTypeInternal {
+  constexpr NonMaximumSuppressionParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NonMaximumSuppressionParameterDefaultTypeInternal() {}
+  union {
+    NonMaximumSuppressionParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NonMaximumSuppressionParameterDefaultTypeInternal _NonMaximumSuppressionParameter_default_instance_;
+constexpr SaveOutputParameter::SaveOutputParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : output_directory_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , output_name_prefix_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , output_format_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , label_map_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , name_size_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , num_test_image_(0u){}
+struct SaveOutputParameterDefaultTypeInternal {
+  constexpr SaveOutputParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SaveOutputParameterDefaultTypeInternal() {}
+  union {
+    SaveOutputParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SaveOutputParameterDefaultTypeInternal _SaveOutputParameter_default_instance_;
+constexpr DropoutParameter::DropoutParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : dropout_ratio_(0.5f)
+  , scale_train_(true){}
+struct DropoutParameterDefaultTypeInternal {
+  constexpr DropoutParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~DropoutParameterDefaultTypeInternal() {}
+  union {
+    DropoutParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DropoutParameterDefaultTypeInternal _DropoutParameter_default_instance_;
+constexpr DummyDataParameter::DummyDataParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : data_filler_()
+  , num_()
+  , channels_()
+  , height_()
+  , width_()
+  , shape_(){}
+struct DummyDataParameterDefaultTypeInternal {
+  constexpr DummyDataParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~DummyDataParameterDefaultTypeInternal() {}
+  union {
+    DummyDataParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DummyDataParameterDefaultTypeInternal _DummyDataParameter_default_instance_;
+constexpr EltwiseParameter::EltwiseParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : coeff_()
+  , operation_(1)
+
+  , stable_prod_grad_(true){}
+struct EltwiseParameterDefaultTypeInternal {
+  constexpr EltwiseParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~EltwiseParameterDefaultTypeInternal() {}
+  union {
+    EltwiseParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EltwiseParameterDefaultTypeInternal _EltwiseParameter_default_instance_;
+constexpr ELUParameter::ELUParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : alpha_(1){}
+struct ELUParameterDefaultTypeInternal {
+  constexpr ELUParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ELUParameterDefaultTypeInternal() {}
+  union {
+    ELUParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ELUParameterDefaultTypeInternal _ELUParameter_default_instance_;
+constexpr EmbedParameter::EmbedParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : weight_filler_(nullptr)
+  , bias_filler_(nullptr)
+  , num_output_(0u)
+  , input_dim_(0u)
+  , bias_term_(true){}
+struct EmbedParameterDefaultTypeInternal {
+  constexpr EmbedParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~EmbedParameterDefaultTypeInternal() {}
+  union {
+    EmbedParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EmbedParameterDefaultTypeInternal _EmbedParameter_default_instance_;
+constexpr ExpParameter::ExpParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : shift_(0)
+  , base_(-1)
+  , scale_(1){}
+struct ExpParameterDefaultTypeInternal {
+  constexpr ExpParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ExpParameterDefaultTypeInternal() {}
+  union {
+    ExpParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ExpParameterDefaultTypeInternal _ExpParameter_default_instance_;
+constexpr FlattenParameter::FlattenParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : axis_(1)
+  , end_axis_(-1){}
+struct FlattenParameterDefaultTypeInternal {
+  constexpr FlattenParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FlattenParameterDefaultTypeInternal() {}
+  union {
+    FlattenParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FlattenParameterDefaultTypeInternal _FlattenParameter_default_instance_;
+constexpr HDF5DataParameter::HDF5DataParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : source_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , batch_size_(0u)
+  , shuffle_(false){}
+struct HDF5DataParameterDefaultTypeInternal {
+  constexpr HDF5DataParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~HDF5DataParameterDefaultTypeInternal() {}
+  union {
+    HDF5DataParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HDF5DataParameterDefaultTypeInternal _HDF5DataParameter_default_instance_;
+constexpr HDF5OutputParameter::HDF5OutputParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : file_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct HDF5OutputParameterDefaultTypeInternal {
+  constexpr HDF5OutputParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~HDF5OutputParameterDefaultTypeInternal() {}
+  union {
+    HDF5OutputParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HDF5OutputParameterDefaultTypeInternal _HDF5OutputParameter_default_instance_;
+constexpr HingeLossParameter::HingeLossParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : norm_(1)
+{}
+struct HingeLossParameterDefaultTypeInternal {
+  constexpr HingeLossParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~HingeLossParameterDefaultTypeInternal() {}
+  union {
+    HingeLossParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HingeLossParameterDefaultTypeInternal _HingeLossParameter_default_instance_;
+constexpr ImageDataParameter::ImageDataParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : source_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , mean_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , root_folder_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , crop_size_(0u)
+  , rand_skip_(0u)
+  , shuffle_(false)
+  , mirror_(false)
+  , new_height_(0u)
+  , new_width_(0u)
+  , is_color_(true)
+  , scale_(1)
+  , batch_size_(1u){}
+struct ImageDataParameterDefaultTypeInternal {
+  constexpr ImageDataParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ImageDataParameterDefaultTypeInternal() {}
+  union {
+    ImageDataParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ImageDataParameterDefaultTypeInternal _ImageDataParameter_default_instance_;
+constexpr InfogainLossParameter::InfogainLossParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : source_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct InfogainLossParameterDefaultTypeInternal {
+  constexpr InfogainLossParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~InfogainLossParameterDefaultTypeInternal() {}
+  union {
+    InfogainLossParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT InfogainLossParameterDefaultTypeInternal _InfogainLossParameter_default_instance_;
+constexpr InnerProductParameter::InnerProductParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : weight_filler_(nullptr)
+  , bias_filler_(nullptr)
+  , num_output_(0u)
+  , transpose_(false)
+  , bias_term_(true)
+  , axis_(1){}
+struct InnerProductParameterDefaultTypeInternal {
+  constexpr InnerProductParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~InnerProductParameterDefaultTypeInternal() {}
+  union {
+    InnerProductParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT InnerProductParameterDefaultTypeInternal _InnerProductParameter_default_instance_;
+constexpr InputParameter::InputParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : shape_(){}
+struct InputParameterDefaultTypeInternal {
+  constexpr InputParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~InputParameterDefaultTypeInternal() {}
+  union {
+    InputParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT InputParameterDefaultTypeInternal _InputParameter_default_instance_;
+constexpr LogParameter::LogParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : shift_(0)
+  , base_(-1)
+  , scale_(1){}
+struct LogParameterDefaultTypeInternal {
+  constexpr LogParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~LogParameterDefaultTypeInternal() {}
+  union {
+    LogParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LogParameterDefaultTypeInternal _LogParameter_default_instance_;
+constexpr LRNParameter::LRNParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : norm_region_(0)
+
+  , engine_(0)
+
+  , local_size_(5u)
+  , alpha_(1)
+  , beta_(0.75f)
+  , k_(1){}
+struct LRNParameterDefaultTypeInternal {
+  constexpr LRNParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~LRNParameterDefaultTypeInternal() {}
+  union {
+    LRNParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LRNParameterDefaultTypeInternal _LRNParameter_default_instance_;
+constexpr MemoryDataParameter::MemoryDataParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : batch_size_(0u)
+  , channels_(0u)
+  , height_(0u)
+  , width_(0u){}
+struct MemoryDataParameterDefaultTypeInternal {
+  constexpr MemoryDataParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~MemoryDataParameterDefaultTypeInternal() {}
+  union {
+    MemoryDataParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MemoryDataParameterDefaultTypeInternal _MemoryDataParameter_default_instance_;
+constexpr MVNParameter::MVNParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : across_channels_(false)
+  , normalize_variance_(true)
+  , eps_(1e-09f){}
+struct MVNParameterDefaultTypeInternal {
+  constexpr MVNParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~MVNParameterDefaultTypeInternal() {}
+  union {
+    MVNParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MVNParameterDefaultTypeInternal _MVNParameter_default_instance_;
+constexpr ParameterParameter::ParameterParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : shape_(nullptr){}
+struct ParameterParameterDefaultTypeInternal {
+  constexpr ParameterParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ParameterParameterDefaultTypeInternal() {}
+  union {
+    ParameterParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ParameterParameterDefaultTypeInternal _ParameterParameter_default_instance_;
+constexpr PoolingParameter::PoolingParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : pool_(0)
+
+  , kernel_size_(0u)
+  , pad_(0u)
+  , kernel_h_(0u)
+  , kernel_w_(0u)
+  , stride_h_(0u)
+  , stride_w_(0u)
+  , pad_h_(0u)
+  , pad_w_(0u)
+  , engine_(0)
+
+  , global_pooling_(false)
+  , stride_(1u)
+  , ceil_mode_(true){}
+struct PoolingParameterDefaultTypeInternal {
+  constexpr PoolingParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~PoolingParameterDefaultTypeInternal() {}
+  union {
+    PoolingParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PoolingParameterDefaultTypeInternal _PoolingParameter_default_instance_;
+constexpr PowerParameter::PowerParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : shift_(0)
+  , power_(1)
+  , scale_(1){}
+struct PowerParameterDefaultTypeInternal {
+  constexpr PowerParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~PowerParameterDefaultTypeInternal() {}
+  union {
+    PowerParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PowerParameterDefaultTypeInternal _PowerParameter_default_instance_;
+constexpr PythonParameter::PythonParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : module_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , layer_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , param_str_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , share_in_parallel_(false){}
+struct PythonParameterDefaultTypeInternal {
+  constexpr PythonParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~PythonParameterDefaultTypeInternal() {}
+  union {
+    PythonParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PythonParameterDefaultTypeInternal _PythonParameter_default_instance_;
+constexpr RecurrentParameter::RecurrentParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : weight_filler_(nullptr)
+  , bias_filler_(nullptr)
+  , num_output_(0u)
+  , debug_info_(false)
+  , expose_hidden_(false){}
+struct RecurrentParameterDefaultTypeInternal {
+  constexpr RecurrentParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~RecurrentParameterDefaultTypeInternal() {}
+  union {
+    RecurrentParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT RecurrentParameterDefaultTypeInternal _RecurrentParameter_default_instance_;
+constexpr ReductionParameter::ReductionParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : axis_(0)
+  , operation_(1)
+
+  , coeff_(1){}
+struct ReductionParameterDefaultTypeInternal {
+  constexpr ReductionParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ReductionParameterDefaultTypeInternal() {}
+  union {
+    ReductionParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReductionParameterDefaultTypeInternal _ReductionParameter_default_instance_;
+constexpr ReLUParameter::ReLUParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : negative_slope_(0)
+  , engine_(0)
+{}
+struct ReLUParameterDefaultTypeInternal {
+  constexpr ReLUParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ReLUParameterDefaultTypeInternal() {}
+  union {
+    ReLUParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReLUParameterDefaultTypeInternal _ReLUParameter_default_instance_;
+constexpr ReshapeParameter::ReshapeParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : shape_(nullptr)
+  , axis_(0)
+  , num_axes_(-1){}
+struct ReshapeParameterDefaultTypeInternal {
+  constexpr ReshapeParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ReshapeParameterDefaultTypeInternal() {}
+  union {
+    ReshapeParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReshapeParameterDefaultTypeInternal _ReshapeParameter_default_instance_;
+constexpr ScaleParameter::ScaleParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : filler_(nullptr)
+  , bias_filler_(nullptr)
+  , bias_term_(false)
+  , axis_(1)
+  , num_axes_(1){}
+struct ScaleParameterDefaultTypeInternal {
+  constexpr ScaleParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ScaleParameterDefaultTypeInternal() {}
+  union {
+    ScaleParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ScaleParameterDefaultTypeInternal _ScaleParameter_default_instance_;
+constexpr SigmoidParameter::SigmoidParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : engine_(0)
+{}
+struct SigmoidParameterDefaultTypeInternal {
+  constexpr SigmoidParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SigmoidParameterDefaultTypeInternal() {}
+  union {
+    SigmoidParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SigmoidParameterDefaultTypeInternal _SigmoidParameter_default_instance_;
+constexpr SliceParameter::SliceParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : slice_point_()
+  , slice_dim_(1u)
+  , axis_(1){}
+struct SliceParameterDefaultTypeInternal {
+  constexpr SliceParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SliceParameterDefaultTypeInternal() {}
+  union {
+    SliceParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SliceParameterDefaultTypeInternal _SliceParameter_default_instance_;
+constexpr SoftmaxParameter::SoftmaxParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : engine_(0)
+
+  , axis_(1){}
+struct SoftmaxParameterDefaultTypeInternal {
+  constexpr SoftmaxParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SoftmaxParameterDefaultTypeInternal() {}
+  union {
+    SoftmaxParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SoftmaxParameterDefaultTypeInternal _SoftmaxParameter_default_instance_;
+constexpr TanHParameter::TanHParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : engine_(0)
+{}
+struct TanHParameterDefaultTypeInternal {
+  constexpr TanHParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TanHParameterDefaultTypeInternal() {}
+  union {
+    TanHParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TanHParameterDefaultTypeInternal _TanHParameter_default_instance_;
+constexpr TileParameter::TileParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : tiles_(0)
+  , axis_(1){}
+struct TileParameterDefaultTypeInternal {
+  constexpr TileParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TileParameterDefaultTypeInternal() {}
+  union {
+    TileParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TileParameterDefaultTypeInternal _TileParameter_default_instance_;
+constexpr ThresholdParameter::ThresholdParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : threshold_(0){}
+struct ThresholdParameterDefaultTypeInternal {
+  constexpr ThresholdParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ThresholdParameterDefaultTypeInternal() {}
+  union {
+    ThresholdParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ThresholdParameterDefaultTypeInternal _ThresholdParameter_default_instance_;
+constexpr WindowDataParameter::WindowDataParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : source_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , mean_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , crop_mode_(nullptr)
+  , root_folder_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , batch_size_(0u)
+  , crop_size_(0u)
+  , mirror_(false)
+  , cache_images_(false)
+  , context_pad_(0u)
+  , scale_(1)
+  , fg_threshold_(0.5f)
+  , bg_threshold_(0.5f)
+  , fg_fraction_(0.25f){}
+struct WindowDataParameterDefaultTypeInternal {
+  constexpr WindowDataParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~WindowDataParameterDefaultTypeInternal() {}
+  union {
+    WindowDataParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT WindowDataParameterDefaultTypeInternal _WindowDataParameter_default_instance_;
+constexpr SPPParameter::SPPParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : pyramid_height_(0u)
+  , pool_(0)
+
+  , engine_(0)
+{}
+struct SPPParameterDefaultTypeInternal {
+  constexpr SPPParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~SPPParameterDefaultTypeInternal() {}
+  union {
+    SPPParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SPPParameterDefaultTypeInternal _SPPParameter_default_instance_;
+constexpr V1LayerParameter::V1LayerParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : bottom_()
+  , top_()
+  , blobs_()
+  , blobs_lr_()
+  , weight_decay_()
+  , include_()
+  , exclude_()
+  , loss_weight_()
+  , param_()
+  , blob_share_mode_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , layer_(nullptr)
+  , concat_param_(nullptr)
+  , convolution_param_(nullptr)
+  , data_param_(nullptr)
+  , dropout_param_(nullptr)
+  , hdf5_data_param_(nullptr)
+  , hdf5_output_param_(nullptr)
+  , image_data_param_(nullptr)
+  , infogain_loss_param_(nullptr)
+  , inner_product_param_(nullptr)
+  , lrn_param_(nullptr)
+  , pooling_param_(nullptr)
+  , window_data_param_(nullptr)
+  , power_param_(nullptr)
+  , memory_data_param_(nullptr)
+  , argmax_param_(nullptr)
+  , eltwise_param_(nullptr)
+  , threshold_param_(nullptr)
+  , dummy_data_param_(nullptr)
+  , accuracy_param_(nullptr)
+  , hinge_loss_param_(nullptr)
+  , relu_param_(nullptr)
+  , slice_param_(nullptr)
+  , mvn_param_(nullptr)
+  , transform_param_(nullptr)
+  , tanh_param_(nullptr)
+  , sigmoid_param_(nullptr)
+  , softmax_param_(nullptr)
+  , contrastive_loss_param_(nullptr)
+  , exp_param_(nullptr)
+  , loss_param_(nullptr)
+  , type_(0)
+{}
+struct V1LayerParameterDefaultTypeInternal {
+  constexpr V1LayerParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~V1LayerParameterDefaultTypeInternal() {}
+  union {
+    V1LayerParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT V1LayerParameterDefaultTypeInternal _V1LayerParameter_default_instance_;
+constexpr V0LayerParameter::V0LayerParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : blobs_()
+  , blobs_lr_()
+  , weight_decay_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , source_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , meanfile_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , det_crop_mode_(nullptr)
+  , weight_filler_(nullptr)
+  , bias_filler_(nullptr)
+  , hdf5_output_param_(nullptr)
+  , num_output_(0u)
+  , pad_(0u)
+  , kernelsize_(0u)
+  , pool_(0)
+
+  , batchsize_(0u)
+  , cropsize_(0u)
+  , new_width_(0)
+  , mirror_(false)
+  , shuffle_images_(false)
+  , rand_skip_(0u)
+  , det_context_pad_(0u)
+  , new_num_(0)
+  , new_channels_(0)
+  , new_height_(0)
+  , concat_dim_(1u)
+  , biasterm_(true)
+  , group_(1u)
+  , stride_(1u)
+  , dropout_ratio_(0.5f)
+  , local_size_(5u)
+  , alpha_(1)
+  , beta_(0.75f)
+  , scale_(1)
+  , k_(1)
+  , det_fg_threshold_(0.5f)
+  , det_bg_threshold_(0.5f)
+  , det_fg_fraction_(0.25f){}
+struct V0LayerParameterDefaultTypeInternal {
+  constexpr V0LayerParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~V0LayerParameterDefaultTypeInternal() {}
+  union {
+    V0LayerParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT V0LayerParameterDefaultTypeInternal _V0LayerParameter_default_instance_;
+constexpr PReLUParameter::PReLUParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : filler_(nullptr)
+  , channel_shared_(false){}
+struct PReLUParameterDefaultTypeInternal {
+  constexpr PReLUParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~PReLUParameterDefaultTypeInternal() {}
+  union {
+    PReLUParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PReLUParameterDefaultTypeInternal _PReLUParameter_default_instance_;
+constexpr NormalizedBBox::NormalizedBBox(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : xmin_(0)
+  , ymin_(0)
+  , xmax_(0)
+  , ymax_(0)
+  , label_(0)
+  , difficult_(false)
+  , score_(0)
+  , size_(0){}
+struct NormalizedBBoxDefaultTypeInternal {
+  constexpr NormalizedBBoxDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NormalizedBBoxDefaultTypeInternal() {}
+  union {
+    NormalizedBBox _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NormalizedBBoxDefaultTypeInternal _NormalizedBBox_default_instance_;
+constexpr ROIPoolingParameter::ROIPoolingParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : pooled_h_(0u)
+  , pooled_w_(0u)
+  , spatial_scale_(1){}
+struct ROIPoolingParameterDefaultTypeInternal {
+  constexpr ROIPoolingParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ROIPoolingParameterDefaultTypeInternal() {}
+  union {
+    ROIPoolingParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ROIPoolingParameterDefaultTypeInternal _ROIPoolingParameter_default_instance_;
+constexpr ProposalParameter::ProposalParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : ratio_()
+  , scale_()
+  , feat_stride_(16u)
+  , base_size_(16u)
+  , min_size_(16u)
+  , pre_nms_topn_(6000u)
+  , post_nms_topn_(300u)
+  , nms_thresh_(0.7f){}
+struct ProposalParameterDefaultTypeInternal {
+  constexpr ProposalParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ProposalParameterDefaultTypeInternal() {}
+  union {
+    ProposalParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ProposalParameterDefaultTypeInternal _ProposalParameter_default_instance_;
+constexpr PSROIPoolingParameter::PSROIPoolingParameter(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : spatial_scale_(0)
+  , output_dim_(0)
+  , group_size_(0){}
+struct PSROIPoolingParameterDefaultTypeInternal {
+  constexpr PSROIPoolingParameterDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~PSROIPoolingParameterDefaultTypeInternal() {}
+  union {
+    PSROIPoolingParameter _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PSROIPoolingParameterDefaultTypeInternal _PSROIPoolingParameter_default_instance_;
 }  // namespace opencv_caffe
-namespace protobuf_opencv_2dcaffe_2eproto {
-void InitDefaultsBlobShapeImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_BlobShape_default_instance_;
-    new (ptr) ::opencv_caffe::BlobShape();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::BlobShape::InitAsDefaultInstance();
-}
-
-void InitDefaultsBlobShape() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBlobShapeImpl);
-}
-
-void InitDefaultsBlobProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShape();
-  {
-    void* ptr = &::opencv_caffe::_BlobProto_default_instance_;
-    new (ptr) ::opencv_caffe::BlobProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::BlobProto::InitAsDefaultInstance();
-}
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_opencv_2dcaffe_2eproto[71];
+static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_opencv_2dcaffe_2eproto[27];
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_opencv_2dcaffe_2eproto = nullptr;
 
-void InitDefaultsBlobProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBlobProtoImpl);
-}
-
-void InitDefaultsBlobProtoVectorImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProto();
-  {
-    void* ptr = &::opencv_caffe::_BlobProtoVector_default_instance_;
-    new (ptr) ::opencv_caffe::BlobProtoVector();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::BlobProtoVector::InitAsDefaultInstance();
-}
-
-void InitDefaultsBlobProtoVector() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBlobProtoVectorImpl);
-}
-
-void InitDefaultsPermuteParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_PermuteParameter_default_instance_;
-    new (ptr) ::opencv_caffe::PermuteParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::PermuteParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsPermuteParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsPermuteParameterImpl);
-}
-
-void InitDefaultsNormalizeBBoxParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  {
-    void* ptr = &::opencv_caffe::_NormalizeBBoxParameter_default_instance_;
-    new (ptr) ::opencv_caffe::NormalizeBBoxParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::NormalizeBBoxParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsNormalizeBBoxParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNormalizeBBoxParameterImpl);
-}
-
-void InitDefaultsPriorBoxParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_PriorBoxParameter_default_instance_;
-    new (ptr) ::opencv_caffe::PriorBoxParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::PriorBoxParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsPriorBoxParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsPriorBoxParameterImpl);
-}
-
-void InitDefaultsDetectionOutputParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsNonMaximumSuppressionParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsSaveOutputParameter();
-  {
-    void* ptr = &::opencv_caffe::_DetectionOutputParameter_default_instance_;
-    new (ptr) ::opencv_caffe::DetectionOutputParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::DetectionOutputParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsDetectionOutputParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDetectionOutputParameterImpl);
-}
-
-void InitDefaultsDatumImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_Datum_default_instance_;
-    new (ptr) ::opencv_caffe::Datum();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::Datum::InitAsDefaultInstance();
-}
-
-void InitDefaultsDatum() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDatumImpl);
-}
-
-void InitDefaultsFillerParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::opencv_caffe::FillerParameter::_default_type_.DefaultConstruct();
-  *::opencv_caffe::FillerParameter::_default_type_.get_mutable() = ::std::string("constant", 8);
-  ::google::protobuf::internal::OnShutdownDestroyString(
-      ::opencv_caffe::FillerParameter::_default_type_.get_mutable());
-  {
-    void* ptr = &::opencv_caffe::_FillerParameter_default_instance_;
-    new (ptr) ::opencv_caffe::FillerParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::FillerParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsFillerParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFillerParameterImpl);
-}
-
-void InitDefaultsNetParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShape();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetState();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsLayerParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsV1LayerParameter();
-  {
-    void* ptr = &::opencv_caffe::_NetParameter_default_instance_;
-    new (ptr) ::opencv_caffe::NetParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::NetParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsNetParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNetParameterImpl);
-}
-
-void InitDefaultsSolverParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetState();
-  ::opencv_caffe::SolverParameter::_default_regularization_type_.DefaultConstruct();
-  *::opencv_caffe::SolverParameter::_default_regularization_type_.get_mutable() = ::std::string("L2", 2);
-  ::google::protobuf::internal::OnShutdownDestroyString(
-      ::opencv_caffe::SolverParameter::_default_regularization_type_.get_mutable());
-  ::opencv_caffe::SolverParameter::_default_type_.DefaultConstruct();
-  *::opencv_caffe::SolverParameter::_default_type_.get_mutable() = ::std::string("SGD", 3);
-  ::google::protobuf::internal::OnShutdownDestroyString(
-      ::opencv_caffe::SolverParameter::_default_type_.get_mutable());
-  {
-    void* ptr = &::opencv_caffe::_SolverParameter_default_instance_;
-    new (ptr) ::opencv_caffe::SolverParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::SolverParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsSolverParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSolverParameterImpl);
-}
-
-void InitDefaultsSolverStateImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProto();
-  {
-    void* ptr = &::opencv_caffe::_SolverState_default_instance_;
-    new (ptr) ::opencv_caffe::SolverState();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::SolverState::InitAsDefaultInstance();
-}
-
-void InitDefaultsSolverState() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSolverStateImpl);
-}
-
-void InitDefaultsNetStateImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_NetState_default_instance_;
-    new (ptr) ::opencv_caffe::NetState();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::NetState::InitAsDefaultInstance();
-}
-
-void InitDefaultsNetState() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNetStateImpl);
-}
-
-void InitDefaultsNetStateRuleImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_NetStateRule_default_instance_;
-    new (ptr) ::opencv_caffe::NetStateRule();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::NetStateRule::InitAsDefaultInstance();
-}
-
-void InitDefaultsNetStateRule() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNetStateRuleImpl);
-}
-
-void InitDefaultsParamSpecImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ParamSpec_default_instance_;
-    new (ptr) ::opencv_caffe::ParamSpec();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ParamSpec::InitAsDefaultInstance();
-}
-
-void InitDefaultsParamSpec() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsParamSpecImpl);
-}
-
-void InitDefaultsLayerParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsParamSpec();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProto();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetStateRule();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsTransformationParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsLossParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsAccuracyParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsArgMaxParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBatchNormParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBiasParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsConcatParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsContrastiveLossParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsConvolutionParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsCropParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsDetectionOutputParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsDropoutParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsDummyDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsEltwiseParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsELUParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsEmbedParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsExpParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFlattenParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5DataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5OutputParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsHingeLossParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsImageDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsInfogainLossParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsInnerProductParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsInputParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsLogParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsLRNParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsMemoryDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsMVNParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsNormalizeBBoxParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPermuteParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsParameterParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPoolingParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPowerParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPReLUParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPriorBoxParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsProposalParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPSROIPoolingParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPythonParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsRecurrentParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsReductionParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsReLUParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsReshapeParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsROIPoolingParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsScaleParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsSigmoidParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsSoftmaxParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsSPPParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsSliceParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsTanHParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsThresholdParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsTileParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsWindowDataParameter();
-  {
-    void* ptr = &::opencv_caffe::_LayerParameter_default_instance_;
-    new (ptr) ::opencv_caffe::LayerParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::LayerParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsLayerParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsLayerParameterImpl);
-}
-
-void InitDefaultsTransformationParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_TransformationParameter_default_instance_;
-    new (ptr) ::opencv_caffe::TransformationParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::TransformationParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsTransformationParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTransformationParameterImpl);
-}
-
-void InitDefaultsLossParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_LossParameter_default_instance_;
-    new (ptr) ::opencv_caffe::LossParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::LossParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsLossParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsLossParameterImpl);
-}
-
-void InitDefaultsAccuracyParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_AccuracyParameter_default_instance_;
-    new (ptr) ::opencv_caffe::AccuracyParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::AccuracyParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsAccuracyParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsAccuracyParameterImpl);
-}
-
-void InitDefaultsArgMaxParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ArgMaxParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ArgMaxParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ArgMaxParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsArgMaxParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsArgMaxParameterImpl);
-}
-
-void InitDefaultsConcatParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ConcatParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ConcatParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ConcatParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsConcatParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsConcatParameterImpl);
-}
-
-void InitDefaultsBatchNormParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_BatchNormParameter_default_instance_;
-    new (ptr) ::opencv_caffe::BatchNormParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::BatchNormParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsBatchNormParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBatchNormParameterImpl);
-}
-
-void InitDefaultsBiasParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  {
-    void* ptr = &::opencv_caffe::_BiasParameter_default_instance_;
-    new (ptr) ::opencv_caffe::BiasParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::BiasParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsBiasParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBiasParameterImpl);
-}
-
-void InitDefaultsContrastiveLossParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ContrastiveLossParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ContrastiveLossParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ContrastiveLossParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsContrastiveLossParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsContrastiveLossParameterImpl);
-}
-
-void InitDefaultsConvolutionParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  {
-    void* ptr = &::opencv_caffe::_ConvolutionParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ConvolutionParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ConvolutionParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsConvolutionParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsConvolutionParameterImpl);
-}
-
-void InitDefaultsCropParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_CropParameter_default_instance_;
-    new (ptr) ::opencv_caffe::CropParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::CropParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsCropParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsCropParameterImpl);
-}
-
-void InitDefaultsDataParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_DataParameter_default_instance_;
-    new (ptr) ::opencv_caffe::DataParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::DataParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsDataParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDataParameterImpl);
-}
-
-void InitDefaultsNonMaximumSuppressionParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_NonMaximumSuppressionParameter_default_instance_;
-    new (ptr) ::opencv_caffe::NonMaximumSuppressionParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::NonMaximumSuppressionParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsNonMaximumSuppressionParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNonMaximumSuppressionParameterImpl);
-}
-
-void InitDefaultsSaveOutputParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_SaveOutputParameter_default_instance_;
-    new (ptr) ::opencv_caffe::SaveOutputParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::SaveOutputParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsSaveOutputParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSaveOutputParameterImpl);
-}
-
-void InitDefaultsDropoutParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_DropoutParameter_default_instance_;
-    new (ptr) ::opencv_caffe::DropoutParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::DropoutParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsDropoutParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDropoutParameterImpl);
-}
-
-void InitDefaultsDummyDataParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShape();
-  {
-    void* ptr = &::opencv_caffe::_DummyDataParameter_default_instance_;
-    new (ptr) ::opencv_caffe::DummyDataParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::DummyDataParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsDummyDataParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDummyDataParameterImpl);
-}
-
-void InitDefaultsEltwiseParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_EltwiseParameter_default_instance_;
-    new (ptr) ::opencv_caffe::EltwiseParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::EltwiseParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsEltwiseParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEltwiseParameterImpl);
-}
-
-void InitDefaultsELUParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ELUParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ELUParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ELUParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsELUParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsELUParameterImpl);
-}
-
-void InitDefaultsEmbedParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  {
-    void* ptr = &::opencv_caffe::_EmbedParameter_default_instance_;
-    new (ptr) ::opencv_caffe::EmbedParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::EmbedParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsEmbedParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEmbedParameterImpl);
-}
-
-void InitDefaultsExpParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ExpParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ExpParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ExpParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsExpParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsExpParameterImpl);
-}
-
-void InitDefaultsFlattenParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_FlattenParameter_default_instance_;
-    new (ptr) ::opencv_caffe::FlattenParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::FlattenParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsFlattenParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFlattenParameterImpl);
-}
-
-void InitDefaultsHDF5DataParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_HDF5DataParameter_default_instance_;
-    new (ptr) ::opencv_caffe::HDF5DataParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::HDF5DataParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsHDF5DataParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsHDF5DataParameterImpl);
-}
-
-void InitDefaultsHDF5OutputParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_HDF5OutputParameter_default_instance_;
-    new (ptr) ::opencv_caffe::HDF5OutputParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::HDF5OutputParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsHDF5OutputParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsHDF5OutputParameterImpl);
-}
-
-void InitDefaultsHingeLossParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_HingeLossParameter_default_instance_;
-    new (ptr) ::opencv_caffe::HingeLossParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::HingeLossParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsHingeLossParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsHingeLossParameterImpl);
-}
-
-void InitDefaultsImageDataParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ImageDataParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ImageDataParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ImageDataParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsImageDataParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsImageDataParameterImpl);
-}
-
-void InitDefaultsInfogainLossParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_InfogainLossParameter_default_instance_;
-    new (ptr) ::opencv_caffe::InfogainLossParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::InfogainLossParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsInfogainLossParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsInfogainLossParameterImpl);
-}
-
-void InitDefaultsInnerProductParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  {
-    void* ptr = &::opencv_caffe::_InnerProductParameter_default_instance_;
-    new (ptr) ::opencv_caffe::InnerProductParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::InnerProductParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsInnerProductParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsInnerProductParameterImpl);
-}
-
-void InitDefaultsInputParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShape();
-  {
-    void* ptr = &::opencv_caffe::_InputParameter_default_instance_;
-    new (ptr) ::opencv_caffe::InputParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::InputParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsInputParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsInputParameterImpl);
-}
-
-void InitDefaultsLogParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_LogParameter_default_instance_;
-    new (ptr) ::opencv_caffe::LogParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::LogParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsLogParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsLogParameterImpl);
-}
-
-void InitDefaultsLRNParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_LRNParameter_default_instance_;
-    new (ptr) ::opencv_caffe::LRNParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::LRNParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsLRNParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsLRNParameterImpl);
-}
-
-void InitDefaultsMemoryDataParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_MemoryDataParameter_default_instance_;
-    new (ptr) ::opencv_caffe::MemoryDataParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::MemoryDataParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsMemoryDataParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMemoryDataParameterImpl);
-}
-
-void InitDefaultsMVNParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_MVNParameter_default_instance_;
-    new (ptr) ::opencv_caffe::MVNParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::MVNParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsMVNParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMVNParameterImpl);
-}
-
-void InitDefaultsParameterParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShape();
-  {
-    void* ptr = &::opencv_caffe::_ParameterParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ParameterParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ParameterParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsParameterParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsParameterParameterImpl);
-}
-
-void InitDefaultsPoolingParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_PoolingParameter_default_instance_;
-    new (ptr) ::opencv_caffe::PoolingParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::PoolingParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsPoolingParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsPoolingParameterImpl);
-}
-
-void InitDefaultsPowerParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_PowerParameter_default_instance_;
-    new (ptr) ::opencv_caffe::PowerParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::PowerParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsPowerParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsPowerParameterImpl);
-}
-
-void InitDefaultsPythonParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_PythonParameter_default_instance_;
-    new (ptr) ::opencv_caffe::PythonParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::PythonParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsPythonParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsPythonParameterImpl);
-}
-
-void InitDefaultsRecurrentParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  {
-    void* ptr = &::opencv_caffe::_RecurrentParameter_default_instance_;
-    new (ptr) ::opencv_caffe::RecurrentParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::RecurrentParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsRecurrentParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsRecurrentParameterImpl);
-}
-
-void InitDefaultsReductionParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ReductionParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ReductionParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ReductionParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsReductionParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsReductionParameterImpl);
-}
-
-void InitDefaultsReLUParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ReLUParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ReLUParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ReLUParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsReLUParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsReLUParameterImpl);
-}
-
-void InitDefaultsReshapeParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShape();
-  {
-    void* ptr = &::opencv_caffe::_ReshapeParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ReshapeParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ReshapeParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsReshapeParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsReshapeParameterImpl);
-}
-
-void InitDefaultsScaleParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  {
-    void* ptr = &::opencv_caffe::_ScaleParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ScaleParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ScaleParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsScaleParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsScaleParameterImpl);
-}
-
-void InitDefaultsSigmoidParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_SigmoidParameter_default_instance_;
-    new (ptr) ::opencv_caffe::SigmoidParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::SigmoidParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsSigmoidParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSigmoidParameterImpl);
-}
-
-void InitDefaultsSliceParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_SliceParameter_default_instance_;
-    new (ptr) ::opencv_caffe::SliceParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::SliceParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsSliceParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSliceParameterImpl);
-}
-
-void InitDefaultsSoftmaxParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_SoftmaxParameter_default_instance_;
-    new (ptr) ::opencv_caffe::SoftmaxParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::SoftmaxParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsSoftmaxParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSoftmaxParameterImpl);
-}
-
-void InitDefaultsTanHParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_TanHParameter_default_instance_;
-    new (ptr) ::opencv_caffe::TanHParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::TanHParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsTanHParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTanHParameterImpl);
-}
-
-void InitDefaultsTileParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_TileParameter_default_instance_;
-    new (ptr) ::opencv_caffe::TileParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::TileParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsTileParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTileParameterImpl);
-}
-
-void InitDefaultsThresholdParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ThresholdParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ThresholdParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ThresholdParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsThresholdParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsThresholdParameterImpl);
-}
-
-void InitDefaultsWindowDataParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::opencv_caffe::WindowDataParameter::_default_crop_mode_.DefaultConstruct();
-  *::opencv_caffe::WindowDataParameter::_default_crop_mode_.get_mutable() = ::std::string("warp", 4);
-  ::google::protobuf::internal::OnShutdownDestroyString(
-      ::opencv_caffe::WindowDataParameter::_default_crop_mode_.get_mutable());
-  {
-    void* ptr = &::opencv_caffe::_WindowDataParameter_default_instance_;
-    new (ptr) ::opencv_caffe::WindowDataParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::WindowDataParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsWindowDataParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsWindowDataParameterImpl);
-}
-
-void InitDefaultsSPPParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_SPPParameter_default_instance_;
-    new (ptr) ::opencv_caffe::SPPParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::SPPParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsSPPParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSPPParameterImpl);
-}
-
-void InitDefaultsV1LayerParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetStateRule();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProto();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsAccuracyParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsArgMaxParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsConcatParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsContrastiveLossParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsConvolutionParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsDropoutParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsDummyDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsEltwiseParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsExpParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5DataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5OutputParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsHingeLossParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsImageDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsInfogainLossParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsInnerProductParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsLRNParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsMemoryDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsMVNParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPoolingParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsPowerParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsReLUParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsSigmoidParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsSoftmaxParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsSliceParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsTanHParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsThresholdParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsWindowDataParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsTransformationParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsLossParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsV0LayerParameter();
-  {
-    void* ptr = &::opencv_caffe::_V1LayerParameter_default_instance_;
-    new (ptr) ::opencv_caffe::V1LayerParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::V1LayerParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsV1LayerParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsV1LayerParameterImpl);
-}
-
-void InitDefaultsV0LayerParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProto();
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5OutputParameter();
-  ::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.DefaultConstruct();
-  *::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get_mutable() = ::std::string("warp", 4);
-  ::google::protobuf::internal::OnShutdownDestroyString(
-      ::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get_mutable());
-  {
-    void* ptr = &::opencv_caffe::_V0LayerParameter_default_instance_;
-    new (ptr) ::opencv_caffe::V0LayerParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::V0LayerParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsV0LayerParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsV0LayerParameterImpl);
-}
-
-void InitDefaultsPReLUParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  {
-    void* ptr = &::opencv_caffe::_PReLUParameter_default_instance_;
-    new (ptr) ::opencv_caffe::PReLUParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::PReLUParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsPReLUParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsPReLUParameterImpl);
-}
-
-void InitDefaultsNormalizedBBoxImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_NormalizedBBox_default_instance_;
-    new (ptr) ::opencv_caffe::NormalizedBBox();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::NormalizedBBox::InitAsDefaultInstance();
-}
-
-void InitDefaultsNormalizedBBox() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNormalizedBBoxImpl);
-}
-
-void InitDefaultsROIPoolingParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ROIPoolingParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ROIPoolingParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ROIPoolingParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsROIPoolingParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsROIPoolingParameterImpl);
-}
-
-void InitDefaultsProposalParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_ProposalParameter_default_instance_;
-    new (ptr) ::opencv_caffe::ProposalParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::ProposalParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsProposalParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsProposalParameterImpl);
-}
-
-void InitDefaultsPSROIPoolingParameterImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_caffe::_PSROIPoolingParameter_default_instance_;
-    new (ptr) ::opencv_caffe::PSROIPoolingParameter();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_caffe::PSROIPoolingParameter::InitAsDefaultInstance();
-}
-
-void InitDefaultsPSROIPoolingParameter() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsPSROIPoolingParameterImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[71];
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[27];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobShape, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobShape, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobShape, dim_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, shape_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, diff_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, double_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, double_diff_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, raw_data_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, raw_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, num_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, channels_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, height_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProto, width_),
-  1,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  6,
-  0,
-  2,
-  3,
-  4,
-  5,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProtoVector, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProtoVector, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BlobProtoVector, blobs_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PermuteParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PermuteParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PermuteParameter, order_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, across_spatial_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, scale_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, channel_shared_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, eps_),
-  1,
-  0,
-  2,
-  3,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, min_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, max_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, aspect_ratio_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, flip_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, clip_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, variance_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, img_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, img_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, img_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, step_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, step_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, step_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, offset_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, offset_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, offset_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, width_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, height_),
-  ~0u,
-  ~0u,
-  ~0u,
-  6,
-  7,
-  ~0u,
-  0,
-  1,
-  2,
-  3,
-  4,
-  5,
-  8,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, num_classes_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, share_location_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, background_label_id_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, nms_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, save_output_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, code_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, variance_encoded_in_target_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, keep_top_k_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, confidence_threshold_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, normalized_bbox_),
-  2,
-  8,
-  3,
-  0,
-  1,
-  7,
-  4,
-  6,
-  5,
-  9,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, channels_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, height_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, width_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, label_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, float_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::Datum, encoded_),
-  1,
-  2,
-  3,
-  0,
-  4,
-  ~0u,
-  5,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, min_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, max_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, mean_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, std_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, sparse_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FillerParameter, variance_norm_),
-  0,
-  1,
-  2,
-  6,
-  3,
-  7,
-  5,
-  4,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, input_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, input_shape_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, input_dim_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, force_backward_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, state_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, debug_info_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, layer_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetParameter, layers_),
-  0,
-  ~0u,
-  ~0u,
-  ~0u,
-  2,
-  1,
-  3,
-  ~0u,
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, net_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, net_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, train_net_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_net_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, train_net_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_net_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, train_state_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_state_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_iter_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_interval_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_compute_loss_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_initialization_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, base_lr_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, display_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, average_loss_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, max_iter_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, iter_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, lr_policy_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, gamma_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, power_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, momentum_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, weight_decay_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, regularization_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, stepsize_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, stepvalue_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, clip_gradients_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_prefix_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_diff_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_format_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, solver_mode_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, device_id_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, random_seed_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, delta_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, momentum2_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, rms_decay_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, debug_info_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_after_train_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverParameter, solver_type_),
-  3,
-  7,
-  0,
-  ~0u,
-  6,
-  ~0u,
-  8,
-  ~0u,
-  ~0u,
-  9,
-  20,
-  27,
-  10,
-  11,
-  30,
-  12,
-  32,
-  1,
-  13,
-  14,
-  15,
-  16,
-  4,
-  17,
-  ~0u,
-  31,
-  18,
-  2,
-  21,
-  33,
-  26,
-  19,
-  25,
-  5,
-  29,
-  24,
-  34,
-  22,
-  28,
-  23,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverState, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverState, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverState, iter_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverState, learned_net_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverState, history_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SolverState, current_step_),
-  1,
-  0,
-  ~0u,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetState, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetState, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetState, phase_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetState, level_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetState, stage_),
-  1,
-  0,
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetStateRule, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetStateRule, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetStateRule, phase_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetStateRule, min_level_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetStateRule, max_level_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetStateRule, stage_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NetStateRule, not_stage_),
-  0,
-  1,
-  2,
-  ~0u,
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParamSpec, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParamSpec, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParamSpec, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParamSpec, share_mode_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParamSpec, lr_mult_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParamSpec, decay_mult_),
-  0,
-  1,
-  2,
-  3,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, bottom_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, top_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, phase_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, loss_weight_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, blobs_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, propagate_down_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, include_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, exclude_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, transform_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, loss_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, accuracy_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, argmax_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, batch_norm_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, bias_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, concat_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, contrastive_loss_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, convolution_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, crop_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, detection_output_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, dropout_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, dummy_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, eltwise_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, elu_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, embed_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, exp_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, flatten_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, hdf5_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, hdf5_output_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, hinge_loss_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, image_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, infogain_loss_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, inner_product_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, input_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, log_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, lrn_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, memory_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, mvn_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, norm_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, permute_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, parameter_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, pooling_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, power_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, prelu_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, prior_box_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, proposal_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, psroi_pooling_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, python_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, recurrent_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, reduction_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, relu_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, reshape_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, roi_pooling_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, scale_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, sigmoid_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, softmax_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, spp_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, slice_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, tanh_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, threshold_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, tile_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LayerParameter, window_data_param_),
-  0,
-  1,
-  ~0u,
-  ~0u,
-  56,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  2,
-  3,
-  4,
-  5,
-  41,
-  43,
-  6,
-  7,
-  8,
-  46,
-  9,
-  49,
-  10,
-  11,
-  12,
-  42,
-  39,
-  13,
-  37,
-  14,
-  15,
-  16,
-  17,
-  18,
-  19,
-  45,
-  36,
-  20,
-  21,
-  22,
-  51,
-  50,
-  47,
-  23,
-  24,
-  33,
-  52,
-  53,
-  54,
-  32,
-  48,
-  38,
-  25,
-  35,
-  55,
-  44,
-  26,
-  27,
-  34,
-  28,
-  29,
-  30,
-  40,
-  31,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, mirror_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, crop_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, mean_file_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, mean_value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, force_color_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TransformationParameter, force_gray_),
-  5,
-  2,
-  1,
-  0,
-  ~0u,
-  3,
-  4,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LossParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LossParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LossParameter, ignore_label_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LossParameter, normalization_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LossParameter, normalize_),
-  0,
-  2,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, top_k_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, ignore_label_),
-  1,
-  2,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, out_max_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, top_k_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, axis_),
-  0,
-  2,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConcatParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConcatParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConcatParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConcatParameter, concat_dim_),
-  1,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, use_global_stats_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, moving_average_fraction_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, eps_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, scale_bias_),
-  0,
-  2,
-  3,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BiasParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BiasParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BiasParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BiasParameter, num_axes_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::BiasParameter, filler_),
-  1,
-  2,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ContrastiveLossParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ContrastiveLossParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ContrastiveLossParameter, margin_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ContrastiveLossParameter, legacy_version_),
-  1,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, num_output_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, bias_term_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, pad_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, kernel_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, stride_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, dilation_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, pad_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, pad_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, kernel_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, kernel_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, stride_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, stride_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, group_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, weight_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, bias_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, engine_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, force_nd_im2col_),
-  2,
-  12,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  3,
-  4,
-  5,
-  6,
-  7,
-  8,
-  13,
-  0,
-  1,
-  9,
-  11,
-  10,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::CropParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::CropParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::CropParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::CropParameter, offset_),
-  0,
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, source_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, batch_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, rand_skip_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, backend_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, mean_file_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, crop_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, mirror_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, force_encoded_color_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DataParameter, prefetch_),
-  0,
-  2,
-  4,
-  7,
-  8,
-  1,
-  3,
-  5,
-  6,
-  9,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, nms_threshold_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, top_k_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, eta_),
-  1,
-  0,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, output_directory_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, output_name_prefix_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, output_format_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, label_map_file_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, name_size_file_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, num_test_image_),
-  0,
-  1,
-  2,
-  3,
-  4,
-  5,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DropoutParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DropoutParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DropoutParameter, dropout_ratio_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DropoutParameter, scale_train_),
-  0,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, data_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, shape_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, num_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, channels_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, height_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, width_),
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, operation_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, coeff_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, stable_prod_grad_),
-  0,
-  ~0u,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ELUParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ELUParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ELUParameter, alpha_),
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EmbedParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EmbedParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EmbedParameter, num_output_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EmbedParameter, input_dim_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EmbedParameter, bias_term_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EmbedParameter, weight_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::EmbedParameter, bias_filler_),
-  2,
-  3,
-  4,
-  0,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ExpParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ExpParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ExpParameter, base_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ExpParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ExpParameter, shift_),
-  1,
-  2,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FlattenParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FlattenParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FlattenParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::FlattenParameter, end_axis_),
-  0,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, source_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, batch_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, shuffle_),
-  0,
-  1,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HDF5OutputParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HDF5OutputParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HDF5OutputParameter, file_name_),
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HingeLossParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HingeLossParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::HingeLossParameter, norm_),
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, source_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, batch_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, rand_skip_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, shuffle_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, new_height_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, new_width_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, is_color_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, mean_file_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, crop_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, mirror_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, root_folder_),
-  0,
-  11,
-  4,
-  5,
-  7,
-  8,
-  9,
-  10,
-  1,
-  3,
-  6,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InfogainLossParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InfogainLossParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InfogainLossParameter, source_),
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, num_output_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, bias_term_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, weight_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, bias_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, transpose_),
-  2,
-  4,
-  0,
-  1,
-  5,
-  3,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InputParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InputParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::InputParameter, shape_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LogParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LogParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LogParameter, base_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LogParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LogParameter, shift_),
-  1,
-  2,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LRNParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LRNParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LRNParameter, local_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LRNParameter, alpha_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LRNParameter, beta_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LRNParameter, norm_region_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LRNParameter, k_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::LRNParameter, engine_),
-  2,
-  3,
-  4,
-  0,
-  5,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, batch_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, channels_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, height_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, width_),
-  0,
-  1,
-  2,
-  3,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MVNParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MVNParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MVNParameter, normalize_variance_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MVNParameter, across_channels_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::MVNParameter, eps_),
-  1,
-  0,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParameterParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParameterParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ParameterParameter, shape_),
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, pool_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, pad_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, pad_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, pad_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, kernel_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, kernel_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, kernel_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, stride_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, stride_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, stride_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, engine_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, global_pooling_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PoolingParameter, ceil_mode_),
-  0,
-  2,
-  7,
-  8,
-  1,
-  3,
-  4,
-  11,
-  5,
-  6,
-  9,
-  10,
-  12,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PowerParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PowerParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PowerParameter, power_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PowerParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PowerParameter, shift_),
-  1,
-  2,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PythonParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PythonParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PythonParameter, module_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PythonParameter, layer_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PythonParameter, param_str_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PythonParameter, share_in_parallel_),
-  0,
-  1,
-  2,
-  3,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, num_output_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, weight_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, bias_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, debug_info_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, expose_hidden_),
-  2,
-  0,
-  1,
-  3,
-  4,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReductionParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReductionParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReductionParameter, operation_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReductionParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReductionParameter, coeff_),
-  1,
-  0,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReLUParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReLUParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReLUParameter, negative_slope_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReLUParameter, engine_),
-  0,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, shape_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, num_axes_),
-  0,
-  1,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ScaleParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ScaleParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ScaleParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ScaleParameter, num_axes_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ScaleParameter, filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ScaleParameter, bias_term_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ScaleParameter, bias_filler_),
-  3,
-  4,
-  0,
-  2,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SigmoidParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SigmoidParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SigmoidParameter, engine_),
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SliceParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SliceParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SliceParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SliceParameter, slice_point_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SliceParameter, slice_dim_),
-  1,
-  ~0u,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SoftmaxParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SoftmaxParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SoftmaxParameter, engine_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SoftmaxParameter, axis_),
-  0,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TanHParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TanHParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TanHParameter, engine_),
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TileParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TileParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TileParameter, axis_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::TileParameter, tiles_),
-  1,
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ThresholdParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ThresholdParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ThresholdParameter, threshold_),
-  0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, source_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, mean_file_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, batch_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, crop_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, mirror_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, fg_threshold_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, bg_threshold_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, fg_fraction_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, context_pad_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, crop_mode_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, cache_images_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, root_folder_),
-  0,
-  9,
-  1,
-  4,
-  5,
-  6,
-  10,
-  11,
-  12,
-  8,
-  2,
-  7,
-  3,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SPPParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SPPParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SPPParameter, pyramid_height_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SPPParameter, pool_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::SPPParameter, engine_),
-  0,
-  1,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, bottom_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, top_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, include_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, exclude_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, blobs_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, blob_share_mode_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, blobs_lr_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, weight_decay_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, loss_weight_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, accuracy_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, argmax_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, concat_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, contrastive_loss_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, convolution_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, dropout_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, dummy_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, eltwise_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, exp_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, hdf5_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, hdf5_output_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, hinge_loss_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, image_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, infogain_loss_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, inner_product_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, lrn_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, memory_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, mvn_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, pooling_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, power_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, relu_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, sigmoid_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, softmax_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, slice_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, tanh_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, threshold_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, window_data_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, transform_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, loss_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, layer_),
-  ~0u,
-  ~0u,
-  0,
-  ~0u,
-  ~0u,
-  32,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  ~0u,
-  20,
-  16,
-  2,
-  29,
-  3,
-  4,
-  5,
-  19,
-  17,
-  30,
-  6,
-  7,
-  21,
-  8,
-  9,
-  10,
-  11,
-  15,
-  24,
-  12,
-  14,
-  22,
-  27,
-  28,
-  23,
-  26,
-  18,
-  13,
-  25,
-  31,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, num_output_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, biasterm_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, weight_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, bias_filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, pad_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, kernelsize_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, group_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, stride_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, pool_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, dropout_ratio_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, local_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, alpha_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, beta_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, k_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, source_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, meanfile_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, batchsize_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, cropsize_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, mirror_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, blobs_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, blobs_lr_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, weight_decay_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, rand_skip_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_fg_threshold_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_bg_threshold_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_fg_fraction_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_context_pad_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_crop_mode_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, new_num_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, new_channels_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, new_height_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, new_width_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, shuffle_images_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, concat_dim_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, hdf5_output_param_),
-  0,
-  1,
-  8,
-  23,
-  5,
-  6,
-  9,
-  10,
-  24,
-  25,
-  11,
-  26,
-  27,
-  28,
-  29,
-  31,
-  2,
-  30,
-  3,
-  12,
-  13,
-  15,
-  ~0u,
-  ~0u,
-  ~0u,
-  17,
-  32,
-  33,
-  34,
-  18,
-  4,
-  19,
-  20,
-  21,
-  14,
-  16,
-  22,
-  7,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PReLUParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PReLUParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PReLUParameter, filler_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PReLUParameter, channel_shared_),
-  0,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, xmin_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, ymin_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, xmax_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, ymax_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, label_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, difficult_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, score_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, size_),
-  0,
-  1,
-  2,
-  3,
-  4,
-  5,
-  6,
-  7,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, pooled_h_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, pooled_w_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, spatial_scale_),
-  0,
-  1,
-  2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, feat_stride_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, base_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, min_size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, ratio_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, pre_nms_topn_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, post_nms_topn_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::ProposalParameter, nms_thresh_),
-  0,
-  1,
-  2,
-  ~0u,
-  ~0u,
-  3,
-  4,
-  5,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, spatial_scale_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, output_dim_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, group_size_),
-  0,
-  1,
-  2,
-};
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 6, sizeof(::opencv_caffe::BlobShape)},
-  { 7, 23, sizeof(::opencv_caffe::BlobProto)},
-  { 34, 40, sizeof(::opencv_caffe::BlobProtoVector)},
-  { 41, 47, sizeof(::opencv_caffe::PermuteParameter)},
-  { 48, 57, sizeof(::opencv_caffe::NormalizeBBoxParameter)},
-  { 61, 83, sizeof(::opencv_caffe::PriorBoxParameter)},
-  { 100, 115, sizeof(::opencv_caffe::DetectionOutputParameter)},
-  { 125, 137, sizeof(::opencv_caffe::Datum)},
-  { 144, 157, sizeof(::opencv_caffe::FillerParameter)},
-  { 165, 179, sizeof(::opencv_caffe::NetParameter)},
-  { 188, 233, sizeof(::opencv_caffe::SolverParameter)},
-  { 273, 282, sizeof(::opencv_caffe::SolverState)},
-  { 286, 294, sizeof(::opencv_caffe::NetState)},
-  { 297, 307, sizeof(::opencv_caffe::NetStateRule)},
-  { 312, 321, sizeof(::opencv_caffe::ParamSpec)},
-  { 325, 395, sizeof(::opencv_caffe::LayerParameter)},
-  { 460, 472, sizeof(::opencv_caffe::TransformationParameter)},
-  { 479, 487, sizeof(::opencv_caffe::LossParameter)},
-  { 490, 498, sizeof(::opencv_caffe::AccuracyParameter)},
-  { 501, 509, sizeof(::opencv_caffe::ArgMaxParameter)},
-  { 512, 519, sizeof(::opencv_caffe::ConcatParameter)},
-  { 521, 530, sizeof(::opencv_caffe::BatchNormParameter)},
-  { 534, 542, sizeof(::opencv_caffe::BiasParameter)},
-  { 545, 552, sizeof(::opencv_caffe::ContrastiveLossParameter)},
-  { 554, 577, sizeof(::opencv_caffe::ConvolutionParameter)},
-  { 595, 602, sizeof(::opencv_caffe::CropParameter)},
-  { 604, 619, sizeof(::opencv_caffe::DataParameter)},
-  { 629, 637, sizeof(::opencv_caffe::NonMaximumSuppressionParameter)},
-  { 640, 651, sizeof(::opencv_caffe::SaveOutputParameter)},
-  { 657, 664, sizeof(::opencv_caffe::DropoutParameter)},
-  { 666, 677, sizeof(::opencv_caffe::DummyDataParameter)},
-  { 683, 691, sizeof(::opencv_caffe::EltwiseParameter)},
-  { 694, 700, sizeof(::opencv_caffe::ELUParameter)},
-  { 701, 711, sizeof(::opencv_caffe::EmbedParameter)},
-  { 716, 724, sizeof(::opencv_caffe::ExpParameter)},
-  { 727, 734, sizeof(::opencv_caffe::FlattenParameter)},
-  { 736, 744, sizeof(::opencv_caffe::HDF5DataParameter)},
-  { 747, 753, sizeof(::opencv_caffe::HDF5OutputParameter)},
-  { 754, 760, sizeof(::opencv_caffe::HingeLossParameter)},
-  { 761, 778, sizeof(::opencv_caffe::ImageDataParameter)},
-  { 790, 796, sizeof(::opencv_caffe::InfogainLossParameter)},
-  { 797, 808, sizeof(::opencv_caffe::InnerProductParameter)},
-  { 814, 820, sizeof(::opencv_caffe::InputParameter)},
-  { 821, 829, sizeof(::opencv_caffe::LogParameter)},
-  { 832, 843, sizeof(::opencv_caffe::LRNParameter)},
-  { 849, 858, sizeof(::opencv_caffe::MemoryDataParameter)},
-  { 862, 870, sizeof(::opencv_caffe::MVNParameter)},
-  { 873, 879, sizeof(::opencv_caffe::ParameterParameter)},
-  { 880, 898, sizeof(::opencv_caffe::PoolingParameter)},
-  { 911, 919, sizeof(::opencv_caffe::PowerParameter)},
-  { 922, 931, sizeof(::opencv_caffe::PythonParameter)},
-  { 935, 945, sizeof(::opencv_caffe::RecurrentParameter)},
-  { 950, 958, sizeof(::opencv_caffe::ReductionParameter)},
-  { 961, 968, sizeof(::opencv_caffe::ReLUParameter)},
-  { 970, 978, sizeof(::opencv_caffe::ReshapeParameter)},
-  { 981, 991, sizeof(::opencv_caffe::ScaleParameter)},
-  { 996, 1002, sizeof(::opencv_caffe::SigmoidParameter)},
-  { 1003, 1011, sizeof(::opencv_caffe::SliceParameter)},
-  { 1014, 1021, sizeof(::opencv_caffe::SoftmaxParameter)},
-  { 1023, 1029, sizeof(::opencv_caffe::TanHParameter)},
-  { 1030, 1037, sizeof(::opencv_caffe::TileParameter)},
-  { 1039, 1045, sizeof(::opencv_caffe::ThresholdParameter)},
-  { 1046, 1064, sizeof(::opencv_caffe::WindowDataParameter)},
-  { 1077, 1085, sizeof(::opencv_caffe::SPPParameter)},
-  { 1088, 1136, sizeof(::opencv_caffe::V1LayerParameter)},
-  { 1179, 1222, sizeof(::opencv_caffe::V0LayerParameter)},
-  { 1260, 1267, sizeof(::opencv_caffe::PReLUParameter)},
-  { 1269, 1282, sizeof(::opencv_caffe::NormalizedBBox)},
-  { 1290, 1298, sizeof(::opencv_caffe::ROIPoolingParameter)},
-  { 1301, 1314, sizeof(::opencv_caffe::ProposalParameter)},
-  { 1322, 1330, sizeof(::opencv_caffe::PSROIPoolingParameter)},
-};
-
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_BlobShape_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_BlobProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_BlobProtoVector_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_PermuteParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_NormalizeBBoxParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_PriorBoxParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_DetectionOutputParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_Datum_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_FillerParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_NetParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_SolverParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_SolverState_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_NetState_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_NetStateRule_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ParamSpec_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_LayerParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_TransformationParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_LossParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_AccuracyParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ArgMaxParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ConcatParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_BatchNormParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_BiasParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ContrastiveLossParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ConvolutionParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_CropParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_DataParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_NonMaximumSuppressionParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_SaveOutputParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_DropoutParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_DummyDataParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_EltwiseParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ELUParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_EmbedParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ExpParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_FlattenParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_HDF5DataParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_HDF5OutputParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_HingeLossParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ImageDataParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_InfogainLossParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_InnerProductParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_InputParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_LogParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_LRNParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_MemoryDataParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_MVNParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ParameterParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_PoolingParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_PowerParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_PythonParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_RecurrentParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ReductionParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ReLUParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ReshapeParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ScaleParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_SigmoidParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_SliceParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_SoftmaxParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_TanHParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_TileParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ThresholdParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_WindowDataParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_SPPParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_V1LayerParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_V0LayerParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_PReLUParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_NormalizedBBox_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ROIPoolingParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_ProposalParameter_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_caffe::_PSROIPoolingParameter_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "opencv-caffe.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, file_level_enum_descriptors, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 71);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\022opencv-caffe.proto\022\014opencv_caffe\"\034\n\tBl"
-      "obShape\022\017\n\003dim\030\001 \003(\003B\002\020\001\"\224\002\n\tBlobProto\022&"
-      "\n\005shape\030\007 \001(\0132\027.opencv_caffe.BlobShape\022\020"
-      "\n\004data\030\005 \003(\002B\002\020\001\022\020\n\004diff\030\006 \003(\002B\002\020\001\022\027\n\013do"
-      "uble_data\030\010 \003(\001B\002\020\001\022\027\n\013double_diff\030\t \003(\001"
-      "B\002\020\001\022)\n\rraw_data_type\030\n \001(\0162\022.opencv_caf"
-      "fe.Type\022\024\n\010raw_data\030\014 \001(\014B\002\020\000\022\016\n\003num\030\001 \001"
-      "(\005:\0010\022\023\n\010channels\030\002 \001(\005:\0010\022\021\n\006height\030\003 \001"
-      "(\005:\0010\022\020\n\005width\030\004 \001(\005:\0010\"9\n\017BlobProtoVect"
-      "or\022&\n\005blobs\030\001 \003(\0132\027.opencv_caffe.BlobPro"
-      "to\"!\n\020PermuteParameter\022\r\n\005order\030\001 \003(\r\"\235\001"
-      "\n\026NormalizeBBoxParameter\022\034\n\016across_spati"
-      "al\030\001 \001(\010:\004true\0223\n\014scale_filler\030\002 \001(\0132\035.o"
-      "pencv_caffe.FillerParameter\022\034\n\016channel_s"
-      "hared\030\003 \001(\010:\004true\022\022\n\003eps\030\004 \001(\002:\0051e-10\"\346\002"
-      "\n\021PriorBoxParameter\022\020\n\010min_size\030\001 \003(\002\022\020\n"
-      "\010max_size\030\002 \003(\002\022\024\n\014aspect_ratio\030\003 \003(\002\022\022\n"
-      "\004flip\030\004 \001(\010:\004true\022\022\n\004clip\030\005 \001(\010:\004true\022\020\n"
-      "\010variance\030\006 \003(\002\022\020\n\010img_size\030\007 \001(\r\022\r\n\005img"
-      "_h\030\010 \001(\r\022\r\n\005img_w\030\t \001(\r\022\014\n\004step\030\n \001(\002\022\016\n"
-      "\006step_h\030\013 \001(\002\022\016\n\006step_w\030\014 \001(\002\022\023\n\006offset\030"
-      "\r \001(\002:\0030.5\022\020\n\010offset_h\030\016 \003(\002\022\020\n\010offset_w"
-      "\030\017 \003(\002\022\r\n\005width\030\020 \003(\002\022\016\n\006height\030\021 \003(\002\"\'\n"
-      "\010CodeType\022\n\n\006CORNER\020\001\022\017\n\013CENTER_SIZE\020\002\"\261"
-      "\003\n\030DetectionOutputParameter\022\023\n\013num_class"
-      "es\030\001 \001(\r\022\034\n\016share_location\030\002 \001(\010:\004true\022\036"
-      "\n\023background_label_id\030\003 \001(\005:\0010\022\?\n\tnms_pa"
-      "ram\030\004 \001(\0132,.opencv_caffe.NonMaximumSuppr"
-      "essionParameter\022<\n\021save_output_param\030\005 \001"
-      "(\0132!.opencv_caffe.SaveOutputParameter\022C\n"
-      "\tcode_type\030\006 \001(\0162(.opencv_caffe.PriorBox"
-      "Parameter.CodeType:\006CORNER\022)\n\032variance_e"
-      "ncoded_in_target\030\010 \001(\010:\005false\022\026\n\nkeep_to"
-      "p_k\030\007 \001(\005:\002-1\022\034\n\024confidence_threshold\030\t "
-      "\001(\002\022\035\n\017normalized_bbox\030\n \001(\010:\004true\"\201\001\n\005D"
-      "atum\022\020\n\010channels\030\001 \001(\005\022\016\n\006height\030\002 \001(\005\022\r"
-      "\n\005width\030\003 \001(\005\022\014\n\004data\030\004 \001(\014\022\r\n\005label\030\005 \001"
-      "(\005\022\022\n\nfloat_data\030\006 \003(\002\022\026\n\007encoded\030\007 \001(\010:"
-      "\005false\"\221\002\n\017FillerParameter\022\026\n\004type\030\001 \001(\t"
-      ":\010constant\022\020\n\005value\030\002 \001(\002:\0010\022\016\n\003min\030\003 \001("
-      "\002:\0010\022\016\n\003max\030\004 \001(\002:\0011\022\017\n\004mean\030\005 \001(\002:\0010\022\016\n"
-      "\003std\030\006 \001(\002:\0011\022\022\n\006sparse\030\007 \001(\005:\002-1\022I\n\rvar"
-      "iance_norm\030\010 \001(\0162*.opencv_caffe.FillerPa"
-      "rameter.VarianceNorm:\006FAN_IN\"4\n\014Variance"
-      "Norm\022\n\n\006FAN_IN\020\000\022\013\n\007FAN_OUT\020\001\022\013\n\007AVERAGE"
-      "\020\002\"\252\002\n\014NetParameter\022\014\n\004name\030\001 \001(\t\022\r\n\005inp"
-      "ut\030\003 \003(\t\022,\n\013input_shape\030\010 \003(\0132\027.opencv_c"
-      "affe.BlobShape\022\021\n\tinput_dim\030\004 \003(\005\022\035\n\016for"
-      "ce_backward\030\005 \001(\010:\005false\022%\n\005state\030\006 \001(\0132"
-      "\026.opencv_caffe.NetState\022\031\n\ndebug_info\030\007 "
-      "\001(\010:\005false\022+\n\005layer\030d \003(\0132\034.opencv_caffe"
-      ".LayerParameter\022.\n\006layers\030\002 \003(\0132\036.opencv"
-      "_caffe.V1LayerParameter\"\332\n\n\017SolverParame"
-      "ter\022\013\n\003net\030\030 \001(\t\022-\n\tnet_param\030\031 \001(\0132\032.op"
-      "encv_caffe.NetParameter\022\021\n\ttrain_net\030\001 \001"
-      "(\t\022\020\n\010test_net\030\002 \003(\t\0223\n\017train_net_param\030"
-      "\025 \001(\0132\032.opencv_caffe.NetParameter\0222\n\016tes"
-      "t_net_param\030\026 \003(\0132\032.opencv_caffe.NetPara"
-      "meter\022+\n\013train_state\030\032 \001(\0132\026.opencv_caff"
-      "e.NetState\022*\n\ntest_state\030\033 \003(\0132\026.opencv_"
-      "caffe.NetState\022\021\n\ttest_iter\030\003 \003(\005\022\030\n\rtes"
-      "t_interval\030\004 \001(\005:\0010\022 \n\021test_compute_loss"
-      "\030\023 \001(\010:\005false\022!\n\023test_initialization\030  \001"
-      "(\010:\004true\022\017\n\007base_lr\030\005 \001(\002\022\017\n\007display\030\006 \001"
-      "(\005\022\027\n\014average_loss\030! \001(\005:\0011\022\020\n\010max_iter\030"
-      "\007 \001(\005\022\024\n\titer_size\030$ \001(\005:\0011\022\021\n\tlr_policy"
-      "\030\010 \001(\t\022\r\n\005gamma\030\t \001(\002\022\r\n\005power\030\n \001(\002\022\020\n\010"
-      "momentum\030\013 \001(\002\022\024\n\014weight_decay\030\014 \001(\002\022\037\n\023"
-      "regularization_type\030\035 \001(\t:\002L2\022\020\n\010stepsiz"
-      "e\030\r \001(\005\022\021\n\tstepvalue\030\" \003(\005\022\032\n\016clip_gradi"
-      "ents\030# \001(\002:\002-1\022\023\n\010snapshot\030\016 \001(\005:\0010\022\027\n\017s"
-      "napshot_prefix\030\017 \001(\t\022\034\n\rsnapshot_diff\030\020 "
-      "\001(\010:\005false\022R\n\017snapshot_format\030% \001(\0162,.op"
-      "encv_caffe.SolverParameter.SnapshotForma"
-      "t:\013BINARYPROTO\022B\n\013solver_mode\030\021 \001(\0162(.op"
-      "encv_caffe.SolverParameter.SolverMode:\003G"
-      "PU\022\024\n\tdevice_id\030\022 \001(\005:\0010\022\027\n\013random_seed\030"
-      "\024 \001(\003:\002-1\022\021\n\004type\030( \001(\t:\003SGD\022\024\n\005delta\030\037 "
-      "\001(\002:\0051e-08\022\030\n\tmomentum2\030\' \001(\002:\0050.999\022\027\n\t"
-      "rms_decay\030& \001(\002:\0040.99\022\031\n\ndebug_info\030\027 \001("
-      "\010:\005false\022\"\n\024snapshot_after_train\030\034 \001(\010:\004"
-      "true\022B\n\013solver_type\030\036 \001(\0162(.opencv_caffe"
-      ".SolverParameter.SolverType:\003SGD\"+\n\016Snap"
-      "shotFormat\022\010\n\004HDF5\020\000\022\017\n\013BINARYPROTO\020\001\"\036\n"
-      "\nSolverMode\022\007\n\003CPU\020\000\022\007\n\003GPU\020\001\"U\n\nSolverT"
-      "ype\022\007\n\003SGD\020\000\022\014\n\010NESTEROV\020\001\022\013\n\007ADAGRAD\020\002\022"
-      "\013\n\007RMSPROP\020\003\022\014\n\010ADADELTA\020\004\022\010\n\004ADAM\020\005\"s\n\013"
-      "SolverState\022\014\n\004iter\030\001 \001(\005\022\023\n\013learned_net"
-      "\030\002 \001(\t\022(\n\007history\030\003 \003(\0132\027.opencv_caffe.B"
-      "lobProto\022\027\n\014current_step\030\004 \001(\005:\0010\"U\n\010Net"
-      "State\022(\n\005phase\030\001 \001(\0162\023.opencv_caffe.Phas"
-      "e:\004TEST\022\020\n\005level\030\002 \001(\005:\0010\022\r\n\005stage\030\003 \003(\t"
-      "\"z\n\014NetStateRule\022\"\n\005phase\030\001 \001(\0162\023.opencv"
-      "_caffe.Phase\022\021\n\tmin_level\030\002 \001(\005\022\021\n\tmax_l"
-      "evel\030\003 \001(\005\022\r\n\005stage\030\004 \003(\t\022\021\n\tnot_stage\030\005"
-      " \003(\t\"\252\001\n\tParamSpec\022\014\n\004name\030\001 \001(\t\0228\n\nshar"
-      "e_mode\030\002 \001(\0162$.opencv_caffe.ParamSpec.Di"
-      "mCheckMode\022\022\n\007lr_mult\030\003 \001(\002:\0011\022\025\n\ndecay_"
-      "mult\030\004 \001(\002:\0011\"*\n\014DimCheckMode\022\n\n\006STRICT\020"
-      "\000\022\016\n\nPERMISSIVE\020\001\"\243\032\n\016LayerParameter\022\014\n\004"
-      "name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\016\n\006bottom\030\003 \003(\t"
-      "\022\013\n\003top\030\004 \003(\t\022\"\n\005phase\030\n \001(\0162\023.opencv_ca"
-      "ffe.Phase\022\023\n\013loss_weight\030\005 \003(\002\022&\n\005param\030"
-      "\006 \003(\0132\027.opencv_caffe.ParamSpec\022&\n\005blobs\030"
-      "\007 \003(\0132\027.opencv_caffe.BlobProto\022\026\n\016propag"
-      "ate_down\030\013 \003(\010\022+\n\007include\030\010 \003(\0132\032.opencv"
-      "_caffe.NetStateRule\022+\n\007exclude\030\t \003(\0132\032.o"
-      "pencv_caffe.NetStateRule\022>\n\017transform_pa"
-      "ram\030d \001(\0132%.opencv_caffe.TransformationP"
-      "arameter\022/\n\nloss_param\030e \001(\0132\033.opencv_ca"
-      "ffe.LossParameter\0227\n\016accuracy_param\030f \001("
-      "\0132\037.opencv_caffe.AccuracyParameter\0223\n\014ar"
-      "gmax_param\030g \001(\0132\035.opencv_caffe.ArgMaxPa"
-      "rameter\022;\n\020batch_norm_param\030\213\001 \001(\0132 .ope"
-      "ncv_caffe.BatchNormParameter\0220\n\nbias_par"
-      "am\030\215\001 \001(\0132\033.opencv_caffe.BiasParameter\0223"
-      "\n\014concat_param\030h \001(\0132\035.opencv_caffe.Conc"
-      "atParameter\022F\n\026contrastive_loss_param\030i "
-      "\001(\0132&.opencv_caffe.ContrastiveLossParame"
-      "ter\022=\n\021convolution_param\030j \001(\0132\".opencv_"
-      "caffe.ConvolutionParameter\0220\n\ncrop_param"
-      "\030\220\001 \001(\0132\033.opencv_caffe.CropParameter\022/\n\n"
-      "data_param\030k \001(\0132\033.opencv_caffe.DataPara"
-      "meter\022G\n\026detection_output_param\030\223\001 \001(\0132&"
-      ".opencv_caffe.DetectionOutputParameter\0225"
-      "\n\rdropout_param\030l \001(\0132\036.opencv_caffe.Dro"
-      "poutParameter\022:\n\020dummy_data_param\030m \001(\0132"
-      " .opencv_caffe.DummyDataParameter\0225\n\relt"
-      "wise_param\030n \001(\0132\036.opencv_caffe.EltwiseP"
-      "arameter\022.\n\telu_param\030\214\001 \001(\0132\032.opencv_ca"
-      "ffe.ELUParameter\0222\n\013embed_param\030\211\001 \001(\0132\034"
-      ".opencv_caffe.EmbedParameter\022-\n\texp_para"
-      "m\030o \001(\0132\032.opencv_caffe.ExpParameter\0226\n\rf"
-      "latten_param\030\207\001 \001(\0132\036.opencv_caffe.Flatt"
-      "enParameter\0228\n\017hdf5_data_param\030p \001(\0132\037.o"
-      "pencv_caffe.HDF5DataParameter\022<\n\021hdf5_ou"
-      "tput_param\030q \001(\0132!.opencv_caffe.HDF5Outp"
-      "utParameter\022:\n\020hinge_loss_param\030r \001(\0132 ."
-      "opencv_caffe.HingeLossParameter\022:\n\020image"
-      "_data_param\030s \001(\0132 .opencv_caffe.ImageDa"
-      "taParameter\022@\n\023infogain_loss_param\030t \001(\013"
-      "2#.opencv_caffe.InfogainLossParameter\022@\n"
-      "\023inner_product_param\030u \001(\0132#.opencv_caff"
-      "e.InnerProductParameter\0222\n\013input_param\030\217"
-      "\001 \001(\0132\034.opencv_caffe.InputParameter\022.\n\tl"
-      "og_param\030\206\001 \001(\0132\032.opencv_caffe.LogParame"
-      "ter\022-\n\tlrn_param\030v \001(\0132\032.opencv_caffe.LR"
-      "NParameter\022<\n\021memory_data_param\030w \001(\0132!."
-      "opencv_caffe.MemoryDataParameter\022-\n\tmvn_"
-      "param\030x \001(\0132\032.opencv_caffe.MVNParameter\022"
-      "9\n\nnorm_param\030\225\001 \001(\0132$.opencv_caffe.Norm"
-      "alizeBBoxParameter\0226\n\rpermute_param\030\224\001 \001"
-      "(\0132\036.opencv_caffe.PermuteParameter\022:\n\017pa"
-      "rameter_param\030\221\001 \001(\0132 .opencv_caffe.Para"
-      "meterParameter\0225\n\rpooling_param\030y \001(\0132\036."
-      "opencv_caffe.PoolingParameter\0221\n\013power_p"
-      "aram\030z \001(\0132\034.opencv_caffe.PowerParameter"
-      "\0222\n\013prelu_param\030\203\001 \001(\0132\034.opencv_caffe.PR"
-      "eLUParameter\0229\n\017prior_box_param\030\226\001 \001(\0132\037"
-      ".opencv_caffe.PriorBoxParameter\0228\n\016propo"
-      "sal_param\030\311\001 \001(\0132\037.opencv_caffe.Proposal"
-      "Parameter\022A\n\023psroi_pooling_param\030\222N \001(\0132"
-      "#.opencv_caffe.PSROIPoolingParameter\0224\n\014"
-      "python_param\030\202\001 \001(\0132\035.opencv_caffe.Pytho"
-      "nParameter\022:\n\017recurrent_param\030\222\001 \001(\0132 .o"
-      "pencv_caffe.RecurrentParameter\022:\n\017reduct"
-      "ion_param\030\210\001 \001(\0132 .opencv_caffe.Reductio"
-      "nParameter\022/\n\nrelu_param\030{ \001(\0132\033.opencv_"
-      "caffe.ReLUParameter\0226\n\rreshape_param\030\205\001 "
-      "\001(\0132\036.opencv_caffe.ReshapeParameter\022\?\n\021r"
-      "oi_pooling_param\030\327\307\370\003 \001(\0132!.opencv_caffe"
-      ".ROIPoolingParameter\0222\n\013scale_param\030\216\001 \001"
-      "(\0132\034.opencv_caffe.ScaleParameter\0225\n\rsigm"
-      "oid_param\030| \001(\0132\036.opencv_caffe.SigmoidPa"
-      "rameter\0225\n\rsoftmax_param\030} \001(\0132\036.opencv_"
-      "caffe.SoftmaxParameter\022.\n\tspp_param\030\204\001 \001"
-      "(\0132\032.opencv_caffe.SPPParameter\0221\n\013slice_"
-      "param\030~ \001(\0132\034.opencv_caffe.SliceParamete"
-      "r\022/\n\ntanh_param\030\177 \001(\0132\033.opencv_caffe.Tan"
-      "HParameter\022:\n\017threshold_param\030\200\001 \001(\0132 .o"
-      "pencv_caffe.ThresholdParameter\0220\n\ntile_p"
-      "aram\030\212\001 \001(\0132\033.opencv_caffe.TileParameter"
-      "\022=\n\021window_data_param\030\201\001 \001(\0132!.opencv_ca"
-      "ffe.WindowDataParameter\"\266\001\n\027Transformati"
-      "onParameter\022\020\n\005scale\030\001 \001(\002:\0011\022\025\n\006mirror\030"
-      "\002 \001(\010:\005false\022\024\n\tcrop_size\030\003 \001(\r:\0010\022\021\n\tme"
-      "an_file\030\004 \001(\t\022\022\n\nmean_value\030\005 \003(\002\022\032\n\013for"
-      "ce_color\030\006 \001(\010:\005false\022\031\n\nforce_gray\030\007 \001("
-      "\010:\005false\"\311\001\n\rLossParameter\022\024\n\014ignore_lab"
-      "el\030\001 \001(\005\022K\n\rnormalization\030\003 \001(\0162-.opencv"
-      "_caffe.LossParameter.NormalizationMode:\005"
-      "VALID\022\021\n\tnormalize\030\002 \001(\010\"B\n\021Normalizatio"
-      "nMode\022\010\n\004FULL\020\000\022\t\n\005VALID\020\001\022\016\n\nBATCH_SIZE"
-      "\020\002\022\010\n\004NONE\020\003\"L\n\021AccuracyParameter\022\020\n\005top"
-      "_k\030\001 \001(\r:\0011\022\017\n\004axis\030\002 \001(\005:\0011\022\024\n\014ignore_l"
-      "abel\030\003 \001(\005\"M\n\017ArgMaxParameter\022\032\n\013out_max"
-      "_val\030\001 \001(\010:\005false\022\020\n\005top_k\030\002 \001(\r:\0011\022\014\n\004a"
-      "xis\030\003 \001(\005\"9\n\017ConcatParameter\022\017\n\004axis\030\002 \001"
-      "(\005:\0011\022\025\n\nconcat_dim\030\001 \001(\r:\0011\"\205\001\n\022BatchNo"
-      "rmParameter\022\030\n\020use_global_stats\030\001 \001(\010\022&\n"
-      "\027moving_average_fraction\030\002 \001(\002:\0050.999\022\022\n"
-      "\003eps\030\003 \001(\002:\0051e-05\022\031\n\nscale_bias\030\007 \001(\010:\005f"
-      "alse\"d\n\rBiasParameter\022\017\n\004axis\030\001 \001(\005:\0011\022\023"
-      "\n\010num_axes\030\002 \001(\005:\0011\022-\n\006filler\030\003 \001(\0132\035.op"
-      "encv_caffe.FillerParameter\"L\n\030Contrastiv"
-      "eLossParameter\022\021\n\006margin\030\001 \001(\002:\0011\022\035\n\016leg"
-      "acy_version\030\002 \001(\010:\005false\"\221\004\n\024Convolution"
-      "Parameter\022\022\n\nnum_output\030\001 \001(\r\022\027\n\tbias_te"
-      "rm\030\002 \001(\010:\004true\022\013\n\003pad\030\003 \003(\r\022\023\n\013kernel_si"
-      "ze\030\004 \003(\r\022\016\n\006stride\030\006 \003(\r\022\020\n\010dilation\030\022 \003"
-      "(\r\022\020\n\005pad_h\030\t \001(\r:\0010\022\020\n\005pad_w\030\n \001(\r:\0010\022\020"
-      "\n\010kernel_h\030\013 \001(\r\022\020\n\010kernel_w\030\014 \001(\r\022\020\n\010st"
-      "ride_h\030\r \001(\r\022\020\n\010stride_w\030\016 \001(\r\022\020\n\005group\030"
-      "\005 \001(\r:\0011\0224\n\rweight_filler\030\007 \001(\0132\035.opencv"
-      "_caffe.FillerParameter\0222\n\013bias_filler\030\010 "
-      "\001(\0132\035.opencv_caffe.FillerParameter\022B\n\006en"
-      "gine\030\017 \001(\0162).opencv_caffe.ConvolutionPar"
-      "ameter.Engine:\007DEFAULT\022\017\n\004axis\030\020 \001(\005:\0011\022"
-      "\036\n\017force_nd_im2col\030\021 \001(\010:\005false\"+\n\006Engin"
-      "e\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"0\n\r"
-      "CropParameter\022\017\n\004axis\030\001 \001(\005:\0012\022\016\n\006offset"
-      "\030\002 \003(\r\"\253\002\n\rDataParameter\022\016\n\006source\030\001 \001(\t"
-      "\022\022\n\nbatch_size\030\004 \001(\r\022\024\n\trand_skip\030\007 \001(\r:"
-      "\0010\0228\n\007backend\030\010 \001(\0162\036.opencv_caffe.DataP"
-      "arameter.DB:\007LEVELDB\022\020\n\005scale\030\002 \001(\002:\0011\022\021"
-      "\n\tmean_file\030\003 \001(\t\022\024\n\tcrop_size\030\005 \001(\r:\0010\022"
-      "\025\n\006mirror\030\006 \001(\010:\005false\022\"\n\023force_encoded_"
-      "color\030\t \001(\010:\005false\022\023\n\010prefetch\030\n \001(\r:\0014\""
-      "\033\n\002DB\022\013\n\007LEVELDB\020\000\022\010\n\004LMDB\020\001\"[\n\036NonMaxim"
-      "umSuppressionParameter\022\032\n\rnms_threshold\030"
-      "\001 \001(\002:\0030.3\022\r\n\005top_k\030\002 \001(\005\022\016\n\003eta\030\003 \001(\002:\001"
-      "1\"\252\001\n\023SaveOutputParameter\022\030\n\020output_dire"
-      "ctory\030\001 \001(\t\022\032\n\022output_name_prefix\030\002 \001(\t\022"
-      "\025\n\routput_format\030\003 \001(\t\022\026\n\016label_map_file"
-      "\030\004 \001(\t\022\026\n\016name_size_file\030\005 \001(\t\022\026\n\016num_te"
-      "st_image\030\006 \001(\r\"I\n\020DropoutParameter\022\032\n\rdr"
-      "opout_ratio\030\001 \001(\002:\0030.5\022\031\n\013scale_train\030\002 "
-      "\001(\010:\004true\"\256\001\n\022DummyDataParameter\0222\n\013data"
-      "_filler\030\001 \003(\0132\035.opencv_caffe.FillerParam"
-      "eter\022&\n\005shape\030\006 \003(\0132\027.opencv_caffe.BlobS"
-      "hape\022\013\n\003num\030\002 \003(\r\022\020\n\010channels\030\003 \003(\r\022\016\n\006h"
-      "eight\030\004 \003(\r\022\r\n\005width\030\005 \003(\r\"\254\001\n\020EltwisePa"
-      "rameter\022@\n\toperation\030\001 \001(\0162(.opencv_caff"
-      "e.EltwiseParameter.EltwiseOp:\003SUM\022\r\n\005coe"
-      "ff\030\002 \003(\002\022\036\n\020stable_prod_grad\030\003 \001(\010:\004true"
-      "\"\'\n\tEltwiseOp\022\010\n\004PROD\020\000\022\007\n\003SUM\020\001\022\007\n\003MAX\020"
-      "\002\" \n\014ELUParameter\022\020\n\005alpha\030\001 \001(\002:\0011\"\272\001\n\016"
-      "EmbedParameter\022\022\n\nnum_output\030\001 \001(\r\022\021\n\tin"
-      "put_dim\030\002 \001(\r\022\027\n\tbias_term\030\003 \001(\010:\004true\0224"
-      "\n\rweight_filler\030\004 \001(\0132\035.opencv_caffe.Fil"
-      "lerParameter\0222\n\013bias_filler\030\005 \001(\0132\035.open"
-      "cv_caffe.FillerParameter\"D\n\014ExpParameter"
-      "\022\020\n\004base\030\001 \001(\002:\002-1\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005"
-      "shift\030\003 \001(\002:\0010\"9\n\020FlattenParameter\022\017\n\004ax"
-      "is\030\001 \001(\005:\0011\022\024\n\010end_axis\030\002 \001(\005:\002-1\"O\n\021HDF"
-      "5DataParameter\022\016\n\006source\030\001 \001(\t\022\022\n\nbatch_"
-      "size\030\002 \001(\r\022\026\n\007shuffle\030\003 \001(\010:\005false\"(\n\023HD"
-      "F5OutputParameter\022\021\n\tfile_name\030\001 \001(\t\"e\n\022"
-      "HingeLossParameter\0227\n\004norm\030\001 \001(\0162%.openc"
-      "v_caffe.HingeLossParameter.Norm:\002L1\"\026\n\004N"
-      "orm\022\006\n\002L1\020\001\022\006\n\002L2\020\002\"\227\002\n\022ImageDataParamet"
-      "er\022\016\n\006source\030\001 \001(\t\022\025\n\nbatch_size\030\004 \001(\r:\001"
-      "1\022\024\n\trand_skip\030\007 \001(\r:\0010\022\026\n\007shuffle\030\010 \001(\010"
-      ":\005false\022\025\n\nnew_height\030\t \001(\r:\0010\022\024\n\tnew_wi"
-      "dth\030\n \001(\r:\0010\022\026\n\010is_color\030\013 \001(\010:\004true\022\020\n\005"
-      "scale\030\002 \001(\002:\0011\022\021\n\tmean_file\030\003 \001(\t\022\024\n\tcro"
-      "p_size\030\005 \001(\r:\0010\022\025\n\006mirror\030\006 \001(\010:\005false\022\025"
-      "\n\013root_folder\030\014 \001(\t:\000\"\'\n\025InfogainLossPar"
-      "ameter\022\016\n\006source\030\001 \001(\t\"\331\001\n\025InnerProductP"
-      "arameter\022\022\n\nnum_output\030\001 \001(\r\022\027\n\tbias_ter"
-      "m\030\002 \001(\010:\004true\0224\n\rweight_filler\030\003 \001(\0132\035.o"
-      "pencv_caffe.FillerParameter\0222\n\013bias_fill"
-      "er\030\004 \001(\0132\035.opencv_caffe.FillerParameter\022"
-      "\017\n\004axis\030\005 \001(\005:\0011\022\030\n\ttranspose\030\006 \001(\010:\005fal"
-      "se\"8\n\016InputParameter\022&\n\005shape\030\001 \003(\0132\027.op"
-      "encv_caffe.BlobShape\"D\n\014LogParameter\022\020\n\004"
-      "base\030\001 \001(\002:\002-1\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005shif"
-      "t\030\003 \001(\002:\0010\"\306\002\n\014LRNParameter\022\025\n\nlocal_siz"
-      "e\030\001 \001(\r:\0015\022\020\n\005alpha\030\002 \001(\002:\0011\022\022\n\004beta\030\003 \001"
-      "(\002:\0040.75\022K\n\013norm_region\030\004 \001(\0162%.opencv_c"
-      "affe.LRNParameter.NormRegion:\017ACROSS_CHA"
-      "NNELS\022\014\n\001k\030\005 \001(\002:\0011\022:\n\006engine\030\006 \001(\0162!.op"
-      "encv_caffe.LRNParameter.Engine:\007DEFAULT\""
-      "5\n\nNormRegion\022\023\n\017ACROSS_CHANNELS\020\000\022\022\n\016WI"
-      "THIN_CHANNEL\020\001\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n"
-      "\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"Z\n\023MemoryDataParamet"
-      "er\022\022\n\nbatch_size\030\001 \001(\r\022\020\n\010channels\030\002 \001(\r"
-      "\022\016\n\006height\030\003 \001(\r\022\r\n\005width\030\004 \001(\r\"d\n\014MVNPa"
-      "rameter\022 \n\022normalize_variance\030\001 \001(\010:\004tru"
-      "e\022\036\n\017across_channels\030\002 \001(\010:\005false\022\022\n\003eps"
-      "\030\003 \001(\002:\0051e-09\"<\n\022ParameterParameter\022&\n\005s"
-      "hape\030\001 \001(\0132\027.opencv_caffe.BlobShape\"\311\003\n\020"
-      "PoolingParameter\022<\n\004pool\030\001 \001(\0162).opencv_"
-      "caffe.PoolingParameter.PoolMethod:\003MAX\022\016"
-      "\n\003pad\030\004 \001(\r:\0010\022\020\n\005pad_h\030\t \001(\r:\0010\022\020\n\005pad_"
-      "w\030\n \001(\r:\0010\022\023\n\013kernel_size\030\002 \001(\r\022\020\n\010kerne"
-      "l_h\030\005 \001(\r\022\020\n\010kernel_w\030\006 \001(\r\022\021\n\006stride\030\003 "
-      "\001(\r:\0011\022\020\n\010stride_h\030\007 \001(\r\022\020\n\010stride_w\030\010 \001"
-      "(\r\022>\n\006engine\030\013 \001(\0162%.opencv_caffe.Poolin"
-      "gParameter.Engine:\007DEFAULT\022\035\n\016global_poo"
-      "ling\030\014 \001(\010:\005false\022\027\n\tceil_mode\030\r \001(\010:\004tr"
-      "ue\".\n\nPoolMethod\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\nST"
-      "OCHASTIC\020\002\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAF"
-      "FE\020\001\022\t\n\005CUDNN\020\002\"F\n\016PowerParameter\022\020\n\005pow"
-      "er\030\001 \001(\002:\0011\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005shift\030\003"
-      " \001(\002:\0010\"g\n\017PythonParameter\022\016\n\006module\030\001 \001"
-      "(\t\022\r\n\005layer\030\002 \001(\t\022\023\n\tparam_str\030\003 \001(\t:\000\022 "
-      "\n\021share_in_parallel\030\004 \001(\010:\005false\"\316\001\n\022Rec"
-      "urrentParameter\022\025\n\nnum_output\030\001 \001(\r:\0010\0224"
-      "\n\rweight_filler\030\002 \001(\0132\035.opencv_caffe.Fil"
-      "lerParameter\0222\n\013bias_filler\030\003 \001(\0132\035.open"
-      "cv_caffe.FillerParameter\022\031\n\ndebug_info\030\004"
-      " \001(\010:\005false\022\034\n\rexpose_hidden\030\005 \001(\010:\005fals"
-      "e\"\264\001\n\022ReductionParameter\022D\n\toperation\030\001 "
-      "\001(\0162,.opencv_caffe.ReductionParameter.Re"
-      "ductionOp:\003SUM\022\017\n\004axis\030\002 \001(\005:\0010\022\020\n\005coeff"
-      "\030\003 \001(\002:\0011\"5\n\013ReductionOp\022\007\n\003SUM\020\001\022\010\n\004ASU"
-      "M\020\002\022\t\n\005SUMSQ\020\003\022\010\n\004MEAN\020\004\"\224\001\n\rReLUParamet"
-      "er\022\031\n\016negative_slope\030\001 \001(\002:\0010\022;\n\006engine\030"
-      "\002 \001(\0162\".opencv_caffe.ReLUParameter.Engin"
-      "e:\007DEFAULT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAF"
-      "FE\020\001\022\t\n\005CUDNN\020\002\"a\n\020ReshapeParameter\022&\n\005s"
-      "hape\030\001 \001(\0132\027.opencv_caffe.BlobShape\022\017\n\004a"
-      "xis\030\002 \001(\005:\0010\022\024\n\010num_axes\030\003 \001(\005:\002-1\"\263\001\n\016S"
-      "caleParameter\022\017\n\004axis\030\001 \001(\005:\0011\022\023\n\010num_ax"
-      "es\030\002 \001(\005:\0011\022-\n\006filler\030\003 \001(\0132\035.opencv_caf"
-      "fe.FillerParameter\022\030\n\tbias_term\030\004 \001(\010:\005f"
-      "alse\0222\n\013bias_filler\030\005 \001(\0132\035.opencv_caffe"
-      ".FillerParameter\"\177\n\020SigmoidParameter\022>\n\006"
-      "engine\030\001 \001(\0162%.opencv_caffe.SigmoidParam"
-      "eter.Engine:\007DEFAULT\"+\n\006Engine\022\013\n\007DEFAUL"
-      "T\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"L\n\016SliceParame"
-      "ter\022\017\n\004axis\030\003 \001(\005:\0011\022\023\n\013slice_point\030\002 \003("
-      "\r\022\024\n\tslice_dim\030\001 \001(\r:\0011\"\220\001\n\020SoftmaxParam"
-      "eter\022>\n\006engine\030\001 \001(\0162%.opencv_caffe.Soft"
-      "maxParameter.Engine:\007DEFAULT\022\017\n\004axis\030\002 \001"
-      "(\005:\0011\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022"
-      "\t\n\005CUDNN\020\002\"y\n\rTanHParameter\022;\n\006engine\030\001 "
-      "\001(\0162\".opencv_caffe.TanHParameter.Engine:"
-      "\007DEFAULT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE"
-      "\020\001\022\t\n\005CUDNN\020\002\"/\n\rTileParameter\022\017\n\004axis\030\001"
-      " \001(\005:\0011\022\r\n\005tiles\030\002 \001(\005\"*\n\022ThresholdParam"
-      "eter\022\024\n\tthreshold\030\001 \001(\002:\0010\"\301\002\n\023WindowDat"
-      "aParameter\022\016\n\006source\030\001 \001(\t\022\020\n\005scale\030\002 \001("
-      "\002:\0011\022\021\n\tmean_file\030\003 \001(\t\022\022\n\nbatch_size\030\004 "
-      "\001(\r\022\024\n\tcrop_size\030\005 \001(\r:\0010\022\025\n\006mirror\030\006 \001("
-      "\010:\005false\022\031\n\014fg_threshold\030\007 \001(\002:\0030.5\022\031\n\014b"
-      "g_threshold\030\010 \001(\002:\0030.5\022\031\n\013fg_fraction\030\t "
-      "\001(\002:\0040.25\022\026\n\013context_pad\030\n \001(\r:\0010\022\027\n\tcro"
-      "p_mode\030\013 \001(\t:\004warp\022\033\n\014cache_images\030\014 \001(\010"
-      ":\005false\022\025\n\013root_folder\030\r \001(\t:\000\"\371\001\n\014SPPPa"
-      "rameter\022\026\n\016pyramid_height\030\001 \001(\r\0228\n\004pool\030"
-      "\002 \001(\0162%.opencv_caffe.SPPParameter.PoolMe"
-      "thod:\003MAX\022:\n\006engine\030\006 \001(\0162!.opencv_caffe"
-      ".SPPParameter.Engine:\007DEFAULT\".\n\nPoolMet"
-      "hod\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002\"+\n"
-      "\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN"
-      "\020\002\"\334\025\n\020V1LayerParameter\022\016\n\006bottom\030\002 \003(\t\022"
-      "\013\n\003top\030\003 \003(\t\022\014\n\004name\030\004 \001(\t\022+\n\007include\030  "
-      "\003(\0132\032.opencv_caffe.NetStateRule\022+\n\007exclu"
-      "de\030! \003(\0132\032.opencv_caffe.NetStateRule\0226\n\004"
-      "type\030\005 \001(\0162(.opencv_caffe.V1LayerParamet"
-      "er.LayerType\022&\n\005blobs\030\006 \003(\0132\027.opencv_caf"
-      "fe.BlobProto\022\016\n\005param\030\351\007 \003(\t\022E\n\017blob_sha"
-      "re_mode\030\352\007 \003(\0162+.opencv_caffe.V1LayerPar"
-      "ameter.DimCheckMode\022\020\n\010blobs_lr\030\007 \003(\002\022\024\n"
-      "\014weight_decay\030\010 \003(\002\022\023\n\013loss_weight\030# \003(\002"
-      "\0227\n\016accuracy_param\030\033 \001(\0132\037.opencv_caffe."
-      "AccuracyParameter\0223\n\014argmax_param\030\027 \001(\0132"
-      "\035.opencv_caffe.ArgMaxParameter\0223\n\014concat"
-      "_param\030\t \001(\0132\035.opencv_caffe.ConcatParame"
-      "ter\022F\n\026contrastive_loss_param\030( \001(\0132&.op"
-      "encv_caffe.ContrastiveLossParameter\022=\n\021c"
-      "onvolution_param\030\n \001(\0132\".opencv_caffe.Co"
-      "nvolutionParameter\022/\n\ndata_param\030\013 \001(\0132\033"
-      ".opencv_caffe.DataParameter\0225\n\rdropout_p"
-      "aram\030\014 \001(\0132\036.opencv_caffe.DropoutParamet"
-      "er\022:\n\020dummy_data_param\030\032 \001(\0132 .opencv_ca"
-      "ffe.DummyDataParameter\0225\n\reltwise_param\030"
-      "\030 \001(\0132\036.opencv_caffe.EltwiseParameter\022-\n"
-      "\texp_param\030) \001(\0132\032.opencv_caffe.ExpParam"
-      "eter\0228\n\017hdf5_data_param\030\r \001(\0132\037.opencv_c"
-      "affe.HDF5DataParameter\022<\n\021hdf5_output_pa"
-      "ram\030\016 \001(\0132!.opencv_caffe.HDF5OutputParam"
-      "eter\022:\n\020hinge_loss_param\030\035 \001(\0132 .opencv_"
-      "caffe.HingeLossParameter\022:\n\020image_data_p"
-      "aram\030\017 \001(\0132 .opencv_caffe.ImageDataParam"
-      "eter\022@\n\023infogain_loss_param\030\020 \001(\0132#.open"
-      "cv_caffe.InfogainLossParameter\022@\n\023inner_"
-      "product_param\030\021 \001(\0132#.opencv_caffe.Inner"
-      "ProductParameter\022-\n\tlrn_param\030\022 \001(\0132\032.op"
-      "encv_caffe.LRNParameter\022<\n\021memory_data_p"
-      "aram\030\026 \001(\0132!.opencv_caffe.MemoryDataPara"
-      "meter\022-\n\tmvn_param\030\" \001(\0132\032.opencv_caffe."
-      "MVNParameter\0225\n\rpooling_param\030\023 \001(\0132\036.op"
-      "encv_caffe.PoolingParameter\0221\n\013power_par"
-      "am\030\025 \001(\0132\034.opencv_caffe.PowerParameter\022/"
-      "\n\nrelu_param\030\036 \001(\0132\033.opencv_caffe.ReLUPa"
-      "rameter\0225\n\rsigmoid_param\030& \001(\0132\036.opencv_"
-      "caffe.SigmoidParameter\0225\n\rsoftmax_param\030"
-      "\' \001(\0132\036.opencv_caffe.SoftmaxParameter\0221\n"
-      "\013slice_param\030\037 \001(\0132\034.opencv_caffe.SliceP"
-      "arameter\022/\n\ntanh_param\030% \001(\0132\033.opencv_ca"
-      "ffe.TanHParameter\0229\n\017threshold_param\030\031 \001"
-      "(\0132 .opencv_caffe.ThresholdParameter\022<\n\021"
-      "window_data_param\030\024 \001(\0132!.opencv_caffe.W"
-      "indowDataParameter\022>\n\017transform_param\030$ "
-      "\001(\0132%.opencv_caffe.TransformationParamet"
-      "er\022/\n\nloss_param\030* \001(\0132\033.opencv_caffe.Lo"
-      "ssParameter\022-\n\005layer\030\001 \001(\0132\036.opencv_caff"
-      "e.V0LayerParameter\"\330\004\n\tLayerType\022\010\n\004NONE"
-      "\020\000\022\n\n\006ABSVAL\020#\022\014\n\010ACCURACY\020\001\022\n\n\006ARGMAX\020\036"
-      "\022\010\n\004BNLL\020\002\022\n\n\006CONCAT\020\003\022\024\n\020CONTRASTIVE_LO"
-      "SS\020%\022\017\n\013CONVOLUTION\020\004\022\010\n\004DATA\020\005\022\021\n\rDECON"
-      "VOLUTION\020\'\022\013\n\007DROPOUT\020\006\022\016\n\nDUMMY_DATA\020 \022"
-      "\022\n\016EUCLIDEAN_LOSS\020\007\022\013\n\007ELTWISE\020\031\022\007\n\003EXP\020"
-      "&\022\013\n\007FLATTEN\020\010\022\r\n\tHDF5_DATA\020\t\022\017\n\013HDF5_OU"
-      "TPUT\020\n\022\016\n\nHINGE_LOSS\020\034\022\n\n\006IM2COL\020\013\022\016\n\nIM"
-      "AGE_DATA\020\014\022\021\n\rINFOGAIN_LOSS\020\r\022\021\n\rINNER_P"
-      "RODUCT\020\016\022\007\n\003LRN\020\017\022\017\n\013MEMORY_DATA\020\035\022\035\n\031MU"
-      "LTINOMIAL_LOGISTIC_LOSS\020\020\022\007\n\003MVN\020\"\022\013\n\007PO"
-      "OLING\020\021\022\t\n\005POWER\020\032\022\010\n\004RELU\020\022\022\013\n\007SIGMOID\020"
-      "\023\022\036\n\032SIGMOID_CROSS_ENTROPY_LOSS\020\033\022\013\n\007SIL"
-      "ENCE\020$\022\013\n\007SOFTMAX\020\024\022\020\n\014SOFTMAX_LOSS\020\025\022\t\n"
-      "\005SPLIT\020\026\022\t\n\005SLICE\020!\022\010\n\004TANH\020\027\022\017\n\013WINDOW_"
-      "DATA\020\030\022\r\n\tTHRESHOLD\020\037\"*\n\014DimCheckMode\022\n\n"
-      "\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"\240\010\n\020V0LayerPar"
-      "ameter\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\022\n\nnu"
-      "m_output\030\003 \001(\r\022\026\n\010biasterm\030\004 \001(\010:\004true\0224"
-      "\n\rweight_filler\030\005 \001(\0132\035.opencv_caffe.Fil"
-      "lerParameter\0222\n\013bias_filler\030\006 \001(\0132\035.open"
-      "cv_caffe.FillerParameter\022\016\n\003pad\030\007 \001(\r:\0010"
-      "\022\022\n\nkernelsize\030\010 \001(\r\022\020\n\005group\030\t \001(\r:\0011\022\021"
-      "\n\006stride\030\n \001(\r:\0011\022<\n\004pool\030\013 \001(\0162).opencv"
-      "_caffe.V0LayerParameter.PoolMethod:\003MAX\022"
-      "\032\n\rdropout_ratio\030\014 \001(\002:\0030.5\022\025\n\nlocal_siz"
-      "e\030\r \001(\r:\0015\022\020\n\005alpha\030\016 \001(\002:\0011\022\022\n\004beta\030\017 \001"
-      "(\002:\0040.75\022\014\n\001k\030\026 \001(\002:\0011\022\016\n\006source\030\020 \001(\t\022\020"
-      "\n\005scale\030\021 \001(\002:\0011\022\020\n\010meanfile\030\022 \001(\t\022\021\n\tba"
-      "tchsize\030\023 \001(\r\022\023\n\010cropsize\030\024 \001(\r:\0010\022\025\n\006mi"
-      "rror\030\025 \001(\010:\005false\022&\n\005blobs\0302 \003(\0132\027.openc"
-      "v_caffe.BlobProto\022\020\n\010blobs_lr\0303 \003(\002\022\024\n\014w"
-      "eight_decay\0304 \003(\002\022\024\n\trand_skip\0305 \001(\r:\0010\022"
-      "\035\n\020det_fg_threshold\0306 \001(\002:\0030.5\022\035\n\020det_bg"
-      "_threshold\0307 \001(\002:\0030.5\022\035\n\017det_fg_fraction"
-      "\0308 \001(\002:\0040.25\022\032\n\017det_context_pad\030: \001(\r:\0010"
-      "\022\033\n\rdet_crop_mode\030; \001(\t:\004warp\022\022\n\007new_num"
-      "\030< \001(\005:\0010\022\027\n\014new_channels\030= \001(\005:\0010\022\025\n\nne"
-      "w_height\030> \001(\005:\0010\022\024\n\tnew_width\030\? \001(\005:\0010\022"
-      "\035\n\016shuffle_images\030@ \001(\010:\005false\022\025\n\nconcat"
-      "_dim\030A \001(\r:\0011\022=\n\021hdf5_output_param\030\351\007 \001("
-      "\0132!.opencv_caffe.HDF5OutputParameter\".\n\n"
-      "PoolMethod\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\nSTOCHAST"
-      "IC\020\002\"^\n\016PReLUParameter\022-\n\006filler\030\001 \001(\0132\035"
-      ".opencv_caffe.FillerParameter\022\035\n\016channel"
-      "_shared\030\002 \001(\010:\005false\"\207\001\n\016NormalizedBBox\022"
-      "\014\n\004xmin\030\001 \001(\002\022\014\n\004ymin\030\002 \001(\002\022\014\n\004xmax\030\003 \001("
-      "\002\022\014\n\004ymax\030\004 \001(\002\022\r\n\005label\030\005 \001(\005\022\021\n\tdiffic"
-      "ult\030\006 \001(\010\022\r\n\005score\030\007 \001(\002\022\014\n\004size\030\010 \001(\002\"Y"
-      "\n\023ROIPoolingParameter\022\023\n\010pooled_h\030\001 \001(\r:"
-      "\0010\022\023\n\010pooled_w\030\002 \001(\r:\0010\022\030\n\rspatial_scale"
-      "\030\003 \001(\002:\0011\"\310\001\n\021ProposalParameter\022\027\n\013feat_"
-      "stride\030\001 \001(\r:\00216\022\025\n\tbase_size\030\002 \001(\r:\00216\022"
-      "\024\n\010min_size\030\003 \001(\r:\00216\022\r\n\005ratio\030\004 \003(\002\022\r\n\005"
-      "scale\030\005 \003(\002\022\032\n\014pre_nms_topn\030\006 \001(\r:\0046000\022"
-      "\032\n\rpost_nms_topn\030\007 \001(\r:\003300\022\027\n\nnms_thres"
-      "h\030\010 \001(\002:\0030.7\"V\n\025PSROIPoolingParameter\022\025\n"
-      "\rspatial_scale\030\001 \002(\002\022\022\n\noutput_dim\030\002 \002(\005"
-      "\022\022\n\ngroup_size\030\003 \002(\005*=\n\004Type\022\n\n\006DOUBLE\020\000"
-      "\022\t\n\005FLOAT\020\001\022\013\n\007FLOAT16\020\002\022\007\n\003INT\020\003\022\010\n\004UIN"
-      "T\020\004*\034\n\005Phase\022\t\n\005TRAIN\020\000\022\010\n\004TEST\020\001"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 18833);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "opencv-caffe.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_opencv_2dcaffe_2eproto
-namespace opencv_caffe {
-const ::google::protobuf::EnumDescriptor* PriorBoxParameter_CodeType_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[0];
-}
-bool PriorBoxParameter_CodeType_IsValid(int value) {
-  switch (value) {
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const PriorBoxParameter_CodeType PriorBoxParameter::CORNER;
-const PriorBoxParameter_CodeType PriorBoxParameter::CENTER_SIZE;
-const PriorBoxParameter_CodeType PriorBoxParameter::CodeType_MIN;
-const PriorBoxParameter_CodeType PriorBoxParameter::CodeType_MAX;
-const int PriorBoxParameter::CodeType_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* FillerParameter_VarianceNorm_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[1];
-}
-bool FillerParameter_VarianceNorm_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const FillerParameter_VarianceNorm FillerParameter::FAN_IN;
-const FillerParameter_VarianceNorm FillerParameter::FAN_OUT;
-const FillerParameter_VarianceNorm FillerParameter::AVERAGE;
-const FillerParameter_VarianceNorm FillerParameter::VarianceNorm_MIN;
-const FillerParameter_VarianceNorm FillerParameter::VarianceNorm_MAX;
-const int FillerParameter::VarianceNorm_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* SolverParameter_SnapshotFormat_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[2];
-}
-bool SolverParameter_SnapshotFormat_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const SolverParameter_SnapshotFormat SolverParameter::HDF5;
-const SolverParameter_SnapshotFormat SolverParameter::BINARYPROTO;
-const SolverParameter_SnapshotFormat SolverParameter::SnapshotFormat_MIN;
-const SolverParameter_SnapshotFormat SolverParameter::SnapshotFormat_MAX;
-const int SolverParameter::SnapshotFormat_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* SolverParameter_SolverMode_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[3];
-}
-bool SolverParameter_SolverMode_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const SolverParameter_SolverMode SolverParameter::CPU;
-const SolverParameter_SolverMode SolverParameter::GPU;
-const SolverParameter_SolverMode SolverParameter::SolverMode_MIN;
-const SolverParameter_SolverMode SolverParameter::SolverMode_MAX;
-const int SolverParameter::SolverMode_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* SolverParameter_SolverType_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[4];
-}
-bool SolverParameter_SolverType_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-    case 5:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const SolverParameter_SolverType SolverParameter::SGD;
-const SolverParameter_SolverType SolverParameter::NESTEROV;
-const SolverParameter_SolverType SolverParameter::ADAGRAD;
-const SolverParameter_SolverType SolverParameter::RMSPROP;
-const SolverParameter_SolverType SolverParameter::ADADELTA;
-const SolverParameter_SolverType SolverParameter::ADAM;
-const SolverParameter_SolverType SolverParameter::SolverType_MIN;
-const SolverParameter_SolverType SolverParameter::SolverType_MAX;
-const int SolverParameter::SolverType_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* ParamSpec_DimCheckMode_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[5];
-}
-bool ParamSpec_DimCheckMode_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const ParamSpec_DimCheckMode ParamSpec::STRICT;
-const ParamSpec_DimCheckMode ParamSpec::PERMISSIVE;
-const ParamSpec_DimCheckMode ParamSpec::DimCheckMode_MIN;
-const ParamSpec_DimCheckMode ParamSpec::DimCheckMode_MAX;
-const int ParamSpec::DimCheckMode_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* LossParameter_NormalizationMode_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[6];
-}
-bool LossParameter_NormalizationMode_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const LossParameter_NormalizationMode LossParameter::FULL;
-const LossParameter_NormalizationMode LossParameter::VALID;
-const LossParameter_NormalizationMode LossParameter::BATCH_SIZE;
-const LossParameter_NormalizationMode LossParameter::NONE;
-const LossParameter_NormalizationMode LossParameter::NormalizationMode_MIN;
-const LossParameter_NormalizationMode LossParameter::NormalizationMode_MAX;
-const int LossParameter::NormalizationMode_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* ConvolutionParameter_Engine_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[7];
-}
-bool ConvolutionParameter_Engine_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const ConvolutionParameter_Engine ConvolutionParameter::DEFAULT;
-const ConvolutionParameter_Engine ConvolutionParameter::CAFFE;
-const ConvolutionParameter_Engine ConvolutionParameter::CUDNN;
-const ConvolutionParameter_Engine ConvolutionParameter::Engine_MIN;
-const ConvolutionParameter_Engine ConvolutionParameter::Engine_MAX;
-const int ConvolutionParameter::Engine_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* DataParameter_DB_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[8];
-}
-bool DataParameter_DB_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const DataParameter_DB DataParameter::LEVELDB;
-const DataParameter_DB DataParameter::LMDB;
-const DataParameter_DB DataParameter::DB_MIN;
-const DataParameter_DB DataParameter::DB_MAX;
-const int DataParameter::DB_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* EltwiseParameter_EltwiseOp_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[9];
-}
-bool EltwiseParameter_EltwiseOp_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const EltwiseParameter_EltwiseOp EltwiseParameter::PROD;
-const EltwiseParameter_EltwiseOp EltwiseParameter::SUM;
-const EltwiseParameter_EltwiseOp EltwiseParameter::MAX;
-const EltwiseParameter_EltwiseOp EltwiseParameter::EltwiseOp_MIN;
-const EltwiseParameter_EltwiseOp EltwiseParameter::EltwiseOp_MAX;
-const int EltwiseParameter::EltwiseOp_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* HingeLossParameter_Norm_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[10];
-}
-bool HingeLossParameter_Norm_IsValid(int value) {
-  switch (value) {
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const HingeLossParameter_Norm HingeLossParameter::L1;
-const HingeLossParameter_Norm HingeLossParameter::L2;
-const HingeLossParameter_Norm HingeLossParameter::Norm_MIN;
-const HingeLossParameter_Norm HingeLossParameter::Norm_MAX;
-const int HingeLossParameter::Norm_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* LRNParameter_NormRegion_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[11];
-}
-bool LRNParameter_NormRegion_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const LRNParameter_NormRegion LRNParameter::ACROSS_CHANNELS;
-const LRNParameter_NormRegion LRNParameter::WITHIN_CHANNEL;
-const LRNParameter_NormRegion LRNParameter::NormRegion_MIN;
-const LRNParameter_NormRegion LRNParameter::NormRegion_MAX;
-const int LRNParameter::NormRegion_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* LRNParameter_Engine_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[12];
-}
-bool LRNParameter_Engine_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const LRNParameter_Engine LRNParameter::DEFAULT;
-const LRNParameter_Engine LRNParameter::CAFFE;
-const LRNParameter_Engine LRNParameter::CUDNN;
-const LRNParameter_Engine LRNParameter::Engine_MIN;
-const LRNParameter_Engine LRNParameter::Engine_MAX;
-const int LRNParameter::Engine_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* PoolingParameter_PoolMethod_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[13];
-}
-bool PoolingParameter_PoolMethod_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const PoolingParameter_PoolMethod PoolingParameter::MAX;
-const PoolingParameter_PoolMethod PoolingParameter::AVE;
-const PoolingParameter_PoolMethod PoolingParameter::STOCHASTIC;
-const PoolingParameter_PoolMethod PoolingParameter::PoolMethod_MIN;
-const PoolingParameter_PoolMethod PoolingParameter::PoolMethod_MAX;
-const int PoolingParameter::PoolMethod_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* PoolingParameter_Engine_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[14];
-}
-bool PoolingParameter_Engine_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const PoolingParameter_Engine PoolingParameter::DEFAULT;
-const PoolingParameter_Engine PoolingParameter::CAFFE;
-const PoolingParameter_Engine PoolingParameter::CUDNN;
-const PoolingParameter_Engine PoolingParameter::Engine_MIN;
-const PoolingParameter_Engine PoolingParameter::Engine_MAX;
-const int PoolingParameter::Engine_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* ReductionParameter_ReductionOp_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[15];
-}
-bool ReductionParameter_ReductionOp_IsValid(int value) {
-  switch (value) {
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const ReductionParameter_ReductionOp ReductionParameter::SUM;
-const ReductionParameter_ReductionOp ReductionParameter::ASUM;
-const ReductionParameter_ReductionOp ReductionParameter::SUMSQ;
-const ReductionParameter_ReductionOp ReductionParameter::MEAN;
-const ReductionParameter_ReductionOp ReductionParameter::ReductionOp_MIN;
-const ReductionParameter_ReductionOp ReductionParameter::ReductionOp_MAX;
-const int ReductionParameter::ReductionOp_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* ReLUParameter_Engine_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[16];
-}
-bool ReLUParameter_Engine_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const ReLUParameter_Engine ReLUParameter::DEFAULT;
-const ReLUParameter_Engine ReLUParameter::CAFFE;
-const ReLUParameter_Engine ReLUParameter::CUDNN;
-const ReLUParameter_Engine ReLUParameter::Engine_MIN;
-const ReLUParameter_Engine ReLUParameter::Engine_MAX;
-const int ReLUParameter::Engine_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* SigmoidParameter_Engine_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[17];
-}
-bool SigmoidParameter_Engine_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const SigmoidParameter_Engine SigmoidParameter::DEFAULT;
-const SigmoidParameter_Engine SigmoidParameter::CAFFE;
-const SigmoidParameter_Engine SigmoidParameter::CUDNN;
-const SigmoidParameter_Engine SigmoidParameter::Engine_MIN;
-const SigmoidParameter_Engine SigmoidParameter::Engine_MAX;
-const int SigmoidParameter::Engine_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* SoftmaxParameter_Engine_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[18];
-}
-bool SoftmaxParameter_Engine_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const SoftmaxParameter_Engine SoftmaxParameter::DEFAULT;
-const SoftmaxParameter_Engine SoftmaxParameter::CAFFE;
-const SoftmaxParameter_Engine SoftmaxParameter::CUDNN;
-const SoftmaxParameter_Engine SoftmaxParameter::Engine_MIN;
-const SoftmaxParameter_Engine SoftmaxParameter::Engine_MAX;
-const int SoftmaxParameter::Engine_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* TanHParameter_Engine_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[19];
-}
-bool TanHParameter_Engine_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const TanHParameter_Engine TanHParameter::DEFAULT;
-const TanHParameter_Engine TanHParameter::CAFFE;
-const TanHParameter_Engine TanHParameter::CUDNN;
-const TanHParameter_Engine TanHParameter::Engine_MIN;
-const TanHParameter_Engine TanHParameter::Engine_MAX;
-const int TanHParameter::Engine_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* SPPParameter_PoolMethod_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[20];
-}
-bool SPPParameter_PoolMethod_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const SPPParameter_PoolMethod SPPParameter::MAX;
-const SPPParameter_PoolMethod SPPParameter::AVE;
-const SPPParameter_PoolMethod SPPParameter::STOCHASTIC;
-const SPPParameter_PoolMethod SPPParameter::PoolMethod_MIN;
-const SPPParameter_PoolMethod SPPParameter::PoolMethod_MAX;
-const int SPPParameter::PoolMethod_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* SPPParameter_Engine_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[21];
-}
-bool SPPParameter_Engine_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const SPPParameter_Engine SPPParameter::DEFAULT;
-const SPPParameter_Engine SPPParameter::CAFFE;
-const SPPParameter_Engine SPPParameter::CUDNN;
-const SPPParameter_Engine SPPParameter::Engine_MIN;
-const SPPParameter_Engine SPPParameter::Engine_MAX;
-const int SPPParameter::Engine_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* V1LayerParameter_LayerType_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[22];
-}
-bool V1LayerParameter_LayerType_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-    case 5:
-    case 6:
-    case 7:
-    case 8:
-    case 9:
-    case 10:
-    case 11:
-    case 12:
-    case 13:
-    case 14:
-    case 15:
-    case 16:
-    case 17:
-    case 18:
-    case 19:
-    case 20:
-    case 21:
-    case 22:
-    case 23:
-    case 24:
-    case 25:
-    case 26:
-    case 27:
-    case 28:
-    case 29:
-    case 30:
-    case 31:
-    case 32:
-    case 33:
-    case 34:
-    case 35:
-    case 36:
-    case 37:
-    case 38:
-    case 39:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const V1LayerParameter_LayerType V1LayerParameter::NONE;
-const V1LayerParameter_LayerType V1LayerParameter::ABSVAL;
-const V1LayerParameter_LayerType V1LayerParameter::ACCURACY;
-const V1LayerParameter_LayerType V1LayerParameter::ARGMAX;
-const V1LayerParameter_LayerType V1LayerParameter::BNLL;
-const V1LayerParameter_LayerType V1LayerParameter::CONCAT;
-const V1LayerParameter_LayerType V1LayerParameter::CONTRASTIVE_LOSS;
-const V1LayerParameter_LayerType V1LayerParameter::CONVOLUTION;
-const V1LayerParameter_LayerType V1LayerParameter::DATA;
-const V1LayerParameter_LayerType V1LayerParameter::DECONVOLUTION;
-const V1LayerParameter_LayerType V1LayerParameter::DROPOUT;
-const V1LayerParameter_LayerType V1LayerParameter::DUMMY_DATA;
-const V1LayerParameter_LayerType V1LayerParameter::EUCLIDEAN_LOSS;
-const V1LayerParameter_LayerType V1LayerParameter::ELTWISE;
-const V1LayerParameter_LayerType V1LayerParameter::EXP;
-const V1LayerParameter_LayerType V1LayerParameter::FLATTEN;
-const V1LayerParameter_LayerType V1LayerParameter::HDF5_DATA;
-const V1LayerParameter_LayerType V1LayerParameter::HDF5_OUTPUT;
-const V1LayerParameter_LayerType V1LayerParameter::HINGE_LOSS;
-const V1LayerParameter_LayerType V1LayerParameter::IM2COL;
-const V1LayerParameter_LayerType V1LayerParameter::IMAGE_DATA;
-const V1LayerParameter_LayerType V1LayerParameter::INFOGAIN_LOSS;
-const V1LayerParameter_LayerType V1LayerParameter::INNER_PRODUCT;
-const V1LayerParameter_LayerType V1LayerParameter::LRN;
-const V1LayerParameter_LayerType V1LayerParameter::MEMORY_DATA;
-const V1LayerParameter_LayerType V1LayerParameter::MULTINOMIAL_LOGISTIC_LOSS;
-const V1LayerParameter_LayerType V1LayerParameter::MVN;
-const V1LayerParameter_LayerType V1LayerParameter::POOLING;
-const V1LayerParameter_LayerType V1LayerParameter::POWER;
-const V1LayerParameter_LayerType V1LayerParameter::RELU;
-const V1LayerParameter_LayerType V1LayerParameter::SIGMOID;
-const V1LayerParameter_LayerType V1LayerParameter::SIGMOID_CROSS_ENTROPY_LOSS;
-const V1LayerParameter_LayerType V1LayerParameter::SILENCE;
-const V1LayerParameter_LayerType V1LayerParameter::SOFTMAX;
-const V1LayerParameter_LayerType V1LayerParameter::SOFTMAX_LOSS;
-const V1LayerParameter_LayerType V1LayerParameter::SPLIT;
-const V1LayerParameter_LayerType V1LayerParameter::SLICE;
-const V1LayerParameter_LayerType V1LayerParameter::TANH;
-const V1LayerParameter_LayerType V1LayerParameter::WINDOW_DATA;
-const V1LayerParameter_LayerType V1LayerParameter::THRESHOLD;
-const V1LayerParameter_LayerType V1LayerParameter::LayerType_MIN;
-const V1LayerParameter_LayerType V1LayerParameter::LayerType_MAX;
-const int V1LayerParameter::LayerType_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* V1LayerParameter_DimCheckMode_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[23];
-}
-bool V1LayerParameter_DimCheckMode_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const V1LayerParameter_DimCheckMode V1LayerParameter::STRICT;
-const V1LayerParameter_DimCheckMode V1LayerParameter::PERMISSIVE;
-const V1LayerParameter_DimCheckMode V1LayerParameter::DimCheckMode_MIN;
-const V1LayerParameter_DimCheckMode V1LayerParameter::DimCheckMode_MAX;
-const int V1LayerParameter::DimCheckMode_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* V0LayerParameter_PoolMethod_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[24];
-}
-bool V0LayerParameter_PoolMethod_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const V0LayerParameter_PoolMethod V0LayerParameter::MAX;
-const V0LayerParameter_PoolMethod V0LayerParameter::AVE;
-const V0LayerParameter_PoolMethod V0LayerParameter::STOCHASTIC;
-const V0LayerParameter_PoolMethod V0LayerParameter::PoolMethod_MIN;
-const V0LayerParameter_PoolMethod V0LayerParameter::PoolMethod_MAX;
-const int V0LayerParameter::PoolMethod_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* Type_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[25];
-}
-bool Type_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-      return true;
-    default:
-      return false;
-  }
-}
-
-const ::google::protobuf::EnumDescriptor* Phase_descriptor() {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2dcaffe_2eproto::file_level_enum_descriptors[26];
-}
-bool Phase_IsValid(int value) {
-  switch (value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-
-// ===================================================================
-
-void BlobShape::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int BlobShape::kDimFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-BlobShape::BlobShape()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShape();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.BlobShape)
-}
-BlobShape::BlobShape(const BlobShape& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      dim_(from.dim_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.BlobShape)
-}
-
-void BlobShape::SharedCtor() {
-  _cached_size_ = 0;
-}
-
-BlobShape::~BlobShape() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.BlobShape)
-  SharedDtor();
-}
-
-void BlobShape::SharedDtor() {
-}
-
-void BlobShape::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* BlobShape::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const BlobShape& BlobShape::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShape();
-  return *internal_default_instance();
-}
-
-BlobShape* BlobShape::New(::google::protobuf::Arena* arena) const {
-  BlobShape* n = new BlobShape;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void BlobShape::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.BlobShape)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  dim_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool BlobShape::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:opencv_caffe.BlobShape)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated int64 dim = 1 [packed = true];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, this->mutable_dim())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 1, 10u, input, this->mutable_dim())));
-        } 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:opencv_caffe.BlobShape)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.BlobShape)
-  return false;
-#undef DO_
-}
-
-void BlobShape::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.BlobShape)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated int64 dim = 1 [packed = true];
-  if (this->dim_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _dim_cached_byte_size_));
-  }
-  for (int i = 0, n = this->dim_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
-      this->dim(i), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.BlobShape)
-}
-
-::google::protobuf::uint8* BlobShape::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.BlobShape)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated int64 dim = 1 [packed = true];
-  if (this->dim_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      1,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _dim_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt64NoTagToArray(this->dim_, 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:opencv_caffe.BlobShape)
-  return target;
-}
-
-size_t BlobShape::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.BlobShape)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // repeated int64 dim = 1 [packed = true];
-  {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
-      Int64Size(this->dim_);
-    if (data_size > 0) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
-    }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _dim_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
-    total_size += data_size;
-  }
-
-  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 BlobShape::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.BlobShape)
-  GOOGLE_DCHECK_NE(&from, this);
-  const BlobShape* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const BlobShape>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.BlobShape)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.BlobShape)
-    MergeFrom(*source);
-  }
-}
-
-void BlobShape::MergeFrom(const BlobShape& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.BlobShape)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  dim_.MergeFrom(from.dim_);
-}
-
-void BlobShape::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.BlobShape)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void BlobShape::CopyFrom(const BlobShape& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.BlobShape)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool BlobShape::IsInitialized() const {
-  return true;
-}
-
-void BlobShape::Swap(BlobShape* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void BlobShape::InternalSwap(BlobShape* other) {
-  using std::swap;
-  dim_.InternalSwap(&other->dim_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata BlobShape::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void BlobProto::InitAsDefaultInstance() {
-  ::opencv_caffe::_BlobProto_default_instance_._instance.get_mutable()->shape_ = const_cast< ::opencv_caffe::BlobShape*>(
-      ::opencv_caffe::BlobShape::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int BlobProto::kShapeFieldNumber;
-const int BlobProto::kDataFieldNumber;
-const int BlobProto::kDiffFieldNumber;
-const int BlobProto::kDoubleDataFieldNumber;
-const int BlobProto::kDoubleDiffFieldNumber;
-const int BlobProto::kRawDataTypeFieldNumber;
-const int BlobProto::kRawDataFieldNumber;
-const int BlobProto::kNumFieldNumber;
-const int BlobProto::kChannelsFieldNumber;
-const int BlobProto::kHeightFieldNumber;
-const int BlobProto::kWidthFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-BlobProto::BlobProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProto();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.BlobProto)
-}
-BlobProto::BlobProto(const BlobProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      data_(from.data_),
-      diff_(from.diff_),
-      double_data_(from.double_data_),
-      double_diff_(from.double_diff_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  raw_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_raw_data()) {
-    raw_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.raw_data_);
-  }
-  if (from.has_shape()) {
-    shape_ = new ::opencv_caffe::BlobShape(*from.shape_);
-  } else {
-    shape_ = NULL;
-  }
-  ::memcpy(&num_, &from.num_,
-    static_cast<size_t>(reinterpret_cast<char*>(&raw_data_type_) -
-    reinterpret_cast<char*>(&num_)) + sizeof(raw_data_type_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.BlobProto)
-}
-
-void BlobProto::SharedCtor() {
-  _cached_size_ = 0;
-  raw_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&shape_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&raw_data_type_) -
-      reinterpret_cast<char*>(&shape_)) + sizeof(raw_data_type_));
-}
-
-BlobProto::~BlobProto() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.BlobProto)
-  SharedDtor();
-}
-
-void BlobProto::SharedDtor() {
-  raw_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (this != internal_default_instance()) delete shape_;
-}
-
-void BlobProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* BlobProto::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const BlobProto& BlobProto::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProto();
-  return *internal_default_instance();
-}
-
-BlobProto* BlobProto::New(::google::protobuf::Arena* arena) const {
-  BlobProto* n = new BlobProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void BlobProto::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.BlobProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  data_.Clear();
-  diff_.Clear();
-  double_data_.Clear();
-  double_diff_.Clear();
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!raw_data_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*raw_data_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(shape_ != NULL);
-      shape_->Clear();
-    }
-  }
-  if (cached_has_bits & 124u) {
-    ::memset(&num_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&raw_data_type_) -
-        reinterpret_cast<char*>(&num_)) + sizeof(raw_data_type_));
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool BlobProto::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:opencv_caffe.BlobProto)
-  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 num = 1 [default = 0];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_num();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &num_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 channels = 2 [default = 0];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_channels();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &channels_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 height = 3 [default = 0];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_height();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &height_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 width = 4 [default = 0];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_width();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &width_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated float data = 5 [packed = true];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_data())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 42u, input, this->mutable_data())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated float diff = 6 [packed = true];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_diff())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 50u, input, this->mutable_diff())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.BlobShape shape = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_shape()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated double double_data = 8 [packed = true];
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 input, this->mutable_double_data())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(65u /* 65 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 1, 66u, input, this->mutable_double_data())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated double double_diff = 9 [packed = true];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 input, this->mutable_double_diff())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(73u /* 73 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 1, 74u, input, this->mutable_double_diff())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.Type raw_data_type = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::Type_IsValid(value)) {
-            set_raw_data_type(static_cast< ::opencv_caffe::Type >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                10, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bytes raw_data = 12 [packed = false];
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_raw_data()));
-        } 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:opencv_caffe.BlobProto)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.BlobProto)
-  return false;
-#undef DO_
-}
-
-void BlobProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.BlobProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 num = 1 [default = 0];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->num(), output);
-  }
-
-  // optional int32 channels = 2 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->channels(), output);
-  }
-
-  // optional int32 height = 3 [default = 0];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->height(), output);
-  }
-
-  // optional int32 width = 4 [default = 0];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->width(), output);
-  }
-
-  // repeated float data = 5 [packed = true];
-  if (this->data_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _data_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
-      this->data().data(), this->data_size(), output);
-  }
-
-  // repeated float diff = 6 [packed = true];
-  if (this->diff_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _diff_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
-      this->diff().data(), this->diff_size(), output);
-  }
-
-  // optional .opencv_caffe.BlobShape shape = 7;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, *this->shape_, output);
-  }
-
-  // repeated double double_data = 8 [packed = true];
-  if (this->double_data_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _double_data_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
-      this->double_data().data(), this->double_data_size(), output);
-  }
-
-  // repeated double double_diff = 9 [packed = true];
-  if (this->double_diff_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _double_diff_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
-      this->double_diff().data(), this->double_diff_size(), output);
-  }
-
-  // optional .opencv_caffe.Type raw_data_type = 10;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      10, this->raw_data_type(), output);
-  }
-
-  // optional bytes raw_data = 12 [packed = false];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      12, this->raw_data(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.BlobProto)
-}
-
-::google::protobuf::uint8* BlobProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.BlobProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 num = 1 [default = 0];
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->num(), target);
-  }
-
-  // optional int32 channels = 2 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->channels(), target);
-  }
-
-  // optional int32 height = 3 [default = 0];
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->height(), target);
-  }
-
-  // optional int32 width = 4 [default = 0];
-  if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->width(), target);
-  }
-
-  // repeated float data = 5 [packed = true];
-  if (this->data_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      5,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _data_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteFloatNoTagToArray(this->data_, target);
-  }
-
-  // repeated float diff = 6 [packed = true];
-  if (this->diff_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      6,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _diff_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteFloatNoTagToArray(this->diff_, target);
-  }
-
-  // optional .opencv_caffe.BlobShape shape = 7;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, *this->shape_, deterministic, target);
-  }
-
-  // repeated double double_data = 8 [packed = true];
-  if (this->double_data_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      8,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _double_data_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteDoubleNoTagToArray(this->double_data_, target);
-  }
-
-  // repeated double double_diff = 9 [packed = true];
-  if (this->double_diff_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      9,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _double_diff_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteDoubleNoTagToArray(this->double_diff_, target);
-  }
-
-  // optional .opencv_caffe.Type raw_data_type = 10;
-  if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      10, this->raw_data_type(), target);
-  }
-
-  // optional bytes raw_data = 12 [packed = false];
-  if (cached_has_bits & 0x00000001u) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        12, this->raw_data(), 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:opencv_caffe.BlobProto)
-  return target;
-}
-
-size_t BlobProto::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.BlobProto)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // repeated float data = 5 [packed = true];
-  {
-    unsigned int count = static_cast<unsigned int>(this->data_size());
-    size_t data_size = 4UL * count;
-    if (data_size > 0) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
-    }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _data_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
-    total_size += data_size;
-  }
-
-  // repeated float diff = 6 [packed = true];
-  {
-    unsigned int count = static_cast<unsigned int>(this->diff_size());
-    size_t data_size = 4UL * count;
-    if (data_size > 0) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
-    }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _diff_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
-    total_size += data_size;
-  }
-
-  // repeated double double_data = 8 [packed = true];
-  {
-    unsigned int count = static_cast<unsigned int>(this->double_data_size());
-    size_t data_size = 8UL * count;
-    if (data_size > 0) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
-    }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _double_data_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
-    total_size += data_size;
-  }
-
-  // repeated double double_diff = 9 [packed = true];
-  {
-    unsigned int count = static_cast<unsigned int>(this->double_diff_size());
-    size_t data_size = 8UL * count;
-    if (data_size > 0) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
-    }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _double_diff_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
-    total_size += data_size;
-  }
-
-  if (_has_bits_[0 / 32] & 127u) {
-    // optional bytes raw_data = 12 [packed = false];
-    if (has_raw_data()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::BytesSize(
-          this->raw_data());
-    }
-
-    // optional .opencv_caffe.BlobShape shape = 7;
-    if (has_shape()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->shape_);
-    }
-
-    // optional int32 num = 1 [default = 0];
-    if (has_num()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->num());
-    }
-
-    // optional int32 channels = 2 [default = 0];
-    if (has_channels()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->channels());
-    }
-
-    // optional int32 height = 3 [default = 0];
-    if (has_height()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->height());
-    }
-
-    // optional int32 width = 4 [default = 0];
-    if (has_width()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->width());
-    }
-
-    // optional .opencv_caffe.Type raw_data_type = 10;
-    if (has_raw_data_type()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->raw_data_type());
-    }
-
-  }
-  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 BlobProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.BlobProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const BlobProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const BlobProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.BlobProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.BlobProto)
-    MergeFrom(*source);
-  }
-}
-
-void BlobProto::MergeFrom(const BlobProto& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.BlobProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  data_.MergeFrom(from.data_);
-  diff_.MergeFrom(from.diff_);
-  double_data_.MergeFrom(from.double_data_);
-  double_diff_.MergeFrom(from.double_diff_);
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 127u) {
-    if (cached_has_bits & 0x00000001u) {
-      set_has_raw_data();
-      raw_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.raw_data_);
-    }
-    if (cached_has_bits & 0x00000002u) {
-      mutable_shape()->::opencv_caffe::BlobShape::MergeFrom(from.shape());
-    }
-    if (cached_has_bits & 0x00000004u) {
-      num_ = from.num_;
-    }
-    if (cached_has_bits & 0x00000008u) {
-      channels_ = from.channels_;
-    }
-    if (cached_has_bits & 0x00000010u) {
-      height_ = from.height_;
-    }
-    if (cached_has_bits & 0x00000020u) {
-      width_ = from.width_;
-    }
-    if (cached_has_bits & 0x00000040u) {
-      raw_data_type_ = from.raw_data_type_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void BlobProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.BlobProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void BlobProto::CopyFrom(const BlobProto& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.BlobProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool BlobProto::IsInitialized() const {
-  return true;
-}
-
-void BlobProto::Swap(BlobProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void BlobProto::InternalSwap(BlobProto* other) {
-  using std::swap;
-  data_.InternalSwap(&other->data_);
-  diff_.InternalSwap(&other->diff_);
-  double_data_.InternalSwap(&other->double_data_);
-  double_diff_.InternalSwap(&other->double_diff_);
-  raw_data_.Swap(&other->raw_data_);
-  swap(shape_, other->shape_);
-  swap(num_, other->num_);
-  swap(channels_, other->channels_);
-  swap(height_, other->height_);
-  swap(width_, other->width_);
-  swap(raw_data_type_, other->raw_data_type_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata BlobProto::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void BlobProtoVector::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int BlobProtoVector::kBlobsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-BlobProtoVector::BlobProtoVector()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProtoVector();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.BlobProtoVector)
-}
-BlobProtoVector::BlobProtoVector(const BlobProtoVector& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      blobs_(from.blobs_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.BlobProtoVector)
-}
-
-void BlobProtoVector::SharedCtor() {
-  _cached_size_ = 0;
-}
-
-BlobProtoVector::~BlobProtoVector() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.BlobProtoVector)
-  SharedDtor();
-}
-
-void BlobProtoVector::SharedDtor() {
-}
-
-void BlobProtoVector::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* BlobProtoVector::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const BlobProtoVector& BlobProtoVector::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProtoVector();
-  return *internal_default_instance();
-}
-
-BlobProtoVector* BlobProtoVector::New(::google::protobuf::Arena* arena) const {
-  BlobProtoVector* n = new BlobProtoVector;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void BlobProtoVector::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.BlobProtoVector)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  blobs_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool BlobProtoVector::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:opencv_caffe.BlobProtoVector)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated .opencv_caffe.BlobProto blobs = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_blobs()));
-        } 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:opencv_caffe.BlobProtoVector)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.BlobProtoVector)
-  return false;
-#undef DO_
-}
-
-void BlobProtoVector::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.BlobProtoVector)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_caffe.BlobProto blobs = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->blobs_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->blobs(static_cast<int>(i)), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.BlobProtoVector)
-}
-
-::google::protobuf::uint8* BlobProtoVector::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.BlobProtoVector)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_caffe.BlobProto blobs = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->blobs_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->blobs(static_cast<int>(i)), deterministic, target);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
-  }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.BlobProtoVector)
-  return target;
-}
-
-size_t BlobProtoVector::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.BlobProtoVector)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // repeated .opencv_caffe.BlobProto blobs = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->blobs_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->blobs(static_cast<int>(i)));
-    }
-  }
-
-  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = cached_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void BlobProtoVector::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.BlobProtoVector)
-  GOOGLE_DCHECK_NE(&from, this);
-  const BlobProtoVector* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const BlobProtoVector>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.BlobProtoVector)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.BlobProtoVector)
-    MergeFrom(*source);
-  }
-}
-
-void BlobProtoVector::MergeFrom(const BlobProtoVector& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.BlobProtoVector)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  blobs_.MergeFrom(from.blobs_);
-}
-
-void BlobProtoVector::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.BlobProtoVector)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void BlobProtoVector::CopyFrom(const BlobProtoVector& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.BlobProtoVector)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool BlobProtoVector::IsInitialized() const {
-  return true;
-}
-
-void BlobProtoVector::Swap(BlobProtoVector* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void BlobProtoVector::InternalSwap(BlobProtoVector* other) {
-  using std::swap;
-  blobs_.InternalSwap(&other->blobs_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata BlobProtoVector::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void PermuteParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int PermuteParameter::kOrderFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-PermuteParameter::PermuteParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPermuteParameter();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.PermuteParameter)
-}
-PermuteParameter::PermuteParameter(const PermuteParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      order_(from.order_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.PermuteParameter)
-}
-
-void PermuteParameter::SharedCtor() {
-  _cached_size_ = 0;
-}
-
-PermuteParameter::~PermuteParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.PermuteParameter)
-  SharedDtor();
-}
-
-void PermuteParameter::SharedDtor() {
-}
-
-void PermuteParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* PermuteParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const PermuteParameter& PermuteParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPermuteParameter();
-  return *internal_default_instance();
-}
-
-PermuteParameter* PermuteParameter::New(::google::protobuf::Arena* arena) const {
-  PermuteParameter* n = new PermuteParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void PermuteParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.PermuteParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  order_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool PermuteParameter::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:opencv_caffe.PermuteParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated uint32 order = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 8u, input, this->mutable_order())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_order())));
-        } 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:opencv_caffe.PermuteParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.PermuteParameter)
-  return false;
-#undef DO_
-}
-
-void PermuteParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.PermuteParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated uint32 order = 1;
-  for (int i = 0, n = this->order_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      1, this->order(i), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.PermuteParameter)
-}
-
-::google::protobuf::uint8* PermuteParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PermuteParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated uint32 order = 1;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(1, this->order_, 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:opencv_caffe.PermuteParameter)
-  return target;
-}
-
-size_t PermuteParameter::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PermuteParameter)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // repeated uint32 order = 1;
-  {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
-      UInt32Size(this->order_);
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->order_size());
-    total_size += data_size;
-  }
-
-  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 PermuteParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.PermuteParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const PermuteParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const PermuteParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.PermuteParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.PermuteParameter)
-    MergeFrom(*source);
-  }
-}
-
-void PermuteParameter::MergeFrom(const PermuteParameter& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PermuteParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  order_.MergeFrom(from.order_);
-}
-
-void PermuteParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.PermuteParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void PermuteParameter::CopyFrom(const PermuteParameter& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.PermuteParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool PermuteParameter::IsInitialized() const {
-  return true;
-}
-
-void PermuteParameter::Swap(PermuteParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void PermuteParameter::InternalSwap(PermuteParameter* other) {
-  using std::swap;
-  order_.InternalSwap(&other->order_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata PermuteParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void NormalizeBBoxParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_NormalizeBBoxParameter_default_instance_._instance.get_mutable()->scale_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NormalizeBBoxParameter::kAcrossSpatialFieldNumber;
-const int NormalizeBBoxParameter::kScaleFillerFieldNumber;
-const int NormalizeBBoxParameter::kChannelSharedFieldNumber;
-const int NormalizeBBoxParameter::kEpsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-NormalizeBBoxParameter::NormalizeBBoxParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNormalizeBBoxParameter();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.NormalizeBBoxParameter)
-}
-NormalizeBBoxParameter::NormalizeBBoxParameter(const NormalizeBBoxParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_scale_filler()) {
-    scale_filler_ = new ::opencv_caffe::FillerParameter(*from.scale_filler_);
-  } else {
-    scale_filler_ = NULL;
-  }
-  ::memcpy(&across_spatial_, &from.across_spatial_,
-    static_cast<size_t>(reinterpret_cast<char*>(&eps_) -
-    reinterpret_cast<char*>(&across_spatial_)) + sizeof(eps_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.NormalizeBBoxParameter)
-}
-
-void NormalizeBBoxParameter::SharedCtor() {
-  _cached_size_ = 0;
-  scale_filler_ = NULL;
-  across_spatial_ = true;
-  channel_shared_ = true;
-  eps_ = 1e-10f;
-}
-
-NormalizeBBoxParameter::~NormalizeBBoxParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.NormalizeBBoxParameter)
-  SharedDtor();
-}
-
-void NormalizeBBoxParameter::SharedDtor() {
-  if (this != internal_default_instance()) delete scale_filler_;
-}
-
-void NormalizeBBoxParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* NormalizeBBoxParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const NormalizeBBoxParameter& NormalizeBBoxParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNormalizeBBoxParameter();
-  return *internal_default_instance();
-}
-
-NormalizeBBoxParameter* NormalizeBBoxParameter::New(::google::protobuf::Arena* arena) const {
-  NormalizeBBoxParameter* n = new NormalizeBBoxParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void NormalizeBBoxParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.NormalizeBBoxParameter)
-  ::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 & 15u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(scale_filler_ != NULL);
-      scale_filler_->Clear();
-    }
-    across_spatial_ = true;
-    channel_shared_ = true;
-    eps_ = 1e-10f;
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool NormalizeBBoxParameter::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:opencv_caffe.NormalizeBBoxParameter)
-  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 bool across_spatial = 1 [default = true];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_across_spatial();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &across_spatial_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.FillerParameter scale_filler = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_scale_filler()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool channel_shared = 3 [default = true];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_channel_shared();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &channel_shared_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float eps = 4 [default = 1e-10];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          set_has_eps();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &eps_)));
-        } 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:opencv_caffe.NormalizeBBoxParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.NormalizeBBoxParameter)
-  return false;
-#undef DO_
-}
-
-void NormalizeBBoxParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.NormalizeBBoxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool across_spatial = 1 [default = true];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->across_spatial(), output);
-  }
-
-  // optional .opencv_caffe.FillerParameter scale_filler = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->scale_filler_, output);
-  }
-
-  // optional bool channel_shared = 3 [default = true];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->channel_shared(), output);
-  }
-
-  // optional float eps = 4 [default = 1e-10];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->eps(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.NormalizeBBoxParameter)
-}
-
-::google::protobuf::uint8* NormalizeBBoxParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NormalizeBBoxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool across_spatial = 1 [default = true];
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->across_spatial(), target);
-  }
-
-  // optional .opencv_caffe.FillerParameter scale_filler = 2;
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, *this->scale_filler_, deterministic, target);
-  }
-
-  // optional bool channel_shared = 3 [default = true];
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->channel_shared(), target);
-  }
-
-  // optional float eps = 4 [default = 1e-10];
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->eps(), 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:opencv_caffe.NormalizeBBoxParameter)
-  return target;
-}
-
-size_t NormalizeBBoxParameter::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NormalizeBBoxParameter)
-  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] & 15u) {
-    // optional .opencv_caffe.FillerParameter scale_filler = 2;
-    if (has_scale_filler()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->scale_filler_);
-    }
-
-    // optional bool across_spatial = 1 [default = true];
-    if (has_across_spatial()) {
-      total_size += 1 + 1;
-    }
-
-    // optional bool channel_shared = 3 [default = true];
-    if (has_channel_shared()) {
-      total_size += 1 + 1;
-    }
-
-    // optional float eps = 4 [default = 1e-10];
-    if (has_eps()) {
-      total_size += 1 + 4;
-    }
-
-  }
-  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 NormalizeBBoxParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.NormalizeBBoxParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NormalizeBBoxParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NormalizeBBoxParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.NormalizeBBoxParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.NormalizeBBoxParameter)
-    MergeFrom(*source);
-  }
-}
-
-void NormalizeBBoxParameter::MergeFrom(const NormalizeBBoxParameter& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NormalizeBBoxParameter)
-  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 & 15u) {
-    if (cached_has_bits & 0x00000001u) {
-      mutable_scale_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.scale_filler());
-    }
-    if (cached_has_bits & 0x00000002u) {
-      across_spatial_ = from.across_spatial_;
-    }
-    if (cached_has_bits & 0x00000004u) {
-      channel_shared_ = from.channel_shared_;
-    }
-    if (cached_has_bits & 0x00000008u) {
-      eps_ = from.eps_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void NormalizeBBoxParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.NormalizeBBoxParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void NormalizeBBoxParameter::CopyFrom(const NormalizeBBoxParameter& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.NormalizeBBoxParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool NormalizeBBoxParameter::IsInitialized() const {
-  return true;
-}
-
-void NormalizeBBoxParameter::Swap(NormalizeBBoxParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void NormalizeBBoxParameter::InternalSwap(NormalizeBBoxParameter* other) {
-  using std::swap;
-  swap(scale_filler_, other->scale_filler_);
-  swap(across_spatial_, other->across_spatial_);
-  swap(channel_shared_, other->channel_shared_);
-  swap(eps_, other->eps_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata NormalizeBBoxParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void PriorBoxParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int PriorBoxParameter::kMinSizeFieldNumber;
-const int PriorBoxParameter::kMaxSizeFieldNumber;
-const int PriorBoxParameter::kAspectRatioFieldNumber;
-const int PriorBoxParameter::kFlipFieldNumber;
-const int PriorBoxParameter::kClipFieldNumber;
-const int PriorBoxParameter::kVarianceFieldNumber;
-const int PriorBoxParameter::kImgSizeFieldNumber;
-const int PriorBoxParameter::kImgHFieldNumber;
-const int PriorBoxParameter::kImgWFieldNumber;
-const int PriorBoxParameter::kStepFieldNumber;
-const int PriorBoxParameter::kStepHFieldNumber;
-const int PriorBoxParameter::kStepWFieldNumber;
-const int PriorBoxParameter::kOffsetFieldNumber;
-const int PriorBoxParameter::kOffsetHFieldNumber;
-const int PriorBoxParameter::kOffsetWFieldNumber;
-const int PriorBoxParameter::kWidthFieldNumber;
-const int PriorBoxParameter::kHeightFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-PriorBoxParameter::PriorBoxParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPriorBoxParameter();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.PriorBoxParameter)
-}
-PriorBoxParameter::PriorBoxParameter(const PriorBoxParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      min_size_(from.min_size_),
-      max_size_(from.max_size_),
-      aspect_ratio_(from.aspect_ratio_),
-      variance_(from.variance_),
-      offset_h_(from.offset_h_),
-      offset_w_(from.offset_w_),
-      width_(from.width_),
-      height_(from.height_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::memcpy(&img_size_, &from.img_size_,
-    static_cast<size_t>(reinterpret_cast<char*>(&offset_) -
-    reinterpret_cast<char*>(&img_size_)) + sizeof(offset_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.PriorBoxParameter)
-}
-
-void PriorBoxParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&img_size_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&step_w_) -
-      reinterpret_cast<char*>(&img_size_)) + sizeof(step_w_));
-  flip_ = true;
-  clip_ = true;
-  offset_ = 0.5f;
-}
-
-PriorBoxParameter::~PriorBoxParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.PriorBoxParameter)
-  SharedDtor();
-}
-
-void PriorBoxParameter::SharedDtor() {
-}
-
-void PriorBoxParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* PriorBoxParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const PriorBoxParameter& PriorBoxParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPriorBoxParameter();
-  return *internal_default_instance();
-}
-
-PriorBoxParameter* PriorBoxParameter::New(::google::protobuf::Arena* arena) const {
-  PriorBoxParameter* n = new PriorBoxParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void PriorBoxParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.PriorBoxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  min_size_.Clear();
-  max_size_.Clear();
-  aspect_ratio_.Clear();
-  variance_.Clear();
-  offset_h_.Clear();
-  offset_w_.Clear();
-  width_.Clear();
-  height_.Clear();
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 255u) {
-    ::memset(&img_size_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&step_w_) -
-        reinterpret_cast<char*>(&img_size_)) + sizeof(step_w_));
-    flip_ = true;
-    clip_ = true;
-  }
-  offset_ = 0.5f;
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool PriorBoxParameter::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:opencv_caffe.PriorBoxParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated float min_size = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 13u, input, this->mutable_min_size())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_min_size())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated float max_size = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 21u, input, this->mutable_max_size())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_max_size())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated float aspect_ratio = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 29u, input, this->mutable_aspect_ratio())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_aspect_ratio())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool flip = 4 [default = true];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_flip();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &flip_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool clip = 5 [default = true];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_clip();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &clip_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated float variance = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 53u, input, this->mutable_variance())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_variance())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 img_size = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_img_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &img_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 img_h = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-          set_has_img_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &img_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 img_w = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
-          set_has_img_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &img_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float step = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(85u /* 85 & 0xFF */)) {
-          set_has_step();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &step_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float step_h = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(93u /* 93 & 0xFF */)) {
-          set_has_step_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &step_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float step_w = 12;
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(101u /* 101 & 0xFF */)) {
-          set_has_step_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &step_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float offset = 13 [default = 0.5];
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(109u /* 109 & 0xFF */)) {
-          set_has_offset();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &offset_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated float offset_h = 14;
-      case 14: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(117u /* 117 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 117u, input, this->mutable_offset_h())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_offset_h())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated float offset_w = 15;
-      case 15: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(125u /* 125 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 125u, input, this->mutable_offset_w())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_offset_w())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+const uint32_t TableStruct_opencv_2dcaffe_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobShape, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobShape, dim_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, shape_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, diff_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, double_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, double_diff_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, raw_data_type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, raw_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, num_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, channels_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, height_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProto, width_),
+  1,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  6,
+  0,
+  2,
+  3,
+  4,
+  5,
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProtoVector, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BlobProtoVector, blobs_),
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PermuteParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PermuteParameter, order_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, across_spatial_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, scale_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, channel_shared_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizeBBoxParameter, eps_),
+  1,
+  0,
+  2,
+  3,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, min_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, max_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, aspect_ratio_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, flip_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, clip_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, variance_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, img_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, img_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, img_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, step_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, step_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, step_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, offset_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, offset_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, offset_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, width_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PriorBoxParameter, height_),
+  ~0u,
+  ~0u,
+  ~0u,
+  6,
+  7,
+  ~0u,
+  0,
+  1,
+  2,
+  3,
+  4,
+  5,
+  8,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, num_classes_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, share_location_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, background_label_id_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, nms_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, save_output_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, code_type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, variance_encoded_in_target_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, keep_top_k_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, confidence_threshold_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, normalized_bbox_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DetectionOutputParameter, clip_),
+  2,
+  9,
+  3,
+  0,
+  1,
+  8,
+  5,
+  7,
+  4,
+  10,
+  6,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, channels_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, height_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, width_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, label_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, float_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::Datum, encoded_),
+  1,
+  2,
+  3,
+  0,
+  4,
+  ~0u,
+  5,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, value_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, min_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, max_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, mean_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, std_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, sparse_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FillerParameter, variance_norm_),
+  0,
+  1,
+  2,
+  6,
+  3,
+  7,
+  5,
+  4,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, input_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, input_shape_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, input_dim_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, force_backward_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, state_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, debug_info_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, layer_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetParameter, layers_),
+  0,
+  ~0u,
+  ~0u,
+  ~0u,
+  2,
+  1,
+  3,
+  ~0u,
+  ~0u,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, net_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, net_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, train_net_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_net_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, train_net_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_net_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, train_state_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_state_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_iter_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_interval_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_compute_loss_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, test_initialization_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, base_lr_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, display_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, average_loss_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, max_iter_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, iter_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, lr_policy_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, gamma_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, power_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, momentum_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, weight_decay_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, regularization_type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, stepsize_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, stepvalue_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, clip_gradients_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_prefix_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_diff_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_format_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, solver_mode_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, device_id_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, random_seed_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, delta_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, momentum2_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, rms_decay_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, debug_info_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, snapshot_after_train_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverParameter, solver_type_),
+  3,
+  7,
+  0,
+  ~0u,
+  6,
+  ~0u,
+  8,
+  ~0u,
+  ~0u,
+  9,
+  20,
+  27,
+  10,
+  11,
+  30,
+  12,
+  32,
+  1,
+  13,
+  14,
+  15,
+  16,
+  4,
+  17,
+  ~0u,
+  31,
+  18,
+  2,
+  21,
+  33,
+  26,
+  19,
+  25,
+  5,
+  29,
+  24,
+  34,
+  22,
+  28,
+  23,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverState, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverState, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverState, iter_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverState, learned_net_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverState, history_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SolverState, current_step_),
+  1,
+  0,
+  ~0u,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetState, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetState, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetState, phase_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetState, level_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetState, stage_),
+  1,
+  0,
+  ~0u,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetStateRule, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetStateRule, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetStateRule, phase_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetStateRule, min_level_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetStateRule, max_level_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetStateRule, stage_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NetStateRule, not_stage_),
+  0,
+  1,
+  2,
+  ~0u,
+  ~0u,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParamSpec, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParamSpec, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParamSpec, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParamSpec, share_mode_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParamSpec, lr_mult_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParamSpec, decay_mult_),
+  0,
+  1,
+  2,
+  3,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, bottom_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, top_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, phase_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, loss_weight_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, blobs_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, propagate_down_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, include_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, exclude_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, transform_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, loss_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, accuracy_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, argmax_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, batch_norm_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, bias_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, concat_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, contrastive_loss_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, convolution_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, crop_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, detection_output_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, dropout_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, dummy_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, eltwise_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, elu_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, embed_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, exp_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, flatten_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, hdf5_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, hdf5_output_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, hinge_loss_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, image_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, infogain_loss_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, inner_product_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, input_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, log_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, lrn_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, memory_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, mvn_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, norm_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, permute_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, parameter_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, pooling_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, power_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, prelu_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, prior_box_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, proposal_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, psroi_pooling_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, python_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, recurrent_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, reduction_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, relu_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, reshape_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, roi_pooling_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, scale_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, sigmoid_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, softmax_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, spp_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, slice_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, tanh_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, threshold_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, tile_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LayerParameter, window_data_param_),
+  0,
+  1,
+  ~0u,
+  ~0u,
+  56,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  2,
+  3,
+  4,
+  5,
+  41,
+  43,
+  6,
+  7,
+  8,
+  46,
+  9,
+  49,
+  10,
+  11,
+  12,
+  42,
+  39,
+  13,
+  37,
+  14,
+  15,
+  16,
+  17,
+  18,
+  19,
+  45,
+  36,
+  20,
+  21,
+  22,
+  51,
+  50,
+  47,
+  23,
+  24,
+  33,
+  52,
+  53,
+  54,
+  32,
+  48,
+  38,
+  25,
+  35,
+  55,
+  44,
+  26,
+  27,
+  34,
+  28,
+  29,
+  30,
+  40,
+  31,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, mirror_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, crop_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, mean_file_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, mean_value_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, force_color_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TransformationParameter, force_gray_),
+  5,
+  2,
+  1,
+  0,
+  ~0u,
+  3,
+  4,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LossParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LossParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LossParameter, ignore_label_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LossParameter, normalization_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LossParameter, normalize_),
+  0,
+  2,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, top_k_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::AccuracyParameter, ignore_label_),
+  1,
+  2,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, out_max_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, top_k_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ArgMaxParameter, axis_),
+  0,
+  2,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConcatParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConcatParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConcatParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConcatParameter, concat_dim_),
+  1,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, use_global_stats_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, moving_average_fraction_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, eps_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BatchNormParameter, scale_bias_),
+  0,
+  2,
+  3,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BiasParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BiasParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BiasParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BiasParameter, num_axes_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::BiasParameter, filler_),
+  1,
+  2,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ContrastiveLossParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ContrastiveLossParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ContrastiveLossParameter, margin_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ContrastiveLossParameter, legacy_version_),
+  1,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, num_output_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, bias_term_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, pad_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, kernel_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, stride_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, dilation_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, pad_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, pad_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, kernel_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, kernel_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, stride_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, stride_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, group_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, weight_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, bias_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, engine_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ConvolutionParameter, force_nd_im2col_),
+  2,
+  12,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  3,
+  4,
+  5,
+  6,
+  7,
+  8,
+  13,
+  0,
+  1,
+  9,
+  11,
+  10,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::CropParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::CropParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::CropParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::CropParameter, offset_),
+  0,
+  ~0u,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, source_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, batch_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, rand_skip_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, backend_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, mean_file_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, crop_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, mirror_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, force_encoded_color_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DataParameter, prefetch_),
+  0,
+  2,
+  4,
+  7,
+  8,
+  1,
+  3,
+  5,
+  6,
+  9,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, nms_threshold_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, top_k_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NonMaximumSuppressionParameter, eta_),
+  1,
+  0,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, output_directory_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, output_name_prefix_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, output_format_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, label_map_file_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, name_size_file_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SaveOutputParameter, num_test_image_),
+  0,
+  1,
+  2,
+  3,
+  4,
+  5,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DropoutParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DropoutParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DropoutParameter, dropout_ratio_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DropoutParameter, scale_train_),
+  0,
+  1,
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, data_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, shape_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, num_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, channels_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, height_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::DummyDataParameter, width_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, operation_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, coeff_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EltwiseParameter, stable_prod_grad_),
+  0,
+  ~0u,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ELUParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ELUParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ELUParameter, alpha_),
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EmbedParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EmbedParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EmbedParameter, num_output_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EmbedParameter, input_dim_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EmbedParameter, bias_term_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EmbedParameter, weight_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::EmbedParameter, bias_filler_),
+  2,
+  3,
+  4,
+  0,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ExpParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ExpParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ExpParameter, base_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ExpParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ExpParameter, shift_),
+  1,
+  2,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FlattenParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FlattenParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FlattenParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::FlattenParameter, end_axis_),
+  0,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, source_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, batch_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HDF5DataParameter, shuffle_),
+  0,
+  1,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HDF5OutputParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HDF5OutputParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HDF5OutputParameter, file_name_),
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HingeLossParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HingeLossParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::HingeLossParameter, norm_),
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, source_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, batch_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, rand_skip_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, shuffle_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, new_height_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, new_width_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, is_color_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, mean_file_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, crop_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, mirror_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ImageDataParameter, root_folder_),
+  0,
+  11,
+  4,
+  5,
+  7,
+  8,
+  9,
+  10,
+  1,
+  3,
+  6,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InfogainLossParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InfogainLossParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InfogainLossParameter, source_),
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, num_output_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, bias_term_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, weight_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, bias_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InnerProductParameter, transpose_),
+  2,
+  4,
+  0,
+  1,
+  5,
+  3,
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InputParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::InputParameter, shape_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LogParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LogParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LogParameter, base_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LogParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LogParameter, shift_),
+  1,
+  2,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LRNParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LRNParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LRNParameter, local_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LRNParameter, alpha_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LRNParameter, beta_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LRNParameter, norm_region_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LRNParameter, k_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::LRNParameter, engine_),
+  2,
+  3,
+  4,
+  0,
+  5,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, batch_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, channels_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, height_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MemoryDataParameter, width_),
+  0,
+  1,
+  2,
+  3,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MVNParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MVNParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MVNParameter, normalize_variance_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MVNParameter, across_channels_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::MVNParameter, eps_),
+  1,
+  0,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParameterParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParameterParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ParameterParameter, shape_),
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, pool_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, pad_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, pad_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, pad_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, kernel_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, kernel_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, kernel_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, stride_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, stride_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, stride_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, engine_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, global_pooling_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PoolingParameter, ceil_mode_),
+  0,
+  2,
+  7,
+  8,
+  1,
+  3,
+  4,
+  11,
+  5,
+  6,
+  9,
+  10,
+  12,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PowerParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PowerParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PowerParameter, power_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PowerParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PowerParameter, shift_),
+  1,
+  2,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PythonParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PythonParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PythonParameter, module_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PythonParameter, layer_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PythonParameter, param_str_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PythonParameter, share_in_parallel_),
+  0,
+  1,
+  2,
+  3,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, num_output_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, weight_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, bias_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, debug_info_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::RecurrentParameter, expose_hidden_),
+  2,
+  0,
+  1,
+  3,
+  4,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReductionParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReductionParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReductionParameter, operation_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReductionParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReductionParameter, coeff_),
+  1,
+  0,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReLUParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReLUParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReLUParameter, negative_slope_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReLUParameter, engine_),
+  0,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, shape_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ReshapeParameter, num_axes_),
+  0,
+  1,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ScaleParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ScaleParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ScaleParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ScaleParameter, num_axes_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ScaleParameter, filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ScaleParameter, bias_term_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ScaleParameter, bias_filler_),
+  3,
+  4,
+  0,
+  2,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SigmoidParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SigmoidParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SigmoidParameter, engine_),
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SliceParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SliceParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SliceParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SliceParameter, slice_point_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SliceParameter, slice_dim_),
+  1,
+  ~0u,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SoftmaxParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SoftmaxParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SoftmaxParameter, engine_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SoftmaxParameter, axis_),
+  0,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TanHParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TanHParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TanHParameter, engine_),
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TileParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TileParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TileParameter, axis_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::TileParameter, tiles_),
+  1,
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ThresholdParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ThresholdParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ThresholdParameter, threshold_),
+  0,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, source_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, mean_file_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, batch_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, crop_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, mirror_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, fg_threshold_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, bg_threshold_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, fg_fraction_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, context_pad_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, crop_mode_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, cache_images_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::WindowDataParameter, root_folder_),
+  0,
+  9,
+  1,
+  4,
+  5,
+  6,
+  10,
+  11,
+  12,
+  8,
+  2,
+  7,
+  3,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SPPParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SPPParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SPPParameter, pyramid_height_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SPPParameter, pool_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::SPPParameter, engine_),
+  0,
+  1,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, bottom_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, top_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, include_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, exclude_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, blobs_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, blob_share_mode_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, blobs_lr_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, weight_decay_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, loss_weight_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, accuracy_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, argmax_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, concat_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, contrastive_loss_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, convolution_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, dropout_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, dummy_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, eltwise_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, exp_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, hdf5_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, hdf5_output_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, hinge_loss_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, image_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, infogain_loss_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, inner_product_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, lrn_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, memory_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, mvn_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, pooling_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, power_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, relu_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, sigmoid_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, softmax_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, slice_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, tanh_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, threshold_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, window_data_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, transform_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, loss_param_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V1LayerParameter, layer_),
+  ~0u,
+  ~0u,
+  0,
+  ~0u,
+  ~0u,
+  32,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  ~0u,
+  20,
+  16,
+  2,
+  29,
+  3,
+  4,
+  5,
+  19,
+  17,
+  30,
+  6,
+  7,
+  21,
+  8,
+  9,
+  10,
+  11,
+  15,
+  24,
+  12,
+  14,
+  22,
+  27,
+  28,
+  23,
+  26,
+  18,
+  13,
+  25,
+  31,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, num_output_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, biasterm_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, weight_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, bias_filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, pad_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, kernelsize_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, group_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, stride_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, pool_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, dropout_ratio_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, local_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, alpha_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, beta_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, k_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, source_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, meanfile_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, batchsize_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, cropsize_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, mirror_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, blobs_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, blobs_lr_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, weight_decay_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, rand_skip_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_fg_threshold_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_bg_threshold_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_fg_fraction_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_context_pad_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, det_crop_mode_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, new_num_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, new_channels_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, new_height_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, new_width_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, shuffle_images_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, concat_dim_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::V0LayerParameter, hdf5_output_param_),
+  0,
+  1,
+  8,
+  23,
+  5,
+  6,
+  9,
+  10,
+  24,
+  25,
+  11,
+  26,
+  27,
+  28,
+  29,
+  31,
+  2,
+  30,
+  3,
+  12,
+  13,
+  15,
+  ~0u,
+  ~0u,
+  ~0u,
+  17,
+  32,
+  33,
+  34,
+  18,
+  4,
+  19,
+  20,
+  21,
+  14,
+  16,
+  22,
+  7,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PReLUParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PReLUParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PReLUParameter, filler_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PReLUParameter, channel_shared_),
+  0,
+  1,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, xmin_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, ymin_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, xmax_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, ymax_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, label_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, difficult_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, score_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::NormalizedBBox, size_),
+  0,
+  1,
+  2,
+  3,
+  4,
+  5,
+  6,
+  7,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, pooled_h_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, pooled_w_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ROIPoolingParameter, spatial_scale_),
+  0,
+  1,
+  2,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, feat_stride_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, base_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, min_size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, ratio_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, pre_nms_topn_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, post_nms_topn_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::ProposalParameter, nms_thresh_),
+  0,
+  1,
+  2,
+  ~0u,
+  ~0u,
+  3,
+  4,
+  5,
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, spatial_scale_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, output_dim_),
+  PROTOBUF_FIELD_OFFSET(::opencv_caffe::PSROIPoolingParameter, group_size_),
+  0,
+  1,
+  2,
+};
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::opencv_caffe::BlobShape)},
+  { 7, 24, -1, sizeof(::opencv_caffe::BlobProto)},
+  { 35, -1, -1, sizeof(::opencv_caffe::BlobProtoVector)},
+  { 42, -1, -1, sizeof(::opencv_caffe::PermuteParameter)},
+  { 49, 59, -1, sizeof(::opencv_caffe::NormalizeBBoxParameter)},
+  { 63, 86, -1, sizeof(::opencv_caffe::PriorBoxParameter)},
+  { 103, 120, -1, sizeof(::opencv_caffe::DetectionOutputParameter)},
+  { 131, 144, -1, sizeof(::opencv_caffe::Datum)},
+  { 151, 165, -1, sizeof(::opencv_caffe::FillerParameter)},
+  { 173, 188, -1, sizeof(::opencv_caffe::NetParameter)},
+  { 197, 243, -1, sizeof(::opencv_caffe::SolverParameter)},
+  { 283, 293, -1, sizeof(::opencv_caffe::SolverState)},
+  { 297, 306, -1, sizeof(::opencv_caffe::NetState)},
+  { 309, 320, -1, sizeof(::opencv_caffe::NetStateRule)},
+  { 325, 335, -1, sizeof(::opencv_caffe::ParamSpec)},
+  { 339, 410, -1, sizeof(::opencv_caffe::LayerParameter)},
+  { 475, 488, -1, sizeof(::opencv_caffe::TransformationParameter)},
+  { 495, 504, -1, sizeof(::opencv_caffe::LossParameter)},
+  { 507, 516, -1, sizeof(::opencv_caffe::AccuracyParameter)},
+  { 519, 528, -1, sizeof(::opencv_caffe::ArgMaxParameter)},
+  { 531, 539, -1, sizeof(::opencv_caffe::ConcatParameter)},
+  { 541, 551, -1, sizeof(::opencv_caffe::BatchNormParameter)},
+  { 555, 564, -1, sizeof(::opencv_caffe::BiasParameter)},
+  { 567, 575, -1, sizeof(::opencv_caffe::ContrastiveLossParameter)},
+  { 577, 601, -1, sizeof(::opencv_caffe::ConvolutionParameter)},
+  { 619, 627, -1, sizeof(::opencv_caffe::CropParameter)},
+  { 629, 645, -1, sizeof(::opencv_caffe::DataParameter)},
+  { 655, 664, -1, sizeof(::opencv_caffe::NonMaximumSuppressionParameter)},
+  { 667, 679, -1, sizeof(::opencv_caffe::SaveOutputParameter)},
+  { 685, 693, -1, sizeof(::opencv_caffe::DropoutParameter)},
+  { 695, -1, -1, sizeof(::opencv_caffe::DummyDataParameter)},
+  { 707, 716, -1, sizeof(::opencv_caffe::EltwiseParameter)},
+  { 719, 726, -1, sizeof(::opencv_caffe::ELUParameter)},
+  { 727, 738, -1, sizeof(::opencv_caffe::EmbedParameter)},
+  { 743, 752, -1, sizeof(::opencv_caffe::ExpParameter)},
+  { 755, 763, -1, sizeof(::opencv_caffe::FlattenParameter)},
+  { 765, 774, -1, sizeof(::opencv_caffe::HDF5DataParameter)},
+  { 777, 784, -1, sizeof(::opencv_caffe::HDF5OutputParameter)},
+  { 785, 792, -1, sizeof(::opencv_caffe::HingeLossParameter)},
+  { 793, 811, -1, sizeof(::opencv_caffe::ImageDataParameter)},
+  { 823, 830, -1, sizeof(::opencv_caffe::InfogainLossParameter)},
+  { 831, 843, -1, sizeof(::opencv_caffe::InnerProductParameter)},
+  { 849, -1, -1, sizeof(::opencv_caffe::InputParameter)},
+  { 856, 865, -1, sizeof(::opencv_caffe::LogParameter)},
+  { 868, 880, -1, sizeof(::opencv_caffe::LRNParameter)},
+  { 886, 896, -1, sizeof(::opencv_caffe::MemoryDataParameter)},
+  { 900, 909, -1, sizeof(::opencv_caffe::MVNParameter)},
+  { 912, 919, -1, sizeof(::opencv_caffe::ParameterParameter)},
+  { 920, 939, -1, sizeof(::opencv_caffe::PoolingParameter)},
+  { 952, 961, -1, sizeof(::opencv_caffe::PowerParameter)},
+  { 964, 974, -1, sizeof(::opencv_caffe::PythonParameter)},
+  { 978, 989, -1, sizeof(::opencv_caffe::RecurrentParameter)},
+  { 994, 1003, -1, sizeof(::opencv_caffe::ReductionParameter)},
+  { 1006, 1014, -1, sizeof(::opencv_caffe::ReLUParameter)},
+  { 1016, 1025, -1, sizeof(::opencv_caffe::ReshapeParameter)},
+  { 1028, 1039, -1, sizeof(::opencv_caffe::ScaleParameter)},
+  { 1044, 1051, -1, sizeof(::opencv_caffe::SigmoidParameter)},
+  { 1052, 1061, -1, sizeof(::opencv_caffe::SliceParameter)},
+  { 1064, 1072, -1, sizeof(::opencv_caffe::SoftmaxParameter)},
+  { 1074, 1081, -1, sizeof(::opencv_caffe::TanHParameter)},
+  { 1082, 1090, -1, sizeof(::opencv_caffe::TileParameter)},
+  { 1092, 1099, -1, sizeof(::opencv_caffe::ThresholdParameter)},
+  { 1100, 1119, -1, sizeof(::opencv_caffe::WindowDataParameter)},
+  { 1132, 1141, -1, sizeof(::opencv_caffe::SPPParameter)},
+  { 1144, 1193, -1, sizeof(::opencv_caffe::V1LayerParameter)},
+  { 1236, 1280, -1, sizeof(::opencv_caffe::V0LayerParameter)},
+  { 1318, 1326, -1, sizeof(::opencv_caffe::PReLUParameter)},
+  { 1328, 1342, -1, sizeof(::opencv_caffe::NormalizedBBox)},
+  { 1350, 1359, -1, sizeof(::opencv_caffe::ROIPoolingParameter)},
+  { 1362, 1376, -1, sizeof(::opencv_caffe::ProposalParameter)},
+  { 1384, 1393, -1, sizeof(::opencv_caffe::PSROIPoolingParameter)},
+};
 
-      // repeated float width = 16;
-      case 16: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(133u /* 133 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 2, 133u, input, this->mutable_width())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(130u /* 130 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_width())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_BlobShape_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_BlobProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_BlobProtoVector_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_PermuteParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_NormalizeBBoxParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_PriorBoxParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_DetectionOutputParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_Datum_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_FillerParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_NetParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_SolverParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_SolverState_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_NetState_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_NetStateRule_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ParamSpec_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_LayerParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_TransformationParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_LossParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_AccuracyParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ArgMaxParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ConcatParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_BatchNormParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_BiasParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ContrastiveLossParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ConvolutionParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_CropParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_DataParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_NonMaximumSuppressionParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_SaveOutputParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_DropoutParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_DummyDataParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_EltwiseParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ELUParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_EmbedParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ExpParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_FlattenParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_HDF5DataParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_HDF5OutputParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_HingeLossParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ImageDataParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_InfogainLossParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_InnerProductParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_InputParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_LogParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_LRNParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_MemoryDataParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_MVNParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ParameterParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_PoolingParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_PowerParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_PythonParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_RecurrentParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ReductionParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ReLUParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ReshapeParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ScaleParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_SigmoidParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_SliceParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_SoftmaxParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_TanHParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_TileParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ThresholdParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_WindowDataParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_SPPParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_V1LayerParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_V0LayerParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_PReLUParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_NormalizedBBox_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ROIPoolingParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_ProposalParameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_caffe::_PSROIPoolingParameter_default_instance_),
+};
 
-      // repeated float height = 17;
-      case 17: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(141u /* 141 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 2, 141u, input, this->mutable_height())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(138u /* 138 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_height())));
-        } 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:opencv_caffe.PriorBoxParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.PriorBoxParameter)
-  return false;
-#undef DO_
+const char descriptor_table_protodef_opencv_2dcaffe_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\022opencv-caffe.proto\022\014opencv_caffe\"\034\n\tBl"
+  "obShape\022\017\n\003dim\030\001 \003(\003B\002\020\001\"\224\002\n\tBlobProto\022&"
+  "\n\005shape\030\007 \001(\0132\027.opencv_caffe.BlobShape\022\020"
+  "\n\004data\030\005 \003(\002B\002\020\001\022\020\n\004diff\030\006 \003(\002B\002\020\001\022\027\n\013do"
+  "uble_data\030\010 \003(\001B\002\020\001\022\027\n\013double_diff\030\t \003(\001"
+  "B\002\020\001\022)\n\rraw_data_type\030\n \001(\0162\022.opencv_caf"
+  "fe.Type\022\024\n\010raw_data\030\014 \001(\014B\002\020\000\022\016\n\003num\030\001 \001"
+  "(\005:\0010\022\023\n\010channels\030\002 \001(\005:\0010\022\021\n\006height\030\003 \001"
+  "(\005:\0010\022\020\n\005width\030\004 \001(\005:\0010\"9\n\017BlobProtoVect"
+  "or\022&\n\005blobs\030\001 \003(\0132\027.opencv_caffe.BlobPro"
+  "to\"!\n\020PermuteParameter\022\r\n\005order\030\001 \003(\r\"\235\001"
+  "\n\026NormalizeBBoxParameter\022\034\n\016across_spati"
+  "al\030\001 \001(\010:\004true\0223\n\014scale_filler\030\002 \001(\0132\035.o"
+  "pencv_caffe.FillerParameter\022\034\n\016channel_s"
+  "hared\030\003 \001(\010:\004true\022\022\n\003eps\030\004 \001(\002:\0051e-10\"\346\002"
+  "\n\021PriorBoxParameter\022\020\n\010min_size\030\001 \003(\002\022\020\n"
+  "\010max_size\030\002 \003(\002\022\024\n\014aspect_ratio\030\003 \003(\002\022\022\n"
+  "\004flip\030\004 \001(\010:\004true\022\022\n\004clip\030\005 \001(\010:\004true\022\020\n"
+  "\010variance\030\006 \003(\002\022\020\n\010img_size\030\007 \001(\r\022\r\n\005img"
+  "_h\030\010 \001(\r\022\r\n\005img_w\030\t \001(\r\022\014\n\004step\030\n \001(\002\022\016\n"
+  "\006step_h\030\013 \001(\002\022\016\n\006step_w\030\014 \001(\002\022\023\n\006offset\030"
+  "\r \001(\002:\0030.5\022\020\n\010offset_h\030\016 \003(\002\022\020\n\010offset_w"
+  "\030\017 \003(\002\022\r\n\005width\030\020 \003(\002\022\016\n\006height\030\021 \003(\002\"\'\n"
+  "\010CodeType\022\n\n\006CORNER\020\001\022\017\n\013CENTER_SIZE\020\002\"\307"
+  "\003\n\030DetectionOutputParameter\022\023\n\013num_class"
+  "es\030\001 \001(\r\022\034\n\016share_location\030\002 \001(\010:\004true\022\036"
+  "\n\023background_label_id\030\003 \001(\005:\0010\022\?\n\tnms_pa"
+  "ram\030\004 \001(\0132,.opencv_caffe.NonMaximumSuppr"
+  "essionParameter\022<\n\021save_output_param\030\005 \001"
+  "(\0132!.opencv_caffe.SaveOutputParameter\022C\n"
+  "\tcode_type\030\006 \001(\0162(.opencv_caffe.PriorBox"
+  "Parameter.CodeType:\006CORNER\022)\n\032variance_e"
+  "ncoded_in_target\030\010 \001(\010:\005false\022\026\n\nkeep_to"
+  "p_k\030\007 \001(\005:\002-1\022\034\n\024confidence_threshold\030\t "
+  "\001(\002\022\035\n\017normalized_bbox\030\n \001(\010:\004true\022\024\n\004cl"
+  "ip\030\350\007 \001(\010:\005false\"\201\001\n\005Datum\022\020\n\010channels\030\001"
+  " \001(\005\022\016\n\006height\030\002 \001(\005\022\r\n\005width\030\003 \001(\005\022\014\n\004d"
+  "ata\030\004 \001(\014\022\r\n\005label\030\005 \001(\005\022\022\n\nfloat_data\030\006"
+  " \003(\002\022\026\n\007encoded\030\007 \001(\010:\005false\"\221\002\n\017FillerP"
+  "arameter\022\026\n\004type\030\001 \001(\t:\010constant\022\020\n\005valu"
+  "e\030\002 \001(\002:\0010\022\016\n\003min\030\003 \001(\002:\0010\022\016\n\003max\030\004 \001(\002:"
+  "\0011\022\017\n\004mean\030\005 \001(\002:\0010\022\016\n\003std\030\006 \001(\002:\0011\022\022\n\006s"
+  "parse\030\007 \001(\005:\002-1\022I\n\rvariance_norm\030\010 \001(\0162*"
+  ".opencv_caffe.FillerParameter.VarianceNo"
+  "rm:\006FAN_IN\"4\n\014VarianceNorm\022\n\n\006FAN_IN\020\000\022\013"
+  "\n\007FAN_OUT\020\001\022\013\n\007AVERAGE\020\002\"\252\002\n\014NetParamete"
+  "r\022\014\n\004name\030\001 \001(\t\022\r\n\005input\030\003 \003(\t\022,\n\013input_"
+  "shape\030\010 \003(\0132\027.opencv_caffe.BlobShape\022\021\n\t"
+  "input_dim\030\004 \003(\005\022\035\n\016force_backward\030\005 \001(\010:"
+  "\005false\022%\n\005state\030\006 \001(\0132\026.opencv_caffe.Net"
+  "State\022\031\n\ndebug_info\030\007 \001(\010:\005false\022+\n\005laye"
+  "r\030d \003(\0132\034.opencv_caffe.LayerParameter\022.\n"
+  "\006layers\030\002 \003(\0132\036.opencv_caffe.V1LayerPara"
+  "meter\"\332\n\n\017SolverParameter\022\013\n\003net\030\030 \001(\t\022-"
+  "\n\tnet_param\030\031 \001(\0132\032.opencv_caffe.NetPara"
+  "meter\022\021\n\ttrain_net\030\001 \001(\t\022\020\n\010test_net\030\002 \003"
+  "(\t\0223\n\017train_net_param\030\025 \001(\0132\032.opencv_caf"
+  "fe.NetParameter\0222\n\016test_net_param\030\026 \003(\0132"
+  "\032.opencv_caffe.NetParameter\022+\n\013train_sta"
+  "te\030\032 \001(\0132\026.opencv_caffe.NetState\022*\n\ntest"
+  "_state\030\033 \003(\0132\026.opencv_caffe.NetState\022\021\n\t"
+  "test_iter\030\003 \003(\005\022\030\n\rtest_interval\030\004 \001(\005:\001"
+  "0\022 \n\021test_compute_loss\030\023 \001(\010:\005false\022!\n\023t"
+  "est_initialization\030  \001(\010:\004true\022\017\n\007base_l"
+  "r\030\005 \001(\002\022\017\n\007display\030\006 \001(\005\022\027\n\014average_loss"
+  "\030! \001(\005:\0011\022\020\n\010max_iter\030\007 \001(\005\022\024\n\titer_size"
+  "\030$ \001(\005:\0011\022\021\n\tlr_policy\030\010 \001(\t\022\r\n\005gamma\030\t "
+  "\001(\002\022\r\n\005power\030\n \001(\002\022\020\n\010momentum\030\013 \001(\002\022\024\n\014"
+  "weight_decay\030\014 \001(\002\022\037\n\023regularization_typ"
+  "e\030\035 \001(\t:\002L2\022\020\n\010stepsize\030\r \001(\005\022\021\n\tstepval"
+  "ue\030\" \003(\005\022\032\n\016clip_gradients\030# \001(\002:\002-1\022\023\n\010"
+  "snapshot\030\016 \001(\005:\0010\022\027\n\017snapshot_prefix\030\017 \001"
+  "(\t\022\034\n\rsnapshot_diff\030\020 \001(\010:\005false\022R\n\017snap"
+  "shot_format\030% \001(\0162,.opencv_caffe.SolverP"
+  "arameter.SnapshotFormat:\013BINARYPROTO\022B\n\013"
+  "solver_mode\030\021 \001(\0162(.opencv_caffe.SolverP"
+  "arameter.SolverMode:\003GPU\022\024\n\tdevice_id\030\022 "
+  "\001(\005:\0010\022\027\n\013random_seed\030\024 \001(\003:\002-1\022\021\n\004type\030"
+  "( \001(\t:\003SGD\022\024\n\005delta\030\037 \001(\002:\0051e-08\022\030\n\tmome"
+  "ntum2\030\' \001(\002:\0050.999\022\027\n\trms_decay\030& \001(\002:\0040"
+  ".99\022\031\n\ndebug_info\030\027 \001(\010:\005false\022\"\n\024snapsh"
+  "ot_after_train\030\034 \001(\010:\004true\022B\n\013solver_typ"
+  "e\030\036 \001(\0162(.opencv_caffe.SolverParameter.S"
+  "olverType:\003SGD\"+\n\016SnapshotFormat\022\010\n\004HDF5"
+  "\020\000\022\017\n\013BINARYPROTO\020\001\"\036\n\nSolverMode\022\007\n\003CPU"
+  "\020\000\022\007\n\003GPU\020\001\"U\n\nSolverType\022\007\n\003SGD\020\000\022\014\n\010NE"
+  "STEROV\020\001\022\013\n\007ADAGRAD\020\002\022\013\n\007RMSPROP\020\003\022\014\n\010AD"
+  "ADELTA\020\004\022\010\n\004ADAM\020\005\"s\n\013SolverState\022\014\n\004ite"
+  "r\030\001 \001(\005\022\023\n\013learned_net\030\002 \001(\t\022(\n\007history\030"
+  "\003 \003(\0132\027.opencv_caffe.BlobProto\022\027\n\014curren"
+  "t_step\030\004 \001(\005:\0010\"U\n\010NetState\022(\n\005phase\030\001 \001"
+  "(\0162\023.opencv_caffe.Phase:\004TEST\022\020\n\005level\030\002"
+  " \001(\005:\0010\022\r\n\005stage\030\003 \003(\t\"z\n\014NetStateRule\022\""
+  "\n\005phase\030\001 \001(\0162\023.opencv_caffe.Phase\022\021\n\tmi"
+  "n_level\030\002 \001(\005\022\021\n\tmax_level\030\003 \001(\005\022\r\n\005stag"
+  "e\030\004 \003(\t\022\021\n\tnot_stage\030\005 \003(\t\"\252\001\n\tParamSpec"
+  "\022\014\n\004name\030\001 \001(\t\0228\n\nshare_mode\030\002 \001(\0162$.ope"
+  "ncv_caffe.ParamSpec.DimCheckMode\022\022\n\007lr_m"
+  "ult\030\003 \001(\002:\0011\022\025\n\ndecay_mult\030\004 \001(\002:\0011\"*\n\014D"
+  "imCheckMode\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\""
+  "\243\032\n\016LayerParameter\022\014\n\004name\030\001 \001(\t\022\014\n\004type"
+  "\030\002 \001(\t\022\016\n\006bottom\030\003 \003(\t\022\013\n\003top\030\004 \003(\t\022\"\n\005p"
+  "hase\030\n \001(\0162\023.opencv_caffe.Phase\022\023\n\013loss_"
+  "weight\030\005 \003(\002\022&\n\005param\030\006 \003(\0132\027.opencv_caf"
+  "fe.ParamSpec\022&\n\005blobs\030\007 \003(\0132\027.opencv_caf"
+  "fe.BlobProto\022\026\n\016propagate_down\030\013 \003(\010\022+\n\007"
+  "include\030\010 \003(\0132\032.opencv_caffe.NetStateRul"
+  "e\022+\n\007exclude\030\t \003(\0132\032.opencv_caffe.NetSta"
+  "teRule\022>\n\017transform_param\030d \001(\0132%.opencv"
+  "_caffe.TransformationParameter\022/\n\nloss_p"
+  "aram\030e \001(\0132\033.opencv_caffe.LossParameter\022"
+  "7\n\016accuracy_param\030f \001(\0132\037.opencv_caffe.A"
+  "ccuracyParameter\0223\n\014argmax_param\030g \001(\0132\035"
+  ".opencv_caffe.ArgMaxParameter\022;\n\020batch_n"
+  "orm_param\030\213\001 \001(\0132 .opencv_caffe.BatchNor"
+  "mParameter\0220\n\nbias_param\030\215\001 \001(\0132\033.opencv"
+  "_caffe.BiasParameter\0223\n\014concat_param\030h \001"
+  "(\0132\035.opencv_caffe.ConcatParameter\022F\n\026con"
+  "trastive_loss_param\030i \001(\0132&.opencv_caffe"
+  ".ContrastiveLossParameter\022=\n\021convolution"
+  "_param\030j \001(\0132\".opencv_caffe.ConvolutionP"
+  "arameter\0220\n\ncrop_param\030\220\001 \001(\0132\033.opencv_c"
+  "affe.CropParameter\022/\n\ndata_param\030k \001(\0132\033"
+  ".opencv_caffe.DataParameter\022G\n\026detection"
+  "_output_param\030\223\001 \001(\0132&.opencv_caffe.Dete"
+  "ctionOutputParameter\0225\n\rdropout_param\030l "
+  "\001(\0132\036.opencv_caffe.DropoutParameter\022:\n\020d"
+  "ummy_data_param\030m \001(\0132 .opencv_caffe.Dum"
+  "myDataParameter\0225\n\reltwise_param\030n \001(\0132\036"
+  ".opencv_caffe.EltwiseParameter\022.\n\telu_pa"
+  "ram\030\214\001 \001(\0132\032.opencv_caffe.ELUParameter\0222"
+  "\n\013embed_param\030\211\001 \001(\0132\034.opencv_caffe.Embe"
+  "dParameter\022-\n\texp_param\030o \001(\0132\032.opencv_c"
+  "affe.ExpParameter\0226\n\rflatten_param\030\207\001 \001("
+  "\0132\036.opencv_caffe.FlattenParameter\0228\n\017hdf"
+  "5_data_param\030p \001(\0132\037.opencv_caffe.HDF5Da"
+  "taParameter\022<\n\021hdf5_output_param\030q \001(\0132!"
+  ".opencv_caffe.HDF5OutputParameter\022:\n\020hin"
+  "ge_loss_param\030r \001(\0132 .opencv_caffe.Hinge"
+  "LossParameter\022:\n\020image_data_param\030s \001(\0132"
+  " .opencv_caffe.ImageDataParameter\022@\n\023inf"
+  "ogain_loss_param\030t \001(\0132#.opencv_caffe.In"
+  "fogainLossParameter\022@\n\023inner_product_par"
+  "am\030u \001(\0132#.opencv_caffe.InnerProductPara"
+  "meter\0222\n\013input_param\030\217\001 \001(\0132\034.opencv_caf"
+  "fe.InputParameter\022.\n\tlog_param\030\206\001 \001(\0132\032."
+  "opencv_caffe.LogParameter\022-\n\tlrn_param\030v"
+  " \001(\0132\032.opencv_caffe.LRNParameter\022<\n\021memo"
+  "ry_data_param\030w \001(\0132!.opencv_caffe.Memor"
+  "yDataParameter\022-\n\tmvn_param\030x \001(\0132\032.open"
+  "cv_caffe.MVNParameter\0229\n\nnorm_param\030\225\001 \001"
+  "(\0132$.opencv_caffe.NormalizeBBoxParameter"
+  "\0226\n\rpermute_param\030\224\001 \001(\0132\036.opencv_caffe."
+  "PermuteParameter\022:\n\017parameter_param\030\221\001 \001"
+  "(\0132 .opencv_caffe.ParameterParameter\0225\n\r"
+  "pooling_param\030y \001(\0132\036.opencv_caffe.Pooli"
+  "ngParameter\0221\n\013power_param\030z \001(\0132\034.openc"
+  "v_caffe.PowerParameter\0222\n\013prelu_param\030\203\001"
+  " \001(\0132\034.opencv_caffe.PReLUParameter\0229\n\017pr"
+  "ior_box_param\030\226\001 \001(\0132\037.opencv_caffe.Prio"
+  "rBoxParameter\0228\n\016proposal_param\030\311\001 \001(\0132\037"
+  ".opencv_caffe.ProposalParameter\022A\n\023psroi"
+  "_pooling_param\030\222N \001(\0132#.opencv_caffe.PSR"
+  "OIPoolingParameter\0224\n\014python_param\030\202\001 \001("
+  "\0132\035.opencv_caffe.PythonParameter\022:\n\017recu"
+  "rrent_param\030\222\001 \001(\0132 .opencv_caffe.Recurr"
+  "entParameter\022:\n\017reduction_param\030\210\001 \001(\0132 "
+  ".opencv_caffe.ReductionParameter\022/\n\nrelu"
+  "_param\030{ \001(\0132\033.opencv_caffe.ReLUParamete"
+  "r\0226\n\rreshape_param\030\205\001 \001(\0132\036.opencv_caffe"
+  ".ReshapeParameter\022\?\n\021roi_pooling_param\030\327"
+  "\307\370\003 \001(\0132!.opencv_caffe.ROIPoolingParamet"
+  "er\0222\n\013scale_param\030\216\001 \001(\0132\034.opencv_caffe."
+  "ScaleParameter\0225\n\rsigmoid_param\030| \001(\0132\036."
+  "opencv_caffe.SigmoidParameter\0225\n\rsoftmax"
+  "_param\030} \001(\0132\036.opencv_caffe.SoftmaxParam"
+  "eter\022.\n\tspp_param\030\204\001 \001(\0132\032.opencv_caffe."
+  "SPPParameter\0221\n\013slice_param\030~ \001(\0132\034.open"
+  "cv_caffe.SliceParameter\022/\n\ntanh_param\030\177 "
+  "\001(\0132\033.opencv_caffe.TanHParameter\022:\n\017thre"
+  "shold_param\030\200\001 \001(\0132 .opencv_caffe.Thresh"
+  "oldParameter\0220\n\ntile_param\030\212\001 \001(\0132\033.open"
+  "cv_caffe.TileParameter\022=\n\021window_data_pa"
+  "ram\030\201\001 \001(\0132!.opencv_caffe.WindowDataPara"
+  "meter\"\266\001\n\027TransformationParameter\022\020\n\005sca"
+  "le\030\001 \001(\002:\0011\022\025\n\006mirror\030\002 \001(\010:\005false\022\024\n\tcr"
+  "op_size\030\003 \001(\r:\0010\022\021\n\tmean_file\030\004 \001(\t\022\022\n\nm"
+  "ean_value\030\005 \003(\002\022\032\n\013force_color\030\006 \001(\010:\005fa"
+  "lse\022\031\n\nforce_gray\030\007 \001(\010:\005false\"\311\001\n\rLossP"
+  "arameter\022\024\n\014ignore_label\030\001 \001(\005\022K\n\rnormal"
+  "ization\030\003 \001(\0162-.opencv_caffe.LossParamet"
+  "er.NormalizationMode:\005VALID\022\021\n\tnormalize"
+  "\030\002 \001(\010\"B\n\021NormalizationMode\022\010\n\004FULL\020\000\022\t\n"
+  "\005VALID\020\001\022\016\n\nBATCH_SIZE\020\002\022\010\n\004NONE\020\003\"L\n\021Ac"
+  "curacyParameter\022\020\n\005top_k\030\001 \001(\r:\0011\022\017\n\004axi"
+  "s\030\002 \001(\005:\0011\022\024\n\014ignore_label\030\003 \001(\005\"M\n\017ArgM"
+  "axParameter\022\032\n\013out_max_val\030\001 \001(\010:\005false\022"
+  "\020\n\005top_k\030\002 \001(\r:\0011\022\014\n\004axis\030\003 \001(\005\"9\n\017Conca"
+  "tParameter\022\017\n\004axis\030\002 \001(\005:\0011\022\025\n\nconcat_di"
+  "m\030\001 \001(\r:\0011\"\205\001\n\022BatchNormParameter\022\030\n\020use"
+  "_global_stats\030\001 \001(\010\022&\n\027moving_average_fr"
+  "action\030\002 \001(\002:\0050.999\022\022\n\003eps\030\003 \001(\002:\0051e-05\022"
+  "\031\n\nscale_bias\030\007 \001(\010:\005false\"d\n\rBiasParame"
+  "ter\022\017\n\004axis\030\001 \001(\005:\0011\022\023\n\010num_axes\030\002 \001(\005:\001"
+  "1\022-\n\006filler\030\003 \001(\0132\035.opencv_caffe.FillerP"
+  "arameter\"L\n\030ContrastiveLossParameter\022\021\n\006"
+  "margin\030\001 \001(\002:\0011\022\035\n\016legacy_version\030\002 \001(\010:"
+  "\005false\"\221\004\n\024ConvolutionParameter\022\022\n\nnum_o"
+  "utput\030\001 \001(\r\022\027\n\tbias_term\030\002 \001(\010:\004true\022\013\n\003"
+  "pad\030\003 \003(\r\022\023\n\013kernel_size\030\004 \003(\r\022\016\n\006stride"
+  "\030\006 \003(\r\022\020\n\010dilation\030\022 \003(\r\022\020\n\005pad_h\030\t \001(\r:"
+  "\0010\022\020\n\005pad_w\030\n \001(\r:\0010\022\020\n\010kernel_h\030\013 \001(\r\022\020"
+  "\n\010kernel_w\030\014 \001(\r\022\020\n\010stride_h\030\r \001(\r\022\020\n\010st"
+  "ride_w\030\016 \001(\r\022\020\n\005group\030\005 \001(\r:\0011\0224\n\rweight"
+  "_filler\030\007 \001(\0132\035.opencv_caffe.FillerParam"
+  "eter\0222\n\013bias_filler\030\010 \001(\0132\035.opencv_caffe"
+  ".FillerParameter\022B\n\006engine\030\017 \001(\0162).openc"
+  "v_caffe.ConvolutionParameter.Engine:\007DEF"
+  "AULT\022\017\n\004axis\030\020 \001(\005:\0011\022\036\n\017force_nd_im2col"
+  "\030\021 \001(\010:\005false\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005"
+  "CAFFE\020\001\022\t\n\005CUDNN\020\002\"0\n\rCropParameter\022\017\n\004a"
+  "xis\030\001 \001(\005:\0012\022\016\n\006offset\030\002 \003(\r\"\253\002\n\rDataPar"
+  "ameter\022\016\n\006source\030\001 \001(\t\022\022\n\nbatch_size\030\004 \001"
+  "(\r\022\024\n\trand_skip\030\007 \001(\r:\0010\0228\n\007backend\030\010 \001("
+  "\0162\036.opencv_caffe.DataParameter.DB:\007LEVEL"
+  "DB\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\tmean_file\030\003 \001(\t\022"
+  "\024\n\tcrop_size\030\005 \001(\r:\0010\022\025\n\006mirror\030\006 \001(\010:\005f"
+  "alse\022\"\n\023force_encoded_color\030\t \001(\010:\005false"
+  "\022\023\n\010prefetch\030\n \001(\r:\0014\"\033\n\002DB\022\013\n\007LEVELDB\020\000"
+  "\022\010\n\004LMDB\020\001\"[\n\036NonMaximumSuppressionParam"
+  "eter\022\032\n\rnms_threshold\030\001 \001(\002:\0030.3\022\r\n\005top_"
+  "k\030\002 \001(\005\022\016\n\003eta\030\003 \001(\002:\0011\"\252\001\n\023SaveOutputPa"
+  "rameter\022\030\n\020output_directory\030\001 \001(\t\022\032\n\022out"
+  "put_name_prefix\030\002 \001(\t\022\025\n\routput_format\030\003"
+  " \001(\t\022\026\n\016label_map_file\030\004 \001(\t\022\026\n\016name_siz"
+  "e_file\030\005 \001(\t\022\026\n\016num_test_image\030\006 \001(\r\"I\n\020"
+  "DropoutParameter\022\032\n\rdropout_ratio\030\001 \001(\002:"
+  "\0030.5\022\031\n\013scale_train\030\002 \001(\010:\004true\"\256\001\n\022Dumm"
+  "yDataParameter\0222\n\013data_filler\030\001 \003(\0132\035.op"
+  "encv_caffe.FillerParameter\022&\n\005shape\030\006 \003("
+  "\0132\027.opencv_caffe.BlobShape\022\013\n\003num\030\002 \003(\r\022"
+  "\020\n\010channels\030\003 \003(\r\022\016\n\006height\030\004 \003(\r\022\r\n\005wid"
+  "th\030\005 \003(\r\"\254\001\n\020EltwiseParameter\022@\n\toperati"
+  "on\030\001 \001(\0162(.opencv_caffe.EltwiseParameter"
+  ".EltwiseOp:\003SUM\022\r\n\005coeff\030\002 \003(\002\022\036\n\020stable"
+  "_prod_grad\030\003 \001(\010:\004true\"\'\n\tEltwiseOp\022\010\n\004P"
+  "ROD\020\000\022\007\n\003SUM\020\001\022\007\n\003MAX\020\002\" \n\014ELUParameter\022"
+  "\020\n\005alpha\030\001 \001(\002:\0011\"\272\001\n\016EmbedParameter\022\022\n\n"
+  "num_output\030\001 \001(\r\022\021\n\tinput_dim\030\002 \001(\r\022\027\n\tb"
+  "ias_term\030\003 \001(\010:\004true\0224\n\rweight_filler\030\004 "
+  "\001(\0132\035.opencv_caffe.FillerParameter\0222\n\013bi"
+  "as_filler\030\005 \001(\0132\035.opencv_caffe.FillerPar"
+  "ameter\"D\n\014ExpParameter\022\020\n\004base\030\001 \001(\002:\002-1"
+  "\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005shift\030\003 \001(\002:\0010\"9\n\020"
+  "FlattenParameter\022\017\n\004axis\030\001 \001(\005:\0011\022\024\n\010end"
+  "_axis\030\002 \001(\005:\002-1\"O\n\021HDF5DataParameter\022\016\n\006"
+  "source\030\001 \001(\t\022\022\n\nbatch_size\030\002 \001(\r\022\026\n\007shuf"
+  "fle\030\003 \001(\010:\005false\"(\n\023HDF5OutputParameter\022"
+  "\021\n\tfile_name\030\001 \001(\t\"e\n\022HingeLossParameter"
+  "\0227\n\004norm\030\001 \001(\0162%.opencv_caffe.HingeLossP"
+  "arameter.Norm:\002L1\"\026\n\004Norm\022\006\n\002L1\020\001\022\006\n\002L2\020"
+  "\002\"\227\002\n\022ImageDataParameter\022\016\n\006source\030\001 \001(\t"
+  "\022\025\n\nbatch_size\030\004 \001(\r:\0011\022\024\n\trand_skip\030\007 \001"
+  "(\r:\0010\022\026\n\007shuffle\030\010 \001(\010:\005false\022\025\n\nnew_hei"
+  "ght\030\t \001(\r:\0010\022\024\n\tnew_width\030\n \001(\r:\0010\022\026\n\010is"
+  "_color\030\013 \001(\010:\004true\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\t"
+  "mean_file\030\003 \001(\t\022\024\n\tcrop_size\030\005 \001(\r:\0010\022\025\n"
+  "\006mirror\030\006 \001(\010:\005false\022\025\n\013root_folder\030\014 \001("
+  "\t:\000\"\'\n\025InfogainLossParameter\022\016\n\006source\030\001"
+  " \001(\t\"\331\001\n\025InnerProductParameter\022\022\n\nnum_ou"
+  "tput\030\001 \001(\r\022\027\n\tbias_term\030\002 \001(\010:\004true\0224\n\rw"
+  "eight_filler\030\003 \001(\0132\035.opencv_caffe.Filler"
+  "Parameter\0222\n\013bias_filler\030\004 \001(\0132\035.opencv_"
+  "caffe.FillerParameter\022\017\n\004axis\030\005 \001(\005:\0011\022\030"
+  "\n\ttranspose\030\006 \001(\010:\005false\"8\n\016InputParamet"
+  "er\022&\n\005shape\030\001 \003(\0132\027.opencv_caffe.BlobSha"
+  "pe\"D\n\014LogParameter\022\020\n\004base\030\001 \001(\002:\002-1\022\020\n\005"
+  "scale\030\002 \001(\002:\0011\022\020\n\005shift\030\003 \001(\002:\0010\"\306\002\n\014LRN"
+  "Parameter\022\025\n\nlocal_size\030\001 \001(\r:\0015\022\020\n\005alph"
+  "a\030\002 \001(\002:\0011\022\022\n\004beta\030\003 \001(\002:\0040.75\022K\n\013norm_r"
+  "egion\030\004 \001(\0162%.opencv_caffe.LRNParameter."
+  "NormRegion:\017ACROSS_CHANNELS\022\014\n\001k\030\005 \001(\002:\001"
+  "1\022:\n\006engine\030\006 \001(\0162!.opencv_caffe.LRNPara"
+  "meter.Engine:\007DEFAULT\"5\n\nNormRegion\022\023\n\017A"
+  "CROSS_CHANNELS\020\000\022\022\n\016WITHIN_CHANNEL\020\001\"+\n\006"
+  "Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020"
+  "\002\"Z\n\023MemoryDataParameter\022\022\n\nbatch_size\030\001"
+  " \001(\r\022\020\n\010channels\030\002 \001(\r\022\016\n\006height\030\003 \001(\r\022\r"
+  "\n\005width\030\004 \001(\r\"d\n\014MVNParameter\022 \n\022normali"
+  "ze_variance\030\001 \001(\010:\004true\022\036\n\017across_channe"
+  "ls\030\002 \001(\010:\005false\022\022\n\003eps\030\003 \001(\002:\0051e-09\"<\n\022P"
+  "arameterParameter\022&\n\005shape\030\001 \001(\0132\027.openc"
+  "v_caffe.BlobShape\"\311\003\n\020PoolingParameter\022<"
+  "\n\004pool\030\001 \001(\0162).opencv_caffe.PoolingParam"
+  "eter.PoolMethod:\003MAX\022\016\n\003pad\030\004 \001(\r:\0010\022\020\n\005"
+  "pad_h\030\t \001(\r:\0010\022\020\n\005pad_w\030\n \001(\r:\0010\022\023\n\013kern"
+  "el_size\030\002 \001(\r\022\020\n\010kernel_h\030\005 \001(\r\022\020\n\010kerne"
+  "l_w\030\006 \001(\r\022\021\n\006stride\030\003 \001(\r:\0011\022\020\n\010stride_h"
+  "\030\007 \001(\r\022\020\n\010stride_w\030\010 \001(\r\022>\n\006engine\030\013 \001(\016"
+  "2%.opencv_caffe.PoolingParameter.Engine:"
+  "\007DEFAULT\022\035\n\016global_pooling\030\014 \001(\010:\005false\022"
+  "\027\n\tceil_mode\030\r \001(\010:\004true\".\n\nPoolMethod\022\007"
+  "\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002\"+\n\006Engi"
+  "ne\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"F\n"
+  "\016PowerParameter\022\020\n\005power\030\001 \001(\002:\0011\022\020\n\005sca"
+  "le\030\002 \001(\002:\0011\022\020\n\005shift\030\003 \001(\002:\0010\"g\n\017PythonP"
+  "arameter\022\016\n\006module\030\001 \001(\t\022\r\n\005layer\030\002 \001(\t\022"
+  "\023\n\tparam_str\030\003 \001(\t:\000\022 \n\021share_in_paralle"
+  "l\030\004 \001(\010:\005false\"\316\001\n\022RecurrentParameter\022\025\n"
+  "\nnum_output\030\001 \001(\r:\0010\0224\n\rweight_filler\030\002 "
+  "\001(\0132\035.opencv_caffe.FillerParameter\0222\n\013bi"
+  "as_filler\030\003 \001(\0132\035.opencv_caffe.FillerPar"
+  "ameter\022\031\n\ndebug_info\030\004 \001(\010:\005false\022\034\n\rexp"
+  "ose_hidden\030\005 \001(\010:\005false\"\264\001\n\022ReductionPar"
+  "ameter\022D\n\toperation\030\001 \001(\0162,.opencv_caffe"
+  ".ReductionParameter.ReductionOp:\003SUM\022\017\n\004"
+  "axis\030\002 \001(\005:\0010\022\020\n\005coeff\030\003 \001(\002:\0011\"5\n\013Reduc"
+  "tionOp\022\007\n\003SUM\020\001\022\010\n\004ASUM\020\002\022\t\n\005SUMSQ\020\003\022\010\n\004"
+  "MEAN\020\004\"\224\001\n\rReLUParameter\022\031\n\016negative_slo"
+  "pe\030\001 \001(\002:\0010\022;\n\006engine\030\002 \001(\0162\".opencv_caf"
+  "fe.ReLUParameter.Engine:\007DEFAULT\"+\n\006Engi"
+  "ne\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"a\n"
+  "\020ReshapeParameter\022&\n\005shape\030\001 \001(\0132\027.openc"
+  "v_caffe.BlobShape\022\017\n\004axis\030\002 \001(\005:\0010\022\024\n\010nu"
+  "m_axes\030\003 \001(\005:\002-1\"\263\001\n\016ScaleParameter\022\017\n\004a"
+  "xis\030\001 \001(\005:\0011\022\023\n\010num_axes\030\002 \001(\005:\0011\022-\n\006fil"
+  "ler\030\003 \001(\0132\035.opencv_caffe.FillerParameter"
+  "\022\030\n\tbias_term\030\004 \001(\010:\005false\0222\n\013bias_fille"
+  "r\030\005 \001(\0132\035.opencv_caffe.FillerParameter\"\177"
+  "\n\020SigmoidParameter\022>\n\006engine\030\001 \001(\0162%.ope"
+  "ncv_caffe.SigmoidParameter.Engine:\007DEFAU"
+  "LT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005"
+  "CUDNN\020\002\"L\n\016SliceParameter\022\017\n\004axis\030\003 \001(\005:"
+  "\0011\022\023\n\013slice_point\030\002 \003(\r\022\024\n\tslice_dim\030\001 \001"
+  "(\r:\0011\"\220\001\n\020SoftmaxParameter\022>\n\006engine\030\001 \001"
+  "(\0162%.opencv_caffe.SoftmaxParameter.Engin"
+  "e:\007DEFAULT\022\017\n\004axis\030\002 \001(\005:\0011\"+\n\006Engine\022\013\n"
+  "\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"y\n\rTanH"
+  "Parameter\022;\n\006engine\030\001 \001(\0162\".opencv_caffe"
+  ".TanHParameter.Engine:\007DEFAULT\"+\n\006Engine"
+  "\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"/\n\rT"
+  "ileParameter\022\017\n\004axis\030\001 \001(\005:\0011\022\r\n\005tiles\030\002"
+  " \001(\005\"*\n\022ThresholdParameter\022\024\n\tthreshold\030"
+  "\001 \001(\002:\0010\"\301\002\n\023WindowDataParameter\022\016\n\006sour"
+  "ce\030\001 \001(\t\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\tmean_file\030"
+  "\003 \001(\t\022\022\n\nbatch_size\030\004 \001(\r\022\024\n\tcrop_size\030\005"
+  " \001(\r:\0010\022\025\n\006mirror\030\006 \001(\010:\005false\022\031\n\014fg_thr"
+  "eshold\030\007 \001(\002:\0030.5\022\031\n\014bg_threshold\030\010 \001(\002:"
+  "\0030.5\022\031\n\013fg_fraction\030\t \001(\002:\0040.25\022\026\n\013conte"
+  "xt_pad\030\n \001(\r:\0010\022\027\n\tcrop_mode\030\013 \001(\t:\004warp"
+  "\022\033\n\014cache_images\030\014 \001(\010:\005false\022\025\n\013root_fo"
+  "lder\030\r \001(\t:\000\"\371\001\n\014SPPParameter\022\026\n\016pyramid"
+  "_height\030\001 \001(\r\0228\n\004pool\030\002 \001(\0162%.opencv_caf"
+  "fe.SPPParameter.PoolMethod:\003MAX\022:\n\006engin"
+  "e\030\006 \001(\0162!.opencv_caffe.SPPParameter.Engi"
+  "ne:\007DEFAULT\".\n\nPoolMethod\022\007\n\003MAX\020\000\022\007\n\003AV"
+  "E\020\001\022\016\n\nSTOCHASTIC\020\002\"+\n\006Engine\022\013\n\007DEFAULT"
+  "\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"\334\025\n\020V1LayerPara"
+  "meter\022\016\n\006bottom\030\002 \003(\t\022\013\n\003top\030\003 \003(\t\022\014\n\004na"
+  "me\030\004 \001(\t\022+\n\007include\030  \003(\0132\032.opencv_caffe"
+  ".NetStateRule\022+\n\007exclude\030! \003(\0132\032.opencv_"
+  "caffe.NetStateRule\0226\n\004type\030\005 \001(\0162(.openc"
+  "v_caffe.V1LayerParameter.LayerType\022&\n\005bl"
+  "obs\030\006 \003(\0132\027.opencv_caffe.BlobProto\022\016\n\005pa"
+  "ram\030\351\007 \003(\t\022E\n\017blob_share_mode\030\352\007 \003(\0162+.o"
+  "pencv_caffe.V1LayerParameter.DimCheckMod"
+  "e\022\020\n\010blobs_lr\030\007 \003(\002\022\024\n\014weight_decay\030\010 \003("
+  "\002\022\023\n\013loss_weight\030# \003(\002\0227\n\016accuracy_param"
+  "\030\033 \001(\0132\037.opencv_caffe.AccuracyParameter\022"
+  "3\n\014argmax_param\030\027 \001(\0132\035.opencv_caffe.Arg"
+  "MaxParameter\0223\n\014concat_param\030\t \001(\0132\035.ope"
+  "ncv_caffe.ConcatParameter\022F\n\026contrastive"
+  "_loss_param\030( \001(\0132&.opencv_caffe.Contras"
+  "tiveLossParameter\022=\n\021convolution_param\030\n"
+  " \001(\0132\".opencv_caffe.ConvolutionParameter"
+  "\022/\n\ndata_param\030\013 \001(\0132\033.opencv_caffe.Data"
+  "Parameter\0225\n\rdropout_param\030\014 \001(\0132\036.openc"
+  "v_caffe.DropoutParameter\022:\n\020dummy_data_p"
+  "aram\030\032 \001(\0132 .opencv_caffe.DummyDataParam"
+  "eter\0225\n\reltwise_param\030\030 \001(\0132\036.opencv_caf"
+  "fe.EltwiseParameter\022-\n\texp_param\030) \001(\0132\032"
+  ".opencv_caffe.ExpParameter\0228\n\017hdf5_data_"
+  "param\030\r \001(\0132\037.opencv_caffe.HDF5DataParam"
+  "eter\022<\n\021hdf5_output_param\030\016 \001(\0132!.opencv"
+  "_caffe.HDF5OutputParameter\022:\n\020hinge_loss"
+  "_param\030\035 \001(\0132 .opencv_caffe.HingeLossPar"
+  "ameter\022:\n\020image_data_param\030\017 \001(\0132 .openc"
+  "v_caffe.ImageDataParameter\022@\n\023infogain_l"
+  "oss_param\030\020 \001(\0132#.opencv_caffe.InfogainL"
+  "ossParameter\022@\n\023inner_product_param\030\021 \001("
+  "\0132#.opencv_caffe.InnerProductParameter\022-"
+  "\n\tlrn_param\030\022 \001(\0132\032.opencv_caffe.LRNPara"
+  "meter\022<\n\021memory_data_param\030\026 \001(\0132!.openc"
+  "v_caffe.MemoryDataParameter\022-\n\tmvn_param"
+  "\030\" \001(\0132\032.opencv_caffe.MVNParameter\0225\n\rpo"
+  "oling_param\030\023 \001(\0132\036.opencv_caffe.Pooling"
+  "Parameter\0221\n\013power_param\030\025 \001(\0132\034.opencv_"
+  "caffe.PowerParameter\022/\n\nrelu_param\030\036 \001(\013"
+  "2\033.opencv_caffe.ReLUParameter\0225\n\rsigmoid"
+  "_param\030& \001(\0132\036.opencv_caffe.SigmoidParam"
+  "eter\0225\n\rsoftmax_param\030\' \001(\0132\036.opencv_caf"
+  "fe.SoftmaxParameter\0221\n\013slice_param\030\037 \001(\013"
+  "2\034.opencv_caffe.SliceParameter\022/\n\ntanh_p"
+  "aram\030% \001(\0132\033.opencv_caffe.TanHParameter\022"
+  "9\n\017threshold_param\030\031 \001(\0132 .opencv_caffe."
+  "ThresholdParameter\022<\n\021window_data_param\030"
+  "\024 \001(\0132!.opencv_caffe.WindowDataParameter"
+  "\022>\n\017transform_param\030$ \001(\0132%.opencv_caffe"
+  ".TransformationParameter\022/\n\nloss_param\030*"
+  " \001(\0132\033.opencv_caffe.LossParameter\022-\n\005lay"
+  "er\030\001 \001(\0132\036.opencv_caffe.V0LayerParameter"
+  "\"\330\004\n\tLayerType\022\010\n\004NONE\020\000\022\n\n\006ABSVAL\020#\022\014\n\010"
+  "ACCURACY\020\001\022\n\n\006ARGMAX\020\036\022\010\n\004BNLL\020\002\022\n\n\006CONC"
+  "AT\020\003\022\024\n\020CONTRASTIVE_LOSS\020%\022\017\n\013CONVOLUTIO"
+  "N\020\004\022\010\n\004DATA\020\005\022\021\n\rDECONVOLUTION\020\'\022\013\n\007DROP"
+  "OUT\020\006\022\016\n\nDUMMY_DATA\020 \022\022\n\016EUCLIDEAN_LOSS\020"
+  "\007\022\013\n\007ELTWISE\020\031\022\007\n\003EXP\020&\022\013\n\007FLATTEN\020\010\022\r\n\t"
+  "HDF5_DATA\020\t\022\017\n\013HDF5_OUTPUT\020\n\022\016\n\nHINGE_LO"
+  "SS\020\034\022\n\n\006IM2COL\020\013\022\016\n\nIMAGE_DATA\020\014\022\021\n\rINFO"
+  "GAIN_LOSS\020\r\022\021\n\rINNER_PRODUCT\020\016\022\007\n\003LRN\020\017\022"
+  "\017\n\013MEMORY_DATA\020\035\022\035\n\031MULTINOMIAL_LOGISTIC"
+  "_LOSS\020\020\022\007\n\003MVN\020\"\022\013\n\007POOLING\020\021\022\t\n\005POWER\020\032"
+  "\022\010\n\004RELU\020\022\022\013\n\007SIGMOID\020\023\022\036\n\032SIGMOID_CROSS"
+  "_ENTROPY_LOSS\020\033\022\013\n\007SILENCE\020$\022\013\n\007SOFTMAX\020"
+  "\024\022\020\n\014SOFTMAX_LOSS\020\025\022\t\n\005SPLIT\020\026\022\t\n\005SLICE\020"
+  "!\022\010\n\004TANH\020\027\022\017\n\013WINDOW_DATA\020\030\022\r\n\tTHRESHOL"
+  "D\020\037\"*\n\014DimCheckMode\022\n\n\006STRICT\020\000\022\016\n\nPERMI"
+  "SSIVE\020\001\"\240\010\n\020V0LayerParameter\022\014\n\004name\030\001 \001"
+  "(\t\022\014\n\004type\030\002 \001(\t\022\022\n\nnum_output\030\003 \001(\r\022\026\n\010"
+  "biasterm\030\004 \001(\010:\004true\0224\n\rweight_filler\030\005 "
+  "\001(\0132\035.opencv_caffe.FillerParameter\0222\n\013bi"
+  "as_filler\030\006 \001(\0132\035.opencv_caffe.FillerPar"
+  "ameter\022\016\n\003pad\030\007 \001(\r:\0010\022\022\n\nkernelsize\030\010 \001"
+  "(\r\022\020\n\005group\030\t \001(\r:\0011\022\021\n\006stride\030\n \001(\r:\0011\022"
+  "<\n\004pool\030\013 \001(\0162).opencv_caffe.V0LayerPara"
+  "meter.PoolMethod:\003MAX\022\032\n\rdropout_ratio\030\014"
+  " \001(\002:\0030.5\022\025\n\nlocal_size\030\r \001(\r:\0015\022\020\n\005alph"
+  "a\030\016 \001(\002:\0011\022\022\n\004beta\030\017 \001(\002:\0040.75\022\014\n\001k\030\026 \001("
+  "\002:\0011\022\016\n\006source\030\020 \001(\t\022\020\n\005scale\030\021 \001(\002:\0011\022\020"
+  "\n\010meanfile\030\022 \001(\t\022\021\n\tbatchsize\030\023 \001(\r\022\023\n\010c"
+  "ropsize\030\024 \001(\r:\0010\022\025\n\006mirror\030\025 \001(\010:\005false\022"
+  "&\n\005blobs\0302 \003(\0132\027.opencv_caffe.BlobProto\022"
+  "\020\n\010blobs_lr\0303 \003(\002\022\024\n\014weight_decay\0304 \003(\002\022"
+  "\024\n\trand_skip\0305 \001(\r:\0010\022\035\n\020det_fg_threshol"
+  "d\0306 \001(\002:\0030.5\022\035\n\020det_bg_threshold\0307 \001(\002:\003"
+  "0.5\022\035\n\017det_fg_fraction\0308 \001(\002:\0040.25\022\032\n\017de"
+  "t_context_pad\030: \001(\r:\0010\022\033\n\rdet_crop_mode\030"
+  "; \001(\t:\004warp\022\022\n\007new_num\030< \001(\005:\0010\022\027\n\014new_c"
+  "hannels\030= \001(\005:\0010\022\025\n\nnew_height\030> \001(\005:\0010\022"
+  "\024\n\tnew_width\030\? \001(\005:\0010\022\035\n\016shuffle_images\030"
+  "@ \001(\010:\005false\022\025\n\nconcat_dim\030A \001(\r:\0011\022=\n\021h"
+  "df5_output_param\030\351\007 \001(\0132!.opencv_caffe.H"
+  "DF5OutputParameter\".\n\nPoolMethod\022\007\n\003MAX\020"
+  "\000\022\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002\"^\n\016PReLUParam"
+  "eter\022-\n\006filler\030\001 \001(\0132\035.opencv_caffe.Fill"
+  "erParameter\022\035\n\016channel_shared\030\002 \001(\010:\005fal"
+  "se\"\207\001\n\016NormalizedBBox\022\014\n\004xmin\030\001 \001(\002\022\014\n\004y"
+  "min\030\002 \001(\002\022\014\n\004xmax\030\003 \001(\002\022\014\n\004ymax\030\004 \001(\002\022\r\n"
+  "\005label\030\005 \001(\005\022\021\n\tdifficult\030\006 \001(\010\022\r\n\005score"
+  "\030\007 \001(\002\022\014\n\004size\030\010 \001(\002\"Y\n\023ROIPoolingParame"
+  "ter\022\023\n\010pooled_h\030\001 \001(\r:\0010\022\023\n\010pooled_w\030\002 \001"
+  "(\r:\0010\022\030\n\rspatial_scale\030\003 \001(\002:\0011\"\310\001\n\021Prop"
+  "osalParameter\022\027\n\013feat_stride\030\001 \001(\r:\00216\022\025"
+  "\n\tbase_size\030\002 \001(\r:\00216\022\024\n\010min_size\030\003 \001(\r:"
+  "\00216\022\r\n\005ratio\030\004 \003(\002\022\r\n\005scale\030\005 \003(\002\022\032\n\014pre"
+  "_nms_topn\030\006 \001(\r:\0046000\022\032\n\rpost_nms_topn\030\007"
+  " \001(\r:\003300\022\027\n\nnms_thresh\030\010 \001(\002:\0030.7\"V\n\025PS"
+  "ROIPoolingParameter\022\025\n\rspatial_scale\030\001 \002"
+  "(\002\022\022\n\noutput_dim\030\002 \002(\005\022\022\n\ngroup_size\030\003 \002"
+  "(\005*=\n\004Type\022\n\n\006DOUBLE\020\000\022\t\n\005FLOAT\020\001\022\013\n\007FLO"
+  "AT16\020\002\022\007\n\003INT\020\003\022\010\n\004UINT\020\004*\034\n\005Phase\022\t\n\005TR"
+  "AIN\020\000\022\010\n\004TEST\020\001"
+  ;
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_opencv_2dcaffe_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_opencv_2dcaffe_2eproto = {
+  false, false, 18855, descriptor_table_protodef_opencv_2dcaffe_2eproto, "opencv-caffe.proto",
+  &descriptor_table_opencv_2dcaffe_2eproto_once, nullptr, 0, 71,
+  schemas, file_default_instances, TableStruct_opencv_2dcaffe_2eproto::offsets,
+  file_level_metadata_opencv_2dcaffe_2eproto, file_level_enum_descriptors_opencv_2dcaffe_2eproto, file_level_service_descriptors_opencv_2dcaffe_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_opencv_2dcaffe_2eproto_getter() {
+  return &descriptor_table_opencv_2dcaffe_2eproto;
 }
 
-void PriorBoxParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.PriorBoxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated float min_size = 1;
-  for (int i = 0, n = this->min_size_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      1, this->min_size(i), output);
-  }
-
-  // repeated float max_size = 2;
-  for (int i = 0, n = this->max_size_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      2, this->max_size(i), output);
-  }
-
-  // repeated float aspect_ratio = 3;
-  for (int i = 0, n = this->aspect_ratio_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      3, this->aspect_ratio(i), output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool flip = 4 [default = true];
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->flip(), output);
-  }
-
-  // optional bool clip = 5 [default = true];
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->clip(), output);
-  }
-
-  // repeated float variance = 6;
-  for (int i = 0, n = this->variance_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      6, this->variance(i), output);
-  }
-
-  // optional uint32 img_size = 7;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->img_size(), output);
-  }
-
-  // optional uint32 img_h = 8;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->img_h(), output);
-  }
-
-  // optional uint32 img_w = 9;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->img_w(), output);
-  }
-
-  // optional float step = 10;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(10, this->step(), output);
-  }
-
-  // optional float step_h = 11;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->step_h(), output);
-  }
-
-  // optional float step_w = 12;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(12, this->step_w(), output);
-  }
-
-  // optional float offset = 13 [default = 0.5];
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(13, this->offset(), output);
-  }
-
-  // repeated float offset_h = 14;
-  for (int i = 0, n = this->offset_h_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      14, this->offset_h(i), output);
-  }
-
-  // repeated float offset_w = 15;
-  for (int i = 0, n = this->offset_w_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      15, this->offset_w(i), output);
-  }
-
-  // repeated float width = 16;
-  for (int i = 0, n = this->width_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      16, this->width(i), output);
-  }
-
-  // repeated float height = 17;
-  for (int i = 0, n = this->height_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      17, this->height(i), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.PriorBoxParameter)
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_opencv_2dcaffe_2eproto(&descriptor_table_opencv_2dcaffe_2eproto);
+namespace opencv_caffe {
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PriorBoxParameter_CodeType_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[0];
 }
-
-::google::protobuf::uint8* PriorBoxParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PriorBoxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated float min_size = 1;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(1, this->min_size_, target);
-
-  // repeated float max_size = 2;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(2, this->max_size_, target);
-
-  // repeated float aspect_ratio = 3;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(3, this->aspect_ratio_, target);
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool flip = 4 [default = true];
-  if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->flip(), target);
+bool PriorBoxParameter_CodeType_IsValid(int value) {
+  switch (value) {
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // optional bool clip = 5 [default = true];
-  if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->clip(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr PriorBoxParameter_CodeType PriorBoxParameter::CORNER;
+constexpr PriorBoxParameter_CodeType PriorBoxParameter::CENTER_SIZE;
+constexpr PriorBoxParameter_CodeType PriorBoxParameter::CodeType_MIN;
+constexpr PriorBoxParameter_CodeType PriorBoxParameter::CodeType_MAX;
+constexpr int PriorBoxParameter::CodeType_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FillerParameter_VarianceNorm_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[1];
+}
+bool FillerParameter_VarianceNorm_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float variance = 6;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(6, this->variance_, target);
-
-  // optional uint32 img_size = 7;
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->img_size(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr FillerParameter_VarianceNorm FillerParameter::FAN_IN;
+constexpr FillerParameter_VarianceNorm FillerParameter::FAN_OUT;
+constexpr FillerParameter_VarianceNorm FillerParameter::AVERAGE;
+constexpr FillerParameter_VarianceNorm FillerParameter::VarianceNorm_MIN;
+constexpr FillerParameter_VarianceNorm FillerParameter::VarianceNorm_MAX;
+constexpr int FillerParameter::VarianceNorm_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SolverParameter_SnapshotFormat_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[2];
+}
+bool SolverParameter_SnapshotFormat_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // optional uint32 img_h = 8;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->img_h(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr SolverParameter_SnapshotFormat SolverParameter::HDF5;
+constexpr SolverParameter_SnapshotFormat SolverParameter::BINARYPROTO;
+constexpr SolverParameter_SnapshotFormat SolverParameter::SnapshotFormat_MIN;
+constexpr SolverParameter_SnapshotFormat SolverParameter::SnapshotFormat_MAX;
+constexpr int SolverParameter::SnapshotFormat_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SolverParameter_SolverMode_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[3];
+}
+bool SolverParameter_SolverMode_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // optional uint32 img_w = 9;
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->img_w(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr SolverParameter_SolverMode SolverParameter::CPU;
+constexpr SolverParameter_SolverMode SolverParameter::GPU;
+constexpr SolverParameter_SolverMode SolverParameter::SolverMode_MIN;
+constexpr SolverParameter_SolverMode SolverParameter::SolverMode_MAX;
+constexpr int SolverParameter::SolverMode_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SolverParameter_SolverType_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[4];
+}
+bool SolverParameter_SolverType_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+    case 5:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // optional float step = 10;
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(10, this->step(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr SolverParameter_SolverType SolverParameter::SGD;
+constexpr SolverParameter_SolverType SolverParameter::NESTEROV;
+constexpr SolverParameter_SolverType SolverParameter::ADAGRAD;
+constexpr SolverParameter_SolverType SolverParameter::RMSPROP;
+constexpr SolverParameter_SolverType SolverParameter::ADADELTA;
+constexpr SolverParameter_SolverType SolverParameter::ADAM;
+constexpr SolverParameter_SolverType SolverParameter::SolverType_MIN;
+constexpr SolverParameter_SolverType SolverParameter::SolverType_MAX;
+constexpr int SolverParameter::SolverType_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ParamSpec_DimCheckMode_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[5];
+}
+bool ParamSpec_DimCheckMode_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // optional float step_h = 11;
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(11, this->step_h(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr ParamSpec_DimCheckMode ParamSpec::STRICT;
+constexpr ParamSpec_DimCheckMode ParamSpec::PERMISSIVE;
+constexpr ParamSpec_DimCheckMode ParamSpec::DimCheckMode_MIN;
+constexpr ParamSpec_DimCheckMode ParamSpec::DimCheckMode_MAX;
+constexpr int ParamSpec::DimCheckMode_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LossParameter_NormalizationMode_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[6];
+}
+bool LossParameter_NormalizationMode_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // optional float step_w = 12;
-  if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(12, this->step_w(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr LossParameter_NormalizationMode LossParameter::FULL;
+constexpr LossParameter_NormalizationMode LossParameter::VALID;
+constexpr LossParameter_NormalizationMode LossParameter::BATCH_SIZE;
+constexpr LossParameter_NormalizationMode LossParameter::NONE;
+constexpr LossParameter_NormalizationMode LossParameter::NormalizationMode_MIN;
+constexpr LossParameter_NormalizationMode LossParameter::NormalizationMode_MAX;
+constexpr int LossParameter::NormalizationMode_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ConvolutionParameter_Engine_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[7];
+}
+bool ConvolutionParameter_Engine_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // optional float offset = 13 [default = 0.5];
-  if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(13, this->offset(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr ConvolutionParameter_Engine ConvolutionParameter::DEFAULT;
+constexpr ConvolutionParameter_Engine ConvolutionParameter::CAFFE;
+constexpr ConvolutionParameter_Engine ConvolutionParameter::CUDNN;
+constexpr ConvolutionParameter_Engine ConvolutionParameter::Engine_MIN;
+constexpr ConvolutionParameter_Engine ConvolutionParameter::Engine_MAX;
+constexpr int ConvolutionParameter::Engine_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataParameter_DB_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[8];
+}
+bool DataParameter_DB_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float offset_h = 14;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(14, this->offset_h_, target);
-
-  // repeated float offset_w = 15;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(15, this->offset_w_, target);
-
-  // repeated float width = 16;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(16, this->width_, target);
-
-  // repeated float height = 17;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(17, this->height_, target);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr DataParameter_DB DataParameter::LEVELDB;
+constexpr DataParameter_DB DataParameter::LMDB;
+constexpr DataParameter_DB DataParameter::DB_MIN;
+constexpr DataParameter_DB DataParameter::DB_MAX;
+constexpr int DataParameter::DB_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EltwiseParameter_EltwiseOp_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[9];
+}
+bool EltwiseParameter_EltwiseOp_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.PriorBoxParameter)
-  return target;
 }
 
-size_t PriorBoxParameter::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PriorBoxParameter)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // repeated float min_size = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->min_size_size());
-    size_t data_size = 4UL * count;
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->min_size_size());
-    total_size += data_size;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr EltwiseParameter_EltwiseOp EltwiseParameter::PROD;
+constexpr EltwiseParameter_EltwiseOp EltwiseParameter::SUM;
+constexpr EltwiseParameter_EltwiseOp EltwiseParameter::MAX;
+constexpr EltwiseParameter_EltwiseOp EltwiseParameter::EltwiseOp_MIN;
+constexpr EltwiseParameter_EltwiseOp EltwiseParameter::EltwiseOp_MAX;
+constexpr int EltwiseParameter::EltwiseOp_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* HingeLossParameter_Norm_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[10];
+}
+bool HingeLossParameter_Norm_IsValid(int value) {
+  switch (value) {
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float max_size = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->max_size_size());
-    size_t data_size = 4UL * count;
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->max_size_size());
-    total_size += data_size;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr HingeLossParameter_Norm HingeLossParameter::L1;
+constexpr HingeLossParameter_Norm HingeLossParameter::L2;
+constexpr HingeLossParameter_Norm HingeLossParameter::Norm_MIN;
+constexpr HingeLossParameter_Norm HingeLossParameter::Norm_MAX;
+constexpr int HingeLossParameter::Norm_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LRNParameter_NormRegion_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[11];
+}
+bool LRNParameter_NormRegion_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float aspect_ratio = 3;
-  {
-    unsigned int count = static_cast<unsigned int>(this->aspect_ratio_size());
-    size_t data_size = 4UL * count;
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->aspect_ratio_size());
-    total_size += data_size;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr LRNParameter_NormRegion LRNParameter::ACROSS_CHANNELS;
+constexpr LRNParameter_NormRegion LRNParameter::WITHIN_CHANNEL;
+constexpr LRNParameter_NormRegion LRNParameter::NormRegion_MIN;
+constexpr LRNParameter_NormRegion LRNParameter::NormRegion_MAX;
+constexpr int LRNParameter::NormRegion_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LRNParameter_Engine_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[12];
+}
+bool LRNParameter_Engine_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float variance = 6;
-  {
-    unsigned int count = static_cast<unsigned int>(this->variance_size());
-    size_t data_size = 4UL * count;
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->variance_size());
-    total_size += data_size;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr LRNParameter_Engine LRNParameter::DEFAULT;
+constexpr LRNParameter_Engine LRNParameter::CAFFE;
+constexpr LRNParameter_Engine LRNParameter::CUDNN;
+constexpr LRNParameter_Engine LRNParameter::Engine_MIN;
+constexpr LRNParameter_Engine LRNParameter::Engine_MAX;
+constexpr int LRNParameter::Engine_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PoolingParameter_PoolMethod_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[13];
+}
+bool PoolingParameter_PoolMethod_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float offset_h = 14;
-  {
-    unsigned int count = static_cast<unsigned int>(this->offset_h_size());
-    size_t data_size = 4UL * count;
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->offset_h_size());
-    total_size += data_size;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr PoolingParameter_PoolMethod PoolingParameter::MAX;
+constexpr PoolingParameter_PoolMethod PoolingParameter::AVE;
+constexpr PoolingParameter_PoolMethod PoolingParameter::STOCHASTIC;
+constexpr PoolingParameter_PoolMethod PoolingParameter::PoolMethod_MIN;
+constexpr PoolingParameter_PoolMethod PoolingParameter::PoolMethod_MAX;
+constexpr int PoolingParameter::PoolMethod_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PoolingParameter_Engine_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[14];
+}
+bool PoolingParameter_Engine_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float offset_w = 15;
-  {
-    unsigned int count = static_cast<unsigned int>(this->offset_w_size());
-    size_t data_size = 4UL * count;
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->offset_w_size());
-    total_size += data_size;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr PoolingParameter_Engine PoolingParameter::DEFAULT;
+constexpr PoolingParameter_Engine PoolingParameter::CAFFE;
+constexpr PoolingParameter_Engine PoolingParameter::CUDNN;
+constexpr PoolingParameter_Engine PoolingParameter::Engine_MIN;
+constexpr PoolingParameter_Engine PoolingParameter::Engine_MAX;
+constexpr int PoolingParameter::Engine_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReductionParameter_ReductionOp_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[15];
+}
+bool ReductionParameter_ReductionOp_IsValid(int value) {
+  switch (value) {
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float width = 16;
-  {
-    unsigned int count = static_cast<unsigned int>(this->width_size());
-    size_t data_size = 4UL * count;
-    total_size += 2 *
-                  ::google::protobuf::internal::FromIntSize(this->width_size());
-    total_size += data_size;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr ReductionParameter_ReductionOp ReductionParameter::SUM;
+constexpr ReductionParameter_ReductionOp ReductionParameter::ASUM;
+constexpr ReductionParameter_ReductionOp ReductionParameter::SUMSQ;
+constexpr ReductionParameter_ReductionOp ReductionParameter::MEAN;
+constexpr ReductionParameter_ReductionOp ReductionParameter::ReductionOp_MIN;
+constexpr ReductionParameter_ReductionOp ReductionParameter::ReductionOp_MAX;
+constexpr int ReductionParameter::ReductionOp_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReLUParameter_Engine_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[16];
+}
+bool ReLUParameter_Engine_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  // repeated float height = 17;
-  {
-    unsigned int count = static_cast<unsigned int>(this->height_size());
-    size_t data_size = 4UL * count;
-    total_size += 2 *
-                  ::google::protobuf::internal::FromIntSize(this->height_size());
-    total_size += data_size;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr ReLUParameter_Engine ReLUParameter::DEFAULT;
+constexpr ReLUParameter_Engine ReLUParameter::CAFFE;
+constexpr ReLUParameter_Engine ReLUParameter::CUDNN;
+constexpr ReLUParameter_Engine ReLUParameter::Engine_MIN;
+constexpr ReLUParameter_Engine ReLUParameter::Engine_MAX;
+constexpr int ReLUParameter::Engine_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SigmoidParameter_Engine_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[17];
+}
+bool SigmoidParameter_Engine_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
+}
 
-  if (_has_bits_[0 / 32] & 255u) {
-    // optional uint32 img_size = 7;
-    if (has_img_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->img_size());
-    }
-
-    // optional uint32 img_h = 8;
-    if (has_img_h()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->img_h());
-    }
-
-    // optional uint32 img_w = 9;
-    if (has_img_w()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->img_w());
-    }
-
-    // optional float step = 10;
-    if (has_step()) {
-      total_size += 1 + 4;
-    }
-
-    // optional float step_h = 11;
-    if (has_step_h()) {
-      total_size += 1 + 4;
-    }
-
-    // optional float step_w = 12;
-    if (has_step_w()) {
-      total_size += 1 + 4;
-    }
-
-    // optional bool flip = 4 [default = true];
-    if (has_flip()) {
-      total_size += 1 + 1;
-    }
-
-    // optional bool clip = 5 [default = true];
-    if (has_clip()) {
-      total_size += 1 + 1;
-    }
-
-  }
-  // optional float offset = 13 [default = 0.5];
-  if (has_offset()) {
-    total_size += 1 + 4;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr SigmoidParameter_Engine SigmoidParameter::DEFAULT;
+constexpr SigmoidParameter_Engine SigmoidParameter::CAFFE;
+constexpr SigmoidParameter_Engine SigmoidParameter::CUDNN;
+constexpr SigmoidParameter_Engine SigmoidParameter::Engine_MIN;
+constexpr SigmoidParameter_Engine SigmoidParameter::Engine_MAX;
+constexpr int SigmoidParameter::Engine_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SoftmaxParameter_Engine_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[18];
+}
+bool SoftmaxParameter_Engine_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
-
-  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 PriorBoxParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.PriorBoxParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const PriorBoxParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const PriorBoxParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.PriorBoxParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.PriorBoxParameter)
-    MergeFrom(*source);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr SoftmaxParameter_Engine SoftmaxParameter::DEFAULT;
+constexpr SoftmaxParameter_Engine SoftmaxParameter::CAFFE;
+constexpr SoftmaxParameter_Engine SoftmaxParameter::CUDNN;
+constexpr SoftmaxParameter_Engine SoftmaxParameter::Engine_MIN;
+constexpr SoftmaxParameter_Engine SoftmaxParameter::Engine_MAX;
+constexpr int SoftmaxParameter::Engine_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TanHParameter_Engine_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[19];
+}
+bool TanHParameter_Engine_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
 }
 
-void PriorBoxParameter::MergeFrom(const PriorBoxParameter& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PriorBoxParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  min_size_.MergeFrom(from.min_size_);
-  max_size_.MergeFrom(from.max_size_);
-  aspect_ratio_.MergeFrom(from.aspect_ratio_);
-  variance_.MergeFrom(from.variance_);
-  offset_h_.MergeFrom(from.offset_h_);
-  offset_w_.MergeFrom(from.offset_w_);
-  width_.MergeFrom(from.width_);
-  height_.MergeFrom(from.height_);
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
-    if (cached_has_bits & 0x00000001u) {
-      img_size_ = from.img_size_;
-    }
-    if (cached_has_bits & 0x00000002u) {
-      img_h_ = from.img_h_;
-    }
-    if (cached_has_bits & 0x00000004u) {
-      img_w_ = from.img_w_;
-    }
-    if (cached_has_bits & 0x00000008u) {
-      step_ = from.step_;
-    }
-    if (cached_has_bits & 0x00000010u) {
-      step_h_ = from.step_h_;
-    }
-    if (cached_has_bits & 0x00000020u) {
-      step_w_ = from.step_w_;
-    }
-    if (cached_has_bits & 0x00000040u) {
-      flip_ = from.flip_;
-    }
-    if (cached_has_bits & 0x00000080u) {
-      clip_ = from.clip_;
-    }
-    _has_bits_[0] |= cached_has_bits;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr TanHParameter_Engine TanHParameter::DEFAULT;
+constexpr TanHParameter_Engine TanHParameter::CAFFE;
+constexpr TanHParameter_Engine TanHParameter::CUDNN;
+constexpr TanHParameter_Engine TanHParameter::Engine_MIN;
+constexpr TanHParameter_Engine TanHParameter::Engine_MAX;
+constexpr int TanHParameter::Engine_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SPPParameter_PoolMethod_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[20];
+}
+bool SPPParameter_PoolMethod_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
-  if (cached_has_bits & 0x00000100u) {
-    set_offset(from.offset());
+}
+
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr SPPParameter_PoolMethod SPPParameter::MAX;
+constexpr SPPParameter_PoolMethod SPPParameter::AVE;
+constexpr SPPParameter_PoolMethod SPPParameter::STOCHASTIC;
+constexpr SPPParameter_PoolMethod SPPParameter::PoolMethod_MIN;
+constexpr SPPParameter_PoolMethod SPPParameter::PoolMethod_MAX;
+constexpr int SPPParameter::PoolMethod_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SPPParameter_Engine_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[21];
+}
+bool SPPParameter_Engine_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
   }
 }
 
-void PriorBoxParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.PriorBoxParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr SPPParameter_Engine SPPParameter::DEFAULT;
+constexpr SPPParameter_Engine SPPParameter::CAFFE;
+constexpr SPPParameter_Engine SPPParameter::CUDNN;
+constexpr SPPParameter_Engine SPPParameter::Engine_MIN;
+constexpr SPPParameter_Engine SPPParameter::Engine_MAX;
+constexpr int SPPParameter::Engine_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* V1LayerParameter_LayerType_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[22];
+}
+bool V1LayerParameter_LayerType_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+    case 5:
+    case 6:
+    case 7:
+    case 8:
+    case 9:
+    case 10:
+    case 11:
+    case 12:
+    case 13:
+    case 14:
+    case 15:
+    case 16:
+    case 17:
+    case 18:
+    case 19:
+    case 20:
+    case 21:
+    case 22:
+    case 23:
+    case 24:
+    case 25:
+    case 26:
+    case 27:
+    case 28:
+    case 29:
+    case 30:
+    case 31:
+    case 32:
+    case 33:
+    case 34:
+    case 35:
+    case 36:
+    case 37:
+    case 38:
+    case 39:
+      return true;
+    default:
+      return false;
+  }
 }
 
-void PriorBoxParameter::CopyFrom(const PriorBoxParameter& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.PriorBoxParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr V1LayerParameter_LayerType V1LayerParameter::NONE;
+constexpr V1LayerParameter_LayerType V1LayerParameter::ABSVAL;
+constexpr V1LayerParameter_LayerType V1LayerParameter::ACCURACY;
+constexpr V1LayerParameter_LayerType V1LayerParameter::ARGMAX;
+constexpr V1LayerParameter_LayerType V1LayerParameter::BNLL;
+constexpr V1LayerParameter_LayerType V1LayerParameter::CONCAT;
+constexpr V1LayerParameter_LayerType V1LayerParameter::CONTRASTIVE_LOSS;
+constexpr V1LayerParameter_LayerType V1LayerParameter::CONVOLUTION;
+constexpr V1LayerParameter_LayerType V1LayerParameter::DATA;
+constexpr V1LayerParameter_LayerType V1LayerParameter::DECONVOLUTION;
+constexpr V1LayerParameter_LayerType V1LayerParameter::DROPOUT;
+constexpr V1LayerParameter_LayerType V1LayerParameter::DUMMY_DATA;
+constexpr V1LayerParameter_LayerType V1LayerParameter::EUCLIDEAN_LOSS;
+constexpr V1LayerParameter_LayerType V1LayerParameter::ELTWISE;
+constexpr V1LayerParameter_LayerType V1LayerParameter::EXP;
+constexpr V1LayerParameter_LayerType V1LayerParameter::FLATTEN;
+constexpr V1LayerParameter_LayerType V1LayerParameter::HDF5_DATA;
+constexpr V1LayerParameter_LayerType V1LayerParameter::HDF5_OUTPUT;
+constexpr V1LayerParameter_LayerType V1LayerParameter::HINGE_LOSS;
+constexpr V1LayerParameter_LayerType V1LayerParameter::IM2COL;
+constexpr V1LayerParameter_LayerType V1LayerParameter::IMAGE_DATA;
+constexpr V1LayerParameter_LayerType V1LayerParameter::INFOGAIN_LOSS;
+constexpr V1LayerParameter_LayerType V1LayerParameter::INNER_PRODUCT;
+constexpr V1LayerParameter_LayerType V1LayerParameter::LRN;
+constexpr V1LayerParameter_LayerType V1LayerParameter::MEMORY_DATA;
+constexpr V1LayerParameter_LayerType V1LayerParameter::MULTINOMIAL_LOGISTIC_LOSS;
+constexpr V1LayerParameter_LayerType V1LayerParameter::MVN;
+constexpr V1LayerParameter_LayerType V1LayerParameter::POOLING;
+constexpr V1LayerParameter_LayerType V1LayerParameter::POWER;
+constexpr V1LayerParameter_LayerType V1LayerParameter::RELU;
+constexpr V1LayerParameter_LayerType V1LayerParameter::SIGMOID;
+constexpr V1LayerParameter_LayerType V1LayerParameter::SIGMOID_CROSS_ENTROPY_LOSS;
+constexpr V1LayerParameter_LayerType V1LayerParameter::SILENCE;
+constexpr V1LayerParameter_LayerType V1LayerParameter::SOFTMAX;
+constexpr V1LayerParameter_LayerType V1LayerParameter::SOFTMAX_LOSS;
+constexpr V1LayerParameter_LayerType V1LayerParameter::SPLIT;
+constexpr V1LayerParameter_LayerType V1LayerParameter::SLICE;
+constexpr V1LayerParameter_LayerType V1LayerParameter::TANH;
+constexpr V1LayerParameter_LayerType V1LayerParameter::WINDOW_DATA;
+constexpr V1LayerParameter_LayerType V1LayerParameter::THRESHOLD;
+constexpr V1LayerParameter_LayerType V1LayerParameter::LayerType_MIN;
+constexpr V1LayerParameter_LayerType V1LayerParameter::LayerType_MAX;
+constexpr int V1LayerParameter::LayerType_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* V1LayerParameter_DimCheckMode_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[23];
+}
+bool V1LayerParameter_DimCheckMode_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+      return true;
+    default:
+      return false;
+  }
 }
 
-bool PriorBoxParameter::IsInitialized() const {
-  return true;
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr V1LayerParameter_DimCheckMode V1LayerParameter::STRICT;
+constexpr V1LayerParameter_DimCheckMode V1LayerParameter::PERMISSIVE;
+constexpr V1LayerParameter_DimCheckMode V1LayerParameter::DimCheckMode_MIN;
+constexpr V1LayerParameter_DimCheckMode V1LayerParameter::DimCheckMode_MAX;
+constexpr int V1LayerParameter::DimCheckMode_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* V0LayerParameter_PoolMethod_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[24];
+}
+bool V0LayerParameter_PoolMethod_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
+  }
 }
 
-void PriorBoxParameter::Swap(PriorBoxParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr V0LayerParameter_PoolMethod V0LayerParameter::MAX;
+constexpr V0LayerParameter_PoolMethod V0LayerParameter::AVE;
+constexpr V0LayerParameter_PoolMethod V0LayerParameter::STOCHASTIC;
+constexpr V0LayerParameter_PoolMethod V0LayerParameter::PoolMethod_MIN;
+constexpr V0LayerParameter_PoolMethod V0LayerParameter::PoolMethod_MAX;
+constexpr int V0LayerParameter::PoolMethod_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Type_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[25];
 }
-void PriorBoxParameter::InternalSwap(PriorBoxParameter* other) {
-  using std::swap;
-  min_size_.InternalSwap(&other->min_size_);
-  max_size_.InternalSwap(&other->max_size_);
-  aspect_ratio_.InternalSwap(&other->aspect_ratio_);
-  variance_.InternalSwap(&other->variance_);
-  offset_h_.InternalSwap(&other->offset_h_);
-  offset_w_.InternalSwap(&other->offset_w_);
-  width_.InternalSwap(&other->width_);
-  height_.InternalSwap(&other->height_);
-  swap(img_size_, other->img_size_);
-  swap(img_h_, other->img_h_);
-  swap(img_w_, other->img_w_);
-  swap(step_, other->step_);
-  swap(step_h_, other->step_h_);
-  swap(step_w_, other->step_w_);
-  swap(flip_, other->flip_);
-  swap(clip_, other->clip_);
-  swap(offset_, other->offset_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+bool Type_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+      return true;
+    default:
+      return false;
+  }
 }
 
-::google::protobuf::Metadata PriorBoxParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Phase_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2dcaffe_2eproto);
+  return file_level_enum_descriptors_opencv_2dcaffe_2eproto[26];
+}
+bool Phase_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+      return true;
+    default:
+      return false;
+  }
 }
 
 
 // ===================================================================
 
-void DetectionOutputParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_DetectionOutputParameter_default_instance_._instance.get_mutable()->nms_param_ = const_cast< ::opencv_caffe::NonMaximumSuppressionParameter*>(
-      ::opencv_caffe::NonMaximumSuppressionParameter::internal_default_instance());
-  ::opencv_caffe::_DetectionOutputParameter_default_instance_._instance.get_mutable()->save_output_param_ = const_cast< ::opencv_caffe::SaveOutputParameter*>(
-      ::opencv_caffe::SaveOutputParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int DetectionOutputParameter::kNumClassesFieldNumber;
-const int DetectionOutputParameter::kShareLocationFieldNumber;
-const int DetectionOutputParameter::kBackgroundLabelIdFieldNumber;
-const int DetectionOutputParameter::kNmsParamFieldNumber;
-const int DetectionOutputParameter::kSaveOutputParamFieldNumber;
-const int DetectionOutputParameter::kCodeTypeFieldNumber;
-const int DetectionOutputParameter::kVarianceEncodedInTargetFieldNumber;
-const int DetectionOutputParameter::kKeepTopKFieldNumber;
-const int DetectionOutputParameter::kConfidenceThresholdFieldNumber;
-const int DetectionOutputParameter::kNormalizedBboxFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-DetectionOutputParameter::DetectionOutputParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDetectionOutputParameter();
-  }
+class BlobShape::_Internal {
+ public:
+};
+
+BlobShape::BlobShape(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  dim_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.DetectionOutputParameter)
-}
-DetectionOutputParameter::DetectionOutputParameter(const DetectionOutputParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_nms_param()) {
-    nms_param_ = new ::opencv_caffe::NonMaximumSuppressionParameter(*from.nms_param_);
-  } else {
-    nms_param_ = NULL;
-  }
-  if (from.has_save_output_param()) {
-    save_output_param_ = new ::opencv_caffe::SaveOutputParameter(*from.save_output_param_);
-  } else {
-    save_output_param_ = NULL;
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-  ::memcpy(&num_classes_, &from.num_classes_,
-    static_cast<size_t>(reinterpret_cast<char*>(&normalized_bbox_) -
-    reinterpret_cast<char*>(&num_classes_)) + sizeof(normalized_bbox_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.DetectionOutputParameter)
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.BlobShape)
+}
+BlobShape::BlobShape(const BlobShape& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      dim_(from.dim_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.BlobShape)
 }
 
-void DetectionOutputParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&nms_param_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&confidence_threshold_) -
-      reinterpret_cast<char*>(&nms_param_)) + sizeof(confidence_threshold_));
-  keep_top_k_ = -1;
-  code_type_ = 1;
-  share_location_ = true;
-  normalized_bbox_ = true;
+inline void BlobShape::SharedCtor() {
 }
 
-DetectionOutputParameter::~DetectionOutputParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.DetectionOutputParameter)
+BlobShape::~BlobShape() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.BlobShape)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void DetectionOutputParameter::SharedDtor() {
-  if (this != internal_default_instance()) delete nms_param_;
-  if (this != internal_default_instance()) delete save_output_param_;
+inline void BlobShape::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void DetectionOutputParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* DetectionOutputParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void BlobShape::ArenaDtor(void* object) {
+  BlobShape* _this = reinterpret_cast< BlobShape* >(object);
+  (void)_this;
 }
-
-const DetectionOutputParameter& DetectionOutputParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDetectionOutputParameter();
-  return *internal_default_instance();
+void BlobShape::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-DetectionOutputParameter* DetectionOutputParameter::New(::google::protobuf::Arena* arena) const {
-  DetectionOutputParameter* n = new DetectionOutputParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void BlobShape::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-void DetectionOutputParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.DetectionOutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+void BlobShape::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.BlobShape)
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(nms_param_ != NULL);
-      nms_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(save_output_param_ != NULL);
-      save_output_param_->Clear();
-    }
-  }
-  if (cached_has_bits & 252u) {
-    ::memset(&num_classes_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&confidence_threshold_) -
-        reinterpret_cast<char*>(&num_classes_)) + sizeof(confidence_threshold_));
-    keep_top_k_ = -1;
-    code_type_ = 1;
-  }
-  if (cached_has_bits & 768u) {
-    share_location_ = true;
-    normalized_bbox_ = true;
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool DetectionOutputParameter::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:opencv_caffe.DetectionOutputParameter)
-  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 uint32 num_classes = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_num_classes();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &num_classes_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool share_location = 2 [default = true];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_share_location();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &share_location_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 background_label_id = 3 [default = 0];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_background_label_id();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &background_label_id_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_nms_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_save_output_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::PriorBoxParameter_CodeType_IsValid(value)) {
-            set_code_type(static_cast< ::opencv_caffe::PriorBoxParameter_CodeType >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                6, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 keep_top_k = 7 [default = -1];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_keep_top_k();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &keep_top_k_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool variance_encoded_in_target = 8 [default = false];
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-          set_has_variance_encoded_in_target();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &variance_encoded_in_target_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float confidence_threshold = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
-          set_has_confidence_threshold();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &confidence_threshold_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool normalized_bbox = 10 [default = true];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_normalized_bbox();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &normalized_bbox_)));
-        } 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:opencv_caffe.DetectionOutputParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.DetectionOutputParameter)
-  return false;
-#undef DO_
+  dim_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void DetectionOutputParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.DetectionOutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 num_classes = 1;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_classes(), output);
-  }
-
-  // optional bool share_location = 2 [default = true];
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->share_location(), output);
-  }
-
-  // optional int32 background_label_id = 3 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->background_label_id(), output);
-  }
-
-  // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, *this->nms_param_, output);
-  }
-
-  // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, *this->save_output_param_, output);
-  }
-
-  // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      6, this->code_type(), output);
-  }
-
-  // optional int32 keep_top_k = 7 [default = -1];
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->keep_top_k(), output);
-  }
-
-  // optional bool variance_encoded_in_target = 8 [default = false];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->variance_encoded_in_target(), output);
-  }
-
-  // optional float confidence_threshold = 9;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->confidence_threshold(), output);
-  }
-
-  // optional bool normalized_bbox = 10 [default = true];
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->normalized_bbox(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.DetectionOutputParameter)
+const char* BlobShape::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // repeated int64 dim = 1 [packed = true];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_dim(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 8) {
+          _internal_add_dim(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* DetectionOutputParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.DetectionOutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* BlobShape::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.BlobShape)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 num_classes = 1;
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_classes(), target);
-  }
-
-  // optional bool share_location = 2 [default = true];
-  if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->share_location(), target);
-  }
-
-  // optional int32 background_label_id = 3 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->background_label_id(), target);
-  }
-
-  // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, *this->nms_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, *this->save_output_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
-  if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      6, this->code_type(), target);
-  }
-
-  // optional int32 keep_top_k = 7 [default = -1];
-  if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->keep_top_k(), target);
-  }
-
-  // optional bool variance_encoded_in_target = 8 [default = false];
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->variance_encoded_in_target(), target);
-  }
-
-  // optional float confidence_threshold = 9;
-  if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->confidence_threshold(), target);
-  }
-
-  // optional bool normalized_bbox = 10 [default = true];
-  if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->normalized_bbox(), target);
+  // repeated int64 dim = 1 [packed = true];
+  {
+    int byte_size = _dim_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt64Packed(
+          1, _internal_dim(), byte_size, target);
+    }
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.DetectionOutputParameter)
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.BlobShape)
   return target;
 }
 
-size_t DetectionOutputParameter::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.DetectionOutputParameter)
+size_t BlobShape::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.BlobShape)
   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] & 255u) {
-    // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
-    if (has_nms_param()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->nms_param_);
-    }
-
-    // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
-    if (has_save_output_param()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->save_output_param_);
-    }
-
-    // optional uint32 num_classes = 1;
-    if (has_num_classes()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->num_classes());
-    }
-
-    // optional int32 background_label_id = 3 [default = 0];
-    if (has_background_label_id()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->background_label_id());
-    }
-
-    // optional bool variance_encoded_in_target = 8 [default = false];
-    if (has_variance_encoded_in_target()) {
-      total_size += 1 + 1;
-    }
-
-    // optional float confidence_threshold = 9;
-    if (has_confidence_threshold()) {
-      total_size += 1 + 4;
-    }
-
-    // optional int32 keep_top_k = 7 [default = -1];
-    if (has_keep_top_k()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->keep_top_k());
-    }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-    // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
-    if (has_code_type()) {
+  // repeated int64 dim = 1 [packed = true];
+  {
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      Int64Size(this->dim_);
+    if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->code_type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _dim_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
+    total_size += data_size;
   }
-  if (_has_bits_[8 / 32] & 768u) {
-    // optional bool share_location = 2 [default = true];
-    if (has_share_location()) {
-      total_size += 1 + 1;
-    }
-
-    // optional bool normalized_bbox = 10 [default = true];
-    if (has_normalized_bbox()) {
-      total_size += 1 + 1;
-    }
 
-  }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void DetectionOutputParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.DetectionOutputParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const DetectionOutputParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const DetectionOutputParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.DetectionOutputParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.DetectionOutputParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BlobShape::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    BlobShape::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BlobShape::GetClassData() const { return &_class_data_; }
+
+void BlobShape::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<BlobShape *>(to)->MergeFrom(
+      static_cast<const BlobShape &>(from));
 }
 
-void DetectionOutputParameter::MergeFrom(const DetectionOutputParameter& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.DetectionOutputParameter)
+
+void BlobShape::MergeFrom(const BlobShape& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.BlobShape)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
-    if (cached_has_bits & 0x00000001u) {
-      mutable_nms_param()->::opencv_caffe::NonMaximumSuppressionParameter::MergeFrom(from.nms_param());
-    }
-    if (cached_has_bits & 0x00000002u) {
-      mutable_save_output_param()->::opencv_caffe::SaveOutputParameter::MergeFrom(from.save_output_param());
-    }
-    if (cached_has_bits & 0x00000004u) {
-      num_classes_ = from.num_classes_;
-    }
-    if (cached_has_bits & 0x00000008u) {
-      background_label_id_ = from.background_label_id_;
-    }
-    if (cached_has_bits & 0x00000010u) {
-      variance_encoded_in_target_ = from.variance_encoded_in_target_;
-    }
-    if (cached_has_bits & 0x00000020u) {
-      confidence_threshold_ = from.confidence_threshold_;
-    }
-    if (cached_has_bits & 0x00000040u) {
-      keep_top_k_ = from.keep_top_k_;
-    }
-    if (cached_has_bits & 0x00000080u) {
-      code_type_ = from.code_type_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-  if (cached_has_bits & 768u) {
-    if (cached_has_bits & 0x00000100u) {
-      share_location_ = from.share_location_;
-    }
-    if (cached_has_bits & 0x00000200u) {
-      normalized_bbox_ = from.normalized_bbox_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void DetectionOutputParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.DetectionOutputParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  dim_.MergeFrom(from.dim_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
-void DetectionOutputParameter::CopyFrom(const DetectionOutputParameter& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.DetectionOutputParameter)
+void BlobShape::CopyFrom(const BlobShape& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.BlobShape)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool DetectionOutputParameter::IsInitialized() const {
+bool BlobShape::IsInitialized() const {
   return true;
 }
 
-void DetectionOutputParameter::Swap(DetectionOutputParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void DetectionOutputParameter::InternalSwap(DetectionOutputParameter* other) {
+void BlobShape::InternalSwap(BlobShape* other) {
   using std::swap;
-  swap(nms_param_, other->nms_param_);
-  swap(save_output_param_, other->save_output_param_);
-  swap(num_classes_, other->num_classes_);
-  swap(background_label_id_, other->background_label_id_);
-  swap(variance_encoded_in_target_, other->variance_encoded_in_target_);
-  swap(confidence_threshold_, other->confidence_threshold_);
-  swap(keep_top_k_, other->keep_top_k_);
-  swap(code_type_, other->code_type_);
-  swap(share_location_, other->share_location_);
-  swap(normalized_bbox_, other->normalized_bbox_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  dim_.InternalSwap(&other->dim_);
 }
 
-::google::protobuf::Metadata DetectionOutputParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata BlobShape::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[0]);
 }
 
-
 // ===================================================================
 
-void Datum::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int Datum::kChannelsFieldNumber;
-const int Datum::kHeightFieldNumber;
-const int Datum::kWidthFieldNumber;
-const int Datum::kDataFieldNumber;
-const int Datum::kLabelFieldNumber;
-const int Datum::kFloatDataFieldNumber;
-const int Datum::kEncodedFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-Datum::Datum()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDatum();
+class BlobProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<BlobProto>()._has_bits_);
+  static const ::opencv_caffe::BlobShape& shape(const BlobProto* msg);
+  static void set_has_shape(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_raw_data_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_raw_data(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_num(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_channels(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
+  static void set_has_height(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_width(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+};
+
+const ::opencv_caffe::BlobShape&
+BlobProto::_Internal::shape(const BlobProto* msg) {
+  return *msg->shape_;
+}
+BlobProto::BlobProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  data_(arena),
+  diff_(arena),
+  double_data_(arena),
+  double_diff_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.Datum)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.BlobProto)
 }
-Datum::Datum(const Datum& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+BlobProto::BlobProto(const BlobProto& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      float_data_(from.float_data_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_data()) {
-    data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_);
+      data_(from.data_),
+      diff_(from.diff_),
+      double_data_(from.double_data_),
+      double_diff_(from.double_diff_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  raw_data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    raw_data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_raw_data()) {
+    raw_data_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_raw_data(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_shape()) {
+    shape_ = new ::opencv_caffe::BlobShape(*from.shape_);
+  } else {
+    shape_ = nullptr;
   }
-  ::memcpy(&channels_, &from.channels_,
-    static_cast<size_t>(reinterpret_cast<char*>(&encoded_) -
-    reinterpret_cast<char*>(&channels_)) + sizeof(encoded_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.Datum)
+  ::memcpy(&num_, &from.num_,
+    static_cast<size_t>(reinterpret_cast<char*>(&raw_data_type_) -
+    reinterpret_cast<char*>(&num_)) + sizeof(raw_data_type_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.BlobProto)
 }
 
-void Datum::SharedCtor() {
-  _cached_size_ = 0;
-  data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&channels_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&encoded_) -
-      reinterpret_cast<char*>(&channels_)) + sizeof(encoded_));
+inline void BlobProto::SharedCtor() {
+raw_data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  raw_data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&shape_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&raw_data_type_) -
+    reinterpret_cast<char*>(&shape_)) + sizeof(raw_data_type_));
 }
 
-Datum::~Datum() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.Datum)
+BlobProto::~BlobProto() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.BlobProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void Datum::SharedDtor() {
-  data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void BlobProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  raw_data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  if (this != internal_default_instance()) delete shape_;
 }
 
-void Datum::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void BlobProto::ArenaDtor(void* object) {
+  BlobProto* _this = reinterpret_cast< BlobProto* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* Datum::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void BlobProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const Datum& Datum::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDatum();
-  return *internal_default_instance();
-}
-
-Datum* Datum::New(::google::protobuf::Arena* arena) const {
-  Datum* n = new Datum;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void BlobProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-void Datum::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.Datum)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+void BlobProto::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.BlobProto)
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  float_data_.Clear();
+  data_.Clear();
+  diff_.Clear();
+  double_data_.Clear();
+  double_diff_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(!data_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*data_.UnsafeRawStringPointer())->clear();
+  if (cached_has_bits & 0x00000003u) {
+    if (cached_has_bits & 0x00000001u) {
+      raw_data_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(shape_ != nullptr);
+      shape_->Clear();
+    }
   }
-  if (cached_has_bits & 62u) {
-    ::memset(&channels_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&encoded_) -
-        reinterpret_cast<char*>(&channels_)) + sizeof(encoded_));
+  if (cached_has_bits & 0x0000007cu) {
+    ::memset(&num_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&raw_data_type_) -
+        reinterpret_cast<char*>(&num_)) + sizeof(raw_data_type_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool Datum::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:opencv_caffe.Datum)
-  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 channels = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_channels();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &channels_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 height = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_height();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &height_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 width = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_width();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &width_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-      // optional bytes data = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_data()));
-        } else {
+const char* BlobProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 num = 1 [default = 0];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_num(&has_bits);
+          num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 channels = 2 [default = 0];
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_channels(&has_bits);
+          channels_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 height = 3 [default = 0];
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_height(&has_bits);
+          height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 width = 4 [default = 0];
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_width(&has_bits);
+          width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float data = 5 [packed = true];
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_data(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 45) {
+          _internal_add_data(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float diff = 6 [packed = true];
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_diff(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 53) {
+          _internal_add_diff(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.BlobShape shape = 7;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_shape(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 label = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_label();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &label_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated float float_data = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 53u, input, this->mutable_float_data())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_float_data())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool encoded = 7 [default = false];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_encoded();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &encoded_)));
-        } 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:opencv_caffe.Datum)
-  return true;
+        continue;
+      // repeated double double_data = 8 [packed = true];
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_double_data(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 65) {
+          _internal_add_double_data(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
+          ptr += sizeof(double);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated double double_diff = 9 [packed = true];
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_double_diff(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 73) {
+          _internal_add_double_diff(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
+          ptr += sizeof(double);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.Type raw_data_type = 10;
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::Type_IsValid(val))) {
+            _internal_set_raw_data_type(static_cast<::opencv_caffe::Type>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(10, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bytes raw_data = 12 [packed = false];
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          auto str = _internal_mutable_raw_data();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.Datum)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void Datum::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.Datum)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* BlobProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.BlobProto)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // optional int32 channels = 1;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->channels(), output);
-  }
-
-  // optional int32 height = 2;
+  // optional int32 num = 1 [default = 0];
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->height(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_num(), target);
   }
 
-  // optional int32 width = 3;
+  // optional int32 channels = 2 [default = 0];
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->width(), output);
-  }
-
-  // optional bytes data = 4;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      4, this->data(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_channels(), target);
   }
 
-  // optional int32 label = 5;
+  // optional int32 height = 3 [default = 0];
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->label(), output);
-  }
-
-  // repeated float float_data = 6;
-  for (int i = 0, n = this->float_data_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      6, this->float_data(i), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_height(), target);
   }
 
-  // optional bool encoded = 7 [default = false];
+  // optional int32 width = 4 [default = 0];
   if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->encoded(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_width(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
+  // repeated float data = 5 [packed = true];
+  if (this->_internal_data_size() > 0) {
+    target = stream->WriteFixedPacked(5, _internal_data(), target);
   }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.Datum)
-}
 
-::google::protobuf::uint8* Datum::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.Datum)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 channels = 1;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->channels(), target);
+  // repeated float diff = 6 [packed = true];
+  if (this->_internal_diff_size() > 0) {
+    target = stream->WriteFixedPacked(6, _internal_diff(), target);
   }
 
-  // optional int32 height = 2;
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->height(), target);
+  // optional .opencv_caffe.BlobShape shape = 7;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        7, _Internal::shape(this), target, stream);
   }
 
-  // optional int32 width = 3;
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->width(), target);
+  // repeated double double_data = 8 [packed = true];
+  if (this->_internal_double_data_size() > 0) {
+    target = stream->WriteFixedPacked(8, _internal_double_data(), target);
   }
 
-  // optional bytes data = 4;
-  if (cached_has_bits & 0x00000001u) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        4, this->data(), target);
+  // repeated double double_diff = 9 [packed = true];
+  if (this->_internal_double_diff_size() > 0) {
+    target = stream->WriteFixedPacked(9, _internal_double_diff(), target);
   }
 
-  // optional int32 label = 5;
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->label(), target);
+  // optional .opencv_caffe.Type raw_data_type = 10;
+  if (cached_has_bits & 0x00000040u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      10, this->_internal_raw_data_type(), target);
   }
 
-  // repeated float float_data = 6;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(6, this->float_data_, target);
-
-  // optional bool encoded = 7 [default = false];
-  if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->encoded(), target);
+  // optional bytes raw_data = 12 [packed = false];
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->WriteBytesMaybeAliased(
+        12, this->_internal_raw_data(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.Datum)
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.BlobProto)
   return target;
 }
 
-size_t Datum::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.Datum)
+size_t BlobProto::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.BlobProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // repeated float data = 5 [packed = true];
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_data_size());
+    size_t data_size = 4UL * count;
+    if (data_size > 0) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
+    }
+    total_size += data_size;
   }
-  // repeated float float_data = 6;
+
+  // repeated float diff = 6 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->float_data_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_diff_size());
     size_t data_size = 4UL * count;
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->float_data_size());
+    if (data_size > 0) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
+    }
+    total_size += data_size;
+  }
+
+  // repeated double double_data = 8 [packed = true];
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_double_data_size());
+    size_t data_size = 8UL * count;
+    if (data_size > 0) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
+    }
+    total_size += data_size;
+  }
+
+  // repeated double double_diff = 9 [packed = true];
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_double_diff_size());
+    size_t data_size = 8UL * count;
+    if (data_size > 0) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
+    }
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 63u) {
-    // optional bytes data = 4;
-    if (has_data()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000007fu) {
+    // optional bytes raw_data = 12 [packed = false];
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::BytesSize(
-          this->data());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+          this->_internal_raw_data());
     }
 
-    // optional int32 channels = 1;
-    if (has_channels()) {
+    // optional .opencv_caffe.BlobShape shape = 7;
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->channels());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *shape_);
     }
 
-    // optional int32 height = 2;
-    if (has_height()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->height());
+    // optional int32 num = 1 [default = 0];
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_num());
     }
 
-    // optional int32 width = 3;
-    if (has_width()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->width());
+    // optional int32 channels = 2 [default = 0];
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_channels());
     }
 
-    // optional int32 label = 5;
-    if (has_label()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->label());
+    // optional int32 height = 3 [default = 0];
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_height());
     }
 
-    // optional bool encoded = 7 [default = false];
-    if (has_encoded()) {
-      total_size += 1 + 1;
+    // optional int32 width = 4 [default = 0];
+    if (cached_has_bits & 0x00000020u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_width());
+    }
+
+    // optional .opencv_caffe.Type raw_data_type = 10;
+    if (cached_has_bits & 0x00000040u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_raw_data_type());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void Datum::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.Datum)
-  GOOGLE_DCHECK_NE(&from, this);
-  const Datum* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const Datum>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.Datum)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.Datum)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BlobProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    BlobProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BlobProto::GetClassData() const { return &_class_data_; }
+
+void BlobProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<BlobProto *>(to)->MergeFrom(
+      static_cast<const BlobProto &>(from));
 }
 
-void Datum::MergeFrom(const Datum& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.Datum)
+
+void BlobProto::MergeFrom(const BlobProto& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.BlobProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  float_data_.MergeFrom(from.float_data_);
+  data_.MergeFrom(from.data_);
+  diff_.MergeFrom(from.diff_);
+  double_data_.MergeFrom(from.double_data_);
+  double_diff_.MergeFrom(from.double_diff_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000007fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_data();
-      data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_);
+      _internal_set_raw_data(from._internal_raw_data());
     }
     if (cached_has_bits & 0x00000002u) {
-      channels_ = from.channels_;
+      _internal_mutable_shape()->::opencv_caffe::BlobShape::MergeFrom(from._internal_shape());
     }
     if (cached_has_bits & 0x00000004u) {
-      height_ = from.height_;
+      num_ = from.num_;
     }
     if (cached_has_bits & 0x00000008u) {
-      width_ = from.width_;
+      channels_ = from.channels_;
     }
     if (cached_has_bits & 0x00000010u) {
-      label_ = from.label_;
+      height_ = from.height_;
     }
     if (cached_has_bits & 0x00000020u) {
-      encoded_ = from.encoded_;
+      width_ = from.width_;
+    }
+    if (cached_has_bits & 0x00000040u) {
+      raw_data_type_ = from.raw_data_type_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
-void Datum::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.Datum)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void Datum::CopyFrom(const Datum& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.Datum)
+void BlobProto::CopyFrom(const BlobProto& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.BlobProto)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool Datum::IsInitialized() const {
+bool BlobProto::IsInitialized() const {
   return true;
 }
 
-void Datum::Swap(Datum* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void Datum::InternalSwap(Datum* other) {
+void BlobProto::InternalSwap(BlobProto* other) {
   using std::swap;
-  float_data_.InternalSwap(&other->float_data_);
-  data_.Swap(&other->data_);
-  swap(channels_, other->channels_);
-  swap(height_, other->height_);
-  swap(width_, other->width_);
-  swap(label_, other->label_);
-  swap(encoded_, other->encoded_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  data_.InternalSwap(&other->data_);
+  diff_.InternalSwap(&other->diff_);
+  double_data_.InternalSwap(&other->double_data_);
+  double_diff_.InternalSwap(&other->double_diff_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &raw_data_, lhs_arena,
+      &other->raw_data_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(BlobProto, raw_data_type_)
+      + sizeof(BlobProto::raw_data_type_)
+      - PROTOBUF_FIELD_OFFSET(BlobProto, shape_)>(
+          reinterpret_cast<char*>(&shape_),
+          reinterpret_cast<char*>(&other->shape_));
 }
 
-::google::protobuf::Metadata Datum::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata BlobProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[1]);
 }
 
-
 // ===================================================================
 
-void FillerParameter::InitAsDefaultInstance() {
-}
-::google::protobuf::internal::ExplicitlyConstructed< ::std::string> FillerParameter::_default_type_;
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FillerParameter::kTypeFieldNumber;
-const int FillerParameter::kValueFieldNumber;
-const int FillerParameter::kMinFieldNumber;
-const int FillerParameter::kMaxFieldNumber;
-const int FillerParameter::kMeanFieldNumber;
-const int FillerParameter::kStdFieldNumber;
-const int FillerParameter::kSparseFieldNumber;
-const int FillerParameter::kVarianceNormFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FillerParameter::FillerParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  }
+class BlobProtoVector::_Internal {
+ public:
+};
+
+BlobProtoVector::BlobProtoVector(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  blobs_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.FillerParameter)
-}
-FillerParameter::FillerParameter(const FillerParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  type_.UnsafeSetDefault(&::opencv_caffe::FillerParameter::_default_type_.get());
-  if (from.has_type()) {
-    type_.AssignWithDefault(&::opencv_caffe::FillerParameter::_default_type_.get(), from.type_);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-  ::memcpy(&value_, &from.value_,
-    static_cast<size_t>(reinterpret_cast<char*>(&std_) -
-    reinterpret_cast<char*>(&value_)) + sizeof(std_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.FillerParameter)
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.BlobProtoVector)
+}
+BlobProtoVector::BlobProtoVector(const BlobProtoVector& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      blobs_(from.blobs_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.BlobProtoVector)
 }
 
-void FillerParameter::SharedCtor() {
-  _cached_size_ = 0;
-  type_.UnsafeSetDefault(&::opencv_caffe::FillerParameter::_default_type_.get());
-  ::memset(&value_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&variance_norm_) -
-      reinterpret_cast<char*>(&value_)) + sizeof(variance_norm_));
-  sparse_ = -1;
-  max_ = 1;
-  std_ = 1;
+inline void BlobProtoVector::SharedCtor() {
 }
 
-FillerParameter::~FillerParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.FillerParameter)
+BlobProtoVector::~BlobProtoVector() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.BlobProtoVector)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FillerParameter::SharedDtor() {
-  type_.DestroyNoArena(&::opencv_caffe::FillerParameter::_default_type_.get());
+inline void BlobProtoVector::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void FillerParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* FillerParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void BlobProtoVector::ArenaDtor(void* object) {
+  BlobProtoVector* _this = reinterpret_cast< BlobProtoVector* >(object);
+  (void)_this;
 }
-
-const FillerParameter& FillerParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameter();
-  return *internal_default_instance();
+void BlobProtoVector::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-FillerParameter* FillerParameter::New(::google::protobuf::Arena* arena) const {
-  FillerParameter* n = new FillerParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void BlobProtoVector::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-void FillerParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.FillerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+void BlobProtoVector::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.BlobProtoVector)
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(!type_.IsDefault(&::opencv_caffe::FillerParameter::_default_type_.get()));
-    (*type_.UnsafeRawStringPointer())->assign(*&::opencv_caffe::FillerParameter::_default_type_.get());
-  }
-  if (cached_has_bits & 254u) {
-    ::memset(&value_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&variance_norm_) -
-        reinterpret_cast<char*>(&value_)) + sizeof(variance_norm_));
-    sparse_ = -1;
-    max_ = 1;
-    std_ = 1;
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FillerParameter::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:opencv_caffe.FillerParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string type = 1 [default = "constant"];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->type().data(), static_cast<int>(this->type().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.FillerParameter.type");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float value = 2 [default = 0];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_value();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &value_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float min = 3 [default = 0];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_min();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &min_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float max = 4 [default = 1];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          set_has_max();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &max_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float mean = 5 [default = 0];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          set_has_mean();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &mean_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float std = 6 [default = 1];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) {
-          set_has_std();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &std_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 sparse = 7 [default = -1];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_sparse();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &sparse_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::FillerParameter_VarianceNorm_IsValid(value)) {
-            set_variance_norm(static_cast< ::opencv_caffe::FillerParameter_VarianceNorm >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                8, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } 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:opencv_caffe.FillerParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.FillerParameter)
-  return false;
-#undef DO_
+  blobs_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FillerParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.FillerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string type = 1 [default = "constant"];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.FillerParameter.type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->type(), output);
-  }
-
-  // optional float value = 2 [default = 0];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->value(), output);
-  }
-
-  // optional float min = 3 [default = 0];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->min(), output);
-  }
-
-  // optional float max = 4 [default = 1];
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->max(), output);
-  }
-
-  // optional float mean = 5 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->mean(), output);
-  }
-
-  // optional float std = 6 [default = 1];
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->std(), output);
-  }
-
-  // optional int32 sparse = 7 [default = -1];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->sparse(), output);
-  }
-
-  // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      8, this->variance_norm(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.FillerParameter)
+const char* BlobProtoVector::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // repeated .opencv_caffe.BlobProto blobs = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_blobs(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* FillerParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.FillerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* BlobProtoVector::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.BlobProtoVector)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  cached_has_bits = _has_bits_[0];
-  // optional string type = 1 [default = "constant"];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.FillerParameter.type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->type(), target);
-  }
-
-  // optional float value = 2 [default = 0];
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->value(), target);
-  }
-
-  // optional float min = 3 [default = 0];
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->min(), target);
-  }
-
-  // optional float max = 4 [default = 1];
-  if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->max(), target);
-  }
-
-  // optional float mean = 5 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->mean(), target);
-  }
-
-  // optional float std = 6 [default = 1];
-  if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->std(), target);
-  }
-
-  // optional int32 sparse = 7 [default = -1];
-  if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->sparse(), target);
-  }
-
-  // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      8, this->variance_norm(), target);
+  // repeated .opencv_caffe.BlobProto blobs = 1;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->_internal_blobs_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_blobs(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.FillerParameter)
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.BlobProtoVector)
   return target;
 }
 
-size_t FillerParameter::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.FillerParameter)
+size_t BlobProtoVector::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.BlobProtoVector)
   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] & 255u) {
-    // optional string type = 1 [default = "constant"];
-    if (has_type()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->type());
-    }
-
-    // optional float value = 2 [default = 0];
-    if (has_value()) {
-      total_size += 1 + 4;
-    }
-
-    // optional float min = 3 [default = 0];
-    if (has_min()) {
-      total_size += 1 + 4;
-    }
-
-    // optional float mean = 5 [default = 0];
-    if (has_mean()) {
-      total_size += 1 + 4;
-    }
-
-    // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
-    if (has_variance_norm()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->variance_norm());
-    }
-
-    // optional int32 sparse = 7 [default = -1];
-    if (has_sparse()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->sparse());
-    }
-
-    // optional float max = 4 [default = 1];
-    if (has_max()) {
-      total_size += 1 + 4;
-    }
-
-    // optional float std = 6 [default = 1];
-    if (has_std()) {
-      total_size += 1 + 4;
-    }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
+  // repeated .opencv_caffe.BlobProto blobs = 1;
+  total_size += 1UL * this->_internal_blobs_size();
+  for (const auto& msg : this->blobs_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
-  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;
+
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FillerParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.FillerParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FillerParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FillerParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.FillerParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.FillerParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BlobProtoVector::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    BlobProtoVector::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BlobProtoVector::GetClassData() const { return &_class_data_; }
+
+void BlobProtoVector::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<BlobProtoVector *>(to)->MergeFrom(
+      static_cast<const BlobProtoVector &>(from));
 }
 
-void FillerParameter::MergeFrom(const FillerParameter& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.FillerParameter)
+
+void BlobProtoVector::MergeFrom(const BlobProtoVector& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.BlobProtoVector)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
-    if (cached_has_bits & 0x00000001u) {
-      set_has_type();
-      type_.AssignWithDefault(&::opencv_caffe::FillerParameter::_default_type_.get(), from.type_);
-    }
-    if (cached_has_bits & 0x00000002u) {
-      value_ = from.value_;
-    }
-    if (cached_has_bits & 0x00000004u) {
-      min_ = from.min_;
-    }
-    if (cached_has_bits & 0x00000008u) {
-      mean_ = from.mean_;
-    }
-    if (cached_has_bits & 0x00000010u) {
-      variance_norm_ = from.variance_norm_;
-    }
-    if (cached_has_bits & 0x00000020u) {
-      sparse_ = from.sparse_;
-    }
-    if (cached_has_bits & 0x00000040u) {
-      max_ = from.max_;
-    }
-    if (cached_has_bits & 0x00000080u) {
-      std_ = from.std_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void FillerParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.FillerParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  blobs_.MergeFrom(from.blobs_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
-void FillerParameter::CopyFrom(const FillerParameter& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.FillerParameter)
+void BlobProtoVector::CopyFrom(const BlobProtoVector& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.BlobProtoVector)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool FillerParameter::IsInitialized() const {
+bool BlobProtoVector::IsInitialized() const {
   return true;
 }
 
-void FillerParameter::Swap(FillerParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void FillerParameter::InternalSwap(FillerParameter* other) {
+void BlobProtoVector::InternalSwap(BlobProtoVector* other) {
   using std::swap;
-  type_.Swap(&other->type_);
-  swap(value_, other->value_);
-  swap(min_, other->min_);
-  swap(mean_, other->mean_);
-  swap(variance_norm_, other->variance_norm_);
-  swap(sparse_, other->sparse_);
-  swap(max_, other->max_);
-  swap(std_, other->std_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  blobs_.InternalSwap(&other->blobs_);
 }
 
-::google::protobuf::Metadata FillerParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata BlobProtoVector::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[2]);
 }
 
-
 // ===================================================================
 
-void NetParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_NetParameter_default_instance_._instance.get_mutable()->state_ = const_cast< ::opencv_caffe::NetState*>(
-      ::opencv_caffe::NetState::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NetParameter::kNameFieldNumber;
-const int NetParameter::kInputFieldNumber;
-const int NetParameter::kInputShapeFieldNumber;
-const int NetParameter::kInputDimFieldNumber;
-const int NetParameter::kForceBackwardFieldNumber;
-const int NetParameter::kStateFieldNumber;
-const int NetParameter::kDebugInfoFieldNumber;
-const int NetParameter::kLayerFieldNumber;
-const int NetParameter::kLayersFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-NetParameter::NetParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetParameter();
-  }
+class PermuteParameter::_Internal {
+ public:
+};
+
+PermuteParameter::PermuteParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  order_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.NetParameter)
-}
-NetParameter::NetParameter(const NetParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      layers_(from.layers_),
-      input_(from.input_),
-      input_dim_(from.input_dim_),
-      input_shape_(from.input_shape_),
-      layer_(from.layer_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  if (from.has_state()) {
-    state_ = new ::opencv_caffe::NetState(*from.state_);
-  } else {
-    state_ = NULL;
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-  ::memcpy(&force_backward_, &from.force_backward_,
-    static_cast<size_t>(reinterpret_cast<char*>(&debug_info_) -
-    reinterpret_cast<char*>(&force_backward_)) + sizeof(debug_info_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.NetParameter)
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.PermuteParameter)
+}
+PermuteParameter::PermuteParameter(const PermuteParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      order_(from.order_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.PermuteParameter)
 }
 
-void NetParameter::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&state_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&debug_info_) -
-      reinterpret_cast<char*>(&state_)) + sizeof(debug_info_));
+inline void PermuteParameter::SharedCtor() {
 }
 
-NetParameter::~NetParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.NetParameter)
+PermuteParameter::~PermuteParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.PermuteParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void NetParameter::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (this != internal_default_instance()) delete state_;
+inline void PermuteParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void NetParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void PermuteParameter::ArenaDtor(void* object) {
+  PermuteParameter* _this = reinterpret_cast< PermuteParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* NetParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void PermuteParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void PermuteParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
+
+void PermuteParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.PermuteParameter)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  order_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-const NetParameter& NetParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetParameter();
-  return *internal_default_instance();
+const char* PermuteParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // repeated uint32 order = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_order(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 10) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_order(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-NetParameter* NetParameter::New(::google::protobuf::Arena* arena) const {
-  NetParameter* n = new NetParameter;
-  if (arena != NULL) {
-    arena->Own(n);
+uint8_t* PermuteParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PermuteParameter)
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  // repeated uint32 order = 1;
+  for (int i = 0, n = this->_internal_order_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_order(i), target);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  return n;
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.PermuteParameter)
+  return target;
 }
 
-void NetParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.NetParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+size_t PermuteParameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PermuteParameter)
+  size_t total_size = 0;
+
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  layers_.Clear();
-  input_.Clear();
-  input_dim_.Clear();
-  input_shape_.Clear();
-  layer_.Clear();
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(state_ != NULL);
-      state_->Clear();
-    }
+  // repeated uint32 order = 1;
+  {
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      UInt32Size(this->order_);
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_order_size());
+    total_size += data_size;
   }
-  ::memset(&force_backward_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&debug_info_) -
-      reinterpret_cast<char*>(&force_backward_)) + sizeof(debug_info_));
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool NetParameter::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:opencv_caffe.NetParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.NetParameter.name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
 
-      // repeated .opencv_caffe.V1LayerParameter layers = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_layers()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
+}
 
-      // repeated string input = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_input()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->input(this->input_size() - 1).data(),
-            static_cast<int>(this->input(this->input_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.NetParameter.input");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PermuteParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    PermuteParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PermuteParameter::GetClassData() const { return &_class_data_; }
 
-      // repeated int32 input_dim = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 32u, input, this->mutable_input_dim())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_input_dim())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void PermuteParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<PermuteParameter *>(to)->MergeFrom(
+      static_cast<const PermuteParameter &>(from));
+}
 
-      // optional bool force_backward = 5 [default = false];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_force_backward();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &force_backward_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
 
-      // optional .opencv_caffe.NetState state = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_state()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void PermuteParameter::MergeFrom(const PermuteParameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PermuteParameter)
+  GOOGLE_DCHECK_NE(&from, this);
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
-      // optional bool debug_info = 7 [default = false];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_debug_info();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &debug_info_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  order_.MergeFrom(from.order_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+}
 
-      // repeated .opencv_caffe.BlobShape input_shape = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_input_shape()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void PermuteParameter::CopyFrom(const PermuteParameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.PermuteParameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
 
-      // repeated .opencv_caffe.LayerParameter layer = 100;
-      case 100: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 802 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_layer()));
-        } 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:opencv_caffe.NetParameter)
+bool PermuteParameter::IsInitialized() const {
   return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.NetParameter)
-  return false;
-#undef DO_
 }
 
-void NetParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.NetParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
+void PermuteParameter::InternalSwap(PermuteParameter* other) {
+  using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  order_.InternalSwap(&other->order_);
+}
 
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetParameter.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
+::PROTOBUF_NAMESPACE_ID::Metadata PermuteParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[3]);
+}
 
-  // repeated .opencv_caffe.V1LayerParameter layers = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->layers_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->layers(static_cast<int>(i)), output);
-  }
+// ===================================================================
 
-  // repeated string input = 3;
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->input(i).data(), static_cast<int>(this->input(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetParameter.input");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      3, this->input(i), output);
+class NormalizeBBoxParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<NormalizeBBoxParameter>()._has_bits_);
+  static void set_has_across_spatial(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-
-  // repeated int32 input_dim = 4;
-  for (int i = 0, n = this->input_dim_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(
-      4, this->input_dim(i), output);
+  static const ::opencv_caffe::FillerParameter& scale_filler(const NormalizeBBoxParameter* msg);
+  static void set_has_scale_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-
-  // optional bool force_backward = 5 [default = false];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->force_backward(), output);
+  static void set_has_channel_shared(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
-
-  // optional .opencv_caffe.NetState state = 6;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, *this->state_, output);
+  static void set_has_eps(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
+};
 
-  // optional bool debug_info = 7 [default = false];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->debug_info(), output);
+const ::opencv_caffe::FillerParameter&
+NormalizeBBoxParameter::_Internal::scale_filler(const NormalizeBBoxParameter* msg) {
+  return *msg->scale_filler_;
+}
+NormalizeBBoxParameter::NormalizeBBoxParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-
-  // repeated .opencv_caffe.BlobShape input_shape = 8;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->input_shape_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, this->input_shape(static_cast<int>(i)), output);
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.NormalizeBBoxParameter)
+}
+NormalizeBBoxParameter::NormalizeBBoxParameter(const NormalizeBBoxParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_scale_filler()) {
+    scale_filler_ = new ::opencv_caffe::FillerParameter(*from.scale_filler_);
+  } else {
+    scale_filler_ = nullptr;
   }
+  ::memcpy(&across_spatial_, &from.across_spatial_,
+    static_cast<size_t>(reinterpret_cast<char*>(&eps_) -
+    reinterpret_cast<char*>(&across_spatial_)) + sizeof(eps_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.NormalizeBBoxParameter)
+}
 
-  // repeated .opencv_caffe.LayerParameter layer = 100;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->layer_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      100, this->layer(static_cast<int>(i)), output);
-  }
+inline void NormalizeBBoxParameter::SharedCtor() {
+scale_filler_ = nullptr;
+across_spatial_ = true;
+channel_shared_ = true;
+eps_ = 1e-10f;
+}
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.NetParameter)
+NormalizeBBoxParameter::~NormalizeBBoxParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.NormalizeBBoxParameter)
+  if (GetArenaForAllocation() != nullptr) return;
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-::google::protobuf::uint8* NetParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NetParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
+inline void NormalizeBBoxParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  if (this != internal_default_instance()) delete scale_filler_;
+}
 
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetParameter.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
+void NormalizeBBoxParameter::ArenaDtor(void* object) {
+  NormalizeBBoxParameter* _this = reinterpret_cast< NormalizeBBoxParameter* >(object);
+  (void)_this;
+}
+void NormalizeBBoxParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void NormalizeBBoxParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
 
-  // repeated .opencv_caffe.V1LayerParameter layers = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->layers_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->layers(static_cast<int>(i)), deterministic, target);
-  }
+void NormalizeBBoxParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.NormalizeBBoxParameter)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-  // repeated string input = 3;
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->input(i).data(), static_cast<int>(this->input(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetParameter.input");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(3, this->input(i), target);
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
+    if (cached_has_bits & 0x00000001u) {
+      GOOGLE_DCHECK(scale_filler_ != nullptr);
+      scale_filler_->Clear();
+    }
+    across_spatial_ = true;
+    channel_shared_ = true;
+    eps_ = 1e-10f;
   }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  // repeated int32 input_dim = 4;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteInt32ToArray(4, this->input_dim_, target);
+const char* NormalizeBBoxParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional bool across_spatial = 1 [default = true];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_across_spatial(&has_bits);
+          across_spatial_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.FillerParameter scale_filler = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_scale_filler(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool channel_shared = 3 [default = true];
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_channel_shared(&has_bits);
+          channel_shared_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float eps = 4 [default = 1e-10];
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 37)) {
+          _Internal::set_has_eps(&has_bits);
+          eps_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
 
-  // optional bool force_backward = 5 [default = false];
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->force_backward(), target);
-  }
+uint8_t* NormalizeBBoxParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NormalizeBBoxParameter)
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
-  // optional .opencv_caffe.NetState state = 6;
+  cached_has_bits = _has_bits_[0];
+  // optional bool across_spatial = 1 [default = true];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, *this->state_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_across_spatial(), target);
   }
 
-  // optional bool debug_info = 7 [default = false];
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->debug_info(), target);
+  // optional .opencv_caffe.FillerParameter scale_filler = 2;
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        2, _Internal::scale_filler(this), target, stream);
   }
 
-  // repeated .opencv_caffe.BlobShape input_shape = 8;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->input_shape_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, this->input_shape(static_cast<int>(i)), deterministic, target);
+  // optional bool channel_shared = 3 [default = true];
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_channel_shared(), target);
   }
 
-  // repeated .opencv_caffe.LayerParameter layer = 100;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->layer_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        100, this->layer(static_cast<int>(i)), deterministic, target);
+  // optional float eps = 4 [default = 1e-10];
+  if (cached_has_bits & 0x00000008u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_eps(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NetParameter)
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NormalizeBBoxParameter)
   return target;
 }
 
-size_t NetParameter::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NetParameter)
+size_t NormalizeBBoxParameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NormalizeBBoxParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // repeated .opencv_caffe.V1LayerParameter layers = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->layers_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->layers(static_cast<int>(i)));
-    }
-  }
-
-  // repeated string input = 3;
-  total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->input_size());
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->input(i));
-  }
-
-  // repeated int32 input_dim = 4;
-  {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
-      Int32Size(this->input_dim_);
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->input_dim_size());
-    total_size += data_size;
-  }
-
-  // repeated .opencv_caffe.BlobShape input_shape = 8;
-  {
-    unsigned int count = static_cast<unsigned int>(this->input_shape_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->input_shape(static_cast<int>(i)));
-    }
-  }
-
-  // repeated .opencv_caffe.LayerParameter layer = 100;
-  {
-    unsigned int count = static_cast<unsigned int>(this->layer_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->layer(static_cast<int>(i)));
-    }
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-  if (_has_bits_[0 / 32] & 15u) {
-    // optional string name = 1;
-    if (has_name()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
+    // optional .opencv_caffe.FillerParameter scale_filler = 2;
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *scale_filler_);
     }
 
-    // optional .opencv_caffe.NetState state = 6;
-    if (has_state()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->state_);
+    // optional bool across_spatial = 1 [default = true];
+    if (cached_has_bits & 0x00000002u) {
+      total_size += 1 + 1;
     }
 
-    // optional bool force_backward = 5 [default = false];
-    if (has_force_backward()) {
+    // optional bool channel_shared = 3 [default = true];
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 1;
     }
 
-    // optional bool debug_info = 7 [default = false];
-    if (has_debug_info()) {
-      total_size += 1 + 1;
+    // optional float eps = 4 [default = 1e-10];
+    if (cached_has_bits & 0x00000008u) {
+      total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void NetParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.NetParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NetParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NetParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.NetParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.NetParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NormalizeBBoxParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NormalizeBBoxParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NormalizeBBoxParameter::GetClassData() const { return &_class_data_; }
+
+void NormalizeBBoxParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NormalizeBBoxParameter *>(to)->MergeFrom(
+      static_cast<const NormalizeBBoxParameter &>(from));
 }
 
-void NetParameter::MergeFrom(const NetParameter& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NetParameter)
+
+void NormalizeBBoxParameter::MergeFrom(const NormalizeBBoxParameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NormalizeBBoxParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  layers_.MergeFrom(from.layers_);
-  input_.MergeFrom(from.input_);
-  input_dim_.MergeFrom(from.input_dim_);
-  input_shape_.MergeFrom(from.input_shape_);
-  layer_.MergeFrom(from.layer_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_mutable_scale_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_scale_filler());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_state()->::opencv_caffe::NetState::MergeFrom(from.state());
+      across_spatial_ = from.across_spatial_;
     }
     if (cached_has_bits & 0x00000004u) {
-      force_backward_ = from.force_backward_;
+      channel_shared_ = from.channel_shared_;
     }
     if (cached_has_bits & 0x00000008u) {
-      debug_info_ = from.debug_info_;
+      eps_ = from.eps_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
-void NetParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.NetParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void NetParameter::CopyFrom(const NetParameter& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.NetParameter)
+void NormalizeBBoxParameter::CopyFrom(const NormalizeBBoxParameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.NormalizeBBoxParameter)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool NetParameter::IsInitialized() const {
-  if (!::google::protobuf::internal::AllAreInitialized(this->layer())) return false;
+bool NormalizeBBoxParameter::IsInitialized() const {
   return true;
 }
 
-void NetParameter::Swap(NetParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void NetParameter::InternalSwap(NetParameter* other) {
+void NormalizeBBoxParameter::InternalSwap(NormalizeBBoxParameter* other) {
   using std::swap;
-  layers_.InternalSwap(&other->layers_);
-  input_.InternalSwap(&other->input_);
-  input_dim_.InternalSwap(&other->input_dim_);
-  input_shape_.InternalSwap(&other->input_shape_);
-  layer_.InternalSwap(&other->layer_);
-  name_.Swap(&other->name_);
-  swap(state_, other->state_);
-  swap(force_backward_, other->force_backward_);
-  swap(debug_info_, other->debug_info_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  swap(scale_filler_, other->scale_filler_);
+  swap(across_spatial_, other->across_spatial_);
+  swap(channel_shared_, other->channel_shared_);
+  swap(eps_, other->eps_);
 }
 
-::google::protobuf::Metadata NetParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata NormalizeBBoxParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[4]);
 }
 
-
 // ===================================================================
 
-void SolverParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_SolverParameter_default_instance_._instance.get_mutable()->net_param_ = const_cast< ::opencv_caffe::NetParameter*>(
-      ::opencv_caffe::NetParameter::internal_default_instance());
-  ::opencv_caffe::_SolverParameter_default_instance_._instance.get_mutable()->train_net_param_ = const_cast< ::opencv_caffe::NetParameter*>(
-      ::opencv_caffe::NetParameter::internal_default_instance());
-  ::opencv_caffe::_SolverParameter_default_instance_._instance.get_mutable()->train_state_ = const_cast< ::opencv_caffe::NetState*>(
-      ::opencv_caffe::NetState::internal_default_instance());
-}
-::google::protobuf::internal::ExplicitlyConstructed< ::std::string> SolverParameter::_default_regularization_type_;
-::google::protobuf::internal::ExplicitlyConstructed< ::std::string> SolverParameter::_default_type_;
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SolverParameter::kNetFieldNumber;
-const int SolverParameter::kNetParamFieldNumber;
-const int SolverParameter::kTrainNetFieldNumber;
-const int SolverParameter::kTestNetFieldNumber;
-const int SolverParameter::kTrainNetParamFieldNumber;
-const int SolverParameter::kTestNetParamFieldNumber;
-const int SolverParameter::kTrainStateFieldNumber;
-const int SolverParameter::kTestStateFieldNumber;
-const int SolverParameter::kTestIterFieldNumber;
-const int SolverParameter::kTestIntervalFieldNumber;
-const int SolverParameter::kTestComputeLossFieldNumber;
-const int SolverParameter::kTestInitializationFieldNumber;
-const int SolverParameter::kBaseLrFieldNumber;
-const int SolverParameter::kDisplayFieldNumber;
-const int SolverParameter::kAverageLossFieldNumber;
-const int SolverParameter::kMaxIterFieldNumber;
-const int SolverParameter::kIterSizeFieldNumber;
-const int SolverParameter::kLrPolicyFieldNumber;
-const int SolverParameter::kGammaFieldNumber;
-const int SolverParameter::kPowerFieldNumber;
-const int SolverParameter::kMomentumFieldNumber;
-const int SolverParameter::kWeightDecayFieldNumber;
-const int SolverParameter::kRegularizationTypeFieldNumber;
-const int SolverParameter::kStepsizeFieldNumber;
-const int SolverParameter::kStepvalueFieldNumber;
-const int SolverParameter::kClipGradientsFieldNumber;
-const int SolverParameter::kSnapshotFieldNumber;
-const int SolverParameter::kSnapshotPrefixFieldNumber;
-const int SolverParameter::kSnapshotDiffFieldNumber;
-const int SolverParameter::kSnapshotFormatFieldNumber;
-const int SolverParameter::kSolverModeFieldNumber;
-const int SolverParameter::kDeviceIdFieldNumber;
-const int SolverParameter::kRandomSeedFieldNumber;
-const int SolverParameter::kTypeFieldNumber;
-const int SolverParameter::kDeltaFieldNumber;
-const int SolverParameter::kMomentum2FieldNumber;
-const int SolverParameter::kRmsDecayFieldNumber;
-const int SolverParameter::kDebugInfoFieldNumber;
-const int SolverParameter::kSnapshotAfterTrainFieldNumber;
-const int SolverParameter::kSolverTypeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-SolverParameter::SolverParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSolverParameter();
+class PriorBoxParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<PriorBoxParameter>()._has_bits_);
+  static void set_has_flip(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.SolverParameter)
-}
-SolverParameter::SolverParameter(const SolverParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      test_net_(from.test_net_),
-      test_iter_(from.test_iter_),
-      test_net_param_(from.test_net_param_),
-      test_state_(from.test_state_),
-      stepvalue_(from.stepvalue_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  train_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_train_net()) {
-    train_net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.train_net_);
-  }
-  lr_policy_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_lr_policy()) {
-    lr_policy_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.lr_policy_);
-  }
-  snapshot_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_snapshot_prefix()) {
-    snapshot_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.snapshot_prefix_);
-  }
-  net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_net()) {
-    net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.net_);
-  }
-  regularization_type_.UnsafeSetDefault(&::opencv_caffe::SolverParameter::_default_regularization_type_.get());
-  if (from.has_regularization_type()) {
-    regularization_type_.AssignWithDefault(&::opencv_caffe::SolverParameter::_default_regularization_type_.get(), from.regularization_type_);
-  }
-  type_.UnsafeSetDefault(&::opencv_caffe::SolverParameter::_default_type_.get());
-  if (from.has_type()) {
-    type_.AssignWithDefault(&::opencv_caffe::SolverParameter::_default_type_.get(), from.type_);
-  }
-  if (from.has_train_net_param()) {
-    train_net_param_ = new ::opencv_caffe::NetParameter(*from.train_net_param_);
-  } else {
-    train_net_param_ = NULL;
+  static void set_has_clip(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
   }
-  if (from.has_net_param()) {
-    net_param_ = new ::opencv_caffe::NetParameter(*from.net_param_);
-  } else {
-    net_param_ = NULL;
+  static void set_has_img_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  if (from.has_train_state()) {
-    train_state_ = new ::opencv_caffe::NetState(*from.train_state_);
-  } else {
-    train_state_ = NULL;
+  static void set_has_img_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  ::memcpy(&test_interval_, &from.test_interval_,
-    static_cast<size_t>(reinterpret_cast<char*>(&rms_decay_) -
-    reinterpret_cast<char*>(&test_interval_)) + sizeof(rms_decay_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.SolverParameter)
+  static void set_has_img_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_step(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_step_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_step_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_offset(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+};
+
+PriorBoxParameter::PriorBoxParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  min_size_(arena),
+  max_size_(arena),
+  aspect_ratio_(arena),
+  variance_(arena),
+  offset_h_(arena),
+  offset_w_(arena),
+  width_(arena),
+  height_(arena) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.PriorBoxParameter)
+}
+PriorBoxParameter::PriorBoxParameter(const PriorBoxParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_),
+      min_size_(from.min_size_),
+      max_size_(from.max_size_),
+      aspect_ratio_(from.aspect_ratio_),
+      variance_(from.variance_),
+      offset_h_(from.offset_h_),
+      offset_w_(from.offset_w_),
+      width_(from.width_),
+      height_(from.height_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  ::memcpy(&img_size_, &from.img_size_,
+    static_cast<size_t>(reinterpret_cast<char*>(&offset_) -
+    reinterpret_cast<char*>(&img_size_)) + sizeof(offset_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.PriorBoxParameter)
 }
 
-void SolverParameter::SharedCtor() {
-  train_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  lr_policy_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  snapshot_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  regularization_type_.UnsafeSetDefault(&::opencv_caffe::SolverParameter::_default_regularization_type_.get());
-  type_.UnsafeSetDefault(&::opencv_caffe::SolverParameter::_default_type_.get());
-  ::memset(&train_net_param_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&solver_type_) -
-      reinterpret_cast<char*>(&train_net_param_)) + sizeof(solver_type_));
-  momentum2_ = 0.999f;
-  random_seed_ = GOOGLE_LONGLONG(-1);
-  solver_mode_ = 1;
-  test_initialization_ = true;
-  snapshot_after_train_ = true;
-  delta_ = 1e-08f;
-  average_loss_ = 1;
-  clip_gradients_ = -1;
-  iter_size_ = 1;
-  snapshot_format_ = 1;
-  rms_decay_ = 0.99f;
-  _cached_size_ = 0;
+inline void PriorBoxParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&img_size_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&step_w_) -
+    reinterpret_cast<char*>(&img_size_)) + sizeof(step_w_));
+flip_ = true;
+clip_ = true;
+offset_ = 0.5f;
 }
 
-SolverParameter::~SolverParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.SolverParameter)
+PriorBoxParameter::~PriorBoxParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.PriorBoxParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SolverParameter::SharedDtor() {
-  train_net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  lr_policy_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  snapshot_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  regularization_type_.DestroyNoArena(&::opencv_caffe::SolverParameter::_default_regularization_type_.get());
-  type_.DestroyNoArena(&::opencv_caffe::SolverParameter::_default_type_.get());
-  if (this != internal_default_instance()) delete train_net_param_;
-  if (this != internal_default_instance()) delete net_param_;
-  if (this != internal_default_instance()) delete train_state_;
+inline void PriorBoxParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void SolverParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* SolverParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void PriorBoxParameter::ArenaDtor(void* object) {
+  PriorBoxParameter* _this = reinterpret_cast< PriorBoxParameter* >(object);
+  (void)_this;
 }
-
-const SolverParameter& SolverParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSolverParameter();
-  return *internal_default_instance();
+void PriorBoxParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-SolverParameter* SolverParameter::New(::google::protobuf::Arena* arena) const {
-  SolverParameter* n = new SolverParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void PriorBoxParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-void SolverParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.SolverParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+void PriorBoxParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.PriorBoxParameter)
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  test_net_.Clear();
-  test_iter_.Clear();
-  test_net_param_.Clear();
-  test_state_.Clear();
-  stepvalue_.Clear();
+  min_size_.Clear();
+  max_size_.Clear();
+  aspect_ratio_.Clear();
+  variance_.Clear();
+  offset_h_.Clear();
+  offset_w_.Clear();
+  width_.Clear();
+  height_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 255u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!train_net_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*train_net_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!lr_policy_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*lr_policy_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!snapshot_prefix_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*snapshot_prefix_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!net_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*net_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(!regularization_type_.IsDefault(&::opencv_caffe::SolverParameter::_default_regularization_type_.get()));
-      (*regularization_type_.UnsafeRawStringPointer())->assign(*&::opencv_caffe::SolverParameter::_default_regularization_type_.get());
-    }
-    if (cached_has_bits & 0x00000020u) {
-      GOOGLE_DCHECK(!type_.IsDefault(&::opencv_caffe::SolverParameter::_default_type_.get()));
-      (*type_.UnsafeRawStringPointer())->assign(*&::opencv_caffe::SolverParameter::_default_type_.get());
-    }
-    if (cached_has_bits & 0x00000040u) {
-      GOOGLE_DCHECK(train_net_param_ != NULL);
-      train_net_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000080u) {
-      GOOGLE_DCHECK(net_param_ != NULL);
-      net_param_->Clear();
-    }
-  }
-  if (cached_has_bits & 0x00000100u) {
-    GOOGLE_DCHECK(train_state_ != NULL);
-    train_state_->Clear();
-  }
-  if (cached_has_bits & 65024u) {
-    ::memset(&test_interval_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&momentum_) -
-        reinterpret_cast<char*>(&test_interval_)) + sizeof(momentum_));
-  }
-  if (cached_has_bits & 16711680u) {
-    ::memset(&weight_decay_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&solver_type_) -
-        reinterpret_cast<char*>(&weight_decay_)) + sizeof(solver_type_));
-  }
-  if (cached_has_bits & 4278190080u) {
-    momentum2_ = 0.999f;
-    random_seed_ = GOOGLE_LONGLONG(-1);
-    solver_mode_ = 1;
-    test_initialization_ = true;
-    snapshot_after_train_ = true;
-    delta_ = 1e-08f;
-    average_loss_ = 1;
-    clip_gradients_ = -1;
+  if (cached_has_bits & 0x000000ffu) {
+    ::memset(&img_size_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&step_w_) -
+        reinterpret_cast<char*>(&img_size_)) + sizeof(step_w_));
+    flip_ = true;
+    clip_ = true;
   }
-  cached_has_bits = _has_bits_[1];
-  if (cached_has_bits & 7u) {
-    iter_size_ = 1;
-    snapshot_format_ = 1;
-    rms_decay_ = 0.99f;
+  offset_ = 0.5f;
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* PriorBoxParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // repeated float min_size = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_min_size(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<13>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 10) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_min_size(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float max_size = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_max_size(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<21>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 18) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_max_size(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float aspect_ratio = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_aspect_ratio(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<29>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 26) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_aspect_ratio(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool flip = 4 [default = true];
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_flip(&has_bits);
+          flip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool clip = 5 [default = true];
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_clip(&has_bits);
+          clip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float variance = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 53)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_variance(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<53>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 50) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_variance(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 img_size = 7;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_img_size(&has_bits);
+          img_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 img_h = 8;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          _Internal::set_has_img_h(&has_bits);
+          img_h_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 img_w = 9;
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+          _Internal::set_has_img_w(&has_bits);
+          img_w_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float step = 10;
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 85)) {
+          _Internal::set_has_step(&has_bits);
+          step_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float step_h = 11;
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 93)) {
+          _Internal::set_has_step_h(&has_bits);
+          step_h_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float step_w = 12;
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 101)) {
+          _Internal::set_has_step_w(&has_bits);
+          step_w_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float offset = 13 [default = 0.5];
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 109)) {
+          _Internal::set_has_offset(&has_bits);
+          offset_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float offset_h = 14;
+      case 14:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 117)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_offset_h(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<117>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 114) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_offset_h(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float offset_w = 15;
+      case 15:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 125)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_offset_w(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<125>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 122) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_offset_w(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float width = 16;
+      case 16:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 133)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            _internal_add_width(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<133>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 130) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_width(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float height = 17;
+      case 17:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 141)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            _internal_add_height(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<141>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 138) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_height(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
+
+uint8_t* PriorBoxParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PriorBoxParameter)
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  // repeated float min_size = 1;
+  for (int i = 0, n = this->_internal_min_size_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_min_size(i), target);
   }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SolverParameter::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:opencv_caffe.SolverParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string train_net = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_train_net()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->train_net().data(), static_cast<int>(this->train_net().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SolverParameter.train_net");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
 
-      // repeated string test_net = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_test_net()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->test_net(this->test_net_size() - 1).data(),
-            static_cast<int>(this->test_net(this->test_net_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SolverParameter.test_net");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float max_size = 2;
+  for (int i = 0, n = this->_internal_max_size_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_max_size(i), target);
+  }
 
-      // repeated int32 test_iter = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 24u, input, this->mutable_test_iter())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_test_iter())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float aspect_ratio = 3;
+  for (int i = 0, n = this->_internal_aspect_ratio_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_aspect_ratio(i), target);
+  }
 
-      // optional int32 test_interval = 4 [default = 0];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_test_interval();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &test_interval_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  cached_has_bits = _has_bits_[0];
+  // optional bool flip = 4 [default = true];
+  if (cached_has_bits & 0x00000040u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_flip(), target);
+  }
 
-      // optional float base_lr = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          set_has_base_lr();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &base_lr_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional bool clip = 5 [default = true];
+  if (cached_has_bits & 0x00000080u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_clip(), target);
+  }
 
-      // optional int32 display = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_display();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &display_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float variance = 6;
+  for (int i = 0, n = this->_internal_variance_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(6, this->_internal_variance(i), target);
+  }
 
-      // optional int32 max_iter = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_max_iter();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &max_iter_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional uint32 img_size = 7;
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_img_size(), target);
+  }
 
-      // optional string lr_policy = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_lr_policy()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->lr_policy().data(), static_cast<int>(this->lr_policy().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SolverParameter.lr_policy");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional uint32 img_h = 8;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(8, this->_internal_img_h(), target);
+  }
 
-      // optional float gamma = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
-          set_has_gamma();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &gamma_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional uint32 img_w = 9;
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(9, this->_internal_img_w(), target);
+  }
 
-      // optional float power = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(85u /* 85 & 0xFF */)) {
-          set_has_power();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &power_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional float step = 10;
+  if (cached_has_bits & 0x00000008u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(10, this->_internal_step(), target);
+  }
 
-      // optional float momentum = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(93u /* 93 & 0xFF */)) {
-          set_has_momentum();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &momentum_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional float step_h = 11;
+  if (cached_has_bits & 0x00000010u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(11, this->_internal_step_h(), target);
+  }
 
-      // optional float weight_decay = 12;
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(101u /* 101 & 0xFF */)) {
-          set_has_weight_decay();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &weight_decay_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional float step_w = 12;
+  if (cached_has_bits & 0x00000020u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(12, this->_internal_step_w(), target);
+  }
 
-      // optional int32 stepsize = 13;
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
-          set_has_stepsize();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &stepsize_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional float offset = 13 [default = 0.5];
+  if (cached_has_bits & 0x00000100u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(13, this->_internal_offset(), target);
+  }
 
-      // optional int32 snapshot = 14 [default = 0];
-      case 14: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(112u /* 112 & 0xFF */)) {
-          set_has_snapshot();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &snapshot_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float offset_h = 14;
+  for (int i = 0, n = this->_internal_offset_h_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(14, this->_internal_offset_h(i), target);
+  }
 
-      // optional string snapshot_prefix = 15;
-      case 15: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_snapshot_prefix()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->snapshot_prefix().data(), static_cast<int>(this->snapshot_prefix().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SolverParameter.snapshot_prefix");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float offset_w = 15;
+  for (int i = 0, n = this->_internal_offset_w_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(15, this->_internal_offset_w(i), target);
+  }
 
-      // optional bool snapshot_diff = 16 [default = false];
-      case 16: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) {
-          set_has_snapshot_diff();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &snapshot_diff_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float width = 16;
+  for (int i = 0, n = this->_internal_width_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(16, this->_internal_width(i), target);
+  }
 
-      // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
-      case 17: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::SolverParameter_SolverMode_IsValid(value)) {
-            set_solver_mode(static_cast< ::opencv_caffe::SolverParameter_SolverMode >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                17, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float height = 17;
+  for (int i = 0, n = this->_internal_height_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(17, this->_internal_height(i), target);
+  }
 
-      // optional int32 device_id = 18 [default = 0];
-      case 18: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(144u /* 144 & 0xFF */)) {
-          set_has_device_id();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &device_id_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.PriorBoxParameter)
+  return target;
+}
 
-      // optional bool test_compute_loss = 19 [default = false];
-      case 19: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(152u /* 152 & 0xFF */)) {
-          set_has_test_compute_loss();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &test_compute_loss_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+size_t PriorBoxParameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PriorBoxParameter)
+  size_t total_size = 0;
 
-      // optional int64 random_seed = 20 [default = -1];
-      case 20: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(160u /* 160 & 0xFF */)) {
-          set_has_random_seed();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &random_seed_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-      // optional .opencv_caffe.NetParameter train_net_param = 21;
-      case 21: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(170u /* 170 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_train_net_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float min_size = 1;
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_min_size_size());
+    size_t data_size = 4UL * count;
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_min_size_size());
+    total_size += data_size;
+  }
 
-      // repeated .opencv_caffe.NetParameter test_net_param = 22;
-      case 22: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(178u /* 178 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_test_net_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float max_size = 2;
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_max_size_size());
+    size_t data_size = 4UL * count;
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_max_size_size());
+    total_size += data_size;
+  }
 
-      // optional bool debug_info = 23 [default = false];
-      case 23: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(184u /* 184 & 0xFF */)) {
-          set_has_debug_info();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &debug_info_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float aspect_ratio = 3;
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_aspect_ratio_size());
+    size_t data_size = 4UL * count;
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_aspect_ratio_size());
+    total_size += data_size;
+  }
 
-      // optional string net = 24;
-      case 24: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(194u /* 194 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_net()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->net().data(), static_cast<int>(this->net().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SolverParameter.net");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float variance = 6;
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_variance_size());
+    size_t data_size = 4UL * count;
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_variance_size());
+    total_size += data_size;
+  }
 
-      // optional .opencv_caffe.NetParameter net_param = 25;
-      case 25: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(202u /* 202 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_net_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float offset_h = 14;
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_offset_h_size());
+    size_t data_size = 4UL * count;
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_offset_h_size());
+    total_size += data_size;
+  }
 
-      // optional .opencv_caffe.NetState train_state = 26;
-      case 26: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(210u /* 210 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_train_state()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float offset_w = 15;
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_offset_w_size());
+    size_t data_size = 4UL * count;
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_offset_w_size());
+    total_size += data_size;
+  }
 
-      // repeated .opencv_caffe.NetState test_state = 27;
-      case 27: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(218u /* 218 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_test_state()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float width = 16;
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_width_size());
+    size_t data_size = 4UL * count;
+    total_size += 2 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_width_size());
+    total_size += data_size;
+  }
 
-      // optional bool snapshot_after_train = 28 [default = true];
-      case 28: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(224u /* 224 & 0xFF */)) {
-          set_has_snapshot_after_train();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &snapshot_after_train_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated float height = 17;
+  {
+    unsigned int count = static_cast<unsigned int>(this->_internal_height_size());
+    size_t data_size = 4UL * count;
+    total_size += 2 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_height_size());
+    total_size += data_size;
+  }
 
-      // optional string regularization_type = 29 [default = "L2"];
-      case 29: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(234u /* 234 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_regularization_type()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->regularization_type().data(), static_cast<int>(this->regularization_type().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SolverParameter.regularization_type");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
+    // optional uint32 img_size = 7;
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_img_size());
+    }
 
-      // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
-      case 30: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(240u /* 240 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::SolverParameter_SolverType_IsValid(value)) {
-            set_solver_type(static_cast< ::opencv_caffe::SolverParameter_SolverType >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                30, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional uint32 img_h = 8;
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_img_h());
+    }
 
-      // optional float delta = 31 [default = 1e-08];
-      case 31: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(253u /* 253 & 0xFF */)) {
-          set_has_delta();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &delta_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional uint32 img_w = 9;
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_img_w());
+    }
 
-      // optional bool test_initialization = 32 [default = true];
-      case 32: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(0u /* 256 & 0xFF */)) {
-          set_has_test_initialization();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &test_initialization_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional float step = 10;
+    if (cached_has_bits & 0x00000008u) {
+      total_size += 1 + 4;
+    }
 
-      // optional int32 average_loss = 33 [default = 1];
-      case 33: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 264 & 0xFF */)) {
-          set_has_average_loss();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &average_loss_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional float step_h = 11;
+    if (cached_has_bits & 0x00000010u) {
+      total_size += 1 + 4;
+    }
 
-      // repeated int32 stepvalue = 34;
-      case 34: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 272 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 2, 272u, input, this->mutable_stepvalue())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 274 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_stepvalue())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional float step_w = 12;
+    if (cached_has_bits & 0x00000020u) {
+      total_size += 1 + 4;
+    }
 
-      // optional float clip_gradients = 35 [default = -1];
-      case 35: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 285 & 0xFF */)) {
-          set_has_clip_gradients();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &clip_gradients_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional bool flip = 4 [default = true];
+    if (cached_has_bits & 0x00000040u) {
+      total_size += 1 + 1;
+    }
 
-      // optional int32 iter_size = 36 [default = 1];
-      case 36: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 288 & 0xFF */)) {
-          set_has_iter_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &iter_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional bool clip = 5 [default = true];
+    if (cached_has_bits & 0x00000080u) {
+      total_size += 1 + 1;
+    }
 
-      // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
-      case 37: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 296 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::SolverParameter_SnapshotFormat_IsValid(value)) {
-            set_snapshot_format(static_cast< ::opencv_caffe::SolverParameter_SnapshotFormat >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                37, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  }
+  // optional float offset = 13 [default = 0.5];
+  if (cached_has_bits & 0x00000100u) {
+    total_size += 1 + 4;
+  }
 
-      // optional float rms_decay = 38 [default = 0.99];
-      case 38: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(53u /* 309 & 0xFF */)) {
-          set_has_rms_decay();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &rms_decay_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
+}
 
-      // optional float momentum2 = 39 [default = 0.999];
-      case 39: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(61u /* 317 & 0xFF */)) {
-          set_has_momentum2();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &momentum2_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PriorBoxParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    PriorBoxParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PriorBoxParameter::GetClassData() const { return &_class_data_; }
 
-      // optional string type = 40 [default = "SGD"];
-      case 40: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 322 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->type().data(), static_cast<int>(this->type().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SolverParameter.type");
-        } 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:opencv_caffe.SolverParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.SolverParameter)
-  return false;
-#undef DO_
+void PriorBoxParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<PriorBoxParameter *>(to)->MergeFrom(
+      static_cast<const PriorBoxParameter &>(from));
 }
 
-void SolverParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.SolverParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+
+void PriorBoxParameter::MergeFrom(const PriorBoxParameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PriorBoxParameter)
+  GOOGLE_DCHECK_NE(&from, this);
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  cached_has_bits = _has_bits_[0];
-  // optional string train_net = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->train_net().data(), static_cast<int>(this->train_net().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.train_net");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->train_net(), output);
+  min_size_.MergeFrom(from.min_size_);
+  max_size_.MergeFrom(from.max_size_);
+  aspect_ratio_.MergeFrom(from.aspect_ratio_);
+  variance_.MergeFrom(from.variance_);
+  offset_h_.MergeFrom(from.offset_h_);
+  offset_w_.MergeFrom(from.offset_w_);
+  width_.MergeFrom(from.width_);
+  height_.MergeFrom(from.height_);
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
+    if (cached_has_bits & 0x00000001u) {
+      img_size_ = from.img_size_;
+    }
+    if (cached_has_bits & 0x00000002u) {
+      img_h_ = from.img_h_;
+    }
+    if (cached_has_bits & 0x00000004u) {
+      img_w_ = from.img_w_;
+    }
+    if (cached_has_bits & 0x00000008u) {
+      step_ = from.step_;
+    }
+    if (cached_has_bits & 0x00000010u) {
+      step_h_ = from.step_h_;
+    }
+    if (cached_has_bits & 0x00000020u) {
+      step_w_ = from.step_w_;
+    }
+    if (cached_has_bits & 0x00000040u) {
+      flip_ = from.flip_;
+    }
+    if (cached_has_bits & 0x00000080u) {
+      clip_ = from.clip_;
+    }
+    _has_bits_[0] |= cached_has_bits;
   }
+  if (cached_has_bits & 0x00000100u) {
+    _internal_set_offset(from._internal_offset());
+  }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+}
+
+void PriorBoxParameter::CopyFrom(const PriorBoxParameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.PriorBoxParameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
 
-  // repeated string test_net = 2;
-  for (int i = 0, n = this->test_net_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->test_net(i).data(), static_cast<int>(this->test_net(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.test_net");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      2, this->test_net(i), output);
-  }
+bool PriorBoxParameter::IsInitialized() const {
+  return true;
+}
 
-  // repeated int32 test_iter = 3;
-  for (int i = 0, n = this->test_iter_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(
-      3, this->test_iter(i), output);
-  }
+void PriorBoxParameter::InternalSwap(PriorBoxParameter* other) {
+  using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  min_size_.InternalSwap(&other->min_size_);
+  max_size_.InternalSwap(&other->max_size_);
+  aspect_ratio_.InternalSwap(&other->aspect_ratio_);
+  variance_.InternalSwap(&other->variance_);
+  offset_h_.InternalSwap(&other->offset_h_);
+  offset_w_.InternalSwap(&other->offset_w_);
+  width_.InternalSwap(&other->width_);
+  height_.InternalSwap(&other->height_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(PriorBoxParameter, step_w_)
+      + sizeof(PriorBoxParameter::step_w_)
+      - PROTOBUF_FIELD_OFFSET(PriorBoxParameter, img_size_)>(
+          reinterpret_cast<char*>(&img_size_),
+          reinterpret_cast<char*>(&other->img_size_));
+  swap(flip_, other->flip_);
+  swap(clip_, other->clip_);
+  swap(offset_, other->offset_);
+}
 
-  // optional int32 test_interval = 4 [default = 0];
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->test_interval(), output);
-  }
+::PROTOBUF_NAMESPACE_ID::Metadata PriorBoxParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[5]);
+}
 
-  // optional float base_lr = 5;
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->base_lr(), output);
-  }
+// ===================================================================
 
-  // optional int32 display = 6;
-  if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->display(), output);
+class DetectionOutputParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<DetectionOutputParameter>()._has_bits_);
+  static void set_has_num_classes(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
-
-  // optional int32 max_iter = 7;
-  if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->max_iter(), output);
+  static void set_has_share_location(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
   }
-
-  // optional string lr_policy = 8;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->lr_policy().data(), static_cast<int>(this->lr_policy().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.lr_policy");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      8, this->lr_policy(), output);
+  static void set_has_background_label_id(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
-
-  // optional float gamma = 9;
-  if (cached_has_bits & 0x00002000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->gamma(), output);
+  static const ::opencv_caffe::NonMaximumSuppressionParameter& nms_param(const DetectionOutputParameter* msg);
+  static void set_has_nms_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-
-  // optional float power = 10;
-  if (cached_has_bits & 0x00004000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(10, this->power(), output);
+  static const ::opencv_caffe::SaveOutputParameter& save_output_param(const DetectionOutputParameter* msg);
+  static void set_has_save_output_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-
-  // optional float momentum = 11;
-  if (cached_has_bits & 0x00008000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->momentum(), output);
+  static void set_has_code_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
   }
-
-  // optional float weight_decay = 12;
-  if (cached_has_bits & 0x00010000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(12, this->weight_decay(), output);
+  static void set_has_variance_encoded_in_target(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
   }
-
-  // optional int32 stepsize = 13;
-  if (cached_has_bits & 0x00020000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->stepsize(), output);
+  static void set_has_keep_top_k(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
   }
-
-  // optional int32 snapshot = 14 [default = 0];
-  if (cached_has_bits & 0x00040000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->snapshot(), output);
+  static void set_has_confidence_threshold(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
-
-  // optional string snapshot_prefix = 15;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->snapshot_prefix().data(), static_cast<int>(this->snapshot_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.snapshot_prefix");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      15, this->snapshot_prefix(), output);
+  static void set_has_normalized_bbox(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
   }
-
-  // optional bool snapshot_diff = 16 [default = false];
-  if (cached_has_bits & 0x00200000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->snapshot_diff(), output);
+  static void set_has_clip(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
   }
+};
 
-  // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
-  if (cached_has_bits & 0x04000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      17, this->solver_mode(), output);
+const ::opencv_caffe::NonMaximumSuppressionParameter&
+DetectionOutputParameter::_Internal::nms_param(const DetectionOutputParameter* msg) {
+  return *msg->nms_param_;
+}
+const ::opencv_caffe::SaveOutputParameter&
+DetectionOutputParameter::_Internal::save_output_param(const DetectionOutputParameter* msg) {
+  return *msg->save_output_param_;
+}
+DetectionOutputParameter::DetectionOutputParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-
-  // optional int32 device_id = 18 [default = 0];
-  if (cached_has_bits & 0x00080000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->device_id(), output);
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.DetectionOutputParameter)
+}
+DetectionOutputParameter::DetectionOutputParameter(const DetectionOutputParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_nms_param()) {
+    nms_param_ = new ::opencv_caffe::NonMaximumSuppressionParameter(*from.nms_param_);
+  } else {
+    nms_param_ = nullptr;
   }
-
-  // optional bool test_compute_loss = 19 [default = false];
-  if (cached_has_bits & 0x00100000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(19, this->test_compute_loss(), output);
+  if (from._internal_has_save_output_param()) {
+    save_output_param_ = new ::opencv_caffe::SaveOutputParameter(*from.save_output_param_);
+  } else {
+    save_output_param_ = nullptr;
   }
+  ::memcpy(&num_classes_, &from.num_classes_,
+    static_cast<size_t>(reinterpret_cast<char*>(&normalized_bbox_) -
+    reinterpret_cast<char*>(&num_classes_)) + sizeof(normalized_bbox_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.DetectionOutputParameter)
+}
 
-  // optional int64 random_seed = 20 [default = -1];
-  if (cached_has_bits & 0x02000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(20, this->random_seed(), output);
-  }
+inline void DetectionOutputParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&nms_param_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&clip_) -
+    reinterpret_cast<char*>(&nms_param_)) + sizeof(clip_));
+keep_top_k_ = -1;
+code_type_ = 1;
+share_location_ = true;
+normalized_bbox_ = true;
+}
 
-  // optional .opencv_caffe.NetParameter train_net_param = 21;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      21, *this->train_net_param_, output);
-  }
+DetectionOutputParameter::~DetectionOutputParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.DetectionOutputParameter)
+  if (GetArenaForAllocation() != nullptr) return;
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  // repeated .opencv_caffe.NetParameter test_net_param = 22;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->test_net_param_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      22, this->test_net_param(static_cast<int>(i)), output);
-  }
+inline void DetectionOutputParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  if (this != internal_default_instance()) delete nms_param_;
+  if (this != internal_default_instance()) delete save_output_param_;
+}
 
-  // optional bool debug_info = 23 [default = false];
-  if (cached_has_bits & 0x00400000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(23, this->debug_info(), output);
-  }
+void DetectionOutputParameter::ArenaDtor(void* object) {
+  DetectionOutputParameter* _this = reinterpret_cast< DetectionOutputParameter* >(object);
+  (void)_this;
+}
+void DetectionOutputParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void DetectionOutputParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
 
-  // optional string net = 24;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->net().data(), static_cast<int>(this->net().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.net");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      24, this->net(), output);
-  }
+void DetectionOutputParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.DetectionOutputParameter)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-  // optional .opencv_caffe.NetParameter net_param = 25;
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      25, *this->net_param_, output);
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
+    if (cached_has_bits & 0x00000001u) {
+      GOOGLE_DCHECK(nms_param_ != nullptr);
+      nms_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(save_output_param_ != nullptr);
+      save_output_param_->Clear();
+    }
   }
-
-  // optional .opencv_caffe.NetState train_state = 26;
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      26, *this->train_state_, output);
+  if (cached_has_bits & 0x000000fcu) {
+    ::memset(&num_classes_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&clip_) -
+        reinterpret_cast<char*>(&num_classes_)) + sizeof(clip_));
+    keep_top_k_ = -1;
   }
-
-  // repeated .opencv_caffe.NetState test_state = 27;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->test_state_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      27, this->test_state(static_cast<int>(i)), output);
+  if (cached_has_bits & 0x00000700u) {
+    code_type_ = 1;
+    share_location_ = true;
+    normalized_bbox_ = true;
   }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  // optional bool snapshot_after_train = 28 [default = true];
-  if (cached_has_bits & 0x10000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(28, this->snapshot_after_train(), output);
-  }
+const char* DetectionOutputParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 num_classes = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_num_classes(&has_bits);
+          num_classes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool share_location = 2 [default = true];
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_share_location(&has_bits);
+          share_location_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 background_label_id = 3 [default = 0];
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_background_label_id(&has_bits);
+          background_label_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_nms_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_save_output_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::PriorBoxParameter_CodeType_IsValid(val))) {
+            _internal_set_code_type(static_cast<::opencv_caffe::PriorBoxParameter_CodeType>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(6, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 keep_top_k = 7 [default = -1];
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_keep_top_k(&has_bits);
+          keep_top_k_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool variance_encoded_in_target = 8 [default = false];
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          _Internal::set_has_variance_encoded_in_target(&has_bits);
+          variance_encoded_in_target_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float confidence_threshold = 9;
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 77)) {
+          _Internal::set_has_confidence_threshold(&has_bits);
+          confidence_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool normalized_bbox = 10 [default = true];
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_normalized_bbox(&has_bits);
+          normalized_bbox_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool clip = 1000 [default = false];
+      case 1000:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          _Internal::set_has_clip(&has_bits);
+          clip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
 
-  // optional string regularization_type = 29 [default = "L2"];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->regularization_type().data(), static_cast<int>(this->regularization_type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.regularization_type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      29, this->regularization_type(), output);
-  }
+uint8_t* DetectionOutputParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.DetectionOutputParameter)
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
-  // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
-  if (cached_has_bits & 0x00800000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      30, this->solver_type(), output);
+  cached_has_bits = _has_bits_[0];
+  // optional uint32 num_classes = 1;
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_classes(), target);
   }
 
-  // optional float delta = 31 [default = 1e-08];
-  if (cached_has_bits & 0x20000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(31, this->delta(), output);
+  // optional bool share_location = 2 [default = true];
+  if (cached_has_bits & 0x00000200u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_share_location(), target);
   }
 
-  // optional bool test_initialization = 32 [default = true];
-  if (cached_has_bits & 0x08000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(32, this->test_initialization(), output);
+  // optional int32 background_label_id = 3 [default = 0];
+  if (cached_has_bits & 0x00000008u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_background_label_id(), target);
   }
 
-  // optional int32 average_loss = 33 [default = 1];
-  if (cached_has_bits & 0x40000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(33, this->average_loss(), output);
+  // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        4, _Internal::nms_param(this), target, stream);
   }
 
-  // repeated int32 stepvalue = 34;
-  for (int i = 0, n = this->stepvalue_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(
-      34, this->stepvalue(i), output);
+  // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        5, _Internal::save_output_param(this), target, stream);
   }
 
-  // optional float clip_gradients = 35 [default = -1];
-  if (cached_has_bits & 0x80000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(35, this->clip_gradients(), output);
+  // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
+  if (cached_has_bits & 0x00000100u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      6, this->_internal_code_type(), target);
   }
 
-  cached_has_bits = _has_bits_[1];
-  // optional int32 iter_size = 36 [default = 1];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(36, this->iter_size(), output);
+  // optional int32 keep_top_k = 7 [default = -1];
+  if (cached_has_bits & 0x00000080u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_keep_top_k(), target);
   }
 
-  // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      37, this->snapshot_format(), output);
+  // optional bool variance_encoded_in_target = 8 [default = false];
+  if (cached_has_bits & 0x00000020u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_variance_encoded_in_target(), target);
   }
 
-  // optional float rms_decay = 38 [default = 0.99];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(38, this->rms_decay(), output);
+  // optional float confidence_threshold = 9;
+  if (cached_has_bits & 0x00000010u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(9, this->_internal_confidence_threshold(), target);
   }
 
-  cached_has_bits = _has_bits_[0];
-  // optional float momentum2 = 39 [default = 0.999];
-  if (cached_has_bits & 0x01000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(39, this->momentum2(), output);
+  // optional bool normalized_bbox = 10 [default = true];
+  if (cached_has_bits & 0x00000400u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->_internal_normalized_bbox(), target);
   }
 
-  // optional string type = 40 [default = "SGD"];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      40, this->type(), output);
+  // optional bool clip = 1000 [default = false];
+  if (cached_has_bits & 0x00000040u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1000, this->_internal_clip(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.SolverParameter)
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.DetectionOutputParameter)
+  return target;
 }
 
-::google::protobuf::uint8* SolverParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SolverParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+size_t DetectionOutputParameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.DetectionOutputParameter)
+  size_t total_size = 0;
+
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // optional string train_net = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->train_net().data(), static_cast<int>(this->train_net().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.train_net");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->train_net(), target);
-  }
+  if (cached_has_bits & 0x000000ffu) {
+    // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
+    if (cached_has_bits & 0x00000001u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *nms_param_);
+    }
 
-  // repeated string test_net = 2;
-  for (int i = 0, n = this->test_net_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->test_net(i).data(), static_cast<int>(this->test_net(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.test_net");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(2, this->test_net(i), target);
-  }
+    // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
+    if (cached_has_bits & 0x00000002u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *save_output_param_);
+    }
 
-  // repeated int32 test_iter = 3;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteInt32ToArray(3, this->test_iter_, target);
+    // optional uint32 num_classes = 1;
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_num_classes());
+    }
 
-  // optional int32 test_interval = 4 [default = 0];
-  if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->test_interval(), target);
-  }
+    // optional int32 background_label_id = 3 [default = 0];
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_background_label_id());
+    }
 
-  // optional float base_lr = 5;
-  if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->base_lr(), target);
-  }
+    // optional float confidence_threshold = 9;
+    if (cached_has_bits & 0x00000010u) {
+      total_size += 1 + 4;
+    }
 
-  // optional int32 display = 6;
-  if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->display(), target);
-  }
+    // optional bool variance_encoded_in_target = 8 [default = false];
+    if (cached_has_bits & 0x00000020u) {
+      total_size += 1 + 1;
+    }
 
-  // optional int32 max_iter = 7;
-  if (cached_has_bits & 0x00001000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->max_iter(), target);
-  }
+    // optional bool clip = 1000 [default = false];
+    if (cached_has_bits & 0x00000040u) {
+      total_size += 2 + 1;
+    }
 
-  // optional string lr_policy = 8;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->lr_policy().data(), static_cast<int>(this->lr_policy().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.lr_policy");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        8, this->lr_policy(), target);
-  }
+    // optional int32 keep_top_k = 7 [default = -1];
+    if (cached_has_bits & 0x00000080u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_keep_top_k());
+    }
 
-  // optional float gamma = 9;
-  if (cached_has_bits & 0x00002000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->gamma(), target);
   }
+  if (cached_has_bits & 0x00000700u) {
+    // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
+    if (cached_has_bits & 0x00000100u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_code_type());
+    }
 
-  // optional float power = 10;
-  if (cached_has_bits & 0x00004000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(10, this->power(), target);
-  }
+    // optional bool share_location = 2 [default = true];
+    if (cached_has_bits & 0x00000200u) {
+      total_size += 1 + 1;
+    }
 
-  // optional float momentum = 11;
-  if (cached_has_bits & 0x00008000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(11, this->momentum(), target);
-  }
+    // optional bool normalized_bbox = 10 [default = true];
+    if (cached_has_bits & 0x00000400u) {
+      total_size += 1 + 1;
+    }
 
-  // optional float weight_decay = 12;
-  if (cached_has_bits & 0x00010000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(12, this->weight_decay(), target);
   }
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
+}
 
-  // optional int32 stepsize = 13;
-  if (cached_has_bits & 0x00020000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->stepsize(), target);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DetectionOutputParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    DetectionOutputParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DetectionOutputParameter::GetClassData() const { return &_class_data_; }
 
-  // optional int32 snapshot = 14 [default = 0];
-  if (cached_has_bits & 0x00040000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->snapshot(), target);
-  }
+void DetectionOutputParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<DetectionOutputParameter *>(to)->MergeFrom(
+      static_cast<const DetectionOutputParameter &>(from));
+}
 
-  // optional string snapshot_prefix = 15;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->snapshot_prefix().data(), static_cast<int>(this->snapshot_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.snapshot_prefix");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        15, this->snapshot_prefix(), target);
-  }
 
-  // optional bool snapshot_diff = 16 [default = false];
-  if (cached_has_bits & 0x00200000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->snapshot_diff(), target);
-  }
+void DetectionOutputParameter::MergeFrom(const DetectionOutputParameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.DetectionOutputParameter)
+  GOOGLE_DCHECK_NE(&from, this);
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
-  // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
-  if (cached_has_bits & 0x04000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      17, this->solver_mode(), target);
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
+    if (cached_has_bits & 0x00000001u) {
+      _internal_mutable_nms_param()->::opencv_caffe::NonMaximumSuppressionParameter::MergeFrom(from._internal_nms_param());
+    }
+    if (cached_has_bits & 0x00000002u) {
+      _internal_mutable_save_output_param()->::opencv_caffe::SaveOutputParameter::MergeFrom(from._internal_save_output_param());
+    }
+    if (cached_has_bits & 0x00000004u) {
+      num_classes_ = from.num_classes_;
+    }
+    if (cached_has_bits & 0x00000008u) {
+      background_label_id_ = from.background_label_id_;
+    }
+    if (cached_has_bits & 0x00000010u) {
+      confidence_threshold_ = from.confidence_threshold_;
+    }
+    if (cached_has_bits & 0x00000020u) {
+      variance_encoded_in_target_ = from.variance_encoded_in_target_;
+    }
+    if (cached_has_bits & 0x00000040u) {
+      clip_ = from.clip_;
+    }
+    if (cached_has_bits & 0x00000080u) {
+      keep_top_k_ = from.keep_top_k_;
+    }
+    _has_bits_[0] |= cached_has_bits;
   }
-
-  // optional int32 device_id = 18 [default = 0];
-  if (cached_has_bits & 0x00080000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(18, this->device_id(), target);
+  if (cached_has_bits & 0x00000700u) {
+    if (cached_has_bits & 0x00000100u) {
+      code_type_ = from.code_type_;
+    }
+    if (cached_has_bits & 0x00000200u) {
+      share_location_ = from.share_location_;
+    }
+    if (cached_has_bits & 0x00000400u) {
+      normalized_bbox_ = from.normalized_bbox_;
+    }
+    _has_bits_[0] |= cached_has_bits;
   }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+}
 
-  // optional bool test_compute_loss = 19 [default = false];
-  if (cached_has_bits & 0x00100000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(19, this->test_compute_loss(), target);
-  }
+void DetectionOutputParameter::CopyFrom(const DetectionOutputParameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.DetectionOutputParameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
 
-  // optional int64 random_seed = 20 [default = -1];
-  if (cached_has_bits & 0x02000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(20, this->random_seed(), target);
-  }
+bool DetectionOutputParameter::IsInitialized() const {
+  return true;
+}
 
-  // optional .opencv_caffe.NetParameter train_net_param = 21;
-  if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        21, *this->train_net_param_, deterministic, target);
-  }
+void DetectionOutputParameter::InternalSwap(DetectionOutputParameter* other) {
+  using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(DetectionOutputParameter, clip_)
+      + sizeof(DetectionOutputParameter::clip_)
+      - PROTOBUF_FIELD_OFFSET(DetectionOutputParameter, nms_param_)>(
+          reinterpret_cast<char*>(&nms_param_),
+          reinterpret_cast<char*>(&other->nms_param_));
+  swap(keep_top_k_, other->keep_top_k_);
+  swap(code_type_, other->code_type_);
+  swap(share_location_, other->share_location_);
+  swap(normalized_bbox_, other->normalized_bbox_);
+}
 
-  // repeated .opencv_caffe.NetParameter test_net_param = 22;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->test_net_param_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        22, this->test_net_param(static_cast<int>(i)), deterministic, target);
-  }
+::PROTOBUF_NAMESPACE_ID::Metadata DetectionOutputParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[6]);
+}
 
-  // optional bool debug_info = 23 [default = false];
-  if (cached_has_bits & 0x00400000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(23, this->debug_info(), target);
-  }
+// ===================================================================
 
-  // optional string net = 24;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->net().data(), static_cast<int>(this->net().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.net");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        24, this->net(), target);
+class Datum::_Internal {
+ public:
+  using HasBits = decltype(std::declval<Datum>()._has_bits_);
+  static void set_has_channels(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-
-  // optional .opencv_caffe.NetParameter net_param = 25;
-  if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        25, *this->net_param_, deterministic, target);
+  static void set_has_height(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
-
-  // optional .opencv_caffe.NetState train_state = 26;
-  if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        26, *this->train_state_, deterministic, target);
+  static void set_has_width(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
-
-  // repeated .opencv_caffe.NetState test_state = 27;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->test_state_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        27, this->test_state(static_cast<int>(i)), deterministic, target);
+  static void set_has_data(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-
-  // optional bool snapshot_after_train = 28 [default = true];
-  if (cached_has_bits & 0x10000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(28, this->snapshot_after_train(), target);
+  static void set_has_label(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
-
-  // optional string regularization_type = 29 [default = "L2"];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->regularization_type().data(), static_cast<int>(this->regularization_type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.regularization_type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        29, this->regularization_type(), target);
+  static void set_has_encoded(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
   }
+};
 
-  // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
-  if (cached_has_bits & 0x00800000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      30, this->solver_type(), target);
+Datum::Datum(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  float_data_(arena) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-
-  // optional float delta = 31 [default = 1e-08];
-  if (cached_has_bits & 0x20000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(31, this->delta(), target);
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.Datum)
+}
+Datum::Datum(const Datum& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_),
+      float_data_(from.float_data_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_data()) {
+    data_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_data(),
+      GetArenaForAllocation());
   }
+  ::memcpy(&channels_, &from.channels_,
+    static_cast<size_t>(reinterpret_cast<char*>(&encoded_) -
+    reinterpret_cast<char*>(&channels_)) + sizeof(encoded_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.Datum)
+}
 
-  // optional bool test_initialization = 32 [default = true];
-  if (cached_has_bits & 0x08000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(32, this->test_initialization(), target);
-  }
+inline void Datum::SharedCtor() {
+data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&channels_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&encoded_) -
+    reinterpret_cast<char*>(&channels_)) + sizeof(encoded_));
+}
 
-  // optional int32 average_loss = 33 [default = 1];
-  if (cached_has_bits & 0x40000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(33, this->average_loss(), target);
-  }
+Datum::~Datum() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.Datum)
+  if (GetArenaForAllocation() != nullptr) return;
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  // repeated int32 stepvalue = 34;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteInt32ToArray(34, this->stepvalue_, target);
+inline void Datum::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+}
 
-  // optional float clip_gradients = 35 [default = -1];
-  if (cached_has_bits & 0x80000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(35, this->clip_gradients(), target);
-  }
+void Datum::ArenaDtor(void* object) {
+  Datum* _this = reinterpret_cast< Datum* >(object);
+  (void)_this;
+}
+void Datum::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void Datum::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
 
-  cached_has_bits = _has_bits_[1];
-  // optional int32 iter_size = 36 [default = 1];
+void Datum::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.Datum)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  float_data_.Clear();
+  cached_has_bits = _has_bits_[0];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(36, this->iter_size(), target);
+    data_.ClearNonDefaultToEmpty();
   }
-
-  // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      37, this->snapshot_format(), target);
+  if (cached_has_bits & 0x0000003eu) {
+    ::memset(&channels_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&encoded_) -
+        reinterpret_cast<char*>(&channels_)) + sizeof(encoded_));
   }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  // optional float rms_decay = 38 [default = 0.99];
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(38, this->rms_decay(), target);
-  }
+const char* Datum::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 channels = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_channels(&has_bits);
+          channels_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 height = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_height(&has_bits);
+          height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 width = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_width(&has_bits);
+          width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bytes data = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_data();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 label = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_label(&has_bits);
+          label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float float_data = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 53)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_float_data(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<53>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 50) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_float_data(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool encoded = 7 [default = false];
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_encoded(&has_bits);
+          encoded_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
+
+uint8_t* Datum::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.Datum)
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // optional float momentum2 = 39 [default = 0.999];
-  if (cached_has_bits & 0x01000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(39, this->momentum2(), target);
+  // optional int32 channels = 1;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_channels(), target);
   }
 
-  // optional string type = 40 [default = "SGD"];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverParameter.type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        40, this->type(), target);
+  // optional int32 height = 2;
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_height(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  // optional int32 width = 3;
+  if (cached_has_bits & 0x00000008u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_width(), target);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SolverParameter)
-  return target;
-}
 
-size_t SolverParameter::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SolverParameter)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // repeated string test_net = 2;
-  total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->test_net_size());
-  for (int i = 0, n = this->test_net_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->test_net(i));
+  // optional bytes data = 4;
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->WriteBytesMaybeAliased(
+        4, this->_internal_data(), target);
   }
 
-  // repeated int32 test_iter = 3;
-  {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
-      Int32Size(this->test_iter_);
-    total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->test_iter_size());
-    total_size += data_size;
+  // optional int32 label = 5;
+  if (cached_has_bits & 0x00000010u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_label(), target);
   }
 
-  // repeated .opencv_caffe.NetParameter test_net_param = 22;
-  {
-    unsigned int count = static_cast<unsigned int>(this->test_net_param_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->test_net_param(static_cast<int>(i)));
-    }
+  // repeated float float_data = 6;
+  for (int i = 0, n = this->_internal_float_data_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(6, this->_internal_float_data(i), target);
   }
 
-  // repeated .opencv_caffe.NetState test_state = 27;
-  {
-    unsigned int count = static_cast<unsigned int>(this->test_state_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->test_state(static_cast<int>(i)));
-    }
+  // optional bool encoded = 7 [default = false];
+  if (cached_has_bits & 0x00000020u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_encoded(), target);
   }
 
-  // repeated int32 stepvalue = 34;
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.Datum)
+  return target;
+}
+
+size_t Datum::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.Datum)
+  size_t total_size = 0;
+
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // repeated float float_data = 6;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
-      Int32Size(this->stepvalue_);
-    total_size += 2 *
-                  ::google::protobuf::internal::FromIntSize(this->stepvalue_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_float_data_size());
+    size_t data_size = 4UL * count;
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_float_data_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 255u) {
-    // optional string train_net = 1;
-    if (has_train_net()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000003fu) {
+    // optional bytes data = 4;
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->train_net());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+          this->_internal_data());
     }
 
-    // optional string lr_policy = 8;
-    if (has_lr_policy()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->lr_policy());
+    // optional int32 channels = 1;
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_channels());
     }
 
-    // optional string snapshot_prefix = 15;
-    if (has_snapshot_prefix()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->snapshot_prefix());
+    // optional int32 height = 2;
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_height());
     }
 
-    // optional string net = 24;
-    if (has_net()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->net());
+    // optional int32 width = 3;
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_width());
     }
 
-    // optional string regularization_type = 29 [default = "L2"];
-    if (has_regularization_type()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->regularization_type());
+    // optional int32 label = 5;
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_label());
     }
 
-    // optional string type = 40 [default = "SGD"];
-    if (has_type()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->type());
+    // optional bool encoded = 7 [default = false];
+    if (cached_has_bits & 0x00000020u) {
+      total_size += 1 + 1;
     }
 
-    // optional .opencv_caffe.NetParameter train_net_param = 21;
-    if (has_train_net_param()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->train_net_param_);
-    }
+  }
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
+}
 
-    // optional .opencv_caffe.NetParameter net_param = 25;
-    if (has_net_param()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->net_param_);
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Datum::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    Datum::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Datum::GetClassData() const { return &_class_data_; }
+
+void Datum::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<Datum *>(to)->MergeFrom(
+      static_cast<const Datum &>(from));
+}
+
+
+void Datum::MergeFrom(const Datum& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.Datum)
+  GOOGLE_DCHECK_NE(&from, this);
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  float_data_.MergeFrom(from.float_data_);
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x0000003fu) {
+    if (cached_has_bits & 0x00000001u) {
+      _internal_set_data(from._internal_data());
+    }
+    if (cached_has_bits & 0x00000002u) {
+      channels_ = from.channels_;
+    }
+    if (cached_has_bits & 0x00000004u) {
+      height_ = from.height_;
+    }
+    if (cached_has_bits & 0x00000008u) {
+      width_ = from.width_;
+    }
+    if (cached_has_bits & 0x00000010u) {
+      label_ = from.label_;
+    }
+    if (cached_has_bits & 0x00000020u) {
+      encoded_ = from.encoded_;
     }
+    _has_bits_[0] |= cached_has_bits;
+  }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+}
+
+void Datum::CopyFrom(const Datum& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.Datum)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Datum::IsInitialized() const {
+  return true;
+}
+
+void Datum::InternalSwap(Datum* other) {
+  using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  float_data_.InternalSwap(&other->float_data_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &data_, lhs_arena,
+      &other->data_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(Datum, encoded_)
+      + sizeof(Datum::encoded_)
+      - PROTOBUF_FIELD_OFFSET(Datum, channels_)>(
+          reinterpret_cast<char*>(&channels_),
+          reinterpret_cast<char*>(&other->channels_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata Datum::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[7]);
+}
+
+// ===================================================================
 
+class FillerParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<FillerParameter>()._has_bits_);
+  static void set_has_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  if (_has_bits_[8 / 32] & 65280u) {
-    // optional .opencv_caffe.NetState train_state = 26;
-    if (has_train_state()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->train_state_);
-    }
+  static void set_has_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_min(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_max(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_mean(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_std(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static void set_has_sparse(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_variance_norm(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+};
 
-    // optional int32 test_interval = 4 [default = 0];
-    if (has_test_interval()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->test_interval());
-    }
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString FillerParameter::_i_give_permission_to_break_this_code_default_type_{{{"constant", 8}}, {nullptr}};
+FillerParameter::FillerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.FillerParameter)
+}
+FillerParameter::FillerParameter(const FillerParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  type_.UnsafeSetDefault(nullptr);
+  if (from._internal_has_type()) {
+    type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_type(),
+      GetArenaForAllocation());
+  }
+  ::memcpy(&value_, &from.value_,
+    static_cast<size_t>(reinterpret_cast<char*>(&std_) -
+    reinterpret_cast<char*>(&value_)) + sizeof(std_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.FillerParameter)
+}
 
-    // optional float base_lr = 5;
-    if (has_base_lr()) {
-      total_size += 1 + 4;
-    }
+inline void FillerParameter::SharedCtor() {
+type_.UnsafeSetDefault(nullptr);
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&value_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&variance_norm_) -
+    reinterpret_cast<char*>(&value_)) + sizeof(variance_norm_));
+sparse_ = -1;
+max_ = 1;
+std_ = 1;
+}
 
-    // optional int32 display = 6;
-    if (has_display()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->display());
-    }
+FillerParameter::~FillerParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.FillerParameter)
+  if (GetArenaForAllocation() != nullptr) return;
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-    // optional int32 max_iter = 7;
-    if (has_max_iter()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->max_iter());
-    }
+inline void FillerParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  type_.DestroyNoArena(nullptr);
+}
 
-    // optional float gamma = 9;
-    if (has_gamma()) {
-      total_size += 1 + 4;
-    }
+void FillerParameter::ArenaDtor(void* object) {
+  FillerParameter* _this = reinterpret_cast< FillerParameter* >(object);
+  (void)_this;
+}
+void FillerParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void FillerParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
 
-    // optional float power = 10;
-    if (has_power()) {
-      total_size += 1 + 4;
-    }
+void FillerParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.FillerParameter)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-    // optional float momentum = 11;
-    if (has_momentum()) {
-      total_size += 1 + 4;
-    }
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    type_.ClearToDefault(::opencv_caffe::FillerParameter::_i_give_permission_to_break_this_code_default_type_, GetArenaForAllocation());
+     }
+  if (cached_has_bits & 0x000000feu) {
+    ::memset(&value_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&variance_norm_) -
+        reinterpret_cast<char*>(&value_)) + sizeof(variance_norm_));
+    sparse_ = -1;
+    max_ = 1;
+    std_ = 1;
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* FillerParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string type = 1 [default = "constant"];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.FillerParameter.type");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float value = 2 [default = 0];
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_value(&has_bits);
+          value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float min = 3 [default = 0];
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_min(&has_bits);
+          min_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float max = 4 [default = 1];
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 37)) {
+          _Internal::set_has_max(&has_bits);
+          max_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float mean = 5 [default = 0];
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
+          _Internal::set_has_mean(&has_bits);
+          mean_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float std = 6 [default = 1];
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 53)) {
+          _Internal::set_has_std(&has_bits);
+          std_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 sparse = 7 [default = -1];
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_sparse(&has_bits);
+          sparse_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::FillerParameter_VarianceNorm_IsValid(val))) {
+            _internal_set_variance_norm(static_cast<::opencv_caffe::FillerParameter_VarianceNorm>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
+
+uint8_t* FillerParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.FillerParameter)
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
+  cached_has_bits = _has_bits_[0];
+  // optional string type = 1 [default = "constant"];
+  if (cached_has_bits & 0x00000001u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_type().data(), static_cast<int>(this->_internal_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.FillerParameter.type");
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_type(), target);
   }
-  if (_has_bits_[16 / 32] & 16711680u) {
-    // optional float weight_decay = 12;
-    if (has_weight_decay()) {
-      total_size += 1 + 4;
-    }
 
-    // optional int32 stepsize = 13;
-    if (has_stepsize()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->stepsize());
-    }
+  // optional float value = 2 [default = 0];
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_value(), target);
+  }
 
-    // optional int32 snapshot = 14 [default = 0];
-    if (has_snapshot()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->snapshot());
-    }
+  // optional float min = 3 [default = 0];
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_min(), target);
+  }
 
-    // optional int32 device_id = 18 [default = 0];
-    if (has_device_id()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->device_id());
-    }
+  // optional float max = 4 [default = 1];
+  if (cached_has_bits & 0x00000040u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_max(), target);
+  }
 
-    // optional bool test_compute_loss = 19 [default = false];
-    if (has_test_compute_loss()) {
-      total_size += 2 + 1;
-    }
+  // optional float mean = 5 [default = 0];
+  if (cached_has_bits & 0x00000008u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->_internal_mean(), target);
+  }
 
-    // optional bool snapshot_diff = 16 [default = false];
-    if (has_snapshot_diff()) {
-      total_size += 2 + 1;
-    }
+  // optional float std = 6 [default = 1];
+  if (cached_has_bits & 0x00000080u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(6, this->_internal_std(), target);
+  }
 
-    // optional bool debug_info = 23 [default = false];
-    if (has_debug_info()) {
-      total_size += 2 + 1;
-    }
+  // optional int32 sparse = 7 [default = -1];
+  if (cached_has_bits & 0x00000020u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_sparse(), target);
+  }
 
-    // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
-    if (has_solver_type()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->solver_type());
-    }
+  // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
+  if (cached_has_bits & 0x00000010u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      8, this->_internal_variance_norm(), target);
+  }
 
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  if (_has_bits_[24 / 32] & 4278190080u) {
-    // optional float momentum2 = 39 [default = 0.999];
-    if (has_momentum2()) {
-      total_size += 2 + 4;
-    }
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.FillerParameter)
+  return target;
+}
 
-    // optional int64 random_seed = 20 [default = -1];
-    if (has_random_seed()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->random_seed());
-    }
+size_t FillerParameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.FillerParameter)
+  size_t total_size = 0;
 
-    // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
-    if (has_solver_mode()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->solver_mode());
-    }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-    // optional bool test_initialization = 32 [default = true];
-    if (has_test_initialization()) {
-      total_size += 2 + 1;
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
+    // optional string type = 1 [default = "constant"];
+    if (cached_has_bits & 0x00000001u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_type());
     }
 
-    // optional bool snapshot_after_train = 28 [default = true];
-    if (has_snapshot_after_train()) {
-      total_size += 2 + 1;
+    // optional float value = 2 [default = 0];
+    if (cached_has_bits & 0x00000002u) {
+      total_size += 1 + 4;
     }
 
-    // optional float delta = 31 [default = 1e-08];
-    if (has_delta()) {
-      total_size += 2 + 4;
+    // optional float min = 3 [default = 0];
+    if (cached_has_bits & 0x00000004u) {
+      total_size += 1 + 4;
     }
 
-    // optional int32 average_loss = 33 [default = 1];
-    if (has_average_loss()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->average_loss());
+    // optional float mean = 5 [default = 0];
+    if (cached_has_bits & 0x00000008u) {
+      total_size += 1 + 4;
     }
 
-    // optional float clip_gradients = 35 [default = -1];
-    if (has_clip_gradients()) {
-      total_size += 2 + 4;
+    // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
+    if (cached_has_bits & 0x00000010u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_variance_norm());
     }
 
-  }
-  if (_has_bits_[32 / 32] & 7u) {
-    // optional int32 iter_size = 36 [default = 1];
-    if (has_iter_size()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->iter_size());
+    // optional int32 sparse = 7 [default = -1];
+    if (cached_has_bits & 0x00000020u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_sparse());
     }
 
-    // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
-    if (has_snapshot_format()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->snapshot_format());
+    // optional float max = 4 [default = 1];
+    if (cached_has_bits & 0x00000040u) {
+      total_size += 1 + 4;
     }
 
-    // optional float rms_decay = 38 [default = 0.99];
-    if (has_rms_decay()) {
-      total_size += 2 + 4;
+    // optional float std = 6 [default = 1];
+    if (cached_has_bits & 0x00000080u) {
+      total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SolverParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.SolverParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SolverParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SolverParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.SolverParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.SolverParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FillerParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FillerParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FillerParameter::GetClassData() const { return &_class_data_; }
+
+void FillerParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FillerParameter *>(to)->MergeFrom(
+      static_cast<const FillerParameter &>(from));
 }
 
-void SolverParameter::MergeFrom(const SolverParameter& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SolverParameter)
+
+void FillerParameter::MergeFrom(const FillerParameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.FillerParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  test_net_.MergeFrom(from.test_net_);
-  test_iter_.MergeFrom(from.test_iter_);
-  test_net_param_.MergeFrom(from.test_net_param_);
-  test_state_.MergeFrom(from.test_state_);
-  stepvalue_.MergeFrom(from.stepvalue_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_train_net();
-      train_net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.train_net_);
+      _internal_set_type(from._internal_type());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_lr_policy();
-      lr_policy_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.lr_policy_);
+      value_ = from.value_;
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_snapshot_prefix();
-      snapshot_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.snapshot_prefix_);
+      min_ = from.min_;
     }
     if (cached_has_bits & 0x00000008u) {
-      set_has_net();
-      net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.net_);
+      mean_ = from.mean_;
     }
     if (cached_has_bits & 0x00000010u) {
-      set_has_regularization_type();
-      regularization_type_.AssignWithDefault(&::opencv_caffe::SolverParameter::_default_regularization_type_.get(), from.regularization_type_);
+      variance_norm_ = from.variance_norm_;
     }
     if (cached_has_bits & 0x00000020u) {
-      set_has_type();
-      type_.AssignWithDefault(&::opencv_caffe::SolverParameter::_default_type_.get(), from.type_);
+      sparse_ = from.sparse_;
     }
     if (cached_has_bits & 0x00000040u) {
-      mutable_train_net_param()->::opencv_caffe::NetParameter::MergeFrom(from.train_net_param());
+      max_ = from.max_;
     }
     if (cached_has_bits & 0x00000080u) {
-      mutable_net_param()->::opencv_caffe::NetParameter::MergeFrom(from.net_param());
-    }
-  }
-  if (cached_has_bits & 65280u) {
-    if (cached_has_bits & 0x00000100u) {
-      mutable_train_state()->::opencv_caffe::NetState::MergeFrom(from.train_state());
-    }
-    if (cached_has_bits & 0x00000200u) {
-      test_interval_ = from.test_interval_;
-    }
-    if (cached_has_bits & 0x00000400u) {
-      base_lr_ = from.base_lr_;
-    }
-    if (cached_has_bits & 0x00000800u) {
-      display_ = from.display_;
-    }
-    if (cached_has_bits & 0x00001000u) {
-      max_iter_ = from.max_iter_;
-    }
-    if (cached_has_bits & 0x00002000u) {
-      gamma_ = from.gamma_;
-    }
-    if (cached_has_bits & 0x00004000u) {
-      power_ = from.power_;
-    }
-    if (cached_has_bits & 0x00008000u) {
-      momentum_ = from.momentum_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-  if (cached_has_bits & 16711680u) {
-    if (cached_has_bits & 0x00010000u) {
-      weight_decay_ = from.weight_decay_;
-    }
-    if (cached_has_bits & 0x00020000u) {
-      stepsize_ = from.stepsize_;
-    }
-    if (cached_has_bits & 0x00040000u) {
-      snapshot_ = from.snapshot_;
-    }
-    if (cached_has_bits & 0x00080000u) {
-      device_id_ = from.device_id_;
-    }
-    if (cached_has_bits & 0x00100000u) {
-      test_compute_loss_ = from.test_compute_loss_;
-    }
-    if (cached_has_bits & 0x00200000u) {
-      snapshot_diff_ = from.snapshot_diff_;
-    }
-    if (cached_has_bits & 0x00400000u) {
-      debug_info_ = from.debug_info_;
-    }
-    if (cached_has_bits & 0x00800000u) {
-      solver_type_ = from.solver_type_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-  if (cached_has_bits & 4278190080u) {
-    if (cached_has_bits & 0x01000000u) {
-      momentum2_ = from.momentum2_;
-    }
-    if (cached_has_bits & 0x02000000u) {
-      random_seed_ = from.random_seed_;
-    }
-    if (cached_has_bits & 0x04000000u) {
-      solver_mode_ = from.solver_mode_;
-    }
-    if (cached_has_bits & 0x08000000u) {
-      test_initialization_ = from.test_initialization_;
-    }
-    if (cached_has_bits & 0x10000000u) {
-      snapshot_after_train_ = from.snapshot_after_train_;
-    }
-    if (cached_has_bits & 0x20000000u) {
-      delta_ = from.delta_;
-    }
-    if (cached_has_bits & 0x40000000u) {
-      average_loss_ = from.average_loss_;
-    }
-    if (cached_has_bits & 0x80000000u) {
-      clip_gradients_ = from.clip_gradients_;
+      std_ = from.std_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  cached_has_bits = from._has_bits_[1];
-  if (cached_has_bits & 7u) {
-    if (cached_has_bits & 0x00000001u) {
-      iter_size_ = from.iter_size_;
-    }
-    if (cached_has_bits & 0x00000002u) {
-      snapshot_format_ = from.snapshot_format_;
-    }
-    if (cached_has_bits & 0x00000004u) {
-      rms_decay_ = from.rms_decay_;
-    }
-    _has_bits_[1] |= cached_has_bits;
-  }
-}
-
-void SolverParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.SolverParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
-void SolverParameter::CopyFrom(const SolverParameter& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.SolverParameter)
+void FillerParameter::CopyFrom(const FillerParameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.FillerParameter)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool SolverParameter::IsInitialized() const {
-  if (!::google::protobuf::internal::AllAreInitialized(this->test_net_param())) return false;
-  if (has_train_net_param()) {
-    if (!this->train_net_param_->IsInitialized()) return false;
-  }
-  if (has_net_param()) {
-    if (!this->net_param_->IsInitialized()) return false;
-  }
+bool FillerParameter::IsInitialized() const {
   return true;
 }
 
-void SolverParameter::Swap(SolverParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void SolverParameter::InternalSwap(SolverParameter* other) {
+void FillerParameter::InternalSwap(FillerParameter* other) {
   using std::swap;
-  test_net_.InternalSwap(&other->test_net_);
-  test_iter_.InternalSwap(&other->test_iter_);
-  test_net_param_.InternalSwap(&other->test_net_param_);
-  test_state_.InternalSwap(&other->test_state_);
-  stepvalue_.InternalSwap(&other->stepvalue_);
-  train_net_.Swap(&other->train_net_);
-  lr_policy_.Swap(&other->lr_policy_);
-  snapshot_prefix_.Swap(&other->snapshot_prefix_);
-  net_.Swap(&other->net_);
-  regularization_type_.Swap(&other->regularization_type_);
-  type_.Swap(&other->type_);
-  swap(train_net_param_, other->train_net_param_);
-  swap(net_param_, other->net_param_);
-  swap(train_state_, other->train_state_);
-  swap(test_interval_, other->test_interval_);
-  swap(base_lr_, other->base_lr_);
-  swap(display_, other->display_);
-  swap(max_iter_, other->max_iter_);
-  swap(gamma_, other->gamma_);
-  swap(power_, other->power_);
-  swap(momentum_, other->momentum_);
-  swap(weight_decay_, other->weight_decay_);
-  swap(stepsize_, other->stepsize_);
-  swap(snapshot_, other->snapshot_);
-  swap(device_id_, other->device_id_);
-  swap(test_compute_loss_, other->test_compute_loss_);
-  swap(snapshot_diff_, other->snapshot_diff_);
-  swap(debug_info_, other->debug_info_);
-  swap(solver_type_, other->solver_type_);
-  swap(momentum2_, other->momentum2_);
-  swap(random_seed_, other->random_seed_);
-  swap(solver_mode_, other->solver_mode_);
-  swap(test_initialization_, other->test_initialization_);
-  swap(snapshot_after_train_, other->snapshot_after_train_);
-  swap(delta_, other->delta_);
-  swap(average_loss_, other->average_loss_);
-  swap(clip_gradients_, other->clip_gradients_);
-  swap(iter_size_, other->iter_size_);
-  swap(snapshot_format_, other->snapshot_format_);
-  swap(rms_decay_, other->rms_decay_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  swap(_has_bits_[1], other->_has_bits_[1]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      nullptr,
+      &type_, lhs_arena,
+      &other->type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(FillerParameter, variance_norm_)
+      + sizeof(FillerParameter::variance_norm_)
+      - PROTOBUF_FIELD_OFFSET(FillerParameter, value_)>(
+          reinterpret_cast<char*>(&value_),
+          reinterpret_cast<char*>(&other->value_));
+  swap(sparse_, other->sparse_);
+  swap(max_, other->max_);
+  swap(std_, other->std_);
 }
 
-::google::protobuf::Metadata SolverParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FillerParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[8]);
 }
 
-
 // ===================================================================
 
-void SolverState::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SolverState::kIterFieldNumber;
-const int SolverState::kLearnedNetFieldNumber;
-const int SolverState::kHistoryFieldNumber;
-const int SolverState::kCurrentStepFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-SolverState::SolverState()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSolverState();
+class NetParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<NetParameter>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_force_backward(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+  static const ::opencv_caffe::NetState& state(const NetParameter* msg);
+  static void set_has_state(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_debug_info(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+};
+
+const ::opencv_caffe::NetState&
+NetParameter::_Internal::state(const NetParameter* msg) {
+  return *msg->state_;
+}
+NetParameter::NetParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  layers_(arena),
+  input_(arena),
+  input_dim_(arena),
+  input_shape_(arena),
+  layer_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.SolverState)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.NetParameter)
 }
-SolverState::SolverState(const SolverState& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+NetParameter::NetParameter(const NetParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      history_(from.history_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  learned_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_learned_net()) {
-    learned_net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.learned_net_);
+      layers_(from.layers_),
+      input_(from.input_),
+      input_dim_(from.input_dim_),
+      input_shape_(from.input_shape_),
+      layer_(from.layer_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_state()) {
+    state_ = new ::opencv_caffe::NetState(*from.state_);
+  } else {
+    state_ = nullptr;
   }
-  ::memcpy(&iter_, &from.iter_,
-    static_cast<size_t>(reinterpret_cast<char*>(&current_step_) -
-    reinterpret_cast<char*>(&iter_)) + sizeof(current_step_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.SolverState)
+  ::memcpy(&force_backward_, &from.force_backward_,
+    static_cast<size_t>(reinterpret_cast<char*>(&debug_info_) -
+    reinterpret_cast<char*>(&force_backward_)) + sizeof(debug_info_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.NetParameter)
 }
 
-void SolverState::SharedCtor() {
-  _cached_size_ = 0;
-  learned_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&iter_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&current_step_) -
-      reinterpret_cast<char*>(&iter_)) + sizeof(current_step_));
+inline void NetParameter::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&state_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&debug_info_) -
+    reinterpret_cast<char*>(&state_)) + sizeof(debug_info_));
 }
 
-SolverState::~SolverState() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.SolverState)
+NetParameter::~NetParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.NetParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SolverState::SharedDtor() {
-  learned_net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void NetParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  if (this != internal_default_instance()) delete state_;
 }
 
-void SolverState::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* SolverState::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void NetParameter::ArenaDtor(void* object) {
+  NetParameter* _this = reinterpret_cast< NetParameter* >(object);
+  (void)_this;
 }
-
-const SolverState& SolverState::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSolverState();
-  return *internal_default_instance();
+void NetParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-SolverState* SolverState::New(::google::protobuf::Arena* arena) const {
-  SolverState* n = new SolverState;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void NetParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-void SolverState::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.SolverState)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+void NetParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.NetParameter)
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  history_.Clear();
+  layers_.Clear();
+  input_.Clear();
+  input_dim_.Clear();
+  input_shape_.Clear();
+  layer_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(!learned_net_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*learned_net_.UnsafeRawStringPointer())->clear();
-  }
-  if (cached_has_bits & 6u) {
-    ::memset(&iter_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&current_step_) -
-        reinterpret_cast<char*>(&iter_)) + sizeof(current_step_));
+  if (cached_has_bits & 0x00000003u) {
+    if (cached_has_bits & 0x00000001u) {
+      name_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(state_ != nullptr);
+      state_->Clear();
+    }
   }
+  ::memset(&force_backward_, 0, static_cast<size_t>(
+      reinterpret_cast<char*>(&debug_info_) -
+      reinterpret_cast<char*>(&force_backward_)) + sizeof(debug_info_));
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SolverState::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:opencv_caffe.SolverState)
-  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 iter = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_iter();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &iter_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string learned_net = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_learned_net()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->learned_net().data(), static_cast<int>(this->learned_net().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SolverState.learned_net");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-      // repeated .opencv_caffe.BlobProto history = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_history()));
-        } else {
+const char* NetParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string name = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.NetParameter.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.V1LayerParameter layers = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_layers(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string input = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_input();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.NetParameter.input");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated int32 input_dim = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_input_dim(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<32>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 34) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_input_dim(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool force_backward = 5 [default = false];
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_force_backward(&has_bits);
+          force_backward_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.NetState state = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ctx->ParseMessage(_internal_mutable_state(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 current_step = 4 [default = 0];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_current_step();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &current_step_)));
-        } 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:opencv_caffe.SolverState)
-  return true;
+        continue;
+      // optional bool debug_info = 7 [default = false];
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_debug_info(&has_bits);
+          debug_info_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.BlobShape input_shape = 8;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_input_shape(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.LayerParameter layer = 100;
+      case 100:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_layer(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<802>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.SolverState)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void SolverState::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.SolverState)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* NetParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NetParameter)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // optional int32 iter = 1;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->iter(), output);
-  }
-
-  // optional string learned_net = 2;
+  // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->learned_net().data(), static_cast<int>(this->learned_net().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverState.learned_net");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->learned_net(), output);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.NetParameter.name");
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
-  // repeated .opencv_caffe.BlobProto history = 3;
+  // repeated .opencv_caffe.V1LayerParameter layers = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->history_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, this->history(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_layers_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_layers(i), target, stream);
   }
 
-  // optional int32 current_step = 4 [default = 0];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->current_step(), output);
+  // repeated string input = 3;
+  for (int i = 0, n = this->_internal_input_size(); i < n; i++) {
+    const auto& s = this->_internal_input(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.NetParameter.input");
+    target = stream->WriteString(3, s, target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
+  // repeated int32 input_dim = 4;
+  for (int i = 0, n = this->_internal_input_dim_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_input_dim(i), target);
   }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.SolverState)
-}
 
-::google::protobuf::uint8* SolverState::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SolverState)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
+  // optional bool force_backward = 5 [default = false];
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_force_backward(), target);
+  }
 
-  cached_has_bits = _has_bits_[0];
-  // optional int32 iter = 1;
+  // optional .opencv_caffe.NetState state = 6;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->iter(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        6, _Internal::state(this), target, stream);
   }
 
-  // optional string learned_net = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->learned_net().data(), static_cast<int>(this->learned_net().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SolverState.learned_net");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->learned_net(), target);
+  // optional bool debug_info = 7 [default = false];
+  if (cached_has_bits & 0x00000008u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_debug_info(), target);
   }
 
-  // repeated .opencv_caffe.BlobProto history = 3;
+  // repeated .opencv_caffe.BlobShape input_shape = 8;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->history_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, this->history(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_input_shape_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(8, this->_internal_input_shape(i), target, stream);
   }
 
-  // optional int32 current_step = 4 [default = 0];
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->current_step(), target);
+  // repeated .opencv_caffe.LayerParameter layer = 100;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->_internal_layer_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(100, this->_internal_layer(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SolverState)
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NetParameter)
   return target;
 }
 
-size_t SolverState::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SolverState)
+size_t NetParameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NetParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // repeated .opencv_caffe.V1LayerParameter layers = 2;
+  total_size += 1UL * this->_internal_layers_size();
+  for (const auto& msg : this->layers_) {
     total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
-  // repeated .opencv_caffe.BlobProto history = 3;
+
+  // repeated string input = 3;
+  total_size += 1 *
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(input_.size());
+  for (int i = 0, n = input_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      input_.Get(i));
+  }
+
+  // repeated int32 input_dim = 4;
   {
-    unsigned int count = static_cast<unsigned int>(this->history_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->history(static_cast<int>(i)));
-    }
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      Int32Size(this->input_dim_);
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_input_dim_size());
+    total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 7u) {
-    // optional string learned_net = 2;
-    if (has_learned_net()) {
+  // repeated .opencv_caffe.BlobShape input_shape = 8;
+  total_size += 1UL * this->_internal_input_shape_size();
+  for (const auto& msg : this->input_shape_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
+  }
+
+  // repeated .opencv_caffe.LayerParameter layer = 100;
+  total_size += 2UL * this->_internal_layer_size();
+  for (const auto& msg : this->layer_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
+  }
+
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
+    // optional string name = 1;
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->learned_net());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
-    // optional int32 iter = 1;
-    if (has_iter()) {
+    // optional .opencv_caffe.NetState state = 6;
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->iter());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *state_);
     }
 
-    // optional int32 current_step = 4 [default = 0];
-    if (has_current_step()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->current_step());
+    // optional bool force_backward = 5 [default = false];
+    if (cached_has_bits & 0x00000004u) {
+      total_size += 1 + 1;
+    }
+
+    // optional bool debug_info = 7 [default = false];
+    if (cached_has_bits & 0x00000008u) {
+      total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SolverState::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.SolverState)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SolverState* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SolverState>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.SolverState)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.SolverState)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NetParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NetParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NetParameter::GetClassData() const { return &_class_data_; }
+
+void NetParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NetParameter *>(to)->MergeFrom(
+      static_cast<const NetParameter &>(from));
 }
 
-void SolverState::MergeFrom(const SolverState& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SolverState)
+
+void NetParameter::MergeFrom(const NetParameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NetParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  history_.MergeFrom(from.history_);
+  layers_.MergeFrom(from.layers_);
+  input_.MergeFrom(from.input_);
+  input_dim_.MergeFrom(from.input_dim_);
+  input_shape_.MergeFrom(from.input_shape_);
+  layer_.MergeFrom(from.layer_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_learned_net();
-      learned_net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.learned_net_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      iter_ = from.iter_;
+      _internal_mutable_state()->::opencv_caffe::NetState::MergeFrom(from._internal_state());
     }
     if (cached_has_bits & 0x00000004u) {
-      current_step_ = from.current_step_;
+      force_backward_ = from.force_backward_;
+    }
+    if (cached_has_bits & 0x00000008u) {
+      debug_info_ = from.debug_info_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
-void SolverState::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.SolverState)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void SolverState::CopyFrom(const SolverState& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.SolverState)
+void NetParameter::CopyFrom(const NetParameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.NetParameter)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool SolverState::IsInitialized() const {
+bool NetParameter::IsInitialized() const {
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(layer_))
+    return false;
   return true;
 }
 
-void SolverState::Swap(SolverState* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void SolverState::InternalSwap(SolverState* other) {
+void NetParameter::InternalSwap(NetParameter* other) {
   using std::swap;
-  history_.InternalSwap(&other->history_);
-  learned_net_.Swap(&other->learned_net_);
-  swap(iter_, other->iter_);
-  swap(current_step_, other->current_step_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  layers_.InternalSwap(&other->layers_);
+  input_.InternalSwap(&other->input_);
+  input_dim_.InternalSwap(&other->input_dim_);
+  input_shape_.InternalSwap(&other->input_shape_);
+  layer_.InternalSwap(&other->layer_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(NetParameter, debug_info_)
+      + sizeof(NetParameter::debug_info_)
+      - PROTOBUF_FIELD_OFFSET(NetParameter, state_)>(
+          reinterpret_cast<char*>(&state_),
+          reinterpret_cast<char*>(&other->state_));
 }
 
-::google::protobuf::Metadata SolverState::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata NetParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[9]);
 }
 
-
 // ===================================================================
 
-void NetState::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NetState::kPhaseFieldNumber;
-const int NetState::kLevelFieldNumber;
-const int NetState::kStageFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-NetState::NetState()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetState();
+class SolverParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<SolverParameter>()._has_bits_);
+  static void set_has_net(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static const ::opencv_caffe::NetParameter& net_param(const SolverParameter* msg);
+  static void set_has_net_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static void set_has_train_net(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static const ::opencv_caffe::NetParameter& train_net_param(const SolverParameter* msg);
+  static void set_has_train_net_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static const ::opencv_caffe::NetState& train_state(const SolverParameter* msg);
+  static void set_has_train_state(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static void set_has_test_interval(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+  static void set_has_test_compute_loss(HasBits* has_bits) {
+    (*has_bits)[0] |= 1048576u;
+  }
+  static void set_has_test_initialization(HasBits* has_bits) {
+    (*has_bits)[0] |= 134217728u;
+  }
+  static void set_has_base_lr(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
+  }
+  static void set_has_display(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
+  }
+  static void set_has_average_loss(HasBits* has_bits) {
+    (*has_bits)[0] |= 1073741824u;
+  }
+  static void set_has_max_iter(HasBits* has_bits) {
+    (*has_bits)[0] |= 4096u;
+  }
+  static void set_has_iter_size(HasBits* has_bits) {
+    (*has_bits)[1] |= 1u;
+  }
+  static void set_has_lr_policy(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+  static void set_has_gamma(HasBits* has_bits) {
+    (*has_bits)[0] |= 8192u;
+  }
+  static void set_has_power(HasBits* has_bits) {
+    (*has_bits)[0] |= 16384u;
+  }
+  static void set_has_momentum(HasBits* has_bits) {
+    (*has_bits)[0] |= 32768u;
+  }
+  static void set_has_weight_decay(HasBits* has_bits) {
+    (*has_bits)[0] |= 65536u;
+  }
+  static void set_has_regularization_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_stepsize(HasBits* has_bits) {
+    (*has_bits)[0] |= 131072u;
+  }
+  static void set_has_clip_gradients(HasBits* has_bits) {
+    (*has_bits)[0] |= 2147483648u;
+  }
+  static void set_has_snapshot(HasBits* has_bits) {
+    (*has_bits)[0] |= 262144u;
+  }
+  static void set_has_snapshot_prefix(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_snapshot_diff(HasBits* has_bits) {
+    (*has_bits)[0] |= 2097152u;
+  }
+  static void set_has_snapshot_format(HasBits* has_bits) {
+    (*has_bits)[1] |= 2u;
+  }
+  static void set_has_solver_mode(HasBits* has_bits) {
+    (*has_bits)[0] |= 67108864u;
+  }
+  static void set_has_device_id(HasBits* has_bits) {
+    (*has_bits)[0] |= 524288u;
+  }
+  static void set_has_random_seed(HasBits* has_bits) {
+    (*has_bits)[0] |= 33554432u;
+  }
+  static void set_has_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_delta(HasBits* has_bits) {
+    (*has_bits)[0] |= 536870912u;
+  }
+  static void set_has_momentum2(HasBits* has_bits) {
+    (*has_bits)[0] |= 16777216u;
+  }
+  static void set_has_rms_decay(HasBits* has_bits) {
+    (*has_bits)[1] |= 4u;
+  }
+  static void set_has_debug_info(HasBits* has_bits) {
+    (*has_bits)[0] |= 4194304u;
+  }
+  static void set_has_snapshot_after_train(HasBits* has_bits) {
+    (*has_bits)[0] |= 268435456u;
+  }
+  static void set_has_solver_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 8388608u;
+  }
+};
+
+const ::opencv_caffe::NetParameter&
+SolverParameter::_Internal::net_param(const SolverParameter* msg) {
+  return *msg->net_param_;
+}
+const ::opencv_caffe::NetParameter&
+SolverParameter::_Internal::train_net_param(const SolverParameter* msg) {
+  return *msg->train_net_param_;
+}
+const ::opencv_caffe::NetState&
+SolverParameter::_Internal::train_state(const SolverParameter* msg) {
+  return *msg->train_state_;
+}
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString SolverParameter::_i_give_permission_to_break_this_code_default_regularization_type_{{{"L2", 2}}, {nullptr}};
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString SolverParameter::_i_give_permission_to_break_this_code_default_type_{{{"SGD", 3}}, {nullptr}};
+SolverParameter::SolverParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  test_net_(arena),
+  test_iter_(arena),
+  test_net_param_(arena),
+  test_state_(arena),
+  stepvalue_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.NetState)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.SolverParameter)
 }
-NetState::NetState(const NetState& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+SolverParameter::SolverParameter(const SolverParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      stage_(from.stage_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::memcpy(&level_, &from.level_,
-    static_cast<size_t>(reinterpret_cast<char*>(&phase_) -
-    reinterpret_cast<char*>(&level_)) + sizeof(phase_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.NetState)
+      test_net_(from.test_net_),
+      test_iter_(from.test_iter_),
+      test_net_param_(from.test_net_param_),
+      test_state_(from.test_state_),
+      stepvalue_(from.stepvalue_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  train_net_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    train_net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_train_net()) {
+    train_net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_train_net(),
+      GetArenaForAllocation());
+  }
+  lr_policy_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    lr_policy_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_lr_policy()) {
+    lr_policy_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_lr_policy(),
+      GetArenaForAllocation());
+  }
+  snapshot_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    snapshot_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_snapshot_prefix()) {
+    snapshot_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_snapshot_prefix(),
+      GetArenaForAllocation());
+  }
+  net_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_net()) {
+    net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_net(),
+      GetArenaForAllocation());
+  }
+  regularization_type_.UnsafeSetDefault(nullptr);
+  if (from._internal_has_regularization_type()) {
+    regularization_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_regularization_type(),
+      GetArenaForAllocation());
+  }
+  type_.UnsafeSetDefault(nullptr);
+  if (from._internal_has_type()) {
+    type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_type(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_train_net_param()) {
+    train_net_param_ = new ::opencv_caffe::NetParameter(*from.train_net_param_);
+  } else {
+    train_net_param_ = nullptr;
+  }
+  if (from._internal_has_net_param()) {
+    net_param_ = new ::opencv_caffe::NetParameter(*from.net_param_);
+  } else {
+    net_param_ = nullptr;
+  }
+  if (from._internal_has_train_state()) {
+    train_state_ = new ::opencv_caffe::NetState(*from.train_state_);
+  } else {
+    train_state_ = nullptr;
+  }
+  ::memcpy(&test_interval_, &from.test_interval_,
+    static_cast<size_t>(reinterpret_cast<char*>(&rms_decay_) -
+    reinterpret_cast<char*>(&test_interval_)) + sizeof(rms_decay_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.SolverParameter)
 }
 
-void NetState::SharedCtor() {
-  _cached_size_ = 0;
-  level_ = 0;
-  phase_ = 1;
+inline void SolverParameter::SharedCtor() {
+train_net_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  train_net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+lr_policy_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  lr_policy_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+snapshot_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  snapshot_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+net_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+regularization_type_.UnsafeSetDefault(nullptr);
+type_.UnsafeSetDefault(nullptr);
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&train_net_param_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&solver_type_) -
+    reinterpret_cast<char*>(&train_net_param_)) + sizeof(solver_type_));
+momentum2_ = 0.999f;
+random_seed_ = int64_t{-1};
+solver_mode_ = 1;
+test_initialization_ = true;
+snapshot_after_train_ = true;
+delta_ = 1e-08f;
+average_loss_ = 1;
+clip_gradients_ = -1;
+iter_size_ = 1;
+snapshot_format_ = 1;
+rms_decay_ = 0.99f;
 }
 
-NetState::~NetState() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.NetState)
+SolverParameter::~SolverParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.SolverParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void NetState::SharedDtor() {
+inline void SolverParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  train_net_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  lr_policy_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  snapshot_prefix_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  net_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  regularization_type_.DestroyNoArena(nullptr);
+  type_.DestroyNoArena(nullptr);
+  if (this != internal_default_instance()) delete train_net_param_;
+  if (this != internal_default_instance()) delete net_param_;
+  if (this != internal_default_instance()) delete train_state_;
 }
 
-void NetState::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void SolverParameter::ArenaDtor(void* object) {
+  SolverParameter* _this = reinterpret_cast< SolverParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* NetState::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void SolverParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const NetState& NetState::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetState();
-  return *internal_default_instance();
+void SolverParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-NetState* NetState::New(::google::protobuf::Arena* arena) const {
-  NetState* n = new NetState;
-  if (arena != NULL) {
-    arena->Own(n);
+void SolverParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.SolverParameter)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  test_net_.Clear();
+  test_iter_.Clear();
+  test_net_param_.Clear();
+  test_state_.Clear();
+  stepvalue_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
+    if (cached_has_bits & 0x00000001u) {
+      train_net_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      lr_policy_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000004u) {
+      snapshot_prefix_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000008u) {
+      net_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000010u) {
+      regularization_type_.ClearToDefault(::opencv_caffe::SolverParameter::_i_give_permission_to_break_this_code_default_regularization_type_, GetArenaForAllocation());
+       }
+    if (cached_has_bits & 0x00000020u) {
+      type_.ClearToDefault(::opencv_caffe::SolverParameter::_i_give_permission_to_break_this_code_default_type_, GetArenaForAllocation());
+       }
+    if (cached_has_bits & 0x00000040u) {
+      GOOGLE_DCHECK(train_net_param_ != nullptr);
+      train_net_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000080u) {
+      GOOGLE_DCHECK(net_param_ != nullptr);
+      net_param_->Clear();
+    }
+  }
+  if (cached_has_bits & 0x00000100u) {
+    GOOGLE_DCHECK(train_state_ != nullptr);
+    train_state_->Clear();
+  }
+  if (cached_has_bits & 0x0000fe00u) {
+    ::memset(&test_interval_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&momentum_) -
+        reinterpret_cast<char*>(&test_interval_)) + sizeof(momentum_));
+  }
+  if (cached_has_bits & 0x00ff0000u) {
+    ::memset(&weight_decay_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&solver_type_) -
+        reinterpret_cast<char*>(&weight_decay_)) + sizeof(solver_type_));
   }
-  return n;
-}
-
-void NetState::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.NetState)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  stage_.Clear();
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
-    level_ = 0;
-    phase_ = 1;
+  if (cached_has_bits & 0xff000000u) {
+    momentum2_ = 0.999f;
+    random_seed_ = int64_t{-1};
+    solver_mode_ = 1;
+    test_initialization_ = true;
+    snapshot_after_train_ = true;
+    delta_ = 1e-08f;
+    average_loss_ = 1;
+    clip_gradients_ = -1;
+  }
+  cached_has_bits = _has_bits_[1];
+  if (cached_has_bits & 0x00000007u) {
+    iter_size_ = 1;
+    snapshot_format_ = 1;
+    rms_decay_ = 0.99f;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool NetState::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:opencv_caffe.NetState)
-  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 .opencv_caffe.Phase phase = 1 [default = TEST];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::Phase_IsValid(value)) {
-            set_phase(static_cast< ::opencv_caffe::Phase >(value));
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* SolverParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string train_net = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_train_net();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SolverParameter.train_net");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string test_net = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_test_net();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SolverParameter.test_net");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated int32 test_iter = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_test_iter(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 26) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_test_iter(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 test_interval = 4 [default = 0];
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_test_interval(&_has_bits_);
+          test_interval_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float base_lr = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
+          _Internal::set_has_base_lr(&_has_bits_);
+          base_lr_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 display = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_display(&_has_bits_);
+          display_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 max_iter = 7;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_max_iter(&_has_bits_);
+          max_iter_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string lr_policy = 8;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          auto str = _internal_mutable_lr_policy();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SolverParameter.lr_policy");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float gamma = 9;
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 77)) {
+          _Internal::set_has_gamma(&_has_bits_);
+          gamma_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float power = 10;
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 85)) {
+          _Internal::set_has_power(&_has_bits_);
+          power_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float momentum = 11;
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 93)) {
+          _Internal::set_has_momentum(&_has_bits_);
+          momentum_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float weight_decay = 12;
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 101)) {
+          _Internal::set_has_weight_decay(&_has_bits_);
+          weight_decay_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 stepsize = 13;
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
+          _Internal::set_has_stepsize(&_has_bits_);
+          stepsize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 snapshot = 14 [default = 0];
+      case 14:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
+          _Internal::set_has_snapshot(&_has_bits_);
+          snapshot_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string snapshot_prefix = 15;
+      case 15:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 122)) {
+          auto str = _internal_mutable_snapshot_prefix();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SolverParameter.snapshot_prefix");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool snapshot_diff = 16 [default = false];
+      case 16:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
+          _Internal::set_has_snapshot_diff(&_has_bits_);
+          snapshot_diff_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
+      case 17:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::SolverParameter_SolverMode_IsValid(val))) {
+            _internal_set_solver_mode(static_cast<::opencv_caffe::SolverParameter_SolverMode>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(17, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 level = 2 [default = 0];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_level();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &level_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated string stage = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_stage()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->stage(this->stage_size() - 1).data(),
-            static_cast<int>(this->stage(this->stage_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.NetState.stage");
-        } 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:opencv_caffe.NetState)
-  return true;
+        continue;
+      // optional int32 device_id = 18 [default = 0];
+      case 18:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
+          _Internal::set_has_device_id(&_has_bits_);
+          device_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool test_compute_loss = 19 [default = false];
+      case 19:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
+          _Internal::set_has_test_compute_loss(&_has_bits_);
+          test_compute_loss_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int64 random_seed = 20 [default = -1];
+      case 20:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
+          _Internal::set_has_random_seed(&_has_bits_);
+          random_seed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.NetParameter train_net_param = 21;
+      case 21:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
+          ptr = ctx->ParseMessage(_internal_mutable_train_net_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.NetParameter test_net_param = 22;
+      case 22:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 178)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_test_net_param(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<178>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool debug_info = 23 [default = false];
+      case 23:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 184)) {
+          _Internal::set_has_debug_info(&_has_bits_);
+          debug_info_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string net = 24;
+      case 24:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 194)) {
+          auto str = _internal_mutable_net();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SolverParameter.net");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.NetParameter net_param = 25;
+      case 25:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 202)) {
+          ptr = ctx->ParseMessage(_internal_mutable_net_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.NetState train_state = 26;
+      case 26:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 210)) {
+          ptr = ctx->ParseMessage(_internal_mutable_train_state(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.NetState test_state = 27;
+      case 27:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 218)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_test_state(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<218>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool snapshot_after_train = 28 [default = true];
+      case 28:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 224)) {
+          _Internal::set_has_snapshot_after_train(&_has_bits_);
+          snapshot_after_train_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string regularization_type = 29 [default = "L2"];
+      case 29:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 234)) {
+          auto str = _internal_mutable_regularization_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SolverParameter.regularization_type");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
+      case 30:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 240)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::SolverParameter_SolverType_IsValid(val))) {
+            _internal_set_solver_type(static_cast<::opencv_caffe::SolverParameter_SolverType>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(30, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float delta = 31 [default = 1e-08];
+      case 31:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 253)) {
+          _Internal::set_has_delta(&_has_bits_);
+          delta_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool test_initialization = 32 [default = true];
+      case 32:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 0)) {
+          _Internal::set_has_test_initialization(&_has_bits_);
+          test_initialization_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 average_loss = 33 [default = 1];
+      case 33:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_average_loss(&_has_bits_);
+          average_loss_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated int32 stepvalue = 34;
+      case 34:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            _internal_add_stepvalue(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<272>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 18) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_stepvalue(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float clip_gradients = 35 [default = -1];
+      case 35:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_clip_gradients(&_has_bits_);
+          clip_gradients_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 iter_size = 36 [default = 1];
+      case 36:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_iter_size(&_has_bits_);
+          iter_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
+      case 37:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::SolverParameter_SnapshotFormat_IsValid(val))) {
+            _internal_set_snapshot_format(static_cast<::opencv_caffe::SolverParameter_SnapshotFormat>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(37, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float rms_decay = 38 [default = 0.99];
+      case 38:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 53)) {
+          _Internal::set_has_rms_decay(&_has_bits_);
+          rms_decay_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float momentum2 = 39 [default = 0.999];
+      case 39:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 61)) {
+          _Internal::set_has_momentum2(&_has_bits_);
+          momentum2_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string type = 40 [default = "SGD"];
+      case 40:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          auto str = _internal_mutable_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SolverParameter.type");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.NetState)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void NetState::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.NetState)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* SolverParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SolverParameter)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.Phase phase = 1 [default = TEST];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->phase(), output);
-  }
-
-  // optional int32 level = 2 [default = 0];
+  // optional string train_net = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->level(), output);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_train_net().data(), static_cast<int>(this->_internal_train_net().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.SolverParameter.train_net");
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_train_net(), target);
   }
 
-  // repeated string stage = 3;
-  for (int i = 0, n = this->stage_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->stage(i).data(), static_cast<int>(this->stage(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetState.stage");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      3, this->stage(i), output);
+  // repeated string test_net = 2;
+  for (int i = 0, n = this->_internal_test_net_size(); i < n; i++) {
+    const auto& s = this->_internal_test_net(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.SolverParameter.test_net");
+    target = stream->WriteString(2, s, target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
+  // repeated int32 test_iter = 3;
+  for (int i = 0, n = this->_internal_test_iter_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_test_iter(i), target);
   }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.NetState)
-}
-
-::google::protobuf::uint8* NetState::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NetState)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
 
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.Phase phase = 1 [default = TEST];
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->phase(), target);
+  // optional int32 test_interval = 4 [default = 0];
+  if (cached_has_bits & 0x00000200u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_test_interval(), target);
   }
 
-  // optional int32 level = 2 [default = 0];
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->level(), target);
+  // optional float base_lr = 5;
+  if (cached_has_bits & 0x00000400u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->_internal_base_lr(), target);
   }
 
-  // repeated string stage = 3;
-  for (int i = 0, n = this->stage_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->stage(i).data(), static_cast<int>(this->stage(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetState.stage");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(3, this->stage(i), target);
+  // optional int32 display = 6;
+  if (cached_has_bits & 0x00000800u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_display(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  // optional int32 max_iter = 7;
+  if (cached_has_bits & 0x00001000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_max_iter(), target);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NetState)
-  return target;
-}
-
-size_t NetState::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NetState)
-  size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // repeated string stage = 3;
-  total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->stage_size());
-  for (int i = 0, n = this->stage_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->stage(i));
+  // optional string lr_policy = 8;
+  if (cached_has_bits & 0x00000002u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_lr_policy().data(), static_cast<int>(this->_internal_lr_policy().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.SolverParameter.lr_policy");
+    target = stream->WriteStringMaybeAliased(
+        8, this->_internal_lr_policy(), target);
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
-    // optional int32 level = 2 [default = 0];
-    if (has_level()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->level());
-    }
+  // optional float gamma = 9;
+  if (cached_has_bits & 0x00002000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(9, this->_internal_gamma(), target);
+  }
 
-    // optional .opencv_caffe.Phase phase = 1 [default = TEST];
-    if (has_phase()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase());
-    }
+  // optional float power = 10;
+  if (cached_has_bits & 0x00004000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(10, this->_internal_power(), target);
+  }
 
+  // optional float momentum = 11;
+  if (cached_has_bits & 0x00008000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(11, this->_internal_momentum(), target);
   }
-  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 NetState::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.NetState)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NetState* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NetState>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.NetState)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.NetState)
-    MergeFrom(*source);
+  // optional float weight_decay = 12;
+  if (cached_has_bits & 0x00010000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(12, this->_internal_weight_decay(), target);
   }
-}
 
-void NetState::MergeFrom(const NetState& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NetState)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
+  // optional int32 stepsize = 13;
+  if (cached_has_bits & 0x00020000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(13, this->_internal_stepsize(), target);
+  }
 
-  stage_.MergeFrom(from.stage_);
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
-    if (cached_has_bits & 0x00000001u) {
-      level_ = from.level_;
-    }
-    if (cached_has_bits & 0x00000002u) {
-      phase_ = from.phase_;
-    }
-    _has_bits_[0] |= cached_has_bits;
+  // optional int32 snapshot = 14 [default = 0];
+  if (cached_has_bits & 0x00040000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(14, this->_internal_snapshot(), target);
   }
-}
 
-void NetState::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.NetState)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
+  // optional string snapshot_prefix = 15;
+  if (cached_has_bits & 0x00000004u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_snapshot_prefix().data(), static_cast<int>(this->_internal_snapshot_prefix().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.SolverParameter.snapshot_prefix");
+    target = stream->WriteStringMaybeAliased(
+        15, this->_internal_snapshot_prefix(), target);
+  }
 
-void NetState::CopyFrom(const NetState& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.NetState)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
+  // optional bool snapshot_diff = 16 [default = false];
+  if (cached_has_bits & 0x00200000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(16, this->_internal_snapshot_diff(), target);
+  }
 
-bool NetState::IsInitialized() const {
-  return true;
-}
+  // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
+  if (cached_has_bits & 0x04000000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      17, this->_internal_solver_mode(), target);
+  }
 
-void NetState::Swap(NetState* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void NetState::InternalSwap(NetState* other) {
-  using std::swap;
-  stage_.InternalSwap(&other->stage_);
-  swap(level_, other->level_);
-  swap(phase_, other->phase_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
+  // optional int32 device_id = 18 [default = 0];
+  if (cached_has_bits & 0x00080000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(18, this->_internal_device_id(), target);
+  }
 
-::google::protobuf::Metadata NetState::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
-}
+  // optional bool test_compute_loss = 19 [default = false];
+  if (cached_has_bits & 0x00100000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(19, this->_internal_test_compute_loss(), target);
+  }
 
+  // optional int64 random_seed = 20 [default = -1];
+  if (cached_has_bits & 0x02000000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(20, this->_internal_random_seed(), target);
+  }
 
-// ===================================================================
+  // optional .opencv_caffe.NetParameter train_net_param = 21;
+  if (cached_has_bits & 0x00000040u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        21, _Internal::train_net_param(this), target, stream);
+  }
 
-void NetStateRule::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NetStateRule::kPhaseFieldNumber;
-const int NetStateRule::kMinLevelFieldNumber;
-const int NetStateRule::kMaxLevelFieldNumber;
-const int NetStateRule::kStageFieldNumber;
-const int NetStateRule::kNotStageFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+  // repeated .opencv_caffe.NetParameter test_net_param = 22;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->_internal_test_net_param_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(22, this->_internal_test_net_param(i), target, stream);
+  }
 
-NetStateRule::NetStateRule()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetStateRule();
+  // optional bool debug_info = 23 [default = false];
+  if (cached_has_bits & 0x00400000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(23, this->_internal_debug_info(), target);
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.NetStateRule)
-}
-NetStateRule::NetStateRule(const NetStateRule& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
-      stage_(from.stage_),
-      not_stage_(from.not_stage_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::memcpy(&phase_, &from.phase_,
-    static_cast<size_t>(reinterpret_cast<char*>(&max_level_) -
-    reinterpret_cast<char*>(&phase_)) + sizeof(max_level_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.NetStateRule)
-}
 
-void NetStateRule::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&phase_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&max_level_) -
-      reinterpret_cast<char*>(&phase_)) + sizeof(max_level_));
-}
+  // optional string net = 24;
+  if (cached_has_bits & 0x00000008u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_net().data(), static_cast<int>(this->_internal_net().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.SolverParameter.net");
+    target = stream->WriteStringMaybeAliased(
+        24, this->_internal_net(), target);
+  }
 
-NetStateRule::~NetStateRule() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.NetStateRule)
-  SharedDtor();
-}
+  // optional .opencv_caffe.NetParameter net_param = 25;
+  if (cached_has_bits & 0x00000080u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        25, _Internal::net_param(this), target, stream);
+  }
 
-void NetStateRule::SharedDtor() {
-}
+  // optional .opencv_caffe.NetState train_state = 26;
+  if (cached_has_bits & 0x00000100u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        26, _Internal::train_state(this), target, stream);
+  }
 
-void NetStateRule::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* NetStateRule::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
+  // repeated .opencv_caffe.NetState test_state = 27;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->_internal_test_state_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(27, this->_internal_test_state(i), target, stream);
+  }
 
-const NetStateRule& NetStateRule::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetStateRule();
-  return *internal_default_instance();
-}
+  // optional bool snapshot_after_train = 28 [default = true];
+  if (cached_has_bits & 0x10000000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(28, this->_internal_snapshot_after_train(), target);
+  }
 
-NetStateRule* NetStateRule::New(::google::protobuf::Arena* arena) const {
-  NetStateRule* n = new NetStateRule;
-  if (arena != NULL) {
-    arena->Own(n);
+  // optional string regularization_type = 29 [default = "L2"];
+  if (cached_has_bits & 0x00000010u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_regularization_type().data(), static_cast<int>(this->_internal_regularization_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.SolverParameter.regularization_type");
+    target = stream->WriteStringMaybeAliased(
+        29, this->_internal_regularization_type(), target);
   }
-  return n;
-}
-
-void NetStateRule::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.NetStateRule)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
 
-  stage_.Clear();
-  not_stage_.Clear();
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 7u) {
-    ::memset(&phase_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&max_level_) -
-        reinterpret_cast<char*>(&phase_)) + sizeof(max_level_));
+  // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
+  if (cached_has_bits & 0x00800000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      30, this->_internal_solver_type(), target);
   }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool NetStateRule::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:opencv_caffe.NetStateRule)
-  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 .opencv_caffe.Phase phase = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::Phase_IsValid(value)) {
-            set_phase(static_cast< ::opencv_caffe::Phase >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
 
-      // optional int32 min_level = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_min_level();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &min_level_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional float delta = 31 [default = 1e-08];
+  if (cached_has_bits & 0x20000000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(31, this->_internal_delta(), target);
+  }
 
-      // optional int32 max_level = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_max_level();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &max_level_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional bool test_initialization = 32 [default = true];
+  if (cached_has_bits & 0x08000000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(32, this->_internal_test_initialization(), target);
+  }
 
-      // repeated string stage = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_stage()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->stage(this->stage_size() - 1).data(),
-            static_cast<int>(this->stage(this->stage_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.NetStateRule.stage");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional int32 average_loss = 33 [default = 1];
+  if (cached_has_bits & 0x40000000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(33, this->_internal_average_loss(), target);
+  }
 
-      // repeated string not_stage = 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_not_stage()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->not_stage(this->not_stage_size() - 1).data(),
-            static_cast<int>(this->not_stage(this->not_stage_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.NetStateRule.not_stage");
-        } 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:opencv_caffe.NetStateRule)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.NetStateRule)
-  return false;
-#undef DO_
-}
+  // repeated int32 stepvalue = 34;
+  for (int i = 0, n = this->_internal_stepvalue_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(34, this->_internal_stepvalue(i), target);
+  }
 
-void NetStateRule::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.NetStateRule)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
+  // optional float clip_gradients = 35 [default = -1];
+  if (cached_has_bits & 0x80000000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(35, this->_internal_clip_gradients(), target);
+  }
 
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.Phase phase = 1;
+  cached_has_bits = _has_bits_[1];
+  // optional int32 iter_size = 36 [default = 1];
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->phase(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(36, this->_internal_iter_size(), target);
   }
 
-  // optional int32 min_level = 2;
+  // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->min_level(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      37, this->_internal_snapshot_format(), target);
   }
 
-  // optional int32 max_level = 3;
+  // optional float rms_decay = 38 [default = 0.99];
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->max_level(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(38, this->_internal_rms_decay(), target);
   }
 
-  // repeated string stage = 4;
-  for (int i = 0, n = this->stage_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->stage(i).data(), static_cast<int>(this->stage(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetStateRule.stage");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      4, this->stage(i), output);
+  cached_has_bits = _has_bits_[0];
+  // optional float momentum2 = 39 [default = 0.999];
+  if (cached_has_bits & 0x01000000u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(39, this->_internal_momentum2(), target);
   }
 
-  // repeated string not_stage = 5;
-  for (int i = 0, n = this->not_stage_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->not_stage(i).data(), static_cast<int>(this->not_stage(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetStateRule.not_stage");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      5, this->not_stage(i), output);
+  // optional string type = 40 [default = "SGD"];
+  if (cached_has_bits & 0x00000020u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_type().data(), static_cast<int>(this->_internal_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.SolverParameter.type");
+    target = stream->WriteStringMaybeAliased(
+        40, this->_internal_type(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.NetStateRule)
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SolverParameter)
+  return target;
 }
 
-::google::protobuf::uint8* NetStateRule::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NetStateRule)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+size_t SolverParameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SolverParameter)
+  size_t total_size = 0;
+
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.Phase phase = 1;
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->phase(), target);
+  // repeated string test_net = 2;
+  total_size += 1 *
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(test_net_.size());
+  for (int i = 0, n = test_net_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      test_net_.Get(i));
   }
 
-  // optional int32 min_level = 2;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->min_level(), target);
+  // repeated int32 test_iter = 3;
+  {
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      Int32Size(this->test_iter_);
+    total_size += 1 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_test_iter_size());
+    total_size += data_size;
   }
 
-  // optional int32 max_level = 3;
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->max_level(), target);
+  // repeated .opencv_caffe.NetParameter test_net_param = 22;
+  total_size += 2UL * this->_internal_test_net_param_size();
+  for (const auto& msg : this->test_net_param_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  // repeated string stage = 4;
-  for (int i = 0, n = this->stage_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->stage(i).data(), static_cast<int>(this->stage(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetStateRule.stage");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(4, this->stage(i), target);
+  // repeated .opencv_caffe.NetState test_state = 27;
+  total_size += 2UL * this->_internal_test_state_size();
+  for (const auto& msg : this->test_state_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  // repeated string not_stage = 5;
-  for (int i = 0, n = this->not_stage_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->not_stage(i).data(), static_cast<int>(this->not_stage(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.NetStateRule.not_stage");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(5, this->not_stage(i), target);
+  // repeated int32 stepvalue = 34;
+  {
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      Int32Size(this->stepvalue_);
+    total_size += 2 *
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_stepvalue_size());
+    total_size += data_size;
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
+    // optional string train_net = 1;
+    if (cached_has_bits & 0x00000001u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_train_net());
+    }
+
+    // optional string lr_policy = 8;
+    if (cached_has_bits & 0x00000002u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_lr_policy());
+    }
+
+    // optional string snapshot_prefix = 15;
+    if (cached_has_bits & 0x00000004u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_snapshot_prefix());
+    }
+
+    // optional string net = 24;
+    if (cached_has_bits & 0x00000008u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_net());
+    }
+
+    // optional string regularization_type = 29 [default = "L2"];
+    if (cached_has_bits & 0x00000010u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_regularization_type());
+    }
+
+    // optional string type = 40 [default = "SGD"];
+    if (cached_has_bits & 0x00000020u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_type());
+    }
+
+    // optional .opencv_caffe.NetParameter train_net_param = 21;
+    if (cached_has_bits & 0x00000040u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *train_net_param_);
+    }
+
+    // optional .opencv_caffe.NetParameter net_param = 25;
+    if (cached_has_bits & 0x00000080u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *net_param_);
+    }
+
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NetStateRule)
-  return target;
-}
+  if (cached_has_bits & 0x0000ff00u) {
+    // optional .opencv_caffe.NetState train_state = 26;
+    if (cached_has_bits & 0x00000100u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *train_state_);
+    }
 
-size_t NetStateRule::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NetStateRule)
-  size_t total_size = 0;
+    // optional int32 test_interval = 4 [default = 0];
+    if (cached_has_bits & 0x00000200u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_test_interval());
+    }
+
+    // optional float base_lr = 5;
+    if (cached_has_bits & 0x00000400u) {
+      total_size += 1 + 4;
+    }
+
+    // optional int32 display = 6;
+    if (cached_has_bits & 0x00000800u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_display());
+    }
+
+    // optional int32 max_iter = 7;
+    if (cached_has_bits & 0x00001000u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_max_iter());
+    }
+
+    // optional float gamma = 9;
+    if (cached_has_bits & 0x00002000u) {
+      total_size += 1 + 4;
+    }
+
+    // optional float power = 10;
+    if (cached_has_bits & 0x00004000u) {
+      total_size += 1 + 4;
+    }
+
+    // optional float momentum = 11;
+    if (cached_has_bits & 0x00008000u) {
+      total_size += 1 + 4;
+    }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
   }
-  // repeated string stage = 4;
-  total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->stage_size());
-  for (int i = 0, n = this->stage_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->stage(i));
+  if (cached_has_bits & 0x00ff0000u) {
+    // optional float weight_decay = 12;
+    if (cached_has_bits & 0x00010000u) {
+      total_size += 1 + 4;
+    }
+
+    // optional int32 stepsize = 13;
+    if (cached_has_bits & 0x00020000u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_stepsize());
+    }
+
+    // optional int32 snapshot = 14 [default = 0];
+    if (cached_has_bits & 0x00040000u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_snapshot());
+    }
+
+    // optional int32 device_id = 18 [default = 0];
+    if (cached_has_bits & 0x00080000u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+          this->_internal_device_id());
+    }
+
+    // optional bool test_compute_loss = 19 [default = false];
+    if (cached_has_bits & 0x00100000u) {
+      total_size += 2 + 1;
+    }
+
+    // optional bool snapshot_diff = 16 [default = false];
+    if (cached_has_bits & 0x00200000u) {
+      total_size += 2 + 1;
+    }
+
+    // optional bool debug_info = 23 [default = false];
+    if (cached_has_bits & 0x00400000u) {
+      total_size += 2 + 1;
+    }
+
+    // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
+    if (cached_has_bits & 0x00800000u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_solver_type());
+    }
+
   }
+  if (cached_has_bits & 0xff000000u) {
+    // optional float momentum2 = 39 [default = 0.999];
+    if (cached_has_bits & 0x01000000u) {
+      total_size += 2 + 4;
+    }
+
+    // optional int64 random_seed = 20 [default = -1];
+    if (cached_has_bits & 0x02000000u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
+          this->_internal_random_seed());
+    }
+
+    // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
+    if (cached_has_bits & 0x04000000u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_solver_mode());
+    }
+
+    // optional bool test_initialization = 32 [default = true];
+    if (cached_has_bits & 0x08000000u) {
+      total_size += 2 + 1;
+    }
+
+    // optional bool snapshot_after_train = 28 [default = true];
+    if (cached_has_bits & 0x10000000u) {
+      total_size += 2 + 1;
+    }
+
+    // optional float delta = 31 [default = 1e-08];
+    if (cached_has_bits & 0x20000000u) {
+      total_size += 2 + 4;
+    }
+
+    // optional int32 average_loss = 33 [default = 1];
+    if (cached_has_bits & 0x40000000u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+          this->_internal_average_loss());
+    }
+
+    // optional float clip_gradients = 35 [default = -1];
+    if (cached_has_bits & 0x80000000u) {
+      total_size += 2 + 4;
+    }
 
-  // repeated string not_stage = 5;
-  total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->not_stage_size());
-  for (int i = 0, n = this->not_stage_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->not_stage(i));
   }
-
-  if (_has_bits_[0 / 32] & 7u) {
-    // optional .opencv_caffe.Phase phase = 1;
-    if (has_phase()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase());
+  cached_has_bits = _has_bits_[1];
+  if (cached_has_bits & 0x00000007u) {
+    // optional int32 iter_size = 36 [default = 1];
+    if (cached_has_bits & 0x00000001u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+          this->_internal_iter_size());
     }
 
-    // optional int32 min_level = 2;
-    if (has_min_level()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->min_level());
+    // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
+    if (cached_has_bits & 0x00000002u) {
+      total_size += 2 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_snapshot_format());
     }
 
-    // optional int32 max_level = 3;
-    if (has_max_level()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->max_level());
+    // optional float rms_decay = 38 [default = 0.99];
+    if (cached_has_bits & 0x00000004u) {
+      total_size += 2 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void NetStateRule::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.NetStateRule)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NetStateRule* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NetStateRule>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.NetStateRule)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.NetStateRule)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SolverParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SolverParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SolverParameter::GetClassData() const { return &_class_data_; }
+
+void SolverParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SolverParameter *>(to)->MergeFrom(
+      static_cast<const SolverParameter &>(from));
 }
 
-void NetStateRule::MergeFrom(const NetStateRule& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NetStateRule)
+
+void SolverParameter::MergeFrom(const SolverParameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SolverParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  stage_.MergeFrom(from.stage_);
-  not_stage_.MergeFrom(from.not_stage_);
+  test_net_.MergeFrom(from.test_net_);
+  test_iter_.MergeFrom(from.test_iter_);
+  test_net_param_.MergeFrom(from.test_net_param_);
+  test_state_.MergeFrom(from.test_state_);
+  stepvalue_.MergeFrom(from.stepvalue_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      phase_ = from.phase_;
+      _internal_set_train_net(from._internal_train_net());
     }
     if (cached_has_bits & 0x00000002u) {
-      min_level_ = from.min_level_;
+      _internal_set_lr_policy(from._internal_lr_policy());
     }
     if (cached_has_bits & 0x00000004u) {
-      max_level_ = from.max_level_;
+      _internal_set_snapshot_prefix(from._internal_snapshot_prefix());
+    }
+    if (cached_has_bits & 0x00000008u) {
+      _internal_set_net(from._internal_net());
+    }
+    if (cached_has_bits & 0x00000010u) {
+      _internal_set_regularization_type(from._internal_regularization_type());
+    }
+    if (cached_has_bits & 0x00000020u) {
+      _internal_set_type(from._internal_type());
+    }
+    if (cached_has_bits & 0x00000040u) {
+      _internal_mutable_train_net_param()->::opencv_caffe::NetParameter::MergeFrom(from._internal_train_net_param());
+    }
+    if (cached_has_bits & 0x00000080u) {
+      _internal_mutable_net_param()->::opencv_caffe::NetParameter::MergeFrom(from._internal_net_param());
+    }
+  }
+  if (cached_has_bits & 0x0000ff00u) {
+    if (cached_has_bits & 0x00000100u) {
+      _internal_mutable_train_state()->::opencv_caffe::NetState::MergeFrom(from._internal_train_state());
+    }
+    if (cached_has_bits & 0x00000200u) {
+      test_interval_ = from.test_interval_;
+    }
+    if (cached_has_bits & 0x00000400u) {
+      base_lr_ = from.base_lr_;
+    }
+    if (cached_has_bits & 0x00000800u) {
+      display_ = from.display_;
+    }
+    if (cached_has_bits & 0x00001000u) {
+      max_iter_ = from.max_iter_;
+    }
+    if (cached_has_bits & 0x00002000u) {
+      gamma_ = from.gamma_;
+    }
+    if (cached_has_bits & 0x00004000u) {
+      power_ = from.power_;
+    }
+    if (cached_has_bits & 0x00008000u) {
+      momentum_ = from.momentum_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  if (cached_has_bits & 0x00ff0000u) {
+    if (cached_has_bits & 0x00010000u) {
+      weight_decay_ = from.weight_decay_;
+    }
+    if (cached_has_bits & 0x00020000u) {
+      stepsize_ = from.stepsize_;
+    }
+    if (cached_has_bits & 0x00040000u) {
+      snapshot_ = from.snapshot_;
+    }
+    if (cached_has_bits & 0x00080000u) {
+      device_id_ = from.device_id_;
+    }
+    if (cached_has_bits & 0x00100000u) {
+      test_compute_loss_ = from.test_compute_loss_;
+    }
+    if (cached_has_bits & 0x00200000u) {
+      snapshot_diff_ = from.snapshot_diff_;
+    }
+    if (cached_has_bits & 0x00400000u) {
+      debug_info_ = from.debug_info_;
+    }
+    if (cached_has_bits & 0x00800000u) {
+      solver_type_ = from.solver_type_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+  if (cached_has_bits & 0xff000000u) {
+    if (cached_has_bits & 0x01000000u) {
+      momentum2_ = from.momentum2_;
+    }
+    if (cached_has_bits & 0x02000000u) {
+      random_seed_ = from.random_seed_;
+    }
+    if (cached_has_bits & 0x04000000u) {
+      solver_mode_ = from.solver_mode_;
+    }
+    if (cached_has_bits & 0x08000000u) {
+      test_initialization_ = from.test_initialization_;
+    }
+    if (cached_has_bits & 0x10000000u) {
+      snapshot_after_train_ = from.snapshot_after_train_;
+    }
+    if (cached_has_bits & 0x20000000u) {
+      delta_ = from.delta_;
+    }
+    if (cached_has_bits & 0x40000000u) {
+      average_loss_ = from.average_loss_;
+    }
+    if (cached_has_bits & 0x80000000u) {
+      clip_gradients_ = from.clip_gradients_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+  cached_has_bits = from._has_bits_[1];
+  if (cached_has_bits & 0x00000007u) {
+    if (cached_has_bits & 0x00000001u) {
+      iter_size_ = from.iter_size_;
+    }
+    if (cached_has_bits & 0x00000002u) {
+      snapshot_format_ = from.snapshot_format_;
+    }
+    if (cached_has_bits & 0x00000004u) {
+      rms_decay_ = from.rms_decay_;
+    }
+    _has_bits_[1] |= cached_has_bits;
+  }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
-void NetStateRule::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.NetStateRule)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void NetStateRule::CopyFrom(const NetStateRule& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.NetStateRule)
+void SolverParameter::CopyFrom(const SolverParameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.SolverParameter)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool NetStateRule::IsInitialized() const {
+bool SolverParameter::IsInitialized() const {
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(test_net_param_))
+    return false;
+  if (_internal_has_train_net_param()) {
+    if (!train_net_param_->IsInitialized()) return false;
+  }
+  if (_internal_has_net_param()) {
+    if (!net_param_->IsInitialized()) return false;
+  }
   return true;
 }
 
-void NetStateRule::Swap(NetStateRule* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void NetStateRule::InternalSwap(NetStateRule* other) {
+void SolverParameter::InternalSwap(SolverParameter* other) {
   using std::swap;
-  stage_.InternalSwap(&other->stage_);
-  not_stage_.InternalSwap(&other->not_stage_);
-  swap(phase_, other->phase_);
-  swap(min_level_, other->min_level_);
-  swap(max_level_, other->max_level_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  swap(_has_bits_[1], other->_has_bits_[1]);
+  test_net_.InternalSwap(&other->test_net_);
+  test_iter_.InternalSwap(&other->test_iter_);
+  test_net_param_.InternalSwap(&other->test_net_param_);
+  test_state_.InternalSwap(&other->test_state_);
+  stepvalue_.InternalSwap(&other->stepvalue_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &train_net_, lhs_arena,
+      &other->train_net_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &lr_policy_, lhs_arena,
+      &other->lr_policy_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &snapshot_prefix_, lhs_arena,
+      &other->snapshot_prefix_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &net_, lhs_arena,
+      &other->net_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      nullptr,
+      &regularization_type_, lhs_arena,
+      &other->regularization_type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      nullptr,
+      &type_, lhs_arena,
+      &other->type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(SolverParameter, solver_type_)
+      + sizeof(SolverParameter::solver_type_)
+      - PROTOBUF_FIELD_OFFSET(SolverParameter, train_net_param_)>(
+          reinterpret_cast<char*>(&train_net_param_),
+          reinterpret_cast<char*>(&other->train_net_param_));
+  swap(momentum2_, other->momentum2_);
+  swap(random_seed_, other->random_seed_);
+  swap(solver_mode_, other->solver_mode_);
+  swap(test_initialization_, other->test_initialization_);
+  swap(snapshot_after_train_, other->snapshot_after_train_);
+  swap(delta_, other->delta_);
+  swap(average_loss_, other->average_loss_);
+  swap(clip_gradients_, other->clip_gradients_);
+  swap(iter_size_, other->iter_size_);
+  swap(snapshot_format_, other->snapshot_format_);
+  swap(rms_decay_, other->rms_decay_);
 }
 
-::google::protobuf::Metadata NetStateRule::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SolverParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[10]);
 }
 
-
 // ===================================================================
 
-void ParamSpec::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ParamSpec::kNameFieldNumber;
-const int ParamSpec::kShareModeFieldNumber;
-const int ParamSpec::kLrMultFieldNumber;
-const int ParamSpec::kDecayMultFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ParamSpec::ParamSpec()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsParamSpec();
+class SolverState::_Internal {
+ public:
+  using HasBits = decltype(std::declval<SolverState>()._has_bits_);
+  static void set_has_iter(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_learned_net(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_current_step(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+SolverState::SolverState(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  history_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ParamSpec)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.SolverState)
 }
-ParamSpec::ParamSpec(const ParamSpec& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+SolverState::SolverState(const SolverState& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      history_(from.history_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  learned_net_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    learned_net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_learned_net()) {
+    learned_net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_learned_net(),
+      GetArenaForAllocation());
   }
-  ::memcpy(&share_mode_, &from.share_mode_,
-    static_cast<size_t>(reinterpret_cast<char*>(&decay_mult_) -
-    reinterpret_cast<char*>(&share_mode_)) + sizeof(decay_mult_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.ParamSpec)
+  ::memcpy(&iter_, &from.iter_,
+    static_cast<size_t>(reinterpret_cast<char*>(&current_step_) -
+    reinterpret_cast<char*>(&iter_)) + sizeof(current_step_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.SolverState)
 }
 
-void ParamSpec::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  share_mode_ = 0;
-  lr_mult_ = 1;
-  decay_mult_ = 1;
+inline void SolverState::SharedCtor() {
+learned_net_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  learned_net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&iter_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&current_step_) -
+    reinterpret_cast<char*>(&iter_)) + sizeof(current_step_));
 }
 
-ParamSpec::~ParamSpec() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.ParamSpec)
+SolverState::~SolverState() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.SolverState)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ParamSpec::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void SolverState::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  learned_net_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void ParamSpec::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ParamSpec::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void SolverState::ArenaDtor(void* object) {
+  SolverState* _this = reinterpret_cast< SolverState* >(object);
+  (void)_this;
 }
-
-const ParamSpec& ParamSpec::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsParamSpec();
-  return *internal_default_instance();
+void SolverState::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ParamSpec* ParamSpec::New(::google::protobuf::Arena* arena) const {
-  ParamSpec* n = new ParamSpec;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void SolverState::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-void ParamSpec::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.ParamSpec)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+void SolverState::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.SolverState)
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
+  history_.Clear();
   cached_has_bits = _has_bits_[0];
   if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*name_.UnsafeRawStringPointer())->clear();
+    learned_net_.ClearNonDefaultToEmpty();
   }
-  if (cached_has_bits & 14u) {
-    share_mode_ = 0;
-    lr_mult_ = 1;
-    decay_mult_ = 1;
+  if (cached_has_bits & 0x00000006u) {
+    ::memset(&iter_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&current_step_) -
+        reinterpret_cast<char*>(&iter_)) + sizeof(current_step_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ParamSpec::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:opencv_caffe.ParamSpec)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.ParamSpec.name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::ParamSpec_DimCheckMode_IsValid(value)) {
-            set_share_mode(static_cast< ::opencv_caffe::ParamSpec_DimCheckMode >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                2, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float lr_mult = 3 [default = 1];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_lr_mult();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &lr_mult_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float decay_mult = 4 [default = 1];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          set_has_decay_mult();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &decay_mult_)));
-        } 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:opencv_caffe.ParamSpec)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ParamSpec)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ParamSpec::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ParamSpec)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.ParamSpec.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      2, this->share_mode(), output);
-  }
-
-  // optional float lr_mult = 3 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->lr_mult(), output);
-  }
-
-  // optional float decay_mult = 4 [default = 1];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->decay_mult(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ParamSpec)
+const char* SolverState::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 iter = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_iter(&has_bits);
+          iter_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string learned_net = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_learned_net();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SolverState.learned_net");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.BlobProto history = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_history(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 current_step = 4 [default = 0];
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_current_step(&has_bits);
+          current_step_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ParamSpec::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ParamSpec)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* SolverState::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SolverState)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.ParamSpec.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+  // optional int32 iter = 1;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_iter(), target);
   }
 
-  // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      2, this->share_mode(), target);
+  // optional string learned_net = 2;
+  if (cached_has_bits & 0x00000001u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_learned_net().data(), static_cast<int>(this->_internal_learned_net().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.SolverState.learned_net");
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_learned_net(), target);
   }
 
-  // optional float lr_mult = 3 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->lr_mult(), target);
+  // repeated .opencv_caffe.BlobProto history = 3;
+  for (unsigned int i = 0,
+      n = static_cast<unsigned int>(this->_internal_history_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(3, this->_internal_history(i), target, stream);
   }
 
-  // optional float decay_mult = 4 [default = 1];
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->decay_mult(), target);
+  // optional int32 current_step = 4 [default = 0];
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_current_step(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ParamSpec)
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SolverState)
   return target;
 }
 
-size_t ParamSpec::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ParamSpec)
+size_t SolverState::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SolverState)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // repeated .opencv_caffe.BlobProto history = 3;
+  total_size += 1UL * this->_internal_history_size();
+  for (const auto& msg : this->history_) {
     total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
-  if (_has_bits_[0 / 32] & 15u) {
-    // optional string name = 1;
-    if (has_name()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
-    }
 
-    // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
-    if (has_share_mode()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000007u) {
+    // optional string learned_net = 2;
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->share_mode());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_learned_net());
     }
 
-    // optional float lr_mult = 3 [default = 1];
-    if (has_lr_mult()) {
-      total_size += 1 + 4;
+    // optional int32 iter = 1;
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_iter());
     }
 
-    // optional float decay_mult = 4 [default = 1];
-    if (has_decay_mult()) {
-      total_size += 1 + 4;
+    // optional int32 current_step = 4 [default = 0];
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_current_step());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ParamSpec::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ParamSpec)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ParamSpec* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ParamSpec>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ParamSpec)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ParamSpec)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SolverState::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SolverState::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SolverState::GetClassData() const { return &_class_data_; }
+
+void SolverState::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SolverState *>(to)->MergeFrom(
+      static_cast<const SolverState &>(from));
 }
 
-void ParamSpec::MergeFrom(const ParamSpec& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ParamSpec)
+
+void SolverState::MergeFrom(const SolverState& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SolverState)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
+  history_.MergeFrom(from.history_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_learned_net(from._internal_learned_net());
     }
     if (cached_has_bits & 0x00000002u) {
-      share_mode_ = from.share_mode_;
+      iter_ = from.iter_;
     }
     if (cached_has_bits & 0x00000004u) {
-      lr_mult_ = from.lr_mult_;
-    }
-    if (cached_has_bits & 0x00000008u) {
-      decay_mult_ = from.decay_mult_;
+      current_step_ = from.current_step_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
-void ParamSpec::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ParamSpec)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void ParamSpec::CopyFrom(const ParamSpec& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.ParamSpec)
+void SolverState::CopyFrom(const SolverState& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.SolverState)
   if (&from == this) return;
   Clear();
   MergeFrom(from);
 }
 
-bool ParamSpec::IsInitialized() const {
+bool SolverState::IsInitialized() const {
   return true;
 }
 
-void ParamSpec::Swap(ParamSpec* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void ParamSpec::InternalSwap(ParamSpec* other) {
+void SolverState::InternalSwap(SolverState* other) {
   using std::swap;
-  name_.Swap(&other->name_);
-  swap(share_mode_, other->share_mode_);
-  swap(lr_mult_, other->lr_mult_);
-  swap(decay_mult_, other->decay_mult_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  history_.InternalSwap(&other->history_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &learned_net_, lhs_arena,
+      &other->learned_net_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(SolverState, current_step_)
+      + sizeof(SolverState::current_step_)
+      - PROTOBUF_FIELD_OFFSET(SolverState, iter_)>(
+          reinterpret_cast<char*>(&iter_),
+          reinterpret_cast<char*>(&other->iter_));
 }
 
-::google::protobuf::Metadata ParamSpec::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SolverState::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[11]);
 }
 
-
 // ===================================================================
 
-void LayerParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->transform_param_ = const_cast< ::opencv_caffe::TransformationParameter*>(
-      ::opencv_caffe::TransformationParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->loss_param_ = const_cast< ::opencv_caffe::LossParameter*>(
-      ::opencv_caffe::LossParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->accuracy_param_ = const_cast< ::opencv_caffe::AccuracyParameter*>(
-      ::opencv_caffe::AccuracyParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->argmax_param_ = const_cast< ::opencv_caffe::ArgMaxParameter*>(
-      ::opencv_caffe::ArgMaxParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->batch_norm_param_ = const_cast< ::opencv_caffe::BatchNormParameter*>(
-      ::opencv_caffe::BatchNormParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->bias_param_ = const_cast< ::opencv_caffe::BiasParameter*>(
-      ::opencv_caffe::BiasParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->concat_param_ = const_cast< ::opencv_caffe::ConcatParameter*>(
-      ::opencv_caffe::ConcatParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->contrastive_loss_param_ = const_cast< ::opencv_caffe::ContrastiveLossParameter*>(
-      ::opencv_caffe::ContrastiveLossParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->convolution_param_ = const_cast< ::opencv_caffe::ConvolutionParameter*>(
-      ::opencv_caffe::ConvolutionParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->crop_param_ = const_cast< ::opencv_caffe::CropParameter*>(
-      ::opencv_caffe::CropParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->data_param_ = const_cast< ::opencv_caffe::DataParameter*>(
-      ::opencv_caffe::DataParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->detection_output_param_ = const_cast< ::opencv_caffe::DetectionOutputParameter*>(
-      ::opencv_caffe::DetectionOutputParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->dropout_param_ = const_cast< ::opencv_caffe::DropoutParameter*>(
-      ::opencv_caffe::DropoutParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->dummy_data_param_ = const_cast< ::opencv_caffe::DummyDataParameter*>(
-      ::opencv_caffe::DummyDataParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->eltwise_param_ = const_cast< ::opencv_caffe::EltwiseParameter*>(
-      ::opencv_caffe::EltwiseParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->elu_param_ = const_cast< ::opencv_caffe::ELUParameter*>(
-      ::opencv_caffe::ELUParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->embed_param_ = const_cast< ::opencv_caffe::EmbedParameter*>(
-      ::opencv_caffe::EmbedParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->exp_param_ = const_cast< ::opencv_caffe::ExpParameter*>(
-      ::opencv_caffe::ExpParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->flatten_param_ = const_cast< ::opencv_caffe::FlattenParameter*>(
-      ::opencv_caffe::FlattenParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->hdf5_data_param_ = const_cast< ::opencv_caffe::HDF5DataParameter*>(
-      ::opencv_caffe::HDF5DataParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->hdf5_output_param_ = const_cast< ::opencv_caffe::HDF5OutputParameter*>(
-      ::opencv_caffe::HDF5OutputParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->hinge_loss_param_ = const_cast< ::opencv_caffe::HingeLossParameter*>(
-      ::opencv_caffe::HingeLossParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->image_data_param_ = const_cast< ::opencv_caffe::ImageDataParameter*>(
-      ::opencv_caffe::ImageDataParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->infogain_loss_param_ = const_cast< ::opencv_caffe::InfogainLossParameter*>(
-      ::opencv_caffe::InfogainLossParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->inner_product_param_ = const_cast< ::opencv_caffe::InnerProductParameter*>(
-      ::opencv_caffe::InnerProductParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->input_param_ = const_cast< ::opencv_caffe::InputParameter*>(
-      ::opencv_caffe::InputParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->log_param_ = const_cast< ::opencv_caffe::LogParameter*>(
-      ::opencv_caffe::LogParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->lrn_param_ = const_cast< ::opencv_caffe::LRNParameter*>(
-      ::opencv_caffe::LRNParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->memory_data_param_ = const_cast< ::opencv_caffe::MemoryDataParameter*>(
-      ::opencv_caffe::MemoryDataParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->mvn_param_ = const_cast< ::opencv_caffe::MVNParameter*>(
-      ::opencv_caffe::MVNParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->norm_param_ = const_cast< ::opencv_caffe::NormalizeBBoxParameter*>(
-      ::opencv_caffe::NormalizeBBoxParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->permute_param_ = const_cast< ::opencv_caffe::PermuteParameter*>(
-      ::opencv_caffe::PermuteParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->parameter_param_ = const_cast< ::opencv_caffe::ParameterParameter*>(
-      ::opencv_caffe::ParameterParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->pooling_param_ = const_cast< ::opencv_caffe::PoolingParameter*>(
-      ::opencv_caffe::PoolingParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->power_param_ = const_cast< ::opencv_caffe::PowerParameter*>(
-      ::opencv_caffe::PowerParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->prelu_param_ = const_cast< ::opencv_caffe::PReLUParameter*>(
-      ::opencv_caffe::PReLUParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->prior_box_param_ = const_cast< ::opencv_caffe::PriorBoxParameter*>(
-      ::opencv_caffe::PriorBoxParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->proposal_param_ = const_cast< ::opencv_caffe::ProposalParameter*>(
-      ::opencv_caffe::ProposalParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->psroi_pooling_param_ = const_cast< ::opencv_caffe::PSROIPoolingParameter*>(
-      ::opencv_caffe::PSROIPoolingParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->python_param_ = const_cast< ::opencv_caffe::PythonParameter*>(
-      ::opencv_caffe::PythonParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->recurrent_param_ = const_cast< ::opencv_caffe::RecurrentParameter*>(
-      ::opencv_caffe::RecurrentParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->reduction_param_ = const_cast< ::opencv_caffe::ReductionParameter*>(
-      ::opencv_caffe::ReductionParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->relu_param_ = const_cast< ::opencv_caffe::ReLUParameter*>(
-      ::opencv_caffe::ReLUParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->reshape_param_ = const_cast< ::opencv_caffe::ReshapeParameter*>(
-      ::opencv_caffe::ReshapeParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->roi_pooling_param_ = const_cast< ::opencv_caffe::ROIPoolingParameter*>(
-      ::opencv_caffe::ROIPoolingParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->scale_param_ = const_cast< ::opencv_caffe::ScaleParameter*>(
-      ::opencv_caffe::ScaleParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->sigmoid_param_ = const_cast< ::opencv_caffe::SigmoidParameter*>(
-      ::opencv_caffe::SigmoidParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->softmax_param_ = const_cast< ::opencv_caffe::SoftmaxParameter*>(
-      ::opencv_caffe::SoftmaxParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->spp_param_ = const_cast< ::opencv_caffe::SPPParameter*>(
-      ::opencv_caffe::SPPParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->slice_param_ = const_cast< ::opencv_caffe::SliceParameter*>(
-      ::opencv_caffe::SliceParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->tanh_param_ = const_cast< ::opencv_caffe::TanHParameter*>(
-      ::opencv_caffe::TanHParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->threshold_param_ = const_cast< ::opencv_caffe::ThresholdParameter*>(
-      ::opencv_caffe::ThresholdParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->tile_param_ = const_cast< ::opencv_caffe::TileParameter*>(
-      ::opencv_caffe::TileParameter::internal_default_instance());
-  ::opencv_caffe::_LayerParameter_default_instance_._instance.get_mutable()->window_data_param_ = const_cast< ::opencv_caffe::WindowDataParameter*>(
-      ::opencv_caffe::WindowDataParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int LayerParameter::kNameFieldNumber;
-const int LayerParameter::kTypeFieldNumber;
-const int LayerParameter::kBottomFieldNumber;
-const int LayerParameter::kTopFieldNumber;
-const int LayerParameter::kPhaseFieldNumber;
-const int LayerParameter::kLossWeightFieldNumber;
-const int LayerParameter::kParamFieldNumber;
-const int LayerParameter::kBlobsFieldNumber;
-const int LayerParameter::kPropagateDownFieldNumber;
-const int LayerParameter::kIncludeFieldNumber;
-const int LayerParameter::kExcludeFieldNumber;
-const int LayerParameter::kTransformParamFieldNumber;
-const int LayerParameter::kLossParamFieldNumber;
-const int LayerParameter::kAccuracyParamFieldNumber;
-const int LayerParameter::kArgmaxParamFieldNumber;
-const int LayerParameter::kBatchNormParamFieldNumber;
-const int LayerParameter::kBiasParamFieldNumber;
-const int LayerParameter::kConcatParamFieldNumber;
-const int LayerParameter::kContrastiveLossParamFieldNumber;
-const int LayerParameter::kConvolutionParamFieldNumber;
-const int LayerParameter::kCropParamFieldNumber;
-const int LayerParameter::kDataParamFieldNumber;
-const int LayerParameter::kDetectionOutputParamFieldNumber;
-const int LayerParameter::kDropoutParamFieldNumber;
-const int LayerParameter::kDummyDataParamFieldNumber;
-const int LayerParameter::kEltwiseParamFieldNumber;
-const int LayerParameter::kEluParamFieldNumber;
-const int LayerParameter::kEmbedParamFieldNumber;
-const int LayerParameter::kExpParamFieldNumber;
-const int LayerParameter::kFlattenParamFieldNumber;
-const int LayerParameter::kHdf5DataParamFieldNumber;
-const int LayerParameter::kHdf5OutputParamFieldNumber;
-const int LayerParameter::kHingeLossParamFieldNumber;
-const int LayerParameter::kImageDataParamFieldNumber;
-const int LayerParameter::kInfogainLossParamFieldNumber;
-const int LayerParameter::kInnerProductParamFieldNumber;
-const int LayerParameter::kInputParamFieldNumber;
-const int LayerParameter::kLogParamFieldNumber;
-const int LayerParameter::kLrnParamFieldNumber;
-const int LayerParameter::kMemoryDataParamFieldNumber;
-const int LayerParameter::kMvnParamFieldNumber;
-const int LayerParameter::kNormParamFieldNumber;
-const int LayerParameter::kPermuteParamFieldNumber;
-const int LayerParameter::kParameterParamFieldNumber;
-const int LayerParameter::kPoolingParamFieldNumber;
-const int LayerParameter::kPowerParamFieldNumber;
-const int LayerParameter::kPreluParamFieldNumber;
-const int LayerParameter::kPriorBoxParamFieldNumber;
-const int LayerParameter::kProposalParamFieldNumber;
-const int LayerParameter::kPsroiPoolingParamFieldNumber;
-const int LayerParameter::kPythonParamFieldNumber;
-const int LayerParameter::kRecurrentParamFieldNumber;
-const int LayerParameter::kReductionParamFieldNumber;
-const int LayerParameter::kReluParamFieldNumber;
-const int LayerParameter::kReshapeParamFieldNumber;
-const int LayerParameter::kRoiPoolingParamFieldNumber;
-const int LayerParameter::kScaleParamFieldNumber;
-const int LayerParameter::kSigmoidParamFieldNumber;
-const int LayerParameter::kSoftmaxParamFieldNumber;
-const int LayerParameter::kSppParamFieldNumber;
-const int LayerParameter::kSliceParamFieldNumber;
-const int LayerParameter::kTanhParamFieldNumber;
-const int LayerParameter::kThresholdParamFieldNumber;
-const int LayerParameter::kTileParamFieldNumber;
-const int LayerParameter::kWindowDataParamFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-LayerParameter::LayerParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLayerParameter();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.LayerParameter)
-}
-LayerParameter::LayerParameter(const LayerParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      bottom_(from.bottom_),
-      top_(from.top_),
-      loss_weight_(from.loss_weight_),
-      param_(from.param_),
-      blobs_(from.blobs_),
-      include_(from.include_),
-      exclude_(from.exclude_),
-      propagate_down_(from.propagate_down_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_type()) {
-    type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
-  }
-  if (from.has_transform_param()) {
-    transform_param_ = new ::opencv_caffe::TransformationParameter(*from.transform_param_);
-  } else {
-    transform_param_ = NULL;
-  }
-  if (from.has_loss_param()) {
-    loss_param_ = new ::opencv_caffe::LossParameter(*from.loss_param_);
-  } else {
-    loss_param_ = NULL;
-  }
-  if (from.has_accuracy_param()) {
-    accuracy_param_ = new ::opencv_caffe::AccuracyParameter(*from.accuracy_param_);
-  } else {
-    accuracy_param_ = NULL;
-  }
-  if (from.has_argmax_param()) {
-    argmax_param_ = new ::opencv_caffe::ArgMaxParameter(*from.argmax_param_);
-  } else {
-    argmax_param_ = NULL;
-  }
-  if (from.has_concat_param()) {
-    concat_param_ = new ::opencv_caffe::ConcatParameter(*from.concat_param_);
-  } else {
-    concat_param_ = NULL;
-  }
-  if (from.has_contrastive_loss_param()) {
-    contrastive_loss_param_ = new ::opencv_caffe::ContrastiveLossParameter(*from.contrastive_loss_param_);
-  } else {
-    contrastive_loss_param_ = NULL;
-  }
-  if (from.has_convolution_param()) {
-    convolution_param_ = new ::opencv_caffe::ConvolutionParameter(*from.convolution_param_);
-  } else {
-    convolution_param_ = NULL;
-  }
-  if (from.has_data_param()) {
-    data_param_ = new ::opencv_caffe::DataParameter(*from.data_param_);
-  } else {
-    data_param_ = NULL;
-  }
-  if (from.has_dropout_param()) {
-    dropout_param_ = new ::opencv_caffe::DropoutParameter(*from.dropout_param_);
-  } else {
-    dropout_param_ = NULL;
-  }
-  if (from.has_dummy_data_param()) {
-    dummy_data_param_ = new ::opencv_caffe::DummyDataParameter(*from.dummy_data_param_);
-  } else {
-    dummy_data_param_ = NULL;
-  }
-  if (from.has_eltwise_param()) {
-    eltwise_param_ = new ::opencv_caffe::EltwiseParameter(*from.eltwise_param_);
-  } else {
-    eltwise_param_ = NULL;
-  }
-  if (from.has_exp_param()) {
-    exp_param_ = new ::opencv_caffe::ExpParameter(*from.exp_param_);
-  } else {
-    exp_param_ = NULL;
-  }
-  if (from.has_hdf5_data_param()) {
-    hdf5_data_param_ = new ::opencv_caffe::HDF5DataParameter(*from.hdf5_data_param_);
-  } else {
-    hdf5_data_param_ = NULL;
-  }
-  if (from.has_hdf5_output_param()) {
-    hdf5_output_param_ = new ::opencv_caffe::HDF5OutputParameter(*from.hdf5_output_param_);
-  } else {
-    hdf5_output_param_ = NULL;
-  }
-  if (from.has_hinge_loss_param()) {
-    hinge_loss_param_ = new ::opencv_caffe::HingeLossParameter(*from.hinge_loss_param_);
-  } else {
-    hinge_loss_param_ = NULL;
-  }
-  if (from.has_image_data_param()) {
-    image_data_param_ = new ::opencv_caffe::ImageDataParameter(*from.image_data_param_);
-  } else {
-    image_data_param_ = NULL;
-  }
-  if (from.has_infogain_loss_param()) {
-    infogain_loss_param_ = new ::opencv_caffe::InfogainLossParameter(*from.infogain_loss_param_);
-  } else {
-    infogain_loss_param_ = NULL;
-  }
-  if (from.has_inner_product_param()) {
-    inner_product_param_ = new ::opencv_caffe::InnerProductParameter(*from.inner_product_param_);
-  } else {
-    inner_product_param_ = NULL;
-  }
-  if (from.has_lrn_param()) {
-    lrn_param_ = new ::opencv_caffe::LRNParameter(*from.lrn_param_);
-  } else {
-    lrn_param_ = NULL;
-  }
-  if (from.has_memory_data_param()) {
-    memory_data_param_ = new ::opencv_caffe::MemoryDataParameter(*from.memory_data_param_);
-  } else {
-    memory_data_param_ = NULL;
-  }
-  if (from.has_mvn_param()) {
-    mvn_param_ = new ::opencv_caffe::MVNParameter(*from.mvn_param_);
-  } else {
-    mvn_param_ = NULL;
-  }
-  if (from.has_pooling_param()) {
-    pooling_param_ = new ::opencv_caffe::PoolingParameter(*from.pooling_param_);
-  } else {
-    pooling_param_ = NULL;
-  }
-  if (from.has_power_param()) {
-    power_param_ = new ::opencv_caffe::PowerParameter(*from.power_param_);
-  } else {
-    power_param_ = NULL;
-  }
-  if (from.has_relu_param()) {
-    relu_param_ = new ::opencv_caffe::ReLUParameter(*from.relu_param_);
-  } else {
-    relu_param_ = NULL;
-  }
-  if (from.has_sigmoid_param()) {
-    sigmoid_param_ = new ::opencv_caffe::SigmoidParameter(*from.sigmoid_param_);
-  } else {
-    sigmoid_param_ = NULL;
-  }
-  if (from.has_softmax_param()) {
-    softmax_param_ = new ::opencv_caffe::SoftmaxParameter(*from.softmax_param_);
-  } else {
-    softmax_param_ = NULL;
-  }
-  if (from.has_slice_param()) {
-    slice_param_ = new ::opencv_caffe::SliceParameter(*from.slice_param_);
-  } else {
-    slice_param_ = NULL;
-  }
-  if (from.has_tanh_param()) {
-    tanh_param_ = new ::opencv_caffe::TanHParameter(*from.tanh_param_);
-  } else {
-    tanh_param_ = NULL;
-  }
-  if (from.has_threshold_param()) {
-    threshold_param_ = new ::opencv_caffe::ThresholdParameter(*from.threshold_param_);
-  } else {
-    threshold_param_ = NULL;
-  }
-  if (from.has_window_data_param()) {
-    window_data_param_ = new ::opencv_caffe::WindowDataParameter(*from.window_data_param_);
-  } else {
-    window_data_param_ = NULL;
-  }
-  if (from.has_python_param()) {
-    python_param_ = new ::opencv_caffe::PythonParameter(*from.python_param_);
-  } else {
-    python_param_ = NULL;
-  }
-  if (from.has_prelu_param()) {
-    prelu_param_ = new ::opencv_caffe::PReLUParameter(*from.prelu_param_);
-  } else {
-    prelu_param_ = NULL;
-  }
-  if (from.has_spp_param()) {
-    spp_param_ = new ::opencv_caffe::SPPParameter(*from.spp_param_);
-  } else {
-    spp_param_ = NULL;
-  }
-  if (from.has_reshape_param()) {
-    reshape_param_ = new ::opencv_caffe::ReshapeParameter(*from.reshape_param_);
-  } else {
-    reshape_param_ = NULL;
-  }
-  if (from.has_log_param()) {
-    log_param_ = new ::opencv_caffe::LogParameter(*from.log_param_);
-  } else {
-    log_param_ = NULL;
-  }
-  if (from.has_flatten_param()) {
-    flatten_param_ = new ::opencv_caffe::FlattenParameter(*from.flatten_param_);
-  } else {
-    flatten_param_ = NULL;
-  }
-  if (from.has_reduction_param()) {
-    reduction_param_ = new ::opencv_caffe::ReductionParameter(*from.reduction_param_);
-  } else {
-    reduction_param_ = NULL;
-  }
-  if (from.has_embed_param()) {
-    embed_param_ = new ::opencv_caffe::EmbedParameter(*from.embed_param_);
-  } else {
-    embed_param_ = NULL;
-  }
-  if (from.has_tile_param()) {
-    tile_param_ = new ::opencv_caffe::TileParameter(*from.tile_param_);
-  } else {
-    tile_param_ = NULL;
-  }
-  if (from.has_batch_norm_param()) {
-    batch_norm_param_ = new ::opencv_caffe::BatchNormParameter(*from.batch_norm_param_);
-  } else {
-    batch_norm_param_ = NULL;
-  }
-  if (from.has_elu_param()) {
-    elu_param_ = new ::opencv_caffe::ELUParameter(*from.elu_param_);
-  } else {
-    elu_param_ = NULL;
-  }
-  if (from.has_bias_param()) {
-    bias_param_ = new ::opencv_caffe::BiasParameter(*from.bias_param_);
-  } else {
-    bias_param_ = NULL;
-  }
-  if (from.has_scale_param()) {
-    scale_param_ = new ::opencv_caffe::ScaleParameter(*from.scale_param_);
-  } else {
-    scale_param_ = NULL;
-  }
-  if (from.has_input_param()) {
-    input_param_ = new ::opencv_caffe::InputParameter(*from.input_param_);
-  } else {
-    input_param_ = NULL;
-  }
-  if (from.has_crop_param()) {
-    crop_param_ = new ::opencv_caffe::CropParameter(*from.crop_param_);
-  } else {
-    crop_param_ = NULL;
-  }
-  if (from.has_parameter_param()) {
-    parameter_param_ = new ::opencv_caffe::ParameterParameter(*from.parameter_param_);
-  } else {
-    parameter_param_ = NULL;
-  }
-  if (from.has_recurrent_param()) {
-    recurrent_param_ = new ::opencv_caffe::RecurrentParameter(*from.recurrent_param_);
-  } else {
-    recurrent_param_ = NULL;
-  }
-  if (from.has_detection_output_param()) {
-    detection_output_param_ = new ::opencv_caffe::DetectionOutputParameter(*from.detection_output_param_);
-  } else {
-    detection_output_param_ = NULL;
-  }
-  if (from.has_permute_param()) {
-    permute_param_ = new ::opencv_caffe::PermuteParameter(*from.permute_param_);
-  } else {
-    permute_param_ = NULL;
-  }
-  if (from.has_norm_param()) {
-    norm_param_ = new ::opencv_caffe::NormalizeBBoxParameter(*from.norm_param_);
-  } else {
-    norm_param_ = NULL;
-  }
-  if (from.has_prior_box_param()) {
-    prior_box_param_ = new ::opencv_caffe::PriorBoxParameter(*from.prior_box_param_);
-  } else {
-    prior_box_param_ = NULL;
-  }
-  if (from.has_proposal_param()) {
-    proposal_param_ = new ::opencv_caffe::ProposalParameter(*from.proposal_param_);
-  } else {
-    proposal_param_ = NULL;
+class NetState::_Internal {
+ public:
+  using HasBits = decltype(std::declval<NetState>()._has_bits_);
+  static void set_has_phase(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  if (from.has_psroi_pooling_param()) {
-    psroi_pooling_param_ = new ::opencv_caffe::PSROIPoolingParameter(*from.psroi_pooling_param_);
-  } else {
-    psroi_pooling_param_ = NULL;
+  static void set_has_level(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  if (from.has_roi_pooling_param()) {
-    roi_pooling_param_ = new ::opencv_caffe::ROIPoolingParameter(*from.roi_pooling_param_);
-  } else {
-    roi_pooling_param_ = NULL;
+};
+
+NetState::NetState(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  stage_(arena) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-  phase_ = from.phase_;
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.LayerParameter)
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.NetState)
+}
+NetState::NetState(const NetState& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_),
+      stage_(from.stage_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  ::memcpy(&level_, &from.level_,
+    static_cast<size_t>(reinterpret_cast<char*>(&phase_) -
+    reinterpret_cast<char*>(&level_)) + sizeof(phase_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.NetState)
 }
 
-void LayerParameter::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&transform_param_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&phase_) -
-      reinterpret_cast<char*>(&transform_param_)) + sizeof(phase_));
-  _cached_size_ = 0;
+inline void NetState::SharedCtor() {
+level_ = 0;
+phase_ = 1;
 }
 
-LayerParameter::~LayerParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.LayerParameter)
+NetState::~NetState() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.NetState)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void LayerParameter::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (this != internal_default_instance()) delete transform_param_;
-  if (this != internal_default_instance()) delete loss_param_;
-  if (this != internal_default_instance()) delete accuracy_param_;
-  if (this != internal_default_instance()) delete argmax_param_;
-  if (this != internal_default_instance()) delete concat_param_;
-  if (this != internal_default_instance()) delete contrastive_loss_param_;
-  if (this != internal_default_instance()) delete convolution_param_;
-  if (this != internal_default_instance()) delete data_param_;
-  if (this != internal_default_instance()) delete dropout_param_;
-  if (this != internal_default_instance()) delete dummy_data_param_;
-  if (this != internal_default_instance()) delete eltwise_param_;
-  if (this != internal_default_instance()) delete exp_param_;
-  if (this != internal_default_instance()) delete hdf5_data_param_;
-  if (this != internal_default_instance()) delete hdf5_output_param_;
-  if (this != internal_default_instance()) delete hinge_loss_param_;
-  if (this != internal_default_instance()) delete image_data_param_;
-  if (this != internal_default_instance()) delete infogain_loss_param_;
-  if (this != internal_default_instance()) delete inner_product_param_;
-  if (this != internal_default_instance()) delete lrn_param_;
-  if (this != internal_default_instance()) delete memory_data_param_;
-  if (this != internal_default_instance()) delete mvn_param_;
-  if (this != internal_default_instance()) delete pooling_param_;
-  if (this != internal_default_instance()) delete power_param_;
-  if (this != internal_default_instance()) delete relu_param_;
-  if (this != internal_default_instance()) delete sigmoid_param_;
-  if (this != internal_default_instance()) delete softmax_param_;
-  if (this != internal_default_instance()) delete slice_param_;
-  if (this != internal_default_instance()) delete tanh_param_;
-  if (this != internal_default_instance()) delete threshold_param_;
-  if (this != internal_default_instance()) delete window_data_param_;
-  if (this != internal_default_instance()) delete python_param_;
-  if (this != internal_default_instance()) delete prelu_param_;
-  if (this != internal_default_instance()) delete spp_param_;
-  if (this != internal_default_instance()) delete reshape_param_;
-  if (this != internal_default_instance()) delete log_param_;
-  if (this != internal_default_instance()) delete flatten_param_;
-  if (this != internal_default_instance()) delete reduction_param_;
-  if (this != internal_default_instance()) delete embed_param_;
-  if (this != internal_default_instance()) delete tile_param_;
-  if (this != internal_default_instance()) delete batch_norm_param_;
-  if (this != internal_default_instance()) delete elu_param_;
-  if (this != internal_default_instance()) delete bias_param_;
-  if (this != internal_default_instance()) delete scale_param_;
-  if (this != internal_default_instance()) delete input_param_;
-  if (this != internal_default_instance()) delete crop_param_;
-  if (this != internal_default_instance()) delete parameter_param_;
-  if (this != internal_default_instance()) delete recurrent_param_;
-  if (this != internal_default_instance()) delete detection_output_param_;
-  if (this != internal_default_instance()) delete permute_param_;
-  if (this != internal_default_instance()) delete norm_param_;
-  if (this != internal_default_instance()) delete prior_box_param_;
-  if (this != internal_default_instance()) delete proposal_param_;
-  if (this != internal_default_instance()) delete psroi_pooling_param_;
-  if (this != internal_default_instance()) delete roi_pooling_param_;
+inline void NetState::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void LayerParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void NetState::ArenaDtor(void* object) {
+  NetState* _this = reinterpret_cast< NetState* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* LayerParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void NetState::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const LayerParameter& LayerParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLayerParameter();
-  return *internal_default_instance();
+void NetState::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-LayerParameter* LayerParameter::New(::google::protobuf::Arena* arena) const {
-  LayerParameter* n = new LayerParameter;
-  if (arena != NULL) {
-    arena->Own(n);
+void NetState::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.NetState)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  stage_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
+    level_ = 0;
+    phase_ = 1;
   }
-  return n;
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void LayerParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
+const char* NetState::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional .opencv_caffe.Phase phase = 1 [default = TEST];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::Phase_IsValid(val))) {
+            _internal_set_phase(static_cast<::opencv_caffe::Phase>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 level = 2 [default = 0];
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_level(&has_bits);
+          level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string stage = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_stage();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.NetState.stage");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
+
+uint8_t* NetState::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NetState)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  bottom_.Clear();
-  top_.Clear();
-  loss_weight_.Clear();
-  param_.Clear();
-  blobs_.Clear();
-  include_.Clear();
-  exclude_.Clear();
-  propagate_down_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 255u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!type_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*type_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(transform_param_ != NULL);
-      transform_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(loss_param_ != NULL);
-      loss_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(accuracy_param_ != NULL);
-      accuracy_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000020u) {
-      GOOGLE_DCHECK(argmax_param_ != NULL);
-      argmax_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000040u) {
-      GOOGLE_DCHECK(concat_param_ != NULL);
-      concat_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000080u) {
-      GOOGLE_DCHECK(contrastive_loss_param_ != NULL);
-      contrastive_loss_param_->Clear();
-    }
-  }
-  if (cached_has_bits & 65280u) {
-    if (cached_has_bits & 0x00000100u) {
-      GOOGLE_DCHECK(convolution_param_ != NULL);
-      convolution_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000200u) {
-      GOOGLE_DCHECK(data_param_ != NULL);
-      data_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000400u) {
-      GOOGLE_DCHECK(dropout_param_ != NULL);
-      dropout_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000800u) {
-      GOOGLE_DCHECK(dummy_data_param_ != NULL);
-      dummy_data_param_->Clear();
-    }
-    if (cached_has_bits & 0x00001000u) {
-      GOOGLE_DCHECK(eltwise_param_ != NULL);
-      eltwise_param_->Clear();
-    }
-    if (cached_has_bits & 0x00002000u) {
-      GOOGLE_DCHECK(exp_param_ != NULL);
-      exp_param_->Clear();
-    }
-    if (cached_has_bits & 0x00004000u) {
-      GOOGLE_DCHECK(hdf5_data_param_ != NULL);
-      hdf5_data_param_->Clear();
-    }
-    if (cached_has_bits & 0x00008000u) {
-      GOOGLE_DCHECK(hdf5_output_param_ != NULL);
-      hdf5_output_param_->Clear();
-    }
-  }
-  if (cached_has_bits & 16711680u) {
-    if (cached_has_bits & 0x00010000u) {
-      GOOGLE_DCHECK(hinge_loss_param_ != NULL);
-      hinge_loss_param_->Clear();
-    }
-    if (cached_has_bits & 0x00020000u) {
-      GOOGLE_DCHECK(image_data_param_ != NULL);
-      image_data_param_->Clear();
-    }
-    if (cached_has_bits & 0x00040000u) {
-      GOOGLE_DCHECK(infogain_loss_param_ != NULL);
-      infogain_loss_param_->Clear();
-    }
-    if (cached_has_bits & 0x00080000u) {
-      GOOGLE_DCHECK(inner_product_param_ != NULL);
-      inner_product_param_->Clear();
-    }
-    if (cached_has_bits & 0x00100000u) {
-      GOOGLE_DCHECK(lrn_param_ != NULL);
-      lrn_param_->Clear();
-    }
-    if (cached_has_bits & 0x00200000u) {
-      GOOGLE_DCHECK(memory_data_param_ != NULL);
-      memory_data_param_->Clear();
-    }
-    if (cached_has_bits & 0x00400000u) {
-      GOOGLE_DCHECK(mvn_param_ != NULL);
-      mvn_param_->Clear();
-    }
-    if (cached_has_bits & 0x00800000u) {
-      GOOGLE_DCHECK(pooling_param_ != NULL);
-      pooling_param_->Clear();
-    }
+  // optional .opencv_caffe.Phase phase = 1 [default = TEST];
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_phase(), target);
   }
-  if (cached_has_bits & 4278190080u) {
-    if (cached_has_bits & 0x01000000u) {
-      GOOGLE_DCHECK(power_param_ != NULL);
-      power_param_->Clear();
-    }
-    if (cached_has_bits & 0x02000000u) {
-      GOOGLE_DCHECK(relu_param_ != NULL);
-      relu_param_->Clear();
-    }
-    if (cached_has_bits & 0x04000000u) {
-      GOOGLE_DCHECK(sigmoid_param_ != NULL);
-      sigmoid_param_->Clear();
-    }
-    if (cached_has_bits & 0x08000000u) {
-      GOOGLE_DCHECK(softmax_param_ != NULL);
-      softmax_param_->Clear();
-    }
-    if (cached_has_bits & 0x10000000u) {
-      GOOGLE_DCHECK(slice_param_ != NULL);
-      slice_param_->Clear();
-    }
-    if (cached_has_bits & 0x20000000u) {
-      GOOGLE_DCHECK(tanh_param_ != NULL);
-      tanh_param_->Clear();
-    }
-    if (cached_has_bits & 0x40000000u) {
-      GOOGLE_DCHECK(threshold_param_ != NULL);
-      threshold_param_->Clear();
-    }
-    if (cached_has_bits & 0x80000000u) {
-      GOOGLE_DCHECK(window_data_param_ != NULL);
-      window_data_param_->Clear();
-    }
+
+  // optional int32 level = 2 [default = 0];
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_level(), target);
   }
-  cached_has_bits = _has_bits_[1];
-  if (cached_has_bits & 255u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(python_param_ != NULL);
-      python_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(prelu_param_ != NULL);
-      prelu_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(spp_param_ != NULL);
-      spp_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(reshape_param_ != NULL);
-      reshape_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(log_param_ != NULL);
-      log_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000020u) {
-      GOOGLE_DCHECK(flatten_param_ != NULL);
-      flatten_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000040u) {
-      GOOGLE_DCHECK(reduction_param_ != NULL);
-      reduction_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000080u) {
-      GOOGLE_DCHECK(embed_param_ != NULL);
-      embed_param_->Clear();
-    }
+
+  // repeated string stage = 3;
+  for (int i = 0, n = this->_internal_stage_size(); i < n; i++) {
+    const auto& s = this->_internal_stage(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.NetState.stage");
+    target = stream->WriteString(3, s, target);
   }
-  if (cached_has_bits & 65280u) {
-    if (cached_has_bits & 0x00000100u) {
-      GOOGLE_DCHECK(tile_param_ != NULL);
-      tile_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000200u) {
-      GOOGLE_DCHECK(batch_norm_param_ != NULL);
-      batch_norm_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000400u) {
-      GOOGLE_DCHECK(elu_param_ != NULL);
-      elu_param_->Clear();
-    }
-    if (cached_has_bits & 0x00000800u) {
-      GOOGLE_DCHECK(bias_param_ != NULL);
-      bias_param_->Clear();
-    }
-    if (cached_has_bits & 0x00001000u) {
-      GOOGLE_DCHECK(scale_param_ != NULL);
-      scale_param_->Clear();
-    }
-    if (cached_has_bits & 0x00002000u) {
-      GOOGLE_DCHECK(input_param_ != NULL);
-      input_param_->Clear();
-    }
-    if (cached_has_bits & 0x00004000u) {
-      GOOGLE_DCHECK(crop_param_ != NULL);
-      crop_param_->Clear();
-    }
-    if (cached_has_bits & 0x00008000u) {
-      GOOGLE_DCHECK(parameter_param_ != NULL);
-      parameter_param_->Clear();
-    }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
-  if (cached_has_bits & 16711680u) {
-    if (cached_has_bits & 0x00010000u) {
-      GOOGLE_DCHECK(recurrent_param_ != NULL);
-      recurrent_param_->Clear();
-    }
-    if (cached_has_bits & 0x00020000u) {
-      GOOGLE_DCHECK(detection_output_param_ != NULL);
-      detection_output_param_->Clear();
-    }
-    if (cached_has_bits & 0x00040000u) {
-      GOOGLE_DCHECK(permute_param_ != NULL);
-      permute_param_->Clear();
-    }
-    if (cached_has_bits & 0x00080000u) {
-      GOOGLE_DCHECK(norm_param_ != NULL);
-      norm_param_->Clear();
-    }
-    if (cached_has_bits & 0x00100000u) {
-      GOOGLE_DCHECK(prior_box_param_ != NULL);
-      prior_box_param_->Clear();
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NetState)
+  return target;
+}
+
+size_t NetState::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NetState)
+  size_t total_size = 0;
+
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // repeated string stage = 3;
+  total_size += 1 *
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(stage_.size());
+  for (int i = 0, n = stage_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      stage_.Get(i));
+  }
+
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
+    // optional int32 level = 2 [default = 0];
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_level());
     }
-    if (cached_has_bits & 0x00200000u) {
-      GOOGLE_DCHECK(proposal_param_ != NULL);
-      proposal_param_->Clear();
+
+    // optional .opencv_caffe.Phase phase = 1 [default = TEST];
+    if (cached_has_bits & 0x00000002u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_phase());
     }
-    if (cached_has_bits & 0x00400000u) {
-      GOOGLE_DCHECK(psroi_pooling_param_ != NULL);
-      psroi_pooling_param_->Clear();
+
+  }
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
+}
+
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NetState::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NetState::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NetState::GetClassData() const { return &_class_data_; }
+
+void NetState::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NetState *>(to)->MergeFrom(
+      static_cast<const NetState &>(from));
+}
+
+
+void NetState::MergeFrom(const NetState& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NetState)
+  GOOGLE_DCHECK_NE(&from, this);
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  stage_.MergeFrom(from.stage_);
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
+    if (cached_has_bits & 0x00000001u) {
+      level_ = from.level_;
     }
-    if (cached_has_bits & 0x00800000u) {
-      GOOGLE_DCHECK(roi_pooling_param_ != NULL);
-      roi_pooling_param_->Clear();
+    if (cached_has_bits & 0x00000002u) {
+      phase_ = from.phase_;
     }
+    _has_bits_[0] |= cached_has_bits;
   }
-  phase_ = 0;
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool LayerParameter::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:opencv_caffe.LayerParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(66133690u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.LayerParameter.name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+}
 
-      // optional string type = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->type().data(), static_cast<int>(this->type().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.LayerParameter.type");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void NetState::CopyFrom(const NetState& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.NetState)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
 
-      // repeated string bottom = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_bottom()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->bottom(this->bottom_size() - 1).data(),
-            static_cast<int>(this->bottom(this->bottom_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.LayerParameter.bottom");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+bool NetState::IsInitialized() const {
+  return true;
+}
 
-      // repeated string top = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_top()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->top(this->top_size() - 1).data(),
-            static_cast<int>(this->top(this->top_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.LayerParameter.top");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void NetState::InternalSwap(NetState* other) {
+  using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  stage_.InternalSwap(&other->stage_);
+  swap(level_, other->level_);
+  swap(phase_, other->phase_);
+}
 
-      // repeated float loss_weight = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 45u, input, this->mutable_loss_weight())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_loss_weight())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+::PROTOBUF_NAMESPACE_ID::Metadata NetState::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[12]);
+}
 
-      // repeated .opencv_caffe.ParamSpec param = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+// ===================================================================
 
-      // repeated .opencv_caffe.BlobProto blobs = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_blobs()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+class NetStateRule::_Internal {
+ public:
+  using HasBits = decltype(std::declval<NetStateRule>()._has_bits_);
+  static void set_has_phase(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_min_level(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_max_level(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
 
-      // repeated .opencv_caffe.NetStateRule include = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_include()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+NetStateRule::NetStateRule(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  stage_(arena),
+  not_stage_(arena) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.NetStateRule)
+}
+NetStateRule::NetStateRule(const NetStateRule& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_),
+      stage_(from.stage_),
+      not_stage_(from.not_stage_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  ::memcpy(&phase_, &from.phase_,
+    static_cast<size_t>(reinterpret_cast<char*>(&max_level_) -
+    reinterpret_cast<char*>(&phase_)) + sizeof(max_level_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.NetStateRule)
+}
 
-      // repeated .opencv_caffe.NetStateRule exclude = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_exclude()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+inline void NetStateRule::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&phase_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&max_level_) -
+    reinterpret_cast<char*>(&phase_)) + sizeof(max_level_));
+}
 
-      // optional .opencv_caffe.Phase phase = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::Phase_IsValid(value)) {
-            set_phase(static_cast< ::opencv_caffe::Phase >(value));
+NetStateRule::~NetStateRule() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.NetStateRule)
+  if (GetArenaForAllocation() != nullptr) return;
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+inline void NetStateRule::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+}
+
+void NetStateRule::ArenaDtor(void* object) {
+  NetStateRule* _this = reinterpret_cast< NetStateRule* >(object);
+  (void)_this;
+}
+void NetStateRule::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void NetStateRule::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
+
+void NetStateRule::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.NetStateRule)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  stage_.Clear();
+  not_stage_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000007u) {
+    ::memset(&phase_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&max_level_) -
+        reinterpret_cast<char*>(&phase_)) + sizeof(max_level_));
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* NetStateRule::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional .opencv_caffe.Phase phase = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::Phase_IsValid(val))) {
+            _internal_set_phase(static_cast<::opencv_caffe::Phase>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                10, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
+        continue;
+      // optional int32 min_level = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_min_level(&has_bits);
+          min_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 max_level = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_max_level(&has_bits);
+          max_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string stage = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_stage();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.NetStateRule.stage");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string not_stage = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_not_stage();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.NetStateRule.not_stage");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
 
-      // repeated bool propagate_down = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 1, 88u, input, this->mutable_propagate_down())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, this->mutable_propagate_down())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+uint8_t* NetStateRule::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NetStateRule)
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
-      // optional .opencv_caffe.TransformationParameter transform_param = 100;
-      case 100: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 802 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_transform_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  cached_has_bits = _has_bits_[0];
+  // optional .opencv_caffe.Phase phase = 1;
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_phase(), target);
+  }
 
-      // optional .opencv_caffe.LossParameter loss_param = 101;
-      case 101: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 810 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_loss_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional int32 min_level = 2;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_min_level(), target);
+  }
 
-      // optional .opencv_caffe.AccuracyParameter accuracy_param = 102;
-      case 102: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 818 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_accuracy_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional int32 max_level = 3;
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_max_level(), target);
+  }
 
-      // optional .opencv_caffe.ArgMaxParameter argmax_param = 103;
-      case 103: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 826 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_argmax_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated string stage = 4;
+  for (int i = 0, n = this->_internal_stage_size(); i < n; i++) {
+    const auto& s = this->_internal_stage(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.NetStateRule.stage");
+    target = stream->WriteString(4, s, target);
+  }
 
-      // optional .opencv_caffe.ConcatParameter concat_param = 104;
-      case 104: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 834 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_concat_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated string not_stage = 5;
+  for (int i = 0, n = this->_internal_not_stage_size(); i < n; i++) {
+    const auto& s = this->_internal_not_stage(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.NetStateRule.not_stage");
+    target = stream->WriteString(5, s, target);
+  }
 
-      // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 105;
-      case 105: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 842 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_contrastive_loss_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NetStateRule)
+  return target;
+}
 
-      // optional .opencv_caffe.ConvolutionParameter convolution_param = 106;
-      case 106: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 850 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_convolution_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+size_t NetStateRule::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NetStateRule)
+  size_t total_size = 0;
 
-      // optional .opencv_caffe.DataParameter data_param = 107;
-      case 107: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 858 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_data_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-      // optional .opencv_caffe.DropoutParameter dropout_param = 108;
-      case 108: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 866 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_dropout_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated string stage = 4;
+  total_size += 1 *
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(stage_.size());
+  for (int i = 0, n = stage_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      stage_.Get(i));
+  }
 
-      // optional .opencv_caffe.DummyDataParameter dummy_data_param = 109;
-      case 109: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(106u /* 874 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_dummy_data_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // repeated string not_stage = 5;
+  total_size += 1 *
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(not_stage_.size());
+  for (int i = 0, n = not_stage_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      not_stage_.Get(i));
+  }
 
-      // optional .opencv_caffe.EltwiseParameter eltwise_param = 110;
-      case 110: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(114u /* 882 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_eltwise_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000007u) {
+    // optional .opencv_caffe.Phase phase = 1;
+    if (cached_has_bits & 0x00000001u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_phase());
+    }
 
-      // optional .opencv_caffe.ExpParameter exp_param = 111;
-      case 111: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(122u /* 890 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_exp_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional int32 min_level = 2;
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_min_level());
+    }
 
-      // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 112;
-      case 112: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(130u /* 898 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_hdf5_data_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional int32 max_level = 3;
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_max_level());
+    }
 
-      // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 113;
-      case 113: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(138u /* 906 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_hdf5_output_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  }
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
+}
 
-      // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 114;
-      case 114: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(146u /* 914 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_hinge_loss_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NetStateRule::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NetStateRule::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NetStateRule::GetClassData() const { return &_class_data_; }
 
-      // optional .opencv_caffe.ImageDataParameter image_data_param = 115;
-      case 115: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(154u /* 922 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_image_data_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void NetStateRule::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NetStateRule *>(to)->MergeFrom(
+      static_cast<const NetStateRule &>(from));
+}
+
+
+void NetStateRule::MergeFrom(const NetStateRule& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NetStateRule)
+  GOOGLE_DCHECK_NE(&from, this);
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  stage_.MergeFrom(from.stage_);
+  not_stage_.MergeFrom(from.not_stage_);
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x00000007u) {
+    if (cached_has_bits & 0x00000001u) {
+      phase_ = from.phase_;
+    }
+    if (cached_has_bits & 0x00000002u) {
+      min_level_ = from.min_level_;
+    }
+    if (cached_has_bits & 0x00000004u) {
+      max_level_ = from.max_level_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+}
+
+void NetStateRule::CopyFrom(const NetStateRule& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.NetStateRule)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
 
-      // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 116;
-      case 116: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(162u /* 930 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_infogain_loss_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+bool NetStateRule::IsInitialized() const {
+  return true;
+}
 
-      // optional .opencv_caffe.InnerProductParameter inner_product_param = 117;
-      case 117: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(170u /* 938 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_inner_product_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void NetStateRule::InternalSwap(NetStateRule* other) {
+  using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  stage_.InternalSwap(&other->stage_);
+  not_stage_.InternalSwap(&other->not_stage_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(NetStateRule, max_level_)
+      + sizeof(NetStateRule::max_level_)
+      - PROTOBUF_FIELD_OFFSET(NetStateRule, phase_)>(
+          reinterpret_cast<char*>(&phase_),
+          reinterpret_cast<char*>(&other->phase_));
+}
 
-      // optional .opencv_caffe.LRNParameter lrn_param = 118;
-      case 118: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(178u /* 946 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_lrn_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+::PROTOBUF_NAMESPACE_ID::Metadata NetStateRule::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[13]);
+}
 
-      // optional .opencv_caffe.MemoryDataParameter memory_data_param = 119;
-      case 119: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(186u /* 954 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_memory_data_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+// ===================================================================
 
-      // optional .opencv_caffe.MVNParameter mvn_param = 120;
-      case 120: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(194u /* 962 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_mvn_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+class ParamSpec::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ParamSpec>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_share_mode(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_lr_mult(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_decay_mult(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+};
 
-      // optional .opencv_caffe.PoolingParameter pooling_param = 121;
-      case 121: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(202u /* 970 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_pooling_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+ParamSpec::ParamSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ParamSpec)
+}
+ParamSpec::ParamSpec(const ParamSpec& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  ::memcpy(&share_mode_, &from.share_mode_,
+    static_cast<size_t>(reinterpret_cast<char*>(&decay_mult_) -
+    reinterpret_cast<char*>(&share_mode_)) + sizeof(decay_mult_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.ParamSpec)
+}
 
-      // optional .opencv_caffe.PowerParameter power_param = 122;
-      case 122: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(210u /* 978 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_power_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+inline void ParamSpec::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+share_mode_ = 0;
+lr_mult_ = 1;
+decay_mult_ = 1;
+}
 
-      // optional .opencv_caffe.ReLUParameter relu_param = 123;
-      case 123: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(218u /* 986 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_relu_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+ParamSpec::~ParamSpec() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.ParamSpec)
+  if (GetArenaForAllocation() != nullptr) return;
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-      // optional .opencv_caffe.SigmoidParameter sigmoid_param = 124;
-      case 124: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(226u /* 994 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_sigmoid_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+inline void ParamSpec::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+}
 
-      // optional .opencv_caffe.SoftmaxParameter softmax_param = 125;
-      case 125: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(234u /* 1002 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_softmax_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void ParamSpec::ArenaDtor(void* object) {
+  ParamSpec* _this = reinterpret_cast< ParamSpec* >(object);
+  (void)_this;
+}
+void ParamSpec::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void ParamSpec::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
 
-      // optional .opencv_caffe.SliceParameter slice_param = 126;
-      case 126: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(242u /* 1010 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_slice_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void ParamSpec::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.ParamSpec)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-      // optional .opencv_caffe.TanHParameter tanh_param = 127;
-      case 127: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(250u /* 1018 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_tanh_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    name_.ClearNonDefaultToEmpty();
+  }
+  if (cached_has_bits & 0x0000000eu) {
+    share_mode_ = 0;
+    lr_mult_ = 1;
+    decay_mult_ = 1;
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-      // optional .opencv_caffe.ThresholdParameter threshold_param = 128;
-      case 128: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(2u /* 1026 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_threshold_param()));
-        } else {
+const char* ParamSpec::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string name = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.ParamSpec.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::ParamSpec_DimCheckMode_IsValid(val))) {
+            _internal_set_share_mode(static_cast<::opencv_caffe::ParamSpec_DimCheckMode>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
+          }
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
+        continue;
+      // optional float lr_mult = 3 [default = 1];
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_lr_mult(&has_bits);
+          lr_mult_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float decay_mult = 4 [default = 1];
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 37)) {
+          _Internal::set_has_decay_mult(&has_bits);
+          decay_mult_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
 
-      // optional .opencv_caffe.WindowDataParameter window_data_param = 129;
-      case 129: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 1034 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_window_data_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+uint8_t* ParamSpec::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ParamSpec)
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
-      // optional .opencv_caffe.PythonParameter python_param = 130;
-      case 130: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 1042 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_python_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  cached_has_bits = _has_bits_[0];
+  // optional string name = 1;
+  if (cached_has_bits & 0x00000001u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "opencv_caffe.ParamSpec.name");
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
+  }
 
-      // optional .opencv_caffe.PReLUParameter prelu_param = 131;
-      case 131: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 1050 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_prelu_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      2, this->_internal_share_mode(), target);
+  }
 
-      // optional .opencv_caffe.SPPParameter spp_param = 132;
-      case 132: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 1058 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_spp_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional float lr_mult = 3 [default = 1];
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_lr_mult(), target);
+  }
 
-      // optional .opencv_caffe.ReshapeParameter reshape_param = 133;
-      case 133: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 1066 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_reshape_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  // optional float decay_mult = 4 [default = 1];
+  if (cached_has_bits & 0x00000008u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_decay_mult(), target);
+  }
 
-      // optional .opencv_caffe.LogParameter log_param = 134;
-      case 134: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 1074 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_log_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ParamSpec)
+  return target;
+}
 
-      // optional .opencv_caffe.FlattenParameter flatten_param = 135;
-      case 135: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 1082 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_flatten_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+size_t ParamSpec::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ParamSpec)
+  size_t total_size = 0;
 
-      // optional .opencv_caffe.ReductionParameter reduction_param = 136;
-      case 136: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 1090 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_reduction_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-      // optional .opencv_caffe.EmbedParameter embed_param = 137;
-      case 137: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 1098 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_embed_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
+    // optional string name = 1;
+    if (cached_has_bits & 0x00000001u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
+    }
 
-      // optional .opencv_caffe.TileParameter tile_param = 138;
-      case 138: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 1106 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_tile_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
+    if (cached_has_bits & 0x00000002u) {
+      total_size += 1 +
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_share_mode());
+    }
 
-      // optional .opencv_caffe.BatchNormParameter batch_norm_param = 139;
-      case 139: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 1114 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_batch_norm_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional float lr_mult = 3 [default = 1];
+    if (cached_has_bits & 0x00000004u) {
+      total_size += 1 + 4;
+    }
 
-      // optional .opencv_caffe.ELUParameter elu_param = 140;
-      case 140: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 1122 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_elu_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+    // optional float decay_mult = 4 [default = 1];
+    if (cached_has_bits & 0x00000008u) {
+      total_size += 1 + 4;
+    }
 
-      // optional .opencv_caffe.BiasParameter bias_param = 141;
-      case 141: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(106u /* 1130 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_bias_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  }
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
+}
 
-      // optional .opencv_caffe.ScaleParameter scale_param = 142;
-      case 142: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(114u /* 1138 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_scale_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ParamSpec::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ParamSpec::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ParamSpec::GetClassData() const { return &_class_data_; }
 
-      // optional .opencv_caffe.InputParameter input_param = 143;
-      case 143: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(122u /* 1146 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_input_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void ParamSpec::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ParamSpec *>(to)->MergeFrom(
+      static_cast<const ParamSpec &>(from));
+}
 
-      // optional .opencv_caffe.CropParameter crop_param = 144;
-      case 144: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(130u /* 1154 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_crop_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
 
-      // optional .opencv_caffe.ParameterParameter parameter_param = 145;
-      case 145: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(138u /* 1162 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_parameter_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void ParamSpec::MergeFrom(const ParamSpec& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ParamSpec)
+  GOOGLE_DCHECK_NE(&from, this);
+  uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
 
-      // optional .opencv_caffe.RecurrentParameter recurrent_param = 146;
-      case 146: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(146u /* 1170 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_recurrent_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
+    if (cached_has_bits & 0x00000001u) {
+      _internal_set_name(from._internal_name());
+    }
+    if (cached_has_bits & 0x00000002u) {
+      share_mode_ = from.share_mode_;
+    }
+    if (cached_has_bits & 0x00000004u) {
+      lr_mult_ = from.lr_mult_;
+    }
+    if (cached_has_bits & 0x00000008u) {
+      decay_mult_ = from.decay_mult_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+}
 
-      // optional .opencv_caffe.DetectionOutputParameter detection_output_param = 147;
-      case 147: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(154u /* 1178 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_detection_output_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void ParamSpec::CopyFrom(const ParamSpec& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:opencv_caffe.ParamSpec)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
 
-      // optional .opencv_caffe.PermuteParameter permute_param = 148;
-      case 148: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(162u /* 1186 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_permute_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+bool ParamSpec::IsInitialized() const {
+  return true;
+}
 
-      // optional .opencv_caffe.NormalizeBBoxParameter norm_param = 149;
-      case 149: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(170u /* 1194 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_norm_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+void ParamSpec::InternalSwap(ParamSpec* other) {
+  using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  swap(share_mode_, other->share_mode_);
+  swap(lr_mult_, other->lr_mult_);
+  swap(decay_mult_, other->decay_mult_);
+}
 
-      // optional .opencv_caffe.PriorBoxParameter prior_box_param = 150;
-      case 150: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(178u /* 1202 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_prior_box_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+::PROTOBUF_NAMESPACE_ID::Metadata ParamSpec::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[14]);
+}
 
-      // optional .opencv_caffe.ProposalParameter proposal_param = 201;
-      case 201: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 1610 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_proposal_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+// ===================================================================
 
-      // optional .opencv_caffe.PSROIPoolingParameter psroi_pooling_param = 10002;
-      case 10002: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(146u /* 80018 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_psroi_pooling_param()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+class LayerParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<LayerParameter>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_phase(HasBits* has_bits) {
+    (*has_bits)[1] |= 16777216u;
+  }
+  static const ::opencv_caffe::TransformationParameter& transform_param(const LayerParameter* msg);
+  static void set_has_transform_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static const ::opencv_caffe::LossParameter& loss_param(const LayerParameter* msg);
+  static void set_has_loss_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static const ::opencv_caffe::AccuracyParameter& accuracy_param(const LayerParameter* msg);
+  static void set_has_accuracy_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static const ::opencv_caffe::ArgMaxParameter& argmax_param(const LayerParameter* msg);
+  static void set_has_argmax_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static const ::opencv_caffe::BatchNormParameter& batch_norm_param(const LayerParameter* msg);
+  static void set_has_batch_norm_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 512u;
+  }
+  static const ::opencv_caffe::BiasParameter& bias_param(const LayerParameter* msg);
+  static void set_has_bias_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 2048u;
+  }
+  static const ::opencv_caffe::ConcatParameter& concat_param(const LayerParameter* msg);
+  static void set_has_concat_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static const ::opencv_caffe::ContrastiveLossParameter& contrastive_loss_param(const LayerParameter* msg);
+  static void set_has_contrastive_loss_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static const ::opencv_caffe::ConvolutionParameter& convolution_param(const LayerParameter* msg);
+  static void set_has_convolution_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static const ::opencv_caffe::CropParameter& crop_param(const LayerParameter* msg);
+  static void set_has_crop_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 16384u;
+  }
+  static const ::opencv_caffe::DataParameter& data_param(const LayerParameter* msg);
+  static void set_has_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+  static const ::opencv_caffe::DetectionOutputParameter& detection_output_param(const LayerParameter* msg);
+  static void set_has_detection_output_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 131072u;
+  }
+  static const ::opencv_caffe::DropoutParameter& dropout_param(const LayerParameter* msg);
+  static void set_has_dropout_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
+  }
+  static const ::opencv_caffe::DummyDataParameter& dummy_data_param(const LayerParameter* msg);
+  static void set_has_dummy_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
+  }
+  static const ::opencv_caffe::EltwiseParameter& eltwise_param(const LayerParameter* msg);
+  static void set_has_eltwise_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 4096u;
+  }
+  static const ::opencv_caffe::ELUParameter& elu_param(const LayerParameter* msg);
+  static void set_has_elu_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 1024u;
+  }
+  static const ::opencv_caffe::EmbedParameter& embed_param(const LayerParameter* msg);
+  static void set_has_embed_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 128u;
+  }
+  static const ::opencv_caffe::ExpParameter& exp_param(const LayerParameter* msg);
+  static void set_has_exp_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 8192u;
+  }
+  static const ::opencv_caffe::FlattenParameter& flatten_param(const LayerParameter* msg);
+  static void set_has_flatten_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 32u;
+  }
+  static const ::opencv_caffe::HDF5DataParameter& hdf5_data_param(const LayerParameter* msg);
+  static void set_has_hdf5_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 16384u;
+  }
+  static const ::opencv_caffe::HDF5OutputParameter& hdf5_output_param(const LayerParameter* msg);
+  static void set_has_hdf5_output_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 32768u;
+  }
+  static const ::opencv_caffe::HingeLossParameter& hinge_loss_param(const LayerParameter* msg);
+  static void set_has_hinge_loss_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 65536u;
+  }
+  static const ::opencv_caffe::ImageDataParameter& image_data_param(const LayerParameter* msg);
+  static void set_has_image_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 131072u;
+  }
+  static const ::opencv_caffe::InfogainLossParameter& infogain_loss_param(const LayerParameter* msg);
+  static void set_has_infogain_loss_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 262144u;
+  }
+  static const ::opencv_caffe::InnerProductParameter& inner_product_param(const LayerParameter* msg);
+  static void set_has_inner_product_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 524288u;
+  }
+  static const ::opencv_caffe::InputParameter& input_param(const LayerParameter* msg);
+  static void set_has_input_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 8192u;
+  }
+  static const ::opencv_caffe::LogParameter& log_param(const LayerParameter* msg);
+  static void set_has_log_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 16u;
+  }
+  static const ::opencv_caffe::LRNParameter& lrn_param(const LayerParameter* msg);
+  static void set_has_lrn_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 1048576u;
+  }
+  static const ::opencv_caffe::MemoryDataParameter& memory_data_param(const LayerParameter* msg);
+  static void set_has_memory_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 2097152u;
+  }
+  static const ::opencv_caffe::MVNParameter& mvn_param(const LayerParameter* msg);
+  static void set_has_mvn_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 4194304u;
+  }
+  static const ::opencv_caffe::NormalizeBBoxParameter& norm_param(const LayerParameter* msg);
+  static void set_has_norm_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 524288u;
+  }
+  static const ::opencv_caffe::PermuteParameter& permute_param(const LayerParameter* msg);
+  static void set_has_permute_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 262144u;
+  }
+  static const ::opencv_caffe::ParameterParameter& parameter_param(const LayerParameter* msg);
+  static void set_has_parameter_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 32768u;
+  }
+  static const ::opencv_caffe::PoolingParameter& pooling_param(const LayerParameter* msg);
+  static void set_has_pooling_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 8388608u;
+  }
+  static const ::opencv_caffe::PowerParameter& power_param(const LayerParameter* msg);
+  static void set_has_power_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 16777216u;
+  }
+  static const ::opencv_caffe::PReLUParameter& prelu_param(const LayerParameter* msg);
+  static void set_has_prelu_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 2u;
+  }
+  static const ::opencv_caffe::PriorBoxParameter& prior_box_param(const LayerParameter* msg);
+  static void set_has_prior_box_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 1048576u;
+  }
+  static const ::opencv_caffe::ProposalParameter& proposal_param(const LayerParameter* msg);
+  static void set_has_proposal_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 2097152u;
+  }
+  static const ::opencv_caffe::PSROIPoolingParameter& psroi_pooling_param(const LayerParameter* msg);
+  static void set_has_psroi_pooling_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 4194304u;
+  }
+  static const ::opencv_caffe::PythonParameter& python_param(const LayerParameter* msg);
+  static void set_has_python_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 1u;
+  }
+  static const ::opencv_caffe::RecurrentParameter& recurrent_param(const LayerParameter* msg);
+  static void set_has_recurrent_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 65536u;
+  }
+  static const ::opencv_caffe::ReductionParameter& reduction_param(const LayerParameter* msg);
+  static void set_has_reduction_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 64u;
+  }
+  static const ::opencv_caffe::ReLUParameter& relu_param(const LayerParameter* msg);
+  static void set_has_relu_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 33554432u;
+  }
+  static const ::opencv_caffe::ReshapeParameter& reshape_param(const LayerParameter* msg);
+  static void set_has_reshape_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 8u;
+  }
+  static const ::opencv_caffe::ROIPoolingParameter& roi_pooling_param(const LayerParameter* msg);
+  static void set_has_roi_pooling_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 8388608u;
+  }
+  static const ::opencv_caffe::ScaleParameter& scale_param(const LayerParameter* msg);
+  static void set_has_scale_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 4096u;
+  }
+  static const ::opencv_caffe::SigmoidParameter& sigmoid_param(const LayerParameter* msg);
+  static void set_has_sigmoid_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 67108864u;
+  }
+  static const ::opencv_caffe::SoftmaxParameter& softmax_param(const LayerParameter* msg);
+  static void set_has_softmax_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 134217728u;
+  }
+  static const ::opencv_caffe::SPPParameter& spp_param(const LayerParameter* msg);
+  static void set_has_spp_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 4u;
+  }
+  static const ::opencv_caffe::SliceParameter& slice_param(const LayerParameter* msg);
+  static void set_has_slice_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 268435456u;
+  }
+  static const ::opencv_caffe::TanHParameter& tanh_param(const LayerParameter* msg);
+  static void set_has_tanh_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 536870912u;
+  }
+  static const ::opencv_caffe::ThresholdParameter& threshold_param(const LayerParameter* msg);
+  static void set_has_threshold_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 1073741824u;
+  }
+  static const ::opencv_caffe::TileParameter& tile_param(const LayerParameter* msg);
+  static void set_has_tile_param(HasBits* has_bits) {
+    (*has_bits)[1] |= 256u;
+  }
+  static const ::opencv_caffe::WindowDataParameter& window_data_param(const LayerParameter* msg);
+  static void set_has_window_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 2147483648u;
+  }
+};
 
-      // optional .opencv_caffe.ROIPoolingParameter roi_pooling_param = 8266711;
-      case 8266711: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(186u /* 66133690 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_roi_pooling_param()));
-        } 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:opencv_caffe.LayerParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.LayerParameter)
-  return false;
-#undef DO_
+const ::opencv_caffe::TransformationParameter&
+LayerParameter::_Internal::transform_param(const LayerParameter* msg) {
+  return *msg->transform_param_;
 }
-
-void LayerParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.LayerParameter.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
+const ::opencv_caffe::LossParameter&
+LayerParameter::_Internal::loss_param(const LayerParameter* msg) {
+  return *msg->loss_param_;
+}
+const ::opencv_caffe::AccuracyParameter&
+LayerParameter::_Internal::accuracy_param(const LayerParameter* msg) {
+  return *msg->accuracy_param_;
+}
+const ::opencv_caffe::ArgMaxParameter&
+LayerParameter::_Internal::argmax_param(const LayerParameter* msg) {
+  return *msg->argmax_param_;
+}
+const ::opencv_caffe::BatchNormParameter&
+LayerParameter::_Internal::batch_norm_param(const LayerParameter* msg) {
+  return *msg->batch_norm_param_;
+}
+const ::opencv_caffe::BiasParameter&
+LayerParameter::_Internal::bias_param(const LayerParameter* msg) {
+  return *msg->bias_param_;
+}
+const ::opencv_caffe::ConcatParameter&
+LayerParameter::_Internal::concat_param(const LayerParameter* msg) {
+  return *msg->concat_param_;
+}
+const ::opencv_caffe::ContrastiveLossParameter&
+LayerParameter::_Internal::contrastive_loss_param(const LayerParameter* msg) {
+  return *msg->contrastive_loss_param_;
+}
+const ::opencv_caffe::ConvolutionParameter&
+LayerParameter::_Internal::convolution_param(const LayerParameter* msg) {
+  return *msg->convolution_param_;
+}
+const ::opencv_caffe::CropParameter&
+LayerParameter::_Internal::crop_param(const LayerParameter* msg) {
+  return *msg->crop_param_;
+}
+const ::opencv_caffe::DataParameter&
+LayerParameter::_Internal::data_param(const LayerParameter* msg) {
+  return *msg->data_param_;
+}
+const ::opencv_caffe::DetectionOutputParameter&
+LayerParameter::_Internal::detection_output_param(const LayerParameter* msg) {
+  return *msg->detection_output_param_;
+}
+const ::opencv_caffe::DropoutParameter&
+LayerParameter::_Internal::dropout_param(const LayerParameter* msg) {
+  return *msg->dropout_param_;
+}
+const ::opencv_caffe::DummyDataParameter&
+LayerParameter::_Internal::dummy_data_param(const LayerParameter* msg) {
+  return *msg->dummy_data_param_;
+}
+const ::opencv_caffe::EltwiseParameter&
+LayerParameter::_Internal::eltwise_param(const LayerParameter* msg) {
+  return *msg->eltwise_param_;
+}
+const ::opencv_caffe::ELUParameter&
+LayerParameter::_Internal::elu_param(const LayerParameter* msg) {
+  return *msg->elu_param_;
+}
+const ::opencv_caffe::EmbedParameter&
+LayerParameter::_Internal::embed_param(const LayerParameter* msg) {
+  return *msg->embed_param_;
+}
+const ::opencv_caffe::ExpParameter&
+LayerParameter::_Internal::exp_param(const LayerParameter* msg) {
+  return *msg->exp_param_;
+}
+const ::opencv_caffe::FlattenParameter&
+LayerParameter::_Internal::flatten_param(const LayerParameter* msg) {
+  return *msg->flatten_param_;
+}
+const ::opencv_caffe::HDF5DataParameter&
+LayerParameter::_Internal::hdf5_data_param(const LayerParameter* msg) {
+  return *msg->hdf5_data_param_;
+}
+const ::opencv_caffe::HDF5OutputParameter&
+LayerParameter::_Internal::hdf5_output_param(const LayerParameter* msg) {
+  return *msg->hdf5_output_param_;
+}
+const ::opencv_caffe::HingeLossParameter&
+LayerParameter::_Internal::hinge_loss_param(const LayerParameter* msg) {
+  return *msg->hinge_loss_param_;
+}
+const ::opencv_caffe::ImageDataParameter&
+LayerParameter::_Internal::image_data_param(const LayerParameter* msg) {
+  return *msg->image_data_param_;
+}
+const ::opencv_caffe::InfogainLossParameter&
+LayerParameter::_Internal::infogain_loss_param(const LayerParameter* msg) {
+  return *msg->infogain_loss_param_;
+}
+const ::opencv_caffe::InnerProductParameter&
+LayerParameter::_Internal::inner_product_param(const LayerParameter* msg) {
+  return *msg->inner_product_param_;
+}
+const ::opencv_caffe::InputParameter&
+LayerParameter::_Internal::input_param(const LayerParameter* msg) {
+  return *msg->input_param_;
+}
+const ::opencv_caffe::LogParameter&
+LayerParameter::_Internal::log_param(const LayerParameter* msg) {
+  return *msg->log_param_;
+}
+const ::opencv_caffe::LRNParameter&
+LayerParameter::_Internal::lrn_param(const LayerParameter* msg) {
+  return *msg->lrn_param_;
+}
+const ::opencv_caffe::MemoryDataParameter&
+LayerParameter::_Internal::memory_data_param(const LayerParameter* msg) {
+  return *msg->memory_data_param_;
+}
+const ::opencv_caffe::MVNParameter&
+LayerParameter::_Internal::mvn_param(const LayerParameter* msg) {
+  return *msg->mvn_param_;
+}
+const ::opencv_caffe::NormalizeBBoxParameter&
+LayerParameter::_Internal::norm_param(const LayerParameter* msg) {
+  return *msg->norm_param_;
+}
+const ::opencv_caffe::PermuteParameter&
+LayerParameter::_Internal::permute_param(const LayerParameter* msg) {
+  return *msg->permute_param_;
+}
+const ::opencv_caffe::ParameterParameter&
+LayerParameter::_Internal::parameter_param(const LayerParameter* msg) {
+  return *msg->parameter_param_;
+}
+const ::opencv_caffe::PoolingParameter&
+LayerParameter::_Internal::pooling_param(const LayerParameter* msg) {
+  return *msg->pooling_param_;
+}
+const ::opencv_caffe::PowerParameter&
+LayerParameter::_Internal::power_param(const LayerParameter* msg) {
+  return *msg->power_param_;
+}
+const ::opencv_caffe::PReLUParameter&
+LayerParameter::_Internal::prelu_param(const LayerParameter* msg) {
+  return *msg->prelu_param_;
+}
+const ::opencv_caffe::PriorBoxParameter&
+LayerParameter::_Internal::prior_box_param(const LayerParameter* msg) {
+  return *msg->prior_box_param_;
+}
+const ::opencv_caffe::ProposalParameter&
+LayerParameter::_Internal::proposal_param(const LayerParameter* msg) {
+  return *msg->proposal_param_;
+}
+const ::opencv_caffe::PSROIPoolingParameter&
+LayerParameter::_Internal::psroi_pooling_param(const LayerParameter* msg) {
+  return *msg->psroi_pooling_param_;
+}
+const ::opencv_caffe::PythonParameter&
+LayerParameter::_Internal::python_param(const LayerParameter* msg) {
+  return *msg->python_param_;
+}
+const ::opencv_caffe::RecurrentParameter&
+LayerParameter::_Internal::recurrent_param(const LayerParameter* msg) {
+  return *msg->recurrent_param_;
+}
+const ::opencv_caffe::ReductionParameter&
+LayerParameter::_Internal::reduction_param(const LayerParameter* msg) {
+  return *msg->reduction_param_;
+}
+const ::opencv_caffe::ReLUParameter&
+LayerParameter::_Internal::relu_param(const LayerParameter* msg) {
+  return *msg->relu_param_;
+}
+const ::opencv_caffe::ReshapeParameter&
+LayerParameter::_Internal::reshape_param(const LayerParameter* msg) {
+  return *msg->reshape_param_;
+}
+const ::opencv_caffe::ROIPoolingParameter&
+LayerParameter::_Internal::roi_pooling_param(const LayerParameter* msg) {
+  return *msg->roi_pooling_param_;
+}
+const ::opencv_caffe::ScaleParameter&
+LayerParameter::_Internal::scale_param(const LayerParameter* msg) {
+  return *msg->scale_param_;
+}
+const ::opencv_caffe::SigmoidParameter&
+LayerParameter::_Internal::sigmoid_param(const LayerParameter* msg) {
+  return *msg->sigmoid_param_;
+}
+const ::opencv_caffe::SoftmaxParameter&
+LayerParameter::_Internal::softmax_param(const LayerParameter* msg) {
+  return *msg->softmax_param_;
+}
+const ::opencv_caffe::SPPParameter&
+LayerParameter::_Internal::spp_param(const LayerParameter* msg) {
+  return *msg->spp_param_;
+}
+const ::opencv_caffe::SliceParameter&
+LayerParameter::_Internal::slice_param(const LayerParameter* msg) {
+  return *msg->slice_param_;
+}
+const ::opencv_caffe::TanHParameter&
+LayerParameter::_Internal::tanh_param(const LayerParameter* msg) {
+  return *msg->tanh_param_;
+}
+const ::opencv_caffe::ThresholdParameter&
+LayerParameter::_Internal::threshold_param(const LayerParameter* msg) {
+  return *msg->threshold_param_;
+}
+const ::opencv_caffe::TileParameter&
+LayerParameter::_Internal::tile_param(const LayerParameter* msg) {
+  return *msg->tile_param_;
+}
+const ::opencv_caffe::WindowDataParameter&
+LayerParameter::_Internal::window_data_param(const LayerParameter* msg) {
+  return *msg->window_data_param_;
+}
+LayerParameter::LayerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  bottom_(arena),
+  top_(arena),
+  loss_weight_(arena),
+  param_(arena),
+  blobs_(arena),
+  include_(arena),
+  exclude_(arena),
+  propagate_down_(arena) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-
-  // optional string type = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.LayerParameter.type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->type(), output);
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.LayerParameter)
+}
+LayerParameter::LayerParameter(const LayerParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_),
+      bottom_(from.bottom_),
+      top_(from.top_),
+      loss_weight_(from.loss_weight_),
+      param_(from.param_),
+      blobs_(from.blobs_),
+      include_(from.include_),
+      exclude_(from.exclude_),
+      propagate_down_(from.propagate_down_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_type()) {
+    type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_transform_param()) {
+    transform_param_ = new ::opencv_caffe::TransformationParameter(*from.transform_param_);
+  } else {
+    transform_param_ = nullptr;
   }
-
-  // repeated string bottom = 3;
-  for (int i = 0, n = this->bottom_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->bottom(i).data(), static_cast<int>(this->bottom(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.LayerParameter.bottom");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      3, this->bottom(i), output);
+  if (from._internal_has_loss_param()) {
+    loss_param_ = new ::opencv_caffe::LossParameter(*from.loss_param_);
+  } else {
+    loss_param_ = nullptr;
   }
-
-  // repeated string top = 4;
-  for (int i = 0, n = this->top_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->top(i).data(), static_cast<int>(this->top(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.LayerParameter.top");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      4, this->top(i), output);
+  if (from._internal_has_accuracy_param()) {
+    accuracy_param_ = new ::opencv_caffe::AccuracyParameter(*from.accuracy_param_);
+  } else {
+    accuracy_param_ = nullptr;
   }
-
-  // repeated float loss_weight = 5;
-  for (int i = 0, n = this->loss_weight_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      5, this->loss_weight(i), output);
+  if (from._internal_has_argmax_param()) {
+    argmax_param_ = new ::opencv_caffe::ArgMaxParameter(*from.argmax_param_);
+  } else {
+    argmax_param_ = nullptr;
   }
-
-  // repeated .opencv_caffe.ParamSpec param = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->param_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, this->param(static_cast<int>(i)), output);
+  if (from._internal_has_concat_param()) {
+    concat_param_ = new ::opencv_caffe::ConcatParameter(*from.concat_param_);
+  } else {
+    concat_param_ = nullptr;
   }
-
-  // repeated .opencv_caffe.BlobProto blobs = 7;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->blobs_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, this->blobs(static_cast<int>(i)), output);
+  if (from._internal_has_contrastive_loss_param()) {
+    contrastive_loss_param_ = new ::opencv_caffe::ContrastiveLossParameter(*from.contrastive_loss_param_);
+  } else {
+    contrastive_loss_param_ = nullptr;
   }
-
-  // repeated .opencv_caffe.NetStateRule include = 8;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->include_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, this->include(static_cast<int>(i)), output);
+  if (from._internal_has_convolution_param()) {
+    convolution_param_ = new ::opencv_caffe::ConvolutionParameter(*from.convolution_param_);
+  } else {
+    convolution_param_ = nullptr;
   }
-
-  // repeated .opencv_caffe.NetStateRule exclude = 9;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->exclude_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      9, this->exclude(static_cast<int>(i)), output);
+  if (from._internal_has_data_param()) {
+    data_param_ = new ::opencv_caffe::DataParameter(*from.data_param_);
+  } else {
+    data_param_ = nullptr;
   }
-
-  cached_has_bits = _has_bits_[1];
-  // optional .opencv_caffe.Phase phase = 10;
-  if (cached_has_bits & 0x01000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      10, this->phase(), output);
+  if (from._internal_has_dropout_param()) {
+    dropout_param_ = new ::opencv_caffe::DropoutParameter(*from.dropout_param_);
+  } else {
+    dropout_param_ = nullptr;
   }
-
-  // repeated bool propagate_down = 11;
-  for (int i = 0, n = this->propagate_down_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(
-      11, this->propagate_down(i), output);
+  if (from._internal_has_dummy_data_param()) {
+    dummy_data_param_ = new ::opencv_caffe::DummyDataParameter(*from.dummy_data_param_);
+  } else {
+    dummy_data_param_ = nullptr;
   }
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.TransformationParameter transform_param = 100;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      100, *this->transform_param_, output);
+  if (from._internal_has_eltwise_param()) {
+    eltwise_param_ = new ::opencv_caffe::EltwiseParameter(*from.eltwise_param_);
+  } else {
+    eltwise_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.LossParameter loss_param = 101;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      101, *this->loss_param_, output);
+  if (from._internal_has_exp_param()) {
+    exp_param_ = new ::opencv_caffe::ExpParameter(*from.exp_param_);
+  } else {
+    exp_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.AccuracyParameter accuracy_param = 102;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      102, *this->accuracy_param_, output);
+  if (from._internal_has_hdf5_data_param()) {
+    hdf5_data_param_ = new ::opencv_caffe::HDF5DataParameter(*from.hdf5_data_param_);
+  } else {
+    hdf5_data_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ArgMaxParameter argmax_param = 103;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      103, *this->argmax_param_, output);
+  if (from._internal_has_hdf5_output_param()) {
+    hdf5_output_param_ = new ::opencv_caffe::HDF5OutputParameter(*from.hdf5_output_param_);
+  } else {
+    hdf5_output_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ConcatParameter concat_param = 104;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      104, *this->concat_param_, output);
+  if (from._internal_has_hinge_loss_param()) {
+    hinge_loss_param_ = new ::opencv_caffe::HingeLossParameter(*from.hinge_loss_param_);
+  } else {
+    hinge_loss_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 105;
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      105, *this->contrastive_loss_param_, output);
+  if (from._internal_has_image_data_param()) {
+    image_data_param_ = new ::opencv_caffe::ImageDataParameter(*from.image_data_param_);
+  } else {
+    image_data_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ConvolutionParameter convolution_param = 106;
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      106, *this->convolution_param_, output);
+  if (from._internal_has_infogain_loss_param()) {
+    infogain_loss_param_ = new ::opencv_caffe::InfogainLossParameter(*from.infogain_loss_param_);
+  } else {
+    infogain_loss_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.DataParameter data_param = 107;
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      107, *this->data_param_, output);
+  if (from._internal_has_inner_product_param()) {
+    inner_product_param_ = new ::opencv_caffe::InnerProductParameter(*from.inner_product_param_);
+  } else {
+    inner_product_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.DropoutParameter dropout_param = 108;
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      108, *this->dropout_param_, output);
+  if (from._internal_has_lrn_param()) {
+    lrn_param_ = new ::opencv_caffe::LRNParameter(*from.lrn_param_);
+  } else {
+    lrn_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.DummyDataParameter dummy_data_param = 109;
-  if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      109, *this->dummy_data_param_, output);
+  if (from._internal_has_memory_data_param()) {
+    memory_data_param_ = new ::opencv_caffe::MemoryDataParameter(*from.memory_data_param_);
+  } else {
+    memory_data_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.EltwiseParameter eltwise_param = 110;
-  if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      110, *this->eltwise_param_, output);
+  if (from._internal_has_mvn_param()) {
+    mvn_param_ = new ::opencv_caffe::MVNParameter(*from.mvn_param_);
+  } else {
+    mvn_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ExpParameter exp_param = 111;
-  if (cached_has_bits & 0x00002000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      111, *this->exp_param_, output);
+  if (from._internal_has_pooling_param()) {
+    pooling_param_ = new ::opencv_caffe::PoolingParameter(*from.pooling_param_);
+  } else {
+    pooling_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 112;
-  if (cached_has_bits & 0x00004000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      112, *this->hdf5_data_param_, output);
+  if (from._internal_has_power_param()) {
+    power_param_ = new ::opencv_caffe::PowerParameter(*from.power_param_);
+  } else {
+    power_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 113;
-  if (cached_has_bits & 0x00008000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      113, *this->hdf5_output_param_, output);
+  if (from._internal_has_relu_param()) {
+    relu_param_ = new ::opencv_caffe::ReLUParameter(*from.relu_param_);
+  } else {
+    relu_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 114;
-  if (cached_has_bits & 0x00010000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      114, *this->hinge_loss_param_, output);
+  if (from._internal_has_sigmoid_param()) {
+    sigmoid_param_ = new ::opencv_caffe::SigmoidParameter(*from.sigmoid_param_);
+  } else {
+    sigmoid_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ImageDataParameter image_data_param = 115;
-  if (cached_has_bits & 0x00020000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      115, *this->image_data_param_, output);
+  if (from._internal_has_softmax_param()) {
+    softmax_param_ = new ::opencv_caffe::SoftmaxParameter(*from.softmax_param_);
+  } else {
+    softmax_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 116;
-  if (cached_has_bits & 0x00040000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      116, *this->infogain_loss_param_, output);
+  if (from._internal_has_slice_param()) {
+    slice_param_ = new ::opencv_caffe::SliceParameter(*from.slice_param_);
+  } else {
+    slice_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.InnerProductParameter inner_product_param = 117;
-  if (cached_has_bits & 0x00080000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      117, *this->inner_product_param_, output);
+  if (from._internal_has_tanh_param()) {
+    tanh_param_ = new ::opencv_caffe::TanHParameter(*from.tanh_param_);
+  } else {
+    tanh_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.LRNParameter lrn_param = 118;
-  if (cached_has_bits & 0x00100000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      118, *this->lrn_param_, output);
+  if (from._internal_has_threshold_param()) {
+    threshold_param_ = new ::opencv_caffe::ThresholdParameter(*from.threshold_param_);
+  } else {
+    threshold_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.MemoryDataParameter memory_data_param = 119;
-  if (cached_has_bits & 0x00200000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      119, *this->memory_data_param_, output);
+  if (from._internal_has_window_data_param()) {
+    window_data_param_ = new ::opencv_caffe::WindowDataParameter(*from.window_data_param_);
+  } else {
+    window_data_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.MVNParameter mvn_param = 120;
-  if (cached_has_bits & 0x00400000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      120, *this->mvn_param_, output);
+  if (from._internal_has_python_param()) {
+    python_param_ = new ::opencv_caffe::PythonParameter(*from.python_param_);
+  } else {
+    python_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.PoolingParameter pooling_param = 121;
-  if (cached_has_bits & 0x00800000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      121, *this->pooling_param_, output);
+  if (from._internal_has_prelu_param()) {
+    prelu_param_ = new ::opencv_caffe::PReLUParameter(*from.prelu_param_);
+  } else {
+    prelu_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.PowerParameter power_param = 122;
-  if (cached_has_bits & 0x01000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      122, *this->power_param_, output);
+  if (from._internal_has_spp_param()) {
+    spp_param_ = new ::opencv_caffe::SPPParameter(*from.spp_param_);
+  } else {
+    spp_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ReLUParameter relu_param = 123;
-  if (cached_has_bits & 0x02000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      123, *this->relu_param_, output);
+  if (from._internal_has_reshape_param()) {
+    reshape_param_ = new ::opencv_caffe::ReshapeParameter(*from.reshape_param_);
+  } else {
+    reshape_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.SigmoidParameter sigmoid_param = 124;
-  if (cached_has_bits & 0x04000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      124, *this->sigmoid_param_, output);
+  if (from._internal_has_log_param()) {
+    log_param_ = new ::opencv_caffe::LogParameter(*from.log_param_);
+  } else {
+    log_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.SoftmaxParameter softmax_param = 125;
-  if (cached_has_bits & 0x08000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      125, *this->softmax_param_, output);
+  if (from._internal_has_flatten_param()) {
+    flatten_param_ = new ::opencv_caffe::FlattenParameter(*from.flatten_param_);
+  } else {
+    flatten_param_ = nullptr;
+  }
+  if (from._internal_has_reduction_param()) {
+    reduction_param_ = new ::opencv_caffe::ReductionParameter(*from.reduction_param_);
+  } else {
+    reduction_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.SliceParameter slice_param = 126;
-  if (cached_has_bits & 0x10000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      126, *this->slice_param_, output);
+  if (from._internal_has_embed_param()) {
+    embed_param_ = new ::opencv_caffe::EmbedParameter(*from.embed_param_);
+  } else {
+    embed_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.TanHParameter tanh_param = 127;
-  if (cached_has_bits & 0x20000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      127, *this->tanh_param_, output);
+  if (from._internal_has_tile_param()) {
+    tile_param_ = new ::opencv_caffe::TileParameter(*from.tile_param_);
+  } else {
+    tile_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ThresholdParameter threshold_param = 128;
-  if (cached_has_bits & 0x40000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      128, *this->threshold_param_, output);
+  if (from._internal_has_batch_norm_param()) {
+    batch_norm_param_ = new ::opencv_caffe::BatchNormParameter(*from.batch_norm_param_);
+  } else {
+    batch_norm_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.WindowDataParameter window_data_param = 129;
-  if (cached_has_bits & 0x80000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      129, *this->window_data_param_, output);
+  if (from._internal_has_elu_param()) {
+    elu_param_ = new ::opencv_caffe::ELUParameter(*from.elu_param_);
+  } else {
+    elu_param_ = nullptr;
   }
-
-  cached_has_bits = _has_bits_[1];
-  // optional .opencv_caffe.PythonParameter python_param = 130;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      130, *this->python_param_, output);
+  if (from._internal_has_bias_param()) {
+    bias_param_ = new ::opencv_caffe::BiasParameter(*from.bias_param_);
+  } else {
+    bias_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.PReLUParameter prelu_param = 131;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      131, *this->prelu_param_, output);
+  if (from._internal_has_scale_param()) {
+    scale_param_ = new ::opencv_caffe::ScaleParameter(*from.scale_param_);
+  } else {
+    scale_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.SPPParameter spp_param = 132;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      132, *this->spp_param_, output);
+  if (from._internal_has_input_param()) {
+    input_param_ = new ::opencv_caffe::InputParameter(*from.input_param_);
+  } else {
+    input_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ReshapeParameter reshape_param = 133;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      133, *this->reshape_param_, output);
+  if (from._internal_has_crop_param()) {
+    crop_param_ = new ::opencv_caffe::CropParameter(*from.crop_param_);
+  } else {
+    crop_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.LogParameter log_param = 134;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      134, *this->log_param_, output);
+  if (from._internal_has_parameter_param()) {
+    parameter_param_ = new ::opencv_caffe::ParameterParameter(*from.parameter_param_);
+  } else {
+    parameter_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.FlattenParameter flatten_param = 135;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      135, *this->flatten_param_, output);
+  if (from._internal_has_recurrent_param()) {
+    recurrent_param_ = new ::opencv_caffe::RecurrentParameter(*from.recurrent_param_);
+  } else {
+    recurrent_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ReductionParameter reduction_param = 136;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      136, *this->reduction_param_, output);
+  if (from._internal_has_detection_output_param()) {
+    detection_output_param_ = new ::opencv_caffe::DetectionOutputParameter(*from.detection_output_param_);
+  } else {
+    detection_output_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.EmbedParameter embed_param = 137;
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      137, *this->embed_param_, output);
+  if (from._internal_has_permute_param()) {
+    permute_param_ = new ::opencv_caffe::PermuteParameter(*from.permute_param_);
+  } else {
+    permute_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.TileParameter tile_param = 138;
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      138, *this->tile_param_, output);
+  if (from._internal_has_norm_param()) {
+    norm_param_ = new ::opencv_caffe::NormalizeBBoxParameter(*from.norm_param_);
+  } else {
+    norm_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.BatchNormParameter batch_norm_param = 139;
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      139, *this->batch_norm_param_, output);
+  if (from._internal_has_prior_box_param()) {
+    prior_box_param_ = new ::opencv_caffe::PriorBoxParameter(*from.prior_box_param_);
+  } else {
+    prior_box_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ELUParameter elu_param = 140;
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      140, *this->elu_param_, output);
+  if (from._internal_has_proposal_param()) {
+    proposal_param_ = new ::opencv_caffe::ProposalParameter(*from.proposal_param_);
+  } else {
+    proposal_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.BiasParameter bias_param = 141;
-  if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      141, *this->bias_param_, output);
+  if (from._internal_has_psroi_pooling_param()) {
+    psroi_pooling_param_ = new ::opencv_caffe::PSROIPoolingParameter(*from.psroi_pooling_param_);
+  } else {
+    psroi_pooling_param_ = nullptr;
   }
-
-  // optional .opencv_caffe.ScaleParameter scale_param = 142;
-  if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      142, *this->scale_param_, output);
+  if (from._internal_has_roi_pooling_param()) {
+    roi_pooling_param_ = new ::opencv_caffe::ROIPoolingParameter(*from.roi_pooling_param_);
+  } else {
+    roi_pooling_param_ = nullptr;
   }
+  phase_ = from.phase_;
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.LayerParameter)
+}
 
-  // optional .opencv_caffe.InputParameter input_param = 143;
-  if (cached_has_bits & 0x00002000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      143, *this->input_param_, output);
-  }
+inline void LayerParameter::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&transform_param_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&phase_) -
+    reinterpret_cast<char*>(&transform_param_)) + sizeof(phase_));
+}
 
-  // optional .opencv_caffe.CropParameter crop_param = 144;
-  if (cached_has_bits & 0x00004000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      144, *this->crop_param_, output);
-  }
+LayerParameter::~LayerParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.LayerParameter)
+  if (GetArenaForAllocation() != nullptr) return;
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  // optional .opencv_caffe.ParameterParameter parameter_param = 145;
-  if (cached_has_bits & 0x00008000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      145, *this->parameter_param_, output);
-  }
+inline void LayerParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  if (this != internal_default_instance()) delete transform_param_;
+  if (this != internal_default_instance()) delete loss_param_;
+  if (this != internal_default_instance()) delete accuracy_param_;
+  if (this != internal_default_instance()) delete argmax_param_;
+  if (this != internal_default_instance()) delete concat_param_;
+  if (this != internal_default_instance()) delete contrastive_loss_param_;
+  if (this != internal_default_instance()) delete convolution_param_;
+  if (this != internal_default_instance()) delete data_param_;
+  if (this != internal_default_instance()) delete dropout_param_;
+  if (this != internal_default_instance()) delete dummy_data_param_;
+  if (this != internal_default_instance()) delete eltwise_param_;
+  if (this != internal_default_instance()) delete exp_param_;
+  if (this != internal_default_instance()) delete hdf5_data_param_;
+  if (this != internal_default_instance()) delete hdf5_output_param_;
+  if (this != internal_default_instance()) delete hinge_loss_param_;
+  if (this != internal_default_instance()) delete image_data_param_;
+  if (this != internal_default_instance()) delete infogain_loss_param_;
+  if (this != internal_default_instance()) delete inner_product_param_;
+  if (this != internal_default_instance()) delete lrn_param_;
+  if (this != internal_default_instance()) delete memory_data_param_;
+  if (this != internal_default_instance()) delete mvn_param_;
+  if (this != internal_default_instance()) delete pooling_param_;
+  if (this != internal_default_instance()) delete power_param_;
+  if (this != internal_default_instance()) delete relu_param_;
+  if (this != internal_default_instance()) delete sigmoid_param_;
+  if (this != internal_default_instance()) delete softmax_param_;
+  if (this != internal_default_instance()) delete slice_param_;
+  if (this != internal_default_instance()) delete tanh_param_;
+  if (this != internal_default_instance()) delete threshold_param_;
+  if (this != internal_default_instance()) delete window_data_param_;
+  if (this != internal_default_instance()) delete python_param_;
+  if (this != internal_default_instance()) delete prelu_param_;
+  if (this != internal_default_instance()) delete spp_param_;
+  if (this != internal_default_instance()) delete reshape_param_;
+  if (this != internal_default_instance()) delete log_param_;
+  if (this != internal_default_instance()) delete flatten_param_;
+  if (this != internal_default_instance()) delete reduction_param_;
+  if (this != internal_default_instance()) delete embed_param_;
+  if (this != internal_default_instance()) delete tile_param_;
+  if (this != internal_default_instance()) delete batch_norm_param_;
+  if (this != internal_default_instance()) delete elu_param_;
+  if (this != internal_default_instance()) delete bias_param_;
+  if (this != internal_default_instance()) delete scale_param_;
+  if (this != internal_default_instance()) delete input_param_;
+  if (this != internal_default_instance()) delete crop_param_;
+  if (this != internal_default_instance()) delete parameter_param_;
+  if (this != internal_default_instance()) delete recurrent_param_;
+  if (this != internal_default_instance()) delete detection_output_param_;
+  if (this != internal_default_instance()) delete permute_param_;
+  if (this != internal_default_instance()) delete norm_param_;
+  if (this != internal_default_instance()) delete prior_box_param_;
+  if (this != internal_default_instance()) delete proposal_param_;
+  if (this != internal_default_instance()) delete psroi_pooling_param_;
+  if (this != internal_default_instance()) delete roi_pooling_param_;
+}
 
-  // optional .opencv_caffe.RecurrentParameter recurrent_param = 146;
-  if (cached_has_bits & 0x00010000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      146, *this->recurrent_param_, output);
-  }
+void LayerParameter::ArenaDtor(void* object) {
+  LayerParameter* _this = reinterpret_cast< LayerParameter* >(object);
+  (void)_this;
+}
+void LayerParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void LayerParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
 
-  // optional .opencv_caffe.DetectionOutputParameter detection_output_param = 147;
-  if (cached_has_bits & 0x00020000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      147, *this->detection_output_param_, output);
-  }
+void LayerParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.LayerParameter)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-  // optional .opencv_caffe.PermuteParameter permute_param = 148;
-  if (cached_has_bits & 0x00040000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      148, *this->permute_param_, output);
+  bottom_.Clear();
+  top_.Clear();
+  loss_weight_.Clear();
+  param_.Clear();
+  blobs_.Clear();
+  include_.Clear();
+  exclude_.Clear();
+  propagate_down_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
+    if (cached_has_bits & 0x00000001u) {
+      name_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      type_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000004u) {
+      GOOGLE_DCHECK(transform_param_ != nullptr);
+      transform_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000008u) {
+      GOOGLE_DCHECK(loss_param_ != nullptr);
+      loss_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000010u) {
+      GOOGLE_DCHECK(accuracy_param_ != nullptr);
+      accuracy_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000020u) {
+      GOOGLE_DCHECK(argmax_param_ != nullptr);
+      argmax_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000040u) {
+      GOOGLE_DCHECK(concat_param_ != nullptr);
+      concat_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000080u) {
+      GOOGLE_DCHECK(contrastive_loss_param_ != nullptr);
+      contrastive_loss_param_->Clear();
+    }
   }
-
-  // optional .opencv_caffe.NormalizeBBoxParameter norm_param = 149;
-  if (cached_has_bits & 0x00080000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      149, *this->norm_param_, output);
+  if (cached_has_bits & 0x0000ff00u) {
+    if (cached_has_bits & 0x00000100u) {
+      GOOGLE_DCHECK(convolution_param_ != nullptr);
+      convolution_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000200u) {
+      GOOGLE_DCHECK(data_param_ != nullptr);
+      data_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000400u) {
+      GOOGLE_DCHECK(dropout_param_ != nullptr);
+      dropout_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000800u) {
+      GOOGLE_DCHECK(dummy_data_param_ != nullptr);
+      dummy_data_param_->Clear();
+    }
+    if (cached_has_bits & 0x00001000u) {
+      GOOGLE_DCHECK(eltwise_param_ != nullptr);
+      eltwise_param_->Clear();
+    }
+    if (cached_has_bits & 0x00002000u) {
+      GOOGLE_DCHECK(exp_param_ != nullptr);
+      exp_param_->Clear();
+    }
+    if (cached_has_bits & 0x00004000u) {
+      GOOGLE_DCHECK(hdf5_data_param_ != nullptr);
+      hdf5_data_param_->Clear();
+    }
+    if (cached_has_bits & 0x00008000u) {
+      GOOGLE_DCHECK(hdf5_output_param_ != nullptr);
+      hdf5_output_param_->Clear();
+    }
+  }
+  if (cached_has_bits & 0x00ff0000u) {
+    if (cached_has_bits & 0x00010000u) {
+      GOOGLE_DCHECK(hinge_loss_param_ != nullptr);
+      hinge_loss_param_->Clear();
+    }
+    if (cached_has_bits & 0x00020000u) {
+      GOOGLE_DCHECK(image_data_param_ != nullptr);
+      image_data_param_->Clear();
+    }
+    if (cached_has_bits & 0x00040000u) {
+      GOOGLE_DCHECK(infogain_loss_param_ != nullptr);
+      infogain_loss_param_->Clear();
+    }
+    if (cached_has_bits & 0x00080000u) {
+      GOOGLE_DCHECK(inner_product_param_ != nullptr);
+      inner_product_param_->Clear();
+    }
+    if (cached_has_bits & 0x00100000u) {
+      GOOGLE_DCHECK(lrn_param_ != nullptr);
+      lrn_param_->Clear();
+    }
+    if (cached_has_bits & 0x00200000u) {
+      GOOGLE_DCHECK(memory_data_param_ != nullptr);
+      memory_data_param_->Clear();
+    }
+    if (cached_has_bits & 0x00400000u) {
+      GOOGLE_DCHECK(mvn_param_ != nullptr);
+      mvn_param_->Clear();
+    }
+    if (cached_has_bits & 0x00800000u) {
+      GOOGLE_DCHECK(pooling_param_ != nullptr);
+      pooling_param_->Clear();
+    }
   }
-
-  // optional .opencv_caffe.PriorBoxParameter prior_box_param = 150;
-  if (cached_has_bits & 0x00100000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      150, *this->prior_box_param_, output);
+  if (cached_has_bits & 0xff000000u) {
+    if (cached_has_bits & 0x01000000u) {
+      GOOGLE_DCHECK(power_param_ != nullptr);
+      power_param_->Clear();
+    }
+    if (cached_has_bits & 0x02000000u) {
+      GOOGLE_DCHECK(relu_param_ != nullptr);
+      relu_param_->Clear();
+    }
+    if (cached_has_bits & 0x04000000u) {
+      GOOGLE_DCHECK(sigmoid_param_ != nullptr);
+      sigmoid_param_->Clear();
+    }
+    if (cached_has_bits & 0x08000000u) {
+      GOOGLE_DCHECK(softmax_param_ != nullptr);
+      softmax_param_->Clear();
+    }
+    if (cached_has_bits & 0x10000000u) {
+      GOOGLE_DCHECK(slice_param_ != nullptr);
+      slice_param_->Clear();
+    }
+    if (cached_has_bits & 0x20000000u) {
+      GOOGLE_DCHECK(tanh_param_ != nullptr);
+      tanh_param_->Clear();
+    }
+    if (cached_has_bits & 0x40000000u) {
+      GOOGLE_DCHECK(threshold_param_ != nullptr);
+      threshold_param_->Clear();
+    }
+    if (cached_has_bits & 0x80000000u) {
+      GOOGLE_DCHECK(window_data_param_ != nullptr);
+      window_data_param_->Clear();
+    }
   }
-
-  // optional .opencv_caffe.ProposalParameter proposal_param = 201;
-  if (cached_has_bits & 0x00200000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      201, *this->proposal_param_, output);
+  cached_has_bits = _has_bits_[1];
+  if (cached_has_bits & 0x000000ffu) {
+    if (cached_has_bits & 0x00000001u) {
+      GOOGLE_DCHECK(python_param_ != nullptr);
+      python_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(prelu_param_ != nullptr);
+      prelu_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000004u) {
+      GOOGLE_DCHECK(spp_param_ != nullptr);
+      spp_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000008u) {
+      GOOGLE_DCHECK(reshape_param_ != nullptr);
+      reshape_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000010u) {
+      GOOGLE_DCHECK(log_param_ != nullptr);
+      log_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000020u) {
+      GOOGLE_DCHECK(flatten_param_ != nullptr);
+      flatten_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000040u) {
+      GOOGLE_DCHECK(reduction_param_ != nullptr);
+      reduction_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000080u) {
+      GOOGLE_DCHECK(embed_param_ != nullptr);
+      embed_param_->Clear();
+    }
   }
-
-  // optional .opencv_caffe.PSROIPoolingParameter psroi_pooling_param = 10002;
-  if (cached_has_bits & 0x00400000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      10002, *this->psroi_pooling_param_, output);
+  if (cached_has_bits & 0x0000ff00u) {
+    if (cached_has_bits & 0x00000100u) {
+      GOOGLE_DCHECK(tile_param_ != nullptr);
+      tile_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000200u) {
+      GOOGLE_DCHECK(batch_norm_param_ != nullptr);
+      batch_norm_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000400u) {
+      GOOGLE_DCHECK(elu_param_ != nullptr);
+      elu_param_->Clear();
+    }
+    if (cached_has_bits & 0x00000800u) {
+      GOOGLE_DCHECK(bias_param_ != nullptr);
+      bias_param_->Clear();
+    }
+    if (cached_has_bits & 0x00001000u) {
+      GOOGLE_DCHECK(scale_param_ != nullptr);
+      scale_param_->Clear();
+    }
+    if (cached_has_bits & 0x00002000u) {
+      GOOGLE_DCHECK(input_param_ != nullptr);
+      input_param_->Clear();
+    }
+    if (cached_has_bits & 0x00004000u) {
+      GOOGLE_DCHECK(crop_param_ != nullptr);
+      crop_param_->Clear();
+    }
+    if (cached_has_bits & 0x00008000u) {
+      GOOGLE_DCHECK(parameter_param_ != nullptr);
+      parameter_param_->Clear();
+    }
   }
-
-  // optional .opencv_caffe.ROIPoolingParameter roi_pooling_param = 8266711;
-  if (cached_has_bits & 0x00800000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8266711, *this->roi_pooling_param_, output);
+  if (cached_has_bits & 0x00ff0000u) {
+    if (cached_has_bits & 0x00010000u) {
+      GOOGLE_DCHECK(recurrent_param_ != nullptr);
+      recurrent_param_->Clear();
+    }
+    if (cached_has_bits & 0x00020000u) {
+      GOOGLE_DCHECK(detection_output_param_ != nullptr);
+      detection_output_param_->Clear();
+    }
+    if (cached_has_bits & 0x00040000u) {
+      GOOGLE_DCHECK(permute_param_ != nullptr);
+      permute_param_->Clear();
+    }
+    if (cached_has_bits & 0x00080000u) {
+      GOOGLE_DCHECK(norm_param_ != nullptr);
+      norm_param_->Clear();
+    }
+    if (cached_has_bits & 0x00100000u) {
+      GOOGLE_DCHECK(prior_box_param_ != nullptr);
+      prior_box_param_->Clear();
+    }
+    if (cached_has_bits & 0x00200000u) {
+      GOOGLE_DCHECK(proposal_param_ != nullptr);
+      proposal_param_->Clear();
+    }
+    if (cached_has_bits & 0x00400000u) {
+      GOOGLE_DCHECK(psroi_pooling_param_ != nullptr);
+      psroi_pooling_param_->Clear();
+    }
+    if (cached_has_bits & 0x00800000u) {
+      GOOGLE_DCHECK(roi_pooling_param_ != nullptr);
+      roi_pooling_param_->Clear();
+    }
   }
+  phase_ = 0;
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.LayerParameter)
+const char* LayerParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string name = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.LayerParameter.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string type = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.LayerParameter.type");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string bottom = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_bottom();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.LayerParameter.bottom");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated string top = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_top();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.LayerParameter.top");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated float loss_weight = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_loss_weight(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<45>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 42) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_loss_weight(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.ParamSpec param = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_param(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.BlobProto blobs = 7;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_blobs(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.NetStateRule include = 8;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_include(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_caffe.NetStateRule exclude = 9;
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_exclude(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.Phase phase = 10;
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::Phase_IsValid(val))) {
+            _internal_set_phase(static_cast<::opencv_caffe::Phase>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(10, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated bool propagate_down = 11;
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_propagate_down(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<88>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 90) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_propagate_down(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.TransformationParameter transform_param = 100;
+      case 100:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_transform_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.LossParameter loss_param = 101;
+      case 101:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_loss_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.AccuracyParameter accuracy_param = 102;
+      case 102:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ctx->ParseMessage(_internal_mutable_accuracy_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ArgMaxParameter argmax_param = 103;
+      case 103:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_argmax_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ConcatParameter concat_param = 104;
+      case 104:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ctx->ParseMessage(_internal_mutable_concat_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 105;
+      case 105:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ctx->ParseMessage(_internal_mutable_contrastive_loss_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ConvolutionParameter convolution_param = 106;
+      case 106:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr = ctx->ParseMessage(_internal_mutable_convolution_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.DataParameter data_param = 107;
+      case 107:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          ptr = ctx->ParseMessage(_internal_mutable_data_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.DropoutParameter dropout_param = 108;
+      case 108:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          ptr = ctx->ParseMessage(_internal_mutable_dropout_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.DummyDataParameter dummy_data_param = 109;
+      case 109:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
+          ptr = ctx->ParseMessage(_internal_mutable_dummy_data_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.EltwiseParameter eltwise_param = 110;
+      case 110:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 114)) {
+          ptr = ctx->ParseMessage(_internal_mutable_eltwise_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ExpParameter exp_param = 111;
+      case 111:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 122)) {
+          ptr = ctx->ParseMessage(_internal_mutable_exp_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 112;
+      case 112:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 130)) {
+          ptr = ctx->ParseMessage(_internal_mutable_hdf5_data_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 113;
+      case 113:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 138)) {
+          ptr = ctx->ParseMessage(_internal_mutable_hdf5_output_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 114;
+      case 114:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 146)) {
+          ptr = ctx->ParseMessage(_internal_mutable_hinge_loss_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ImageDataParameter image_data_param = 115;
+      case 115:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 154)) {
+          ptr = ctx->ParseMessage(_internal_mutable_image_data_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 116;
+      case 116:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 162)) {
+          ptr = ctx->ParseMessage(_internal_mutable_infogain_loss_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.InnerProductParameter inner_product_param = 117;
+      case 117:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
+          ptr = ctx->ParseMessage(_internal_mutable_inner_product_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.LRNParameter lrn_param = 118;
+      case 118:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 178)) {
+          ptr = ctx->ParseMessage(_internal_mutable_lrn_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.MemoryDataParameter memory_data_param = 119;
+      case 119:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 186)) {
+          ptr = ctx->ParseMessage(_internal_mutable_memory_data_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.MVNParameter mvn_param = 120;
+      case 120:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 194)) {
+          ptr = ctx->ParseMessage(_internal_mutable_mvn_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.PoolingParameter pooling_param = 121;
+      case 121:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 202)) {
+          ptr = ctx->ParseMessage(_internal_mutable_pooling_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.PowerParameter power_param = 122;
+      case 122:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 210)) {
+          ptr = ctx->ParseMessage(_internal_mutable_power_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ReLUParameter relu_param = 123;
+      case 123:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 218)) {
+          ptr = ctx->ParseMessage(_internal_mutable_relu_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.SigmoidParameter sigmoid_param = 124;
+      case 124:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 226)) {
+          ptr = ctx->ParseMessage(_internal_mutable_sigmoid_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.SoftmaxParameter softmax_param = 125;
+      case 125:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 234)) {
+          ptr = ctx->ParseMessage(_internal_mutable_softmax_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.SliceParameter slice_param = 126;
+      case 126:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 242)) {
+          ptr = ctx->ParseMessage(_internal_mutable_slice_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.TanHParameter tanh_param = 127;
+      case 127:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 250)) {
+          ptr = ctx->ParseMessage(_internal_mutable_tanh_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ThresholdParameter threshold_param = 128;
+      case 128:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 2)) {
+          ptr = ctx->ParseMessage(_internal_mutable_threshold_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.WindowDataParameter window_data_param = 129;
+      case 129:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_window_data_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.PythonParameter python_param = 130;
+      case 130:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_python_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.PReLUParameter prelu_param = 131;
+      case 131:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_prelu_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.SPPParameter spp_param = 132;
+      case 132:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_spp_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ReshapeParameter reshape_param = 133;
+      case 133:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_reshape_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.LogParameter log_param = 134;
+      case 134:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ctx->ParseMessage(_internal_mutable_log_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.FlattenParameter flatten_param = 135;
+      case 135:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_flatten_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ReductionParameter reduction_param = 136;
+      case 136:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ctx->ParseMessage(_internal_mutable_reduction_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.EmbedParameter embed_param = 137;
+      case 137:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ctx->ParseMessage(_internal_mutable_embed_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.TileParameter tile_param = 138;
+      case 138:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr = ctx->ParseMessage(_internal_mutable_tile_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.BatchNormParameter batch_norm_param = 139;
+      case 139:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          ptr = ctx->ParseMessage(_internal_mutable_batch_norm_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ELUParameter elu_param = 140;
+      case 140:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          ptr = ctx->ParseMessage(_internal_mutable_elu_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.BiasParameter bias_param = 141;
+      case 141:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
+          ptr = ctx->ParseMessage(_internal_mutable_bias_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ScaleParameter scale_param = 142;
+      case 142:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 114)) {
+          ptr = ctx->ParseMessage(_internal_mutable_scale_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.InputParameter input_param = 143;
+      case 143:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 122)) {
+          ptr = ctx->ParseMessage(_internal_mutable_input_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.CropParameter crop_param = 144;
+      case 144:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 130)) {
+          ptr = ctx->ParseMessage(_internal_mutable_crop_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ParameterParameter parameter_param = 145;
+      case 145:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 138)) {
+          ptr = ctx->ParseMessage(_internal_mutable_parameter_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.RecurrentParameter recurrent_param = 146;
+      case 146:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 146)) {
+          ptr = ctx->ParseMessage(_internal_mutable_recurrent_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.DetectionOutputParameter detection_output_param = 147;
+      case 147:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 154)) {
+          ptr = ctx->ParseMessage(_internal_mutable_detection_output_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.PermuteParameter permute_param = 148;
+      case 148:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 162)) {
+          ptr = ctx->ParseMessage(_internal_mutable_permute_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.NormalizeBBoxParameter norm_param = 149;
+      case 149:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
+          ptr = ctx->ParseMessage(_internal_mutable_norm_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.PriorBoxParameter prior_box_param = 150;
+      case 150:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 178)) {
+          ptr = ctx->ParseMessage(_internal_mutable_prior_box_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ProposalParameter proposal_param = 201;
+      case 201:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ctx->ParseMessage(_internal_mutable_proposal_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.PSROIPoolingParameter psroi_pooling_param = 10002;
+      case 10002:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 146)) {
+          ptr = ctx->ParseMessage(_internal_mutable_psroi_pooling_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ROIPoolingParameter roi_pooling_param = 8266711;
+      case 8266711:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 186)) {
+          ptr = ctx->ParseMessage(_internal_mutable_roi_pooling_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* LayerParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* LayerParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.LayerParameter.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional string type = 2;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_type().data(), static_cast<int>(this->_internal_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.LayerParameter.type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->type(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_type(), target);
   }
 
   // repeated string bottom = 3;
-  for (int i = 0, n = this->bottom_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->bottom(i).data(), static_cast<int>(this->bottom(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_bottom_size(); i < n; i++) {
+    const auto& s = this->_internal_bottom(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.LayerParameter.bottom");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(3, this->bottom(i), target);
+    target = stream->WriteString(3, s, target);
   }
 
   // repeated string top = 4;
-  for (int i = 0, n = this->top_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->top(i).data(), static_cast<int>(this->top(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_top_size(); i < n; i++) {
+    const auto& s = this->_internal_top(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.LayerParameter.top");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(4, this->top(i), target);
+    target = stream->WriteString(4, s, target);
   }
 
   // repeated float loss_weight = 5;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(5, this->loss_weight_, target);
+  for (int i = 0, n = this->_internal_loss_weight_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->_internal_loss_weight(i), target);
+  }
 
   // repeated .opencv_caffe.ParamSpec param = 6;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->param_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, this->param(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_param_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(6, this->_internal_param(i), target, stream);
   }
 
   // repeated .opencv_caffe.BlobProto blobs = 7;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->blobs_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, this->blobs(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_blobs_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(7, this->_internal_blobs(i), target, stream);
   }
 
   // repeated .opencv_caffe.NetStateRule include = 8;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->include_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, this->include(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_include_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(8, this->_internal_include(i), target, stream);
   }
 
   // repeated .opencv_caffe.NetStateRule exclude = 9;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->exclude_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        9, this->exclude(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_exclude_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(9, this->_internal_exclude(i), target, stream);
   }
 
   cached_has_bits = _has_bits_[1];
   // optional .opencv_caffe.Phase phase = 10;
   if (cached_has_bits & 0x01000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      10, this->phase(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      10, this->_internal_phase(), target);
   }
 
   // repeated bool propagate_down = 11;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteBoolToArray(11, this->propagate_down_, target);
+  for (int i = 0, n = this->_internal_propagate_down_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(11, this->_internal_propagate_down(i), target);
+  }
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.TransformationParameter transform_param = 100;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        100, *this->transform_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        100, _Internal::transform_param(this), target, stream);
   }
 
   // optional .opencv_caffe.LossParameter loss_param = 101;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        101, *this->loss_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        101, _Internal::loss_param(this), target, stream);
   }
 
   // optional .opencv_caffe.AccuracyParameter accuracy_param = 102;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        102, *this->accuracy_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        102, _Internal::accuracy_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ArgMaxParameter argmax_param = 103;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        103, *this->argmax_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        103, _Internal::argmax_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ConcatParameter concat_param = 104;
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        104, *this->concat_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        104, _Internal::concat_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 105;
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        105, *this->contrastive_loss_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        105, _Internal::contrastive_loss_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ConvolutionParameter convolution_param = 106;
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        106, *this->convolution_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        106, _Internal::convolution_param(this), target, stream);
   }
 
   // optional .opencv_caffe.DataParameter data_param = 107;
   if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        107, *this->data_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        107, _Internal::data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.DropoutParameter dropout_param = 108;
   if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        108, *this->dropout_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        108, _Internal::dropout_param(this), target, stream);
   }
 
   // optional .opencv_caffe.DummyDataParameter dummy_data_param = 109;
   if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        109, *this->dummy_data_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        109, _Internal::dummy_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.EltwiseParameter eltwise_param = 110;
   if (cached_has_bits & 0x00001000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        110, *this->eltwise_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        110, _Internal::eltwise_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ExpParameter exp_param = 111;
   if (cached_has_bits & 0x00002000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        111, *this->exp_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        111, _Internal::exp_param(this), target, stream);
   }
 
   // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 112;
   if (cached_has_bits & 0x00004000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        112, *this->hdf5_data_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        112, _Internal::hdf5_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 113;
   if (cached_has_bits & 0x00008000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        113, *this->hdf5_output_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        113, _Internal::hdf5_output_param(this), target, stream);
   }
 
   // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 114;
   if (cached_has_bits & 0x00010000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        114, *this->hinge_loss_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        114, _Internal::hinge_loss_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ImageDataParameter image_data_param = 115;
   if (cached_has_bits & 0x00020000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        115, *this->image_data_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        115, _Internal::image_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 116;
   if (cached_has_bits & 0x00040000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        116, *this->infogain_loss_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        116, _Internal::infogain_loss_param(this), target, stream);
   }
 
   // optional .opencv_caffe.InnerProductParameter inner_product_param = 117;
   if (cached_has_bits & 0x00080000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        117, *this->inner_product_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        117, _Internal::inner_product_param(this), target, stream);
   }
 
   // optional .opencv_caffe.LRNParameter lrn_param = 118;
   if (cached_has_bits & 0x00100000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        118, *this->lrn_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        118, _Internal::lrn_param(this), target, stream);
   }
 
   // optional .opencv_caffe.MemoryDataParameter memory_data_param = 119;
   if (cached_has_bits & 0x00200000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        119, *this->memory_data_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        119, _Internal::memory_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.MVNParameter mvn_param = 120;
   if (cached_has_bits & 0x00400000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        120, *this->mvn_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        120, _Internal::mvn_param(this), target, stream);
   }
 
   // optional .opencv_caffe.PoolingParameter pooling_param = 121;
   if (cached_has_bits & 0x00800000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        121, *this->pooling_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        121, _Internal::pooling_param(this), target, stream);
   }
 
   // optional .opencv_caffe.PowerParameter power_param = 122;
   if (cached_has_bits & 0x01000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        122, *this->power_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        122, _Internal::power_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ReLUParameter relu_param = 123;
   if (cached_has_bits & 0x02000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        123, *this->relu_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        123, _Internal::relu_param(this), target, stream);
   }
 
   // optional .opencv_caffe.SigmoidParameter sigmoid_param = 124;
   if (cached_has_bits & 0x04000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        124, *this->sigmoid_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        124, _Internal::sigmoid_param(this), target, stream);
   }
 
   // optional .opencv_caffe.SoftmaxParameter softmax_param = 125;
   if (cached_has_bits & 0x08000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        125, *this->softmax_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        125, _Internal::softmax_param(this), target, stream);
   }
 
   // optional .opencv_caffe.SliceParameter slice_param = 126;
   if (cached_has_bits & 0x10000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        126, *this->slice_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        126, _Internal::slice_param(this), target, stream);
   }
 
   // optional .opencv_caffe.TanHParameter tanh_param = 127;
   if (cached_has_bits & 0x20000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        127, *this->tanh_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        127, _Internal::tanh_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ThresholdParameter threshold_param = 128;
   if (cached_has_bits & 0x40000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        128, *this->threshold_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        128, _Internal::threshold_param(this), target, stream);
   }
 
   // optional .opencv_caffe.WindowDataParameter window_data_param = 129;
   if (cached_has_bits & 0x80000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        129, *this->window_data_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        129, _Internal::window_data_param(this), target, stream);
   }
 
   cached_has_bits = _has_bits_[1];
   // optional .opencv_caffe.PythonParameter python_param = 130;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        130, *this->python_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        130, _Internal::python_param(this), target, stream);
   }
 
   // optional .opencv_caffe.PReLUParameter prelu_param = 131;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        131, *this->prelu_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        131, _Internal::prelu_param(this), target, stream);
   }
 
   // optional .opencv_caffe.SPPParameter spp_param = 132;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        132, *this->spp_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        132, _Internal::spp_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ReshapeParameter reshape_param = 133;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        133, *this->reshape_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        133, _Internal::reshape_param(this), target, stream);
   }
 
   // optional .opencv_caffe.LogParameter log_param = 134;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        134, *this->log_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        134, _Internal::log_param(this), target, stream);
   }
 
   // optional .opencv_caffe.FlattenParameter flatten_param = 135;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        135, *this->flatten_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        135, _Internal::flatten_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ReductionParameter reduction_param = 136;
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        136, *this->reduction_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        136, _Internal::reduction_param(this), target, stream);
   }
 
   // optional .opencv_caffe.EmbedParameter embed_param = 137;
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        137, *this->embed_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        137, _Internal::embed_param(this), target, stream);
   }
 
   // optional .opencv_caffe.TileParameter tile_param = 138;
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        138, *this->tile_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        138, _Internal::tile_param(this), target, stream);
   }
 
   // optional .opencv_caffe.BatchNormParameter batch_norm_param = 139;
   if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        139, *this->batch_norm_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        139, _Internal::batch_norm_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ELUParameter elu_param = 140;
   if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        140, *this->elu_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        140, _Internal::elu_param(this), target, stream);
   }
 
   // optional .opencv_caffe.BiasParameter bias_param = 141;
   if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        141, *this->bias_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        141, _Internal::bias_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ScaleParameter scale_param = 142;
   if (cached_has_bits & 0x00001000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        142, *this->scale_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        142, _Internal::scale_param(this), target, stream);
   }
 
   // optional .opencv_caffe.InputParameter input_param = 143;
   if (cached_has_bits & 0x00002000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        143, *this->input_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        143, _Internal::input_param(this), target, stream);
   }
 
   // optional .opencv_caffe.CropParameter crop_param = 144;
   if (cached_has_bits & 0x00004000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        144, *this->crop_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        144, _Internal::crop_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ParameterParameter parameter_param = 145;
   if (cached_has_bits & 0x00008000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        145, *this->parameter_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        145, _Internal::parameter_param(this), target, stream);
   }
 
   // optional .opencv_caffe.RecurrentParameter recurrent_param = 146;
   if (cached_has_bits & 0x00010000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        146, *this->recurrent_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        146, _Internal::recurrent_param(this), target, stream);
   }
 
   // optional .opencv_caffe.DetectionOutputParameter detection_output_param = 147;
   if (cached_has_bits & 0x00020000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        147, *this->detection_output_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        147, _Internal::detection_output_param(this), target, stream);
   }
 
   // optional .opencv_caffe.PermuteParameter permute_param = 148;
   if (cached_has_bits & 0x00040000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        148, *this->permute_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        148, _Internal::permute_param(this), target, stream);
   }
 
   // optional .opencv_caffe.NormalizeBBoxParameter norm_param = 149;
   if (cached_has_bits & 0x00080000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        149, *this->norm_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        149, _Internal::norm_param(this), target, stream);
   }
 
   // optional .opencv_caffe.PriorBoxParameter prior_box_param = 150;
   if (cached_has_bits & 0x00100000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        150, *this->prior_box_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        150, _Internal::prior_box_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ProposalParameter proposal_param = 201;
   if (cached_has_bits & 0x00200000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        201, *this->proposal_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        201, _Internal::proposal_param(this), target, stream);
   }
 
   // optional .opencv_caffe.PSROIPoolingParameter psroi_pooling_param = 10002;
   if (cached_has_bits & 0x00400000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        10002, *this->psroi_pooling_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        10002, _Internal::psroi_pooling_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ROIPoolingParameter roi_pooling_param = 8266711;
   if (cached_has_bits & 0x00800000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8266711, *this->roi_pooling_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        8266711, _Internal::roi_pooling_param(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.LayerParameter)
   return target;
@@ -15841,528 +13207,506 @@ size_t LayerParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.LayerParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated string bottom = 3;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->bottom_size());
-  for (int i = 0, n = this->bottom_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->bottom(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(bottom_.size());
+  for (int i = 0, n = bottom_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      bottom_.Get(i));
   }
 
   // repeated string top = 4;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->top_size());
-  for (int i = 0, n = this->top_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->top(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(top_.size());
+  for (int i = 0, n = top_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      top_.Get(i));
   }
 
   // repeated float loss_weight = 5;
   {
-    unsigned int count = static_cast<unsigned int>(this->loss_weight_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_loss_weight_size());
     size_t data_size = 4UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->loss_weight_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_loss_weight_size());
     total_size += data_size;
   }
 
   // repeated .opencv_caffe.ParamSpec param = 6;
-  {
-    unsigned int count = static_cast<unsigned int>(this->param_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->param(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_param_size();
+  for (const auto& msg : this->param_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_caffe.BlobProto blobs = 7;
-  {
-    unsigned int count = static_cast<unsigned int>(this->blobs_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->blobs(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_blobs_size();
+  for (const auto& msg : this->blobs_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_caffe.NetStateRule include = 8;
-  {
-    unsigned int count = static_cast<unsigned int>(this->include_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->include(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_include_size();
+  for (const auto& msg : this->include_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  // repeated .opencv_caffe.NetStateRule exclude = 9;
-  {
-    unsigned int count = static_cast<unsigned int>(this->exclude_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->exclude(static_cast<int>(i)));
-    }
+  // repeated .opencv_caffe.NetStateRule exclude = 9;
+  total_size += 1UL * this->_internal_exclude_size();
+  for (const auto& msg : this->exclude_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated bool propagate_down = 11;
   {
-    unsigned int count = static_cast<unsigned int>(this->propagate_down_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_propagate_down_size());
     size_t data_size = 1UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->propagate_down_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_propagate_down_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 255u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional string type = 2;
-    if (has_type()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_type());
     }
 
     // optional .opencv_caffe.TransformationParameter transform_param = 100;
-    if (has_transform_param()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->transform_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *transform_param_);
     }
 
     // optional .opencv_caffe.LossParameter loss_param = 101;
-    if (has_loss_param()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->loss_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *loss_param_);
     }
 
     // optional .opencv_caffe.AccuracyParameter accuracy_param = 102;
-    if (has_accuracy_param()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->accuracy_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *accuracy_param_);
     }
 
     // optional .opencv_caffe.ArgMaxParameter argmax_param = 103;
-    if (has_argmax_param()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->argmax_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *argmax_param_);
     }
 
     // optional .opencv_caffe.ConcatParameter concat_param = 104;
-    if (has_concat_param()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->concat_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *concat_param_);
     }
 
     // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 105;
-    if (has_contrastive_loss_param()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->contrastive_loss_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *contrastive_loss_param_);
     }
 
   }
-  if (_has_bits_[8 / 32] & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     // optional .opencv_caffe.ConvolutionParameter convolution_param = 106;
-    if (has_convolution_param()) {
+    if (cached_has_bits & 0x00000100u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->convolution_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *convolution_param_);
     }
 
     // optional .opencv_caffe.DataParameter data_param = 107;
-    if (has_data_param()) {
+    if (cached_has_bits & 0x00000200u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *data_param_);
     }
 
     // optional .opencv_caffe.DropoutParameter dropout_param = 108;
-    if (has_dropout_param()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->dropout_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *dropout_param_);
     }
 
     // optional .opencv_caffe.DummyDataParameter dummy_data_param = 109;
-    if (has_dummy_data_param()) {
+    if (cached_has_bits & 0x00000800u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->dummy_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *dummy_data_param_);
     }
 
     // optional .opencv_caffe.EltwiseParameter eltwise_param = 110;
-    if (has_eltwise_param()) {
+    if (cached_has_bits & 0x00001000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->eltwise_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *eltwise_param_);
     }
 
     // optional .opencv_caffe.ExpParameter exp_param = 111;
-    if (has_exp_param()) {
+    if (cached_has_bits & 0x00002000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->exp_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *exp_param_);
     }
 
     // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 112;
-    if (has_hdf5_data_param()) {
+    if (cached_has_bits & 0x00004000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->hdf5_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *hdf5_data_param_);
     }
 
     // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 113;
-    if (has_hdf5_output_param()) {
+    if (cached_has_bits & 0x00008000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->hdf5_output_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *hdf5_output_param_);
     }
 
   }
-  if (_has_bits_[16 / 32] & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 114;
-    if (has_hinge_loss_param()) {
+    if (cached_has_bits & 0x00010000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->hinge_loss_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *hinge_loss_param_);
     }
 
     // optional .opencv_caffe.ImageDataParameter image_data_param = 115;
-    if (has_image_data_param()) {
+    if (cached_has_bits & 0x00020000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->image_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *image_data_param_);
     }
 
     // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 116;
-    if (has_infogain_loss_param()) {
+    if (cached_has_bits & 0x00040000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->infogain_loss_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *infogain_loss_param_);
     }
 
     // optional .opencv_caffe.InnerProductParameter inner_product_param = 117;
-    if (has_inner_product_param()) {
+    if (cached_has_bits & 0x00080000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->inner_product_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *inner_product_param_);
     }
 
     // optional .opencv_caffe.LRNParameter lrn_param = 118;
-    if (has_lrn_param()) {
+    if (cached_has_bits & 0x00100000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->lrn_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *lrn_param_);
     }
 
     // optional .opencv_caffe.MemoryDataParameter memory_data_param = 119;
-    if (has_memory_data_param()) {
+    if (cached_has_bits & 0x00200000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->memory_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *memory_data_param_);
     }
 
     // optional .opencv_caffe.MVNParameter mvn_param = 120;
-    if (has_mvn_param()) {
+    if (cached_has_bits & 0x00400000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->mvn_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *mvn_param_);
     }
 
     // optional .opencv_caffe.PoolingParameter pooling_param = 121;
-    if (has_pooling_param()) {
+    if (cached_has_bits & 0x00800000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->pooling_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *pooling_param_);
     }
 
   }
-  if (_has_bits_[24 / 32] & 4278190080u) {
+  if (cached_has_bits & 0xff000000u) {
     // optional .opencv_caffe.PowerParameter power_param = 122;
-    if (has_power_param()) {
+    if (cached_has_bits & 0x01000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->power_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *power_param_);
     }
 
     // optional .opencv_caffe.ReLUParameter relu_param = 123;
-    if (has_relu_param()) {
+    if (cached_has_bits & 0x02000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->relu_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *relu_param_);
     }
 
     // optional .opencv_caffe.SigmoidParameter sigmoid_param = 124;
-    if (has_sigmoid_param()) {
+    if (cached_has_bits & 0x04000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->sigmoid_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *sigmoid_param_);
     }
 
     // optional .opencv_caffe.SoftmaxParameter softmax_param = 125;
-    if (has_softmax_param()) {
+    if (cached_has_bits & 0x08000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->softmax_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *softmax_param_);
     }
 
     // optional .opencv_caffe.SliceParameter slice_param = 126;
-    if (has_slice_param()) {
+    if (cached_has_bits & 0x10000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->slice_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *slice_param_);
     }
 
     // optional .opencv_caffe.TanHParameter tanh_param = 127;
-    if (has_tanh_param()) {
+    if (cached_has_bits & 0x20000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->tanh_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *tanh_param_);
     }
 
     // optional .opencv_caffe.ThresholdParameter threshold_param = 128;
-    if (has_threshold_param()) {
+    if (cached_has_bits & 0x40000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->threshold_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *threshold_param_);
     }
 
     // optional .opencv_caffe.WindowDataParameter window_data_param = 129;
-    if (has_window_data_param()) {
+    if (cached_has_bits & 0x80000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->window_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *window_data_param_);
     }
 
   }
-  if (_has_bits_[32 / 32] & 255u) {
+  cached_has_bits = _has_bits_[1];
+  if (cached_has_bits & 0x000000ffu) {
     // optional .opencv_caffe.PythonParameter python_param = 130;
-    if (has_python_param()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->python_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *python_param_);
     }
 
     // optional .opencv_caffe.PReLUParameter prelu_param = 131;
-    if (has_prelu_param()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->prelu_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *prelu_param_);
     }
 
     // optional .opencv_caffe.SPPParameter spp_param = 132;
-    if (has_spp_param()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->spp_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *spp_param_);
     }
 
     // optional .opencv_caffe.ReshapeParameter reshape_param = 133;
-    if (has_reshape_param()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->reshape_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *reshape_param_);
     }
 
     // optional .opencv_caffe.LogParameter log_param = 134;
-    if (has_log_param()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->log_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *log_param_);
     }
 
     // optional .opencv_caffe.FlattenParameter flatten_param = 135;
-    if (has_flatten_param()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->flatten_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *flatten_param_);
     }
 
     // optional .opencv_caffe.ReductionParameter reduction_param = 136;
-    if (has_reduction_param()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->reduction_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *reduction_param_);
     }
 
     // optional .opencv_caffe.EmbedParameter embed_param = 137;
-    if (has_embed_param()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->embed_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *embed_param_);
     }
 
   }
-  if (_has_bits_[40 / 32] & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     // optional .opencv_caffe.TileParameter tile_param = 138;
-    if (has_tile_param()) {
+    if (cached_has_bits & 0x00000100u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->tile_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *tile_param_);
     }
 
     // optional .opencv_caffe.BatchNormParameter batch_norm_param = 139;
-    if (has_batch_norm_param()) {
+    if (cached_has_bits & 0x00000200u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->batch_norm_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *batch_norm_param_);
     }
 
     // optional .opencv_caffe.ELUParameter elu_param = 140;
-    if (has_elu_param()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->elu_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *elu_param_);
     }
 
     // optional .opencv_caffe.BiasParameter bias_param = 141;
-    if (has_bias_param()) {
+    if (cached_has_bits & 0x00000800u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->bias_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *bias_param_);
     }
 
     // optional .opencv_caffe.ScaleParameter scale_param = 142;
-    if (has_scale_param()) {
+    if (cached_has_bits & 0x00001000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->scale_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *scale_param_);
     }
 
     // optional .opencv_caffe.InputParameter input_param = 143;
-    if (has_input_param()) {
+    if (cached_has_bits & 0x00002000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->input_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *input_param_);
     }
 
     // optional .opencv_caffe.CropParameter crop_param = 144;
-    if (has_crop_param()) {
+    if (cached_has_bits & 0x00004000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->crop_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *crop_param_);
     }
 
     // optional .opencv_caffe.ParameterParameter parameter_param = 145;
-    if (has_parameter_param()) {
+    if (cached_has_bits & 0x00008000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->parameter_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *parameter_param_);
     }
 
   }
-  if (_has_bits_[48 / 32] & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     // optional .opencv_caffe.RecurrentParameter recurrent_param = 146;
-    if (has_recurrent_param()) {
+    if (cached_has_bits & 0x00010000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->recurrent_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *recurrent_param_);
     }
 
     // optional .opencv_caffe.DetectionOutputParameter detection_output_param = 147;
-    if (has_detection_output_param()) {
+    if (cached_has_bits & 0x00020000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->detection_output_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *detection_output_param_);
     }
 
     // optional .opencv_caffe.PermuteParameter permute_param = 148;
-    if (has_permute_param()) {
+    if (cached_has_bits & 0x00040000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->permute_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *permute_param_);
     }
 
     // optional .opencv_caffe.NormalizeBBoxParameter norm_param = 149;
-    if (has_norm_param()) {
+    if (cached_has_bits & 0x00080000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->norm_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *norm_param_);
     }
 
     // optional .opencv_caffe.PriorBoxParameter prior_box_param = 150;
-    if (has_prior_box_param()) {
+    if (cached_has_bits & 0x00100000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->prior_box_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *prior_box_param_);
     }
 
     // optional .opencv_caffe.ProposalParameter proposal_param = 201;
-    if (has_proposal_param()) {
+    if (cached_has_bits & 0x00200000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->proposal_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *proposal_param_);
     }
 
     // optional .opencv_caffe.PSROIPoolingParameter psroi_pooling_param = 10002;
-    if (has_psroi_pooling_param()) {
+    if (cached_has_bits & 0x00400000u) {
       total_size += 3 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->psroi_pooling_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *psroi_pooling_param_);
     }
 
     // optional .opencv_caffe.ROIPoolingParameter roi_pooling_param = 8266711;
-    if (has_roi_pooling_param()) {
+    if (cached_has_bits & 0x00800000u) {
       total_size += 4 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->roi_pooling_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *roi_pooling_param_);
     }
 
   }
   // optional .opencv_caffe.Phase phase = 10;
-  if (has_phase()) {
+  if (cached_has_bits & 0x01000000u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_phase());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void LayerParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.LayerParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const LayerParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const LayerParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.LayerParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.LayerParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LayerParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    LayerParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LayerParameter::GetClassData() const { return &_class_data_; }
+
+void LayerParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<LayerParameter *>(to)->MergeFrom(
+      static_cast<const LayerParameter &>(from));
 }
 
+
 void LayerParameter::MergeFrom(const LayerParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.LayerParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   bottom_.MergeFrom(from.bottom_);
@@ -16374,201 +13718,193 @@ void LayerParameter::MergeFrom(const LayerParameter& from) {
   exclude_.MergeFrom(from.exclude_);
   propagate_down_.MergeFrom(from.propagate_down_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_type();
-      type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
+      _internal_set_type(from._internal_type());
     }
     if (cached_has_bits & 0x00000004u) {
-      mutable_transform_param()->::opencv_caffe::TransformationParameter::MergeFrom(from.transform_param());
+      _internal_mutable_transform_param()->::opencv_caffe::TransformationParameter::MergeFrom(from._internal_transform_param());
     }
     if (cached_has_bits & 0x00000008u) {
-      mutable_loss_param()->::opencv_caffe::LossParameter::MergeFrom(from.loss_param());
+      _internal_mutable_loss_param()->::opencv_caffe::LossParameter::MergeFrom(from._internal_loss_param());
     }
     if (cached_has_bits & 0x00000010u) {
-      mutable_accuracy_param()->::opencv_caffe::AccuracyParameter::MergeFrom(from.accuracy_param());
+      _internal_mutable_accuracy_param()->::opencv_caffe::AccuracyParameter::MergeFrom(from._internal_accuracy_param());
     }
     if (cached_has_bits & 0x00000020u) {
-      mutable_argmax_param()->::opencv_caffe::ArgMaxParameter::MergeFrom(from.argmax_param());
+      _internal_mutable_argmax_param()->::opencv_caffe::ArgMaxParameter::MergeFrom(from._internal_argmax_param());
     }
     if (cached_has_bits & 0x00000040u) {
-      mutable_concat_param()->::opencv_caffe::ConcatParameter::MergeFrom(from.concat_param());
+      _internal_mutable_concat_param()->::opencv_caffe::ConcatParameter::MergeFrom(from._internal_concat_param());
     }
     if (cached_has_bits & 0x00000080u) {
-      mutable_contrastive_loss_param()->::opencv_caffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param());
+      _internal_mutable_contrastive_loss_param()->::opencv_caffe::ContrastiveLossParameter::MergeFrom(from._internal_contrastive_loss_param());
     }
   }
-  if (cached_has_bits & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     if (cached_has_bits & 0x00000100u) {
-      mutable_convolution_param()->::opencv_caffe::ConvolutionParameter::MergeFrom(from.convolution_param());
+      _internal_mutable_convolution_param()->::opencv_caffe::ConvolutionParameter::MergeFrom(from._internal_convolution_param());
     }
     if (cached_has_bits & 0x00000200u) {
-      mutable_data_param()->::opencv_caffe::DataParameter::MergeFrom(from.data_param());
+      _internal_mutable_data_param()->::opencv_caffe::DataParameter::MergeFrom(from._internal_data_param());
     }
     if (cached_has_bits & 0x00000400u) {
-      mutable_dropout_param()->::opencv_caffe::DropoutParameter::MergeFrom(from.dropout_param());
+      _internal_mutable_dropout_param()->::opencv_caffe::DropoutParameter::MergeFrom(from._internal_dropout_param());
     }
     if (cached_has_bits & 0x00000800u) {
-      mutable_dummy_data_param()->::opencv_caffe::DummyDataParameter::MergeFrom(from.dummy_data_param());
+      _internal_mutable_dummy_data_param()->::opencv_caffe::DummyDataParameter::MergeFrom(from._internal_dummy_data_param());
     }
     if (cached_has_bits & 0x00001000u) {
-      mutable_eltwise_param()->::opencv_caffe::EltwiseParameter::MergeFrom(from.eltwise_param());
+      _internal_mutable_eltwise_param()->::opencv_caffe::EltwiseParameter::MergeFrom(from._internal_eltwise_param());
     }
     if (cached_has_bits & 0x00002000u) {
-      mutable_exp_param()->::opencv_caffe::ExpParameter::MergeFrom(from.exp_param());
+      _internal_mutable_exp_param()->::opencv_caffe::ExpParameter::MergeFrom(from._internal_exp_param());
     }
     if (cached_has_bits & 0x00004000u) {
-      mutable_hdf5_data_param()->::opencv_caffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param());
+      _internal_mutable_hdf5_data_param()->::opencv_caffe::HDF5DataParameter::MergeFrom(from._internal_hdf5_data_param());
     }
     if (cached_has_bits & 0x00008000u) {
-      mutable_hdf5_output_param()->::opencv_caffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param());
+      _internal_mutable_hdf5_output_param()->::opencv_caffe::HDF5OutputParameter::MergeFrom(from._internal_hdf5_output_param());
     }
   }
-  if (cached_has_bits & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     if (cached_has_bits & 0x00010000u) {
-      mutable_hinge_loss_param()->::opencv_caffe::HingeLossParameter::MergeFrom(from.hinge_loss_param());
+      _internal_mutable_hinge_loss_param()->::opencv_caffe::HingeLossParameter::MergeFrom(from._internal_hinge_loss_param());
     }
     if (cached_has_bits & 0x00020000u) {
-      mutable_image_data_param()->::opencv_caffe::ImageDataParameter::MergeFrom(from.image_data_param());
+      _internal_mutable_image_data_param()->::opencv_caffe::ImageDataParameter::MergeFrom(from._internal_image_data_param());
     }
     if (cached_has_bits & 0x00040000u) {
-      mutable_infogain_loss_param()->::opencv_caffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param());
+      _internal_mutable_infogain_loss_param()->::opencv_caffe::InfogainLossParameter::MergeFrom(from._internal_infogain_loss_param());
     }
     if (cached_has_bits & 0x00080000u) {
-      mutable_inner_product_param()->::opencv_caffe::InnerProductParameter::MergeFrom(from.inner_product_param());
+      _internal_mutable_inner_product_param()->::opencv_caffe::InnerProductParameter::MergeFrom(from._internal_inner_product_param());
     }
     if (cached_has_bits & 0x00100000u) {
-      mutable_lrn_param()->::opencv_caffe::LRNParameter::MergeFrom(from.lrn_param());
+      _internal_mutable_lrn_param()->::opencv_caffe::LRNParameter::MergeFrom(from._internal_lrn_param());
     }
     if (cached_has_bits & 0x00200000u) {
-      mutable_memory_data_param()->::opencv_caffe::MemoryDataParameter::MergeFrom(from.memory_data_param());
+      _internal_mutable_memory_data_param()->::opencv_caffe::MemoryDataParameter::MergeFrom(from._internal_memory_data_param());
     }
     if (cached_has_bits & 0x00400000u) {
-      mutable_mvn_param()->::opencv_caffe::MVNParameter::MergeFrom(from.mvn_param());
+      _internal_mutable_mvn_param()->::opencv_caffe::MVNParameter::MergeFrom(from._internal_mvn_param());
     }
     if (cached_has_bits & 0x00800000u) {
-      mutable_pooling_param()->::opencv_caffe::PoolingParameter::MergeFrom(from.pooling_param());
+      _internal_mutable_pooling_param()->::opencv_caffe::PoolingParameter::MergeFrom(from._internal_pooling_param());
     }
   }
-  if (cached_has_bits & 4278190080u) {
+  if (cached_has_bits & 0xff000000u) {
     if (cached_has_bits & 0x01000000u) {
-      mutable_power_param()->::opencv_caffe::PowerParameter::MergeFrom(from.power_param());
+      _internal_mutable_power_param()->::opencv_caffe::PowerParameter::MergeFrom(from._internal_power_param());
     }
     if (cached_has_bits & 0x02000000u) {
-      mutable_relu_param()->::opencv_caffe::ReLUParameter::MergeFrom(from.relu_param());
+      _internal_mutable_relu_param()->::opencv_caffe::ReLUParameter::MergeFrom(from._internal_relu_param());
     }
     if (cached_has_bits & 0x04000000u) {
-      mutable_sigmoid_param()->::opencv_caffe::SigmoidParameter::MergeFrom(from.sigmoid_param());
+      _internal_mutable_sigmoid_param()->::opencv_caffe::SigmoidParameter::MergeFrom(from._internal_sigmoid_param());
     }
     if (cached_has_bits & 0x08000000u) {
-      mutable_softmax_param()->::opencv_caffe::SoftmaxParameter::MergeFrom(from.softmax_param());
+      _internal_mutable_softmax_param()->::opencv_caffe::SoftmaxParameter::MergeFrom(from._internal_softmax_param());
     }
     if (cached_has_bits & 0x10000000u) {
-      mutable_slice_param()->::opencv_caffe::SliceParameter::MergeFrom(from.slice_param());
+      _internal_mutable_slice_param()->::opencv_caffe::SliceParameter::MergeFrom(from._internal_slice_param());
     }
     if (cached_has_bits & 0x20000000u) {
-      mutable_tanh_param()->::opencv_caffe::TanHParameter::MergeFrom(from.tanh_param());
+      _internal_mutable_tanh_param()->::opencv_caffe::TanHParameter::MergeFrom(from._internal_tanh_param());
     }
     if (cached_has_bits & 0x40000000u) {
-      mutable_threshold_param()->::opencv_caffe::ThresholdParameter::MergeFrom(from.threshold_param());
+      _internal_mutable_threshold_param()->::opencv_caffe::ThresholdParameter::MergeFrom(from._internal_threshold_param());
     }
     if (cached_has_bits & 0x80000000u) {
-      mutable_window_data_param()->::opencv_caffe::WindowDataParameter::MergeFrom(from.window_data_param());
+      _internal_mutable_window_data_param()->::opencv_caffe::WindowDataParameter::MergeFrom(from._internal_window_data_param());
     }
   }
   cached_has_bits = from._has_bits_[1];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_python_param()->::opencv_caffe::PythonParameter::MergeFrom(from.python_param());
+      _internal_mutable_python_param()->::opencv_caffe::PythonParameter::MergeFrom(from._internal_python_param());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_prelu_param()->::opencv_caffe::PReLUParameter::MergeFrom(from.prelu_param());
+      _internal_mutable_prelu_param()->::opencv_caffe::PReLUParameter::MergeFrom(from._internal_prelu_param());
     }
     if (cached_has_bits & 0x00000004u) {
-      mutable_spp_param()->::opencv_caffe::SPPParameter::MergeFrom(from.spp_param());
+      _internal_mutable_spp_param()->::opencv_caffe::SPPParameter::MergeFrom(from._internal_spp_param());
     }
     if (cached_has_bits & 0x00000008u) {
-      mutable_reshape_param()->::opencv_caffe::ReshapeParameter::MergeFrom(from.reshape_param());
+      _internal_mutable_reshape_param()->::opencv_caffe::ReshapeParameter::MergeFrom(from._internal_reshape_param());
     }
     if (cached_has_bits & 0x00000010u) {
-      mutable_log_param()->::opencv_caffe::LogParameter::MergeFrom(from.log_param());
+      _internal_mutable_log_param()->::opencv_caffe::LogParameter::MergeFrom(from._internal_log_param());
     }
     if (cached_has_bits & 0x00000020u) {
-      mutable_flatten_param()->::opencv_caffe::FlattenParameter::MergeFrom(from.flatten_param());
+      _internal_mutable_flatten_param()->::opencv_caffe::FlattenParameter::MergeFrom(from._internal_flatten_param());
     }
     if (cached_has_bits & 0x00000040u) {
-      mutable_reduction_param()->::opencv_caffe::ReductionParameter::MergeFrom(from.reduction_param());
+      _internal_mutable_reduction_param()->::opencv_caffe::ReductionParameter::MergeFrom(from._internal_reduction_param());
     }
     if (cached_has_bits & 0x00000080u) {
-      mutable_embed_param()->::opencv_caffe::EmbedParameter::MergeFrom(from.embed_param());
+      _internal_mutable_embed_param()->::opencv_caffe::EmbedParameter::MergeFrom(from._internal_embed_param());
     }
   }
-  if (cached_has_bits & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     if (cached_has_bits & 0x00000100u) {
-      mutable_tile_param()->::opencv_caffe::TileParameter::MergeFrom(from.tile_param());
+      _internal_mutable_tile_param()->::opencv_caffe::TileParameter::MergeFrom(from._internal_tile_param());
     }
     if (cached_has_bits & 0x00000200u) {
-      mutable_batch_norm_param()->::opencv_caffe::BatchNormParameter::MergeFrom(from.batch_norm_param());
+      _internal_mutable_batch_norm_param()->::opencv_caffe::BatchNormParameter::MergeFrom(from._internal_batch_norm_param());
     }
     if (cached_has_bits & 0x00000400u) {
-      mutable_elu_param()->::opencv_caffe::ELUParameter::MergeFrom(from.elu_param());
+      _internal_mutable_elu_param()->::opencv_caffe::ELUParameter::MergeFrom(from._internal_elu_param());
     }
     if (cached_has_bits & 0x00000800u) {
-      mutable_bias_param()->::opencv_caffe::BiasParameter::MergeFrom(from.bias_param());
+      _internal_mutable_bias_param()->::opencv_caffe::BiasParameter::MergeFrom(from._internal_bias_param());
     }
     if (cached_has_bits & 0x00001000u) {
-      mutable_scale_param()->::opencv_caffe::ScaleParameter::MergeFrom(from.scale_param());
+      _internal_mutable_scale_param()->::opencv_caffe::ScaleParameter::MergeFrom(from._internal_scale_param());
     }
     if (cached_has_bits & 0x00002000u) {
-      mutable_input_param()->::opencv_caffe::InputParameter::MergeFrom(from.input_param());
+      _internal_mutable_input_param()->::opencv_caffe::InputParameter::MergeFrom(from._internal_input_param());
     }
     if (cached_has_bits & 0x00004000u) {
-      mutable_crop_param()->::opencv_caffe::CropParameter::MergeFrom(from.crop_param());
+      _internal_mutable_crop_param()->::opencv_caffe::CropParameter::MergeFrom(from._internal_crop_param());
     }
     if (cached_has_bits & 0x00008000u) {
-      mutable_parameter_param()->::opencv_caffe::ParameterParameter::MergeFrom(from.parameter_param());
+      _internal_mutable_parameter_param()->::opencv_caffe::ParameterParameter::MergeFrom(from._internal_parameter_param());
     }
   }
-  if (cached_has_bits & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     if (cached_has_bits & 0x00010000u) {
-      mutable_recurrent_param()->::opencv_caffe::RecurrentParameter::MergeFrom(from.recurrent_param());
+      _internal_mutable_recurrent_param()->::opencv_caffe::RecurrentParameter::MergeFrom(from._internal_recurrent_param());
     }
     if (cached_has_bits & 0x00020000u) {
-      mutable_detection_output_param()->::opencv_caffe::DetectionOutputParameter::MergeFrom(from.detection_output_param());
+      _internal_mutable_detection_output_param()->::opencv_caffe::DetectionOutputParameter::MergeFrom(from._internal_detection_output_param());
     }
     if (cached_has_bits & 0x00040000u) {
-      mutable_permute_param()->::opencv_caffe::PermuteParameter::MergeFrom(from.permute_param());
+      _internal_mutable_permute_param()->::opencv_caffe::PermuteParameter::MergeFrom(from._internal_permute_param());
     }
     if (cached_has_bits & 0x00080000u) {
-      mutable_norm_param()->::opencv_caffe::NormalizeBBoxParameter::MergeFrom(from.norm_param());
+      _internal_mutable_norm_param()->::opencv_caffe::NormalizeBBoxParameter::MergeFrom(from._internal_norm_param());
     }
     if (cached_has_bits & 0x00100000u) {
-      mutable_prior_box_param()->::opencv_caffe::PriorBoxParameter::MergeFrom(from.prior_box_param());
+      _internal_mutable_prior_box_param()->::opencv_caffe::PriorBoxParameter::MergeFrom(from._internal_prior_box_param());
     }
     if (cached_has_bits & 0x00200000u) {
-      mutable_proposal_param()->::opencv_caffe::ProposalParameter::MergeFrom(from.proposal_param());
+      _internal_mutable_proposal_param()->::opencv_caffe::ProposalParameter::MergeFrom(from._internal_proposal_param());
     }
     if (cached_has_bits & 0x00400000u) {
-      mutable_psroi_pooling_param()->::opencv_caffe::PSROIPoolingParameter::MergeFrom(from.psroi_pooling_param());
+      _internal_mutable_psroi_pooling_param()->::opencv_caffe::PSROIPoolingParameter::MergeFrom(from._internal_psroi_pooling_param());
     }
     if (cached_has_bits & 0x00800000u) {
-      mutable_roi_pooling_param()->::opencv_caffe::ROIPoolingParameter::MergeFrom(from.roi_pooling_param());
+      _internal_mutable_roi_pooling_param()->::opencv_caffe::ROIPoolingParameter::MergeFrom(from._internal_roi_pooling_param());
     }
   }
   if (cached_has_bits & 0x01000000u) {
-    set_phase(from.phase());
+    _internal_set_phase(from._internal_phase());
   }
-}
-
-void LayerParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.LayerParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void LayerParameter::CopyFrom(const LayerParameter& from) {
@@ -16579,18 +13915,19 @@ void LayerParameter::CopyFrom(const LayerParameter& from) {
 }
 
 bool LayerParameter::IsInitialized() const {
-  if (has_psroi_pooling_param()) {
-    if (!this->psroi_pooling_param_->IsInitialized()) return false;
+  if (_internal_has_psroi_pooling_param()) {
+    if (!psroi_pooling_param_->IsInitialized()) return false;
   }
   return true;
 }
 
-void LayerParameter::Swap(LayerParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void LayerParameter::InternalSwap(LayerParameter* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  swap(_has_bits_[1], other->_has_bits_[1]);
   bottom_.InternalSwap(&other->bottom_);
   top_.InternalSwap(&other->top_);
   loss_weight_.InternalSwap(&other->loss_weight_);
@@ -16599,107 +13936,77 @@ void LayerParameter::InternalSwap(LayerParameter* other) {
   include_.InternalSwap(&other->include_);
   exclude_.InternalSwap(&other->exclude_);
   propagate_down_.InternalSwap(&other->propagate_down_);
-  name_.Swap(&other->name_);
-  type_.Swap(&other->type_);
-  swap(transform_param_, other->transform_param_);
-  swap(loss_param_, other->loss_param_);
-  swap(accuracy_param_, other->accuracy_param_);
-  swap(argmax_param_, other->argmax_param_);
-  swap(concat_param_, other->concat_param_);
-  swap(contrastive_loss_param_, other->contrastive_loss_param_);
-  swap(convolution_param_, other->convolution_param_);
-  swap(data_param_, other->data_param_);
-  swap(dropout_param_, other->dropout_param_);
-  swap(dummy_data_param_, other->dummy_data_param_);
-  swap(eltwise_param_, other->eltwise_param_);
-  swap(exp_param_, other->exp_param_);
-  swap(hdf5_data_param_, other->hdf5_data_param_);
-  swap(hdf5_output_param_, other->hdf5_output_param_);
-  swap(hinge_loss_param_, other->hinge_loss_param_);
-  swap(image_data_param_, other->image_data_param_);
-  swap(infogain_loss_param_, other->infogain_loss_param_);
-  swap(inner_product_param_, other->inner_product_param_);
-  swap(lrn_param_, other->lrn_param_);
-  swap(memory_data_param_, other->memory_data_param_);
-  swap(mvn_param_, other->mvn_param_);
-  swap(pooling_param_, other->pooling_param_);
-  swap(power_param_, other->power_param_);
-  swap(relu_param_, other->relu_param_);
-  swap(sigmoid_param_, other->sigmoid_param_);
-  swap(softmax_param_, other->softmax_param_);
-  swap(slice_param_, other->slice_param_);
-  swap(tanh_param_, other->tanh_param_);
-  swap(threshold_param_, other->threshold_param_);
-  swap(window_data_param_, other->window_data_param_);
-  swap(python_param_, other->python_param_);
-  swap(prelu_param_, other->prelu_param_);
-  swap(spp_param_, other->spp_param_);
-  swap(reshape_param_, other->reshape_param_);
-  swap(log_param_, other->log_param_);
-  swap(flatten_param_, other->flatten_param_);
-  swap(reduction_param_, other->reduction_param_);
-  swap(embed_param_, other->embed_param_);
-  swap(tile_param_, other->tile_param_);
-  swap(batch_norm_param_, other->batch_norm_param_);
-  swap(elu_param_, other->elu_param_);
-  swap(bias_param_, other->bias_param_);
-  swap(scale_param_, other->scale_param_);
-  swap(input_param_, other->input_param_);
-  swap(crop_param_, other->crop_param_);
-  swap(parameter_param_, other->parameter_param_);
-  swap(recurrent_param_, other->recurrent_param_);
-  swap(detection_output_param_, other->detection_output_param_);
-  swap(permute_param_, other->permute_param_);
-  swap(norm_param_, other->norm_param_);
-  swap(prior_box_param_, other->prior_box_param_);
-  swap(proposal_param_, other->proposal_param_);
-  swap(psroi_pooling_param_, other->psroi_pooling_param_);
-  swap(roi_pooling_param_, other->roi_pooling_param_);
-  swap(phase_, other->phase_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  swap(_has_bits_[1], other->_has_bits_[1]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata LayerParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &type_, lhs_arena,
+      &other->type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(LayerParameter, phase_)
+      + sizeof(LayerParameter::phase_)
+      - PROTOBUF_FIELD_OFFSET(LayerParameter, transform_param_)>(
+          reinterpret_cast<char*>(&transform_param_),
+          reinterpret_cast<char*>(&other->transform_param_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata LayerParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[15]);
 }
 
-
 // ===================================================================
 
-void TransformationParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TransformationParameter::kScaleFieldNumber;
-const int TransformationParameter::kMirrorFieldNumber;
-const int TransformationParameter::kCropSizeFieldNumber;
-const int TransformationParameter::kMeanFileFieldNumber;
-const int TransformationParameter::kMeanValueFieldNumber;
-const int TransformationParameter::kForceColorFieldNumber;
-const int TransformationParameter::kForceGrayFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TransformationParameter::TransformationParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTransformationParameter();
+class TransformationParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<TransformationParameter>()._has_bits_);
+  static void set_has_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_mirror(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_crop_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_mean_file(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_force_color(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_force_gray(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+};
+
+TransformationParameter::TransformationParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  mean_value_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.TransformationParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.TransformationParameter)
 }
 TransformationParameter::TransformationParameter(const TransformationParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       mean_value_(from.mean_value_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_mean_file()) {
-    mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  mean_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_mean_file()) {
+    mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_mean_file(),
+      GetArenaForAllocation());
   }
   ::memcpy(&crop_size_, &from.crop_size_,
     static_cast<size_t>(reinterpret_cast<char*>(&scale_) -
@@ -16707,310 +14014,221 @@ TransformationParameter::TransformationParameter(const TransformationParameter&
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.TransformationParameter)
 }
 
-void TransformationParameter::SharedCtor() {
-  _cached_size_ = 0;
-  mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&crop_size_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&force_gray_) -
-      reinterpret_cast<char*>(&crop_size_)) + sizeof(force_gray_));
-  scale_ = 1;
+inline void TransformationParameter::SharedCtor() {
+mean_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&crop_size_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&force_gray_) -
+    reinterpret_cast<char*>(&crop_size_)) + sizeof(force_gray_));
+scale_ = 1;
 }
 
 TransformationParameter::~TransformationParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.TransformationParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TransformationParameter::SharedDtor() {
-  mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void TransformationParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  mean_file_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void TransformationParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void TransformationParameter::ArenaDtor(void* object) {
+  TransformationParameter* _this = reinterpret_cast< TransformationParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* TransformationParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const TransformationParameter& TransformationParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTransformationParameter();
-  return *internal_default_instance();
+void TransformationParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-TransformationParameter* TransformationParameter::New(::google::protobuf::Arena* arena) const {
-  TransformationParameter* n = new TransformationParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TransformationParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TransformationParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.TransformationParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   mean_value_.Clear();
   cached_has_bits = _has_bits_[0];
   if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(!mean_file_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*mean_file_.UnsafeRawStringPointer())->clear();
+    mean_file_.ClearNonDefaultToEmpty();
   }
-  if (cached_has_bits & 62u) {
+  if (cached_has_bits & 0x0000003eu) {
     ::memset(&crop_size_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&force_gray_) -
         reinterpret_cast<char*>(&crop_size_)) + sizeof(force_gray_));
     scale_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TransformationParameter::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:opencv_caffe.TransformationParameter)
-  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 float scale = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* TransformationParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float scale = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_scale(&has_bits);
+          scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool mirror = 2 [default = false];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_mirror();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &mirror_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_mirror(&has_bits);
+          mirror_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 crop_size = 3 [default = 0];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_crop_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &crop_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_crop_size(&has_bits);
+          crop_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string mean_file = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_mean_file()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.TransformationParameter.mean_file");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_mean_file();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.TransformationParameter.mean_file");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated float mean_value = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 45u, input, this->mutable_mean_value())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_mean_value())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_mean_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<45>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 42) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_mean_value(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool force_color = 6 [default = false];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_force_color();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &force_color_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_force_color(&has_bits);
+          force_color_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool force_gray = 7 [default = false];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_force_gray();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &force_gray_)));
-        } 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:opencv_caffe.TransformationParameter)
-  return true;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_force_gray(&has_bits);
+          force_gray_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.TransformationParameter)
-  return false;
-#undef DO_
-}
-
-void TransformationParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.TransformationParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float scale = 1 [default = 1];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->scale(), output);
-  }
-
-  // optional bool mirror = 2 [default = false];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->mirror(), output);
-  }
-
-  // optional uint32 crop_size = 3 [default = 0];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->crop_size(), output);
-  }
-
-  // optional string mean_file = 4;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.TransformationParameter.mean_file");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->mean_file(), output);
-  }
-
-  // repeated float mean_value = 5;
-  for (int i = 0, n = this->mean_value_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      5, this->mean_value(i), output);
-  }
-
-  // optional bool force_color = 6 [default = false];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->force_color(), output);
-  }
-
-  // optional bool force_gray = 7 [default = false];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->force_gray(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.TransformationParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TransformationParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TransformationParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.TransformationParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float scale = 1 [default = 1];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_scale(), target);
   }
 
   // optional bool mirror = 2 [default = false];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->mirror(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_mirror(), target);
   }
 
   // optional uint32 crop_size = 3 [default = 0];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->crop_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_crop_size(), target);
   }
 
   // optional string mean_file = 4;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_mean_file().data(), static_cast<int>(this->_internal_mean_file().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.TransformationParameter.mean_file");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->mean_file(), target);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_mean_file(), target);
   }
 
   // repeated float mean_value = 5;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(5, this->mean_value_, target);
+  for (int i = 0, n = this->_internal_mean_value_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->_internal_mean_value(i), target);
+  }
 
   // optional bool force_color = 6 [default = false];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->force_color(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_force_color(), target);
   }
 
   // optional bool force_gray = 7 [default = false];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->force_gray(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_force_gray(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.TransformationParameter)
   return target;
@@ -17020,91 +14238,81 @@ size_t TransformationParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.TransformationParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated float mean_value = 5;
   {
-    unsigned int count = static_cast<unsigned int>(this->mean_value_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_mean_value_size());
     size_t data_size = 4UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->mean_value_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_mean_value_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 63u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000003fu) {
     // optional string mean_file = 4;
-    if (has_mean_file()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->mean_file());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_mean_file());
     }
 
     // optional uint32 crop_size = 3 [default = 0];
-    if (has_crop_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->crop_size());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_crop_size());
     }
 
     // optional bool mirror = 2 [default = false];
-    if (has_mirror()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 1;
     }
 
     // optional bool force_color = 6 [default = false];
-    if (has_force_color()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 1;
     }
 
     // optional bool force_gray = 7 [default = false];
-    if (has_force_gray()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 + 1;
     }
 
     // optional float scale = 1 [default = 1];
-    if (has_scale()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TransformationParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.TransformationParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TransformationParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TransformationParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.TransformationParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.TransformationParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TransformationParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TransformationParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TransformationParameter::GetClassData() const { return &_class_data_; }
+
+void TransformationParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TransformationParameter *>(to)->MergeFrom(
+      static_cast<const TransformationParameter &>(from));
 }
 
+
 void TransformationParameter::MergeFrom(const TransformationParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.TransformationParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   mean_value_.MergeFrom(from.mean_value_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_mean_file();
-      mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_);
+      _internal_set_mean_file(from._internal_mean_file());
     }
     if (cached_has_bits & 0x00000002u) {
       crop_size_ = from.crop_size_;
@@ -17123,13 +14331,7 @@ void TransformationParameter::MergeFrom(const TransformationParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void TransformationParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.TransformationParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TransformationParameter::CopyFrom(const TransformationParameter& from) {
@@ -17143,251 +14345,205 @@ bool TransformationParameter::IsInitialized() const {
   return true;
 }
 
-void TransformationParameter::Swap(TransformationParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TransformationParameter::InternalSwap(TransformationParameter* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   mean_value_.InternalSwap(&other->mean_value_);
-  mean_file_.Swap(&other->mean_file_);
-  swap(crop_size_, other->crop_size_);
-  swap(mirror_, other->mirror_);
-  swap(force_color_, other->force_color_);
-  swap(force_gray_, other->force_gray_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &mean_file_, lhs_arena,
+      &other->mean_file_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(TransformationParameter, force_gray_)
+      + sizeof(TransformationParameter::force_gray_)
+      - PROTOBUF_FIELD_OFFSET(TransformationParameter, crop_size_)>(
+          reinterpret_cast<char*>(&crop_size_),
+          reinterpret_cast<char*>(&other->crop_size_));
   swap(scale_, other->scale_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata TransformationParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TransformationParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[16]);
 }
 
-
 // ===================================================================
 
-void LossParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int LossParameter::kIgnoreLabelFieldNumber;
-const int LossParameter::kNormalizationFieldNumber;
-const int LossParameter::kNormalizeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-LossParameter::LossParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLossParameter();
+class LossParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<LossParameter>()._has_bits_);
+  static void set_has_ignore_label(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_normalization(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+  static void set_has_normalize(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+LossParameter::LossParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.LossParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.LossParameter)
 }
 LossParameter::LossParameter(const LossParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&ignore_label_, &from.ignore_label_,
     static_cast<size_t>(reinterpret_cast<char*>(&normalization_) -
     reinterpret_cast<char*>(&ignore_label_)) + sizeof(normalization_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.LossParameter)
 }
 
-void LossParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&ignore_label_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&normalize_) -
-      reinterpret_cast<char*>(&ignore_label_)) + sizeof(normalize_));
-  normalization_ = 1;
+inline void LossParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&ignore_label_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&normalize_) -
+    reinterpret_cast<char*>(&ignore_label_)) + sizeof(normalize_));
+normalization_ = 1;
 }
 
 LossParameter::~LossParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.LossParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void LossParameter::SharedDtor() {
+inline void LossParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void LossParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void LossParameter::ArenaDtor(void* object) {
+  LossParameter* _this = reinterpret_cast< LossParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* LossParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const LossParameter& LossParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLossParameter();
-  return *internal_default_instance();
+void LossParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-LossParameter* LossParameter::New(::google::protobuf::Arena* arena) const {
-  LossParameter* n = new LossParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void LossParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void LossParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.LossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     ::memset(&ignore_label_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&normalize_) -
         reinterpret_cast<char*>(&ignore_label_)) + sizeof(normalize_));
     normalization_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool LossParameter::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:opencv_caffe.LossParameter)
-  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 ignore_label = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_ignore_label();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &ignore_label_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* LossParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 ignore_label = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_ignore_label(&has_bits);
+          ignore_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool normalize = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_normalize();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &normalize_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_normalize(&has_bits);
+          normalize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::LossParameter_NormalizationMode_IsValid(value)) {
-            set_normalization(static_cast< ::opencv_caffe::LossParameter_NormalizationMode >(value));
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::LossParameter_NormalizationMode_IsValid(val))) {
+            _internal_set_normalization(static_cast<::opencv_caffe::LossParameter_NormalizationMode>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                3, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
           }
-        } 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:opencv_caffe.LossParameter)
-  return true;
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.LossParameter)
-  return false;
-#undef DO_
-}
-
-void LossParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.LossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 ignore_label = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ignore_label(), output);
-  }
-
-  // optional bool normalize = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->normalize(), output);
-  }
-
-  // optional .opencv_caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      3, this->normalization(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.LossParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* LossParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* LossParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.LossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int32 ignore_label = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ignore_label(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_ignore_label(), target);
   }
 
   // optional bool normalize = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->normalize(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_normalize(), target);
   }
 
   // optional .opencv_caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      3, this->normalization(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      3, this->_internal_normalization(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.LossParameter)
   return target;
@@ -17397,62 +14553,53 @@ size_t LossParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.LossParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional int32 ignore_label = 1;
-    if (has_ignore_label()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->ignore_label());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_ignore_label());
     }
 
     // optional bool normalize = 2;
-    if (has_normalize()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
     // optional .opencv_caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID];
-    if (has_normalization()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->normalization());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_normalization());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void LossParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.LossParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const LossParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const LossParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.LossParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.LossParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LossParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    LossParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LossParameter::GetClassData() const { return &_class_data_; }
+
+void LossParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<LossParameter *>(to)->MergeFrom(
+      static_cast<const LossParameter &>(from));
 }
 
+
 void LossParameter::MergeFrom(const LossParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.LossParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       ignore_label_ = from.ignore_label_;
     }
@@ -17464,13 +14611,7 @@ void LossParameter::MergeFrom(const LossParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void LossParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.LossParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void LossParameter::CopyFrom(const LossParameter& from) {
@@ -17484,237 +14625,189 @@ bool LossParameter::IsInitialized() const {
   return true;
 }
 
-void LossParameter::Swap(LossParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void LossParameter::InternalSwap(LossParameter* other) {
   using std::swap;
-  swap(ignore_label_, other->ignore_label_);
-  swap(normalize_, other->normalize_);
-  swap(normalization_, other->normalization_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(LossParameter, normalize_)
+      + sizeof(LossParameter::normalize_)
+      - PROTOBUF_FIELD_OFFSET(LossParameter, ignore_label_)>(
+          reinterpret_cast<char*>(&ignore_label_),
+          reinterpret_cast<char*>(&other->ignore_label_));
+  swap(normalization_, other->normalization_);
 }
 
-::google::protobuf::Metadata LossParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata LossParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[17]);
 }
 
-
 // ===================================================================
 
-void AccuracyParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int AccuracyParameter::kTopKFieldNumber;
-const int AccuracyParameter::kAxisFieldNumber;
-const int AccuracyParameter::kIgnoreLabelFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-AccuracyParameter::AccuracyParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsAccuracyParameter();
+class AccuracyParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<AccuracyParameter>()._has_bits_);
+  static void set_has_top_k(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_ignore_label(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+AccuracyParameter::AccuracyParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.AccuracyParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.AccuracyParameter)
 }
 AccuracyParameter::AccuracyParameter(const AccuracyParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&ignore_label_, &from.ignore_label_,
     static_cast<size_t>(reinterpret_cast<char*>(&axis_) -
     reinterpret_cast<char*>(&ignore_label_)) + sizeof(axis_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.AccuracyParameter)
 }
 
-void AccuracyParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ignore_label_ = 0;
-  top_k_ = 1u;
-  axis_ = 1;
+inline void AccuracyParameter::SharedCtor() {
+ignore_label_ = 0;
+top_k_ = 1u;
+axis_ = 1;
 }
 
 AccuracyParameter::~AccuracyParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.AccuracyParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void AccuracyParameter::SharedDtor() {
+inline void AccuracyParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void AccuracyParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* AccuracyParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void AccuracyParameter::ArenaDtor(void* object) {
+  AccuracyParameter* _this = reinterpret_cast< AccuracyParameter* >(object);
+  (void)_this;
 }
-
-const AccuracyParameter& AccuracyParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsAccuracyParameter();
-  return *internal_default_instance();
+void AccuracyParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-AccuracyParameter* AccuracyParameter::New(::google::protobuf::Arena* arena) const {
-  AccuracyParameter* n = new AccuracyParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void AccuracyParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void AccuracyParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.AccuracyParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     ignore_label_ = 0;
     top_k_ = 1u;
     axis_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool AccuracyParameter::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:opencv_caffe.AccuracyParameter)
-  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 uint32 top_k = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_top_k();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &top_k_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* AccuracyParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 top_k = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_top_k(&has_bits);
+          top_k_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 axis = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 ignore_label = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_ignore_label();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &ignore_label_)));
-        } 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:opencv_caffe.AccuracyParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_ignore_label(&has_bits);
+          ignore_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.AccuracyParameter)
-  return false;
-#undef DO_
-}
-
-void AccuracyParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.AccuracyParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 top_k = 1 [default = 1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->top_k(), output);
-  }
-
-  // optional int32 axis = 2 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output);
-  }
-
-  // optional int32 ignore_label = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->ignore_label(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.AccuracyParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* AccuracyParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* AccuracyParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.AccuracyParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 top_k = 1 [default = 1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->top_k(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_top_k(), target);
   }
 
   // optional int32 axis = 2 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_axis(), target);
   }
 
   // optional int32 ignore_label = 3;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->ignore_label(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_ignore_label(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.AccuracyParameter)
   return target;
@@ -17724,65 +14817,52 @@ size_t AccuracyParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.AccuracyParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional int32 ignore_label = 3;
-    if (has_ignore_label()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->ignore_label());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_ignore_label());
     }
 
     // optional uint32 top_k = 1 [default = 1];
-    if (has_top_k()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->top_k());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_top_k());
     }
 
     // optional int32 axis = 2 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void AccuracyParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.AccuracyParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const AccuracyParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const AccuracyParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.AccuracyParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.AccuracyParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData AccuracyParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    AccuracyParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AccuracyParameter::GetClassData() const { return &_class_data_; }
+
+void AccuracyParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<AccuracyParameter *>(to)->MergeFrom(
+      static_cast<const AccuracyParameter &>(from));
 }
 
+
 void AccuracyParameter::MergeFrom(const AccuracyParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.AccuracyParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       ignore_label_ = from.ignore_label_;
     }
@@ -17794,13 +14874,7 @@ void AccuracyParameter::MergeFrom(const AccuracyParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void AccuracyParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.AccuracyParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void AccuracyParameter::CopyFrom(const AccuracyParameter& from) {
@@ -17814,239 +14888,188 @@ bool AccuracyParameter::IsInitialized() const {
   return true;
 }
 
-void AccuracyParameter::Swap(AccuracyParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void AccuracyParameter::InternalSwap(AccuracyParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(ignore_label_, other->ignore_label_);
   swap(top_k_, other->top_k_);
   swap(axis_, other->axis_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata AccuracyParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata AccuracyParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[18]);
 }
 
-
 // ===================================================================
 
-void ArgMaxParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ArgMaxParameter::kOutMaxValFieldNumber;
-const int ArgMaxParameter::kTopKFieldNumber;
-const int ArgMaxParameter::kAxisFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ArgMaxParameter::ArgMaxParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsArgMaxParameter();
+class ArgMaxParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ArgMaxParameter>()._has_bits_);
+  static void set_has_out_max_val(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_top_k(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+};
+
+ArgMaxParameter::ArgMaxParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ArgMaxParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ArgMaxParameter)
 }
 ArgMaxParameter::ArgMaxParameter(const ArgMaxParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&out_max_val_, &from.out_max_val_,
     static_cast<size_t>(reinterpret_cast<char*>(&top_k_) -
     reinterpret_cast<char*>(&out_max_val_)) + sizeof(top_k_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ArgMaxParameter)
 }
 
-void ArgMaxParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&out_max_val_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&axis_) -
-      reinterpret_cast<char*>(&out_max_val_)) + sizeof(axis_));
-  top_k_ = 1u;
+inline void ArgMaxParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&out_max_val_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&axis_) -
+    reinterpret_cast<char*>(&out_max_val_)) + sizeof(axis_));
+top_k_ = 1u;
 }
 
 ArgMaxParameter::~ArgMaxParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ArgMaxParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ArgMaxParameter::SharedDtor() {
+inline void ArgMaxParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ArgMaxParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ArgMaxParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ArgMaxParameter::ArenaDtor(void* object) {
+  ArgMaxParameter* _this = reinterpret_cast< ArgMaxParameter* >(object);
+  (void)_this;
 }
-
-const ArgMaxParameter& ArgMaxParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsArgMaxParameter();
-  return *internal_default_instance();
+void ArgMaxParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ArgMaxParameter* ArgMaxParameter::New(::google::protobuf::Arena* arena) const {
-  ArgMaxParameter* n = new ArgMaxParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ArgMaxParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ArgMaxParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ArgMaxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     ::memset(&out_max_val_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&axis_) -
         reinterpret_cast<char*>(&out_max_val_)) + sizeof(axis_));
     top_k_ = 1u;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ArgMaxParameter::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:opencv_caffe.ArgMaxParameter)
-  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 bool out_max_val = 1 [default = false];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_out_max_val();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &out_max_val_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* ArgMaxParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional bool out_max_val = 1 [default = false];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_out_max_val(&has_bits);
+          out_max_val_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 top_k = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_top_k();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &top_k_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_top_k(&has_bits);
+          top_k_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 axis = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } 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:opencv_caffe.ArgMaxParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ArgMaxParameter)
-  return false;
-#undef DO_
-}
-
-void ArgMaxParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ArgMaxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool out_max_val = 1 [default = false];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->out_max_val(), output);
-  }
-
-  // optional uint32 top_k = 2 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->top_k(), output);
-  }
-
-  // optional int32 axis = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->axis(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ArgMaxParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ArgMaxParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ArgMaxParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ArgMaxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional bool out_max_val = 1 [default = false];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->out_max_val(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_out_max_val(), target);
   }
 
   // optional uint32 top_k = 2 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->top_k(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_top_k(), target);
   }
 
   // optional int32 axis = 3;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_axis(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ArgMaxParameter)
   return target;
@@ -18056,63 +15079,52 @@ size_t ArgMaxParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ArgMaxParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional bool out_max_val = 1 [default = false];
-    if (has_out_max_val()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 1;
     }
 
     // optional int32 axis = 3;
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
     // optional uint32 top_k = 2 [default = 1];
-    if (has_top_k()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->top_k());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_top_k());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ArgMaxParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ArgMaxParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ArgMaxParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ArgMaxParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ArgMaxParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ArgMaxParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ArgMaxParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ArgMaxParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ArgMaxParameter::GetClassData() const { return &_class_data_; }
+
+void ArgMaxParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ArgMaxParameter *>(to)->MergeFrom(
+      static_cast<const ArgMaxParameter &>(from));
 }
 
+
 void ArgMaxParameter::MergeFrom(const ArgMaxParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ArgMaxParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       out_max_val_ = from.out_max_val_;
     }
@@ -18124,13 +15136,7 @@ void ArgMaxParameter::MergeFrom(const ArgMaxParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ArgMaxParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ArgMaxParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ArgMaxParameter::CopyFrom(const ArgMaxParameter& from) {
@@ -18144,210 +15150,169 @@ bool ArgMaxParameter::IsInitialized() const {
   return true;
 }
 
-void ArgMaxParameter::Swap(ArgMaxParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ArgMaxParameter::InternalSwap(ArgMaxParameter* other) {
   using std::swap;
-  swap(out_max_val_, other->out_max_val_);
-  swap(axis_, other->axis_);
-  swap(top_k_, other->top_k_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ArgMaxParameter, axis_)
+      + sizeof(ArgMaxParameter::axis_)
+      - PROTOBUF_FIELD_OFFSET(ArgMaxParameter, out_max_val_)>(
+          reinterpret_cast<char*>(&out_max_val_),
+          reinterpret_cast<char*>(&other->out_max_val_));
+  swap(top_k_, other->top_k_);
 }
 
-::google::protobuf::Metadata ArgMaxParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ArgMaxParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[19]);
 }
 
-
 // ===================================================================
 
-void ConcatParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ConcatParameter::kAxisFieldNumber;
-const int ConcatParameter::kConcatDimFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ConcatParameter::ConcatParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsConcatParameter();
+class ConcatParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ConcatParameter>()._has_bits_);
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+  static void set_has_concat_dim(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+ConcatParameter::ConcatParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ConcatParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ConcatParameter)
 }
 ConcatParameter::ConcatParameter(const ConcatParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&concat_dim_, &from.concat_dim_,
     static_cast<size_t>(reinterpret_cast<char*>(&axis_) -
     reinterpret_cast<char*>(&concat_dim_)) + sizeof(axis_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ConcatParameter)
 }
 
-void ConcatParameter::SharedCtor() {
-  _cached_size_ = 0;
-  concat_dim_ = 1u;
-  axis_ = 1;
+inline void ConcatParameter::SharedCtor() {
+concat_dim_ = 1u;
+axis_ = 1;
 }
 
 ConcatParameter::~ConcatParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ConcatParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ConcatParameter::SharedDtor() {
+inline void ConcatParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ConcatParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void ConcatParameter::ArenaDtor(void* object) {
+  ConcatParameter* _this = reinterpret_cast< ConcatParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* ConcatParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const ConcatParameter& ConcatParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsConcatParameter();
-  return *internal_default_instance();
+void ConcatParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ConcatParameter* ConcatParameter::New(::google::protobuf::Arena* arena) const {
-  ConcatParameter* n = new ConcatParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ConcatParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ConcatParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ConcatParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     concat_dim_ = 1u;
     axis_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ConcatParameter::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:opencv_caffe.ConcatParameter)
-  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 uint32 concat_dim = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_concat_dim();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &concat_dim_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* ConcatParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 concat_dim = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_concat_dim(&has_bits);
+          concat_dim_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 axis = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } 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:opencv_caffe.ConcatParameter)
-  return true;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ConcatParameter)
-  return false;
-#undef DO_
-}
-
-void ConcatParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ConcatParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 concat_dim = 1 [default = 1];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->concat_dim(), output);
-  }
-
-  // optional int32 axis = 2 [default = 1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ConcatParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ConcatParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ConcatParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ConcatParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 concat_dim = 1 [default = 1];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->concat_dim(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_concat_dim(), target);
   }
 
   // optional int32 axis = 2 [default = 1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_axis(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ConcatParameter)
   return target;
@@ -18357,58 +15322,47 @@ size_t ConcatParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ConcatParameter)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional uint32 concat_dim = 1 [default = 1];
-    if (has_concat_dim()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->concat_dim());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_concat_dim());
     }
 
     // optional int32 axis = 2 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ConcatParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ConcatParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ConcatParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ConcatParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ConcatParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ConcatParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ConcatParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ConcatParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ConcatParameter::GetClassData() const { return &_class_data_; }
+
+void ConcatParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ConcatParameter *>(to)->MergeFrom(
+      static_cast<const ConcatParameter &>(from));
 }
 
+
 void ConcatParameter::MergeFrom(const ConcatParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ConcatParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       concat_dim_ = from.concat_dim_;
     }
@@ -18417,13 +15371,7 @@ void ConcatParameter::MergeFrom(const ConcatParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ConcatParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ConcatParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ConcatParameter::CopyFrom(const ConcatParameter& from) {
@@ -18437,99 +15385,91 @@ bool ConcatParameter::IsInitialized() const {
   return true;
 }
 
-void ConcatParameter::Swap(ConcatParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ConcatParameter::InternalSwap(ConcatParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(concat_dim_, other->concat_dim_);
   swap(axis_, other->axis_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ConcatParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ConcatParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[20]);
 }
 
-
 // ===================================================================
 
-void BatchNormParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int BatchNormParameter::kUseGlobalStatsFieldNumber;
-const int BatchNormParameter::kMovingAverageFractionFieldNumber;
-const int BatchNormParameter::kEpsFieldNumber;
-const int BatchNormParameter::kScaleBiasFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-BatchNormParameter::BatchNormParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBatchNormParameter();
+class BatchNormParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<BatchNormParameter>()._has_bits_);
+  static void set_has_use_global_stats(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_moving_average_fraction(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_eps(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
+  static void set_has_scale_bias(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+BatchNormParameter::BatchNormParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.BatchNormParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.BatchNormParameter)
 }
 BatchNormParameter::BatchNormParameter(const BatchNormParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&use_global_stats_, &from.use_global_stats_,
     static_cast<size_t>(reinterpret_cast<char*>(&eps_) -
     reinterpret_cast<char*>(&use_global_stats_)) + sizeof(eps_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.BatchNormParameter)
 }
 
-void BatchNormParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&use_global_stats_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&scale_bias_) -
-      reinterpret_cast<char*>(&use_global_stats_)) + sizeof(scale_bias_));
-  moving_average_fraction_ = 0.999f;
-  eps_ = 1e-05f;
+inline void BatchNormParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&use_global_stats_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&scale_bias_) -
+    reinterpret_cast<char*>(&use_global_stats_)) + sizeof(scale_bias_));
+moving_average_fraction_ = 0.999f;
+eps_ = 1e-05f;
 }
 
 BatchNormParameter::~BatchNormParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.BatchNormParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void BatchNormParameter::SharedDtor() {
+inline void BatchNormParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void BatchNormParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* BatchNormParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void BatchNormParameter::ArenaDtor(void* object) {
+  BatchNormParameter* _this = reinterpret_cast< BatchNormParameter* >(object);
+  (void)_this;
 }
-
-const BatchNormParameter& BatchNormParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBatchNormParameter();
-  return *internal_default_instance();
+void BatchNormParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-BatchNormParameter* BatchNormParameter::New(::google::protobuf::Arena* arena) const {
-  BatchNormParameter* n = new BatchNormParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void BatchNormParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void BatchNormParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.BatchNormParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -18537,165 +15477,115 @@ void BatchNormParameter::Clear() {
       reinterpret_cast<char*>(&scale_bias_) -
       reinterpret_cast<char*>(&use_global_stats_)) + sizeof(scale_bias_));
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 12u) {
+  if (cached_has_bits & 0x0000000cu) {
     moving_average_fraction_ = 0.999f;
     eps_ = 1e-05f;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool BatchNormParameter::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:opencv_caffe.BatchNormParameter)
-  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 bool use_global_stats = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_use_global_stats();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &use_global_stats_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* BatchNormParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional bool use_global_stats = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_use_global_stats(&has_bits);
+          use_global_stats_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float moving_average_fraction = 2 [default = 0.999];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_moving_average_fraction();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &moving_average_fraction_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_moving_average_fraction(&has_bits);
+          moving_average_fraction_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float eps = 3 [default = 1e-05];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_eps();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &eps_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_eps(&has_bits);
+          eps_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool scale_bias = 7 [default = false];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_scale_bias();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &scale_bias_)));
-        } 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:opencv_caffe.BatchNormParameter)
-  return true;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_scale_bias(&has_bits);
+          scale_bias_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.BatchNormParameter)
-  return false;
-#undef DO_
-}
-
-void BatchNormParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.BatchNormParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool use_global_stats = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->use_global_stats(), output);
-  }
-
-  // optional float moving_average_fraction = 2 [default = 0.999];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->moving_average_fraction(), output);
-  }
-
-  // optional float eps = 3 [default = 1e-05];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->eps(), output);
-  }
-
-  // optional bool scale_bias = 7 [default = false];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->scale_bias(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.BatchNormParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* BatchNormParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* BatchNormParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.BatchNormParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional bool use_global_stats = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->use_global_stats(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_use_global_stats(), target);
   }
 
   // optional float moving_average_fraction = 2 [default = 0.999];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->moving_average_fraction(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_moving_average_fraction(), target);
   }
 
   // optional float eps = 3 [default = 1e-05];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->eps(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_eps(), target);
   }
 
   // optional bool scale_bias = 7 [default = false];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->scale_bias(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_scale_bias(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.BatchNormParameter)
   return target;
@@ -18705,64 +15595,57 @@ size_t BatchNormParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.BatchNormParameter)
   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] & 15u) {
+  uint32_t 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 & 0x0000000fu) {
     // optional bool use_global_stats = 1;
-    if (has_use_global_stats()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 1;
     }
 
     // optional bool scale_bias = 7 [default = false];
-    if (has_scale_bias()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
     // optional float moving_average_fraction = 2 [default = 0.999];
-    if (has_moving_average_fraction()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
     // optional float eps = 3 [default = 1e-05];
-    if (has_eps()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void BatchNormParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.BatchNormParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const BatchNormParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const BatchNormParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.BatchNormParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.BatchNormParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BatchNormParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    BatchNormParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BatchNormParameter::GetClassData() const { return &_class_data_; }
+
+void BatchNormParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<BatchNormParameter *>(to)->MergeFrom(
+      static_cast<const BatchNormParameter &>(from));
 }
 
+
 void BatchNormParameter::MergeFrom(const BatchNormParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.BatchNormParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
       use_global_stats_ = from.use_global_stats_;
     }
@@ -18777,13 +15660,7 @@ void BatchNormParameter::MergeFrom(const BatchNormParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void BatchNormParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.BatchNormParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void BatchNormParameter::CopyFrom(const BatchNormParameter& from) {
@@ -18797,57 +15674,64 @@ bool BatchNormParameter::IsInitialized() const {
   return true;
 }
 
-void BatchNormParameter::Swap(BatchNormParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void BatchNormParameter::InternalSwap(BatchNormParameter* other) {
   using std::swap;
-  swap(use_global_stats_, other->use_global_stats_);
-  swap(scale_bias_, other->scale_bias_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(BatchNormParameter, scale_bias_)
+      + sizeof(BatchNormParameter::scale_bias_)
+      - PROTOBUF_FIELD_OFFSET(BatchNormParameter, use_global_stats_)>(
+          reinterpret_cast<char*>(&use_global_stats_),
+          reinterpret_cast<char*>(&other->use_global_stats_));
   swap(moving_average_fraction_, other->moving_average_fraction_);
   swap(eps_, other->eps_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata BatchNormParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata BatchNormParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[21]);
 }
 
-
 // ===================================================================
 
-void BiasParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_BiasParameter_default_instance_._instance.get_mutable()->filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int BiasParameter::kAxisFieldNumber;
-const int BiasParameter::kNumAxesFieldNumber;
-const int BiasParameter::kFillerFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-BiasParameter::BiasParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBiasParameter();
+class BiasParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<BiasParameter>()._has_bits_);
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_num_axes(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+  static const ::opencv_caffe::FillerParameter& filler(const BiasParameter* msg);
+  static void set_has_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+const ::opencv_caffe::FillerParameter&
+BiasParameter::_Internal::filler(const BiasParameter* msg) {
+  return *msg->filler_;
+}
+BiasParameter::BiasParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.BiasParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.BiasParameter)
 }
 BiasParameter::BiasParameter(const BiasParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_filler()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_filler()) {
     filler_ = new ::opencv_caffe::FillerParameter(*from.filler_);
   } else {
-    filler_ = NULL;
+    filler_ = nullptr;
   }
   ::memcpy(&axis_, &from.axis_,
     static_cast<size_t>(reinterpret_cast<char*>(&num_axes_) -
@@ -18855,192 +15739,140 @@ BiasParameter::BiasParameter(const BiasParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.BiasParameter)
 }
 
-void BiasParameter::SharedCtor() {
-  _cached_size_ = 0;
-  filler_ = NULL;
-  axis_ = 1;
-  num_axes_ = 1;
+inline void BiasParameter::SharedCtor() {
+filler_ = nullptr;
+axis_ = 1;
+num_axes_ = 1;
 }
 
 BiasParameter::~BiasParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.BiasParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void BiasParameter::SharedDtor() {
+inline void BiasParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete filler_;
 }
 
-void BiasParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* BiasParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void BiasParameter::ArenaDtor(void* object) {
+  BiasParameter* _this = reinterpret_cast< BiasParameter* >(object);
+  (void)_this;
 }
-
-const BiasParameter& BiasParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBiasParameter();
-  return *internal_default_instance();
+void BiasParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-BiasParameter* BiasParameter::New(::google::protobuf::Arena* arena) const {
-  BiasParameter* n = new BiasParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void BiasParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void BiasParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.BiasParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(filler_ != NULL);
+      GOOGLE_DCHECK(filler_ != nullptr);
       filler_->Clear();
     }
     axis_ = 1;
     num_axes_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool BiasParameter::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:opencv_caffe.BiasParameter)
-  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 axis = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* BiasParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 axis = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 num_axes = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_num_axes();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &num_axes_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_num_axes(&has_bits);
+          num_axes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.FillerParameter filler = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_filler()));
-        } 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:opencv_caffe.BiasParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_filler(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.BiasParameter)
-  return false;
-#undef DO_
-}
-
-void BiasParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.BiasParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 axis = 1 [default = 1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output);
-  }
-
-  // optional int32 num_axes = 2 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_axes(), output);
-  }
-
-  // optional .opencv_caffe.FillerParameter filler = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->filler_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.BiasParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* BiasParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* BiasParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.BiasParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int32 axis = 1 [default = 1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_axis(), target);
   }
 
   // optional int32 num_axes = 2 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_axes(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_num_axes(), target);
   }
 
   // optional .opencv_caffe.FillerParameter filler = 3;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::filler(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.BiasParameter)
   return target;
@@ -19050,67 +15882,56 @@ size_t BiasParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.BiasParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional .opencv_caffe.FillerParameter filler = 3;
-    if (has_filler()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *filler_);
     }
 
     // optional int32 axis = 1 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
     // optional int32 num_axes = 2 [default = 1];
-    if (has_num_axes()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->num_axes());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_num_axes());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void BiasParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.BiasParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const BiasParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const BiasParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.BiasParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.BiasParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BiasParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    BiasParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BiasParameter::GetClassData() const { return &_class_data_; }
+
+void BiasParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<BiasParameter *>(to)->MergeFrom(
+      static_cast<const BiasParameter &>(from));
 }
 
+
 void BiasParameter::MergeFrom(const BiasParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.BiasParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.filler());
+      _internal_mutable_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_filler());
     }
     if (cached_has_bits & 0x00000002u) {
       axis_ = from.axis_;
@@ -19120,13 +15941,7 @@ void BiasParameter::MergeFrom(const BiasParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void BiasParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.BiasParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void BiasParameter::CopyFrom(const BiasParameter& from) {
@@ -19140,210 +15955,165 @@ bool BiasParameter::IsInitialized() const {
   return true;
 }
 
-void BiasParameter::Swap(BiasParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void BiasParameter::InternalSwap(BiasParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(filler_, other->filler_);
   swap(axis_, other->axis_);
   swap(num_axes_, other->num_axes_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata BiasParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata BiasParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[22]);
 }
 
-
 // ===================================================================
 
-void ContrastiveLossParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ContrastiveLossParameter::kMarginFieldNumber;
-const int ContrastiveLossParameter::kLegacyVersionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ContrastiveLossParameter::ContrastiveLossParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsContrastiveLossParameter();
+class ContrastiveLossParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ContrastiveLossParameter>()._has_bits_);
+  static void set_has_margin(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_legacy_version(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+ContrastiveLossParameter::ContrastiveLossParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ContrastiveLossParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ContrastiveLossParameter)
 }
 ContrastiveLossParameter::ContrastiveLossParameter(const ContrastiveLossParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&legacy_version_, &from.legacy_version_,
     static_cast<size_t>(reinterpret_cast<char*>(&margin_) -
     reinterpret_cast<char*>(&legacy_version_)) + sizeof(margin_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ContrastiveLossParameter)
 }
 
-void ContrastiveLossParameter::SharedCtor() {
-  _cached_size_ = 0;
-  legacy_version_ = false;
-  margin_ = 1;
+inline void ContrastiveLossParameter::SharedCtor() {
+legacy_version_ = false;
+margin_ = 1;
 }
 
 ContrastiveLossParameter::~ContrastiveLossParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ContrastiveLossParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ContrastiveLossParameter::SharedDtor() {
+inline void ContrastiveLossParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ContrastiveLossParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ContrastiveLossParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ContrastiveLossParameter::ArenaDtor(void* object) {
+  ContrastiveLossParameter* _this = reinterpret_cast< ContrastiveLossParameter* >(object);
+  (void)_this;
 }
-
-const ContrastiveLossParameter& ContrastiveLossParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsContrastiveLossParameter();
-  return *internal_default_instance();
+void ContrastiveLossParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ContrastiveLossParameter* ContrastiveLossParameter::New(::google::protobuf::Arena* arena) const {
-  ContrastiveLossParameter* n = new ContrastiveLossParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ContrastiveLossParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ContrastiveLossParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ContrastiveLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     legacy_version_ = false;
     margin_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ContrastiveLossParameter::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:opencv_caffe.ContrastiveLossParameter)
-  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 float margin = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_margin();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &margin_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* ContrastiveLossParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float margin = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_margin(&has_bits);
+          margin_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool legacy_version = 2 [default = false];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_legacy_version();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &legacy_version_)));
-        } 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:opencv_caffe.ContrastiveLossParameter)
-  return true;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_legacy_version(&has_bits);
+          legacy_version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ContrastiveLossParameter)
-  return false;
-#undef DO_
-}
-
-void ContrastiveLossParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ContrastiveLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float margin = 1 [default = 1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->margin(), output);
-  }
-
-  // optional bool legacy_version = 2 [default = false];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->legacy_version(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ContrastiveLossParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ContrastiveLossParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ContrastiveLossParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ContrastiveLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float margin = 1 [default = 1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->margin(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_margin(), target);
   }
 
   // optional bool legacy_version = 2 [default = false];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->legacy_version(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_legacy_version(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ContrastiveLossParameter)
   return target;
@@ -19353,54 +16123,47 @@ size_t ContrastiveLossParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ContrastiveLossParameter)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional bool legacy_version = 2 [default = false];
-    if (has_legacy_version()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 1;
     }
 
     // optional float margin = 1 [default = 1];
-    if (has_margin()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ContrastiveLossParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ContrastiveLossParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ContrastiveLossParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ContrastiveLossParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ContrastiveLossParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ContrastiveLossParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ContrastiveLossParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ContrastiveLossParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ContrastiveLossParameter::GetClassData() const { return &_class_data_; }
+
+void ContrastiveLossParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ContrastiveLossParameter *>(to)->MergeFrom(
+      static_cast<const ContrastiveLossParameter &>(from));
 }
 
+
 void ContrastiveLossParameter::MergeFrom(const ContrastiveLossParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ContrastiveLossParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       legacy_version_ = from.legacy_version_;
     }
@@ -19409,13 +16172,7 @@ void ContrastiveLossParameter::MergeFrom(const ContrastiveLossParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ContrastiveLossParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ContrastiveLossParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ContrastiveLossParameter::CopyFrom(const ContrastiveLossParameter& from) {
@@ -19429,81 +16186,109 @@ bool ContrastiveLossParameter::IsInitialized() const {
   return true;
 }
 
-void ContrastiveLossParameter::Swap(ContrastiveLossParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ContrastiveLossParameter::InternalSwap(ContrastiveLossParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(legacy_version_, other->legacy_version_);
   swap(margin_, other->margin_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ContrastiveLossParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ContrastiveLossParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[23]);
 }
 
-
 // ===================================================================
 
-void ConvolutionParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_ConvolutionParameter_default_instance_._instance.get_mutable()->weight_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-  ::opencv_caffe::_ConvolutionParameter_default_instance_._instance.get_mutable()->bias_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ConvolutionParameter::kNumOutputFieldNumber;
-const int ConvolutionParameter::kBiasTermFieldNumber;
-const int ConvolutionParameter::kPadFieldNumber;
-const int ConvolutionParameter::kKernelSizeFieldNumber;
-const int ConvolutionParameter::kStrideFieldNumber;
-const int ConvolutionParameter::kDilationFieldNumber;
-const int ConvolutionParameter::kPadHFieldNumber;
-const int ConvolutionParameter::kPadWFieldNumber;
-const int ConvolutionParameter::kKernelHFieldNumber;
-const int ConvolutionParameter::kKernelWFieldNumber;
-const int ConvolutionParameter::kStrideHFieldNumber;
-const int ConvolutionParameter::kStrideWFieldNumber;
-const int ConvolutionParameter::kGroupFieldNumber;
-const int ConvolutionParameter::kWeightFillerFieldNumber;
-const int ConvolutionParameter::kBiasFillerFieldNumber;
-const int ConvolutionParameter::kEngineFieldNumber;
-const int ConvolutionParameter::kAxisFieldNumber;
-const int ConvolutionParameter::kForceNdIm2ColFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ConvolutionParameter::ConvolutionParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsConvolutionParameter();
+class ConvolutionParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ConvolutionParameter>()._has_bits_);
+  static void set_has_num_output(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_bias_term(HasBits* has_bits) {
+    (*has_bits)[0] |= 4096u;
+  }
+  static void set_has_pad_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_pad_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_kernel_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_kernel_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_stride_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static void set_has_stride_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static void set_has_group(HasBits* has_bits) {
+    (*has_bits)[0] |= 8192u;
+  }
+  static const ::opencv_caffe::FillerParameter& weight_filler(const ConvolutionParameter* msg);
+  static void set_has_weight_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static const ::opencv_caffe::FillerParameter& bias_filler(const ConvolutionParameter* msg);
+  static void set_has_bias_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_engine(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
+  }
+  static void set_has_force_nd_im2col(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
   }
+};
+
+const ::opencv_caffe::FillerParameter&
+ConvolutionParameter::_Internal::weight_filler(const ConvolutionParameter* msg) {
+  return *msg->weight_filler_;
+}
+const ::opencv_caffe::FillerParameter&
+ConvolutionParameter::_Internal::bias_filler(const ConvolutionParameter* msg) {
+  return *msg->bias_filler_;
+}
+ConvolutionParameter::ConvolutionParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  pad_(arena),
+  kernel_size_(arena),
+  stride_(arena),
+  dilation_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ConvolutionParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ConvolutionParameter)
 }
 ConvolutionParameter::ConvolutionParameter(const ConvolutionParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       pad_(from.pad_),
       kernel_size_(from.kernel_size_),
       stride_(from.stride_),
       dilation_(from.dilation_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_weight_filler()) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_weight_filler()) {
     weight_filler_ = new ::opencv_caffe::FillerParameter(*from.weight_filler_);
   } else {
-    weight_filler_ = NULL;
+    weight_filler_ = nullptr;
   }
-  if (from.has_bias_filler()) {
+  if (from._internal_has_bias_filler()) {
     bias_filler_ = new ::opencv_caffe::FillerParameter(*from.bias_filler_);
   } else {
-    bias_filler_ = NULL;
+    bias_filler_ = nullptr;
   }
   ::memcpy(&num_output_, &from.num_output_,
     static_cast<size_t>(reinterpret_cast<char*>(&group_) -
@@ -19511,52 +16296,42 @@ ConvolutionParameter::ConvolutionParameter(const ConvolutionParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ConvolutionParameter)
 }
 
-void ConvolutionParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&weight_filler_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&force_nd_im2col_) -
-      reinterpret_cast<char*>(&weight_filler_)) + sizeof(force_nd_im2col_));
-  axis_ = 1;
-  bias_term_ = true;
-  group_ = 1u;
+inline void ConvolutionParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&weight_filler_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&force_nd_im2col_) -
+    reinterpret_cast<char*>(&weight_filler_)) + sizeof(force_nd_im2col_));
+axis_ = 1;
+bias_term_ = true;
+group_ = 1u;
 }
 
 ConvolutionParameter::~ConvolutionParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ConvolutionParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ConvolutionParameter::SharedDtor() {
+inline void ConvolutionParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete weight_filler_;
   if (this != internal_default_instance()) delete bias_filler_;
 }
 
-void ConvolutionParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void ConvolutionParameter::ArenaDtor(void* object) {
+  ConvolutionParameter* _this = reinterpret_cast< ConvolutionParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* ConvolutionParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ConvolutionParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const ConvolutionParameter& ConvolutionParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsConvolutionParameter();
-  return *internal_default_instance();
-}
-
-ConvolutionParameter* ConvolutionParameter::New(::google::protobuf::Arena* arena) const {
-  ConvolutionParameter* n = new ConvolutionParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ConvolutionParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ConvolutionParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ConvolutionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -19565,550 +16340,379 @@ void ConvolutionParameter::Clear() {
   stride_.Clear();
   dilation_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(weight_filler_ != NULL);
+      GOOGLE_DCHECK(weight_filler_ != nullptr);
       weight_filler_->Clear();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(bias_filler_ != NULL);
+      GOOGLE_DCHECK(bias_filler_ != nullptr);
       bias_filler_->Clear();
     }
   }
-  if (cached_has_bits & 252u) {
+  if (cached_has_bits & 0x000000fcu) {
     ::memset(&num_output_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&stride_h_) -
         reinterpret_cast<char*>(&num_output_)) + sizeof(stride_h_));
   }
-  if (cached_has_bits & 16128u) {
+  if (cached_has_bits & 0x00003f00u) {
     ::memset(&stride_w_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&force_nd_im2col_) -
-        reinterpret_cast<char*>(&stride_w_)) + sizeof(force_nd_im2col_));
-    axis_ = 1;
-    bias_term_ = true;
-    group_ = 1u;
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ConvolutionParameter::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:opencv_caffe.ConvolutionParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional uint32 num_output = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_num_output();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &num_output_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool bias_term = 2 [default = true];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_bias_term();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &bias_term_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated uint32 pad = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 24u, input, this->mutable_pad())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_pad())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated uint32 kernel_size = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 32u, input, this->mutable_kernel_size())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_kernel_size())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 group = 5 [default = 1];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_group();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &group_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated uint32 stride = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 48u, input, this->mutable_stride())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_stride())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.FillerParameter weight_filler = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_weight_filler()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.FillerParameter bias_filler = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_bias_filler()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 pad_h = 9 [default = 0];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
-          set_has_pad_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pad_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 pad_w = 10 [default = 0];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_pad_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pad_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 kernel_h = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
-          set_has_kernel_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &kernel_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 kernel_w = 12;
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) {
-          set_has_kernel_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &kernel_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 stride_h = 13;
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
-          set_has_stride_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &stride_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 stride_w = 14;
-      case 14: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(112u /* 112 & 0xFF */)) {
-          set_has_stride_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &stride_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT];
-      case 15: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(120u /* 120 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::ConvolutionParameter_Engine_IsValid(value)) {
-            set_engine(static_cast< ::opencv_caffe::ConvolutionParameter_Engine >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                15, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 axis = 16 [default = 1];
-      case 16: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool force_nd_im2col = 17 [default = false];
-      case 17: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) {
-          set_has_force_nd_im2col();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &force_nd_im2col_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated uint32 dilation = 18;
-      case 18: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(144u /* 144 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 2, 144u, input, this->mutable_dilation())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(146u /* 146 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_dilation())));
-        } 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:opencv_caffe.ConvolutionParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ConvolutionParameter)
-  return false;
-#undef DO_
-}
-
-void ConvolutionParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ConvolutionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 num_output = 1;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_output(), output);
-  }
-
-  // optional bool bias_term = 2 [default = true];
-  if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->bias_term(), output);
-  }
-
-  // repeated uint32 pad = 3;
-  for (int i = 0, n = this->pad_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      3, this->pad(i), output);
-  }
-
-  // repeated uint32 kernel_size = 4;
-  for (int i = 0, n = this->kernel_size_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      4, this->kernel_size(i), output);
-  }
-
-  // optional uint32 group = 5 [default = 1];
-  if (cached_has_bits & 0x00002000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->group(), output);
-  }
-
-  // repeated uint32 stride = 6;
-  for (int i = 0, n = this->stride_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      6, this->stride(i), output);
-  }
-
-  // optional .opencv_caffe.FillerParameter weight_filler = 7;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, *this->weight_filler_, output);
-  }
-
-  // optional .opencv_caffe.FillerParameter bias_filler = 8;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, *this->bias_filler_, output);
-  }
-
-  // optional uint32 pad_h = 9 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->pad_h(), output);
-  }
-
-  // optional uint32 pad_w = 10 [default = 0];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->pad_w(), output);
-  }
-
-  // optional uint32 kernel_h = 11;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->kernel_h(), output);
-  }
-
-  // optional uint32 kernel_w = 12;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(12, this->kernel_w(), output);
-  }
-
-  // optional uint32 stride_h = 13;
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(13, this->stride_h(), output);
-  }
-
-  // optional uint32 stride_w = 14;
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(14, this->stride_w(), output);
-  }
-
-  // optional .opencv_caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT];
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      15, this->engine(), output);
-  }
-
-  // optional int32 axis = 16 [default = 1];
-  if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->axis(), output);
-  }
-
-  // optional bool force_nd_im2col = 17 [default = false];
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->force_nd_im2col(), output);
-  }
-
-  // repeated uint32 dilation = 18;
-  for (int i = 0, n = this->dilation_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      18, this->dilation(i), output);
+        reinterpret_cast<char*>(&stride_w_)) + sizeof(force_nd_im2col_));
+    axis_ = 1;
+    bias_term_ = true;
+    group_ = 1u;
   }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ConvolutionParameter)
+const char* ConvolutionParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 num_output = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_num_output(&has_bits);
+          num_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool bias_term = 2 [default = true];
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_bias_term(&has_bits);
+          bias_term_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated uint32 pad = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_pad(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 26) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_pad(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated uint32 kernel_size = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_kernel_size(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<32>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 34) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_kernel_size(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 group = 5 [default = 1];
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_group(&has_bits);
+          group_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated uint32 stride = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_stride(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<48>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 50) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_stride(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.FillerParameter weight_filler = 7;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_weight_filler(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.FillerParameter bias_filler = 8;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ctx->ParseMessage(_internal_mutable_bias_filler(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 pad_h = 9 [default = 0];
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+          _Internal::set_has_pad_h(&has_bits);
+          pad_h_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 pad_w = 10 [default = 0];
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_pad_w(&has_bits);
+          pad_w_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 kernel_h = 11;
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
+          _Internal::set_has_kernel_h(&has_bits);
+          kernel_h_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 kernel_w = 12;
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
+          _Internal::set_has_kernel_w(&has_bits);
+          kernel_w_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 stride_h = 13;
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
+          _Internal::set_has_stride_h(&has_bits);
+          stride_h_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 stride_w = 14;
+      case 14:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
+          _Internal::set_has_stride_w(&has_bits);
+          stride_w_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT];
+      case 15:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::ConvolutionParameter_Engine_IsValid(val))) {
+            _internal_set_engine(static_cast<::opencv_caffe::ConvolutionParameter_Engine>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(15, val, mutable_unknown_fields());
+          }
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 axis = 16 [default = 1];
+      case 16:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool force_nd_im2col = 17 [default = false];
+      case 17:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
+          _Internal::set_has_force_nd_im2col(&has_bits);
+          force_nd_im2col_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated uint32 dilation = 18;
+      case 18:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            _internal_add_dilation(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<144>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 146) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_dilation(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ConvolutionParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ConvolutionParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ConvolutionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 num_output = 1;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_output(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_output(), target);
   }
 
   // optional bool bias_term = 2 [default = true];
   if (cached_has_bits & 0x00001000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->bias_term(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_bias_term(), target);
   }
 
   // repeated uint32 pad = 3;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(3, this->pad_, target);
+  for (int i = 0, n = this->_internal_pad_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_pad(i), target);
+  }
 
   // repeated uint32 kernel_size = 4;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(4, this->kernel_size_, target);
+  for (int i = 0, n = this->_internal_kernel_size_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_kernel_size(i), target);
+  }
 
   // optional uint32 group = 5 [default = 1];
   if (cached_has_bits & 0x00002000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->group(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_group(), target);
   }
 
   // repeated uint32 stride = 6;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(6, this->stride_, target);
+  for (int i = 0, n = this->_internal_stride_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_stride(i), target);
+  }
 
   // optional .opencv_caffe.FillerParameter weight_filler = 7;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, *this->weight_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        7, _Internal::weight_filler(this), target, stream);
   }
 
   // optional .opencv_caffe.FillerParameter bias_filler = 8;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, *this->bias_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        8, _Internal::bias_filler(this), target, stream);
   }
 
   // optional uint32 pad_h = 9 [default = 0];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->pad_h(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(9, this->_internal_pad_h(), target);
   }
 
   // optional uint32 pad_w = 10 [default = 0];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->pad_w(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->_internal_pad_w(), target);
   }
 
   // optional uint32 kernel_h = 11;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->kernel_h(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(11, this->_internal_kernel_h(), target);
   }
 
   // optional uint32 kernel_w = 12;
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(12, this->kernel_w(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(12, this->_internal_kernel_w(), target);
   }
 
   // optional uint32 stride_h = 13;
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(13, this->stride_h(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(13, this->_internal_stride_h(), target);
   }
 
   // optional uint32 stride_w = 14;
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(14, this->stride_w(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(14, this->_internal_stride_w(), target);
   }
 
   // optional .opencv_caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT];
   if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      15, this->engine(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      15, this->_internal_engine(), target);
   }
 
   // optional int32 axis = 16 [default = 1];
   if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(16, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(16, this->_internal_axis(), target);
   }
 
   // optional bool force_nd_im2col = 17 [default = false];
   if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->force_nd_im2col(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(17, this->_internal_force_nd_im2col(), target);
   }
 
   // repeated uint32 dilation = 18;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(18, this->dilation_, target);
+  for (int i = 0, n = this->_internal_dilation_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(18, this->_internal_dilation(i), target);
+  }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ConvolutionParameter)
   return target;
@@ -20118,171 +16722,148 @@ size_t ConvolutionParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ConvolutionParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated uint32 pad = 3;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->pad_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->pad_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_pad_size());
     total_size += data_size;
   }
 
   // repeated uint32 kernel_size = 4;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->kernel_size_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->kernel_size_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_kernel_size_size());
     total_size += data_size;
   }
 
   // repeated uint32 stride = 6;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->stride_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->stride_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_stride_size());
     total_size += data_size;
   }
 
   // repeated uint32 dilation = 18;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->dilation_);
     total_size += 2 *
-                  ::google::protobuf::internal::FromIntSize(this->dilation_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_dilation_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 255u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
     // optional .opencv_caffe.FillerParameter weight_filler = 7;
-    if (has_weight_filler()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->weight_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *weight_filler_);
     }
 
     // optional .opencv_caffe.FillerParameter bias_filler = 8;
-    if (has_bias_filler()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->bias_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *bias_filler_);
     }
 
     // optional uint32 num_output = 1;
-    if (has_num_output()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->num_output());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_num_output());
     }
 
     // optional uint32 pad_h = 9 [default = 0];
-    if (has_pad_h()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pad_h());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pad_h());
     }
 
     // optional uint32 pad_w = 10 [default = 0];
-    if (has_pad_w()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pad_w());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pad_w());
     }
 
     // optional uint32 kernel_h = 11;
-    if (has_kernel_h()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->kernel_h());
+    if (cached_has_bits & 0x00000020u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_kernel_h());
     }
 
     // optional uint32 kernel_w = 12;
-    if (has_kernel_w()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->kernel_w());
+    if (cached_has_bits & 0x00000040u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_kernel_w());
     }
 
     // optional uint32 stride_h = 13;
-    if (has_stride_h()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->stride_h());
+    if (cached_has_bits & 0x00000080u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_stride_h());
     }
 
   }
-  if (_has_bits_[8 / 32] & 16128u) {
+  if (cached_has_bits & 0x00003f00u) {
     // optional uint32 stride_w = 14;
-    if (has_stride_w()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->stride_w());
+    if (cached_has_bits & 0x00000100u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_stride_w());
     }
 
     // optional .opencv_caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT];
-    if (has_engine()) {
+    if (cached_has_bits & 0x00000200u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_engine());
     }
 
     // optional bool force_nd_im2col = 17 [default = false];
-    if (has_force_nd_im2col()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 2 + 1;
     }
 
     // optional int32 axis = 16 [default = 1];
-    if (has_axis()) {
+    if (cached_has_bits & 0x00000800u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+          this->_internal_axis());
     }
 
     // optional bool bias_term = 2 [default = true];
-    if (has_bias_term()) {
+    if (cached_has_bits & 0x00001000u) {
       total_size += 1 + 1;
     }
 
     // optional uint32 group = 5 [default = 1];
-    if (has_group()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->group());
+    if (cached_has_bits & 0x00002000u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_group());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ConvolutionParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ConvolutionParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ConvolutionParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ConvolutionParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ConvolutionParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ConvolutionParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ConvolutionParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ConvolutionParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ConvolutionParameter::GetClassData() const { return &_class_data_; }
+
+void ConvolutionParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ConvolutionParameter *>(to)->MergeFrom(
+      static_cast<const ConvolutionParameter &>(from));
 }
 
+
 void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ConvolutionParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   pad_.MergeFrom(from.pad_);
@@ -20290,12 +16871,12 @@ void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) {
   stride_.MergeFrom(from.stride_);
   dilation_.MergeFrom(from.dilation_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.weight_filler());
+      _internal_mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_weight_filler());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.bias_filler());
+      _internal_mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_bias_filler());
     }
     if (cached_has_bits & 0x00000004u) {
       num_output_ = from.num_output_;
@@ -20317,7 +16898,7 @@ void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 16128u) {
+  if (cached_has_bits & 0x00003f00u) {
     if (cached_has_bits & 0x00000100u) {
       stride_w_ = from.stride_w_;
     }
@@ -20338,13 +16919,7 @@ void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ConvolutionParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ConvolutionParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ConvolutionParameter::CopyFrom(const ConvolutionParameter& from) {
@@ -20358,225 +16933,175 @@ bool ConvolutionParameter::IsInitialized() const {
   return true;
 }
 
-void ConvolutionParameter::Swap(ConvolutionParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ConvolutionParameter::InternalSwap(ConvolutionParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   pad_.InternalSwap(&other->pad_);
   kernel_size_.InternalSwap(&other->kernel_size_);
   stride_.InternalSwap(&other->stride_);
   dilation_.InternalSwap(&other->dilation_);
-  swap(weight_filler_, other->weight_filler_);
-  swap(bias_filler_, other->bias_filler_);
-  swap(num_output_, other->num_output_);
-  swap(pad_h_, other->pad_h_);
-  swap(pad_w_, other->pad_w_);
-  swap(kernel_h_, other->kernel_h_);
-  swap(kernel_w_, other->kernel_w_);
-  swap(stride_h_, other->stride_h_);
-  swap(stride_w_, other->stride_w_);
-  swap(engine_, other->engine_);
-  swap(force_nd_im2col_, other->force_nd_im2col_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ConvolutionParameter, force_nd_im2col_)
+      + sizeof(ConvolutionParameter::force_nd_im2col_)
+      - PROTOBUF_FIELD_OFFSET(ConvolutionParameter, weight_filler_)>(
+          reinterpret_cast<char*>(&weight_filler_),
+          reinterpret_cast<char*>(&other->weight_filler_));
   swap(axis_, other->axis_);
   swap(bias_term_, other->bias_term_);
   swap(group_, other->group_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ConvolutionParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ConvolutionParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[24]);
 }
 
-
 // ===================================================================
 
-void CropParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int CropParameter::kAxisFieldNumber;
-const int CropParameter::kOffsetFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-CropParameter::CropParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsCropParameter();
+class CropParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<CropParameter>()._has_bits_);
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+CropParameter::CropParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  offset_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.CropParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.CropParameter)
 }
 CropParameter::CropParameter(const CropParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       offset_(from.offset_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   axis_ = from.axis_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.CropParameter)
 }
 
-void CropParameter::SharedCtor() {
-  _cached_size_ = 0;
-  axis_ = 2;
+inline void CropParameter::SharedCtor() {
+axis_ = 2;
 }
 
 CropParameter::~CropParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.CropParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void CropParameter::SharedDtor() {
+inline void CropParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void CropParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void CropParameter::ArenaDtor(void* object) {
+  CropParameter* _this = reinterpret_cast< CropParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* CropParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void CropParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const CropParameter& CropParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsCropParameter();
-  return *internal_default_instance();
-}
-
-CropParameter* CropParameter::New(::google::protobuf::Arena* arena) const {
-  CropParameter* n = new CropParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void CropParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void CropParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.CropParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   offset_.Clear();
   axis_ = 2;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool CropParameter::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:opencv_caffe.CropParameter)
-  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 axis = 1 [default = 2];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* CropParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 axis = 1 [default = 2];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated uint32 offset = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 16u, input, this->mutable_offset())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_offset())));
-        } 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:opencv_caffe.CropParameter)
-  return true;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_offset(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 18) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_offset(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.CropParameter)
-  return false;
-#undef DO_
-}
-
-void CropParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.CropParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 axis = 1 [default = 2];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output);
-  }
-
-  // repeated uint32 offset = 2;
-  for (int i = 0, n = this->offset_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      2, this->offset(i), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.CropParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* CropParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* CropParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.CropParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int32 axis = 1 [default = 2];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_axis(), target);
   }
 
   // repeated uint32 offset = 2;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(2, this->offset_, target);
+  for (int i = 0, n = this->_internal_offset_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_offset(i), target);
+  }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.CropParameter)
   return target;
@@ -20586,67 +17111,52 @@ size_t CropParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.CropParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated uint32 offset = 2;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->offset_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->offset_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_offset_size());
     total_size += data_size;
   }
 
   // optional int32 axis = 1 [default = 2];
-  if (has_axis()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->axis());
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void CropParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.CropParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const CropParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const CropParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.CropParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.CropParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CropParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    CropParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CropParameter::GetClassData() const { return &_class_data_; }
+
+void CropParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<CropParameter *>(to)->MergeFrom(
+      static_cast<const CropParameter &>(from));
 }
 
+
 void CropParameter::MergeFrom(const CropParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.CropParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   offset_.MergeFrom(from.offset_);
-  if (from.has_axis()) {
-    set_axis(from.axis());
+  if (from._internal_has_axis()) {
+    _internal_set_axis(from._internal_axis());
   }
-}
-
-void CropParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.CropParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void CropParameter::CopyFrom(const CropParameter& from) {
@@ -20660,63 +17170,85 @@ bool CropParameter::IsInitialized() const {
   return true;
 }
 
-void CropParameter::Swap(CropParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void CropParameter::InternalSwap(CropParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   offset_.InternalSwap(&other->offset_);
   swap(axis_, other->axis_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata CropParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata CropParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[25]);
 }
 
-
 // ===================================================================
 
-void DataParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int DataParameter::kSourceFieldNumber;
-const int DataParameter::kBatchSizeFieldNumber;
-const int DataParameter::kRandSkipFieldNumber;
-const int DataParameter::kBackendFieldNumber;
-const int DataParameter::kScaleFieldNumber;
-const int DataParameter::kMeanFileFieldNumber;
-const int DataParameter::kCropSizeFieldNumber;
-const int DataParameter::kMirrorFieldNumber;
-const int DataParameter::kForceEncodedColorFieldNumber;
-const int DataParameter::kPrefetchFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-DataParameter::DataParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDataParameter();
+class DataParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<DataParameter>()._has_bits_);
+  static void set_has_source(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_batch_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_rand_skip(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_backend(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static void set_has_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static void set_has_mean_file(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_crop_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_mirror(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_force_encoded_color(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
   }
+  static void set_has_prefetch(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+};
+
+DataParameter::DataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.DataParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.DataParameter)
 }
 DataParameter::DataParameter(const DataParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_source()) {
-    source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
-  }
-  mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_mean_file()) {
-    mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_source()) {
+    source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_source(),
+      GetArenaForAllocation());
+  }
+  mean_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_mean_file()) {
+    mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_mean_file(),
+      GetArenaForAllocation());
   }
   ::memcpy(&batch_size_, &from.batch_size_,
     static_cast<size_t>(reinterpret_cast<char*>(&prefetch_) -
@@ -20724,409 +17256,284 @@ DataParameter::DataParameter(const DataParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.DataParameter)
 }
 
-void DataParameter::SharedCtor() {
-  _cached_size_ = 0;
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&batch_size_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&backend_) -
-      reinterpret_cast<char*>(&batch_size_)) + sizeof(backend_));
-  scale_ = 1;
-  prefetch_ = 4u;
+inline void DataParameter::SharedCtor() {
+source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+mean_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&batch_size_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&backend_) -
+    reinterpret_cast<char*>(&batch_size_)) + sizeof(backend_));
+scale_ = 1;
+prefetch_ = 4u;
 }
 
 DataParameter::~DataParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.DataParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void DataParameter::SharedDtor() {
-  source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void DataParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  source_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  mean_file_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void DataParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* DataParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void DataParameter::ArenaDtor(void* object) {
+  DataParameter* _this = reinterpret_cast< DataParameter* >(object);
+  (void)_this;
 }
-
-const DataParameter& DataParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDataParameter();
-  return *internal_default_instance();
+void DataParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-DataParameter* DataParameter::New(::google::protobuf::Arena* arena) const {
-  DataParameter* n = new DataParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void DataParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void DataParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.DataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!source_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*source_.UnsafeRawStringPointer())->clear();
+      source_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!mean_file_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*mean_file_.UnsafeRawStringPointer())->clear();
+      mean_file_.ClearNonDefaultToEmpty();
     }
   }
-  if (cached_has_bits & 252u) {
+  if (cached_has_bits & 0x000000fcu) {
     ::memset(&batch_size_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&backend_) -
         reinterpret_cast<char*>(&batch_size_)) + sizeof(backend_));
   }
-  if (cached_has_bits & 768u) {
+  if (cached_has_bits & 0x00000300u) {
     scale_ = 1;
     prefetch_ = 4u;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool DataParameter::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:opencv_caffe.DataParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string source = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_source()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->source().data(), static_cast<int>(this->source().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.DataParameter.source");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* DataParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string source = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_source();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.DataParameter.source");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float scale = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_scale(&has_bits);
+          scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string mean_file = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_mean_file()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.DataParameter.mean_file");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_mean_file();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.DataParameter.mean_file");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 batch_size = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_batch_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &batch_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_batch_size(&has_bits);
+          batch_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 crop_size = 5 [default = 0];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_crop_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &crop_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_crop_size(&has_bits);
+          crop_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool mirror = 6 [default = false];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_mirror();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &mirror_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_mirror(&has_bits);
+          mirror_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 rand_skip = 7 [default = 0];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_rand_skip();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &rand_skip_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_rand_skip(&has_bits);
+          rand_skip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.DataParameter.DB backend = 8 [default = LEVELDB];
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::DataParameter_DB_IsValid(value)) {
-            set_backend(static_cast< ::opencv_caffe::DataParameter_DB >(value));
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::DataParameter_DB_IsValid(val))) {
+            _internal_set_backend(static_cast<::opencv_caffe::DataParameter_DB>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                8, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool force_encoded_color = 9 [default = false];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
-          set_has_force_encoded_color();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &force_encoded_color_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+          _Internal::set_has_force_encoded_color(&has_bits);
+          force_encoded_color_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 prefetch = 10 [default = 4];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_prefetch();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &prefetch_)));
-        } 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:opencv_caffe.DataParameter)
-  return true;
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_prefetch(&has_bits);
+          prefetch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.DataParameter)
-  return false;
-#undef DO_
-}
-
-void DataParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.DataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string source = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.DataParameter.source");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->source(), output);
-  }
-
-  // optional float scale = 2 [default = 1];
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output);
-  }
-
-  // optional string mean_file = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.DataParameter.mean_file");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->mean_file(), output);
-  }
-
-  // optional uint32 batch_size = 4;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->batch_size(), output);
-  }
-
-  // optional uint32 crop_size = 5 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->crop_size(), output);
-  }
-
-  // optional bool mirror = 6 [default = false];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->mirror(), output);
-  }
-
-  // optional uint32 rand_skip = 7 [default = 0];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->rand_skip(), output);
-  }
-
-  // optional .opencv_caffe.DataParameter.DB backend = 8 [default = LEVELDB];
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      8, this->backend(), output);
-  }
-
-  // optional bool force_encoded_color = 9 [default = false];
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->force_encoded_color(), output);
-  }
-
-  // optional uint32 prefetch = 10 [default = 4];
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->prefetch(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.DataParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* DataParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* DataParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.DataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string source = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_source().data(), static_cast<int>(this->_internal_source().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.DataParameter.source");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->source(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_source(), target);
   }
 
   // optional float scale = 2 [default = 1];
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_scale(), target);
   }
 
   // optional string mean_file = 3;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_mean_file().data(), static_cast<int>(this->_internal_mean_file().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.DataParameter.mean_file");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->mean_file(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_mean_file(), target);
   }
 
   // optional uint32 batch_size = 4;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->batch_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_batch_size(), target);
   }
 
   // optional uint32 crop_size = 5 [default = 0];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->crop_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_crop_size(), target);
   }
 
   // optional bool mirror = 6 [default = false];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->mirror(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_mirror(), target);
   }
 
   // optional uint32 rand_skip = 7 [default = 0];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->rand_skip(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_rand_skip(), target);
   }
 
   // optional .opencv_caffe.DataParameter.DB backend = 8 [default = LEVELDB];
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      8, this->backend(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      8, this->_internal_backend(), target);
   }
 
   // optional bool force_encoded_color = 9 [default = false];
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(9, this->force_encoded_color(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(9, this->_internal_force_encoded_color(), target);
   }
 
   // optional uint32 prefetch = 10 [default = 4];
   if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->prefetch(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->_internal_prefetch(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.DataParameter)
   return target;
@@ -21136,116 +17543,99 @@ size_t DataParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.DataParameter)
   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] & 255u) {
+  uint32_t 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 & 0x000000ffu) {
     // optional string source = 1;
-    if (has_source()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->source());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_source());
     }
 
     // optional string mean_file = 3;
-    if (has_mean_file()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->mean_file());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_mean_file());
     }
 
     // optional uint32 batch_size = 4;
-    if (has_batch_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->batch_size());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_batch_size());
     }
 
     // optional uint32 crop_size = 5 [default = 0];
-    if (has_crop_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->crop_size());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_crop_size());
     }
 
     // optional uint32 rand_skip = 7 [default = 0];
-    if (has_rand_skip()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->rand_skip());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_rand_skip());
     }
 
     // optional bool mirror = 6 [default = false];
-    if (has_mirror()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 + 1;
     }
 
     // optional bool force_encoded_color = 9 [default = false];
-    if (has_force_encoded_color()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 1 + 1;
     }
 
     // optional .opencv_caffe.DataParameter.DB backend = 8 [default = LEVELDB];
-    if (has_backend()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->backend());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_backend());
     }
 
   }
-  if (_has_bits_[8 / 32] & 768u) {
+  if (cached_has_bits & 0x00000300u) {
     // optional float scale = 2 [default = 1];
-    if (has_scale()) {
+    if (cached_has_bits & 0x00000100u) {
       total_size += 1 + 4;
     }
 
     // optional uint32 prefetch = 10 [default = 4];
-    if (has_prefetch()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->prefetch());
+    if (cached_has_bits & 0x00000200u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_prefetch());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void DataParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.DataParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const DataParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const DataParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.DataParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.DataParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DataParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    DataParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DataParameter::GetClassData() const { return &_class_data_; }
+
+void DataParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<DataParameter *>(to)->MergeFrom(
+      static_cast<const DataParameter &>(from));
 }
 
+
 void DataParameter::MergeFrom(const DataParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.DataParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_source();
-      source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+      _internal_set_source(from._internal_source());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_mean_file();
-      mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_);
+      _internal_set_mean_file(from._internal_mean_file());
     }
     if (cached_has_bits & 0x00000004u) {
       batch_size_ = from.batch_size_;
@@ -21267,7 +17657,7 @@ void DataParameter::MergeFrom(const DataParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 768u) {
+  if (cached_has_bits & 0x00000300u) {
     if (cached_has_bits & 0x00000100u) {
       scale_ = from.scale_;
     }
@@ -21276,13 +17666,7 @@ void DataParameter::MergeFrom(const DataParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void DataParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.DataParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void DataParameter::CopyFrom(const DataParameter& from) {
@@ -21296,244 +17680,202 @@ bool DataParameter::IsInitialized() const {
   return true;
 }
 
-void DataParameter::Swap(DataParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void DataParameter::InternalSwap(DataParameter* other) {
   using std::swap;
-  source_.Swap(&other->source_);
-  mean_file_.Swap(&other->mean_file_);
-  swap(batch_size_, other->batch_size_);
-  swap(crop_size_, other->crop_size_);
-  swap(rand_skip_, other->rand_skip_);
-  swap(mirror_, other->mirror_);
-  swap(force_encoded_color_, other->force_encoded_color_);
-  swap(backend_, other->backend_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &source_, lhs_arena,
+      &other->source_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &mean_file_, lhs_arena,
+      &other->mean_file_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(DataParameter, backend_)
+      + sizeof(DataParameter::backend_)
+      - PROTOBUF_FIELD_OFFSET(DataParameter, batch_size_)>(
+          reinterpret_cast<char*>(&batch_size_),
+          reinterpret_cast<char*>(&other->batch_size_));
   swap(scale_, other->scale_);
   swap(prefetch_, other->prefetch_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata DataParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata DataParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[26]);
 }
 
-
 // ===================================================================
 
-void NonMaximumSuppressionParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NonMaximumSuppressionParameter::kNmsThresholdFieldNumber;
-const int NonMaximumSuppressionParameter::kTopKFieldNumber;
-const int NonMaximumSuppressionParameter::kEtaFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-NonMaximumSuppressionParameter::NonMaximumSuppressionParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNonMaximumSuppressionParameter();
+class NonMaximumSuppressionParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<NonMaximumSuppressionParameter>()._has_bits_);
+  static void set_has_nms_threshold(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+  static void set_has_top_k(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_eta(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+NonMaximumSuppressionParameter::NonMaximumSuppressionParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.NonMaximumSuppressionParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.NonMaximumSuppressionParameter)
 }
 NonMaximumSuppressionParameter::NonMaximumSuppressionParameter(const NonMaximumSuppressionParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&top_k_, &from.top_k_,
     static_cast<size_t>(reinterpret_cast<char*>(&eta_) -
     reinterpret_cast<char*>(&top_k_)) + sizeof(eta_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.NonMaximumSuppressionParameter)
 }
 
-void NonMaximumSuppressionParameter::SharedCtor() {
-  _cached_size_ = 0;
-  top_k_ = 0;
-  nms_threshold_ = 0.3f;
-  eta_ = 1;
+inline void NonMaximumSuppressionParameter::SharedCtor() {
+top_k_ = 0;
+nms_threshold_ = 0.3f;
+eta_ = 1;
 }
 
 NonMaximumSuppressionParameter::~NonMaximumSuppressionParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.NonMaximumSuppressionParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void NonMaximumSuppressionParameter::SharedDtor() {
+inline void NonMaximumSuppressionParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void NonMaximumSuppressionParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* NonMaximumSuppressionParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void NonMaximumSuppressionParameter::ArenaDtor(void* object) {
+  NonMaximumSuppressionParameter* _this = reinterpret_cast< NonMaximumSuppressionParameter* >(object);
+  (void)_this;
 }
-
-const NonMaximumSuppressionParameter& NonMaximumSuppressionParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNonMaximumSuppressionParameter();
-  return *internal_default_instance();
+void NonMaximumSuppressionParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-NonMaximumSuppressionParameter* NonMaximumSuppressionParameter::New(::google::protobuf::Arena* arena) const {
-  NonMaximumSuppressionParameter* n = new NonMaximumSuppressionParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void NonMaximumSuppressionParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void NonMaximumSuppressionParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.NonMaximumSuppressionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     top_k_ = 0;
     nms_threshold_ = 0.3f;
     eta_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool NonMaximumSuppressionParameter::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:opencv_caffe.NonMaximumSuppressionParameter)
-  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 float nms_threshold = 1 [default = 0.3];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_nms_threshold();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &nms_threshold_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* NonMaximumSuppressionParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float nms_threshold = 1 [default = 0.3];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_nms_threshold(&has_bits);
+          nms_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 top_k = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_top_k();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &top_k_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_top_k(&has_bits);
+          top_k_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float eta = 3 [default = 1];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_eta();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &eta_)));
-        } 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:opencv_caffe.NonMaximumSuppressionParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_eta(&has_bits);
+          eta_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.NonMaximumSuppressionParameter)
-  return false;
-#undef DO_
-}
-
-void NonMaximumSuppressionParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.NonMaximumSuppressionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float nms_threshold = 1 [default = 0.3];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->nms_threshold(), output);
-  }
-
-  // optional int32 top_k = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->top_k(), output);
-  }
-
-  // optional float eta = 3 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->eta(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.NonMaximumSuppressionParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* NonMaximumSuppressionParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* NonMaximumSuppressionParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NonMaximumSuppressionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float nms_threshold = 1 [default = 0.3];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->nms_threshold(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_nms_threshold(), target);
   }
 
   // optional int32 top_k = 2;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->top_k(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_top_k(), target);
   }
 
   // optional float eta = 3 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->eta(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_eta(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NonMaximumSuppressionParameter)
   return target;
@@ -21543,61 +17885,52 @@ size_t NonMaximumSuppressionParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NonMaximumSuppressionParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional int32 top_k = 2;
-    if (has_top_k()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->top_k());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_top_k());
     }
 
     // optional float nms_threshold = 1 [default = 0.3];
-    if (has_nms_threshold()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 4;
     }
 
     // optional float eta = 3 [default = 1];
-    if (has_eta()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void NonMaximumSuppressionParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.NonMaximumSuppressionParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NonMaximumSuppressionParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NonMaximumSuppressionParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.NonMaximumSuppressionParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.NonMaximumSuppressionParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NonMaximumSuppressionParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NonMaximumSuppressionParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NonMaximumSuppressionParameter::GetClassData() const { return &_class_data_; }
+
+void NonMaximumSuppressionParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NonMaximumSuppressionParameter *>(to)->MergeFrom(
+      static_cast<const NonMaximumSuppressionParameter &>(from));
 }
 
+
 void NonMaximumSuppressionParameter::MergeFrom(const NonMaximumSuppressionParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NonMaximumSuppressionParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       top_k_ = from.top_k_;
     }
@@ -21609,13 +17942,7 @@ void NonMaximumSuppressionParameter::MergeFrom(const NonMaximumSuppressionParame
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void NonMaximumSuppressionParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.NonMaximumSuppressionParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void NonMaximumSuppressionParameter::CopyFrom(const NonMaximumSuppressionParameter& from) {
@@ -21629,421 +17956,348 @@ bool NonMaximumSuppressionParameter::IsInitialized() const {
   return true;
 }
 
-void NonMaximumSuppressionParameter::Swap(NonMaximumSuppressionParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void NonMaximumSuppressionParameter::InternalSwap(NonMaximumSuppressionParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(top_k_, other->top_k_);
   swap(nms_threshold_, other->nms_threshold_);
   swap(eta_, other->eta_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata NonMaximumSuppressionParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata NonMaximumSuppressionParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[27]);
 }
 
-
 // ===================================================================
 
-void SaveOutputParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SaveOutputParameter::kOutputDirectoryFieldNumber;
-const int SaveOutputParameter::kOutputNamePrefixFieldNumber;
-const int SaveOutputParameter::kOutputFormatFieldNumber;
-const int SaveOutputParameter::kLabelMapFileFieldNumber;
-const int SaveOutputParameter::kNameSizeFileFieldNumber;
-const int SaveOutputParameter::kNumTestImageFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-SaveOutputParameter::SaveOutputParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSaveOutputParameter();
+class SaveOutputParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<SaveOutputParameter>()._has_bits_);
+  static void set_has_output_directory(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.SaveOutputParameter)
-}
-SaveOutputParameter::SaveOutputParameter(const SaveOutputParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  output_directory_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_output_directory()) {
-    output_directory_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_directory_);
+  static void set_has_output_name_prefix(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  output_name_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_output_name_prefix()) {
-    output_name_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_name_prefix_);
+  static void set_has_output_format(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
-  output_format_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_output_format()) {
-    output_format_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_format_);
+  static void set_has_label_map_file(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
-  label_map_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_label_map_file()) {
-    label_map_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.label_map_file_);
+  static void set_has_name_size_file(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_num_test_image(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+};
+
+SaveOutputParameter::SaveOutputParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-  name_size_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name_size_file()) {
-    name_size_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_size_file_);
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.SaveOutputParameter)
+}
+SaveOutputParameter::SaveOutputParameter(const SaveOutputParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  output_directory_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    output_directory_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_output_directory()) {
+    output_directory_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_output_directory(),
+      GetArenaForAllocation());
+  }
+  output_name_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    output_name_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_output_name_prefix()) {
+    output_name_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_output_name_prefix(),
+      GetArenaForAllocation());
+  }
+  output_format_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    output_format_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_output_format()) {
+    output_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_output_format(),
+      GetArenaForAllocation());
+  }
+  label_map_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    label_map_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_label_map_file()) {
+    label_map_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_label_map_file(),
+      GetArenaForAllocation());
+  }
+  name_size_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_size_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name_size_file()) {
+    name_size_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name_size_file(),
+      GetArenaForAllocation());
   }
   num_test_image_ = from.num_test_image_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.SaveOutputParameter)
 }
 
-void SaveOutputParameter::SharedCtor() {
-  _cached_size_ = 0;
-  output_directory_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  output_name_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  output_format_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  label_map_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  name_size_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  num_test_image_ = 0u;
+inline void SaveOutputParameter::SharedCtor() {
+output_directory_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  output_directory_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+output_name_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  output_name_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+output_format_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  output_format_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+label_map_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  label_map_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+name_size_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_size_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+num_test_image_ = 0u;
 }
 
 SaveOutputParameter::~SaveOutputParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.SaveOutputParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SaveOutputParameter::SharedDtor() {
-  output_directory_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  output_name_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  output_format_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  label_map_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  name_size_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void SaveOutputParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  output_directory_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  output_name_prefix_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  output_format_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  label_map_file_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  name_size_file_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void SaveOutputParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* SaveOutputParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void SaveOutputParameter::ArenaDtor(void* object) {
+  SaveOutputParameter* _this = reinterpret_cast< SaveOutputParameter* >(object);
+  (void)_this;
 }
-
-const SaveOutputParameter& SaveOutputParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSaveOutputParameter();
-  return *internal_default_instance();
+void SaveOutputParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-SaveOutputParameter* SaveOutputParameter::New(::google::protobuf::Arena* arena) const {
-  SaveOutputParameter* n = new SaveOutputParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void SaveOutputParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void SaveOutputParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.SaveOutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 31u) {
+  if (cached_has_bits & 0x0000001fu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!output_directory_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*output_directory_.UnsafeRawStringPointer())->clear();
+      output_directory_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!output_name_prefix_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*output_name_prefix_.UnsafeRawStringPointer())->clear();
+      output_name_prefix_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!output_format_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*output_format_.UnsafeRawStringPointer())->clear();
+      output_format_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!label_map_file_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*label_map_file_.UnsafeRawStringPointer())->clear();
+      label_map_file_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(!name_size_file_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_size_file_.UnsafeRawStringPointer())->clear();
+      name_size_file_.ClearNonDefaultToEmpty();
     }
   }
   num_test_image_ = 0u;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SaveOutputParameter::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:opencv_caffe.SaveOutputParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string output_directory = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_output_directory()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->output_directory().data(), static_cast<int>(this->output_directory().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SaveOutputParameter.output_directory");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* SaveOutputParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string output_directory = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_output_directory();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SaveOutputParameter.output_directory");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string output_name_prefix = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_output_name_prefix()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->output_name_prefix().data(), static_cast<int>(this->output_name_prefix().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SaveOutputParameter.output_name_prefix");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_output_name_prefix();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SaveOutputParameter.output_name_prefix");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string output_format = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_output_format()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->output_format().data(), static_cast<int>(this->output_format().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SaveOutputParameter.output_format");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_output_format();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SaveOutputParameter.output_format");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string label_map_file = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_label_map_file()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->label_map_file().data(), static_cast<int>(this->label_map_file().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SaveOutputParameter.label_map_file");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_label_map_file();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SaveOutputParameter.label_map_file");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string name_size_file = 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->mutable_name_size_file()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name_size_file().data(), static_cast<int>(this->name_size_file().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.SaveOutputParameter.name_size_file");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          auto str = _internal_mutable_name_size_file();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.SaveOutputParameter.name_size_file");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 num_test_image = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_num_test_image();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &num_test_image_)));
-        } 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:opencv_caffe.SaveOutputParameter)
-  return true;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_num_test_image(&has_bits);
+          num_test_image_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.SaveOutputParameter)
-  return false;
-#undef DO_
-}
-
-void SaveOutputParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.SaveOutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string output_directory = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output_directory().data(), static_cast<int>(this->output_directory().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SaveOutputParameter.output_directory");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->output_directory(), output);
-  }
-
-  // optional string output_name_prefix = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output_name_prefix().data(), static_cast<int>(this->output_name_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SaveOutputParameter.output_name_prefix");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->output_name_prefix(), output);
-  }
-
-  // optional string output_format = 3;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output_format().data(), static_cast<int>(this->output_format().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SaveOutputParameter.output_format");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->output_format(), output);
-  }
-
-  // optional string label_map_file = 4;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->label_map_file().data(), static_cast<int>(this->label_map_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SaveOutputParameter.label_map_file");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->label_map_file(), output);
-  }
-
-  // optional string name_size_file = 5;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name_size_file().data(), static_cast<int>(this->name_size_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.SaveOutputParameter.name_size_file");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      5, this->name_size_file(), output);
-  }
-
-  // optional uint32 num_test_image = 6;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->num_test_image(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.SaveOutputParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* SaveOutputParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* SaveOutputParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SaveOutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string output_directory = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output_directory().data(), static_cast<int>(this->output_directory().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_output_directory().data(), static_cast<int>(this->_internal_output_directory().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.SaveOutputParameter.output_directory");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->output_directory(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_output_directory(), target);
   }
 
   // optional string output_name_prefix = 2;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output_name_prefix().data(), static_cast<int>(this->output_name_prefix().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_output_name_prefix().data(), static_cast<int>(this->_internal_output_name_prefix().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.SaveOutputParameter.output_name_prefix");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->output_name_prefix(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_output_name_prefix(), target);
   }
 
   // optional string output_format = 3;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output_format().data(), static_cast<int>(this->output_format().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_output_format().data(), static_cast<int>(this->_internal_output_format().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.SaveOutputParameter.output_format");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->output_format(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_output_format(), target);
   }
 
   // optional string label_map_file = 4;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->label_map_file().data(), static_cast<int>(this->label_map_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_label_map_file().data(), static_cast<int>(this->_internal_label_map_file().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.SaveOutputParameter.label_map_file");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->label_map_file(), target);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_label_map_file(), target);
   }
 
   // optional string name_size_file = 5;
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name_size_file().data(), static_cast<int>(this->name_size_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name_size_file().data(), static_cast<int>(this->_internal_name_size_file().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.SaveOutputParameter.name_size_file");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        5, this->name_size_file(), target);
+    target = stream->WriteStringMaybeAliased(
+        5, this->_internal_name_size_file(), target);
   }
 
   // optional uint32 num_test_image = 6;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->num_test_image(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_num_test_image(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SaveOutputParameter)
   return target;
@@ -22053,118 +18307,98 @@ size_t SaveOutputParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SaveOutputParameter)
   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] & 63u) {
+  uint32_t 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 & 0x0000003fu) {
     // optional string output_directory = 1;
-    if (has_output_directory()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->output_directory());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_output_directory());
     }
 
     // optional string output_name_prefix = 2;
-    if (has_output_name_prefix()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->output_name_prefix());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_output_name_prefix());
     }
 
     // optional string output_format = 3;
-    if (has_output_format()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->output_format());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_output_format());
     }
 
     // optional string label_map_file = 4;
-    if (has_label_map_file()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->label_map_file());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_label_map_file());
     }
 
     // optional string name_size_file = 5;
-    if (has_name_size_file()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name_size_file());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name_size_file());
     }
 
     // optional uint32 num_test_image = 6;
-    if (has_num_test_image()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->num_test_image());
+    if (cached_has_bits & 0x00000020u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_num_test_image());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SaveOutputParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.SaveOutputParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SaveOutputParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SaveOutputParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.SaveOutputParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.SaveOutputParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SaveOutputParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SaveOutputParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SaveOutputParameter::GetClassData() const { return &_class_data_; }
+
+void SaveOutputParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SaveOutputParameter *>(to)->MergeFrom(
+      static_cast<const SaveOutputParameter &>(from));
 }
 
+
 void SaveOutputParameter::MergeFrom(const SaveOutputParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SaveOutputParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_output_directory();
-      output_directory_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_directory_);
+      _internal_set_output_directory(from._internal_output_directory());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_output_name_prefix();
-      output_name_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_name_prefix_);
+      _internal_set_output_name_prefix(from._internal_output_name_prefix());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_output_format();
-      output_format_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_format_);
+      _internal_set_output_format(from._internal_output_format());
     }
     if (cached_has_bits & 0x00000008u) {
-      set_has_label_map_file();
-      label_map_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.label_map_file_);
+      _internal_set_label_map_file(from._internal_label_map_file());
     }
     if (cached_has_bits & 0x00000010u) {
-      set_has_name_size_file();
-      name_size_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_size_file_);
+      _internal_set_name_size_file(from._internal_name_size_file());
     }
     if (cached_has_bits & 0x00000020u) {
       num_test_image_ = from.num_test_image_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void SaveOutputParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.SaveOutputParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void SaveOutputParameter::CopyFrom(const SaveOutputParameter& from) {
@@ -22178,213 +18412,190 @@ bool SaveOutputParameter::IsInitialized() const {
   return true;
 }
 
-void SaveOutputParameter::Swap(SaveOutputParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void SaveOutputParameter::InternalSwap(SaveOutputParameter* other) {
   using std::swap;
-  output_directory_.Swap(&other->output_directory_);
-  output_name_prefix_.Swap(&other->output_name_prefix_);
-  output_format_.Swap(&other->output_format_);
-  label_map_file_.Swap(&other->label_map_file_);
-  name_size_file_.Swap(&other->name_size_file_);
-  swap(num_test_image_, other->num_test_image_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &output_directory_, lhs_arena,
+      &other->output_directory_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &output_name_prefix_, lhs_arena,
+      &other->output_name_prefix_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &output_format_, lhs_arena,
+      &other->output_format_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &label_map_file_, lhs_arena,
+      &other->label_map_file_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_size_file_, lhs_arena,
+      &other->name_size_file_, rhs_arena
+  );
+  swap(num_test_image_, other->num_test_image_);
 }
 
-::google::protobuf::Metadata SaveOutputParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SaveOutputParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[28]);
 }
 
-
 // ===================================================================
 
-void DropoutParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int DropoutParameter::kDropoutRatioFieldNumber;
-const int DropoutParameter::kScaleTrainFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-DropoutParameter::DropoutParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDropoutParameter();
+class DropoutParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<DropoutParameter>()._has_bits_);
+  static void set_has_dropout_ratio(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_scale_train(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+};
+
+DropoutParameter::DropoutParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.DropoutParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.DropoutParameter)
 }
 DropoutParameter::DropoutParameter(const DropoutParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&dropout_ratio_, &from.dropout_ratio_,
     static_cast<size_t>(reinterpret_cast<char*>(&scale_train_) -
     reinterpret_cast<char*>(&dropout_ratio_)) + sizeof(scale_train_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.DropoutParameter)
 }
 
-void DropoutParameter::SharedCtor() {
-  _cached_size_ = 0;
-  dropout_ratio_ = 0.5f;
-  scale_train_ = true;
+inline void DropoutParameter::SharedCtor() {
+dropout_ratio_ = 0.5f;
+scale_train_ = true;
 }
 
 DropoutParameter::~DropoutParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.DropoutParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void DropoutParameter::SharedDtor() {
+inline void DropoutParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void DropoutParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* DropoutParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void DropoutParameter::ArenaDtor(void* object) {
+  DropoutParameter* _this = reinterpret_cast< DropoutParameter* >(object);
+  (void)_this;
 }
-
-const DropoutParameter& DropoutParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDropoutParameter();
-  return *internal_default_instance();
+void DropoutParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-DropoutParameter* DropoutParameter::New(::google::protobuf::Arena* arena) const {
-  DropoutParameter* n = new DropoutParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void DropoutParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void DropoutParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.DropoutParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     dropout_ratio_ = 0.5f;
     scale_train_ = true;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool DropoutParameter::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:opencv_caffe.DropoutParameter)
-  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 float dropout_ratio = 1 [default = 0.5];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_dropout_ratio();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &dropout_ratio_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* DropoutParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float dropout_ratio = 1 [default = 0.5];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_dropout_ratio(&has_bits);
+          dropout_ratio_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool scale_train = 2 [default = true];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_scale_train();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &scale_train_)));
-        } 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:opencv_caffe.DropoutParameter)
-  return true;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_scale_train(&has_bits);
+          scale_train_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.DropoutParameter)
-  return false;
-#undef DO_
-}
-
-void DropoutParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.DropoutParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float dropout_ratio = 1 [default = 0.5];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->dropout_ratio(), output);
-  }
-
-  // optional bool scale_train = 2 [default = true];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->scale_train(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.DropoutParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* DropoutParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* DropoutParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.DropoutParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float dropout_ratio = 1 [default = 0.5];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->dropout_ratio(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_dropout_ratio(), target);
   }
 
   // optional bool scale_train = 2 [default = true];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->scale_train(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_scale_train(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.DropoutParameter)
   return target;
@@ -22394,54 +18605,47 @@ size_t DropoutParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.DropoutParameter)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional float dropout_ratio = 1 [default = 0.5];
-    if (has_dropout_ratio()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 4;
     }
 
     // optional bool scale_train = 2 [default = true];
-    if (has_scale_train()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void DropoutParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.DropoutParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const DropoutParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const DropoutParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.DropoutParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.DropoutParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DropoutParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    DropoutParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DropoutParameter::GetClassData() const { return &_class_data_; }
+
+void DropoutParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<DropoutParameter *>(to)->MergeFrom(
+      static_cast<const DropoutParameter &>(from));
 }
 
+
 void DropoutParameter::MergeFrom(const DropoutParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.DropoutParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       dropout_ratio_ = from.dropout_ratio_;
     }
@@ -22450,13 +18654,7 @@ void DropoutParameter::MergeFrom(const DropoutParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void DropoutParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.DropoutParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void DropoutParameter::CopyFrom(const DropoutParameter& from) {
@@ -22470,99 +18668,80 @@ bool DropoutParameter::IsInitialized() const {
   return true;
 }
 
-void DropoutParameter::Swap(DropoutParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void DropoutParameter::InternalSwap(DropoutParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(dropout_ratio_, other->dropout_ratio_);
   swap(scale_train_, other->scale_train_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata DropoutParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata DropoutParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[29]);
 }
 
-
 // ===================================================================
 
-void DummyDataParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int DummyDataParameter::kDataFillerFieldNumber;
-const int DummyDataParameter::kShapeFieldNumber;
-const int DummyDataParameter::kNumFieldNumber;
-const int DummyDataParameter::kChannelsFieldNumber;
-const int DummyDataParameter::kHeightFieldNumber;
-const int DummyDataParameter::kWidthFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class DummyDataParameter::_Internal {
+ public:
+};
 
-DummyDataParameter::DummyDataParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDummyDataParameter();
-  }
+DummyDataParameter::DummyDataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  data_filler_(arena),
+  num_(arena),
+  channels_(arena),
+  height_(arena),
+  width_(arena),
+  shape_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.DummyDataParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.DummyDataParameter)
 }
 DummyDataParameter::DummyDataParameter(const DummyDataParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       data_filler_(from.data_filler_),
       num_(from.num_),
       channels_(from.channels_),
       height_(from.height_),
       width_(from.width_),
       shape_(from.shape_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.DummyDataParameter)
 }
 
-void DummyDataParameter::SharedCtor() {
-  _cached_size_ = 0;
+inline void DummyDataParameter::SharedCtor() {
 }
 
 DummyDataParameter::~DummyDataParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.DummyDataParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void DummyDataParameter::SharedDtor() {
+inline void DummyDataParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void DummyDataParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* DummyDataParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void DummyDataParameter::ArenaDtor(void* object) {
+  DummyDataParameter* _this = reinterpret_cast< DummyDataParameter* >(object);
+  (void)_this;
 }
-
-const DummyDataParameter& DummyDataParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDummyDataParameter();
-  return *internal_default_instance();
+void DummyDataParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-DummyDataParameter* DummyDataParameter::New(::google::protobuf::Arena* arena) const {
-  DummyDataParameter* n = new DummyDataParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void DummyDataParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void DummyDataParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.DummyDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -22572,231 +18751,177 @@ void DummyDataParameter::Clear() {
   height_.Clear();
   width_.Clear();
   shape_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool DummyDataParameter::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:opencv_caffe.DummyDataParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated .opencv_caffe.FillerParameter data_filler = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_data_filler()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* DummyDataParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // repeated .opencv_caffe.FillerParameter data_filler = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_data_filler(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
       // repeated uint32 num = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 16u, input, this->mutable_num())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_num())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_num(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 18) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_num(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated uint32 channels = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 24u, input, this->mutable_channels())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_channels())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_channels(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 26) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_channels(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated uint32 height = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 32u, input, this->mutable_height())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_height())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_height(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<32>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 34) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_height(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated uint32 width = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 40u, input, this->mutable_width())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_width())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_width(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<40>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 42) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_width(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated .opencv_caffe.BlobShape shape = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_shape()));
-        } 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:opencv_caffe.DummyDataParameter)
-  return true;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_shape(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.DummyDataParameter)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void DummyDataParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.DummyDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* DummyDataParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.DummyDataParameter)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .opencv_caffe.FillerParameter data_filler = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->data_filler_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->data_filler(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_data_filler_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_data_filler(i), target, stream);
   }
 
   // repeated uint32 num = 2;
-  for (int i = 0, n = this->num_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      2, this->num(i), output);
+  for (int i = 0, n = this->_internal_num_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_num(i), target);
   }
 
   // repeated uint32 channels = 3;
-  for (int i = 0, n = this->channels_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      3, this->channels(i), output);
+  for (int i = 0, n = this->_internal_channels_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_channels(i), target);
   }
 
   // repeated uint32 height = 4;
-  for (int i = 0, n = this->height_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      4, this->height(i), output);
-  }
-
-  // repeated uint32 width = 5;
-  for (int i = 0, n = this->width_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      5, this->width(i), output);
-  }
-
-  // repeated .opencv_caffe.BlobShape shape = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->shape_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, this->shape(static_cast<int>(i)), output);
+  for (int i = 0, n = this->_internal_height_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_height(i), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.DummyDataParameter)
-}
-
-::google::protobuf::uint8* DummyDataParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.DummyDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_caffe.FillerParameter data_filler = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->data_filler_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->data_filler(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated uint32 num = 2;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(2, this->num_, target);
-
-  // repeated uint32 channels = 3;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(3, this->channels_, target);
-
-  // repeated uint32 height = 4;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(4, this->height_, target);
-
   // repeated uint32 width = 5;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(5, this->width_, target);
+  for (int i = 0, n = this->_internal_width_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_width(i), target);
+  }
 
   // repeated .opencv_caffe.BlobShape shape = 6;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->shape_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, this->shape(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_shape_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(6, this->_internal_shape(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.DummyDataParameter)
   return target;
@@ -22806,96 +18931,80 @@ size_t DummyDataParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.DummyDataParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_caffe.FillerParameter data_filler = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->data_filler_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->data_filler(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_data_filler_size();
+  for (const auto& msg : this->data_filler_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated uint32 num = 2;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->num_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->num_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_num_size());
     total_size += data_size;
   }
 
   // repeated uint32 channels = 3;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->channels_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->channels_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_channels_size());
     total_size += data_size;
   }
 
   // repeated uint32 height = 4;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->height_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->height_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_height_size());
     total_size += data_size;
   }
 
   // repeated uint32 width = 5;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->width_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->width_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_width_size());
     total_size += data_size;
   }
 
   // repeated .opencv_caffe.BlobShape shape = 6;
-  {
-    unsigned int count = static_cast<unsigned int>(this->shape_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->shape(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_shape_size();
+  for (const auto& msg : this->shape_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void DummyDataParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.DummyDataParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const DummyDataParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const DummyDataParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.DummyDataParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.DummyDataParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DummyDataParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    DummyDataParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DummyDataParameter::GetClassData() const { return &_class_data_; }
+
+void DummyDataParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<DummyDataParameter *>(to)->MergeFrom(
+      static_cast<const DummyDataParameter &>(from));
 }
 
+
 void DummyDataParameter::MergeFrom(const DummyDataParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.DummyDataParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   data_filler_.MergeFrom(from.data_filler_);
@@ -22904,13 +19013,7 @@ void DummyDataParameter::MergeFrom(const DummyDataParameter& from) {
   height_.MergeFrom(from.height_);
   width_.MergeFrom(from.width_);
   shape_.MergeFrom(from.shape_);
-}
-
-void DummyDataParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.DummyDataParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void DummyDataParameter::CopyFrom(const DummyDataParameter& from) {
@@ -22924,253 +19027,197 @@ bool DummyDataParameter::IsInitialized() const {
   return true;
 }
 
-void DummyDataParameter::Swap(DummyDataParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void DummyDataParameter::InternalSwap(DummyDataParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   data_filler_.InternalSwap(&other->data_filler_);
   num_.InternalSwap(&other->num_);
   channels_.InternalSwap(&other->channels_);
   height_.InternalSwap(&other->height_);
   width_.InternalSwap(&other->width_);
   shape_.InternalSwap(&other->shape_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata DummyDataParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata DummyDataParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[30]);
 }
 
-
 // ===================================================================
 
-void EltwiseParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int EltwiseParameter::kOperationFieldNumber;
-const int EltwiseParameter::kCoeffFieldNumber;
-const int EltwiseParameter::kStableProdGradFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-EltwiseParameter::EltwiseParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsEltwiseParameter();
+class EltwiseParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<EltwiseParameter>()._has_bits_);
+  static void set_has_operation(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_stable_prod_grad(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+EltwiseParameter::EltwiseParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  coeff_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.EltwiseParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.EltwiseParameter)
 }
 EltwiseParameter::EltwiseParameter(const EltwiseParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       coeff_(from.coeff_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&operation_, &from.operation_,
     static_cast<size_t>(reinterpret_cast<char*>(&stable_prod_grad_) -
     reinterpret_cast<char*>(&operation_)) + sizeof(stable_prod_grad_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.EltwiseParameter)
 }
 
-void EltwiseParameter::SharedCtor() {
-  _cached_size_ = 0;
-  operation_ = 1;
-  stable_prod_grad_ = true;
+inline void EltwiseParameter::SharedCtor() {
+operation_ = 1;
+stable_prod_grad_ = true;
 }
 
 EltwiseParameter::~EltwiseParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.EltwiseParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void EltwiseParameter::SharedDtor() {
+inline void EltwiseParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void EltwiseParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* EltwiseParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void EltwiseParameter::ArenaDtor(void* object) {
+  EltwiseParameter* _this = reinterpret_cast< EltwiseParameter* >(object);
+  (void)_this;
 }
-
-const EltwiseParameter& EltwiseParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsEltwiseParameter();
-  return *internal_default_instance();
+void EltwiseParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-EltwiseParameter* EltwiseParameter::New(::google::protobuf::Arena* arena) const {
-  EltwiseParameter* n = new EltwiseParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void EltwiseParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void EltwiseParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.EltwiseParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   coeff_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     operation_ = 1;
     stable_prod_grad_ = true;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool EltwiseParameter::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:opencv_caffe.EltwiseParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* EltwiseParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::EltwiseParameter_EltwiseOp_IsValid(value)) {
-            set_operation(static_cast< ::opencv_caffe::EltwiseParameter_EltwiseOp >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::EltwiseParameter_EltwiseOp_IsValid(val))) {
+            _internal_set_operation(static_cast<::opencv_caffe::EltwiseParameter_EltwiseOp>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated float coeff = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 21u, input, this->mutable_coeff())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_coeff())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_coeff(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<21>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 18) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_coeff(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool stable_prod_grad = 3 [default = true];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_stable_prod_grad();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &stable_prod_grad_)));
-        } 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:opencv_caffe.EltwiseParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_stable_prod_grad(&has_bits);
+          stable_prod_grad_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.EltwiseParameter)
-  return false;
-#undef DO_
-}
-
-void EltwiseParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.EltwiseParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->operation(), output);
-  }
-
-  // repeated float coeff = 2;
-  for (int i = 0, n = this->coeff_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      2, this->coeff(i), output);
-  }
-
-  // optional bool stable_prod_grad = 3 [default = true];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->stable_prod_grad(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.EltwiseParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* EltwiseParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* EltwiseParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.EltwiseParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->operation(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_operation(), target);
   }
 
   // repeated float coeff = 2;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(2, this->coeff_, target);
+  for (int i = 0, n = this->_internal_coeff_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_coeff(i), target);
+  }
 
   // optional bool stable_prod_grad = 3 [default = true];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->stable_prod_grad(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_stable_prod_grad(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.EltwiseParameter)
   return target;
@@ -23180,65 +19227,58 @@ size_t EltwiseParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.EltwiseParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated float coeff = 2;
   {
-    unsigned int count = static_cast<unsigned int>(this->coeff_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_coeff_size());
     size_t data_size = 4UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->coeff_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_coeff_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional .opencv_caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM];
-    if (has_operation()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->operation());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_operation());
     }
 
     // optional bool stable_prod_grad = 3 [default = true];
-    if (has_stable_prod_grad()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void EltwiseParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.EltwiseParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const EltwiseParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const EltwiseParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.EltwiseParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.EltwiseParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EltwiseParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    EltwiseParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EltwiseParameter::GetClassData() const { return &_class_data_; }
+
+void EltwiseParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<EltwiseParameter *>(to)->MergeFrom(
+      static_cast<const EltwiseParameter &>(from));
 }
 
+
 void EltwiseParameter::MergeFrom(const EltwiseParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.EltwiseParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   coeff_.MergeFrom(from.coeff_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       operation_ = from.operation_;
     }
@@ -23247,13 +19287,7 @@ void EltwiseParameter::MergeFrom(const EltwiseParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void EltwiseParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.EltwiseParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void EltwiseParameter::CopyFrom(const EltwiseParameter& from) {
@@ -23267,178 +19301,140 @@ bool EltwiseParameter::IsInitialized() const {
   return true;
 }
 
-void EltwiseParameter::Swap(EltwiseParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void EltwiseParameter::InternalSwap(EltwiseParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   coeff_.InternalSwap(&other->coeff_);
   swap(operation_, other->operation_);
   swap(stable_prod_grad_, other->stable_prod_grad_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata EltwiseParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata EltwiseParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[31]);
 }
 
-
 // ===================================================================
 
-void ELUParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ELUParameter::kAlphaFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ELUParameter::ELUParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsELUParameter();
+class ELUParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ELUParameter>()._has_bits_);
+  static void set_has_alpha(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+ELUParameter::ELUParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ELUParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ELUParameter)
 }
 ELUParameter::ELUParameter(const ELUParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   alpha_ = from.alpha_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ELUParameter)
 }
 
-void ELUParameter::SharedCtor() {
-  _cached_size_ = 0;
-  alpha_ = 1;
+inline void ELUParameter::SharedCtor() {
+alpha_ = 1;
 }
 
 ELUParameter::~ELUParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ELUParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ELUParameter::SharedDtor() {
+inline void ELUParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ELUParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void ELUParameter::ArenaDtor(void* object) {
+  ELUParameter* _this = reinterpret_cast< ELUParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* ELUParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ELUParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const ELUParameter& ELUParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsELUParameter();
-  return *internal_default_instance();
-}
-
-ELUParameter* ELUParameter::New(::google::protobuf::Arena* arena) const {
-  ELUParameter* n = new ELUParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ELUParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ELUParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ELUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   alpha_ = 1;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ELUParameter::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:opencv_caffe.ELUParameter)
-  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 float alpha = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_alpha();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &alpha_)));
-        } 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:opencv_caffe.ELUParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ELUParameter)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ELUParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ELUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float alpha = 1 [default = 1];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->alpha(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ELUParameter)
+const char* ELUParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float alpha = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_alpha(&has_bits);
+          alpha_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ELUParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ELUParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ELUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float alpha = 1 [default = 1];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->alpha(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_alpha(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ELUParameter)
   return target;
@@ -23448,55 +19444,42 @@ size_t ELUParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ELUParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional float alpha = 1 [default = 1];
-  if (has_alpha()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 + 4;
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ELUParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ELUParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ELUParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ELUParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ELUParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ELUParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ELUParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ELUParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ELUParameter::GetClassData() const { return &_class_data_; }
+
+void ELUParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ELUParameter *>(to)->MergeFrom(
+      static_cast<const ELUParameter &>(from));
 }
 
+
 void ELUParameter::MergeFrom(const ELUParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ELUParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_alpha()) {
-    set_alpha(from.alpha());
+  if (from._internal_has_alpha()) {
+    _internal_set_alpha(from._internal_alpha());
   }
-}
-
-void ELUParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ELUParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ELUParameter::CopyFrom(const ELUParameter& from) {
@@ -23510,63 +19493,73 @@ bool ELUParameter::IsInitialized() const {
   return true;
 }
 
-void ELUParameter::Swap(ELUParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ELUParameter::InternalSwap(ELUParameter* other) {
   using std::swap;
-  swap(alpha_, other->alpha_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  swap(alpha_, other->alpha_);
 }
 
-::google::protobuf::Metadata ELUParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ELUParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[32]);
 }
 
-
 // ===================================================================
 
-void EmbedParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_EmbedParameter_default_instance_._instance.get_mutable()->weight_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-  ::opencv_caffe::_EmbedParameter_default_instance_._instance.get_mutable()->bias_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int EmbedParameter::kNumOutputFieldNumber;
-const int EmbedParameter::kInputDimFieldNumber;
-const int EmbedParameter::kBiasTermFieldNumber;
-const int EmbedParameter::kWeightFillerFieldNumber;
-const int EmbedParameter::kBiasFillerFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-EmbedParameter::EmbedParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsEmbedParameter();
+class EmbedParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<EmbedParameter>()._has_bits_);
+  static void set_has_num_output(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_input_dim(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_bias_term(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
+  static const ::opencv_caffe::FillerParameter& weight_filler(const EmbedParameter* msg);
+  static void set_has_weight_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static const ::opencv_caffe::FillerParameter& bias_filler(const EmbedParameter* msg);
+  static void set_has_bias_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+const ::opencv_caffe::FillerParameter&
+EmbedParameter::_Internal::weight_filler(const EmbedParameter* msg) {
+  return *msg->weight_filler_;
+}
+const ::opencv_caffe::FillerParameter&
+EmbedParameter::_Internal::bias_filler(const EmbedParameter* msg) {
+  return *msg->bias_filler_;
+}
+EmbedParameter::EmbedParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.EmbedParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.EmbedParameter)
 }
 EmbedParameter::EmbedParameter(const EmbedParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_weight_filler()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_weight_filler()) {
     weight_filler_ = new ::opencv_caffe::FillerParameter(*from.weight_filler_);
   } else {
-    weight_filler_ = NULL;
+    weight_filler_ = nullptr;
   }
-  if (from.has_bias_filler()) {
+  if (from._internal_has_bias_filler()) {
     bias_filler_ = new ::opencv_caffe::FillerParameter(*from.bias_filler_);
   } else {
-    bias_filler_ = NULL;
+    bias_filler_ = nullptr;
   }
   ::memcpy(&num_output_, &from.num_output_,
     static_cast<size_t>(reinterpret_cast<char*>(&bias_term_) -
@@ -23574,251 +19567,182 @@ EmbedParameter::EmbedParameter(const EmbedParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.EmbedParameter)
 }
 
-void EmbedParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&weight_filler_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&input_dim_) -
-      reinterpret_cast<char*>(&weight_filler_)) + sizeof(input_dim_));
-  bias_term_ = true;
+inline void EmbedParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&weight_filler_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&input_dim_) -
+    reinterpret_cast<char*>(&weight_filler_)) + sizeof(input_dim_));
+bias_term_ = true;
 }
 
 EmbedParameter::~EmbedParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.EmbedParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void EmbedParameter::SharedDtor() {
+inline void EmbedParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete weight_filler_;
   if (this != internal_default_instance()) delete bias_filler_;
 }
 
-void EmbedParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* EmbedParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void EmbedParameter::ArenaDtor(void* object) {
+  EmbedParameter* _this = reinterpret_cast< EmbedParameter* >(object);
+  (void)_this;
 }
-
-const EmbedParameter& EmbedParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsEmbedParameter();
-  return *internal_default_instance();
+void EmbedParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-EmbedParameter* EmbedParameter::New(::google::protobuf::Arena* arena) const {
-  EmbedParameter* n = new EmbedParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void EmbedParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void EmbedParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.EmbedParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(weight_filler_ != NULL);
+      GOOGLE_DCHECK(weight_filler_ != nullptr);
       weight_filler_->Clear();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(bias_filler_ != NULL);
+      GOOGLE_DCHECK(bias_filler_ != nullptr);
       bias_filler_->Clear();
     }
   }
-  if (cached_has_bits & 28u) {
+  if (cached_has_bits & 0x0000001cu) {
     ::memset(&num_output_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&input_dim_) -
         reinterpret_cast<char*>(&num_output_)) + sizeof(input_dim_));
     bias_term_ = true;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool EmbedParameter::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:opencv_caffe.EmbedParameter)
-  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 uint32 num_output = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_num_output();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &num_output_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* EmbedParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 num_output = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_num_output(&has_bits);
+          num_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 input_dim = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_input_dim();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &input_dim_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_input_dim(&has_bits);
+          input_dim_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool bias_term = 3 [default = true];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_bias_term();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &bias_term_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_bias_term(&has_bits);
+          bias_term_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.FillerParameter weight_filler = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_weight_filler()));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_weight_filler(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.FillerParameter bias_filler = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_bias_filler()));
-        } 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:opencv_caffe.EmbedParameter)
-  return true;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_bias_filler(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.EmbedParameter)
-  return false;
-#undef DO_
-}
-
-void EmbedParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.EmbedParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 num_output = 1;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_output(), output);
-  }
-
-  // optional uint32 input_dim = 2;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->input_dim(), output);
-  }
-
-  // optional bool bias_term = 3 [default = true];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->bias_term(), output);
-  }
-
-  // optional .opencv_caffe.FillerParameter weight_filler = 4;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, *this->weight_filler_, output);
-  }
-
-  // optional .opencv_caffe.FillerParameter bias_filler = 5;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, *this->bias_filler_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.EmbedParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* EmbedParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* EmbedParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.EmbedParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 num_output = 1;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_output(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_output(), target);
   }
 
   // optional uint32 input_dim = 2;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->input_dim(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_input_dim(), target);
   }
 
   // optional bool bias_term = 3 [default = true];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->bias_term(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_bias_term(), target);
   }
 
   // optional .opencv_caffe.FillerParameter weight_filler = 4;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, *this->weight_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        4, _Internal::weight_filler(this), target, stream);
   }
 
   // optional .opencv_caffe.FillerParameter bias_filler = 5;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, *this->bias_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        5, _Internal::bias_filler(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.EmbedParameter)
   return target;
@@ -23828,82 +19752,71 @@ size_t EmbedParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.EmbedParameter)
   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] & 31u) {
+  uint32_t 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 & 0x0000001fu) {
     // optional .opencv_caffe.FillerParameter weight_filler = 4;
-    if (has_weight_filler()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->weight_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *weight_filler_);
     }
 
     // optional .opencv_caffe.FillerParameter bias_filler = 5;
-    if (has_bias_filler()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->bias_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *bias_filler_);
     }
 
     // optional uint32 num_output = 1;
-    if (has_num_output()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->num_output());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_num_output());
     }
 
     // optional uint32 input_dim = 2;
-    if (has_input_dim()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->input_dim());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_input_dim());
     }
 
     // optional bool bias_term = 3 [default = true];
-    if (has_bias_term()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void EmbedParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.EmbedParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const EmbedParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const EmbedParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.EmbedParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.EmbedParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EmbedParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    EmbedParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EmbedParameter::GetClassData() const { return &_class_data_; }
+
+void EmbedParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<EmbedParameter *>(to)->MergeFrom(
+      static_cast<const EmbedParameter &>(from));
 }
 
+
 void EmbedParameter::MergeFrom(const EmbedParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.EmbedParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 31u) {
+  if (cached_has_bits & 0x0000001fu) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.weight_filler());
+      _internal_mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_weight_filler());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.bias_filler());
+      _internal_mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_bias_filler());
     }
     if (cached_has_bits & 0x00000004u) {
       num_output_ = from.num_output_;
@@ -23916,13 +19829,7 @@ void EmbedParameter::MergeFrom(const EmbedParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void EmbedParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.EmbedParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void EmbedParameter::CopyFrom(const EmbedParameter& from) {
@@ -23936,239 +19843,189 @@ bool EmbedParameter::IsInitialized() const {
   return true;
 }
 
-void EmbedParameter::Swap(EmbedParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void EmbedParameter::InternalSwap(EmbedParameter* other) {
   using std::swap;
-  swap(weight_filler_, other->weight_filler_);
-  swap(bias_filler_, other->bias_filler_);
-  swap(num_output_, other->num_output_);
-  swap(input_dim_, other->input_dim_);
-  swap(bias_term_, other->bias_term_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(EmbedParameter, input_dim_)
+      + sizeof(EmbedParameter::input_dim_)
+      - PROTOBUF_FIELD_OFFSET(EmbedParameter, weight_filler_)>(
+          reinterpret_cast<char*>(&weight_filler_),
+          reinterpret_cast<char*>(&other->weight_filler_));
+  swap(bias_term_, other->bias_term_);
 }
 
-::google::protobuf::Metadata EmbedParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata EmbedParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[33]);
 }
 
-
 // ===================================================================
 
-void ExpParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ExpParameter::kBaseFieldNumber;
-const int ExpParameter::kScaleFieldNumber;
-const int ExpParameter::kShiftFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ExpParameter::ExpParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsExpParameter();
+class ExpParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ExpParameter>()._has_bits_);
+  static void set_has_base(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+  static void set_has_shift(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+ExpParameter::ExpParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ExpParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ExpParameter)
 }
 ExpParameter::ExpParameter(const ExpParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&shift_, &from.shift_,
     static_cast<size_t>(reinterpret_cast<char*>(&scale_) -
     reinterpret_cast<char*>(&shift_)) + sizeof(scale_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ExpParameter)
 }
 
-void ExpParameter::SharedCtor() {
-  _cached_size_ = 0;
-  shift_ = 0;
-  base_ = -1;
-  scale_ = 1;
+inline void ExpParameter::SharedCtor() {
+shift_ = 0;
+base_ = -1;
+scale_ = 1;
 }
 
 ExpParameter::~ExpParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ExpParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ExpParameter::SharedDtor() {
+inline void ExpParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ExpParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void ExpParameter::ArenaDtor(void* object) {
+  ExpParameter* _this = reinterpret_cast< ExpParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* ExpParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const ExpParameter& ExpParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsExpParameter();
-  return *internal_default_instance();
+void ExpParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ExpParameter* ExpParameter::New(::google::protobuf::Arena* arena) const {
-  ExpParameter* n = new ExpParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ExpParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ExpParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ExpParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     shift_ = 0;
     base_ = -1;
     scale_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ExpParameter::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:opencv_caffe.ExpParameter)
-  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 float base = 1 [default = -1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_base();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &base_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* ExpParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float base = 1 [default = -1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_base(&has_bits);
+          base_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float scale = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_scale(&has_bits);
+          scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float shift = 3 [default = 0];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_shift();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &shift_)));
-        } 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:opencv_caffe.ExpParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_shift(&has_bits);
+          shift_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ExpParameter)
-  return false;
-#undef DO_
-}
-
-void ExpParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ExpParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float base = 1 [default = -1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->base(), output);
-  }
-
-  // optional float scale = 2 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output);
-  }
-
-  // optional float shift = 3 [default = 0];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->shift(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ExpParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ExpParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ExpParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ExpParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float base = 1 [default = -1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->base(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_base(), target);
   }
 
   // optional float scale = 2 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_scale(), target);
   }
 
   // optional float shift = 3 [default = 0];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->shift(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_shift(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ExpParameter)
   return target;
@@ -24178,59 +20035,52 @@ size_t ExpParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ExpParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional float shift = 3 [default = 0];
-    if (has_shift()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 4;
     }
 
     // optional float base = 1 [default = -1];
-    if (has_base()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 4;
     }
 
     // optional float scale = 2 [default = 1];
-    if (has_scale()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ExpParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ExpParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ExpParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ExpParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ExpParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ExpParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ExpParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ExpParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ExpParameter::GetClassData() const { return &_class_data_; }
+
+void ExpParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ExpParameter *>(to)->MergeFrom(
+      static_cast<const ExpParameter &>(from));
 }
 
+
 void ExpParameter::MergeFrom(const ExpParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ExpParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       shift_ = from.shift_;
     }
@@ -24242,13 +20092,7 @@ void ExpParameter::MergeFrom(const ExpParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ExpParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ExpParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ExpParameter::CopyFrom(const ExpParameter& from) {
@@ -24262,210 +20106,165 @@ bool ExpParameter::IsInitialized() const {
   return true;
 }
 
-void ExpParameter::Swap(ExpParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ExpParameter::InternalSwap(ExpParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(shift_, other->shift_);
   swap(base_, other->base_);
   swap(scale_, other->scale_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ExpParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ExpParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[34]);
 }
 
-
 // ===================================================================
 
-void FlattenParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FlattenParameter::kAxisFieldNumber;
-const int FlattenParameter::kEndAxisFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FlattenParameter::FlattenParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsFlattenParameter();
+class FlattenParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<FlattenParameter>()._has_bits_);
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_end_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+FlattenParameter::FlattenParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.FlattenParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.FlattenParameter)
 }
 FlattenParameter::FlattenParameter(const FlattenParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&axis_, &from.axis_,
     static_cast<size_t>(reinterpret_cast<char*>(&end_axis_) -
     reinterpret_cast<char*>(&axis_)) + sizeof(end_axis_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.FlattenParameter)
 }
 
-void FlattenParameter::SharedCtor() {
-  _cached_size_ = 0;
-  axis_ = 1;
-  end_axis_ = -1;
+inline void FlattenParameter::SharedCtor() {
+axis_ = 1;
+end_axis_ = -1;
 }
 
 FlattenParameter::~FlattenParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.FlattenParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FlattenParameter::SharedDtor() {
+inline void FlattenParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void FlattenParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void FlattenParameter::ArenaDtor(void* object) {
+  FlattenParameter* _this = reinterpret_cast< FlattenParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* FlattenParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void FlattenParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const FlattenParameter& FlattenParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsFlattenParameter();
-  return *internal_default_instance();
-}
-
-FlattenParameter* FlattenParameter::New(::google::protobuf::Arena* arena) const {
-  FlattenParameter* n = new FlattenParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void FlattenParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void FlattenParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.FlattenParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     axis_ = 1;
     end_axis_ = -1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FlattenParameter::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:opencv_caffe.FlattenParameter)
-  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 axis = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* FlattenParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 axis = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 end_axis = 2 [default = -1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_end_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &end_axis_)));
-        } 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:opencv_caffe.FlattenParameter)
-  return true;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_end_axis(&has_bits);
+          end_axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.FlattenParameter)
-  return false;
-#undef DO_
-}
-
-void FlattenParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.FlattenParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 axis = 1 [default = 1];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output);
-  }
-
-  // optional int32 end_axis = 2 [default = -1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end_axis(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.FlattenParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* FlattenParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* FlattenParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.FlattenParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int32 axis = 1 [default = 1];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_axis(), target);
   }
 
   // optional int32 end_axis = 2 [default = -1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end_axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_end_axis(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.FlattenParameter)
   return target;
@@ -24475,58 +20274,47 @@ size_t FlattenParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.FlattenParameter)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional int32 axis = 1 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
     // optional int32 end_axis = 2 [default = -1];
-    if (has_end_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->end_axis());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_end_axis());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FlattenParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.FlattenParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FlattenParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FlattenParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.FlattenParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.FlattenParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FlattenParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FlattenParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FlattenParameter::GetClassData() const { return &_class_data_; }
+
+void FlattenParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FlattenParameter *>(to)->MergeFrom(
+      static_cast<const FlattenParameter &>(from));
 }
 
+
 void FlattenParameter::MergeFrom(const FlattenParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.FlattenParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       axis_ = from.axis_;
     }
@@ -24535,13 +20323,7 @@ void FlattenParameter::MergeFrom(const FlattenParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void FlattenParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.FlattenParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FlattenParameter::CopyFrom(const FlattenParameter& from) {
@@ -24555,52 +20337,56 @@ bool FlattenParameter::IsInitialized() const {
   return true;
 }
 
-void FlattenParameter::Swap(FlattenParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void FlattenParameter::InternalSwap(FlattenParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(axis_, other->axis_);
   swap(end_axis_, other->end_axis_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata FlattenParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FlattenParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[35]);
 }
 
-
 // ===================================================================
 
-void HDF5DataParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int HDF5DataParameter::kSourceFieldNumber;
-const int HDF5DataParameter::kBatchSizeFieldNumber;
-const int HDF5DataParameter::kShuffleFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-HDF5DataParameter::HDF5DataParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5DataParameter();
+class HDF5DataParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<HDF5DataParameter>()._has_bits_);
+  static void set_has_source(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_batch_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_shuffle(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+HDF5DataParameter::HDF5DataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.HDF5DataParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.HDF5DataParameter)
 }
 HDF5DataParameter::HDF5DataParameter(const HDF5DataParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_source()) {
-    source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_source()) {
+    source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_source(),
+      GetArenaForAllocation());
   }
   ::memcpy(&batch_size_, &from.batch_size_,
     static_cast<size_t>(reinterpret_cast<char*>(&shuffle_) -
@@ -24608,206 +20394,151 @@ HDF5DataParameter::HDF5DataParameter(const HDF5DataParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.HDF5DataParameter)
 }
 
-void HDF5DataParameter::SharedCtor() {
-  _cached_size_ = 0;
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&batch_size_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&shuffle_) -
-      reinterpret_cast<char*>(&batch_size_)) + sizeof(shuffle_));
+inline void HDF5DataParameter::SharedCtor() {
+source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&batch_size_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&shuffle_) -
+    reinterpret_cast<char*>(&batch_size_)) + sizeof(shuffle_));
 }
 
 HDF5DataParameter::~HDF5DataParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.HDF5DataParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void HDF5DataParameter::SharedDtor() {
-  source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void HDF5DataParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  source_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void HDF5DataParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void HDF5DataParameter::ArenaDtor(void* object) {
+  HDF5DataParameter* _this = reinterpret_cast< HDF5DataParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* HDF5DataParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void HDF5DataParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const HDF5DataParameter& HDF5DataParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5DataParameter();
-  return *internal_default_instance();
-}
-
-HDF5DataParameter* HDF5DataParameter::New(::google::protobuf::Arena* arena) const {
-  HDF5DataParameter* n = new HDF5DataParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void HDF5DataParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void HDF5DataParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.HDF5DataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(!source_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*source_.UnsafeRawStringPointer())->clear();
+    source_.ClearNonDefaultToEmpty();
   }
-  if (cached_has_bits & 6u) {
+  if (cached_has_bits & 0x00000006u) {
     ::memset(&batch_size_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&shuffle_) -
         reinterpret_cast<char*>(&batch_size_)) + sizeof(shuffle_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool HDF5DataParameter::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:opencv_caffe.HDF5DataParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string source = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_source()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->source().data(), static_cast<int>(this->source().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.HDF5DataParameter.source");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* HDF5DataParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string source = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_source();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.HDF5DataParameter.source");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 batch_size = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_batch_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &batch_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_batch_size(&has_bits);
+          batch_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool shuffle = 3 [default = false];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_shuffle();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &shuffle_)));
-        } 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:opencv_caffe.HDF5DataParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_shuffle(&has_bits);
+          shuffle_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.HDF5DataParameter)
-  return false;
-#undef DO_
-}
-
-void HDF5DataParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.HDF5DataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string source = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.HDF5DataParameter.source");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->source(), output);
-  }
-
-  // optional uint32 batch_size = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->batch_size(), output);
-  }
-
-  // optional bool shuffle = 3 [default = false];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->shuffle(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.HDF5DataParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* HDF5DataParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* HDF5DataParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.HDF5DataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string source = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_source().data(), static_cast<int>(this->_internal_source().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.HDF5DataParameter.source");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->source(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_source(), target);
   }
 
   // optional uint32 batch_size = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->batch_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_batch_size(), target);
   }
 
   // optional bool shuffle = 3 [default = false];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->shuffle(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_shuffle(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.HDF5DataParameter)
   return target;
@@ -24817,66 +20548,56 @@ size_t HDF5DataParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.HDF5DataParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional string source = 1;
-    if (has_source()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->source());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_source());
     }
 
     // optional uint32 batch_size = 2;
-    if (has_batch_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->batch_size());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_batch_size());
     }
 
     // optional bool shuffle = 3 [default = false];
-    if (has_shuffle()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void HDF5DataParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.HDF5DataParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const HDF5DataParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const HDF5DataParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.HDF5DataParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.HDF5DataParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData HDF5DataParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    HDF5DataParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HDF5DataParameter::GetClassData() const { return &_class_data_; }
+
+void HDF5DataParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<HDF5DataParameter *>(to)->MergeFrom(
+      static_cast<const HDF5DataParameter &>(from));
 }
 
+
 void HDF5DataParameter::MergeFrom(const HDF5DataParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.HDF5DataParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_source();
-      source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+      _internal_set_source(from._internal_source());
     }
     if (cached_has_bits & 0x00000002u) {
       batch_size_ = from.batch_size_;
@@ -24886,13 +20607,7 @@ void HDF5DataParameter::MergeFrom(const HDF5DataParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void HDF5DataParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.HDF5DataParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void HDF5DataParameter::CopyFrom(const HDF5DataParameter& from) {
@@ -24906,199 +20621,171 @@ bool HDF5DataParameter::IsInitialized() const {
   return true;
 }
 
-void HDF5DataParameter::Swap(HDF5DataParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void HDF5DataParameter::InternalSwap(HDF5DataParameter* other) {
   using std::swap;
-  source_.Swap(&other->source_);
-  swap(batch_size_, other->batch_size_);
-  swap(shuffle_, other->shuffle_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &source_, lhs_arena,
+      &other->source_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(HDF5DataParameter, shuffle_)
+      + sizeof(HDF5DataParameter::shuffle_)
+      - PROTOBUF_FIELD_OFFSET(HDF5DataParameter, batch_size_)>(
+          reinterpret_cast<char*>(&batch_size_),
+          reinterpret_cast<char*>(&other->batch_size_));
 }
 
-::google::protobuf::Metadata HDF5DataParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata HDF5DataParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[36]);
 }
 
-
 // ===================================================================
 
-void HDF5OutputParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int HDF5OutputParameter::kFileNameFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-HDF5OutputParameter::HDF5OutputParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5OutputParameter();
+class HDF5OutputParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<HDF5OutputParameter>()._has_bits_);
+  static void set_has_file_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+HDF5OutputParameter::HDF5OutputParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.HDF5OutputParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.HDF5OutputParameter)
 }
 HDF5OutputParameter::HDF5OutputParameter(const HDF5OutputParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_file_name()) {
-    file_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.file_name_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  file_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    file_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_file_name()) {
+    file_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_file_name(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.HDF5OutputParameter)
 }
 
-void HDF5OutputParameter::SharedCtor() {
-  _cached_size_ = 0;
-  file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void HDF5OutputParameter::SharedCtor() {
+file_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  file_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 HDF5OutputParameter::~HDF5OutputParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.HDF5OutputParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void HDF5OutputParameter::SharedDtor() {
-  file_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void HDF5OutputParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  file_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void HDF5OutputParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void HDF5OutputParameter::ArenaDtor(void* object) {
+  HDF5OutputParameter* _this = reinterpret_cast< HDF5OutputParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* HDF5OutputParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const HDF5OutputParameter& HDF5OutputParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5OutputParameter();
-  return *internal_default_instance();
+void HDF5OutputParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-HDF5OutputParameter* HDF5OutputParameter::New(::google::protobuf::Arena* arena) const {
-  HDF5OutputParameter* n = new HDF5OutputParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void HDF5OutputParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void HDF5OutputParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.HDF5OutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(!file_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*file_name_.UnsafeRawStringPointer())->clear();
+    file_name_.ClearNonDefaultToEmpty();
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool HDF5OutputParameter::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:opencv_caffe.HDF5OutputParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string file_name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_file_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->file_name().data(), static_cast<int>(this->file_name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.HDF5OutputParameter.file_name");
-        } 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:opencv_caffe.HDF5OutputParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.HDF5OutputParameter)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void HDF5OutputParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.HDF5OutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string file_name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->file_name().data(), static_cast<int>(this->file_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.HDF5OutputParameter.file_name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->file_name(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.HDF5OutputParameter)
+const char* HDF5OutputParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string file_name = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_file_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.HDF5OutputParameter.file_name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* HDF5OutputParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* HDF5OutputParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.HDF5OutputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string file_name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->file_name().data(), static_cast<int>(this->file_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_file_name().data(), static_cast<int>(this->_internal_file_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.HDF5OutputParameter.file_name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->file_name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_file_name(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.HDF5OutputParameter)
   return target;
@@ -25108,58 +20795,44 @@ size_t HDF5OutputParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.HDF5OutputParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional string file_name = 1;
-  if (has_file_name()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->file_name());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_file_name());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void HDF5OutputParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.HDF5OutputParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const HDF5OutputParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const HDF5OutputParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.HDF5OutputParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.HDF5OutputParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData HDF5OutputParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    HDF5OutputParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HDF5OutputParameter::GetClassData() const { return &_class_data_; }
+
+void HDF5OutputParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<HDF5OutputParameter *>(to)->MergeFrom(
+      static_cast<const HDF5OutputParameter &>(from));
 }
 
+
 void HDF5OutputParameter::MergeFrom(const HDF5OutputParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.HDF5OutputParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_file_name()) {
-    set_has_file_name();
-    file_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.file_name_);
+  if (from._internal_has_file_name()) {
+    _internal_set_file_name(from._internal_file_name());
   }
-}
-
-void HDF5OutputParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.HDF5OutputParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void HDF5OutputParameter::CopyFrom(const HDF5OutputParameter& from) {
@@ -25173,184 +20846,149 @@ bool HDF5OutputParameter::IsInitialized() const {
   return true;
 }
 
-void HDF5OutputParameter::Swap(HDF5OutputParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void HDF5OutputParameter::InternalSwap(HDF5OutputParameter* other) {
   using std::swap;
-  file_name_.Swap(&other->file_name_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &file_name_, lhs_arena,
+      &other->file_name_, rhs_arena
+  );
 }
 
-::google::protobuf::Metadata HDF5OutputParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata HDF5OutputParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[37]);
 }
 
-
 // ===================================================================
 
-void HingeLossParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int HingeLossParameter::kNormFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-HingeLossParameter::HingeLossParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHingeLossParameter();
+class HingeLossParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<HingeLossParameter>()._has_bits_);
+  static void set_has_norm(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+HingeLossParameter::HingeLossParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.HingeLossParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.HingeLossParameter)
 }
 HingeLossParameter::HingeLossParameter(const HingeLossParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   norm_ = from.norm_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.HingeLossParameter)
 }
 
-void HingeLossParameter::SharedCtor() {
-  _cached_size_ = 0;
-  norm_ = 1;
+inline void HingeLossParameter::SharedCtor() {
+norm_ = 1;
 }
 
 HingeLossParameter::~HingeLossParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.HingeLossParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void HingeLossParameter::SharedDtor() {
+inline void HingeLossParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void HingeLossParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* HingeLossParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void HingeLossParameter::ArenaDtor(void* object) {
+  HingeLossParameter* _this = reinterpret_cast< HingeLossParameter* >(object);
+  (void)_this;
 }
-
-const HingeLossParameter& HingeLossParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHingeLossParameter();
-  return *internal_default_instance();
+void HingeLossParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-HingeLossParameter* HingeLossParameter::New(::google::protobuf::Arena* arena) const {
-  HingeLossParameter* n = new HingeLossParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void HingeLossParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void HingeLossParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.HingeLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   norm_ = 1;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool HingeLossParameter::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:opencv_caffe.HingeLossParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* HingeLossParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.HingeLossParameter.Norm norm = 1 [default = L1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::HingeLossParameter_Norm_IsValid(value)) {
-            set_norm(static_cast< ::opencv_caffe::HingeLossParameter_Norm >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::HingeLossParameter_Norm_IsValid(val))) {
+            _internal_set_norm(static_cast<::opencv_caffe::HingeLossParameter_Norm>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } 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:opencv_caffe.HingeLossParameter)
-  return true;
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.HingeLossParameter)
-  return false;
-#undef DO_
-}
-
-void HingeLossParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.HingeLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.HingeLossParameter.Norm norm = 1 [default = L1];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->norm(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.HingeLossParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* HingeLossParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* HingeLossParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.HingeLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.HingeLossParameter.Norm norm = 1 [default = L1];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->norm(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_norm(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.HingeLossParameter)
   return target;
@@ -25360,56 +20998,43 @@ size_t HingeLossParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.HingeLossParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional .opencv_caffe.HingeLossParameter.Norm norm = 1 [default = L1];
-  if (has_norm()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->norm());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_norm());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void HingeLossParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.HingeLossParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const HingeLossParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const HingeLossParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.HingeLossParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.HingeLossParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData HingeLossParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    HingeLossParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HingeLossParameter::GetClassData() const { return &_class_data_; }
+
+void HingeLossParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<HingeLossParameter *>(to)->MergeFrom(
+      static_cast<const HingeLossParameter &>(from));
 }
 
+
 void HingeLossParameter::MergeFrom(const HingeLossParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.HingeLossParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_norm()) {
-    set_norm(from.norm());
+  if (from._internal_has_norm()) {
+    _internal_set_norm(from._internal_norm());
   }
-}
-
-void HingeLossParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.HingeLossParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void HingeLossParameter::CopyFrom(const HingeLossParameter& from) {
@@ -25423,68 +21048,98 @@ bool HingeLossParameter::IsInitialized() const {
   return true;
 }
 
-void HingeLossParameter::Swap(HingeLossParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void HingeLossParameter::InternalSwap(HingeLossParameter* other) {
   using std::swap;
-  swap(norm_, other->norm_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  swap(norm_, other->norm_);
 }
 
-::google::protobuf::Metadata HingeLossParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata HingeLossParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[38]);
 }
 
-
 // ===================================================================
 
-void ImageDataParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ImageDataParameter::kSourceFieldNumber;
-const int ImageDataParameter::kBatchSizeFieldNumber;
-const int ImageDataParameter::kRandSkipFieldNumber;
-const int ImageDataParameter::kShuffleFieldNumber;
-const int ImageDataParameter::kNewHeightFieldNumber;
-const int ImageDataParameter::kNewWidthFieldNumber;
-const int ImageDataParameter::kIsColorFieldNumber;
-const int ImageDataParameter::kScaleFieldNumber;
-const int ImageDataParameter::kMeanFileFieldNumber;
-const int ImageDataParameter::kCropSizeFieldNumber;
-const int ImageDataParameter::kMirrorFieldNumber;
-const int ImageDataParameter::kRootFolderFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ImageDataParameter::ImageDataParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsImageDataParameter();
+class ImageDataParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ImageDataParameter>()._has_bits_);
+  static void set_has_source(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_batch_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
+  }
+  static void set_has_rand_skip(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_shuffle(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_new_height(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static void set_has_new_width(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static void set_has_is_color(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+  static void set_has_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
   }
+  static void set_has_mean_file(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_crop_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_mirror(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_root_folder(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+ImageDataParameter::ImageDataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ImageDataParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ImageDataParameter)
 }
 ImageDataParameter::ImageDataParameter(const ImageDataParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_source()) {
-    source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
-  }
-  mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_mean_file()) {
-    mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_);
-  }
-  root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_root_folder()) {
-    root_folder_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_folder_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_source()) {
+    source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_source(),
+      GetArenaForAllocation());
+  }
+  mean_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_mean_file()) {
+    mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_mean_file(),
+      GetArenaForAllocation());
+  }
+  root_folder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    root_folder_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_root_folder()) {
+    root_folder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_root_folder(),
+      GetArenaForAllocation());
   }
   ::memcpy(&crop_size_, &from.crop_size_,
     static_cast<size_t>(reinterpret_cast<char*>(&batch_size_) -
@@ -25492,471 +21147,327 @@ ImageDataParameter::ImageDataParameter(const ImageDataParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ImageDataParameter)
 }
 
-void ImageDataParameter::SharedCtor() {
-  _cached_size_ = 0;
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&crop_size_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&new_width_) -
-      reinterpret_cast<char*>(&crop_size_)) + sizeof(new_width_));
-  is_color_ = true;
-  scale_ = 1;
-  batch_size_ = 1u;
+inline void ImageDataParameter::SharedCtor() {
+source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+mean_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+root_folder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  root_folder_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&crop_size_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&new_width_) -
+    reinterpret_cast<char*>(&crop_size_)) + sizeof(new_width_));
+is_color_ = true;
+scale_ = 1;
+batch_size_ = 1u;
 }
 
 ImageDataParameter::~ImageDataParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ImageDataParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ImageDataParameter::SharedDtor() {
-  source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  root_folder_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void ImageDataParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  source_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  mean_file_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  root_folder_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void ImageDataParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ImageDataParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ImageDataParameter::ArenaDtor(void* object) {
+  ImageDataParameter* _this = reinterpret_cast< ImageDataParameter* >(object);
+  (void)_this;
 }
-
-const ImageDataParameter& ImageDataParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsImageDataParameter();
-  return *internal_default_instance();
+void ImageDataParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ImageDataParameter* ImageDataParameter::New(::google::protobuf::Arena* arena) const {
-  ImageDataParameter* n = new ImageDataParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ImageDataParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ImageDataParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ImageDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!source_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*source_.UnsafeRawStringPointer())->clear();
+      source_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!mean_file_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*mean_file_.UnsafeRawStringPointer())->clear();
+      mean_file_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!root_folder_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*root_folder_.UnsafeRawStringPointer())->clear();
+      root_folder_.ClearNonDefaultToEmpty();
     }
   }
-  if (cached_has_bits & 248u) {
+  if (cached_has_bits & 0x000000f8u) {
     ::memset(&crop_size_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&new_height_) -
         reinterpret_cast<char*>(&crop_size_)) + sizeof(new_height_));
   }
-  if (cached_has_bits & 3840u) {
+  if (cached_has_bits & 0x00000f00u) {
     new_width_ = 0u;
     is_color_ = true;
     scale_ = 1;
     batch_size_ = 1u;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ImageDataParameter::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:opencv_caffe.ImageDataParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string source = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_source()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->source().data(), static_cast<int>(this->source().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.ImageDataParameter.source");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* ImageDataParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string source = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_source();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.ImageDataParameter.source");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float scale = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_scale(&has_bits);
+          scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string mean_file = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_mean_file()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.ImageDataParameter.mean_file");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_mean_file();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.ImageDataParameter.mean_file");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 batch_size = 4 [default = 1];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_batch_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &batch_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_batch_size(&has_bits);
+          batch_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 crop_size = 5 [default = 0];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_crop_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &crop_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_crop_size(&has_bits);
+          crop_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool mirror = 6 [default = false];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_mirror();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &mirror_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_mirror(&has_bits);
+          mirror_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 rand_skip = 7 [default = 0];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_rand_skip();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &rand_skip_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_rand_skip(&has_bits);
+          rand_skip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool shuffle = 8 [default = false];
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-          set_has_shuffle();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &shuffle_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          _Internal::set_has_shuffle(&has_bits);
+          shuffle_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 new_height = 9 [default = 0];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
-          set_has_new_height();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &new_height_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+          _Internal::set_has_new_height(&has_bits);
+          new_height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 new_width = 10 [default = 0];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_new_width();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &new_width_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_new_width(&has_bits);
+          new_width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool is_color = 11 [default = true];
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
-          set_has_is_color();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &is_color_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
+          _Internal::set_has_is_color(&has_bits);
+          is_color_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string root_folder = 12 [default = ""];
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_root_folder()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->root_folder().data(), static_cast<int>(this->root_folder().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.ImageDataParameter.root_folder");
-        } 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:opencv_caffe.ImageDataParameter)
-  return true;
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          auto str = _internal_mutable_root_folder();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.ImageDataParameter.root_folder");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ImageDataParameter)
-  return false;
-#undef DO_
-}
-
-void ImageDataParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ImageDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string source = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.ImageDataParameter.source");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->source(), output);
-  }
-
-  // optional float scale = 2 [default = 1];
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output);
-  }
-
-  // optional string mean_file = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.ImageDataParameter.mean_file");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->mean_file(), output);
-  }
-
-  // optional uint32 batch_size = 4 [default = 1];
-  if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->batch_size(), output);
-  }
-
-  // optional uint32 crop_size = 5 [default = 0];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->crop_size(), output);
-  }
-
-  // optional bool mirror = 6 [default = false];
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->mirror(), output);
-  }
-
-  // optional uint32 rand_skip = 7 [default = 0];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->rand_skip(), output);
-  }
-
-  // optional bool shuffle = 8 [default = false];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->shuffle(), output);
-  }
-
-  // optional uint32 new_height = 9 [default = 0];
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->new_height(), output);
-  }
-
-  // optional uint32 new_width = 10 [default = 0];
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->new_width(), output);
-  }
-
-  // optional bool is_color = 11 [default = true];
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(11, this->is_color(), output);
-  }
-
-  // optional string root_folder = 12 [default = ""];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->root_folder().data(), static_cast<int>(this->root_folder().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.ImageDataParameter.root_folder");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      12, this->root_folder(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ImageDataParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ImageDataParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ImageDataParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ImageDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string source = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_source().data(), static_cast<int>(this->_internal_source().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.ImageDataParameter.source");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->source(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_source(), target);
   }
 
   // optional float scale = 2 [default = 1];
   if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_scale(), target);
   }
 
   // optional string mean_file = 3;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_mean_file().data(), static_cast<int>(this->_internal_mean_file().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.ImageDataParameter.mean_file");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->mean_file(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_mean_file(), target);
   }
 
   // optional uint32 batch_size = 4 [default = 1];
   if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->batch_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_batch_size(), target);
   }
 
   // optional uint32 crop_size = 5 [default = 0];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->crop_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_crop_size(), target);
   }
 
   // optional bool mirror = 6 [default = false];
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->mirror(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_mirror(), target);
   }
 
   // optional uint32 rand_skip = 7 [default = 0];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->rand_skip(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_rand_skip(), target);
   }
 
   // optional bool shuffle = 8 [default = false];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->shuffle(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_shuffle(), target);
   }
 
   // optional uint32 new_height = 9 [default = 0];
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->new_height(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(9, this->_internal_new_height(), target);
   }
 
   // optional uint32 new_width = 10 [default = 0];
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->new_width(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->_internal_new_width(), target);
   }
 
   // optional bool is_color = 11 [default = true];
   if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(11, this->is_color(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(11, this->_internal_is_color(), target);
   }
 
   // optional string root_folder = 12 [default = ""];
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->root_folder().data(), static_cast<int>(this->root_folder().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_root_folder().data(), static_cast<int>(this->_internal_root_folder().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.ImageDataParameter.root_folder");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        12, this->root_folder(), target);
+    target = stream->WriteStringMaybeAliased(
+        12, this->_internal_root_folder(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ImageDataParameter)
   return target;
@@ -25966,133 +21477,113 @@ size_t ImageDataParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ImageDataParameter)
   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] & 255u) {
+  uint32_t 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 & 0x000000ffu) {
     // optional string source = 1;
-    if (has_source()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->source());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_source());
     }
 
     // optional string mean_file = 3;
-    if (has_mean_file()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->mean_file());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_mean_file());
     }
 
     // optional string root_folder = 12 [default = ""];
-    if (has_root_folder()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->root_folder());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_root_folder());
     }
 
     // optional uint32 crop_size = 5 [default = 0];
-    if (has_crop_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->crop_size());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_crop_size());
     }
 
     // optional uint32 rand_skip = 7 [default = 0];
-    if (has_rand_skip()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->rand_skip());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_rand_skip());
     }
 
     // optional bool shuffle = 8 [default = false];
-    if (has_shuffle()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 + 1;
     }
 
     // optional bool mirror = 6 [default = false];
-    if (has_mirror()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 1 + 1;
     }
 
     // optional uint32 new_height = 9 [default = 0];
-    if (has_new_height()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->new_height());
+    if (cached_has_bits & 0x00000080u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_new_height());
     }
 
   }
-  if (_has_bits_[8 / 32] & 3840u) {
+  if (cached_has_bits & 0x00000f00u) {
     // optional uint32 new_width = 10 [default = 0];
-    if (has_new_width()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->new_width());
+    if (cached_has_bits & 0x00000100u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_new_width());
     }
 
     // optional bool is_color = 11 [default = true];
-    if (has_is_color()) {
+    if (cached_has_bits & 0x00000200u) {
       total_size += 1 + 1;
     }
 
     // optional float scale = 2 [default = 1];
-    if (has_scale()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 1 + 4;
     }
 
     // optional uint32 batch_size = 4 [default = 1];
-    if (has_batch_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->batch_size());
+    if (cached_has_bits & 0x00000800u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_batch_size());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ImageDataParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ImageDataParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ImageDataParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ImageDataParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ImageDataParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ImageDataParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ImageDataParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ImageDataParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ImageDataParameter::GetClassData() const { return &_class_data_; }
+
+void ImageDataParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ImageDataParameter *>(to)->MergeFrom(
+      static_cast<const ImageDataParameter &>(from));
 }
 
+
 void ImageDataParameter::MergeFrom(const ImageDataParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ImageDataParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_source();
-      source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+      _internal_set_source(from._internal_source());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_mean_file();
-      mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_);
+      _internal_set_mean_file(from._internal_mean_file());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_root_folder();
-      root_folder_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_folder_);
+      _internal_set_root_folder(from._internal_root_folder());
     }
     if (cached_has_bits & 0x00000008u) {
       crop_size_ = from.crop_size_;
@@ -26111,7 +21602,7 @@ void ImageDataParameter::MergeFrom(const ImageDataParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 3840u) {
+  if (cached_has_bits & 0x00000f00u) {
     if (cached_has_bits & 0x00000100u) {
       new_width_ = from.new_width_;
     }
@@ -26126,13 +21617,7 @@ void ImageDataParameter::MergeFrom(const ImageDataParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ImageDataParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ImageDataParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ImageDataParameter::CopyFrom(const ImageDataParameter& from) {
@@ -26146,208 +21631,184 @@ bool ImageDataParameter::IsInitialized() const {
   return true;
 }
 
-void ImageDataParameter::Swap(ImageDataParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ImageDataParameter::InternalSwap(ImageDataParameter* other) {
   using std::swap;
-  source_.Swap(&other->source_);
-  mean_file_.Swap(&other->mean_file_);
-  root_folder_.Swap(&other->root_folder_);
-  swap(crop_size_, other->crop_size_);
-  swap(rand_skip_, other->rand_skip_);
-  swap(shuffle_, other->shuffle_);
-  swap(mirror_, other->mirror_);
-  swap(new_height_, other->new_height_);
-  swap(new_width_, other->new_width_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &source_, lhs_arena,
+      &other->source_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &mean_file_, lhs_arena,
+      &other->mean_file_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &root_folder_, lhs_arena,
+      &other->root_folder_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ImageDataParameter, new_width_)
+      + sizeof(ImageDataParameter::new_width_)
+      - PROTOBUF_FIELD_OFFSET(ImageDataParameter, crop_size_)>(
+          reinterpret_cast<char*>(&crop_size_),
+          reinterpret_cast<char*>(&other->crop_size_));
   swap(is_color_, other->is_color_);
   swap(scale_, other->scale_);
   swap(batch_size_, other->batch_size_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ImageDataParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ImageDataParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[39]);
 }
 
-
 // ===================================================================
 
-void InfogainLossParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int InfogainLossParameter::kSourceFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-InfogainLossParameter::InfogainLossParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInfogainLossParameter();
+class InfogainLossParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<InfogainLossParameter>()._has_bits_);
+  static void set_has_source(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+InfogainLossParameter::InfogainLossParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.InfogainLossParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.InfogainLossParameter)
 }
 InfogainLossParameter::InfogainLossParameter(const InfogainLossParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_source()) {
-    source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_source()) {
+    source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_source(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.InfogainLossParameter)
 }
 
-void InfogainLossParameter::SharedCtor() {
-  _cached_size_ = 0;
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void InfogainLossParameter::SharedCtor() {
+source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 InfogainLossParameter::~InfogainLossParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.InfogainLossParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void InfogainLossParameter::SharedDtor() {
-  source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void InfogainLossParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  source_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void InfogainLossParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void InfogainLossParameter::ArenaDtor(void* object) {
+  InfogainLossParameter* _this = reinterpret_cast< InfogainLossParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* InfogainLossParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const InfogainLossParameter& InfogainLossParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInfogainLossParameter();
-  return *internal_default_instance();
+void InfogainLossParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-InfogainLossParameter* InfogainLossParameter::New(::google::protobuf::Arena* arena) const {
-  InfogainLossParameter* n = new InfogainLossParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void InfogainLossParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void InfogainLossParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.InfogainLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(!source_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*source_.UnsafeRawStringPointer())->clear();
+    source_.ClearNonDefaultToEmpty();
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool InfogainLossParameter::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:opencv_caffe.InfogainLossParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string source = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_source()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->source().data(), static_cast<int>(this->source().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.InfogainLossParameter.source");
-        } 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:opencv_caffe.InfogainLossParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.InfogainLossParameter)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void InfogainLossParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.InfogainLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string source = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.InfogainLossParameter.source");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->source(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.InfogainLossParameter)
+const char* InfogainLossParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string source = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_source();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.InfogainLossParameter.source");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* InfogainLossParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* InfogainLossParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.InfogainLossParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string source = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_source().data(), static_cast<int>(this->_internal_source().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.InfogainLossParameter.source");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->source(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_source(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.InfogainLossParameter)
   return target;
@@ -26357,58 +21818,44 @@ size_t InfogainLossParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.InfogainLossParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional string source = 1;
-  if (has_source()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->source());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_source());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void InfogainLossParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.InfogainLossParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const InfogainLossParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const InfogainLossParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.InfogainLossParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.InfogainLossParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData InfogainLossParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    InfogainLossParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*InfogainLossParameter::GetClassData() const { return &_class_data_; }
+
+void InfogainLossParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<InfogainLossParameter *>(to)->MergeFrom(
+      static_cast<const InfogainLossParameter &>(from));
 }
 
+
 void InfogainLossParameter::MergeFrom(const InfogainLossParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.InfogainLossParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_source()) {
-    set_has_source();
-    source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+  if (from._internal_has_source()) {
+    _internal_set_source(from._internal_source());
   }
-}
-
-void InfogainLossParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.InfogainLossParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void InfogainLossParameter::CopyFrom(const InfogainLossParameter& from) {
@@ -26422,64 +21869,82 @@ bool InfogainLossParameter::IsInitialized() const {
   return true;
 }
 
-void InfogainLossParameter::Swap(InfogainLossParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void InfogainLossParameter::InternalSwap(InfogainLossParameter* other) {
   using std::swap;
-  source_.Swap(&other->source_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &source_, lhs_arena,
+      &other->source_, rhs_arena
+  );
 }
 
-::google::protobuf::Metadata InfogainLossParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata InfogainLossParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[40]);
 }
 
-
 // ===================================================================
 
-void InnerProductParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_InnerProductParameter_default_instance_._instance.get_mutable()->weight_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-  ::opencv_caffe::_InnerProductParameter_default_instance_._instance.get_mutable()->bias_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int InnerProductParameter::kNumOutputFieldNumber;
-const int InnerProductParameter::kBiasTermFieldNumber;
-const int InnerProductParameter::kWeightFillerFieldNumber;
-const int InnerProductParameter::kBiasFillerFieldNumber;
-const int InnerProductParameter::kAxisFieldNumber;
-const int InnerProductParameter::kTransposeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-InnerProductParameter::InnerProductParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInnerProductParameter();
+class InnerProductParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<InnerProductParameter>()._has_bits_);
+  static void set_has_num_output(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_bias_term(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
+  static const ::opencv_caffe::FillerParameter& weight_filler(const InnerProductParameter* msg);
+  static void set_has_weight_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static const ::opencv_caffe::FillerParameter& bias_filler(const InnerProductParameter* msg);
+  static void set_has_bias_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_transpose(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+};
+
+const ::opencv_caffe::FillerParameter&
+InnerProductParameter::_Internal::weight_filler(const InnerProductParameter* msg) {
+  return *msg->weight_filler_;
+}
+const ::opencv_caffe::FillerParameter&
+InnerProductParameter::_Internal::bias_filler(const InnerProductParameter* msg) {
+  return *msg->bias_filler_;
+}
+InnerProductParameter::InnerProductParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.InnerProductParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.InnerProductParameter)
 }
 InnerProductParameter::InnerProductParameter(const InnerProductParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_weight_filler()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_weight_filler()) {
     weight_filler_ = new ::opencv_caffe::FillerParameter(*from.weight_filler_);
   } else {
-    weight_filler_ = NULL;
+    weight_filler_ = nullptr;
   }
-  if (from.has_bias_filler()) {
+  if (from._internal_has_bias_filler()) {
     bias_filler_ = new ::opencv_caffe::FillerParameter(*from.bias_filler_);
   } else {
-    bias_filler_ = NULL;
+    bias_filler_ = nullptr;
   }
   ::memcpy(&num_output_, &from.num_output_,
     static_cast<size_t>(reinterpret_cast<char*>(&axis_) -
@@ -26487,66 +21952,56 @@ InnerProductParameter::InnerProductParameter(const InnerProductParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.InnerProductParameter)
 }
 
-void InnerProductParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&weight_filler_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&transpose_) -
-      reinterpret_cast<char*>(&weight_filler_)) + sizeof(transpose_));
-  bias_term_ = true;
-  axis_ = 1;
+inline void InnerProductParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&weight_filler_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&transpose_) -
+    reinterpret_cast<char*>(&weight_filler_)) + sizeof(transpose_));
+bias_term_ = true;
+axis_ = 1;
 }
 
 InnerProductParameter::~InnerProductParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.InnerProductParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void InnerProductParameter::SharedDtor() {
+inline void InnerProductParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete weight_filler_;
   if (this != internal_default_instance()) delete bias_filler_;
 }
 
-void InnerProductParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* InnerProductParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void InnerProductParameter::ArenaDtor(void* object) {
+  InnerProductParameter* _this = reinterpret_cast< InnerProductParameter* >(object);
+  (void)_this;
 }
-
-const InnerProductParameter& InnerProductParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInnerProductParameter();
-  return *internal_default_instance();
+void InnerProductParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-InnerProductParameter* InnerProductParameter::New(::google::protobuf::Arena* arena) const {
-  InnerProductParameter* n = new InnerProductParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void InnerProductParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void InnerProductParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.InnerProductParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(weight_filler_ != NULL);
+      GOOGLE_DCHECK(weight_filler_ != nullptr);
       weight_filler_->Clear();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(bias_filler_ != NULL);
+      GOOGLE_DCHECK(bias_filler_ != nullptr);
       bias_filler_->Clear();
     }
   }
-  if (cached_has_bits & 60u) {
+  if (cached_has_bits & 0x0000003cu) {
     ::memset(&num_output_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&transpose_) -
         reinterpret_cast<char*>(&num_output_)) + sizeof(transpose_));
@@ -26554,210 +22009,142 @@ void InnerProductParameter::Clear() {
     axis_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool InnerProductParameter::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:opencv_caffe.InnerProductParameter)
-  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 uint32 num_output = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_num_output();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &num_output_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* InnerProductParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 num_output = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_num_output(&has_bits);
+          num_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool bias_term = 2 [default = true];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_bias_term();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &bias_term_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_bias_term(&has_bits);
+          bias_term_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.FillerParameter weight_filler = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_weight_filler()));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_weight_filler(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.FillerParameter bias_filler = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_bias_filler()));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_bias_filler(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int32 axis = 5 [default = 1];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool transpose = 6 [default = false];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_transpose();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &transpose_)));
-        } 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:opencv_caffe.InnerProductParameter)
-  return true;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_transpose(&has_bits);
+          transpose_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.InnerProductParameter)
-  return false;
-#undef DO_
-}
-
-void InnerProductParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.InnerProductParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 num_output = 1;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_output(), output);
-  }
-
-  // optional bool bias_term = 2 [default = true];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->bias_term(), output);
-  }
-
-  // optional .opencv_caffe.FillerParameter weight_filler = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->weight_filler_, output);
-  }
-
-  // optional .opencv_caffe.FillerParameter bias_filler = 4;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, *this->bias_filler_, output);
-  }
-
-  // optional int32 axis = 5 [default = 1];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->axis(), output);
-  }
-
-  // optional bool transpose = 6 [default = false];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->transpose(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.InnerProductParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* InnerProductParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* InnerProductParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.InnerProductParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 num_output = 1;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_output(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_output(), target);
   }
 
   // optional bool bias_term = 2 [default = true];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->bias_term(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_bias_term(), target);
   }
 
   // optional .opencv_caffe.FillerParameter weight_filler = 3;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->weight_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::weight_filler(this), target, stream);
   }
 
   // optional .opencv_caffe.FillerParameter bias_filler = 4;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, *this->bias_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        4, _Internal::bias_filler(this), target, stream);
   }
 
   // optional int32 axis = 5 [default = 1];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_axis(), target);
   }
 
   // optional bool transpose = 6 [default = false];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->transpose(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_transpose(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.InnerProductParameter)
   return target;
@@ -26767,87 +22154,76 @@ size_t InnerProductParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.InnerProductParameter)
   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] & 63u) {
+  uint32_t 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 & 0x0000003fu) {
     // optional .opencv_caffe.FillerParameter weight_filler = 3;
-    if (has_weight_filler()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->weight_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *weight_filler_);
     }
 
     // optional .opencv_caffe.FillerParameter bias_filler = 4;
-    if (has_bias_filler()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->bias_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *bias_filler_);
     }
 
     // optional uint32 num_output = 1;
-    if (has_num_output()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->num_output());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_num_output());
     }
 
     // optional bool transpose = 6 [default = false];
-    if (has_transpose()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 1;
     }
 
     // optional bool bias_term = 2 [default = true];
-    if (has_bias_term()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 + 1;
     }
 
     // optional int32 axis = 5 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000020u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void InnerProductParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.InnerProductParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const InnerProductParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const InnerProductParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.InnerProductParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.InnerProductParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData InnerProductParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    InnerProductParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*InnerProductParameter::GetClassData() const { return &_class_data_; }
+
+void InnerProductParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<InnerProductParameter *>(to)->MergeFrom(
+      static_cast<const InnerProductParameter &>(from));
 }
 
+
 void InnerProductParameter::MergeFrom(const InnerProductParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.InnerProductParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.weight_filler());
+      _internal_mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_weight_filler());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.bias_filler());
+      _internal_mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_bias_filler());
     }
     if (cached_has_bits & 0x00000004u) {
       num_output_ = from.num_output_;
@@ -26863,13 +22239,7 @@ void InnerProductParameter::MergeFrom(const InnerProductParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void InnerProductParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.InnerProductParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void InnerProductParameter::CopyFrom(const InnerProductParameter& from) {
@@ -26883,180 +22253,142 @@ bool InnerProductParameter::IsInitialized() const {
   return true;
 }
 
-void InnerProductParameter::Swap(InnerProductParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void InnerProductParameter::InternalSwap(InnerProductParameter* other) {
   using std::swap;
-  swap(weight_filler_, other->weight_filler_);
-  swap(bias_filler_, other->bias_filler_);
-  swap(num_output_, other->num_output_);
-  swap(transpose_, other->transpose_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(InnerProductParameter, transpose_)
+      + sizeof(InnerProductParameter::transpose_)
+      - PROTOBUF_FIELD_OFFSET(InnerProductParameter, weight_filler_)>(
+          reinterpret_cast<char*>(&weight_filler_),
+          reinterpret_cast<char*>(&other->weight_filler_));
   swap(bias_term_, other->bias_term_);
   swap(axis_, other->axis_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata InnerProductParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata InnerProductParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[41]);
 }
 
-
 // ===================================================================
 
-void InputParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int InputParameter::kShapeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class InputParameter::_Internal {
+ public:
+};
 
-InputParameter::InputParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInputParameter();
-  }
+InputParameter::InputParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  shape_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.InputParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.InputParameter)
 }
 InputParameter::InputParameter(const InputParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       shape_(from.shape_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.InputParameter)
 }
 
-void InputParameter::SharedCtor() {
-  _cached_size_ = 0;
+inline void InputParameter::SharedCtor() {
 }
 
 InputParameter::~InputParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.InputParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void InputParameter::SharedDtor() {
+inline void InputParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void InputParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* InputParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void InputParameter::ArenaDtor(void* object) {
+  InputParameter* _this = reinterpret_cast< InputParameter* >(object);
+  (void)_this;
 }
-
-const InputParameter& InputParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInputParameter();
-  return *internal_default_instance();
+void InputParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-InputParameter* InputParameter::New(::google::protobuf::Arena* arena) const {
-  InputParameter* n = new InputParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void InputParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void InputParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.InputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   shape_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool InputParameter::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:opencv_caffe.InputParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // repeated .opencv_caffe.BlobShape shape = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_shape()));
-        } 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:opencv_caffe.InputParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.InputParameter)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void InputParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.InputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_caffe.BlobShape shape = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->shape_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->shape(static_cast<int>(i)), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.InputParameter)
+const char* InputParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // repeated .opencv_caffe.BlobShape shape = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_shape(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* InputParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* InputParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.InputParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .opencv_caffe.BlobShape shape = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->shape_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->shape(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_shape_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_shape(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.InputParameter)
   return target;
@@ -27066,59 +22398,41 @@ size_t InputParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.InputParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_caffe.BlobShape shape = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->shape_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->shape(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_shape_size();
+  for (const auto& msg : this->shape_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void InputParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.InputParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const InputParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const InputParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.InputParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.InputParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData InputParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    InputParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*InputParameter::GetClassData() const { return &_class_data_; }
+
+void InputParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<InputParameter *>(to)->MergeFrom(
+      static_cast<const InputParameter &>(from));
 }
 
+
 void InputParameter::MergeFrom(const InputParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.InputParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   shape_.MergeFrom(from.shape_);
-}
-
-void InputParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.InputParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void InputParameter::CopyFrom(const InputParameter& from) {
@@ -27132,235 +22446,182 @@ bool InputParameter::IsInitialized() const {
   return true;
 }
 
-void InputParameter::Swap(InputParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void InputParameter::InternalSwap(InputParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   shape_.InternalSwap(&other->shape_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata InputParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata InputParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[42]);
 }
 
-
 // ===================================================================
 
-void LogParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int LogParameter::kBaseFieldNumber;
-const int LogParameter::kScaleFieldNumber;
-const int LogParameter::kShiftFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-LogParameter::LogParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLogParameter();
+class LogParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<LogParameter>()._has_bits_);
+  static void set_has_base(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+  static void set_has_shift(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+LogParameter::LogParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.LogParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.LogParameter)
 }
 LogParameter::LogParameter(const LogParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&shift_, &from.shift_,
     static_cast<size_t>(reinterpret_cast<char*>(&scale_) -
     reinterpret_cast<char*>(&shift_)) + sizeof(scale_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.LogParameter)
 }
 
-void LogParameter::SharedCtor() {
-  _cached_size_ = 0;
-  shift_ = 0;
-  base_ = -1;
-  scale_ = 1;
+inline void LogParameter::SharedCtor() {
+shift_ = 0;
+base_ = -1;
+scale_ = 1;
 }
 
 LogParameter::~LogParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.LogParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void LogParameter::SharedDtor() {
+inline void LogParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void LogParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void LogParameter::ArenaDtor(void* object) {
+  LogParameter* _this = reinterpret_cast< LogParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* LogParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const LogParameter& LogParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLogParameter();
-  return *internal_default_instance();
+void LogParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-LogParameter* LogParameter::New(::google::protobuf::Arena* arena) const {
-  LogParameter* n = new LogParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void LogParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void LogParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.LogParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     shift_ = 0;
     base_ = -1;
     scale_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool LogParameter::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:opencv_caffe.LogParameter)
-  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 float base = 1 [default = -1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_base();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &base_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* LogParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float base = 1 [default = -1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_base(&has_bits);
+          base_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float scale = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_scale(&has_bits);
+          scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float shift = 3 [default = 0];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_shift();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &shift_)));
-        } 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:opencv_caffe.LogParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_shift(&has_bits);
+          shift_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.LogParameter)
-  return false;
-#undef DO_
-}
-
-void LogParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.LogParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float base = 1 [default = -1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->base(), output);
-  }
-
-  // optional float scale = 2 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output);
-  }
-
-  // optional float shift = 3 [default = 0];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->shift(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.LogParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* LogParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* LogParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.LogParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float base = 1 [default = -1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->base(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_base(), target);
   }
 
   // optional float scale = 2 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_scale(), target);
   }
 
   // optional float shift = 3 [default = 0];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->shift(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_shift(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.LogParameter)
   return target;
@@ -27370,59 +22631,52 @@ size_t LogParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.LogParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional float shift = 3 [default = 0];
-    if (has_shift()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 4;
     }
 
     // optional float base = 1 [default = -1];
-    if (has_base()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 4;
     }
 
     // optional float scale = 2 [default = 1];
-    if (has_scale()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void LogParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.LogParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const LogParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const LogParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.LogParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.LogParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LogParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    LogParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LogParameter::GetClassData() const { return &_class_data_; }
+
+void LogParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<LogParameter *>(to)->MergeFrom(
+      static_cast<const LogParameter &>(from));
 }
 
+
 void LogParameter::MergeFrom(const LogParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.LogParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       shift_ = from.shift_;
     }
@@ -27434,13 +22688,7 @@ void LogParameter::MergeFrom(const LogParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void LogParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.LogParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void LogParameter::CopyFrom(const LogParameter& from) {
@@ -27454,109 +22702,105 @@ bool LogParameter::IsInitialized() const {
   return true;
 }
 
-void LogParameter::Swap(LogParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void LogParameter::InternalSwap(LogParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(shift_, other->shift_);
   swap(base_, other->base_);
   swap(scale_, other->scale_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata LogParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata LogParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[43]);
 }
 
-
 // ===================================================================
 
-void LRNParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int LRNParameter::kLocalSizeFieldNumber;
-const int LRNParameter::kAlphaFieldNumber;
-const int LRNParameter::kBetaFieldNumber;
-const int LRNParameter::kNormRegionFieldNumber;
-const int LRNParameter::kKFieldNumber;
-const int LRNParameter::kEngineFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-LRNParameter::LRNParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLRNParameter();
+class LRNParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<LRNParameter>()._has_bits_);
+  static void set_has_local_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_alpha(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_beta(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
+  static void set_has_norm_region(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_k(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_engine(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+LRNParameter::LRNParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.LRNParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.LRNParameter)
 }
 LRNParameter::LRNParameter(const LRNParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&norm_region_, &from.norm_region_,
     static_cast<size_t>(reinterpret_cast<char*>(&k_) -
     reinterpret_cast<char*>(&norm_region_)) + sizeof(k_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.LRNParameter)
 }
 
-void LRNParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&norm_region_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&engine_) -
-      reinterpret_cast<char*>(&norm_region_)) + sizeof(engine_));
-  local_size_ = 5u;
-  alpha_ = 1;
-  beta_ = 0.75f;
-  k_ = 1;
+inline void LRNParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&norm_region_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&engine_) -
+    reinterpret_cast<char*>(&norm_region_)) + sizeof(engine_));
+local_size_ = 5u;
+alpha_ = 1;
+beta_ = 0.75f;
+k_ = 1;
 }
 
 LRNParameter::~LRNParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.LRNParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void LRNParameter::SharedDtor() {
+inline void LRNParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void LRNParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* LRNParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void LRNParameter::ArenaDtor(void* object) {
+  LRNParameter* _this = reinterpret_cast< LRNParameter* >(object);
+  (void)_this;
 }
-
-const LRNParameter& LRNParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLRNParameter();
-  return *internal_default_instance();
+void LRNParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-LRNParameter* LRNParameter::New(::google::protobuf::Arena* arena) const {
-  LRNParameter* n = new LRNParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void LRNParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void LRNParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.LRNParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     ::memset(&norm_region_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&engine_) -
         reinterpret_cast<char*>(&norm_region_)) + sizeof(engine_));
@@ -27566,224 +22810,150 @@ void LRNParameter::Clear() {
     k_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool LRNParameter::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:opencv_caffe.LRNParameter)
-  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 uint32 local_size = 1 [default = 5];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_local_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &local_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* LRNParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 local_size = 1 [default = 5];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_local_size(&has_bits);
+          local_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float alpha = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_alpha();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &alpha_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_alpha(&has_bits);
+          alpha_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float beta = 3 [default = 0.75];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_beta();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &beta_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_beta(&has_bits);
+          beta_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::LRNParameter_NormRegion_IsValid(value)) {
-            set_norm_region(static_cast< ::opencv_caffe::LRNParameter_NormRegion >(value));
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::LRNParameter_NormRegion_IsValid(val))) {
+            _internal_set_norm_region(static_cast<::opencv_caffe::LRNParameter_NormRegion>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                4, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional float k = 5 [default = 1];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          set_has_k();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &k_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
+          _Internal::set_has_k(&has_bits);
+          k_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.LRNParameter.Engine engine = 6 [default = DEFAULT];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::LRNParameter_Engine_IsValid(value)) {
-            set_engine(static_cast< ::opencv_caffe::LRNParameter_Engine >(value));
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::LRNParameter_Engine_IsValid(val))) {
+            _internal_set_engine(static_cast<::opencv_caffe::LRNParameter_Engine>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                6, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(6, val, mutable_unknown_fields());
           }
-        } 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:opencv_caffe.LRNParameter)
-  return true;
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.LRNParameter)
-  return false;
-#undef DO_
-}
-
-void LRNParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.LRNParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 local_size = 1 [default = 5];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->local_size(), output);
-  }
-
-  // optional float alpha = 2 [default = 1];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->alpha(), output);
-  }
-
-  // optional float beta = 3 [default = 0.75];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->beta(), output);
-  }
-
-  // optional .opencv_caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      4, this->norm_region(), output);
-  }
-
-  // optional float k = 5 [default = 1];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->k(), output);
-  }
-
-  // optional .opencv_caffe.LRNParameter.Engine engine = 6 [default = DEFAULT];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      6, this->engine(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.LRNParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* LRNParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* LRNParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.LRNParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 local_size = 1 [default = 5];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->local_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_local_size(), target);
   }
 
   // optional float alpha = 2 [default = 1];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->alpha(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_alpha(), target);
   }
 
   // optional float beta = 3 [default = 0.75];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->beta(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_beta(), target);
   }
 
   // optional .opencv_caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      4, this->norm_region(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      4, this->_internal_norm_region(), target);
   }
 
   // optional float k = 5 [default = 1];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->k(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->_internal_k(), target);
   }
 
   // optional .opencv_caffe.LRNParameter.Engine engine = 6 [default = DEFAULT];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      6, this->engine(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      6, this->_internal_engine(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.LRNParameter)
   return target;
@@ -27793,78 +22963,69 @@ size_t LRNParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.LRNParameter)
   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] & 63u) {
+  uint32_t 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 & 0x0000003fu) {
     // optional .opencv_caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
-    if (has_norm_region()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->norm_region());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_norm_region());
     }
 
     // optional .opencv_caffe.LRNParameter.Engine engine = 6 [default = DEFAULT];
-    if (has_engine()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_engine());
     }
 
     // optional uint32 local_size = 1 [default = 5];
-    if (has_local_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->local_size());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_local_size());
     }
 
     // optional float alpha = 2 [default = 1];
-    if (has_alpha()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 4;
     }
 
     // optional float beta = 3 [default = 0.75];
-    if (has_beta()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 + 4;
     }
 
     // optional float k = 5 [default = 1];
-    if (has_k()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void LRNParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.LRNParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const LRNParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const LRNParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.LRNParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.LRNParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LRNParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    LRNParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LRNParameter::GetClassData() const { return &_class_data_; }
+
+void LRNParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<LRNParameter *>(to)->MergeFrom(
+      static_cast<const LRNParameter &>(from));
 }
 
+
 void LRNParameter::MergeFrom(const LRNParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.LRNParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
       norm_region_ = from.norm_region_;
     }
@@ -27885,13 +23046,7 @@ void LRNParameter::MergeFrom(const LRNParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void LRNParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.LRNParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void LRNParameter::CopyFrom(const LRNParameter& from) {
@@ -27905,265 +23060,211 @@ bool LRNParameter::IsInitialized() const {
   return true;
 }
 
-void LRNParameter::Swap(LRNParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void LRNParameter::InternalSwap(LRNParameter* other) {
   using std::swap;
-  swap(norm_region_, other->norm_region_);
-  swap(engine_, other->engine_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(LRNParameter, engine_)
+      + sizeof(LRNParameter::engine_)
+      - PROTOBUF_FIELD_OFFSET(LRNParameter, norm_region_)>(
+          reinterpret_cast<char*>(&norm_region_),
+          reinterpret_cast<char*>(&other->norm_region_));
   swap(local_size_, other->local_size_);
   swap(alpha_, other->alpha_);
   swap(beta_, other->beta_);
   swap(k_, other->k_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata LRNParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata LRNParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[44]);
 }
 
-
 // ===================================================================
 
-void MemoryDataParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int MemoryDataParameter::kBatchSizeFieldNumber;
-const int MemoryDataParameter::kChannelsFieldNumber;
-const int MemoryDataParameter::kHeightFieldNumber;
-const int MemoryDataParameter::kWidthFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-MemoryDataParameter::MemoryDataParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsMemoryDataParameter();
+class MemoryDataParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<MemoryDataParameter>()._has_bits_);
+  static void set_has_batch_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_channels(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_height(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_width(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
+};
+
+MemoryDataParameter::MemoryDataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.MemoryDataParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.MemoryDataParameter)
 }
 MemoryDataParameter::MemoryDataParameter(const MemoryDataParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&batch_size_, &from.batch_size_,
     static_cast<size_t>(reinterpret_cast<char*>(&width_) -
     reinterpret_cast<char*>(&batch_size_)) + sizeof(width_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.MemoryDataParameter)
 }
 
-void MemoryDataParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&batch_size_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&width_) -
-      reinterpret_cast<char*>(&batch_size_)) + sizeof(width_));
+inline void MemoryDataParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&batch_size_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&width_) -
+    reinterpret_cast<char*>(&batch_size_)) + sizeof(width_));
 }
 
 MemoryDataParameter::~MemoryDataParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.MemoryDataParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void MemoryDataParameter::SharedDtor() {
+inline void MemoryDataParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void MemoryDataParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void MemoryDataParameter::ArenaDtor(void* object) {
+  MemoryDataParameter* _this = reinterpret_cast< MemoryDataParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* MemoryDataParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const MemoryDataParameter& MemoryDataParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsMemoryDataParameter();
-  return *internal_default_instance();
+void MemoryDataParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-MemoryDataParameter* MemoryDataParameter::New(::google::protobuf::Arena* arena) const {
-  MemoryDataParameter* n = new MemoryDataParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void MemoryDataParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void MemoryDataParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.MemoryDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 15u) {
-    ::memset(&batch_size_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&width_) -
-        reinterpret_cast<char*>(&batch_size_)) + sizeof(width_));
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool MemoryDataParameter::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:opencv_caffe.MemoryDataParameter)
-  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 uint32 batch_size = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_batch_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &batch_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 channels = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_channels();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &channels_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 height = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_height();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &height_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 width = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_width();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &width_)));
-        } 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:opencv_caffe.MemoryDataParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.MemoryDataParameter)
-  return false;
-#undef DO_
-}
-
-void MemoryDataParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.MemoryDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 batch_size = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->batch_size(), output);
-  }
-
-  // optional uint32 channels = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->channels(), output);
-  }
-
-  // optional uint32 height = 3;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->height(), output);
-  }
+  (void) cached_has_bits;
 
-  // optional uint32 width = 4;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->width(), output);
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
+    ::memset(&batch_size_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&width_) -
+        reinterpret_cast<char*>(&batch_size_)) + sizeof(width_));
   }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.MemoryDataParameter)
+const char* MemoryDataParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 batch_size = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_batch_size(&has_bits);
+          batch_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 channels = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_channels(&has_bits);
+          channels_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 height = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_height(&has_bits);
+          height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 width = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_width(&has_bits);
+          width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* MemoryDataParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* MemoryDataParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.MemoryDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 batch_size = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->batch_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_batch_size(), target);
   }
 
   // optional uint32 channels = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->channels(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_channels(), target);
   }
 
   // optional uint32 height = 3;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->height(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_height(), target);
   }
 
   // optional uint32 width = 4;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->width(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_width(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.MemoryDataParameter)
   return target;
@@ -28173,72 +23274,57 @@ size_t MemoryDataParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.MemoryDataParameter)
   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] & 15u) {
+  uint32_t 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 & 0x0000000fu) {
     // optional uint32 batch_size = 1;
-    if (has_batch_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->batch_size());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_batch_size());
     }
 
     // optional uint32 channels = 2;
-    if (has_channels()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->channels());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_channels());
     }
 
     // optional uint32 height = 3;
-    if (has_height()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->height());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_height());
     }
 
     // optional uint32 width = 4;
-    if (has_width()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->width());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_width());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void MemoryDataParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.MemoryDataParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const MemoryDataParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const MemoryDataParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.MemoryDataParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.MemoryDataParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MemoryDataParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    MemoryDataParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MemoryDataParameter::GetClassData() const { return &_class_data_; }
+
+void MemoryDataParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<MemoryDataParameter *>(to)->MergeFrom(
+      static_cast<const MemoryDataParameter &>(from));
 }
 
+
 void MemoryDataParameter::MergeFrom(const MemoryDataParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.MemoryDataParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
       batch_size_ = from.batch_size_;
     }
@@ -28253,13 +23339,7 @@ void MemoryDataParameter::MergeFrom(const MemoryDataParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void MemoryDataParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.MemoryDataParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void MemoryDataParameter::CopyFrom(const MemoryDataParameter& from) {
@@ -28273,238 +23353,188 @@ bool MemoryDataParameter::IsInitialized() const {
   return true;
 }
 
-void MemoryDataParameter::Swap(MemoryDataParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void MemoryDataParameter::InternalSwap(MemoryDataParameter* other) {
   using std::swap;
-  swap(batch_size_, other->batch_size_);
-  swap(channels_, other->channels_);
-  swap(height_, other->height_);
-  swap(width_, other->width_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(MemoryDataParameter, width_)
+      + sizeof(MemoryDataParameter::width_)
+      - PROTOBUF_FIELD_OFFSET(MemoryDataParameter, batch_size_)>(
+          reinterpret_cast<char*>(&batch_size_),
+          reinterpret_cast<char*>(&other->batch_size_));
 }
 
-::google::protobuf::Metadata MemoryDataParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata MemoryDataParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[45]);
 }
 
-
 // ===================================================================
 
-void MVNParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int MVNParameter::kNormalizeVarianceFieldNumber;
-const int MVNParameter::kAcrossChannelsFieldNumber;
-const int MVNParameter::kEpsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-MVNParameter::MVNParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsMVNParameter();
+class MVNParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<MVNParameter>()._has_bits_);
+  static void set_has_normalize_variance(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_across_channels(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_eps(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+MVNParameter::MVNParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.MVNParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.MVNParameter)
 }
 MVNParameter::MVNParameter(const MVNParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&across_channels_, &from.across_channels_,
     static_cast<size_t>(reinterpret_cast<char*>(&eps_) -
     reinterpret_cast<char*>(&across_channels_)) + sizeof(eps_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.MVNParameter)
 }
 
-void MVNParameter::SharedCtor() {
-  _cached_size_ = 0;
-  across_channels_ = false;
-  normalize_variance_ = true;
-  eps_ = 1e-09f;
+inline void MVNParameter::SharedCtor() {
+across_channels_ = false;
+normalize_variance_ = true;
+eps_ = 1e-09f;
 }
 
 MVNParameter::~MVNParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.MVNParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void MVNParameter::SharedDtor() {
+inline void MVNParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void MVNParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void MVNParameter::ArenaDtor(void* object) {
+  MVNParameter* _this = reinterpret_cast< MVNParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* MVNParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const MVNParameter& MVNParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsMVNParameter();
-  return *internal_default_instance();
+void MVNParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-MVNParameter* MVNParameter::New(::google::protobuf::Arena* arena) const {
-  MVNParameter* n = new MVNParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void MVNParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void MVNParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.MVNParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     across_channels_ = false;
     normalize_variance_ = true;
     eps_ = 1e-09f;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool MVNParameter::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:opencv_caffe.MVNParameter)
-  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 bool normalize_variance = 1 [default = true];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_normalize_variance();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &normalize_variance_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* MVNParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional bool normalize_variance = 1 [default = true];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_normalize_variance(&has_bits);
+          normalize_variance_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool across_channels = 2 [default = false];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_across_channels();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &across_channels_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_across_channels(&has_bits);
+          across_channels_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float eps = 3 [default = 1e-09];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_eps();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &eps_)));
-        } 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:opencv_caffe.MVNParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_eps(&has_bits);
+          eps_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.MVNParameter)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void MVNParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.MVNParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional bool normalize_variance = 1 [default = true];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->normalize_variance(), output);
-  }
-
-  // optional bool across_channels = 2 [default = false];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->across_channels(), output);
-  }
-
-  // optional float eps = 3 [default = 1e-09];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->eps(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.MVNParameter)
-}
-
-::google::protobuf::uint8* MVNParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* MVNParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.MVNParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional bool normalize_variance = 1 [default = true];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->normalize_variance(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_normalize_variance(), target);
   }
 
   // optional bool across_channels = 2 [default = false];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->across_channels(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_across_channels(), target);
   }
 
   // optional float eps = 3 [default = 1e-09];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->eps(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_eps(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.MVNParameter)
   return target;
@@ -28514,59 +23544,52 @@ size_t MVNParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.MVNParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional bool across_channels = 2 [default = false];
-    if (has_across_channels()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 1;
     }
 
     // optional bool normalize_variance = 1 [default = true];
-    if (has_normalize_variance()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
     // optional float eps = 3 [default = 1e-09];
-    if (has_eps()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void MVNParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.MVNParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const MVNParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const MVNParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.MVNParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.MVNParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MVNParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    MVNParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MVNParameter::GetClassData() const { return &_class_data_; }
+
+void MVNParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<MVNParameter *>(to)->MergeFrom(
+      static_cast<const MVNParameter &>(from));
 }
 
+
 void MVNParameter::MergeFrom(const MVNParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.MVNParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       across_channels_ = from.across_channels_;
     }
@@ -28578,13 +23601,7 @@ void MVNParameter::MergeFrom(const MVNParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void MVNParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.MVNParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void MVNParameter::CopyFrom(const MVNParameter& from) {
@@ -28598,190 +23615,155 @@ bool MVNParameter::IsInitialized() const {
   return true;
 }
 
-void MVNParameter::Swap(MVNParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void MVNParameter::InternalSwap(MVNParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(across_channels_, other->across_channels_);
   swap(normalize_variance_, other->normalize_variance_);
   swap(eps_, other->eps_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata MVNParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata MVNParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[46]);
 }
 
-
 // ===================================================================
 
-void ParameterParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_ParameterParameter_default_instance_._instance.get_mutable()->shape_ = const_cast< ::opencv_caffe::BlobShape*>(
-      ::opencv_caffe::BlobShape::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ParameterParameter::kShapeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ParameterParameter::ParameterParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsParameterParameter();
+class ParameterParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ParameterParameter>()._has_bits_);
+  static const ::opencv_caffe::BlobShape& shape(const ParameterParameter* msg);
+  static void set_has_shape(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+const ::opencv_caffe::BlobShape&
+ParameterParameter::_Internal::shape(const ParameterParameter* msg) {
+  return *msg->shape_;
+}
+ParameterParameter::ParameterParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ParameterParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ParameterParameter)
 }
 ParameterParameter::ParameterParameter(const ParameterParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_shape()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_shape()) {
     shape_ = new ::opencv_caffe::BlobShape(*from.shape_);
   } else {
-    shape_ = NULL;
+    shape_ = nullptr;
   }
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ParameterParameter)
 }
 
-void ParameterParameter::SharedCtor() {
-  _cached_size_ = 0;
-  shape_ = NULL;
+inline void ParameterParameter::SharedCtor() {
+shape_ = nullptr;
 }
 
 ParameterParameter::~ParameterParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ParameterParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ParameterParameter::SharedDtor() {
+inline void ParameterParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete shape_;
 }
 
-void ParameterParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void ParameterParameter::ArenaDtor(void* object) {
+  ParameterParameter* _this = reinterpret_cast< ParameterParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* ParameterParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ParameterParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const ParameterParameter& ParameterParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsParameterParameter();
-  return *internal_default_instance();
-}
-
-ParameterParameter* ParameterParameter::New(::google::protobuf::Arena* arena) const {
-  ParameterParameter* n = new ParameterParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ParameterParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ParameterParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ParameterParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(shape_ != NULL);
+    GOOGLE_DCHECK(shape_ != nullptr);
     shape_->Clear();
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ParameterParameter::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:opencv_caffe.ParameterParameter)
-  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 .opencv_caffe.BlobShape shape = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_shape()));
-        } 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:opencv_caffe.ParameterParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ParameterParameter)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ParameterParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ParameterParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.BlobShape shape = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->shape_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ParameterParameter)
+const char* ParameterParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional .opencv_caffe.BlobShape shape = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_shape(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ParameterParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ParameterParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ParameterParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.BlobShape shape = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *this->shape_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::shape(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ParameterParameter)
   return target;
@@ -28791,57 +23773,44 @@ size_t ParameterParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ParameterParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional .opencv_caffe.BlobShape shape = 1;
-  if (has_shape()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->shape_);
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *shape_);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ParameterParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ParameterParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ParameterParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ParameterParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ParameterParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ParameterParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ParameterParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ParameterParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ParameterParameter::GetClassData() const { return &_class_data_; }
+
+void ParameterParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ParameterParameter *>(to)->MergeFrom(
+      static_cast<const ParameterParameter &>(from));
 }
 
+
 void ParameterParameter::MergeFrom(const ParameterParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ParameterParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_shape()) {
-    mutable_shape()->::opencv_caffe::BlobShape::MergeFrom(from.shape());
+  if (from._internal_has_shape()) {
+    _internal_mutable_shape()->::opencv_caffe::BlobShape::MergeFrom(from._internal_shape());
   }
-}
-
-void ParameterParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ParameterParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ParameterParameter::CopyFrom(const ParameterParameter& from) {
@@ -28855,117 +23824,127 @@ bool ParameterParameter::IsInitialized() const {
   return true;
 }
 
-void ParameterParameter::Swap(ParameterParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ParameterParameter::InternalSwap(ParameterParameter* other) {
   using std::swap;
-  swap(shape_, other->shape_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  swap(shape_, other->shape_);
 }
 
-::google::protobuf::Metadata ParameterParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ParameterParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[47]);
 }
 
-
 // ===================================================================
 
-void PoolingParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int PoolingParameter::kPoolFieldNumber;
-const int PoolingParameter::kPadFieldNumber;
-const int PoolingParameter::kPadHFieldNumber;
-const int PoolingParameter::kPadWFieldNumber;
-const int PoolingParameter::kKernelSizeFieldNumber;
-const int PoolingParameter::kKernelHFieldNumber;
-const int PoolingParameter::kKernelWFieldNumber;
-const int PoolingParameter::kStrideFieldNumber;
-const int PoolingParameter::kStrideHFieldNumber;
-const int PoolingParameter::kStrideWFieldNumber;
-const int PoolingParameter::kEngineFieldNumber;
-const int PoolingParameter::kGlobalPoolingFieldNumber;
-const int PoolingParameter::kCeilModeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-PoolingParameter::PoolingParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPoolingParameter();
+class PoolingParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<PoolingParameter>()._has_bits_);
+  static void set_has_pool(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_pad(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_pad_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
   }
+  static void set_has_pad_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static void set_has_kernel_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_kernel_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_kernel_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_stride(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
+  }
+  static void set_has_stride_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_stride_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_engine(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+  static void set_has_global_pooling(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
+  }
+  static void set_has_ceil_mode(HasBits* has_bits) {
+    (*has_bits)[0] |= 4096u;
+  }
+};
+
+PoolingParameter::PoolingParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.PoolingParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.PoolingParameter)
 }
 PoolingParameter::PoolingParameter(const PoolingParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&pool_, &from.pool_,
     static_cast<size_t>(reinterpret_cast<char*>(&ceil_mode_) -
     reinterpret_cast<char*>(&pool_)) + sizeof(ceil_mode_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.PoolingParameter)
 }
 
-void PoolingParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&pool_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&global_pooling_) -
-      reinterpret_cast<char*>(&pool_)) + sizeof(global_pooling_));
-  stride_ = 1u;
-  ceil_mode_ = true;
+inline void PoolingParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&pool_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&global_pooling_) -
+    reinterpret_cast<char*>(&pool_)) + sizeof(global_pooling_));
+stride_ = 1u;
+ceil_mode_ = true;
 }
 
 PoolingParameter::~PoolingParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.PoolingParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void PoolingParameter::SharedDtor() {
+inline void PoolingParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void PoolingParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* PoolingParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void PoolingParameter::ArenaDtor(void* object) {
+  PoolingParameter* _this = reinterpret_cast< PoolingParameter* >(object);
+  (void)_this;
 }
-
-const PoolingParameter& PoolingParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPoolingParameter();
-  return *internal_default_instance();
+void PoolingParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-PoolingParameter* PoolingParameter::New(::google::protobuf::Arena* arena) const {
-  PoolingParameter* n = new PoolingParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void PoolingParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void PoolingParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.PoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     ::memset(&pool_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&pad_h_) -
         reinterpret_cast<char*>(&pool_)) + sizeof(pad_h_));
   }
-  if (cached_has_bits & 7936u) {
+  if (cached_has_bits & 0x00001f00u) {
     ::memset(&pad_w_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&global_pooling_) -
         reinterpret_cast<char*>(&pad_w_)) + sizeof(global_pooling_));
@@ -28973,392 +23952,255 @@ void PoolingParameter::Clear() {
     ceil_mode_ = true;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool PoolingParameter::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:opencv_caffe.PoolingParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* PoolingParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::PoolingParameter_PoolMethod_IsValid(value)) {
-            set_pool(static_cast< ::opencv_caffe::PoolingParameter_PoolMethod >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::PoolingParameter_PoolMethod_IsValid(val))) {
+            _internal_set_pool(static_cast<::opencv_caffe::PoolingParameter_PoolMethod>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional uint32 kernel_size = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_kernel_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &kernel_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_kernel_size(&has_bits);
+          kernel_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 stride = 3 [default = 1];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_stride();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &stride_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_stride(&has_bits);
+          stride_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 pad = 4 [default = 0];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_pad();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pad_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_pad(&has_bits);
+          pad_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 kernel_h = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_kernel_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &kernel_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_kernel_h(&has_bits);
+          kernel_h_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 kernel_w = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_kernel_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &kernel_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_kernel_w(&has_bits);
+          kernel_w_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 stride_h = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_stride_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &stride_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_stride_h(&has_bits);
+          stride_h_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 stride_w = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-          set_has_stride_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &stride_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          _Internal::set_has_stride_w(&has_bits);
+          stride_w_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 pad_h = 9 [default = 0];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
-          set_has_pad_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pad_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+          _Internal::set_has_pad_h(&has_bits);
+          pad_h_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 pad_w = 10 [default = 0];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_pad_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pad_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_pad_w(&has_bits);
+          pad_w_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT];
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::PoolingParameter_Engine_IsValid(value)) {
-            set_engine(static_cast< ::opencv_caffe::PoolingParameter_Engine >(value));
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::PoolingParameter_Engine_IsValid(val))) {
+            _internal_set_engine(static_cast<::opencv_caffe::PoolingParameter_Engine>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                11, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(11, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool global_pooling = 12 [default = false];
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) {
-          set_has_global_pooling();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &global_pooling_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool ceil_mode = 13 [default = true];
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
-          set_has_ceil_mode();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &ceil_mode_)));
-        } 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:opencv_caffe.PoolingParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.PoolingParameter)
-  return false;
-#undef DO_
-}
-
-void PoolingParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.PoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->pool(), output);
-  }
-
-  // optional uint32 kernel_size = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->kernel_size(), output);
-  }
-
-  // optional uint32 stride = 3 [default = 1];
-  if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->stride(), output);
-  }
-
-  // optional uint32 pad = 4 [default = 0];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->pad(), output);
-  }
-
-  // optional uint32 kernel_h = 5;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->kernel_h(), output);
-  }
-
-  // optional uint32 kernel_w = 6;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->kernel_w(), output);
-  }
-
-  // optional uint32 stride_h = 7;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->stride_h(), output);
-  }
-
-  // optional uint32 stride_w = 8;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->stride_w(), output);
-  }
-
-  // optional uint32 pad_h = 9 [default = 0];
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->pad_h(), output);
-  }
-
-  // optional uint32 pad_w = 10 [default = 0];
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->pad_w(), output);
-  }
-
-  // optional .opencv_caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT];
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      11, this->engine(), output);
-  }
-
-  // optional bool global_pooling = 12 [default = false];
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->global_pooling(), output);
-  }
-
-  // optional bool ceil_mode = 13 [default = true];
-  if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(13, this->ceil_mode(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.PoolingParameter)
+        continue;
+      // optional bool global_pooling = 12 [default = false];
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
+          _Internal::set_has_global_pooling(&has_bits);
+          global_pooling_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool ceil_mode = 13 [default = true];
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
+          _Internal::set_has_ceil_mode(&has_bits);
+          ceil_mode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* PoolingParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* PoolingParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->pool(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_pool(), target);
   }
 
   // optional uint32 kernel_size = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->kernel_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_kernel_size(), target);
   }
 
   // optional uint32 stride = 3 [default = 1];
   if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->stride(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_stride(), target);
   }
 
   // optional uint32 pad = 4 [default = 0];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->pad(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_pad(), target);
   }
 
   // optional uint32 kernel_h = 5;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->kernel_h(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_kernel_h(), target);
   }
 
   // optional uint32 kernel_w = 6;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->kernel_w(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_kernel_w(), target);
   }
 
   // optional uint32 stride_h = 7;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->stride_h(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_stride_h(), target);
   }
 
   // optional uint32 stride_w = 8;
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->stride_w(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(8, this->_internal_stride_w(), target);
   }
 
   // optional uint32 pad_h = 9 [default = 0];
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->pad_h(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(9, this->_internal_pad_h(), target);
   }
 
   // optional uint32 pad_w = 10 [default = 0];
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->pad_w(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->_internal_pad_w(), target);
   }
 
   // optional .opencv_caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT];
   if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      11, this->engine(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      11, this->_internal_engine(), target);
   }
 
   // optional bool global_pooling = 12 [default = false];
   if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->global_pooling(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(12, this->_internal_global_pooling(), target);
   }
 
   // optional bool ceil_mode = 13 [default = true];
   if (cached_has_bits & 0x00001000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(13, this->ceil_mode(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(13, this->_internal_ceil_mode(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.PoolingParameter)
   return target;
@@ -29368,131 +24210,106 @@ size_t PoolingParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PoolingParameter)
   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] & 255u) {
+  uint32_t 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 & 0x000000ffu) {
     // optional .opencv_caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX];
-    if (has_pool()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_pool());
     }
 
     // optional uint32 kernel_size = 2;
-    if (has_kernel_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->kernel_size());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_kernel_size());
     }
 
     // optional uint32 pad = 4 [default = 0];
-    if (has_pad()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pad());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pad());
     }
 
     // optional uint32 kernel_h = 5;
-    if (has_kernel_h()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->kernel_h());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_kernel_h());
     }
 
     // optional uint32 kernel_w = 6;
-    if (has_kernel_w()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->kernel_w());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_kernel_w());
     }
 
     // optional uint32 stride_h = 7;
-    if (has_stride_h()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->stride_h());
+    if (cached_has_bits & 0x00000020u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_stride_h());
     }
 
     // optional uint32 stride_w = 8;
-    if (has_stride_w()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->stride_w());
+    if (cached_has_bits & 0x00000040u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_stride_w());
     }
 
     // optional uint32 pad_h = 9 [default = 0];
-    if (has_pad_h()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pad_h());
+    if (cached_has_bits & 0x00000080u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pad_h());
     }
 
   }
-  if (_has_bits_[8 / 32] & 7936u) {
+  if (cached_has_bits & 0x00001f00u) {
     // optional uint32 pad_w = 10 [default = 0];
-    if (has_pad_w()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pad_w());
+    if (cached_has_bits & 0x00000100u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pad_w());
     }
 
     // optional .opencv_caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT];
-    if (has_engine()) {
+    if (cached_has_bits & 0x00000200u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_engine());
     }
 
     // optional bool global_pooling = 12 [default = false];
-    if (has_global_pooling()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 1 + 1;
     }
 
     // optional uint32 stride = 3 [default = 1];
-    if (has_stride()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->stride());
+    if (cached_has_bits & 0x00000800u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_stride());
     }
 
     // optional bool ceil_mode = 13 [default = true];
-    if (has_ceil_mode()) {
+    if (cached_has_bits & 0x00001000u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void PoolingParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.PoolingParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const PoolingParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const PoolingParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.PoolingParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.PoolingParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PoolingParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    PoolingParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PoolingParameter::GetClassData() const { return &_class_data_; }
+
+void PoolingParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<PoolingParameter *>(to)->MergeFrom(
+      static_cast<const PoolingParameter &>(from));
 }
 
+
 void PoolingParameter::MergeFrom(const PoolingParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PoolingParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
       pool_ = from.pool_;
     }
@@ -29519,7 +24336,7 @@ void PoolingParameter::MergeFrom(const PoolingParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 7936u) {
+  if (cached_has_bits & 0x00001f00u) {
     if (cached_has_bits & 0x00000100u) {
       pad_w_ = from.pad_w_;
     }
@@ -29537,13 +24354,7 @@ void PoolingParameter::MergeFrom(const PoolingParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void PoolingParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.PoolingParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void PoolingParameter::CopyFrom(const PoolingParameter& from) {
@@ -29557,247 +24368,190 @@ bool PoolingParameter::IsInitialized() const {
   return true;
 }
 
-void PoolingParameter::Swap(PoolingParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void PoolingParameter::InternalSwap(PoolingParameter* other) {
   using std::swap;
-  swap(pool_, other->pool_);
-  swap(kernel_size_, other->kernel_size_);
-  swap(pad_, other->pad_);
-  swap(kernel_h_, other->kernel_h_);
-  swap(kernel_w_, other->kernel_w_);
-  swap(stride_h_, other->stride_h_);
-  swap(stride_w_, other->stride_w_);
-  swap(pad_h_, other->pad_h_);
-  swap(pad_w_, other->pad_w_);
-  swap(engine_, other->engine_);
-  swap(global_pooling_, other->global_pooling_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(PoolingParameter, global_pooling_)
+      + sizeof(PoolingParameter::global_pooling_)
+      - PROTOBUF_FIELD_OFFSET(PoolingParameter, pool_)>(
+          reinterpret_cast<char*>(&pool_),
+          reinterpret_cast<char*>(&other->pool_));
   swap(stride_, other->stride_);
   swap(ceil_mode_, other->ceil_mode_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata PoolingParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata PoolingParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[48]);
 }
 
-
 // ===================================================================
 
-void PowerParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int PowerParameter::kPowerFieldNumber;
-const int PowerParameter::kScaleFieldNumber;
-const int PowerParameter::kShiftFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-PowerParameter::PowerParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPowerParameter();
+class PowerParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<PowerParameter>()._has_bits_);
+  static void set_has_power(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+  static void set_has_shift(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+PowerParameter::PowerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.PowerParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.PowerParameter)
 }
 PowerParameter::PowerParameter(const PowerParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&shift_, &from.shift_,
     static_cast<size_t>(reinterpret_cast<char*>(&scale_) -
     reinterpret_cast<char*>(&shift_)) + sizeof(scale_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.PowerParameter)
 }
 
-void PowerParameter::SharedCtor() {
-  _cached_size_ = 0;
-  shift_ = 0;
-  power_ = 1;
-  scale_ = 1;
+inline void PowerParameter::SharedCtor() {
+shift_ = 0;
+power_ = 1;
+scale_ = 1;
 }
 
 PowerParameter::~PowerParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.PowerParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void PowerParameter::SharedDtor() {
+inline void PowerParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void PowerParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void PowerParameter::ArenaDtor(void* object) {
+  PowerParameter* _this = reinterpret_cast< PowerParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* PowerParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const PowerParameter& PowerParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPowerParameter();
-  return *internal_default_instance();
+void PowerParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-PowerParameter* PowerParameter::New(::google::protobuf::Arena* arena) const {
-  PowerParameter* n = new PowerParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void PowerParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void PowerParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.PowerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     shift_ = 0;
     power_ = 1;
     scale_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool PowerParameter::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:opencv_caffe.PowerParameter)
-  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 float power = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_power();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &power_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* PowerParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float power = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_power(&has_bits);
+          power_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float scale = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_scale(&has_bits);
+          scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float shift = 3 [default = 0];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_shift();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &shift_)));
-        } 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:opencv_caffe.PowerParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_shift(&has_bits);
+          shift_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.PowerParameter)
-  return false;
-#undef DO_
-}
-
-void PowerParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.PowerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float power = 1 [default = 1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->power(), output);
-  }
-
-  // optional float scale = 2 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output);
-  }
-
-  // optional float shift = 3 [default = 0];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->shift(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.PowerParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* PowerParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* PowerParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PowerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float power = 1 [default = 1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->power(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_power(), target);
   }
 
   // optional float scale = 2 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_scale(), target);
   }
 
   // optional float shift = 3 [default = 0];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->shift(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_shift(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.PowerParameter)
   return target;
@@ -29807,59 +24561,52 @@ size_t PowerParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PowerParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional float shift = 3 [default = 0];
-    if (has_shift()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 4;
     }
 
     // optional float power = 1 [default = 1];
-    if (has_power()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 4;
     }
 
     // optional float scale = 2 [default = 1];
-    if (has_scale()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void PowerParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.PowerParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const PowerParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const PowerParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.PowerParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.PowerParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PowerParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    PowerParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PowerParameter::GetClassData() const { return &_class_data_; }
+
+void PowerParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<PowerParameter *>(to)->MergeFrom(
+      static_cast<const PowerParameter &>(from));
 }
 
+
 void PowerParameter::MergeFrom(const PowerParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PowerParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       shift_ = from.shift_;
     }
@@ -29871,13 +24618,7 @@ void PowerParameter::MergeFrom(const PowerParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void PowerParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.PowerParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void PowerParameter::CopyFrom(const PowerParameter& from) {
@@ -29891,325 +24632,266 @@ bool PowerParameter::IsInitialized() const {
   return true;
 }
 
-void PowerParameter::Swap(PowerParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void PowerParameter::InternalSwap(PowerParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(shift_, other->shift_);
   swap(power_, other->power_);
   swap(scale_, other->scale_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata PowerParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata PowerParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[49]);
 }
 
-
 // ===================================================================
 
-void PythonParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int PythonParameter::kModuleFieldNumber;
-const int PythonParameter::kLayerFieldNumber;
-const int PythonParameter::kParamStrFieldNumber;
-const int PythonParameter::kShareInParallelFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-PythonParameter::PythonParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPythonParameter();
+class PythonParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<PythonParameter>()._has_bits_);
+  static void set_has_module(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_layer(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_param_str(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+  static void set_has_share_in_parallel(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+};
+
+PythonParameter::PythonParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.PythonParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.PythonParameter)
 }
 PythonParameter::PythonParameter(const PythonParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  module_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_module()) {
-    module_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.module_);
-  }
-  layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_layer()) {
-    layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.layer_);
-  }
-  param_str_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_param_str()) {
-    param_str_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.param_str_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  module_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    module_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_module()) {
+    module_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_module(),
+      GetArenaForAllocation());
+  }
+  layer_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    layer_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_layer()) {
+    layer_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_layer(),
+      GetArenaForAllocation());
+  }
+  param_str_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    param_str_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_param_str()) {
+    param_str_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_param_str(),
+      GetArenaForAllocation());
   }
   share_in_parallel_ = from.share_in_parallel_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.PythonParameter)
 }
 
-void PythonParameter::SharedCtor() {
-  _cached_size_ = 0;
-  module_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  param_str_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  share_in_parallel_ = false;
+inline void PythonParameter::SharedCtor() {
+module_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  module_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+layer_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  layer_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+param_str_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  param_str_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+share_in_parallel_ = false;
 }
 
 PythonParameter::~PythonParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.PythonParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void PythonParameter::SharedDtor() {
-  module_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  layer_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  param_str_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void PythonParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  module_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  layer_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  param_str_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void PythonParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* PythonParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void PythonParameter::ArenaDtor(void* object) {
+  PythonParameter* _this = reinterpret_cast< PythonParameter* >(object);
+  (void)_this;
 }
-
-const PythonParameter& PythonParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPythonParameter();
-  return *internal_default_instance();
+void PythonParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-PythonParameter* PythonParameter::New(::google::protobuf::Arena* arena) const {
-  PythonParameter* n = new PythonParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void PythonParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void PythonParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.PythonParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!module_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*module_.UnsafeRawStringPointer())->clear();
+      module_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!layer_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*layer_.UnsafeRawStringPointer())->clear();
+      layer_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!param_str_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*param_str_.UnsafeRawStringPointer())->clear();
+      param_str_.ClearNonDefaultToEmpty();
     }
   }
   share_in_parallel_ = false;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool PythonParameter::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:opencv_caffe.PythonParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string module = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_module()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->module().data(), static_cast<int>(this->module().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.PythonParameter.module");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* PythonParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string module = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_module();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.PythonParameter.module");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string layer = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_layer()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->layer().data(), static_cast<int>(this->layer().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.PythonParameter.layer");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_layer();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.PythonParameter.layer");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string param_str = 3 [default = ""];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_param_str()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->param_str().data(), static_cast<int>(this->param_str().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.PythonParameter.param_str");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_param_str();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.PythonParameter.param_str");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool share_in_parallel = 4 [default = false];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_share_in_parallel();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &share_in_parallel_)));
-        } 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:opencv_caffe.PythonParameter)
-  return true;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_share_in_parallel(&has_bits);
+          share_in_parallel_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.PythonParameter)
-  return false;
-#undef DO_
-}
-
-void PythonParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.PythonParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string module = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->module().data(), static_cast<int>(this->module().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.PythonParameter.module");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->module(), output);
-  }
-
-  // optional string layer = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->layer().data(), static_cast<int>(this->layer().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.PythonParameter.layer");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->layer(), output);
-  }
-
-  // optional string param_str = 3 [default = ""];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->param_str().data(), static_cast<int>(this->param_str().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.PythonParameter.param_str");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->param_str(), output);
-  }
-
-  // optional bool share_in_parallel = 4 [default = false];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->share_in_parallel(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.PythonParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* PythonParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* PythonParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PythonParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string module = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->module().data(), static_cast<int>(this->module().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_module().data(), static_cast<int>(this->_internal_module().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.PythonParameter.module");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->module(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_module(), target);
   }
 
   // optional string layer = 2;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->layer().data(), static_cast<int>(this->layer().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_layer().data(), static_cast<int>(this->_internal_layer().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.PythonParameter.layer");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->layer(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_layer(), target);
   }
 
   // optional string param_str = 3 [default = ""];
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->param_str().data(), static_cast<int>(this->param_str().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_param_str().data(), static_cast<int>(this->_internal_param_str().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.PythonParameter.param_str");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->param_str(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_param_str(), target);
   }
 
   // optional bool share_in_parallel = 4 [default = false];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->share_in_parallel(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_share_in_parallel(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.PythonParameter)
   return target;
@@ -30219,94 +24901,78 @@ size_t PythonParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PythonParameter)
   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] & 15u) {
+  uint32_t 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 & 0x0000000fu) {
     // optional string module = 1;
-    if (has_module()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->module());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_module());
     }
 
     // optional string layer = 2;
-    if (has_layer()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->layer());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_layer());
     }
 
     // optional string param_str = 3 [default = ""];
-    if (has_param_str()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->param_str());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_param_str());
     }
 
     // optional bool share_in_parallel = 4 [default = false];
-    if (has_share_in_parallel()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void PythonParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.PythonParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const PythonParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const PythonParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.PythonParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.PythonParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PythonParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    PythonParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PythonParameter::GetClassData() const { return &_class_data_; }
+
+void PythonParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<PythonParameter *>(to)->MergeFrom(
+      static_cast<const PythonParameter &>(from));
 }
 
+
 void PythonParameter::MergeFrom(const PythonParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PythonParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_module();
-      module_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.module_);
+      _internal_set_module(from._internal_module());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_layer();
-      layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.layer_);
+      _internal_set_layer(from._internal_layer());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_param_str();
-      param_str_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.param_str_);
+      _internal_set_param_str(from._internal_param_str());
     }
     if (cached_has_bits & 0x00000008u) {
       share_in_parallel_ = from.share_in_parallel_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void PythonParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.PythonParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void PythonParameter::CopyFrom(const PythonParameter& from) {
@@ -30320,66 +24986,90 @@ bool PythonParameter::IsInitialized() const {
   return true;
 }
 
-void PythonParameter::Swap(PythonParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void PythonParameter::InternalSwap(PythonParameter* other) {
   using std::swap;
-  module_.Swap(&other->module_);
-  layer_.Swap(&other->layer_);
-  param_str_.Swap(&other->param_str_);
-  swap(share_in_parallel_, other->share_in_parallel_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &module_, lhs_arena,
+      &other->module_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &layer_, lhs_arena,
+      &other->layer_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &param_str_, lhs_arena,
+      &other->param_str_, rhs_arena
+  );
+  swap(share_in_parallel_, other->share_in_parallel_);
 }
 
-::google::protobuf::Metadata PythonParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata PythonParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[50]);
 }
 
-
 // ===================================================================
 
-void RecurrentParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_RecurrentParameter_default_instance_._instance.get_mutable()->weight_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-  ::opencv_caffe::_RecurrentParameter_default_instance_._instance.get_mutable()->bias_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int RecurrentParameter::kNumOutputFieldNumber;
-const int RecurrentParameter::kWeightFillerFieldNumber;
-const int RecurrentParameter::kBiasFillerFieldNumber;
-const int RecurrentParameter::kDebugInfoFieldNumber;
-const int RecurrentParameter::kExposeHiddenFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-RecurrentParameter::RecurrentParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsRecurrentParameter();
+class RecurrentParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<RecurrentParameter>()._has_bits_);
+  static void set_has_num_output(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static const ::opencv_caffe::FillerParameter& weight_filler(const RecurrentParameter* msg);
+  static void set_has_weight_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static const ::opencv_caffe::FillerParameter& bias_filler(const RecurrentParameter* msg);
+  static void set_has_bias_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_debug_info(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_expose_hidden(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
+};
+
+const ::opencv_caffe::FillerParameter&
+RecurrentParameter::_Internal::weight_filler(const RecurrentParameter* msg) {
+  return *msg->weight_filler_;
+}
+const ::opencv_caffe::FillerParameter&
+RecurrentParameter::_Internal::bias_filler(const RecurrentParameter* msg) {
+  return *msg->bias_filler_;
+}
+RecurrentParameter::RecurrentParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.RecurrentParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.RecurrentParameter)
 }
 RecurrentParameter::RecurrentParameter(const RecurrentParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_weight_filler()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_weight_filler()) {
     weight_filler_ = new ::opencv_caffe::FillerParameter(*from.weight_filler_);
   } else {
-    weight_filler_ = NULL;
+    weight_filler_ = nullptr;
   }
-  if (from.has_bias_filler()) {
+  if (from._internal_has_bias_filler()) {
     bias_filler_ = new ::opencv_caffe::FillerParameter(*from.bias_filler_);
   } else {
-    bias_filler_ = NULL;
+    bias_filler_ = nullptr;
   }
   ::memcpy(&num_output_, &from.num_output_,
     static_cast<size_t>(reinterpret_cast<char*>(&expose_hidden_) -
@@ -30387,249 +25077,180 @@ RecurrentParameter::RecurrentParameter(const RecurrentParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.RecurrentParameter)
 }
 
-void RecurrentParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&weight_filler_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&expose_hidden_) -
-      reinterpret_cast<char*>(&weight_filler_)) + sizeof(expose_hidden_));
+inline void RecurrentParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&weight_filler_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&expose_hidden_) -
+    reinterpret_cast<char*>(&weight_filler_)) + sizeof(expose_hidden_));
 }
 
 RecurrentParameter::~RecurrentParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.RecurrentParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void RecurrentParameter::SharedDtor() {
+inline void RecurrentParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete weight_filler_;
   if (this != internal_default_instance()) delete bias_filler_;
 }
 
-void RecurrentParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* RecurrentParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void RecurrentParameter::ArenaDtor(void* object) {
+  RecurrentParameter* _this = reinterpret_cast< RecurrentParameter* >(object);
+  (void)_this;
 }
-
-const RecurrentParameter& RecurrentParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsRecurrentParameter();
-  return *internal_default_instance();
+void RecurrentParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-RecurrentParameter* RecurrentParameter::New(::google::protobuf::Arena* arena) const {
-  RecurrentParameter* n = new RecurrentParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void RecurrentParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void RecurrentParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.RecurrentParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(weight_filler_ != NULL);
+      GOOGLE_DCHECK(weight_filler_ != nullptr);
       weight_filler_->Clear();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(bias_filler_ != NULL);
+      GOOGLE_DCHECK(bias_filler_ != nullptr);
       bias_filler_->Clear();
     }
   }
-  if (cached_has_bits & 28u) {
+  if (cached_has_bits & 0x0000001cu) {
     ::memset(&num_output_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&expose_hidden_) -
         reinterpret_cast<char*>(&num_output_)) + sizeof(expose_hidden_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool RecurrentParameter::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:opencv_caffe.RecurrentParameter)
-  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 uint32 num_output = 1 [default = 0];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_num_output();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &num_output_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* RecurrentParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 num_output = 1 [default = 0];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_num_output(&has_bits);
+          num_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.FillerParameter weight_filler = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_weight_filler()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_weight_filler(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.FillerParameter bias_filler = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_bias_filler()));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_bias_filler(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool debug_info = 4 [default = false];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_debug_info();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &debug_info_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_debug_info(&has_bits);
+          debug_info_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool expose_hidden = 5 [default = false];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_expose_hidden();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &expose_hidden_)));
-        } 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:opencv_caffe.RecurrentParameter)
-  return true;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_expose_hidden(&has_bits);
+          expose_hidden_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.RecurrentParameter)
-  return false;
-#undef DO_
-}
-
-void RecurrentParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.RecurrentParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 num_output = 1 [default = 0];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_output(), output);
-  }
-
-  // optional .opencv_caffe.FillerParameter weight_filler = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->weight_filler_, output);
-  }
-
-  // optional .opencv_caffe.FillerParameter bias_filler = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->bias_filler_, output);
-  }
-
-  // optional bool debug_info = 4 [default = false];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->debug_info(), output);
-  }
-
-  // optional bool expose_hidden = 5 [default = false];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->expose_hidden(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.RecurrentParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* RecurrentParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* RecurrentParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.RecurrentParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 num_output = 1 [default = 0];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_output(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_output(), target);
   }
 
   // optional .opencv_caffe.FillerParameter weight_filler = 2;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, *this->weight_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        2, _Internal::weight_filler(this), target, stream);
   }
 
   // optional .opencv_caffe.FillerParameter bias_filler = 3;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->bias_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::bias_filler(this), target, stream);
   }
 
   // optional bool debug_info = 4 [default = false];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->debug_info(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_debug_info(), target);
   }
 
   // optional bool expose_hidden = 5 [default = false];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->expose_hidden(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_expose_hidden(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.RecurrentParameter)
   return target;
@@ -30639,80 +25260,71 @@ size_t RecurrentParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.RecurrentParameter)
   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] & 31u) {
+  uint32_t 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 & 0x0000001fu) {
     // optional .opencv_caffe.FillerParameter weight_filler = 2;
-    if (has_weight_filler()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->weight_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *weight_filler_);
     }
 
     // optional .opencv_caffe.FillerParameter bias_filler = 3;
-    if (has_bias_filler()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->bias_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *bias_filler_);
     }
 
     // optional uint32 num_output = 1 [default = 0];
-    if (has_num_output()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->num_output());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_num_output());
     }
 
     // optional bool debug_info = 4 [default = false];
-    if (has_debug_info()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 1;
     }
 
     // optional bool expose_hidden = 5 [default = false];
-    if (has_expose_hidden()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void RecurrentParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.RecurrentParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const RecurrentParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const RecurrentParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.RecurrentParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.RecurrentParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData RecurrentParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    RecurrentParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*RecurrentParameter::GetClassData() const { return &_class_data_; }
+
+void RecurrentParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<RecurrentParameter *>(to)->MergeFrom(
+      static_cast<const RecurrentParameter &>(from));
 }
 
+
 void RecurrentParameter::MergeFrom(const RecurrentParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.RecurrentParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 31u) {
+  if (cached_has_bits & 0x0000001fu) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.weight_filler());
+      _internal_mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_weight_filler());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.bias_filler());
+      _internal_mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_bias_filler());
     }
     if (cached_has_bits & 0x00000004u) {
       num_output_ = from.num_output_;
@@ -30725,13 +25337,7 @@ void RecurrentParameter::MergeFrom(const RecurrentParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void RecurrentParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.RecurrentParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void RecurrentParameter::CopyFrom(const RecurrentParameter& from) {
@@ -30745,247 +25351,193 @@ bool RecurrentParameter::IsInitialized() const {
   return true;
 }
 
-void RecurrentParameter::Swap(RecurrentParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void RecurrentParameter::InternalSwap(RecurrentParameter* other) {
   using std::swap;
-  swap(weight_filler_, other->weight_filler_);
-  swap(bias_filler_, other->bias_filler_);
-  swap(num_output_, other->num_output_);
-  swap(debug_info_, other->debug_info_);
-  swap(expose_hidden_, other->expose_hidden_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(RecurrentParameter, expose_hidden_)
+      + sizeof(RecurrentParameter::expose_hidden_)
+      - PROTOBUF_FIELD_OFFSET(RecurrentParameter, weight_filler_)>(
+          reinterpret_cast<char*>(&weight_filler_),
+          reinterpret_cast<char*>(&other->weight_filler_));
 }
 
-::google::protobuf::Metadata RecurrentParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata RecurrentParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[51]);
 }
 
-
 // ===================================================================
 
-void ReductionParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ReductionParameter::kOperationFieldNumber;
-const int ReductionParameter::kAxisFieldNumber;
-const int ReductionParameter::kCoeffFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ReductionParameter::ReductionParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReductionParameter();
+class ReductionParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ReductionParameter>()._has_bits_);
+  static void set_has_operation(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_coeff(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+};
+
+ReductionParameter::ReductionParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ReductionParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ReductionParameter)
 }
 ReductionParameter::ReductionParameter(const ReductionParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&axis_, &from.axis_,
     static_cast<size_t>(reinterpret_cast<char*>(&coeff_) -
     reinterpret_cast<char*>(&axis_)) + sizeof(coeff_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ReductionParameter)
 }
 
-void ReductionParameter::SharedCtor() {
-  _cached_size_ = 0;
-  axis_ = 0;
-  operation_ = 1;
-  coeff_ = 1;
+inline void ReductionParameter::SharedCtor() {
+axis_ = 0;
+operation_ = 1;
+coeff_ = 1;
 }
 
 ReductionParameter::~ReductionParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ReductionParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ReductionParameter::SharedDtor() {
+inline void ReductionParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ReductionParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ReductionParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ReductionParameter::ArenaDtor(void* object) {
+  ReductionParameter* _this = reinterpret_cast< ReductionParameter* >(object);
+  (void)_this;
 }
-
-const ReductionParameter& ReductionParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReductionParameter();
-  return *internal_default_instance();
+void ReductionParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ReductionParameter* ReductionParameter::New(::google::protobuf::Arena* arena) const {
-  ReductionParameter* n = new ReductionParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ReductionParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ReductionParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ReductionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     axis_ = 0;
     operation_ = 1;
     coeff_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ReductionParameter::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:opencv_caffe.ReductionParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* ReductionParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::ReductionParameter_ReductionOp_IsValid(value)) {
-            set_operation(static_cast< ::opencv_caffe::ReductionParameter_ReductionOp >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::ReductionParameter_ReductionOp_IsValid(val))) {
+            _internal_set_operation(static_cast<::opencv_caffe::ReductionParameter_ReductionOp>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int32 axis = 2 [default = 0];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float coeff = 3 [default = 1];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_coeff();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &coeff_)));
-        } 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:opencv_caffe.ReductionParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_coeff(&has_bits);
+          coeff_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ReductionParameter)
-  return false;
-#undef DO_
-}
-
-void ReductionParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ReductionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->operation(), output);
-  }
-
-  // optional int32 axis = 2 [default = 0];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output);
-  }
-
-  // optional float coeff = 3 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->coeff(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ReductionParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ReductionParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ReductionParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ReductionParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->operation(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_operation(), target);
   }
 
   // optional int32 axis = 2 [default = 0];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_axis(), target);
   }
 
   // optional float coeff = 3 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->coeff(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_coeff(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ReductionParameter)
   return target;
@@ -30995,62 +25547,53 @@ size_t ReductionParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ReductionParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional int32 axis = 2 [default = 0];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
     // optional .opencv_caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM];
-    if (has_operation()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->operation());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_operation());
     }
 
     // optional float coeff = 3 [default = 1];
-    if (has_coeff()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ReductionParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ReductionParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ReductionParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ReductionParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ReductionParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ReductionParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ReductionParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ReductionParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ReductionParameter::GetClassData() const { return &_class_data_; }
+
+void ReductionParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ReductionParameter *>(to)->MergeFrom(
+      static_cast<const ReductionParameter &>(from));
 }
 
+
 void ReductionParameter::MergeFrom(const ReductionParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ReductionParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       axis_ = from.axis_;
     }
@@ -31062,13 +25605,7 @@ void ReductionParameter::MergeFrom(const ReductionParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ReductionParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ReductionParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ReductionParameter::CopyFrom(const ReductionParameter& from) {
@@ -31082,220 +25619,173 @@ bool ReductionParameter::IsInitialized() const {
   return true;
 }
 
-void ReductionParameter::Swap(ReductionParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ReductionParameter::InternalSwap(ReductionParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(axis_, other->axis_);
   swap(operation_, other->operation_);
   swap(coeff_, other->coeff_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ReductionParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ReductionParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[52]);
 }
 
-
 // ===================================================================
 
-void ReLUParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ReLUParameter::kNegativeSlopeFieldNumber;
-const int ReLUParameter::kEngineFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ReLUParameter::ReLUParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReLUParameter();
+class ReLUParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ReLUParameter>()._has_bits_);
+  static void set_has_negative_slope(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_engine(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+ReLUParameter::ReLUParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ReLUParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ReLUParameter)
 }
 ReLUParameter::ReLUParameter(const ReLUParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&negative_slope_, &from.negative_slope_,
     static_cast<size_t>(reinterpret_cast<char*>(&engine_) -
     reinterpret_cast<char*>(&negative_slope_)) + sizeof(engine_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ReLUParameter)
 }
 
-void ReLUParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&negative_slope_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&engine_) -
-      reinterpret_cast<char*>(&negative_slope_)) + sizeof(engine_));
+inline void ReLUParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&negative_slope_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&engine_) -
+    reinterpret_cast<char*>(&negative_slope_)) + sizeof(engine_));
 }
 
 ReLUParameter::~ReLUParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ReLUParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ReLUParameter::SharedDtor() {
+inline void ReLUParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ReLUParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ReLUParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ReLUParameter::ArenaDtor(void* object) {
+  ReLUParameter* _this = reinterpret_cast< ReLUParameter* >(object);
+  (void)_this;
 }
-
-const ReLUParameter& ReLUParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReLUParameter();
-  return *internal_default_instance();
+void ReLUParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ReLUParameter* ReLUParameter::New(::google::protobuf::Arena* arena) const {
-  ReLUParameter* n = new ReLUParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ReLUParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ReLUParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ReLUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     ::memset(&negative_slope_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&engine_) -
         reinterpret_cast<char*>(&negative_slope_)) + sizeof(engine_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ReLUParameter::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:opencv_caffe.ReLUParameter)
-  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 float negative_slope = 1 [default = 0];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_negative_slope();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &negative_slope_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* ReLUParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float negative_slope = 1 [default = 0];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_negative_slope(&has_bits);
+          negative_slope_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::ReLUParameter_Engine_IsValid(value)) {
-            set_engine(static_cast< ::opencv_caffe::ReLUParameter_Engine >(value));
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::ReLUParameter_Engine_IsValid(val))) {
+            _internal_set_engine(static_cast<::opencv_caffe::ReLUParameter_Engine>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                2, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
           }
-        } 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:opencv_caffe.ReLUParameter)
-  return true;
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ReLUParameter)
-  return false;
-#undef DO_
-}
-
-void ReLUParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ReLUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float negative_slope = 1 [default = 0];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->negative_slope(), output);
-  }
-
-  // optional .opencv_caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      2, this->engine(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ReLUParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ReLUParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ReLUParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ReLUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float negative_slope = 1 [default = 0];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->negative_slope(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_negative_slope(), target);
   }
 
   // optional .opencv_caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      2, this->engine(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      2, this->_internal_engine(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ReLUParameter)
   return target;
@@ -31305,55 +25795,48 @@ size_t ReLUParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ReLUParameter)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional float negative_slope = 1 [default = 0];
-    if (has_negative_slope()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 4;
     }
 
     // optional .opencv_caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT];
-    if (has_engine()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_engine());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ReLUParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ReLUParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ReLUParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ReLUParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ReLUParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ReLUParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ReLUParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ReLUParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ReLUParameter::GetClassData() const { return &_class_data_; }
+
+void ReLUParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ReLUParameter *>(to)->MergeFrom(
+      static_cast<const ReLUParameter &>(from));
 }
 
+
 void ReLUParameter::MergeFrom(const ReLUParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ReLUParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       negative_slope_ = from.negative_slope_;
     }
@@ -31362,13 +25845,7 @@ void ReLUParameter::MergeFrom(const ReLUParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ReLUParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ReLUParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ReLUParameter::CopyFrom(const ReLUParameter& from) {
@@ -31382,55 +25859,62 @@ bool ReLUParameter::IsInitialized() const {
   return true;
 }
 
-void ReLUParameter::Swap(ReLUParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ReLUParameter::InternalSwap(ReLUParameter* other) {
   using std::swap;
-  swap(negative_slope_, other->negative_slope_);
-  swap(engine_, other->engine_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ReLUParameter, engine_)
+      + sizeof(ReLUParameter::engine_)
+      - PROTOBUF_FIELD_OFFSET(ReLUParameter, negative_slope_)>(
+          reinterpret_cast<char*>(&negative_slope_),
+          reinterpret_cast<char*>(&other->negative_slope_));
 }
 
-::google::protobuf::Metadata ReLUParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ReLUParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[53]);
 }
 
-
 // ===================================================================
 
-void ReshapeParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_ReshapeParameter_default_instance_._instance.get_mutable()->shape_ = const_cast< ::opencv_caffe::BlobShape*>(
-      ::opencv_caffe::BlobShape::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ReshapeParameter::kShapeFieldNumber;
-const int ReshapeParameter::kAxisFieldNumber;
-const int ReshapeParameter::kNumAxesFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ReshapeParameter::ReshapeParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReshapeParameter();
+class ReshapeParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ReshapeParameter>()._has_bits_);
+  static const ::opencv_caffe::BlobShape& shape(const ReshapeParameter* msg);
+  static void set_has_shape(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_num_axes(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+};
+
+const ::opencv_caffe::BlobShape&
+ReshapeParameter::_Internal::shape(const ReshapeParameter* msg) {
+  return *msg->shape_;
+}
+ReshapeParameter::ReshapeParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ReshapeParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ReshapeParameter)
 }
 ReshapeParameter::ReshapeParameter(const ReshapeParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_shape()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_shape()) {
     shape_ = new ::opencv_caffe::BlobShape(*from.shape_);
   } else {
-    shape_ = NULL;
+    shape_ = nullptr;
   }
   ::memcpy(&axis_, &from.axis_,
     static_cast<size_t>(reinterpret_cast<char*>(&num_axes_) -
@@ -31438,193 +25922,142 @@ ReshapeParameter::ReshapeParameter(const ReshapeParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ReshapeParameter)
 }
 
-void ReshapeParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&shape_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&axis_) -
-      reinterpret_cast<char*>(&shape_)) + sizeof(axis_));
-  num_axes_ = -1;
+inline void ReshapeParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&shape_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&axis_) -
+    reinterpret_cast<char*>(&shape_)) + sizeof(axis_));
+num_axes_ = -1;
 }
 
 ReshapeParameter::~ReshapeParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ReshapeParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ReshapeParameter::SharedDtor() {
+inline void ReshapeParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete shape_;
 }
 
-void ReshapeParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void ReshapeParameter::ArenaDtor(void* object) {
+  ReshapeParameter* _this = reinterpret_cast< ReshapeParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* ReshapeParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const ReshapeParameter& ReshapeParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReshapeParameter();
-  return *internal_default_instance();
+void ReshapeParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ReshapeParameter* ReshapeParameter::New(::google::protobuf::Arena* arena) const {
-  ReshapeParameter* n = new ReshapeParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ReshapeParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ReshapeParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ReshapeParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(shape_ != NULL);
+    GOOGLE_DCHECK(shape_ != nullptr);
     shape_->Clear();
   }
-  if (cached_has_bits & 6u) {
+  if (cached_has_bits & 0x00000006u) {
     axis_ = 0;
     num_axes_ = -1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ReshapeParameter::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:opencv_caffe.ReshapeParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* ReshapeParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.BlobShape shape = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_shape()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_shape(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int32 axis = 2 [default = 0];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 num_axes = 3 [default = -1];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_num_axes();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &num_axes_)));
-        } 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:opencv_caffe.ReshapeParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_num_axes(&has_bits);
+          num_axes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ReshapeParameter)
-  return false;
-#undef DO_
-}
-
-void ReshapeParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ReshapeParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.BlobShape shape = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->shape_, output);
-  }
-
-  // optional int32 axis = 2 [default = 0];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output);
-  }
-
-  // optional int32 num_axes = 3 [default = -1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->num_axes(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ReshapeParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ReshapeParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ReshapeParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ReshapeParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.BlobShape shape = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *this->shape_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::shape(this), target, stream);
   }
 
   // optional int32 axis = 2 [default = 0];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_axis(), target);
   }
 
   // optional int32 num_axes = 3 [default = -1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->num_axes(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_num_axes(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ReshapeParameter)
   return target;
@@ -31634,67 +26067,56 @@ size_t ReshapeParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ReshapeParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional .opencv_caffe.BlobShape shape = 1;
-    if (has_shape()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->shape_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *shape_);
     }
 
     // optional int32 axis = 2 [default = 0];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
     // optional int32 num_axes = 3 [default = -1];
-    if (has_num_axes()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->num_axes());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_num_axes());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ReshapeParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ReshapeParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ReshapeParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ReshapeParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ReshapeParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ReshapeParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ReshapeParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ReshapeParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ReshapeParameter::GetClassData() const { return &_class_data_; }
+
+void ReshapeParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ReshapeParameter *>(to)->MergeFrom(
+      static_cast<const ReshapeParameter &>(from));
 }
 
+
 void ReshapeParameter::MergeFrom(const ReshapeParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ReshapeParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_shape()->::opencv_caffe::BlobShape::MergeFrom(from.shape());
+      _internal_mutable_shape()->::opencv_caffe::BlobShape::MergeFrom(from._internal_shape());
     }
     if (cached_has_bits & 0x00000002u) {
       axis_ = from.axis_;
@@ -31704,13 +26126,7 @@ void ReshapeParameter::MergeFrom(const ReshapeParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ReshapeParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ReshapeParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ReshapeParameter::CopyFrom(const ReshapeParameter& from) {
@@ -31724,65 +26140,79 @@ bool ReshapeParameter::IsInitialized() const {
   return true;
 }
 
-void ReshapeParameter::Swap(ReshapeParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ReshapeParameter::InternalSwap(ReshapeParameter* other) {
   using std::swap;
-  swap(shape_, other->shape_);
-  swap(axis_, other->axis_);
-  swap(num_axes_, other->num_axes_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ReshapeParameter, axis_)
+      + sizeof(ReshapeParameter::axis_)
+      - PROTOBUF_FIELD_OFFSET(ReshapeParameter, shape_)>(
+          reinterpret_cast<char*>(&shape_),
+          reinterpret_cast<char*>(&other->shape_));
+  swap(num_axes_, other->num_axes_);
 }
 
-::google::protobuf::Metadata ReshapeParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ReshapeParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[54]);
 }
 
-
 // ===================================================================
 
-void ScaleParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_ScaleParameter_default_instance_._instance.get_mutable()->filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-  ::opencv_caffe::_ScaleParameter_default_instance_._instance.get_mutable()->bias_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ScaleParameter::kAxisFieldNumber;
-const int ScaleParameter::kNumAxesFieldNumber;
-const int ScaleParameter::kFillerFieldNumber;
-const int ScaleParameter::kBiasTermFieldNumber;
-const int ScaleParameter::kBiasFillerFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ScaleParameter::ScaleParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsScaleParameter();
+class ScaleParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ScaleParameter>()._has_bits_);
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
+  static void set_has_num_axes(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static const ::opencv_caffe::FillerParameter& filler(const ScaleParameter* msg);
+  static void set_has_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_bias_term(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static const ::opencv_caffe::FillerParameter& bias_filler(const ScaleParameter* msg);
+  static void set_has_bias_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+const ::opencv_caffe::FillerParameter&
+ScaleParameter::_Internal::filler(const ScaleParameter* msg) {
+  return *msg->filler_;
+}
+const ::opencv_caffe::FillerParameter&
+ScaleParameter::_Internal::bias_filler(const ScaleParameter* msg) {
+  return *msg->bias_filler_;
+}
+ScaleParameter::ScaleParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ScaleParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ScaleParameter)
 }
 ScaleParameter::ScaleParameter(const ScaleParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_filler()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_filler()) {
     filler_ = new ::opencv_caffe::FillerParameter(*from.filler_);
   } else {
-    filler_ = NULL;
+    filler_ = nullptr;
   }
-  if (from.has_bias_filler()) {
+  if (from._internal_has_bias_filler()) {
     bias_filler_ = new ::opencv_caffe::FillerParameter(*from.bias_filler_);
   } else {
-    bias_filler_ = NULL;
+    bias_filler_ = nullptr;
   }
   ::memcpy(&bias_term_, &from.bias_term_,
     static_cast<size_t>(reinterpret_cast<char*>(&num_axes_) -
@@ -31790,251 +26220,182 @@ ScaleParameter::ScaleParameter(const ScaleParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ScaleParameter)
 }
 
-void ScaleParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&filler_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&bias_term_) -
-      reinterpret_cast<char*>(&filler_)) + sizeof(bias_term_));
-  axis_ = 1;
-  num_axes_ = 1;
+inline void ScaleParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&filler_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&bias_term_) -
+    reinterpret_cast<char*>(&filler_)) + sizeof(bias_term_));
+axis_ = 1;
+num_axes_ = 1;
 }
 
 ScaleParameter::~ScaleParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ScaleParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ScaleParameter::SharedDtor() {
+inline void ScaleParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete filler_;
   if (this != internal_default_instance()) delete bias_filler_;
 }
 
-void ScaleParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ScaleParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ScaleParameter::ArenaDtor(void* object) {
+  ScaleParameter* _this = reinterpret_cast< ScaleParameter* >(object);
+  (void)_this;
 }
-
-const ScaleParameter& ScaleParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsScaleParameter();
-  return *internal_default_instance();
+void ScaleParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ScaleParameter* ScaleParameter::New(::google::protobuf::Arena* arena) const {
-  ScaleParameter* n = new ScaleParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ScaleParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ScaleParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ScaleParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(filler_ != NULL);
+      GOOGLE_DCHECK(filler_ != nullptr);
       filler_->Clear();
     }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(bias_filler_ != NULL);
-      bias_filler_->Clear();
-    }
-  }
-  if (cached_has_bits & 28u) {
-    bias_term_ = false;
-    axis_ = 1;
-    num_axes_ = 1;
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ScaleParameter::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:opencv_caffe.ScaleParameter)
-  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 axis = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int32 num_axes = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_num_axes();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &num_axes_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.FillerParameter filler = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_filler()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool bias_term = 4 [default = false];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_bias_term();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &bias_term_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_caffe.FillerParameter bias_filler = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_bias_filler()));
-        } 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:opencv_caffe.ScaleParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ScaleParameter)
-  return false;
-#undef DO_
-}
-
-void ScaleParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ScaleParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 axis = 1 [default = 1];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output);
-  }
-
-  // optional int32 num_axes = 2 [default = 1];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_axes(), output);
-  }
-
-  // optional .opencv_caffe.FillerParameter filler = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->filler_, output);
-  }
-
-  // optional bool bias_term = 4 [default = false];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bias_term(), output);
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(bias_filler_ != nullptr);
+      bias_filler_->Clear();
+    }
   }
-
-  // optional .opencv_caffe.FillerParameter bias_filler = 5;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, *this->bias_filler_, output);
+  if (cached_has_bits & 0x0000001cu) {
+    bias_term_ = false;
+    axis_ = 1;
+    num_axes_ = 1;
   }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ScaleParameter)
+const char* ScaleParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 axis = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int32 num_axes = 2 [default = 1];
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_num_axes(&has_bits);
+          num_axes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.FillerParameter filler = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_filler(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool bias_term = 4 [default = false];
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_bias_term(&has_bits);
+          bias_term_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_caffe.FillerParameter bias_filler = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_bias_filler(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ScaleParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ScaleParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ScaleParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int32 axis = 1 [default = 1];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_axis(), target);
   }
 
   // optional int32 num_axes = 2 [default = 1];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_axes(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_num_axes(), target);
   }
 
   // optional .opencv_caffe.FillerParameter filler = 3;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::filler(this), target, stream);
   }
 
   // optional bool bias_term = 4 [default = false];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bias_term(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_bias_term(), target);
   }
 
   // optional .opencv_caffe.FillerParameter bias_filler = 5;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, *this->bias_filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        5, _Internal::bias_filler(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ScaleParameter)
   return target;
@@ -32044,82 +26405,71 @@ size_t ScaleParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ScaleParameter)
   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] & 31u) {
+  uint32_t 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 & 0x0000001fu) {
     // optional .opencv_caffe.FillerParameter filler = 3;
-    if (has_filler()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *filler_);
     }
 
     // optional .opencv_caffe.FillerParameter bias_filler = 5;
-    if (has_bias_filler()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->bias_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *bias_filler_);
     }
 
     // optional bool bias_term = 4 [default = false];
-    if (has_bias_term()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 1;
     }
 
     // optional int32 axis = 1 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
     // optional int32 num_axes = 2 [default = 1];
-    if (has_num_axes()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->num_axes());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_num_axes());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ScaleParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ScaleParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ScaleParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ScaleParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ScaleParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ScaleParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ScaleParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ScaleParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ScaleParameter::GetClassData() const { return &_class_data_; }
+
+void ScaleParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ScaleParameter *>(to)->MergeFrom(
+      static_cast<const ScaleParameter &>(from));
 }
 
+
 void ScaleParameter::MergeFrom(const ScaleParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ScaleParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 31u) {
+  if (cached_has_bits & 0x0000001fu) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.filler());
+      _internal_mutable_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_filler());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.bias_filler());
+      _internal_mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_bias_filler());
     }
     if (cached_has_bits & 0x00000004u) {
       bias_term_ = from.bias_term_;
@@ -32132,13 +26482,7 @@ void ScaleParameter::MergeFrom(const ScaleParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ScaleParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ScaleParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ScaleParameter::CopyFrom(const ScaleParameter& from) {
@@ -32152,188 +26496,150 @@ bool ScaleParameter::IsInitialized() const {
   return true;
 }
 
-void ScaleParameter::Swap(ScaleParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ScaleParameter::InternalSwap(ScaleParameter* other) {
   using std::swap;
-  swap(filler_, other->filler_);
-  swap(bias_filler_, other->bias_filler_);
-  swap(bias_term_, other->bias_term_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ScaleParameter, bias_term_)
+      + sizeof(ScaleParameter::bias_term_)
+      - PROTOBUF_FIELD_OFFSET(ScaleParameter, filler_)>(
+          reinterpret_cast<char*>(&filler_),
+          reinterpret_cast<char*>(&other->filler_));
   swap(axis_, other->axis_);
   swap(num_axes_, other->num_axes_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ScaleParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ScaleParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[55]);
 }
 
-
 // ===================================================================
 
-void SigmoidParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SigmoidParameter::kEngineFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-SigmoidParameter::SigmoidParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSigmoidParameter();
+class SigmoidParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<SigmoidParameter>()._has_bits_);
+  static void set_has_engine(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+SigmoidParameter::SigmoidParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.SigmoidParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.SigmoidParameter)
 }
 SigmoidParameter::SigmoidParameter(const SigmoidParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   engine_ = from.engine_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.SigmoidParameter)
 }
 
-void SigmoidParameter::SharedCtor() {
-  _cached_size_ = 0;
-  engine_ = 0;
+inline void SigmoidParameter::SharedCtor() {
+engine_ = 0;
 }
 
 SigmoidParameter::~SigmoidParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.SigmoidParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SigmoidParameter::SharedDtor() {
+inline void SigmoidParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void SigmoidParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* SigmoidParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void SigmoidParameter::ArenaDtor(void* object) {
+  SigmoidParameter* _this = reinterpret_cast< SigmoidParameter* >(object);
+  (void)_this;
 }
-
-const SigmoidParameter& SigmoidParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSigmoidParameter();
-  return *internal_default_instance();
+void SigmoidParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-SigmoidParameter* SigmoidParameter::New(::google::protobuf::Arena* arena) const {
-  SigmoidParameter* n = new SigmoidParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void SigmoidParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void SigmoidParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.SigmoidParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   engine_ = 0;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SigmoidParameter::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:opencv_caffe.SigmoidParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* SigmoidParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::SigmoidParameter_Engine_IsValid(value)) {
-            set_engine(static_cast< ::opencv_caffe::SigmoidParameter_Engine >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::SigmoidParameter_Engine_IsValid(val))) {
+            _internal_set_engine(static_cast<::opencv_caffe::SigmoidParameter_Engine>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } 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:opencv_caffe.SigmoidParameter)
-  return true;
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.SigmoidParameter)
-  return false;
-#undef DO_
-}
-
-void SigmoidParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.SigmoidParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->engine(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.SigmoidParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* SigmoidParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* SigmoidParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SigmoidParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->engine(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_engine(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SigmoidParameter)
   return target;
@@ -32343,56 +26649,43 @@ size_t SigmoidParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SigmoidParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional .opencv_caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT];
-  if (has_engine()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_engine());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SigmoidParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.SigmoidParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SigmoidParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SigmoidParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.SigmoidParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.SigmoidParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SigmoidParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SigmoidParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SigmoidParameter::GetClassData() const { return &_class_data_; }
+
+void SigmoidParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SigmoidParameter *>(to)->MergeFrom(
+      static_cast<const SigmoidParameter &>(from));
 }
 
+
 void SigmoidParameter::MergeFrom(const SigmoidParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SigmoidParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_engine()) {
-    set_engine(from.engine());
+  if (from._internal_has_engine()) {
+    _internal_set_engine(from._internal_engine());
   }
-}
-
-void SigmoidParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.SigmoidParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void SigmoidParameter::CopyFrom(const SigmoidParameter& from) {
@@ -32406,240 +26699,188 @@ bool SigmoidParameter::IsInitialized() const {
   return true;
 }
 
-void SigmoidParameter::Swap(SigmoidParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void SigmoidParameter::InternalSwap(SigmoidParameter* other) {
   using std::swap;
-  swap(engine_, other->engine_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  swap(engine_, other->engine_);
 }
 
-::google::protobuf::Metadata SigmoidParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SigmoidParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[56]);
 }
 
-
 // ===================================================================
 
-void SliceParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SliceParameter::kAxisFieldNumber;
-const int SliceParameter::kSlicePointFieldNumber;
-const int SliceParameter::kSliceDimFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-SliceParameter::SliceParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSliceParameter();
+class SliceParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<SliceParameter>()._has_bits_);
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_slice_dim(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+SliceParameter::SliceParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  slice_point_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.SliceParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.SliceParameter)
 }
 SliceParameter::SliceParameter(const SliceParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       slice_point_(from.slice_point_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&slice_dim_, &from.slice_dim_,
     static_cast<size_t>(reinterpret_cast<char*>(&axis_) -
     reinterpret_cast<char*>(&slice_dim_)) + sizeof(axis_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.SliceParameter)
 }
 
-void SliceParameter::SharedCtor() {
-  _cached_size_ = 0;
-  slice_dim_ = 1u;
-  axis_ = 1;
+inline void SliceParameter::SharedCtor() {
+slice_dim_ = 1u;
+axis_ = 1;
 }
 
 SliceParameter::~SliceParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.SliceParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SliceParameter::SharedDtor() {
+inline void SliceParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void SliceParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void SliceParameter::ArenaDtor(void* object) {
+  SliceParameter* _this = reinterpret_cast< SliceParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* SliceParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void SliceParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const SliceParameter& SliceParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSliceParameter();
-  return *internal_default_instance();
-}
-
-SliceParameter* SliceParameter::New(::google::protobuf::Arena* arena) const {
-  SliceParameter* n = new SliceParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void SliceParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void SliceParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.SliceParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   slice_point_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     slice_dim_ = 1u;
     axis_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SliceParameter::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:opencv_caffe.SliceParameter)
-  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 uint32 slice_dim = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_slice_dim();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &slice_dim_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* SliceParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 slice_dim = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_slice_dim(&has_bits);
+          slice_dim_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated uint32 slice_point = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 1, 16u, input, this->mutable_slice_point())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, this->mutable_slice_point())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_slice_point(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 18) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_slice_point(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 axis = 3 [default = 1];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } 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:opencv_caffe.SliceParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.SliceParameter)
-  return false;
-#undef DO_
-}
-
-void SliceParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.SliceParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 slice_dim = 1 [default = 1];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->slice_dim(), output);
-  }
-
-  // repeated uint32 slice_point = 2;
-  for (int i = 0, n = this->slice_point_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
-      2, this->slice_point(i), output);
-  }
-
-  // optional int32 axis = 3 [default = 1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->axis(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.SliceParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* SliceParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* SliceParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SliceParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 slice_dim = 1 [default = 1];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->slice_dim(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_slice_dim(), target);
   }
 
   // repeated uint32 slice_point = 2;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteUInt32ToArray(2, this->slice_point_, target);
+  for (int i = 0, n = this->_internal_slice_point_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_slice_point(i), target);
+  }
 
   // optional int32 axis = 3 [default = 1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_axis(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SliceParameter)
   return target;
@@ -32649,68 +26890,57 @@ size_t SliceParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SliceParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated uint32 slice_point = 2;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt32Size(this->slice_point_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->slice_point_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_slice_point_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional uint32 slice_dim = 1 [default = 1];
-    if (has_slice_dim()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->slice_dim());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_slice_dim());
     }
 
     // optional int32 axis = 3 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SliceParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.SliceParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SliceParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SliceParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.SliceParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.SliceParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SliceParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SliceParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SliceParameter::GetClassData() const { return &_class_data_; }
+
+void SliceParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SliceParameter *>(to)->MergeFrom(
+      static_cast<const SliceParameter &>(from));
 }
 
+
 void SliceParameter::MergeFrom(const SliceParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SliceParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   slice_point_.MergeFrom(from.slice_point_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       slice_dim_ = from.slice_dim_;
     }
@@ -32719,13 +26949,7 @@ void SliceParameter::MergeFrom(const SliceParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void SliceParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.SliceParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void SliceParameter::CopyFrom(const SliceParameter& from) {
@@ -32739,218 +26963,170 @@ bool SliceParameter::IsInitialized() const {
   return true;
 }
 
-void SliceParameter::Swap(SliceParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void SliceParameter::InternalSwap(SliceParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   slice_point_.InternalSwap(&other->slice_point_);
   swap(slice_dim_, other->slice_dim_);
   swap(axis_, other->axis_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata SliceParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SliceParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[57]);
 }
 
-
 // ===================================================================
 
-void SoftmaxParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SoftmaxParameter::kEngineFieldNumber;
-const int SoftmaxParameter::kAxisFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-SoftmaxParameter::SoftmaxParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSoftmaxParameter();
+class SoftmaxParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<SoftmaxParameter>()._has_bits_);
+  static void set_has_engine(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+};
+
+SoftmaxParameter::SoftmaxParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.SoftmaxParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.SoftmaxParameter)
 }
 SoftmaxParameter::SoftmaxParameter(const SoftmaxParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&engine_, &from.engine_,
     static_cast<size_t>(reinterpret_cast<char*>(&axis_) -
     reinterpret_cast<char*>(&engine_)) + sizeof(axis_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.SoftmaxParameter)
 }
 
-void SoftmaxParameter::SharedCtor() {
-  _cached_size_ = 0;
-  engine_ = 0;
-  axis_ = 1;
+inline void SoftmaxParameter::SharedCtor() {
+engine_ = 0;
+axis_ = 1;
 }
 
 SoftmaxParameter::~SoftmaxParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.SoftmaxParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SoftmaxParameter::SharedDtor() {
+inline void SoftmaxParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void SoftmaxParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void SoftmaxParameter::ArenaDtor(void* object) {
+  SoftmaxParameter* _this = reinterpret_cast< SoftmaxParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* SoftmaxParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void SoftmaxParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const SoftmaxParameter& SoftmaxParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSoftmaxParameter();
-  return *internal_default_instance();
-}
-
-SoftmaxParameter* SoftmaxParameter::New(::google::protobuf::Arena* arena) const {
-  SoftmaxParameter* n = new SoftmaxParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void SoftmaxParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void SoftmaxParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.SoftmaxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     engine_ = 0;
     axis_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SoftmaxParameter::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:opencv_caffe.SoftmaxParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* SoftmaxParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::SoftmaxParameter_Engine_IsValid(value)) {
-            set_engine(static_cast< ::opencv_caffe::SoftmaxParameter_Engine >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::SoftmaxParameter_Engine_IsValid(val))) {
+            _internal_set_engine(static_cast<::opencv_caffe::SoftmaxParameter_Engine>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int32 axis = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } 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:opencv_caffe.SoftmaxParameter)
-  return true;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.SoftmaxParameter)
-  return false;
-#undef DO_
-}
-
-void SoftmaxParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.SoftmaxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->engine(), output);
-  }
-
-  // optional int32 axis = 2 [default = 1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.SoftmaxParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* SoftmaxParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* SoftmaxParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SoftmaxParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->engine(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_engine(), target);
   }
 
   // optional int32 axis = 2 [default = 1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_axis(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SoftmaxParameter)
   return target;
@@ -32960,57 +27136,48 @@ size_t SoftmaxParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SoftmaxParameter)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional .opencv_caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT];
-    if (has_engine()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_engine());
     }
 
     // optional int32 axis = 2 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SoftmaxParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.SoftmaxParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SoftmaxParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SoftmaxParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.SoftmaxParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.SoftmaxParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SoftmaxParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SoftmaxParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SoftmaxParameter::GetClassData() const { return &_class_data_; }
+
+void SoftmaxParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SoftmaxParameter *>(to)->MergeFrom(
+      static_cast<const SoftmaxParameter &>(from));
 }
 
+
 void SoftmaxParameter::MergeFrom(const SoftmaxParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SoftmaxParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       engine_ = from.engine_;
     }
@@ -33019,13 +27186,7 @@ void SoftmaxParameter::MergeFrom(const SoftmaxParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void SoftmaxParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.SoftmaxParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void SoftmaxParameter::CopyFrom(const SoftmaxParameter& from) {
@@ -33039,185 +27200,144 @@ bool SoftmaxParameter::IsInitialized() const {
   return true;
 }
 
-void SoftmaxParameter::Swap(SoftmaxParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void SoftmaxParameter::InternalSwap(SoftmaxParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(engine_, other->engine_);
   swap(axis_, other->axis_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata SoftmaxParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SoftmaxParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[58]);
 }
 
-
 // ===================================================================
 
-void TanHParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TanHParameter::kEngineFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TanHParameter::TanHParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTanHParameter();
+class TanHParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<TanHParameter>()._has_bits_);
+  static void set_has_engine(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+TanHParameter::TanHParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.TanHParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.TanHParameter)
 }
 TanHParameter::TanHParameter(const TanHParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   engine_ = from.engine_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.TanHParameter)
 }
 
-void TanHParameter::SharedCtor() {
-  _cached_size_ = 0;
-  engine_ = 0;
+inline void TanHParameter::SharedCtor() {
+engine_ = 0;
 }
 
 TanHParameter::~TanHParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.TanHParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TanHParameter::SharedDtor() {
+inline void TanHParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void TanHParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TanHParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void TanHParameter::ArenaDtor(void* object) {
+  TanHParameter* _this = reinterpret_cast< TanHParameter* >(object);
+  (void)_this;
 }
-
-const TanHParameter& TanHParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTanHParameter();
-  return *internal_default_instance();
+void TanHParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-TanHParameter* TanHParameter::New(::google::protobuf::Arena* arena) const {
-  TanHParameter* n = new TanHParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TanHParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TanHParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.TanHParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   engine_ = 0;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TanHParameter::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:opencv_caffe.TanHParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TanHParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.TanHParameter.Engine engine = 1 [default = DEFAULT];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::TanHParameter_Engine_IsValid(value)) {
-            set_engine(static_cast< ::opencv_caffe::TanHParameter_Engine >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::TanHParameter_Engine_IsValid(val))) {
+            _internal_set_engine(static_cast<::opencv_caffe::TanHParameter_Engine>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } 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:opencv_caffe.TanHParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.TanHParameter)
-  return false;
-#undef DO_
-}
-
-void TanHParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.TanHParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.TanHParameter.Engine engine = 1 [default = DEFAULT];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->engine(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.TanHParameter)
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TanHParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TanHParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.TanHParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.TanHParameter.Engine engine = 1 [default = DEFAULT];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->engine(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_engine(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.TanHParameter)
   return target;
@@ -33227,56 +27347,43 @@ size_t TanHParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.TanHParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional .opencv_caffe.TanHParameter.Engine engine = 1 [default = DEFAULT];
-  if (has_engine()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_engine());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TanHParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.TanHParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TanHParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TanHParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.TanHParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.TanHParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TanHParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TanHParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TanHParameter::GetClassData() const { return &_class_data_; }
+
+void TanHParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TanHParameter *>(to)->MergeFrom(
+      static_cast<const TanHParameter &>(from));
 }
 
+
 void TanHParameter::MergeFrom(const TanHParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.TanHParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_engine()) {
-    set_engine(from.engine());
+  if (from._internal_has_engine()) {
+    _internal_set_engine(from._internal_engine());
   }
-}
-
-void TanHParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.TanHParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TanHParameter::CopyFrom(const TanHParameter& from) {
@@ -33290,208 +27397,163 @@ bool TanHParameter::IsInitialized() const {
   return true;
 }
 
-void TanHParameter::Swap(TanHParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TanHParameter::InternalSwap(TanHParameter* other) {
   using std::swap;
-  swap(engine_, other->engine_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  swap(engine_, other->engine_);
 }
 
-::google::protobuf::Metadata TanHParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TanHParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[59]);
 }
 
-
 // ===================================================================
 
-void TileParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TileParameter::kAxisFieldNumber;
-const int TileParameter::kTilesFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TileParameter::TileParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTileParameter();
+class TileParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<TileParameter>()._has_bits_);
+  static void set_has_axis(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_tiles(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+TileParameter::TileParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.TileParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.TileParameter)
 }
 TileParameter::TileParameter(const TileParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&tiles_, &from.tiles_,
     static_cast<size_t>(reinterpret_cast<char*>(&axis_) -
     reinterpret_cast<char*>(&tiles_)) + sizeof(axis_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.TileParameter)
 }
 
-void TileParameter::SharedCtor() {
-  _cached_size_ = 0;
-  tiles_ = 0;
-  axis_ = 1;
+inline void TileParameter::SharedCtor() {
+tiles_ = 0;
+axis_ = 1;
 }
 
 TileParameter::~TileParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.TileParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TileParameter::SharedDtor() {
+inline void TileParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void TileParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TileParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void TileParameter::ArenaDtor(void* object) {
+  TileParameter* _this = reinterpret_cast< TileParameter* >(object);
+  (void)_this;
 }
-
-const TileParameter& TileParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTileParameter();
-  return *internal_default_instance();
+void TileParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-TileParameter* TileParameter::New(::google::protobuf::Arena* arena) const {
-  TileParameter* n = new TileParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TileParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TileParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.TileParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     tiles_ = 0;
     axis_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TileParameter::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:opencv_caffe.TileParameter)
-  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 axis = 1 [default = 1];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_axis();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &axis_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* TileParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int32 axis = 1 [default = 1];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_axis(&has_bits);
+          axis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 tiles = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_tiles();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &tiles_)));
-        } 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:opencv_caffe.TileParameter)
-  return true;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_tiles(&has_bits);
+          tiles_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.TileParameter)
-  return false;
-#undef DO_
-}
-
-void TileParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.TileParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int32 axis = 1 [default = 1];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output);
-  }
-
-  // optional int32 tiles = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->tiles(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.TileParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TileParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TileParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.TileParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int32 axis = 1 [default = 1];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_axis(), target);
   }
 
   // optional int32 tiles = 2;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->tiles(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_tiles(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.TileParameter)
   return target;
@@ -33501,58 +27563,47 @@ size_t TileParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.TileParameter)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional int32 tiles = 2;
-    if (has_tiles()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->tiles());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_tiles());
     }
 
     // optional int32 axis = 1 [default = 1];
-    if (has_axis()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->axis());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_axis());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TileParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.TileParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TileParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TileParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.TileParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.TileParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TileParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TileParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TileParameter::GetClassData() const { return &_class_data_; }
+
+void TileParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TileParameter *>(to)->MergeFrom(
+      static_cast<const TileParameter &>(from));
 }
 
+
 void TileParameter::MergeFrom(const TileParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.TileParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       tiles_ = from.tiles_;
     }
@@ -33561,13 +27612,7 @@ void TileParameter::MergeFrom(const TileParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void TileParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.TileParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TileParameter::CopyFrom(const TileParameter& from) {
@@ -33581,177 +27626,139 @@ bool TileParameter::IsInitialized() const {
   return true;
 }
 
-void TileParameter::Swap(TileParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TileParameter::InternalSwap(TileParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   swap(tiles_, other->tiles_);
   swap(axis_, other->axis_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata TileParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TileParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[60]);
 }
 
-
 // ===================================================================
 
-void ThresholdParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ThresholdParameter::kThresholdFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ThresholdParameter::ThresholdParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsThresholdParameter();
+class ThresholdParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ThresholdParameter>()._has_bits_);
+  static void set_has_threshold(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+ThresholdParameter::ThresholdParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ThresholdParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ThresholdParameter)
 }
 ThresholdParameter::ThresholdParameter(const ThresholdParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   threshold_ = from.threshold_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ThresholdParameter)
 }
 
-void ThresholdParameter::SharedCtor() {
-  _cached_size_ = 0;
-  threshold_ = 0;
+inline void ThresholdParameter::SharedCtor() {
+threshold_ = 0;
 }
 
 ThresholdParameter::~ThresholdParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ThresholdParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ThresholdParameter::SharedDtor() {
+inline void ThresholdParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ThresholdParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ThresholdParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ThresholdParameter::ArenaDtor(void* object) {
+  ThresholdParameter* _this = reinterpret_cast< ThresholdParameter* >(object);
+  (void)_this;
 }
-
-const ThresholdParameter& ThresholdParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsThresholdParameter();
-  return *internal_default_instance();
+void ThresholdParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ThresholdParameter* ThresholdParameter::New(::google::protobuf::Arena* arena) const {
-  ThresholdParameter* n = new ThresholdParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ThresholdParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ThresholdParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ThresholdParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   threshold_ = 0;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ThresholdParameter::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:opencv_caffe.ThresholdParameter)
-  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 float threshold = 1 [default = 0];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_threshold();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &threshold_)));
-        } 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:opencv_caffe.ThresholdParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ThresholdParameter)
-  return false;
-#undef DO_
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ThresholdParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ThresholdParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float threshold = 1 [default = 0];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->threshold(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ThresholdParameter)
+const char* ThresholdParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float threshold = 1 [default = 0];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_threshold(&has_bits);
+          threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ThresholdParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ThresholdParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ThresholdParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float threshold = 1 [default = 0];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->threshold(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_threshold(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ThresholdParameter)
   return target;
@@ -33761,55 +27768,42 @@ size_t ThresholdParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ThresholdParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional float threshold = 1 [default = 0];
-  if (has_threshold()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 + 4;
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ThresholdParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ThresholdParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ThresholdParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ThresholdParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ThresholdParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ThresholdParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ThresholdParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ThresholdParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ThresholdParameter::GetClassData() const { return &_class_data_; }
+
+void ThresholdParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ThresholdParameter *>(to)->MergeFrom(
+      static_cast<const ThresholdParameter &>(from));
 }
 
+
 void ThresholdParameter::MergeFrom(const ThresholdParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ThresholdParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_threshold()) {
-    set_threshold(from.threshold());
+  if (from._internal_has_threshold()) {
+    _internal_set_threshold(from._internal_threshold());
   }
-}
-
-void ThresholdParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ThresholdParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ThresholdParameter::CopyFrom(const ThresholdParameter& from) {
@@ -33823,591 +27817,464 @@ bool ThresholdParameter::IsInitialized() const {
   return true;
 }
 
-void ThresholdParameter::Swap(ThresholdParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ThresholdParameter::InternalSwap(ThresholdParameter* other) {
   using std::swap;
-  swap(threshold_, other->threshold_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  swap(threshold_, other->threshold_);
 }
 
-::google::protobuf::Metadata ThresholdParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ThresholdParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[61]);
 }
 
-
 // ===================================================================
 
-void WindowDataParameter::InitAsDefaultInstance() {
-}
-::google::protobuf::internal::ExplicitlyConstructed< ::std::string> WindowDataParameter::_default_crop_mode_;
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int WindowDataParameter::kSourceFieldNumber;
-const int WindowDataParameter::kScaleFieldNumber;
-const int WindowDataParameter::kMeanFileFieldNumber;
-const int WindowDataParameter::kBatchSizeFieldNumber;
-const int WindowDataParameter::kCropSizeFieldNumber;
-const int WindowDataParameter::kMirrorFieldNumber;
-const int WindowDataParameter::kFgThresholdFieldNumber;
-const int WindowDataParameter::kBgThresholdFieldNumber;
-const int WindowDataParameter::kFgFractionFieldNumber;
-const int WindowDataParameter::kContextPadFieldNumber;
-const int WindowDataParameter::kCropModeFieldNumber;
-const int WindowDataParameter::kCacheImagesFieldNumber;
-const int WindowDataParameter::kRootFolderFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-WindowDataParameter::WindowDataParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsWindowDataParameter();
+class WindowDataParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<WindowDataParameter>()._has_bits_);
+  static void set_has_source(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.WindowDataParameter)
-}
-WindowDataParameter::WindowDataParameter(const WindowDataParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_source()) {
-    source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+  static void set_has_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
   }
-  mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_mean_file()) {
-    mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_);
+  static void set_has_mean_file(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
-  crop_mode_.UnsafeSetDefault(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get());
-  if (from.has_crop_mode()) {
-    crop_mode_.AssignWithDefault(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get(), from.crop_mode_);
+  static void set_has_batch_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
-  root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_root_folder()) {
-    root_folder_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_folder_);
+  static void set_has_crop_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
   }
-  ::memcpy(&batch_size_, &from.batch_size_,
-    static_cast<size_t>(reinterpret_cast<char*>(&fg_fraction_) -
-    reinterpret_cast<char*>(&batch_size_)) + sizeof(fg_fraction_));
-  // @@protoc_insertion_point(copy_constructor:opencv_caffe.WindowDataParameter)
-}
-
-void WindowDataParameter::SharedCtor() {
-  _cached_size_ = 0;
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  crop_mode_.UnsafeSetDefault(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get());
-  root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&batch_size_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&context_pad_) -
-      reinterpret_cast<char*>(&batch_size_)) + sizeof(context_pad_));
-  scale_ = 1;
-  fg_threshold_ = 0.5f;
-  bg_threshold_ = 0.5f;
-  fg_fraction_ = 0.25f;
-}
-
-WindowDataParameter::~WindowDataParameter() {
-  // @@protoc_insertion_point(destructor:opencv_caffe.WindowDataParameter)
-  SharedDtor();
-}
-
-void WindowDataParameter::SharedDtor() {
-  source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  crop_mode_.DestroyNoArena(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get());
-  root_folder_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void WindowDataParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* WindowDataParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const WindowDataParameter& WindowDataParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsWindowDataParameter();
-  return *internal_default_instance();
-}
-
-WindowDataParameter* WindowDataParameter::New(::google::protobuf::Arena* arena) const {
-  WindowDataParameter* n = new WindowDataParameter;
-  if (arena != NULL) {
-    arena->Own(n);
+  static void set_has_mirror(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
   }
-  return n;
-}
-
-void WindowDataParameter::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_caffe.WindowDataParameter)
-  ::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 & 15u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!source_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*source_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!mean_file_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*mean_file_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!crop_mode_.IsDefault(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get()));
-      (*crop_mode_.UnsafeRawStringPointer())->assign(*&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get());
-    }
-    if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!root_folder_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*root_folder_.UnsafeRawStringPointer())->clear();
-    }
+  static void set_has_fg_threshold(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
   }
-  if (cached_has_bits & 240u) {
-    ::memset(&batch_size_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&cache_images_) -
-        reinterpret_cast<char*>(&batch_size_)) + sizeof(cache_images_));
+  static void set_has_bg_threshold(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
   }
-  if (cached_has_bits & 7936u) {
-    context_pad_ = 0u;
-    scale_ = 1;
-    fg_threshold_ = 0.5f;
-    bg_threshold_ = 0.5f;
-    fg_fraction_ = 0.25f;
+  static void set_has_fg_fraction(HasBits* has_bits) {
+    (*has_bits)[0] |= 4096u;
   }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool WindowDataParameter::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:opencv_caffe.WindowDataParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string source = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_source()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->source().data(), static_cast<int>(this->source().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.WindowDataParameter.source");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float scale = 2 [default = 1];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string mean_file = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_mean_file()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.WindowDataParameter.mean_file");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 batch_size = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_batch_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &batch_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 crop_size = 5 [default = 0];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_crop_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &crop_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool mirror = 6 [default = false];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_mirror();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &mirror_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float fg_threshold = 7 [default = 0.5];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
-          set_has_fg_threshold();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &fg_threshold_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float bg_threshold = 8 [default = 0.5];
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(69u /* 69 & 0xFF */)) {
-          set_has_bg_threshold();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &bg_threshold_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional float fg_fraction = 9 [default = 0.25];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
-          set_has_fg_fraction();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &fg_fraction_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional uint32 context_pad = 10 [default = 0];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_context_pad();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &context_pad_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string crop_mode = 11 [default = "warp"];
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_crop_mode()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->crop_mode().data(), static_cast<int>(this->crop_mode().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.WindowDataParameter.crop_mode");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional bool cache_images = 12 [default = false];
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) {
-          set_has_cache_images();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &cache_images_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string root_folder = 13 [default = ""];
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_root_folder()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->root_folder().data(), static_cast<int>(this->root_folder().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.WindowDataParameter.root_folder");
-        } 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:opencv_caffe.WindowDataParameter)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.WindowDataParameter)
-  return false;
-#undef DO_
-}
-
-void WindowDataParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.WindowDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string source = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.WindowDataParameter.source");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->source(), output);
+  static void set_has_context_pad(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
   }
-
-  // optional float scale = 2 [default = 1];
-  if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output);
+  static void set_has_crop_mode(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
-
-  // optional string mean_file = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.WindowDataParameter.mean_file");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->mean_file(), output);
+  static void set_has_cache_images(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
   }
-
-  // optional uint32 batch_size = 4;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->batch_size(), output);
+  static void set_has_root_folder(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
   }
+};
 
-  // optional uint32 crop_size = 5 [default = 0];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->crop_size(), output);
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString WindowDataParameter::_i_give_permission_to_break_this_code_default_crop_mode_{{{"warp", 4}}, {nullptr}};
+WindowDataParameter::WindowDataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
+  SharedCtor();
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
   }
-
-  // optional bool mirror = 6 [default = false];
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->mirror(), output);
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.WindowDataParameter)
+}
+WindowDataParameter::WindowDataParameter(const WindowDataParameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_source()) {
+    source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_source(),
+      GetArenaForAllocation());
+  }
+  mean_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_mean_file()) {
+    mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_mean_file(),
+      GetArenaForAllocation());
+  }
+  crop_mode_.UnsafeSetDefault(nullptr);
+  if (from._internal_has_crop_mode()) {
+    crop_mode_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_crop_mode(),
+      GetArenaForAllocation());
+  }
+  root_folder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    root_folder_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_root_folder()) {
+    root_folder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_root_folder(),
+      GetArenaForAllocation());
   }
+  ::memcpy(&batch_size_, &from.batch_size_,
+    static_cast<size_t>(reinterpret_cast<char*>(&fg_fraction_) -
+    reinterpret_cast<char*>(&batch_size_)) + sizeof(fg_fraction_));
+  // @@protoc_insertion_point(copy_constructor:opencv_caffe.WindowDataParameter)
+}
 
-  // optional float fg_threshold = 7 [default = 0.5];
-  if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->fg_threshold(), output);
-  }
+inline void WindowDataParameter::SharedCtor() {
+source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+mean_file_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+crop_mode_.UnsafeSetDefault(nullptr);
+root_folder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  root_folder_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&batch_size_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&context_pad_) -
+    reinterpret_cast<char*>(&batch_size_)) + sizeof(context_pad_));
+scale_ = 1;
+fg_threshold_ = 0.5f;
+bg_threshold_ = 0.5f;
+fg_fraction_ = 0.25f;
+}
 
-  // optional float bg_threshold = 8 [default = 0.5];
-  if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->bg_threshold(), output);
-  }
+WindowDataParameter::~WindowDataParameter() {
+  // @@protoc_insertion_point(destructor:opencv_caffe.WindowDataParameter)
+  if (GetArenaForAllocation() != nullptr) return;
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
-  // optional float fg_fraction = 9 [default = 0.25];
-  if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->fg_fraction(), output);
-  }
+inline void WindowDataParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  source_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  mean_file_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  crop_mode_.DestroyNoArena(nullptr);
+  root_folder_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+}
 
-  // optional uint32 context_pad = 10 [default = 0];
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->context_pad(), output);
-  }
+void WindowDataParameter::ArenaDtor(void* object) {
+  WindowDataParameter* _this = reinterpret_cast< WindowDataParameter* >(object);
+  (void)_this;
+}
+void WindowDataParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void WindowDataParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
 
-  // optional string crop_mode = 11 [default = "warp"];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->crop_mode().data(), static_cast<int>(this->crop_mode().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.WindowDataParameter.crop_mode");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      11, this->crop_mode(), output);
-  }
+void WindowDataParameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_caffe.WindowDataParameter)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-  // optional bool cache_images = 12 [default = false];
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->cache_images(), output);
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
+    if (cached_has_bits & 0x00000001u) {
+      source_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      mean_file_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000004u) {
+      crop_mode_.ClearToDefault(::opencv_caffe::WindowDataParameter::_i_give_permission_to_break_this_code_default_crop_mode_, GetArenaForAllocation());
+       }
+    if (cached_has_bits & 0x00000008u) {
+      root_folder_.ClearNonDefaultToEmpty();
+    }
   }
-
-  // optional string root_folder = 13 [default = ""];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->root_folder().data(), static_cast<int>(this->root_folder().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.WindowDataParameter.root_folder");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      13, this->root_folder(), output);
+  if (cached_has_bits & 0x000000f0u) {
+    ::memset(&batch_size_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&cache_images_) -
+        reinterpret_cast<char*>(&batch_size_)) + sizeof(cache_images_));
   }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
+  if (cached_has_bits & 0x00001f00u) {
+    context_pad_ = 0u;
+    scale_ = 1;
+    fg_threshold_ = 0.5f;
+    bg_threshold_ = 0.5f;
+    fg_fraction_ = 0.25f;
   }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.WindowDataParameter)
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* WindowDataParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string source = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_source();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.WindowDataParameter.source");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float scale = 2 [default = 1];
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_scale(&has_bits);
+          scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string mean_file = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_mean_file();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.WindowDataParameter.mean_file");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 batch_size = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_batch_size(&has_bits);
+          batch_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 crop_size = 5 [default = 0];
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_crop_size(&has_bits);
+          crop_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool mirror = 6 [default = false];
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_mirror(&has_bits);
+          mirror_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float fg_threshold = 7 [default = 0.5];
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 61)) {
+          _Internal::set_has_fg_threshold(&has_bits);
+          fg_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float bg_threshold = 8 [default = 0.5];
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 69)) {
+          _Internal::set_has_bg_threshold(&has_bits);
+          bg_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional float fg_fraction = 9 [default = 0.25];
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 77)) {
+          _Internal::set_has_fg_fraction(&has_bits);
+          fg_fraction_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional uint32 context_pad = 10 [default = 0];
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_context_pad(&has_bits);
+          context_pad_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string crop_mode = 11 [default = "warp"];
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          auto str = _internal_mutable_crop_mode();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.WindowDataParameter.crop_mode");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional bool cache_images = 12 [default = false];
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
+          _Internal::set_has_cache_images(&has_bits);
+          cache_images_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string root_folder = 13 [default = ""];
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
+          auto str = _internal_mutable_root_folder();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.WindowDataParameter.root_folder");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* WindowDataParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* WindowDataParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.WindowDataParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string source = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_source().data(), static_cast<int>(this->_internal_source().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.WindowDataParameter.source");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->source(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_source(), target);
   }
 
   // optional float scale = 2 [default = 1];
   if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_scale(), target);
   }
 
   // optional string mean_file = 3;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->mean_file().data(), static_cast<int>(this->mean_file().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_mean_file().data(), static_cast<int>(this->_internal_mean_file().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.WindowDataParameter.mean_file");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->mean_file(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_mean_file(), target);
   }
 
   // optional uint32 batch_size = 4;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->batch_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_batch_size(), target);
   }
 
   // optional uint32 crop_size = 5 [default = 0];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->crop_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_crop_size(), target);
   }
 
   // optional bool mirror = 6 [default = false];
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->mirror(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_mirror(), target);
   }
 
   // optional float fg_threshold = 7 [default = 0.5];
   if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->fg_threshold(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(7, this->_internal_fg_threshold(), target);
   }
 
   // optional float bg_threshold = 8 [default = 0.5];
   if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->bg_threshold(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(8, this->_internal_bg_threshold(), target);
   }
 
   // optional float fg_fraction = 9 [default = 0.25];
   if (cached_has_bits & 0x00001000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->fg_fraction(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(9, this->_internal_fg_fraction(), target);
   }
 
   // optional uint32 context_pad = 10 [default = 0];
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->context_pad(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->_internal_context_pad(), target);
   }
 
   // optional string crop_mode = 11 [default = "warp"];
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->crop_mode().data(), static_cast<int>(this->crop_mode().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_crop_mode().data(), static_cast<int>(this->_internal_crop_mode().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.WindowDataParameter.crop_mode");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        11, this->crop_mode(), target);
+    target = stream->WriteStringMaybeAliased(
+        11, this->_internal_crop_mode(), target);
   }
 
   // optional bool cache_images = 12 [default = false];
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->cache_images(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(12, this->_internal_cache_images(), target);
   }
 
   // optional string root_folder = 13 [default = ""];
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->root_folder().data(), static_cast<int>(this->root_folder().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_root_folder().data(), static_cast<int>(this->_internal_root_folder().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.WindowDataParameter.root_folder");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        13, this->root_folder(), target);
+    target = stream->WriteStringMaybeAliased(
+        13, this->_internal_root_folder(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.WindowDataParameter)
   return target;
@@ -34417,140 +28284,123 @@ size_t WindowDataParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.WindowDataParameter)
   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] & 255u) {
+  uint32_t 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 & 0x000000ffu) {
     // optional string source = 1;
-    if (has_source()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->source());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_source());
     }
 
     // optional string mean_file = 3;
-    if (has_mean_file()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->mean_file());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_mean_file());
     }
 
     // optional string crop_mode = 11 [default = "warp"];
-    if (has_crop_mode()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->crop_mode());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_crop_mode());
     }
 
     // optional string root_folder = 13 [default = ""];
-    if (has_root_folder()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->root_folder());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_root_folder());
     }
 
     // optional uint32 batch_size = 4;
-    if (has_batch_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->batch_size());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_batch_size());
     }
 
     // optional uint32 crop_size = 5 [default = 0];
-    if (has_crop_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->crop_size());
+    if (cached_has_bits & 0x00000020u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_crop_size());
     }
 
     // optional bool mirror = 6 [default = false];
-    if (has_mirror()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 1 + 1;
     }
 
     // optional bool cache_images = 12 [default = false];
-    if (has_cache_images()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 1 + 1;
     }
 
   }
-  if (_has_bits_[8 / 32] & 7936u) {
+  if (cached_has_bits & 0x00001f00u) {
     // optional uint32 context_pad = 10 [default = 0];
-    if (has_context_pad()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->context_pad());
+    if (cached_has_bits & 0x00000100u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_context_pad());
     }
 
     // optional float scale = 2 [default = 1];
-    if (has_scale()) {
+    if (cached_has_bits & 0x00000200u) {
       total_size += 1 + 4;
     }
 
     // optional float fg_threshold = 7 [default = 0.5];
-    if (has_fg_threshold()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 1 + 4;
     }
 
     // optional float bg_threshold = 8 [default = 0.5];
-    if (has_bg_threshold()) {
+    if (cached_has_bits & 0x00000800u) {
       total_size += 1 + 4;
     }
 
     // optional float fg_fraction = 9 [default = 0.25];
-    if (has_fg_fraction()) {
+    if (cached_has_bits & 0x00001000u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void WindowDataParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.WindowDataParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const WindowDataParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const WindowDataParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.WindowDataParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.WindowDataParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData WindowDataParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    WindowDataParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*WindowDataParameter::GetClassData() const { return &_class_data_; }
+
+void WindowDataParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<WindowDataParameter *>(to)->MergeFrom(
+      static_cast<const WindowDataParameter &>(from));
 }
 
+
 void WindowDataParameter::MergeFrom(const WindowDataParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.WindowDataParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_source();
-      source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+      _internal_set_source(from._internal_source());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_mean_file();
-      mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_);
+      _internal_set_mean_file(from._internal_mean_file());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_crop_mode();
-      crop_mode_.AssignWithDefault(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get(), from.crop_mode_);
+      _internal_set_crop_mode(from._internal_crop_mode());
     }
     if (cached_has_bits & 0x00000008u) {
-      set_has_root_folder();
-      root_folder_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_folder_);
+      _internal_set_root_folder(from._internal_root_folder());
     }
     if (cached_has_bits & 0x00000010u) {
       batch_size_ = from.batch_size_;
@@ -34566,7 +28416,7 @@ void WindowDataParameter::MergeFrom(const WindowDataParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 7936u) {
+  if (cached_has_bits & 0x00001f00u) {
     if (cached_has_bits & 0x00000100u) {
       context_pad_ = from.context_pad_;
     }
@@ -34584,13 +28434,7 @@ void WindowDataParameter::MergeFrom(const WindowDataParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void WindowDataParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.WindowDataParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void WindowDataParameter::CopyFrom(const WindowDataParameter& from) {
@@ -34604,263 +28448,225 @@ bool WindowDataParameter::IsInitialized() const {
   return true;
 }
 
-void WindowDataParameter::Swap(WindowDataParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void WindowDataParameter::InternalSwap(WindowDataParameter* other) {
   using std::swap;
-  source_.Swap(&other->source_);
-  mean_file_.Swap(&other->mean_file_);
-  crop_mode_.Swap(&other->crop_mode_);
-  root_folder_.Swap(&other->root_folder_);
-  swap(batch_size_, other->batch_size_);
-  swap(crop_size_, other->crop_size_);
-  swap(mirror_, other->mirror_);
-  swap(cache_images_, other->cache_images_);
-  swap(context_pad_, other->context_pad_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &source_, lhs_arena,
+      &other->source_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &mean_file_, lhs_arena,
+      &other->mean_file_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      nullptr,
+      &crop_mode_, lhs_arena,
+      &other->crop_mode_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &root_folder_, lhs_arena,
+      &other->root_folder_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(WindowDataParameter, context_pad_)
+      + sizeof(WindowDataParameter::context_pad_)
+      - PROTOBUF_FIELD_OFFSET(WindowDataParameter, batch_size_)>(
+          reinterpret_cast<char*>(&batch_size_),
+          reinterpret_cast<char*>(&other->batch_size_));
   swap(scale_, other->scale_);
   swap(fg_threshold_, other->fg_threshold_);
   swap(bg_threshold_, other->bg_threshold_);
   swap(fg_fraction_, other->fg_fraction_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata WindowDataParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata WindowDataParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[62]);
 }
 
-
 // ===================================================================
 
-void SPPParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int SPPParameter::kPyramidHeightFieldNumber;
-const int SPPParameter::kPoolFieldNumber;
-const int SPPParameter::kEngineFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-SPPParameter::SPPParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSPPParameter();
+class SPPParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<SPPParameter>()._has_bits_);
+  static void set_has_pyramid_height(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_pool(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_engine(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+};
+
+SPPParameter::SPPParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.SPPParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.SPPParameter)
 }
 SPPParameter::SPPParameter(const SPPParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&pyramid_height_, &from.pyramid_height_,
     static_cast<size_t>(reinterpret_cast<char*>(&engine_) -
     reinterpret_cast<char*>(&pyramid_height_)) + sizeof(engine_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.SPPParameter)
 }
 
-void SPPParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&pyramid_height_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&engine_) -
-      reinterpret_cast<char*>(&pyramid_height_)) + sizeof(engine_));
+inline void SPPParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&pyramid_height_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&engine_) -
+    reinterpret_cast<char*>(&pyramid_height_)) + sizeof(engine_));
 }
 
 SPPParameter::~SPPParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.SPPParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void SPPParameter::SharedDtor() {
+inline void SPPParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void SPPParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void SPPParameter::ArenaDtor(void* object) {
+  SPPParameter* _this = reinterpret_cast< SPPParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* SPPParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const SPPParameter& SPPParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSPPParameter();
-  return *internal_default_instance();
+void SPPParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-SPPParameter* SPPParameter::New(::google::protobuf::Arena* arena) const {
-  SPPParameter* n = new SPPParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void SPPParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void SPPParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.SPPParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     ::memset(&pyramid_height_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&engine_) -
         reinterpret_cast<char*>(&pyramid_height_)) + sizeof(engine_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool SPPParameter::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:opencv_caffe.SPPParameter)
-  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 uint32 pyramid_height = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_pyramid_height();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pyramid_height_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* SPPParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 pyramid_height = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_pyramid_height(&has_bits);
+          pyramid_height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.SPPParameter.PoolMethod pool = 2 [default = MAX];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::SPPParameter_PoolMethod_IsValid(value)) {
-            set_pool(static_cast< ::opencv_caffe::SPPParameter_PoolMethod >(value));
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::SPPParameter_PoolMethod_IsValid(val))) {
+            _internal_set_pool(static_cast<::opencv_caffe::SPPParameter_PoolMethod>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                2, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.SPPParameter.Engine engine = 6 [default = DEFAULT];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::SPPParameter_Engine_IsValid(value)) {
-            set_engine(static_cast< ::opencv_caffe::SPPParameter_Engine >(value));
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::SPPParameter_Engine_IsValid(val))) {
+            _internal_set_engine(static_cast<::opencv_caffe::SPPParameter_Engine>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                6, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(6, val, mutable_unknown_fields());
           }
-        } 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:opencv_caffe.SPPParameter)
-  return true;
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.SPPParameter)
-  return false;
-#undef DO_
-}
-
-void SPPParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.SPPParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 pyramid_height = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->pyramid_height(), output);
-  }
-
-  // optional .opencv_caffe.SPPParameter.PoolMethod pool = 2 [default = MAX];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      2, this->pool(), output);
-  }
-
-  // optional .opencv_caffe.SPPParameter.Engine engine = 6 [default = DEFAULT];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      6, this->engine(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.SPPParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* SPPParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* SPPParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.SPPParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 pyramid_height = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->pyramid_height(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_pyramid_height(), target);
   }
 
   // optional .opencv_caffe.SPPParameter.PoolMethod pool = 2 [default = MAX];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      2, this->pool(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      2, this->_internal_pool(), target);
   }
 
   // optional .opencv_caffe.SPPParameter.Engine engine = 6 [default = DEFAULT];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      6, this->engine(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      6, this->_internal_engine(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.SPPParameter)
   return target;
@@ -34870,63 +28676,54 @@ size_t SPPParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.SPPParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional uint32 pyramid_height = 1;
-    if (has_pyramid_height()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pyramid_height());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pyramid_height());
     }
 
     // optional .opencv_caffe.SPPParameter.PoolMethod pool = 2 [default = MAX];
-    if (has_pool()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_pool());
     }
 
     // optional .opencv_caffe.SPPParameter.Engine engine = 6 [default = DEFAULT];
-    if (has_engine()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_engine());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void SPPParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.SPPParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const SPPParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const SPPParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.SPPParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.SPPParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SPPParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    SPPParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SPPParameter::GetClassData() const { return &_class_data_; }
+
+void SPPParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<SPPParameter *>(to)->MergeFrom(
+      static_cast<const SPPParameter &>(from));
 }
 
+
 void SPPParameter::MergeFrom(const SPPParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.SPPParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       pyramid_height_ = from.pyramid_height_;
     }
@@ -34938,13 +28735,7 @@ void SPPParameter::MergeFrom(const SPPParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void SPPParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.SPPParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void SPPParameter::CopyFrom(const SPPParameter& from) {
@@ -34958,149 +28749,306 @@ bool SPPParameter::IsInitialized() const {
   return true;
 }
 
-void SPPParameter::Swap(SPPParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void SPPParameter::InternalSwap(SPPParameter* other) {
   using std::swap;
-  swap(pyramid_height_, other->pyramid_height_);
-  swap(pool_, other->pool_);
-  swap(engine_, other->engine_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(SPPParameter, engine_)
+      + sizeof(SPPParameter::engine_)
+      - PROTOBUF_FIELD_OFFSET(SPPParameter, pyramid_height_)>(
+          reinterpret_cast<char*>(&pyramid_height_),
+          reinterpret_cast<char*>(&other->pyramid_height_));
 }
 
-::google::protobuf::Metadata SPPParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata SPPParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[63]);
 }
 
-
 // ===================================================================
 
-void V1LayerParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->accuracy_param_ = const_cast< ::opencv_caffe::AccuracyParameter*>(
-      ::opencv_caffe::AccuracyParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->argmax_param_ = const_cast< ::opencv_caffe::ArgMaxParameter*>(
-      ::opencv_caffe::ArgMaxParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->concat_param_ = const_cast< ::opencv_caffe::ConcatParameter*>(
-      ::opencv_caffe::ConcatParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->contrastive_loss_param_ = const_cast< ::opencv_caffe::ContrastiveLossParameter*>(
-      ::opencv_caffe::ContrastiveLossParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->convolution_param_ = const_cast< ::opencv_caffe::ConvolutionParameter*>(
-      ::opencv_caffe::ConvolutionParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->data_param_ = const_cast< ::opencv_caffe::DataParameter*>(
-      ::opencv_caffe::DataParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->dropout_param_ = const_cast< ::opencv_caffe::DropoutParameter*>(
-      ::opencv_caffe::DropoutParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->dummy_data_param_ = const_cast< ::opencv_caffe::DummyDataParameter*>(
-      ::opencv_caffe::DummyDataParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->eltwise_param_ = const_cast< ::opencv_caffe::EltwiseParameter*>(
-      ::opencv_caffe::EltwiseParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->exp_param_ = const_cast< ::opencv_caffe::ExpParameter*>(
-      ::opencv_caffe::ExpParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->hdf5_data_param_ = const_cast< ::opencv_caffe::HDF5DataParameter*>(
-      ::opencv_caffe::HDF5DataParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->hdf5_output_param_ = const_cast< ::opencv_caffe::HDF5OutputParameter*>(
-      ::opencv_caffe::HDF5OutputParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->hinge_loss_param_ = const_cast< ::opencv_caffe::HingeLossParameter*>(
-      ::opencv_caffe::HingeLossParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->image_data_param_ = const_cast< ::opencv_caffe::ImageDataParameter*>(
-      ::opencv_caffe::ImageDataParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->infogain_loss_param_ = const_cast< ::opencv_caffe::InfogainLossParameter*>(
-      ::opencv_caffe::InfogainLossParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->inner_product_param_ = const_cast< ::opencv_caffe::InnerProductParameter*>(
-      ::opencv_caffe::InnerProductParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->lrn_param_ = const_cast< ::opencv_caffe::LRNParameter*>(
-      ::opencv_caffe::LRNParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->memory_data_param_ = const_cast< ::opencv_caffe::MemoryDataParameter*>(
-      ::opencv_caffe::MemoryDataParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->mvn_param_ = const_cast< ::opencv_caffe::MVNParameter*>(
-      ::opencv_caffe::MVNParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->pooling_param_ = const_cast< ::opencv_caffe::PoolingParameter*>(
-      ::opencv_caffe::PoolingParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->power_param_ = const_cast< ::opencv_caffe::PowerParameter*>(
-      ::opencv_caffe::PowerParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->relu_param_ = const_cast< ::opencv_caffe::ReLUParameter*>(
-      ::opencv_caffe::ReLUParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->sigmoid_param_ = const_cast< ::opencv_caffe::SigmoidParameter*>(
-      ::opencv_caffe::SigmoidParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->softmax_param_ = const_cast< ::opencv_caffe::SoftmaxParameter*>(
-      ::opencv_caffe::SoftmaxParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->slice_param_ = const_cast< ::opencv_caffe::SliceParameter*>(
-      ::opencv_caffe::SliceParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->tanh_param_ = const_cast< ::opencv_caffe::TanHParameter*>(
-      ::opencv_caffe::TanHParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->threshold_param_ = const_cast< ::opencv_caffe::ThresholdParameter*>(
-      ::opencv_caffe::ThresholdParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->window_data_param_ = const_cast< ::opencv_caffe::WindowDataParameter*>(
-      ::opencv_caffe::WindowDataParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->transform_param_ = const_cast< ::opencv_caffe::TransformationParameter*>(
-      ::opencv_caffe::TransformationParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->loss_param_ = const_cast< ::opencv_caffe::LossParameter*>(
-      ::opencv_caffe::LossParameter::internal_default_instance());
-  ::opencv_caffe::_V1LayerParameter_default_instance_._instance.get_mutable()->layer_ = const_cast< ::opencv_caffe::V0LayerParameter*>(
-      ::opencv_caffe::V0LayerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int V1LayerParameter::kBottomFieldNumber;
-const int V1LayerParameter::kTopFieldNumber;
-const int V1LayerParameter::kNameFieldNumber;
-const int V1LayerParameter::kIncludeFieldNumber;
-const int V1LayerParameter::kExcludeFieldNumber;
-const int V1LayerParameter::kTypeFieldNumber;
-const int V1LayerParameter::kBlobsFieldNumber;
-const int V1LayerParameter::kParamFieldNumber;
-const int V1LayerParameter::kBlobShareModeFieldNumber;
-const int V1LayerParameter::kBlobsLrFieldNumber;
-const int V1LayerParameter::kWeightDecayFieldNumber;
-const int V1LayerParameter::kLossWeightFieldNumber;
-const int V1LayerParameter::kAccuracyParamFieldNumber;
-const int V1LayerParameter::kArgmaxParamFieldNumber;
-const int V1LayerParameter::kConcatParamFieldNumber;
-const int V1LayerParameter::kContrastiveLossParamFieldNumber;
-const int V1LayerParameter::kConvolutionParamFieldNumber;
-const int V1LayerParameter::kDataParamFieldNumber;
-const int V1LayerParameter::kDropoutParamFieldNumber;
-const int V1LayerParameter::kDummyDataParamFieldNumber;
-const int V1LayerParameter::kEltwiseParamFieldNumber;
-const int V1LayerParameter::kExpParamFieldNumber;
-const int V1LayerParameter::kHdf5DataParamFieldNumber;
-const int V1LayerParameter::kHdf5OutputParamFieldNumber;
-const int V1LayerParameter::kHingeLossParamFieldNumber;
-const int V1LayerParameter::kImageDataParamFieldNumber;
-const int V1LayerParameter::kInfogainLossParamFieldNumber;
-const int V1LayerParameter::kInnerProductParamFieldNumber;
-const int V1LayerParameter::kLrnParamFieldNumber;
-const int V1LayerParameter::kMemoryDataParamFieldNumber;
-const int V1LayerParameter::kMvnParamFieldNumber;
-const int V1LayerParameter::kPoolingParamFieldNumber;
-const int V1LayerParameter::kPowerParamFieldNumber;
-const int V1LayerParameter::kReluParamFieldNumber;
-const int V1LayerParameter::kSigmoidParamFieldNumber;
-const int V1LayerParameter::kSoftmaxParamFieldNumber;
-const int V1LayerParameter::kSliceParamFieldNumber;
-const int V1LayerParameter::kTanhParamFieldNumber;
-const int V1LayerParameter::kThresholdParamFieldNumber;
-const int V1LayerParameter::kWindowDataParamFieldNumber;
-const int V1LayerParameter::kTransformParamFieldNumber;
-const int V1LayerParameter::kLossParamFieldNumber;
-const int V1LayerParameter::kLayerFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-V1LayerParameter::V1LayerParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsV1LayerParameter();
+class V1LayerParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<V1LayerParameter>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_type(HasBits* has_bits) {
+    (*has_bits)[1] |= 1u;
+  }
+  static const ::opencv_caffe::AccuracyParameter& accuracy_param(const V1LayerParameter* msg);
+  static void set_has_accuracy_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 1048576u;
+  }
+  static const ::opencv_caffe::ArgMaxParameter& argmax_param(const V1LayerParameter* msg);
+  static void set_has_argmax_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 65536u;
+  }
+  static const ::opencv_caffe::ConcatParameter& concat_param(const V1LayerParameter* msg);
+  static void set_has_concat_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static const ::opencv_caffe::ContrastiveLossParameter& contrastive_loss_param(const V1LayerParameter* msg);
+  static void set_has_contrastive_loss_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 536870912u;
+  }
+  static const ::opencv_caffe::ConvolutionParameter& convolution_param(const V1LayerParameter* msg);
+  static void set_has_convolution_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static const ::opencv_caffe::DataParameter& data_param(const V1LayerParameter* msg);
+  static void set_has_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static const ::opencv_caffe::DropoutParameter& dropout_param(const V1LayerParameter* msg);
+  static void set_has_dropout_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static const ::opencv_caffe::DummyDataParameter& dummy_data_param(const V1LayerParameter* msg);
+  static void set_has_dummy_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 524288u;
+  }
+  static const ::opencv_caffe::EltwiseParameter& eltwise_param(const V1LayerParameter* msg);
+  static void set_has_eltwise_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 131072u;
+  }
+  static const ::opencv_caffe::ExpParameter& exp_param(const V1LayerParameter* msg);
+  static void set_has_exp_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 1073741824u;
+  }
+  static const ::opencv_caffe::HDF5DataParameter& hdf5_data_param(const V1LayerParameter* msg);
+  static void set_has_hdf5_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static const ::opencv_caffe::HDF5OutputParameter& hdf5_output_param(const V1LayerParameter* msg);
+  static void set_has_hdf5_output_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static const ::opencv_caffe::HingeLossParameter& hinge_loss_param(const V1LayerParameter* msg);
+  static void set_has_hinge_loss_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 2097152u;
+  }
+  static const ::opencv_caffe::ImageDataParameter& image_data_param(const V1LayerParameter* msg);
+  static void set_has_image_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static const ::opencv_caffe::InfogainLossParameter& infogain_loss_param(const V1LayerParameter* msg);
+  static void set_has_infogain_loss_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+  static const ::opencv_caffe::InnerProductParameter& inner_product_param(const V1LayerParameter* msg);
+  static void set_has_inner_product_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
+  }
+  static const ::opencv_caffe::LRNParameter& lrn_param(const V1LayerParameter* msg);
+  static void set_has_lrn_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
+  }
+  static const ::opencv_caffe::MemoryDataParameter& memory_data_param(const V1LayerParameter* msg);
+  static void set_has_memory_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 32768u;
+  }
+  static const ::opencv_caffe::MVNParameter& mvn_param(const V1LayerParameter* msg);
+  static void set_has_mvn_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 16777216u;
+  }
+  static const ::opencv_caffe::PoolingParameter& pooling_param(const V1LayerParameter* msg);
+  static void set_has_pooling_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 4096u;
+  }
+  static const ::opencv_caffe::PowerParameter& power_param(const V1LayerParameter* msg);
+  static void set_has_power_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 16384u;
+  }
+  static const ::opencv_caffe::ReLUParameter& relu_param(const V1LayerParameter* msg);
+  static void set_has_relu_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 4194304u;
+  }
+  static const ::opencv_caffe::SigmoidParameter& sigmoid_param(const V1LayerParameter* msg);
+  static void set_has_sigmoid_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 134217728u;
+  }
+  static const ::opencv_caffe::SoftmaxParameter& softmax_param(const V1LayerParameter* msg);
+  static void set_has_softmax_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 268435456u;
+  }
+  static const ::opencv_caffe::SliceParameter& slice_param(const V1LayerParameter* msg);
+  static void set_has_slice_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 8388608u;
+  }
+  static const ::opencv_caffe::TanHParameter& tanh_param(const V1LayerParameter* msg);
+  static void set_has_tanh_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 67108864u;
+  }
+  static const ::opencv_caffe::ThresholdParameter& threshold_param(const V1LayerParameter* msg);
+  static void set_has_threshold_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 262144u;
   }
+  static const ::opencv_caffe::WindowDataParameter& window_data_param(const V1LayerParameter* msg);
+  static void set_has_window_data_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 8192u;
+  }
+  static const ::opencv_caffe::TransformationParameter& transform_param(const V1LayerParameter* msg);
+  static void set_has_transform_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 33554432u;
+  }
+  static const ::opencv_caffe::LossParameter& loss_param(const V1LayerParameter* msg);
+  static void set_has_loss_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 2147483648u;
+  }
+  static const ::opencv_caffe::V0LayerParameter& layer(const V1LayerParameter* msg);
+  static void set_has_layer(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+const ::opencv_caffe::AccuracyParameter&
+V1LayerParameter::_Internal::accuracy_param(const V1LayerParameter* msg) {
+  return *msg->accuracy_param_;
+}
+const ::opencv_caffe::ArgMaxParameter&
+V1LayerParameter::_Internal::argmax_param(const V1LayerParameter* msg) {
+  return *msg->argmax_param_;
+}
+const ::opencv_caffe::ConcatParameter&
+V1LayerParameter::_Internal::concat_param(const V1LayerParameter* msg) {
+  return *msg->concat_param_;
+}
+const ::opencv_caffe::ContrastiveLossParameter&
+V1LayerParameter::_Internal::contrastive_loss_param(const V1LayerParameter* msg) {
+  return *msg->contrastive_loss_param_;
+}
+const ::opencv_caffe::ConvolutionParameter&
+V1LayerParameter::_Internal::convolution_param(const V1LayerParameter* msg) {
+  return *msg->convolution_param_;
+}
+const ::opencv_caffe::DataParameter&
+V1LayerParameter::_Internal::data_param(const V1LayerParameter* msg) {
+  return *msg->data_param_;
+}
+const ::opencv_caffe::DropoutParameter&
+V1LayerParameter::_Internal::dropout_param(const V1LayerParameter* msg) {
+  return *msg->dropout_param_;
+}
+const ::opencv_caffe::DummyDataParameter&
+V1LayerParameter::_Internal::dummy_data_param(const V1LayerParameter* msg) {
+  return *msg->dummy_data_param_;
+}
+const ::opencv_caffe::EltwiseParameter&
+V1LayerParameter::_Internal::eltwise_param(const V1LayerParameter* msg) {
+  return *msg->eltwise_param_;
+}
+const ::opencv_caffe::ExpParameter&
+V1LayerParameter::_Internal::exp_param(const V1LayerParameter* msg) {
+  return *msg->exp_param_;
+}
+const ::opencv_caffe::HDF5DataParameter&
+V1LayerParameter::_Internal::hdf5_data_param(const V1LayerParameter* msg) {
+  return *msg->hdf5_data_param_;
+}
+const ::opencv_caffe::HDF5OutputParameter&
+V1LayerParameter::_Internal::hdf5_output_param(const V1LayerParameter* msg) {
+  return *msg->hdf5_output_param_;
+}
+const ::opencv_caffe::HingeLossParameter&
+V1LayerParameter::_Internal::hinge_loss_param(const V1LayerParameter* msg) {
+  return *msg->hinge_loss_param_;
+}
+const ::opencv_caffe::ImageDataParameter&
+V1LayerParameter::_Internal::image_data_param(const V1LayerParameter* msg) {
+  return *msg->image_data_param_;
+}
+const ::opencv_caffe::InfogainLossParameter&
+V1LayerParameter::_Internal::infogain_loss_param(const V1LayerParameter* msg) {
+  return *msg->infogain_loss_param_;
+}
+const ::opencv_caffe::InnerProductParameter&
+V1LayerParameter::_Internal::inner_product_param(const V1LayerParameter* msg) {
+  return *msg->inner_product_param_;
+}
+const ::opencv_caffe::LRNParameter&
+V1LayerParameter::_Internal::lrn_param(const V1LayerParameter* msg) {
+  return *msg->lrn_param_;
+}
+const ::opencv_caffe::MemoryDataParameter&
+V1LayerParameter::_Internal::memory_data_param(const V1LayerParameter* msg) {
+  return *msg->memory_data_param_;
+}
+const ::opencv_caffe::MVNParameter&
+V1LayerParameter::_Internal::mvn_param(const V1LayerParameter* msg) {
+  return *msg->mvn_param_;
+}
+const ::opencv_caffe::PoolingParameter&
+V1LayerParameter::_Internal::pooling_param(const V1LayerParameter* msg) {
+  return *msg->pooling_param_;
+}
+const ::opencv_caffe::PowerParameter&
+V1LayerParameter::_Internal::power_param(const V1LayerParameter* msg) {
+  return *msg->power_param_;
+}
+const ::opencv_caffe::ReLUParameter&
+V1LayerParameter::_Internal::relu_param(const V1LayerParameter* msg) {
+  return *msg->relu_param_;
+}
+const ::opencv_caffe::SigmoidParameter&
+V1LayerParameter::_Internal::sigmoid_param(const V1LayerParameter* msg) {
+  return *msg->sigmoid_param_;
+}
+const ::opencv_caffe::SoftmaxParameter&
+V1LayerParameter::_Internal::softmax_param(const V1LayerParameter* msg) {
+  return *msg->softmax_param_;
+}
+const ::opencv_caffe::SliceParameter&
+V1LayerParameter::_Internal::slice_param(const V1LayerParameter* msg) {
+  return *msg->slice_param_;
+}
+const ::opencv_caffe::TanHParameter&
+V1LayerParameter::_Internal::tanh_param(const V1LayerParameter* msg) {
+  return *msg->tanh_param_;
+}
+const ::opencv_caffe::ThresholdParameter&
+V1LayerParameter::_Internal::threshold_param(const V1LayerParameter* msg) {
+  return *msg->threshold_param_;
+}
+const ::opencv_caffe::WindowDataParameter&
+V1LayerParameter::_Internal::window_data_param(const V1LayerParameter* msg) {
+  return *msg->window_data_param_;
+}
+const ::opencv_caffe::TransformationParameter&
+V1LayerParameter::_Internal::transform_param(const V1LayerParameter* msg) {
+  return *msg->transform_param_;
+}
+const ::opencv_caffe::LossParameter&
+V1LayerParameter::_Internal::loss_param(const V1LayerParameter* msg) {
+  return *msg->loss_param_;
+}
+const ::opencv_caffe::V0LayerParameter&
+V1LayerParameter::_Internal::layer(const V1LayerParameter* msg) {
+  return *msg->layer_;
+}
+V1LayerParameter::V1LayerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  bottom_(arena),
+  top_(arena),
+  blobs_(arena),
+  blobs_lr_(arena),
+  weight_decay_(arena),
+  include_(arena),
+  exclude_(arena),
+  loss_weight_(arena),
+  param_(arena),
+  blob_share_mode_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.V1LayerParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.V1LayerParameter)
 }
 V1LayerParameter::V1LayerParameter(const V1LayerParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
       bottom_(from.bottom_),
       top_(from.top_),
@@ -35111,187 +29059,196 @@ V1LayerParameter::V1LayerParameter(const V1LayerParameter& from)
       exclude_(from.exclude_),
       loss_weight_(from.loss_weight_),
       param_(from.param_),
-      blob_share_mode_(from.blob_share_mode_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  if (from.has_layer()) {
+      blob_share_mode_(from.blob_share_mode_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_layer()) {
     layer_ = new ::opencv_caffe::V0LayerParameter(*from.layer_);
   } else {
-    layer_ = NULL;
+    layer_ = nullptr;
   }
-  if (from.has_concat_param()) {
+  if (from._internal_has_concat_param()) {
     concat_param_ = new ::opencv_caffe::ConcatParameter(*from.concat_param_);
   } else {
-    concat_param_ = NULL;
+    concat_param_ = nullptr;
   }
-  if (from.has_convolution_param()) {
+  if (from._internal_has_convolution_param()) {
     convolution_param_ = new ::opencv_caffe::ConvolutionParameter(*from.convolution_param_);
   } else {
-    convolution_param_ = NULL;
+    convolution_param_ = nullptr;
   }
-  if (from.has_data_param()) {
+  if (from._internal_has_data_param()) {
     data_param_ = new ::opencv_caffe::DataParameter(*from.data_param_);
   } else {
-    data_param_ = NULL;
+    data_param_ = nullptr;
   }
-  if (from.has_dropout_param()) {
+  if (from._internal_has_dropout_param()) {
     dropout_param_ = new ::opencv_caffe::DropoutParameter(*from.dropout_param_);
   } else {
-    dropout_param_ = NULL;
+    dropout_param_ = nullptr;
   }
-  if (from.has_hdf5_data_param()) {
+  if (from._internal_has_hdf5_data_param()) {
     hdf5_data_param_ = new ::opencv_caffe::HDF5DataParameter(*from.hdf5_data_param_);
   } else {
-    hdf5_data_param_ = NULL;
+    hdf5_data_param_ = nullptr;
   }
-  if (from.has_hdf5_output_param()) {
+  if (from._internal_has_hdf5_output_param()) {
     hdf5_output_param_ = new ::opencv_caffe::HDF5OutputParameter(*from.hdf5_output_param_);
   } else {
-    hdf5_output_param_ = NULL;
+    hdf5_output_param_ = nullptr;
   }
-  if (from.has_image_data_param()) {
+  if (from._internal_has_image_data_param()) {
     image_data_param_ = new ::opencv_caffe::ImageDataParameter(*from.image_data_param_);
   } else {
-    image_data_param_ = NULL;
+    image_data_param_ = nullptr;
   }
-  if (from.has_infogain_loss_param()) {
+  if (from._internal_has_infogain_loss_param()) {
     infogain_loss_param_ = new ::opencv_caffe::InfogainLossParameter(*from.infogain_loss_param_);
   } else {
-    infogain_loss_param_ = NULL;
+    infogain_loss_param_ = nullptr;
   }
-  if (from.has_inner_product_param()) {
+  if (from._internal_has_inner_product_param()) {
     inner_product_param_ = new ::opencv_caffe::InnerProductParameter(*from.inner_product_param_);
   } else {
-    inner_product_param_ = NULL;
+    inner_product_param_ = nullptr;
   }
-  if (from.has_lrn_param()) {
+  if (from._internal_has_lrn_param()) {
     lrn_param_ = new ::opencv_caffe::LRNParameter(*from.lrn_param_);
   } else {
-    lrn_param_ = NULL;
+    lrn_param_ = nullptr;
   }
-  if (from.has_pooling_param()) {
+  if (from._internal_has_pooling_param()) {
     pooling_param_ = new ::opencv_caffe::PoolingParameter(*from.pooling_param_);
   } else {
-    pooling_param_ = NULL;
+    pooling_param_ = nullptr;
   }
-  if (from.has_window_data_param()) {
+  if (from._internal_has_window_data_param()) {
     window_data_param_ = new ::opencv_caffe::WindowDataParameter(*from.window_data_param_);
   } else {
-    window_data_param_ = NULL;
+    window_data_param_ = nullptr;
   }
-  if (from.has_power_param()) {
+  if (from._internal_has_power_param()) {
     power_param_ = new ::opencv_caffe::PowerParameter(*from.power_param_);
   } else {
-    power_param_ = NULL;
+    power_param_ = nullptr;
   }
-  if (from.has_memory_data_param()) {
+  if (from._internal_has_memory_data_param()) {
     memory_data_param_ = new ::opencv_caffe::MemoryDataParameter(*from.memory_data_param_);
   } else {
-    memory_data_param_ = NULL;
+    memory_data_param_ = nullptr;
   }
-  if (from.has_argmax_param()) {
+  if (from._internal_has_argmax_param()) {
     argmax_param_ = new ::opencv_caffe::ArgMaxParameter(*from.argmax_param_);
   } else {
-    argmax_param_ = NULL;
+    argmax_param_ = nullptr;
   }
-  if (from.has_eltwise_param()) {
+  if (from._internal_has_eltwise_param()) {
     eltwise_param_ = new ::opencv_caffe::EltwiseParameter(*from.eltwise_param_);
   } else {
-    eltwise_param_ = NULL;
+    eltwise_param_ = nullptr;
   }
-  if (from.has_threshold_param()) {
+  if (from._internal_has_threshold_param()) {
     threshold_param_ = new ::opencv_caffe::ThresholdParameter(*from.threshold_param_);
   } else {
-    threshold_param_ = NULL;
+    threshold_param_ = nullptr;
   }
-  if (from.has_dummy_data_param()) {
+  if (from._internal_has_dummy_data_param()) {
     dummy_data_param_ = new ::opencv_caffe::DummyDataParameter(*from.dummy_data_param_);
   } else {
-    dummy_data_param_ = NULL;
+    dummy_data_param_ = nullptr;
   }
-  if (from.has_accuracy_param()) {
+  if (from._internal_has_accuracy_param()) {
     accuracy_param_ = new ::opencv_caffe::AccuracyParameter(*from.accuracy_param_);
   } else {
-    accuracy_param_ = NULL;
+    accuracy_param_ = nullptr;
   }
-  if (from.has_hinge_loss_param()) {
+  if (from._internal_has_hinge_loss_param()) {
     hinge_loss_param_ = new ::opencv_caffe::HingeLossParameter(*from.hinge_loss_param_);
   } else {
-    hinge_loss_param_ = NULL;
+    hinge_loss_param_ = nullptr;
   }
-  if (from.has_relu_param()) {
+  if (from._internal_has_relu_param()) {
     relu_param_ = new ::opencv_caffe::ReLUParameter(*from.relu_param_);
   } else {
-    relu_param_ = NULL;
+    relu_param_ = nullptr;
   }
-  if (from.has_slice_param()) {
+  if (from._internal_has_slice_param()) {
     slice_param_ = new ::opencv_caffe::SliceParameter(*from.slice_param_);
   } else {
-    slice_param_ = NULL;
+    slice_param_ = nullptr;
   }
-  if (from.has_mvn_param()) {
+  if (from._internal_has_mvn_param()) {
     mvn_param_ = new ::opencv_caffe::MVNParameter(*from.mvn_param_);
   } else {
-    mvn_param_ = NULL;
+    mvn_param_ = nullptr;
   }
-  if (from.has_transform_param()) {
+  if (from._internal_has_transform_param()) {
     transform_param_ = new ::opencv_caffe::TransformationParameter(*from.transform_param_);
   } else {
-    transform_param_ = NULL;
+    transform_param_ = nullptr;
   }
-  if (from.has_tanh_param()) {
+  if (from._internal_has_tanh_param()) {
     tanh_param_ = new ::opencv_caffe::TanHParameter(*from.tanh_param_);
   } else {
-    tanh_param_ = NULL;
+    tanh_param_ = nullptr;
   }
-  if (from.has_sigmoid_param()) {
+  if (from._internal_has_sigmoid_param()) {
     sigmoid_param_ = new ::opencv_caffe::SigmoidParameter(*from.sigmoid_param_);
   } else {
-    sigmoid_param_ = NULL;
+    sigmoid_param_ = nullptr;
   }
-  if (from.has_softmax_param()) {
+  if (from._internal_has_softmax_param()) {
     softmax_param_ = new ::opencv_caffe::SoftmaxParameter(*from.softmax_param_);
   } else {
-    softmax_param_ = NULL;
+    softmax_param_ = nullptr;
   }
-  if (from.has_contrastive_loss_param()) {
+  if (from._internal_has_contrastive_loss_param()) {
     contrastive_loss_param_ = new ::opencv_caffe::ContrastiveLossParameter(*from.contrastive_loss_param_);
   } else {
-    contrastive_loss_param_ = NULL;
+    contrastive_loss_param_ = nullptr;
   }
-  if (from.has_exp_param()) {
+  if (from._internal_has_exp_param()) {
     exp_param_ = new ::opencv_caffe::ExpParameter(*from.exp_param_);
   } else {
-    exp_param_ = NULL;
+    exp_param_ = nullptr;
   }
-  if (from.has_loss_param()) {
+  if (from._internal_has_loss_param()) {
     loss_param_ = new ::opencv_caffe::LossParameter(*from.loss_param_);
   } else {
-    loss_param_ = NULL;
+    loss_param_ = nullptr;
   }
   type_ = from.type_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.V1LayerParameter)
 }
 
-void V1LayerParameter::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&layer_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&type_) -
-      reinterpret_cast<char*>(&layer_)) + sizeof(type_));
-  _cached_size_ = 0;
+inline void V1LayerParameter::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&layer_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&type_) -
+    reinterpret_cast<char*>(&layer_)) + sizeof(type_));
 }
 
 V1LayerParameter::~V1LayerParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.V1LayerParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void V1LayerParameter::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void V1LayerParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete layer_;
   if (this != internal_default_instance()) delete concat_param_;
   if (this != internal_default_instance()) delete convolution_param_;
@@ -35325,32 +29282,19 @@ void V1LayerParameter::SharedDtor() {
   if (this != internal_default_instance()) delete loss_param_;
 }
 
-void V1LayerParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* V1LayerParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void V1LayerParameter::ArenaDtor(void* object) {
+  V1LayerParameter* _this = reinterpret_cast< V1LayerParameter* >(object);
+  (void)_this;
 }
-
-const V1LayerParameter& V1LayerParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsV1LayerParameter();
-  return *internal_default_instance();
+void V1LayerParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-V1LayerParameter* V1LayerParameter::New(::google::protobuf::Arena* arena) const {
-  V1LayerParameter* n = new V1LayerParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void V1LayerParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void V1LayerParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.V1LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -35365,1365 +29309,963 @@ void V1LayerParameter::Clear() {
   param_.Clear();
   blob_share_mode_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(layer_ != NULL);
+      GOOGLE_DCHECK(layer_ != nullptr);
       layer_->Clear();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(concat_param_ != NULL);
+      GOOGLE_DCHECK(concat_param_ != nullptr);
       concat_param_->Clear();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(convolution_param_ != NULL);
+      GOOGLE_DCHECK(convolution_param_ != nullptr);
       convolution_param_->Clear();
     }
     if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(data_param_ != NULL);
+      GOOGLE_DCHECK(data_param_ != nullptr);
       data_param_->Clear();
     }
     if (cached_has_bits & 0x00000020u) {
-      GOOGLE_DCHECK(dropout_param_ != NULL);
+      GOOGLE_DCHECK(dropout_param_ != nullptr);
       dropout_param_->Clear();
     }
     if (cached_has_bits & 0x00000040u) {
-      GOOGLE_DCHECK(hdf5_data_param_ != NULL);
+      GOOGLE_DCHECK(hdf5_data_param_ != nullptr);
       hdf5_data_param_->Clear();
     }
     if (cached_has_bits & 0x00000080u) {
-      GOOGLE_DCHECK(hdf5_output_param_ != NULL);
+      GOOGLE_DCHECK(hdf5_output_param_ != nullptr);
       hdf5_output_param_->Clear();
     }
   }
-  if (cached_has_bits & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     if (cached_has_bits & 0x00000100u) {
-      GOOGLE_DCHECK(image_data_param_ != NULL);
+      GOOGLE_DCHECK(image_data_param_ != nullptr);
       image_data_param_->Clear();
     }
     if (cached_has_bits & 0x00000200u) {
-      GOOGLE_DCHECK(infogain_loss_param_ != NULL);
+      GOOGLE_DCHECK(infogain_loss_param_ != nullptr);
       infogain_loss_param_->Clear();
     }
     if (cached_has_bits & 0x00000400u) {
-      GOOGLE_DCHECK(inner_product_param_ != NULL);
+      GOOGLE_DCHECK(inner_product_param_ != nullptr);
       inner_product_param_->Clear();
     }
     if (cached_has_bits & 0x00000800u) {
-      GOOGLE_DCHECK(lrn_param_ != NULL);
+      GOOGLE_DCHECK(lrn_param_ != nullptr);
       lrn_param_->Clear();
     }
     if (cached_has_bits & 0x00001000u) {
-      GOOGLE_DCHECK(pooling_param_ != NULL);
+      GOOGLE_DCHECK(pooling_param_ != nullptr);
       pooling_param_->Clear();
     }
     if (cached_has_bits & 0x00002000u) {
-      GOOGLE_DCHECK(window_data_param_ != NULL);
+      GOOGLE_DCHECK(window_data_param_ != nullptr);
       window_data_param_->Clear();
     }
     if (cached_has_bits & 0x00004000u) {
-      GOOGLE_DCHECK(power_param_ != NULL);
+      GOOGLE_DCHECK(power_param_ != nullptr);
       power_param_->Clear();
     }
     if (cached_has_bits & 0x00008000u) {
-      GOOGLE_DCHECK(memory_data_param_ != NULL);
+      GOOGLE_DCHECK(memory_data_param_ != nullptr);
       memory_data_param_->Clear();
     }
   }
-  if (cached_has_bits & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     if (cached_has_bits & 0x00010000u) {
-      GOOGLE_DCHECK(argmax_param_ != NULL);
+      GOOGLE_DCHECK(argmax_param_ != nullptr);
       argmax_param_->Clear();
     }
     if (cached_has_bits & 0x00020000u) {
-      GOOGLE_DCHECK(eltwise_param_ != NULL);
+      GOOGLE_DCHECK(eltwise_param_ != nullptr);
       eltwise_param_->Clear();
     }
     if (cached_has_bits & 0x00040000u) {
-      GOOGLE_DCHECK(threshold_param_ != NULL);
+      GOOGLE_DCHECK(threshold_param_ != nullptr);
       threshold_param_->Clear();
     }
     if (cached_has_bits & 0x00080000u) {
-      GOOGLE_DCHECK(dummy_data_param_ != NULL);
+      GOOGLE_DCHECK(dummy_data_param_ != nullptr);
       dummy_data_param_->Clear();
     }
     if (cached_has_bits & 0x00100000u) {
-      GOOGLE_DCHECK(accuracy_param_ != NULL);
+      GOOGLE_DCHECK(accuracy_param_ != nullptr);
       accuracy_param_->Clear();
     }
     if (cached_has_bits & 0x00200000u) {
-      GOOGLE_DCHECK(hinge_loss_param_ != NULL);
+      GOOGLE_DCHECK(hinge_loss_param_ != nullptr);
       hinge_loss_param_->Clear();
     }
     if (cached_has_bits & 0x00400000u) {
-      GOOGLE_DCHECK(relu_param_ != NULL);
+      GOOGLE_DCHECK(relu_param_ != nullptr);
       relu_param_->Clear();
     }
     if (cached_has_bits & 0x00800000u) {
-      GOOGLE_DCHECK(slice_param_ != NULL);
+      GOOGLE_DCHECK(slice_param_ != nullptr);
       slice_param_->Clear();
     }
   }
-  if (cached_has_bits & 4278190080u) {
+  if (cached_has_bits & 0xff000000u) {
     if (cached_has_bits & 0x01000000u) {
-      GOOGLE_DCHECK(mvn_param_ != NULL);
+      GOOGLE_DCHECK(mvn_param_ != nullptr);
       mvn_param_->Clear();
     }
     if (cached_has_bits & 0x02000000u) {
-      GOOGLE_DCHECK(transform_param_ != NULL);
+      GOOGLE_DCHECK(transform_param_ != nullptr);
       transform_param_->Clear();
     }
     if (cached_has_bits & 0x04000000u) {
-      GOOGLE_DCHECK(tanh_param_ != NULL);
+      GOOGLE_DCHECK(tanh_param_ != nullptr);
       tanh_param_->Clear();
     }
     if (cached_has_bits & 0x08000000u) {
-      GOOGLE_DCHECK(sigmoid_param_ != NULL);
+      GOOGLE_DCHECK(sigmoid_param_ != nullptr);
       sigmoid_param_->Clear();
     }
     if (cached_has_bits & 0x10000000u) {
-      GOOGLE_DCHECK(softmax_param_ != NULL);
+      GOOGLE_DCHECK(softmax_param_ != nullptr);
       softmax_param_->Clear();
     }
     if (cached_has_bits & 0x20000000u) {
-      GOOGLE_DCHECK(contrastive_loss_param_ != NULL);
+      GOOGLE_DCHECK(contrastive_loss_param_ != nullptr);
       contrastive_loss_param_->Clear();
     }
     if (cached_has_bits & 0x40000000u) {
-      GOOGLE_DCHECK(exp_param_ != NULL);
+      GOOGLE_DCHECK(exp_param_ != nullptr);
       exp_param_->Clear();
     }
     if (cached_has_bits & 0x80000000u) {
-      GOOGLE_DCHECK(loss_param_ != NULL);
+      GOOGLE_DCHECK(loss_param_ != nullptr);
       loss_param_->Clear();
     }
   }
   type_ = 0;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool V1LayerParameter::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:opencv_caffe.V1LayerParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* V1LayerParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.V0LayerParameter layer = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_layer()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_layer(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated string bottom = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_bottom()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->bottom(this->bottom_size() - 1).data(),
-            static_cast<int>(this->bottom(this->bottom_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V1LayerParameter.bottom");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_bottom();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V1LayerParameter.bottom");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
       // repeated string top = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_top()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->top(this->top_size() - 1).data(),
-            static_cast<int>(this->top(this->top_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V1LayerParameter.top");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_top();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V1LayerParameter.top");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
       // optional string name = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V1LayerParameter.name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V1LayerParameter.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.V1LayerParameter.LayerType type = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::V1LayerParameter_LayerType_IsValid(value)) {
-            set_type(static_cast< ::opencv_caffe::V1LayerParameter_LayerType >(value));
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::V1LayerParameter_LayerType_IsValid(val))) {
+            _internal_set_type(static_cast<::opencv_caffe::V1LayerParameter_LayerType>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                5, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_caffe.BlobProto blobs = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_blobs()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_blobs(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
       // repeated float blobs_lr = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 61u, input, this->mutable_blobs_lr())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_blobs_lr())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 61)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_blobs_lr(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<61>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 58) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_blobs_lr(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated float weight_decay = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(69u /* 69 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 69u, input, this->mutable_weight_decay())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_weight_decay())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 69)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_weight_decay(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<69>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 66) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_weight_decay(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.ConcatParameter concat_param = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_concat_param()));
-        } else {
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ctx->ParseMessage(_internal_mutable_concat_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.ConvolutionParameter convolution_param = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_convolution_param()));
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr = ctx->ParseMessage(_internal_mutable_convolution_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.DataParameter data_param = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_data_param()));
-        } else {
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          ptr = ctx->ParseMessage(_internal_mutable_data_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.DropoutParameter dropout_param = 12;
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_dropout_param()));
-        } else {
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          ptr = ctx->ParseMessage(_internal_mutable_dropout_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 13;
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_hdf5_data_param()));
-        } else {
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
+          ptr = ctx->ParseMessage(_internal_mutable_hdf5_data_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 14;
-      case 14: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_hdf5_output_param()));
-        } else {
+      case 14:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 114)) {
+          ptr = ctx->ParseMessage(_internal_mutable_hdf5_output_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.ImageDataParameter image_data_param = 15;
-      case 15: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_image_data_param()));
-        } else {
+      case 15:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 122)) {
+          ptr = ctx->ParseMessage(_internal_mutable_image_data_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 16;
-      case 16: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(130u /* 130 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_infogain_loss_param()));
-        } else {
+      case 16:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 130)) {
+          ptr = ctx->ParseMessage(_internal_mutable_infogain_loss_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.InnerProductParameter inner_product_param = 17;
-      case 17: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(138u /* 138 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_inner_product_param()));
-        } else {
+      case 17:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 138)) {
+          ptr = ctx->ParseMessage(_internal_mutable_inner_product_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.LRNParameter lrn_param = 18;
-      case 18: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(146u /* 146 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_lrn_param()));
-        } else {
+      case 18:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 146)) {
+          ptr = ctx->ParseMessage(_internal_mutable_lrn_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.PoolingParameter pooling_param = 19;
-      case 19: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(154u /* 154 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_pooling_param()));
-        } else {
+      case 19:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 154)) {
+          ptr = ctx->ParseMessage(_internal_mutable_pooling_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.WindowDataParameter window_data_param = 20;
-      case 20: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(162u /* 162 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_window_data_param()));
-        } else {
+      case 20:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 162)) {
+          ptr = ctx->ParseMessage(_internal_mutable_window_data_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.PowerParameter power_param = 21;
-      case 21: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(170u /* 170 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_power_param()));
-        } else {
+      case 21:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
+          ptr = ctx->ParseMessage(_internal_mutable_power_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.MemoryDataParameter memory_data_param = 22;
-      case 22: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(178u /* 178 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_memory_data_param()));
-        } else {
+      case 22:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 178)) {
+          ptr = ctx->ParseMessage(_internal_mutable_memory_data_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.ArgMaxParameter argmax_param = 23;
-      case 23: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(186u /* 186 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_argmax_param()));
-        } else {
+      case 23:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 186)) {
+          ptr = ctx->ParseMessage(_internal_mutable_argmax_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.EltwiseParameter eltwise_param = 24;
-      case 24: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(194u /* 194 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_eltwise_param()));
-        } else {
+      case 24:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 194)) {
+          ptr = ctx->ParseMessage(_internal_mutable_eltwise_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.ThresholdParameter threshold_param = 25;
-      case 25: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(202u /* 202 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_threshold_param()));
-        } else {
+      case 25:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 202)) {
+          ptr = ctx->ParseMessage(_internal_mutable_threshold_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.DummyDataParameter dummy_data_param = 26;
-      case 26: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(210u /* 210 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_dummy_data_param()));
-        } else {
+      case 26:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 210)) {
+          ptr = ctx->ParseMessage(_internal_mutable_dummy_data_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.AccuracyParameter accuracy_param = 27;
-      case 27: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(218u /* 218 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_accuracy_param()));
-        } else {
+      case 27:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 218)) {
+          ptr = ctx->ParseMessage(_internal_mutable_accuracy_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 29;
-      case 29: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(234u /* 234 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_hinge_loss_param()));
-        } else {
+      case 29:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 234)) {
+          ptr = ctx->ParseMessage(_internal_mutable_hinge_loss_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.ReLUParameter relu_param = 30;
-      case 30: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(242u /* 242 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_relu_param()));
-        } else {
+      case 30:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 242)) {
+          ptr = ctx->ParseMessage(_internal_mutable_relu_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.SliceParameter slice_param = 31;
-      case 31: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(250u /* 250 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_slice_param()));
-        } else {
+      case 31:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 250)) {
+          ptr = ctx->ParseMessage(_internal_mutable_slice_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_caffe.NetStateRule include = 32;
-      case 32: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(2u /* 258 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_include()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 32:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 2)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_include(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<258>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
       // repeated .opencv_caffe.NetStateRule exclude = 33;
-      case 33: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 266 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_exclude()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 33:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_exclude(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<266>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.MVNParameter mvn_param = 34;
-      case 34: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 274 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_mvn_param()));
-        } else {
+      case 34:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_mvn_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated float loss_weight = 35;
-      case 35: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 285 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 2, 285u, input, this->mutable_loss_weight())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 282 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_loss_weight())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 35:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            _internal_add_loss_weight(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<285>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 26) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_loss_weight(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.TransformationParameter transform_param = 36;
-      case 36: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 290 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_transform_param()));
-        } else {
+      case 36:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_transform_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.TanHParameter tanh_param = 37;
-      case 37: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 298 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_tanh_param()));
-        } else {
+      case 37:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_tanh_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.SigmoidParameter sigmoid_param = 38;
-      case 38: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 306 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_sigmoid_param()));
-        } else {
+      case 38:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ctx->ParseMessage(_internal_mutable_sigmoid_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.SoftmaxParameter softmax_param = 39;
-      case 39: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 314 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_softmax_param()));
-        } else {
+      case 39:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_softmax_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 40;
-      case 40: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 322 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_contrastive_loss_param()));
-        } else {
+      case 40:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ctx->ParseMessage(_internal_mutable_contrastive_loss_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.ExpParameter exp_param = 41;
-      case 41: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 330 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_exp_param()));
-        } else {
+      case 41:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ctx->ParseMessage(_internal_mutable_exp_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.LossParameter loss_param = 42;
-      case 42: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 338 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_loss_param()));
-        } else {
+      case 42:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr = ctx->ParseMessage(_internal_mutable_loss_param(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated string param = 1001;
-      case 1001: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 8010 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_param()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->param(this->param_size() - 1).data(),
-            static_cast<int>(this->param(this->param_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V1LayerParameter.param");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 1001:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            auto str = _internal_add_param();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V1LayerParameter.param");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8010>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
       // repeated .opencv_caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002;
-      case 1002: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 8016 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::V1LayerParameter_DimCheckMode_IsValid(value)) {
-            add_blob_share_mode(static_cast< ::opencv_caffe::V1LayerParameter_DimCheckMode >(value));
-          } else {
-            mutable_unknown_fields()->AddVarint(
-                1002, static_cast< ::google::protobuf::uint64>(value));
-          }
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 8018 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns(
-                 input,
-                 1002,
-                 ::opencv_caffe::V1LayerParameter_DimCheckMode_IsValid,
-                 mutable_unknown_fields(),
-                 this->mutable_blob_share_mode())));
-        } 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:opencv_caffe.V1LayerParameter)
-  return true;
+      case 1002:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+            CHK_(ptr);
+            if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::V1LayerParameter_DimCheckMode_IsValid(val))) {
+              _internal_add_blob_share_mode(static_cast<::opencv_caffe::V1LayerParameter_DimCheckMode>(val));
+            } else {
+              ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1002, val, mutable_unknown_fields());
+            }
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8016>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 82) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(_internal_mutable_blob_share_mode(), ptr, ctx, ::opencv_caffe::V1LayerParameter_DimCheckMode_IsValid, &_internal_metadata_, 1002);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.V1LayerParameter)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void V1LayerParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.V1LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* V1LayerParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.V1LayerParameter)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.V0LayerParameter layer = 1;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->layer_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::layer(this), target, stream);
   }
 
   // repeated string bottom = 2;
-  for (int i = 0, n = this->bottom_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->bottom(i).data(), static_cast<int>(this->bottom(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_bottom_size(); i < n; i++) {
+    const auto& s = this->_internal_bottom(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V1LayerParameter.bottom");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      2, this->bottom(i), output);
+    target = stream->WriteString(2, s, target);
   }
 
   // repeated string top = 3;
-  for (int i = 0, n = this->top_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->top(i).data(), static_cast<int>(this->top(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_top_size(); i < n; i++) {
+    const auto& s = this->_internal_top(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V1LayerParameter.top");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      3, this->top(i), output);
+    target = stream->WriteString(3, s, target);
   }
 
   // optional string name = 4;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V1LayerParameter.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->name(), output);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_name(), target);
   }
 
   cached_has_bits = _has_bits_[1];
   // optional .opencv_caffe.V1LayerParameter.LayerType type = 5;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      5, this->type(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      5, this->_internal_type(), target);
   }
 
   // repeated .opencv_caffe.BlobProto blobs = 6;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->blobs_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, this->blobs(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_blobs_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(6, this->_internal_blobs(i), target, stream);
   }
 
   // repeated float blobs_lr = 7;
-  for (int i = 0, n = this->blobs_lr_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      7, this->blobs_lr(i), output);
+  for (int i = 0, n = this->_internal_blobs_lr_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(7, this->_internal_blobs_lr(i), target);
   }
 
   // repeated float weight_decay = 8;
-  for (int i = 0, n = this->weight_decay_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      8, this->weight_decay(i), output);
+  for (int i = 0, n = this->_internal_weight_decay_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(8, this->_internal_weight_decay(i), target);
   }
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.ConcatParameter concat_param = 9;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      9, *this->concat_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        9, _Internal::concat_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ConvolutionParameter convolution_param = 10;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      10, *this->convolution_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        10, _Internal::convolution_param(this), target, stream);
   }
 
   // optional .opencv_caffe.DataParameter data_param = 11;
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      11, *this->data_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        11, _Internal::data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.DropoutParameter dropout_param = 12;
   if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      12, *this->dropout_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        12, _Internal::dropout_param(this), target, stream);
   }
 
   // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 13;
   if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      13, *this->hdf5_data_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        13, _Internal::hdf5_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 14;
   if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      14, *this->hdf5_output_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        14, _Internal::hdf5_output_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ImageDataParameter image_data_param = 15;
   if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      15, *this->image_data_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        15, _Internal::image_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 16;
   if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      16, *this->infogain_loss_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        16, _Internal::infogain_loss_param(this), target, stream);
   }
 
   // optional .opencv_caffe.InnerProductParameter inner_product_param = 17;
   if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      17, *this->inner_product_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        17, _Internal::inner_product_param(this), target, stream);
   }
 
   // optional .opencv_caffe.LRNParameter lrn_param = 18;
   if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      18, *this->lrn_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        18, _Internal::lrn_param(this), target, stream);
   }
 
   // optional .opencv_caffe.PoolingParameter pooling_param = 19;
   if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      19, *this->pooling_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        19, _Internal::pooling_param(this), target, stream);
   }
 
   // optional .opencv_caffe.WindowDataParameter window_data_param = 20;
   if (cached_has_bits & 0x00002000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      20, *this->window_data_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        20, _Internal::window_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.PowerParameter power_param = 21;
   if (cached_has_bits & 0x00004000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      21, *this->power_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        21, _Internal::power_param(this), target, stream);
   }
 
   // optional .opencv_caffe.MemoryDataParameter memory_data_param = 22;
   if (cached_has_bits & 0x00008000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      22, *this->memory_data_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        22, _Internal::memory_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ArgMaxParameter argmax_param = 23;
   if (cached_has_bits & 0x00010000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      23, *this->argmax_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        23, _Internal::argmax_param(this), target, stream);
   }
 
   // optional .opencv_caffe.EltwiseParameter eltwise_param = 24;
   if (cached_has_bits & 0x00020000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      24, *this->eltwise_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        24, _Internal::eltwise_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ThresholdParameter threshold_param = 25;
   if (cached_has_bits & 0x00040000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      25, *this->threshold_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        25, _Internal::threshold_param(this), target, stream);
   }
 
   // optional .opencv_caffe.DummyDataParameter dummy_data_param = 26;
   if (cached_has_bits & 0x00080000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      26, *this->dummy_data_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        26, _Internal::dummy_data_param(this), target, stream);
   }
 
   // optional .opencv_caffe.AccuracyParameter accuracy_param = 27;
   if (cached_has_bits & 0x00100000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      27, *this->accuracy_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        27, _Internal::accuracy_param(this), target, stream);
   }
 
   // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 29;
   if (cached_has_bits & 0x00200000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      29, *this->hinge_loss_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        29, _Internal::hinge_loss_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ReLUParameter relu_param = 30;
   if (cached_has_bits & 0x00400000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      30, *this->relu_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        30, _Internal::relu_param(this), target, stream);
   }
 
   // optional .opencv_caffe.SliceParameter slice_param = 31;
   if (cached_has_bits & 0x00800000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      31, *this->slice_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        31, _Internal::slice_param(this), target, stream);
   }
 
   // repeated .opencv_caffe.NetStateRule include = 32;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->include_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      32, this->include(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_include_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(32, this->_internal_include(i), target, stream);
   }
 
   // repeated .opencv_caffe.NetStateRule exclude = 33;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->exclude_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      33, this->exclude(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_exclude_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(33, this->_internal_exclude(i), target, stream);
   }
 
   // optional .opencv_caffe.MVNParameter mvn_param = 34;
   if (cached_has_bits & 0x01000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      34, *this->mvn_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        34, _Internal::mvn_param(this), target, stream);
   }
 
   // repeated float loss_weight = 35;
-  for (int i = 0, n = this->loss_weight_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      35, this->loss_weight(i), output);
+  for (int i = 0, n = this->_internal_loss_weight_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(35, this->_internal_loss_weight(i), target);
   }
 
   // optional .opencv_caffe.TransformationParameter transform_param = 36;
   if (cached_has_bits & 0x02000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      36, *this->transform_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        36, _Internal::transform_param(this), target, stream);
   }
 
   // optional .opencv_caffe.TanHParameter tanh_param = 37;
   if (cached_has_bits & 0x04000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      37, *this->tanh_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        37, _Internal::tanh_param(this), target, stream);
   }
 
   // optional .opencv_caffe.SigmoidParameter sigmoid_param = 38;
   if (cached_has_bits & 0x08000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      38, *this->sigmoid_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        38, _Internal::sigmoid_param(this), target, stream);
   }
 
   // optional .opencv_caffe.SoftmaxParameter softmax_param = 39;
   if (cached_has_bits & 0x10000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      39, *this->softmax_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        39, _Internal::softmax_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 40;
   if (cached_has_bits & 0x20000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      40, *this->contrastive_loss_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        40, _Internal::contrastive_loss_param(this), target, stream);
   }
 
   // optional .opencv_caffe.ExpParameter exp_param = 41;
   if (cached_has_bits & 0x40000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      41, *this->exp_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        41, _Internal::exp_param(this), target, stream);
   }
 
   // optional .opencv_caffe.LossParameter loss_param = 42;
   if (cached_has_bits & 0x80000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      42, *this->loss_param_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        42, _Internal::loss_param(this), target, stream);
   }
 
   // repeated string param = 1001;
-  for (int i = 0, n = this->param_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->param(i).data(), static_cast<int>(this->param(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_param_size(); i < n; i++) {
+    const auto& s = this->_internal_param(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V1LayerParameter.param");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      1001, this->param(i), output);
+    target = stream->WriteString(1001, s, target);
   }
 
   // repeated .opencv_caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002;
-  for (int i = 0, n = this->blob_share_mode_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1002, this->blob_share_mode(i), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.V1LayerParameter)
-}
-
-::google::protobuf::uint8* V1LayerParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.V1LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.V0LayerParameter layer = 1;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *this->layer_, deterministic, target);
-  }
-
-  // repeated string bottom = 2;
-  for (int i = 0, n = this->bottom_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->bottom(i).data(), static_cast<int>(this->bottom(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V1LayerParameter.bottom");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(2, this->bottom(i), target);
-  }
-
-  // repeated string top = 3;
-  for (int i = 0, n = this->top_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->top(i).data(), static_cast<int>(this->top(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V1LayerParameter.top");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(3, this->top(i), target);
-  }
-
-  // optional string name = 4;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V1LayerParameter.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->name(), target);
-  }
-
-  cached_has_bits = _has_bits_[1];
-  // optional .opencv_caffe.V1LayerParameter.LayerType type = 5;
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      5, this->type(), target);
-  }
-
-  // repeated .opencv_caffe.BlobProto blobs = 6;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->blobs_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, this->blobs(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated float blobs_lr = 7;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(7, this->blobs_lr_, target);
-
-  // repeated float weight_decay = 8;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(8, this->weight_decay_, target);
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.ConcatParameter concat_param = 9;
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        9, *this->concat_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.ConvolutionParameter convolution_param = 10;
-  if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        10, *this->convolution_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.DataParameter data_param = 11;
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        11, *this->data_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.DropoutParameter dropout_param = 12;
-  if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        12, *this->dropout_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 13;
-  if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        13, *this->hdf5_data_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 14;
-  if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        14, *this->hdf5_output_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.ImageDataParameter image_data_param = 15;
-  if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        15, *this->image_data_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 16;
-  if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        16, *this->infogain_loss_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.InnerProductParameter inner_product_param = 17;
-  if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        17, *this->inner_product_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.LRNParameter lrn_param = 18;
-  if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        18, *this->lrn_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.PoolingParameter pooling_param = 19;
-  if (cached_has_bits & 0x00001000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        19, *this->pooling_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.WindowDataParameter window_data_param = 20;
-  if (cached_has_bits & 0x00002000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        20, *this->window_data_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.PowerParameter power_param = 21;
-  if (cached_has_bits & 0x00004000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        21, *this->power_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.MemoryDataParameter memory_data_param = 22;
-  if (cached_has_bits & 0x00008000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        22, *this->memory_data_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.ArgMaxParameter argmax_param = 23;
-  if (cached_has_bits & 0x00010000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        23, *this->argmax_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.EltwiseParameter eltwise_param = 24;
-  if (cached_has_bits & 0x00020000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        24, *this->eltwise_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.ThresholdParameter threshold_param = 25;
-  if (cached_has_bits & 0x00040000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        25, *this->threshold_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.DummyDataParameter dummy_data_param = 26;
-  if (cached_has_bits & 0x00080000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        26, *this->dummy_data_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.AccuracyParameter accuracy_param = 27;
-  if (cached_has_bits & 0x00100000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        27, *this->accuracy_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 29;
-  if (cached_has_bits & 0x00200000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        29, *this->hinge_loss_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.ReLUParameter relu_param = 30;
-  if (cached_has_bits & 0x00400000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        30, *this->relu_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.SliceParameter slice_param = 31;
-  if (cached_has_bits & 0x00800000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        31, *this->slice_param_, deterministic, target);
-  }
-
-  // repeated .opencv_caffe.NetStateRule include = 32;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->include_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        32, this->include(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated .opencv_caffe.NetStateRule exclude = 33;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->exclude_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        33, this->exclude(static_cast<int>(i)), deterministic, target);
-  }
-
-  // optional .opencv_caffe.MVNParameter mvn_param = 34;
-  if (cached_has_bits & 0x01000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        34, *this->mvn_param_, deterministic, target);
-  }
-
-  // repeated float loss_weight = 35;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(35, this->loss_weight_, target);
-
-  // optional .opencv_caffe.TransformationParameter transform_param = 36;
-  if (cached_has_bits & 0x02000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        36, *this->transform_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.TanHParameter tanh_param = 37;
-  if (cached_has_bits & 0x04000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        37, *this->tanh_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.SigmoidParameter sigmoid_param = 38;
-  if (cached_has_bits & 0x08000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        38, *this->sigmoid_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.SoftmaxParameter softmax_param = 39;
-  if (cached_has_bits & 0x10000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        39, *this->softmax_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 40;
-  if (cached_has_bits & 0x20000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        40, *this->contrastive_loss_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.ExpParameter exp_param = 41;
-  if (cached_has_bits & 0x40000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        41, *this->exp_param_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.LossParameter loss_param = 42;
-  if (cached_has_bits & 0x80000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        42, *this->loss_param_, deterministic, target);
-  }
-
-  // repeated string param = 1001;
-  for (int i = 0, n = this->param_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->param(i).data(), static_cast<int>(this->param(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V1LayerParameter.param");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(1001, this->param(i), target);
+  for (int i = 0, n = this->_internal_blob_share_mode_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+        1002, this->_internal_blob_share_mode(i), target);
   }
 
-  // repeated .opencv_caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002;
-  target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-    1002, this->blob_share_mode_, target);
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.V1LayerParameter)
   return target;
@@ -36733,370 +30275,352 @@ size_t V1LayerParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.V1LayerParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated string bottom = 2;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->bottom_size());
-  for (int i = 0, n = this->bottom_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->bottom(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(bottom_.size());
+  for (int i = 0, n = bottom_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      bottom_.Get(i));
   }
 
   // repeated string top = 3;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->top_size());
-  for (int i = 0, n = this->top_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->top(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(top_.size());
+  for (int i = 0, n = top_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      top_.Get(i));
   }
 
   // repeated .opencv_caffe.BlobProto blobs = 6;
-  {
-    unsigned int count = static_cast<unsigned int>(this->blobs_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->blobs(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_blobs_size();
+  for (const auto& msg : this->blobs_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated float blobs_lr = 7;
   {
-    unsigned int count = static_cast<unsigned int>(this->blobs_lr_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_blobs_lr_size());
     size_t data_size = 4UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->blobs_lr_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_blobs_lr_size());
     total_size += data_size;
   }
 
   // repeated float weight_decay = 8;
   {
-    unsigned int count = static_cast<unsigned int>(this->weight_decay_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_weight_decay_size());
     size_t data_size = 4UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->weight_decay_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_weight_decay_size());
     total_size += data_size;
   }
 
   // repeated .opencv_caffe.NetStateRule include = 32;
-  {
-    unsigned int count = static_cast<unsigned int>(this->include_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->include(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_include_size();
+  for (const auto& msg : this->include_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_caffe.NetStateRule exclude = 33;
-  {
-    unsigned int count = static_cast<unsigned int>(this->exclude_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->exclude(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_exclude_size();
+  for (const auto& msg : this->exclude_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated float loss_weight = 35;
   {
-    unsigned int count = static_cast<unsigned int>(this->loss_weight_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_loss_weight_size());
     size_t data_size = 4UL * count;
     total_size += 2 *
-                  ::google::protobuf::internal::FromIntSize(this->loss_weight_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_loss_weight_size());
     total_size += data_size;
   }
 
   // repeated string param = 1001;
   total_size += 2 *
-      ::google::protobuf::internal::FromIntSize(this->param_size());
-  for (int i = 0, n = this->param_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->param(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(param_.size());
+  for (int i = 0, n = param_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      param_.Get(i));
   }
 
   // repeated .opencv_caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002;
   {
     size_t data_size = 0;
-    unsigned int count = static_cast<unsigned int>(this->blob_share_mode_size());for (unsigned int i = 0; i < count; i++) {
-      data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
-        this->blob_share_mode(static_cast<int>(i)));
+    unsigned int count = static_cast<unsigned int>(this->_internal_blob_share_mode_size());for (unsigned int i = 0; i < count; i++) {
+      data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(
+        this->_internal_blob_share_mode(static_cast<int>(i)));
     }
     total_size += (2UL * count) + data_size;
   }
 
-  if (_has_bits_[0 / 32] & 255u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
     // optional string name = 4;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional .opencv_caffe.V0LayerParameter layer = 1;
-    if (has_layer()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->layer_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *layer_);
     }
 
     // optional .opencv_caffe.ConcatParameter concat_param = 9;
-    if (has_concat_param()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->concat_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *concat_param_);
     }
 
     // optional .opencv_caffe.ConvolutionParameter convolution_param = 10;
-    if (has_convolution_param()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->convolution_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *convolution_param_);
     }
 
     // optional .opencv_caffe.DataParameter data_param = 11;
-    if (has_data_param()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *data_param_);
     }
 
     // optional .opencv_caffe.DropoutParameter dropout_param = 12;
-    if (has_dropout_param()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->dropout_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *dropout_param_);
     }
 
     // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 13;
-    if (has_hdf5_data_param()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->hdf5_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *hdf5_data_param_);
     }
 
     // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 14;
-    if (has_hdf5_output_param()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->hdf5_output_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *hdf5_output_param_);
     }
 
   }
-  if (_has_bits_[8 / 32] & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     // optional .opencv_caffe.ImageDataParameter image_data_param = 15;
-    if (has_image_data_param()) {
+    if (cached_has_bits & 0x00000100u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->image_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *image_data_param_);
     }
 
     // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 16;
-    if (has_infogain_loss_param()) {
+    if (cached_has_bits & 0x00000200u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->infogain_loss_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *infogain_loss_param_);
     }
 
     // optional .opencv_caffe.InnerProductParameter inner_product_param = 17;
-    if (has_inner_product_param()) {
+    if (cached_has_bits & 0x00000400u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->inner_product_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *inner_product_param_);
     }
 
     // optional .opencv_caffe.LRNParameter lrn_param = 18;
-    if (has_lrn_param()) {
+    if (cached_has_bits & 0x00000800u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->lrn_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *lrn_param_);
     }
 
     // optional .opencv_caffe.PoolingParameter pooling_param = 19;
-    if (has_pooling_param()) {
+    if (cached_has_bits & 0x00001000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->pooling_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *pooling_param_);
     }
 
     // optional .opencv_caffe.WindowDataParameter window_data_param = 20;
-    if (has_window_data_param()) {
+    if (cached_has_bits & 0x00002000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->window_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *window_data_param_);
     }
 
     // optional .opencv_caffe.PowerParameter power_param = 21;
-    if (has_power_param()) {
+    if (cached_has_bits & 0x00004000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->power_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *power_param_);
     }
 
     // optional .opencv_caffe.MemoryDataParameter memory_data_param = 22;
-    if (has_memory_data_param()) {
+    if (cached_has_bits & 0x00008000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->memory_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *memory_data_param_);
     }
 
   }
-  if (_has_bits_[16 / 32] & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     // optional .opencv_caffe.ArgMaxParameter argmax_param = 23;
-    if (has_argmax_param()) {
+    if (cached_has_bits & 0x00010000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->argmax_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *argmax_param_);
     }
 
     // optional .opencv_caffe.EltwiseParameter eltwise_param = 24;
-    if (has_eltwise_param()) {
+    if (cached_has_bits & 0x00020000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->eltwise_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *eltwise_param_);
     }
 
     // optional .opencv_caffe.ThresholdParameter threshold_param = 25;
-    if (has_threshold_param()) {
+    if (cached_has_bits & 0x00040000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->threshold_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *threshold_param_);
     }
 
     // optional .opencv_caffe.DummyDataParameter dummy_data_param = 26;
-    if (has_dummy_data_param()) {
+    if (cached_has_bits & 0x00080000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->dummy_data_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *dummy_data_param_);
     }
 
     // optional .opencv_caffe.AccuracyParameter accuracy_param = 27;
-    if (has_accuracy_param()) {
+    if (cached_has_bits & 0x00100000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->accuracy_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *accuracy_param_);
     }
 
     // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 29;
-    if (has_hinge_loss_param()) {
+    if (cached_has_bits & 0x00200000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->hinge_loss_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *hinge_loss_param_);
     }
 
     // optional .opencv_caffe.ReLUParameter relu_param = 30;
-    if (has_relu_param()) {
+    if (cached_has_bits & 0x00400000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->relu_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *relu_param_);
     }
 
     // optional .opencv_caffe.SliceParameter slice_param = 31;
-    if (has_slice_param()) {
+    if (cached_has_bits & 0x00800000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->slice_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *slice_param_);
     }
 
   }
-  if (_has_bits_[24 / 32] & 4278190080u) {
+  if (cached_has_bits & 0xff000000u) {
     // optional .opencv_caffe.MVNParameter mvn_param = 34;
-    if (has_mvn_param()) {
+    if (cached_has_bits & 0x01000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->mvn_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *mvn_param_);
     }
 
     // optional .opencv_caffe.TransformationParameter transform_param = 36;
-    if (has_transform_param()) {
+    if (cached_has_bits & 0x02000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->transform_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *transform_param_);
     }
 
     // optional .opencv_caffe.TanHParameter tanh_param = 37;
-    if (has_tanh_param()) {
+    if (cached_has_bits & 0x04000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->tanh_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *tanh_param_);
     }
 
     // optional .opencv_caffe.SigmoidParameter sigmoid_param = 38;
-    if (has_sigmoid_param()) {
+    if (cached_has_bits & 0x08000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->sigmoid_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *sigmoid_param_);
     }
 
     // optional .opencv_caffe.SoftmaxParameter softmax_param = 39;
-    if (has_softmax_param()) {
+    if (cached_has_bits & 0x10000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->softmax_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *softmax_param_);
     }
 
     // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 40;
-    if (has_contrastive_loss_param()) {
+    if (cached_has_bits & 0x20000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->contrastive_loss_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *contrastive_loss_param_);
     }
 
     // optional .opencv_caffe.ExpParameter exp_param = 41;
-    if (has_exp_param()) {
+    if (cached_has_bits & 0x40000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->exp_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *exp_param_);
     }
 
     // optional .opencv_caffe.LossParameter loss_param = 42;
-    if (has_loss_param()) {
+    if (cached_has_bits & 0x80000000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->loss_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *loss_param_);
     }
 
   }
   // optional .opencv_caffe.V1LayerParameter.LayerType type = 5;
-  if (has_type()) {
+  cached_has_bits = _has_bits_[1];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void V1LayerParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.V1LayerParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const V1LayerParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const V1LayerParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.V1LayerParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.V1LayerParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData V1LayerParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    V1LayerParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*V1LayerParameter::GetClassData() const { return &_class_data_; }
+
+void V1LayerParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<V1LayerParameter *>(to)->MergeFrom(
+      static_cast<const V1LayerParameter &>(from));
 }
 
+
 void V1LayerParameter::MergeFrom(const V1LayerParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.V1LayerParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   bottom_.MergeFrom(from.bottom_);
@@ -37110,121 +30634,114 @@ void V1LayerParameter::MergeFrom(const V1LayerParameter& from) {
   param_.MergeFrom(from.param_);
   blob_share_mode_.MergeFrom(from.blob_share_mode_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      mutable_layer()->::opencv_caffe::V0LayerParameter::MergeFrom(from.layer());
+      _internal_mutable_layer()->::opencv_caffe::V0LayerParameter::MergeFrom(from._internal_layer());
     }
     if (cached_has_bits & 0x00000004u) {
-      mutable_concat_param()->::opencv_caffe::ConcatParameter::MergeFrom(from.concat_param());
+      _internal_mutable_concat_param()->::opencv_caffe::ConcatParameter::MergeFrom(from._internal_concat_param());
     }
     if (cached_has_bits & 0x00000008u) {
-      mutable_convolution_param()->::opencv_caffe::ConvolutionParameter::MergeFrom(from.convolution_param());
+      _internal_mutable_convolution_param()->::opencv_caffe::ConvolutionParameter::MergeFrom(from._internal_convolution_param());
     }
     if (cached_has_bits & 0x00000010u) {
-      mutable_data_param()->::opencv_caffe::DataParameter::MergeFrom(from.data_param());
+      _internal_mutable_data_param()->::opencv_caffe::DataParameter::MergeFrom(from._internal_data_param());
     }
     if (cached_has_bits & 0x00000020u) {
-      mutable_dropout_param()->::opencv_caffe::DropoutParameter::MergeFrom(from.dropout_param());
+      _internal_mutable_dropout_param()->::opencv_caffe::DropoutParameter::MergeFrom(from._internal_dropout_param());
     }
     if (cached_has_bits & 0x00000040u) {
-      mutable_hdf5_data_param()->::opencv_caffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param());
+      _internal_mutable_hdf5_data_param()->::opencv_caffe::HDF5DataParameter::MergeFrom(from._internal_hdf5_data_param());
     }
     if (cached_has_bits & 0x00000080u) {
-      mutable_hdf5_output_param()->::opencv_caffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param());
+      _internal_mutable_hdf5_output_param()->::opencv_caffe::HDF5OutputParameter::MergeFrom(from._internal_hdf5_output_param());
     }
   }
-  if (cached_has_bits & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     if (cached_has_bits & 0x00000100u) {
-      mutable_image_data_param()->::opencv_caffe::ImageDataParameter::MergeFrom(from.image_data_param());
+      _internal_mutable_image_data_param()->::opencv_caffe::ImageDataParameter::MergeFrom(from._internal_image_data_param());
     }
     if (cached_has_bits & 0x00000200u) {
-      mutable_infogain_loss_param()->::opencv_caffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param());
+      _internal_mutable_infogain_loss_param()->::opencv_caffe::InfogainLossParameter::MergeFrom(from._internal_infogain_loss_param());
     }
     if (cached_has_bits & 0x00000400u) {
-      mutable_inner_product_param()->::opencv_caffe::InnerProductParameter::MergeFrom(from.inner_product_param());
+      _internal_mutable_inner_product_param()->::opencv_caffe::InnerProductParameter::MergeFrom(from._internal_inner_product_param());
     }
     if (cached_has_bits & 0x00000800u) {
-      mutable_lrn_param()->::opencv_caffe::LRNParameter::MergeFrom(from.lrn_param());
+      _internal_mutable_lrn_param()->::opencv_caffe::LRNParameter::MergeFrom(from._internal_lrn_param());
     }
     if (cached_has_bits & 0x00001000u) {
-      mutable_pooling_param()->::opencv_caffe::PoolingParameter::MergeFrom(from.pooling_param());
+      _internal_mutable_pooling_param()->::opencv_caffe::PoolingParameter::MergeFrom(from._internal_pooling_param());
     }
     if (cached_has_bits & 0x00002000u) {
-      mutable_window_data_param()->::opencv_caffe::WindowDataParameter::MergeFrom(from.window_data_param());
+      _internal_mutable_window_data_param()->::opencv_caffe::WindowDataParameter::MergeFrom(from._internal_window_data_param());
     }
     if (cached_has_bits & 0x00004000u) {
-      mutable_power_param()->::opencv_caffe::PowerParameter::MergeFrom(from.power_param());
+      _internal_mutable_power_param()->::opencv_caffe::PowerParameter::MergeFrom(from._internal_power_param());
     }
     if (cached_has_bits & 0x00008000u) {
-      mutable_memory_data_param()->::opencv_caffe::MemoryDataParameter::MergeFrom(from.memory_data_param());
+      _internal_mutable_memory_data_param()->::opencv_caffe::MemoryDataParameter::MergeFrom(from._internal_memory_data_param());
     }
   }
-  if (cached_has_bits & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     if (cached_has_bits & 0x00010000u) {
-      mutable_argmax_param()->::opencv_caffe::ArgMaxParameter::MergeFrom(from.argmax_param());
+      _internal_mutable_argmax_param()->::opencv_caffe::ArgMaxParameter::MergeFrom(from._internal_argmax_param());
     }
     if (cached_has_bits & 0x00020000u) {
-      mutable_eltwise_param()->::opencv_caffe::EltwiseParameter::MergeFrom(from.eltwise_param());
+      _internal_mutable_eltwise_param()->::opencv_caffe::EltwiseParameter::MergeFrom(from._internal_eltwise_param());
     }
     if (cached_has_bits & 0x00040000u) {
-      mutable_threshold_param()->::opencv_caffe::ThresholdParameter::MergeFrom(from.threshold_param());
+      _internal_mutable_threshold_param()->::opencv_caffe::ThresholdParameter::MergeFrom(from._internal_threshold_param());
     }
     if (cached_has_bits & 0x00080000u) {
-      mutable_dummy_data_param()->::opencv_caffe::DummyDataParameter::MergeFrom(from.dummy_data_param());
+      _internal_mutable_dummy_data_param()->::opencv_caffe::DummyDataParameter::MergeFrom(from._internal_dummy_data_param());
     }
     if (cached_has_bits & 0x00100000u) {
-      mutable_accuracy_param()->::opencv_caffe::AccuracyParameter::MergeFrom(from.accuracy_param());
+      _internal_mutable_accuracy_param()->::opencv_caffe::AccuracyParameter::MergeFrom(from._internal_accuracy_param());
     }
     if (cached_has_bits & 0x00200000u) {
-      mutable_hinge_loss_param()->::opencv_caffe::HingeLossParameter::MergeFrom(from.hinge_loss_param());
+      _internal_mutable_hinge_loss_param()->::opencv_caffe::HingeLossParameter::MergeFrom(from._internal_hinge_loss_param());
     }
     if (cached_has_bits & 0x00400000u) {
-      mutable_relu_param()->::opencv_caffe::ReLUParameter::MergeFrom(from.relu_param());
+      _internal_mutable_relu_param()->::opencv_caffe::ReLUParameter::MergeFrom(from._internal_relu_param());
     }
     if (cached_has_bits & 0x00800000u) {
-      mutable_slice_param()->::opencv_caffe::SliceParameter::MergeFrom(from.slice_param());
+      _internal_mutable_slice_param()->::opencv_caffe::SliceParameter::MergeFrom(from._internal_slice_param());
     }
   }
-  if (cached_has_bits & 4278190080u) {
+  if (cached_has_bits & 0xff000000u) {
     if (cached_has_bits & 0x01000000u) {
-      mutable_mvn_param()->::opencv_caffe::MVNParameter::MergeFrom(from.mvn_param());
+      _internal_mutable_mvn_param()->::opencv_caffe::MVNParameter::MergeFrom(from._internal_mvn_param());
     }
     if (cached_has_bits & 0x02000000u) {
-      mutable_transform_param()->::opencv_caffe::TransformationParameter::MergeFrom(from.transform_param());
+      _internal_mutable_transform_param()->::opencv_caffe::TransformationParameter::MergeFrom(from._internal_transform_param());
     }
     if (cached_has_bits & 0x04000000u) {
-      mutable_tanh_param()->::opencv_caffe::TanHParameter::MergeFrom(from.tanh_param());
+      _internal_mutable_tanh_param()->::opencv_caffe::TanHParameter::MergeFrom(from._internal_tanh_param());
     }
     if (cached_has_bits & 0x08000000u) {
-      mutable_sigmoid_param()->::opencv_caffe::SigmoidParameter::MergeFrom(from.sigmoid_param());
+      _internal_mutable_sigmoid_param()->::opencv_caffe::SigmoidParameter::MergeFrom(from._internal_sigmoid_param());
     }
     if (cached_has_bits & 0x10000000u) {
-      mutable_softmax_param()->::opencv_caffe::SoftmaxParameter::MergeFrom(from.softmax_param());
+      _internal_mutable_softmax_param()->::opencv_caffe::SoftmaxParameter::MergeFrom(from._internal_softmax_param());
     }
     if (cached_has_bits & 0x20000000u) {
-      mutable_contrastive_loss_param()->::opencv_caffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param());
+      _internal_mutable_contrastive_loss_param()->::opencv_caffe::ContrastiveLossParameter::MergeFrom(from._internal_contrastive_loss_param());
     }
     if (cached_has_bits & 0x40000000u) {
-      mutable_exp_param()->::opencv_caffe::ExpParameter::MergeFrom(from.exp_param());
+      _internal_mutable_exp_param()->::opencv_caffe::ExpParameter::MergeFrom(from._internal_exp_param());
     }
     if (cached_has_bits & 0x80000000u) {
-      mutable_loss_param()->::opencv_caffe::LossParameter::MergeFrom(from.loss_param());
+      _internal_mutable_loss_param()->::opencv_caffe::LossParameter::MergeFrom(from._internal_loss_param());
     }
   }
-  if (from.has_type()) {
-    set_type(from.type());
+  if (from._internal_has_type()) {
+    _internal_set_type(from._internal_type());
   }
-}
-
-void V1LayerParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.V1LayerParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void V1LayerParameter::CopyFrom(const V1LayerParameter& from) {
@@ -37238,12 +30755,13 @@ bool V1LayerParameter::IsInitialized() const {
   return true;
 }
 
-void V1LayerParameter::Swap(V1LayerParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void V1LayerParameter::InternalSwap(V1LayerParameter* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  swap(_has_bits_[1], other->_has_bits_[1]);
   bottom_.InternalSwap(&other->bottom_);
   top_.InternalSwap(&other->top_);
   blobs_.InternalSwap(&other->blobs_);
@@ -37254,154 +30772,223 @@ void V1LayerParameter::InternalSwap(V1LayerParameter* other) {
   loss_weight_.InternalSwap(&other->loss_weight_);
   param_.InternalSwap(&other->param_);
   blob_share_mode_.InternalSwap(&other->blob_share_mode_);
-  name_.Swap(&other->name_);
-  swap(layer_, other->layer_);
-  swap(concat_param_, other->concat_param_);
-  swap(convolution_param_, other->convolution_param_);
-  swap(data_param_, other->data_param_);
-  swap(dropout_param_, other->dropout_param_);
-  swap(hdf5_data_param_, other->hdf5_data_param_);
-  swap(hdf5_output_param_, other->hdf5_output_param_);
-  swap(image_data_param_, other->image_data_param_);
-  swap(infogain_loss_param_, other->infogain_loss_param_);
-  swap(inner_product_param_, other->inner_product_param_);
-  swap(lrn_param_, other->lrn_param_);
-  swap(pooling_param_, other->pooling_param_);
-  swap(window_data_param_, other->window_data_param_);
-  swap(power_param_, other->power_param_);
-  swap(memory_data_param_, other->memory_data_param_);
-  swap(argmax_param_, other->argmax_param_);
-  swap(eltwise_param_, other->eltwise_param_);
-  swap(threshold_param_, other->threshold_param_);
-  swap(dummy_data_param_, other->dummy_data_param_);
-  swap(accuracy_param_, other->accuracy_param_);
-  swap(hinge_loss_param_, other->hinge_loss_param_);
-  swap(relu_param_, other->relu_param_);
-  swap(slice_param_, other->slice_param_);
-  swap(mvn_param_, other->mvn_param_);
-  swap(transform_param_, other->transform_param_);
-  swap(tanh_param_, other->tanh_param_);
-  swap(sigmoid_param_, other->sigmoid_param_);
-  swap(softmax_param_, other->softmax_param_);
-  swap(contrastive_loss_param_, other->contrastive_loss_param_);
-  swap(exp_param_, other->exp_param_);
-  swap(loss_param_, other->loss_param_);
-  swap(type_, other->type_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  swap(_has_bits_[1], other->_has_bits_[1]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(V1LayerParameter, type_)
+      + sizeof(V1LayerParameter::type_)
+      - PROTOBUF_FIELD_OFFSET(V1LayerParameter, layer_)>(
+          reinterpret_cast<char*>(&layer_),
+          reinterpret_cast<char*>(&other->layer_));
 }
 
-::google::protobuf::Metadata V1LayerParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata V1LayerParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[64]);
 }
 
-
 // ===================================================================
 
-void V0LayerParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_V0LayerParameter_default_instance_._instance.get_mutable()->weight_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-  ::opencv_caffe::_V0LayerParameter_default_instance_._instance.get_mutable()->bias_filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-  ::opencv_caffe::_V0LayerParameter_default_instance_._instance.get_mutable()->hdf5_output_param_ = const_cast< ::opencv_caffe::HDF5OutputParameter*>(
-      ::opencv_caffe::HDF5OutputParameter::internal_default_instance());
-}
-::google::protobuf::internal::ExplicitlyConstructed< ::std::string> V0LayerParameter::_default_det_crop_mode_;
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int V0LayerParameter::kNameFieldNumber;
-const int V0LayerParameter::kTypeFieldNumber;
-const int V0LayerParameter::kNumOutputFieldNumber;
-const int V0LayerParameter::kBiastermFieldNumber;
-const int V0LayerParameter::kWeightFillerFieldNumber;
-const int V0LayerParameter::kBiasFillerFieldNumber;
-const int V0LayerParameter::kPadFieldNumber;
-const int V0LayerParameter::kKernelsizeFieldNumber;
-const int V0LayerParameter::kGroupFieldNumber;
-const int V0LayerParameter::kStrideFieldNumber;
-const int V0LayerParameter::kPoolFieldNumber;
-const int V0LayerParameter::kDropoutRatioFieldNumber;
-const int V0LayerParameter::kLocalSizeFieldNumber;
-const int V0LayerParameter::kAlphaFieldNumber;
-const int V0LayerParameter::kBetaFieldNumber;
-const int V0LayerParameter::kKFieldNumber;
-const int V0LayerParameter::kSourceFieldNumber;
-const int V0LayerParameter::kScaleFieldNumber;
-const int V0LayerParameter::kMeanfileFieldNumber;
-const int V0LayerParameter::kBatchsizeFieldNumber;
-const int V0LayerParameter::kCropsizeFieldNumber;
-const int V0LayerParameter::kMirrorFieldNumber;
-const int V0LayerParameter::kBlobsFieldNumber;
-const int V0LayerParameter::kBlobsLrFieldNumber;
-const int V0LayerParameter::kWeightDecayFieldNumber;
-const int V0LayerParameter::kRandSkipFieldNumber;
-const int V0LayerParameter::kDetFgThresholdFieldNumber;
-const int V0LayerParameter::kDetBgThresholdFieldNumber;
-const int V0LayerParameter::kDetFgFractionFieldNumber;
-const int V0LayerParameter::kDetContextPadFieldNumber;
-const int V0LayerParameter::kDetCropModeFieldNumber;
-const int V0LayerParameter::kNewNumFieldNumber;
-const int V0LayerParameter::kNewChannelsFieldNumber;
-const int V0LayerParameter::kNewHeightFieldNumber;
-const int V0LayerParameter::kNewWidthFieldNumber;
-const int V0LayerParameter::kShuffleImagesFieldNumber;
-const int V0LayerParameter::kConcatDimFieldNumber;
-const int V0LayerParameter::kHdf5OutputParamFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-V0LayerParameter::V0LayerParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsV0LayerParameter();
+class V0LayerParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<V0LayerParameter>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_num_output(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static void set_has_biasterm(HasBits* has_bits) {
+    (*has_bits)[0] |= 8388608u;
+  }
+  static const ::opencv_caffe::FillerParameter& weight_filler(const V0LayerParameter* msg);
+  static void set_has_weight_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static const ::opencv_caffe::FillerParameter& bias_filler(const V0LayerParameter* msg);
+  static void set_has_bias_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_pad(HasBits* has_bits) {
+    (*has_bits)[0] |= 512u;
+  }
+  static void set_has_kernelsize(HasBits* has_bits) {
+    (*has_bits)[0] |= 1024u;
   }
+  static void set_has_group(HasBits* has_bits) {
+    (*has_bits)[0] |= 16777216u;
+  }
+  static void set_has_stride(HasBits* has_bits) {
+    (*has_bits)[0] |= 33554432u;
+  }
+  static void set_has_pool(HasBits* has_bits) {
+    (*has_bits)[0] |= 2048u;
+  }
+  static void set_has_dropout_ratio(HasBits* has_bits) {
+    (*has_bits)[0] |= 67108864u;
+  }
+  static void set_has_local_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 134217728u;
+  }
+  static void set_has_alpha(HasBits* has_bits) {
+    (*has_bits)[0] |= 268435456u;
+  }
+  static void set_has_beta(HasBits* has_bits) {
+    (*has_bits)[0] |= 536870912u;
+  }
+  static void set_has_k(HasBits* has_bits) {
+    (*has_bits)[0] |= 2147483648u;
+  }
+  static void set_has_source(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 1073741824u;
+  }
+  static void set_has_meanfile(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_batchsize(HasBits* has_bits) {
+    (*has_bits)[0] |= 4096u;
+  }
+  static void set_has_cropsize(HasBits* has_bits) {
+    (*has_bits)[0] |= 8192u;
+  }
+  static void set_has_mirror(HasBits* has_bits) {
+    (*has_bits)[0] |= 32768u;
+  }
+  static void set_has_rand_skip(HasBits* has_bits) {
+    (*has_bits)[0] |= 131072u;
+  }
+  static void set_has_det_fg_threshold(HasBits* has_bits) {
+    (*has_bits)[1] |= 1u;
+  }
+  static void set_has_det_bg_threshold(HasBits* has_bits) {
+    (*has_bits)[1] |= 2u;
+  }
+  static void set_has_det_fg_fraction(HasBits* has_bits) {
+    (*has_bits)[1] |= 4u;
+  }
+  static void set_has_det_context_pad(HasBits* has_bits) {
+    (*has_bits)[0] |= 262144u;
+  }
+  static void set_has_det_crop_mode(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_new_num(HasBits* has_bits) {
+    (*has_bits)[0] |= 524288u;
+  }
+  static void set_has_new_channels(HasBits* has_bits) {
+    (*has_bits)[0] |= 1048576u;
+  }
+  static void set_has_new_height(HasBits* has_bits) {
+    (*has_bits)[0] |= 2097152u;
+  }
+  static void set_has_new_width(HasBits* has_bits) {
+    (*has_bits)[0] |= 16384u;
+  }
+  static void set_has_shuffle_images(HasBits* has_bits) {
+    (*has_bits)[0] |= 65536u;
+  }
+  static void set_has_concat_dim(HasBits* has_bits) {
+    (*has_bits)[0] |= 4194304u;
+  }
+  static const ::opencv_caffe::HDF5OutputParameter& hdf5_output_param(const V0LayerParameter* msg);
+  static void set_has_hdf5_output_param(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+};
+
+const ::opencv_caffe::FillerParameter&
+V0LayerParameter::_Internal::weight_filler(const V0LayerParameter* msg) {
+  return *msg->weight_filler_;
+}
+const ::opencv_caffe::FillerParameter&
+V0LayerParameter::_Internal::bias_filler(const V0LayerParameter* msg) {
+  return *msg->bias_filler_;
+}
+const ::opencv_caffe::HDF5OutputParameter&
+V0LayerParameter::_Internal::hdf5_output_param(const V0LayerParameter* msg) {
+  return *msg->hdf5_output_param_;
+}
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString V0LayerParameter::_i_give_permission_to_break_this_code_default_det_crop_mode_{{{"warp", 4}}, {nullptr}};
+V0LayerParameter::V0LayerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  blobs_(arena),
+  blobs_lr_(arena),
+  weight_decay_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.V0LayerParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.V0LayerParameter)
 }
 V0LayerParameter::V0LayerParameter(const V0LayerParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
       blobs_(from.blobs_),
       blobs_lr_(from.blobs_lr_),
-      weight_decay_(from.weight_decay_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_type()) {
-    type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
-  }
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_source()) {
-    source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
-  }
-  meanfile_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_meanfile()) {
-    meanfile_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.meanfile_);
-  }
-  det_crop_mode_.UnsafeSetDefault(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get());
-  if (from.has_det_crop_mode()) {
-    det_crop_mode_.AssignWithDefault(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get(), from.det_crop_mode_);
-  }
-  if (from.has_weight_filler()) {
+      weight_decay_(from.weight_decay_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_type()) {
+    type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type(),
+      GetArenaForAllocation());
+  }
+  source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_source()) {
+    source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_source(),
+      GetArenaForAllocation());
+  }
+  meanfile_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    meanfile_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_meanfile()) {
+    meanfile_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_meanfile(),
+      GetArenaForAllocation());
+  }
+  det_crop_mode_.UnsafeSetDefault(nullptr);
+  if (from._internal_has_det_crop_mode()) {
+    det_crop_mode_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_det_crop_mode(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_weight_filler()) {
     weight_filler_ = new ::opencv_caffe::FillerParameter(*from.weight_filler_);
   } else {
-    weight_filler_ = NULL;
+    weight_filler_ = nullptr;
   }
-  if (from.has_bias_filler()) {
+  if (from._internal_has_bias_filler()) {
     bias_filler_ = new ::opencv_caffe::FillerParameter(*from.bias_filler_);
   } else {
-    bias_filler_ = NULL;
+    bias_filler_ = nullptr;
   }
-  if (from.has_hdf5_output_param()) {
+  if (from._internal_has_hdf5_output_param()) {
     hdf5_output_param_ = new ::opencv_caffe::HDF5OutputParameter(*from.hdf5_output_param_);
   } else {
-    hdf5_output_param_ = NULL;
+    hdf5_output_param_ = nullptr;
   }
   ::memcpy(&num_output_, &from.num_output_,
     static_cast<size_t>(reinterpret_cast<char*>(&det_fg_fraction_) -
@@ -37409,73 +30996,75 @@ V0LayerParameter::V0LayerParameter(const V0LayerParameter& from)
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.V0LayerParameter)
 }
 
-void V0LayerParameter::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  meanfile_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  det_crop_mode_.UnsafeSetDefault(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get());
-  ::memset(&weight_filler_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&new_height_) -
-      reinterpret_cast<char*>(&weight_filler_)) + sizeof(new_height_));
-  concat_dim_ = 1u;
-  biasterm_ = true;
-  group_ = 1u;
-  stride_ = 1u;
-  dropout_ratio_ = 0.5f;
-  local_size_ = 5u;
-  alpha_ = 1;
-  beta_ = 0.75f;
-  scale_ = 1;
-  k_ = 1;
-  det_fg_threshold_ = 0.5f;
-  det_bg_threshold_ = 0.5f;
-  det_fg_fraction_ = 0.25f;
-  _cached_size_ = 0;
+inline void V0LayerParameter::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+meanfile_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  meanfile_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+det_crop_mode_.UnsafeSetDefault(nullptr);
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&weight_filler_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&new_height_) -
+    reinterpret_cast<char*>(&weight_filler_)) + sizeof(new_height_));
+concat_dim_ = 1u;
+biasterm_ = true;
+group_ = 1u;
+stride_ = 1u;
+dropout_ratio_ = 0.5f;
+local_size_ = 5u;
+alpha_ = 1;
+beta_ = 0.75f;
+scale_ = 1;
+k_ = 1;
+det_fg_threshold_ = 0.5f;
+det_bg_threshold_ = 0.5f;
+det_fg_fraction_ = 0.25f;
 }
 
 V0LayerParameter::~V0LayerParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.V0LayerParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void V0LayerParameter::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  meanfile_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  det_crop_mode_.DestroyNoArena(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get());
+inline void V0LayerParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  source_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  meanfile_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  det_crop_mode_.DestroyNoArena(nullptr);
   if (this != internal_default_instance()) delete weight_filler_;
   if (this != internal_default_instance()) delete bias_filler_;
   if (this != internal_default_instance()) delete hdf5_output_param_;
 }
 
-void V0LayerParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void V0LayerParameter::ArenaDtor(void* object) {
+  V0LayerParameter* _this = reinterpret_cast< V0LayerParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* V0LayerParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const V0LayerParameter& V0LayerParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsV0LayerParameter();
-  return *internal_default_instance();
+void V0LayerParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-V0LayerParameter* V0LayerParameter::New(::google::protobuf::Arena* arena) const {
-  V0LayerParameter* n = new V0LayerParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void V0LayerParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void V0LayerParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.V0LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -37483,53 +31072,48 @@ void V0LayerParameter::Clear() {
   blobs_lr_.Clear();
   weight_decay_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!type_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*type_.UnsafeRawStringPointer())->clear();
+      type_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!source_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*source_.UnsafeRawStringPointer())->clear();
+      source_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!meanfile_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*meanfile_.UnsafeRawStringPointer())->clear();
+      meanfile_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(!det_crop_mode_.IsDefault(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get()));
-      (*det_crop_mode_.UnsafeRawStringPointer())->assign(*&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get());
-    }
+      det_crop_mode_.ClearToDefault(::opencv_caffe::V0LayerParameter::_i_give_permission_to_break_this_code_default_det_crop_mode_, GetArenaForAllocation());
+       }
     if (cached_has_bits & 0x00000020u) {
-      GOOGLE_DCHECK(weight_filler_ != NULL);
+      GOOGLE_DCHECK(weight_filler_ != nullptr);
       weight_filler_->Clear();
     }
     if (cached_has_bits & 0x00000040u) {
-      GOOGLE_DCHECK(bias_filler_ != NULL);
+      GOOGLE_DCHECK(bias_filler_ != nullptr);
       bias_filler_->Clear();
     }
     if (cached_has_bits & 0x00000080u) {
-      GOOGLE_DCHECK(hdf5_output_param_ != NULL);
+      GOOGLE_DCHECK(hdf5_output_param_ != nullptr);
       hdf5_output_param_->Clear();
     }
   }
-  if (cached_has_bits & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     ::memset(&num_output_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&mirror_) -
         reinterpret_cast<char*>(&num_output_)) + sizeof(mirror_));
   }
-  if (cached_has_bits & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     ::memset(&shuffle_images_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&new_height_) -
         reinterpret_cast<char*>(&shuffle_images_)) + sizeof(new_height_));
     concat_dim_ = 1u;
     biasterm_ = true;
   }
-  if (cached_has_bits & 4278190080u) {
+  if (cached_has_bits & 0xff000000u) {
     group_ = 1u;
     stride_ = 1u;
     dropout_ratio_ = 0.5f;
@@ -37540,1074 +31124,689 @@ void V0LayerParameter::Clear() {
     k_ = 1;
   }
   cached_has_bits = _has_bits_[1];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     det_fg_threshold_ = 0.5f;
     det_bg_threshold_ = 0.5f;
     det_fg_fraction_ = 0.25f;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool V0LayerParameter::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:opencv_caffe.V0LayerParameter)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V0LayerParameter.name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* V0LayerParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional string name = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V0LayerParameter.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string type = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->type().data(), static_cast<int>(this->type().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V0LayerParameter.type");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V0LayerParameter.type");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 num_output = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_num_output();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &num_output_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_num_output(&_has_bits_);
+          num_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool biasterm = 4 [default = true];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
-          set_has_biasterm();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &biasterm_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+          _Internal::set_has_biasterm(&_has_bits_);
+          biasterm_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.FillerParameter weight_filler = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_weight_filler()));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_weight_filler(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_caffe.FillerParameter bias_filler = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_bias_filler()));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ctx->ParseMessage(_internal_mutable_bias_filler(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional uint32 pad = 7 [default = 0];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_pad();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pad_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_pad(&_has_bits_);
+          pad_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 kernelsize = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-          set_has_kernelsize();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &kernelsize_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          _Internal::set_has_kernelsize(&_has_bits_);
+          kernelsize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 group = 9 [default = 1];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
-          set_has_group();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &group_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+          _Internal::set_has_group(&_has_bits_);
+          group_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 stride = 10 [default = 1];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          set_has_stride();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &stride_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+          _Internal::set_has_stride(&_has_bits_);
+          stride_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX];
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_caffe::V0LayerParameter_PoolMethod_IsValid(value)) {
-            set_pool(static_cast< ::opencv_caffe::V0LayerParameter_PoolMethod >(value));
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_caffe::V0LayerParameter_PoolMethod_IsValid(val))) {
+            _internal_set_pool(static_cast<::opencv_caffe::V0LayerParameter_PoolMethod>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                11, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(11, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional float dropout_ratio = 12 [default = 0.5];
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(101u /* 101 & 0xFF */)) {
-          set_has_dropout_ratio();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &dropout_ratio_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 101)) {
+          _Internal::set_has_dropout_ratio(&_has_bits_);
+          dropout_ratio_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 local_size = 13 [default = 5];
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
-          set_has_local_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &local_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
+          _Internal::set_has_local_size(&_has_bits_);
+          local_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float alpha = 14 [default = 1];
-      case 14: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(117u /* 117 & 0xFF */)) {
-          set_has_alpha();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &alpha_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 14:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 117)) {
+          _Internal::set_has_alpha(&_has_bits_);
+          alpha_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float beta = 15 [default = 0.75];
-      case 15: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(125u /* 125 & 0xFF */)) {
-          set_has_beta();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &beta_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 15:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 125)) {
+          _Internal::set_has_beta(&_has_bits_);
+          beta_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string source = 16;
-      case 16: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(130u /* 130 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_source()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->source().data(), static_cast<int>(this->source().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V0LayerParameter.source");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 16:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 130)) {
+          auto str = _internal_mutable_source();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V0LayerParameter.source");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float scale = 17 [default = 1];
-      case 17: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(141u /* 141 & 0xFF */)) {
-          set_has_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 17:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 141)) {
+          _Internal::set_has_scale(&_has_bits_);
+          scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string meanfile = 18;
-      case 18: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(146u /* 146 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_meanfile()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->meanfile().data(), static_cast<int>(this->meanfile().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V0LayerParameter.meanfile");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 18:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 146)) {
+          auto str = _internal_mutable_meanfile();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V0LayerParameter.meanfile");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 batchsize = 19;
-      case 19: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(152u /* 152 & 0xFF */)) {
-          set_has_batchsize();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &batchsize_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 19:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
+          _Internal::set_has_batchsize(&_has_bits_);
+          batchsize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 cropsize = 20 [default = 0];
-      case 20: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(160u /* 160 & 0xFF */)) {
-          set_has_cropsize();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &cropsize_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 20:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
+          _Internal::set_has_cropsize(&_has_bits_);
+          cropsize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool mirror = 21 [default = false];
-      case 21: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(168u /* 168 & 0xFF */)) {
-          set_has_mirror();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &mirror_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 21:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 168)) {
+          _Internal::set_has_mirror(&_has_bits_);
+          mirror_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float k = 22 [default = 1];
-      case 22: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(181u /* 181 & 0xFF */)) {
-          set_has_k();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &k_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 22:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 181)) {
+          _Internal::set_has_k(&_has_bits_);
+          k_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated .opencv_caffe.BlobProto blobs = 50;
-      case 50: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(146u /* 402 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_blobs()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 50:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 146)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            ptr = ctx->ParseMessage(_internal_add_blobs(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<402>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
       // repeated float blobs_lr = 51;
-      case 51: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(157u /* 413 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 2, 413u, input, this->mutable_blobs_lr())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(154u /* 410 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_blobs_lr())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 51:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 157)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            _internal_add_blobs_lr(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<413>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 154) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_blobs_lr(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated float weight_decay = 52;
-      case 52: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(165u /* 421 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 2, 421u, input, this->mutable_weight_decay())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(162u /* 418 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_weight_decay())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 52:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 165)) {
+          ptr -= 2;
+          do {
+            ptr += 2;
+            _internal_add_weight_decay(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<421>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 162) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_weight_decay(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 rand_skip = 53 [default = 0];
-      case 53: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(168u /* 424 & 0xFF */)) {
-          set_has_rand_skip();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &rand_skip_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 53:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 168)) {
+          _Internal::set_has_rand_skip(&_has_bits_);
+          rand_skip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float det_fg_threshold = 54 [default = 0.5];
-      case 54: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(181u /* 437 & 0xFF */)) {
-          set_has_det_fg_threshold();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &det_fg_threshold_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 54:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 181)) {
+          _Internal::set_has_det_fg_threshold(&_has_bits_);
+          det_fg_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float det_bg_threshold = 55 [default = 0.5];
-      case 55: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(189u /* 445 & 0xFF */)) {
-          set_has_det_bg_threshold();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &det_bg_threshold_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 55:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 189)) {
+          _Internal::set_has_det_bg_threshold(&_has_bits_);
+          det_bg_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float det_fg_fraction = 56 [default = 0.25];
-      case 56: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(197u /* 453 & 0xFF */)) {
-          set_has_det_fg_fraction();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &det_fg_fraction_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 56:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 197)) {
+          _Internal::set_has_det_fg_fraction(&_has_bits_);
+          det_fg_fraction_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 det_context_pad = 58 [default = 0];
-      case 58: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(208u /* 464 & 0xFF */)) {
-          set_has_det_context_pad();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &det_context_pad_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 58:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 208)) {
+          _Internal::set_has_det_context_pad(&_has_bits_);
+          det_context_pad_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional string det_crop_mode = 59 [default = "warp"];
-      case 59: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(218u /* 474 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_det_crop_mode()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->det_crop_mode().data(), static_cast<int>(this->det_crop_mode().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_caffe.V0LayerParameter.det_crop_mode");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 59:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 218)) {
+          auto str = _internal_mutable_det_crop_mode();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_caffe.V0LayerParameter.det_crop_mode");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 new_num = 60 [default = 0];
-      case 60: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(224u /* 480 & 0xFF */)) {
-          set_has_new_num();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &new_num_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 60:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 224)) {
+          _Internal::set_has_new_num(&_has_bits_);
+          new_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 new_channels = 61 [default = 0];
-      case 61: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(232u /* 488 & 0xFF */)) {
-          set_has_new_channels();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &new_channels_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 61:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 232)) {
+          _Internal::set_has_new_channels(&_has_bits_);
+          new_channels_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 new_height = 62 [default = 0];
-      case 62: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(240u /* 496 & 0xFF */)) {
-          set_has_new_height();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &new_height_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 62:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 240)) {
+          _Internal::set_has_new_height(&_has_bits_);
+          new_height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 new_width = 63 [default = 0];
-      case 63: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(248u /* 504 & 0xFF */)) {
-          set_has_new_width();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &new_width_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 63:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 248)) {
+          _Internal::set_has_new_width(&_has_bits_);
+          new_width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool shuffle_images = 64 [default = false];
-      case 64: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(0u /* 512 & 0xFF */)) {
-          set_has_shuffle_images();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &shuffle_images_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 64:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 0)) {
+          _Internal::set_has_shuffle_images(&_has_bits_);
+          shuffle_images_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 concat_dim = 65 [default = 1];
-      case 65: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 520 & 0xFF */)) {
-          set_has_concat_dim();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &concat_dim_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 65:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_concat_dim(&_has_bits_);
+          concat_dim_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 1001;
-      case 1001: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 8010 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_hdf5_output_param()));
-        } 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:opencv_caffe.V0LayerParameter)
-  return true;
+      case 1001:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ctx->ParseMessage(_internal_mutable_hdf5_output_param(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.V0LayerParameter)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void V0LayerParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.V0LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* V0LayerParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.V0LayerParameter)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V0LayerParameter.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional string type = 2;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_type().data(), static_cast<int>(this->_internal_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V0LayerParameter.type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->type(), output);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_type(), target);
   }
 
   // optional uint32 num_output = 3;
   if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->num_output(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_num_output(), target);
   }
 
   // optional bool biasterm = 4 [default = true];
   if (cached_has_bits & 0x00800000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->biasterm(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_biasterm(), target);
   }
 
   // optional .opencv_caffe.FillerParameter weight_filler = 5;
   if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, *this->weight_filler_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        5, _Internal::weight_filler(this), target, stream);
   }
 
   // optional .opencv_caffe.FillerParameter bias_filler = 6;
   if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, *this->bias_filler_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        6, _Internal::bias_filler(this), target, stream);
   }
 
   // optional uint32 pad = 7 [default = 0];
   if (cached_has_bits & 0x00000200u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->pad(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_pad(), target);
   }
 
   // optional uint32 kernelsize = 8;
   if (cached_has_bits & 0x00000400u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->kernelsize(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(8, this->_internal_kernelsize(), target);
   }
 
   // optional uint32 group = 9 [default = 1];
   if (cached_has_bits & 0x01000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->group(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(9, this->_internal_group(), target);
   }
 
   // optional uint32 stride = 10 [default = 1];
   if (cached_has_bits & 0x02000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->stride(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->_internal_stride(), target);
   }
 
   // optional .opencv_caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX];
   if (cached_has_bits & 0x00000800u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      11, this->pool(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      11, this->_internal_pool(), target);
   }
 
   // optional float dropout_ratio = 12 [default = 0.5];
   if (cached_has_bits & 0x04000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(12, this->dropout_ratio(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(12, this->_internal_dropout_ratio(), target);
   }
 
   // optional uint32 local_size = 13 [default = 5];
   if (cached_has_bits & 0x08000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(13, this->local_size(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(13, this->_internal_local_size(), target);
   }
 
   // optional float alpha = 14 [default = 1];
   if (cached_has_bits & 0x10000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(14, this->alpha(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(14, this->_internal_alpha(), target);
   }
 
   // optional float beta = 15 [default = 0.75];
   if (cached_has_bits & 0x20000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(15, this->beta(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(15, this->_internal_beta(), target);
   }
 
   // optional string source = 16;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_source().data(), static_cast<int>(this->_internal_source().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V0LayerParameter.source");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      16, this->source(), output);
+    target = stream->WriteStringMaybeAliased(
+        16, this->_internal_source(), target);
   }
 
   // optional float scale = 17 [default = 1];
   if (cached_has_bits & 0x40000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(17, this->scale(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(17, this->_internal_scale(), target);
   }
 
   // optional string meanfile = 18;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->meanfile().data(), static_cast<int>(this->meanfile().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_meanfile().data(), static_cast<int>(this->_internal_meanfile().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V0LayerParameter.meanfile");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      18, this->meanfile(), output);
+    target = stream->WriteStringMaybeAliased(
+        18, this->_internal_meanfile(), target);
   }
 
   // optional uint32 batchsize = 19;
   if (cached_has_bits & 0x00001000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(19, this->batchsize(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(19, this->_internal_batchsize(), target);
   }
 
   // optional uint32 cropsize = 20 [default = 0];
   if (cached_has_bits & 0x00002000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(20, this->cropsize(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(20, this->_internal_cropsize(), target);
   }
 
   // optional bool mirror = 21 [default = false];
   if (cached_has_bits & 0x00008000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(21, this->mirror(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(21, this->_internal_mirror(), target);
   }
 
   // optional float k = 22 [default = 1];
   if (cached_has_bits & 0x80000000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(22, this->k(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(22, this->_internal_k(), target);
   }
 
   // repeated .opencv_caffe.BlobProto blobs = 50;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->blobs_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      50, this->blobs(static_cast<int>(i)), output);
+      n = static_cast<unsigned int>(this->_internal_blobs_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(50, this->_internal_blobs(i), target, stream);
   }
 
   // repeated float blobs_lr = 51;
-  for (int i = 0, n = this->blobs_lr_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      51, this->blobs_lr(i), output);
+  for (int i = 0, n = this->_internal_blobs_lr_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(51, this->_internal_blobs_lr(i), target);
   }
 
   // repeated float weight_decay = 52;
-  for (int i = 0, n = this->weight_decay_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      52, this->weight_decay(i), output);
-  }
-
-  // optional uint32 rand_skip = 53 [default = 0];
-  if (cached_has_bits & 0x00020000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(53, this->rand_skip(), output);
-  }
-
-  cached_has_bits = _has_bits_[1];
-  // optional float det_fg_threshold = 54 [default = 0.5];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(54, this->det_fg_threshold(), output);
-  }
-
-  // optional float det_bg_threshold = 55 [default = 0.5];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(55, this->det_bg_threshold(), output);
-  }
-
-  // optional float det_fg_fraction = 56 [default = 0.25];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(56, this->det_fg_fraction(), output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 det_context_pad = 58 [default = 0];
-  if (cached_has_bits & 0x00040000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(58, this->det_context_pad(), output);
-  }
-
-  // optional string det_crop_mode = 59 [default = "warp"];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->det_crop_mode().data(), static_cast<int>(this->det_crop_mode().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V0LayerParameter.det_crop_mode");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      59, this->det_crop_mode(), output);
-  }
-
-  // optional int32 new_num = 60 [default = 0];
-  if (cached_has_bits & 0x00080000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(60, this->new_num(), output);
-  }
-
-  // optional int32 new_channels = 61 [default = 0];
-  if (cached_has_bits & 0x00100000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(61, this->new_channels(), output);
-  }
-
-  // optional int32 new_height = 62 [default = 0];
-  if (cached_has_bits & 0x00200000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(62, this->new_height(), output);
-  }
-
-  // optional int32 new_width = 63 [default = 0];
-  if (cached_has_bits & 0x00004000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(63, this->new_width(), output);
-  }
-
-  // optional bool shuffle_images = 64 [default = false];
-  if (cached_has_bits & 0x00010000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(64, this->shuffle_images(), output);
-  }
-
-  // optional uint32 concat_dim = 65 [default = 1];
-  if (cached_has_bits & 0x00400000u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(65, this->concat_dim(), output);
-  }
-
-  // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 1001;
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1001, *this->hdf5_output_param_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.V0LayerParameter)
-}
-
-::google::protobuf::uint8* V0LayerParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.V0LayerParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V0LayerParameter.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // optional string type = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V0LayerParameter.type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->type(), target);
-  }
-
-  // optional uint32 num_output = 3;
-  if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->num_output(), target);
-  }
-
-  // optional bool biasterm = 4 [default = true];
-  if (cached_has_bits & 0x00800000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->biasterm(), target);
-  }
-
-  // optional .opencv_caffe.FillerParameter weight_filler = 5;
-  if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, *this->weight_filler_, deterministic, target);
-  }
-
-  // optional .opencv_caffe.FillerParameter bias_filler = 6;
-  if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, *this->bias_filler_, deterministic, target);
-  }
-
-  // optional uint32 pad = 7 [default = 0];
-  if (cached_has_bits & 0x00000200u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->pad(), target);
-  }
-
-  // optional uint32 kernelsize = 8;
-  if (cached_has_bits & 0x00000400u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->kernelsize(), target);
-  }
-
-  // optional uint32 group = 9 [default = 1];
-  if (cached_has_bits & 0x01000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->group(), target);
-  }
-
-  // optional uint32 stride = 10 [default = 1];
-  if (cached_has_bits & 0x02000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->stride(), target);
-  }
-
-  // optional .opencv_caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX];
-  if (cached_has_bits & 0x00000800u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      11, this->pool(), target);
-  }
-
-  // optional float dropout_ratio = 12 [default = 0.5];
-  if (cached_has_bits & 0x04000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(12, this->dropout_ratio(), target);
-  }
-
-  // optional uint32 local_size = 13 [default = 5];
-  if (cached_has_bits & 0x08000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(13, this->local_size(), target);
-  }
-
-  // optional float alpha = 14 [default = 1];
-  if (cached_has_bits & 0x10000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(14, this->alpha(), target);
-  }
-
-  // optional float beta = 15 [default = 0.75];
-  if (cached_has_bits & 0x20000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(15, this->beta(), target);
-  }
-
-  // optional string source = 16;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->source().data(), static_cast<int>(this->source().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V0LayerParameter.source");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        16, this->source(), target);
-  }
-
-  // optional float scale = 17 [default = 1];
-  if (cached_has_bits & 0x40000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(17, this->scale(), target);
-  }
-
-  // optional string meanfile = 18;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->meanfile().data(), static_cast<int>(this->meanfile().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_caffe.V0LayerParameter.meanfile");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        18, this->meanfile(), target);
+  for (int i = 0, n = this->_internal_weight_decay_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(52, this->_internal_weight_decay(i), target);
   }
 
-  // optional uint32 batchsize = 19;
-  if (cached_has_bits & 0x00001000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(19, this->batchsize(), target);
-  }
-
-  // optional uint32 cropsize = 20 [default = 0];
-  if (cached_has_bits & 0x00002000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(20, this->cropsize(), target);
-  }
-
-  // optional bool mirror = 21 [default = false];
-  if (cached_has_bits & 0x00008000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(21, this->mirror(), target);
-  }
-
-  // optional float k = 22 [default = 1];
-  if (cached_has_bits & 0x80000000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(22, this->k(), target);
-  }
-
-  // repeated .opencv_caffe.BlobProto blobs = 50;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->blobs_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        50, this->blobs(static_cast<int>(i)), deterministic, target);
-  }
-
-  // repeated float blobs_lr = 51;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(51, this->blobs_lr_, target);
-
-  // repeated float weight_decay = 52;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(52, this->weight_decay_, target);
-
   // optional uint32 rand_skip = 53 [default = 0];
   if (cached_has_bits & 0x00020000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(53, this->rand_skip(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(53, this->_internal_rand_skip(), target);
   }
 
   cached_has_bits = _has_bits_[1];
   // optional float det_fg_threshold = 54 [default = 0.5];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(54, this->det_fg_threshold(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(54, this->_internal_det_fg_threshold(), target);
   }
 
   // optional float det_bg_threshold = 55 [default = 0.5];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(55, this->det_bg_threshold(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(55, this->_internal_det_bg_threshold(), target);
   }
 
   // optional float det_fg_fraction = 56 [default = 0.25];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(56, this->det_fg_fraction(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(56, this->_internal_det_fg_fraction(), target);
   }
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 det_context_pad = 58 [default = 0];
   if (cached_has_bits & 0x00040000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(58, this->det_context_pad(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(58, this->_internal_det_context_pad(), target);
   }
 
   // optional string det_crop_mode = 59 [default = "warp"];
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->det_crop_mode().data(), static_cast<int>(this->det_crop_mode().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_det_crop_mode().data(), static_cast<int>(this->_internal_det_crop_mode().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_caffe.V0LayerParameter.det_crop_mode");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        59, this->det_crop_mode(), target);
+    target = stream->WriteStringMaybeAliased(
+        59, this->_internal_det_crop_mode(), target);
   }
 
   // optional int32 new_num = 60 [default = 0];
   if (cached_has_bits & 0x00080000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(60, this->new_num(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(60, this->_internal_new_num(), target);
   }
 
   // optional int32 new_channels = 61 [default = 0];
   if (cached_has_bits & 0x00100000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(61, this->new_channels(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(61, this->_internal_new_channels(), target);
   }
 
   // optional int32 new_height = 62 [default = 0];
   if (cached_has_bits & 0x00200000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(62, this->new_height(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(62, this->_internal_new_height(), target);
   }
 
   // optional int32 new_width = 63 [default = 0];
   if (cached_has_bits & 0x00004000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(63, this->new_width(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(63, this->_internal_new_width(), target);
   }
 
   // optional bool shuffle_images = 64 [default = false];
   if (cached_has_bits & 0x00010000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(64, this->shuffle_images(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(64, this->_internal_shuffle_images(), target);
   }
 
   // optional uint32 concat_dim = 65 [default = 1];
   if (cached_has_bits & 0x00400000u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(65, this->concat_dim(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(65, this->_internal_concat_dim(), target);
   }
 
   // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 1001;
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1001, *this->hdf5_output_param_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1001, _Internal::hdf5_output_param(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.V0LayerParameter)
   return target;
@@ -38617,337 +31816,310 @@ size_t V0LayerParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.V0LayerParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_caffe.BlobProto blobs = 50;
-  {
-    unsigned int count = static_cast<unsigned int>(this->blobs_size());
-    total_size += 2UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->blobs(static_cast<int>(i)));
-    }
+  total_size += 2UL * this->_internal_blobs_size();
+  for (const auto& msg : this->blobs_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated float blobs_lr = 51;
   {
-    unsigned int count = static_cast<unsigned int>(this->blobs_lr_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_blobs_lr_size());
     size_t data_size = 4UL * count;
     total_size += 2 *
-                  ::google::protobuf::internal::FromIntSize(this->blobs_lr_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_blobs_lr_size());
     total_size += data_size;
   }
 
   // repeated float weight_decay = 52;
   {
-    unsigned int count = static_cast<unsigned int>(this->weight_decay_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_weight_decay_size());
     size_t data_size = 4UL * count;
     total_size += 2 *
-                  ::google::protobuf::internal::FromIntSize(this->weight_decay_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_weight_decay_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 255u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional string type = 2;
-    if (has_type()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_type());
     }
 
     // optional string source = 16;
-    if (has_source()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->source());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_source());
     }
 
     // optional string meanfile = 18;
-    if (has_meanfile()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->meanfile());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_meanfile());
     }
 
     // optional string det_crop_mode = 59 [default = "warp"];
-    if (has_det_crop_mode()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->det_crop_mode());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_det_crop_mode());
     }
 
     // optional .opencv_caffe.FillerParameter weight_filler = 5;
-    if (has_weight_filler()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->weight_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *weight_filler_);
     }
 
     // optional .opencv_caffe.FillerParameter bias_filler = 6;
-    if (has_bias_filler()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->bias_filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *bias_filler_);
     }
 
     // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 1001;
-    if (has_hdf5_output_param()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->hdf5_output_param_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *hdf5_output_param_);
     }
 
   }
-  if (_has_bits_[8 / 32] & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     // optional uint32 num_output = 3;
-    if (has_num_output()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->num_output());
+    if (cached_has_bits & 0x00000100u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_num_output());
     }
 
     // optional uint32 pad = 7 [default = 0];
-    if (has_pad()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pad());
+    if (cached_has_bits & 0x00000200u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pad());
     }
 
     // optional uint32 kernelsize = 8;
-    if (has_kernelsize()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->kernelsize());
+    if (cached_has_bits & 0x00000400u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_kernelsize());
     }
 
     // optional .opencv_caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX];
-    if (has_pool()) {
+    if (cached_has_bits & 0x00000800u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_pool());
     }
 
     // optional uint32 batchsize = 19;
-    if (has_batchsize()) {
+    if (cached_has_bits & 0x00001000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->batchsize());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
+          this->_internal_batchsize());
     }
 
     // optional uint32 cropsize = 20 [default = 0];
-    if (has_cropsize()) {
+    if (cached_has_bits & 0x00002000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->cropsize());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
+          this->_internal_cropsize());
     }
 
     // optional int32 new_width = 63 [default = 0];
-    if (has_new_width()) {
+    if (cached_has_bits & 0x00004000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->new_width());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+          this->_internal_new_width());
     }
 
     // optional bool mirror = 21 [default = false];
-    if (has_mirror()) {
+    if (cached_has_bits & 0x00008000u) {
       total_size += 2 + 1;
     }
 
   }
-  if (_has_bits_[16 / 32] & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     // optional bool shuffle_images = 64 [default = false];
-    if (has_shuffle_images()) {
+    if (cached_has_bits & 0x00010000u) {
       total_size += 2 + 1;
     }
 
     // optional uint32 rand_skip = 53 [default = 0];
-    if (has_rand_skip()) {
+    if (cached_has_bits & 0x00020000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->rand_skip());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
+          this->_internal_rand_skip());
     }
 
     // optional uint32 det_context_pad = 58 [default = 0];
-    if (has_det_context_pad()) {
+    if (cached_has_bits & 0x00040000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->det_context_pad());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
+          this->_internal_det_context_pad());
     }
 
     // optional int32 new_num = 60 [default = 0];
-    if (has_new_num()) {
+    if (cached_has_bits & 0x00080000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->new_num());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+          this->_internal_new_num());
     }
 
     // optional int32 new_channels = 61 [default = 0];
-    if (has_new_channels()) {
+    if (cached_has_bits & 0x00100000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->new_channels());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+          this->_internal_new_channels());
     }
 
     // optional int32 new_height = 62 [default = 0];
-    if (has_new_height()) {
+    if (cached_has_bits & 0x00200000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->new_height());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+          this->_internal_new_height());
     }
 
     // optional uint32 concat_dim = 65 [default = 1];
-    if (has_concat_dim()) {
+    if (cached_has_bits & 0x00400000u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->concat_dim());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
+          this->_internal_concat_dim());
     }
 
     // optional bool biasterm = 4 [default = true];
-    if (has_biasterm()) {
+    if (cached_has_bits & 0x00800000u) {
       total_size += 1 + 1;
     }
 
   }
-  if (_has_bits_[24 / 32] & 4278190080u) {
+  if (cached_has_bits & 0xff000000u) {
     // optional uint32 group = 9 [default = 1];
-    if (has_group()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->group());
+    if (cached_has_bits & 0x01000000u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_group());
     }
 
     // optional uint32 stride = 10 [default = 1];
-    if (has_stride()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->stride());
+    if (cached_has_bits & 0x02000000u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_stride());
     }
 
     // optional float dropout_ratio = 12 [default = 0.5];
-    if (has_dropout_ratio()) {
+    if (cached_has_bits & 0x04000000u) {
       total_size += 1 + 4;
     }
 
     // optional uint32 local_size = 13 [default = 5];
-    if (has_local_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->local_size());
+    if (cached_has_bits & 0x08000000u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_local_size());
     }
 
     // optional float alpha = 14 [default = 1];
-    if (has_alpha()) {
+    if (cached_has_bits & 0x10000000u) {
       total_size += 1 + 4;
     }
 
     // optional float beta = 15 [default = 0.75];
-    if (has_beta()) {
+    if (cached_has_bits & 0x20000000u) {
       total_size += 1 + 4;
     }
 
     // optional float scale = 17 [default = 1];
-    if (has_scale()) {
+    if (cached_has_bits & 0x40000000u) {
       total_size += 2 + 4;
     }
 
     // optional float k = 22 [default = 1];
-    if (has_k()) {
+    if (cached_has_bits & 0x80000000u) {
       total_size += 2 + 4;
     }
 
   }
-  if (_has_bits_[32 / 32] & 7u) {
+  cached_has_bits = _has_bits_[1];
+  if (cached_has_bits & 0x00000007u) {
     // optional float det_fg_threshold = 54 [default = 0.5];
-    if (has_det_fg_threshold()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 2 + 4;
     }
 
     // optional float det_bg_threshold = 55 [default = 0.5];
-    if (has_det_bg_threshold()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 2 + 4;
     }
 
     // optional float det_fg_fraction = 56 [default = 0.25];
-    if (has_det_fg_fraction()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 2 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void V0LayerParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.V0LayerParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const V0LayerParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const V0LayerParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.V0LayerParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.V0LayerParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData V0LayerParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    V0LayerParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*V0LayerParameter::GetClassData() const { return &_class_data_; }
+
+void V0LayerParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<V0LayerParameter *>(to)->MergeFrom(
+      static_cast<const V0LayerParameter &>(from));
 }
 
+
 void V0LayerParameter::MergeFrom(const V0LayerParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.V0LayerParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   blobs_.MergeFrom(from.blobs_);
   blobs_lr_.MergeFrom(from.blobs_lr_);
   weight_decay_.MergeFrom(from.weight_decay_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_type();
-      type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
+      _internal_set_type(from._internal_type());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_source();
-      source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
+      _internal_set_source(from._internal_source());
     }
     if (cached_has_bits & 0x00000008u) {
-      set_has_meanfile();
-      meanfile_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.meanfile_);
+      _internal_set_meanfile(from._internal_meanfile());
     }
     if (cached_has_bits & 0x00000010u) {
-      set_has_det_crop_mode();
-      det_crop_mode_.AssignWithDefault(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get(), from.det_crop_mode_);
+      _internal_set_det_crop_mode(from._internal_det_crop_mode());
     }
     if (cached_has_bits & 0x00000020u) {
-      mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.weight_filler());
+      _internal_mutable_weight_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_weight_filler());
     }
     if (cached_has_bits & 0x00000040u) {
-      mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.bias_filler());
+      _internal_mutable_bias_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_bias_filler());
     }
     if (cached_has_bits & 0x00000080u) {
-      mutable_hdf5_output_param()->::opencv_caffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param());
+      _internal_mutable_hdf5_output_param()->::opencv_caffe::HDF5OutputParameter::MergeFrom(from._internal_hdf5_output_param());
     }
   }
-  if (cached_has_bits & 65280u) {
+  if (cached_has_bits & 0x0000ff00u) {
     if (cached_has_bits & 0x00000100u) {
       num_output_ = from.num_output_;
     }
@@ -38974,7 +32146,7 @@ void V0LayerParameter::MergeFrom(const V0LayerParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 16711680u) {
+  if (cached_has_bits & 0x00ff0000u) {
     if (cached_has_bits & 0x00010000u) {
       shuffle_images_ = from.shuffle_images_;
     }
@@ -39001,7 +32173,7 @@ void V0LayerParameter::MergeFrom(const V0LayerParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 4278190080u) {
+  if (cached_has_bits & 0xff000000u) {
     if (cached_has_bits & 0x01000000u) {
       group_ = from.group_;
     }
@@ -39029,7 +32201,7 @@ void V0LayerParameter::MergeFrom(const V0LayerParameter& from) {
     _has_bits_[0] |= cached_has_bits;
   }
   cached_has_bits = from._has_bits_[1];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       det_fg_threshold_ = from.det_fg_threshold_;
     }
@@ -39041,13 +32213,7 @@ void V0LayerParameter::MergeFrom(const V0LayerParameter& from) {
     }
     _has_bits_[1] |= cached_has_bits;
   }
-}
-
-void V0LayerParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.V0LayerParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void V0LayerParameter::CopyFrom(const V0LayerParameter& from) {
@@ -39061,37 +32227,47 @@ bool V0LayerParameter::IsInitialized() const {
   return true;
 }
 
-void V0LayerParameter::Swap(V0LayerParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void V0LayerParameter::InternalSwap(V0LayerParameter* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  swap(_has_bits_[1], other->_has_bits_[1]);
   blobs_.InternalSwap(&other->blobs_);
   blobs_lr_.InternalSwap(&other->blobs_lr_);
   weight_decay_.InternalSwap(&other->weight_decay_);
-  name_.Swap(&other->name_);
-  type_.Swap(&other->type_);
-  source_.Swap(&other->source_);
-  meanfile_.Swap(&other->meanfile_);
-  det_crop_mode_.Swap(&other->det_crop_mode_);
-  swap(weight_filler_, other->weight_filler_);
-  swap(bias_filler_, other->bias_filler_);
-  swap(hdf5_output_param_, other->hdf5_output_param_);
-  swap(num_output_, other->num_output_);
-  swap(pad_, other->pad_);
-  swap(kernelsize_, other->kernelsize_);
-  swap(pool_, other->pool_);
-  swap(batchsize_, other->batchsize_);
-  swap(cropsize_, other->cropsize_);
-  swap(new_width_, other->new_width_);
-  swap(mirror_, other->mirror_);
-  swap(shuffle_images_, other->shuffle_images_);
-  swap(rand_skip_, other->rand_skip_);
-  swap(det_context_pad_, other->det_context_pad_);
-  swap(new_num_, other->new_num_);
-  swap(new_channels_, other->new_channels_);
-  swap(new_height_, other->new_height_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &type_, lhs_arena,
+      &other->type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &source_, lhs_arena,
+      &other->source_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &meanfile_, lhs_arena,
+      &other->meanfile_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      nullptr,
+      &det_crop_mode_, lhs_arena,
+      &other->det_crop_mode_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(V0LayerParameter, new_height_)
+      + sizeof(V0LayerParameter::new_height_)
+      - PROTOBUF_FIELD_OFFSET(V0LayerParameter, weight_filler_)>(
+          reinterpret_cast<char*>(&weight_filler_),
+          reinterpret_cast<char*>(&other->weight_filler_));
   swap(concat_dim_, other->concat_dim_);
   swap(biasterm_, other->biasterm_);
   swap(group_, other->group_);
@@ -39105,211 +32281,171 @@ void V0LayerParameter::InternalSwap(V0LayerParameter* other) {
   swap(det_fg_threshold_, other->det_fg_threshold_);
   swap(det_bg_threshold_, other->det_bg_threshold_);
   swap(det_fg_fraction_, other->det_fg_fraction_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  swap(_has_bits_[1], other->_has_bits_[1]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata V0LayerParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata V0LayerParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[65]);
 }
 
-
 // ===================================================================
 
-void PReLUParameter::InitAsDefaultInstance() {
-  ::opencv_caffe::_PReLUParameter_default_instance_._instance.get_mutable()->filler_ = const_cast< ::opencv_caffe::FillerParameter*>(
-      ::opencv_caffe::FillerParameter::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int PReLUParameter::kFillerFieldNumber;
-const int PReLUParameter::kChannelSharedFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-PReLUParameter::PReLUParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPReLUParameter();
+class PReLUParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<PReLUParameter>()._has_bits_);
+  static const ::opencv_caffe::FillerParameter& filler(const PReLUParameter* msg);
+  static void set_has_filler(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_channel_shared(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+const ::opencv_caffe::FillerParameter&
+PReLUParameter::_Internal::filler(const PReLUParameter* msg) {
+  return *msg->filler_;
+}
+PReLUParameter::PReLUParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.PReLUParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.PReLUParameter)
 }
 PReLUParameter::PReLUParameter(const PReLUParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_filler()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_filler()) {
     filler_ = new ::opencv_caffe::FillerParameter(*from.filler_);
   } else {
-    filler_ = NULL;
+    filler_ = nullptr;
   }
   channel_shared_ = from.channel_shared_;
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.PReLUParameter)
 }
 
-void PReLUParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&filler_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&channel_shared_) -
-      reinterpret_cast<char*>(&filler_)) + sizeof(channel_shared_));
+inline void PReLUParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&filler_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&channel_shared_) -
+    reinterpret_cast<char*>(&filler_)) + sizeof(channel_shared_));
 }
 
 PReLUParameter::~PReLUParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.PReLUParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void PReLUParameter::SharedDtor() {
+inline void PReLUParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete filler_;
 }
 
-void PReLUParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* PReLUParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void PReLUParameter::ArenaDtor(void* object) {
+  PReLUParameter* _this = reinterpret_cast< PReLUParameter* >(object);
+  (void)_this;
 }
-
-const PReLUParameter& PReLUParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPReLUParameter();
-  return *internal_default_instance();
+void PReLUParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-PReLUParameter* PReLUParameter::New(::google::protobuf::Arena* arena) const {
-  PReLUParameter* n = new PReLUParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void PReLUParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void PReLUParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.PReLUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(filler_ != NULL);
+    GOOGLE_DCHECK(filler_ != nullptr);
     filler_->Clear();
   }
   channel_shared_ = false;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool PReLUParameter::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:opencv_caffe.PReLUParameter)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* PReLUParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_caffe.FillerParameter filler = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_filler()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_filler(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bool channel_shared = 2 [default = false];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_channel_shared();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &channel_shared_)));
-        } 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:opencv_caffe.PReLUParameter)
-  return true;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_channel_shared(&has_bits);
+          channel_shared_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.PReLUParameter)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void PReLUParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.PReLUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_caffe.FillerParameter filler = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->filler_, output);
-  }
-
-  // optional bool channel_shared = 2 [default = false];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->channel_shared(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.PReLUParameter)
-}
-
-::google::protobuf::uint8* PReLUParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* PReLUParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PReLUParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_caffe.FillerParameter filler = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *this->filler_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::filler(this), target, stream);
   }
 
   // optional bool channel_shared = 2 [default = false];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->channel_shared(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_channel_shared(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.PReLUParameter)
   return target;
@@ -39319,71 +32455,58 @@ size_t PReLUParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PReLUParameter)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional .opencv_caffe.FillerParameter filler = 1;
-    if (has_filler()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->filler_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *filler_);
     }
 
     // optional bool channel_shared = 2 [default = false];
-    if (has_channel_shared()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 1;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void PReLUParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.PReLUParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const PReLUParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const PReLUParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.PReLUParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.PReLUParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PReLUParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    PReLUParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PReLUParameter::GetClassData() const { return &_class_data_; }
+
+void PReLUParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<PReLUParameter *>(to)->MergeFrom(
+      static_cast<const PReLUParameter &>(from));
 }
 
+
 void PReLUParameter::MergeFrom(const PReLUParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PReLUParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_filler()->::opencv_caffe::FillerParameter::MergeFrom(from.filler());
+      _internal_mutable_filler()->::opencv_caffe::FillerParameter::MergeFrom(from._internal_filler());
     }
     if (cached_has_bits & 0x00000002u) {
       channel_shared_ = from.channel_shared_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void PReLUParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.PReLUParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void PReLUParameter::CopyFrom(const PReLUParameter& from) {
@@ -39397,361 +32520,279 @@ bool PReLUParameter::IsInitialized() const {
   return true;
 }
 
-void PReLUParameter::Swap(PReLUParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void PReLUParameter::InternalSwap(PReLUParameter* other) {
   using std::swap;
-  swap(filler_, other->filler_);
-  swap(channel_shared_, other->channel_shared_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(PReLUParameter, channel_shared_)
+      + sizeof(PReLUParameter::channel_shared_)
+      - PROTOBUF_FIELD_OFFSET(PReLUParameter, filler_)>(
+          reinterpret_cast<char*>(&filler_),
+          reinterpret_cast<char*>(&other->filler_));
 }
 
-::google::protobuf::Metadata PReLUParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata PReLUParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[66]);
 }
 
-
 // ===================================================================
 
-void NormalizedBBox::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NormalizedBBox::kXminFieldNumber;
-const int NormalizedBBox::kYminFieldNumber;
-const int NormalizedBBox::kXmaxFieldNumber;
-const int NormalizedBBox::kYmaxFieldNumber;
-const int NormalizedBBox::kLabelFieldNumber;
-const int NormalizedBBox::kDifficultFieldNumber;
-const int NormalizedBBox::kScoreFieldNumber;
-const int NormalizedBBox::kSizeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-NormalizedBBox::NormalizedBBox()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNormalizedBBox();
+class NormalizedBBox::_Internal {
+ public:
+  using HasBits = decltype(std::declval<NormalizedBBox>()._has_bits_);
+  static void set_has_xmin(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_ymin(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_xmax(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_ymax(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_label(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static void set_has_difficult(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+  static void set_has_score(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
   }
+};
+
+NormalizedBBox::NormalizedBBox(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.NormalizedBBox)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.NormalizedBBox)
 }
 NormalizedBBox::NormalizedBBox(const NormalizedBBox& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&xmin_, &from.xmin_,
     static_cast<size_t>(reinterpret_cast<char*>(&size_) -
     reinterpret_cast<char*>(&xmin_)) + sizeof(size_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.NormalizedBBox)
 }
 
-void NormalizedBBox::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&xmin_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&size_) -
-      reinterpret_cast<char*>(&xmin_)) + sizeof(size_));
+inline void NormalizedBBox::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&xmin_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&size_) -
+    reinterpret_cast<char*>(&xmin_)) + sizeof(size_));
 }
 
 NormalizedBBox::~NormalizedBBox() {
   // @@protoc_insertion_point(destructor:opencv_caffe.NormalizedBBox)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void NormalizedBBox::SharedDtor() {
+inline void NormalizedBBox::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void NormalizedBBox::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void NormalizedBBox::ArenaDtor(void* object) {
+  NormalizedBBox* _this = reinterpret_cast< NormalizedBBox* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* NormalizedBBox::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const NormalizedBBox& NormalizedBBox::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNormalizedBBox();
-  return *internal_default_instance();
+void NormalizedBBox::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-NormalizedBBox* NormalizedBBox::New(::google::protobuf::Arena* arena) const {
-  NormalizedBBox* n = new NormalizedBBox;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void NormalizedBBox::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void NormalizedBBox::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.NormalizedBBox)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     ::memset(&xmin_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&size_) -
         reinterpret_cast<char*>(&xmin_)) + sizeof(size_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool NormalizedBBox::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:opencv_caffe.NormalizedBBox)
-  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 float xmin = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_xmin();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &xmin_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* NormalizedBBox::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional float xmin = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_xmin(&has_bits);
+          xmin_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float ymin = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_ymin();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &ymin_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_ymin(&has_bits);
+          ymin_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float xmax = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_xmax();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &xmax_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_xmax(&has_bits);
+          xmax_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float ymax = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          set_has_ymax();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &ymax_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 37)) {
+          _Internal::set_has_ymax(&has_bits);
+          ymax_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional int32 label = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_label();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &label_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_label(&has_bits);
+          label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional bool difficult = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_difficult();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &difficult_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_difficult(&has_bits);
+          difficult_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float score = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
-          set_has_score();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &score_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 61)) {
+          _Internal::set_has_score(&has_bits);
+          score_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float size = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(69u /* 69 & 0xFF */)) {
-          set_has_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &size_)));
-        } 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:opencv_caffe.NormalizedBBox)
-  return true;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 69)) {
+          _Internal::set_has_size(&has_bits);
+          size_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.NormalizedBBox)
-  return false;
-#undef DO_
-}
-
-void NormalizedBBox::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.NormalizedBBox)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional float xmin = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->xmin(), output);
-  }
-
-  // optional float ymin = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->ymin(), output);
-  }
-
-  // optional float xmax = 3;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->xmax(), output);
-  }
-
-  // optional float ymax = 4;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->ymax(), output);
-  }
-
-  // optional int32 label = 5;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->label(), output);
-  }
-
-  // optional bool difficult = 6;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->difficult(), output);
-  }
-
-  // optional float score = 7;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->score(), output);
-  }
-
-  // optional float size = 8;
-  if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->size(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.NormalizedBBox)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* NormalizedBBox::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* NormalizedBBox::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.NormalizedBBox)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional float xmin = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->xmin(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_xmin(), target);
   }
 
   // optional float ymin = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->ymin(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_ymin(), target);
   }
 
   // optional float xmax = 3;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->xmax(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_xmax(), target);
   }
 
   // optional float ymax = 4;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->ymax(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_ymax(), target);
   }
 
   // optional int32 label = 5;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->label(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_label(), target);
   }
 
   // optional bool difficult = 6;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->difficult(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_difficult(), target);
   }
 
   // optional float score = 7;
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->score(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(7, this->_internal_score(), target);
   }
 
   // optional float size = 8;
   if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(8, this->_internal_size(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.NormalizedBBox)
   return target;
@@ -39761,86 +32802,77 @@ size_t NormalizedBBox::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.NormalizedBBox)
   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] & 255u) {
+  uint32_t 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 & 0x000000ffu) {
     // optional float xmin = 1;
-    if (has_xmin()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 + 4;
     }
 
     // optional float ymin = 2;
-    if (has_ymin()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 + 4;
     }
 
     // optional float xmax = 3;
-    if (has_xmax()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
     // optional float ymax = 4;
-    if (has_ymax()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 + 4;
     }
 
     // optional int32 label = 5;
-    if (has_label()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->label());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_label());
     }
 
     // optional bool difficult = 6;
-    if (has_difficult()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 + 1;
     }
 
     // optional float score = 7;
-    if (has_score()) {
+    if (cached_has_bits & 0x00000040u) {
       total_size += 1 + 4;
     }
 
     // optional float size = 8;
-    if (has_size()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void NormalizedBBox::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.NormalizedBBox)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NormalizedBBox* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NormalizedBBox>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.NormalizedBBox)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.NormalizedBBox)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NormalizedBBox::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NormalizedBBox::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NormalizedBBox::GetClassData() const { return &_class_data_; }
+
+void NormalizedBBox::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NormalizedBBox *>(to)->MergeFrom(
+      static_cast<const NormalizedBBox &>(from));
 }
 
+
 void NormalizedBBox::MergeFrom(const NormalizedBBox& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.NormalizedBBox)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
       xmin_ = from.xmin_;
     }
@@ -39867,13 +32899,7 @@ void NormalizedBBox::MergeFrom(const NormalizedBBox& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void NormalizedBBox::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.NormalizedBBox)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void NormalizedBBox::CopyFrom(const NormalizedBBox& from) {
@@ -39887,244 +32913,191 @@ bool NormalizedBBox::IsInitialized() const {
   return true;
 }
 
-void NormalizedBBox::Swap(NormalizedBBox* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void NormalizedBBox::InternalSwap(NormalizedBBox* other) {
   using std::swap;
-  swap(xmin_, other->xmin_);
-  swap(ymin_, other->ymin_);
-  swap(xmax_, other->xmax_);
-  swap(ymax_, other->ymax_);
-  swap(label_, other->label_);
-  swap(difficult_, other->difficult_);
-  swap(score_, other->score_);
-  swap(size_, other->size_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(NormalizedBBox, size_)
+      + sizeof(NormalizedBBox::size_)
+      - PROTOBUF_FIELD_OFFSET(NormalizedBBox, xmin_)>(
+          reinterpret_cast<char*>(&xmin_),
+          reinterpret_cast<char*>(&other->xmin_));
 }
 
-::google::protobuf::Metadata NormalizedBBox::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata NormalizedBBox::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[67]);
 }
 
-
 // ===================================================================
 
-void ROIPoolingParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ROIPoolingParameter::kPooledHFieldNumber;
-const int ROIPoolingParameter::kPooledWFieldNumber;
-const int ROIPoolingParameter::kSpatialScaleFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ROIPoolingParameter::ROIPoolingParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsROIPoolingParameter();
+class ROIPoolingParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ROIPoolingParameter>()._has_bits_);
+  static void set_has_pooled_h(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_pooled_w(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+  static void set_has_spatial_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+ROIPoolingParameter::ROIPoolingParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ROIPoolingParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ROIPoolingParameter)
 }
 ROIPoolingParameter::ROIPoolingParameter(const ROIPoolingParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&pooled_h_, &from.pooled_h_,
     static_cast<size_t>(reinterpret_cast<char*>(&spatial_scale_) -
     reinterpret_cast<char*>(&pooled_h_)) + sizeof(spatial_scale_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ROIPoolingParameter)
 }
 
-void ROIPoolingParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&pooled_h_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&pooled_w_) -
-      reinterpret_cast<char*>(&pooled_h_)) + sizeof(pooled_w_));
-  spatial_scale_ = 1;
+inline void ROIPoolingParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&pooled_h_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&pooled_w_) -
+    reinterpret_cast<char*>(&pooled_h_)) + sizeof(pooled_w_));
+spatial_scale_ = 1;
 }
 
 ROIPoolingParameter::~ROIPoolingParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ROIPoolingParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ROIPoolingParameter::SharedDtor() {
+inline void ROIPoolingParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ROIPoolingParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void ROIPoolingParameter::ArenaDtor(void* object) {
+  ROIPoolingParameter* _this = reinterpret_cast< ROIPoolingParameter* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* ROIPoolingParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const ROIPoolingParameter& ROIPoolingParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsROIPoolingParameter();
-  return *internal_default_instance();
+void ROIPoolingParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ROIPoolingParameter* ROIPoolingParameter::New(::google::protobuf::Arena* arena) const {
-  ROIPoolingParameter* n = new ROIPoolingParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ROIPoolingParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ROIPoolingParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ROIPoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     ::memset(&pooled_h_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&pooled_w_) -
         reinterpret_cast<char*>(&pooled_h_)) + sizeof(pooled_w_));
     spatial_scale_ = 1;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ROIPoolingParameter::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:opencv_caffe.ROIPoolingParameter)
-  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 uint32 pooled_h = 1 [default = 0];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_pooled_h();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pooled_h_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* ROIPoolingParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 pooled_h = 1 [default = 0];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_pooled_h(&has_bits);
+          pooled_h_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 pooled_w = 2 [default = 0];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_pooled_w();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pooled_w_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_pooled_w(&has_bits);
+          pooled_w_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float spatial_scale = 3 [default = 1];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_spatial_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &spatial_scale_)));
-        } 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:opencv_caffe.ROIPoolingParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
+          _Internal::set_has_spatial_scale(&has_bits);
+          spatial_scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ROIPoolingParameter)
-  return false;
-#undef DO_
-}
-
-void ROIPoolingParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ROIPoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 pooled_h = 1 [default = 0];
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->pooled_h(), output);
-  }
-
-  // optional uint32 pooled_w = 2 [default = 0];
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->pooled_w(), output);
-  }
-
-  // optional float spatial_scale = 3 [default = 1];
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->spatial_scale(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ROIPoolingParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ROIPoolingParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ROIPoolingParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ROIPoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 pooled_h = 1 [default = 0];
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->pooled_h(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_pooled_h(), target);
   }
 
   // optional uint32 pooled_w = 2 [default = 0];
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->pooled_w(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_pooled_w(), target);
   }
 
   // optional float spatial_scale = 3 [default = 1];
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->spatial_scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_spatial_scale(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ROIPoolingParameter)
   return target;
@@ -40134,63 +33107,52 @@ size_t ROIPoolingParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ROIPoolingParameter)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional uint32 pooled_h = 1 [default = 0];
-    if (has_pooled_h()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pooled_h());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pooled_h());
     }
 
     // optional uint32 pooled_w = 2 [default = 0];
-    if (has_pooled_w()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pooled_w());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pooled_w());
     }
 
     // optional float spatial_scale = 3 [default = 1];
-    if (has_spatial_scale()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ROIPoolingParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ROIPoolingParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ROIPoolingParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ROIPoolingParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ROIPoolingParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ROIPoolingParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ROIPoolingParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ROIPoolingParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ROIPoolingParameter::GetClassData() const { return &_class_data_; }
+
+void ROIPoolingParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ROIPoolingParameter *>(to)->MergeFrom(
+      static_cast<const ROIPoolingParameter &>(from));
 }
 
+
 void ROIPoolingParameter::MergeFrom(const ROIPoolingParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ROIPoolingParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       pooled_h_ = from.pooled_h_;
     }
@@ -40202,13 +33164,7 @@ void ROIPoolingParameter::MergeFrom(const ROIPoolingParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ROIPoolingParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ROIPoolingParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ROIPoolingParameter::CopyFrom(const ROIPoolingParameter& from) {
@@ -40222,114 +33178,113 @@ bool ROIPoolingParameter::IsInitialized() const {
   return true;
 }
 
-void ROIPoolingParameter::Swap(ROIPoolingParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ROIPoolingParameter::InternalSwap(ROIPoolingParameter* other) {
   using std::swap;
-  swap(pooled_h_, other->pooled_h_);
-  swap(pooled_w_, other->pooled_w_);
-  swap(spatial_scale_, other->spatial_scale_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ROIPoolingParameter, pooled_w_)
+      + sizeof(ROIPoolingParameter::pooled_w_)
+      - PROTOBUF_FIELD_OFFSET(ROIPoolingParameter, pooled_h_)>(
+          reinterpret_cast<char*>(&pooled_h_),
+          reinterpret_cast<char*>(&other->pooled_h_));
+  swap(spatial_scale_, other->spatial_scale_);
 }
 
-::google::protobuf::Metadata ROIPoolingParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ROIPoolingParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[68]);
 }
 
-
 // ===================================================================
 
-void ProposalParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ProposalParameter::kFeatStrideFieldNumber;
-const int ProposalParameter::kBaseSizeFieldNumber;
-const int ProposalParameter::kMinSizeFieldNumber;
-const int ProposalParameter::kRatioFieldNumber;
-const int ProposalParameter::kScaleFieldNumber;
-const int ProposalParameter::kPreNmsTopnFieldNumber;
-const int ProposalParameter::kPostNmsTopnFieldNumber;
-const int ProposalParameter::kNmsThreshFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ProposalParameter::ProposalParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsProposalParameter();
+class ProposalParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ProposalParameter>()._has_bits_);
+  static void set_has_feat_stride(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_base_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_min_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_pre_nms_topn(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_post_nms_topn(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
+  static void set_has_nms_thresh(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+};
+
+ProposalParameter::ProposalParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  ratio_(arena),
+  scale_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.ProposalParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.ProposalParameter)
 }
 ProposalParameter::ProposalParameter(const ProposalParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       ratio_(from.ratio_),
       scale_(from.scale_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&feat_stride_, &from.feat_stride_,
     static_cast<size_t>(reinterpret_cast<char*>(&nms_thresh_) -
     reinterpret_cast<char*>(&feat_stride_)) + sizeof(nms_thresh_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.ProposalParameter)
 }
 
-void ProposalParameter::SharedCtor() {
-  _cached_size_ = 0;
-  feat_stride_ = 16u;
-  base_size_ = 16u;
-  min_size_ = 16u;
-  pre_nms_topn_ = 6000u;
-  post_nms_topn_ = 300u;
-  nms_thresh_ = 0.7f;
+inline void ProposalParameter::SharedCtor() {
+feat_stride_ = 16u;
+base_size_ = 16u;
+min_size_ = 16u;
+pre_nms_topn_ = 6000u;
+post_nms_topn_ = 300u;
+nms_thresh_ = 0.7f;
 }
 
 ProposalParameter::~ProposalParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.ProposalParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ProposalParameter::SharedDtor() {
+inline void ProposalParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void ProposalParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ProposalParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void ProposalParameter::ArenaDtor(void* object) {
+  ProposalParameter* _this = reinterpret_cast< ProposalParameter* >(object);
+  (void)_this;
 }
-
-const ProposalParameter& ProposalParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsProposalParameter();
-  return *internal_default_instance();
+void ProposalParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ProposalParameter* ProposalParameter::New(::google::protobuf::Arena* arena) const {
-  ProposalParameter* n = new ProposalParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ProposalParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ProposalParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.ProposalParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   ratio_.Clear();
   scale_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     feat_stride_ = 16u;
     base_size_ = 16u;
     min_size_ = 16u;
@@ -40338,266 +33293,184 @@ void ProposalParameter::Clear() {
     nms_thresh_ = 0.7f;
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ProposalParameter::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:opencv_caffe.ProposalParameter)
-  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 uint32 feat_stride = 1 [default = 16];
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_feat_stride();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &feat_stride_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* ProposalParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional uint32 feat_stride = 1 [default = 16];
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_feat_stride(&has_bits);
+          feat_stride_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 base_size = 2 [default = 16];
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_base_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &base_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_base_size(&has_bits);
+          base_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 min_size = 3 [default = 16];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_min_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &min_size_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_min_size(&has_bits);
+          min_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated float ratio = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 37u, input, this->mutable_ratio())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_ratio())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 37)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_ratio(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<37>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 34) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_ratio(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // repeated float scale = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 45u, input, this->mutable_scale())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_scale())));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_scale(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<45>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 42) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_scale(), ptr, ctx);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 pre_nms_topn = 6 [default = 6000];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          set_has_pre_nms_topn();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &pre_nms_topn_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          _Internal::set_has_pre_nms_topn(&has_bits);
+          pre_nms_topn_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional uint32 post_nms_topn = 7 [default = 300];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          set_has_post_nms_topn();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
-                 input, &post_nms_topn_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
+          _Internal::set_has_post_nms_topn(&has_bits);
+          post_nms_topn_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // optional float nms_thresh = 8 [default = 0.7];
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(69u /* 69 & 0xFF */)) {
-          set_has_nms_thresh();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &nms_thresh_)));
-        } 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:opencv_caffe.ProposalParameter)
-  return true;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 69)) {
+          _Internal::set_has_nms_thresh(&has_bits);
+          nms_thresh_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.ProposalParameter)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void ProposalParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.ProposalParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* ProposalParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ProposalParameter)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional uint32 feat_stride = 1 [default = 16];
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->feat_stride(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_feat_stride(), target);
   }
 
   // optional uint32 base_size = 2 [default = 16];
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->base_size(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_base_size(), target);
   }
 
   // optional uint32 min_size = 3 [default = 16];
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->min_size(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_min_size(), target);
   }
 
   // repeated float ratio = 4;
-  for (int i = 0, n = this->ratio_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      4, this->ratio(i), output);
+  for (int i = 0, n = this->_internal_ratio_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_ratio(i), target);
   }
 
   // repeated float scale = 5;
-  for (int i = 0, n = this->scale_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      5, this->scale(i), output);
-  }
-
-  // optional uint32 pre_nms_topn = 6 [default = 6000];
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->pre_nms_topn(), output);
-  }
-
-  // optional uint32 post_nms_topn = 7 [default = 300];
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->post_nms_topn(), output);
-  }
-
-  // optional float nms_thresh = 8 [default = 0.7];
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->nms_thresh(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.ProposalParameter)
-}
-
-::google::protobuf::uint8* ProposalParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.ProposalParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional uint32 feat_stride = 1 [default = 16];
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->feat_stride(), target);
-  }
-
-  // optional uint32 base_size = 2 [default = 16];
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->base_size(), target);
+  for (int i = 0, n = this->_internal_scale_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->_internal_scale(i), target);
   }
 
-  // optional uint32 min_size = 3 [default = 16];
-  if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->min_size(), target);
-  }
-
-  // repeated float ratio = 4;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(4, this->ratio_, target);
-
-  // repeated float scale = 5;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(5, this->scale_, target);
-
   // optional uint32 pre_nms_topn = 6 [default = 6000];
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->pre_nms_topn(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->_internal_pre_nms_topn(), target);
   }
 
   // optional uint32 post_nms_topn = 7 [default = 300];
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->post_nms_topn(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_post_nms_topn(), target);
   }
 
   // optional float nms_thresh = 8 [default = 0.7];
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->nms_thresh(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(8, this->_internal_nms_thresh(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.ProposalParameter)
   return target;
@@ -40607,104 +33480,87 @@ size_t ProposalParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.ProposalParameter)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated float ratio = 4;
   {
-    unsigned int count = static_cast<unsigned int>(this->ratio_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_ratio_size());
     size_t data_size = 4UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->ratio_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_ratio_size());
     total_size += data_size;
   }
 
   // repeated float scale = 5;
   {
-    unsigned int count = static_cast<unsigned int>(this->scale_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_scale_size());
     size_t data_size = 4UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->scale_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_scale_size());
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 63u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000003fu) {
     // optional uint32 feat_stride = 1 [default = 16];
-    if (has_feat_stride()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->feat_stride());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_feat_stride());
     }
 
     // optional uint32 base_size = 2 [default = 16];
-    if (has_base_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->base_size());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_base_size());
     }
 
     // optional uint32 min_size = 3 [default = 16];
-    if (has_min_size()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->min_size());
+    if (cached_has_bits & 0x00000004u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_min_size());
     }
 
     // optional uint32 pre_nms_topn = 6 [default = 6000];
-    if (has_pre_nms_topn()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->pre_nms_topn());
+    if (cached_has_bits & 0x00000008u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_pre_nms_topn());
     }
 
     // optional uint32 post_nms_topn = 7 [default = 300];
-    if (has_post_nms_topn()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::UInt32Size(
-          this->post_nms_topn());
+    if (cached_has_bits & 0x00000010u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_post_nms_topn());
     }
 
     // optional float nms_thresh = 8 [default = 0.7];
-    if (has_nms_thresh()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 + 4;
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ProposalParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.ProposalParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ProposalParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ProposalParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.ProposalParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.ProposalParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ProposalParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ProposalParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ProposalParameter::GetClassData() const { return &_class_data_; }
+
+void ProposalParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ProposalParameter *>(to)->MergeFrom(
+      static_cast<const ProposalParameter &>(from));
 }
 
+
 void ProposalParameter::MergeFrom(const ProposalParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.ProposalParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   ratio_.MergeFrom(from.ratio_);
   scale_.MergeFrom(from.scale_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
       feat_stride_ = from.feat_stride_;
     }
@@ -40725,13 +33581,7 @@ void ProposalParameter::MergeFrom(const ProposalParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ProposalParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.ProposalParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ProposalParameter::CopyFrom(const ProposalParameter& from) {
@@ -40745,12 +33595,10 @@ bool ProposalParameter::IsInitialized() const {
   return true;
 }
 
-void ProposalParameter::Swap(ProposalParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ProposalParameter::InternalSwap(ProposalParameter* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   ratio_.InternalSwap(&other->ratio_);
   scale_.InternalSwap(&other->scale_);
   swap(feat_stride_, other->feat_stride_);
@@ -40759,228 +33607,182 @@ void ProposalParameter::InternalSwap(ProposalParameter* other) {
   swap(pre_nms_topn_, other->pre_nms_topn_);
   swap(post_nms_topn_, other->post_nms_topn_);
   swap(nms_thresh_, other->nms_thresh_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata ProposalParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ProposalParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[69]);
 }
 
-
 // ===================================================================
 
-void PSROIPoolingParameter::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int PSROIPoolingParameter::kSpatialScaleFieldNumber;
-const int PSROIPoolingParameter::kOutputDimFieldNumber;
-const int PSROIPoolingParameter::kGroupSizeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-PSROIPoolingParameter::PSROIPoolingParameter()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPSROIPoolingParameter();
+class PSROIPoolingParameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<PSROIPoolingParameter>()._has_bits_);
+  static void set_has_spatial_scale(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_output_dim(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_group_size(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static bool MissingRequiredFields(const HasBits& has_bits) {
+    return ((has_bits[0] & 0x00000007) ^ 0x00000007) != 0;
+  }
+};
+
+PSROIPoolingParameter::PSROIPoolingParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_caffe.PSROIPoolingParameter)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_caffe.PSROIPoolingParameter)
 }
 PSROIPoolingParameter::PSROIPoolingParameter(const PSROIPoolingParameter& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&spatial_scale_, &from.spatial_scale_,
     static_cast<size_t>(reinterpret_cast<char*>(&group_size_) -
     reinterpret_cast<char*>(&spatial_scale_)) + sizeof(group_size_));
   // @@protoc_insertion_point(copy_constructor:opencv_caffe.PSROIPoolingParameter)
 }
 
-void PSROIPoolingParameter::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&spatial_scale_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&group_size_) -
-      reinterpret_cast<char*>(&spatial_scale_)) + sizeof(group_size_));
+inline void PSROIPoolingParameter::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&spatial_scale_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&group_size_) -
+    reinterpret_cast<char*>(&spatial_scale_)) + sizeof(group_size_));
 }
 
 PSROIPoolingParameter::~PSROIPoolingParameter() {
   // @@protoc_insertion_point(destructor:opencv_caffe.PSROIPoolingParameter)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void PSROIPoolingParameter::SharedDtor() {
+inline void PSROIPoolingParameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void PSROIPoolingParameter::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* PSROIPoolingParameter::descriptor() {
-  ::protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void PSROIPoolingParameter::ArenaDtor(void* object) {
+  PSROIPoolingParameter* _this = reinterpret_cast< PSROIPoolingParameter* >(object);
+  (void)_this;
 }
-
-const PSROIPoolingParameter& PSROIPoolingParameter::default_instance() {
-  ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPSROIPoolingParameter();
-  return *internal_default_instance();
+void PSROIPoolingParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-PSROIPoolingParameter* PSROIPoolingParameter::New(::google::protobuf::Arena* arena) const {
-  PSROIPoolingParameter* n = new PSROIPoolingParameter;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void PSROIPoolingParameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void PSROIPoolingParameter::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_caffe.PSROIPoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     ::memset(&spatial_scale_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&group_size_) -
         reinterpret_cast<char*>(&spatial_scale_)) + sizeof(group_size_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool PSROIPoolingParameter::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:opencv_caffe.PSROIPoolingParameter)
-  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)) {
-      // required float spatial_scale = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) {
-          set_has_spatial_scale();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &spatial_scale_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
 
+const char* PSROIPoolingParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // required float spatial_scale = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
+          _Internal::set_has_spatial_scale(&has_bits);
+          spatial_scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
+          goto handle_unusual;
+        continue;
       // required int32 output_dim = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_output_dim();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &output_dim_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_output_dim(&has_bits);
+          output_dim_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
       // required int32 group_size = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_group_size();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &group_size_)));
-        } 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:opencv_caffe.PSROIPoolingParameter)
-  return true;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_group_size(&has_bits);
+          group_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_caffe.PSROIPoolingParameter)
-  return false;
-#undef DO_
-}
-
-void PSROIPoolingParameter::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_caffe.PSROIPoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required float spatial_scale = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->spatial_scale(), output);
-  }
-
-  // required int32 output_dim = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->output_dim(), output);
-  }
-
-  // required int32 group_size = 3;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->group_size(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_caffe.PSROIPoolingParameter)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* PSROIPoolingParameter::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* PSROIPoolingParameter::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_caffe.PSROIPoolingParameter)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // required float spatial_scale = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->spatial_scale(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_spatial_scale(), target);
   }
 
   // required int32 output_dim = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->output_dim(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_output_dim(), target);
   }
 
   // required int32 group_size = 3;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->group_size(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_group_size(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_caffe.PSROIPoolingParameter)
   return target;
@@ -40990,23 +33792,19 @@ size_t PSROIPoolingParameter::RequiredFieldsByteSizeFallback() const {
 // @@protoc_insertion_point(required_fields_byte_size_fallback_start:opencv_caffe.PSROIPoolingParameter)
   size_t total_size = 0;
 
-  if (has_spatial_scale()) {
+  if (_internal_has_spatial_scale()) {
     // required float spatial_scale = 1;
     total_size += 1 + 4;
   }
 
-  if (has_output_dim()) {
+  if (_internal_has_output_dim()) {
     // required int32 output_dim = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->output_dim());
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_output_dim());
   }
 
-  if (has_group_size()) {
+  if (_internal_has_group_size()) {
     // required int32 group_size = 3;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->group_size());
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_group_size());
   }
 
   return total_size;
@@ -41015,59 +33813,47 @@ size_t PSROIPoolingParameter::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_caffe.PSROIPoolingParameter)
   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] & 0x00000007) ^ 0x00000007) == 0) {  // All required fields are present.
     // required float spatial_scale = 1;
     total_size += 1 + 4;
 
     // required int32 output_dim = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->output_dim());
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_output_dim());
 
     // required int32 group_size = 3;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->group_size());
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_group_size());
 
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
-  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;
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void PSROIPoolingParameter::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_caffe.PSROIPoolingParameter)
-  GOOGLE_DCHECK_NE(&from, this);
-  const PSROIPoolingParameter* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const PSROIPoolingParameter>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_caffe.PSROIPoolingParameter)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_caffe.PSROIPoolingParameter)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PSROIPoolingParameter::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    PSROIPoolingParameter::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PSROIPoolingParameter::GetClassData() const { return &_class_data_; }
+
+void PSROIPoolingParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<PSROIPoolingParameter *>(to)->MergeFrom(
+      static_cast<const PSROIPoolingParameter &>(from));
 }
 
+
 void PSROIPoolingParameter::MergeFrom(const PSROIPoolingParameter& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_caffe.PSROIPoolingParameter)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
       spatial_scale_ = from.spatial_scale_;
     }
@@ -41079,13 +33865,7 @@ void PSROIPoolingParameter::MergeFrom(const PSROIPoolingParameter& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void PSROIPoolingParameter::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_caffe.PSROIPoolingParameter)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void PSROIPoolingParameter::CopyFrom(const PSROIPoolingParameter& from) {
@@ -41096,31 +33876,245 @@ void PSROIPoolingParameter::CopyFrom(const PSROIPoolingParameter& from) {
 }
 
 bool PSROIPoolingParameter::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
+  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
   return true;
 }
 
-void PSROIPoolingParameter::Swap(PSROIPoolingParameter* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void PSROIPoolingParameter::InternalSwap(PSROIPoolingParameter* other) {
   using std::swap;
-  swap(spatial_scale_, other->spatial_scale_);
-  swap(output_dim_, other->output_dim_);
-  swap(group_size_, other->group_size_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(PSROIPoolingParameter, group_size_)
+      + sizeof(PSROIPoolingParameter::group_size_)
+      - PROTOBUF_FIELD_OFFSET(PSROIPoolingParameter, spatial_scale_)>(
+          reinterpret_cast<char*>(&spatial_scale_),
+          reinterpret_cast<char*>(&other->spatial_scale_));
 }
 
-::google::protobuf::Metadata PSROIPoolingParameter::GetMetadata() const {
-  protobuf_opencv_2dcaffe_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2dcaffe_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata PSROIPoolingParameter::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2dcaffe_2eproto_getter, &descriptor_table_opencv_2dcaffe_2eproto_once,
+      file_level_metadata_opencv_2dcaffe_2eproto[70]);
 }
 
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_caffe
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_caffe::BlobShape* Arena::CreateMaybeMessage< ::opencv_caffe::BlobShape >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::BlobShape >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::BlobProto* Arena::CreateMaybeMessage< ::opencv_caffe::BlobProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::BlobProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::BlobProtoVector* Arena::CreateMaybeMessage< ::opencv_caffe::BlobProtoVector >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::BlobProtoVector >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::PermuteParameter* Arena::CreateMaybeMessage< ::opencv_caffe::PermuteParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::PermuteParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::NormalizeBBoxParameter* Arena::CreateMaybeMessage< ::opencv_caffe::NormalizeBBoxParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::NormalizeBBoxParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::PriorBoxParameter* Arena::CreateMaybeMessage< ::opencv_caffe::PriorBoxParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::PriorBoxParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::DetectionOutputParameter* Arena::CreateMaybeMessage< ::opencv_caffe::DetectionOutputParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::DetectionOutputParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::Datum* Arena::CreateMaybeMessage< ::opencv_caffe::Datum >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::Datum >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::FillerParameter* Arena::CreateMaybeMessage< ::opencv_caffe::FillerParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::FillerParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::NetParameter* Arena::CreateMaybeMessage< ::opencv_caffe::NetParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::NetParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::SolverParameter* Arena::CreateMaybeMessage< ::opencv_caffe::SolverParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::SolverParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::SolverState* Arena::CreateMaybeMessage< ::opencv_caffe::SolverState >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::SolverState >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::NetState* Arena::CreateMaybeMessage< ::opencv_caffe::NetState >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::NetState >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::NetStateRule* Arena::CreateMaybeMessage< ::opencv_caffe::NetStateRule >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::NetStateRule >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ParamSpec* Arena::CreateMaybeMessage< ::opencv_caffe::ParamSpec >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ParamSpec >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::LayerParameter* Arena::CreateMaybeMessage< ::opencv_caffe::LayerParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::LayerParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::TransformationParameter* Arena::CreateMaybeMessage< ::opencv_caffe::TransformationParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::TransformationParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::LossParameter* Arena::CreateMaybeMessage< ::opencv_caffe::LossParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::LossParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::AccuracyParameter* Arena::CreateMaybeMessage< ::opencv_caffe::AccuracyParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::AccuracyParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ArgMaxParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ArgMaxParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ArgMaxParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ConcatParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ConcatParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ConcatParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::BatchNormParameter* Arena::CreateMaybeMessage< ::opencv_caffe::BatchNormParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::BatchNormParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::BiasParameter* Arena::CreateMaybeMessage< ::opencv_caffe::BiasParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::BiasParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ContrastiveLossParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ContrastiveLossParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ContrastiveLossParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ConvolutionParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ConvolutionParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ConvolutionParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::CropParameter* Arena::CreateMaybeMessage< ::opencv_caffe::CropParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::CropParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::DataParameter* Arena::CreateMaybeMessage< ::opencv_caffe::DataParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::DataParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::NonMaximumSuppressionParameter* Arena::CreateMaybeMessage< ::opencv_caffe::NonMaximumSuppressionParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::NonMaximumSuppressionParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::SaveOutputParameter* Arena::CreateMaybeMessage< ::opencv_caffe::SaveOutputParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::SaveOutputParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::DropoutParameter* Arena::CreateMaybeMessage< ::opencv_caffe::DropoutParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::DropoutParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::DummyDataParameter* Arena::CreateMaybeMessage< ::opencv_caffe::DummyDataParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::DummyDataParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::EltwiseParameter* Arena::CreateMaybeMessage< ::opencv_caffe::EltwiseParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::EltwiseParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ELUParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ELUParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ELUParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::EmbedParameter* Arena::CreateMaybeMessage< ::opencv_caffe::EmbedParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::EmbedParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ExpParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ExpParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ExpParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::FlattenParameter* Arena::CreateMaybeMessage< ::opencv_caffe::FlattenParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::FlattenParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::HDF5DataParameter* Arena::CreateMaybeMessage< ::opencv_caffe::HDF5DataParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::HDF5DataParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::HDF5OutputParameter* Arena::CreateMaybeMessage< ::opencv_caffe::HDF5OutputParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::HDF5OutputParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::HingeLossParameter* Arena::CreateMaybeMessage< ::opencv_caffe::HingeLossParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::HingeLossParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ImageDataParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ImageDataParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ImageDataParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::InfogainLossParameter* Arena::CreateMaybeMessage< ::opencv_caffe::InfogainLossParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::InfogainLossParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::InnerProductParameter* Arena::CreateMaybeMessage< ::opencv_caffe::InnerProductParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::InnerProductParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::InputParameter* Arena::CreateMaybeMessage< ::opencv_caffe::InputParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::InputParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::LogParameter* Arena::CreateMaybeMessage< ::opencv_caffe::LogParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::LogParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::LRNParameter* Arena::CreateMaybeMessage< ::opencv_caffe::LRNParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::LRNParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::MemoryDataParameter* Arena::CreateMaybeMessage< ::opencv_caffe::MemoryDataParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::MemoryDataParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::MVNParameter* Arena::CreateMaybeMessage< ::opencv_caffe::MVNParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::MVNParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ParameterParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ParameterParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ParameterParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::PoolingParameter* Arena::CreateMaybeMessage< ::opencv_caffe::PoolingParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::PoolingParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::PowerParameter* Arena::CreateMaybeMessage< ::opencv_caffe::PowerParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::PowerParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::PythonParameter* Arena::CreateMaybeMessage< ::opencv_caffe::PythonParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::PythonParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::RecurrentParameter* Arena::CreateMaybeMessage< ::opencv_caffe::RecurrentParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::RecurrentParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ReductionParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ReductionParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ReductionParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ReLUParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ReLUParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ReLUParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ReshapeParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ReshapeParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ReshapeParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ScaleParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ScaleParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ScaleParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::SigmoidParameter* Arena::CreateMaybeMessage< ::opencv_caffe::SigmoidParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::SigmoidParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::SliceParameter* Arena::CreateMaybeMessage< ::opencv_caffe::SliceParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::SliceParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::SoftmaxParameter* Arena::CreateMaybeMessage< ::opencv_caffe::SoftmaxParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::SoftmaxParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::TanHParameter* Arena::CreateMaybeMessage< ::opencv_caffe::TanHParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::TanHParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::TileParameter* Arena::CreateMaybeMessage< ::opencv_caffe::TileParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::TileParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ThresholdParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ThresholdParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ThresholdParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::WindowDataParameter* Arena::CreateMaybeMessage< ::opencv_caffe::WindowDataParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::WindowDataParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::SPPParameter* Arena::CreateMaybeMessage< ::opencv_caffe::SPPParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::SPPParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::V1LayerParameter* Arena::CreateMaybeMessage< ::opencv_caffe::V1LayerParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::V1LayerParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::V0LayerParameter* Arena::CreateMaybeMessage< ::opencv_caffe::V0LayerParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::V0LayerParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::PReLUParameter* Arena::CreateMaybeMessage< ::opencv_caffe::PReLUParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::PReLUParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::NormalizedBBox* Arena::CreateMaybeMessage< ::opencv_caffe::NormalizedBBox >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::NormalizedBBox >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ROIPoolingParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ROIPoolingParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ROIPoolingParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::ProposalParameter* Arena::CreateMaybeMessage< ::opencv_caffe::ProposalParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::ProposalParameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_caffe::PSROIPoolingParameter* Arena::CreateMaybeMessage< ::opencv_caffe::PSROIPoolingParameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_caffe::PSROIPoolingParameter >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index 923ca7f..74ec5ca 100644 (file)
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: opencv-caffe.proto
 
-#ifndef PROTOBUF_opencv_2dcaffe_2eproto__INCLUDED
-#define PROTOBUF_opencv_2dcaffe_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_opencv_2dcaffe_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_opencv_2dcaffe_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include <google/protobuf/generated_enum_reflection.h>
 #include <google/protobuf/unknown_field_set.h>
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_opencv_2dcaffe_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_opencv_2dcaffe_2eproto {
 // Internal implementation detail -- do not use these members.
-struct TableStruct {
-  static const ::google::protobuf::internal::ParseTableField entries[];
-  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  static const ::google::protobuf::internal::ParseTable schema[71];
-  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
-  static const ::google::protobuf::internal::SerializationTable serialization_table[];
-  static const ::google::protobuf::uint32 offsets[];
+struct TableStruct_opencv_2dcaffe_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[71]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsBlobShapeImpl();
-void InitDefaultsBlobShape();
-void InitDefaultsBlobProtoImpl();
-void InitDefaultsBlobProto();
-void InitDefaultsBlobProtoVectorImpl();
-void InitDefaultsBlobProtoVector();
-void InitDefaultsPermuteParameterImpl();
-void InitDefaultsPermuteParameter();
-void InitDefaultsNormalizeBBoxParameterImpl();
-void InitDefaultsNormalizeBBoxParameter();
-void InitDefaultsPriorBoxParameterImpl();
-void InitDefaultsPriorBoxParameter();
-void InitDefaultsDetectionOutputParameterImpl();
-void InitDefaultsDetectionOutputParameter();
-void InitDefaultsDatumImpl();
-void InitDefaultsDatum();
-void InitDefaultsFillerParameterImpl();
-void InitDefaultsFillerParameter();
-void InitDefaultsNetParameterImpl();
-void InitDefaultsNetParameter();
-void InitDefaultsSolverParameterImpl();
-void InitDefaultsSolverParameter();
-void InitDefaultsSolverStateImpl();
-void InitDefaultsSolverState();
-void InitDefaultsNetStateImpl();
-void InitDefaultsNetState();
-void InitDefaultsNetStateRuleImpl();
-void InitDefaultsNetStateRule();
-void InitDefaultsParamSpecImpl();
-void InitDefaultsParamSpec();
-void InitDefaultsLayerParameterImpl();
-void InitDefaultsLayerParameter();
-void InitDefaultsTransformationParameterImpl();
-void InitDefaultsTransformationParameter();
-void InitDefaultsLossParameterImpl();
-void InitDefaultsLossParameter();
-void InitDefaultsAccuracyParameterImpl();
-void InitDefaultsAccuracyParameter();
-void InitDefaultsArgMaxParameterImpl();
-void InitDefaultsArgMaxParameter();
-void InitDefaultsConcatParameterImpl();
-void InitDefaultsConcatParameter();
-void InitDefaultsBatchNormParameterImpl();
-void InitDefaultsBatchNormParameter();
-void InitDefaultsBiasParameterImpl();
-void InitDefaultsBiasParameter();
-void InitDefaultsContrastiveLossParameterImpl();
-void InitDefaultsContrastiveLossParameter();
-void InitDefaultsConvolutionParameterImpl();
-void InitDefaultsConvolutionParameter();
-void InitDefaultsCropParameterImpl();
-void InitDefaultsCropParameter();
-void InitDefaultsDataParameterImpl();
-void InitDefaultsDataParameter();
-void InitDefaultsNonMaximumSuppressionParameterImpl();
-void InitDefaultsNonMaximumSuppressionParameter();
-void InitDefaultsSaveOutputParameterImpl();
-void InitDefaultsSaveOutputParameter();
-void InitDefaultsDropoutParameterImpl();
-void InitDefaultsDropoutParameter();
-void InitDefaultsDummyDataParameterImpl();
-void InitDefaultsDummyDataParameter();
-void InitDefaultsEltwiseParameterImpl();
-void InitDefaultsEltwiseParameter();
-void InitDefaultsELUParameterImpl();
-void InitDefaultsELUParameter();
-void InitDefaultsEmbedParameterImpl();
-void InitDefaultsEmbedParameter();
-void InitDefaultsExpParameterImpl();
-void InitDefaultsExpParameter();
-void InitDefaultsFlattenParameterImpl();
-void InitDefaultsFlattenParameter();
-void InitDefaultsHDF5DataParameterImpl();
-void InitDefaultsHDF5DataParameter();
-void InitDefaultsHDF5OutputParameterImpl();
-void InitDefaultsHDF5OutputParameter();
-void InitDefaultsHingeLossParameterImpl();
-void InitDefaultsHingeLossParameter();
-void InitDefaultsImageDataParameterImpl();
-void InitDefaultsImageDataParameter();
-void InitDefaultsInfogainLossParameterImpl();
-void InitDefaultsInfogainLossParameter();
-void InitDefaultsInnerProductParameterImpl();
-void InitDefaultsInnerProductParameter();
-void InitDefaultsInputParameterImpl();
-void InitDefaultsInputParameter();
-void InitDefaultsLogParameterImpl();
-void InitDefaultsLogParameter();
-void InitDefaultsLRNParameterImpl();
-void InitDefaultsLRNParameter();
-void InitDefaultsMemoryDataParameterImpl();
-void InitDefaultsMemoryDataParameter();
-void InitDefaultsMVNParameterImpl();
-void InitDefaultsMVNParameter();
-void InitDefaultsParameterParameterImpl();
-void InitDefaultsParameterParameter();
-void InitDefaultsPoolingParameterImpl();
-void InitDefaultsPoolingParameter();
-void InitDefaultsPowerParameterImpl();
-void InitDefaultsPowerParameter();
-void InitDefaultsPythonParameterImpl();
-void InitDefaultsPythonParameter();
-void InitDefaultsRecurrentParameterImpl();
-void InitDefaultsRecurrentParameter();
-void InitDefaultsReductionParameterImpl();
-void InitDefaultsReductionParameter();
-void InitDefaultsReLUParameterImpl();
-void InitDefaultsReLUParameter();
-void InitDefaultsReshapeParameterImpl();
-void InitDefaultsReshapeParameter();
-void InitDefaultsScaleParameterImpl();
-void InitDefaultsScaleParameter();
-void InitDefaultsSigmoidParameterImpl();
-void InitDefaultsSigmoidParameter();
-void InitDefaultsSliceParameterImpl();
-void InitDefaultsSliceParameter();
-void InitDefaultsSoftmaxParameterImpl();
-void InitDefaultsSoftmaxParameter();
-void InitDefaultsTanHParameterImpl();
-void InitDefaultsTanHParameter();
-void InitDefaultsTileParameterImpl();
-void InitDefaultsTileParameter();
-void InitDefaultsThresholdParameterImpl();
-void InitDefaultsThresholdParameter();
-void InitDefaultsWindowDataParameterImpl();
-void InitDefaultsWindowDataParameter();
-void InitDefaultsSPPParameterImpl();
-void InitDefaultsSPPParameter();
-void InitDefaultsV1LayerParameterImpl();
-void InitDefaultsV1LayerParameter();
-void InitDefaultsV0LayerParameterImpl();
-void InitDefaultsV0LayerParameter();
-void InitDefaultsPReLUParameterImpl();
-void InitDefaultsPReLUParameter();
-void InitDefaultsNormalizedBBoxImpl();
-void InitDefaultsNormalizedBBox();
-void InitDefaultsROIPoolingParameterImpl();
-void InitDefaultsROIPoolingParameter();
-void InitDefaultsProposalParameterImpl();
-void InitDefaultsProposalParameter();
-void InitDefaultsPSROIPoolingParameterImpl();
-void InitDefaultsPSROIPoolingParameter();
-inline void InitDefaults() {
-  InitDefaultsBlobShape();
-  InitDefaultsBlobProto();
-  InitDefaultsBlobProtoVector();
-  InitDefaultsPermuteParameter();
-  InitDefaultsNormalizeBBoxParameter();
-  InitDefaultsPriorBoxParameter();
-  InitDefaultsDetectionOutputParameter();
-  InitDefaultsDatum();
-  InitDefaultsFillerParameter();
-  InitDefaultsNetParameter();
-  InitDefaultsSolverParameter();
-  InitDefaultsSolverState();
-  InitDefaultsNetState();
-  InitDefaultsNetStateRule();
-  InitDefaultsParamSpec();
-  InitDefaultsLayerParameter();
-  InitDefaultsTransformationParameter();
-  InitDefaultsLossParameter();
-  InitDefaultsAccuracyParameter();
-  InitDefaultsArgMaxParameter();
-  InitDefaultsConcatParameter();
-  InitDefaultsBatchNormParameter();
-  InitDefaultsBiasParameter();
-  InitDefaultsContrastiveLossParameter();
-  InitDefaultsConvolutionParameter();
-  InitDefaultsCropParameter();
-  InitDefaultsDataParameter();
-  InitDefaultsNonMaximumSuppressionParameter();
-  InitDefaultsSaveOutputParameter();
-  InitDefaultsDropoutParameter();
-  InitDefaultsDummyDataParameter();
-  InitDefaultsEltwiseParameter();
-  InitDefaultsELUParameter();
-  InitDefaultsEmbedParameter();
-  InitDefaultsExpParameter();
-  InitDefaultsFlattenParameter();
-  InitDefaultsHDF5DataParameter();
-  InitDefaultsHDF5OutputParameter();
-  InitDefaultsHingeLossParameter();
-  InitDefaultsImageDataParameter();
-  InitDefaultsInfogainLossParameter();
-  InitDefaultsInnerProductParameter();
-  InitDefaultsInputParameter();
-  InitDefaultsLogParameter();
-  InitDefaultsLRNParameter();
-  InitDefaultsMemoryDataParameter();
-  InitDefaultsMVNParameter();
-  InitDefaultsParameterParameter();
-  InitDefaultsPoolingParameter();
-  InitDefaultsPowerParameter();
-  InitDefaultsPythonParameter();
-  InitDefaultsRecurrentParameter();
-  InitDefaultsReductionParameter();
-  InitDefaultsReLUParameter();
-  InitDefaultsReshapeParameter();
-  InitDefaultsScaleParameter();
-  InitDefaultsSigmoidParameter();
-  InitDefaultsSliceParameter();
-  InitDefaultsSoftmaxParameter();
-  InitDefaultsTanHParameter();
-  InitDefaultsTileParameter();
-  InitDefaultsThresholdParameter();
-  InitDefaultsWindowDataParameter();
-  InitDefaultsSPPParameter();
-  InitDefaultsV1LayerParameter();
-  InitDefaultsV0LayerParameter();
-  InitDefaultsPReLUParameter();
-  InitDefaultsNormalizedBBox();
-  InitDefaultsROIPoolingParameter();
-  InitDefaultsProposalParameter();
-  InitDefaultsPSROIPoolingParameter();
-}
-}  // namespace protobuf_opencv_2dcaffe_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_opencv_2dcaffe_2eproto;
 namespace opencv_caffe {
 class AccuracyParameter;
-class AccuracyParameterDefaultTypeInternal;
+struct AccuracyParameterDefaultTypeInternal;
 extern AccuracyParameterDefaultTypeInternal _AccuracyParameter_default_instance_;
 class ArgMaxParameter;
-class ArgMaxParameterDefaultTypeInternal;
+struct ArgMaxParameterDefaultTypeInternal;
 extern ArgMaxParameterDefaultTypeInternal _ArgMaxParameter_default_instance_;
 class BatchNormParameter;
-class BatchNormParameterDefaultTypeInternal;
+struct BatchNormParameterDefaultTypeInternal;
 extern BatchNormParameterDefaultTypeInternal _BatchNormParameter_default_instance_;
 class BiasParameter;
-class BiasParameterDefaultTypeInternal;
+struct BiasParameterDefaultTypeInternal;
 extern BiasParameterDefaultTypeInternal _BiasParameter_default_instance_;
 class BlobProto;
-class BlobProtoDefaultTypeInternal;
+struct BlobProtoDefaultTypeInternal;
 extern BlobProtoDefaultTypeInternal _BlobProto_default_instance_;
 class BlobProtoVector;
-class BlobProtoVectorDefaultTypeInternal;
+struct BlobProtoVectorDefaultTypeInternal;
 extern BlobProtoVectorDefaultTypeInternal _BlobProtoVector_default_instance_;
 class BlobShape;
-class BlobShapeDefaultTypeInternal;
+struct BlobShapeDefaultTypeInternal;
 extern BlobShapeDefaultTypeInternal _BlobShape_default_instance_;
 class ConcatParameter;
-class ConcatParameterDefaultTypeInternal;
+struct ConcatParameterDefaultTypeInternal;
 extern ConcatParameterDefaultTypeInternal _ConcatParameter_default_instance_;
 class ContrastiveLossParameter;
-class ContrastiveLossParameterDefaultTypeInternal;
+struct ContrastiveLossParameterDefaultTypeInternal;
 extern ContrastiveLossParameterDefaultTypeInternal _ContrastiveLossParameter_default_instance_;
 class ConvolutionParameter;
-class ConvolutionParameterDefaultTypeInternal;
+struct ConvolutionParameterDefaultTypeInternal;
 extern ConvolutionParameterDefaultTypeInternal _ConvolutionParameter_default_instance_;
 class CropParameter;
-class CropParameterDefaultTypeInternal;
+struct CropParameterDefaultTypeInternal;
 extern CropParameterDefaultTypeInternal _CropParameter_default_instance_;
 class DataParameter;
-class DataParameterDefaultTypeInternal;
+struct DataParameterDefaultTypeInternal;
 extern DataParameterDefaultTypeInternal _DataParameter_default_instance_;
 class Datum;
-class DatumDefaultTypeInternal;
+struct DatumDefaultTypeInternal;
 extern DatumDefaultTypeInternal _Datum_default_instance_;
 class DetectionOutputParameter;
-class DetectionOutputParameterDefaultTypeInternal;
+struct DetectionOutputParameterDefaultTypeInternal;
 extern DetectionOutputParameterDefaultTypeInternal _DetectionOutputParameter_default_instance_;
 class DropoutParameter;
-class DropoutParameterDefaultTypeInternal;
+struct DropoutParameterDefaultTypeInternal;
 extern DropoutParameterDefaultTypeInternal _DropoutParameter_default_instance_;
 class DummyDataParameter;
-class DummyDataParameterDefaultTypeInternal;
+struct DummyDataParameterDefaultTypeInternal;
 extern DummyDataParameterDefaultTypeInternal _DummyDataParameter_default_instance_;
 class ELUParameter;
-class ELUParameterDefaultTypeInternal;
+struct ELUParameterDefaultTypeInternal;
 extern ELUParameterDefaultTypeInternal _ELUParameter_default_instance_;
 class EltwiseParameter;
-class EltwiseParameterDefaultTypeInternal;
+struct EltwiseParameterDefaultTypeInternal;
 extern EltwiseParameterDefaultTypeInternal _EltwiseParameter_default_instance_;
 class EmbedParameter;
-class EmbedParameterDefaultTypeInternal;
+struct EmbedParameterDefaultTypeInternal;
 extern EmbedParameterDefaultTypeInternal _EmbedParameter_default_instance_;
 class ExpParameter;
-class ExpParameterDefaultTypeInternal;
+struct ExpParameterDefaultTypeInternal;
 extern ExpParameterDefaultTypeInternal _ExpParameter_default_instance_;
 class FillerParameter;
-class FillerParameterDefaultTypeInternal;
+struct FillerParameterDefaultTypeInternal;
 extern FillerParameterDefaultTypeInternal _FillerParameter_default_instance_;
 class FlattenParameter;
-class FlattenParameterDefaultTypeInternal;
+struct FlattenParameterDefaultTypeInternal;
 extern FlattenParameterDefaultTypeInternal _FlattenParameter_default_instance_;
 class HDF5DataParameter;
-class HDF5DataParameterDefaultTypeInternal;
+struct HDF5DataParameterDefaultTypeInternal;
 extern HDF5DataParameterDefaultTypeInternal _HDF5DataParameter_default_instance_;
 class HDF5OutputParameter;
-class HDF5OutputParameterDefaultTypeInternal;
+struct HDF5OutputParameterDefaultTypeInternal;
 extern HDF5OutputParameterDefaultTypeInternal _HDF5OutputParameter_default_instance_;
 class HingeLossParameter;
-class HingeLossParameterDefaultTypeInternal;
+struct HingeLossParameterDefaultTypeInternal;
 extern HingeLossParameterDefaultTypeInternal _HingeLossParameter_default_instance_;
 class ImageDataParameter;
-class ImageDataParameterDefaultTypeInternal;
+struct ImageDataParameterDefaultTypeInternal;
 extern ImageDataParameterDefaultTypeInternal _ImageDataParameter_default_instance_;
 class InfogainLossParameter;
-class InfogainLossParameterDefaultTypeInternal;
+struct InfogainLossParameterDefaultTypeInternal;
 extern InfogainLossParameterDefaultTypeInternal _InfogainLossParameter_default_instance_;
 class InnerProductParameter;
-class InnerProductParameterDefaultTypeInternal;
+struct InnerProductParameterDefaultTypeInternal;
 extern InnerProductParameterDefaultTypeInternal _InnerProductParameter_default_instance_;
 class InputParameter;
-class InputParameterDefaultTypeInternal;
+struct InputParameterDefaultTypeInternal;
 extern InputParameterDefaultTypeInternal _InputParameter_default_instance_;
 class LRNParameter;
-class LRNParameterDefaultTypeInternal;
+struct LRNParameterDefaultTypeInternal;
 extern LRNParameterDefaultTypeInternal _LRNParameter_default_instance_;
 class LayerParameter;
-class LayerParameterDefaultTypeInternal;
+struct LayerParameterDefaultTypeInternal;
 extern LayerParameterDefaultTypeInternal _LayerParameter_default_instance_;
 class LogParameter;
-class LogParameterDefaultTypeInternal;
+struct LogParameterDefaultTypeInternal;
 extern LogParameterDefaultTypeInternal _LogParameter_default_instance_;
 class LossParameter;
-class LossParameterDefaultTypeInternal;
+struct LossParameterDefaultTypeInternal;
 extern LossParameterDefaultTypeInternal _LossParameter_default_instance_;
 class MVNParameter;
-class MVNParameterDefaultTypeInternal;
+struct MVNParameterDefaultTypeInternal;
 extern MVNParameterDefaultTypeInternal _MVNParameter_default_instance_;
 class MemoryDataParameter;
-class MemoryDataParameterDefaultTypeInternal;
+struct MemoryDataParameterDefaultTypeInternal;
 extern MemoryDataParameterDefaultTypeInternal _MemoryDataParameter_default_instance_;
 class NetParameter;
-class NetParameterDefaultTypeInternal;
+struct NetParameterDefaultTypeInternal;
 extern NetParameterDefaultTypeInternal _NetParameter_default_instance_;
 class NetState;
-class NetStateDefaultTypeInternal;
+struct NetStateDefaultTypeInternal;
 extern NetStateDefaultTypeInternal _NetState_default_instance_;
 class NetStateRule;
-class NetStateRuleDefaultTypeInternal;
+struct NetStateRuleDefaultTypeInternal;
 extern NetStateRuleDefaultTypeInternal _NetStateRule_default_instance_;
 class NonMaximumSuppressionParameter;
-class NonMaximumSuppressionParameterDefaultTypeInternal;
+struct NonMaximumSuppressionParameterDefaultTypeInternal;
 extern NonMaximumSuppressionParameterDefaultTypeInternal _NonMaximumSuppressionParameter_default_instance_;
 class NormalizeBBoxParameter;
-class NormalizeBBoxParameterDefaultTypeInternal;
+struct NormalizeBBoxParameterDefaultTypeInternal;
 extern NormalizeBBoxParameterDefaultTypeInternal _NormalizeBBoxParameter_default_instance_;
 class NormalizedBBox;
-class NormalizedBBoxDefaultTypeInternal;
+struct NormalizedBBoxDefaultTypeInternal;
 extern NormalizedBBoxDefaultTypeInternal _NormalizedBBox_default_instance_;
 class PReLUParameter;
-class PReLUParameterDefaultTypeInternal;
+struct PReLUParameterDefaultTypeInternal;
 extern PReLUParameterDefaultTypeInternal _PReLUParameter_default_instance_;
 class PSROIPoolingParameter;
-class PSROIPoolingParameterDefaultTypeInternal;
+struct PSROIPoolingParameterDefaultTypeInternal;
 extern PSROIPoolingParameterDefaultTypeInternal _PSROIPoolingParameter_default_instance_;
 class ParamSpec;
-class ParamSpecDefaultTypeInternal;
+struct ParamSpecDefaultTypeInternal;
 extern ParamSpecDefaultTypeInternal _ParamSpec_default_instance_;
 class ParameterParameter;
-class ParameterParameterDefaultTypeInternal;
+struct ParameterParameterDefaultTypeInternal;
 extern ParameterParameterDefaultTypeInternal _ParameterParameter_default_instance_;
 class PermuteParameter;
-class PermuteParameterDefaultTypeInternal;
+struct PermuteParameterDefaultTypeInternal;
 extern PermuteParameterDefaultTypeInternal _PermuteParameter_default_instance_;
 class PoolingParameter;
-class PoolingParameterDefaultTypeInternal;
+struct PoolingParameterDefaultTypeInternal;
 extern PoolingParameterDefaultTypeInternal _PoolingParameter_default_instance_;
 class PowerParameter;
-class PowerParameterDefaultTypeInternal;
+struct PowerParameterDefaultTypeInternal;
 extern PowerParameterDefaultTypeInternal _PowerParameter_default_instance_;
 class PriorBoxParameter;
-class PriorBoxParameterDefaultTypeInternal;
+struct PriorBoxParameterDefaultTypeInternal;
 extern PriorBoxParameterDefaultTypeInternal _PriorBoxParameter_default_instance_;
 class ProposalParameter;
-class ProposalParameterDefaultTypeInternal;
+struct ProposalParameterDefaultTypeInternal;
 extern ProposalParameterDefaultTypeInternal _ProposalParameter_default_instance_;
 class PythonParameter;
-class PythonParameterDefaultTypeInternal;
+struct PythonParameterDefaultTypeInternal;
 extern PythonParameterDefaultTypeInternal _PythonParameter_default_instance_;
 class ROIPoolingParameter;
-class ROIPoolingParameterDefaultTypeInternal;
+struct ROIPoolingParameterDefaultTypeInternal;
 extern ROIPoolingParameterDefaultTypeInternal _ROIPoolingParameter_default_instance_;
 class ReLUParameter;
-class ReLUParameterDefaultTypeInternal;
+struct ReLUParameterDefaultTypeInternal;
 extern ReLUParameterDefaultTypeInternal _ReLUParameter_default_instance_;
 class RecurrentParameter;
-class RecurrentParameterDefaultTypeInternal;
+struct RecurrentParameterDefaultTypeInternal;
 extern RecurrentParameterDefaultTypeInternal _RecurrentParameter_default_instance_;
 class ReductionParameter;
-class ReductionParameterDefaultTypeInternal;
+struct ReductionParameterDefaultTypeInternal;
 extern ReductionParameterDefaultTypeInternal _ReductionParameter_default_instance_;
 class ReshapeParameter;
-class ReshapeParameterDefaultTypeInternal;
+struct ReshapeParameterDefaultTypeInternal;
 extern ReshapeParameterDefaultTypeInternal _ReshapeParameter_default_instance_;
 class SPPParameter;
-class SPPParameterDefaultTypeInternal;
+struct SPPParameterDefaultTypeInternal;
 extern SPPParameterDefaultTypeInternal _SPPParameter_default_instance_;
 class SaveOutputParameter;
-class SaveOutputParameterDefaultTypeInternal;
+struct SaveOutputParameterDefaultTypeInternal;
 extern SaveOutputParameterDefaultTypeInternal _SaveOutputParameter_default_instance_;
 class ScaleParameter;
-class ScaleParameterDefaultTypeInternal;
+struct ScaleParameterDefaultTypeInternal;
 extern ScaleParameterDefaultTypeInternal _ScaleParameter_default_instance_;
 class SigmoidParameter;
-class SigmoidParameterDefaultTypeInternal;
+struct SigmoidParameterDefaultTypeInternal;
 extern SigmoidParameterDefaultTypeInternal _SigmoidParameter_default_instance_;
 class SliceParameter;
-class SliceParameterDefaultTypeInternal;
+struct SliceParameterDefaultTypeInternal;
 extern SliceParameterDefaultTypeInternal _SliceParameter_default_instance_;
 class SoftmaxParameter;
-class SoftmaxParameterDefaultTypeInternal;
+struct SoftmaxParameterDefaultTypeInternal;
 extern SoftmaxParameterDefaultTypeInternal _SoftmaxParameter_default_instance_;
 class SolverParameter;
-class SolverParameterDefaultTypeInternal;
+struct SolverParameterDefaultTypeInternal;
 extern SolverParameterDefaultTypeInternal _SolverParameter_default_instance_;
 class SolverState;
-class SolverStateDefaultTypeInternal;
+struct SolverStateDefaultTypeInternal;
 extern SolverStateDefaultTypeInternal _SolverState_default_instance_;
 class TanHParameter;
-class TanHParameterDefaultTypeInternal;
+struct TanHParameterDefaultTypeInternal;
 extern TanHParameterDefaultTypeInternal _TanHParameter_default_instance_;
 class ThresholdParameter;
-class ThresholdParameterDefaultTypeInternal;
+struct ThresholdParameterDefaultTypeInternal;
 extern ThresholdParameterDefaultTypeInternal _ThresholdParameter_default_instance_;
 class TileParameter;
-class TileParameterDefaultTypeInternal;
+struct TileParameterDefaultTypeInternal;
 extern TileParameterDefaultTypeInternal _TileParameter_default_instance_;
 class TransformationParameter;
-class TransformationParameterDefaultTypeInternal;
+struct TransformationParameterDefaultTypeInternal;
 extern TransformationParameterDefaultTypeInternal _TransformationParameter_default_instance_;
 class V0LayerParameter;
-class V0LayerParameterDefaultTypeInternal;
+struct V0LayerParameterDefaultTypeInternal;
 extern V0LayerParameterDefaultTypeInternal _V0LayerParameter_default_instance_;
 class V1LayerParameter;
-class V1LayerParameterDefaultTypeInternal;
+struct V1LayerParameterDefaultTypeInternal;
 extern V1LayerParameterDefaultTypeInternal _V1LayerParameter_default_instance_;
 class WindowDataParameter;
-class WindowDataParameterDefaultTypeInternal;
+struct WindowDataParameterDefaultTypeInternal;
 extern WindowDataParameterDefaultTypeInternal _WindowDataParameter_default_instance_;
 }  // namespace opencv_caffe
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_caffe::AccuracyParameter* Arena::CreateMaybeMessage<::opencv_caffe::AccuracyParameter>(Arena*);
+template<> ::opencv_caffe::ArgMaxParameter* Arena::CreateMaybeMessage<::opencv_caffe::ArgMaxParameter>(Arena*);
+template<> ::opencv_caffe::BatchNormParameter* Arena::CreateMaybeMessage<::opencv_caffe::BatchNormParameter>(Arena*);
+template<> ::opencv_caffe::BiasParameter* Arena::CreateMaybeMessage<::opencv_caffe::BiasParameter>(Arena*);
+template<> ::opencv_caffe::BlobProto* Arena::CreateMaybeMessage<::opencv_caffe::BlobProto>(Arena*);
+template<> ::opencv_caffe::BlobProtoVector* Arena::CreateMaybeMessage<::opencv_caffe::BlobProtoVector>(Arena*);
+template<> ::opencv_caffe::BlobShape* Arena::CreateMaybeMessage<::opencv_caffe::BlobShape>(Arena*);
+template<> ::opencv_caffe::ConcatParameter* Arena::CreateMaybeMessage<::opencv_caffe::ConcatParameter>(Arena*);
+template<> ::opencv_caffe::ContrastiveLossParameter* Arena::CreateMaybeMessage<::opencv_caffe::ContrastiveLossParameter>(Arena*);
+template<> ::opencv_caffe::ConvolutionParameter* Arena::CreateMaybeMessage<::opencv_caffe::ConvolutionParameter>(Arena*);
+template<> ::opencv_caffe::CropParameter* Arena::CreateMaybeMessage<::opencv_caffe::CropParameter>(Arena*);
+template<> ::opencv_caffe::DataParameter* Arena::CreateMaybeMessage<::opencv_caffe::DataParameter>(Arena*);
+template<> ::opencv_caffe::Datum* Arena::CreateMaybeMessage<::opencv_caffe::Datum>(Arena*);
+template<> ::opencv_caffe::DetectionOutputParameter* Arena::CreateMaybeMessage<::opencv_caffe::DetectionOutputParameter>(Arena*);
+template<> ::opencv_caffe::DropoutParameter* Arena::CreateMaybeMessage<::opencv_caffe::DropoutParameter>(Arena*);
+template<> ::opencv_caffe::DummyDataParameter* Arena::CreateMaybeMessage<::opencv_caffe::DummyDataParameter>(Arena*);
+template<> ::opencv_caffe::ELUParameter* Arena::CreateMaybeMessage<::opencv_caffe::ELUParameter>(Arena*);
+template<> ::opencv_caffe::EltwiseParameter* Arena::CreateMaybeMessage<::opencv_caffe::EltwiseParameter>(Arena*);
+template<> ::opencv_caffe::EmbedParameter* Arena::CreateMaybeMessage<::opencv_caffe::EmbedParameter>(Arena*);
+template<> ::opencv_caffe::ExpParameter* Arena::CreateMaybeMessage<::opencv_caffe::ExpParameter>(Arena*);
+template<> ::opencv_caffe::FillerParameter* Arena::CreateMaybeMessage<::opencv_caffe::FillerParameter>(Arena*);
+template<> ::opencv_caffe::FlattenParameter* Arena::CreateMaybeMessage<::opencv_caffe::FlattenParameter>(Arena*);
+template<> ::opencv_caffe::HDF5DataParameter* Arena::CreateMaybeMessage<::opencv_caffe::HDF5DataParameter>(Arena*);
+template<> ::opencv_caffe::HDF5OutputParameter* Arena::CreateMaybeMessage<::opencv_caffe::HDF5OutputParameter>(Arena*);
+template<> ::opencv_caffe::HingeLossParameter* Arena::CreateMaybeMessage<::opencv_caffe::HingeLossParameter>(Arena*);
+template<> ::opencv_caffe::ImageDataParameter* Arena::CreateMaybeMessage<::opencv_caffe::ImageDataParameter>(Arena*);
+template<> ::opencv_caffe::InfogainLossParameter* Arena::CreateMaybeMessage<::opencv_caffe::InfogainLossParameter>(Arena*);
+template<> ::opencv_caffe::InnerProductParameter* Arena::CreateMaybeMessage<::opencv_caffe::InnerProductParameter>(Arena*);
+template<> ::opencv_caffe::InputParameter* Arena::CreateMaybeMessage<::opencv_caffe::InputParameter>(Arena*);
+template<> ::opencv_caffe::LRNParameter* Arena::CreateMaybeMessage<::opencv_caffe::LRNParameter>(Arena*);
+template<> ::opencv_caffe::LayerParameter* Arena::CreateMaybeMessage<::opencv_caffe::LayerParameter>(Arena*);
+template<> ::opencv_caffe::LogParameter* Arena::CreateMaybeMessage<::opencv_caffe::LogParameter>(Arena*);
+template<> ::opencv_caffe::LossParameter* Arena::CreateMaybeMessage<::opencv_caffe::LossParameter>(Arena*);
+template<> ::opencv_caffe::MVNParameter* Arena::CreateMaybeMessage<::opencv_caffe::MVNParameter>(Arena*);
+template<> ::opencv_caffe::MemoryDataParameter* Arena::CreateMaybeMessage<::opencv_caffe::MemoryDataParameter>(Arena*);
+template<> ::opencv_caffe::NetParameter* Arena::CreateMaybeMessage<::opencv_caffe::NetParameter>(Arena*);
+template<> ::opencv_caffe::NetState* Arena::CreateMaybeMessage<::opencv_caffe::NetState>(Arena*);
+template<> ::opencv_caffe::NetStateRule* Arena::CreateMaybeMessage<::opencv_caffe::NetStateRule>(Arena*);
+template<> ::opencv_caffe::NonMaximumSuppressionParameter* Arena::CreateMaybeMessage<::opencv_caffe::NonMaximumSuppressionParameter>(Arena*);
+template<> ::opencv_caffe::NormalizeBBoxParameter* Arena::CreateMaybeMessage<::opencv_caffe::NormalizeBBoxParameter>(Arena*);
+template<> ::opencv_caffe::NormalizedBBox* Arena::CreateMaybeMessage<::opencv_caffe::NormalizedBBox>(Arena*);
+template<> ::opencv_caffe::PReLUParameter* Arena::CreateMaybeMessage<::opencv_caffe::PReLUParameter>(Arena*);
+template<> ::opencv_caffe::PSROIPoolingParameter* Arena::CreateMaybeMessage<::opencv_caffe::PSROIPoolingParameter>(Arena*);
+template<> ::opencv_caffe::ParamSpec* Arena::CreateMaybeMessage<::opencv_caffe::ParamSpec>(Arena*);
+template<> ::opencv_caffe::ParameterParameter* Arena::CreateMaybeMessage<::opencv_caffe::ParameterParameter>(Arena*);
+template<> ::opencv_caffe::PermuteParameter* Arena::CreateMaybeMessage<::opencv_caffe::PermuteParameter>(Arena*);
+template<> ::opencv_caffe::PoolingParameter* Arena::CreateMaybeMessage<::opencv_caffe::PoolingParameter>(Arena*);
+template<> ::opencv_caffe::PowerParameter* Arena::CreateMaybeMessage<::opencv_caffe::PowerParameter>(Arena*);
+template<> ::opencv_caffe::PriorBoxParameter* Arena::CreateMaybeMessage<::opencv_caffe::PriorBoxParameter>(Arena*);
+template<> ::opencv_caffe::ProposalParameter* Arena::CreateMaybeMessage<::opencv_caffe::ProposalParameter>(Arena*);
+template<> ::opencv_caffe::PythonParameter* Arena::CreateMaybeMessage<::opencv_caffe::PythonParameter>(Arena*);
+template<> ::opencv_caffe::ROIPoolingParameter* Arena::CreateMaybeMessage<::opencv_caffe::ROIPoolingParameter>(Arena*);
+template<> ::opencv_caffe::ReLUParameter* Arena::CreateMaybeMessage<::opencv_caffe::ReLUParameter>(Arena*);
+template<> ::opencv_caffe::RecurrentParameter* Arena::CreateMaybeMessage<::opencv_caffe::RecurrentParameter>(Arena*);
+template<> ::opencv_caffe::ReductionParameter* Arena::CreateMaybeMessage<::opencv_caffe::ReductionParameter>(Arena*);
+template<> ::opencv_caffe::ReshapeParameter* Arena::CreateMaybeMessage<::opencv_caffe::ReshapeParameter>(Arena*);
+template<> ::opencv_caffe::SPPParameter* Arena::CreateMaybeMessage<::opencv_caffe::SPPParameter>(Arena*);
+template<> ::opencv_caffe::SaveOutputParameter* Arena::CreateMaybeMessage<::opencv_caffe::SaveOutputParameter>(Arena*);
+template<> ::opencv_caffe::ScaleParameter* Arena::CreateMaybeMessage<::opencv_caffe::ScaleParameter>(Arena*);
+template<> ::opencv_caffe::SigmoidParameter* Arena::CreateMaybeMessage<::opencv_caffe::SigmoidParameter>(Arena*);
+template<> ::opencv_caffe::SliceParameter* Arena::CreateMaybeMessage<::opencv_caffe::SliceParameter>(Arena*);
+template<> ::opencv_caffe::SoftmaxParameter* Arena::CreateMaybeMessage<::opencv_caffe::SoftmaxParameter>(Arena*);
+template<> ::opencv_caffe::SolverParameter* Arena::CreateMaybeMessage<::opencv_caffe::SolverParameter>(Arena*);
+template<> ::opencv_caffe::SolverState* Arena::CreateMaybeMessage<::opencv_caffe::SolverState>(Arena*);
+template<> ::opencv_caffe::TanHParameter* Arena::CreateMaybeMessage<::opencv_caffe::TanHParameter>(Arena*);
+template<> ::opencv_caffe::ThresholdParameter* Arena::CreateMaybeMessage<::opencv_caffe::ThresholdParameter>(Arena*);
+template<> ::opencv_caffe::TileParameter* Arena::CreateMaybeMessage<::opencv_caffe::TileParameter>(Arena*);
+template<> ::opencv_caffe::TransformationParameter* Arena::CreateMaybeMessage<::opencv_caffe::TransformationParameter>(Arena*);
+template<> ::opencv_caffe::V0LayerParameter* Arena::CreateMaybeMessage<::opencv_caffe::V0LayerParameter>(Arena*);
+template<> ::opencv_caffe::V1LayerParameter* Arena::CreateMaybeMessage<::opencv_caffe::V1LayerParameter>(Arena*);
+template<> ::opencv_caffe::WindowDataParameter* Arena::CreateMaybeMessage<::opencv_caffe::WindowDataParameter>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_caffe {
 
-enum PriorBoxParameter_CodeType {
+enum PriorBoxParameter_CodeType : int {
   PriorBoxParameter_CodeType_CORNER = 1,
   PriorBoxParameter_CodeType_CENTER_SIZE = 2
 };
 bool PriorBoxParameter_CodeType_IsValid(int value);
-const PriorBoxParameter_CodeType PriorBoxParameter_CodeType_CodeType_MIN = PriorBoxParameter_CodeType_CORNER;
-const PriorBoxParameter_CodeType PriorBoxParameter_CodeType_CodeType_MAX = PriorBoxParameter_CodeType_CENTER_SIZE;
-const int PriorBoxParameter_CodeType_CodeType_ARRAYSIZE = PriorBoxParameter_CodeType_CodeType_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* PriorBoxParameter_CodeType_descriptor();
-inline const ::std::string& PriorBoxParameter_CodeType_Name(PriorBoxParameter_CodeType value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    PriorBoxParameter_CodeType_descriptor(), value);
+constexpr PriorBoxParameter_CodeType PriorBoxParameter_CodeType_CodeType_MIN = PriorBoxParameter_CodeType_CORNER;
+constexpr PriorBoxParameter_CodeType PriorBoxParameter_CodeType_CodeType_MAX = PriorBoxParameter_CodeType_CENTER_SIZE;
+constexpr int PriorBoxParameter_CodeType_CodeType_ARRAYSIZE = PriorBoxParameter_CodeType_CodeType_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PriorBoxParameter_CodeType_descriptor();
+template<typename T>
+inline const std::string& PriorBoxParameter_CodeType_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, PriorBoxParameter_CodeType>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function PriorBoxParameter_CodeType_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    PriorBoxParameter_CodeType_descriptor(), enum_t_value);
 }
 inline bool PriorBoxParameter_CodeType_Parse(
-    const ::std::string& name, PriorBoxParameter_CodeType* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<PriorBoxParameter_CodeType>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PriorBoxParameter_CodeType* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<PriorBoxParameter_CodeType>(
     PriorBoxParameter_CodeType_descriptor(), name, value);
 }
-enum FillerParameter_VarianceNorm {
+enum FillerParameter_VarianceNorm : int {
   FillerParameter_VarianceNorm_FAN_IN = 0,
   FillerParameter_VarianceNorm_FAN_OUT = 1,
   FillerParameter_VarianceNorm_AVERAGE = 2
 };
 bool FillerParameter_VarianceNorm_IsValid(int value);
-const FillerParameter_VarianceNorm FillerParameter_VarianceNorm_VarianceNorm_MIN = FillerParameter_VarianceNorm_FAN_IN;
-const FillerParameter_VarianceNorm FillerParameter_VarianceNorm_VarianceNorm_MAX = FillerParameter_VarianceNorm_AVERAGE;
-const int FillerParameter_VarianceNorm_VarianceNorm_ARRAYSIZE = FillerParameter_VarianceNorm_VarianceNorm_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* FillerParameter_VarianceNorm_descriptor();
-inline const ::std::string& FillerParameter_VarianceNorm_Name(FillerParameter_VarianceNorm value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    FillerParameter_VarianceNorm_descriptor(), value);
+constexpr FillerParameter_VarianceNorm FillerParameter_VarianceNorm_VarianceNorm_MIN = FillerParameter_VarianceNorm_FAN_IN;
+constexpr FillerParameter_VarianceNorm FillerParameter_VarianceNorm_VarianceNorm_MAX = FillerParameter_VarianceNorm_AVERAGE;
+constexpr int FillerParameter_VarianceNorm_VarianceNorm_ARRAYSIZE = FillerParameter_VarianceNorm_VarianceNorm_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FillerParameter_VarianceNorm_descriptor();
+template<typename T>
+inline const std::string& FillerParameter_VarianceNorm_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, FillerParameter_VarianceNorm>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function FillerParameter_VarianceNorm_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    FillerParameter_VarianceNorm_descriptor(), enum_t_value);
 }
 inline bool FillerParameter_VarianceNorm_Parse(
-    const ::std::string& name, FillerParameter_VarianceNorm* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<FillerParameter_VarianceNorm>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, FillerParameter_VarianceNorm* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<FillerParameter_VarianceNorm>(
     FillerParameter_VarianceNorm_descriptor(), name, value);
 }
-enum SolverParameter_SnapshotFormat {
+enum SolverParameter_SnapshotFormat : int {
   SolverParameter_SnapshotFormat_HDF5 = 0,
   SolverParameter_SnapshotFormat_BINARYPROTO = 1
 };
 bool SolverParameter_SnapshotFormat_IsValid(int value);
-const SolverParameter_SnapshotFormat SolverParameter_SnapshotFormat_SnapshotFormat_MIN = SolverParameter_SnapshotFormat_HDF5;
-const SolverParameter_SnapshotFormat SolverParameter_SnapshotFormat_SnapshotFormat_MAX = SolverParameter_SnapshotFormat_BINARYPROTO;
-const int SolverParameter_SnapshotFormat_SnapshotFormat_ARRAYSIZE = SolverParameter_SnapshotFormat_SnapshotFormat_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* SolverParameter_SnapshotFormat_descriptor();
-inline const ::std::string& SolverParameter_SnapshotFormat_Name(SolverParameter_SnapshotFormat value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    SolverParameter_SnapshotFormat_descriptor(), value);
+constexpr SolverParameter_SnapshotFormat SolverParameter_SnapshotFormat_SnapshotFormat_MIN = SolverParameter_SnapshotFormat_HDF5;
+constexpr SolverParameter_SnapshotFormat SolverParameter_SnapshotFormat_SnapshotFormat_MAX = SolverParameter_SnapshotFormat_BINARYPROTO;
+constexpr int SolverParameter_SnapshotFormat_SnapshotFormat_ARRAYSIZE = SolverParameter_SnapshotFormat_SnapshotFormat_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SolverParameter_SnapshotFormat_descriptor();
+template<typename T>
+inline const std::string& SolverParameter_SnapshotFormat_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, SolverParameter_SnapshotFormat>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function SolverParameter_SnapshotFormat_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    SolverParameter_SnapshotFormat_descriptor(), enum_t_value);
 }
 inline bool SolverParameter_SnapshotFormat_Parse(
-    const ::std::string& name, SolverParameter_SnapshotFormat* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<SolverParameter_SnapshotFormat>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SolverParameter_SnapshotFormat* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<SolverParameter_SnapshotFormat>(
     SolverParameter_SnapshotFormat_descriptor(), name, value);
 }
-enum SolverParameter_SolverMode {
+enum SolverParameter_SolverMode : int {
   SolverParameter_SolverMode_CPU = 0,
   SolverParameter_SolverMode_GPU = 1
 };
 bool SolverParameter_SolverMode_IsValid(int value);
-const SolverParameter_SolverMode SolverParameter_SolverMode_SolverMode_MIN = SolverParameter_SolverMode_CPU;
-const SolverParameter_SolverMode SolverParameter_SolverMode_SolverMode_MAX = SolverParameter_SolverMode_GPU;
-const int SolverParameter_SolverMode_SolverMode_ARRAYSIZE = SolverParameter_SolverMode_SolverMode_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* SolverParameter_SolverMode_descriptor();
-inline const ::std::string& SolverParameter_SolverMode_Name(SolverParameter_SolverMode value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    SolverParameter_SolverMode_descriptor(), value);
+constexpr SolverParameter_SolverMode SolverParameter_SolverMode_SolverMode_MIN = SolverParameter_SolverMode_CPU;
+constexpr SolverParameter_SolverMode SolverParameter_SolverMode_SolverMode_MAX = SolverParameter_SolverMode_GPU;
+constexpr int SolverParameter_SolverMode_SolverMode_ARRAYSIZE = SolverParameter_SolverMode_SolverMode_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SolverParameter_SolverMode_descriptor();
+template<typename T>
+inline const std::string& SolverParameter_SolverMode_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, SolverParameter_SolverMode>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function SolverParameter_SolverMode_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    SolverParameter_SolverMode_descriptor(), enum_t_value);
 }
 inline bool SolverParameter_SolverMode_Parse(
-    const ::std::string& name, SolverParameter_SolverMode* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<SolverParameter_SolverMode>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SolverParameter_SolverMode* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<SolverParameter_SolverMode>(
     SolverParameter_SolverMode_descriptor(), name, value);
 }
-enum SolverParameter_SolverType {
+enum SolverParameter_SolverType : int {
   SolverParameter_SolverType_SGD = 0,
   SolverParameter_SolverType_NESTEROV = 1,
   SolverParameter_SolverType_ADAGRAD = 2,
@@ -562,359 +446,431 @@ enum SolverParameter_SolverType {
   SolverParameter_SolverType_ADAM = 5
 };
 bool SolverParameter_SolverType_IsValid(int value);
-const SolverParameter_SolverType SolverParameter_SolverType_SolverType_MIN = SolverParameter_SolverType_SGD;
-const SolverParameter_SolverType SolverParameter_SolverType_SolverType_MAX = SolverParameter_SolverType_ADAM;
-const int SolverParameter_SolverType_SolverType_ARRAYSIZE = SolverParameter_SolverType_SolverType_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* SolverParameter_SolverType_descriptor();
-inline const ::std::string& SolverParameter_SolverType_Name(SolverParameter_SolverType value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    SolverParameter_SolverType_descriptor(), value);
+constexpr SolverParameter_SolverType SolverParameter_SolverType_SolverType_MIN = SolverParameter_SolverType_SGD;
+constexpr SolverParameter_SolverType SolverParameter_SolverType_SolverType_MAX = SolverParameter_SolverType_ADAM;
+constexpr int SolverParameter_SolverType_SolverType_ARRAYSIZE = SolverParameter_SolverType_SolverType_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SolverParameter_SolverType_descriptor();
+template<typename T>
+inline const std::string& SolverParameter_SolverType_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, SolverParameter_SolverType>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function SolverParameter_SolverType_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    SolverParameter_SolverType_descriptor(), enum_t_value);
 }
 inline bool SolverParameter_SolverType_Parse(
-    const ::std::string& name, SolverParameter_SolverType* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<SolverParameter_SolverType>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SolverParameter_SolverType* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<SolverParameter_SolverType>(
     SolverParameter_SolverType_descriptor(), name, value);
 }
-enum ParamSpec_DimCheckMode {
+enum ParamSpec_DimCheckMode : int {
   ParamSpec_DimCheckMode_STRICT = 0,
   ParamSpec_DimCheckMode_PERMISSIVE = 1
 };
 bool ParamSpec_DimCheckMode_IsValid(int value);
-const ParamSpec_DimCheckMode ParamSpec_DimCheckMode_DimCheckMode_MIN = ParamSpec_DimCheckMode_STRICT;
-const ParamSpec_DimCheckMode ParamSpec_DimCheckMode_DimCheckMode_MAX = ParamSpec_DimCheckMode_PERMISSIVE;
-const int ParamSpec_DimCheckMode_DimCheckMode_ARRAYSIZE = ParamSpec_DimCheckMode_DimCheckMode_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* ParamSpec_DimCheckMode_descriptor();
-inline const ::std::string& ParamSpec_DimCheckMode_Name(ParamSpec_DimCheckMode value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    ParamSpec_DimCheckMode_descriptor(), value);
+constexpr ParamSpec_DimCheckMode ParamSpec_DimCheckMode_DimCheckMode_MIN = ParamSpec_DimCheckMode_STRICT;
+constexpr ParamSpec_DimCheckMode ParamSpec_DimCheckMode_DimCheckMode_MAX = ParamSpec_DimCheckMode_PERMISSIVE;
+constexpr int ParamSpec_DimCheckMode_DimCheckMode_ARRAYSIZE = ParamSpec_DimCheckMode_DimCheckMode_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ParamSpec_DimCheckMode_descriptor();
+template<typename T>
+inline const std::string& ParamSpec_DimCheckMode_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, ParamSpec_DimCheckMode>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function ParamSpec_DimCheckMode_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    ParamSpec_DimCheckMode_descriptor(), enum_t_value);
 }
 inline bool ParamSpec_DimCheckMode_Parse(
-    const ::std::string& name, ParamSpec_DimCheckMode* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<ParamSpec_DimCheckMode>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ParamSpec_DimCheckMode* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<ParamSpec_DimCheckMode>(
     ParamSpec_DimCheckMode_descriptor(), name, value);
 }
-enum LossParameter_NormalizationMode {
+enum LossParameter_NormalizationMode : int {
   LossParameter_NormalizationMode_FULL = 0,
   LossParameter_NormalizationMode_VALID = 1,
   LossParameter_NormalizationMode_BATCH_SIZE = 2,
   LossParameter_NormalizationMode_NONE = 3
 };
 bool LossParameter_NormalizationMode_IsValid(int value);
-const LossParameter_NormalizationMode LossParameter_NormalizationMode_NormalizationMode_MIN = LossParameter_NormalizationMode_FULL;
-const LossParameter_NormalizationMode LossParameter_NormalizationMode_NormalizationMode_MAX = LossParameter_NormalizationMode_NONE;
-const int LossParameter_NormalizationMode_NormalizationMode_ARRAYSIZE = LossParameter_NormalizationMode_NormalizationMode_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* LossParameter_NormalizationMode_descriptor();
-inline const ::std::string& LossParameter_NormalizationMode_Name(LossParameter_NormalizationMode value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    LossParameter_NormalizationMode_descriptor(), value);
+constexpr LossParameter_NormalizationMode LossParameter_NormalizationMode_NormalizationMode_MIN = LossParameter_NormalizationMode_FULL;
+constexpr LossParameter_NormalizationMode LossParameter_NormalizationMode_NormalizationMode_MAX = LossParameter_NormalizationMode_NONE;
+constexpr int LossParameter_NormalizationMode_NormalizationMode_ARRAYSIZE = LossParameter_NormalizationMode_NormalizationMode_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LossParameter_NormalizationMode_descriptor();
+template<typename T>
+inline const std::string& LossParameter_NormalizationMode_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, LossParameter_NormalizationMode>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function LossParameter_NormalizationMode_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    LossParameter_NormalizationMode_descriptor(), enum_t_value);
 }
 inline bool LossParameter_NormalizationMode_Parse(
-    const ::std::string& name, LossParameter_NormalizationMode* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<LossParameter_NormalizationMode>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, LossParameter_NormalizationMode* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<LossParameter_NormalizationMode>(
     LossParameter_NormalizationMode_descriptor(), name, value);
 }
-enum ConvolutionParameter_Engine {
+enum ConvolutionParameter_Engine : int {
   ConvolutionParameter_Engine_DEFAULT = 0,
   ConvolutionParameter_Engine_CAFFE = 1,
   ConvolutionParameter_Engine_CUDNN = 2
 };
 bool ConvolutionParameter_Engine_IsValid(int value);
-const ConvolutionParameter_Engine ConvolutionParameter_Engine_Engine_MIN = ConvolutionParameter_Engine_DEFAULT;
-const ConvolutionParameter_Engine ConvolutionParameter_Engine_Engine_MAX = ConvolutionParameter_Engine_CUDNN;
-const int ConvolutionParameter_Engine_Engine_ARRAYSIZE = ConvolutionParameter_Engine_Engine_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* ConvolutionParameter_Engine_descriptor();
-inline const ::std::string& ConvolutionParameter_Engine_Name(ConvolutionParameter_Engine value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    ConvolutionParameter_Engine_descriptor(), value);
+constexpr ConvolutionParameter_Engine ConvolutionParameter_Engine_Engine_MIN = ConvolutionParameter_Engine_DEFAULT;
+constexpr ConvolutionParameter_Engine ConvolutionParameter_Engine_Engine_MAX = ConvolutionParameter_Engine_CUDNN;
+constexpr int ConvolutionParameter_Engine_Engine_ARRAYSIZE = ConvolutionParameter_Engine_Engine_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ConvolutionParameter_Engine_descriptor();
+template<typename T>
+inline const std::string& ConvolutionParameter_Engine_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, ConvolutionParameter_Engine>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function ConvolutionParameter_Engine_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    ConvolutionParameter_Engine_descriptor(), enum_t_value);
 }
 inline bool ConvolutionParameter_Engine_Parse(
-    const ::std::string& name, ConvolutionParameter_Engine* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<ConvolutionParameter_Engine>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ConvolutionParameter_Engine* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<ConvolutionParameter_Engine>(
     ConvolutionParameter_Engine_descriptor(), name, value);
 }
-enum DataParameter_DB {
+enum DataParameter_DB : int {
   DataParameter_DB_LEVELDB = 0,
   DataParameter_DB_LMDB = 1
 };
 bool DataParameter_DB_IsValid(int value);
-const DataParameter_DB DataParameter_DB_DB_MIN = DataParameter_DB_LEVELDB;
-const DataParameter_DB DataParameter_DB_DB_MAX = DataParameter_DB_LMDB;
-const int DataParameter_DB_DB_ARRAYSIZE = DataParameter_DB_DB_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* DataParameter_DB_descriptor();
-inline const ::std::string& DataParameter_DB_Name(DataParameter_DB value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    DataParameter_DB_descriptor(), value);
+constexpr DataParameter_DB DataParameter_DB_DB_MIN = DataParameter_DB_LEVELDB;
+constexpr DataParameter_DB DataParameter_DB_DB_MAX = DataParameter_DB_LMDB;
+constexpr int DataParameter_DB_DB_ARRAYSIZE = DataParameter_DB_DB_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataParameter_DB_descriptor();
+template<typename T>
+inline const std::string& DataParameter_DB_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, DataParameter_DB>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function DataParameter_DB_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    DataParameter_DB_descriptor(), enum_t_value);
 }
 inline bool DataParameter_DB_Parse(
-    const ::std::string& name, DataParameter_DB* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<DataParameter_DB>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataParameter_DB* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<DataParameter_DB>(
     DataParameter_DB_descriptor(), name, value);
 }
-enum EltwiseParameter_EltwiseOp {
+enum EltwiseParameter_EltwiseOp : int {
   EltwiseParameter_EltwiseOp_PROD = 0,
   EltwiseParameter_EltwiseOp_SUM = 1,
   EltwiseParameter_EltwiseOp_MAX = 2
 };
 bool EltwiseParameter_EltwiseOp_IsValid(int value);
-const EltwiseParameter_EltwiseOp EltwiseParameter_EltwiseOp_EltwiseOp_MIN = EltwiseParameter_EltwiseOp_PROD;
-const EltwiseParameter_EltwiseOp EltwiseParameter_EltwiseOp_EltwiseOp_MAX = EltwiseParameter_EltwiseOp_MAX;
-const int EltwiseParameter_EltwiseOp_EltwiseOp_ARRAYSIZE = EltwiseParameter_EltwiseOp_EltwiseOp_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* EltwiseParameter_EltwiseOp_descriptor();
-inline const ::std::string& EltwiseParameter_EltwiseOp_Name(EltwiseParameter_EltwiseOp value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    EltwiseParameter_EltwiseOp_descriptor(), value);
+constexpr EltwiseParameter_EltwiseOp EltwiseParameter_EltwiseOp_EltwiseOp_MIN = EltwiseParameter_EltwiseOp_PROD;
+constexpr EltwiseParameter_EltwiseOp EltwiseParameter_EltwiseOp_EltwiseOp_MAX = EltwiseParameter_EltwiseOp_MAX;
+constexpr int EltwiseParameter_EltwiseOp_EltwiseOp_ARRAYSIZE = EltwiseParameter_EltwiseOp_EltwiseOp_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EltwiseParameter_EltwiseOp_descriptor();
+template<typename T>
+inline const std::string& EltwiseParameter_EltwiseOp_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, EltwiseParameter_EltwiseOp>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function EltwiseParameter_EltwiseOp_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    EltwiseParameter_EltwiseOp_descriptor(), enum_t_value);
 }
 inline bool EltwiseParameter_EltwiseOp_Parse(
-    const ::std::string& name, EltwiseParameter_EltwiseOp* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<EltwiseParameter_EltwiseOp>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, EltwiseParameter_EltwiseOp* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<EltwiseParameter_EltwiseOp>(
     EltwiseParameter_EltwiseOp_descriptor(), name, value);
 }
-enum HingeLossParameter_Norm {
+enum HingeLossParameter_Norm : int {
   HingeLossParameter_Norm_L1 = 1,
   HingeLossParameter_Norm_L2 = 2
 };
 bool HingeLossParameter_Norm_IsValid(int value);
-const HingeLossParameter_Norm HingeLossParameter_Norm_Norm_MIN = HingeLossParameter_Norm_L1;
-const HingeLossParameter_Norm HingeLossParameter_Norm_Norm_MAX = HingeLossParameter_Norm_L2;
-const int HingeLossParameter_Norm_Norm_ARRAYSIZE = HingeLossParameter_Norm_Norm_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* HingeLossParameter_Norm_descriptor();
-inline const ::std::string& HingeLossParameter_Norm_Name(HingeLossParameter_Norm value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    HingeLossParameter_Norm_descriptor(), value);
+constexpr HingeLossParameter_Norm HingeLossParameter_Norm_Norm_MIN = HingeLossParameter_Norm_L1;
+constexpr HingeLossParameter_Norm HingeLossParameter_Norm_Norm_MAX = HingeLossParameter_Norm_L2;
+constexpr int HingeLossParameter_Norm_Norm_ARRAYSIZE = HingeLossParameter_Norm_Norm_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* HingeLossParameter_Norm_descriptor();
+template<typename T>
+inline const std::string& HingeLossParameter_Norm_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, HingeLossParameter_Norm>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function HingeLossParameter_Norm_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    HingeLossParameter_Norm_descriptor(), enum_t_value);
 }
 inline bool HingeLossParameter_Norm_Parse(
-    const ::std::string& name, HingeLossParameter_Norm* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<HingeLossParameter_Norm>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, HingeLossParameter_Norm* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<HingeLossParameter_Norm>(
     HingeLossParameter_Norm_descriptor(), name, value);
 }
-enum LRNParameter_NormRegion {
+enum LRNParameter_NormRegion : int {
   LRNParameter_NormRegion_ACROSS_CHANNELS = 0,
   LRNParameter_NormRegion_WITHIN_CHANNEL = 1
 };
 bool LRNParameter_NormRegion_IsValid(int value);
-const LRNParameter_NormRegion LRNParameter_NormRegion_NormRegion_MIN = LRNParameter_NormRegion_ACROSS_CHANNELS;
-const LRNParameter_NormRegion LRNParameter_NormRegion_NormRegion_MAX = LRNParameter_NormRegion_WITHIN_CHANNEL;
-const int LRNParameter_NormRegion_NormRegion_ARRAYSIZE = LRNParameter_NormRegion_NormRegion_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* LRNParameter_NormRegion_descriptor();
-inline const ::std::string& LRNParameter_NormRegion_Name(LRNParameter_NormRegion value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    LRNParameter_NormRegion_descriptor(), value);
+constexpr LRNParameter_NormRegion LRNParameter_NormRegion_NormRegion_MIN = LRNParameter_NormRegion_ACROSS_CHANNELS;
+constexpr LRNParameter_NormRegion LRNParameter_NormRegion_NormRegion_MAX = LRNParameter_NormRegion_WITHIN_CHANNEL;
+constexpr int LRNParameter_NormRegion_NormRegion_ARRAYSIZE = LRNParameter_NormRegion_NormRegion_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LRNParameter_NormRegion_descriptor();
+template<typename T>
+inline const std::string& LRNParameter_NormRegion_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, LRNParameter_NormRegion>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function LRNParameter_NormRegion_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    LRNParameter_NormRegion_descriptor(), enum_t_value);
 }
 inline bool LRNParameter_NormRegion_Parse(
-    const ::std::string& name, LRNParameter_NormRegion* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<LRNParameter_NormRegion>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, LRNParameter_NormRegion* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<LRNParameter_NormRegion>(
     LRNParameter_NormRegion_descriptor(), name, value);
 }
-enum LRNParameter_Engine {
+enum LRNParameter_Engine : int {
   LRNParameter_Engine_DEFAULT = 0,
   LRNParameter_Engine_CAFFE = 1,
   LRNParameter_Engine_CUDNN = 2
 };
 bool LRNParameter_Engine_IsValid(int value);
-const LRNParameter_Engine LRNParameter_Engine_Engine_MIN = LRNParameter_Engine_DEFAULT;
-const LRNParameter_Engine LRNParameter_Engine_Engine_MAX = LRNParameter_Engine_CUDNN;
-const int LRNParameter_Engine_Engine_ARRAYSIZE = LRNParameter_Engine_Engine_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* LRNParameter_Engine_descriptor();
-inline const ::std::string& LRNParameter_Engine_Name(LRNParameter_Engine value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    LRNParameter_Engine_descriptor(), value);
+constexpr LRNParameter_Engine LRNParameter_Engine_Engine_MIN = LRNParameter_Engine_DEFAULT;
+constexpr LRNParameter_Engine LRNParameter_Engine_Engine_MAX = LRNParameter_Engine_CUDNN;
+constexpr int LRNParameter_Engine_Engine_ARRAYSIZE = LRNParameter_Engine_Engine_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LRNParameter_Engine_descriptor();
+template<typename T>
+inline const std::string& LRNParameter_Engine_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, LRNParameter_Engine>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function LRNParameter_Engine_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    LRNParameter_Engine_descriptor(), enum_t_value);
 }
 inline bool LRNParameter_Engine_Parse(
-    const ::std::string& name, LRNParameter_Engine* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<LRNParameter_Engine>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, LRNParameter_Engine* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<LRNParameter_Engine>(
     LRNParameter_Engine_descriptor(), name, value);
 }
-enum PoolingParameter_PoolMethod {
+enum PoolingParameter_PoolMethod : int {
   PoolingParameter_PoolMethod_MAX = 0,
   PoolingParameter_PoolMethod_AVE = 1,
   PoolingParameter_PoolMethod_STOCHASTIC = 2
 };
 bool PoolingParameter_PoolMethod_IsValid(int value);
-const PoolingParameter_PoolMethod PoolingParameter_PoolMethod_PoolMethod_MIN = PoolingParameter_PoolMethod_MAX;
-const PoolingParameter_PoolMethod PoolingParameter_PoolMethod_PoolMethod_MAX = PoolingParameter_PoolMethod_STOCHASTIC;
-const int PoolingParameter_PoolMethod_PoolMethod_ARRAYSIZE = PoolingParameter_PoolMethod_PoolMethod_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* PoolingParameter_PoolMethod_descriptor();
-inline const ::std::string& PoolingParameter_PoolMethod_Name(PoolingParameter_PoolMethod value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    PoolingParameter_PoolMethod_descriptor(), value);
+constexpr PoolingParameter_PoolMethod PoolingParameter_PoolMethod_PoolMethod_MIN = PoolingParameter_PoolMethod_MAX;
+constexpr PoolingParameter_PoolMethod PoolingParameter_PoolMethod_PoolMethod_MAX = PoolingParameter_PoolMethod_STOCHASTIC;
+constexpr int PoolingParameter_PoolMethod_PoolMethod_ARRAYSIZE = PoolingParameter_PoolMethod_PoolMethod_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PoolingParameter_PoolMethod_descriptor();
+template<typename T>
+inline const std::string& PoolingParameter_PoolMethod_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, PoolingParameter_PoolMethod>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function PoolingParameter_PoolMethod_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    PoolingParameter_PoolMethod_descriptor(), enum_t_value);
 }
 inline bool PoolingParameter_PoolMethod_Parse(
-    const ::std::string& name, PoolingParameter_PoolMethod* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<PoolingParameter_PoolMethod>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PoolingParameter_PoolMethod* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<PoolingParameter_PoolMethod>(
     PoolingParameter_PoolMethod_descriptor(), name, value);
 }
-enum PoolingParameter_Engine {
+enum PoolingParameter_Engine : int {
   PoolingParameter_Engine_DEFAULT = 0,
   PoolingParameter_Engine_CAFFE = 1,
   PoolingParameter_Engine_CUDNN = 2
 };
 bool PoolingParameter_Engine_IsValid(int value);
-const PoolingParameter_Engine PoolingParameter_Engine_Engine_MIN = PoolingParameter_Engine_DEFAULT;
-const PoolingParameter_Engine PoolingParameter_Engine_Engine_MAX = PoolingParameter_Engine_CUDNN;
-const int PoolingParameter_Engine_Engine_ARRAYSIZE = PoolingParameter_Engine_Engine_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* PoolingParameter_Engine_descriptor();
-inline const ::std::string& PoolingParameter_Engine_Name(PoolingParameter_Engine value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    PoolingParameter_Engine_descriptor(), value);
+constexpr PoolingParameter_Engine PoolingParameter_Engine_Engine_MIN = PoolingParameter_Engine_DEFAULT;
+constexpr PoolingParameter_Engine PoolingParameter_Engine_Engine_MAX = PoolingParameter_Engine_CUDNN;
+constexpr int PoolingParameter_Engine_Engine_ARRAYSIZE = PoolingParameter_Engine_Engine_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PoolingParameter_Engine_descriptor();
+template<typename T>
+inline const std::string& PoolingParameter_Engine_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, PoolingParameter_Engine>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function PoolingParameter_Engine_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    PoolingParameter_Engine_descriptor(), enum_t_value);
 }
 inline bool PoolingParameter_Engine_Parse(
-    const ::std::string& name, PoolingParameter_Engine* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<PoolingParameter_Engine>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PoolingParameter_Engine* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<PoolingParameter_Engine>(
     PoolingParameter_Engine_descriptor(), name, value);
 }
-enum ReductionParameter_ReductionOp {
+enum ReductionParameter_ReductionOp : int {
   ReductionParameter_ReductionOp_SUM = 1,
   ReductionParameter_ReductionOp_ASUM = 2,
   ReductionParameter_ReductionOp_SUMSQ = 3,
   ReductionParameter_ReductionOp_MEAN = 4
 };
 bool ReductionParameter_ReductionOp_IsValid(int value);
-const ReductionParameter_ReductionOp ReductionParameter_ReductionOp_ReductionOp_MIN = ReductionParameter_ReductionOp_SUM;
-const ReductionParameter_ReductionOp ReductionParameter_ReductionOp_ReductionOp_MAX = ReductionParameter_ReductionOp_MEAN;
-const int ReductionParameter_ReductionOp_ReductionOp_ARRAYSIZE = ReductionParameter_ReductionOp_ReductionOp_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* ReductionParameter_ReductionOp_descriptor();
-inline const ::std::string& ReductionParameter_ReductionOp_Name(ReductionParameter_ReductionOp value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    ReductionParameter_ReductionOp_descriptor(), value);
+constexpr ReductionParameter_ReductionOp ReductionParameter_ReductionOp_ReductionOp_MIN = ReductionParameter_ReductionOp_SUM;
+constexpr ReductionParameter_ReductionOp ReductionParameter_ReductionOp_ReductionOp_MAX = ReductionParameter_ReductionOp_MEAN;
+constexpr int ReductionParameter_ReductionOp_ReductionOp_ARRAYSIZE = ReductionParameter_ReductionOp_ReductionOp_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReductionParameter_ReductionOp_descriptor();
+template<typename T>
+inline const std::string& ReductionParameter_ReductionOp_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, ReductionParameter_ReductionOp>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function ReductionParameter_ReductionOp_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    ReductionParameter_ReductionOp_descriptor(), enum_t_value);
 }
 inline bool ReductionParameter_ReductionOp_Parse(
-    const ::std::string& name, ReductionParameter_ReductionOp* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<ReductionParameter_ReductionOp>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ReductionParameter_ReductionOp* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<ReductionParameter_ReductionOp>(
     ReductionParameter_ReductionOp_descriptor(), name, value);
 }
-enum ReLUParameter_Engine {
+enum ReLUParameter_Engine : int {
   ReLUParameter_Engine_DEFAULT = 0,
   ReLUParameter_Engine_CAFFE = 1,
   ReLUParameter_Engine_CUDNN = 2
 };
 bool ReLUParameter_Engine_IsValid(int value);
-const ReLUParameter_Engine ReLUParameter_Engine_Engine_MIN = ReLUParameter_Engine_DEFAULT;
-const ReLUParameter_Engine ReLUParameter_Engine_Engine_MAX = ReLUParameter_Engine_CUDNN;
-const int ReLUParameter_Engine_Engine_ARRAYSIZE = ReLUParameter_Engine_Engine_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* ReLUParameter_Engine_descriptor();
-inline const ::std::string& ReLUParameter_Engine_Name(ReLUParameter_Engine value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    ReLUParameter_Engine_descriptor(), value);
+constexpr ReLUParameter_Engine ReLUParameter_Engine_Engine_MIN = ReLUParameter_Engine_DEFAULT;
+constexpr ReLUParameter_Engine ReLUParameter_Engine_Engine_MAX = ReLUParameter_Engine_CUDNN;
+constexpr int ReLUParameter_Engine_Engine_ARRAYSIZE = ReLUParameter_Engine_Engine_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ReLUParameter_Engine_descriptor();
+template<typename T>
+inline const std::string& ReLUParameter_Engine_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, ReLUParameter_Engine>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function ReLUParameter_Engine_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    ReLUParameter_Engine_descriptor(), enum_t_value);
 }
 inline bool ReLUParameter_Engine_Parse(
-    const ::std::string& name, ReLUParameter_Engine* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<ReLUParameter_Engine>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ReLUParameter_Engine* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<ReLUParameter_Engine>(
     ReLUParameter_Engine_descriptor(), name, value);
 }
-enum SigmoidParameter_Engine {
+enum SigmoidParameter_Engine : int {
   SigmoidParameter_Engine_DEFAULT = 0,
   SigmoidParameter_Engine_CAFFE = 1,
   SigmoidParameter_Engine_CUDNN = 2
 };
 bool SigmoidParameter_Engine_IsValid(int value);
-const SigmoidParameter_Engine SigmoidParameter_Engine_Engine_MIN = SigmoidParameter_Engine_DEFAULT;
-const SigmoidParameter_Engine SigmoidParameter_Engine_Engine_MAX = SigmoidParameter_Engine_CUDNN;
-const int SigmoidParameter_Engine_Engine_ARRAYSIZE = SigmoidParameter_Engine_Engine_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* SigmoidParameter_Engine_descriptor();
-inline const ::std::string& SigmoidParameter_Engine_Name(SigmoidParameter_Engine value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    SigmoidParameter_Engine_descriptor(), value);
+constexpr SigmoidParameter_Engine SigmoidParameter_Engine_Engine_MIN = SigmoidParameter_Engine_DEFAULT;
+constexpr SigmoidParameter_Engine SigmoidParameter_Engine_Engine_MAX = SigmoidParameter_Engine_CUDNN;
+constexpr int SigmoidParameter_Engine_Engine_ARRAYSIZE = SigmoidParameter_Engine_Engine_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SigmoidParameter_Engine_descriptor();
+template<typename T>
+inline const std::string& SigmoidParameter_Engine_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, SigmoidParameter_Engine>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function SigmoidParameter_Engine_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    SigmoidParameter_Engine_descriptor(), enum_t_value);
 }
 inline bool SigmoidParameter_Engine_Parse(
-    const ::std::string& name, SigmoidParameter_Engine* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<SigmoidParameter_Engine>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SigmoidParameter_Engine* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<SigmoidParameter_Engine>(
     SigmoidParameter_Engine_descriptor(), name, value);
 }
-enum SoftmaxParameter_Engine {
+enum SoftmaxParameter_Engine : int {
   SoftmaxParameter_Engine_DEFAULT = 0,
   SoftmaxParameter_Engine_CAFFE = 1,
   SoftmaxParameter_Engine_CUDNN = 2
 };
 bool SoftmaxParameter_Engine_IsValid(int value);
-const SoftmaxParameter_Engine SoftmaxParameter_Engine_Engine_MIN = SoftmaxParameter_Engine_DEFAULT;
-const SoftmaxParameter_Engine SoftmaxParameter_Engine_Engine_MAX = SoftmaxParameter_Engine_CUDNN;
-const int SoftmaxParameter_Engine_Engine_ARRAYSIZE = SoftmaxParameter_Engine_Engine_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* SoftmaxParameter_Engine_descriptor();
-inline const ::std::string& SoftmaxParameter_Engine_Name(SoftmaxParameter_Engine value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    SoftmaxParameter_Engine_descriptor(), value);
+constexpr SoftmaxParameter_Engine SoftmaxParameter_Engine_Engine_MIN = SoftmaxParameter_Engine_DEFAULT;
+constexpr SoftmaxParameter_Engine SoftmaxParameter_Engine_Engine_MAX = SoftmaxParameter_Engine_CUDNN;
+constexpr int SoftmaxParameter_Engine_Engine_ARRAYSIZE = SoftmaxParameter_Engine_Engine_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SoftmaxParameter_Engine_descriptor();
+template<typename T>
+inline const std::string& SoftmaxParameter_Engine_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, SoftmaxParameter_Engine>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function SoftmaxParameter_Engine_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    SoftmaxParameter_Engine_descriptor(), enum_t_value);
 }
 inline bool SoftmaxParameter_Engine_Parse(
-    const ::std::string& name, SoftmaxParameter_Engine* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<SoftmaxParameter_Engine>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SoftmaxParameter_Engine* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<SoftmaxParameter_Engine>(
     SoftmaxParameter_Engine_descriptor(), name, value);
 }
-enum TanHParameter_Engine {
+enum TanHParameter_Engine : int {
   TanHParameter_Engine_DEFAULT = 0,
   TanHParameter_Engine_CAFFE = 1,
   TanHParameter_Engine_CUDNN = 2
 };
 bool TanHParameter_Engine_IsValid(int value);
-const TanHParameter_Engine TanHParameter_Engine_Engine_MIN = TanHParameter_Engine_DEFAULT;
-const TanHParameter_Engine TanHParameter_Engine_Engine_MAX = TanHParameter_Engine_CUDNN;
-const int TanHParameter_Engine_Engine_ARRAYSIZE = TanHParameter_Engine_Engine_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* TanHParameter_Engine_descriptor();
-inline const ::std::string& TanHParameter_Engine_Name(TanHParameter_Engine value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    TanHParameter_Engine_descriptor(), value);
+constexpr TanHParameter_Engine TanHParameter_Engine_Engine_MIN = TanHParameter_Engine_DEFAULT;
+constexpr TanHParameter_Engine TanHParameter_Engine_Engine_MAX = TanHParameter_Engine_CUDNN;
+constexpr int TanHParameter_Engine_Engine_ARRAYSIZE = TanHParameter_Engine_Engine_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TanHParameter_Engine_descriptor();
+template<typename T>
+inline const std::string& TanHParameter_Engine_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, TanHParameter_Engine>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function TanHParameter_Engine_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    TanHParameter_Engine_descriptor(), enum_t_value);
 }
 inline bool TanHParameter_Engine_Parse(
-    const ::std::string& name, TanHParameter_Engine* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<TanHParameter_Engine>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TanHParameter_Engine* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<TanHParameter_Engine>(
     TanHParameter_Engine_descriptor(), name, value);
 }
-enum SPPParameter_PoolMethod {
+enum SPPParameter_PoolMethod : int {
   SPPParameter_PoolMethod_MAX = 0,
   SPPParameter_PoolMethod_AVE = 1,
   SPPParameter_PoolMethod_STOCHASTIC = 2
 };
 bool SPPParameter_PoolMethod_IsValid(int value);
-const SPPParameter_PoolMethod SPPParameter_PoolMethod_PoolMethod_MIN = SPPParameter_PoolMethod_MAX;
-const SPPParameter_PoolMethod SPPParameter_PoolMethod_PoolMethod_MAX = SPPParameter_PoolMethod_STOCHASTIC;
-const int SPPParameter_PoolMethod_PoolMethod_ARRAYSIZE = SPPParameter_PoolMethod_PoolMethod_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* SPPParameter_PoolMethod_descriptor();
-inline const ::std::string& SPPParameter_PoolMethod_Name(SPPParameter_PoolMethod value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    SPPParameter_PoolMethod_descriptor(), value);
+constexpr SPPParameter_PoolMethod SPPParameter_PoolMethod_PoolMethod_MIN = SPPParameter_PoolMethod_MAX;
+constexpr SPPParameter_PoolMethod SPPParameter_PoolMethod_PoolMethod_MAX = SPPParameter_PoolMethod_STOCHASTIC;
+constexpr int SPPParameter_PoolMethod_PoolMethod_ARRAYSIZE = SPPParameter_PoolMethod_PoolMethod_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SPPParameter_PoolMethod_descriptor();
+template<typename T>
+inline const std::string& SPPParameter_PoolMethod_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, SPPParameter_PoolMethod>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function SPPParameter_PoolMethod_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    SPPParameter_PoolMethod_descriptor(), enum_t_value);
 }
 inline bool SPPParameter_PoolMethod_Parse(
-    const ::std::string& name, SPPParameter_PoolMethod* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<SPPParameter_PoolMethod>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SPPParameter_PoolMethod* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<SPPParameter_PoolMethod>(
     SPPParameter_PoolMethod_descriptor(), name, value);
 }
-enum SPPParameter_Engine {
+enum SPPParameter_Engine : int {
   SPPParameter_Engine_DEFAULT = 0,
   SPPParameter_Engine_CAFFE = 1,
   SPPParameter_Engine_CUDNN = 2
 };
 bool SPPParameter_Engine_IsValid(int value);
-const SPPParameter_Engine SPPParameter_Engine_Engine_MIN = SPPParameter_Engine_DEFAULT;
-const SPPParameter_Engine SPPParameter_Engine_Engine_MAX = SPPParameter_Engine_CUDNN;
-const int SPPParameter_Engine_Engine_ARRAYSIZE = SPPParameter_Engine_Engine_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* SPPParameter_Engine_descriptor();
-inline const ::std::string& SPPParameter_Engine_Name(SPPParameter_Engine value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    SPPParameter_Engine_descriptor(), value);
+constexpr SPPParameter_Engine SPPParameter_Engine_Engine_MIN = SPPParameter_Engine_DEFAULT;
+constexpr SPPParameter_Engine SPPParameter_Engine_Engine_MAX = SPPParameter_Engine_CUDNN;
+constexpr int SPPParameter_Engine_Engine_ARRAYSIZE = SPPParameter_Engine_Engine_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SPPParameter_Engine_descriptor();
+template<typename T>
+inline const std::string& SPPParameter_Engine_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, SPPParameter_Engine>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function SPPParameter_Engine_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    SPPParameter_Engine_descriptor(), enum_t_value);
 }
 inline bool SPPParameter_Engine_Parse(
-    const ::std::string& name, SPPParameter_Engine* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<SPPParameter_Engine>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SPPParameter_Engine* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<SPPParameter_Engine>(
     SPPParameter_Engine_descriptor(), name, value);
 }
-enum V1LayerParameter_LayerType {
+enum V1LayerParameter_LayerType : int {
   V1LayerParameter_LayerType_NONE = 0,
   V1LayerParameter_LayerType_ABSVAL = 35,
   V1LayerParameter_LayerType_ACCURACY = 1,
@@ -957,60 +913,72 @@ enum V1LayerParameter_LayerType {
   V1LayerParameter_LayerType_THRESHOLD = 31
 };
 bool V1LayerParameter_LayerType_IsValid(int value);
-const V1LayerParameter_LayerType V1LayerParameter_LayerType_LayerType_MIN = V1LayerParameter_LayerType_NONE;
-const V1LayerParameter_LayerType V1LayerParameter_LayerType_LayerType_MAX = V1LayerParameter_LayerType_DECONVOLUTION;
-const int V1LayerParameter_LayerType_LayerType_ARRAYSIZE = V1LayerParameter_LayerType_LayerType_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* V1LayerParameter_LayerType_descriptor();
-inline const ::std::string& V1LayerParameter_LayerType_Name(V1LayerParameter_LayerType value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    V1LayerParameter_LayerType_descriptor(), value);
+constexpr V1LayerParameter_LayerType V1LayerParameter_LayerType_LayerType_MIN = V1LayerParameter_LayerType_NONE;
+constexpr V1LayerParameter_LayerType V1LayerParameter_LayerType_LayerType_MAX = V1LayerParameter_LayerType_DECONVOLUTION;
+constexpr int V1LayerParameter_LayerType_LayerType_ARRAYSIZE = V1LayerParameter_LayerType_LayerType_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* V1LayerParameter_LayerType_descriptor();
+template<typename T>
+inline const std::string& V1LayerParameter_LayerType_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, V1LayerParameter_LayerType>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function V1LayerParameter_LayerType_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    V1LayerParameter_LayerType_descriptor(), enum_t_value);
 }
 inline bool V1LayerParameter_LayerType_Parse(
-    const ::std::string& name, V1LayerParameter_LayerType* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<V1LayerParameter_LayerType>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, V1LayerParameter_LayerType* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<V1LayerParameter_LayerType>(
     V1LayerParameter_LayerType_descriptor(), name, value);
 }
-enum V1LayerParameter_DimCheckMode {
+enum V1LayerParameter_DimCheckMode : int {
   V1LayerParameter_DimCheckMode_STRICT = 0,
   V1LayerParameter_DimCheckMode_PERMISSIVE = 1
 };
 bool V1LayerParameter_DimCheckMode_IsValid(int value);
-const V1LayerParameter_DimCheckMode V1LayerParameter_DimCheckMode_DimCheckMode_MIN = V1LayerParameter_DimCheckMode_STRICT;
-const V1LayerParameter_DimCheckMode V1LayerParameter_DimCheckMode_DimCheckMode_MAX = V1LayerParameter_DimCheckMode_PERMISSIVE;
-const int V1LayerParameter_DimCheckMode_DimCheckMode_ARRAYSIZE = V1LayerParameter_DimCheckMode_DimCheckMode_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* V1LayerParameter_DimCheckMode_descriptor();
-inline const ::std::string& V1LayerParameter_DimCheckMode_Name(V1LayerParameter_DimCheckMode value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    V1LayerParameter_DimCheckMode_descriptor(), value);
+constexpr V1LayerParameter_DimCheckMode V1LayerParameter_DimCheckMode_DimCheckMode_MIN = V1LayerParameter_DimCheckMode_STRICT;
+constexpr V1LayerParameter_DimCheckMode V1LayerParameter_DimCheckMode_DimCheckMode_MAX = V1LayerParameter_DimCheckMode_PERMISSIVE;
+constexpr int V1LayerParameter_DimCheckMode_DimCheckMode_ARRAYSIZE = V1LayerParameter_DimCheckMode_DimCheckMode_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* V1LayerParameter_DimCheckMode_descriptor();
+template<typename T>
+inline const std::string& V1LayerParameter_DimCheckMode_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, V1LayerParameter_DimCheckMode>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function V1LayerParameter_DimCheckMode_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    V1LayerParameter_DimCheckMode_descriptor(), enum_t_value);
 }
 inline bool V1LayerParameter_DimCheckMode_Parse(
-    const ::std::string& name, V1LayerParameter_DimCheckMode* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<V1LayerParameter_DimCheckMode>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, V1LayerParameter_DimCheckMode* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<V1LayerParameter_DimCheckMode>(
     V1LayerParameter_DimCheckMode_descriptor(), name, value);
 }
-enum V0LayerParameter_PoolMethod {
+enum V0LayerParameter_PoolMethod : int {
   V0LayerParameter_PoolMethod_MAX = 0,
   V0LayerParameter_PoolMethod_AVE = 1,
   V0LayerParameter_PoolMethod_STOCHASTIC = 2
 };
 bool V0LayerParameter_PoolMethod_IsValid(int value);
-const V0LayerParameter_PoolMethod V0LayerParameter_PoolMethod_PoolMethod_MIN = V0LayerParameter_PoolMethod_MAX;
-const V0LayerParameter_PoolMethod V0LayerParameter_PoolMethod_PoolMethod_MAX = V0LayerParameter_PoolMethod_STOCHASTIC;
-const int V0LayerParameter_PoolMethod_PoolMethod_ARRAYSIZE = V0LayerParameter_PoolMethod_PoolMethod_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* V0LayerParameter_PoolMethod_descriptor();
-inline const ::std::string& V0LayerParameter_PoolMethod_Name(V0LayerParameter_PoolMethod value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    V0LayerParameter_PoolMethod_descriptor(), value);
+constexpr V0LayerParameter_PoolMethod V0LayerParameter_PoolMethod_PoolMethod_MIN = V0LayerParameter_PoolMethod_MAX;
+constexpr V0LayerParameter_PoolMethod V0LayerParameter_PoolMethod_PoolMethod_MAX = V0LayerParameter_PoolMethod_STOCHASTIC;
+constexpr int V0LayerParameter_PoolMethod_PoolMethod_ARRAYSIZE = V0LayerParameter_PoolMethod_PoolMethod_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* V0LayerParameter_PoolMethod_descriptor();
+template<typename T>
+inline const std::string& V0LayerParameter_PoolMethod_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, V0LayerParameter_PoolMethod>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function V0LayerParameter_PoolMethod_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    V0LayerParameter_PoolMethod_descriptor(), enum_t_value);
 }
 inline bool V0LayerParameter_PoolMethod_Parse(
-    const ::std::string& name, V0LayerParameter_PoolMethod* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<V0LayerParameter_PoolMethod>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, V0LayerParameter_PoolMethod* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<V0LayerParameter_PoolMethod>(
     V0LayerParameter_PoolMethod_descriptor(), name, value);
 }
-enum Type {
+enum Type : int {
   DOUBLE = 0,
   FLOAT = 1,
   FLOAT16 = 2,
@@ -1018,4074 +986,6026 @@ enum Type {
   UINT = 4
 };
 bool Type_IsValid(int value);
-const Type Type_MIN = DOUBLE;
-const Type Type_MAX = UINT;
-const int Type_ARRAYSIZE = Type_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* Type_descriptor();
-inline const ::std::string& Type_Name(Type value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    Type_descriptor(), value);
+constexpr Type Type_MIN = DOUBLE;
+constexpr Type Type_MAX = UINT;
+constexpr int Type_ARRAYSIZE = Type_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Type_descriptor();
+template<typename T>
+inline const std::string& Type_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, Type>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function Type_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    Type_descriptor(), enum_t_value);
 }
 inline bool Type_Parse(
-    const ::std::string& name, Type* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<Type>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Type* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<Type>(
     Type_descriptor(), name, value);
 }
-enum Phase {
+enum Phase : int {
   TRAIN = 0,
   TEST = 1
 };
 bool Phase_IsValid(int value);
-const Phase Phase_MIN = TRAIN;
-const Phase Phase_MAX = TEST;
-const int Phase_ARRAYSIZE = Phase_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* Phase_descriptor();
-inline const ::std::string& Phase_Name(Phase value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    Phase_descriptor(), value);
+constexpr Phase Phase_MIN = TRAIN;
+constexpr Phase Phase_MAX = TEST;
+constexpr int Phase_ARRAYSIZE = Phase_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Phase_descriptor();
+template<typename T>
+inline const std::string& Phase_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, Phase>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function Phase_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    Phase_descriptor(), enum_t_value);
 }
 inline bool Phase_Parse(
-    const ::std::string& name, Phase* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<Phase>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Phase* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<Phase>(
     Phase_descriptor(), name, value);
 }
 // ===================================================================
 
-class BlobShape : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BlobShape) */ {
+class BlobShape final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BlobShape) */ {
  public:
-  BlobShape();
-  virtual ~BlobShape();
+  inline BlobShape() : BlobShape(nullptr) {}
+  ~BlobShape() override;
+  explicit constexpr BlobShape(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   BlobShape(const BlobShape& from);
-
-  inline BlobShape& operator=(const BlobShape& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   BlobShape(BlobShape&& from) noexcept
     : BlobShape() {
     *this = ::std::move(from);
   }
 
+  inline BlobShape& operator=(const BlobShape& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline BlobShape& operator=(BlobShape&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const BlobShape& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const BlobShape& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const BlobShape* internal_default_instance() {
     return reinterpret_cast<const BlobShape*>(
                &_BlobShape_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void Swap(BlobShape* other);
   friend void swap(BlobShape& a, BlobShape& b) {
     a.Swap(&b);
   }
+  inline void Swap(BlobShape* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(BlobShape* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline BlobShape* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  BlobShape* 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;
+  BlobShape* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<BlobShape>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const BlobShape& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const BlobShape& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(BlobShape* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.BlobShape";
   }
+  protected:
+  explicit BlobShape(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDimFieldNumber = 1,
+  };
   // repeated int64 dim = 1 [packed = true];
   int dim_size() const;
+  private:
+  int _internal_dim_size() const;
+  public:
   void clear_dim();
-  static const int kDimFieldNumber = 1;
-  ::google::protobuf::int64 dim(int index) const;
-  void set_dim(int index, ::google::protobuf::int64 value);
-  void add_dim(::google::protobuf::int64 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+  private:
+  int64_t _internal_dim(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+      _internal_dim() const;
+  void _internal_add_dim(int64_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+      _internal_mutable_dim();
+  public:
+  int64_t dim(int index) const;
+  void set_dim(int index, int64_t value);
+  void add_dim(int64_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
       dim() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
       mutable_dim();
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.BlobShape)
  private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dim_;
-  mutable int _dim_cached_byte_size_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobShapeImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t > dim_;
+  mutable std::atomic<int> _dim_cached_byte_size_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class BlobProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BlobProto) */ {
+class BlobProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BlobProto) */ {
  public:
-  BlobProto();
-  virtual ~BlobProto();
+  inline BlobProto() : BlobProto(nullptr) {}
+  ~BlobProto() override;
+  explicit constexpr BlobProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   BlobProto(const BlobProto& from);
-
-  inline BlobProto& operator=(const BlobProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   BlobProto(BlobProto&& from) noexcept
     : BlobProto() {
     *this = ::std::move(from);
   }
 
+  inline BlobProto& operator=(const BlobProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline BlobProto& operator=(BlobProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const BlobProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const BlobProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const BlobProto* internal_default_instance() {
     return reinterpret_cast<const BlobProto*>(
                &_BlobProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     1;
 
-  void Swap(BlobProto* other);
   friend void swap(BlobProto& a, BlobProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(BlobProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(BlobProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline BlobProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  BlobProto* 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;
+  BlobProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<BlobProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const BlobProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const BlobProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(BlobProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.BlobProto";
   }
+  protected:
+  explicit BlobProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDataFieldNumber = 5,
+    kDiffFieldNumber = 6,
+    kDoubleDataFieldNumber = 8,
+    kDoubleDiffFieldNumber = 9,
+    kRawDataFieldNumber = 12,
+    kShapeFieldNumber = 7,
+    kNumFieldNumber = 1,
+    kChannelsFieldNumber = 2,
+    kHeightFieldNumber = 3,
+    kWidthFieldNumber = 4,
+    kRawDataTypeFieldNumber = 10,
+  };
   // repeated float data = 5 [packed = true];
   int data_size() const;
+  private:
+  int _internal_data_size() const;
+  public:
   void clear_data();
-  static const int kDataFieldNumber = 5;
+  private:
+  float _internal_data(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_data() const;
+  void _internal_add_data(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_data();
+  public:
   float data(int index) const;
   void set_data(int index, float value);
   void add_data(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       data() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_data();
 
   // repeated float diff = 6 [packed = true];
   int diff_size() const;
+  private:
+  int _internal_diff_size() const;
+  public:
   void clear_diff();
-  static const int kDiffFieldNumber = 6;
+  private:
+  float _internal_diff(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_diff() const;
+  void _internal_add_diff(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_diff();
+  public:
   float diff(int index) const;
   void set_diff(int index, float value);
   void add_diff(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       diff() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_diff();
 
   // repeated double double_data = 8 [packed = true];
   int double_data_size() const;
+  private:
+  int _internal_double_data_size() const;
+  public:
   void clear_double_data();
-  static const int kDoubleDataFieldNumber = 8;
+  private:
+  double _internal_double_data(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+      _internal_double_data() const;
+  void _internal_add_double_data(double value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+      _internal_mutable_double_data();
+  public:
   double double_data(int index) const;
   void set_double_data(int index, double value);
   void add_double_data(double value);
-  const ::google::protobuf::RepeatedField< double >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
       double_data() const;
-  ::google::protobuf::RepeatedField< double >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
       mutable_double_data();
 
   // repeated double double_diff = 9 [packed = true];
   int double_diff_size() const;
+  private:
+  int _internal_double_diff_size() const;
+  public:
   void clear_double_diff();
-  static const int kDoubleDiffFieldNumber = 9;
+  private:
+  double _internal_double_diff(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+      _internal_double_diff() const;
+  void _internal_add_double_diff(double value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+      _internal_mutable_double_diff();
+  public:
   double double_diff(int index) const;
   void set_double_diff(int index, double value);
   void add_double_diff(double value);
-  const ::google::protobuf::RepeatedField< double >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
       double_diff() const;
-  ::google::protobuf::RepeatedField< double >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
       mutable_double_diff();
 
   // optional bytes raw_data = 12 [packed = false];
   bool has_raw_data() const;
+  private:
+  bool _internal_has_raw_data() const;
+  public:
   void clear_raw_data();
-  static const int kRawDataFieldNumber = 12;
-  const ::std::string& raw_data() const;
-  void set_raw_data(const ::std::string& value);
-  #if LANG_CXX11
-  void set_raw_data(::std::string&& value);
-  #endif
-  void set_raw_data(const char* value);
-  void set_raw_data(const void* value, size_t size);
-  ::std::string* mutable_raw_data();
-  ::std::string* release_raw_data();
-  void set_allocated_raw_data(::std::string* raw_data);
+  const std::string& raw_data() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_raw_data(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_raw_data();
+  PROTOBUF_NODISCARD std::string* release_raw_data();
+  void set_allocated_raw_data(std::string* raw_data);
+  private:
+  const std::string& _internal_raw_data() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_raw_data(const std::string& value);
+  std::string* _internal_mutable_raw_data();
+  public:
 
   // optional .opencv_caffe.BlobShape shape = 7;
   bool has_shape() const;
+  private:
+  bool _internal_has_shape() const;
+  public:
   void clear_shape();
-  static const int kShapeFieldNumber = 7;
   const ::opencv_caffe::BlobShape& shape() const;
-  ::opencv_caffe::BlobShape* release_shape();
+  PROTOBUF_NODISCARD ::opencv_caffe::BlobShape* release_shape();
   ::opencv_caffe::BlobShape* mutable_shape();
   void set_allocated_shape(::opencv_caffe::BlobShape* shape);
+  private:
+  const ::opencv_caffe::BlobShape& _internal_shape() const;
+  ::opencv_caffe::BlobShape* _internal_mutable_shape();
+  public:
+  void unsafe_arena_set_allocated_shape(
+      ::opencv_caffe::BlobShape* shape);
+  ::opencv_caffe::BlobShape* unsafe_arena_release_shape();
 
   // optional int32 num = 1 [default = 0];
   bool has_num() const;
+  private:
+  bool _internal_has_num() const;
+  public:
   void clear_num();
-  static const int kNumFieldNumber = 1;
-  ::google::protobuf::int32 num() const;
-  void set_num(::google::protobuf::int32 value);
+  int32_t num() const;
+  void set_num(int32_t value);
+  private:
+  int32_t _internal_num() const;
+  void _internal_set_num(int32_t value);
+  public:
 
   // optional int32 channels = 2 [default = 0];
   bool has_channels() const;
+  private:
+  bool _internal_has_channels() const;
+  public:
   void clear_channels();
-  static const int kChannelsFieldNumber = 2;
-  ::google::protobuf::int32 channels() const;
-  void set_channels(::google::protobuf::int32 value);
+  int32_t channels() const;
+  void set_channels(int32_t value);
+  private:
+  int32_t _internal_channels() const;
+  void _internal_set_channels(int32_t value);
+  public:
 
   // optional int32 height = 3 [default = 0];
   bool has_height() const;
+  private:
+  bool _internal_has_height() const;
+  public:
   void clear_height();
-  static const int kHeightFieldNumber = 3;
-  ::google::protobuf::int32 height() const;
-  void set_height(::google::protobuf::int32 value);
+  int32_t height() const;
+  void set_height(int32_t value);
+  private:
+  int32_t _internal_height() const;
+  void _internal_set_height(int32_t value);
+  public:
 
   // optional int32 width = 4 [default = 0];
   bool has_width() const;
+  private:
+  bool _internal_has_width() const;
+  public:
   void clear_width();
-  static const int kWidthFieldNumber = 4;
-  ::google::protobuf::int32 width() const;
-  void set_width(::google::protobuf::int32 value);
+  int32_t width() const;
+  void set_width(int32_t value);
+  private:
+  int32_t _internal_width() const;
+  void _internal_set_width(int32_t value);
+  public:
 
   // optional .opencv_caffe.Type raw_data_type = 10;
   bool has_raw_data_type() const;
+  private:
+  bool _internal_has_raw_data_type() const;
+  public:
   void clear_raw_data_type();
-  static const int kRawDataTypeFieldNumber = 10;
   ::opencv_caffe::Type raw_data_type() const;
   void set_raw_data_type(::opencv_caffe::Type value);
+  private:
+  ::opencv_caffe::Type _internal_raw_data_type() const;
+  void _internal_set_raw_data_type(::opencv_caffe::Type value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.BlobProto)
  private:
-  void set_has_shape();
-  void clear_has_shape();
-  void set_has_raw_data_type();
-  void clear_has_raw_data_type();
-  void set_has_raw_data();
-  void clear_has_raw_data();
-  void set_has_num();
-  void clear_has_num();
-  void set_has_channels();
-  void clear_has_channels();
-  void set_has_height();
-  void clear_has_height();
-  void set_has_width();
-  void clear_has_width();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< float > data_;
-  mutable int _data_cached_byte_size_;
-  ::google::protobuf::RepeatedField< float > diff_;
-  mutable int _diff_cached_byte_size_;
-  ::google::protobuf::RepeatedField< double > double_data_;
-  mutable int _double_data_cached_byte_size_;
-  ::google::protobuf::RepeatedField< double > double_diff_;
-  mutable int _double_diff_cached_byte_size_;
-  ::google::protobuf::internal::ArenaStringPtr raw_data_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > data_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > diff_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > double_data_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > double_diff_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr raw_data_;
   ::opencv_caffe::BlobShape* shape_;
-  ::google::protobuf::int32 num_;
-  ::google::protobuf::int32 channels_;
-  ::google::protobuf::int32 height_;
-  ::google::protobuf::int32 width_;
+  int32_t num_;
+  int32_t channels_;
+  int32_t height_;
+  int32_t width_;
   int raw_data_type_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProtoImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class BlobProtoVector : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BlobProtoVector) */ {
+class BlobProtoVector final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BlobProtoVector) */ {
  public:
-  BlobProtoVector();
-  virtual ~BlobProtoVector();
+  inline BlobProtoVector() : BlobProtoVector(nullptr) {}
+  ~BlobProtoVector() override;
+  explicit constexpr BlobProtoVector(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   BlobProtoVector(const BlobProtoVector& from);
-
-  inline BlobProtoVector& operator=(const BlobProtoVector& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   BlobProtoVector(BlobProtoVector&& from) noexcept
     : BlobProtoVector() {
     *this = ::std::move(from);
   }
 
+  inline BlobProtoVector& operator=(const BlobProtoVector& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline BlobProtoVector& operator=(BlobProtoVector&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const BlobProtoVector& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const BlobProtoVector& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const BlobProtoVector* internal_default_instance() {
     return reinterpret_cast<const BlobProtoVector*>(
                &_BlobProtoVector_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     2;
 
-  void Swap(BlobProtoVector* other);
   friend void swap(BlobProtoVector& a, BlobProtoVector& b) {
     a.Swap(&b);
   }
+  inline void Swap(BlobProtoVector* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(BlobProtoVector* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline BlobProtoVector* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  BlobProtoVector* 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;
+  BlobProtoVector* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<BlobProtoVector>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const BlobProtoVector& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const BlobProtoVector& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(BlobProtoVector* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.BlobProtoVector";
   }
+  protected:
+  explicit BlobProtoVector(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kBlobsFieldNumber = 1,
+  };
   // repeated .opencv_caffe.BlobProto blobs = 1;
   int blobs_size() const;
+  private:
+  int _internal_blobs_size() const;
+  public:
   void clear_blobs();
-  static const int kBlobsFieldNumber = 1;
-  const ::opencv_caffe::BlobProto& blobs(int index) const;
   ::opencv_caffe::BlobProto* mutable_blobs(int index);
-  ::opencv_caffe::BlobProto* add_blobs();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
       mutable_blobs();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+  private:
+  const ::opencv_caffe::BlobProto& _internal_blobs(int index) const;
+  ::opencv_caffe::BlobProto* _internal_add_blobs();
+  public:
+  const ::opencv_caffe::BlobProto& blobs(int index) const;
+  ::opencv_caffe::BlobProto* add_blobs();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
       blobs() const;
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.BlobProtoVector)
  private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto > blobs_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBlobProtoVectorImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto > blobs_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class PermuteParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PermuteParameter) */ {
+class PermuteParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PermuteParameter) */ {
  public:
-  PermuteParameter();
-  virtual ~PermuteParameter();
+  inline PermuteParameter() : PermuteParameter(nullptr) {}
+  ~PermuteParameter() override;
+  explicit constexpr PermuteParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   PermuteParameter(const PermuteParameter& from);
-
-  inline PermuteParameter& operator=(const PermuteParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   PermuteParameter(PermuteParameter&& from) noexcept
     : PermuteParameter() {
     *this = ::std::move(from);
   }
 
+  inline PermuteParameter& operator=(const PermuteParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline PermuteParameter& operator=(PermuteParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const PermuteParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const PermuteParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const PermuteParameter* internal_default_instance() {
     return reinterpret_cast<const PermuteParameter*>(
                &_PermuteParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     3;
 
-  void Swap(PermuteParameter* other);
   friend void swap(PermuteParameter& a, PermuteParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(PermuteParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(PermuteParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline PermuteParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  PermuteParameter* 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;
+  PermuteParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<PermuteParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const PermuteParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const PermuteParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(PermuteParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.PermuteParameter";
   }
+  protected:
+  explicit PermuteParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kOrderFieldNumber = 1,
+  };
   // repeated uint32 order = 1;
   int order_size() const;
+  private:
+  int _internal_order_size() const;
+  public:
   void clear_order();
-  static const int kOrderFieldNumber = 1;
-  ::google::protobuf::uint32 order(int index) const;
-  void set_order(int index, ::google::protobuf::uint32 value);
-  void add_order(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_order(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_order() const;
+  void _internal_add_order(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_order();
+  public:
+  uint32_t order(int index) const;
+  void set_order(int index, uint32_t value);
+  void add_order(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       order() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_order();
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.PermuteParameter)
  private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > order_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPermuteParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > order_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NormalizeBBoxParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NormalizeBBoxParameter) */ {
+class NormalizeBBoxParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NormalizeBBoxParameter) */ {
  public:
-  NormalizeBBoxParameter();
-  virtual ~NormalizeBBoxParameter();
+  inline NormalizeBBoxParameter() : NormalizeBBoxParameter(nullptr) {}
+  ~NormalizeBBoxParameter() override;
+  explicit constexpr NormalizeBBoxParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NormalizeBBoxParameter(const NormalizeBBoxParameter& from);
-
-  inline NormalizeBBoxParameter& operator=(const NormalizeBBoxParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NormalizeBBoxParameter(NormalizeBBoxParameter&& from) noexcept
     : NormalizeBBoxParameter() {
     *this = ::std::move(from);
   }
 
+  inline NormalizeBBoxParameter& operator=(const NormalizeBBoxParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NormalizeBBoxParameter& operator=(NormalizeBBoxParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NormalizeBBoxParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NormalizeBBoxParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NormalizeBBoxParameter* internal_default_instance() {
     return reinterpret_cast<const NormalizeBBoxParameter*>(
                &_NormalizeBBoxParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     4;
 
-  void Swap(NormalizeBBoxParameter* other);
   friend void swap(NormalizeBBoxParameter& a, NormalizeBBoxParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(NormalizeBBoxParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NormalizeBBoxParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NormalizeBBoxParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NormalizeBBoxParameter* 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;
+  NormalizeBBoxParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NormalizeBBoxParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NormalizeBBoxParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NormalizeBBoxParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NormalizeBBoxParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.NormalizeBBoxParameter";
   }
+  protected:
+  explicit NormalizeBBoxParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kScaleFillerFieldNumber = 2,
+    kAcrossSpatialFieldNumber = 1,
+    kChannelSharedFieldNumber = 3,
+    kEpsFieldNumber = 4,
+  };
   // optional .opencv_caffe.FillerParameter scale_filler = 2;
   bool has_scale_filler() const;
+  private:
+  bool _internal_has_scale_filler() const;
+  public:
   void clear_scale_filler();
-  static const int kScaleFillerFieldNumber = 2;
   const ::opencv_caffe::FillerParameter& scale_filler() const;
-  ::opencv_caffe::FillerParameter* release_scale_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_scale_filler();
   ::opencv_caffe::FillerParameter* mutable_scale_filler();
   void set_allocated_scale_filler(::opencv_caffe::FillerParameter* scale_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_scale_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_scale_filler();
+  public:
+  void unsafe_arena_set_allocated_scale_filler(
+      ::opencv_caffe::FillerParameter* scale_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_scale_filler();
 
   // optional bool across_spatial = 1 [default = true];
   bool has_across_spatial() const;
+  private:
+  bool _internal_has_across_spatial() const;
+  public:
   void clear_across_spatial();
-  static const int kAcrossSpatialFieldNumber = 1;
   bool across_spatial() const;
   void set_across_spatial(bool value);
+  private:
+  bool _internal_across_spatial() const;
+  void _internal_set_across_spatial(bool value);
+  public:
 
   // optional bool channel_shared = 3 [default = true];
   bool has_channel_shared() const;
+  private:
+  bool _internal_has_channel_shared() const;
+  public:
   void clear_channel_shared();
-  static const int kChannelSharedFieldNumber = 3;
   bool channel_shared() const;
   void set_channel_shared(bool value);
+  private:
+  bool _internal_channel_shared() const;
+  void _internal_set_channel_shared(bool value);
+  public:
 
   // optional float eps = 4 [default = 1e-10];
   bool has_eps() const;
+  private:
+  bool _internal_has_eps() const;
+  public:
   void clear_eps();
-  static const int kEpsFieldNumber = 4;
   float eps() const;
   void set_eps(float value);
+  private:
+  float _internal_eps() const;
+  void _internal_set_eps(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.NormalizeBBoxParameter)
  private:
-  void set_has_across_spatial();
-  void clear_has_across_spatial();
-  void set_has_scale_filler();
-  void clear_has_scale_filler();
-  void set_has_channel_shared();
-  void clear_has_channel_shared();
-  void set_has_eps();
-  void clear_has_eps();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::FillerParameter* scale_filler_;
   bool across_spatial_;
   bool channel_shared_;
   float eps_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNormalizeBBoxParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class PriorBoxParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PriorBoxParameter) */ {
+class PriorBoxParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PriorBoxParameter) */ {
  public:
-  PriorBoxParameter();
-  virtual ~PriorBoxParameter();
+  inline PriorBoxParameter() : PriorBoxParameter(nullptr) {}
+  ~PriorBoxParameter() override;
+  explicit constexpr PriorBoxParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   PriorBoxParameter(const PriorBoxParameter& from);
-
-  inline PriorBoxParameter& operator=(const PriorBoxParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   PriorBoxParameter(PriorBoxParameter&& from) noexcept
     : PriorBoxParameter() {
     *this = ::std::move(from);
   }
 
+  inline PriorBoxParameter& operator=(const PriorBoxParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline PriorBoxParameter& operator=(PriorBoxParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const PriorBoxParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const PriorBoxParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const PriorBoxParameter* internal_default_instance() {
     return reinterpret_cast<const PriorBoxParameter*>(
                &_PriorBoxParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     5;
 
-  void Swap(PriorBoxParameter* other);
   friend void swap(PriorBoxParameter& a, PriorBoxParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(PriorBoxParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(PriorBoxParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline PriorBoxParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  PriorBoxParameter* 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;
+  PriorBoxParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<PriorBoxParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const PriorBoxParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const PriorBoxParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(PriorBoxParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.PriorBoxParameter";
   }
+  protected:
+  explicit PriorBoxParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef PriorBoxParameter_CodeType CodeType;
-  static const CodeType CORNER =
+  static constexpr CodeType CORNER =
     PriorBoxParameter_CodeType_CORNER;
-  static const CodeType CENTER_SIZE =
+  static constexpr CodeType CENTER_SIZE =
     PriorBoxParameter_CodeType_CENTER_SIZE;
   static inline bool CodeType_IsValid(int value) {
     return PriorBoxParameter_CodeType_IsValid(value);
   }
-  static const CodeType CodeType_MIN =
+  static constexpr CodeType CodeType_MIN =
     PriorBoxParameter_CodeType_CodeType_MIN;
-  static const CodeType CodeType_MAX =
+  static constexpr CodeType CodeType_MAX =
     PriorBoxParameter_CodeType_CodeType_MAX;
-  static const int CodeType_ARRAYSIZE =
+  static constexpr int CodeType_ARRAYSIZE =
     PriorBoxParameter_CodeType_CodeType_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   CodeType_descriptor() {
     return PriorBoxParameter_CodeType_descriptor();
   }
-  static inline const ::std::string& CodeType_Name(CodeType value) {
-    return PriorBoxParameter_CodeType_Name(value);
+  template<typename T>
+  static inline const std::string& CodeType_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, CodeType>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function CodeType_Name.");
+    return PriorBoxParameter_CodeType_Name(enum_t_value);
   }
-  static inline bool CodeType_Parse(const ::std::string& name,
+  static inline bool CodeType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       CodeType* value) {
     return PriorBoxParameter_CodeType_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kMinSizeFieldNumber = 1,
+    kMaxSizeFieldNumber = 2,
+    kAspectRatioFieldNumber = 3,
+    kVarianceFieldNumber = 6,
+    kOffsetHFieldNumber = 14,
+    kOffsetWFieldNumber = 15,
+    kWidthFieldNumber = 16,
+    kHeightFieldNumber = 17,
+    kImgSizeFieldNumber = 7,
+    kImgHFieldNumber = 8,
+    kImgWFieldNumber = 9,
+    kStepFieldNumber = 10,
+    kStepHFieldNumber = 11,
+    kStepWFieldNumber = 12,
+    kFlipFieldNumber = 4,
+    kClipFieldNumber = 5,
+    kOffsetFieldNumber = 13,
+  };
   // repeated float min_size = 1;
   int min_size_size() const;
+  private:
+  int _internal_min_size_size() const;
+  public:
   void clear_min_size();
-  static const int kMinSizeFieldNumber = 1;
+  private:
+  float _internal_min_size(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_min_size() const;
+  void _internal_add_min_size(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_min_size();
+  public:
   float min_size(int index) const;
   void set_min_size(int index, float value);
   void add_min_size(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       min_size() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_min_size();
 
   // repeated float max_size = 2;
   int max_size_size() const;
+  private:
+  int _internal_max_size_size() const;
+  public:
   void clear_max_size();
-  static const int kMaxSizeFieldNumber = 2;
+  private:
+  float _internal_max_size(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_max_size() const;
+  void _internal_add_max_size(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_max_size();
+  public:
   float max_size(int index) const;
   void set_max_size(int index, float value);
   void add_max_size(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       max_size() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_max_size();
 
   // repeated float aspect_ratio = 3;
   int aspect_ratio_size() const;
+  private:
+  int _internal_aspect_ratio_size() const;
+  public:
   void clear_aspect_ratio();
-  static const int kAspectRatioFieldNumber = 3;
+  private:
+  float _internal_aspect_ratio(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_aspect_ratio() const;
+  void _internal_add_aspect_ratio(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_aspect_ratio();
+  public:
   float aspect_ratio(int index) const;
   void set_aspect_ratio(int index, float value);
   void add_aspect_ratio(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       aspect_ratio() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_aspect_ratio();
 
   // repeated float variance = 6;
   int variance_size() const;
+  private:
+  int _internal_variance_size() const;
+  public:
   void clear_variance();
-  static const int kVarianceFieldNumber = 6;
+  private:
+  float _internal_variance(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_variance() const;
+  void _internal_add_variance(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_variance();
+  public:
   float variance(int index) const;
   void set_variance(int index, float value);
   void add_variance(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       variance() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_variance();
 
   // repeated float offset_h = 14;
   int offset_h_size() const;
+  private:
+  int _internal_offset_h_size() const;
+  public:
   void clear_offset_h();
-  static const int kOffsetHFieldNumber = 14;
+  private:
+  float _internal_offset_h(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_offset_h() const;
+  void _internal_add_offset_h(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_offset_h();
+  public:
   float offset_h(int index) const;
   void set_offset_h(int index, float value);
   void add_offset_h(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       offset_h() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_offset_h();
 
   // repeated float offset_w = 15;
   int offset_w_size() const;
+  private:
+  int _internal_offset_w_size() const;
+  public:
   void clear_offset_w();
-  static const int kOffsetWFieldNumber = 15;
+  private:
+  float _internal_offset_w(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_offset_w() const;
+  void _internal_add_offset_w(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_offset_w();
+  public:
   float offset_w(int index) const;
   void set_offset_w(int index, float value);
   void add_offset_w(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       offset_w() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_offset_w();
 
   // repeated float width = 16;
   int width_size() const;
+  private:
+  int _internal_width_size() const;
+  public:
   void clear_width();
-  static const int kWidthFieldNumber = 16;
+  private:
+  float _internal_width(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_width() const;
+  void _internal_add_width(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_width();
+  public:
   float width(int index) const;
   void set_width(int index, float value);
   void add_width(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       width() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_width();
 
   // repeated float height = 17;
   int height_size() const;
+  private:
+  int _internal_height_size() const;
+  public:
   void clear_height();
-  static const int kHeightFieldNumber = 17;
+  private:
+  float _internal_height(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_height() const;
+  void _internal_add_height(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_height();
+  public:
   float height(int index) const;
   void set_height(int index, float value);
   void add_height(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       height() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_height();
 
   // optional uint32 img_size = 7;
   bool has_img_size() const;
+  private:
+  bool _internal_has_img_size() const;
+  public:
   void clear_img_size();
-  static const int kImgSizeFieldNumber = 7;
-  ::google::protobuf::uint32 img_size() const;
-  void set_img_size(::google::protobuf::uint32 value);
+  uint32_t img_size() const;
+  void set_img_size(uint32_t value);
+  private:
+  uint32_t _internal_img_size() const;
+  void _internal_set_img_size(uint32_t value);
+  public:
 
   // optional uint32 img_h = 8;
   bool has_img_h() const;
+  private:
+  bool _internal_has_img_h() const;
+  public:
   void clear_img_h();
-  static const int kImgHFieldNumber = 8;
-  ::google::protobuf::uint32 img_h() const;
-  void set_img_h(::google::protobuf::uint32 value);
+  uint32_t img_h() const;
+  void set_img_h(uint32_t value);
+  private:
+  uint32_t _internal_img_h() const;
+  void _internal_set_img_h(uint32_t value);
+  public:
 
   // optional uint32 img_w = 9;
   bool has_img_w() const;
+  private:
+  bool _internal_has_img_w() const;
+  public:
   void clear_img_w();
-  static const int kImgWFieldNumber = 9;
-  ::google::protobuf::uint32 img_w() const;
-  void set_img_w(::google::protobuf::uint32 value);
+  uint32_t img_w() const;
+  void set_img_w(uint32_t value);
+  private:
+  uint32_t _internal_img_w() const;
+  void _internal_set_img_w(uint32_t value);
+  public:
 
   // optional float step = 10;
   bool has_step() const;
+  private:
+  bool _internal_has_step() const;
+  public:
   void clear_step();
-  static const int kStepFieldNumber = 10;
   float step() const;
   void set_step(float value);
+  private:
+  float _internal_step() const;
+  void _internal_set_step(float value);
+  public:
 
   // optional float step_h = 11;
   bool has_step_h() const;
+  private:
+  bool _internal_has_step_h() const;
+  public:
   void clear_step_h();
-  static const int kStepHFieldNumber = 11;
   float step_h() const;
   void set_step_h(float value);
+  private:
+  float _internal_step_h() const;
+  void _internal_set_step_h(float value);
+  public:
 
   // optional float step_w = 12;
   bool has_step_w() const;
+  private:
+  bool _internal_has_step_w() const;
+  public:
   void clear_step_w();
-  static const int kStepWFieldNumber = 12;
   float step_w() const;
   void set_step_w(float value);
+  private:
+  float _internal_step_w() const;
+  void _internal_set_step_w(float value);
+  public:
 
   // optional bool flip = 4 [default = true];
   bool has_flip() const;
+  private:
+  bool _internal_has_flip() const;
+  public:
   void clear_flip();
-  static const int kFlipFieldNumber = 4;
   bool flip() const;
   void set_flip(bool value);
+  private:
+  bool _internal_flip() const;
+  void _internal_set_flip(bool value);
+  public:
 
   // optional bool clip = 5 [default = true];
   bool has_clip() const;
+  private:
+  bool _internal_has_clip() const;
+  public:
   void clear_clip();
-  static const int kClipFieldNumber = 5;
   bool clip() const;
   void set_clip(bool value);
+  private:
+  bool _internal_clip() const;
+  void _internal_set_clip(bool value);
+  public:
 
   // optional float offset = 13 [default = 0.5];
   bool has_offset() const;
+  private:
+  bool _internal_has_offset() const;
+  public:
   void clear_offset();
-  static const int kOffsetFieldNumber = 13;
   float offset() const;
   void set_offset(float value);
+  private:
+  float _internal_offset() const;
+  void _internal_set_offset(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.PriorBoxParameter)
  private:
-  void set_has_flip();
-  void clear_has_flip();
-  void set_has_clip();
-  void clear_has_clip();
-  void set_has_img_size();
-  void clear_has_img_size();
-  void set_has_img_h();
-  void clear_has_img_h();
-  void set_has_img_w();
-  void clear_has_img_w();
-  void set_has_step();
-  void clear_has_step();
-  void set_has_step_h();
-  void clear_has_step_h();
-  void set_has_step_w();
-  void clear_has_step_w();
-  void set_has_offset();
-  void clear_has_offset();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< float > min_size_;
-  ::google::protobuf::RepeatedField< float > max_size_;
-  ::google::protobuf::RepeatedField< float > aspect_ratio_;
-  ::google::protobuf::RepeatedField< float > variance_;
-  ::google::protobuf::RepeatedField< float > offset_h_;
-  ::google::protobuf::RepeatedField< float > offset_w_;
-  ::google::protobuf::RepeatedField< float > width_;
-  ::google::protobuf::RepeatedField< float > height_;
-  ::google::protobuf::uint32 img_size_;
-  ::google::protobuf::uint32 img_h_;
-  ::google::protobuf::uint32 img_w_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > min_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > max_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > aspect_ratio_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > variance_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > offset_h_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > offset_w_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > width_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > height_;
+  uint32_t img_size_;
+  uint32_t img_h_;
+  uint32_t img_w_;
   float step_;
   float step_h_;
   float step_w_;
   bool flip_;
   bool clip_;
   float offset_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPriorBoxParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class DetectionOutputParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.DetectionOutputParameter) */ {
+class DetectionOutputParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.DetectionOutputParameter) */ {
  public:
-  DetectionOutputParameter();
-  virtual ~DetectionOutputParameter();
+  inline DetectionOutputParameter() : DetectionOutputParameter(nullptr) {}
+  ~DetectionOutputParameter() override;
+  explicit constexpr DetectionOutputParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   DetectionOutputParameter(const DetectionOutputParameter& from);
-
-  inline DetectionOutputParameter& operator=(const DetectionOutputParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   DetectionOutputParameter(DetectionOutputParameter&& from) noexcept
     : DetectionOutputParameter() {
     *this = ::std::move(from);
   }
 
+  inline DetectionOutputParameter& operator=(const DetectionOutputParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline DetectionOutputParameter& operator=(DetectionOutputParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const DetectionOutputParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const DetectionOutputParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const DetectionOutputParameter* internal_default_instance() {
     return reinterpret_cast<const DetectionOutputParameter*>(
                &_DetectionOutputParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     6;
 
-  void Swap(DetectionOutputParameter* other);
   friend void swap(DetectionOutputParameter& a, DetectionOutputParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(DetectionOutputParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(DetectionOutputParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline DetectionOutputParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  DetectionOutputParameter* 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;
+  DetectionOutputParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<DetectionOutputParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const DetectionOutputParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const DetectionOutputParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(DetectionOutputParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.DetectionOutputParameter";
   }
+  protected:
+  explicit DetectionOutputParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNmsParamFieldNumber = 4,
+    kSaveOutputParamFieldNumber = 5,
+    kNumClassesFieldNumber = 1,
+    kBackgroundLabelIdFieldNumber = 3,
+    kConfidenceThresholdFieldNumber = 9,
+    kVarianceEncodedInTargetFieldNumber = 8,
+    kClipFieldNumber = 1000,
+    kKeepTopKFieldNumber = 7,
+    kCodeTypeFieldNumber = 6,
+    kShareLocationFieldNumber = 2,
+    kNormalizedBboxFieldNumber = 10,
+  };
   // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
   bool has_nms_param() const;
+  private:
+  bool _internal_has_nms_param() const;
+  public:
   void clear_nms_param();
-  static const int kNmsParamFieldNumber = 4;
   const ::opencv_caffe::NonMaximumSuppressionParameter& nms_param() const;
-  ::opencv_caffe::NonMaximumSuppressionParameter* release_nms_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::NonMaximumSuppressionParameter* release_nms_param();
   ::opencv_caffe::NonMaximumSuppressionParameter* mutable_nms_param();
   void set_allocated_nms_param(::opencv_caffe::NonMaximumSuppressionParameter* nms_param);
+  private:
+  const ::opencv_caffe::NonMaximumSuppressionParameter& _internal_nms_param() const;
+  ::opencv_caffe::NonMaximumSuppressionParameter* _internal_mutable_nms_param();
+  public:
+  void unsafe_arena_set_allocated_nms_param(
+      ::opencv_caffe::NonMaximumSuppressionParameter* nms_param);
+  ::opencv_caffe::NonMaximumSuppressionParameter* unsafe_arena_release_nms_param();
 
   // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
   bool has_save_output_param() const;
+  private:
+  bool _internal_has_save_output_param() const;
+  public:
   void clear_save_output_param();
-  static const int kSaveOutputParamFieldNumber = 5;
   const ::opencv_caffe::SaveOutputParameter& save_output_param() const;
-  ::opencv_caffe::SaveOutputParameter* release_save_output_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::SaveOutputParameter* release_save_output_param();
   ::opencv_caffe::SaveOutputParameter* mutable_save_output_param();
   void set_allocated_save_output_param(::opencv_caffe::SaveOutputParameter* save_output_param);
+  private:
+  const ::opencv_caffe::SaveOutputParameter& _internal_save_output_param() const;
+  ::opencv_caffe::SaveOutputParameter* _internal_mutable_save_output_param();
+  public:
+  void unsafe_arena_set_allocated_save_output_param(
+      ::opencv_caffe::SaveOutputParameter* save_output_param);
+  ::opencv_caffe::SaveOutputParameter* unsafe_arena_release_save_output_param();
 
   // optional uint32 num_classes = 1;
   bool has_num_classes() const;
+  private:
+  bool _internal_has_num_classes() const;
+  public:
   void clear_num_classes();
-  static const int kNumClassesFieldNumber = 1;
-  ::google::protobuf::uint32 num_classes() const;
-  void set_num_classes(::google::protobuf::uint32 value);
+  uint32_t num_classes() const;
+  void set_num_classes(uint32_t value);
+  private:
+  uint32_t _internal_num_classes() const;
+  void _internal_set_num_classes(uint32_t value);
+  public:
 
   // optional int32 background_label_id = 3 [default = 0];
   bool has_background_label_id() const;
+  private:
+  bool _internal_has_background_label_id() const;
+  public:
   void clear_background_label_id();
-  static const int kBackgroundLabelIdFieldNumber = 3;
-  ::google::protobuf::int32 background_label_id() const;
-  void set_background_label_id(::google::protobuf::int32 value);
+  int32_t background_label_id() const;
+  void set_background_label_id(int32_t value);
+  private:
+  int32_t _internal_background_label_id() const;
+  void _internal_set_background_label_id(int32_t value);
+  public:
+
+  // optional float confidence_threshold = 9;
+  bool has_confidence_threshold() const;
+  private:
+  bool _internal_has_confidence_threshold() const;
+  public:
+  void clear_confidence_threshold();
+  float confidence_threshold() const;
+  void set_confidence_threshold(float value);
+  private:
+  float _internal_confidence_threshold() const;
+  void _internal_set_confidence_threshold(float value);
+  public:
 
   // optional bool variance_encoded_in_target = 8 [default = false];
   bool has_variance_encoded_in_target() const;
+  private:
+  bool _internal_has_variance_encoded_in_target() const;
+  public:
   void clear_variance_encoded_in_target();
-  static const int kVarianceEncodedInTargetFieldNumber = 8;
   bool variance_encoded_in_target() const;
   void set_variance_encoded_in_target(bool value);
+  private:
+  bool _internal_variance_encoded_in_target() const;
+  void _internal_set_variance_encoded_in_target(bool value);
+  public:
 
-  // optional float confidence_threshold = 9;
-  bool has_confidence_threshold() const;
-  void clear_confidence_threshold();
-  static const int kConfidenceThresholdFieldNumber = 9;
-  float confidence_threshold() const;
-  void set_confidence_threshold(float value);
+  // optional bool clip = 1000 [default = false];
+  bool has_clip() const;
+  private:
+  bool _internal_has_clip() const;
+  public:
+  void clear_clip();
+  bool clip() const;
+  void set_clip(bool value);
+  private:
+  bool _internal_clip() const;
+  void _internal_set_clip(bool value);
+  public:
 
   // optional int32 keep_top_k = 7 [default = -1];
   bool has_keep_top_k() const;
+  private:
+  bool _internal_has_keep_top_k() const;
+  public:
   void clear_keep_top_k();
-  static const int kKeepTopKFieldNumber = 7;
-  ::google::protobuf::int32 keep_top_k() const;
-  void set_keep_top_k(::google::protobuf::int32 value);
+  int32_t keep_top_k() const;
+  void set_keep_top_k(int32_t value);
+  private:
+  int32_t _internal_keep_top_k() const;
+  void _internal_set_keep_top_k(int32_t value);
+  public:
 
   // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
   bool has_code_type() const;
+  private:
+  bool _internal_has_code_type() const;
+  public:
   void clear_code_type();
-  static const int kCodeTypeFieldNumber = 6;
   ::opencv_caffe::PriorBoxParameter_CodeType code_type() const;
   void set_code_type(::opencv_caffe::PriorBoxParameter_CodeType value);
+  private:
+  ::opencv_caffe::PriorBoxParameter_CodeType _internal_code_type() const;
+  void _internal_set_code_type(::opencv_caffe::PriorBoxParameter_CodeType value);
+  public:
 
   // optional bool share_location = 2 [default = true];
   bool has_share_location() const;
+  private:
+  bool _internal_has_share_location() const;
+  public:
   void clear_share_location();
-  static const int kShareLocationFieldNumber = 2;
   bool share_location() const;
   void set_share_location(bool value);
+  private:
+  bool _internal_share_location() const;
+  void _internal_set_share_location(bool value);
+  public:
 
   // optional bool normalized_bbox = 10 [default = true];
   bool has_normalized_bbox() const;
+  private:
+  bool _internal_has_normalized_bbox() const;
+  public:
   void clear_normalized_bbox();
-  static const int kNormalizedBboxFieldNumber = 10;
   bool normalized_bbox() const;
   void set_normalized_bbox(bool value);
+  private:
+  bool _internal_normalized_bbox() const;
+  void _internal_set_normalized_bbox(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.DetectionOutputParameter)
  private:
-  void set_has_num_classes();
-  void clear_has_num_classes();
-  void set_has_share_location();
-  void clear_has_share_location();
-  void set_has_background_label_id();
-  void clear_has_background_label_id();
-  void set_has_nms_param();
-  void clear_has_nms_param();
-  void set_has_save_output_param();
-  void clear_has_save_output_param();
-  void set_has_code_type();
-  void clear_has_code_type();
-  void set_has_variance_encoded_in_target();
-  void clear_has_variance_encoded_in_target();
-  void set_has_keep_top_k();
-  void clear_has_keep_top_k();
-  void set_has_confidence_threshold();
-  void clear_has_confidence_threshold();
-  void set_has_normalized_bbox();
-  void clear_has_normalized_bbox();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::NonMaximumSuppressionParameter* nms_param_;
   ::opencv_caffe::SaveOutputParameter* save_output_param_;
-  ::google::protobuf::uint32 num_classes_;
-  ::google::protobuf::int32 background_label_id_;
-  bool variance_encoded_in_target_;
+  uint32_t num_classes_;
+  int32_t background_label_id_;
   float confidence_threshold_;
-  ::google::protobuf::int32 keep_top_k_;
+  bool variance_encoded_in_target_;
+  bool clip_;
+  int32_t keep_top_k_;
   int code_type_;
   bool share_location_;
   bool normalized_bbox_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDetectionOutputParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class Datum : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.Datum) */ {
+class Datum final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.Datum) */ {
  public:
-  Datum();
-  virtual ~Datum();
+  inline Datum() : Datum(nullptr) {}
+  ~Datum() override;
+  explicit constexpr Datum(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   Datum(const Datum& from);
-
-  inline Datum& operator=(const Datum& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   Datum(Datum&& from) noexcept
     : Datum() {
     *this = ::std::move(from);
   }
 
+  inline Datum& operator=(const Datum& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline Datum& operator=(Datum&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const Datum& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const Datum& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const Datum* internal_default_instance() {
     return reinterpret_cast<const Datum*>(
                &_Datum_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     7;
 
-  void Swap(Datum* other);
   friend void swap(Datum& a, Datum& b) {
     a.Swap(&b);
   }
+  inline void Swap(Datum* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(Datum* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline Datum* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  Datum* 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;
+  Datum* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<Datum>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const Datum& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const Datum& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(Datum* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.Datum";
   }
+  protected:
+  explicit Datum(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFloatDataFieldNumber = 6,
+    kDataFieldNumber = 4,
+    kChannelsFieldNumber = 1,
+    kHeightFieldNumber = 2,
+    kWidthFieldNumber = 3,
+    kLabelFieldNumber = 5,
+    kEncodedFieldNumber = 7,
+  };
   // repeated float float_data = 6;
   int float_data_size() const;
+  private:
+  int _internal_float_data_size() const;
+  public:
   void clear_float_data();
-  static const int kFloatDataFieldNumber = 6;
+  private:
+  float _internal_float_data(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_float_data() const;
+  void _internal_add_float_data(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_float_data();
+  public:
   float float_data(int index) const;
   void set_float_data(int index, float value);
   void add_float_data(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       float_data() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_float_data();
 
   // optional bytes data = 4;
   bool has_data() const;
+  private:
+  bool _internal_has_data() const;
+  public:
   void clear_data();
-  static const int kDataFieldNumber = 4;
-  const ::std::string& data() const;
-  void set_data(const ::std::string& value);
-  #if LANG_CXX11
-  void set_data(::std::string&& value);
-  #endif
-  void set_data(const char* value);
-  void set_data(const void* value, size_t size);
-  ::std::string* mutable_data();
-  ::std::string* release_data();
-  void set_allocated_data(::std::string* data);
+  const std::string& data() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_data(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_data();
+  PROTOBUF_NODISCARD std::string* release_data();
+  void set_allocated_data(std::string* data);
+  private:
+  const std::string& _internal_data() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(const std::string& value);
+  std::string* _internal_mutable_data();
+  public:
 
   // optional int32 channels = 1;
   bool has_channels() const;
+  private:
+  bool _internal_has_channels() const;
+  public:
   void clear_channels();
-  static const int kChannelsFieldNumber = 1;
-  ::google::protobuf::int32 channels() const;
-  void set_channels(::google::protobuf::int32 value);
+  int32_t channels() const;
+  void set_channels(int32_t value);
+  private:
+  int32_t _internal_channels() const;
+  void _internal_set_channels(int32_t value);
+  public:
 
   // optional int32 height = 2;
   bool has_height() const;
+  private:
+  bool _internal_has_height() const;
+  public:
   void clear_height();
-  static const int kHeightFieldNumber = 2;
-  ::google::protobuf::int32 height() const;
-  void set_height(::google::protobuf::int32 value);
+  int32_t height() const;
+  void set_height(int32_t value);
+  private:
+  int32_t _internal_height() const;
+  void _internal_set_height(int32_t value);
+  public:
 
   // optional int32 width = 3;
   bool has_width() const;
+  private:
+  bool _internal_has_width() const;
+  public:
   void clear_width();
-  static const int kWidthFieldNumber = 3;
-  ::google::protobuf::int32 width() const;
-  void set_width(::google::protobuf::int32 value);
+  int32_t width() const;
+  void set_width(int32_t value);
+  private:
+  int32_t _internal_width() const;
+  void _internal_set_width(int32_t value);
+  public:
 
   // optional int32 label = 5;
   bool has_label() const;
+  private:
+  bool _internal_has_label() const;
+  public:
   void clear_label();
-  static const int kLabelFieldNumber = 5;
-  ::google::protobuf::int32 label() const;
-  void set_label(::google::protobuf::int32 value);
+  int32_t label() const;
+  void set_label(int32_t value);
+  private:
+  int32_t _internal_label() const;
+  void _internal_set_label(int32_t value);
+  public:
 
   // optional bool encoded = 7 [default = false];
   bool has_encoded() const;
+  private:
+  bool _internal_has_encoded() const;
+  public:
   void clear_encoded();
-  static const int kEncodedFieldNumber = 7;
   bool encoded() const;
   void set_encoded(bool value);
+  private:
+  bool _internal_encoded() const;
+  void _internal_set_encoded(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.Datum)
  private:
-  void set_has_channels();
-  void clear_has_channels();
-  void set_has_height();
-  void clear_has_height();
-  void set_has_width();
-  void clear_has_width();
-  void set_has_data();
-  void clear_has_data();
-  void set_has_label();
-  void clear_has_label();
-  void set_has_encoded();
-  void clear_has_encoded();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< float > float_data_;
-  ::google::protobuf::internal::ArenaStringPtr data_;
-  ::google::protobuf::int32 channels_;
-  ::google::protobuf::int32 height_;
-  ::google::protobuf::int32 width_;
-  ::google::protobuf::int32 label_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > float_data_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr data_;
+  int32_t channels_;
+  int32_t height_;
+  int32_t width_;
+  int32_t label_;
   bool encoded_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDatumImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class FillerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.FillerParameter) */ {
+class FillerParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.FillerParameter) */ {
  public:
-  FillerParameter();
-  virtual ~FillerParameter();
+  inline FillerParameter() : FillerParameter(nullptr) {}
+  ~FillerParameter() override;
+  explicit constexpr FillerParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FillerParameter(const FillerParameter& from);
-
-  inline FillerParameter& operator=(const FillerParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FillerParameter(FillerParameter&& from) noexcept
     : FillerParameter() {
     *this = ::std::move(from);
   }
 
+  inline FillerParameter& operator=(const FillerParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FillerParameter& operator=(FillerParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const FillerParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const FillerParameter* internal_default_instance() {
-    return reinterpret_cast<const FillerParameter*>(
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FillerParameter& default_instance() {
+    return *internal_default_instance();
+  }
+  static inline const FillerParameter* internal_default_instance() {
+    return reinterpret_cast<const FillerParameter*>(
                &_FillerParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     8;
 
-  void Swap(FillerParameter* other);
   friend void swap(FillerParameter& a, FillerParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(FillerParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FillerParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FillerParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FillerParameter* 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;
+  FillerParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FillerParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FillerParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FillerParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FillerParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.FillerParameter";
   }
+  protected:
+  explicit FillerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef FillerParameter_VarianceNorm VarianceNorm;
-  static const VarianceNorm FAN_IN =
+  static constexpr VarianceNorm FAN_IN =
     FillerParameter_VarianceNorm_FAN_IN;
-  static const VarianceNorm FAN_OUT =
+  static constexpr VarianceNorm FAN_OUT =
     FillerParameter_VarianceNorm_FAN_OUT;
-  static const VarianceNorm AVERAGE =
+  static constexpr VarianceNorm AVERAGE =
     FillerParameter_VarianceNorm_AVERAGE;
   static inline bool VarianceNorm_IsValid(int value) {
     return FillerParameter_VarianceNorm_IsValid(value);
   }
-  static const VarianceNorm VarianceNorm_MIN =
+  static constexpr VarianceNorm VarianceNorm_MIN =
     FillerParameter_VarianceNorm_VarianceNorm_MIN;
-  static const VarianceNorm VarianceNorm_MAX =
+  static constexpr VarianceNorm VarianceNorm_MAX =
     FillerParameter_VarianceNorm_VarianceNorm_MAX;
-  static const int VarianceNorm_ARRAYSIZE =
+  static constexpr int VarianceNorm_ARRAYSIZE =
     FillerParameter_VarianceNorm_VarianceNorm_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   VarianceNorm_descriptor() {
     return FillerParameter_VarianceNorm_descriptor();
   }
-  static inline const ::std::string& VarianceNorm_Name(VarianceNorm value) {
-    return FillerParameter_VarianceNorm_Name(value);
+  template<typename T>
+  static inline const std::string& VarianceNorm_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, VarianceNorm>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function VarianceNorm_Name.");
+    return FillerParameter_VarianceNorm_Name(enum_t_value);
   }
-  static inline bool VarianceNorm_Parse(const ::std::string& name,
+  static inline bool VarianceNorm_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       VarianceNorm* value) {
     return FillerParameter_VarianceNorm_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kTypeFieldNumber = 1,
+    kValueFieldNumber = 2,
+    kMinFieldNumber = 3,
+    kMeanFieldNumber = 5,
+    kVarianceNormFieldNumber = 8,
+    kSparseFieldNumber = 7,
+    kMaxFieldNumber = 4,
+    kStdFieldNumber = 6,
+  };
   // optional string type = 1 [default = "constant"];
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 1;
-  const ::std::string& type() const;
-  void set_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type(::std::string&& value);
-  #endif
-  void set_type(const char* value);
-  void set_type(const char* value, size_t size);
-  ::std::string* mutable_type();
-  ::std::string* release_type();
-  void set_allocated_type(::std::string* type);
+  const std::string& type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_type();
+  PROTOBUF_NODISCARD std::string* release_type();
+  void set_allocated_type(std::string* type);
+  private:
+  const std::string& _internal_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_type(const std::string& value);
+  std::string* _internal_mutable_type();
+  public:
 
   // optional float value = 2 [default = 0];
   bool has_value() const;
+  private:
+  bool _internal_has_value() const;
+  public:
   void clear_value();
-  static const int kValueFieldNumber = 2;
   float value() const;
   void set_value(float value);
+  private:
+  float _internal_value() const;
+  void _internal_set_value(float value);
+  public:
 
   // optional float min = 3 [default = 0];
   bool has_min() const;
+  private:
+  bool _internal_has_min() const;
+  public:
   void clear_min();
-  static const int kMinFieldNumber = 3;
   float min() const;
   void set_min(float value);
+  private:
+  float _internal_min() const;
+  void _internal_set_min(float value);
+  public:
 
   // optional float mean = 5 [default = 0];
   bool has_mean() const;
+  private:
+  bool _internal_has_mean() const;
+  public:
   void clear_mean();
-  static const int kMeanFieldNumber = 5;
   float mean() const;
   void set_mean(float value);
+  private:
+  float _internal_mean() const;
+  void _internal_set_mean(float value);
+  public:
 
   // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
   bool has_variance_norm() const;
+  private:
+  bool _internal_has_variance_norm() const;
+  public:
   void clear_variance_norm();
-  static const int kVarianceNormFieldNumber = 8;
   ::opencv_caffe::FillerParameter_VarianceNorm variance_norm() const;
   void set_variance_norm(::opencv_caffe::FillerParameter_VarianceNorm value);
+  private:
+  ::opencv_caffe::FillerParameter_VarianceNorm _internal_variance_norm() const;
+  void _internal_set_variance_norm(::opencv_caffe::FillerParameter_VarianceNorm value);
+  public:
 
   // optional int32 sparse = 7 [default = -1];
   bool has_sparse() const;
+  private:
+  bool _internal_has_sparse() const;
+  public:
   void clear_sparse();
-  static const int kSparseFieldNumber = 7;
-  ::google::protobuf::int32 sparse() const;
-  void set_sparse(::google::protobuf::int32 value);
+  int32_t sparse() const;
+  void set_sparse(int32_t value);
+  private:
+  int32_t _internal_sparse() const;
+  void _internal_set_sparse(int32_t value);
+  public:
 
   // optional float max = 4 [default = 1];
   bool has_max() const;
+  private:
+  bool _internal_has_max() const;
+  public:
   void clear_max();
-  static const int kMaxFieldNumber = 4;
   float max() const;
   void set_max(float value);
+  private:
+  float _internal_max() const;
+  void _internal_set_max(float value);
+  public:
 
   // optional float std = 6 [default = 1];
   bool has_std() const;
+  private:
+  bool _internal_has_std() const;
+  public:
   void clear_std();
-  static const int kStdFieldNumber = 6;
   float std() const;
   void set_std(float value);
+  private:
+  float _internal_std() const;
+  void _internal_set_std(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.FillerParameter)
  private:
-  void set_has_type();
-  void clear_has_type();
-  void set_has_value();
-  void clear_has_value();
-  void set_has_min();
-  void clear_has_min();
-  void set_has_max();
-  void clear_has_max();
-  void set_has_mean();
-  void clear_has_mean();
-  void set_has_std();
-  void clear_has_std();
-  void set_has_sparse();
-  void clear_has_sparse();
-  void set_has_variance_norm();
-  void clear_has_variance_norm();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  static ::google::protobuf::internal::ExplicitlyConstructed< ::std::string> _default_type_;
-  ::google::protobuf::internal::ArenaStringPtr type_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_type_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_;
   float value_;
   float min_;
   float mean_;
   int variance_norm_;
-  ::google::protobuf::int32 sparse_;
+  int32_t sparse_;
   float max_;
   float std_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsFillerParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NetParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NetParameter) */ {
+class NetParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NetParameter) */ {
  public:
-  NetParameter();
-  virtual ~NetParameter();
+  inline NetParameter() : NetParameter(nullptr) {}
+  ~NetParameter() override;
+  explicit constexpr NetParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NetParameter(const NetParameter& from);
-
-  inline NetParameter& operator=(const NetParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NetParameter(NetParameter&& from) noexcept
     : NetParameter() {
     *this = ::std::move(from);
   }
 
+  inline NetParameter& operator=(const NetParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NetParameter& operator=(NetParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NetParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NetParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NetParameter* internal_default_instance() {
     return reinterpret_cast<const NetParameter*>(
                &_NetParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     9;
 
-  void Swap(NetParameter* other);
   friend void swap(NetParameter& a, NetParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(NetParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NetParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NetParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NetParameter* 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;
+  NetParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NetParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NetParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NetParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NetParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.NetParameter";
   }
+  protected:
+  explicit NetParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kLayersFieldNumber = 2,
+    kInputFieldNumber = 3,
+    kInputDimFieldNumber = 4,
+    kInputShapeFieldNumber = 8,
+    kLayerFieldNumber = 100,
+    kNameFieldNumber = 1,
+    kStateFieldNumber = 6,
+    kForceBackwardFieldNumber = 5,
+    kDebugInfoFieldNumber = 7,
+  };
   // repeated .opencv_caffe.V1LayerParameter layers = 2;
   int layers_size() const;
+  private:
+  int _internal_layers_size() const;
+  public:
   void clear_layers();
-  static const int kLayersFieldNumber = 2;
-  const ::opencv_caffe::V1LayerParameter& layers(int index) const;
   ::opencv_caffe::V1LayerParameter* mutable_layers(int index);
-  ::opencv_caffe::V1LayerParameter* add_layers();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::V1LayerParameter >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::V1LayerParameter >*
       mutable_layers();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::V1LayerParameter >&
+  private:
+  const ::opencv_caffe::V1LayerParameter& _internal_layers(int index) const;
+  ::opencv_caffe::V1LayerParameter* _internal_add_layers();
+  public:
+  const ::opencv_caffe::V1LayerParameter& layers(int index) const;
+  ::opencv_caffe::V1LayerParameter* add_layers();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::V1LayerParameter >&
       layers() const;
 
   // repeated string input = 3;
   int input_size() const;
+  private:
+  int _internal_input_size() const;
+  public:
   void clear_input();
-  static const int kInputFieldNumber = 3;
-  const ::std::string& input(int index) const;
-  ::std::string* mutable_input(int index);
-  void set_input(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_input(int index, ::std::string&& value);
-  #endif
+  const std::string& input(int index) const;
+  std::string* mutable_input(int index);
+  void set_input(int index, const std::string& value);
+  void set_input(int index, std::string&& value);
   void set_input(int index, const char* value);
   void set_input(int index, const char* value, size_t size);
-  ::std::string* add_input();
-  void add_input(const ::std::string& value);
-  #if LANG_CXX11
-  void add_input(::std::string&& value);
-  #endif
+  std::string* add_input();
+  void add_input(const std::string& value);
+  void add_input(std::string&& value);
   void add_input(const char* value);
   void add_input(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& input() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_input();
+  private:
+  const std::string& _internal_input(int index) const;
+  std::string* _internal_add_input();
+  public:
 
   // repeated int32 input_dim = 4;
   int input_dim_size() const;
+  private:
+  int _internal_input_dim_size() const;
+  public:
   void clear_input_dim();
-  static const int kInputDimFieldNumber = 4;
-  ::google::protobuf::int32 input_dim(int index) const;
-  void set_input_dim(int index, ::google::protobuf::int32 value);
-  void add_input_dim(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_input_dim(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_input_dim() const;
+  void _internal_add_input_dim(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_input_dim();
+  public:
+  int32_t input_dim(int index) const;
+  void set_input_dim(int index, int32_t value);
+  void add_input_dim(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       input_dim() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_input_dim();
 
   // repeated .opencv_caffe.BlobShape input_shape = 8;
   int input_shape_size() const;
+  private:
+  int _internal_input_shape_size() const;
+  public:
   void clear_input_shape();
-  static const int kInputShapeFieldNumber = 8;
-  const ::opencv_caffe::BlobShape& input_shape(int index) const;
   ::opencv_caffe::BlobShape* mutable_input_shape(int index);
-  ::opencv_caffe::BlobShape* add_input_shape();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >*
       mutable_input_shape();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >&
+  private:
+  const ::opencv_caffe::BlobShape& _internal_input_shape(int index) const;
+  ::opencv_caffe::BlobShape* _internal_add_input_shape();
+  public:
+  const ::opencv_caffe::BlobShape& input_shape(int index) const;
+  ::opencv_caffe::BlobShape* add_input_shape();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >&
       input_shape() const;
 
   // repeated .opencv_caffe.LayerParameter layer = 100;
   int layer_size() const;
+  private:
+  int _internal_layer_size() const;
+  public:
   void clear_layer();
-  static const int kLayerFieldNumber = 100;
-  const ::opencv_caffe::LayerParameter& layer(int index) const;
   ::opencv_caffe::LayerParameter* mutable_layer(int index);
-  ::opencv_caffe::LayerParameter* add_layer();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::LayerParameter >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::LayerParameter >*
       mutable_layer();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::LayerParameter >&
+  private:
+  const ::opencv_caffe::LayerParameter& _internal_layer(int index) const;
+  ::opencv_caffe::LayerParameter* _internal_add_layer();
+  public:
+  const ::opencv_caffe::LayerParameter& layer(int index) const;
+  ::opencv_caffe::LayerParameter* add_layer();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::LayerParameter >&
       layer() const;
 
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional .opencv_caffe.NetState state = 6;
   bool has_state() const;
+  private:
+  bool _internal_has_state() const;
+  public:
   void clear_state();
-  static const int kStateFieldNumber = 6;
   const ::opencv_caffe::NetState& state() const;
-  ::opencv_caffe::NetState* release_state();
+  PROTOBUF_NODISCARD ::opencv_caffe::NetState* release_state();
   ::opencv_caffe::NetState* mutable_state();
   void set_allocated_state(::opencv_caffe::NetState* state);
+  private:
+  const ::opencv_caffe::NetState& _internal_state() const;
+  ::opencv_caffe::NetState* _internal_mutable_state();
+  public:
+  void unsafe_arena_set_allocated_state(
+      ::opencv_caffe::NetState* state);
+  ::opencv_caffe::NetState* unsafe_arena_release_state();
 
   // optional bool force_backward = 5 [default = false];
   bool has_force_backward() const;
+  private:
+  bool _internal_has_force_backward() const;
+  public:
   void clear_force_backward();
-  static const int kForceBackwardFieldNumber = 5;
   bool force_backward() const;
   void set_force_backward(bool value);
+  private:
+  bool _internal_force_backward() const;
+  void _internal_set_force_backward(bool value);
+  public:
 
   // optional bool debug_info = 7 [default = false];
   bool has_debug_info() const;
+  private:
+  bool _internal_has_debug_info() const;
+  public:
   void clear_debug_info();
-  static const int kDebugInfoFieldNumber = 7;
   bool debug_info() const;
   void set_debug_info(bool value);
+  private:
+  bool _internal_debug_info() const;
+  void _internal_set_debug_info(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.NetParameter)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_force_backward();
-  void clear_has_force_backward();
-  void set_has_state();
-  void clear_has_state();
-  void set_has_debug_info();
-  void clear_has_debug_info();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::V1LayerParameter > layers_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> input_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > input_dim_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape > input_shape_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::LayerParameter > layer_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::V1LayerParameter > layers_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> input_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > input_dim_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape > input_shape_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::LayerParameter > layer_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
   ::opencv_caffe::NetState* state_;
   bool force_backward_;
   bool debug_info_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class SolverParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SolverParameter) */ {
+class SolverParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SolverParameter) */ {
  public:
-  SolverParameter();
-  virtual ~SolverParameter();
+  inline SolverParameter() : SolverParameter(nullptr) {}
+  ~SolverParameter() override;
+  explicit constexpr SolverParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SolverParameter(const SolverParameter& from);
-
-  inline SolverParameter& operator=(const SolverParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SolverParameter(SolverParameter&& from) noexcept
     : SolverParameter() {
     *this = ::std::move(from);
   }
 
+  inline SolverParameter& operator=(const SolverParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SolverParameter& operator=(SolverParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const SolverParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SolverParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SolverParameter* internal_default_instance() {
     return reinterpret_cast<const SolverParameter*>(
                &_SolverParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     10;
 
-  void Swap(SolverParameter* other);
   friend void swap(SolverParameter& a, SolverParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(SolverParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SolverParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SolverParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SolverParameter* 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;
+  SolverParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SolverParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SolverParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SolverParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SolverParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.SolverParameter";
   }
+  protected:
+  explicit SolverParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef SolverParameter_SnapshotFormat SnapshotFormat;
-  static const SnapshotFormat HDF5 =
+  static constexpr SnapshotFormat HDF5 =
     SolverParameter_SnapshotFormat_HDF5;
-  static const SnapshotFormat BINARYPROTO =
+  static constexpr SnapshotFormat BINARYPROTO =
     SolverParameter_SnapshotFormat_BINARYPROTO;
   static inline bool SnapshotFormat_IsValid(int value) {
     return SolverParameter_SnapshotFormat_IsValid(value);
   }
-  static const SnapshotFormat SnapshotFormat_MIN =
+  static constexpr SnapshotFormat SnapshotFormat_MIN =
     SolverParameter_SnapshotFormat_SnapshotFormat_MIN;
-  static const SnapshotFormat SnapshotFormat_MAX =
+  static constexpr SnapshotFormat SnapshotFormat_MAX =
     SolverParameter_SnapshotFormat_SnapshotFormat_MAX;
-  static const int SnapshotFormat_ARRAYSIZE =
+  static constexpr int SnapshotFormat_ARRAYSIZE =
     SolverParameter_SnapshotFormat_SnapshotFormat_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   SnapshotFormat_descriptor() {
     return SolverParameter_SnapshotFormat_descriptor();
   }
-  static inline const ::std::string& SnapshotFormat_Name(SnapshotFormat value) {
-    return SolverParameter_SnapshotFormat_Name(value);
+  template<typename T>
+  static inline const std::string& SnapshotFormat_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, SnapshotFormat>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function SnapshotFormat_Name.");
+    return SolverParameter_SnapshotFormat_Name(enum_t_value);
   }
-  static inline bool SnapshotFormat_Parse(const ::std::string& name,
+  static inline bool SnapshotFormat_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       SnapshotFormat* value) {
     return SolverParameter_SnapshotFormat_Parse(name, value);
   }
 
   typedef SolverParameter_SolverMode SolverMode;
-  static const SolverMode CPU =
+  static constexpr SolverMode CPU =
     SolverParameter_SolverMode_CPU;
-  static const SolverMode GPU =
+  static constexpr SolverMode GPU =
     SolverParameter_SolverMode_GPU;
   static inline bool SolverMode_IsValid(int value) {
     return SolverParameter_SolverMode_IsValid(value);
   }
-  static const SolverMode SolverMode_MIN =
+  static constexpr SolverMode SolverMode_MIN =
     SolverParameter_SolverMode_SolverMode_MIN;
-  static const SolverMode SolverMode_MAX =
+  static constexpr SolverMode SolverMode_MAX =
     SolverParameter_SolverMode_SolverMode_MAX;
-  static const int SolverMode_ARRAYSIZE =
+  static constexpr int SolverMode_ARRAYSIZE =
     SolverParameter_SolverMode_SolverMode_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   SolverMode_descriptor() {
     return SolverParameter_SolverMode_descriptor();
   }
-  static inline const ::std::string& SolverMode_Name(SolverMode value) {
-    return SolverParameter_SolverMode_Name(value);
+  template<typename T>
+  static inline const std::string& SolverMode_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, SolverMode>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function SolverMode_Name.");
+    return SolverParameter_SolverMode_Name(enum_t_value);
   }
-  static inline bool SolverMode_Parse(const ::std::string& name,
+  static inline bool SolverMode_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       SolverMode* value) {
     return SolverParameter_SolverMode_Parse(name, value);
   }
 
   typedef SolverParameter_SolverType SolverType;
-  static const SolverType SGD =
+  static constexpr SolverType SGD =
     SolverParameter_SolverType_SGD;
-  static const SolverType NESTEROV =
+  static constexpr SolverType NESTEROV =
     SolverParameter_SolverType_NESTEROV;
-  static const SolverType ADAGRAD =
+  static constexpr SolverType ADAGRAD =
     SolverParameter_SolverType_ADAGRAD;
-  static const SolverType RMSPROP =
+  static constexpr SolverType RMSPROP =
     SolverParameter_SolverType_RMSPROP;
-  static const SolverType ADADELTA =
+  static constexpr SolverType ADADELTA =
     SolverParameter_SolverType_ADADELTA;
-  static const SolverType ADAM =
+  static constexpr SolverType ADAM =
     SolverParameter_SolverType_ADAM;
   static inline bool SolverType_IsValid(int value) {
     return SolverParameter_SolverType_IsValid(value);
   }
-  static const SolverType SolverType_MIN =
+  static constexpr SolverType SolverType_MIN =
     SolverParameter_SolverType_SolverType_MIN;
-  static const SolverType SolverType_MAX =
+  static constexpr SolverType SolverType_MAX =
     SolverParameter_SolverType_SolverType_MAX;
-  static const int SolverType_ARRAYSIZE =
+  static constexpr int SolverType_ARRAYSIZE =
     SolverParameter_SolverType_SolverType_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   SolverType_descriptor() {
     return SolverParameter_SolverType_descriptor();
   }
-  static inline const ::std::string& SolverType_Name(SolverType value) {
-    return SolverParameter_SolverType_Name(value);
+  template<typename T>
+  static inline const std::string& SolverType_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, SolverType>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function SolverType_Name.");
+    return SolverParameter_SolverType_Name(enum_t_value);
   }
-  static inline bool SolverType_Parse(const ::std::string& name,
+  static inline bool SolverType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       SolverType* value) {
     return SolverParameter_SolverType_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kTestNetFieldNumber = 2,
+    kTestIterFieldNumber = 3,
+    kTestNetParamFieldNumber = 22,
+    kTestStateFieldNumber = 27,
+    kStepvalueFieldNumber = 34,
+    kTrainNetFieldNumber = 1,
+    kLrPolicyFieldNumber = 8,
+    kSnapshotPrefixFieldNumber = 15,
+    kNetFieldNumber = 24,
+    kRegularizationTypeFieldNumber = 29,
+    kTypeFieldNumber = 40,
+    kTrainNetParamFieldNumber = 21,
+    kNetParamFieldNumber = 25,
+    kTrainStateFieldNumber = 26,
+    kTestIntervalFieldNumber = 4,
+    kBaseLrFieldNumber = 5,
+    kDisplayFieldNumber = 6,
+    kMaxIterFieldNumber = 7,
+    kGammaFieldNumber = 9,
+    kPowerFieldNumber = 10,
+    kMomentumFieldNumber = 11,
+    kWeightDecayFieldNumber = 12,
+    kStepsizeFieldNumber = 13,
+    kSnapshotFieldNumber = 14,
+    kDeviceIdFieldNumber = 18,
+    kTestComputeLossFieldNumber = 19,
+    kSnapshotDiffFieldNumber = 16,
+    kDebugInfoFieldNumber = 23,
+    kSolverTypeFieldNumber = 30,
+    kMomentum2FieldNumber = 39,
+    kRandomSeedFieldNumber = 20,
+    kSolverModeFieldNumber = 17,
+    kTestInitializationFieldNumber = 32,
+    kSnapshotAfterTrainFieldNumber = 28,
+    kDeltaFieldNumber = 31,
+    kAverageLossFieldNumber = 33,
+    kClipGradientsFieldNumber = 35,
+    kIterSizeFieldNumber = 36,
+    kSnapshotFormatFieldNumber = 37,
+    kRmsDecayFieldNumber = 38,
+  };
   // repeated string test_net = 2;
   int test_net_size() const;
+  private:
+  int _internal_test_net_size() const;
+  public:
   void clear_test_net();
-  static const int kTestNetFieldNumber = 2;
-  const ::std::string& test_net(int index) const;
-  ::std::string* mutable_test_net(int index);
-  void set_test_net(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_test_net(int index, ::std::string&& value);
-  #endif
+  const std::string& test_net(int index) const;
+  std::string* mutable_test_net(int index);
+  void set_test_net(int index, const std::string& value);
+  void set_test_net(int index, std::string&& value);
   void set_test_net(int index, const char* value);
   void set_test_net(int index, const char* value, size_t size);
-  ::std::string* add_test_net();
-  void add_test_net(const ::std::string& value);
-  #if LANG_CXX11
-  void add_test_net(::std::string&& value);
-  #endif
+  std::string* add_test_net();
+  void add_test_net(const std::string& value);
+  void add_test_net(std::string&& value);
   void add_test_net(const char* value);
   void add_test_net(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& test_net() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_test_net();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& test_net() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_test_net();
+  private:
+  const std::string& _internal_test_net(int index) const;
+  std::string* _internal_add_test_net();
+  public:
 
   // repeated int32 test_iter = 3;
   int test_iter_size() const;
+  private:
+  int _internal_test_iter_size() const;
+  public:
   void clear_test_iter();
-  static const int kTestIterFieldNumber = 3;
-  ::google::protobuf::int32 test_iter(int index) const;
-  void set_test_iter(int index, ::google::protobuf::int32 value);
-  void add_test_iter(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_test_iter(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_test_iter() const;
+  void _internal_add_test_iter(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_test_iter();
+  public:
+  int32_t test_iter(int index) const;
+  void set_test_iter(int index, int32_t value);
+  void add_test_iter(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       test_iter() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_test_iter();
 
   // repeated .opencv_caffe.NetParameter test_net_param = 22;
   int test_net_param_size() const;
+  private:
+  int _internal_test_net_param_size() const;
+  public:
   void clear_test_net_param();
-  static const int kTestNetParamFieldNumber = 22;
-  const ::opencv_caffe::NetParameter& test_net_param(int index) const;
   ::opencv_caffe::NetParameter* mutable_test_net_param(int index);
-  ::opencv_caffe::NetParameter* add_test_net_param();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetParameter >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetParameter >*
       mutable_test_net_param();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetParameter >&
+  private:
+  const ::opencv_caffe::NetParameter& _internal_test_net_param(int index) const;
+  ::opencv_caffe::NetParameter* _internal_add_test_net_param();
+  public:
+  const ::opencv_caffe::NetParameter& test_net_param(int index) const;
+  ::opencv_caffe::NetParameter* add_test_net_param();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetParameter >&
       test_net_param() const;
 
   // repeated .opencv_caffe.NetState test_state = 27;
   int test_state_size() const;
+  private:
+  int _internal_test_state_size() const;
+  public:
   void clear_test_state();
-  static const int kTestStateFieldNumber = 27;
-  const ::opencv_caffe::NetState& test_state(int index) const;
   ::opencv_caffe::NetState* mutable_test_state(int index);
-  ::opencv_caffe::NetState* add_test_state();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetState >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetState >*
       mutable_test_state();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetState >&
+  private:
+  const ::opencv_caffe::NetState& _internal_test_state(int index) const;
+  ::opencv_caffe::NetState* _internal_add_test_state();
+  public:
+  const ::opencv_caffe::NetState& test_state(int index) const;
+  ::opencv_caffe::NetState* add_test_state();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetState >&
       test_state() const;
 
   // repeated int32 stepvalue = 34;
   int stepvalue_size() const;
+  private:
+  int _internal_stepvalue_size() const;
+  public:
   void clear_stepvalue();
-  static const int kStepvalueFieldNumber = 34;
-  ::google::protobuf::int32 stepvalue(int index) const;
-  void set_stepvalue(int index, ::google::protobuf::int32 value);
-  void add_stepvalue(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_stepvalue(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_stepvalue() const;
+  void _internal_add_stepvalue(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_stepvalue();
+  public:
+  int32_t stepvalue(int index) const;
+  void set_stepvalue(int index, int32_t value);
+  void add_stepvalue(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       stepvalue() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_stepvalue();
 
   // optional string train_net = 1;
   bool has_train_net() const;
+  private:
+  bool _internal_has_train_net() const;
+  public:
   void clear_train_net();
-  static const int kTrainNetFieldNumber = 1;
-  const ::std::string& train_net() const;
-  void set_train_net(const ::std::string& value);
-  #if LANG_CXX11
-  void set_train_net(::std::string&& value);
-  #endif
-  void set_train_net(const char* value);
-  void set_train_net(const char* value, size_t size);
-  ::std::string* mutable_train_net();
-  ::std::string* release_train_net();
-  void set_allocated_train_net(::std::string* train_net);
+  const std::string& train_net() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_train_net(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_train_net();
+  PROTOBUF_NODISCARD std::string* release_train_net();
+  void set_allocated_train_net(std::string* train_net);
+  private:
+  const std::string& _internal_train_net() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_train_net(const std::string& value);
+  std::string* _internal_mutable_train_net();
+  public:
 
   // optional string lr_policy = 8;
   bool has_lr_policy() const;
+  private:
+  bool _internal_has_lr_policy() const;
+  public:
   void clear_lr_policy();
-  static const int kLrPolicyFieldNumber = 8;
-  const ::std::string& lr_policy() const;
-  void set_lr_policy(const ::std::string& value);
-  #if LANG_CXX11
-  void set_lr_policy(::std::string&& value);
-  #endif
-  void set_lr_policy(const char* value);
-  void set_lr_policy(const char* value, size_t size);
-  ::std::string* mutable_lr_policy();
-  ::std::string* release_lr_policy();
-  void set_allocated_lr_policy(::std::string* lr_policy);
+  const std::string& lr_policy() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_lr_policy(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_lr_policy();
+  PROTOBUF_NODISCARD std::string* release_lr_policy();
+  void set_allocated_lr_policy(std::string* lr_policy);
+  private:
+  const std::string& _internal_lr_policy() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_lr_policy(const std::string& value);
+  std::string* _internal_mutable_lr_policy();
+  public:
 
   // optional string snapshot_prefix = 15;
   bool has_snapshot_prefix() const;
+  private:
+  bool _internal_has_snapshot_prefix() const;
+  public:
   void clear_snapshot_prefix();
-  static const int kSnapshotPrefixFieldNumber = 15;
-  const ::std::string& snapshot_prefix() const;
-  void set_snapshot_prefix(const ::std::string& value);
-  #if LANG_CXX11
-  void set_snapshot_prefix(::std::string&& value);
-  #endif
-  void set_snapshot_prefix(const char* value);
-  void set_snapshot_prefix(const char* value, size_t size);
-  ::std::string* mutable_snapshot_prefix();
-  ::std::string* release_snapshot_prefix();
-  void set_allocated_snapshot_prefix(::std::string* snapshot_prefix);
+  const std::string& snapshot_prefix() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_snapshot_prefix(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_snapshot_prefix();
+  PROTOBUF_NODISCARD std::string* release_snapshot_prefix();
+  void set_allocated_snapshot_prefix(std::string* snapshot_prefix);
+  private:
+  const std::string& _internal_snapshot_prefix() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_snapshot_prefix(const std::string& value);
+  std::string* _internal_mutable_snapshot_prefix();
+  public:
 
   // optional string net = 24;
   bool has_net() const;
+  private:
+  bool _internal_has_net() const;
+  public:
   void clear_net();
-  static const int kNetFieldNumber = 24;
-  const ::std::string& net() const;
-  void set_net(const ::std::string& value);
-  #if LANG_CXX11
-  void set_net(::std::string&& value);
-  #endif
-  void set_net(const char* value);
-  void set_net(const char* value, size_t size);
-  ::std::string* mutable_net();
-  ::std::string* release_net();
-  void set_allocated_net(::std::string* net);
+  const std::string& net() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_net(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_net();
+  PROTOBUF_NODISCARD std::string* release_net();
+  void set_allocated_net(std::string* net);
+  private:
+  const std::string& _internal_net() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_net(const std::string& value);
+  std::string* _internal_mutable_net();
+  public:
 
   // optional string regularization_type = 29 [default = "L2"];
   bool has_regularization_type() const;
+  private:
+  bool _internal_has_regularization_type() const;
+  public:
   void clear_regularization_type();
-  static const int kRegularizationTypeFieldNumber = 29;
-  const ::std::string& regularization_type() const;
-  void set_regularization_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_regularization_type(::std::string&& value);
-  #endif
-  void set_regularization_type(const char* value);
-  void set_regularization_type(const char* value, size_t size);
-  ::std::string* mutable_regularization_type();
-  ::std::string* release_regularization_type();
-  void set_allocated_regularization_type(::std::string* regularization_type);
+  const std::string& regularization_type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_regularization_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_regularization_type();
+  PROTOBUF_NODISCARD std::string* release_regularization_type();
+  void set_allocated_regularization_type(std::string* regularization_type);
+  private:
+  const std::string& _internal_regularization_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_regularization_type(const std::string& value);
+  std::string* _internal_mutable_regularization_type();
+  public:
 
   // optional string type = 40 [default = "SGD"];
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 40;
-  const ::std::string& type() const;
-  void set_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type(::std::string&& value);
-  #endif
-  void set_type(const char* value);
-  void set_type(const char* value, size_t size);
-  ::std::string* mutable_type();
-  ::std::string* release_type();
-  void set_allocated_type(::std::string* type);
+  const std::string& type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_type();
+  PROTOBUF_NODISCARD std::string* release_type();
+  void set_allocated_type(std::string* type);
+  private:
+  const std::string& _internal_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_type(const std::string& value);
+  std::string* _internal_mutable_type();
+  public:
 
   // optional .opencv_caffe.NetParameter train_net_param = 21;
   bool has_train_net_param() const;
+  private:
+  bool _internal_has_train_net_param() const;
+  public:
   void clear_train_net_param();
-  static const int kTrainNetParamFieldNumber = 21;
   const ::opencv_caffe::NetParameter& train_net_param() const;
-  ::opencv_caffe::NetParameter* release_train_net_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::NetParameter* release_train_net_param();
   ::opencv_caffe::NetParameter* mutable_train_net_param();
   void set_allocated_train_net_param(::opencv_caffe::NetParameter* train_net_param);
+  private:
+  const ::opencv_caffe::NetParameter& _internal_train_net_param() const;
+  ::opencv_caffe::NetParameter* _internal_mutable_train_net_param();
+  public:
+  void unsafe_arena_set_allocated_train_net_param(
+      ::opencv_caffe::NetParameter* train_net_param);
+  ::opencv_caffe::NetParameter* unsafe_arena_release_train_net_param();
 
   // optional .opencv_caffe.NetParameter net_param = 25;
   bool has_net_param() const;
+  private:
+  bool _internal_has_net_param() const;
+  public:
   void clear_net_param();
-  static const int kNetParamFieldNumber = 25;
   const ::opencv_caffe::NetParameter& net_param() const;
-  ::opencv_caffe::NetParameter* release_net_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::NetParameter* release_net_param();
   ::opencv_caffe::NetParameter* mutable_net_param();
   void set_allocated_net_param(::opencv_caffe::NetParameter* net_param);
+  private:
+  const ::opencv_caffe::NetParameter& _internal_net_param() const;
+  ::opencv_caffe::NetParameter* _internal_mutable_net_param();
+  public:
+  void unsafe_arena_set_allocated_net_param(
+      ::opencv_caffe::NetParameter* net_param);
+  ::opencv_caffe::NetParameter* unsafe_arena_release_net_param();
 
   // optional .opencv_caffe.NetState train_state = 26;
   bool has_train_state() const;
+  private:
+  bool _internal_has_train_state() const;
+  public:
   void clear_train_state();
-  static const int kTrainStateFieldNumber = 26;
   const ::opencv_caffe::NetState& train_state() const;
-  ::opencv_caffe::NetState* release_train_state();
+  PROTOBUF_NODISCARD ::opencv_caffe::NetState* release_train_state();
   ::opencv_caffe::NetState* mutable_train_state();
   void set_allocated_train_state(::opencv_caffe::NetState* train_state);
+  private:
+  const ::opencv_caffe::NetState& _internal_train_state() const;
+  ::opencv_caffe::NetState* _internal_mutable_train_state();
+  public:
+  void unsafe_arena_set_allocated_train_state(
+      ::opencv_caffe::NetState* train_state);
+  ::opencv_caffe::NetState* unsafe_arena_release_train_state();
 
   // optional int32 test_interval = 4 [default = 0];
   bool has_test_interval() const;
+  private:
+  bool _internal_has_test_interval() const;
+  public:
   void clear_test_interval();
-  static const int kTestIntervalFieldNumber = 4;
-  ::google::protobuf::int32 test_interval() const;
-  void set_test_interval(::google::protobuf::int32 value);
+  int32_t test_interval() const;
+  void set_test_interval(int32_t value);
+  private:
+  int32_t _internal_test_interval() const;
+  void _internal_set_test_interval(int32_t value);
+  public:
 
   // optional float base_lr = 5;
   bool has_base_lr() const;
+  private:
+  bool _internal_has_base_lr() const;
+  public:
   void clear_base_lr();
-  static const int kBaseLrFieldNumber = 5;
   float base_lr() const;
   void set_base_lr(float value);
+  private:
+  float _internal_base_lr() const;
+  void _internal_set_base_lr(float value);
+  public:
 
   // optional int32 display = 6;
   bool has_display() const;
+  private:
+  bool _internal_has_display() const;
+  public:
   void clear_display();
-  static const int kDisplayFieldNumber = 6;
-  ::google::protobuf::int32 display() const;
-  void set_display(::google::protobuf::int32 value);
+  int32_t display() const;
+  void set_display(int32_t value);
+  private:
+  int32_t _internal_display() const;
+  void _internal_set_display(int32_t value);
+  public:
 
   // optional int32 max_iter = 7;
   bool has_max_iter() const;
+  private:
+  bool _internal_has_max_iter() const;
+  public:
   void clear_max_iter();
-  static const int kMaxIterFieldNumber = 7;
-  ::google::protobuf::int32 max_iter() const;
-  void set_max_iter(::google::protobuf::int32 value);
+  int32_t max_iter() const;
+  void set_max_iter(int32_t value);
+  private:
+  int32_t _internal_max_iter() const;
+  void _internal_set_max_iter(int32_t value);
+  public:
 
   // optional float gamma = 9;
   bool has_gamma() const;
+  private:
+  bool _internal_has_gamma() const;
+  public:
   void clear_gamma();
-  static const int kGammaFieldNumber = 9;
   float gamma() const;
   void set_gamma(float value);
+  private:
+  float _internal_gamma() const;
+  void _internal_set_gamma(float value);
+  public:
 
   // optional float power = 10;
   bool has_power() const;
+  private:
+  bool _internal_has_power() const;
+  public:
   void clear_power();
-  static const int kPowerFieldNumber = 10;
   float power() const;
   void set_power(float value);
+  private:
+  float _internal_power() const;
+  void _internal_set_power(float value);
+  public:
 
   // optional float momentum = 11;
   bool has_momentum() const;
+  private:
+  bool _internal_has_momentum() const;
+  public:
   void clear_momentum();
-  static const int kMomentumFieldNumber = 11;
   float momentum() const;
   void set_momentum(float value);
+  private:
+  float _internal_momentum() const;
+  void _internal_set_momentum(float value);
+  public:
 
   // optional float weight_decay = 12;
   bool has_weight_decay() const;
+  private:
+  bool _internal_has_weight_decay() const;
+  public:
   void clear_weight_decay();
-  static const int kWeightDecayFieldNumber = 12;
   float weight_decay() const;
   void set_weight_decay(float value);
+  private:
+  float _internal_weight_decay() const;
+  void _internal_set_weight_decay(float value);
+  public:
 
   // optional int32 stepsize = 13;
   bool has_stepsize() const;
+  private:
+  bool _internal_has_stepsize() const;
+  public:
   void clear_stepsize();
-  static const int kStepsizeFieldNumber = 13;
-  ::google::protobuf::int32 stepsize() const;
-  void set_stepsize(::google::protobuf::int32 value);
+  int32_t stepsize() const;
+  void set_stepsize(int32_t value);
+  private:
+  int32_t _internal_stepsize() const;
+  void _internal_set_stepsize(int32_t value);
+  public:
 
   // optional int32 snapshot = 14 [default = 0];
   bool has_snapshot() const;
+  private:
+  bool _internal_has_snapshot() const;
+  public:
   void clear_snapshot();
-  static const int kSnapshotFieldNumber = 14;
-  ::google::protobuf::int32 snapshot() const;
-  void set_snapshot(::google::protobuf::int32 value);
+  int32_t snapshot() const;
+  void set_snapshot(int32_t value);
+  private:
+  int32_t _internal_snapshot() const;
+  void _internal_set_snapshot(int32_t value);
+  public:
 
   // optional int32 device_id = 18 [default = 0];
   bool has_device_id() const;
+  private:
+  bool _internal_has_device_id() const;
+  public:
   void clear_device_id();
-  static const int kDeviceIdFieldNumber = 18;
-  ::google::protobuf::int32 device_id() const;
-  void set_device_id(::google::protobuf::int32 value);
+  int32_t device_id() const;
+  void set_device_id(int32_t value);
+  private:
+  int32_t _internal_device_id() const;
+  void _internal_set_device_id(int32_t value);
+  public:
 
   // optional bool test_compute_loss = 19 [default = false];
   bool has_test_compute_loss() const;
+  private:
+  bool _internal_has_test_compute_loss() const;
+  public:
   void clear_test_compute_loss();
-  static const int kTestComputeLossFieldNumber = 19;
   bool test_compute_loss() const;
   void set_test_compute_loss(bool value);
+  private:
+  bool _internal_test_compute_loss() const;
+  void _internal_set_test_compute_loss(bool value);
+  public:
 
   // optional bool snapshot_diff = 16 [default = false];
   bool has_snapshot_diff() const;
+  private:
+  bool _internal_has_snapshot_diff() const;
+  public:
   void clear_snapshot_diff();
-  static const int kSnapshotDiffFieldNumber = 16;
   bool snapshot_diff() const;
   void set_snapshot_diff(bool value);
+  private:
+  bool _internal_snapshot_diff() const;
+  void _internal_set_snapshot_diff(bool value);
+  public:
 
   // optional bool debug_info = 23 [default = false];
   bool has_debug_info() const;
+  private:
+  bool _internal_has_debug_info() const;
+  public:
   void clear_debug_info();
-  static const int kDebugInfoFieldNumber = 23;
   bool debug_info() const;
   void set_debug_info(bool value);
+  private:
+  bool _internal_debug_info() const;
+  void _internal_set_debug_info(bool value);
+  public:
 
   // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
   bool has_solver_type() const;
+  private:
+  bool _internal_has_solver_type() const;
+  public:
   void clear_solver_type();
-  static const int kSolverTypeFieldNumber = 30;
   ::opencv_caffe::SolverParameter_SolverType solver_type() const;
   void set_solver_type(::opencv_caffe::SolverParameter_SolverType value);
+  private:
+  ::opencv_caffe::SolverParameter_SolverType _internal_solver_type() const;
+  void _internal_set_solver_type(::opencv_caffe::SolverParameter_SolverType value);
+  public:
 
   // optional float momentum2 = 39 [default = 0.999];
   bool has_momentum2() const;
+  private:
+  bool _internal_has_momentum2() const;
+  public:
   void clear_momentum2();
-  static const int kMomentum2FieldNumber = 39;
   float momentum2() const;
   void set_momentum2(float value);
+  private:
+  float _internal_momentum2() const;
+  void _internal_set_momentum2(float value);
+  public:
 
   // optional int64 random_seed = 20 [default = -1];
   bool has_random_seed() const;
+  private:
+  bool _internal_has_random_seed() const;
+  public:
   void clear_random_seed();
-  static const int kRandomSeedFieldNumber = 20;
-  ::google::protobuf::int64 random_seed() const;
-  void set_random_seed(::google::protobuf::int64 value);
+  int64_t random_seed() const;
+  void set_random_seed(int64_t value);
+  private:
+  int64_t _internal_random_seed() const;
+  void _internal_set_random_seed(int64_t value);
+  public:
 
   // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
   bool has_solver_mode() const;
+  private:
+  bool _internal_has_solver_mode() const;
+  public:
   void clear_solver_mode();
-  static const int kSolverModeFieldNumber = 17;
   ::opencv_caffe::SolverParameter_SolverMode solver_mode() const;
   void set_solver_mode(::opencv_caffe::SolverParameter_SolverMode value);
+  private:
+  ::opencv_caffe::SolverParameter_SolverMode _internal_solver_mode() const;
+  void _internal_set_solver_mode(::opencv_caffe::SolverParameter_SolverMode value);
+  public:
 
   // optional bool test_initialization = 32 [default = true];
   bool has_test_initialization() const;
+  private:
+  bool _internal_has_test_initialization() const;
+  public:
   void clear_test_initialization();
-  static const int kTestInitializationFieldNumber = 32;
   bool test_initialization() const;
   void set_test_initialization(bool value);
+  private:
+  bool _internal_test_initialization() const;
+  void _internal_set_test_initialization(bool value);
+  public:
 
   // optional bool snapshot_after_train = 28 [default = true];
   bool has_snapshot_after_train() const;
+  private:
+  bool _internal_has_snapshot_after_train() const;
+  public:
   void clear_snapshot_after_train();
-  static const int kSnapshotAfterTrainFieldNumber = 28;
   bool snapshot_after_train() const;
   void set_snapshot_after_train(bool value);
+  private:
+  bool _internal_snapshot_after_train() const;
+  void _internal_set_snapshot_after_train(bool value);
+  public:
 
   // optional float delta = 31 [default = 1e-08];
   bool has_delta() const;
+  private:
+  bool _internal_has_delta() const;
+  public:
   void clear_delta();
-  static const int kDeltaFieldNumber = 31;
   float delta() const;
   void set_delta(float value);
+  private:
+  float _internal_delta() const;
+  void _internal_set_delta(float value);
+  public:
 
   // optional int32 average_loss = 33 [default = 1];
   bool has_average_loss() const;
+  private:
+  bool _internal_has_average_loss() const;
+  public:
   void clear_average_loss();
-  static const int kAverageLossFieldNumber = 33;
-  ::google::protobuf::int32 average_loss() const;
-  void set_average_loss(::google::protobuf::int32 value);
+  int32_t average_loss() const;
+  void set_average_loss(int32_t value);
+  private:
+  int32_t _internal_average_loss() const;
+  void _internal_set_average_loss(int32_t value);
+  public:
 
   // optional float clip_gradients = 35 [default = -1];
   bool has_clip_gradients() const;
+  private:
+  bool _internal_has_clip_gradients() const;
+  public:
   void clear_clip_gradients();
-  static const int kClipGradientsFieldNumber = 35;
   float clip_gradients() const;
   void set_clip_gradients(float value);
+  private:
+  float _internal_clip_gradients() const;
+  void _internal_set_clip_gradients(float value);
+  public:
 
   // optional int32 iter_size = 36 [default = 1];
   bool has_iter_size() const;
+  private:
+  bool _internal_has_iter_size() const;
+  public:
   void clear_iter_size();
-  static const int kIterSizeFieldNumber = 36;
-  ::google::protobuf::int32 iter_size() const;
-  void set_iter_size(::google::protobuf::int32 value);
+  int32_t iter_size() const;
+  void set_iter_size(int32_t value);
+  private:
+  int32_t _internal_iter_size() const;
+  void _internal_set_iter_size(int32_t value);
+  public:
 
   // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
   bool has_snapshot_format() const;
+  private:
+  bool _internal_has_snapshot_format() const;
+  public:
   void clear_snapshot_format();
-  static const int kSnapshotFormatFieldNumber = 37;
   ::opencv_caffe::SolverParameter_SnapshotFormat snapshot_format() const;
   void set_snapshot_format(::opencv_caffe::SolverParameter_SnapshotFormat value);
+  private:
+  ::opencv_caffe::SolverParameter_SnapshotFormat _internal_snapshot_format() const;
+  void _internal_set_snapshot_format(::opencv_caffe::SolverParameter_SnapshotFormat value);
+  public:
 
   // optional float rms_decay = 38 [default = 0.99];
   bool has_rms_decay() const;
+  private:
+  bool _internal_has_rms_decay() const;
+  public:
   void clear_rms_decay();
-  static const int kRmsDecayFieldNumber = 38;
   float rms_decay() const;
   void set_rms_decay(float value);
+  private:
+  float _internal_rms_decay() const;
+  void _internal_set_rms_decay(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.SolverParameter)
  private:
-  void set_has_net();
-  void clear_has_net();
-  void set_has_net_param();
-  void clear_has_net_param();
-  void set_has_train_net();
-  void clear_has_train_net();
-  void set_has_train_net_param();
-  void clear_has_train_net_param();
-  void set_has_train_state();
-  void clear_has_train_state();
-  void set_has_test_interval();
-  void clear_has_test_interval();
-  void set_has_test_compute_loss();
-  void clear_has_test_compute_loss();
-  void set_has_test_initialization();
-  void clear_has_test_initialization();
-  void set_has_base_lr();
-  void clear_has_base_lr();
-  void set_has_display();
-  void clear_has_display();
-  void set_has_average_loss();
-  void clear_has_average_loss();
-  void set_has_max_iter();
-  void clear_has_max_iter();
-  void set_has_iter_size();
-  void clear_has_iter_size();
-  void set_has_lr_policy();
-  void clear_has_lr_policy();
-  void set_has_gamma();
-  void clear_has_gamma();
-  void set_has_power();
-  void clear_has_power();
-  void set_has_momentum();
-  void clear_has_momentum();
-  void set_has_weight_decay();
-  void clear_has_weight_decay();
-  void set_has_regularization_type();
-  void clear_has_regularization_type();
-  void set_has_stepsize();
-  void clear_has_stepsize();
-  void set_has_clip_gradients();
-  void clear_has_clip_gradients();
-  void set_has_snapshot();
-  void clear_has_snapshot();
-  void set_has_snapshot_prefix();
-  void clear_has_snapshot_prefix();
-  void set_has_snapshot_diff();
-  void clear_has_snapshot_diff();
-  void set_has_snapshot_format();
-  void clear_has_snapshot_format();
-  void set_has_solver_mode();
-  void clear_has_solver_mode();
-  void set_has_device_id();
-  void clear_has_device_id();
-  void set_has_random_seed();
-  void clear_has_random_seed();
-  void set_has_type();
-  void clear_has_type();
-  void set_has_delta();
-  void clear_has_delta();
-  void set_has_momentum2();
-  void clear_has_momentum2();
-  void set_has_rms_decay();
-  void clear_has_rms_decay();
-  void set_has_debug_info();
-  void clear_has_debug_info();
-  void set_has_snapshot_after_train();
-  void clear_has_snapshot_after_train();
-  void set_has_solver_type();
-  void clear_has_solver_type();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<2> _has_bits_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> test_net_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > test_iter_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetParameter > test_net_param_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetState > test_state_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > stepvalue_;
-  ::google::protobuf::internal::ArenaStringPtr train_net_;
-  ::google::protobuf::internal::ArenaStringPtr lr_policy_;
-  ::google::protobuf::internal::ArenaStringPtr snapshot_prefix_;
-  ::google::protobuf::internal::ArenaStringPtr net_;
-  static ::google::protobuf::internal::ExplicitlyConstructed< ::std::string> _default_regularization_type_;
-  ::google::protobuf::internal::ArenaStringPtr regularization_type_;
-  static ::google::protobuf::internal::ExplicitlyConstructed< ::std::string> _default_type_;
-  ::google::protobuf::internal::ArenaStringPtr type_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<2> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> test_net_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > test_iter_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetParameter > test_net_param_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetState > test_state_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > stepvalue_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr train_net_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr lr_policy_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr snapshot_prefix_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr net_;
+  static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_regularization_type_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr regularization_type_;
+  static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_type_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_;
   ::opencv_caffe::NetParameter* train_net_param_;
   ::opencv_caffe::NetParameter* net_param_;
   ::opencv_caffe::NetState* train_state_;
-  ::google::protobuf::int32 test_interval_;
+  int32_t test_interval_;
   float base_lr_;
-  ::google::protobuf::int32 display_;
-  ::google::protobuf::int32 max_iter_;
+  int32_t display_;
+  int32_t max_iter_;
   float gamma_;
   float power_;
   float momentum_;
   float weight_decay_;
-  ::google::protobuf::int32 stepsize_;
-  ::google::protobuf::int32 snapshot_;
-  ::google::protobuf::int32 device_id_;
+  int32_t stepsize_;
+  int32_t snapshot_;
+  int32_t device_id_;
   bool test_compute_loss_;
   bool snapshot_diff_;
   bool debug_info_;
   int solver_type_;
   float momentum2_;
-  ::google::protobuf::int64 random_seed_;
+  int64_t random_seed_;
   int solver_mode_;
   bool test_initialization_;
   bool snapshot_after_train_;
   float delta_;
-  ::google::protobuf::int32 average_loss_;
+  int32_t average_loss_;
   float clip_gradients_;
-  ::google::protobuf::int32 iter_size_;
+  int32_t iter_size_;
   int snapshot_format_;
   float rms_decay_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSolverParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class SolverState : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SolverState) */ {
+class SolverState final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SolverState) */ {
  public:
-  SolverState();
-  virtual ~SolverState();
+  inline SolverState() : SolverState(nullptr) {}
+  ~SolverState() override;
+  explicit constexpr SolverState(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SolverState(const SolverState& from);
-
-  inline SolverState& operator=(const SolverState& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SolverState(SolverState&& from) noexcept
     : SolverState() {
     *this = ::std::move(from);
   }
 
+  inline SolverState& operator=(const SolverState& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SolverState& operator=(SolverState&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const SolverState& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SolverState& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SolverState* internal_default_instance() {
     return reinterpret_cast<const SolverState*>(
                &_SolverState_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     11;
 
-  void Swap(SolverState* other);
   friend void swap(SolverState& a, SolverState& b) {
     a.Swap(&b);
   }
+  inline void Swap(SolverState* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SolverState* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SolverState* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SolverState* 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;
+  SolverState* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SolverState>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SolverState& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SolverState& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SolverState* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.SolverState";
   }
+  protected:
+  explicit SolverState(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kHistoryFieldNumber = 3,
+    kLearnedNetFieldNumber = 2,
+    kIterFieldNumber = 1,
+    kCurrentStepFieldNumber = 4,
+  };
   // repeated .opencv_caffe.BlobProto history = 3;
   int history_size() const;
+  private:
+  int _internal_history_size() const;
+  public:
   void clear_history();
-  static const int kHistoryFieldNumber = 3;
-  const ::opencv_caffe::BlobProto& history(int index) const;
   ::opencv_caffe::BlobProto* mutable_history(int index);
-  ::opencv_caffe::BlobProto* add_history();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
       mutable_history();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+  private:
+  const ::opencv_caffe::BlobProto& _internal_history(int index) const;
+  ::opencv_caffe::BlobProto* _internal_add_history();
+  public:
+  const ::opencv_caffe::BlobProto& history(int index) const;
+  ::opencv_caffe::BlobProto* add_history();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
       history() const;
 
   // optional string learned_net = 2;
   bool has_learned_net() const;
+  private:
+  bool _internal_has_learned_net() const;
+  public:
   void clear_learned_net();
-  static const int kLearnedNetFieldNumber = 2;
-  const ::std::string& learned_net() const;
-  void set_learned_net(const ::std::string& value);
-  #if LANG_CXX11
-  void set_learned_net(::std::string&& value);
-  #endif
-  void set_learned_net(const char* value);
-  void set_learned_net(const char* value, size_t size);
-  ::std::string* mutable_learned_net();
-  ::std::string* release_learned_net();
-  void set_allocated_learned_net(::std::string* learned_net);
+  const std::string& learned_net() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_learned_net(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_learned_net();
+  PROTOBUF_NODISCARD std::string* release_learned_net();
+  void set_allocated_learned_net(std::string* learned_net);
+  private:
+  const std::string& _internal_learned_net() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_learned_net(const std::string& value);
+  std::string* _internal_mutable_learned_net();
+  public:
 
   // optional int32 iter = 1;
   bool has_iter() const;
+  private:
+  bool _internal_has_iter() const;
+  public:
   void clear_iter();
-  static const int kIterFieldNumber = 1;
-  ::google::protobuf::int32 iter() const;
-  void set_iter(::google::protobuf::int32 value);
+  int32_t iter() const;
+  void set_iter(int32_t value);
+  private:
+  int32_t _internal_iter() const;
+  void _internal_set_iter(int32_t value);
+  public:
 
   // optional int32 current_step = 4 [default = 0];
   bool has_current_step() const;
+  private:
+  bool _internal_has_current_step() const;
+  public:
   void clear_current_step();
-  static const int kCurrentStepFieldNumber = 4;
-  ::google::protobuf::int32 current_step() const;
-  void set_current_step(::google::protobuf::int32 value);
+  int32_t current_step() const;
+  void set_current_step(int32_t value);
+  private:
+  int32_t _internal_current_step() const;
+  void _internal_set_current_step(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.SolverState)
  private:
-  void set_has_iter();
-  void clear_has_iter();
-  void set_has_learned_net();
-  void clear_has_learned_net();
-  void set_has_current_step();
-  void clear_has_current_step();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto > history_;
-  ::google::protobuf::internal::ArenaStringPtr learned_net_;
-  ::google::protobuf::int32 iter_;
-  ::google::protobuf::int32 current_step_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSolverStateImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto > history_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr learned_net_;
+  int32_t iter_;
+  int32_t current_step_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NetState : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NetState) */ {
+class NetState final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NetState) */ {
  public:
-  NetState();
-  virtual ~NetState();
+  inline NetState() : NetState(nullptr) {}
+  ~NetState() override;
+  explicit constexpr NetState(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NetState(const NetState& from);
-
-  inline NetState& operator=(const NetState& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NetState(NetState&& from) noexcept
     : NetState() {
     *this = ::std::move(from);
   }
 
+  inline NetState& operator=(const NetState& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NetState& operator=(NetState&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NetState& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NetState& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NetState* internal_default_instance() {
     return reinterpret_cast<const NetState*>(
                &_NetState_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     12;
 
-  void Swap(NetState* other);
   friend void swap(NetState& a, NetState& b) {
     a.Swap(&b);
   }
+  inline void Swap(NetState* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NetState* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NetState* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NetState* 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;
+  NetState* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NetState>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NetState& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NetState& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NetState* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.NetState";
   }
+  protected:
+  explicit NetState(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kStageFieldNumber = 3,
+    kLevelFieldNumber = 2,
+    kPhaseFieldNumber = 1,
+  };
   // repeated string stage = 3;
   int stage_size() const;
+  private:
+  int _internal_stage_size() const;
+  public:
   void clear_stage();
-  static const int kStageFieldNumber = 3;
-  const ::std::string& stage(int index) const;
-  ::std::string* mutable_stage(int index);
-  void set_stage(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_stage(int index, ::std::string&& value);
-  #endif
+  const std::string& stage(int index) const;
+  std::string* mutable_stage(int index);
+  void set_stage(int index, const std::string& value);
+  void set_stage(int index, std::string&& value);
   void set_stage(int index, const char* value);
   void set_stage(int index, const char* value, size_t size);
-  ::std::string* add_stage();
-  void add_stage(const ::std::string& value);
-  #if LANG_CXX11
-  void add_stage(::std::string&& value);
-  #endif
+  std::string* add_stage();
+  void add_stage(const std::string& value);
+  void add_stage(std::string&& value);
   void add_stage(const char* value);
   void add_stage(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& stage() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_stage();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& stage() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_stage();
+  private:
+  const std::string& _internal_stage(int index) const;
+  std::string* _internal_add_stage();
+  public:
 
   // optional int32 level = 2 [default = 0];
   bool has_level() const;
+  private:
+  bool _internal_has_level() const;
+  public:
   void clear_level();
-  static const int kLevelFieldNumber = 2;
-  ::google::protobuf::int32 level() const;
-  void set_level(::google::protobuf::int32 value);
+  int32_t level() const;
+  void set_level(int32_t value);
+  private:
+  int32_t _internal_level() const;
+  void _internal_set_level(int32_t value);
+  public:
 
   // optional .opencv_caffe.Phase phase = 1 [default = TEST];
   bool has_phase() const;
+  private:
+  bool _internal_has_phase() const;
+  public:
   void clear_phase();
-  static const int kPhaseFieldNumber = 1;
   ::opencv_caffe::Phase phase() const;
   void set_phase(::opencv_caffe::Phase value);
+  private:
+  ::opencv_caffe::Phase _internal_phase() const;
+  void _internal_set_phase(::opencv_caffe::Phase value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.NetState)
  private:
-  void set_has_phase();
-  void clear_has_phase();
-  void set_has_level();
-  void clear_has_level();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> stage_;
-  ::google::protobuf::int32 level_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> stage_;
+  int32_t level_;
   int phase_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetStateImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NetStateRule : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NetStateRule) */ {
+class NetStateRule final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NetStateRule) */ {
  public:
-  NetStateRule();
-  virtual ~NetStateRule();
+  inline NetStateRule() : NetStateRule(nullptr) {}
+  ~NetStateRule() override;
+  explicit constexpr NetStateRule(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NetStateRule(const NetStateRule& from);
-
-  inline NetStateRule& operator=(const NetStateRule& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NetStateRule(NetStateRule&& from) noexcept
     : NetStateRule() {
     *this = ::std::move(from);
   }
 
+  inline NetStateRule& operator=(const NetStateRule& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NetStateRule& operator=(NetStateRule&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NetStateRule& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NetStateRule& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NetStateRule* internal_default_instance() {
     return reinterpret_cast<const NetStateRule*>(
                &_NetStateRule_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     13;
 
-  void Swap(NetStateRule* other);
   friend void swap(NetStateRule& a, NetStateRule& b) {
     a.Swap(&b);
   }
+  inline void Swap(NetStateRule* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NetStateRule* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NetStateRule* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NetStateRule* 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;
+  NetStateRule* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NetStateRule>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NetStateRule& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NetStateRule& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NetStateRule* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.NetStateRule";
   }
+  protected:
+  explicit NetStateRule(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kStageFieldNumber = 4,
+    kNotStageFieldNumber = 5,
+    kPhaseFieldNumber = 1,
+    kMinLevelFieldNumber = 2,
+    kMaxLevelFieldNumber = 3,
+  };
   // repeated string stage = 4;
   int stage_size() const;
+  private:
+  int _internal_stage_size() const;
+  public:
   void clear_stage();
-  static const int kStageFieldNumber = 4;
-  const ::std::string& stage(int index) const;
-  ::std::string* mutable_stage(int index);
-  void set_stage(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_stage(int index, ::std::string&& value);
-  #endif
+  const std::string& stage(int index) const;
+  std::string* mutable_stage(int index);
+  void set_stage(int index, const std::string& value);
+  void set_stage(int index, std::string&& value);
   void set_stage(int index, const char* value);
   void set_stage(int index, const char* value, size_t size);
-  ::std::string* add_stage();
-  void add_stage(const ::std::string& value);
-  #if LANG_CXX11
-  void add_stage(::std::string&& value);
-  #endif
+  std::string* add_stage();
+  void add_stage(const std::string& value);
+  void add_stage(std::string&& value);
   void add_stage(const char* value);
   void add_stage(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& stage() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_stage();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& stage() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_stage();
+  private:
+  const std::string& _internal_stage(int index) const;
+  std::string* _internal_add_stage();
+  public:
 
   // repeated string not_stage = 5;
   int not_stage_size() const;
+  private:
+  int _internal_not_stage_size() const;
+  public:
   void clear_not_stage();
-  static const int kNotStageFieldNumber = 5;
-  const ::std::string& not_stage(int index) const;
-  ::std::string* mutable_not_stage(int index);
-  void set_not_stage(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_not_stage(int index, ::std::string&& value);
-  #endif
+  const std::string& not_stage(int index) const;
+  std::string* mutable_not_stage(int index);
+  void set_not_stage(int index, const std::string& value);
+  void set_not_stage(int index, std::string&& value);
   void set_not_stage(int index, const char* value);
   void set_not_stage(int index, const char* value, size_t size);
-  ::std::string* add_not_stage();
-  void add_not_stage(const ::std::string& value);
-  #if LANG_CXX11
-  void add_not_stage(::std::string&& value);
-  #endif
+  std::string* add_not_stage();
+  void add_not_stage(const std::string& value);
+  void add_not_stage(std::string&& value);
   void add_not_stage(const char* value);
   void add_not_stage(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& not_stage() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_not_stage();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& not_stage() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_not_stage();
+  private:
+  const std::string& _internal_not_stage(int index) const;
+  std::string* _internal_add_not_stage();
+  public:
 
   // optional .opencv_caffe.Phase phase = 1;
   bool has_phase() const;
+  private:
+  bool _internal_has_phase() const;
+  public:
   void clear_phase();
-  static const int kPhaseFieldNumber = 1;
   ::opencv_caffe::Phase phase() const;
   void set_phase(::opencv_caffe::Phase value);
+  private:
+  ::opencv_caffe::Phase _internal_phase() const;
+  void _internal_set_phase(::opencv_caffe::Phase value);
+  public:
 
   // optional int32 min_level = 2;
   bool has_min_level() const;
+  private:
+  bool _internal_has_min_level() const;
+  public:
   void clear_min_level();
-  static const int kMinLevelFieldNumber = 2;
-  ::google::protobuf::int32 min_level() const;
-  void set_min_level(::google::protobuf::int32 value);
+  int32_t min_level() const;
+  void set_min_level(int32_t value);
+  private:
+  int32_t _internal_min_level() const;
+  void _internal_set_min_level(int32_t value);
+  public:
 
   // optional int32 max_level = 3;
   bool has_max_level() const;
+  private:
+  bool _internal_has_max_level() const;
+  public:
   void clear_max_level();
-  static const int kMaxLevelFieldNumber = 3;
-  ::google::protobuf::int32 max_level() const;
-  void set_max_level(::google::protobuf::int32 value);
+  int32_t max_level() const;
+  void set_max_level(int32_t value);
+  private:
+  int32_t _internal_max_level() const;
+  void _internal_set_max_level(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.NetStateRule)
  private:
-  void set_has_phase();
-  void clear_has_phase();
-  void set_has_min_level();
-  void clear_has_min_level();
-  void set_has_max_level();
-  void clear_has_max_level();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> stage_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> not_stage_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> stage_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> not_stage_;
   int phase_;
-  ::google::protobuf::int32 min_level_;
-  ::google::protobuf::int32 max_level_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNetStateRuleImpl();
+  int32_t min_level_;
+  int32_t max_level_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ParamSpec : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ParamSpec) */ {
+class ParamSpec final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ParamSpec) */ {
  public:
-  ParamSpec();
-  virtual ~ParamSpec();
+  inline ParamSpec() : ParamSpec(nullptr) {}
+  ~ParamSpec() override;
+  explicit constexpr ParamSpec(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ParamSpec(const ParamSpec& from);
-
-  inline ParamSpec& operator=(const ParamSpec& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ParamSpec(ParamSpec&& from) noexcept
     : ParamSpec() {
     *this = ::std::move(from);
   }
 
+  inline ParamSpec& operator=(const ParamSpec& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ParamSpec& operator=(ParamSpec&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ParamSpec& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ParamSpec& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ParamSpec* internal_default_instance() {
     return reinterpret_cast<const ParamSpec*>(
                &_ParamSpec_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     14;
 
-  void Swap(ParamSpec* other);
   friend void swap(ParamSpec& a, ParamSpec& b) {
     a.Swap(&b);
   }
+  inline void Swap(ParamSpec* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ParamSpec* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ParamSpec* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ParamSpec* 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;
+  ParamSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ParamSpec>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ParamSpec& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ParamSpec& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ParamSpec* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ParamSpec";
   }
+  protected:
+  explicit ParamSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef ParamSpec_DimCheckMode DimCheckMode;
-  static const DimCheckMode STRICT =
+  static constexpr DimCheckMode STRICT =
     ParamSpec_DimCheckMode_STRICT;
-  static const DimCheckMode PERMISSIVE =
+  static constexpr DimCheckMode PERMISSIVE =
     ParamSpec_DimCheckMode_PERMISSIVE;
   static inline bool DimCheckMode_IsValid(int value) {
     return ParamSpec_DimCheckMode_IsValid(value);
   }
-  static const DimCheckMode DimCheckMode_MIN =
+  static constexpr DimCheckMode DimCheckMode_MIN =
     ParamSpec_DimCheckMode_DimCheckMode_MIN;
-  static const DimCheckMode DimCheckMode_MAX =
+  static constexpr DimCheckMode DimCheckMode_MAX =
     ParamSpec_DimCheckMode_DimCheckMode_MAX;
-  static const int DimCheckMode_ARRAYSIZE =
+  static constexpr int DimCheckMode_ARRAYSIZE =
     ParamSpec_DimCheckMode_DimCheckMode_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   DimCheckMode_descriptor() {
     return ParamSpec_DimCheckMode_descriptor();
   }
-  static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) {
-    return ParamSpec_DimCheckMode_Name(value);
+  template<typename T>
+  static inline const std::string& DimCheckMode_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, DimCheckMode>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function DimCheckMode_Name.");
+    return ParamSpec_DimCheckMode_Name(enum_t_value);
   }
-  static inline bool DimCheckMode_Parse(const ::std::string& name,
+  static inline bool DimCheckMode_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       DimCheckMode* value) {
     return ParamSpec_DimCheckMode_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 1,
+    kShareModeFieldNumber = 2,
+    kLrMultFieldNumber = 3,
+    kDecayMultFieldNumber = 4,
+  };
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
   bool has_share_mode() const;
+  private:
+  bool _internal_has_share_mode() const;
+  public:
   void clear_share_mode();
-  static const int kShareModeFieldNumber = 2;
   ::opencv_caffe::ParamSpec_DimCheckMode share_mode() const;
   void set_share_mode(::opencv_caffe::ParamSpec_DimCheckMode value);
+  private:
+  ::opencv_caffe::ParamSpec_DimCheckMode _internal_share_mode() const;
+  void _internal_set_share_mode(::opencv_caffe::ParamSpec_DimCheckMode value);
+  public:
 
   // optional float lr_mult = 3 [default = 1];
   bool has_lr_mult() const;
+  private:
+  bool _internal_has_lr_mult() const;
+  public:
   void clear_lr_mult();
-  static const int kLrMultFieldNumber = 3;
   float lr_mult() const;
   void set_lr_mult(float value);
+  private:
+  float _internal_lr_mult() const;
+  void _internal_set_lr_mult(float value);
+  public:
 
   // optional float decay_mult = 4 [default = 1];
   bool has_decay_mult() const;
+  private:
+  bool _internal_has_decay_mult() const;
+  public:
   void clear_decay_mult();
-  static const int kDecayMultFieldNumber = 4;
   float decay_mult() const;
   void set_decay_mult(float value);
+  private:
+  float _internal_decay_mult() const;
+  void _internal_set_decay_mult(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ParamSpec)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_share_mode();
-  void clear_has_share_mode();
-  void set_has_lr_mult();
-  void clear_has_lr_mult();
-  void set_has_decay_mult();
-  void clear_has_decay_mult();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
   int share_mode_;
   float lr_mult_;
   float decay_mult_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsParamSpecImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LayerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.LayerParameter) */ {
+class LayerParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.LayerParameter) */ {
  public:
-  LayerParameter();
-  virtual ~LayerParameter();
+  inline LayerParameter() : LayerParameter(nullptr) {}
+  ~LayerParameter() override;
+  explicit constexpr LayerParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   LayerParameter(const LayerParameter& from);
-
-  inline LayerParameter& operator=(const LayerParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   LayerParameter(LayerParameter&& from) noexcept
     : LayerParameter() {
     *this = ::std::move(from);
   }
 
+  inline LayerParameter& operator=(const LayerParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline LayerParameter& operator=(LayerParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const LayerParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const LayerParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const LayerParameter* internal_default_instance() {
     return reinterpret_cast<const LayerParameter*>(
                &_LayerParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     15;
 
-  void Swap(LayerParameter* other);
   friend void swap(LayerParameter& a, LayerParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(LayerParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(LayerParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline LayerParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  LayerParameter* 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;
+  LayerParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<LayerParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const LayerParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const LayerParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(LayerParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.LayerParameter";
   }
+  protected:
+  explicit LayerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kBottomFieldNumber = 3,
+    kTopFieldNumber = 4,
+    kLossWeightFieldNumber = 5,
+    kParamFieldNumber = 6,
+    kBlobsFieldNumber = 7,
+    kIncludeFieldNumber = 8,
+    kExcludeFieldNumber = 9,
+    kPropagateDownFieldNumber = 11,
+    kNameFieldNumber = 1,
+    kTypeFieldNumber = 2,
+    kTransformParamFieldNumber = 100,
+    kLossParamFieldNumber = 101,
+    kAccuracyParamFieldNumber = 102,
+    kArgmaxParamFieldNumber = 103,
+    kConcatParamFieldNumber = 104,
+    kContrastiveLossParamFieldNumber = 105,
+    kConvolutionParamFieldNumber = 106,
+    kDataParamFieldNumber = 107,
+    kDropoutParamFieldNumber = 108,
+    kDummyDataParamFieldNumber = 109,
+    kEltwiseParamFieldNumber = 110,
+    kExpParamFieldNumber = 111,
+    kHdf5DataParamFieldNumber = 112,
+    kHdf5OutputParamFieldNumber = 113,
+    kHingeLossParamFieldNumber = 114,
+    kImageDataParamFieldNumber = 115,
+    kInfogainLossParamFieldNumber = 116,
+    kInnerProductParamFieldNumber = 117,
+    kLrnParamFieldNumber = 118,
+    kMemoryDataParamFieldNumber = 119,
+    kMvnParamFieldNumber = 120,
+    kPoolingParamFieldNumber = 121,
+    kPowerParamFieldNumber = 122,
+    kReluParamFieldNumber = 123,
+    kSigmoidParamFieldNumber = 124,
+    kSoftmaxParamFieldNumber = 125,
+    kSliceParamFieldNumber = 126,
+    kTanhParamFieldNumber = 127,
+    kThresholdParamFieldNumber = 128,
+    kWindowDataParamFieldNumber = 129,
+    kPythonParamFieldNumber = 130,
+    kPreluParamFieldNumber = 131,
+    kSppParamFieldNumber = 132,
+    kReshapeParamFieldNumber = 133,
+    kLogParamFieldNumber = 134,
+    kFlattenParamFieldNumber = 135,
+    kReductionParamFieldNumber = 136,
+    kEmbedParamFieldNumber = 137,
+    kTileParamFieldNumber = 138,
+    kBatchNormParamFieldNumber = 139,
+    kEluParamFieldNumber = 140,
+    kBiasParamFieldNumber = 141,
+    kScaleParamFieldNumber = 142,
+    kInputParamFieldNumber = 143,
+    kCropParamFieldNumber = 144,
+    kParameterParamFieldNumber = 145,
+    kRecurrentParamFieldNumber = 146,
+    kDetectionOutputParamFieldNumber = 147,
+    kPermuteParamFieldNumber = 148,
+    kNormParamFieldNumber = 149,
+    kPriorBoxParamFieldNumber = 150,
+    kProposalParamFieldNumber = 201,
+    kPsroiPoolingParamFieldNumber = 10002,
+    kRoiPoolingParamFieldNumber = 8266711,
+    kPhaseFieldNumber = 10,
+  };
   // repeated string bottom = 3;
   int bottom_size() const;
+  private:
+  int _internal_bottom_size() const;
+  public:
   void clear_bottom();
-  static const int kBottomFieldNumber = 3;
-  const ::std::string& bottom(int index) const;
-  ::std::string* mutable_bottom(int index);
-  void set_bottom(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_bottom(int index, ::std::string&& value);
-  #endif
+  const std::string& bottom(int index) const;
+  std::string* mutable_bottom(int index);
+  void set_bottom(int index, const std::string& value);
+  void set_bottom(int index, std::string&& value);
   void set_bottom(int index, const char* value);
   void set_bottom(int index, const char* value, size_t size);
-  ::std::string* add_bottom();
-  void add_bottom(const ::std::string& value);
-  #if LANG_CXX11
-  void add_bottom(::std::string&& value);
-  #endif
+  std::string* add_bottom();
+  void add_bottom(const std::string& value);
+  void add_bottom(std::string&& value);
   void add_bottom(const char* value);
   void add_bottom(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& bottom() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_bottom();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& bottom() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_bottom();
+  private:
+  const std::string& _internal_bottom(int index) const;
+  std::string* _internal_add_bottom();
+  public:
 
   // repeated string top = 4;
   int top_size() const;
+  private:
+  int _internal_top_size() const;
+  public:
   void clear_top();
-  static const int kTopFieldNumber = 4;
-  const ::std::string& top(int index) const;
-  ::std::string* mutable_top(int index);
-  void set_top(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_top(int index, ::std::string&& value);
-  #endif
+  const std::string& top(int index) const;
+  std::string* mutable_top(int index);
+  void set_top(int index, const std::string& value);
+  void set_top(int index, std::string&& value);
   void set_top(int index, const char* value);
   void set_top(int index, const char* value, size_t size);
-  ::std::string* add_top();
-  void add_top(const ::std::string& value);
-  #if LANG_CXX11
-  void add_top(::std::string&& value);
-  #endif
+  std::string* add_top();
+  void add_top(const std::string& value);
+  void add_top(std::string&& value);
   void add_top(const char* value);
   void add_top(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& top() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_top();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& top() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_top();
+  private:
+  const std::string& _internal_top(int index) const;
+  std::string* _internal_add_top();
+  public:
 
   // repeated float loss_weight = 5;
   int loss_weight_size() const;
+  private:
+  int _internal_loss_weight_size() const;
+  public:
   void clear_loss_weight();
-  static const int kLossWeightFieldNumber = 5;
+  private:
+  float _internal_loss_weight(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_loss_weight() const;
+  void _internal_add_loss_weight(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_loss_weight();
+  public:
   float loss_weight(int index) const;
   void set_loss_weight(int index, float value);
   void add_loss_weight(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       loss_weight() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_loss_weight();
 
   // repeated .opencv_caffe.ParamSpec param = 6;
   int param_size() const;
+  private:
+  int _internal_param_size() const;
+  public:
   void clear_param();
-  static const int kParamFieldNumber = 6;
-  const ::opencv_caffe::ParamSpec& param(int index) const;
   ::opencv_caffe::ParamSpec* mutable_param(int index);
-  ::opencv_caffe::ParamSpec* add_param();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::ParamSpec >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::ParamSpec >*
       mutable_param();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::ParamSpec >&
+  private:
+  const ::opencv_caffe::ParamSpec& _internal_param(int index) const;
+  ::opencv_caffe::ParamSpec* _internal_add_param();
+  public:
+  const ::opencv_caffe::ParamSpec& param(int index) const;
+  ::opencv_caffe::ParamSpec* add_param();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::ParamSpec >&
       param() const;
 
   // repeated .opencv_caffe.BlobProto blobs = 7;
   int blobs_size() const;
+  private:
+  int _internal_blobs_size() const;
+  public:
   void clear_blobs();
-  static const int kBlobsFieldNumber = 7;
-  const ::opencv_caffe::BlobProto& blobs(int index) const;
   ::opencv_caffe::BlobProto* mutable_blobs(int index);
-  ::opencv_caffe::BlobProto* add_blobs();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
       mutable_blobs();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+  private:
+  const ::opencv_caffe::BlobProto& _internal_blobs(int index) const;
+  ::opencv_caffe::BlobProto* _internal_add_blobs();
+  public:
+  const ::opencv_caffe::BlobProto& blobs(int index) const;
+  ::opencv_caffe::BlobProto* add_blobs();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
       blobs() const;
 
   // repeated .opencv_caffe.NetStateRule include = 8;
   int include_size() const;
+  private:
+  int _internal_include_size() const;
+  public:
   void clear_include();
-  static const int kIncludeFieldNumber = 8;
-  const ::opencv_caffe::NetStateRule& include(int index) const;
   ::opencv_caffe::NetStateRule* mutable_include(int index);
-  ::opencv_caffe::NetStateRule* add_include();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
       mutable_include();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
+  private:
+  const ::opencv_caffe::NetStateRule& _internal_include(int index) const;
+  ::opencv_caffe::NetStateRule* _internal_add_include();
+  public:
+  const ::opencv_caffe::NetStateRule& include(int index) const;
+  ::opencv_caffe::NetStateRule* add_include();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
       include() const;
 
   // repeated .opencv_caffe.NetStateRule exclude = 9;
   int exclude_size() const;
+  private:
+  int _internal_exclude_size() const;
+  public:
   void clear_exclude();
-  static const int kExcludeFieldNumber = 9;
-  const ::opencv_caffe::NetStateRule& exclude(int index) const;
   ::opencv_caffe::NetStateRule* mutable_exclude(int index);
-  ::opencv_caffe::NetStateRule* add_exclude();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
       mutable_exclude();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
+  private:
+  const ::opencv_caffe::NetStateRule& _internal_exclude(int index) const;
+  ::opencv_caffe::NetStateRule* _internal_add_exclude();
+  public:
+  const ::opencv_caffe::NetStateRule& exclude(int index) const;
+  ::opencv_caffe::NetStateRule* add_exclude();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
       exclude() const;
 
   // repeated bool propagate_down = 11;
   int propagate_down_size() const;
+  private:
+  int _internal_propagate_down_size() const;
+  public:
   void clear_propagate_down();
-  static const int kPropagateDownFieldNumber = 11;
+  private:
+  bool _internal_propagate_down(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
+      _internal_propagate_down() const;
+  void _internal_add_propagate_down(bool value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
+      _internal_mutable_propagate_down();
+  public:
   bool propagate_down(int index) const;
   void set_propagate_down(int index, bool value);
   void add_propagate_down(bool value);
-  const ::google::protobuf::RepeatedField< bool >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
       propagate_down() const;
-  ::google::protobuf::RepeatedField< bool >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
       mutable_propagate_down();
 
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional string type = 2;
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 2;
-  const ::std::string& type() const;
-  void set_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type(::std::string&& value);
-  #endif
-  void set_type(const char* value);
-  void set_type(const char* value, size_t size);
-  ::std::string* mutable_type();
-  ::std::string* release_type();
-  void set_allocated_type(::std::string* type);
+  const std::string& type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_type();
+  PROTOBUF_NODISCARD std::string* release_type();
+  void set_allocated_type(std::string* type);
+  private:
+  const std::string& _internal_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_type(const std::string& value);
+  std::string* _internal_mutable_type();
+  public:
 
   // optional .opencv_caffe.TransformationParameter transform_param = 100;
   bool has_transform_param() const;
+  private:
+  bool _internal_has_transform_param() const;
+  public:
   void clear_transform_param();
-  static const int kTransformParamFieldNumber = 100;
   const ::opencv_caffe::TransformationParameter& transform_param() const;
-  ::opencv_caffe::TransformationParameter* release_transform_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::TransformationParameter* release_transform_param();
   ::opencv_caffe::TransformationParameter* mutable_transform_param();
   void set_allocated_transform_param(::opencv_caffe::TransformationParameter* transform_param);
+  private:
+  const ::opencv_caffe::TransformationParameter& _internal_transform_param() const;
+  ::opencv_caffe::TransformationParameter* _internal_mutable_transform_param();
+  public:
+  void unsafe_arena_set_allocated_transform_param(
+      ::opencv_caffe::TransformationParameter* transform_param);
+  ::opencv_caffe::TransformationParameter* unsafe_arena_release_transform_param();
 
   // optional .opencv_caffe.LossParameter loss_param = 101;
   bool has_loss_param() const;
+  private:
+  bool _internal_has_loss_param() const;
+  public:
   void clear_loss_param();
-  static const int kLossParamFieldNumber = 101;
   const ::opencv_caffe::LossParameter& loss_param() const;
-  ::opencv_caffe::LossParameter* release_loss_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::LossParameter* release_loss_param();
   ::opencv_caffe::LossParameter* mutable_loss_param();
   void set_allocated_loss_param(::opencv_caffe::LossParameter* loss_param);
+  private:
+  const ::opencv_caffe::LossParameter& _internal_loss_param() const;
+  ::opencv_caffe::LossParameter* _internal_mutable_loss_param();
+  public:
+  void unsafe_arena_set_allocated_loss_param(
+      ::opencv_caffe::LossParameter* loss_param);
+  ::opencv_caffe::LossParameter* unsafe_arena_release_loss_param();
 
   // optional .opencv_caffe.AccuracyParameter accuracy_param = 102;
   bool has_accuracy_param() const;
+  private:
+  bool _internal_has_accuracy_param() const;
+  public:
   void clear_accuracy_param();
-  static const int kAccuracyParamFieldNumber = 102;
   const ::opencv_caffe::AccuracyParameter& accuracy_param() const;
-  ::opencv_caffe::AccuracyParameter* release_accuracy_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::AccuracyParameter* release_accuracy_param();
   ::opencv_caffe::AccuracyParameter* mutable_accuracy_param();
   void set_allocated_accuracy_param(::opencv_caffe::AccuracyParameter* accuracy_param);
+  private:
+  const ::opencv_caffe::AccuracyParameter& _internal_accuracy_param() const;
+  ::opencv_caffe::AccuracyParameter* _internal_mutable_accuracy_param();
+  public:
+  void unsafe_arena_set_allocated_accuracy_param(
+      ::opencv_caffe::AccuracyParameter* accuracy_param);
+  ::opencv_caffe::AccuracyParameter* unsafe_arena_release_accuracy_param();
 
   // optional .opencv_caffe.ArgMaxParameter argmax_param = 103;
   bool has_argmax_param() const;
+  private:
+  bool _internal_has_argmax_param() const;
+  public:
   void clear_argmax_param();
-  static const int kArgmaxParamFieldNumber = 103;
   const ::opencv_caffe::ArgMaxParameter& argmax_param() const;
-  ::opencv_caffe::ArgMaxParameter* release_argmax_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ArgMaxParameter* release_argmax_param();
   ::opencv_caffe::ArgMaxParameter* mutable_argmax_param();
   void set_allocated_argmax_param(::opencv_caffe::ArgMaxParameter* argmax_param);
+  private:
+  const ::opencv_caffe::ArgMaxParameter& _internal_argmax_param() const;
+  ::opencv_caffe::ArgMaxParameter* _internal_mutable_argmax_param();
+  public:
+  void unsafe_arena_set_allocated_argmax_param(
+      ::opencv_caffe::ArgMaxParameter* argmax_param);
+  ::opencv_caffe::ArgMaxParameter* unsafe_arena_release_argmax_param();
 
   // optional .opencv_caffe.ConcatParameter concat_param = 104;
   bool has_concat_param() const;
+  private:
+  bool _internal_has_concat_param() const;
+  public:
   void clear_concat_param();
-  static const int kConcatParamFieldNumber = 104;
   const ::opencv_caffe::ConcatParameter& concat_param() const;
-  ::opencv_caffe::ConcatParameter* release_concat_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ConcatParameter* release_concat_param();
   ::opencv_caffe::ConcatParameter* mutable_concat_param();
   void set_allocated_concat_param(::opencv_caffe::ConcatParameter* concat_param);
+  private:
+  const ::opencv_caffe::ConcatParameter& _internal_concat_param() const;
+  ::opencv_caffe::ConcatParameter* _internal_mutable_concat_param();
+  public:
+  void unsafe_arena_set_allocated_concat_param(
+      ::opencv_caffe::ConcatParameter* concat_param);
+  ::opencv_caffe::ConcatParameter* unsafe_arena_release_concat_param();
 
   // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 105;
   bool has_contrastive_loss_param() const;
+  private:
+  bool _internal_has_contrastive_loss_param() const;
+  public:
   void clear_contrastive_loss_param();
-  static const int kContrastiveLossParamFieldNumber = 105;
   const ::opencv_caffe::ContrastiveLossParameter& contrastive_loss_param() const;
-  ::opencv_caffe::ContrastiveLossParameter* release_contrastive_loss_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ContrastiveLossParameter* release_contrastive_loss_param();
   ::opencv_caffe::ContrastiveLossParameter* mutable_contrastive_loss_param();
   void set_allocated_contrastive_loss_param(::opencv_caffe::ContrastiveLossParameter* contrastive_loss_param);
+  private:
+  const ::opencv_caffe::ContrastiveLossParameter& _internal_contrastive_loss_param() const;
+  ::opencv_caffe::ContrastiveLossParameter* _internal_mutable_contrastive_loss_param();
+  public:
+  void unsafe_arena_set_allocated_contrastive_loss_param(
+      ::opencv_caffe::ContrastiveLossParameter* contrastive_loss_param);
+  ::opencv_caffe::ContrastiveLossParameter* unsafe_arena_release_contrastive_loss_param();
 
   // optional .opencv_caffe.ConvolutionParameter convolution_param = 106;
   bool has_convolution_param() const;
+  private:
+  bool _internal_has_convolution_param() const;
+  public:
   void clear_convolution_param();
-  static const int kConvolutionParamFieldNumber = 106;
   const ::opencv_caffe::ConvolutionParameter& convolution_param() const;
-  ::opencv_caffe::ConvolutionParameter* release_convolution_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ConvolutionParameter* release_convolution_param();
   ::opencv_caffe::ConvolutionParameter* mutable_convolution_param();
   void set_allocated_convolution_param(::opencv_caffe::ConvolutionParameter* convolution_param);
+  private:
+  const ::opencv_caffe::ConvolutionParameter& _internal_convolution_param() const;
+  ::opencv_caffe::ConvolutionParameter* _internal_mutable_convolution_param();
+  public:
+  void unsafe_arena_set_allocated_convolution_param(
+      ::opencv_caffe::ConvolutionParameter* convolution_param);
+  ::opencv_caffe::ConvolutionParameter* unsafe_arena_release_convolution_param();
 
   // optional .opencv_caffe.DataParameter data_param = 107;
   bool has_data_param() const;
+  private:
+  bool _internal_has_data_param() const;
+  public:
   void clear_data_param();
-  static const int kDataParamFieldNumber = 107;
   const ::opencv_caffe::DataParameter& data_param() const;
-  ::opencv_caffe::DataParameter* release_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::DataParameter* release_data_param();
   ::opencv_caffe::DataParameter* mutable_data_param();
   void set_allocated_data_param(::opencv_caffe::DataParameter* data_param);
+  private:
+  const ::opencv_caffe::DataParameter& _internal_data_param() const;
+  ::opencv_caffe::DataParameter* _internal_mutable_data_param();
+  public:
+  void unsafe_arena_set_allocated_data_param(
+      ::opencv_caffe::DataParameter* data_param);
+  ::opencv_caffe::DataParameter* unsafe_arena_release_data_param();
 
   // optional .opencv_caffe.DropoutParameter dropout_param = 108;
   bool has_dropout_param() const;
+  private:
+  bool _internal_has_dropout_param() const;
+  public:
   void clear_dropout_param();
-  static const int kDropoutParamFieldNumber = 108;
   const ::opencv_caffe::DropoutParameter& dropout_param() const;
-  ::opencv_caffe::DropoutParameter* release_dropout_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::DropoutParameter* release_dropout_param();
   ::opencv_caffe::DropoutParameter* mutable_dropout_param();
   void set_allocated_dropout_param(::opencv_caffe::DropoutParameter* dropout_param);
+  private:
+  const ::opencv_caffe::DropoutParameter& _internal_dropout_param() const;
+  ::opencv_caffe::DropoutParameter* _internal_mutable_dropout_param();
+  public:
+  void unsafe_arena_set_allocated_dropout_param(
+      ::opencv_caffe::DropoutParameter* dropout_param);
+  ::opencv_caffe::DropoutParameter* unsafe_arena_release_dropout_param();
 
   // optional .opencv_caffe.DummyDataParameter dummy_data_param = 109;
   bool has_dummy_data_param() const;
+  private:
+  bool _internal_has_dummy_data_param() const;
+  public:
   void clear_dummy_data_param();
-  static const int kDummyDataParamFieldNumber = 109;
   const ::opencv_caffe::DummyDataParameter& dummy_data_param() const;
-  ::opencv_caffe::DummyDataParameter* release_dummy_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::DummyDataParameter* release_dummy_data_param();
   ::opencv_caffe::DummyDataParameter* mutable_dummy_data_param();
   void set_allocated_dummy_data_param(::opencv_caffe::DummyDataParameter* dummy_data_param);
+  private:
+  const ::opencv_caffe::DummyDataParameter& _internal_dummy_data_param() const;
+  ::opencv_caffe::DummyDataParameter* _internal_mutable_dummy_data_param();
+  public:
+  void unsafe_arena_set_allocated_dummy_data_param(
+      ::opencv_caffe::DummyDataParameter* dummy_data_param);
+  ::opencv_caffe::DummyDataParameter* unsafe_arena_release_dummy_data_param();
 
   // optional .opencv_caffe.EltwiseParameter eltwise_param = 110;
   bool has_eltwise_param() const;
+  private:
+  bool _internal_has_eltwise_param() const;
+  public:
   void clear_eltwise_param();
-  static const int kEltwiseParamFieldNumber = 110;
   const ::opencv_caffe::EltwiseParameter& eltwise_param() const;
-  ::opencv_caffe::EltwiseParameter* release_eltwise_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::EltwiseParameter* release_eltwise_param();
   ::opencv_caffe::EltwiseParameter* mutable_eltwise_param();
   void set_allocated_eltwise_param(::opencv_caffe::EltwiseParameter* eltwise_param);
+  private:
+  const ::opencv_caffe::EltwiseParameter& _internal_eltwise_param() const;
+  ::opencv_caffe::EltwiseParameter* _internal_mutable_eltwise_param();
+  public:
+  void unsafe_arena_set_allocated_eltwise_param(
+      ::opencv_caffe::EltwiseParameter* eltwise_param);
+  ::opencv_caffe::EltwiseParameter* unsafe_arena_release_eltwise_param();
 
   // optional .opencv_caffe.ExpParameter exp_param = 111;
   bool has_exp_param() const;
+  private:
+  bool _internal_has_exp_param() const;
+  public:
   void clear_exp_param();
-  static const int kExpParamFieldNumber = 111;
   const ::opencv_caffe::ExpParameter& exp_param() const;
-  ::opencv_caffe::ExpParameter* release_exp_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ExpParameter* release_exp_param();
   ::opencv_caffe::ExpParameter* mutable_exp_param();
   void set_allocated_exp_param(::opencv_caffe::ExpParameter* exp_param);
+  private:
+  const ::opencv_caffe::ExpParameter& _internal_exp_param() const;
+  ::opencv_caffe::ExpParameter* _internal_mutable_exp_param();
+  public:
+  void unsafe_arena_set_allocated_exp_param(
+      ::opencv_caffe::ExpParameter* exp_param);
+  ::opencv_caffe::ExpParameter* unsafe_arena_release_exp_param();
 
   // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 112;
   bool has_hdf5_data_param() const;
+  private:
+  bool _internal_has_hdf5_data_param() const;
+  public:
   void clear_hdf5_data_param();
-  static const int kHdf5DataParamFieldNumber = 112;
   const ::opencv_caffe::HDF5DataParameter& hdf5_data_param() const;
-  ::opencv_caffe::HDF5DataParameter* release_hdf5_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::HDF5DataParameter* release_hdf5_data_param();
   ::opencv_caffe::HDF5DataParameter* mutable_hdf5_data_param();
   void set_allocated_hdf5_data_param(::opencv_caffe::HDF5DataParameter* hdf5_data_param);
+  private:
+  const ::opencv_caffe::HDF5DataParameter& _internal_hdf5_data_param() const;
+  ::opencv_caffe::HDF5DataParameter* _internal_mutable_hdf5_data_param();
+  public:
+  void unsafe_arena_set_allocated_hdf5_data_param(
+      ::opencv_caffe::HDF5DataParameter* hdf5_data_param);
+  ::opencv_caffe::HDF5DataParameter* unsafe_arena_release_hdf5_data_param();
 
   // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 113;
   bool has_hdf5_output_param() const;
+  private:
+  bool _internal_has_hdf5_output_param() const;
+  public:
   void clear_hdf5_output_param();
-  static const int kHdf5OutputParamFieldNumber = 113;
   const ::opencv_caffe::HDF5OutputParameter& hdf5_output_param() const;
-  ::opencv_caffe::HDF5OutputParameter* release_hdf5_output_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::HDF5OutputParameter* release_hdf5_output_param();
   ::opencv_caffe::HDF5OutputParameter* mutable_hdf5_output_param();
   void set_allocated_hdf5_output_param(::opencv_caffe::HDF5OutputParameter* hdf5_output_param);
+  private:
+  const ::opencv_caffe::HDF5OutputParameter& _internal_hdf5_output_param() const;
+  ::opencv_caffe::HDF5OutputParameter* _internal_mutable_hdf5_output_param();
+  public:
+  void unsafe_arena_set_allocated_hdf5_output_param(
+      ::opencv_caffe::HDF5OutputParameter* hdf5_output_param);
+  ::opencv_caffe::HDF5OutputParameter* unsafe_arena_release_hdf5_output_param();
 
   // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 114;
   bool has_hinge_loss_param() const;
+  private:
+  bool _internal_has_hinge_loss_param() const;
+  public:
   void clear_hinge_loss_param();
-  static const int kHingeLossParamFieldNumber = 114;
   const ::opencv_caffe::HingeLossParameter& hinge_loss_param() const;
-  ::opencv_caffe::HingeLossParameter* release_hinge_loss_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::HingeLossParameter* release_hinge_loss_param();
   ::opencv_caffe::HingeLossParameter* mutable_hinge_loss_param();
   void set_allocated_hinge_loss_param(::opencv_caffe::HingeLossParameter* hinge_loss_param);
+  private:
+  const ::opencv_caffe::HingeLossParameter& _internal_hinge_loss_param() const;
+  ::opencv_caffe::HingeLossParameter* _internal_mutable_hinge_loss_param();
+  public:
+  void unsafe_arena_set_allocated_hinge_loss_param(
+      ::opencv_caffe::HingeLossParameter* hinge_loss_param);
+  ::opencv_caffe::HingeLossParameter* unsafe_arena_release_hinge_loss_param();
 
   // optional .opencv_caffe.ImageDataParameter image_data_param = 115;
   bool has_image_data_param() const;
+  private:
+  bool _internal_has_image_data_param() const;
+  public:
   void clear_image_data_param();
-  static const int kImageDataParamFieldNumber = 115;
   const ::opencv_caffe::ImageDataParameter& image_data_param() const;
-  ::opencv_caffe::ImageDataParameter* release_image_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ImageDataParameter* release_image_data_param();
   ::opencv_caffe::ImageDataParameter* mutable_image_data_param();
   void set_allocated_image_data_param(::opencv_caffe::ImageDataParameter* image_data_param);
+  private:
+  const ::opencv_caffe::ImageDataParameter& _internal_image_data_param() const;
+  ::opencv_caffe::ImageDataParameter* _internal_mutable_image_data_param();
+  public:
+  void unsafe_arena_set_allocated_image_data_param(
+      ::opencv_caffe::ImageDataParameter* image_data_param);
+  ::opencv_caffe::ImageDataParameter* unsafe_arena_release_image_data_param();
 
   // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 116;
   bool has_infogain_loss_param() const;
+  private:
+  bool _internal_has_infogain_loss_param() const;
+  public:
   void clear_infogain_loss_param();
-  static const int kInfogainLossParamFieldNumber = 116;
   const ::opencv_caffe::InfogainLossParameter& infogain_loss_param() const;
-  ::opencv_caffe::InfogainLossParameter* release_infogain_loss_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::InfogainLossParameter* release_infogain_loss_param();
   ::opencv_caffe::InfogainLossParameter* mutable_infogain_loss_param();
   void set_allocated_infogain_loss_param(::opencv_caffe::InfogainLossParameter* infogain_loss_param);
+  private:
+  const ::opencv_caffe::InfogainLossParameter& _internal_infogain_loss_param() const;
+  ::opencv_caffe::InfogainLossParameter* _internal_mutable_infogain_loss_param();
+  public:
+  void unsafe_arena_set_allocated_infogain_loss_param(
+      ::opencv_caffe::InfogainLossParameter* infogain_loss_param);
+  ::opencv_caffe::InfogainLossParameter* unsafe_arena_release_infogain_loss_param();
 
   // optional .opencv_caffe.InnerProductParameter inner_product_param = 117;
   bool has_inner_product_param() const;
+  private:
+  bool _internal_has_inner_product_param() const;
+  public:
   void clear_inner_product_param();
-  static const int kInnerProductParamFieldNumber = 117;
   const ::opencv_caffe::InnerProductParameter& inner_product_param() const;
-  ::opencv_caffe::InnerProductParameter* release_inner_product_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::InnerProductParameter* release_inner_product_param();
   ::opencv_caffe::InnerProductParameter* mutable_inner_product_param();
   void set_allocated_inner_product_param(::opencv_caffe::InnerProductParameter* inner_product_param);
+  private:
+  const ::opencv_caffe::InnerProductParameter& _internal_inner_product_param() const;
+  ::opencv_caffe::InnerProductParameter* _internal_mutable_inner_product_param();
+  public:
+  void unsafe_arena_set_allocated_inner_product_param(
+      ::opencv_caffe::InnerProductParameter* inner_product_param);
+  ::opencv_caffe::InnerProductParameter* unsafe_arena_release_inner_product_param();
 
   // optional .opencv_caffe.LRNParameter lrn_param = 118;
   bool has_lrn_param() const;
+  private:
+  bool _internal_has_lrn_param() const;
+  public:
   void clear_lrn_param();
-  static const int kLrnParamFieldNumber = 118;
   const ::opencv_caffe::LRNParameter& lrn_param() const;
-  ::opencv_caffe::LRNParameter* release_lrn_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::LRNParameter* release_lrn_param();
   ::opencv_caffe::LRNParameter* mutable_lrn_param();
   void set_allocated_lrn_param(::opencv_caffe::LRNParameter* lrn_param);
+  private:
+  const ::opencv_caffe::LRNParameter& _internal_lrn_param() const;
+  ::opencv_caffe::LRNParameter* _internal_mutable_lrn_param();
+  public:
+  void unsafe_arena_set_allocated_lrn_param(
+      ::opencv_caffe::LRNParameter* lrn_param);
+  ::opencv_caffe::LRNParameter* unsafe_arena_release_lrn_param();
 
   // optional .opencv_caffe.MemoryDataParameter memory_data_param = 119;
   bool has_memory_data_param() const;
+  private:
+  bool _internal_has_memory_data_param() const;
+  public:
   void clear_memory_data_param();
-  static const int kMemoryDataParamFieldNumber = 119;
   const ::opencv_caffe::MemoryDataParameter& memory_data_param() const;
-  ::opencv_caffe::MemoryDataParameter* release_memory_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::MemoryDataParameter* release_memory_data_param();
   ::opencv_caffe::MemoryDataParameter* mutable_memory_data_param();
   void set_allocated_memory_data_param(::opencv_caffe::MemoryDataParameter* memory_data_param);
+  private:
+  const ::opencv_caffe::MemoryDataParameter& _internal_memory_data_param() const;
+  ::opencv_caffe::MemoryDataParameter* _internal_mutable_memory_data_param();
+  public:
+  void unsafe_arena_set_allocated_memory_data_param(
+      ::opencv_caffe::MemoryDataParameter* memory_data_param);
+  ::opencv_caffe::MemoryDataParameter* unsafe_arena_release_memory_data_param();
 
   // optional .opencv_caffe.MVNParameter mvn_param = 120;
   bool has_mvn_param() const;
+  private:
+  bool _internal_has_mvn_param() const;
+  public:
   void clear_mvn_param();
-  static const int kMvnParamFieldNumber = 120;
   const ::opencv_caffe::MVNParameter& mvn_param() const;
-  ::opencv_caffe::MVNParameter* release_mvn_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::MVNParameter* release_mvn_param();
   ::opencv_caffe::MVNParameter* mutable_mvn_param();
   void set_allocated_mvn_param(::opencv_caffe::MVNParameter* mvn_param);
+  private:
+  const ::opencv_caffe::MVNParameter& _internal_mvn_param() const;
+  ::opencv_caffe::MVNParameter* _internal_mutable_mvn_param();
+  public:
+  void unsafe_arena_set_allocated_mvn_param(
+      ::opencv_caffe::MVNParameter* mvn_param);
+  ::opencv_caffe::MVNParameter* unsafe_arena_release_mvn_param();
 
   // optional .opencv_caffe.PoolingParameter pooling_param = 121;
   bool has_pooling_param() const;
+  private:
+  bool _internal_has_pooling_param() const;
+  public:
   void clear_pooling_param();
-  static const int kPoolingParamFieldNumber = 121;
   const ::opencv_caffe::PoolingParameter& pooling_param() const;
-  ::opencv_caffe::PoolingParameter* release_pooling_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PoolingParameter* release_pooling_param();
   ::opencv_caffe::PoolingParameter* mutable_pooling_param();
   void set_allocated_pooling_param(::opencv_caffe::PoolingParameter* pooling_param);
+  private:
+  const ::opencv_caffe::PoolingParameter& _internal_pooling_param() const;
+  ::opencv_caffe::PoolingParameter* _internal_mutable_pooling_param();
+  public:
+  void unsafe_arena_set_allocated_pooling_param(
+      ::opencv_caffe::PoolingParameter* pooling_param);
+  ::opencv_caffe::PoolingParameter* unsafe_arena_release_pooling_param();
 
   // optional .opencv_caffe.PowerParameter power_param = 122;
   bool has_power_param() const;
+  private:
+  bool _internal_has_power_param() const;
+  public:
   void clear_power_param();
-  static const int kPowerParamFieldNumber = 122;
   const ::opencv_caffe::PowerParameter& power_param() const;
-  ::opencv_caffe::PowerParameter* release_power_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PowerParameter* release_power_param();
   ::opencv_caffe::PowerParameter* mutable_power_param();
   void set_allocated_power_param(::opencv_caffe::PowerParameter* power_param);
+  private:
+  const ::opencv_caffe::PowerParameter& _internal_power_param() const;
+  ::opencv_caffe::PowerParameter* _internal_mutable_power_param();
+  public:
+  void unsafe_arena_set_allocated_power_param(
+      ::opencv_caffe::PowerParameter* power_param);
+  ::opencv_caffe::PowerParameter* unsafe_arena_release_power_param();
 
   // optional .opencv_caffe.ReLUParameter relu_param = 123;
   bool has_relu_param() const;
+  private:
+  bool _internal_has_relu_param() const;
+  public:
   void clear_relu_param();
-  static const int kReluParamFieldNumber = 123;
   const ::opencv_caffe::ReLUParameter& relu_param() const;
-  ::opencv_caffe::ReLUParameter* release_relu_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ReLUParameter* release_relu_param();
   ::opencv_caffe::ReLUParameter* mutable_relu_param();
   void set_allocated_relu_param(::opencv_caffe::ReLUParameter* relu_param);
+  private:
+  const ::opencv_caffe::ReLUParameter& _internal_relu_param() const;
+  ::opencv_caffe::ReLUParameter* _internal_mutable_relu_param();
+  public:
+  void unsafe_arena_set_allocated_relu_param(
+      ::opencv_caffe::ReLUParameter* relu_param);
+  ::opencv_caffe::ReLUParameter* unsafe_arena_release_relu_param();
 
   // optional .opencv_caffe.SigmoidParameter sigmoid_param = 124;
   bool has_sigmoid_param() const;
+  private:
+  bool _internal_has_sigmoid_param() const;
+  public:
   void clear_sigmoid_param();
-  static const int kSigmoidParamFieldNumber = 124;
   const ::opencv_caffe::SigmoidParameter& sigmoid_param() const;
-  ::opencv_caffe::SigmoidParameter* release_sigmoid_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::SigmoidParameter* release_sigmoid_param();
   ::opencv_caffe::SigmoidParameter* mutable_sigmoid_param();
   void set_allocated_sigmoid_param(::opencv_caffe::SigmoidParameter* sigmoid_param);
+  private:
+  const ::opencv_caffe::SigmoidParameter& _internal_sigmoid_param() const;
+  ::opencv_caffe::SigmoidParameter* _internal_mutable_sigmoid_param();
+  public:
+  void unsafe_arena_set_allocated_sigmoid_param(
+      ::opencv_caffe::SigmoidParameter* sigmoid_param);
+  ::opencv_caffe::SigmoidParameter* unsafe_arena_release_sigmoid_param();
 
   // optional .opencv_caffe.SoftmaxParameter softmax_param = 125;
   bool has_softmax_param() const;
+  private:
+  bool _internal_has_softmax_param() const;
+  public:
   void clear_softmax_param();
-  static const int kSoftmaxParamFieldNumber = 125;
   const ::opencv_caffe::SoftmaxParameter& softmax_param() const;
-  ::opencv_caffe::SoftmaxParameter* release_softmax_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::SoftmaxParameter* release_softmax_param();
   ::opencv_caffe::SoftmaxParameter* mutable_softmax_param();
   void set_allocated_softmax_param(::opencv_caffe::SoftmaxParameter* softmax_param);
+  private:
+  const ::opencv_caffe::SoftmaxParameter& _internal_softmax_param() const;
+  ::opencv_caffe::SoftmaxParameter* _internal_mutable_softmax_param();
+  public:
+  void unsafe_arena_set_allocated_softmax_param(
+      ::opencv_caffe::SoftmaxParameter* softmax_param);
+  ::opencv_caffe::SoftmaxParameter* unsafe_arena_release_softmax_param();
 
   // optional .opencv_caffe.SliceParameter slice_param = 126;
   bool has_slice_param() const;
+  private:
+  bool _internal_has_slice_param() const;
+  public:
   void clear_slice_param();
-  static const int kSliceParamFieldNumber = 126;
   const ::opencv_caffe::SliceParameter& slice_param() const;
-  ::opencv_caffe::SliceParameter* release_slice_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::SliceParameter* release_slice_param();
   ::opencv_caffe::SliceParameter* mutable_slice_param();
   void set_allocated_slice_param(::opencv_caffe::SliceParameter* slice_param);
+  private:
+  const ::opencv_caffe::SliceParameter& _internal_slice_param() const;
+  ::opencv_caffe::SliceParameter* _internal_mutable_slice_param();
+  public:
+  void unsafe_arena_set_allocated_slice_param(
+      ::opencv_caffe::SliceParameter* slice_param);
+  ::opencv_caffe::SliceParameter* unsafe_arena_release_slice_param();
 
   // optional .opencv_caffe.TanHParameter tanh_param = 127;
   bool has_tanh_param() const;
+  private:
+  bool _internal_has_tanh_param() const;
+  public:
   void clear_tanh_param();
-  static const int kTanhParamFieldNumber = 127;
   const ::opencv_caffe::TanHParameter& tanh_param() const;
-  ::opencv_caffe::TanHParameter* release_tanh_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::TanHParameter* release_tanh_param();
   ::opencv_caffe::TanHParameter* mutable_tanh_param();
   void set_allocated_tanh_param(::opencv_caffe::TanHParameter* tanh_param);
+  private:
+  const ::opencv_caffe::TanHParameter& _internal_tanh_param() const;
+  ::opencv_caffe::TanHParameter* _internal_mutable_tanh_param();
+  public:
+  void unsafe_arena_set_allocated_tanh_param(
+      ::opencv_caffe::TanHParameter* tanh_param);
+  ::opencv_caffe::TanHParameter* unsafe_arena_release_tanh_param();
 
   // optional .opencv_caffe.ThresholdParameter threshold_param = 128;
   bool has_threshold_param() const;
+  private:
+  bool _internal_has_threshold_param() const;
+  public:
   void clear_threshold_param();
-  static const int kThresholdParamFieldNumber = 128;
   const ::opencv_caffe::ThresholdParameter& threshold_param() const;
-  ::opencv_caffe::ThresholdParameter* release_threshold_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ThresholdParameter* release_threshold_param();
   ::opencv_caffe::ThresholdParameter* mutable_threshold_param();
   void set_allocated_threshold_param(::opencv_caffe::ThresholdParameter* threshold_param);
+  private:
+  const ::opencv_caffe::ThresholdParameter& _internal_threshold_param() const;
+  ::opencv_caffe::ThresholdParameter* _internal_mutable_threshold_param();
+  public:
+  void unsafe_arena_set_allocated_threshold_param(
+      ::opencv_caffe::ThresholdParameter* threshold_param);
+  ::opencv_caffe::ThresholdParameter* unsafe_arena_release_threshold_param();
 
   // optional .opencv_caffe.WindowDataParameter window_data_param = 129;
   bool has_window_data_param() const;
+  private:
+  bool _internal_has_window_data_param() const;
+  public:
   void clear_window_data_param();
-  static const int kWindowDataParamFieldNumber = 129;
   const ::opencv_caffe::WindowDataParameter& window_data_param() const;
-  ::opencv_caffe::WindowDataParameter* release_window_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::WindowDataParameter* release_window_data_param();
   ::opencv_caffe::WindowDataParameter* mutable_window_data_param();
   void set_allocated_window_data_param(::opencv_caffe::WindowDataParameter* window_data_param);
+  private:
+  const ::opencv_caffe::WindowDataParameter& _internal_window_data_param() const;
+  ::opencv_caffe::WindowDataParameter* _internal_mutable_window_data_param();
+  public:
+  void unsafe_arena_set_allocated_window_data_param(
+      ::opencv_caffe::WindowDataParameter* window_data_param);
+  ::opencv_caffe::WindowDataParameter* unsafe_arena_release_window_data_param();
 
   // optional .opencv_caffe.PythonParameter python_param = 130;
   bool has_python_param() const;
+  private:
+  bool _internal_has_python_param() const;
+  public:
   void clear_python_param();
-  static const int kPythonParamFieldNumber = 130;
   const ::opencv_caffe::PythonParameter& python_param() const;
-  ::opencv_caffe::PythonParameter* release_python_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PythonParameter* release_python_param();
   ::opencv_caffe::PythonParameter* mutable_python_param();
   void set_allocated_python_param(::opencv_caffe::PythonParameter* python_param);
+  private:
+  const ::opencv_caffe::PythonParameter& _internal_python_param() const;
+  ::opencv_caffe::PythonParameter* _internal_mutable_python_param();
+  public:
+  void unsafe_arena_set_allocated_python_param(
+      ::opencv_caffe::PythonParameter* python_param);
+  ::opencv_caffe::PythonParameter* unsafe_arena_release_python_param();
 
   // optional .opencv_caffe.PReLUParameter prelu_param = 131;
   bool has_prelu_param() const;
+  private:
+  bool _internal_has_prelu_param() const;
+  public:
   void clear_prelu_param();
-  static const int kPreluParamFieldNumber = 131;
   const ::opencv_caffe::PReLUParameter& prelu_param() const;
-  ::opencv_caffe::PReLUParameter* release_prelu_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PReLUParameter* release_prelu_param();
   ::opencv_caffe::PReLUParameter* mutable_prelu_param();
   void set_allocated_prelu_param(::opencv_caffe::PReLUParameter* prelu_param);
+  private:
+  const ::opencv_caffe::PReLUParameter& _internal_prelu_param() const;
+  ::opencv_caffe::PReLUParameter* _internal_mutable_prelu_param();
+  public:
+  void unsafe_arena_set_allocated_prelu_param(
+      ::opencv_caffe::PReLUParameter* prelu_param);
+  ::opencv_caffe::PReLUParameter* unsafe_arena_release_prelu_param();
 
   // optional .opencv_caffe.SPPParameter spp_param = 132;
   bool has_spp_param() const;
+  private:
+  bool _internal_has_spp_param() const;
+  public:
   void clear_spp_param();
-  static const int kSppParamFieldNumber = 132;
   const ::opencv_caffe::SPPParameter& spp_param() const;
-  ::opencv_caffe::SPPParameter* release_spp_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::SPPParameter* release_spp_param();
   ::opencv_caffe::SPPParameter* mutable_spp_param();
   void set_allocated_spp_param(::opencv_caffe::SPPParameter* spp_param);
+  private:
+  const ::opencv_caffe::SPPParameter& _internal_spp_param() const;
+  ::opencv_caffe::SPPParameter* _internal_mutable_spp_param();
+  public:
+  void unsafe_arena_set_allocated_spp_param(
+      ::opencv_caffe::SPPParameter* spp_param);
+  ::opencv_caffe::SPPParameter* unsafe_arena_release_spp_param();
 
   // optional .opencv_caffe.ReshapeParameter reshape_param = 133;
   bool has_reshape_param() const;
+  private:
+  bool _internal_has_reshape_param() const;
+  public:
   void clear_reshape_param();
-  static const int kReshapeParamFieldNumber = 133;
   const ::opencv_caffe::ReshapeParameter& reshape_param() const;
-  ::opencv_caffe::ReshapeParameter* release_reshape_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ReshapeParameter* release_reshape_param();
   ::opencv_caffe::ReshapeParameter* mutable_reshape_param();
   void set_allocated_reshape_param(::opencv_caffe::ReshapeParameter* reshape_param);
+  private:
+  const ::opencv_caffe::ReshapeParameter& _internal_reshape_param() const;
+  ::opencv_caffe::ReshapeParameter* _internal_mutable_reshape_param();
+  public:
+  void unsafe_arena_set_allocated_reshape_param(
+      ::opencv_caffe::ReshapeParameter* reshape_param);
+  ::opencv_caffe::ReshapeParameter* unsafe_arena_release_reshape_param();
 
   // optional .opencv_caffe.LogParameter log_param = 134;
   bool has_log_param() const;
+  private:
+  bool _internal_has_log_param() const;
+  public:
   void clear_log_param();
-  static const int kLogParamFieldNumber = 134;
   const ::opencv_caffe::LogParameter& log_param() const;
-  ::opencv_caffe::LogParameter* release_log_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::LogParameter* release_log_param();
   ::opencv_caffe::LogParameter* mutable_log_param();
   void set_allocated_log_param(::opencv_caffe::LogParameter* log_param);
+  private:
+  const ::opencv_caffe::LogParameter& _internal_log_param() const;
+  ::opencv_caffe::LogParameter* _internal_mutable_log_param();
+  public:
+  void unsafe_arena_set_allocated_log_param(
+      ::opencv_caffe::LogParameter* log_param);
+  ::opencv_caffe::LogParameter* unsafe_arena_release_log_param();
 
   // optional .opencv_caffe.FlattenParameter flatten_param = 135;
   bool has_flatten_param() const;
+  private:
+  bool _internal_has_flatten_param() const;
+  public:
   void clear_flatten_param();
-  static const int kFlattenParamFieldNumber = 135;
   const ::opencv_caffe::FlattenParameter& flatten_param() const;
-  ::opencv_caffe::FlattenParameter* release_flatten_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::FlattenParameter* release_flatten_param();
   ::opencv_caffe::FlattenParameter* mutable_flatten_param();
   void set_allocated_flatten_param(::opencv_caffe::FlattenParameter* flatten_param);
+  private:
+  const ::opencv_caffe::FlattenParameter& _internal_flatten_param() const;
+  ::opencv_caffe::FlattenParameter* _internal_mutable_flatten_param();
+  public:
+  void unsafe_arena_set_allocated_flatten_param(
+      ::opencv_caffe::FlattenParameter* flatten_param);
+  ::opencv_caffe::FlattenParameter* unsafe_arena_release_flatten_param();
 
   // optional .opencv_caffe.ReductionParameter reduction_param = 136;
   bool has_reduction_param() const;
+  private:
+  bool _internal_has_reduction_param() const;
+  public:
   void clear_reduction_param();
-  static const int kReductionParamFieldNumber = 136;
   const ::opencv_caffe::ReductionParameter& reduction_param() const;
-  ::opencv_caffe::ReductionParameter* release_reduction_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ReductionParameter* release_reduction_param();
   ::opencv_caffe::ReductionParameter* mutable_reduction_param();
   void set_allocated_reduction_param(::opencv_caffe::ReductionParameter* reduction_param);
+  private:
+  const ::opencv_caffe::ReductionParameter& _internal_reduction_param() const;
+  ::opencv_caffe::ReductionParameter* _internal_mutable_reduction_param();
+  public:
+  void unsafe_arena_set_allocated_reduction_param(
+      ::opencv_caffe::ReductionParameter* reduction_param);
+  ::opencv_caffe::ReductionParameter* unsafe_arena_release_reduction_param();
 
   // optional .opencv_caffe.EmbedParameter embed_param = 137;
   bool has_embed_param() const;
+  private:
+  bool _internal_has_embed_param() const;
+  public:
   void clear_embed_param();
-  static const int kEmbedParamFieldNumber = 137;
   const ::opencv_caffe::EmbedParameter& embed_param() const;
-  ::opencv_caffe::EmbedParameter* release_embed_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::EmbedParameter* release_embed_param();
   ::opencv_caffe::EmbedParameter* mutable_embed_param();
   void set_allocated_embed_param(::opencv_caffe::EmbedParameter* embed_param);
+  private:
+  const ::opencv_caffe::EmbedParameter& _internal_embed_param() const;
+  ::opencv_caffe::EmbedParameter* _internal_mutable_embed_param();
+  public:
+  void unsafe_arena_set_allocated_embed_param(
+      ::opencv_caffe::EmbedParameter* embed_param);
+  ::opencv_caffe::EmbedParameter* unsafe_arena_release_embed_param();
 
   // optional .opencv_caffe.TileParameter tile_param = 138;
   bool has_tile_param() const;
+  private:
+  bool _internal_has_tile_param() const;
+  public:
   void clear_tile_param();
-  static const int kTileParamFieldNumber = 138;
   const ::opencv_caffe::TileParameter& tile_param() const;
-  ::opencv_caffe::TileParameter* release_tile_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::TileParameter* release_tile_param();
   ::opencv_caffe::TileParameter* mutable_tile_param();
   void set_allocated_tile_param(::opencv_caffe::TileParameter* tile_param);
+  private:
+  const ::opencv_caffe::TileParameter& _internal_tile_param() const;
+  ::opencv_caffe::TileParameter* _internal_mutable_tile_param();
+  public:
+  void unsafe_arena_set_allocated_tile_param(
+      ::opencv_caffe::TileParameter* tile_param);
+  ::opencv_caffe::TileParameter* unsafe_arena_release_tile_param();
 
   // optional .opencv_caffe.BatchNormParameter batch_norm_param = 139;
   bool has_batch_norm_param() const;
+  private:
+  bool _internal_has_batch_norm_param() const;
+  public:
   void clear_batch_norm_param();
-  static const int kBatchNormParamFieldNumber = 139;
   const ::opencv_caffe::BatchNormParameter& batch_norm_param() const;
-  ::opencv_caffe::BatchNormParameter* release_batch_norm_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::BatchNormParameter* release_batch_norm_param();
   ::opencv_caffe::BatchNormParameter* mutable_batch_norm_param();
   void set_allocated_batch_norm_param(::opencv_caffe::BatchNormParameter* batch_norm_param);
+  private:
+  const ::opencv_caffe::BatchNormParameter& _internal_batch_norm_param() const;
+  ::opencv_caffe::BatchNormParameter* _internal_mutable_batch_norm_param();
+  public:
+  void unsafe_arena_set_allocated_batch_norm_param(
+      ::opencv_caffe::BatchNormParameter* batch_norm_param);
+  ::opencv_caffe::BatchNormParameter* unsafe_arena_release_batch_norm_param();
 
   // optional .opencv_caffe.ELUParameter elu_param = 140;
   bool has_elu_param() const;
+  private:
+  bool _internal_has_elu_param() const;
+  public:
   void clear_elu_param();
-  static const int kEluParamFieldNumber = 140;
   const ::opencv_caffe::ELUParameter& elu_param() const;
-  ::opencv_caffe::ELUParameter* release_elu_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ELUParameter* release_elu_param();
   ::opencv_caffe::ELUParameter* mutable_elu_param();
   void set_allocated_elu_param(::opencv_caffe::ELUParameter* elu_param);
+  private:
+  const ::opencv_caffe::ELUParameter& _internal_elu_param() const;
+  ::opencv_caffe::ELUParameter* _internal_mutable_elu_param();
+  public:
+  void unsafe_arena_set_allocated_elu_param(
+      ::opencv_caffe::ELUParameter* elu_param);
+  ::opencv_caffe::ELUParameter* unsafe_arena_release_elu_param();
 
   // optional .opencv_caffe.BiasParameter bias_param = 141;
   bool has_bias_param() const;
+  private:
+  bool _internal_has_bias_param() const;
+  public:
   void clear_bias_param();
-  static const int kBiasParamFieldNumber = 141;
   const ::opencv_caffe::BiasParameter& bias_param() const;
-  ::opencv_caffe::BiasParameter* release_bias_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::BiasParameter* release_bias_param();
   ::opencv_caffe::BiasParameter* mutable_bias_param();
   void set_allocated_bias_param(::opencv_caffe::BiasParameter* bias_param);
+  private:
+  const ::opencv_caffe::BiasParameter& _internal_bias_param() const;
+  ::opencv_caffe::BiasParameter* _internal_mutable_bias_param();
+  public:
+  void unsafe_arena_set_allocated_bias_param(
+      ::opencv_caffe::BiasParameter* bias_param);
+  ::opencv_caffe::BiasParameter* unsafe_arena_release_bias_param();
 
   // optional .opencv_caffe.ScaleParameter scale_param = 142;
   bool has_scale_param() const;
+  private:
+  bool _internal_has_scale_param() const;
+  public:
   void clear_scale_param();
-  static const int kScaleParamFieldNumber = 142;
   const ::opencv_caffe::ScaleParameter& scale_param() const;
-  ::opencv_caffe::ScaleParameter* release_scale_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ScaleParameter* release_scale_param();
   ::opencv_caffe::ScaleParameter* mutable_scale_param();
   void set_allocated_scale_param(::opencv_caffe::ScaleParameter* scale_param);
+  private:
+  const ::opencv_caffe::ScaleParameter& _internal_scale_param() const;
+  ::opencv_caffe::ScaleParameter* _internal_mutable_scale_param();
+  public:
+  void unsafe_arena_set_allocated_scale_param(
+      ::opencv_caffe::ScaleParameter* scale_param);
+  ::opencv_caffe::ScaleParameter* unsafe_arena_release_scale_param();
 
   // optional .opencv_caffe.InputParameter input_param = 143;
   bool has_input_param() const;
-  void clear_input_param();
-  static const int kInputParamFieldNumber = 143;
+  private:
+  bool _internal_has_input_param() const;
+  public:
+  void clear_input_param();
   const ::opencv_caffe::InputParameter& input_param() const;
-  ::opencv_caffe::InputParameter* release_input_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::InputParameter* release_input_param();
   ::opencv_caffe::InputParameter* mutable_input_param();
   void set_allocated_input_param(::opencv_caffe::InputParameter* input_param);
+  private:
+  const ::opencv_caffe::InputParameter& _internal_input_param() const;
+  ::opencv_caffe::InputParameter* _internal_mutable_input_param();
+  public:
+  void unsafe_arena_set_allocated_input_param(
+      ::opencv_caffe::InputParameter* input_param);
+  ::opencv_caffe::InputParameter* unsafe_arena_release_input_param();
 
   // optional .opencv_caffe.CropParameter crop_param = 144;
   bool has_crop_param() const;
+  private:
+  bool _internal_has_crop_param() const;
+  public:
   void clear_crop_param();
-  static const int kCropParamFieldNumber = 144;
   const ::opencv_caffe::CropParameter& crop_param() const;
-  ::opencv_caffe::CropParameter* release_crop_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::CropParameter* release_crop_param();
   ::opencv_caffe::CropParameter* mutable_crop_param();
   void set_allocated_crop_param(::opencv_caffe::CropParameter* crop_param);
+  private:
+  const ::opencv_caffe::CropParameter& _internal_crop_param() const;
+  ::opencv_caffe::CropParameter* _internal_mutable_crop_param();
+  public:
+  void unsafe_arena_set_allocated_crop_param(
+      ::opencv_caffe::CropParameter* crop_param);
+  ::opencv_caffe::CropParameter* unsafe_arena_release_crop_param();
 
   // optional .opencv_caffe.ParameterParameter parameter_param = 145;
   bool has_parameter_param() const;
+  private:
+  bool _internal_has_parameter_param() const;
+  public:
   void clear_parameter_param();
-  static const int kParameterParamFieldNumber = 145;
   const ::opencv_caffe::ParameterParameter& parameter_param() const;
-  ::opencv_caffe::ParameterParameter* release_parameter_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ParameterParameter* release_parameter_param();
   ::opencv_caffe::ParameterParameter* mutable_parameter_param();
   void set_allocated_parameter_param(::opencv_caffe::ParameterParameter* parameter_param);
+  private:
+  const ::opencv_caffe::ParameterParameter& _internal_parameter_param() const;
+  ::opencv_caffe::ParameterParameter* _internal_mutable_parameter_param();
+  public:
+  void unsafe_arena_set_allocated_parameter_param(
+      ::opencv_caffe::ParameterParameter* parameter_param);
+  ::opencv_caffe::ParameterParameter* unsafe_arena_release_parameter_param();
 
   // optional .opencv_caffe.RecurrentParameter recurrent_param = 146;
   bool has_recurrent_param() const;
+  private:
+  bool _internal_has_recurrent_param() const;
+  public:
   void clear_recurrent_param();
-  static const int kRecurrentParamFieldNumber = 146;
   const ::opencv_caffe::RecurrentParameter& recurrent_param() const;
-  ::opencv_caffe::RecurrentParameter* release_recurrent_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::RecurrentParameter* release_recurrent_param();
   ::opencv_caffe::RecurrentParameter* mutable_recurrent_param();
   void set_allocated_recurrent_param(::opencv_caffe::RecurrentParameter* recurrent_param);
+  private:
+  const ::opencv_caffe::RecurrentParameter& _internal_recurrent_param() const;
+  ::opencv_caffe::RecurrentParameter* _internal_mutable_recurrent_param();
+  public:
+  void unsafe_arena_set_allocated_recurrent_param(
+      ::opencv_caffe::RecurrentParameter* recurrent_param);
+  ::opencv_caffe::RecurrentParameter* unsafe_arena_release_recurrent_param();
 
   // optional .opencv_caffe.DetectionOutputParameter detection_output_param = 147;
   bool has_detection_output_param() const;
+  private:
+  bool _internal_has_detection_output_param() const;
+  public:
   void clear_detection_output_param();
-  static const int kDetectionOutputParamFieldNumber = 147;
   const ::opencv_caffe::DetectionOutputParameter& detection_output_param() const;
-  ::opencv_caffe::DetectionOutputParameter* release_detection_output_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::DetectionOutputParameter* release_detection_output_param();
   ::opencv_caffe::DetectionOutputParameter* mutable_detection_output_param();
   void set_allocated_detection_output_param(::opencv_caffe::DetectionOutputParameter* detection_output_param);
+  private:
+  const ::opencv_caffe::DetectionOutputParameter& _internal_detection_output_param() const;
+  ::opencv_caffe::DetectionOutputParameter* _internal_mutable_detection_output_param();
+  public:
+  void unsafe_arena_set_allocated_detection_output_param(
+      ::opencv_caffe::DetectionOutputParameter* detection_output_param);
+  ::opencv_caffe::DetectionOutputParameter* unsafe_arena_release_detection_output_param();
 
   // optional .opencv_caffe.PermuteParameter permute_param = 148;
   bool has_permute_param() const;
+  private:
+  bool _internal_has_permute_param() const;
+  public:
   void clear_permute_param();
-  static const int kPermuteParamFieldNumber = 148;
   const ::opencv_caffe::PermuteParameter& permute_param() const;
-  ::opencv_caffe::PermuteParameter* release_permute_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PermuteParameter* release_permute_param();
   ::opencv_caffe::PermuteParameter* mutable_permute_param();
   void set_allocated_permute_param(::opencv_caffe::PermuteParameter* permute_param);
+  private:
+  const ::opencv_caffe::PermuteParameter& _internal_permute_param() const;
+  ::opencv_caffe::PermuteParameter* _internal_mutable_permute_param();
+  public:
+  void unsafe_arena_set_allocated_permute_param(
+      ::opencv_caffe::PermuteParameter* permute_param);
+  ::opencv_caffe::PermuteParameter* unsafe_arena_release_permute_param();
 
   // optional .opencv_caffe.NormalizeBBoxParameter norm_param = 149;
   bool has_norm_param() const;
+  private:
+  bool _internal_has_norm_param() const;
+  public:
   void clear_norm_param();
-  static const int kNormParamFieldNumber = 149;
   const ::opencv_caffe::NormalizeBBoxParameter& norm_param() const;
-  ::opencv_caffe::NormalizeBBoxParameter* release_norm_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::NormalizeBBoxParameter* release_norm_param();
   ::opencv_caffe::NormalizeBBoxParameter* mutable_norm_param();
   void set_allocated_norm_param(::opencv_caffe::NormalizeBBoxParameter* norm_param);
+  private:
+  const ::opencv_caffe::NormalizeBBoxParameter& _internal_norm_param() const;
+  ::opencv_caffe::NormalizeBBoxParameter* _internal_mutable_norm_param();
+  public:
+  void unsafe_arena_set_allocated_norm_param(
+      ::opencv_caffe::NormalizeBBoxParameter* norm_param);
+  ::opencv_caffe::NormalizeBBoxParameter* unsafe_arena_release_norm_param();
 
   // optional .opencv_caffe.PriorBoxParameter prior_box_param = 150;
   bool has_prior_box_param() const;
+  private:
+  bool _internal_has_prior_box_param() const;
+  public:
   void clear_prior_box_param();
-  static const int kPriorBoxParamFieldNumber = 150;
   const ::opencv_caffe::PriorBoxParameter& prior_box_param() const;
-  ::opencv_caffe::PriorBoxParameter* release_prior_box_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PriorBoxParameter* release_prior_box_param();
   ::opencv_caffe::PriorBoxParameter* mutable_prior_box_param();
   void set_allocated_prior_box_param(::opencv_caffe::PriorBoxParameter* prior_box_param);
+  private:
+  const ::opencv_caffe::PriorBoxParameter& _internal_prior_box_param() const;
+  ::opencv_caffe::PriorBoxParameter* _internal_mutable_prior_box_param();
+  public:
+  void unsafe_arena_set_allocated_prior_box_param(
+      ::opencv_caffe::PriorBoxParameter* prior_box_param);
+  ::opencv_caffe::PriorBoxParameter* unsafe_arena_release_prior_box_param();
 
   // optional .opencv_caffe.ProposalParameter proposal_param = 201;
   bool has_proposal_param() const;
+  private:
+  bool _internal_has_proposal_param() const;
+  public:
   void clear_proposal_param();
-  static const int kProposalParamFieldNumber = 201;
   const ::opencv_caffe::ProposalParameter& proposal_param() const;
-  ::opencv_caffe::ProposalParameter* release_proposal_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ProposalParameter* release_proposal_param();
   ::opencv_caffe::ProposalParameter* mutable_proposal_param();
   void set_allocated_proposal_param(::opencv_caffe::ProposalParameter* proposal_param);
+  private:
+  const ::opencv_caffe::ProposalParameter& _internal_proposal_param() const;
+  ::opencv_caffe::ProposalParameter* _internal_mutable_proposal_param();
+  public:
+  void unsafe_arena_set_allocated_proposal_param(
+      ::opencv_caffe::ProposalParameter* proposal_param);
+  ::opencv_caffe::ProposalParameter* unsafe_arena_release_proposal_param();
 
   // optional .opencv_caffe.PSROIPoolingParameter psroi_pooling_param = 10002;
   bool has_psroi_pooling_param() const;
+  private:
+  bool _internal_has_psroi_pooling_param() const;
+  public:
   void clear_psroi_pooling_param();
-  static const int kPsroiPoolingParamFieldNumber = 10002;
   const ::opencv_caffe::PSROIPoolingParameter& psroi_pooling_param() const;
-  ::opencv_caffe::PSROIPoolingParameter* release_psroi_pooling_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PSROIPoolingParameter* release_psroi_pooling_param();
   ::opencv_caffe::PSROIPoolingParameter* mutable_psroi_pooling_param();
   void set_allocated_psroi_pooling_param(::opencv_caffe::PSROIPoolingParameter* psroi_pooling_param);
+  private:
+  const ::opencv_caffe::PSROIPoolingParameter& _internal_psroi_pooling_param() const;
+  ::opencv_caffe::PSROIPoolingParameter* _internal_mutable_psroi_pooling_param();
+  public:
+  void unsafe_arena_set_allocated_psroi_pooling_param(
+      ::opencv_caffe::PSROIPoolingParameter* psroi_pooling_param);
+  ::opencv_caffe::PSROIPoolingParameter* unsafe_arena_release_psroi_pooling_param();
 
   // optional .opencv_caffe.ROIPoolingParameter roi_pooling_param = 8266711;
   bool has_roi_pooling_param() const;
+  private:
+  bool _internal_has_roi_pooling_param() const;
+  public:
   void clear_roi_pooling_param();
-  static const int kRoiPoolingParamFieldNumber = 8266711;
   const ::opencv_caffe::ROIPoolingParameter& roi_pooling_param() const;
-  ::opencv_caffe::ROIPoolingParameter* release_roi_pooling_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ROIPoolingParameter* release_roi_pooling_param();
   ::opencv_caffe::ROIPoolingParameter* mutable_roi_pooling_param();
   void set_allocated_roi_pooling_param(::opencv_caffe::ROIPoolingParameter* roi_pooling_param);
+  private:
+  const ::opencv_caffe::ROIPoolingParameter& _internal_roi_pooling_param() const;
+  ::opencv_caffe::ROIPoolingParameter* _internal_mutable_roi_pooling_param();
+  public:
+  void unsafe_arena_set_allocated_roi_pooling_param(
+      ::opencv_caffe::ROIPoolingParameter* roi_pooling_param);
+  ::opencv_caffe::ROIPoolingParameter* unsafe_arena_release_roi_pooling_param();
 
   // optional .opencv_caffe.Phase phase = 10;
   bool has_phase() const;
+  private:
+  bool _internal_has_phase() const;
+  public:
   void clear_phase();
-  static const int kPhaseFieldNumber = 10;
   ::opencv_caffe::Phase phase() const;
   void set_phase(::opencv_caffe::Phase value);
+  private:
+  ::opencv_caffe::Phase _internal_phase() const;
+  void _internal_set_phase(::opencv_caffe::Phase value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.LayerParameter)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_type();
-  void clear_has_type();
-  void set_has_phase();
-  void clear_has_phase();
-  void set_has_transform_param();
-  void clear_has_transform_param();
-  void set_has_loss_param();
-  void clear_has_loss_param();
-  void set_has_accuracy_param();
-  void clear_has_accuracy_param();
-  void set_has_argmax_param();
-  void clear_has_argmax_param();
-  void set_has_batch_norm_param();
-  void clear_has_batch_norm_param();
-  void set_has_bias_param();
-  void clear_has_bias_param();
-  void set_has_concat_param();
-  void clear_has_concat_param();
-  void set_has_contrastive_loss_param();
-  void clear_has_contrastive_loss_param();
-  void set_has_convolution_param();
-  void clear_has_convolution_param();
-  void set_has_crop_param();
-  void clear_has_crop_param();
-  void set_has_data_param();
-  void clear_has_data_param();
-  void set_has_detection_output_param();
-  void clear_has_detection_output_param();
-  void set_has_dropout_param();
-  void clear_has_dropout_param();
-  void set_has_dummy_data_param();
-  void clear_has_dummy_data_param();
-  void set_has_eltwise_param();
-  void clear_has_eltwise_param();
-  void set_has_elu_param();
-  void clear_has_elu_param();
-  void set_has_embed_param();
-  void clear_has_embed_param();
-  void set_has_exp_param();
-  void clear_has_exp_param();
-  void set_has_flatten_param();
-  void clear_has_flatten_param();
-  void set_has_hdf5_data_param();
-  void clear_has_hdf5_data_param();
-  void set_has_hdf5_output_param();
-  void clear_has_hdf5_output_param();
-  void set_has_hinge_loss_param();
-  void clear_has_hinge_loss_param();
-  void set_has_image_data_param();
-  void clear_has_image_data_param();
-  void set_has_infogain_loss_param();
-  void clear_has_infogain_loss_param();
-  void set_has_inner_product_param();
-  void clear_has_inner_product_param();
-  void set_has_input_param();
-  void clear_has_input_param();
-  void set_has_log_param();
-  void clear_has_log_param();
-  void set_has_lrn_param();
-  void clear_has_lrn_param();
-  void set_has_memory_data_param();
-  void clear_has_memory_data_param();
-  void set_has_mvn_param();
-  void clear_has_mvn_param();
-  void set_has_norm_param();
-  void clear_has_norm_param();
-  void set_has_permute_param();
-  void clear_has_permute_param();
-  void set_has_parameter_param();
-  void clear_has_parameter_param();
-  void set_has_pooling_param();
-  void clear_has_pooling_param();
-  void set_has_power_param();
-  void clear_has_power_param();
-  void set_has_prelu_param();
-  void clear_has_prelu_param();
-  void set_has_prior_box_param();
-  void clear_has_prior_box_param();
-  void set_has_proposal_param();
-  void clear_has_proposal_param();
-  void set_has_psroi_pooling_param();
-  void clear_has_psroi_pooling_param();
-  void set_has_python_param();
-  void clear_has_python_param();
-  void set_has_recurrent_param();
-  void clear_has_recurrent_param();
-  void set_has_reduction_param();
-  void clear_has_reduction_param();
-  void set_has_relu_param();
-  void clear_has_relu_param();
-  void set_has_reshape_param();
-  void clear_has_reshape_param();
-  void set_has_roi_pooling_param();
-  void clear_has_roi_pooling_param();
-  void set_has_scale_param();
-  void clear_has_scale_param();
-  void set_has_sigmoid_param();
-  void clear_has_sigmoid_param();
-  void set_has_softmax_param();
-  void clear_has_softmax_param();
-  void set_has_spp_param();
-  void clear_has_spp_param();
-  void set_has_slice_param();
-  void clear_has_slice_param();
-  void set_has_tanh_param();
-  void clear_has_tanh_param();
-  void set_has_threshold_param();
-  void clear_has_threshold_param();
-  void set_has_tile_param();
-  void clear_has_tile_param();
-  void set_has_window_data_param();
-  void clear_has_window_data_param();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<2> _has_bits_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> bottom_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> top_;
-  ::google::protobuf::RepeatedField< float > loss_weight_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::ParamSpec > param_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto > blobs_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule > include_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule > exclude_;
-  ::google::protobuf::RepeatedField< bool > propagate_down_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr type_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<2> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> bottom_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> top_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > loss_weight_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::ParamSpec > param_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto > blobs_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule > include_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule > exclude_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool > propagate_down_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_;
   ::opencv_caffe::TransformationParameter* transform_param_;
   ::opencv_caffe::LossParameter* loss_param_;
   ::opencv_caffe::AccuracyParameter* accuracy_param_;
@@ -5141,8186 +7061,11713 @@ class LayerParameter : public ::google::protobuf::Message /* @@protoc_insertion_
   ::opencv_caffe::PSROIPoolingParameter* psroi_pooling_param_;
   ::opencv_caffe::ROIPoolingParameter* roi_pooling_param_;
   int phase_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLayerParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TransformationParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.TransformationParameter) */ {
+class TransformationParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.TransformationParameter) */ {
  public:
-  TransformationParameter();
-  virtual ~TransformationParameter();
+  inline TransformationParameter() : TransformationParameter(nullptr) {}
+  ~TransformationParameter() override;
+  explicit constexpr TransformationParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TransformationParameter(const TransformationParameter& from);
-
-  inline TransformationParameter& operator=(const TransformationParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TransformationParameter(TransformationParameter&& from) noexcept
     : TransformationParameter() {
     *this = ::std::move(from);
   }
 
+  inline TransformationParameter& operator=(const TransformationParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TransformationParameter& operator=(TransformationParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TransformationParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TransformationParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const TransformationParameter* internal_default_instance() {
     return reinterpret_cast<const TransformationParameter*>(
                &_TransformationParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     16;
 
-  void Swap(TransformationParameter* other);
   friend void swap(TransformationParameter& a, TransformationParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(TransformationParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TransformationParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TransformationParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TransformationParameter* 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;
+  TransformationParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TransformationParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TransformationParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TransformationParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TransformationParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.TransformationParameter";
   }
+  protected:
+  explicit TransformationParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kMeanValueFieldNumber = 5,
+    kMeanFileFieldNumber = 4,
+    kCropSizeFieldNumber = 3,
+    kMirrorFieldNumber = 2,
+    kForceColorFieldNumber = 6,
+    kForceGrayFieldNumber = 7,
+    kScaleFieldNumber = 1,
+  };
   // repeated float mean_value = 5;
   int mean_value_size() const;
+  private:
+  int _internal_mean_value_size() const;
+  public:
   void clear_mean_value();
-  static const int kMeanValueFieldNumber = 5;
+  private:
+  float _internal_mean_value(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_mean_value() const;
+  void _internal_add_mean_value(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_mean_value();
+  public:
   float mean_value(int index) const;
   void set_mean_value(int index, float value);
   void add_mean_value(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       mean_value() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_mean_value();
 
   // optional string mean_file = 4;
   bool has_mean_file() const;
+  private:
+  bool _internal_has_mean_file() const;
+  public:
   void clear_mean_file();
-  static const int kMeanFileFieldNumber = 4;
-  const ::std::string& mean_file() const;
-  void set_mean_file(const ::std::string& value);
-  #if LANG_CXX11
-  void set_mean_file(::std::string&& value);
-  #endif
-  void set_mean_file(const char* value);
-  void set_mean_file(const char* value, size_t size);
-  ::std::string* mutable_mean_file();
-  ::std::string* release_mean_file();
-  void set_allocated_mean_file(::std::string* mean_file);
+  const std::string& mean_file() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_mean_file(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_mean_file();
+  PROTOBUF_NODISCARD std::string* release_mean_file();
+  void set_allocated_mean_file(std::string* mean_file);
+  private:
+  const std::string& _internal_mean_file() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_mean_file(const std::string& value);
+  std::string* _internal_mutable_mean_file();
+  public:
 
   // optional uint32 crop_size = 3 [default = 0];
   bool has_crop_size() const;
+  private:
+  bool _internal_has_crop_size() const;
+  public:
   void clear_crop_size();
-  static const int kCropSizeFieldNumber = 3;
-  ::google::protobuf::uint32 crop_size() const;
-  void set_crop_size(::google::protobuf::uint32 value);
+  uint32_t crop_size() const;
+  void set_crop_size(uint32_t value);
+  private:
+  uint32_t _internal_crop_size() const;
+  void _internal_set_crop_size(uint32_t value);
+  public:
 
   // optional bool mirror = 2 [default = false];
   bool has_mirror() const;
+  private:
+  bool _internal_has_mirror() const;
+  public:
   void clear_mirror();
-  static const int kMirrorFieldNumber = 2;
   bool mirror() const;
   void set_mirror(bool value);
+  private:
+  bool _internal_mirror() const;
+  void _internal_set_mirror(bool value);
+  public:
 
   // optional bool force_color = 6 [default = false];
   bool has_force_color() const;
+  private:
+  bool _internal_has_force_color() const;
+  public:
   void clear_force_color();
-  static const int kForceColorFieldNumber = 6;
   bool force_color() const;
   void set_force_color(bool value);
+  private:
+  bool _internal_force_color() const;
+  void _internal_set_force_color(bool value);
+  public:
 
   // optional bool force_gray = 7 [default = false];
   bool has_force_gray() const;
+  private:
+  bool _internal_has_force_gray() const;
+  public:
   void clear_force_gray();
-  static const int kForceGrayFieldNumber = 7;
   bool force_gray() const;
   void set_force_gray(bool value);
+  private:
+  bool _internal_force_gray() const;
+  void _internal_set_force_gray(bool value);
+  public:
 
   // optional float scale = 1 [default = 1];
   bool has_scale() const;
+  private:
+  bool _internal_has_scale() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 1;
   float scale() const;
   void set_scale(float value);
+  private:
+  float _internal_scale() const;
+  void _internal_set_scale(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.TransformationParameter)
  private:
-  void set_has_scale();
-  void clear_has_scale();
-  void set_has_mirror();
-  void clear_has_mirror();
-  void set_has_crop_size();
-  void clear_has_crop_size();
-  void set_has_mean_file();
-  void clear_has_mean_file();
-  void set_has_force_color();
-  void clear_has_force_color();
-  void set_has_force_gray();
-  void clear_has_force_gray();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< float > mean_value_;
-  ::google::protobuf::internal::ArenaStringPtr mean_file_;
-  ::google::protobuf::uint32 crop_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > mean_value_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr mean_file_;
+  uint32_t crop_size_;
   bool mirror_;
   bool force_color_;
   bool force_gray_;
   float scale_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTransformationParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LossParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.LossParameter) */ {
+class LossParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.LossParameter) */ {
  public:
-  LossParameter();
-  virtual ~LossParameter();
+  inline LossParameter() : LossParameter(nullptr) {}
+  ~LossParameter() override;
+  explicit constexpr LossParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   LossParameter(const LossParameter& from);
-
-  inline LossParameter& operator=(const LossParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   LossParameter(LossParameter&& from) noexcept
     : LossParameter() {
     *this = ::std::move(from);
   }
 
+  inline LossParameter& operator=(const LossParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline LossParameter& operator=(LossParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const LossParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const LossParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const LossParameter* internal_default_instance() {
     return reinterpret_cast<const LossParameter*>(
                &_LossParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     17;
 
-  void Swap(LossParameter* other);
   friend void swap(LossParameter& a, LossParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(LossParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(LossParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline LossParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  LossParameter* 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;
+  LossParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<LossParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const LossParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const LossParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(LossParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.LossParameter";
   }
+  protected:
+  explicit LossParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef LossParameter_NormalizationMode NormalizationMode;
-  static const NormalizationMode FULL =
+  static constexpr NormalizationMode FULL =
     LossParameter_NormalizationMode_FULL;
-  static const NormalizationMode VALID =
+  static constexpr NormalizationMode VALID =
     LossParameter_NormalizationMode_VALID;
-  static const NormalizationMode BATCH_SIZE =
+  static constexpr NormalizationMode BATCH_SIZE =
     LossParameter_NormalizationMode_BATCH_SIZE;
-  static const NormalizationMode NONE =
+  static constexpr NormalizationMode NONE =
     LossParameter_NormalizationMode_NONE;
   static inline bool NormalizationMode_IsValid(int value) {
     return LossParameter_NormalizationMode_IsValid(value);
   }
-  static const NormalizationMode NormalizationMode_MIN =
+  static constexpr NormalizationMode NormalizationMode_MIN =
     LossParameter_NormalizationMode_NormalizationMode_MIN;
-  static const NormalizationMode NormalizationMode_MAX =
+  static constexpr NormalizationMode NormalizationMode_MAX =
     LossParameter_NormalizationMode_NormalizationMode_MAX;
-  static const int NormalizationMode_ARRAYSIZE =
+  static constexpr int NormalizationMode_ARRAYSIZE =
     LossParameter_NormalizationMode_NormalizationMode_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   NormalizationMode_descriptor() {
     return LossParameter_NormalizationMode_descriptor();
   }
-  static inline const ::std::string& NormalizationMode_Name(NormalizationMode value) {
-    return LossParameter_NormalizationMode_Name(value);
+  template<typename T>
+  static inline const std::string& NormalizationMode_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, NormalizationMode>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function NormalizationMode_Name.");
+    return LossParameter_NormalizationMode_Name(enum_t_value);
   }
-  static inline bool NormalizationMode_Parse(const ::std::string& name,
+  static inline bool NormalizationMode_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       NormalizationMode* value) {
     return LossParameter_NormalizationMode_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kIgnoreLabelFieldNumber = 1,
+    kNormalizeFieldNumber = 2,
+    kNormalizationFieldNumber = 3,
+  };
   // optional int32 ignore_label = 1;
   bool has_ignore_label() const;
+  private:
+  bool _internal_has_ignore_label() const;
+  public:
   void clear_ignore_label();
-  static const int kIgnoreLabelFieldNumber = 1;
-  ::google::protobuf::int32 ignore_label() const;
-  void set_ignore_label(::google::protobuf::int32 value);
+  int32_t ignore_label() const;
+  void set_ignore_label(int32_t value);
+  private:
+  int32_t _internal_ignore_label() const;
+  void _internal_set_ignore_label(int32_t value);
+  public:
 
   // optional bool normalize = 2;
   bool has_normalize() const;
+  private:
+  bool _internal_has_normalize() const;
+  public:
   void clear_normalize();
-  static const int kNormalizeFieldNumber = 2;
   bool normalize() const;
   void set_normalize(bool value);
+  private:
+  bool _internal_normalize() const;
+  void _internal_set_normalize(bool value);
+  public:
 
   // optional .opencv_caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID];
   bool has_normalization() const;
+  private:
+  bool _internal_has_normalization() const;
+  public:
   void clear_normalization();
-  static const int kNormalizationFieldNumber = 3;
   ::opencv_caffe::LossParameter_NormalizationMode normalization() const;
   void set_normalization(::opencv_caffe::LossParameter_NormalizationMode value);
+  private:
+  ::opencv_caffe::LossParameter_NormalizationMode _internal_normalization() const;
+  void _internal_set_normalization(::opencv_caffe::LossParameter_NormalizationMode value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.LossParameter)
  private:
-  void set_has_ignore_label();
-  void clear_has_ignore_label();
-  void set_has_normalization();
-  void clear_has_normalization();
-  void set_has_normalize();
-  void clear_has_normalize();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::int32 ignore_label_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int32_t ignore_label_;
   bool normalize_;
   int normalization_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLossParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class AccuracyParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.AccuracyParameter) */ {
+class AccuracyParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.AccuracyParameter) */ {
  public:
-  AccuracyParameter();
-  virtual ~AccuracyParameter();
+  inline AccuracyParameter() : AccuracyParameter(nullptr) {}
+  ~AccuracyParameter() override;
+  explicit constexpr AccuracyParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   AccuracyParameter(const AccuracyParameter& from);
-
-  inline AccuracyParameter& operator=(const AccuracyParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   AccuracyParameter(AccuracyParameter&& from) noexcept
     : AccuracyParameter() {
     *this = ::std::move(from);
   }
 
+  inline AccuracyParameter& operator=(const AccuracyParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline AccuracyParameter& operator=(AccuracyParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const AccuracyParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const AccuracyParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const AccuracyParameter* internal_default_instance() {
     return reinterpret_cast<const AccuracyParameter*>(
                &_AccuracyParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     18;
 
-  void Swap(AccuracyParameter* other);
   friend void swap(AccuracyParameter& a, AccuracyParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(AccuracyParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(AccuracyParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline AccuracyParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  AccuracyParameter* 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;
+  AccuracyParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<AccuracyParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const AccuracyParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const AccuracyParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(AccuracyParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.AccuracyParameter";
   }
+  protected:
+  explicit AccuracyParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kIgnoreLabelFieldNumber = 3,
+    kTopKFieldNumber = 1,
+    kAxisFieldNumber = 2,
+  };
   // optional int32 ignore_label = 3;
   bool has_ignore_label() const;
+  private:
+  bool _internal_has_ignore_label() const;
+  public:
   void clear_ignore_label();
-  static const int kIgnoreLabelFieldNumber = 3;
-  ::google::protobuf::int32 ignore_label() const;
-  void set_ignore_label(::google::protobuf::int32 value);
+  int32_t ignore_label() const;
+  void set_ignore_label(int32_t value);
+  private:
+  int32_t _internal_ignore_label() const;
+  void _internal_set_ignore_label(int32_t value);
+  public:
 
   // optional uint32 top_k = 1 [default = 1];
   bool has_top_k() const;
+  private:
+  bool _internal_has_top_k() const;
+  public:
   void clear_top_k();
-  static const int kTopKFieldNumber = 1;
-  ::google::protobuf::uint32 top_k() const;
-  void set_top_k(::google::protobuf::uint32 value);
+  uint32_t top_k() const;
+  void set_top_k(uint32_t value);
+  private:
+  uint32_t _internal_top_k() const;
+  void _internal_set_top_k(uint32_t value);
+  public:
 
   // optional int32 axis = 2 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 2;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.AccuracyParameter)
  private:
-  void set_has_top_k();
-  void clear_has_top_k();
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_ignore_label();
-  void clear_has_ignore_label();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::int32 ignore_label_;
-  ::google::protobuf::uint32 top_k_;
-  ::google::protobuf::int32 axis_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsAccuracyParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int32_t ignore_label_;
+  uint32_t top_k_;
+  int32_t axis_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ArgMaxParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ArgMaxParameter) */ {
+class ArgMaxParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ArgMaxParameter) */ {
  public:
-  ArgMaxParameter();
-  virtual ~ArgMaxParameter();
+  inline ArgMaxParameter() : ArgMaxParameter(nullptr) {}
+  ~ArgMaxParameter() override;
+  explicit constexpr ArgMaxParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ArgMaxParameter(const ArgMaxParameter& from);
-
-  inline ArgMaxParameter& operator=(const ArgMaxParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ArgMaxParameter(ArgMaxParameter&& from) noexcept
     : ArgMaxParameter() {
     *this = ::std::move(from);
   }
 
+  inline ArgMaxParameter& operator=(const ArgMaxParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ArgMaxParameter& operator=(ArgMaxParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ArgMaxParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ArgMaxParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ArgMaxParameter* internal_default_instance() {
     return reinterpret_cast<const ArgMaxParameter*>(
                &_ArgMaxParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     19;
 
-  void Swap(ArgMaxParameter* other);
   friend void swap(ArgMaxParameter& a, ArgMaxParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ArgMaxParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ArgMaxParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ArgMaxParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ArgMaxParameter* 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;
+  ArgMaxParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ArgMaxParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ArgMaxParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ArgMaxParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ArgMaxParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ArgMaxParameter";
   }
+  protected:
+  explicit ArgMaxParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kOutMaxValFieldNumber = 1,
+    kAxisFieldNumber = 3,
+    kTopKFieldNumber = 2,
+  };
   // optional bool out_max_val = 1 [default = false];
   bool has_out_max_val() const;
+  private:
+  bool _internal_has_out_max_val() const;
+  public:
   void clear_out_max_val();
-  static const int kOutMaxValFieldNumber = 1;
   bool out_max_val() const;
   void set_out_max_val(bool value);
+  private:
+  bool _internal_out_max_val() const;
+  void _internal_set_out_max_val(bool value);
+  public:
 
   // optional int32 axis = 3;
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 3;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // optional uint32 top_k = 2 [default = 1];
   bool has_top_k() const;
+  private:
+  bool _internal_has_top_k() const;
+  public:
   void clear_top_k();
-  static const int kTopKFieldNumber = 2;
-  ::google::protobuf::uint32 top_k() const;
-  void set_top_k(::google::protobuf::uint32 value);
+  uint32_t top_k() const;
+  void set_top_k(uint32_t value);
+  private:
+  uint32_t _internal_top_k() const;
+  void _internal_set_top_k(uint32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ArgMaxParameter)
  private:
-  void set_has_out_max_val();
-  void clear_has_out_max_val();
-  void set_has_top_k();
-  void clear_has_top_k();
-  void set_has_axis();
-  void clear_has_axis();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   bool out_max_val_;
-  ::google::protobuf::int32 axis_;
-  ::google::protobuf::uint32 top_k_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsArgMaxParameterImpl();
+  int32_t axis_;
+  uint32_t top_k_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ConcatParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ConcatParameter) */ {
+class ConcatParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ConcatParameter) */ {
  public:
-  ConcatParameter();
-  virtual ~ConcatParameter();
+  inline ConcatParameter() : ConcatParameter(nullptr) {}
+  ~ConcatParameter() override;
+  explicit constexpr ConcatParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ConcatParameter(const ConcatParameter& from);
-
-  inline ConcatParameter& operator=(const ConcatParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ConcatParameter(ConcatParameter&& from) noexcept
     : ConcatParameter() {
     *this = ::std::move(from);
   }
 
+  inline ConcatParameter& operator=(const ConcatParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ConcatParameter& operator=(ConcatParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ConcatParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ConcatParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ConcatParameter* internal_default_instance() {
     return reinterpret_cast<const ConcatParameter*>(
                &_ConcatParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     20;
 
-  void Swap(ConcatParameter* other);
   friend void swap(ConcatParameter& a, ConcatParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ConcatParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ConcatParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ConcatParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ConcatParameter* 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;
+  ConcatParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ConcatParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ConcatParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ConcatParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ConcatParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ConcatParameter";
   }
+  protected:
+  explicit ConcatParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kConcatDimFieldNumber = 1,
+    kAxisFieldNumber = 2,
+  };
   // optional uint32 concat_dim = 1 [default = 1];
   bool has_concat_dim() const;
+  private:
+  bool _internal_has_concat_dim() const;
+  public:
   void clear_concat_dim();
-  static const int kConcatDimFieldNumber = 1;
-  ::google::protobuf::uint32 concat_dim() const;
-  void set_concat_dim(::google::protobuf::uint32 value);
+  uint32_t concat_dim() const;
+  void set_concat_dim(uint32_t value);
+  private:
+  uint32_t _internal_concat_dim() const;
+  void _internal_set_concat_dim(uint32_t value);
+  public:
 
   // optional int32 axis = 2 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 2;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ConcatParameter)
  private:
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_concat_dim();
-  void clear_has_concat_dim();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::uint32 concat_dim_;
-  ::google::protobuf::int32 axis_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsConcatParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  uint32_t concat_dim_;
+  int32_t axis_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class BatchNormParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BatchNormParameter) */ {
+class BatchNormParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BatchNormParameter) */ {
  public:
-  BatchNormParameter();
-  virtual ~BatchNormParameter();
+  inline BatchNormParameter() : BatchNormParameter(nullptr) {}
+  ~BatchNormParameter() override;
+  explicit constexpr BatchNormParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   BatchNormParameter(const BatchNormParameter& from);
-
-  inline BatchNormParameter& operator=(const BatchNormParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   BatchNormParameter(BatchNormParameter&& from) noexcept
     : BatchNormParameter() {
     *this = ::std::move(from);
   }
 
+  inline BatchNormParameter& operator=(const BatchNormParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline BatchNormParameter& operator=(BatchNormParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const BatchNormParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const BatchNormParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const BatchNormParameter* internal_default_instance() {
     return reinterpret_cast<const BatchNormParameter*>(
                &_BatchNormParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     21;
 
-  void Swap(BatchNormParameter* other);
   friend void swap(BatchNormParameter& a, BatchNormParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(BatchNormParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(BatchNormParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline BatchNormParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  BatchNormParameter* 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;
+  BatchNormParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<BatchNormParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const BatchNormParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const BatchNormParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(BatchNormParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.BatchNormParameter";
   }
+  protected:
+  explicit BatchNormParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kUseGlobalStatsFieldNumber = 1,
+    kScaleBiasFieldNumber = 7,
+    kMovingAverageFractionFieldNumber = 2,
+    kEpsFieldNumber = 3,
+  };
   // optional bool use_global_stats = 1;
   bool has_use_global_stats() const;
+  private:
+  bool _internal_has_use_global_stats() const;
+  public:
   void clear_use_global_stats();
-  static const int kUseGlobalStatsFieldNumber = 1;
   bool use_global_stats() const;
   void set_use_global_stats(bool value);
+  private:
+  bool _internal_use_global_stats() const;
+  void _internal_set_use_global_stats(bool value);
+  public:
 
   // optional bool scale_bias = 7 [default = false];
   bool has_scale_bias() const;
+  private:
+  bool _internal_has_scale_bias() const;
+  public:
   void clear_scale_bias();
-  static const int kScaleBiasFieldNumber = 7;
   bool scale_bias() const;
   void set_scale_bias(bool value);
+  private:
+  bool _internal_scale_bias() const;
+  void _internal_set_scale_bias(bool value);
+  public:
 
   // optional float moving_average_fraction = 2 [default = 0.999];
   bool has_moving_average_fraction() const;
+  private:
+  bool _internal_has_moving_average_fraction() const;
+  public:
   void clear_moving_average_fraction();
-  static const int kMovingAverageFractionFieldNumber = 2;
   float moving_average_fraction() const;
   void set_moving_average_fraction(float value);
+  private:
+  float _internal_moving_average_fraction() const;
+  void _internal_set_moving_average_fraction(float value);
+  public:
 
   // optional float eps = 3 [default = 1e-05];
   bool has_eps() const;
+  private:
+  bool _internal_has_eps() const;
+  public:
   void clear_eps();
-  static const int kEpsFieldNumber = 3;
   float eps() const;
   void set_eps(float value);
+  private:
+  float _internal_eps() const;
+  void _internal_set_eps(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.BatchNormParameter)
  private:
-  void set_has_use_global_stats();
-  void clear_has_use_global_stats();
-  void set_has_moving_average_fraction();
-  void clear_has_moving_average_fraction();
-  void set_has_eps();
-  void clear_has_eps();
-  void set_has_scale_bias();
-  void clear_has_scale_bias();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   bool use_global_stats_;
   bool scale_bias_;
   float moving_average_fraction_;
   float eps_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBatchNormParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class BiasParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BiasParameter) */ {
+class BiasParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.BiasParameter) */ {
  public:
-  BiasParameter();
-  virtual ~BiasParameter();
+  inline BiasParameter() : BiasParameter(nullptr) {}
+  ~BiasParameter() override;
+  explicit constexpr BiasParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   BiasParameter(const BiasParameter& from);
-
-  inline BiasParameter& operator=(const BiasParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   BiasParameter(BiasParameter&& from) noexcept
     : BiasParameter() {
     *this = ::std::move(from);
   }
 
+  inline BiasParameter& operator=(const BiasParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline BiasParameter& operator=(BiasParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const BiasParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const BiasParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const BiasParameter* internal_default_instance() {
     return reinterpret_cast<const BiasParameter*>(
                &_BiasParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     22;
 
-  void Swap(BiasParameter* other);
   friend void swap(BiasParameter& a, BiasParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(BiasParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(BiasParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline BiasParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  BiasParameter* 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;
+  BiasParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<BiasParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const BiasParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const BiasParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(BiasParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.BiasParameter";
   }
+  protected:
+  explicit BiasParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFillerFieldNumber = 3,
+    kAxisFieldNumber = 1,
+    kNumAxesFieldNumber = 2,
+  };
   // optional .opencv_caffe.FillerParameter filler = 3;
   bool has_filler() const;
+  private:
+  bool _internal_has_filler() const;
+  public:
   void clear_filler();
-  static const int kFillerFieldNumber = 3;
   const ::opencv_caffe::FillerParameter& filler() const;
-  ::opencv_caffe::FillerParameter* release_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_filler();
   ::opencv_caffe::FillerParameter* mutable_filler();
   void set_allocated_filler(::opencv_caffe::FillerParameter* filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_filler();
+  public:
+  void unsafe_arena_set_allocated_filler(
+      ::opencv_caffe::FillerParameter* filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_filler();
 
   // optional int32 axis = 1 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 1;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // optional int32 num_axes = 2 [default = 1];
   bool has_num_axes() const;
+  private:
+  bool _internal_has_num_axes() const;
+  public:
   void clear_num_axes();
-  static const int kNumAxesFieldNumber = 2;
-  ::google::protobuf::int32 num_axes() const;
-  void set_num_axes(::google::protobuf::int32 value);
+  int32_t num_axes() const;
+  void set_num_axes(int32_t value);
+  private:
+  int32_t _internal_num_axes() const;
+  void _internal_set_num_axes(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.BiasParameter)
  private:
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_num_axes();
-  void clear_has_num_axes();
-  void set_has_filler();
-  void clear_has_filler();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::FillerParameter* filler_;
-  ::google::protobuf::int32 axis_;
-  ::google::protobuf::int32 num_axes_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsBiasParameterImpl();
+  int32_t axis_;
+  int32_t num_axes_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ContrastiveLossParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ContrastiveLossParameter) */ {
+class ContrastiveLossParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ContrastiveLossParameter) */ {
  public:
-  ContrastiveLossParameter();
-  virtual ~ContrastiveLossParameter();
+  inline ContrastiveLossParameter() : ContrastiveLossParameter(nullptr) {}
+  ~ContrastiveLossParameter() override;
+  explicit constexpr ContrastiveLossParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ContrastiveLossParameter(const ContrastiveLossParameter& from);
-
-  inline ContrastiveLossParameter& operator=(const ContrastiveLossParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ContrastiveLossParameter(ContrastiveLossParameter&& from) noexcept
     : ContrastiveLossParameter() {
     *this = ::std::move(from);
   }
 
+  inline ContrastiveLossParameter& operator=(const ContrastiveLossParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ContrastiveLossParameter& operator=(ContrastiveLossParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ContrastiveLossParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ContrastiveLossParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ContrastiveLossParameter* internal_default_instance() {
     return reinterpret_cast<const ContrastiveLossParameter*>(
                &_ContrastiveLossParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     23;
 
-  void Swap(ContrastiveLossParameter* other);
   friend void swap(ContrastiveLossParameter& a, ContrastiveLossParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ContrastiveLossParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ContrastiveLossParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ContrastiveLossParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ContrastiveLossParameter* 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;
+  ContrastiveLossParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ContrastiveLossParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ContrastiveLossParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ContrastiveLossParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ContrastiveLossParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ContrastiveLossParameter";
   }
+  protected:
+  explicit ContrastiveLossParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kLegacyVersionFieldNumber = 2,
+    kMarginFieldNumber = 1,
+  };
   // optional bool legacy_version = 2 [default = false];
   bool has_legacy_version() const;
+  private:
+  bool _internal_has_legacy_version() const;
+  public:
   void clear_legacy_version();
-  static const int kLegacyVersionFieldNumber = 2;
   bool legacy_version() const;
   void set_legacy_version(bool value);
+  private:
+  bool _internal_legacy_version() const;
+  void _internal_set_legacy_version(bool value);
+  public:
 
   // optional float margin = 1 [default = 1];
   bool has_margin() const;
+  private:
+  bool _internal_has_margin() const;
+  public:
   void clear_margin();
-  static const int kMarginFieldNumber = 1;
   float margin() const;
   void set_margin(float value);
+  private:
+  float _internal_margin() const;
+  void _internal_set_margin(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ContrastiveLossParameter)
  private:
-  void set_has_margin();
-  void clear_has_margin();
-  void set_has_legacy_version();
-  void clear_has_legacy_version();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   bool legacy_version_;
   float margin_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsContrastiveLossParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ConvolutionParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ConvolutionParameter) */ {
+class ConvolutionParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ConvolutionParameter) */ {
  public:
-  ConvolutionParameter();
-  virtual ~ConvolutionParameter();
+  inline ConvolutionParameter() : ConvolutionParameter(nullptr) {}
+  ~ConvolutionParameter() override;
+  explicit constexpr ConvolutionParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ConvolutionParameter(const ConvolutionParameter& from);
-
-  inline ConvolutionParameter& operator=(const ConvolutionParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ConvolutionParameter(ConvolutionParameter&& from) noexcept
     : ConvolutionParameter() {
     *this = ::std::move(from);
   }
 
+  inline ConvolutionParameter& operator=(const ConvolutionParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ConvolutionParameter& operator=(ConvolutionParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ConvolutionParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ConvolutionParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ConvolutionParameter* internal_default_instance() {
     return reinterpret_cast<const ConvolutionParameter*>(
                &_ConvolutionParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     24;
 
-  void Swap(ConvolutionParameter* other);
   friend void swap(ConvolutionParameter& a, ConvolutionParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ConvolutionParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ConvolutionParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ConvolutionParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ConvolutionParameter* 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;
+  ConvolutionParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ConvolutionParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ConvolutionParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ConvolutionParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ConvolutionParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ConvolutionParameter";
   }
+  protected:
+  explicit ConvolutionParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef ConvolutionParameter_Engine Engine;
-  static const Engine DEFAULT =
+  static constexpr Engine DEFAULT =
     ConvolutionParameter_Engine_DEFAULT;
-  static const Engine CAFFE =
+  static constexpr Engine CAFFE =
     ConvolutionParameter_Engine_CAFFE;
-  static const Engine CUDNN =
+  static constexpr Engine CUDNN =
     ConvolutionParameter_Engine_CUDNN;
   static inline bool Engine_IsValid(int value) {
     return ConvolutionParameter_Engine_IsValid(value);
   }
-  static const Engine Engine_MIN =
+  static constexpr Engine Engine_MIN =
     ConvolutionParameter_Engine_Engine_MIN;
-  static const Engine Engine_MAX =
+  static constexpr Engine Engine_MAX =
     ConvolutionParameter_Engine_Engine_MAX;
-  static const int Engine_ARRAYSIZE =
+  static constexpr int Engine_ARRAYSIZE =
     ConvolutionParameter_Engine_Engine_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Engine_descriptor() {
     return ConvolutionParameter_Engine_descriptor();
   }
-  static inline const ::std::string& Engine_Name(Engine value) {
-    return ConvolutionParameter_Engine_Name(value);
+  template<typename T>
+  static inline const std::string& Engine_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Engine>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Engine_Name.");
+    return ConvolutionParameter_Engine_Name(enum_t_value);
   }
-  static inline bool Engine_Parse(const ::std::string& name,
+  static inline bool Engine_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Engine* value) {
     return ConvolutionParameter_Engine_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kPadFieldNumber = 3,
+    kKernelSizeFieldNumber = 4,
+    kStrideFieldNumber = 6,
+    kDilationFieldNumber = 18,
+    kWeightFillerFieldNumber = 7,
+    kBiasFillerFieldNumber = 8,
+    kNumOutputFieldNumber = 1,
+    kPadHFieldNumber = 9,
+    kPadWFieldNumber = 10,
+    kKernelHFieldNumber = 11,
+    kKernelWFieldNumber = 12,
+    kStrideHFieldNumber = 13,
+    kStrideWFieldNumber = 14,
+    kEngineFieldNumber = 15,
+    kForceNdIm2ColFieldNumber = 17,
+    kAxisFieldNumber = 16,
+    kBiasTermFieldNumber = 2,
+    kGroupFieldNumber = 5,
+  };
   // repeated uint32 pad = 3;
   int pad_size() const;
+  private:
+  int _internal_pad_size() const;
+  public:
   void clear_pad();
-  static const int kPadFieldNumber = 3;
-  ::google::protobuf::uint32 pad(int index) const;
-  void set_pad(int index, ::google::protobuf::uint32 value);
-  void add_pad(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_pad(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_pad() const;
+  void _internal_add_pad(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_pad();
+  public:
+  uint32_t pad(int index) const;
+  void set_pad(int index, uint32_t value);
+  void add_pad(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       pad() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_pad();
 
   // repeated uint32 kernel_size = 4;
   int kernel_size_size() const;
+  private:
+  int _internal_kernel_size_size() const;
+  public:
   void clear_kernel_size();
-  static const int kKernelSizeFieldNumber = 4;
-  ::google::protobuf::uint32 kernel_size(int index) const;
-  void set_kernel_size(int index, ::google::protobuf::uint32 value);
-  void add_kernel_size(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_kernel_size(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_kernel_size() const;
+  void _internal_add_kernel_size(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_kernel_size();
+  public:
+  uint32_t kernel_size(int index) const;
+  void set_kernel_size(int index, uint32_t value);
+  void add_kernel_size(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       kernel_size() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_kernel_size();
 
   // repeated uint32 stride = 6;
   int stride_size() const;
+  private:
+  int _internal_stride_size() const;
+  public:
   void clear_stride();
-  static const int kStrideFieldNumber = 6;
-  ::google::protobuf::uint32 stride(int index) const;
-  void set_stride(int index, ::google::protobuf::uint32 value);
-  void add_stride(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_stride(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_stride() const;
+  void _internal_add_stride(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_stride();
+  public:
+  uint32_t stride(int index) const;
+  void set_stride(int index, uint32_t value);
+  void add_stride(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       stride() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_stride();
 
   // repeated uint32 dilation = 18;
   int dilation_size() const;
+  private:
+  int _internal_dilation_size() const;
+  public:
   void clear_dilation();
-  static const int kDilationFieldNumber = 18;
-  ::google::protobuf::uint32 dilation(int index) const;
-  void set_dilation(int index, ::google::protobuf::uint32 value);
-  void add_dilation(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_dilation(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_dilation() const;
+  void _internal_add_dilation(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_dilation();
+  public:
+  uint32_t dilation(int index) const;
+  void set_dilation(int index, uint32_t value);
+  void add_dilation(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       dilation() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_dilation();
 
   // optional .opencv_caffe.FillerParameter weight_filler = 7;
   bool has_weight_filler() const;
+  private:
+  bool _internal_has_weight_filler() const;
+  public:
   void clear_weight_filler();
-  static const int kWeightFillerFieldNumber = 7;
   const ::opencv_caffe::FillerParameter& weight_filler() const;
-  ::opencv_caffe::FillerParameter* release_weight_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_weight_filler();
   ::opencv_caffe::FillerParameter* mutable_weight_filler();
   void set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_weight_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_weight_filler();
+  public:
+  void unsafe_arena_set_allocated_weight_filler(
+      ::opencv_caffe::FillerParameter* weight_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_weight_filler();
 
   // optional .opencv_caffe.FillerParameter bias_filler = 8;
   bool has_bias_filler() const;
+  private:
+  bool _internal_has_bias_filler() const;
+  public:
   void clear_bias_filler();
-  static const int kBiasFillerFieldNumber = 8;
   const ::opencv_caffe::FillerParameter& bias_filler() const;
-  ::opencv_caffe::FillerParameter* release_bias_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_bias_filler();
   ::opencv_caffe::FillerParameter* mutable_bias_filler();
   void set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_bias_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_bias_filler();
+  public:
+  void unsafe_arena_set_allocated_bias_filler(
+      ::opencv_caffe::FillerParameter* bias_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_bias_filler();
 
   // optional uint32 num_output = 1;
   bool has_num_output() const;
+  private:
+  bool _internal_has_num_output() const;
+  public:
   void clear_num_output();
-  static const int kNumOutputFieldNumber = 1;
-  ::google::protobuf::uint32 num_output() const;
-  void set_num_output(::google::protobuf::uint32 value);
+  uint32_t num_output() const;
+  void set_num_output(uint32_t value);
+  private:
+  uint32_t _internal_num_output() const;
+  void _internal_set_num_output(uint32_t value);
+  public:
 
   // optional uint32 pad_h = 9 [default = 0];
   bool has_pad_h() const;
+  private:
+  bool _internal_has_pad_h() const;
+  public:
   void clear_pad_h();
-  static const int kPadHFieldNumber = 9;
-  ::google::protobuf::uint32 pad_h() const;
-  void set_pad_h(::google::protobuf::uint32 value);
+  uint32_t pad_h() const;
+  void set_pad_h(uint32_t value);
+  private:
+  uint32_t _internal_pad_h() const;
+  void _internal_set_pad_h(uint32_t value);
+  public:
 
   // optional uint32 pad_w = 10 [default = 0];
   bool has_pad_w() const;
+  private:
+  bool _internal_has_pad_w() const;
+  public:
   void clear_pad_w();
-  static const int kPadWFieldNumber = 10;
-  ::google::protobuf::uint32 pad_w() const;
-  void set_pad_w(::google::protobuf::uint32 value);
+  uint32_t pad_w() const;
+  void set_pad_w(uint32_t value);
+  private:
+  uint32_t _internal_pad_w() const;
+  void _internal_set_pad_w(uint32_t value);
+  public:
 
   // optional uint32 kernel_h = 11;
   bool has_kernel_h() const;
+  private:
+  bool _internal_has_kernel_h() const;
+  public:
   void clear_kernel_h();
-  static const int kKernelHFieldNumber = 11;
-  ::google::protobuf::uint32 kernel_h() const;
-  void set_kernel_h(::google::protobuf::uint32 value);
+  uint32_t kernel_h() const;
+  void set_kernel_h(uint32_t value);
+  private:
+  uint32_t _internal_kernel_h() const;
+  void _internal_set_kernel_h(uint32_t value);
+  public:
 
   // optional uint32 kernel_w = 12;
   bool has_kernel_w() const;
+  private:
+  bool _internal_has_kernel_w() const;
+  public:
   void clear_kernel_w();
-  static const int kKernelWFieldNumber = 12;
-  ::google::protobuf::uint32 kernel_w() const;
-  void set_kernel_w(::google::protobuf::uint32 value);
+  uint32_t kernel_w() const;
+  void set_kernel_w(uint32_t value);
+  private:
+  uint32_t _internal_kernel_w() const;
+  void _internal_set_kernel_w(uint32_t value);
+  public:
 
   // optional uint32 stride_h = 13;
   bool has_stride_h() const;
+  private:
+  bool _internal_has_stride_h() const;
+  public:
   void clear_stride_h();
-  static const int kStrideHFieldNumber = 13;
-  ::google::protobuf::uint32 stride_h() const;
-  void set_stride_h(::google::protobuf::uint32 value);
+  uint32_t stride_h() const;
+  void set_stride_h(uint32_t value);
+  private:
+  uint32_t _internal_stride_h() const;
+  void _internal_set_stride_h(uint32_t value);
+  public:
 
   // optional uint32 stride_w = 14;
   bool has_stride_w() const;
+  private:
+  bool _internal_has_stride_w() const;
+  public:
   void clear_stride_w();
-  static const int kStrideWFieldNumber = 14;
-  ::google::protobuf::uint32 stride_w() const;
-  void set_stride_w(::google::protobuf::uint32 value);
+  uint32_t stride_w() const;
+  void set_stride_w(uint32_t value);
+  private:
+  uint32_t _internal_stride_w() const;
+  void _internal_set_stride_w(uint32_t value);
+  public:
 
   // optional .opencv_caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT];
   bool has_engine() const;
+  private:
+  bool _internal_has_engine() const;
+  public:
   void clear_engine();
-  static const int kEngineFieldNumber = 15;
   ::opencv_caffe::ConvolutionParameter_Engine engine() const;
   void set_engine(::opencv_caffe::ConvolutionParameter_Engine value);
+  private:
+  ::opencv_caffe::ConvolutionParameter_Engine _internal_engine() const;
+  void _internal_set_engine(::opencv_caffe::ConvolutionParameter_Engine value);
+  public:
 
   // optional bool force_nd_im2col = 17 [default = false];
   bool has_force_nd_im2col() const;
+  private:
+  bool _internal_has_force_nd_im2col() const;
+  public:
   void clear_force_nd_im2col();
-  static const int kForceNdIm2ColFieldNumber = 17;
   bool force_nd_im2col() const;
   void set_force_nd_im2col(bool value);
+  private:
+  bool _internal_force_nd_im2col() const;
+  void _internal_set_force_nd_im2col(bool value);
+  public:
 
   // optional int32 axis = 16 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 16;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // optional bool bias_term = 2 [default = true];
   bool has_bias_term() const;
+  private:
+  bool _internal_has_bias_term() const;
+  public:
   void clear_bias_term();
-  static const int kBiasTermFieldNumber = 2;
   bool bias_term() const;
   void set_bias_term(bool value);
+  private:
+  bool _internal_bias_term() const;
+  void _internal_set_bias_term(bool value);
+  public:
 
   // optional uint32 group = 5 [default = 1];
   bool has_group() const;
+  private:
+  bool _internal_has_group() const;
+  public:
   void clear_group();
-  static const int kGroupFieldNumber = 5;
-  ::google::protobuf::uint32 group() const;
-  void set_group(::google::protobuf::uint32 value);
+  uint32_t group() const;
+  void set_group(uint32_t value);
+  private:
+  uint32_t _internal_group() const;
+  void _internal_set_group(uint32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ConvolutionParameter)
  private:
-  void set_has_num_output();
-  void clear_has_num_output();
-  void set_has_bias_term();
-  void clear_has_bias_term();
-  void set_has_pad_h();
-  void clear_has_pad_h();
-  void set_has_pad_w();
-  void clear_has_pad_w();
-  void set_has_kernel_h();
-  void clear_has_kernel_h();
-  void set_has_kernel_w();
-  void clear_has_kernel_w();
-  void set_has_stride_h();
-  void clear_has_stride_h();
-  void set_has_stride_w();
-  void clear_has_stride_w();
-  void set_has_group();
-  void clear_has_group();
-  void set_has_weight_filler();
-  void clear_has_weight_filler();
-  void set_has_bias_filler();
-  void clear_has_bias_filler();
-  void set_has_engine();
-  void clear_has_engine();
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_force_nd_im2col();
-  void clear_has_force_nd_im2col();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > pad_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > kernel_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > stride_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > dilation_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > pad_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > kernel_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > stride_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > dilation_;
   ::opencv_caffe::FillerParameter* weight_filler_;
   ::opencv_caffe::FillerParameter* bias_filler_;
-  ::google::protobuf::uint32 num_output_;
-  ::google::protobuf::uint32 pad_h_;
-  ::google::protobuf::uint32 pad_w_;
-  ::google::protobuf::uint32 kernel_h_;
-  ::google::protobuf::uint32 kernel_w_;
-  ::google::protobuf::uint32 stride_h_;
-  ::google::protobuf::uint32 stride_w_;
+  uint32_t num_output_;
+  uint32_t pad_h_;
+  uint32_t pad_w_;
+  uint32_t kernel_h_;
+  uint32_t kernel_w_;
+  uint32_t stride_h_;
+  uint32_t stride_w_;
   int engine_;
   bool force_nd_im2col_;
-  ::google::protobuf::int32 axis_;
+  int32_t axis_;
   bool bias_term_;
-  ::google::protobuf::uint32 group_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsConvolutionParameterImpl();
+  uint32_t group_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class CropParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.CropParameter) */ {
+class CropParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.CropParameter) */ {
  public:
-  CropParameter();
-  virtual ~CropParameter();
+  inline CropParameter() : CropParameter(nullptr) {}
+  ~CropParameter() override;
+  explicit constexpr CropParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   CropParameter(const CropParameter& from);
-
-  inline CropParameter& operator=(const CropParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   CropParameter(CropParameter&& from) noexcept
     : CropParameter() {
     *this = ::std::move(from);
   }
 
+  inline CropParameter& operator=(const CropParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline CropParameter& operator=(CropParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const CropParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const CropParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const CropParameter* internal_default_instance() {
     return reinterpret_cast<const CropParameter*>(
                &_CropParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     25;
 
-  void Swap(CropParameter* other);
   friend void swap(CropParameter& a, CropParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(CropParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(CropParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
-  // implements Message ----------------------------------------------
-
-  inline CropParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  CropParameter* 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;
+  // implements Message ----------------------------------------------
+
+  CropParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<CropParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const CropParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const CropParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(CropParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.CropParameter";
   }
+  protected:
+  explicit CropParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kOffsetFieldNumber = 2,
+    kAxisFieldNumber = 1,
+  };
   // repeated uint32 offset = 2;
   int offset_size() const;
+  private:
+  int _internal_offset_size() const;
+  public:
   void clear_offset();
-  static const int kOffsetFieldNumber = 2;
-  ::google::protobuf::uint32 offset(int index) const;
-  void set_offset(int index, ::google::protobuf::uint32 value);
-  void add_offset(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_offset(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_offset() const;
+  void _internal_add_offset(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_offset();
+  public:
+  uint32_t offset(int index) const;
+  void set_offset(int index, uint32_t value);
+  void add_offset(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       offset() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_offset();
 
   // optional int32 axis = 1 [default = 2];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 1;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.CropParameter)
  private:
-  void set_has_axis();
-  void clear_has_axis();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > offset_;
-  ::google::protobuf::int32 axis_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsCropParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > offset_;
+  int32_t axis_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class DataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.DataParameter) */ {
+class DataParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.DataParameter) */ {
  public:
-  DataParameter();
-  virtual ~DataParameter();
+  inline DataParameter() : DataParameter(nullptr) {}
+  ~DataParameter() override;
+  explicit constexpr DataParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   DataParameter(const DataParameter& from);
-
-  inline DataParameter& operator=(const DataParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   DataParameter(DataParameter&& from) noexcept
     : DataParameter() {
     *this = ::std::move(from);
   }
 
+  inline DataParameter& operator=(const DataParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline DataParameter& operator=(DataParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const DataParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const DataParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const DataParameter* internal_default_instance() {
     return reinterpret_cast<const DataParameter*>(
                &_DataParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     26;
 
-  void Swap(DataParameter* other);
   friend void swap(DataParameter& a, DataParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(DataParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(DataParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline DataParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  DataParameter* 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;
+  DataParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<DataParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const DataParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const DataParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(DataParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.DataParameter";
   }
+  protected:
+  explicit DataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef DataParameter_DB DB;
-  static const DB LEVELDB =
+  static constexpr DB LEVELDB =
     DataParameter_DB_LEVELDB;
-  static const DB LMDB =
+  static constexpr DB LMDB =
     DataParameter_DB_LMDB;
   static inline bool DB_IsValid(int value) {
     return DataParameter_DB_IsValid(value);
   }
-  static const DB DB_MIN =
+  static constexpr DB DB_MIN =
     DataParameter_DB_DB_MIN;
-  static const DB DB_MAX =
+  static constexpr DB DB_MAX =
     DataParameter_DB_DB_MAX;
-  static const int DB_ARRAYSIZE =
+  static constexpr int DB_ARRAYSIZE =
     DataParameter_DB_DB_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   DB_descriptor() {
     return DataParameter_DB_descriptor();
   }
-  static inline const ::std::string& DB_Name(DB value) {
-    return DataParameter_DB_Name(value);
+  template<typename T>
+  static inline const std::string& DB_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, DB>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function DB_Name.");
+    return DataParameter_DB_Name(enum_t_value);
   }
-  static inline bool DB_Parse(const ::std::string& name,
+  static inline bool DB_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       DB* value) {
     return DataParameter_DB_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSourceFieldNumber = 1,
+    kMeanFileFieldNumber = 3,
+    kBatchSizeFieldNumber = 4,
+    kCropSizeFieldNumber = 5,
+    kRandSkipFieldNumber = 7,
+    kMirrorFieldNumber = 6,
+    kForceEncodedColorFieldNumber = 9,
+    kBackendFieldNumber = 8,
+    kScaleFieldNumber = 2,
+    kPrefetchFieldNumber = 10,
+  };
   // optional string source = 1;
   bool has_source() const;
+  private:
+  bool _internal_has_source() const;
+  public:
   void clear_source();
-  static const int kSourceFieldNumber = 1;
-  const ::std::string& source() const;
-  void set_source(const ::std::string& value);
-  #if LANG_CXX11
-  void set_source(::std::string&& value);
-  #endif
-  void set_source(const char* value);
-  void set_source(const char* value, size_t size);
-  ::std::string* mutable_source();
-  ::std::string* release_source();
-  void set_allocated_source(::std::string* source);
+  const std::string& source() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_source(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_source();
+  PROTOBUF_NODISCARD std::string* release_source();
+  void set_allocated_source(std::string* source);
+  private:
+  const std::string& _internal_source() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_source(const std::string& value);
+  std::string* _internal_mutable_source();
+  public:
 
   // optional string mean_file = 3;
   bool has_mean_file() const;
+  private:
+  bool _internal_has_mean_file() const;
+  public:
   void clear_mean_file();
-  static const int kMeanFileFieldNumber = 3;
-  const ::std::string& mean_file() const;
-  void set_mean_file(const ::std::string& value);
-  #if LANG_CXX11
-  void set_mean_file(::std::string&& value);
-  #endif
-  void set_mean_file(const char* value);
-  void set_mean_file(const char* value, size_t size);
-  ::std::string* mutable_mean_file();
-  ::std::string* release_mean_file();
-  void set_allocated_mean_file(::std::string* mean_file);
+  const std::string& mean_file() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_mean_file(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_mean_file();
+  PROTOBUF_NODISCARD std::string* release_mean_file();
+  void set_allocated_mean_file(std::string* mean_file);
+  private:
+  const std::string& _internal_mean_file() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_mean_file(const std::string& value);
+  std::string* _internal_mutable_mean_file();
+  public:
 
   // optional uint32 batch_size = 4;
   bool has_batch_size() const;
+  private:
+  bool _internal_has_batch_size() const;
+  public:
   void clear_batch_size();
-  static const int kBatchSizeFieldNumber = 4;
-  ::google::protobuf::uint32 batch_size() const;
-  void set_batch_size(::google::protobuf::uint32 value);
+  uint32_t batch_size() const;
+  void set_batch_size(uint32_t value);
+  private:
+  uint32_t _internal_batch_size() const;
+  void _internal_set_batch_size(uint32_t value);
+  public:
 
   // optional uint32 crop_size = 5 [default = 0];
   bool has_crop_size() const;
+  private:
+  bool _internal_has_crop_size() const;
+  public:
   void clear_crop_size();
-  static const int kCropSizeFieldNumber = 5;
-  ::google::protobuf::uint32 crop_size() const;
-  void set_crop_size(::google::protobuf::uint32 value);
+  uint32_t crop_size() const;
+  void set_crop_size(uint32_t value);
+  private:
+  uint32_t _internal_crop_size() const;
+  void _internal_set_crop_size(uint32_t value);
+  public:
 
   // optional uint32 rand_skip = 7 [default = 0];
   bool has_rand_skip() const;
+  private:
+  bool _internal_has_rand_skip() const;
+  public:
   void clear_rand_skip();
-  static const int kRandSkipFieldNumber = 7;
-  ::google::protobuf::uint32 rand_skip() const;
-  void set_rand_skip(::google::protobuf::uint32 value);
+  uint32_t rand_skip() const;
+  void set_rand_skip(uint32_t value);
+  private:
+  uint32_t _internal_rand_skip() const;
+  void _internal_set_rand_skip(uint32_t value);
+  public:
 
   // optional bool mirror = 6 [default = false];
   bool has_mirror() const;
+  private:
+  bool _internal_has_mirror() const;
+  public:
   void clear_mirror();
-  static const int kMirrorFieldNumber = 6;
   bool mirror() const;
   void set_mirror(bool value);
+  private:
+  bool _internal_mirror() const;
+  void _internal_set_mirror(bool value);
+  public:
 
   // optional bool force_encoded_color = 9 [default = false];
   bool has_force_encoded_color() const;
+  private:
+  bool _internal_has_force_encoded_color() const;
+  public:
   void clear_force_encoded_color();
-  static const int kForceEncodedColorFieldNumber = 9;
   bool force_encoded_color() const;
   void set_force_encoded_color(bool value);
+  private:
+  bool _internal_force_encoded_color() const;
+  void _internal_set_force_encoded_color(bool value);
+  public:
 
   // optional .opencv_caffe.DataParameter.DB backend = 8 [default = LEVELDB];
   bool has_backend() const;
+  private:
+  bool _internal_has_backend() const;
+  public:
   void clear_backend();
-  static const int kBackendFieldNumber = 8;
   ::opencv_caffe::DataParameter_DB backend() const;
   void set_backend(::opencv_caffe::DataParameter_DB value);
+  private:
+  ::opencv_caffe::DataParameter_DB _internal_backend() const;
+  void _internal_set_backend(::opencv_caffe::DataParameter_DB value);
+  public:
 
   // optional float scale = 2 [default = 1];
   bool has_scale() const;
+  private:
+  bool _internal_has_scale() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 2;
   float scale() const;
   void set_scale(float value);
+  private:
+  float _internal_scale() const;
+  void _internal_set_scale(float value);
+  public:
 
   // optional uint32 prefetch = 10 [default = 4];
   bool has_prefetch() const;
+  private:
+  bool _internal_has_prefetch() const;
+  public:
   void clear_prefetch();
-  static const int kPrefetchFieldNumber = 10;
-  ::google::protobuf::uint32 prefetch() const;
-  void set_prefetch(::google::protobuf::uint32 value);
+  uint32_t prefetch() const;
+  void set_prefetch(uint32_t value);
+  private:
+  uint32_t _internal_prefetch() const;
+  void _internal_set_prefetch(uint32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.DataParameter)
  private:
-  void set_has_source();
-  void clear_has_source();
-  void set_has_batch_size();
-  void clear_has_batch_size();
-  void set_has_rand_skip();
-  void clear_has_rand_skip();
-  void set_has_backend();
-  void clear_has_backend();
-  void set_has_scale();
-  void clear_has_scale();
-  void set_has_mean_file();
-  void clear_has_mean_file();
-  void set_has_crop_size();
-  void clear_has_crop_size();
-  void set_has_mirror();
-  void clear_has_mirror();
-  void set_has_force_encoded_color();
-  void clear_has_force_encoded_color();
-  void set_has_prefetch();
-  void clear_has_prefetch();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr source_;
-  ::google::protobuf::internal::ArenaStringPtr mean_file_;
-  ::google::protobuf::uint32 batch_size_;
-  ::google::protobuf::uint32 crop_size_;
-  ::google::protobuf::uint32 rand_skip_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr mean_file_;
+  uint32_t batch_size_;
+  uint32_t crop_size_;
+  uint32_t rand_skip_;
   bool mirror_;
   bool force_encoded_color_;
   int backend_;
   float scale_;
-  ::google::protobuf::uint32 prefetch_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDataParameterImpl();
+  uint32_t prefetch_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NonMaximumSuppressionParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NonMaximumSuppressionParameter) */ {
+class NonMaximumSuppressionParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NonMaximumSuppressionParameter) */ {
  public:
-  NonMaximumSuppressionParameter();
-  virtual ~NonMaximumSuppressionParameter();
+  inline NonMaximumSuppressionParameter() : NonMaximumSuppressionParameter(nullptr) {}
+  ~NonMaximumSuppressionParameter() override;
+  explicit constexpr NonMaximumSuppressionParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NonMaximumSuppressionParameter(const NonMaximumSuppressionParameter& from);
-
-  inline NonMaximumSuppressionParameter& operator=(const NonMaximumSuppressionParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NonMaximumSuppressionParameter(NonMaximumSuppressionParameter&& from) noexcept
     : NonMaximumSuppressionParameter() {
     *this = ::std::move(from);
   }
 
+  inline NonMaximumSuppressionParameter& operator=(const NonMaximumSuppressionParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NonMaximumSuppressionParameter& operator=(NonMaximumSuppressionParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NonMaximumSuppressionParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NonMaximumSuppressionParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NonMaximumSuppressionParameter* internal_default_instance() {
     return reinterpret_cast<const NonMaximumSuppressionParameter*>(
                &_NonMaximumSuppressionParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     27;
 
-  void Swap(NonMaximumSuppressionParameter* other);
   friend void swap(NonMaximumSuppressionParameter& a, NonMaximumSuppressionParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(NonMaximumSuppressionParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NonMaximumSuppressionParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NonMaximumSuppressionParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NonMaximumSuppressionParameter* 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;
+  NonMaximumSuppressionParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NonMaximumSuppressionParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NonMaximumSuppressionParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NonMaximumSuppressionParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NonMaximumSuppressionParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.NonMaximumSuppressionParameter";
   }
+  protected:
+  explicit NonMaximumSuppressionParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kTopKFieldNumber = 2,
+    kNmsThresholdFieldNumber = 1,
+    kEtaFieldNumber = 3,
+  };
   // optional int32 top_k = 2;
   bool has_top_k() const;
+  private:
+  bool _internal_has_top_k() const;
+  public:
   void clear_top_k();
-  static const int kTopKFieldNumber = 2;
-  ::google::protobuf::int32 top_k() const;
-  void set_top_k(::google::protobuf::int32 value);
+  int32_t top_k() const;
+  void set_top_k(int32_t value);
+  private:
+  int32_t _internal_top_k() const;
+  void _internal_set_top_k(int32_t value);
+  public:
 
   // optional float nms_threshold = 1 [default = 0.3];
   bool has_nms_threshold() const;
+  private:
+  bool _internal_has_nms_threshold() const;
+  public:
   void clear_nms_threshold();
-  static const int kNmsThresholdFieldNumber = 1;
   float nms_threshold() const;
   void set_nms_threshold(float value);
+  private:
+  float _internal_nms_threshold() const;
+  void _internal_set_nms_threshold(float value);
+  public:
 
   // optional float eta = 3 [default = 1];
   bool has_eta() const;
+  private:
+  bool _internal_has_eta() const;
+  public:
   void clear_eta();
-  static const int kEtaFieldNumber = 3;
   float eta() const;
   void set_eta(float value);
+  private:
+  float _internal_eta() const;
+  void _internal_set_eta(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.NonMaximumSuppressionParameter)
  private:
-  void set_has_nms_threshold();
-  void clear_has_nms_threshold();
-  void set_has_top_k();
-  void clear_has_top_k();
-  void set_has_eta();
-  void clear_has_eta();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::int32 top_k_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int32_t top_k_;
   float nms_threshold_;
   float eta_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNonMaximumSuppressionParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class SaveOutputParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SaveOutputParameter) */ {
+class SaveOutputParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SaveOutputParameter) */ {
  public:
-  SaveOutputParameter();
-  virtual ~SaveOutputParameter();
+  inline SaveOutputParameter() : SaveOutputParameter(nullptr) {}
+  ~SaveOutputParameter() override;
+  explicit constexpr SaveOutputParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SaveOutputParameter(const SaveOutputParameter& from);
-
-  inline SaveOutputParameter& operator=(const SaveOutputParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SaveOutputParameter(SaveOutputParameter&& from) noexcept
     : SaveOutputParameter() {
     *this = ::std::move(from);
   }
 
+  inline SaveOutputParameter& operator=(const SaveOutputParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SaveOutputParameter& operator=(SaveOutputParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const SaveOutputParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SaveOutputParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SaveOutputParameter* internal_default_instance() {
     return reinterpret_cast<const SaveOutputParameter*>(
                &_SaveOutputParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     28;
 
-  void Swap(SaveOutputParameter* other);
   friend void swap(SaveOutputParameter& a, SaveOutputParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(SaveOutputParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SaveOutputParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SaveOutputParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SaveOutputParameter* 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;
+  SaveOutputParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SaveOutputParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SaveOutputParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SaveOutputParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SaveOutputParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.SaveOutputParameter";
   }
+  protected:
+  explicit SaveOutputParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kOutputDirectoryFieldNumber = 1,
+    kOutputNamePrefixFieldNumber = 2,
+    kOutputFormatFieldNumber = 3,
+    kLabelMapFileFieldNumber = 4,
+    kNameSizeFileFieldNumber = 5,
+    kNumTestImageFieldNumber = 6,
+  };
   // optional string output_directory = 1;
   bool has_output_directory() const;
+  private:
+  bool _internal_has_output_directory() const;
+  public:
   void clear_output_directory();
-  static const int kOutputDirectoryFieldNumber = 1;
-  const ::std::string& output_directory() const;
-  void set_output_directory(const ::std::string& value);
-  #if LANG_CXX11
-  void set_output_directory(::std::string&& value);
-  #endif
-  void set_output_directory(const char* value);
-  void set_output_directory(const char* value, size_t size);
-  ::std::string* mutable_output_directory();
-  ::std::string* release_output_directory();
-  void set_allocated_output_directory(::std::string* output_directory);
+  const std::string& output_directory() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_output_directory(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_output_directory();
+  PROTOBUF_NODISCARD std::string* release_output_directory();
+  void set_allocated_output_directory(std::string* output_directory);
+  private:
+  const std::string& _internal_output_directory() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_output_directory(const std::string& value);
+  std::string* _internal_mutable_output_directory();
+  public:
 
   // optional string output_name_prefix = 2;
   bool has_output_name_prefix() const;
+  private:
+  bool _internal_has_output_name_prefix() const;
+  public:
   void clear_output_name_prefix();
-  static const int kOutputNamePrefixFieldNumber = 2;
-  const ::std::string& output_name_prefix() const;
-  void set_output_name_prefix(const ::std::string& value);
-  #if LANG_CXX11
-  void set_output_name_prefix(::std::string&& value);
-  #endif
-  void set_output_name_prefix(const char* value);
-  void set_output_name_prefix(const char* value, size_t size);
-  ::std::string* mutable_output_name_prefix();
-  ::std::string* release_output_name_prefix();
-  void set_allocated_output_name_prefix(::std::string* output_name_prefix);
+  const std::string& output_name_prefix() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_output_name_prefix(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_output_name_prefix();
+  PROTOBUF_NODISCARD std::string* release_output_name_prefix();
+  void set_allocated_output_name_prefix(std::string* output_name_prefix);
+  private:
+  const std::string& _internal_output_name_prefix() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_output_name_prefix(const std::string& value);
+  std::string* _internal_mutable_output_name_prefix();
+  public:
 
   // optional string output_format = 3;
   bool has_output_format() const;
+  private:
+  bool _internal_has_output_format() const;
+  public:
   void clear_output_format();
-  static const int kOutputFormatFieldNumber = 3;
-  const ::std::string& output_format() const;
-  void set_output_format(const ::std::string& value);
-  #if LANG_CXX11
-  void set_output_format(::std::string&& value);
-  #endif
-  void set_output_format(const char* value);
-  void set_output_format(const char* value, size_t size);
-  ::std::string* mutable_output_format();
-  ::std::string* release_output_format();
-  void set_allocated_output_format(::std::string* output_format);
+  const std::string& output_format() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_output_format(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_output_format();
+  PROTOBUF_NODISCARD std::string* release_output_format();
+  void set_allocated_output_format(std::string* output_format);
+  private:
+  const std::string& _internal_output_format() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_output_format(const std::string& value);
+  std::string* _internal_mutable_output_format();
+  public:
 
   // optional string label_map_file = 4;
   bool has_label_map_file() const;
+  private:
+  bool _internal_has_label_map_file() const;
+  public:
   void clear_label_map_file();
-  static const int kLabelMapFileFieldNumber = 4;
-  const ::std::string& label_map_file() const;
-  void set_label_map_file(const ::std::string& value);
-  #if LANG_CXX11
-  void set_label_map_file(::std::string&& value);
-  #endif
-  void set_label_map_file(const char* value);
-  void set_label_map_file(const char* value, size_t size);
-  ::std::string* mutable_label_map_file();
-  ::std::string* release_label_map_file();
-  void set_allocated_label_map_file(::std::string* label_map_file);
+  const std::string& label_map_file() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_label_map_file(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_label_map_file();
+  PROTOBUF_NODISCARD std::string* release_label_map_file();
+  void set_allocated_label_map_file(std::string* label_map_file);
+  private:
+  const std::string& _internal_label_map_file() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_label_map_file(const std::string& value);
+  std::string* _internal_mutable_label_map_file();
+  public:
 
   // optional string name_size_file = 5;
   bool has_name_size_file() const;
+  private:
+  bool _internal_has_name_size_file() const;
+  public:
   void clear_name_size_file();
-  static const int kNameSizeFileFieldNumber = 5;
-  const ::std::string& name_size_file() const;
-  void set_name_size_file(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name_size_file(::std::string&& value);
-  #endif
-  void set_name_size_file(const char* value);
-  void set_name_size_file(const char* value, size_t size);
-  ::std::string* mutable_name_size_file();
-  ::std::string* release_name_size_file();
-  void set_allocated_name_size_file(::std::string* name_size_file);
+  const std::string& name_size_file() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name_size_file(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name_size_file();
+  PROTOBUF_NODISCARD std::string* release_name_size_file();
+  void set_allocated_name_size_file(std::string* name_size_file);
+  private:
+  const std::string& _internal_name_size_file() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name_size_file(const std::string& value);
+  std::string* _internal_mutable_name_size_file();
+  public:
 
   // optional uint32 num_test_image = 6;
   bool has_num_test_image() const;
+  private:
+  bool _internal_has_num_test_image() const;
+  public:
   void clear_num_test_image();
-  static const int kNumTestImageFieldNumber = 6;
-  ::google::protobuf::uint32 num_test_image() const;
-  void set_num_test_image(::google::protobuf::uint32 value);
+  uint32_t num_test_image() const;
+  void set_num_test_image(uint32_t value);
+  private:
+  uint32_t _internal_num_test_image() const;
+  void _internal_set_num_test_image(uint32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.SaveOutputParameter)
  private:
-  void set_has_output_directory();
-  void clear_has_output_directory();
-  void set_has_output_name_prefix();
-  void clear_has_output_name_prefix();
-  void set_has_output_format();
-  void clear_has_output_format();
-  void set_has_label_map_file();
-  void clear_has_label_map_file();
-  void set_has_name_size_file();
-  void clear_has_name_size_file();
-  void set_has_num_test_image();
-  void clear_has_num_test_image();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr output_directory_;
-  ::google::protobuf::internal::ArenaStringPtr output_name_prefix_;
-  ::google::protobuf::internal::ArenaStringPtr output_format_;
-  ::google::protobuf::internal::ArenaStringPtr label_map_file_;
-  ::google::protobuf::internal::ArenaStringPtr name_size_file_;
-  ::google::protobuf::uint32 num_test_image_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSaveOutputParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr output_directory_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr output_name_prefix_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr output_format_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr label_map_file_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_size_file_;
+  uint32_t num_test_image_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class DropoutParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.DropoutParameter) */ {
+class DropoutParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.DropoutParameter) */ {
  public:
-  DropoutParameter();
-  virtual ~DropoutParameter();
+  inline DropoutParameter() : DropoutParameter(nullptr) {}
+  ~DropoutParameter() override;
+  explicit constexpr DropoutParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   DropoutParameter(const DropoutParameter& from);
-
-  inline DropoutParameter& operator=(const DropoutParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   DropoutParameter(DropoutParameter&& from) noexcept
     : DropoutParameter() {
     *this = ::std::move(from);
   }
 
+  inline DropoutParameter& operator=(const DropoutParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline DropoutParameter& operator=(DropoutParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const DropoutParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const DropoutParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const DropoutParameter* internal_default_instance() {
     return reinterpret_cast<const DropoutParameter*>(
                &_DropoutParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     29;
 
-  void Swap(DropoutParameter* other);
   friend void swap(DropoutParameter& a, DropoutParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(DropoutParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(DropoutParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline DropoutParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  DropoutParameter* 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;
+  DropoutParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<DropoutParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const DropoutParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const DropoutParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(DropoutParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.DropoutParameter";
   }
+  protected:
+  explicit DropoutParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDropoutRatioFieldNumber = 1,
+    kScaleTrainFieldNumber = 2,
+  };
   // optional float dropout_ratio = 1 [default = 0.5];
   bool has_dropout_ratio() const;
+  private:
+  bool _internal_has_dropout_ratio() const;
+  public:
   void clear_dropout_ratio();
-  static const int kDropoutRatioFieldNumber = 1;
   float dropout_ratio() const;
   void set_dropout_ratio(float value);
+  private:
+  float _internal_dropout_ratio() const;
+  void _internal_set_dropout_ratio(float value);
+  public:
 
   // optional bool scale_train = 2 [default = true];
   bool has_scale_train() const;
+  private:
+  bool _internal_has_scale_train() const;
+  public:
   void clear_scale_train();
-  static const int kScaleTrainFieldNumber = 2;
   bool scale_train() const;
   void set_scale_train(bool value);
+  private:
+  bool _internal_scale_train() const;
+  void _internal_set_scale_train(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.DropoutParameter)
  private:
-  void set_has_dropout_ratio();
-  void clear_has_dropout_ratio();
-  void set_has_scale_train();
-  void clear_has_scale_train();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float dropout_ratio_;
   bool scale_train_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDropoutParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class DummyDataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.DummyDataParameter) */ {
+class DummyDataParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.DummyDataParameter) */ {
  public:
-  DummyDataParameter();
-  virtual ~DummyDataParameter();
+  inline DummyDataParameter() : DummyDataParameter(nullptr) {}
+  ~DummyDataParameter() override;
+  explicit constexpr DummyDataParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   DummyDataParameter(const DummyDataParameter& from);
-
-  inline DummyDataParameter& operator=(const DummyDataParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   DummyDataParameter(DummyDataParameter&& from) noexcept
     : DummyDataParameter() {
     *this = ::std::move(from);
   }
 
+  inline DummyDataParameter& operator=(const DummyDataParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline DummyDataParameter& operator=(DummyDataParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const DummyDataParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const DummyDataParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const DummyDataParameter* internal_default_instance() {
     return reinterpret_cast<const DummyDataParameter*>(
                &_DummyDataParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     30;
 
-  void Swap(DummyDataParameter* other);
   friend void swap(DummyDataParameter& a, DummyDataParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(DummyDataParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(DummyDataParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline DummyDataParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  DummyDataParameter* 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;
+  DummyDataParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<DummyDataParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const DummyDataParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const DummyDataParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(DummyDataParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.DummyDataParameter";
   }
+  protected:
+  explicit DummyDataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDataFillerFieldNumber = 1,
+    kNumFieldNumber = 2,
+    kChannelsFieldNumber = 3,
+    kHeightFieldNumber = 4,
+    kWidthFieldNumber = 5,
+    kShapeFieldNumber = 6,
+  };
   // repeated .opencv_caffe.FillerParameter data_filler = 1;
   int data_filler_size() const;
+  private:
+  int _internal_data_filler_size() const;
+  public:
   void clear_data_filler();
-  static const int kDataFillerFieldNumber = 1;
-  const ::opencv_caffe::FillerParameter& data_filler(int index) const;
   ::opencv_caffe::FillerParameter* mutable_data_filler(int index);
-  ::opencv_caffe::FillerParameter* add_data_filler();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::FillerParameter >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::FillerParameter >*
       mutable_data_filler();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::FillerParameter >&
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_data_filler(int index) const;
+  ::opencv_caffe::FillerParameter* _internal_add_data_filler();
+  public:
+  const ::opencv_caffe::FillerParameter& data_filler(int index) const;
+  ::opencv_caffe::FillerParameter* add_data_filler();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::FillerParameter >&
       data_filler() const;
 
   // repeated uint32 num = 2;
   int num_size() const;
+  private:
+  int _internal_num_size() const;
+  public:
   void clear_num();
-  static const int kNumFieldNumber = 2;
-  ::google::protobuf::uint32 num(int index) const;
-  void set_num(int index, ::google::protobuf::uint32 value);
-  void add_num(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_num(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_num() const;
+  void _internal_add_num(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_num();
+  public:
+  uint32_t num(int index) const;
+  void set_num(int index, uint32_t value);
+  void add_num(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       num() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_num();
 
   // repeated uint32 channels = 3;
   int channels_size() const;
+  private:
+  int _internal_channels_size() const;
+  public:
   void clear_channels();
-  static const int kChannelsFieldNumber = 3;
-  ::google::protobuf::uint32 channels(int index) const;
-  void set_channels(int index, ::google::protobuf::uint32 value);
-  void add_channels(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_channels(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_channels() const;
+  void _internal_add_channels(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_channels();
+  public:
+  uint32_t channels(int index) const;
+  void set_channels(int index, uint32_t value);
+  void add_channels(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       channels() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_channels();
 
   // repeated uint32 height = 4;
   int height_size() const;
+  private:
+  int _internal_height_size() const;
+  public:
   void clear_height();
-  static const int kHeightFieldNumber = 4;
-  ::google::protobuf::uint32 height(int index) const;
-  void set_height(int index, ::google::protobuf::uint32 value);
-  void add_height(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_height(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_height() const;
+  void _internal_add_height(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_height();
+  public:
+  uint32_t height(int index) const;
+  void set_height(int index, uint32_t value);
+  void add_height(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       height() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_height();
 
   // repeated uint32 width = 5;
   int width_size() const;
+  private:
+  int _internal_width_size() const;
+  public:
   void clear_width();
-  static const int kWidthFieldNumber = 5;
-  ::google::protobuf::uint32 width(int index) const;
-  void set_width(int index, ::google::protobuf::uint32 value);
-  void add_width(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_width(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_width() const;
+  void _internal_add_width(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_width();
+  public:
+  uint32_t width(int index) const;
+  void set_width(int index, uint32_t value);
+  void add_width(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       width() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_width();
 
   // repeated .opencv_caffe.BlobShape shape = 6;
   int shape_size() const;
+  private:
+  int _internal_shape_size() const;
+  public:
   void clear_shape();
-  static const int kShapeFieldNumber = 6;
-  const ::opencv_caffe::BlobShape& shape(int index) const;
   ::opencv_caffe::BlobShape* mutable_shape(int index);
-  ::opencv_caffe::BlobShape* add_shape();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >*
       mutable_shape();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >&
+  private:
+  const ::opencv_caffe::BlobShape& _internal_shape(int index) const;
+  ::opencv_caffe::BlobShape* _internal_add_shape();
+  public:
+  const ::opencv_caffe::BlobShape& shape(int index) const;
+  ::opencv_caffe::BlobShape* add_shape();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >&
       shape() const;
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.DummyDataParameter)
  private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::FillerParameter > data_filler_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > num_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > channels_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > height_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > width_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape > shape_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsDummyDataParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::FillerParameter > data_filler_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > num_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > channels_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > height_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > width_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape > shape_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class EltwiseParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.EltwiseParameter) */ {
+class EltwiseParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.EltwiseParameter) */ {
  public:
-  EltwiseParameter();
-  virtual ~EltwiseParameter();
+  inline EltwiseParameter() : EltwiseParameter(nullptr) {}
+  ~EltwiseParameter() override;
+  explicit constexpr EltwiseParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   EltwiseParameter(const EltwiseParameter& from);
-
-  inline EltwiseParameter& operator=(const EltwiseParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   EltwiseParameter(EltwiseParameter&& from) noexcept
     : EltwiseParameter() {
     *this = ::std::move(from);
   }
 
+  inline EltwiseParameter& operator=(const EltwiseParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline EltwiseParameter& operator=(EltwiseParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const EltwiseParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const EltwiseParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const EltwiseParameter* internal_default_instance() {
     return reinterpret_cast<const EltwiseParameter*>(
                &_EltwiseParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     31;
 
-  void Swap(EltwiseParameter* other);
   friend void swap(EltwiseParameter& a, EltwiseParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(EltwiseParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(EltwiseParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline EltwiseParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  EltwiseParameter* 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;
+  EltwiseParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<EltwiseParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const EltwiseParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const EltwiseParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(EltwiseParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.EltwiseParameter";
   }
+  protected:
+  explicit EltwiseParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef EltwiseParameter_EltwiseOp EltwiseOp;
-  static const EltwiseOp PROD =
+  static constexpr EltwiseOp PROD =
     EltwiseParameter_EltwiseOp_PROD;
-  static const EltwiseOp SUM =
+  static constexpr EltwiseOp SUM =
     EltwiseParameter_EltwiseOp_SUM;
-  static const EltwiseOp MAX =
+  static constexpr EltwiseOp MAX =
     EltwiseParameter_EltwiseOp_MAX;
   static inline bool EltwiseOp_IsValid(int value) {
     return EltwiseParameter_EltwiseOp_IsValid(value);
   }
-  static const EltwiseOp EltwiseOp_MIN =
+  static constexpr EltwiseOp EltwiseOp_MIN =
     EltwiseParameter_EltwiseOp_EltwiseOp_MIN;
-  static const EltwiseOp EltwiseOp_MAX =
+  static constexpr EltwiseOp EltwiseOp_MAX =
     EltwiseParameter_EltwiseOp_EltwiseOp_MAX;
-  static const int EltwiseOp_ARRAYSIZE =
+  static constexpr int EltwiseOp_ARRAYSIZE =
     EltwiseParameter_EltwiseOp_EltwiseOp_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   EltwiseOp_descriptor() {
     return EltwiseParameter_EltwiseOp_descriptor();
   }
-  static inline const ::std::string& EltwiseOp_Name(EltwiseOp value) {
-    return EltwiseParameter_EltwiseOp_Name(value);
+  template<typename T>
+  static inline const std::string& EltwiseOp_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, EltwiseOp>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function EltwiseOp_Name.");
+    return EltwiseParameter_EltwiseOp_Name(enum_t_value);
   }
-  static inline bool EltwiseOp_Parse(const ::std::string& name,
+  static inline bool EltwiseOp_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       EltwiseOp* value) {
     return EltwiseParameter_EltwiseOp_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kCoeffFieldNumber = 2,
+    kOperationFieldNumber = 1,
+    kStableProdGradFieldNumber = 3,
+  };
   // repeated float coeff = 2;
   int coeff_size() const;
+  private:
+  int _internal_coeff_size() const;
+  public:
   void clear_coeff();
-  static const int kCoeffFieldNumber = 2;
+  private:
+  float _internal_coeff(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_coeff() const;
+  void _internal_add_coeff(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_coeff();
+  public:
   float coeff(int index) const;
   void set_coeff(int index, float value);
   void add_coeff(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       coeff() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_coeff();
 
   // optional .opencv_caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM];
   bool has_operation() const;
+  private:
+  bool _internal_has_operation() const;
+  public:
   void clear_operation();
-  static const int kOperationFieldNumber = 1;
   ::opencv_caffe::EltwiseParameter_EltwiseOp operation() const;
   void set_operation(::opencv_caffe::EltwiseParameter_EltwiseOp value);
+  private:
+  ::opencv_caffe::EltwiseParameter_EltwiseOp _internal_operation() const;
+  void _internal_set_operation(::opencv_caffe::EltwiseParameter_EltwiseOp value);
+  public:
 
   // optional bool stable_prod_grad = 3 [default = true];
   bool has_stable_prod_grad() const;
+  private:
+  bool _internal_has_stable_prod_grad() const;
+  public:
   void clear_stable_prod_grad();
-  static const int kStableProdGradFieldNumber = 3;
   bool stable_prod_grad() const;
   void set_stable_prod_grad(bool value);
+  private:
+  bool _internal_stable_prod_grad() const;
+  void _internal_set_stable_prod_grad(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.EltwiseParameter)
  private:
-  void set_has_operation();
-  void clear_has_operation();
-  void set_has_stable_prod_grad();
-  void clear_has_stable_prod_grad();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< float > coeff_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > coeff_;
   int operation_;
   bool stable_prod_grad_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsEltwiseParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ELUParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ELUParameter) */ {
+class ELUParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ELUParameter) */ {
  public:
-  ELUParameter();
-  virtual ~ELUParameter();
+  inline ELUParameter() : ELUParameter(nullptr) {}
+  ~ELUParameter() override;
+  explicit constexpr ELUParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ELUParameter(const ELUParameter& from);
-
-  inline ELUParameter& operator=(const ELUParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ELUParameter(ELUParameter&& from) noexcept
     : ELUParameter() {
     *this = ::std::move(from);
   }
 
+  inline ELUParameter& operator=(const ELUParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ELUParameter& operator=(ELUParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ELUParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ELUParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ELUParameter* internal_default_instance() {
     return reinterpret_cast<const ELUParameter*>(
                &_ELUParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     32;
 
-  void Swap(ELUParameter* other);
   friend void swap(ELUParameter& a, ELUParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ELUParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ELUParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ELUParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ELUParameter* 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;
+  ELUParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ELUParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ELUParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ELUParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ELUParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ELUParameter";
   }
+  protected:
+  explicit ELUParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kAlphaFieldNumber = 1,
+  };
   // optional float alpha = 1 [default = 1];
   bool has_alpha() const;
+  private:
+  bool _internal_has_alpha() const;
+  public:
   void clear_alpha();
-  static const int kAlphaFieldNumber = 1;
   float alpha() const;
   void set_alpha(float value);
+  private:
+  float _internal_alpha() const;
+  void _internal_set_alpha(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ELUParameter)
  private:
-  void set_has_alpha();
-  void clear_has_alpha();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float alpha_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsELUParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class EmbedParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.EmbedParameter) */ {
+class EmbedParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.EmbedParameter) */ {
  public:
-  EmbedParameter();
-  virtual ~EmbedParameter();
+  inline EmbedParameter() : EmbedParameter(nullptr) {}
+  ~EmbedParameter() override;
+  explicit constexpr EmbedParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   EmbedParameter(const EmbedParameter& from);
-
-  inline EmbedParameter& operator=(const EmbedParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   EmbedParameter(EmbedParameter&& from) noexcept
     : EmbedParameter() {
     *this = ::std::move(from);
   }
 
+  inline EmbedParameter& operator=(const EmbedParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline EmbedParameter& operator=(EmbedParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const EmbedParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const EmbedParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const EmbedParameter* internal_default_instance() {
     return reinterpret_cast<const EmbedParameter*>(
                &_EmbedParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     33;
 
-  void Swap(EmbedParameter* other);
   friend void swap(EmbedParameter& a, EmbedParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(EmbedParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(EmbedParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline EmbedParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  EmbedParameter* 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;
+  EmbedParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<EmbedParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const EmbedParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const EmbedParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(EmbedParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.EmbedParameter";
   }
+  protected:
+  explicit EmbedParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kWeightFillerFieldNumber = 4,
+    kBiasFillerFieldNumber = 5,
+    kNumOutputFieldNumber = 1,
+    kInputDimFieldNumber = 2,
+    kBiasTermFieldNumber = 3,
+  };
   // optional .opencv_caffe.FillerParameter weight_filler = 4;
   bool has_weight_filler() const;
+  private:
+  bool _internal_has_weight_filler() const;
+  public:
   void clear_weight_filler();
-  static const int kWeightFillerFieldNumber = 4;
   const ::opencv_caffe::FillerParameter& weight_filler() const;
-  ::opencv_caffe::FillerParameter* release_weight_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_weight_filler();
   ::opencv_caffe::FillerParameter* mutable_weight_filler();
   void set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_weight_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_weight_filler();
+  public:
+  void unsafe_arena_set_allocated_weight_filler(
+      ::opencv_caffe::FillerParameter* weight_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_weight_filler();
 
   // optional .opencv_caffe.FillerParameter bias_filler = 5;
   bool has_bias_filler() const;
+  private:
+  bool _internal_has_bias_filler() const;
+  public:
   void clear_bias_filler();
-  static const int kBiasFillerFieldNumber = 5;
   const ::opencv_caffe::FillerParameter& bias_filler() const;
-  ::opencv_caffe::FillerParameter* release_bias_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_bias_filler();
   ::opencv_caffe::FillerParameter* mutable_bias_filler();
   void set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_bias_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_bias_filler();
+  public:
+  void unsafe_arena_set_allocated_bias_filler(
+      ::opencv_caffe::FillerParameter* bias_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_bias_filler();
 
   // optional uint32 num_output = 1;
   bool has_num_output() const;
+  private:
+  bool _internal_has_num_output() const;
+  public:
   void clear_num_output();
-  static const int kNumOutputFieldNumber = 1;
-  ::google::protobuf::uint32 num_output() const;
-  void set_num_output(::google::protobuf::uint32 value);
+  uint32_t num_output() const;
+  void set_num_output(uint32_t value);
+  private:
+  uint32_t _internal_num_output() const;
+  void _internal_set_num_output(uint32_t value);
+  public:
 
   // optional uint32 input_dim = 2;
   bool has_input_dim() const;
+  private:
+  bool _internal_has_input_dim() const;
+  public:
   void clear_input_dim();
-  static const int kInputDimFieldNumber = 2;
-  ::google::protobuf::uint32 input_dim() const;
-  void set_input_dim(::google::protobuf::uint32 value);
+  uint32_t input_dim() const;
+  void set_input_dim(uint32_t value);
+  private:
+  uint32_t _internal_input_dim() const;
+  void _internal_set_input_dim(uint32_t value);
+  public:
 
   // optional bool bias_term = 3 [default = true];
   bool has_bias_term() const;
+  private:
+  bool _internal_has_bias_term() const;
+  public:
   void clear_bias_term();
-  static const int kBiasTermFieldNumber = 3;
   bool bias_term() const;
   void set_bias_term(bool value);
+  private:
+  bool _internal_bias_term() const;
+  void _internal_set_bias_term(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.EmbedParameter)
  private:
-  void set_has_num_output();
-  void clear_has_num_output();
-  void set_has_input_dim();
-  void clear_has_input_dim();
-  void set_has_bias_term();
-  void clear_has_bias_term();
-  void set_has_weight_filler();
-  void clear_has_weight_filler();
-  void set_has_bias_filler();
-  void clear_has_bias_filler();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::FillerParameter* weight_filler_;
   ::opencv_caffe::FillerParameter* bias_filler_;
-  ::google::protobuf::uint32 num_output_;
-  ::google::protobuf::uint32 input_dim_;
+  uint32_t num_output_;
+  uint32_t input_dim_;
   bool bias_term_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsEmbedParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ExpParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ExpParameter) */ {
+class ExpParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ExpParameter) */ {
  public:
-  ExpParameter();
-  virtual ~ExpParameter();
+  inline ExpParameter() : ExpParameter(nullptr) {}
+  ~ExpParameter() override;
+  explicit constexpr ExpParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ExpParameter(const ExpParameter& from);
-
-  inline ExpParameter& operator=(const ExpParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ExpParameter(ExpParameter&& from) noexcept
     : ExpParameter() {
     *this = ::std::move(from);
   }
 
+  inline ExpParameter& operator=(const ExpParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ExpParameter& operator=(ExpParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ExpParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ExpParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ExpParameter* internal_default_instance() {
     return reinterpret_cast<const ExpParameter*>(
                &_ExpParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     34;
 
-  void Swap(ExpParameter* other);
   friend void swap(ExpParameter& a, ExpParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ExpParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ExpParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ExpParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ExpParameter* 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;
+  ExpParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ExpParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ExpParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ExpParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ExpParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ExpParameter";
   }
+  protected:
+  explicit ExpParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kShiftFieldNumber = 3,
+    kBaseFieldNumber = 1,
+    kScaleFieldNumber = 2,
+  };
   // optional float shift = 3 [default = 0];
   bool has_shift() const;
+  private:
+  bool _internal_has_shift() const;
+  public:
   void clear_shift();
-  static const int kShiftFieldNumber = 3;
   float shift() const;
   void set_shift(float value);
+  private:
+  float _internal_shift() const;
+  void _internal_set_shift(float value);
+  public:
 
   // optional float base = 1 [default = -1];
   bool has_base() const;
+  private:
+  bool _internal_has_base() const;
+  public:
   void clear_base();
-  static const int kBaseFieldNumber = 1;
   float base() const;
   void set_base(float value);
+  private:
+  float _internal_base() const;
+  void _internal_set_base(float value);
+  public:
 
   // optional float scale = 2 [default = 1];
   bool has_scale() const;
+  private:
+  bool _internal_has_scale() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 2;
   float scale() const;
   void set_scale(float value);
+  private:
+  float _internal_scale() const;
+  void _internal_set_scale(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ExpParameter)
  private:
-  void set_has_base();
-  void clear_has_base();
-  void set_has_scale();
-  void clear_has_scale();
-  void set_has_shift();
-  void clear_has_shift();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float shift_;
   float base_;
   float scale_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsExpParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class FlattenParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.FlattenParameter) */ {
+class FlattenParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.FlattenParameter) */ {
  public:
-  FlattenParameter();
-  virtual ~FlattenParameter();
+  inline FlattenParameter() : FlattenParameter(nullptr) {}
+  ~FlattenParameter() override;
+  explicit constexpr FlattenParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FlattenParameter(const FlattenParameter& from);
-
-  inline FlattenParameter& operator=(const FlattenParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FlattenParameter(FlattenParameter&& from) noexcept
     : FlattenParameter() {
     *this = ::std::move(from);
   }
 
+  inline FlattenParameter& operator=(const FlattenParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FlattenParameter& operator=(FlattenParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const FlattenParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FlattenParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const FlattenParameter* internal_default_instance() {
     return reinterpret_cast<const FlattenParameter*>(
                &_FlattenParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     35;
 
-  void Swap(FlattenParameter* other);
   friend void swap(FlattenParameter& a, FlattenParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(FlattenParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FlattenParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FlattenParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FlattenParameter* 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;
+  FlattenParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FlattenParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FlattenParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FlattenParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FlattenParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.FlattenParameter";
   }
+  protected:
+  explicit FlattenParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kAxisFieldNumber = 1,
+    kEndAxisFieldNumber = 2,
+  };
   // optional int32 axis = 1 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 1;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // optional int32 end_axis = 2 [default = -1];
   bool has_end_axis() const;
+  private:
+  bool _internal_has_end_axis() const;
+  public:
   void clear_end_axis();
-  static const int kEndAxisFieldNumber = 2;
-  ::google::protobuf::int32 end_axis() const;
-  void set_end_axis(::google::protobuf::int32 value);
+  int32_t end_axis() const;
+  void set_end_axis(int32_t value);
+  private:
+  int32_t _internal_end_axis() const;
+  void _internal_set_end_axis(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.FlattenParameter)
  private:
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_end_axis();
-  void clear_has_end_axis();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::int32 axis_;
-  ::google::protobuf::int32 end_axis_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsFlattenParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int32_t axis_;
+  int32_t end_axis_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class HDF5DataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.HDF5DataParameter) */ {
+class HDF5DataParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.HDF5DataParameter) */ {
  public:
-  HDF5DataParameter();
-  virtual ~HDF5DataParameter();
+  inline HDF5DataParameter() : HDF5DataParameter(nullptr) {}
+  ~HDF5DataParameter() override;
+  explicit constexpr HDF5DataParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   HDF5DataParameter(const HDF5DataParameter& from);
-
-  inline HDF5DataParameter& operator=(const HDF5DataParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   HDF5DataParameter(HDF5DataParameter&& from) noexcept
     : HDF5DataParameter() {
     *this = ::std::move(from);
   }
 
+  inline HDF5DataParameter& operator=(const HDF5DataParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline HDF5DataParameter& operator=(HDF5DataParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const HDF5DataParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const HDF5DataParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const HDF5DataParameter* internal_default_instance() {
     return reinterpret_cast<const HDF5DataParameter*>(
                &_HDF5DataParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     36;
 
-  void Swap(HDF5DataParameter* other);
   friend void swap(HDF5DataParameter& a, HDF5DataParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(HDF5DataParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(HDF5DataParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline HDF5DataParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  HDF5DataParameter* 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;
+  HDF5DataParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<HDF5DataParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const HDF5DataParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const HDF5DataParameter& 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;
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const final;
   void InternalSwap(HDF5DataParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.HDF5DataParameter";
   }
+  protected:
+  explicit HDF5DataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSourceFieldNumber = 1,
+    kBatchSizeFieldNumber = 2,
+    kShuffleFieldNumber = 3,
+  };
   // optional string source = 1;
   bool has_source() const;
+  private:
+  bool _internal_has_source() const;
+  public:
   void clear_source();
-  static const int kSourceFieldNumber = 1;
-  const ::std::string& source() const;
-  void set_source(const ::std::string& value);
-  #if LANG_CXX11
-  void set_source(::std::string&& value);
-  #endif
-  void set_source(const char* value);
-  void set_source(const char* value, size_t size);
-  ::std::string* mutable_source();
-  ::std::string* release_source();
-  void set_allocated_source(::std::string* source);
+  const std::string& source() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_source(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_source();
+  PROTOBUF_NODISCARD std::string* release_source();
+  void set_allocated_source(std::string* source);
+  private:
+  const std::string& _internal_source() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_source(const std::string& value);
+  std::string* _internal_mutable_source();
+  public:
 
   // optional uint32 batch_size = 2;
   bool has_batch_size() const;
+  private:
+  bool _internal_has_batch_size() const;
+  public:
   void clear_batch_size();
-  static const int kBatchSizeFieldNumber = 2;
-  ::google::protobuf::uint32 batch_size() const;
-  void set_batch_size(::google::protobuf::uint32 value);
+  uint32_t batch_size() const;
+  void set_batch_size(uint32_t value);
+  private:
+  uint32_t _internal_batch_size() const;
+  void _internal_set_batch_size(uint32_t value);
+  public:
 
   // optional bool shuffle = 3 [default = false];
   bool has_shuffle() const;
+  private:
+  bool _internal_has_shuffle() const;
+  public:
   void clear_shuffle();
-  static const int kShuffleFieldNumber = 3;
   bool shuffle() const;
   void set_shuffle(bool value);
+  private:
+  bool _internal_shuffle() const;
+  void _internal_set_shuffle(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.HDF5DataParameter)
  private:
-  void set_has_source();
-  void clear_has_source();
-  void set_has_batch_size();
-  void clear_has_batch_size();
-  void set_has_shuffle();
-  void clear_has_shuffle();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr source_;
-  ::google::protobuf::uint32 batch_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_;
+  uint32_t batch_size_;
   bool shuffle_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5DataParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class HDF5OutputParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.HDF5OutputParameter) */ {
+class HDF5OutputParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.HDF5OutputParameter) */ {
  public:
-  HDF5OutputParameter();
-  virtual ~HDF5OutputParameter();
+  inline HDF5OutputParameter() : HDF5OutputParameter(nullptr) {}
+  ~HDF5OutputParameter() override;
+  explicit constexpr HDF5OutputParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   HDF5OutputParameter(const HDF5OutputParameter& from);
-
-  inline HDF5OutputParameter& operator=(const HDF5OutputParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   HDF5OutputParameter(HDF5OutputParameter&& from) noexcept
     : HDF5OutputParameter() {
     *this = ::std::move(from);
   }
 
+  inline HDF5OutputParameter& operator=(const HDF5OutputParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline HDF5OutputParameter& operator=(HDF5OutputParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const HDF5OutputParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const HDF5OutputParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const HDF5OutputParameter* internal_default_instance() {
     return reinterpret_cast<const HDF5OutputParameter*>(
                &_HDF5OutputParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     37;
 
-  void Swap(HDF5OutputParameter* other);
   friend void swap(HDF5OutputParameter& a, HDF5OutputParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(HDF5OutputParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(HDF5OutputParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline HDF5OutputParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  HDF5OutputParameter* 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;
+  HDF5OutputParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<HDF5OutputParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const HDF5OutputParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const HDF5OutputParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(HDF5OutputParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.HDF5OutputParameter";
   }
+  protected:
+  explicit HDF5OutputParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFileNameFieldNumber = 1,
+  };
   // optional string file_name = 1;
   bool has_file_name() const;
+  private:
+  bool _internal_has_file_name() const;
+  public:
   void clear_file_name();
-  static const int kFileNameFieldNumber = 1;
-  const ::std::string& file_name() const;
-  void set_file_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_file_name(::std::string&& value);
-  #endif
-  void set_file_name(const char* value);
-  void set_file_name(const char* value, size_t size);
-  ::std::string* mutable_file_name();
-  ::std::string* release_file_name();
-  void set_allocated_file_name(::std::string* file_name);
+  const std::string& file_name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_file_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_file_name();
+  PROTOBUF_NODISCARD std::string* release_file_name();
+  void set_allocated_file_name(std::string* file_name);
+  private:
+  const std::string& _internal_file_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_file_name(const std::string& value);
+  std::string* _internal_mutable_file_name();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.HDF5OutputParameter)
  private:
-  void set_has_file_name();
-  void clear_has_file_name();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr file_name_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHDF5OutputParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr file_name_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class HingeLossParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.HingeLossParameter) */ {
+class HingeLossParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.HingeLossParameter) */ {
  public:
-  HingeLossParameter();
-  virtual ~HingeLossParameter();
+  inline HingeLossParameter() : HingeLossParameter(nullptr) {}
+  ~HingeLossParameter() override;
+  explicit constexpr HingeLossParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   HingeLossParameter(const HingeLossParameter& from);
-
-  inline HingeLossParameter& operator=(const HingeLossParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   HingeLossParameter(HingeLossParameter&& from) noexcept
     : HingeLossParameter() {
     *this = ::std::move(from);
   }
 
+  inline HingeLossParameter& operator=(const HingeLossParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline HingeLossParameter& operator=(HingeLossParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const HingeLossParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const HingeLossParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const HingeLossParameter* internal_default_instance() {
     return reinterpret_cast<const HingeLossParameter*>(
                &_HingeLossParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     38;
 
-  void Swap(HingeLossParameter* other);
   friend void swap(HingeLossParameter& a, HingeLossParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(HingeLossParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(HingeLossParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline HingeLossParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  HingeLossParameter* 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;
+  HingeLossParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<HingeLossParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const HingeLossParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const HingeLossParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(HingeLossParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.HingeLossParameter";
   }
+  protected:
+  explicit HingeLossParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef HingeLossParameter_Norm Norm;
-  static const Norm L1 =
+  static constexpr Norm L1 =
     HingeLossParameter_Norm_L1;
-  static const Norm L2 =
+  static constexpr Norm L2 =
     HingeLossParameter_Norm_L2;
   static inline bool Norm_IsValid(int value) {
     return HingeLossParameter_Norm_IsValid(value);
   }
-  static const Norm Norm_MIN =
+  static constexpr Norm Norm_MIN =
     HingeLossParameter_Norm_Norm_MIN;
-  static const Norm Norm_MAX =
+  static constexpr Norm Norm_MAX =
     HingeLossParameter_Norm_Norm_MAX;
-  static const int Norm_ARRAYSIZE =
+  static constexpr int Norm_ARRAYSIZE =
     HingeLossParameter_Norm_Norm_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Norm_descriptor() {
     return HingeLossParameter_Norm_descriptor();
   }
-  static inline const ::std::string& Norm_Name(Norm value) {
-    return HingeLossParameter_Norm_Name(value);
+  template<typename T>
+  static inline const std::string& Norm_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Norm>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Norm_Name.");
+    return HingeLossParameter_Norm_Name(enum_t_value);
   }
-  static inline bool Norm_Parse(const ::std::string& name,
+  static inline bool Norm_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Norm* value) {
     return HingeLossParameter_Norm_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNormFieldNumber = 1,
+  };
   // optional .opencv_caffe.HingeLossParameter.Norm norm = 1 [default = L1];
   bool has_norm() const;
+  private:
+  bool _internal_has_norm() const;
+  public:
   void clear_norm();
-  static const int kNormFieldNumber = 1;
   ::opencv_caffe::HingeLossParameter_Norm norm() const;
   void set_norm(::opencv_caffe::HingeLossParameter_Norm value);
+  private:
+  ::opencv_caffe::HingeLossParameter_Norm _internal_norm() const;
+  void _internal_set_norm(::opencv_caffe::HingeLossParameter_Norm value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.HingeLossParameter)
  private:
-  void set_has_norm();
-  void clear_has_norm();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   int norm_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsHingeLossParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ImageDataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ImageDataParameter) */ {
+class ImageDataParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ImageDataParameter) */ {
  public:
-  ImageDataParameter();
-  virtual ~ImageDataParameter();
+  inline ImageDataParameter() : ImageDataParameter(nullptr) {}
+  ~ImageDataParameter() override;
+  explicit constexpr ImageDataParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ImageDataParameter(const ImageDataParameter& from);
-
-  inline ImageDataParameter& operator=(const ImageDataParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ImageDataParameter(ImageDataParameter&& from) noexcept
     : ImageDataParameter() {
     *this = ::std::move(from);
   }
 
+  inline ImageDataParameter& operator=(const ImageDataParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ImageDataParameter& operator=(ImageDataParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ImageDataParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ImageDataParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ImageDataParameter* internal_default_instance() {
     return reinterpret_cast<const ImageDataParameter*>(
                &_ImageDataParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     39;
 
-  void Swap(ImageDataParameter* other);
   friend void swap(ImageDataParameter& a, ImageDataParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ImageDataParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ImageDataParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ImageDataParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ImageDataParameter* 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;
+  ImageDataParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ImageDataParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ImageDataParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ImageDataParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ImageDataParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ImageDataParameter";
   }
+  protected:
+  explicit ImageDataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSourceFieldNumber = 1,
+    kMeanFileFieldNumber = 3,
+    kRootFolderFieldNumber = 12,
+    kCropSizeFieldNumber = 5,
+    kRandSkipFieldNumber = 7,
+    kShuffleFieldNumber = 8,
+    kMirrorFieldNumber = 6,
+    kNewHeightFieldNumber = 9,
+    kNewWidthFieldNumber = 10,
+    kIsColorFieldNumber = 11,
+    kScaleFieldNumber = 2,
+    kBatchSizeFieldNumber = 4,
+  };
   // optional string source = 1;
   bool has_source() const;
+  private:
+  bool _internal_has_source() const;
+  public:
   void clear_source();
-  static const int kSourceFieldNumber = 1;
-  const ::std::string& source() const;
-  void set_source(const ::std::string& value);
-  #if LANG_CXX11
-  void set_source(::std::string&& value);
-  #endif
-  void set_source(const char* value);
-  void set_source(const char* value, size_t size);
-  ::std::string* mutable_source();
-  ::std::string* release_source();
-  void set_allocated_source(::std::string* source);
+  const std::string& source() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_source(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_source();
+  PROTOBUF_NODISCARD std::string* release_source();
+  void set_allocated_source(std::string* source);
+  private:
+  const std::string& _internal_source() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_source(const std::string& value);
+  std::string* _internal_mutable_source();
+  public:
 
   // optional string mean_file = 3;
   bool has_mean_file() const;
+  private:
+  bool _internal_has_mean_file() const;
+  public:
   void clear_mean_file();
-  static const int kMeanFileFieldNumber = 3;
-  const ::std::string& mean_file() const;
-  void set_mean_file(const ::std::string& value);
-  #if LANG_CXX11
-  void set_mean_file(::std::string&& value);
-  #endif
-  void set_mean_file(const char* value);
-  void set_mean_file(const char* value, size_t size);
-  ::std::string* mutable_mean_file();
-  ::std::string* release_mean_file();
-  void set_allocated_mean_file(::std::string* mean_file);
+  const std::string& mean_file() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_mean_file(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_mean_file();
+  PROTOBUF_NODISCARD std::string* release_mean_file();
+  void set_allocated_mean_file(std::string* mean_file);
+  private:
+  const std::string& _internal_mean_file() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_mean_file(const std::string& value);
+  std::string* _internal_mutable_mean_file();
+  public:
 
   // optional string root_folder = 12 [default = ""];
   bool has_root_folder() const;
+  private:
+  bool _internal_has_root_folder() const;
+  public:
   void clear_root_folder();
-  static const int kRootFolderFieldNumber = 12;
-  const ::std::string& root_folder() const;
-  void set_root_folder(const ::std::string& value);
-  #if LANG_CXX11
-  void set_root_folder(::std::string&& value);
-  #endif
-  void set_root_folder(const char* value);
-  void set_root_folder(const char* value, size_t size);
-  ::std::string* mutable_root_folder();
-  ::std::string* release_root_folder();
-  void set_allocated_root_folder(::std::string* root_folder);
+  const std::string& root_folder() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_root_folder(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_root_folder();
+  PROTOBUF_NODISCARD std::string* release_root_folder();
+  void set_allocated_root_folder(std::string* root_folder);
+  private:
+  const std::string& _internal_root_folder() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_root_folder(const std::string& value);
+  std::string* _internal_mutable_root_folder();
+  public:
 
   // optional uint32 crop_size = 5 [default = 0];
   bool has_crop_size() const;
+  private:
+  bool _internal_has_crop_size() const;
+  public:
   void clear_crop_size();
-  static const int kCropSizeFieldNumber = 5;
-  ::google::protobuf::uint32 crop_size() const;
-  void set_crop_size(::google::protobuf::uint32 value);
+  uint32_t crop_size() const;
+  void set_crop_size(uint32_t value);
+  private:
+  uint32_t _internal_crop_size() const;
+  void _internal_set_crop_size(uint32_t value);
+  public:
 
   // optional uint32 rand_skip = 7 [default = 0];
   bool has_rand_skip() const;
+  private:
+  bool _internal_has_rand_skip() const;
+  public:
   void clear_rand_skip();
-  static const int kRandSkipFieldNumber = 7;
-  ::google::protobuf::uint32 rand_skip() const;
-  void set_rand_skip(::google::protobuf::uint32 value);
+  uint32_t rand_skip() const;
+  void set_rand_skip(uint32_t value);
+  private:
+  uint32_t _internal_rand_skip() const;
+  void _internal_set_rand_skip(uint32_t value);
+  public:
 
   // optional bool shuffle = 8 [default = false];
   bool has_shuffle() const;
+  private:
+  bool _internal_has_shuffle() const;
+  public:
   void clear_shuffle();
-  static const int kShuffleFieldNumber = 8;
   bool shuffle() const;
   void set_shuffle(bool value);
+  private:
+  bool _internal_shuffle() const;
+  void _internal_set_shuffle(bool value);
+  public:
 
   // optional bool mirror = 6 [default = false];
   bool has_mirror() const;
+  private:
+  bool _internal_has_mirror() const;
+  public:
   void clear_mirror();
-  static const int kMirrorFieldNumber = 6;
   bool mirror() const;
   void set_mirror(bool value);
+  private:
+  bool _internal_mirror() const;
+  void _internal_set_mirror(bool value);
+  public:
 
   // optional uint32 new_height = 9 [default = 0];
   bool has_new_height() const;
+  private:
+  bool _internal_has_new_height() const;
+  public:
   void clear_new_height();
-  static const int kNewHeightFieldNumber = 9;
-  ::google::protobuf::uint32 new_height() const;
-  void set_new_height(::google::protobuf::uint32 value);
+  uint32_t new_height() const;
+  void set_new_height(uint32_t value);
+  private:
+  uint32_t _internal_new_height() const;
+  void _internal_set_new_height(uint32_t value);
+  public:
 
   // optional uint32 new_width = 10 [default = 0];
   bool has_new_width() const;
+  private:
+  bool _internal_has_new_width() const;
+  public:
   void clear_new_width();
-  static const int kNewWidthFieldNumber = 10;
-  ::google::protobuf::uint32 new_width() const;
-  void set_new_width(::google::protobuf::uint32 value);
+  uint32_t new_width() const;
+  void set_new_width(uint32_t value);
+  private:
+  uint32_t _internal_new_width() const;
+  void _internal_set_new_width(uint32_t value);
+  public:
 
   // optional bool is_color = 11 [default = true];
   bool has_is_color() const;
+  private:
+  bool _internal_has_is_color() const;
+  public:
   void clear_is_color();
-  static const int kIsColorFieldNumber = 11;
   bool is_color() const;
   void set_is_color(bool value);
+  private:
+  bool _internal_is_color() const;
+  void _internal_set_is_color(bool value);
+  public:
 
   // optional float scale = 2 [default = 1];
   bool has_scale() const;
+  private:
+  bool _internal_has_scale() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 2;
   float scale() const;
   void set_scale(float value);
+  private:
+  float _internal_scale() const;
+  void _internal_set_scale(float value);
+  public:
 
   // optional uint32 batch_size = 4 [default = 1];
   bool has_batch_size() const;
+  private:
+  bool _internal_has_batch_size() const;
+  public:
   void clear_batch_size();
-  static const int kBatchSizeFieldNumber = 4;
-  ::google::protobuf::uint32 batch_size() const;
-  void set_batch_size(::google::protobuf::uint32 value);
+  uint32_t batch_size() const;
+  void set_batch_size(uint32_t value);
+  private:
+  uint32_t _internal_batch_size() const;
+  void _internal_set_batch_size(uint32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ImageDataParameter)
  private:
-  void set_has_source();
-  void clear_has_source();
-  void set_has_batch_size();
-  void clear_has_batch_size();
-  void set_has_rand_skip();
-  void clear_has_rand_skip();
-  void set_has_shuffle();
-  void clear_has_shuffle();
-  void set_has_new_height();
-  void clear_has_new_height();
-  void set_has_new_width();
-  void clear_has_new_width();
-  void set_has_is_color();
-  void clear_has_is_color();
-  void set_has_scale();
-  void clear_has_scale();
-  void set_has_mean_file();
-  void clear_has_mean_file();
-  void set_has_crop_size();
-  void clear_has_crop_size();
-  void set_has_mirror();
-  void clear_has_mirror();
-  void set_has_root_folder();
-  void clear_has_root_folder();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr source_;
-  ::google::protobuf::internal::ArenaStringPtr mean_file_;
-  ::google::protobuf::internal::ArenaStringPtr root_folder_;
-  ::google::protobuf::uint32 crop_size_;
-  ::google::protobuf::uint32 rand_skip_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr mean_file_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr root_folder_;
+  uint32_t crop_size_;
+  uint32_t rand_skip_;
   bool shuffle_;
   bool mirror_;
-  ::google::protobuf::uint32 new_height_;
-  ::google::protobuf::uint32 new_width_;
+  uint32_t new_height_;
+  uint32_t new_width_;
   bool is_color_;
   float scale_;
-  ::google::protobuf::uint32 batch_size_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsImageDataParameterImpl();
+  uint32_t batch_size_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class InfogainLossParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.InfogainLossParameter) */ {
+class InfogainLossParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.InfogainLossParameter) */ {
  public:
-  InfogainLossParameter();
-  virtual ~InfogainLossParameter();
+  inline InfogainLossParameter() : InfogainLossParameter(nullptr) {}
+  ~InfogainLossParameter() override;
+  explicit constexpr InfogainLossParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   InfogainLossParameter(const InfogainLossParameter& from);
-
-  inline InfogainLossParameter& operator=(const InfogainLossParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   InfogainLossParameter(InfogainLossParameter&& from) noexcept
     : InfogainLossParameter() {
     *this = ::std::move(from);
   }
 
+  inline InfogainLossParameter& operator=(const InfogainLossParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline InfogainLossParameter& operator=(InfogainLossParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const InfogainLossParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const InfogainLossParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const InfogainLossParameter* internal_default_instance() {
     return reinterpret_cast<const InfogainLossParameter*>(
                &_InfogainLossParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     40;
 
-  void Swap(InfogainLossParameter* other);
   friend void swap(InfogainLossParameter& a, InfogainLossParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(InfogainLossParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(InfogainLossParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline InfogainLossParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  InfogainLossParameter* 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;
+  InfogainLossParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<InfogainLossParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const InfogainLossParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const InfogainLossParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(InfogainLossParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.InfogainLossParameter";
   }
+  protected:
+  explicit InfogainLossParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSourceFieldNumber = 1,
+  };
   // optional string source = 1;
   bool has_source() const;
+  private:
+  bool _internal_has_source() const;
+  public:
   void clear_source();
-  static const int kSourceFieldNumber = 1;
-  const ::std::string& source() const;
-  void set_source(const ::std::string& value);
-  #if LANG_CXX11
-  void set_source(::std::string&& value);
-  #endif
-  void set_source(const char* value);
-  void set_source(const char* value, size_t size);
-  ::std::string* mutable_source();
-  ::std::string* release_source();
-  void set_allocated_source(::std::string* source);
+  const std::string& source() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_source(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_source();
+  PROTOBUF_NODISCARD std::string* release_source();
+  void set_allocated_source(std::string* source);
+  private:
+  const std::string& _internal_source() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_source(const std::string& value);
+  std::string* _internal_mutable_source();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.InfogainLossParameter)
  private:
-  void set_has_source();
-  void clear_has_source();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr source_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInfogainLossParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class InnerProductParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.InnerProductParameter) */ {
+class InnerProductParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.InnerProductParameter) */ {
  public:
-  InnerProductParameter();
-  virtual ~InnerProductParameter();
+  inline InnerProductParameter() : InnerProductParameter(nullptr) {}
+  ~InnerProductParameter() override;
+  explicit constexpr InnerProductParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   InnerProductParameter(const InnerProductParameter& from);
-
-  inline InnerProductParameter& operator=(const InnerProductParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   InnerProductParameter(InnerProductParameter&& from) noexcept
     : InnerProductParameter() {
     *this = ::std::move(from);
   }
 
+  inline InnerProductParameter& operator=(const InnerProductParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline InnerProductParameter& operator=(InnerProductParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const InnerProductParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const InnerProductParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const InnerProductParameter* internal_default_instance() {
     return reinterpret_cast<const InnerProductParameter*>(
                &_InnerProductParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     41;
 
-  void Swap(InnerProductParameter* other);
   friend void swap(InnerProductParameter& a, InnerProductParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(InnerProductParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(InnerProductParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline InnerProductParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  InnerProductParameter* 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;
+  InnerProductParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<InnerProductParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const InnerProductParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const InnerProductParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(InnerProductParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.InnerProductParameter";
   }
+  protected:
+  explicit InnerProductParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kWeightFillerFieldNumber = 3,
+    kBiasFillerFieldNumber = 4,
+    kNumOutputFieldNumber = 1,
+    kTransposeFieldNumber = 6,
+    kBiasTermFieldNumber = 2,
+    kAxisFieldNumber = 5,
+  };
   // optional .opencv_caffe.FillerParameter weight_filler = 3;
   bool has_weight_filler() const;
+  private:
+  bool _internal_has_weight_filler() const;
+  public:
   void clear_weight_filler();
-  static const int kWeightFillerFieldNumber = 3;
   const ::opencv_caffe::FillerParameter& weight_filler() const;
-  ::opencv_caffe::FillerParameter* release_weight_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_weight_filler();
   ::opencv_caffe::FillerParameter* mutable_weight_filler();
   void set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_weight_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_weight_filler();
+  public:
+  void unsafe_arena_set_allocated_weight_filler(
+      ::opencv_caffe::FillerParameter* weight_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_weight_filler();
 
   // optional .opencv_caffe.FillerParameter bias_filler = 4;
   bool has_bias_filler() const;
+  private:
+  bool _internal_has_bias_filler() const;
+  public:
   void clear_bias_filler();
-  static const int kBiasFillerFieldNumber = 4;
   const ::opencv_caffe::FillerParameter& bias_filler() const;
-  ::opencv_caffe::FillerParameter* release_bias_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_bias_filler();
   ::opencv_caffe::FillerParameter* mutable_bias_filler();
   void set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_bias_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_bias_filler();
+  public:
+  void unsafe_arena_set_allocated_bias_filler(
+      ::opencv_caffe::FillerParameter* bias_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_bias_filler();
 
   // optional uint32 num_output = 1;
   bool has_num_output() const;
+  private:
+  bool _internal_has_num_output() const;
+  public:
   void clear_num_output();
-  static const int kNumOutputFieldNumber = 1;
-  ::google::protobuf::uint32 num_output() const;
-  void set_num_output(::google::protobuf::uint32 value);
+  uint32_t num_output() const;
+  void set_num_output(uint32_t value);
+  private:
+  uint32_t _internal_num_output() const;
+  void _internal_set_num_output(uint32_t value);
+  public:
 
   // optional bool transpose = 6 [default = false];
   bool has_transpose() const;
+  private:
+  bool _internal_has_transpose() const;
+  public:
   void clear_transpose();
-  static const int kTransposeFieldNumber = 6;
   bool transpose() const;
   void set_transpose(bool value);
+  private:
+  bool _internal_transpose() const;
+  void _internal_set_transpose(bool value);
+  public:
 
   // optional bool bias_term = 2 [default = true];
   bool has_bias_term() const;
+  private:
+  bool _internal_has_bias_term() const;
+  public:
   void clear_bias_term();
-  static const int kBiasTermFieldNumber = 2;
   bool bias_term() const;
   void set_bias_term(bool value);
+  private:
+  bool _internal_bias_term() const;
+  void _internal_set_bias_term(bool value);
+  public:
 
   // optional int32 axis = 5 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 5;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.InnerProductParameter)
  private:
-  void set_has_num_output();
-  void clear_has_num_output();
-  void set_has_bias_term();
-  void clear_has_bias_term();
-  void set_has_weight_filler();
-  void clear_has_weight_filler();
-  void set_has_bias_filler();
-  void clear_has_bias_filler();
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_transpose();
-  void clear_has_transpose();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::FillerParameter* weight_filler_;
   ::opencv_caffe::FillerParameter* bias_filler_;
-  ::google::protobuf::uint32 num_output_;
+  uint32_t num_output_;
   bool transpose_;
   bool bias_term_;
-  ::google::protobuf::int32 axis_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInnerProductParameterImpl();
+  int32_t axis_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class InputParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.InputParameter) */ {
+class InputParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.InputParameter) */ {
  public:
-  InputParameter();
-  virtual ~InputParameter();
+  inline InputParameter() : InputParameter(nullptr) {}
+  ~InputParameter() override;
+  explicit constexpr InputParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   InputParameter(const InputParameter& from);
+  InputParameter(InputParameter&& from) noexcept
+    : InputParameter() {
+    *this = ::std::move(from);
+  }
 
   inline InputParameter& operator=(const InputParameter& from) {
     CopyFrom(from);
     return *this;
   }
-  #if LANG_CXX11
-  InputParameter(InputParameter&& from) noexcept
-    : InputParameter() {
-    *this = ::std::move(from);
-  }
-
   inline InputParameter& operator=(InputParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const InputParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const InputParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const InputParameter* internal_default_instance() {
     return reinterpret_cast<const InputParameter*>(
                &_InputParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     42;
 
-  void Swap(InputParameter* other);
   friend void swap(InputParameter& a, InputParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(InputParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(InputParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline InputParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  InputParameter* 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;
+  InputParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<InputParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const InputParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const InputParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(InputParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.InputParameter";
   }
+  protected:
+  explicit InputParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kShapeFieldNumber = 1,
+  };
   // repeated .opencv_caffe.BlobShape shape = 1;
   int shape_size() const;
+  private:
+  int _internal_shape_size() const;
+  public:
   void clear_shape();
-  static const int kShapeFieldNumber = 1;
-  const ::opencv_caffe::BlobShape& shape(int index) const;
   ::opencv_caffe::BlobShape* mutable_shape(int index);
-  ::opencv_caffe::BlobShape* add_shape();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >*
       mutable_shape();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >&
+  private:
+  const ::opencv_caffe::BlobShape& _internal_shape(int index) const;
+  ::opencv_caffe::BlobShape* _internal_add_shape();
+  public:
+  const ::opencv_caffe::BlobShape& shape(int index) const;
+  ::opencv_caffe::BlobShape* add_shape();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >&
       shape() const;
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.InputParameter)
  private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape > shape_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsInputParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape > shape_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LogParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.LogParameter) */ {
+class LogParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.LogParameter) */ {
  public:
-  LogParameter();
-  virtual ~LogParameter();
+  inline LogParameter() : LogParameter(nullptr) {}
+  ~LogParameter() override;
+  explicit constexpr LogParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   LogParameter(const LogParameter& from);
-
-  inline LogParameter& operator=(const LogParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   LogParameter(LogParameter&& from) noexcept
     : LogParameter() {
     *this = ::std::move(from);
   }
 
+  inline LogParameter& operator=(const LogParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline LogParameter& operator=(LogParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const LogParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const LogParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const LogParameter* internal_default_instance() {
     return reinterpret_cast<const LogParameter*>(
                &_LogParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     43;
 
-  void Swap(LogParameter* other);
   friend void swap(LogParameter& a, LogParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(LogParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(LogParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline LogParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  LogParameter* 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;
+  LogParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<LogParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const LogParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const LogParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(LogParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.LogParameter";
   }
+  protected:
+  explicit LogParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kShiftFieldNumber = 3,
+    kBaseFieldNumber = 1,
+    kScaleFieldNumber = 2,
+  };
   // optional float shift = 3 [default = 0];
   bool has_shift() const;
+  private:
+  bool _internal_has_shift() const;
+  public:
   void clear_shift();
-  static const int kShiftFieldNumber = 3;
   float shift() const;
   void set_shift(float value);
+  private:
+  float _internal_shift() const;
+  void _internal_set_shift(float value);
+  public:
 
   // optional float base = 1 [default = -1];
   bool has_base() const;
+  private:
+  bool _internal_has_base() const;
+  public:
   void clear_base();
-  static const int kBaseFieldNumber = 1;
   float base() const;
   void set_base(float value);
+  private:
+  float _internal_base() const;
+  void _internal_set_base(float value);
+  public:
 
   // optional float scale = 2 [default = 1];
   bool has_scale() const;
+  private:
+  bool _internal_has_scale() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 2;
   float scale() const;
   void set_scale(float value);
+  private:
+  float _internal_scale() const;
+  void _internal_set_scale(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.LogParameter)
  private:
-  void set_has_base();
-  void clear_has_base();
-  void set_has_scale();
-  void clear_has_scale();
-  void set_has_shift();
-  void clear_has_shift();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float shift_;
   float base_;
   float scale_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLogParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class LRNParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.LRNParameter) */ {
+class LRNParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.LRNParameter) */ {
  public:
-  LRNParameter();
-  virtual ~LRNParameter();
+  inline LRNParameter() : LRNParameter(nullptr) {}
+  ~LRNParameter() override;
+  explicit constexpr LRNParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   LRNParameter(const LRNParameter& from);
-
-  inline LRNParameter& operator=(const LRNParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   LRNParameter(LRNParameter&& from) noexcept
     : LRNParameter() {
     *this = ::std::move(from);
   }
 
+  inline LRNParameter& operator=(const LRNParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline LRNParameter& operator=(LRNParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const LRNParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const LRNParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const LRNParameter* internal_default_instance() {
     return reinterpret_cast<const LRNParameter*>(
                &_LRNParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     44;
 
-  void Swap(LRNParameter* other);
   friend void swap(LRNParameter& a, LRNParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(LRNParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(LRNParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline LRNParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  LRNParameter* 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;
+  LRNParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<LRNParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const LRNParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const LRNParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(LRNParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.LRNParameter";
   }
+  protected:
+  explicit LRNParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef LRNParameter_NormRegion NormRegion;
-  static const NormRegion ACROSS_CHANNELS =
+  static constexpr NormRegion ACROSS_CHANNELS =
     LRNParameter_NormRegion_ACROSS_CHANNELS;
-  static const NormRegion WITHIN_CHANNEL =
+  static constexpr NormRegion WITHIN_CHANNEL =
     LRNParameter_NormRegion_WITHIN_CHANNEL;
   static inline bool NormRegion_IsValid(int value) {
     return LRNParameter_NormRegion_IsValid(value);
   }
-  static const NormRegion NormRegion_MIN =
+  static constexpr NormRegion NormRegion_MIN =
     LRNParameter_NormRegion_NormRegion_MIN;
-  static const NormRegion NormRegion_MAX =
+  static constexpr NormRegion NormRegion_MAX =
     LRNParameter_NormRegion_NormRegion_MAX;
-  static const int NormRegion_ARRAYSIZE =
+  static constexpr int NormRegion_ARRAYSIZE =
     LRNParameter_NormRegion_NormRegion_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   NormRegion_descriptor() {
     return LRNParameter_NormRegion_descriptor();
   }
-  static inline const ::std::string& NormRegion_Name(NormRegion value) {
-    return LRNParameter_NormRegion_Name(value);
+  template<typename T>
+  static inline const std::string& NormRegion_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, NormRegion>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function NormRegion_Name.");
+    return LRNParameter_NormRegion_Name(enum_t_value);
   }
-  static inline bool NormRegion_Parse(const ::std::string& name,
+  static inline bool NormRegion_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       NormRegion* value) {
     return LRNParameter_NormRegion_Parse(name, value);
   }
 
   typedef LRNParameter_Engine Engine;
-  static const Engine DEFAULT =
+  static constexpr Engine DEFAULT =
     LRNParameter_Engine_DEFAULT;
-  static const Engine CAFFE =
+  static constexpr Engine CAFFE =
     LRNParameter_Engine_CAFFE;
-  static const Engine CUDNN =
+  static constexpr Engine CUDNN =
     LRNParameter_Engine_CUDNN;
   static inline bool Engine_IsValid(int value) {
     return LRNParameter_Engine_IsValid(value);
   }
-  static const Engine Engine_MIN =
+  static constexpr Engine Engine_MIN =
     LRNParameter_Engine_Engine_MIN;
-  static const Engine Engine_MAX =
+  static constexpr Engine Engine_MAX =
     LRNParameter_Engine_Engine_MAX;
-  static const int Engine_ARRAYSIZE =
+  static constexpr int Engine_ARRAYSIZE =
     LRNParameter_Engine_Engine_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Engine_descriptor() {
     return LRNParameter_Engine_descriptor();
   }
-  static inline const ::std::string& Engine_Name(Engine value) {
-    return LRNParameter_Engine_Name(value);
+  template<typename T>
+  static inline const std::string& Engine_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Engine>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Engine_Name.");
+    return LRNParameter_Engine_Name(enum_t_value);
   }
-  static inline bool Engine_Parse(const ::std::string& name,
+  static inline bool Engine_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Engine* value) {
     return LRNParameter_Engine_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNormRegionFieldNumber = 4,
+    kEngineFieldNumber = 6,
+    kLocalSizeFieldNumber = 1,
+    kAlphaFieldNumber = 2,
+    kBetaFieldNumber = 3,
+    kKFieldNumber = 5,
+  };
   // optional .opencv_caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
   bool has_norm_region() const;
+  private:
+  bool _internal_has_norm_region() const;
+  public:
   void clear_norm_region();
-  static const int kNormRegionFieldNumber = 4;
   ::opencv_caffe::LRNParameter_NormRegion norm_region() const;
   void set_norm_region(::opencv_caffe::LRNParameter_NormRegion value);
+  private:
+  ::opencv_caffe::LRNParameter_NormRegion _internal_norm_region() const;
+  void _internal_set_norm_region(::opencv_caffe::LRNParameter_NormRegion value);
+  public:
 
   // optional .opencv_caffe.LRNParameter.Engine engine = 6 [default = DEFAULT];
   bool has_engine() const;
+  private:
+  bool _internal_has_engine() const;
+  public:
   void clear_engine();
-  static const int kEngineFieldNumber = 6;
   ::opencv_caffe::LRNParameter_Engine engine() const;
   void set_engine(::opencv_caffe::LRNParameter_Engine value);
+  private:
+  ::opencv_caffe::LRNParameter_Engine _internal_engine() const;
+  void _internal_set_engine(::opencv_caffe::LRNParameter_Engine value);
+  public:
 
   // optional uint32 local_size = 1 [default = 5];
   bool has_local_size() const;
+  private:
+  bool _internal_has_local_size() const;
+  public:
   void clear_local_size();
-  static const int kLocalSizeFieldNumber = 1;
-  ::google::protobuf::uint32 local_size() const;
-  void set_local_size(::google::protobuf::uint32 value);
+  uint32_t local_size() const;
+  void set_local_size(uint32_t value);
+  private:
+  uint32_t _internal_local_size() const;
+  void _internal_set_local_size(uint32_t value);
+  public:
 
   // optional float alpha = 2 [default = 1];
   bool has_alpha() const;
+  private:
+  bool _internal_has_alpha() const;
+  public:
   void clear_alpha();
-  static const int kAlphaFieldNumber = 2;
   float alpha() const;
   void set_alpha(float value);
+  private:
+  float _internal_alpha() const;
+  void _internal_set_alpha(float value);
+  public:
 
   // optional float beta = 3 [default = 0.75];
   bool has_beta() const;
+  private:
+  bool _internal_has_beta() const;
+  public:
   void clear_beta();
-  static const int kBetaFieldNumber = 3;
   float beta() const;
   void set_beta(float value);
+  private:
+  float _internal_beta() const;
+  void _internal_set_beta(float value);
+  public:
 
   // optional float k = 5 [default = 1];
   bool has_k() const;
+  private:
+  bool _internal_has_k() const;
+  public:
   void clear_k();
-  static const int kKFieldNumber = 5;
   float k() const;
   void set_k(float value);
+  private:
+  float _internal_k() const;
+  void _internal_set_k(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.LRNParameter)
  private:
-  void set_has_local_size();
-  void clear_has_local_size();
-  void set_has_alpha();
-  void clear_has_alpha();
-  void set_has_beta();
-  void clear_has_beta();
-  void set_has_norm_region();
-  void clear_has_norm_region();
-  void set_has_k();
-  void clear_has_k();
-  void set_has_engine();
-  void clear_has_engine();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   int norm_region_;
   int engine_;
-  ::google::protobuf::uint32 local_size_;
+  uint32_t local_size_;
   float alpha_;
   float beta_;
   float k_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsLRNParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class MemoryDataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.MemoryDataParameter) */ {
+class MemoryDataParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.MemoryDataParameter) */ {
  public:
-  MemoryDataParameter();
-  virtual ~MemoryDataParameter();
+  inline MemoryDataParameter() : MemoryDataParameter(nullptr) {}
+  ~MemoryDataParameter() override;
+  explicit constexpr MemoryDataParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   MemoryDataParameter(const MemoryDataParameter& from);
-
-  inline MemoryDataParameter& operator=(const MemoryDataParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   MemoryDataParameter(MemoryDataParameter&& from) noexcept
     : MemoryDataParameter() {
     *this = ::std::move(from);
   }
 
+  inline MemoryDataParameter& operator=(const MemoryDataParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline MemoryDataParameter& operator=(MemoryDataParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const MemoryDataParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const MemoryDataParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const MemoryDataParameter* internal_default_instance() {
     return reinterpret_cast<const MemoryDataParameter*>(
                &_MemoryDataParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     45;
 
-  void Swap(MemoryDataParameter* other);
   friend void swap(MemoryDataParameter& a, MemoryDataParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(MemoryDataParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(MemoryDataParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline MemoryDataParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  MemoryDataParameter* 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;
+  MemoryDataParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<MemoryDataParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const MemoryDataParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const MemoryDataParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(MemoryDataParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.MemoryDataParameter";
   }
+  protected:
+  explicit MemoryDataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kBatchSizeFieldNumber = 1,
+    kChannelsFieldNumber = 2,
+    kHeightFieldNumber = 3,
+    kWidthFieldNumber = 4,
+  };
   // optional uint32 batch_size = 1;
   bool has_batch_size() const;
+  private:
+  bool _internal_has_batch_size() const;
+  public:
   void clear_batch_size();
-  static const int kBatchSizeFieldNumber = 1;
-  ::google::protobuf::uint32 batch_size() const;
-  void set_batch_size(::google::protobuf::uint32 value);
+  uint32_t batch_size() const;
+  void set_batch_size(uint32_t value);
+  private:
+  uint32_t _internal_batch_size() const;
+  void _internal_set_batch_size(uint32_t value);
+  public:
 
   // optional uint32 channels = 2;
   bool has_channels() const;
+  private:
+  bool _internal_has_channels() const;
+  public:
   void clear_channels();
-  static const int kChannelsFieldNumber = 2;
-  ::google::protobuf::uint32 channels() const;
-  void set_channels(::google::protobuf::uint32 value);
+  uint32_t channels() const;
+  void set_channels(uint32_t value);
+  private:
+  uint32_t _internal_channels() const;
+  void _internal_set_channels(uint32_t value);
+  public:
 
   // optional uint32 height = 3;
   bool has_height() const;
+  private:
+  bool _internal_has_height() const;
+  public:
   void clear_height();
-  static const int kHeightFieldNumber = 3;
-  ::google::protobuf::uint32 height() const;
-  void set_height(::google::protobuf::uint32 value);
+  uint32_t height() const;
+  void set_height(uint32_t value);
+  private:
+  uint32_t _internal_height() const;
+  void _internal_set_height(uint32_t value);
+  public:
 
   // optional uint32 width = 4;
   bool has_width() const;
+  private:
+  bool _internal_has_width() const;
+  public:
   void clear_width();
-  static const int kWidthFieldNumber = 4;
-  ::google::protobuf::uint32 width() const;
-  void set_width(::google::protobuf::uint32 value);
+  uint32_t width() const;
+  void set_width(uint32_t value);
+  private:
+  uint32_t _internal_width() const;
+  void _internal_set_width(uint32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.MemoryDataParameter)
  private:
-  void set_has_batch_size();
-  void clear_has_batch_size();
-  void set_has_channels();
-  void clear_has_channels();
-  void set_has_height();
-  void clear_has_height();
-  void set_has_width();
-  void clear_has_width();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::uint32 batch_size_;
-  ::google::protobuf::uint32 channels_;
-  ::google::protobuf::uint32 height_;
-  ::google::protobuf::uint32 width_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsMemoryDataParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  uint32_t batch_size_;
+  uint32_t channels_;
+  uint32_t height_;
+  uint32_t width_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class MVNParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.MVNParameter) */ {
+class MVNParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.MVNParameter) */ {
  public:
-  MVNParameter();
-  virtual ~MVNParameter();
+  inline MVNParameter() : MVNParameter(nullptr) {}
+  ~MVNParameter() override;
+  explicit constexpr MVNParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   MVNParameter(const MVNParameter& from);
-
-  inline MVNParameter& operator=(const MVNParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   MVNParameter(MVNParameter&& from) noexcept
     : MVNParameter() {
     *this = ::std::move(from);
   }
 
+  inline MVNParameter& operator=(const MVNParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline MVNParameter& operator=(MVNParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const MVNParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const MVNParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const MVNParameter* internal_default_instance() {
     return reinterpret_cast<const MVNParameter*>(
                &_MVNParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     46;
 
-  void Swap(MVNParameter* other);
   friend void swap(MVNParameter& a, MVNParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(MVNParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(MVNParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline MVNParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  MVNParameter* 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;
+  MVNParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<MVNParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const MVNParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const MVNParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(MVNParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.MVNParameter";
   }
+  protected:
+  explicit MVNParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kAcrossChannelsFieldNumber = 2,
+    kNormalizeVarianceFieldNumber = 1,
+    kEpsFieldNumber = 3,
+  };
   // optional bool across_channels = 2 [default = false];
   bool has_across_channels() const;
+  private:
+  bool _internal_has_across_channels() const;
+  public:
   void clear_across_channels();
-  static const int kAcrossChannelsFieldNumber = 2;
   bool across_channels() const;
   void set_across_channels(bool value);
+  private:
+  bool _internal_across_channels() const;
+  void _internal_set_across_channels(bool value);
+  public:
 
   // optional bool normalize_variance = 1 [default = true];
   bool has_normalize_variance() const;
+  private:
+  bool _internal_has_normalize_variance() const;
+  public:
   void clear_normalize_variance();
-  static const int kNormalizeVarianceFieldNumber = 1;
   bool normalize_variance() const;
   void set_normalize_variance(bool value);
+  private:
+  bool _internal_normalize_variance() const;
+  void _internal_set_normalize_variance(bool value);
+  public:
 
   // optional float eps = 3 [default = 1e-09];
   bool has_eps() const;
+  private:
+  bool _internal_has_eps() const;
+  public:
   void clear_eps();
-  static const int kEpsFieldNumber = 3;
   float eps() const;
   void set_eps(float value);
+  private:
+  float _internal_eps() const;
+  void _internal_set_eps(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.MVNParameter)
  private:
-  void set_has_normalize_variance();
-  void clear_has_normalize_variance();
-  void set_has_across_channels();
-  void clear_has_across_channels();
-  void set_has_eps();
-  void clear_has_eps();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   bool across_channels_;
   bool normalize_variance_;
   float eps_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsMVNParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ParameterParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ParameterParameter) */ {
+class ParameterParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ParameterParameter) */ {
  public:
-  ParameterParameter();
-  virtual ~ParameterParameter();
+  inline ParameterParameter() : ParameterParameter(nullptr) {}
+  ~ParameterParameter() override;
+  explicit constexpr ParameterParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ParameterParameter(const ParameterParameter& from);
-
-  inline ParameterParameter& operator=(const ParameterParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ParameterParameter(ParameterParameter&& from) noexcept
     : ParameterParameter() {
     *this = ::std::move(from);
   }
 
+  inline ParameterParameter& operator=(const ParameterParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ParameterParameter& operator=(ParameterParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ParameterParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ParameterParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ParameterParameter* internal_default_instance() {
     return reinterpret_cast<const ParameterParameter*>(
                &_ParameterParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     47;
 
-  void Swap(ParameterParameter* other);
   friend void swap(ParameterParameter& a, ParameterParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ParameterParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ParameterParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ParameterParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ParameterParameter* 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;
+  ParameterParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ParameterParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ParameterParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ParameterParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ParameterParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ParameterParameter";
   }
+  protected:
+  explicit ParameterParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kShapeFieldNumber = 1,
+  };
   // optional .opencv_caffe.BlobShape shape = 1;
   bool has_shape() const;
+  private:
+  bool _internal_has_shape() const;
+  public:
   void clear_shape();
-  static const int kShapeFieldNumber = 1;
   const ::opencv_caffe::BlobShape& shape() const;
-  ::opencv_caffe::BlobShape* release_shape();
+  PROTOBUF_NODISCARD ::opencv_caffe::BlobShape* release_shape();
   ::opencv_caffe::BlobShape* mutable_shape();
   void set_allocated_shape(::opencv_caffe::BlobShape* shape);
+  private:
+  const ::opencv_caffe::BlobShape& _internal_shape() const;
+  ::opencv_caffe::BlobShape* _internal_mutable_shape();
+  public:
+  void unsafe_arena_set_allocated_shape(
+      ::opencv_caffe::BlobShape* shape);
+  ::opencv_caffe::BlobShape* unsafe_arena_release_shape();
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ParameterParameter)
  private:
-  void set_has_shape();
-  void clear_has_shape();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::BlobShape* shape_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsParameterParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class PoolingParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PoolingParameter) */ {
+class PoolingParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PoolingParameter) */ {
  public:
-  PoolingParameter();
-  virtual ~PoolingParameter();
+  inline PoolingParameter() : PoolingParameter(nullptr) {}
+  ~PoolingParameter() override;
+  explicit constexpr PoolingParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   PoolingParameter(const PoolingParameter& from);
-
-  inline PoolingParameter& operator=(const PoolingParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   PoolingParameter(PoolingParameter&& from) noexcept
     : PoolingParameter() {
     *this = ::std::move(from);
   }
 
-  inline PoolingParameter& operator=(PoolingParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+  inline PoolingParameter& operator=(const PoolingParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  inline PoolingParameter& operator=(PoolingParameter&& from) noexcept {
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const PoolingParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const PoolingParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const PoolingParameter* internal_default_instance() {
     return reinterpret_cast<const PoolingParameter*>(
                &_PoolingParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     48;
 
-  void Swap(PoolingParameter* other);
   friend void swap(PoolingParameter& a, PoolingParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(PoolingParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(PoolingParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline PoolingParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  PoolingParameter* 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;
+  PoolingParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<PoolingParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const PoolingParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const PoolingParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(PoolingParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.PoolingParameter";
   }
+  protected:
+  explicit PoolingParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef PoolingParameter_PoolMethod PoolMethod;
-  static const PoolMethod MAX =
+  static constexpr PoolMethod MAX =
     PoolingParameter_PoolMethod_MAX;
-  static const PoolMethod AVE =
+  static constexpr PoolMethod AVE =
     PoolingParameter_PoolMethod_AVE;
-  static const PoolMethod STOCHASTIC =
+  static constexpr PoolMethod STOCHASTIC =
     PoolingParameter_PoolMethod_STOCHASTIC;
   static inline bool PoolMethod_IsValid(int value) {
     return PoolingParameter_PoolMethod_IsValid(value);
   }
-  static const PoolMethod PoolMethod_MIN =
+  static constexpr PoolMethod PoolMethod_MIN =
     PoolingParameter_PoolMethod_PoolMethod_MIN;
-  static const PoolMethod PoolMethod_MAX =
+  static constexpr PoolMethod PoolMethod_MAX =
     PoolingParameter_PoolMethod_PoolMethod_MAX;
-  static const int PoolMethod_ARRAYSIZE =
+  static constexpr int PoolMethod_ARRAYSIZE =
     PoolingParameter_PoolMethod_PoolMethod_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   PoolMethod_descriptor() {
     return PoolingParameter_PoolMethod_descriptor();
   }
-  static inline const ::std::string& PoolMethod_Name(PoolMethod value) {
-    return PoolingParameter_PoolMethod_Name(value);
+  template<typename T>
+  static inline const std::string& PoolMethod_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, PoolMethod>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function PoolMethod_Name.");
+    return PoolingParameter_PoolMethod_Name(enum_t_value);
   }
-  static inline bool PoolMethod_Parse(const ::std::string& name,
+  static inline bool PoolMethod_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       PoolMethod* value) {
     return PoolingParameter_PoolMethod_Parse(name, value);
   }
 
   typedef PoolingParameter_Engine Engine;
-  static const Engine DEFAULT =
+  static constexpr Engine DEFAULT =
     PoolingParameter_Engine_DEFAULT;
-  static const Engine CAFFE =
+  static constexpr Engine CAFFE =
     PoolingParameter_Engine_CAFFE;
-  static const Engine CUDNN =
+  static constexpr Engine CUDNN =
     PoolingParameter_Engine_CUDNN;
   static inline bool Engine_IsValid(int value) {
     return PoolingParameter_Engine_IsValid(value);
   }
-  static const Engine Engine_MIN =
+  static constexpr Engine Engine_MIN =
     PoolingParameter_Engine_Engine_MIN;
-  static const Engine Engine_MAX =
+  static constexpr Engine Engine_MAX =
     PoolingParameter_Engine_Engine_MAX;
-  static const int Engine_ARRAYSIZE =
+  static constexpr int Engine_ARRAYSIZE =
     PoolingParameter_Engine_Engine_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Engine_descriptor() {
     return PoolingParameter_Engine_descriptor();
   }
-  static inline const ::std::string& Engine_Name(Engine value) {
-    return PoolingParameter_Engine_Name(value);
+  template<typename T>
+  static inline const std::string& Engine_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Engine>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Engine_Name.");
+    return PoolingParameter_Engine_Name(enum_t_value);
   }
-  static inline bool Engine_Parse(const ::std::string& name,
+  static inline bool Engine_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Engine* value) {
     return PoolingParameter_Engine_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kPoolFieldNumber = 1,
+    kKernelSizeFieldNumber = 2,
+    kPadFieldNumber = 4,
+    kKernelHFieldNumber = 5,
+    kKernelWFieldNumber = 6,
+    kStrideHFieldNumber = 7,
+    kStrideWFieldNumber = 8,
+    kPadHFieldNumber = 9,
+    kPadWFieldNumber = 10,
+    kEngineFieldNumber = 11,
+    kGlobalPoolingFieldNumber = 12,
+    kStrideFieldNumber = 3,
+    kCeilModeFieldNumber = 13,
+  };
   // optional .opencv_caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX];
   bool has_pool() const;
+  private:
+  bool _internal_has_pool() const;
+  public:
   void clear_pool();
-  static const int kPoolFieldNumber = 1;
   ::opencv_caffe::PoolingParameter_PoolMethod pool() const;
   void set_pool(::opencv_caffe::PoolingParameter_PoolMethod value);
+  private:
+  ::opencv_caffe::PoolingParameter_PoolMethod _internal_pool() const;
+  void _internal_set_pool(::opencv_caffe::PoolingParameter_PoolMethod value);
+  public:
 
   // optional uint32 kernel_size = 2;
   bool has_kernel_size() const;
+  private:
+  bool _internal_has_kernel_size() const;
+  public:
   void clear_kernel_size();
-  static const int kKernelSizeFieldNumber = 2;
-  ::google::protobuf::uint32 kernel_size() const;
-  void set_kernel_size(::google::protobuf::uint32 value);
+  uint32_t kernel_size() const;
+  void set_kernel_size(uint32_t value);
+  private:
+  uint32_t _internal_kernel_size() const;
+  void _internal_set_kernel_size(uint32_t value);
+  public:
 
   // optional uint32 pad = 4 [default = 0];
   bool has_pad() const;
+  private:
+  bool _internal_has_pad() const;
+  public:
   void clear_pad();
-  static const int kPadFieldNumber = 4;
-  ::google::protobuf::uint32 pad() const;
-  void set_pad(::google::protobuf::uint32 value);
+  uint32_t pad() const;
+  void set_pad(uint32_t value);
+  private:
+  uint32_t _internal_pad() const;
+  void _internal_set_pad(uint32_t value);
+  public:
 
   // optional uint32 kernel_h = 5;
   bool has_kernel_h() const;
+  private:
+  bool _internal_has_kernel_h() const;
+  public:
   void clear_kernel_h();
-  static const int kKernelHFieldNumber = 5;
-  ::google::protobuf::uint32 kernel_h() const;
-  void set_kernel_h(::google::protobuf::uint32 value);
+  uint32_t kernel_h() const;
+  void set_kernel_h(uint32_t value);
+  private:
+  uint32_t _internal_kernel_h() const;
+  void _internal_set_kernel_h(uint32_t value);
+  public:
 
   // optional uint32 kernel_w = 6;
   bool has_kernel_w() const;
+  private:
+  bool _internal_has_kernel_w() const;
+  public:
   void clear_kernel_w();
-  static const int kKernelWFieldNumber = 6;
-  ::google::protobuf::uint32 kernel_w() const;
-  void set_kernel_w(::google::protobuf::uint32 value);
+  uint32_t kernel_w() const;
+  void set_kernel_w(uint32_t value);
+  private:
+  uint32_t _internal_kernel_w() const;
+  void _internal_set_kernel_w(uint32_t value);
+  public:
 
   // optional uint32 stride_h = 7;
   bool has_stride_h() const;
+  private:
+  bool _internal_has_stride_h() const;
+  public:
   void clear_stride_h();
-  static const int kStrideHFieldNumber = 7;
-  ::google::protobuf::uint32 stride_h() const;
-  void set_stride_h(::google::protobuf::uint32 value);
+  uint32_t stride_h() const;
+  void set_stride_h(uint32_t value);
+  private:
+  uint32_t _internal_stride_h() const;
+  void _internal_set_stride_h(uint32_t value);
+  public:
 
   // optional uint32 stride_w = 8;
   bool has_stride_w() const;
+  private:
+  bool _internal_has_stride_w() const;
+  public:
   void clear_stride_w();
-  static const int kStrideWFieldNumber = 8;
-  ::google::protobuf::uint32 stride_w() const;
-  void set_stride_w(::google::protobuf::uint32 value);
+  uint32_t stride_w() const;
+  void set_stride_w(uint32_t value);
+  private:
+  uint32_t _internal_stride_w() const;
+  void _internal_set_stride_w(uint32_t value);
+  public:
 
   // optional uint32 pad_h = 9 [default = 0];
   bool has_pad_h() const;
+  private:
+  bool _internal_has_pad_h() const;
+  public:
   void clear_pad_h();
-  static const int kPadHFieldNumber = 9;
-  ::google::protobuf::uint32 pad_h() const;
-  void set_pad_h(::google::protobuf::uint32 value);
+  uint32_t pad_h() const;
+  void set_pad_h(uint32_t value);
+  private:
+  uint32_t _internal_pad_h() const;
+  void _internal_set_pad_h(uint32_t value);
+  public:
 
   // optional uint32 pad_w = 10 [default = 0];
   bool has_pad_w() const;
+  private:
+  bool _internal_has_pad_w() const;
+  public:
   void clear_pad_w();
-  static const int kPadWFieldNumber = 10;
-  ::google::protobuf::uint32 pad_w() const;
-  void set_pad_w(::google::protobuf::uint32 value);
+  uint32_t pad_w() const;
+  void set_pad_w(uint32_t value);
+  private:
+  uint32_t _internal_pad_w() const;
+  void _internal_set_pad_w(uint32_t value);
+  public:
 
   // optional .opencv_caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT];
   bool has_engine() const;
+  private:
+  bool _internal_has_engine() const;
+  public:
   void clear_engine();
-  static const int kEngineFieldNumber = 11;
   ::opencv_caffe::PoolingParameter_Engine engine() const;
   void set_engine(::opencv_caffe::PoolingParameter_Engine value);
+  private:
+  ::opencv_caffe::PoolingParameter_Engine _internal_engine() const;
+  void _internal_set_engine(::opencv_caffe::PoolingParameter_Engine value);
+  public:
 
   // optional bool global_pooling = 12 [default = false];
   bool has_global_pooling() const;
+  private:
+  bool _internal_has_global_pooling() const;
+  public:
   void clear_global_pooling();
-  static const int kGlobalPoolingFieldNumber = 12;
   bool global_pooling() const;
   void set_global_pooling(bool value);
+  private:
+  bool _internal_global_pooling() const;
+  void _internal_set_global_pooling(bool value);
+  public:
 
   // optional uint32 stride = 3 [default = 1];
   bool has_stride() const;
+  private:
+  bool _internal_has_stride() const;
+  public:
   void clear_stride();
-  static const int kStrideFieldNumber = 3;
-  ::google::protobuf::uint32 stride() const;
-  void set_stride(::google::protobuf::uint32 value);
+  uint32_t stride() const;
+  void set_stride(uint32_t value);
+  private:
+  uint32_t _internal_stride() const;
+  void _internal_set_stride(uint32_t value);
+  public:
 
   // optional bool ceil_mode = 13 [default = true];
   bool has_ceil_mode() const;
+  private:
+  bool _internal_has_ceil_mode() const;
+  public:
   void clear_ceil_mode();
-  static const int kCeilModeFieldNumber = 13;
   bool ceil_mode() const;
   void set_ceil_mode(bool value);
+  private:
+  bool _internal_ceil_mode() const;
+  void _internal_set_ceil_mode(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.PoolingParameter)
  private:
-  void set_has_pool();
-  void clear_has_pool();
-  void set_has_pad();
-  void clear_has_pad();
-  void set_has_pad_h();
-  void clear_has_pad_h();
-  void set_has_pad_w();
-  void clear_has_pad_w();
-  void set_has_kernel_size();
-  void clear_has_kernel_size();
-  void set_has_kernel_h();
-  void clear_has_kernel_h();
-  void set_has_kernel_w();
-  void clear_has_kernel_w();
-  void set_has_stride();
-  void clear_has_stride();
-  void set_has_stride_h();
-  void clear_has_stride_h();
-  void set_has_stride_w();
-  void clear_has_stride_w();
-  void set_has_engine();
-  void clear_has_engine();
-  void set_has_global_pooling();
-  void clear_has_global_pooling();
-  void set_has_ceil_mode();
-  void clear_has_ceil_mode();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   int pool_;
-  ::google::protobuf::uint32 kernel_size_;
-  ::google::protobuf::uint32 pad_;
-  ::google::protobuf::uint32 kernel_h_;
-  ::google::protobuf::uint32 kernel_w_;
-  ::google::protobuf::uint32 stride_h_;
-  ::google::protobuf::uint32 stride_w_;
-  ::google::protobuf::uint32 pad_h_;
-  ::google::protobuf::uint32 pad_w_;
+  uint32_t kernel_size_;
+  uint32_t pad_;
+  uint32_t kernel_h_;
+  uint32_t kernel_w_;
+  uint32_t stride_h_;
+  uint32_t stride_w_;
+  uint32_t pad_h_;
+  uint32_t pad_w_;
   int engine_;
   bool global_pooling_;
-  ::google::protobuf::uint32 stride_;
+  uint32_t stride_;
   bool ceil_mode_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPoolingParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class PowerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PowerParameter) */ {
+class PowerParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PowerParameter) */ {
  public:
-  PowerParameter();
-  virtual ~PowerParameter();
+  inline PowerParameter() : PowerParameter(nullptr) {}
+  ~PowerParameter() override;
+  explicit constexpr PowerParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   PowerParameter(const PowerParameter& from);
-
-  inline PowerParameter& operator=(const PowerParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   PowerParameter(PowerParameter&& from) noexcept
     : PowerParameter() {
     *this = ::std::move(from);
   }
 
+  inline PowerParameter& operator=(const PowerParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline PowerParameter& operator=(PowerParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const PowerParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const PowerParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const PowerParameter* internal_default_instance() {
     return reinterpret_cast<const PowerParameter*>(
                &_PowerParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     49;
 
-  void Swap(PowerParameter* other);
   friend void swap(PowerParameter& a, PowerParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(PowerParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(PowerParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline PowerParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  PowerParameter* 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;
+  PowerParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<PowerParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const PowerParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const PowerParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(PowerParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.PowerParameter";
   }
+  protected:
+  explicit PowerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kShiftFieldNumber = 3,
+    kPowerFieldNumber = 1,
+    kScaleFieldNumber = 2,
+  };
   // optional float shift = 3 [default = 0];
   bool has_shift() const;
+  private:
+  bool _internal_has_shift() const;
+  public:
   void clear_shift();
-  static const int kShiftFieldNumber = 3;
   float shift() const;
   void set_shift(float value);
+  private:
+  float _internal_shift() const;
+  void _internal_set_shift(float value);
+  public:
 
   // optional float power = 1 [default = 1];
   bool has_power() const;
+  private:
+  bool _internal_has_power() const;
+  public:
   void clear_power();
-  static const int kPowerFieldNumber = 1;
   float power() const;
   void set_power(float value);
+  private:
+  float _internal_power() const;
+  void _internal_set_power(float value);
+  public:
 
   // optional float scale = 2 [default = 1];
   bool has_scale() const;
+  private:
+  bool _internal_has_scale() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 2;
   float scale() const;
   void set_scale(float value);
+  private:
+  float _internal_scale() const;
+  void _internal_set_scale(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.PowerParameter)
  private:
-  void set_has_power();
-  void clear_has_power();
-  void set_has_scale();
-  void clear_has_scale();
-  void set_has_shift();
-  void clear_has_shift();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float shift_;
   float power_;
   float scale_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPowerParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class PythonParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PythonParameter) */ {
+class PythonParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PythonParameter) */ {
  public:
-  PythonParameter();
-  virtual ~PythonParameter();
+  inline PythonParameter() : PythonParameter(nullptr) {}
+  ~PythonParameter() override;
+  explicit constexpr PythonParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   PythonParameter(const PythonParameter& from);
-
-  inline PythonParameter& operator=(const PythonParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   PythonParameter(PythonParameter&& from) noexcept
     : PythonParameter() {
     *this = ::std::move(from);
   }
 
+  inline PythonParameter& operator=(const PythonParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline PythonParameter& operator=(PythonParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const PythonParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const PythonParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const PythonParameter* internal_default_instance() {
     return reinterpret_cast<const PythonParameter*>(
                &_PythonParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     50;
 
-  void Swap(PythonParameter* other);
   friend void swap(PythonParameter& a, PythonParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(PythonParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(PythonParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline PythonParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  PythonParameter* 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;
+  PythonParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<PythonParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const PythonParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const PythonParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(PythonParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.PythonParameter";
   }
+  protected:
+  explicit PythonParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kModuleFieldNumber = 1,
+    kLayerFieldNumber = 2,
+    kParamStrFieldNumber = 3,
+    kShareInParallelFieldNumber = 4,
+  };
   // optional string module = 1;
   bool has_module() const;
+  private:
+  bool _internal_has_module() const;
+  public:
   void clear_module();
-  static const int kModuleFieldNumber = 1;
-  const ::std::string& module() const;
-  void set_module(const ::std::string& value);
-  #if LANG_CXX11
-  void set_module(::std::string&& value);
-  #endif
-  void set_module(const char* value);
-  void set_module(const char* value, size_t size);
-  ::std::string* mutable_module();
-  ::std::string* release_module();
-  void set_allocated_module(::std::string* module);
+  const std::string& module() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_module(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_module();
+  PROTOBUF_NODISCARD std::string* release_module();
+  void set_allocated_module(std::string* module);
+  private:
+  const std::string& _internal_module() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_module(const std::string& value);
+  std::string* _internal_mutable_module();
+  public:
 
   // optional string layer = 2;
   bool has_layer() const;
+  private:
+  bool _internal_has_layer() const;
+  public:
   void clear_layer();
-  static const int kLayerFieldNumber = 2;
-  const ::std::string& layer() const;
-  void set_layer(const ::std::string& value);
-  #if LANG_CXX11
-  void set_layer(::std::string&& value);
-  #endif
-  void set_layer(const char* value);
-  void set_layer(const char* value, size_t size);
-  ::std::string* mutable_layer();
-  ::std::string* release_layer();
-  void set_allocated_layer(::std::string* layer);
+  const std::string& layer() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_layer(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_layer();
+  PROTOBUF_NODISCARD std::string* release_layer();
+  void set_allocated_layer(std::string* layer);
+  private:
+  const std::string& _internal_layer() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_layer(const std::string& value);
+  std::string* _internal_mutable_layer();
+  public:
 
   // optional string param_str = 3 [default = ""];
   bool has_param_str() const;
+  private:
+  bool _internal_has_param_str() const;
+  public:
   void clear_param_str();
-  static const int kParamStrFieldNumber = 3;
-  const ::std::string& param_str() const;
-  void set_param_str(const ::std::string& value);
-  #if LANG_CXX11
-  void set_param_str(::std::string&& value);
-  #endif
-  void set_param_str(const char* value);
-  void set_param_str(const char* value, size_t size);
-  ::std::string* mutable_param_str();
-  ::std::string* release_param_str();
-  void set_allocated_param_str(::std::string* param_str);
+  const std::string& param_str() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_param_str(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_param_str();
+  PROTOBUF_NODISCARD std::string* release_param_str();
+  void set_allocated_param_str(std::string* param_str);
+  private:
+  const std::string& _internal_param_str() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_param_str(const std::string& value);
+  std::string* _internal_mutable_param_str();
+  public:
 
   // optional bool share_in_parallel = 4 [default = false];
   bool has_share_in_parallel() const;
+  private:
+  bool _internal_has_share_in_parallel() const;
+  public:
   void clear_share_in_parallel();
-  static const int kShareInParallelFieldNumber = 4;
   bool share_in_parallel() const;
   void set_share_in_parallel(bool value);
+  private:
+  bool _internal_share_in_parallel() const;
+  void _internal_set_share_in_parallel(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.PythonParameter)
  private:
-  void set_has_module();
-  void clear_has_module();
-  void set_has_layer();
-  void clear_has_layer();
-  void set_has_param_str();
-  void clear_has_param_str();
-  void set_has_share_in_parallel();
-  void clear_has_share_in_parallel();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr module_;
-  ::google::protobuf::internal::ArenaStringPtr layer_;
-  ::google::protobuf::internal::ArenaStringPtr param_str_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr module_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr layer_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr param_str_;
   bool share_in_parallel_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPythonParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class RecurrentParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.RecurrentParameter) */ {
+class RecurrentParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.RecurrentParameter) */ {
  public:
-  RecurrentParameter();
-  virtual ~RecurrentParameter();
+  inline RecurrentParameter() : RecurrentParameter(nullptr) {}
+  ~RecurrentParameter() override;
+  explicit constexpr RecurrentParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   RecurrentParameter(const RecurrentParameter& from);
-
-  inline RecurrentParameter& operator=(const RecurrentParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   RecurrentParameter(RecurrentParameter&& from) noexcept
     : RecurrentParameter() {
     *this = ::std::move(from);
   }
 
+  inline RecurrentParameter& operator=(const RecurrentParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline RecurrentParameter& operator=(RecurrentParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const RecurrentParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const RecurrentParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const RecurrentParameter* internal_default_instance() {
     return reinterpret_cast<const RecurrentParameter*>(
                &_RecurrentParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     51;
 
-  void Swap(RecurrentParameter* other);
   friend void swap(RecurrentParameter& a, RecurrentParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(RecurrentParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(RecurrentParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline RecurrentParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  RecurrentParameter* 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;
+  RecurrentParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<RecurrentParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const RecurrentParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const RecurrentParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(RecurrentParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.RecurrentParameter";
   }
+  protected:
+  explicit RecurrentParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kWeightFillerFieldNumber = 2,
+    kBiasFillerFieldNumber = 3,
+    kNumOutputFieldNumber = 1,
+    kDebugInfoFieldNumber = 4,
+    kExposeHiddenFieldNumber = 5,
+  };
   // optional .opencv_caffe.FillerParameter weight_filler = 2;
   bool has_weight_filler() const;
+  private:
+  bool _internal_has_weight_filler() const;
+  public:
   void clear_weight_filler();
-  static const int kWeightFillerFieldNumber = 2;
   const ::opencv_caffe::FillerParameter& weight_filler() const;
-  ::opencv_caffe::FillerParameter* release_weight_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_weight_filler();
   ::opencv_caffe::FillerParameter* mutable_weight_filler();
   void set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_weight_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_weight_filler();
+  public:
+  void unsafe_arena_set_allocated_weight_filler(
+      ::opencv_caffe::FillerParameter* weight_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_weight_filler();
 
   // optional .opencv_caffe.FillerParameter bias_filler = 3;
   bool has_bias_filler() const;
+  private:
+  bool _internal_has_bias_filler() const;
+  public:
   void clear_bias_filler();
-  static const int kBiasFillerFieldNumber = 3;
   const ::opencv_caffe::FillerParameter& bias_filler() const;
-  ::opencv_caffe::FillerParameter* release_bias_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_bias_filler();
   ::opencv_caffe::FillerParameter* mutable_bias_filler();
   void set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_bias_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_bias_filler();
+  public:
+  void unsafe_arena_set_allocated_bias_filler(
+      ::opencv_caffe::FillerParameter* bias_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_bias_filler();
 
   // optional uint32 num_output = 1 [default = 0];
   bool has_num_output() const;
+  private:
+  bool _internal_has_num_output() const;
+  public:
   void clear_num_output();
-  static const int kNumOutputFieldNumber = 1;
-  ::google::protobuf::uint32 num_output() const;
-  void set_num_output(::google::protobuf::uint32 value);
+  uint32_t num_output() const;
+  void set_num_output(uint32_t value);
+  private:
+  uint32_t _internal_num_output() const;
+  void _internal_set_num_output(uint32_t value);
+  public:
 
   // optional bool debug_info = 4 [default = false];
   bool has_debug_info() const;
+  private:
+  bool _internal_has_debug_info() const;
+  public:
   void clear_debug_info();
-  static const int kDebugInfoFieldNumber = 4;
   bool debug_info() const;
   void set_debug_info(bool value);
+  private:
+  bool _internal_debug_info() const;
+  void _internal_set_debug_info(bool value);
+  public:
 
   // optional bool expose_hidden = 5 [default = false];
   bool has_expose_hidden() const;
+  private:
+  bool _internal_has_expose_hidden() const;
+  public:
   void clear_expose_hidden();
-  static const int kExposeHiddenFieldNumber = 5;
   bool expose_hidden() const;
   void set_expose_hidden(bool value);
+  private:
+  bool _internal_expose_hidden() const;
+  void _internal_set_expose_hidden(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.RecurrentParameter)
  private:
-  void set_has_num_output();
-  void clear_has_num_output();
-  void set_has_weight_filler();
-  void clear_has_weight_filler();
-  void set_has_bias_filler();
-  void clear_has_bias_filler();
-  void set_has_debug_info();
-  void clear_has_debug_info();
-  void set_has_expose_hidden();
-  void clear_has_expose_hidden();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::FillerParameter* weight_filler_;
   ::opencv_caffe::FillerParameter* bias_filler_;
-  ::google::protobuf::uint32 num_output_;
+  uint32_t num_output_;
   bool debug_info_;
   bool expose_hidden_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsRecurrentParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ReductionParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ReductionParameter) */ {
+class ReductionParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ReductionParameter) */ {
  public:
-  ReductionParameter();
-  virtual ~ReductionParameter();
+  inline ReductionParameter() : ReductionParameter(nullptr) {}
+  ~ReductionParameter() override;
+  explicit constexpr ReductionParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ReductionParameter(const ReductionParameter& from);
-
-  inline ReductionParameter& operator=(const ReductionParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ReductionParameter(ReductionParameter&& from) noexcept
     : ReductionParameter() {
     *this = ::std::move(from);
   }
 
+  inline ReductionParameter& operator=(const ReductionParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ReductionParameter& operator=(ReductionParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ReductionParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ReductionParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ReductionParameter* internal_default_instance() {
     return reinterpret_cast<const ReductionParameter*>(
                &_ReductionParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     52;
 
-  void Swap(ReductionParameter* other);
   friend void swap(ReductionParameter& a, ReductionParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ReductionParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ReductionParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ReductionParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ReductionParameter* 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;
+  ReductionParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ReductionParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ReductionParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ReductionParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ReductionParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ReductionParameter";
   }
+  protected:
+  explicit ReductionParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef ReductionParameter_ReductionOp ReductionOp;
-  static const ReductionOp SUM =
+  static constexpr ReductionOp SUM =
     ReductionParameter_ReductionOp_SUM;
-  static const ReductionOp ASUM =
+  static constexpr ReductionOp ASUM =
     ReductionParameter_ReductionOp_ASUM;
-  static const ReductionOp SUMSQ =
+  static constexpr ReductionOp SUMSQ =
     ReductionParameter_ReductionOp_SUMSQ;
-  static const ReductionOp MEAN =
+  static constexpr ReductionOp MEAN =
     ReductionParameter_ReductionOp_MEAN;
   static inline bool ReductionOp_IsValid(int value) {
     return ReductionParameter_ReductionOp_IsValid(value);
   }
-  static const ReductionOp ReductionOp_MIN =
+  static constexpr ReductionOp ReductionOp_MIN =
     ReductionParameter_ReductionOp_ReductionOp_MIN;
-  static const ReductionOp ReductionOp_MAX =
+  static constexpr ReductionOp ReductionOp_MAX =
     ReductionParameter_ReductionOp_ReductionOp_MAX;
-  static const int ReductionOp_ARRAYSIZE =
+  static constexpr int ReductionOp_ARRAYSIZE =
     ReductionParameter_ReductionOp_ReductionOp_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   ReductionOp_descriptor() {
     return ReductionParameter_ReductionOp_descriptor();
   }
-  static inline const ::std::string& ReductionOp_Name(ReductionOp value) {
-    return ReductionParameter_ReductionOp_Name(value);
+  template<typename T>
+  static inline const std::string& ReductionOp_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, ReductionOp>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function ReductionOp_Name.");
+    return ReductionParameter_ReductionOp_Name(enum_t_value);
   }
-  static inline bool ReductionOp_Parse(const ::std::string& name,
+  static inline bool ReductionOp_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       ReductionOp* value) {
     return ReductionParameter_ReductionOp_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kAxisFieldNumber = 2,
+    kOperationFieldNumber = 1,
+    kCoeffFieldNumber = 3,
+  };
   // optional int32 axis = 2 [default = 0];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 2;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // optional .opencv_caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM];
   bool has_operation() const;
+  private:
+  bool _internal_has_operation() const;
+  public:
   void clear_operation();
-  static const int kOperationFieldNumber = 1;
   ::opencv_caffe::ReductionParameter_ReductionOp operation() const;
   void set_operation(::opencv_caffe::ReductionParameter_ReductionOp value);
+  private:
+  ::opencv_caffe::ReductionParameter_ReductionOp _internal_operation() const;
+  void _internal_set_operation(::opencv_caffe::ReductionParameter_ReductionOp value);
+  public:
 
   // optional float coeff = 3 [default = 1];
   bool has_coeff() const;
+  private:
+  bool _internal_has_coeff() const;
+  public:
   void clear_coeff();
-  static const int kCoeffFieldNumber = 3;
   float coeff() const;
   void set_coeff(float value);
+  private:
+  float _internal_coeff() const;
+  void _internal_set_coeff(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ReductionParameter)
  private:
-  void set_has_operation();
-  void clear_has_operation();
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_coeff();
-  void clear_has_coeff();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::int32 axis_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int32_t axis_;
   int operation_;
   float coeff_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReductionParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ReLUParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ReLUParameter) */ {
+class ReLUParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ReLUParameter) */ {
  public:
-  ReLUParameter();
-  virtual ~ReLUParameter();
+  inline ReLUParameter() : ReLUParameter(nullptr) {}
+  ~ReLUParameter() override;
+  explicit constexpr ReLUParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ReLUParameter(const ReLUParameter& from);
-
-  inline ReLUParameter& operator=(const ReLUParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ReLUParameter(ReLUParameter&& from) noexcept
     : ReLUParameter() {
     *this = ::std::move(from);
   }
 
+  inline ReLUParameter& operator=(const ReLUParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ReLUParameter& operator=(ReLUParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ReLUParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ReLUParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ReLUParameter* internal_default_instance() {
     return reinterpret_cast<const ReLUParameter*>(
                &_ReLUParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     53;
 
-  void Swap(ReLUParameter* other);
   friend void swap(ReLUParameter& a, ReLUParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ReLUParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ReLUParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ReLUParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ReLUParameter* 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;
+  ReLUParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ReLUParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ReLUParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ReLUParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ReLUParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ReLUParameter";
   }
+  protected:
+  explicit ReLUParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef ReLUParameter_Engine Engine;
-  static const Engine DEFAULT =
+  static constexpr Engine DEFAULT =
     ReLUParameter_Engine_DEFAULT;
-  static const Engine CAFFE =
+  static constexpr Engine CAFFE =
     ReLUParameter_Engine_CAFFE;
-  static const Engine CUDNN =
+  static constexpr Engine CUDNN =
     ReLUParameter_Engine_CUDNN;
   static inline bool Engine_IsValid(int value) {
     return ReLUParameter_Engine_IsValid(value);
   }
-  static const Engine Engine_MIN =
+  static constexpr Engine Engine_MIN =
     ReLUParameter_Engine_Engine_MIN;
-  static const Engine Engine_MAX =
+  static constexpr Engine Engine_MAX =
     ReLUParameter_Engine_Engine_MAX;
-  static const int Engine_ARRAYSIZE =
+  static constexpr int Engine_ARRAYSIZE =
     ReLUParameter_Engine_Engine_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Engine_descriptor() {
     return ReLUParameter_Engine_descriptor();
   }
-  static inline const ::std::string& Engine_Name(Engine value) {
-    return ReLUParameter_Engine_Name(value);
+  template<typename T>
+  static inline const std::string& Engine_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Engine>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Engine_Name.");
+    return ReLUParameter_Engine_Name(enum_t_value);
   }
-  static inline bool Engine_Parse(const ::std::string& name,
+  static inline bool Engine_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Engine* value) {
     return ReLUParameter_Engine_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNegativeSlopeFieldNumber = 1,
+    kEngineFieldNumber = 2,
+  };
   // optional float negative_slope = 1 [default = 0];
   bool has_negative_slope() const;
+  private:
+  bool _internal_has_negative_slope() const;
+  public:
   void clear_negative_slope();
-  static const int kNegativeSlopeFieldNumber = 1;
   float negative_slope() const;
   void set_negative_slope(float value);
+  private:
+  float _internal_negative_slope() const;
+  void _internal_set_negative_slope(float value);
+  public:
 
   // optional .opencv_caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT];
   bool has_engine() const;
+  private:
+  bool _internal_has_engine() const;
+  public:
   void clear_engine();
-  static const int kEngineFieldNumber = 2;
   ::opencv_caffe::ReLUParameter_Engine engine() const;
   void set_engine(::opencv_caffe::ReLUParameter_Engine value);
+  private:
+  ::opencv_caffe::ReLUParameter_Engine _internal_engine() const;
+  void _internal_set_engine(::opencv_caffe::ReLUParameter_Engine value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ReLUParameter)
  private:
-  void set_has_negative_slope();
-  void clear_has_negative_slope();
-  void set_has_engine();
-  void clear_has_engine();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float negative_slope_;
   int engine_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReLUParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ReshapeParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ReshapeParameter) */ {
+class ReshapeParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ReshapeParameter) */ {
  public:
-  ReshapeParameter();
-  virtual ~ReshapeParameter();
+  inline ReshapeParameter() : ReshapeParameter(nullptr) {}
+  ~ReshapeParameter() override;
+  explicit constexpr ReshapeParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ReshapeParameter(const ReshapeParameter& from);
-
-  inline ReshapeParameter& operator=(const ReshapeParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ReshapeParameter(ReshapeParameter&& from) noexcept
     : ReshapeParameter() {
     *this = ::std::move(from);
   }
 
+  inline ReshapeParameter& operator=(const ReshapeParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ReshapeParameter& operator=(ReshapeParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ReshapeParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ReshapeParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ReshapeParameter* internal_default_instance() {
     return reinterpret_cast<const ReshapeParameter*>(
                &_ReshapeParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     54;
 
-  void Swap(ReshapeParameter* other);
   friend void swap(ReshapeParameter& a, ReshapeParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ReshapeParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ReshapeParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ReshapeParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ReshapeParameter* 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;
+  ReshapeParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ReshapeParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ReshapeParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ReshapeParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ReshapeParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ReshapeParameter";
   }
+  protected:
+  explicit ReshapeParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kShapeFieldNumber = 1,
+    kAxisFieldNumber = 2,
+    kNumAxesFieldNumber = 3,
+  };
   // optional .opencv_caffe.BlobShape shape = 1;
   bool has_shape() const;
+  private:
+  bool _internal_has_shape() const;
+  public:
   void clear_shape();
-  static const int kShapeFieldNumber = 1;
   const ::opencv_caffe::BlobShape& shape() const;
-  ::opencv_caffe::BlobShape* release_shape();
+  PROTOBUF_NODISCARD ::opencv_caffe::BlobShape* release_shape();
   ::opencv_caffe::BlobShape* mutable_shape();
   void set_allocated_shape(::opencv_caffe::BlobShape* shape);
+  private:
+  const ::opencv_caffe::BlobShape& _internal_shape() const;
+  ::opencv_caffe::BlobShape* _internal_mutable_shape();
+  public:
+  void unsafe_arena_set_allocated_shape(
+      ::opencv_caffe::BlobShape* shape);
+  ::opencv_caffe::BlobShape* unsafe_arena_release_shape();
 
   // optional int32 axis = 2 [default = 0];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 2;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // optional int32 num_axes = 3 [default = -1];
   bool has_num_axes() const;
+  private:
+  bool _internal_has_num_axes() const;
+  public:
   void clear_num_axes();
-  static const int kNumAxesFieldNumber = 3;
-  ::google::protobuf::int32 num_axes() const;
-  void set_num_axes(::google::protobuf::int32 value);
+  int32_t num_axes() const;
+  void set_num_axes(int32_t value);
+  private:
+  int32_t _internal_num_axes() const;
+  void _internal_set_num_axes(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ReshapeParameter)
  private:
-  void set_has_shape();
-  void clear_has_shape();
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_num_axes();
-  void clear_has_num_axes();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::BlobShape* shape_;
-  ::google::protobuf::int32 axis_;
-  ::google::protobuf::int32 num_axes_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsReshapeParameterImpl();
+  int32_t axis_;
+  int32_t num_axes_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ScaleParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ScaleParameter) */ {
+class ScaleParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ScaleParameter) */ {
  public:
-  ScaleParameter();
-  virtual ~ScaleParameter();
+  inline ScaleParameter() : ScaleParameter(nullptr) {}
+  ~ScaleParameter() override;
+  explicit constexpr ScaleParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ScaleParameter(const ScaleParameter& from);
-
-  inline ScaleParameter& operator=(const ScaleParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ScaleParameter(ScaleParameter&& from) noexcept
     : ScaleParameter() {
     *this = ::std::move(from);
   }
 
+  inline ScaleParameter& operator=(const ScaleParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ScaleParameter& operator=(ScaleParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ScaleParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ScaleParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ScaleParameter* internal_default_instance() {
     return reinterpret_cast<const ScaleParameter*>(
                &_ScaleParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     55;
 
-  void Swap(ScaleParameter* other);
   friend void swap(ScaleParameter& a, ScaleParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ScaleParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ScaleParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ScaleParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ScaleParameter* 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;
+  ScaleParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ScaleParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ScaleParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ScaleParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ScaleParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ScaleParameter";
   }
+  protected:
+  explicit ScaleParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFillerFieldNumber = 3,
+    kBiasFillerFieldNumber = 5,
+    kBiasTermFieldNumber = 4,
+    kAxisFieldNumber = 1,
+    kNumAxesFieldNumber = 2,
+  };
   // optional .opencv_caffe.FillerParameter filler = 3;
   bool has_filler() const;
+  private:
+  bool _internal_has_filler() const;
+  public:
   void clear_filler();
-  static const int kFillerFieldNumber = 3;
   const ::opencv_caffe::FillerParameter& filler() const;
-  ::opencv_caffe::FillerParameter* release_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_filler();
   ::opencv_caffe::FillerParameter* mutable_filler();
   void set_allocated_filler(::opencv_caffe::FillerParameter* filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_filler();
+  public:
+  void unsafe_arena_set_allocated_filler(
+      ::opencv_caffe::FillerParameter* filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_filler();
 
   // optional .opencv_caffe.FillerParameter bias_filler = 5;
   bool has_bias_filler() const;
+  private:
+  bool _internal_has_bias_filler() const;
+  public:
   void clear_bias_filler();
-  static const int kBiasFillerFieldNumber = 5;
   const ::opencv_caffe::FillerParameter& bias_filler() const;
-  ::opencv_caffe::FillerParameter* release_bias_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_bias_filler();
   ::opencv_caffe::FillerParameter* mutable_bias_filler();
   void set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_bias_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_bias_filler();
+  public:
+  void unsafe_arena_set_allocated_bias_filler(
+      ::opencv_caffe::FillerParameter* bias_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_bias_filler();
 
   // optional bool bias_term = 4 [default = false];
   bool has_bias_term() const;
+  private:
+  bool _internal_has_bias_term() const;
+  public:
   void clear_bias_term();
-  static const int kBiasTermFieldNumber = 4;
   bool bias_term() const;
   void set_bias_term(bool value);
+  private:
+  bool _internal_bias_term() const;
+  void _internal_set_bias_term(bool value);
+  public:
 
   // optional int32 axis = 1 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 1;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // optional int32 num_axes = 2 [default = 1];
   bool has_num_axes() const;
+  private:
+  bool _internal_has_num_axes() const;
+  public:
   void clear_num_axes();
-  static const int kNumAxesFieldNumber = 2;
-  ::google::protobuf::int32 num_axes() const;
-  void set_num_axes(::google::protobuf::int32 value);
+  int32_t num_axes() const;
+  void set_num_axes(int32_t value);
+  private:
+  int32_t _internal_num_axes() const;
+  void _internal_set_num_axes(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ScaleParameter)
  private:
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_num_axes();
-  void clear_has_num_axes();
-  void set_has_filler();
-  void clear_has_filler();
-  void set_has_bias_term();
-  void clear_has_bias_term();
-  void set_has_bias_filler();
-  void clear_has_bias_filler();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::FillerParameter* filler_;
   ::opencv_caffe::FillerParameter* bias_filler_;
   bool bias_term_;
-  ::google::protobuf::int32 axis_;
-  ::google::protobuf::int32 num_axes_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsScaleParameterImpl();
+  int32_t axis_;
+  int32_t num_axes_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class SigmoidParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SigmoidParameter) */ {
+class SigmoidParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SigmoidParameter) */ {
  public:
-  SigmoidParameter();
-  virtual ~SigmoidParameter();
+  inline SigmoidParameter() : SigmoidParameter(nullptr) {}
+  ~SigmoidParameter() override;
+  explicit constexpr SigmoidParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SigmoidParameter(const SigmoidParameter& from);
-
-  inline SigmoidParameter& operator=(const SigmoidParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SigmoidParameter(SigmoidParameter&& from) noexcept
     : SigmoidParameter() {
     *this = ::std::move(from);
   }
 
+  inline SigmoidParameter& operator=(const SigmoidParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SigmoidParameter& operator=(SigmoidParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const SigmoidParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SigmoidParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SigmoidParameter* internal_default_instance() {
     return reinterpret_cast<const SigmoidParameter*>(
                &_SigmoidParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     56;
 
-  void Swap(SigmoidParameter* other);
   friend void swap(SigmoidParameter& a, SigmoidParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(SigmoidParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SigmoidParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SigmoidParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SigmoidParameter* 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;
+  SigmoidParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SigmoidParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SigmoidParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SigmoidParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SigmoidParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.SigmoidParameter";
   }
+  protected:
+  explicit SigmoidParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef SigmoidParameter_Engine Engine;
-  static const Engine DEFAULT =
+  static constexpr Engine DEFAULT =
     SigmoidParameter_Engine_DEFAULT;
-  static const Engine CAFFE =
+  static constexpr Engine CAFFE =
     SigmoidParameter_Engine_CAFFE;
-  static const Engine CUDNN =
+  static constexpr Engine CUDNN =
     SigmoidParameter_Engine_CUDNN;
   static inline bool Engine_IsValid(int value) {
     return SigmoidParameter_Engine_IsValid(value);
   }
-  static const Engine Engine_MIN =
+  static constexpr Engine Engine_MIN =
     SigmoidParameter_Engine_Engine_MIN;
-  static const Engine Engine_MAX =
+  static constexpr Engine Engine_MAX =
     SigmoidParameter_Engine_Engine_MAX;
-  static const int Engine_ARRAYSIZE =
+  static constexpr int Engine_ARRAYSIZE =
     SigmoidParameter_Engine_Engine_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Engine_descriptor() {
     return SigmoidParameter_Engine_descriptor();
   }
-  static inline const ::std::string& Engine_Name(Engine value) {
-    return SigmoidParameter_Engine_Name(value);
+  template<typename T>
+  static inline const std::string& Engine_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Engine>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Engine_Name.");
+    return SigmoidParameter_Engine_Name(enum_t_value);
   }
-  static inline bool Engine_Parse(const ::std::string& name,
+  static inline bool Engine_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Engine* value) {
     return SigmoidParameter_Engine_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kEngineFieldNumber = 1,
+  };
   // optional .opencv_caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT];
   bool has_engine() const;
+  private:
+  bool _internal_has_engine() const;
+  public:
   void clear_engine();
-  static const int kEngineFieldNumber = 1;
   ::opencv_caffe::SigmoidParameter_Engine engine() const;
   void set_engine(::opencv_caffe::SigmoidParameter_Engine value);
+  private:
+  ::opencv_caffe::SigmoidParameter_Engine _internal_engine() const;
+  void _internal_set_engine(::opencv_caffe::SigmoidParameter_Engine value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.SigmoidParameter)
  private:
-  void set_has_engine();
-  void clear_has_engine();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   int engine_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSigmoidParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class SliceParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SliceParameter) */ {
+class SliceParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SliceParameter) */ {
  public:
-  SliceParameter();
-  virtual ~SliceParameter();
+  inline SliceParameter() : SliceParameter(nullptr) {}
+  ~SliceParameter() override;
+  explicit constexpr SliceParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SliceParameter(const SliceParameter& from);
-
-  inline SliceParameter& operator=(const SliceParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SliceParameter(SliceParameter&& from) noexcept
     : SliceParameter() {
     *this = ::std::move(from);
   }
 
+  inline SliceParameter& operator=(const SliceParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SliceParameter& operator=(SliceParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const SliceParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SliceParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SliceParameter* internal_default_instance() {
     return reinterpret_cast<const SliceParameter*>(
                &_SliceParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     57;
 
-  void Swap(SliceParameter* other);
   friend void swap(SliceParameter& a, SliceParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(SliceParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SliceParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SliceParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SliceParameter* 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;
+  SliceParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SliceParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SliceParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SliceParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SliceParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.SliceParameter";
   }
+  protected:
+  explicit SliceParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSlicePointFieldNumber = 2,
+    kSliceDimFieldNumber = 1,
+    kAxisFieldNumber = 3,
+  };
   // repeated uint32 slice_point = 2;
   int slice_point_size() const;
+  private:
+  int _internal_slice_point_size() const;
+  public:
   void clear_slice_point();
-  static const int kSlicePointFieldNumber = 2;
-  ::google::protobuf::uint32 slice_point(int index) const;
-  void set_slice_point(int index, ::google::protobuf::uint32 value);
-  void add_slice_point(::google::protobuf::uint32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+  private:
+  uint32_t _internal_slice_point(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+      _internal_slice_point() const;
+  void _internal_add_slice_point(uint32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+      _internal_mutable_slice_point();
+  public:
+  uint32_t slice_point(int index) const;
+  void set_slice_point(int index, uint32_t value);
+  void add_slice_point(uint32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
       slice_point() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
       mutable_slice_point();
 
   // optional uint32 slice_dim = 1 [default = 1];
   bool has_slice_dim() const;
+  private:
+  bool _internal_has_slice_dim() const;
+  public:
   void clear_slice_dim();
-  static const int kSliceDimFieldNumber = 1;
-  ::google::protobuf::uint32 slice_dim() const;
-  void set_slice_dim(::google::protobuf::uint32 value);
+  uint32_t slice_dim() const;
+  void set_slice_dim(uint32_t value);
+  private:
+  uint32_t _internal_slice_dim() const;
+  void _internal_set_slice_dim(uint32_t value);
+  public:
 
   // optional int32 axis = 3 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 3;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.SliceParameter)
  private:
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_slice_dim();
-  void clear_has_slice_dim();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > slice_point_;
-  ::google::protobuf::uint32 slice_dim_;
-  ::google::protobuf::int32 axis_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSliceParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t > slice_point_;
+  uint32_t slice_dim_;
+  int32_t axis_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class SoftmaxParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SoftmaxParameter) */ {
+class SoftmaxParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SoftmaxParameter) */ {
  public:
-  SoftmaxParameter();
-  virtual ~SoftmaxParameter();
+  inline SoftmaxParameter() : SoftmaxParameter(nullptr) {}
+  ~SoftmaxParameter() override;
+  explicit constexpr SoftmaxParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SoftmaxParameter(const SoftmaxParameter& from);
-
-  inline SoftmaxParameter& operator=(const SoftmaxParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SoftmaxParameter(SoftmaxParameter&& from) noexcept
     : SoftmaxParameter() {
     *this = ::std::move(from);
   }
 
+  inline SoftmaxParameter& operator=(const SoftmaxParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SoftmaxParameter& operator=(SoftmaxParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const SoftmaxParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SoftmaxParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SoftmaxParameter* internal_default_instance() {
     return reinterpret_cast<const SoftmaxParameter*>(
                &_SoftmaxParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     58;
 
-  void Swap(SoftmaxParameter* other);
   friend void swap(SoftmaxParameter& a, SoftmaxParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(SoftmaxParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SoftmaxParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SoftmaxParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SoftmaxParameter* 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;
+  SoftmaxParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SoftmaxParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SoftmaxParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SoftmaxParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SoftmaxParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.SoftmaxParameter";
   }
+  protected:
+  explicit SoftmaxParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef SoftmaxParameter_Engine Engine;
-  static const Engine DEFAULT =
+  static constexpr Engine DEFAULT =
     SoftmaxParameter_Engine_DEFAULT;
-  static const Engine CAFFE =
+  static constexpr Engine CAFFE =
     SoftmaxParameter_Engine_CAFFE;
-  static const Engine CUDNN =
+  static constexpr Engine CUDNN =
     SoftmaxParameter_Engine_CUDNN;
   static inline bool Engine_IsValid(int value) {
     return SoftmaxParameter_Engine_IsValid(value);
   }
-  static const Engine Engine_MIN =
+  static constexpr Engine Engine_MIN =
     SoftmaxParameter_Engine_Engine_MIN;
-  static const Engine Engine_MAX =
+  static constexpr Engine Engine_MAX =
     SoftmaxParameter_Engine_Engine_MAX;
-  static const int Engine_ARRAYSIZE =
+  static constexpr int Engine_ARRAYSIZE =
     SoftmaxParameter_Engine_Engine_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Engine_descriptor() {
     return SoftmaxParameter_Engine_descriptor();
   }
-  static inline const ::std::string& Engine_Name(Engine value) {
-    return SoftmaxParameter_Engine_Name(value);
+  template<typename T>
+  static inline const std::string& Engine_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Engine>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Engine_Name.");
+    return SoftmaxParameter_Engine_Name(enum_t_value);
   }
-  static inline bool Engine_Parse(const ::std::string& name,
+  static inline bool Engine_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Engine* value) {
     return SoftmaxParameter_Engine_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kEngineFieldNumber = 1,
+    kAxisFieldNumber = 2,
+  };
   // optional .opencv_caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT];
   bool has_engine() const;
+  private:
+  bool _internal_has_engine() const;
+  public:
   void clear_engine();
-  static const int kEngineFieldNumber = 1;
   ::opencv_caffe::SoftmaxParameter_Engine engine() const;
   void set_engine(::opencv_caffe::SoftmaxParameter_Engine value);
+  private:
+  ::opencv_caffe::SoftmaxParameter_Engine _internal_engine() const;
+  void _internal_set_engine(::opencv_caffe::SoftmaxParameter_Engine value);
+  public:
 
   // optional int32 axis = 2 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 2;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.SoftmaxParameter)
  private:
-  void set_has_engine();
-  void clear_has_engine();
-  void set_has_axis();
-  void clear_has_axis();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   int engine_;
-  ::google::protobuf::int32 axis_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSoftmaxParameterImpl();
+  int32_t axis_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TanHParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.TanHParameter) */ {
+class TanHParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.TanHParameter) */ {
  public:
-  TanHParameter();
-  virtual ~TanHParameter();
+  inline TanHParameter() : TanHParameter(nullptr) {}
+  ~TanHParameter() override;
+  explicit constexpr TanHParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TanHParameter(const TanHParameter& from);
-
-  inline TanHParameter& operator=(const TanHParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TanHParameter(TanHParameter&& from) noexcept
     : TanHParameter() {
     *this = ::std::move(from);
   }
 
+  inline TanHParameter& operator=(const TanHParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TanHParameter& operator=(TanHParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TanHParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const TanHParameter* internal_default_instance() {
-    return reinterpret_cast<const TanHParameter*>(
-               &_TanHParameter_default_instance_);
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TanHParameter& default_instance() {
+    return *internal_default_instance();
+  }
+  static inline const TanHParameter* internal_default_instance() {
+    return reinterpret_cast<const TanHParameter*>(
+               &_TanHParameter_default_instance_);
+  }
+  static constexpr int kIndexInFileMessages =
     59;
 
-  void Swap(TanHParameter* other);
   friend void swap(TanHParameter& a, TanHParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(TanHParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TanHParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TanHParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TanHParameter* 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;
+  TanHParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TanHParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TanHParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TanHParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TanHParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.TanHParameter";
   }
+  protected:
+  explicit TanHParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef TanHParameter_Engine Engine;
-  static const Engine DEFAULT =
+  static constexpr Engine DEFAULT =
     TanHParameter_Engine_DEFAULT;
-  static const Engine CAFFE =
+  static constexpr Engine CAFFE =
     TanHParameter_Engine_CAFFE;
-  static const Engine CUDNN =
+  static constexpr Engine CUDNN =
     TanHParameter_Engine_CUDNN;
   static inline bool Engine_IsValid(int value) {
     return TanHParameter_Engine_IsValid(value);
   }
-  static const Engine Engine_MIN =
+  static constexpr Engine Engine_MIN =
     TanHParameter_Engine_Engine_MIN;
-  static const Engine Engine_MAX =
+  static constexpr Engine Engine_MAX =
     TanHParameter_Engine_Engine_MAX;
-  static const int Engine_ARRAYSIZE =
+  static constexpr int Engine_ARRAYSIZE =
     TanHParameter_Engine_Engine_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Engine_descriptor() {
     return TanHParameter_Engine_descriptor();
   }
-  static inline const ::std::string& Engine_Name(Engine value) {
-    return TanHParameter_Engine_Name(value);
+  template<typename T>
+  static inline const std::string& Engine_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Engine>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Engine_Name.");
+    return TanHParameter_Engine_Name(enum_t_value);
   }
-  static inline bool Engine_Parse(const ::std::string& name,
+  static inline bool Engine_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Engine* value) {
     return TanHParameter_Engine_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kEngineFieldNumber = 1,
+  };
   // optional .opencv_caffe.TanHParameter.Engine engine = 1 [default = DEFAULT];
   bool has_engine() const;
+  private:
+  bool _internal_has_engine() const;
+  public:
   void clear_engine();
-  static const int kEngineFieldNumber = 1;
   ::opencv_caffe::TanHParameter_Engine engine() const;
   void set_engine(::opencv_caffe::TanHParameter_Engine value);
+  private:
+  ::opencv_caffe::TanHParameter_Engine _internal_engine() const;
+  void _internal_set_engine(::opencv_caffe::TanHParameter_Engine value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.TanHParameter)
  private:
-  void set_has_engine();
-  void clear_has_engine();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   int engine_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTanHParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TileParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.TileParameter) */ {
+class TileParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.TileParameter) */ {
  public:
-  TileParameter();
-  virtual ~TileParameter();
+  inline TileParameter() : TileParameter(nullptr) {}
+  ~TileParameter() override;
+  explicit constexpr TileParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TileParameter(const TileParameter& from);
-
-  inline TileParameter& operator=(const TileParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TileParameter(TileParameter&& from) noexcept
     : TileParameter() {
     *this = ::std::move(from);
   }
 
+  inline TileParameter& operator=(const TileParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TileParameter& operator=(TileParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TileParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TileParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const TileParameter* internal_default_instance() {
     return reinterpret_cast<const TileParameter*>(
                &_TileParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     60;
 
-  void Swap(TileParameter* other);
   friend void swap(TileParameter& a, TileParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(TileParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TileParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TileParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TileParameter* 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;
+  TileParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TileParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TileParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TileParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TileParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.TileParameter";
   }
+  protected:
+  explicit TileParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kTilesFieldNumber = 2,
+    kAxisFieldNumber = 1,
+  };
   // optional int32 tiles = 2;
   bool has_tiles() const;
+  private:
+  bool _internal_has_tiles() const;
+  public:
   void clear_tiles();
-  static const int kTilesFieldNumber = 2;
-  ::google::protobuf::int32 tiles() const;
-  void set_tiles(::google::protobuf::int32 value);
+  int32_t tiles() const;
+  void set_tiles(int32_t value);
+  private:
+  int32_t _internal_tiles() const;
+  void _internal_set_tiles(int32_t value);
+  public:
 
   // optional int32 axis = 1 [default = 1];
   bool has_axis() const;
+  private:
+  bool _internal_has_axis() const;
+  public:
   void clear_axis();
-  static const int kAxisFieldNumber = 1;
-  ::google::protobuf::int32 axis() const;
-  void set_axis(::google::protobuf::int32 value);
+  int32_t axis() const;
+  void set_axis(int32_t value);
+  private:
+  int32_t _internal_axis() const;
+  void _internal_set_axis(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.TileParameter)
  private:
-  void set_has_axis();
-  void clear_has_axis();
-  void set_has_tiles();
-  void clear_has_tiles();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::int32 tiles_;
-  ::google::protobuf::int32 axis_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsTileParameterImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int32_t tiles_;
+  int32_t axis_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ThresholdParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ThresholdParameter) */ {
+class ThresholdParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ThresholdParameter) */ {
  public:
-  ThresholdParameter();
-  virtual ~ThresholdParameter();
+  inline ThresholdParameter() : ThresholdParameter(nullptr) {}
+  ~ThresholdParameter() override;
+  explicit constexpr ThresholdParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ThresholdParameter(const ThresholdParameter& from);
-
-  inline ThresholdParameter& operator=(const ThresholdParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ThresholdParameter(ThresholdParameter&& from) noexcept
     : ThresholdParameter() {
     *this = ::std::move(from);
   }
 
+  inline ThresholdParameter& operator=(const ThresholdParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ThresholdParameter& operator=(ThresholdParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ThresholdParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ThresholdParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ThresholdParameter* internal_default_instance() {
     return reinterpret_cast<const ThresholdParameter*>(
                &_ThresholdParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     61;
 
-  void Swap(ThresholdParameter* other);
   friend void swap(ThresholdParameter& a, ThresholdParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ThresholdParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ThresholdParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ThresholdParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ThresholdParameter* 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;
+  ThresholdParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ThresholdParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ThresholdParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ThresholdParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ThresholdParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ThresholdParameter";
   }
+  protected:
+  explicit ThresholdParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kThresholdFieldNumber = 1,
+  };
   // optional float threshold = 1 [default = 0];
   bool has_threshold() const;
+  private:
+  bool _internal_has_threshold() const;
+  public:
   void clear_threshold();
-  static const int kThresholdFieldNumber = 1;
   float threshold() const;
   void set_threshold(float value);
+  private:
+  float _internal_threshold() const;
+  void _internal_set_threshold(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ThresholdParameter)
  private:
-  void set_has_threshold();
-  void clear_has_threshold();
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float threshold_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsThresholdParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class WindowDataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.WindowDataParameter) */ {
+class WindowDataParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.WindowDataParameter) */ {
  public:
-  WindowDataParameter();
-  virtual ~WindowDataParameter();
+  inline WindowDataParameter() : WindowDataParameter(nullptr) {}
+  ~WindowDataParameter() override;
+  explicit constexpr WindowDataParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   WindowDataParameter(const WindowDataParameter& from);
-
-  inline WindowDataParameter& operator=(const WindowDataParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   WindowDataParameter(WindowDataParameter&& from) noexcept
     : WindowDataParameter() {
     *this = ::std::move(from);
   }
 
+  inline WindowDataParameter& operator=(const WindowDataParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline WindowDataParameter& operator=(WindowDataParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const WindowDataParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const WindowDataParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const WindowDataParameter* internal_default_instance() {
     return reinterpret_cast<const WindowDataParameter*>(
                &_WindowDataParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     62;
 
-  void Swap(WindowDataParameter* other);
   friend void swap(WindowDataParameter& a, WindowDataParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(WindowDataParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(WindowDataParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline WindowDataParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  WindowDataParameter* 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;
+  WindowDataParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<WindowDataParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const WindowDataParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const WindowDataParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(WindowDataParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.WindowDataParameter";
   }
+  protected:
+  explicit WindowDataParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSourceFieldNumber = 1,
+    kMeanFileFieldNumber = 3,
+    kCropModeFieldNumber = 11,
+    kRootFolderFieldNumber = 13,
+    kBatchSizeFieldNumber = 4,
+    kCropSizeFieldNumber = 5,
+    kMirrorFieldNumber = 6,
+    kCacheImagesFieldNumber = 12,
+    kContextPadFieldNumber = 10,
+    kScaleFieldNumber = 2,
+    kFgThresholdFieldNumber = 7,
+    kBgThresholdFieldNumber = 8,
+    kFgFractionFieldNumber = 9,
+  };
   // optional string source = 1;
   bool has_source() const;
+  private:
+  bool _internal_has_source() const;
+  public:
   void clear_source();
-  static const int kSourceFieldNumber = 1;
-  const ::std::string& source() const;
-  void set_source(const ::std::string& value);
-  #if LANG_CXX11
-  void set_source(::std::string&& value);
-  #endif
-  void set_source(const char* value);
-  void set_source(const char* value, size_t size);
-  ::std::string* mutable_source();
-  ::std::string* release_source();
-  void set_allocated_source(::std::string* source);
+  const std::string& source() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_source(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_source();
+  PROTOBUF_NODISCARD std::string* release_source();
+  void set_allocated_source(std::string* source);
+  private:
+  const std::string& _internal_source() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_source(const std::string& value);
+  std::string* _internal_mutable_source();
+  public:
 
   // optional string mean_file = 3;
   bool has_mean_file() const;
+  private:
+  bool _internal_has_mean_file() const;
+  public:
   void clear_mean_file();
-  static const int kMeanFileFieldNumber = 3;
-  const ::std::string& mean_file() const;
-  void set_mean_file(const ::std::string& value);
-  #if LANG_CXX11
-  void set_mean_file(::std::string&& value);
-  #endif
-  void set_mean_file(const char* value);
-  void set_mean_file(const char* value, size_t size);
-  ::std::string* mutable_mean_file();
-  ::std::string* release_mean_file();
-  void set_allocated_mean_file(::std::string* mean_file);
+  const std::string& mean_file() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_mean_file(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_mean_file();
+  PROTOBUF_NODISCARD std::string* release_mean_file();
+  void set_allocated_mean_file(std::string* mean_file);
+  private:
+  const std::string& _internal_mean_file() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_mean_file(const std::string& value);
+  std::string* _internal_mutable_mean_file();
+  public:
 
   // optional string crop_mode = 11 [default = "warp"];
   bool has_crop_mode() const;
+  private:
+  bool _internal_has_crop_mode() const;
+  public:
   void clear_crop_mode();
-  static const int kCropModeFieldNumber = 11;
-  const ::std::string& crop_mode() const;
-  void set_crop_mode(const ::std::string& value);
-  #if LANG_CXX11
-  void set_crop_mode(::std::string&& value);
-  #endif
-  void set_crop_mode(const char* value);
-  void set_crop_mode(const char* value, size_t size);
-  ::std::string* mutable_crop_mode();
-  ::std::string* release_crop_mode();
-  void set_allocated_crop_mode(::std::string* crop_mode);
+  const std::string& crop_mode() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_crop_mode(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_crop_mode();
+  PROTOBUF_NODISCARD std::string* release_crop_mode();
+  void set_allocated_crop_mode(std::string* crop_mode);
+  private:
+  const std::string& _internal_crop_mode() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_crop_mode(const std::string& value);
+  std::string* _internal_mutable_crop_mode();
+  public:
 
   // optional string root_folder = 13 [default = ""];
   bool has_root_folder() const;
+  private:
+  bool _internal_has_root_folder() const;
+  public:
   void clear_root_folder();
-  static const int kRootFolderFieldNumber = 13;
-  const ::std::string& root_folder() const;
-  void set_root_folder(const ::std::string& value);
-  #if LANG_CXX11
-  void set_root_folder(::std::string&& value);
-  #endif
-  void set_root_folder(const char* value);
-  void set_root_folder(const char* value, size_t size);
-  ::std::string* mutable_root_folder();
-  ::std::string* release_root_folder();
-  void set_allocated_root_folder(::std::string* root_folder);
+  const std::string& root_folder() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_root_folder(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_root_folder();
+  PROTOBUF_NODISCARD std::string* release_root_folder();
+  void set_allocated_root_folder(std::string* root_folder);
+  private:
+  const std::string& _internal_root_folder() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_root_folder(const std::string& value);
+  std::string* _internal_mutable_root_folder();
+  public:
 
   // optional uint32 batch_size = 4;
   bool has_batch_size() const;
+  private:
+  bool _internal_has_batch_size() const;
+  public:
   void clear_batch_size();
-  static const int kBatchSizeFieldNumber = 4;
-  ::google::protobuf::uint32 batch_size() const;
-  void set_batch_size(::google::protobuf::uint32 value);
+  uint32_t batch_size() const;
+  void set_batch_size(uint32_t value);
+  private:
+  uint32_t _internal_batch_size() const;
+  void _internal_set_batch_size(uint32_t value);
+  public:
 
   // optional uint32 crop_size = 5 [default = 0];
   bool has_crop_size() const;
+  private:
+  bool _internal_has_crop_size() const;
+  public:
   void clear_crop_size();
-  static const int kCropSizeFieldNumber = 5;
-  ::google::protobuf::uint32 crop_size() const;
-  void set_crop_size(::google::protobuf::uint32 value);
+  uint32_t crop_size() const;
+  void set_crop_size(uint32_t value);
+  private:
+  uint32_t _internal_crop_size() const;
+  void _internal_set_crop_size(uint32_t value);
+  public:
 
   // optional bool mirror = 6 [default = false];
   bool has_mirror() const;
+  private:
+  bool _internal_has_mirror() const;
+  public:
   void clear_mirror();
-  static const int kMirrorFieldNumber = 6;
   bool mirror() const;
   void set_mirror(bool value);
+  private:
+  bool _internal_mirror() const;
+  void _internal_set_mirror(bool value);
+  public:
 
   // optional bool cache_images = 12 [default = false];
   bool has_cache_images() const;
+  private:
+  bool _internal_has_cache_images() const;
+  public:
   void clear_cache_images();
-  static const int kCacheImagesFieldNumber = 12;
   bool cache_images() const;
   void set_cache_images(bool value);
+  private:
+  bool _internal_cache_images() const;
+  void _internal_set_cache_images(bool value);
+  public:
 
   // optional uint32 context_pad = 10 [default = 0];
   bool has_context_pad() const;
+  private:
+  bool _internal_has_context_pad() const;
+  public:
   void clear_context_pad();
-  static const int kContextPadFieldNumber = 10;
-  ::google::protobuf::uint32 context_pad() const;
-  void set_context_pad(::google::protobuf::uint32 value);
+  uint32_t context_pad() const;
+  void set_context_pad(uint32_t value);
+  private:
+  uint32_t _internal_context_pad() const;
+  void _internal_set_context_pad(uint32_t value);
+  public:
 
   // optional float scale = 2 [default = 1];
   bool has_scale() const;
+  private:
+  bool _internal_has_scale() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 2;
   float scale() const;
   void set_scale(float value);
+  private:
+  float _internal_scale() const;
+  void _internal_set_scale(float value);
+  public:
 
   // optional float fg_threshold = 7 [default = 0.5];
   bool has_fg_threshold() const;
+  private:
+  bool _internal_has_fg_threshold() const;
+  public:
   void clear_fg_threshold();
-  static const int kFgThresholdFieldNumber = 7;
   float fg_threshold() const;
   void set_fg_threshold(float value);
+  private:
+  float _internal_fg_threshold() const;
+  void _internal_set_fg_threshold(float value);
+  public:
 
   // optional float bg_threshold = 8 [default = 0.5];
   bool has_bg_threshold() const;
+  private:
+  bool _internal_has_bg_threshold() const;
+  public:
   void clear_bg_threshold();
-  static const int kBgThresholdFieldNumber = 8;
   float bg_threshold() const;
   void set_bg_threshold(float value);
+  private:
+  float _internal_bg_threshold() const;
+  void _internal_set_bg_threshold(float value);
+  public:
 
   // optional float fg_fraction = 9 [default = 0.25];
   bool has_fg_fraction() const;
+  private:
+  bool _internal_has_fg_fraction() const;
+  public:
   void clear_fg_fraction();
-  static const int kFgFractionFieldNumber = 9;
   float fg_fraction() const;
   void set_fg_fraction(float value);
+  private:
+  float _internal_fg_fraction() const;
+  void _internal_set_fg_fraction(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.WindowDataParameter)
  private:
-  void set_has_source();
-  void clear_has_source();
-  void set_has_scale();
-  void clear_has_scale();
-  void set_has_mean_file();
-  void clear_has_mean_file();
-  void set_has_batch_size();
-  void clear_has_batch_size();
-  void set_has_crop_size();
-  void clear_has_crop_size();
-  void set_has_mirror();
-  void clear_has_mirror();
-  void set_has_fg_threshold();
-  void clear_has_fg_threshold();
-  void set_has_bg_threshold();
-  void clear_has_bg_threshold();
-  void set_has_fg_fraction();
-  void clear_has_fg_fraction();
-  void set_has_context_pad();
-  void clear_has_context_pad();
-  void set_has_crop_mode();
-  void clear_has_crop_mode();
-  void set_has_cache_images();
-  void clear_has_cache_images();
-  void set_has_root_folder();
-  void clear_has_root_folder();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr source_;
-  ::google::protobuf::internal::ArenaStringPtr mean_file_;
-  static ::google::protobuf::internal::ExplicitlyConstructed< ::std::string> _default_crop_mode_;
-  ::google::protobuf::internal::ArenaStringPtr crop_mode_;
-  ::google::protobuf::internal::ArenaStringPtr root_folder_;
-  ::google::protobuf::uint32 batch_size_;
-  ::google::protobuf::uint32 crop_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr mean_file_;
+  static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_crop_mode_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr crop_mode_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr root_folder_;
+  uint32_t batch_size_;
+  uint32_t crop_size_;
   bool mirror_;
   bool cache_images_;
-  ::google::protobuf::uint32 context_pad_;
+  uint32_t context_pad_;
   float scale_;
   float fg_threshold_;
   float bg_threshold_;
   float fg_fraction_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsWindowDataParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class SPPParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SPPParameter) */ {
+class SPPParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.SPPParameter) */ {
  public:
-  SPPParameter();
-  virtual ~SPPParameter();
+  inline SPPParameter() : SPPParameter(nullptr) {}
+  ~SPPParameter() override;
+  explicit constexpr SPPParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SPPParameter(const SPPParameter& from);
-
-  inline SPPParameter& operator=(const SPPParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   SPPParameter(SPPParameter&& from) noexcept
     : SPPParameter() {
     *this = ::std::move(from);
   }
 
+  inline SPPParameter& operator=(const SPPParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline SPPParameter& operator=(SPPParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const SPPParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const SPPParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SPPParameter* internal_default_instance() {
     return reinterpret_cast<const SPPParameter*>(
                &_SPPParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     63;
 
-  void Swap(SPPParameter* other);
   friend void swap(SPPParameter& a, SPPParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(SPPParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(SPPParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline SPPParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  SPPParameter* 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;
+  SPPParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<SPPParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const SPPParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const SPPParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(SPPParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.SPPParameter";
   }
+  protected:
+  explicit SPPParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef SPPParameter_PoolMethod PoolMethod;
-  static const PoolMethod MAX =
+  static constexpr PoolMethod MAX =
     SPPParameter_PoolMethod_MAX;
-  static const PoolMethod AVE =
+  static constexpr PoolMethod AVE =
     SPPParameter_PoolMethod_AVE;
-  static const PoolMethod STOCHASTIC =
+  static constexpr PoolMethod STOCHASTIC =
     SPPParameter_PoolMethod_STOCHASTIC;
   static inline bool PoolMethod_IsValid(int value) {
     return SPPParameter_PoolMethod_IsValid(value);
   }
-  static const PoolMethod PoolMethod_MIN =
+  static constexpr PoolMethod PoolMethod_MIN =
     SPPParameter_PoolMethod_PoolMethod_MIN;
-  static const PoolMethod PoolMethod_MAX =
+  static constexpr PoolMethod PoolMethod_MAX =
     SPPParameter_PoolMethod_PoolMethod_MAX;
-  static const int PoolMethod_ARRAYSIZE =
+  static constexpr int PoolMethod_ARRAYSIZE =
     SPPParameter_PoolMethod_PoolMethod_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   PoolMethod_descriptor() {
     return SPPParameter_PoolMethod_descriptor();
   }
-  static inline const ::std::string& PoolMethod_Name(PoolMethod value) {
-    return SPPParameter_PoolMethod_Name(value);
+  template<typename T>
+  static inline const std::string& PoolMethod_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, PoolMethod>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function PoolMethod_Name.");
+    return SPPParameter_PoolMethod_Name(enum_t_value);
   }
-  static inline bool PoolMethod_Parse(const ::std::string& name,
+  static inline bool PoolMethod_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       PoolMethod* value) {
     return SPPParameter_PoolMethod_Parse(name, value);
   }
 
   typedef SPPParameter_Engine Engine;
-  static const Engine DEFAULT =
+  static constexpr Engine DEFAULT =
     SPPParameter_Engine_DEFAULT;
-  static const Engine CAFFE =
+  static constexpr Engine CAFFE =
     SPPParameter_Engine_CAFFE;
-  static const Engine CUDNN =
+  static constexpr Engine CUDNN =
     SPPParameter_Engine_CUDNN;
   static inline bool Engine_IsValid(int value) {
     return SPPParameter_Engine_IsValid(value);
   }
-  static const Engine Engine_MIN =
+  static constexpr Engine Engine_MIN =
     SPPParameter_Engine_Engine_MIN;
-  static const Engine Engine_MAX =
+  static constexpr Engine Engine_MAX =
     SPPParameter_Engine_Engine_MAX;
-  static const int Engine_ARRAYSIZE =
+  static constexpr int Engine_ARRAYSIZE =
     SPPParameter_Engine_Engine_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   Engine_descriptor() {
     return SPPParameter_Engine_descriptor();
   }
-  static inline const ::std::string& Engine_Name(Engine value) {
-    return SPPParameter_Engine_Name(value);
+  template<typename T>
+  static inline const std::string& Engine_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, Engine>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function Engine_Name.");
+    return SPPParameter_Engine_Name(enum_t_value);
   }
-  static inline bool Engine_Parse(const ::std::string& name,
+  static inline bool Engine_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       Engine* value) {
     return SPPParameter_Engine_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kPyramidHeightFieldNumber = 1,
+    kPoolFieldNumber = 2,
+    kEngineFieldNumber = 6,
+  };
   // optional uint32 pyramid_height = 1;
   bool has_pyramid_height() const;
+  private:
+  bool _internal_has_pyramid_height() const;
+  public:
   void clear_pyramid_height();
-  static const int kPyramidHeightFieldNumber = 1;
-  ::google::protobuf::uint32 pyramid_height() const;
-  void set_pyramid_height(::google::protobuf::uint32 value);
+  uint32_t pyramid_height() const;
+  void set_pyramid_height(uint32_t value);
+  private:
+  uint32_t _internal_pyramid_height() const;
+  void _internal_set_pyramid_height(uint32_t value);
+  public:
 
   // optional .opencv_caffe.SPPParameter.PoolMethod pool = 2 [default = MAX];
   bool has_pool() const;
+  private:
+  bool _internal_has_pool() const;
+  public:
   void clear_pool();
-  static const int kPoolFieldNumber = 2;
   ::opencv_caffe::SPPParameter_PoolMethod pool() const;
   void set_pool(::opencv_caffe::SPPParameter_PoolMethod value);
+  private:
+  ::opencv_caffe::SPPParameter_PoolMethod _internal_pool() const;
+  void _internal_set_pool(::opencv_caffe::SPPParameter_PoolMethod value);
+  public:
 
   // optional .opencv_caffe.SPPParameter.Engine engine = 6 [default = DEFAULT];
   bool has_engine() const;
+  private:
+  bool _internal_has_engine() const;
+  public:
   void clear_engine();
-  static const int kEngineFieldNumber = 6;
   ::opencv_caffe::SPPParameter_Engine engine() const;
   void set_engine(::opencv_caffe::SPPParameter_Engine value);
+  private:
+  ::opencv_caffe::SPPParameter_Engine _internal_engine() const;
+  void _internal_set_engine(::opencv_caffe::SPPParameter_Engine value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.SPPParameter)
  private:
-  void set_has_pyramid_height();
-  void clear_has_pyramid_height();
-  void set_has_pool();
-  void clear_has_pool();
-  void set_has_engine();
-  void clear_has_engine();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::uint32 pyramid_height_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  uint32_t pyramid_height_;
   int pool_;
   int engine_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsSPPParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class V1LayerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.V1LayerParameter) */ {
+class V1LayerParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.V1LayerParameter) */ {
  public:
-  V1LayerParameter();
-  virtual ~V1LayerParameter();
+  inline V1LayerParameter() : V1LayerParameter(nullptr) {}
+  ~V1LayerParameter() override;
+  explicit constexpr V1LayerParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   V1LayerParameter(const V1LayerParameter& from);
-
-  inline V1LayerParameter& operator=(const V1LayerParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   V1LayerParameter(V1LayerParameter&& from) noexcept
     : V1LayerParameter() {
     *this = ::std::move(from);
   }
 
+  inline V1LayerParameter& operator=(const V1LayerParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline V1LayerParameter& operator=(V1LayerParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const V1LayerParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const V1LayerParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const V1LayerParameter* internal_default_instance() {
     return reinterpret_cast<const V1LayerParameter*>(
                &_V1LayerParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     64;
 
-  void Swap(V1LayerParameter* other);
   friend void swap(V1LayerParameter& a, V1LayerParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(V1LayerParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(V1LayerParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline V1LayerParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  V1LayerParameter* 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;
+  V1LayerParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<V1LayerParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const V1LayerParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const V1LayerParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(V1LayerParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.V1LayerParameter";
   }
+  protected:
+  explicit V1LayerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef V1LayerParameter_LayerType LayerType;
-  static const LayerType NONE =
+  static constexpr LayerType NONE =
     V1LayerParameter_LayerType_NONE;
-  static const LayerType ABSVAL =
+  static constexpr LayerType ABSVAL =
     V1LayerParameter_LayerType_ABSVAL;
-  static const LayerType ACCURACY =
+  static constexpr LayerType ACCURACY =
     V1LayerParameter_LayerType_ACCURACY;
-  static const LayerType ARGMAX =
+  static constexpr LayerType ARGMAX =
     V1LayerParameter_LayerType_ARGMAX;
-  static const LayerType BNLL =
+  static constexpr LayerType BNLL =
     V1LayerParameter_LayerType_BNLL;
-  static const LayerType CONCAT =
+  static constexpr LayerType CONCAT =
     V1LayerParameter_LayerType_CONCAT;
-  static const LayerType CONTRASTIVE_LOSS =
+  static constexpr LayerType CONTRASTIVE_LOSS =
     V1LayerParameter_LayerType_CONTRASTIVE_LOSS;
-  static const LayerType CONVOLUTION =
+  static constexpr LayerType CONVOLUTION =
     V1LayerParameter_LayerType_CONVOLUTION;
-  static const LayerType DATA =
+  static constexpr LayerType DATA =
     V1LayerParameter_LayerType_DATA;
-  static const LayerType DECONVOLUTION =
+  static constexpr LayerType DECONVOLUTION =
     V1LayerParameter_LayerType_DECONVOLUTION;
-  static const LayerType DROPOUT =
+  static constexpr LayerType DROPOUT =
     V1LayerParameter_LayerType_DROPOUT;
-  static const LayerType DUMMY_DATA =
+  static constexpr LayerType DUMMY_DATA =
     V1LayerParameter_LayerType_DUMMY_DATA;
-  static const LayerType EUCLIDEAN_LOSS =
+  static constexpr LayerType EUCLIDEAN_LOSS =
     V1LayerParameter_LayerType_EUCLIDEAN_LOSS;
-  static const LayerType ELTWISE =
+  static constexpr LayerType ELTWISE =
     V1LayerParameter_LayerType_ELTWISE;
-  static const LayerType EXP =
+  static constexpr LayerType EXP =
     V1LayerParameter_LayerType_EXP;
-  static const LayerType FLATTEN =
+  static constexpr LayerType FLATTEN =
     V1LayerParameter_LayerType_FLATTEN;
-  static const LayerType HDF5_DATA =
+  static constexpr LayerType HDF5_DATA =
     V1LayerParameter_LayerType_HDF5_DATA;
-  static const LayerType HDF5_OUTPUT =
+  static constexpr LayerType HDF5_OUTPUT =
     V1LayerParameter_LayerType_HDF5_OUTPUT;
-  static const LayerType HINGE_LOSS =
+  static constexpr LayerType HINGE_LOSS =
     V1LayerParameter_LayerType_HINGE_LOSS;
-  static const LayerType IM2COL =
+  static constexpr LayerType IM2COL =
     V1LayerParameter_LayerType_IM2COL;
-  static const LayerType IMAGE_DATA =
+  static constexpr LayerType IMAGE_DATA =
     V1LayerParameter_LayerType_IMAGE_DATA;
-  static const LayerType INFOGAIN_LOSS =
+  static constexpr LayerType INFOGAIN_LOSS =
     V1LayerParameter_LayerType_INFOGAIN_LOSS;
-  static const LayerType INNER_PRODUCT =
+  static constexpr LayerType INNER_PRODUCT =
     V1LayerParameter_LayerType_INNER_PRODUCT;
-  static const LayerType LRN =
+  static constexpr LayerType LRN =
     V1LayerParameter_LayerType_LRN;
-  static const LayerType MEMORY_DATA =
+  static constexpr LayerType MEMORY_DATA =
     V1LayerParameter_LayerType_MEMORY_DATA;
-  static const LayerType MULTINOMIAL_LOGISTIC_LOSS =
+  static constexpr LayerType MULTINOMIAL_LOGISTIC_LOSS =
     V1LayerParameter_LayerType_MULTINOMIAL_LOGISTIC_LOSS;
-  static const LayerType MVN =
+  static constexpr LayerType MVN =
     V1LayerParameter_LayerType_MVN;
-  static const LayerType POOLING =
+  static constexpr LayerType POOLING =
     V1LayerParameter_LayerType_POOLING;
-  static const LayerType POWER =
+  static constexpr LayerType POWER =
     V1LayerParameter_LayerType_POWER;
-  static const LayerType RELU =
+  static constexpr LayerType RELU =
     V1LayerParameter_LayerType_RELU;
-  static const LayerType SIGMOID =
+  static constexpr LayerType SIGMOID =
     V1LayerParameter_LayerType_SIGMOID;
-  static const LayerType SIGMOID_CROSS_ENTROPY_LOSS =
+  static constexpr LayerType SIGMOID_CROSS_ENTROPY_LOSS =
     V1LayerParameter_LayerType_SIGMOID_CROSS_ENTROPY_LOSS;
-  static const LayerType SILENCE =
+  static constexpr LayerType SILENCE =
     V1LayerParameter_LayerType_SILENCE;
-  static const LayerType SOFTMAX =
+  static constexpr LayerType SOFTMAX =
     V1LayerParameter_LayerType_SOFTMAX;
-  static const LayerType SOFTMAX_LOSS =
+  static constexpr LayerType SOFTMAX_LOSS =
     V1LayerParameter_LayerType_SOFTMAX_LOSS;
-  static const LayerType SPLIT =
+  static constexpr LayerType SPLIT =
     V1LayerParameter_LayerType_SPLIT;
-  static const LayerType SLICE =
+  static constexpr LayerType SLICE =
     V1LayerParameter_LayerType_SLICE;
-  static const LayerType TANH =
+  static constexpr LayerType TANH =
     V1LayerParameter_LayerType_TANH;
-  static const LayerType WINDOW_DATA =
+  static constexpr LayerType WINDOW_DATA =
     V1LayerParameter_LayerType_WINDOW_DATA;
-  static const LayerType THRESHOLD =
+  static constexpr LayerType THRESHOLD =
     V1LayerParameter_LayerType_THRESHOLD;
   static inline bool LayerType_IsValid(int value) {
     return V1LayerParameter_LayerType_IsValid(value);
   }
-  static const LayerType LayerType_MIN =
+  static constexpr LayerType LayerType_MIN =
     V1LayerParameter_LayerType_LayerType_MIN;
-  static const LayerType LayerType_MAX =
+  static constexpr LayerType LayerType_MAX =
     V1LayerParameter_LayerType_LayerType_MAX;
-  static const int LayerType_ARRAYSIZE =
+  static constexpr int LayerType_ARRAYSIZE =
     V1LayerParameter_LayerType_LayerType_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   LayerType_descriptor() {
     return V1LayerParameter_LayerType_descriptor();
   }
-  static inline const ::std::string& LayerType_Name(LayerType value) {
-    return V1LayerParameter_LayerType_Name(value);
+  template<typename T>
+  static inline const std::string& LayerType_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, LayerType>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function LayerType_Name.");
+    return V1LayerParameter_LayerType_Name(enum_t_value);
   }
-  static inline bool LayerType_Parse(const ::std::string& name,
+  static inline bool LayerType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       LayerType* value) {
     return V1LayerParameter_LayerType_Parse(name, value);
   }
 
   typedef V1LayerParameter_DimCheckMode DimCheckMode;
-  static const DimCheckMode STRICT =
+  static constexpr DimCheckMode STRICT =
     V1LayerParameter_DimCheckMode_STRICT;
-  static const DimCheckMode PERMISSIVE =
+  static constexpr DimCheckMode PERMISSIVE =
     V1LayerParameter_DimCheckMode_PERMISSIVE;
   static inline bool DimCheckMode_IsValid(int value) {
     return V1LayerParameter_DimCheckMode_IsValid(value);
   }
-  static const DimCheckMode DimCheckMode_MIN =
+  static constexpr DimCheckMode DimCheckMode_MIN =
     V1LayerParameter_DimCheckMode_DimCheckMode_MIN;
-  static const DimCheckMode DimCheckMode_MAX =
+  static constexpr DimCheckMode DimCheckMode_MAX =
     V1LayerParameter_DimCheckMode_DimCheckMode_MAX;
-  static const int DimCheckMode_ARRAYSIZE =
+  static constexpr int DimCheckMode_ARRAYSIZE =
     V1LayerParameter_DimCheckMode_DimCheckMode_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   DimCheckMode_descriptor() {
     return V1LayerParameter_DimCheckMode_descriptor();
   }
-  static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) {
-    return V1LayerParameter_DimCheckMode_Name(value);
+  template<typename T>
+  static inline const std::string& DimCheckMode_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, DimCheckMode>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function DimCheckMode_Name.");
+    return V1LayerParameter_DimCheckMode_Name(enum_t_value);
   }
-  static inline bool DimCheckMode_Parse(const ::std::string& name,
+  static inline bool DimCheckMode_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       DimCheckMode* value) {
     return V1LayerParameter_DimCheckMode_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kBottomFieldNumber = 2,
+    kTopFieldNumber = 3,
+    kBlobsFieldNumber = 6,
+    kBlobsLrFieldNumber = 7,
+    kWeightDecayFieldNumber = 8,
+    kIncludeFieldNumber = 32,
+    kExcludeFieldNumber = 33,
+    kLossWeightFieldNumber = 35,
+    kParamFieldNumber = 1001,
+    kBlobShareModeFieldNumber = 1002,
+    kNameFieldNumber = 4,
+    kLayerFieldNumber = 1,
+    kConcatParamFieldNumber = 9,
+    kConvolutionParamFieldNumber = 10,
+    kDataParamFieldNumber = 11,
+    kDropoutParamFieldNumber = 12,
+    kHdf5DataParamFieldNumber = 13,
+    kHdf5OutputParamFieldNumber = 14,
+    kImageDataParamFieldNumber = 15,
+    kInfogainLossParamFieldNumber = 16,
+    kInnerProductParamFieldNumber = 17,
+    kLrnParamFieldNumber = 18,
+    kPoolingParamFieldNumber = 19,
+    kWindowDataParamFieldNumber = 20,
+    kPowerParamFieldNumber = 21,
+    kMemoryDataParamFieldNumber = 22,
+    kArgmaxParamFieldNumber = 23,
+    kEltwiseParamFieldNumber = 24,
+    kThresholdParamFieldNumber = 25,
+    kDummyDataParamFieldNumber = 26,
+    kAccuracyParamFieldNumber = 27,
+    kHingeLossParamFieldNumber = 29,
+    kReluParamFieldNumber = 30,
+    kSliceParamFieldNumber = 31,
+    kMvnParamFieldNumber = 34,
+    kTransformParamFieldNumber = 36,
+    kTanhParamFieldNumber = 37,
+    kSigmoidParamFieldNumber = 38,
+    kSoftmaxParamFieldNumber = 39,
+    kContrastiveLossParamFieldNumber = 40,
+    kExpParamFieldNumber = 41,
+    kLossParamFieldNumber = 42,
+    kTypeFieldNumber = 5,
+  };
   // repeated string bottom = 2;
   int bottom_size() const;
+  private:
+  int _internal_bottom_size() const;
+  public:
   void clear_bottom();
-  static const int kBottomFieldNumber = 2;
-  const ::std::string& bottom(int index) const;
-  ::std::string* mutable_bottom(int index);
-  void set_bottom(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_bottom(int index, ::std::string&& value);
-  #endif
+  const std::string& bottom(int index) const;
+  std::string* mutable_bottom(int index);
+  void set_bottom(int index, const std::string& value);
+  void set_bottom(int index, std::string&& value);
   void set_bottom(int index, const char* value);
   void set_bottom(int index, const char* value, size_t size);
-  ::std::string* add_bottom();
-  void add_bottom(const ::std::string& value);
-  #if LANG_CXX11
-  void add_bottom(::std::string&& value);
-  #endif
+  std::string* add_bottom();
+  void add_bottom(const std::string& value);
+  void add_bottom(std::string&& value);
   void add_bottom(const char* value);
   void add_bottom(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& bottom() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_bottom();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& bottom() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_bottom();
+  private:
+  const std::string& _internal_bottom(int index) const;
+  std::string* _internal_add_bottom();
+  public:
 
   // repeated string top = 3;
   int top_size() const;
+  private:
+  int _internal_top_size() const;
+  public:
   void clear_top();
-  static const int kTopFieldNumber = 3;
-  const ::std::string& top(int index) const;
-  ::std::string* mutable_top(int index);
-  void set_top(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_top(int index, ::std::string&& value);
-  #endif
+  const std::string& top(int index) const;
+  std::string* mutable_top(int index);
+  void set_top(int index, const std::string& value);
+  void set_top(int index, std::string&& value);
   void set_top(int index, const char* value);
   void set_top(int index, const char* value, size_t size);
-  ::std::string* add_top();
-  void add_top(const ::std::string& value);
-  #if LANG_CXX11
-  void add_top(::std::string&& value);
-  #endif
+  std::string* add_top();
+  void add_top(const std::string& value);
+  void add_top(std::string&& value);
   void add_top(const char* value);
   void add_top(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& top() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_top();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& top() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_top();
+  private:
+  const std::string& _internal_top(int index) const;
+  std::string* _internal_add_top();
+  public:
 
   // repeated .opencv_caffe.BlobProto blobs = 6;
   int blobs_size() const;
+  private:
+  int _internal_blobs_size() const;
+  public:
   void clear_blobs();
-  static const int kBlobsFieldNumber = 6;
-  const ::opencv_caffe::BlobProto& blobs(int index) const;
   ::opencv_caffe::BlobProto* mutable_blobs(int index);
-  ::opencv_caffe::BlobProto* add_blobs();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
       mutable_blobs();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+  private:
+  const ::opencv_caffe::BlobProto& _internal_blobs(int index) const;
+  ::opencv_caffe::BlobProto* _internal_add_blobs();
+  public:
+  const ::opencv_caffe::BlobProto& blobs(int index) const;
+  ::opencv_caffe::BlobProto* add_blobs();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
       blobs() const;
 
   // repeated float blobs_lr = 7;
   int blobs_lr_size() const;
+  private:
+  int _internal_blobs_lr_size() const;
+  public:
   void clear_blobs_lr();
-  static const int kBlobsLrFieldNumber = 7;
+  private:
+  float _internal_blobs_lr(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_blobs_lr() const;
+  void _internal_add_blobs_lr(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_blobs_lr();
+  public:
   float blobs_lr(int index) const;
   void set_blobs_lr(int index, float value);
   void add_blobs_lr(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       blobs_lr() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_blobs_lr();
 
   // repeated float weight_decay = 8;
   int weight_decay_size() const;
+  private:
+  int _internal_weight_decay_size() const;
+  public:
   void clear_weight_decay();
-  static const int kWeightDecayFieldNumber = 8;
+  private:
+  float _internal_weight_decay(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_weight_decay() const;
+  void _internal_add_weight_decay(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_weight_decay();
+  public:
   float weight_decay(int index) const;
   void set_weight_decay(int index, float value);
   void add_weight_decay(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       weight_decay() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_weight_decay();
 
   // repeated .opencv_caffe.NetStateRule include = 32;
   int include_size() const;
+  private:
+  int _internal_include_size() const;
+  public:
   void clear_include();
-  static const int kIncludeFieldNumber = 32;
-  const ::opencv_caffe::NetStateRule& include(int index) const;
   ::opencv_caffe::NetStateRule* mutable_include(int index);
-  ::opencv_caffe::NetStateRule* add_include();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
       mutable_include();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
+  private:
+  const ::opencv_caffe::NetStateRule& _internal_include(int index) const;
+  ::opencv_caffe::NetStateRule* _internal_add_include();
+  public:
+  const ::opencv_caffe::NetStateRule& include(int index) const;
+  ::opencv_caffe::NetStateRule* add_include();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
       include() const;
 
   // repeated .opencv_caffe.NetStateRule exclude = 33;
   int exclude_size() const;
+  private:
+  int _internal_exclude_size() const;
+  public:
   void clear_exclude();
-  static const int kExcludeFieldNumber = 33;
-  const ::opencv_caffe::NetStateRule& exclude(int index) const;
   ::opencv_caffe::NetStateRule* mutable_exclude(int index);
-  ::opencv_caffe::NetStateRule* add_exclude();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
       mutable_exclude();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
+  private:
+  const ::opencv_caffe::NetStateRule& _internal_exclude(int index) const;
+  ::opencv_caffe::NetStateRule* _internal_add_exclude();
+  public:
+  const ::opencv_caffe::NetStateRule& exclude(int index) const;
+  ::opencv_caffe::NetStateRule* add_exclude();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
       exclude() const;
 
   // repeated float loss_weight = 35;
   int loss_weight_size() const;
+  private:
+  int _internal_loss_weight_size() const;
+  public:
   void clear_loss_weight();
-  static const int kLossWeightFieldNumber = 35;
+  private:
+  float _internal_loss_weight(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_loss_weight() const;
+  void _internal_add_loss_weight(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_loss_weight();
+  public:
   float loss_weight(int index) const;
   void set_loss_weight(int index, float value);
   void add_loss_weight(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       loss_weight() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_loss_weight();
 
   // repeated string param = 1001;
   int param_size() const;
+  private:
+  int _internal_param_size() const;
+  public:
   void clear_param();
-  static const int kParamFieldNumber = 1001;
-  const ::std::string& param(int index) const;
-  ::std::string* mutable_param(int index);
-  void set_param(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_param(int index, ::std::string&& value);
-  #endif
+  const std::string& param(int index) const;
+  std::string* mutable_param(int index);
+  void set_param(int index, const std::string& value);
+  void set_param(int index, std::string&& value);
   void set_param(int index, const char* value);
   void set_param(int index, const char* value, size_t size);
-  ::std::string* add_param();
-  void add_param(const ::std::string& value);
-  #if LANG_CXX11
-  void add_param(::std::string&& value);
-  #endif
+  std::string* add_param();
+  void add_param(const std::string& value);
+  void add_param(std::string&& value);
   void add_param(const char* value);
   void add_param(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& param() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_param();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& param() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_param();
+  private:
+  const std::string& _internal_param(int index) const;
+  std::string* _internal_add_param();
+  public:
 
   // repeated .opencv_caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002;
   int blob_share_mode_size() const;
+  private:
+  int _internal_blob_share_mode_size() const;
+  public:
   void clear_blob_share_mode();
-  static const int kBlobShareModeFieldNumber = 1002;
+  private:
+  ::opencv_caffe::V1LayerParameter_DimCheckMode _internal_blob_share_mode(int index) const;
+  void _internal_add_blob_share_mode(::opencv_caffe::V1LayerParameter_DimCheckMode value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>* _internal_mutable_blob_share_mode();
+  public:
   ::opencv_caffe::V1LayerParameter_DimCheckMode blob_share_mode(int index) const;
   void set_blob_share_mode(int index, ::opencv_caffe::V1LayerParameter_DimCheckMode value);
   void add_blob_share_mode(::opencv_caffe::V1LayerParameter_DimCheckMode value);
-  const ::google::protobuf::RepeatedField<int>& blob_share_mode() const;
-  ::google::protobuf::RepeatedField<int>* mutable_blob_share_mode();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>& blob_share_mode() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>* mutable_blob_share_mode();
 
   // optional string name = 4;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 4;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional .opencv_caffe.V0LayerParameter layer = 1;
   bool has_layer() const;
+  private:
+  bool _internal_has_layer() const;
+  public:
   void clear_layer();
-  static const int kLayerFieldNumber = 1;
   const ::opencv_caffe::V0LayerParameter& layer() const;
-  ::opencv_caffe::V0LayerParameter* release_layer();
+  PROTOBUF_NODISCARD ::opencv_caffe::V0LayerParameter* release_layer();
   ::opencv_caffe::V0LayerParameter* mutable_layer();
   void set_allocated_layer(::opencv_caffe::V0LayerParameter* layer);
+  private:
+  const ::opencv_caffe::V0LayerParameter& _internal_layer() const;
+  ::opencv_caffe::V0LayerParameter* _internal_mutable_layer();
+  public:
+  void unsafe_arena_set_allocated_layer(
+      ::opencv_caffe::V0LayerParameter* layer);
+  ::opencv_caffe::V0LayerParameter* unsafe_arena_release_layer();
 
   // optional .opencv_caffe.ConcatParameter concat_param = 9;
   bool has_concat_param() const;
+  private:
+  bool _internal_has_concat_param() const;
+  public:
   void clear_concat_param();
-  static const int kConcatParamFieldNumber = 9;
   const ::opencv_caffe::ConcatParameter& concat_param() const;
-  ::opencv_caffe::ConcatParameter* release_concat_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ConcatParameter* release_concat_param();
   ::opencv_caffe::ConcatParameter* mutable_concat_param();
   void set_allocated_concat_param(::opencv_caffe::ConcatParameter* concat_param);
+  private:
+  const ::opencv_caffe::ConcatParameter& _internal_concat_param() const;
+  ::opencv_caffe::ConcatParameter* _internal_mutable_concat_param();
+  public:
+  void unsafe_arena_set_allocated_concat_param(
+      ::opencv_caffe::ConcatParameter* concat_param);
+  ::opencv_caffe::ConcatParameter* unsafe_arena_release_concat_param();
 
   // optional .opencv_caffe.ConvolutionParameter convolution_param = 10;
   bool has_convolution_param() const;
+  private:
+  bool _internal_has_convolution_param() const;
+  public:
   void clear_convolution_param();
-  static const int kConvolutionParamFieldNumber = 10;
   const ::opencv_caffe::ConvolutionParameter& convolution_param() const;
-  ::opencv_caffe::ConvolutionParameter* release_convolution_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ConvolutionParameter* release_convolution_param();
   ::opencv_caffe::ConvolutionParameter* mutable_convolution_param();
   void set_allocated_convolution_param(::opencv_caffe::ConvolutionParameter* convolution_param);
+  private:
+  const ::opencv_caffe::ConvolutionParameter& _internal_convolution_param() const;
+  ::opencv_caffe::ConvolutionParameter* _internal_mutable_convolution_param();
+  public:
+  void unsafe_arena_set_allocated_convolution_param(
+      ::opencv_caffe::ConvolutionParameter* convolution_param);
+  ::opencv_caffe::ConvolutionParameter* unsafe_arena_release_convolution_param();
 
   // optional .opencv_caffe.DataParameter data_param = 11;
   bool has_data_param() const;
+  private:
+  bool _internal_has_data_param() const;
+  public:
   void clear_data_param();
-  static const int kDataParamFieldNumber = 11;
   const ::opencv_caffe::DataParameter& data_param() const;
-  ::opencv_caffe::DataParameter* release_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::DataParameter* release_data_param();
   ::opencv_caffe::DataParameter* mutable_data_param();
   void set_allocated_data_param(::opencv_caffe::DataParameter* data_param);
+  private:
+  const ::opencv_caffe::DataParameter& _internal_data_param() const;
+  ::opencv_caffe::DataParameter* _internal_mutable_data_param();
+  public:
+  void unsafe_arena_set_allocated_data_param(
+      ::opencv_caffe::DataParameter* data_param);
+  ::opencv_caffe::DataParameter* unsafe_arena_release_data_param();
 
   // optional .opencv_caffe.DropoutParameter dropout_param = 12;
   bool has_dropout_param() const;
+  private:
+  bool _internal_has_dropout_param() const;
+  public:
   void clear_dropout_param();
-  static const int kDropoutParamFieldNumber = 12;
   const ::opencv_caffe::DropoutParameter& dropout_param() const;
-  ::opencv_caffe::DropoutParameter* release_dropout_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::DropoutParameter* release_dropout_param();
   ::opencv_caffe::DropoutParameter* mutable_dropout_param();
   void set_allocated_dropout_param(::opencv_caffe::DropoutParameter* dropout_param);
+  private:
+  const ::opencv_caffe::DropoutParameter& _internal_dropout_param() const;
+  ::opencv_caffe::DropoutParameter* _internal_mutable_dropout_param();
+  public:
+  void unsafe_arena_set_allocated_dropout_param(
+      ::opencv_caffe::DropoutParameter* dropout_param);
+  ::opencv_caffe::DropoutParameter* unsafe_arena_release_dropout_param();
 
   // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 13;
   bool has_hdf5_data_param() const;
+  private:
+  bool _internal_has_hdf5_data_param() const;
+  public:
   void clear_hdf5_data_param();
-  static const int kHdf5DataParamFieldNumber = 13;
   const ::opencv_caffe::HDF5DataParameter& hdf5_data_param() const;
-  ::opencv_caffe::HDF5DataParameter* release_hdf5_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::HDF5DataParameter* release_hdf5_data_param();
   ::opencv_caffe::HDF5DataParameter* mutable_hdf5_data_param();
   void set_allocated_hdf5_data_param(::opencv_caffe::HDF5DataParameter* hdf5_data_param);
+  private:
+  const ::opencv_caffe::HDF5DataParameter& _internal_hdf5_data_param() const;
+  ::opencv_caffe::HDF5DataParameter* _internal_mutable_hdf5_data_param();
+  public:
+  void unsafe_arena_set_allocated_hdf5_data_param(
+      ::opencv_caffe::HDF5DataParameter* hdf5_data_param);
+  ::opencv_caffe::HDF5DataParameter* unsafe_arena_release_hdf5_data_param();
 
   // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 14;
   bool has_hdf5_output_param() const;
+  private:
+  bool _internal_has_hdf5_output_param() const;
+  public:
   void clear_hdf5_output_param();
-  static const int kHdf5OutputParamFieldNumber = 14;
   const ::opencv_caffe::HDF5OutputParameter& hdf5_output_param() const;
-  ::opencv_caffe::HDF5OutputParameter* release_hdf5_output_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::HDF5OutputParameter* release_hdf5_output_param();
   ::opencv_caffe::HDF5OutputParameter* mutable_hdf5_output_param();
   void set_allocated_hdf5_output_param(::opencv_caffe::HDF5OutputParameter* hdf5_output_param);
+  private:
+  const ::opencv_caffe::HDF5OutputParameter& _internal_hdf5_output_param() const;
+  ::opencv_caffe::HDF5OutputParameter* _internal_mutable_hdf5_output_param();
+  public:
+  void unsafe_arena_set_allocated_hdf5_output_param(
+      ::opencv_caffe::HDF5OutputParameter* hdf5_output_param);
+  ::opencv_caffe::HDF5OutputParameter* unsafe_arena_release_hdf5_output_param();
 
   // optional .opencv_caffe.ImageDataParameter image_data_param = 15;
   bool has_image_data_param() const;
+  private:
+  bool _internal_has_image_data_param() const;
+  public:
   void clear_image_data_param();
-  static const int kImageDataParamFieldNumber = 15;
   const ::opencv_caffe::ImageDataParameter& image_data_param() const;
-  ::opencv_caffe::ImageDataParameter* release_image_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ImageDataParameter* release_image_data_param();
   ::opencv_caffe::ImageDataParameter* mutable_image_data_param();
   void set_allocated_image_data_param(::opencv_caffe::ImageDataParameter* image_data_param);
+  private:
+  const ::opencv_caffe::ImageDataParameter& _internal_image_data_param() const;
+  ::opencv_caffe::ImageDataParameter* _internal_mutable_image_data_param();
+  public:
+  void unsafe_arena_set_allocated_image_data_param(
+      ::opencv_caffe::ImageDataParameter* image_data_param);
+  ::opencv_caffe::ImageDataParameter* unsafe_arena_release_image_data_param();
 
   // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 16;
   bool has_infogain_loss_param() const;
+  private:
+  bool _internal_has_infogain_loss_param() const;
+  public:
   void clear_infogain_loss_param();
-  static const int kInfogainLossParamFieldNumber = 16;
   const ::opencv_caffe::InfogainLossParameter& infogain_loss_param() const;
-  ::opencv_caffe::InfogainLossParameter* release_infogain_loss_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::InfogainLossParameter* release_infogain_loss_param();
   ::opencv_caffe::InfogainLossParameter* mutable_infogain_loss_param();
   void set_allocated_infogain_loss_param(::opencv_caffe::InfogainLossParameter* infogain_loss_param);
+  private:
+  const ::opencv_caffe::InfogainLossParameter& _internal_infogain_loss_param() const;
+  ::opencv_caffe::InfogainLossParameter* _internal_mutable_infogain_loss_param();
+  public:
+  void unsafe_arena_set_allocated_infogain_loss_param(
+      ::opencv_caffe::InfogainLossParameter* infogain_loss_param);
+  ::opencv_caffe::InfogainLossParameter* unsafe_arena_release_infogain_loss_param();
 
   // optional .opencv_caffe.InnerProductParameter inner_product_param = 17;
   bool has_inner_product_param() const;
+  private:
+  bool _internal_has_inner_product_param() const;
+  public:
   void clear_inner_product_param();
-  static const int kInnerProductParamFieldNumber = 17;
   const ::opencv_caffe::InnerProductParameter& inner_product_param() const;
-  ::opencv_caffe::InnerProductParameter* release_inner_product_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::InnerProductParameter* release_inner_product_param();
   ::opencv_caffe::InnerProductParameter* mutable_inner_product_param();
   void set_allocated_inner_product_param(::opencv_caffe::InnerProductParameter* inner_product_param);
+  private:
+  const ::opencv_caffe::InnerProductParameter& _internal_inner_product_param() const;
+  ::opencv_caffe::InnerProductParameter* _internal_mutable_inner_product_param();
+  public:
+  void unsafe_arena_set_allocated_inner_product_param(
+      ::opencv_caffe::InnerProductParameter* inner_product_param);
+  ::opencv_caffe::InnerProductParameter* unsafe_arena_release_inner_product_param();
 
   // optional .opencv_caffe.LRNParameter lrn_param = 18;
   bool has_lrn_param() const;
+  private:
+  bool _internal_has_lrn_param() const;
+  public:
   void clear_lrn_param();
-  static const int kLrnParamFieldNumber = 18;
   const ::opencv_caffe::LRNParameter& lrn_param() const;
-  ::opencv_caffe::LRNParameter* release_lrn_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::LRNParameter* release_lrn_param();
   ::opencv_caffe::LRNParameter* mutable_lrn_param();
   void set_allocated_lrn_param(::opencv_caffe::LRNParameter* lrn_param);
+  private:
+  const ::opencv_caffe::LRNParameter& _internal_lrn_param() const;
+  ::opencv_caffe::LRNParameter* _internal_mutable_lrn_param();
+  public:
+  void unsafe_arena_set_allocated_lrn_param(
+      ::opencv_caffe::LRNParameter* lrn_param);
+  ::opencv_caffe::LRNParameter* unsafe_arena_release_lrn_param();
 
   // optional .opencv_caffe.PoolingParameter pooling_param = 19;
   bool has_pooling_param() const;
+  private:
+  bool _internal_has_pooling_param() const;
+  public:
   void clear_pooling_param();
-  static const int kPoolingParamFieldNumber = 19;
   const ::opencv_caffe::PoolingParameter& pooling_param() const;
-  ::opencv_caffe::PoolingParameter* release_pooling_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PoolingParameter* release_pooling_param();
   ::opencv_caffe::PoolingParameter* mutable_pooling_param();
   void set_allocated_pooling_param(::opencv_caffe::PoolingParameter* pooling_param);
+  private:
+  const ::opencv_caffe::PoolingParameter& _internal_pooling_param() const;
+  ::opencv_caffe::PoolingParameter* _internal_mutable_pooling_param();
+  public:
+  void unsafe_arena_set_allocated_pooling_param(
+      ::opencv_caffe::PoolingParameter* pooling_param);
+  ::opencv_caffe::PoolingParameter* unsafe_arena_release_pooling_param();
 
   // optional .opencv_caffe.WindowDataParameter window_data_param = 20;
   bool has_window_data_param() const;
+  private:
+  bool _internal_has_window_data_param() const;
+  public:
   void clear_window_data_param();
-  static const int kWindowDataParamFieldNumber = 20;
   const ::opencv_caffe::WindowDataParameter& window_data_param() const;
-  ::opencv_caffe::WindowDataParameter* release_window_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::WindowDataParameter* release_window_data_param();
   ::opencv_caffe::WindowDataParameter* mutable_window_data_param();
   void set_allocated_window_data_param(::opencv_caffe::WindowDataParameter* window_data_param);
+  private:
+  const ::opencv_caffe::WindowDataParameter& _internal_window_data_param() const;
+  ::opencv_caffe::WindowDataParameter* _internal_mutable_window_data_param();
+  public:
+  void unsafe_arena_set_allocated_window_data_param(
+      ::opencv_caffe::WindowDataParameter* window_data_param);
+  ::opencv_caffe::WindowDataParameter* unsafe_arena_release_window_data_param();
 
   // optional .opencv_caffe.PowerParameter power_param = 21;
   bool has_power_param() const;
+  private:
+  bool _internal_has_power_param() const;
+  public:
   void clear_power_param();
-  static const int kPowerParamFieldNumber = 21;
   const ::opencv_caffe::PowerParameter& power_param() const;
-  ::opencv_caffe::PowerParameter* release_power_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::PowerParameter* release_power_param();
   ::opencv_caffe::PowerParameter* mutable_power_param();
   void set_allocated_power_param(::opencv_caffe::PowerParameter* power_param);
+  private:
+  const ::opencv_caffe::PowerParameter& _internal_power_param() const;
+  ::opencv_caffe::PowerParameter* _internal_mutable_power_param();
+  public:
+  void unsafe_arena_set_allocated_power_param(
+      ::opencv_caffe::PowerParameter* power_param);
+  ::opencv_caffe::PowerParameter* unsafe_arena_release_power_param();
 
   // optional .opencv_caffe.MemoryDataParameter memory_data_param = 22;
   bool has_memory_data_param() const;
+  private:
+  bool _internal_has_memory_data_param() const;
+  public:
   void clear_memory_data_param();
-  static const int kMemoryDataParamFieldNumber = 22;
   const ::opencv_caffe::MemoryDataParameter& memory_data_param() const;
-  ::opencv_caffe::MemoryDataParameter* release_memory_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::MemoryDataParameter* release_memory_data_param();
   ::opencv_caffe::MemoryDataParameter* mutable_memory_data_param();
   void set_allocated_memory_data_param(::opencv_caffe::MemoryDataParameter* memory_data_param);
+  private:
+  const ::opencv_caffe::MemoryDataParameter& _internal_memory_data_param() const;
+  ::opencv_caffe::MemoryDataParameter* _internal_mutable_memory_data_param();
+  public:
+  void unsafe_arena_set_allocated_memory_data_param(
+      ::opencv_caffe::MemoryDataParameter* memory_data_param);
+  ::opencv_caffe::MemoryDataParameter* unsafe_arena_release_memory_data_param();
 
   // optional .opencv_caffe.ArgMaxParameter argmax_param = 23;
   bool has_argmax_param() const;
+  private:
+  bool _internal_has_argmax_param() const;
+  public:
   void clear_argmax_param();
-  static const int kArgmaxParamFieldNumber = 23;
   const ::opencv_caffe::ArgMaxParameter& argmax_param() const;
-  ::opencv_caffe::ArgMaxParameter* release_argmax_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ArgMaxParameter* release_argmax_param();
   ::opencv_caffe::ArgMaxParameter* mutable_argmax_param();
   void set_allocated_argmax_param(::opencv_caffe::ArgMaxParameter* argmax_param);
+  private:
+  const ::opencv_caffe::ArgMaxParameter& _internal_argmax_param() const;
+  ::opencv_caffe::ArgMaxParameter* _internal_mutable_argmax_param();
+  public:
+  void unsafe_arena_set_allocated_argmax_param(
+      ::opencv_caffe::ArgMaxParameter* argmax_param);
+  ::opencv_caffe::ArgMaxParameter* unsafe_arena_release_argmax_param();
 
   // optional .opencv_caffe.EltwiseParameter eltwise_param = 24;
   bool has_eltwise_param() const;
+  private:
+  bool _internal_has_eltwise_param() const;
+  public:
   void clear_eltwise_param();
-  static const int kEltwiseParamFieldNumber = 24;
   const ::opencv_caffe::EltwiseParameter& eltwise_param() const;
-  ::opencv_caffe::EltwiseParameter* release_eltwise_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::EltwiseParameter* release_eltwise_param();
   ::opencv_caffe::EltwiseParameter* mutable_eltwise_param();
   void set_allocated_eltwise_param(::opencv_caffe::EltwiseParameter* eltwise_param);
+  private:
+  const ::opencv_caffe::EltwiseParameter& _internal_eltwise_param() const;
+  ::opencv_caffe::EltwiseParameter* _internal_mutable_eltwise_param();
+  public:
+  void unsafe_arena_set_allocated_eltwise_param(
+      ::opencv_caffe::EltwiseParameter* eltwise_param);
+  ::opencv_caffe::EltwiseParameter* unsafe_arena_release_eltwise_param();
 
   // optional .opencv_caffe.ThresholdParameter threshold_param = 25;
   bool has_threshold_param() const;
+  private:
+  bool _internal_has_threshold_param() const;
+  public:
   void clear_threshold_param();
-  static const int kThresholdParamFieldNumber = 25;
   const ::opencv_caffe::ThresholdParameter& threshold_param() const;
-  ::opencv_caffe::ThresholdParameter* release_threshold_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ThresholdParameter* release_threshold_param();
   ::opencv_caffe::ThresholdParameter* mutable_threshold_param();
   void set_allocated_threshold_param(::opencv_caffe::ThresholdParameter* threshold_param);
+  private:
+  const ::opencv_caffe::ThresholdParameter& _internal_threshold_param() const;
+  ::opencv_caffe::ThresholdParameter* _internal_mutable_threshold_param();
+  public:
+  void unsafe_arena_set_allocated_threshold_param(
+      ::opencv_caffe::ThresholdParameter* threshold_param);
+  ::opencv_caffe::ThresholdParameter* unsafe_arena_release_threshold_param();
 
   // optional .opencv_caffe.DummyDataParameter dummy_data_param = 26;
   bool has_dummy_data_param() const;
+  private:
+  bool _internal_has_dummy_data_param() const;
+  public:
   void clear_dummy_data_param();
-  static const int kDummyDataParamFieldNumber = 26;
   const ::opencv_caffe::DummyDataParameter& dummy_data_param() const;
-  ::opencv_caffe::DummyDataParameter* release_dummy_data_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::DummyDataParameter* release_dummy_data_param();
   ::opencv_caffe::DummyDataParameter* mutable_dummy_data_param();
   void set_allocated_dummy_data_param(::opencv_caffe::DummyDataParameter* dummy_data_param);
+  private:
+  const ::opencv_caffe::DummyDataParameter& _internal_dummy_data_param() const;
+  ::opencv_caffe::DummyDataParameter* _internal_mutable_dummy_data_param();
+  public:
+  void unsafe_arena_set_allocated_dummy_data_param(
+      ::opencv_caffe::DummyDataParameter* dummy_data_param);
+  ::opencv_caffe::DummyDataParameter* unsafe_arena_release_dummy_data_param();
 
   // optional .opencv_caffe.AccuracyParameter accuracy_param = 27;
   bool has_accuracy_param() const;
+  private:
+  bool _internal_has_accuracy_param() const;
+  public:
   void clear_accuracy_param();
-  static const int kAccuracyParamFieldNumber = 27;
   const ::opencv_caffe::AccuracyParameter& accuracy_param() const;
-  ::opencv_caffe::AccuracyParameter* release_accuracy_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::AccuracyParameter* release_accuracy_param();
   ::opencv_caffe::AccuracyParameter* mutable_accuracy_param();
   void set_allocated_accuracy_param(::opencv_caffe::AccuracyParameter* accuracy_param);
+  private:
+  const ::opencv_caffe::AccuracyParameter& _internal_accuracy_param() const;
+  ::opencv_caffe::AccuracyParameter* _internal_mutable_accuracy_param();
+  public:
+  void unsafe_arena_set_allocated_accuracy_param(
+      ::opencv_caffe::AccuracyParameter* accuracy_param);
+  ::opencv_caffe::AccuracyParameter* unsafe_arena_release_accuracy_param();
 
   // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 29;
   bool has_hinge_loss_param() const;
+  private:
+  bool _internal_has_hinge_loss_param() const;
+  public:
   void clear_hinge_loss_param();
-  static const int kHingeLossParamFieldNumber = 29;
   const ::opencv_caffe::HingeLossParameter& hinge_loss_param() const;
-  ::opencv_caffe::HingeLossParameter* release_hinge_loss_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::HingeLossParameter* release_hinge_loss_param();
   ::opencv_caffe::HingeLossParameter* mutable_hinge_loss_param();
   void set_allocated_hinge_loss_param(::opencv_caffe::HingeLossParameter* hinge_loss_param);
+  private:
+  const ::opencv_caffe::HingeLossParameter& _internal_hinge_loss_param() const;
+  ::opencv_caffe::HingeLossParameter* _internal_mutable_hinge_loss_param();
+  public:
+  void unsafe_arena_set_allocated_hinge_loss_param(
+      ::opencv_caffe::HingeLossParameter* hinge_loss_param);
+  ::opencv_caffe::HingeLossParameter* unsafe_arena_release_hinge_loss_param();
 
   // optional .opencv_caffe.ReLUParameter relu_param = 30;
   bool has_relu_param() const;
+  private:
+  bool _internal_has_relu_param() const;
+  public:
   void clear_relu_param();
-  static const int kReluParamFieldNumber = 30;
   const ::opencv_caffe::ReLUParameter& relu_param() const;
-  ::opencv_caffe::ReLUParameter* release_relu_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ReLUParameter* release_relu_param();
   ::opencv_caffe::ReLUParameter* mutable_relu_param();
   void set_allocated_relu_param(::opencv_caffe::ReLUParameter* relu_param);
+  private:
+  const ::opencv_caffe::ReLUParameter& _internal_relu_param() const;
+  ::opencv_caffe::ReLUParameter* _internal_mutable_relu_param();
+  public:
+  void unsafe_arena_set_allocated_relu_param(
+      ::opencv_caffe::ReLUParameter* relu_param);
+  ::opencv_caffe::ReLUParameter* unsafe_arena_release_relu_param();
 
   // optional .opencv_caffe.SliceParameter slice_param = 31;
   bool has_slice_param() const;
+  private:
+  bool _internal_has_slice_param() const;
+  public:
   void clear_slice_param();
-  static const int kSliceParamFieldNumber = 31;
   const ::opencv_caffe::SliceParameter& slice_param() const;
-  ::opencv_caffe::SliceParameter* release_slice_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::SliceParameter* release_slice_param();
   ::opencv_caffe::SliceParameter* mutable_slice_param();
   void set_allocated_slice_param(::opencv_caffe::SliceParameter* slice_param);
+  private:
+  const ::opencv_caffe::SliceParameter& _internal_slice_param() const;
+  ::opencv_caffe::SliceParameter* _internal_mutable_slice_param();
+  public:
+  void unsafe_arena_set_allocated_slice_param(
+      ::opencv_caffe::SliceParameter* slice_param);
+  ::opencv_caffe::SliceParameter* unsafe_arena_release_slice_param();
 
   // optional .opencv_caffe.MVNParameter mvn_param = 34;
   bool has_mvn_param() const;
+  private:
+  bool _internal_has_mvn_param() const;
+  public:
   void clear_mvn_param();
-  static const int kMvnParamFieldNumber = 34;
   const ::opencv_caffe::MVNParameter& mvn_param() const;
-  ::opencv_caffe::MVNParameter* release_mvn_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::MVNParameter* release_mvn_param();
   ::opencv_caffe::MVNParameter* mutable_mvn_param();
   void set_allocated_mvn_param(::opencv_caffe::MVNParameter* mvn_param);
+  private:
+  const ::opencv_caffe::MVNParameter& _internal_mvn_param() const;
+  ::opencv_caffe::MVNParameter* _internal_mutable_mvn_param();
+  public:
+  void unsafe_arena_set_allocated_mvn_param(
+      ::opencv_caffe::MVNParameter* mvn_param);
+  ::opencv_caffe::MVNParameter* unsafe_arena_release_mvn_param();
 
   // optional .opencv_caffe.TransformationParameter transform_param = 36;
   bool has_transform_param() const;
+  private:
+  bool _internal_has_transform_param() const;
+  public:
   void clear_transform_param();
-  static const int kTransformParamFieldNumber = 36;
   const ::opencv_caffe::TransformationParameter& transform_param() const;
-  ::opencv_caffe::TransformationParameter* release_transform_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::TransformationParameter* release_transform_param();
   ::opencv_caffe::TransformationParameter* mutable_transform_param();
   void set_allocated_transform_param(::opencv_caffe::TransformationParameter* transform_param);
+  private:
+  const ::opencv_caffe::TransformationParameter& _internal_transform_param() const;
+  ::opencv_caffe::TransformationParameter* _internal_mutable_transform_param();
+  public:
+  void unsafe_arena_set_allocated_transform_param(
+      ::opencv_caffe::TransformationParameter* transform_param);
+  ::opencv_caffe::TransformationParameter* unsafe_arena_release_transform_param();
 
   // optional .opencv_caffe.TanHParameter tanh_param = 37;
   bool has_tanh_param() const;
+  private:
+  bool _internal_has_tanh_param() const;
+  public:
   void clear_tanh_param();
-  static const int kTanhParamFieldNumber = 37;
   const ::opencv_caffe::TanHParameter& tanh_param() const;
-  ::opencv_caffe::TanHParameter* release_tanh_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::TanHParameter* release_tanh_param();
   ::opencv_caffe::TanHParameter* mutable_tanh_param();
   void set_allocated_tanh_param(::opencv_caffe::TanHParameter* tanh_param);
+  private:
+  const ::opencv_caffe::TanHParameter& _internal_tanh_param() const;
+  ::opencv_caffe::TanHParameter* _internal_mutable_tanh_param();
+  public:
+  void unsafe_arena_set_allocated_tanh_param(
+      ::opencv_caffe::TanHParameter* tanh_param);
+  ::opencv_caffe::TanHParameter* unsafe_arena_release_tanh_param();
 
   // optional .opencv_caffe.SigmoidParameter sigmoid_param = 38;
   bool has_sigmoid_param() const;
+  private:
+  bool _internal_has_sigmoid_param() const;
+  public:
   void clear_sigmoid_param();
-  static const int kSigmoidParamFieldNumber = 38;
   const ::opencv_caffe::SigmoidParameter& sigmoid_param() const;
-  ::opencv_caffe::SigmoidParameter* release_sigmoid_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::SigmoidParameter* release_sigmoid_param();
   ::opencv_caffe::SigmoidParameter* mutable_sigmoid_param();
   void set_allocated_sigmoid_param(::opencv_caffe::SigmoidParameter* sigmoid_param);
+  private:
+  const ::opencv_caffe::SigmoidParameter& _internal_sigmoid_param() const;
+  ::opencv_caffe::SigmoidParameter* _internal_mutable_sigmoid_param();
+  public:
+  void unsafe_arena_set_allocated_sigmoid_param(
+      ::opencv_caffe::SigmoidParameter* sigmoid_param);
+  ::opencv_caffe::SigmoidParameter* unsafe_arena_release_sigmoid_param();
 
   // optional .opencv_caffe.SoftmaxParameter softmax_param = 39;
   bool has_softmax_param() const;
+  private:
+  bool _internal_has_softmax_param() const;
+  public:
   void clear_softmax_param();
-  static const int kSoftmaxParamFieldNumber = 39;
   const ::opencv_caffe::SoftmaxParameter& softmax_param() const;
-  ::opencv_caffe::SoftmaxParameter* release_softmax_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::SoftmaxParameter* release_softmax_param();
   ::opencv_caffe::SoftmaxParameter* mutable_softmax_param();
   void set_allocated_softmax_param(::opencv_caffe::SoftmaxParameter* softmax_param);
+  private:
+  const ::opencv_caffe::SoftmaxParameter& _internal_softmax_param() const;
+  ::opencv_caffe::SoftmaxParameter* _internal_mutable_softmax_param();
+  public:
+  void unsafe_arena_set_allocated_softmax_param(
+      ::opencv_caffe::SoftmaxParameter* softmax_param);
+  ::opencv_caffe::SoftmaxParameter* unsafe_arena_release_softmax_param();
 
   // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 40;
   bool has_contrastive_loss_param() const;
+  private:
+  bool _internal_has_contrastive_loss_param() const;
+  public:
   void clear_contrastive_loss_param();
-  static const int kContrastiveLossParamFieldNumber = 40;
   const ::opencv_caffe::ContrastiveLossParameter& contrastive_loss_param() const;
-  ::opencv_caffe::ContrastiveLossParameter* release_contrastive_loss_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ContrastiveLossParameter* release_contrastive_loss_param();
   ::opencv_caffe::ContrastiveLossParameter* mutable_contrastive_loss_param();
   void set_allocated_contrastive_loss_param(::opencv_caffe::ContrastiveLossParameter* contrastive_loss_param);
+  private:
+  const ::opencv_caffe::ContrastiveLossParameter& _internal_contrastive_loss_param() const;
+  ::opencv_caffe::ContrastiveLossParameter* _internal_mutable_contrastive_loss_param();
+  public:
+  void unsafe_arena_set_allocated_contrastive_loss_param(
+      ::opencv_caffe::ContrastiveLossParameter* contrastive_loss_param);
+  ::opencv_caffe::ContrastiveLossParameter* unsafe_arena_release_contrastive_loss_param();
 
   // optional .opencv_caffe.ExpParameter exp_param = 41;
   bool has_exp_param() const;
+  private:
+  bool _internal_has_exp_param() const;
+  public:
   void clear_exp_param();
-  static const int kExpParamFieldNumber = 41;
   const ::opencv_caffe::ExpParameter& exp_param() const;
-  ::opencv_caffe::ExpParameter* release_exp_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::ExpParameter* release_exp_param();
   ::opencv_caffe::ExpParameter* mutable_exp_param();
   void set_allocated_exp_param(::opencv_caffe::ExpParameter* exp_param);
+  private:
+  const ::opencv_caffe::ExpParameter& _internal_exp_param() const;
+  ::opencv_caffe::ExpParameter* _internal_mutable_exp_param();
+  public:
+  void unsafe_arena_set_allocated_exp_param(
+      ::opencv_caffe::ExpParameter* exp_param);
+  ::opencv_caffe::ExpParameter* unsafe_arena_release_exp_param();
 
   // optional .opencv_caffe.LossParameter loss_param = 42;
   bool has_loss_param() const;
+  private:
+  bool _internal_has_loss_param() const;
+  public:
   void clear_loss_param();
-  static const int kLossParamFieldNumber = 42;
   const ::opencv_caffe::LossParameter& loss_param() const;
-  ::opencv_caffe::LossParameter* release_loss_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::LossParameter* release_loss_param();
   ::opencv_caffe::LossParameter* mutable_loss_param();
   void set_allocated_loss_param(::opencv_caffe::LossParameter* loss_param);
+  private:
+  const ::opencv_caffe::LossParameter& _internal_loss_param() const;
+  ::opencv_caffe::LossParameter* _internal_mutable_loss_param();
+  public:
+  void unsafe_arena_set_allocated_loss_param(
+      ::opencv_caffe::LossParameter* loss_param);
+  ::opencv_caffe::LossParameter* unsafe_arena_release_loss_param();
 
   // optional .opencv_caffe.V1LayerParameter.LayerType type = 5;
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 5;
   ::opencv_caffe::V1LayerParameter_LayerType type() const;
   void set_type(::opencv_caffe::V1LayerParameter_LayerType value);
+  private:
+  ::opencv_caffe::V1LayerParameter_LayerType _internal_type() const;
+  void _internal_set_type(::opencv_caffe::V1LayerParameter_LayerType value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.V1LayerParameter)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_type();
-  void clear_has_type();
-  void set_has_accuracy_param();
-  void clear_has_accuracy_param();
-  void set_has_argmax_param();
-  void clear_has_argmax_param();
-  void set_has_concat_param();
-  void clear_has_concat_param();
-  void set_has_contrastive_loss_param();
-  void clear_has_contrastive_loss_param();
-  void set_has_convolution_param();
-  void clear_has_convolution_param();
-  void set_has_data_param();
-  void clear_has_data_param();
-  void set_has_dropout_param();
-  void clear_has_dropout_param();
-  void set_has_dummy_data_param();
-  void clear_has_dummy_data_param();
-  void set_has_eltwise_param();
-  void clear_has_eltwise_param();
-  void set_has_exp_param();
-  void clear_has_exp_param();
-  void set_has_hdf5_data_param();
-  void clear_has_hdf5_data_param();
-  void set_has_hdf5_output_param();
-  void clear_has_hdf5_output_param();
-  void set_has_hinge_loss_param();
-  void clear_has_hinge_loss_param();
-  void set_has_image_data_param();
-  void clear_has_image_data_param();
-  void set_has_infogain_loss_param();
-  void clear_has_infogain_loss_param();
-  void set_has_inner_product_param();
-  void clear_has_inner_product_param();
-  void set_has_lrn_param();
-  void clear_has_lrn_param();
-  void set_has_memory_data_param();
-  void clear_has_memory_data_param();
-  void set_has_mvn_param();
-  void clear_has_mvn_param();
-  void set_has_pooling_param();
-  void clear_has_pooling_param();
-  void set_has_power_param();
-  void clear_has_power_param();
-  void set_has_relu_param();
-  void clear_has_relu_param();
-  void set_has_sigmoid_param();
-  void clear_has_sigmoid_param();
-  void set_has_softmax_param();
-  void clear_has_softmax_param();
-  void set_has_slice_param();
-  void clear_has_slice_param();
-  void set_has_tanh_param();
-  void clear_has_tanh_param();
-  void set_has_threshold_param();
-  void clear_has_threshold_param();
-  void set_has_window_data_param();
-  void clear_has_window_data_param();
-  void set_has_transform_param();
-  void clear_has_transform_param();
-  void set_has_loss_param();
-  void clear_has_loss_param();
-  void set_has_layer();
-  void clear_has_layer();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<2> _has_bits_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> bottom_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> top_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto > blobs_;
-  ::google::protobuf::RepeatedField< float > blobs_lr_;
-  ::google::protobuf::RepeatedField< float > weight_decay_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule > include_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule > exclude_;
-  ::google::protobuf::RepeatedField< float > loss_weight_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> param_;
-  ::google::protobuf::RepeatedField<int> blob_share_mode_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<2> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> bottom_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> top_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto > blobs_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > blobs_lr_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > weight_decay_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule > include_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule > exclude_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > loss_weight_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> param_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int> blob_share_mode_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
   ::opencv_caffe::V0LayerParameter* layer_;
   ::opencv_caffe::ConcatParameter* concat_param_;
   ::opencv_caffe::ConvolutionParameter* convolution_param_;
@@ -13353,563 +18800,808 @@ class V1LayerParameter : public ::google::protobuf::Message /* @@protoc_insertio
   ::opencv_caffe::ExpParameter* exp_param_;
   ::opencv_caffe::LossParameter* loss_param_;
   int type_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsV1LayerParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class V0LayerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.V0LayerParameter) */ {
+class V0LayerParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.V0LayerParameter) */ {
  public:
-  V0LayerParameter();
-  virtual ~V0LayerParameter();
+  inline V0LayerParameter() : V0LayerParameter(nullptr) {}
+  ~V0LayerParameter() override;
+  explicit constexpr V0LayerParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   V0LayerParameter(const V0LayerParameter& from);
-
-  inline V0LayerParameter& operator=(const V0LayerParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   V0LayerParameter(V0LayerParameter&& from) noexcept
     : V0LayerParameter() {
     *this = ::std::move(from);
   }
 
+  inline V0LayerParameter& operator=(const V0LayerParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline V0LayerParameter& operator=(V0LayerParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const V0LayerParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const V0LayerParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const V0LayerParameter* internal_default_instance() {
     return reinterpret_cast<const V0LayerParameter*>(
                &_V0LayerParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     65;
 
-  void Swap(V0LayerParameter* other);
   friend void swap(V0LayerParameter& a, V0LayerParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(V0LayerParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(V0LayerParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline V0LayerParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  V0LayerParameter* 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;
+  V0LayerParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<V0LayerParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const V0LayerParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const V0LayerParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(V0LayerParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.V0LayerParameter";
   }
+  protected:
+  explicit V0LayerParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef V0LayerParameter_PoolMethod PoolMethod;
-  static const PoolMethod MAX =
+  static constexpr PoolMethod MAX =
     V0LayerParameter_PoolMethod_MAX;
-  static const PoolMethod AVE =
+  static constexpr PoolMethod AVE =
     V0LayerParameter_PoolMethod_AVE;
-  static const PoolMethod STOCHASTIC =
+  static constexpr PoolMethod STOCHASTIC =
     V0LayerParameter_PoolMethod_STOCHASTIC;
   static inline bool PoolMethod_IsValid(int value) {
     return V0LayerParameter_PoolMethod_IsValid(value);
   }
-  static const PoolMethod PoolMethod_MIN =
+  static constexpr PoolMethod PoolMethod_MIN =
     V0LayerParameter_PoolMethod_PoolMethod_MIN;
-  static const PoolMethod PoolMethod_MAX =
+  static constexpr PoolMethod PoolMethod_MAX =
     V0LayerParameter_PoolMethod_PoolMethod_MAX;
-  static const int PoolMethod_ARRAYSIZE =
+  static constexpr int PoolMethod_ARRAYSIZE =
     V0LayerParameter_PoolMethod_PoolMethod_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   PoolMethod_descriptor() {
     return V0LayerParameter_PoolMethod_descriptor();
   }
-  static inline const ::std::string& PoolMethod_Name(PoolMethod value) {
-    return V0LayerParameter_PoolMethod_Name(value);
+  template<typename T>
+  static inline const std::string& PoolMethod_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, PoolMethod>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function PoolMethod_Name.");
+    return V0LayerParameter_PoolMethod_Name(enum_t_value);
   }
-  static inline bool PoolMethod_Parse(const ::std::string& name,
+  static inline bool PoolMethod_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       PoolMethod* value) {
     return V0LayerParameter_PoolMethod_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kBlobsFieldNumber = 50,
+    kBlobsLrFieldNumber = 51,
+    kWeightDecayFieldNumber = 52,
+    kNameFieldNumber = 1,
+    kTypeFieldNumber = 2,
+    kSourceFieldNumber = 16,
+    kMeanfileFieldNumber = 18,
+    kDetCropModeFieldNumber = 59,
+    kWeightFillerFieldNumber = 5,
+    kBiasFillerFieldNumber = 6,
+    kHdf5OutputParamFieldNumber = 1001,
+    kNumOutputFieldNumber = 3,
+    kPadFieldNumber = 7,
+    kKernelsizeFieldNumber = 8,
+    kPoolFieldNumber = 11,
+    kBatchsizeFieldNumber = 19,
+    kCropsizeFieldNumber = 20,
+    kNewWidthFieldNumber = 63,
+    kMirrorFieldNumber = 21,
+    kShuffleImagesFieldNumber = 64,
+    kRandSkipFieldNumber = 53,
+    kDetContextPadFieldNumber = 58,
+    kNewNumFieldNumber = 60,
+    kNewChannelsFieldNumber = 61,
+    kNewHeightFieldNumber = 62,
+    kConcatDimFieldNumber = 65,
+    kBiastermFieldNumber = 4,
+    kGroupFieldNumber = 9,
+    kStrideFieldNumber = 10,
+    kDropoutRatioFieldNumber = 12,
+    kLocalSizeFieldNumber = 13,
+    kAlphaFieldNumber = 14,
+    kBetaFieldNumber = 15,
+    kScaleFieldNumber = 17,
+    kKFieldNumber = 22,
+    kDetFgThresholdFieldNumber = 54,
+    kDetBgThresholdFieldNumber = 55,
+    kDetFgFractionFieldNumber = 56,
+  };
   // repeated .opencv_caffe.BlobProto blobs = 50;
   int blobs_size() const;
+  private:
+  int _internal_blobs_size() const;
+  public:
   void clear_blobs();
-  static const int kBlobsFieldNumber = 50;
-  const ::opencv_caffe::BlobProto& blobs(int index) const;
   ::opencv_caffe::BlobProto* mutable_blobs(int index);
-  ::opencv_caffe::BlobProto* add_blobs();
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
       mutable_blobs();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+  private:
+  const ::opencv_caffe::BlobProto& _internal_blobs(int index) const;
+  ::opencv_caffe::BlobProto* _internal_add_blobs();
+  public:
+  const ::opencv_caffe::BlobProto& blobs(int index) const;
+  ::opencv_caffe::BlobProto* add_blobs();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
       blobs() const;
 
   // repeated float blobs_lr = 51;
   int blobs_lr_size() const;
+  private:
+  int _internal_blobs_lr_size() const;
+  public:
   void clear_blobs_lr();
-  static const int kBlobsLrFieldNumber = 51;
+  private:
+  float _internal_blobs_lr(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_blobs_lr() const;
+  void _internal_add_blobs_lr(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_blobs_lr();
+  public:
   float blobs_lr(int index) const;
   void set_blobs_lr(int index, float value);
   void add_blobs_lr(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       blobs_lr() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_blobs_lr();
 
   // repeated float weight_decay = 52;
   int weight_decay_size() const;
+  private:
+  int _internal_weight_decay_size() const;
+  public:
   void clear_weight_decay();
-  static const int kWeightDecayFieldNumber = 52;
+  private:
+  float _internal_weight_decay(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_weight_decay() const;
+  void _internal_add_weight_decay(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_weight_decay();
+  public:
   float weight_decay(int index) const;
   void set_weight_decay(int index, float value);
   void add_weight_decay(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       weight_decay() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_weight_decay();
 
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional string type = 2;
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 2;
-  const ::std::string& type() const;
-  void set_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type(::std::string&& value);
-  #endif
-  void set_type(const char* value);
-  void set_type(const char* value, size_t size);
-  ::std::string* mutable_type();
-  ::std::string* release_type();
-  void set_allocated_type(::std::string* type);
+  const std::string& type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_type();
+  PROTOBUF_NODISCARD std::string* release_type();
+  void set_allocated_type(std::string* type);
+  private:
+  const std::string& _internal_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_type(const std::string& value);
+  std::string* _internal_mutable_type();
+  public:
 
   // optional string source = 16;
   bool has_source() const;
+  private:
+  bool _internal_has_source() const;
+  public:
   void clear_source();
-  static const int kSourceFieldNumber = 16;
-  const ::std::string& source() const;
-  void set_source(const ::std::string& value);
-  #if LANG_CXX11
-  void set_source(::std::string&& value);
-  #endif
-  void set_source(const char* value);
-  void set_source(const char* value, size_t size);
-  ::std::string* mutable_source();
-  ::std::string* release_source();
-  void set_allocated_source(::std::string* source);
+  const std::string& source() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_source(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_source();
+  PROTOBUF_NODISCARD std::string* release_source();
+  void set_allocated_source(std::string* source);
+  private:
+  const std::string& _internal_source() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_source(const std::string& value);
+  std::string* _internal_mutable_source();
+  public:
 
   // optional string meanfile = 18;
   bool has_meanfile() const;
+  private:
+  bool _internal_has_meanfile() const;
+  public:
   void clear_meanfile();
-  static const int kMeanfileFieldNumber = 18;
-  const ::std::string& meanfile() const;
-  void set_meanfile(const ::std::string& value);
-  #if LANG_CXX11
-  void set_meanfile(::std::string&& value);
-  #endif
-  void set_meanfile(const char* value);
-  void set_meanfile(const char* value, size_t size);
-  ::std::string* mutable_meanfile();
-  ::std::string* release_meanfile();
-  void set_allocated_meanfile(::std::string* meanfile);
+  const std::string& meanfile() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_meanfile(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_meanfile();
+  PROTOBUF_NODISCARD std::string* release_meanfile();
+  void set_allocated_meanfile(std::string* meanfile);
+  private:
+  const std::string& _internal_meanfile() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_meanfile(const std::string& value);
+  std::string* _internal_mutable_meanfile();
+  public:
 
   // optional string det_crop_mode = 59 [default = "warp"];
   bool has_det_crop_mode() const;
+  private:
+  bool _internal_has_det_crop_mode() const;
+  public:
   void clear_det_crop_mode();
-  static const int kDetCropModeFieldNumber = 59;
-  const ::std::string& det_crop_mode() const;
-  void set_det_crop_mode(const ::std::string& value);
-  #if LANG_CXX11
-  void set_det_crop_mode(::std::string&& value);
-  #endif
-  void set_det_crop_mode(const char* value);
-  void set_det_crop_mode(const char* value, size_t size);
-  ::std::string* mutable_det_crop_mode();
-  ::std::string* release_det_crop_mode();
-  void set_allocated_det_crop_mode(::std::string* det_crop_mode);
+  const std::string& det_crop_mode() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_det_crop_mode(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_det_crop_mode();
+  PROTOBUF_NODISCARD std::string* release_det_crop_mode();
+  void set_allocated_det_crop_mode(std::string* det_crop_mode);
+  private:
+  const std::string& _internal_det_crop_mode() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_det_crop_mode(const std::string& value);
+  std::string* _internal_mutable_det_crop_mode();
+  public:
 
   // optional .opencv_caffe.FillerParameter weight_filler = 5;
   bool has_weight_filler() const;
+  private:
+  bool _internal_has_weight_filler() const;
+  public:
   void clear_weight_filler();
-  static const int kWeightFillerFieldNumber = 5;
   const ::opencv_caffe::FillerParameter& weight_filler() const;
-  ::opencv_caffe::FillerParameter* release_weight_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_weight_filler();
   ::opencv_caffe::FillerParameter* mutable_weight_filler();
   void set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_weight_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_weight_filler();
+  public:
+  void unsafe_arena_set_allocated_weight_filler(
+      ::opencv_caffe::FillerParameter* weight_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_weight_filler();
 
   // optional .opencv_caffe.FillerParameter bias_filler = 6;
   bool has_bias_filler() const;
+  private:
+  bool _internal_has_bias_filler() const;
+  public:
   void clear_bias_filler();
-  static const int kBiasFillerFieldNumber = 6;
   const ::opencv_caffe::FillerParameter& bias_filler() const;
-  ::opencv_caffe::FillerParameter* release_bias_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_bias_filler();
   ::opencv_caffe::FillerParameter* mutable_bias_filler();
   void set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_bias_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_bias_filler();
+  public:
+  void unsafe_arena_set_allocated_bias_filler(
+      ::opencv_caffe::FillerParameter* bias_filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_bias_filler();
 
   // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 1001;
   bool has_hdf5_output_param() const;
+  private:
+  bool _internal_has_hdf5_output_param() const;
+  public:
   void clear_hdf5_output_param();
-  static const int kHdf5OutputParamFieldNumber = 1001;
   const ::opencv_caffe::HDF5OutputParameter& hdf5_output_param() const;
-  ::opencv_caffe::HDF5OutputParameter* release_hdf5_output_param();
+  PROTOBUF_NODISCARD ::opencv_caffe::HDF5OutputParameter* release_hdf5_output_param();
   ::opencv_caffe::HDF5OutputParameter* mutable_hdf5_output_param();
   void set_allocated_hdf5_output_param(::opencv_caffe::HDF5OutputParameter* hdf5_output_param);
+  private:
+  const ::opencv_caffe::HDF5OutputParameter& _internal_hdf5_output_param() const;
+  ::opencv_caffe::HDF5OutputParameter* _internal_mutable_hdf5_output_param();
+  public:
+  void unsafe_arena_set_allocated_hdf5_output_param(
+      ::opencv_caffe::HDF5OutputParameter* hdf5_output_param);
+  ::opencv_caffe::HDF5OutputParameter* unsafe_arena_release_hdf5_output_param();
 
   // optional uint32 num_output = 3;
   bool has_num_output() const;
+  private:
+  bool _internal_has_num_output() const;
+  public:
   void clear_num_output();
-  static const int kNumOutputFieldNumber = 3;
-  ::google::protobuf::uint32 num_output() const;
-  void set_num_output(::google::protobuf::uint32 value);
+  uint32_t num_output() const;
+  void set_num_output(uint32_t value);
+  private:
+  uint32_t _internal_num_output() const;
+  void _internal_set_num_output(uint32_t value);
+  public:
 
   // optional uint32 pad = 7 [default = 0];
   bool has_pad() const;
-  void clear_pad();
-  static const int kPadFieldNumber = 7;
-  ::google::protobuf::uint32 pad() const;
-  void set_pad(::google::protobuf::uint32 value);
+  private:
+  bool _internal_has_pad() const;
+  public:
+  void clear_pad();
+  uint32_t pad() const;
+  void set_pad(uint32_t value);
+  private:
+  uint32_t _internal_pad() const;
+  void _internal_set_pad(uint32_t value);
+  public:
 
   // optional uint32 kernelsize = 8;
   bool has_kernelsize() const;
+  private:
+  bool _internal_has_kernelsize() const;
+  public:
   void clear_kernelsize();
-  static const int kKernelsizeFieldNumber = 8;
-  ::google::protobuf::uint32 kernelsize() const;
-  void set_kernelsize(::google::protobuf::uint32 value);
+  uint32_t kernelsize() const;
+  void set_kernelsize(uint32_t value);
+  private:
+  uint32_t _internal_kernelsize() const;
+  void _internal_set_kernelsize(uint32_t value);
+  public:
 
   // optional .opencv_caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX];
   bool has_pool() const;
+  private:
+  bool _internal_has_pool() const;
+  public:
   void clear_pool();
-  static const int kPoolFieldNumber = 11;
   ::opencv_caffe::V0LayerParameter_PoolMethod pool() const;
   void set_pool(::opencv_caffe::V0LayerParameter_PoolMethod value);
+  private:
+  ::opencv_caffe::V0LayerParameter_PoolMethod _internal_pool() const;
+  void _internal_set_pool(::opencv_caffe::V0LayerParameter_PoolMethod value);
+  public:
 
   // optional uint32 batchsize = 19;
   bool has_batchsize() const;
+  private:
+  bool _internal_has_batchsize() const;
+  public:
   void clear_batchsize();
-  static const int kBatchsizeFieldNumber = 19;
-  ::google::protobuf::uint32 batchsize() const;
-  void set_batchsize(::google::protobuf::uint32 value);
+  uint32_t batchsize() const;
+  void set_batchsize(uint32_t value);
+  private:
+  uint32_t _internal_batchsize() const;
+  void _internal_set_batchsize(uint32_t value);
+  public:
 
   // optional uint32 cropsize = 20 [default = 0];
   bool has_cropsize() const;
+  private:
+  bool _internal_has_cropsize() const;
+  public:
   void clear_cropsize();
-  static const int kCropsizeFieldNumber = 20;
-  ::google::protobuf::uint32 cropsize() const;
-  void set_cropsize(::google::protobuf::uint32 value);
+  uint32_t cropsize() const;
+  void set_cropsize(uint32_t value);
+  private:
+  uint32_t _internal_cropsize() const;
+  void _internal_set_cropsize(uint32_t value);
+  public:
 
   // optional int32 new_width = 63 [default = 0];
   bool has_new_width() const;
+  private:
+  bool _internal_has_new_width() const;
+  public:
   void clear_new_width();
-  static const int kNewWidthFieldNumber = 63;
-  ::google::protobuf::int32 new_width() const;
-  void set_new_width(::google::protobuf::int32 value);
+  int32_t new_width() const;
+  void set_new_width(int32_t value);
+  private:
+  int32_t _internal_new_width() const;
+  void _internal_set_new_width(int32_t value);
+  public:
 
   // optional bool mirror = 21 [default = false];
   bool has_mirror() const;
+  private:
+  bool _internal_has_mirror() const;
+  public:
   void clear_mirror();
-  static const int kMirrorFieldNumber = 21;
   bool mirror() const;
   void set_mirror(bool value);
+  private:
+  bool _internal_mirror() const;
+  void _internal_set_mirror(bool value);
+  public:
 
   // optional bool shuffle_images = 64 [default = false];
   bool has_shuffle_images() const;
+  private:
+  bool _internal_has_shuffle_images() const;
+  public:
   void clear_shuffle_images();
-  static const int kShuffleImagesFieldNumber = 64;
   bool shuffle_images() const;
   void set_shuffle_images(bool value);
+  private:
+  bool _internal_shuffle_images() const;
+  void _internal_set_shuffle_images(bool value);
+  public:
 
   // optional uint32 rand_skip = 53 [default = 0];
   bool has_rand_skip() const;
+  private:
+  bool _internal_has_rand_skip() const;
+  public:
   void clear_rand_skip();
-  static const int kRandSkipFieldNumber = 53;
-  ::google::protobuf::uint32 rand_skip() const;
-  void set_rand_skip(::google::protobuf::uint32 value);
+  uint32_t rand_skip() const;
+  void set_rand_skip(uint32_t value);
+  private:
+  uint32_t _internal_rand_skip() const;
+  void _internal_set_rand_skip(uint32_t value);
+  public:
 
   // optional uint32 det_context_pad = 58 [default = 0];
   bool has_det_context_pad() const;
+  private:
+  bool _internal_has_det_context_pad() const;
+  public:
   void clear_det_context_pad();
-  static const int kDetContextPadFieldNumber = 58;
-  ::google::protobuf::uint32 det_context_pad() const;
-  void set_det_context_pad(::google::protobuf::uint32 value);
+  uint32_t det_context_pad() const;
+  void set_det_context_pad(uint32_t value);
+  private:
+  uint32_t _internal_det_context_pad() const;
+  void _internal_set_det_context_pad(uint32_t value);
+  public:
 
   // optional int32 new_num = 60 [default = 0];
   bool has_new_num() const;
+  private:
+  bool _internal_has_new_num() const;
+  public:
   void clear_new_num();
-  static const int kNewNumFieldNumber = 60;
-  ::google::protobuf::int32 new_num() const;
-  void set_new_num(::google::protobuf::int32 value);
+  int32_t new_num() const;
+  void set_new_num(int32_t value);
+  private:
+  int32_t _internal_new_num() const;
+  void _internal_set_new_num(int32_t value);
+  public:
 
   // optional int32 new_channels = 61 [default = 0];
   bool has_new_channels() const;
+  private:
+  bool _internal_has_new_channels() const;
+  public:
   void clear_new_channels();
-  static const int kNewChannelsFieldNumber = 61;
-  ::google::protobuf::int32 new_channels() const;
-  void set_new_channels(::google::protobuf::int32 value);
+  int32_t new_channels() const;
+  void set_new_channels(int32_t value);
+  private:
+  int32_t _internal_new_channels() const;
+  void _internal_set_new_channels(int32_t value);
+  public:
 
   // optional int32 new_height = 62 [default = 0];
   bool has_new_height() const;
+  private:
+  bool _internal_has_new_height() const;
+  public:
   void clear_new_height();
-  static const int kNewHeightFieldNumber = 62;
-  ::google::protobuf::int32 new_height() const;
-  void set_new_height(::google::protobuf::int32 value);
+  int32_t new_height() const;
+  void set_new_height(int32_t value);
+  private:
+  int32_t _internal_new_height() const;
+  void _internal_set_new_height(int32_t value);
+  public:
 
   // optional uint32 concat_dim = 65 [default = 1];
   bool has_concat_dim() const;
+  private:
+  bool _internal_has_concat_dim() const;
+  public:
   void clear_concat_dim();
-  static const int kConcatDimFieldNumber = 65;
-  ::google::protobuf::uint32 concat_dim() const;
-  void set_concat_dim(::google::protobuf::uint32 value);
+  uint32_t concat_dim() const;
+  void set_concat_dim(uint32_t value);
+  private:
+  uint32_t _internal_concat_dim() const;
+  void _internal_set_concat_dim(uint32_t value);
+  public:
 
   // optional bool biasterm = 4 [default = true];
   bool has_biasterm() const;
+  private:
+  bool _internal_has_biasterm() const;
+  public:
   void clear_biasterm();
-  static const int kBiastermFieldNumber = 4;
   bool biasterm() const;
   void set_biasterm(bool value);
+  private:
+  bool _internal_biasterm() const;
+  void _internal_set_biasterm(bool value);
+  public:
 
   // optional uint32 group = 9 [default = 1];
   bool has_group() const;
+  private:
+  bool _internal_has_group() const;
+  public:
   void clear_group();
-  static const int kGroupFieldNumber = 9;
-  ::google::protobuf::uint32 group() const;
-  void set_group(::google::protobuf::uint32 value);
+  uint32_t group() const;
+  void set_group(uint32_t value);
+  private:
+  uint32_t _internal_group() const;
+  void _internal_set_group(uint32_t value);
+  public:
 
   // optional uint32 stride = 10 [default = 1];
   bool has_stride() const;
+  private:
+  bool _internal_has_stride() const;
+  public:
   void clear_stride();
-  static const int kStrideFieldNumber = 10;
-  ::google::protobuf::uint32 stride() const;
-  void set_stride(::google::protobuf::uint32 value);
+  uint32_t stride() const;
+  void set_stride(uint32_t value);
+  private:
+  uint32_t _internal_stride() const;
+  void _internal_set_stride(uint32_t value);
+  public:
 
   // optional float dropout_ratio = 12 [default = 0.5];
   bool has_dropout_ratio() const;
+  private:
+  bool _internal_has_dropout_ratio() const;
+  public:
   void clear_dropout_ratio();
-  static const int kDropoutRatioFieldNumber = 12;
   float dropout_ratio() const;
   void set_dropout_ratio(float value);
+  private:
+  float _internal_dropout_ratio() const;
+  void _internal_set_dropout_ratio(float value);
+  public:
 
   // optional uint32 local_size = 13 [default = 5];
   bool has_local_size() const;
+  private:
+  bool _internal_has_local_size() const;
+  public:
   void clear_local_size();
-  static const int kLocalSizeFieldNumber = 13;
-  ::google::protobuf::uint32 local_size() const;
-  void set_local_size(::google::protobuf::uint32 value);
+  uint32_t local_size() const;
+  void set_local_size(uint32_t value);
+  private:
+  uint32_t _internal_local_size() const;
+  void _internal_set_local_size(uint32_t value);
+  public:
 
   // optional float alpha = 14 [default = 1];
   bool has_alpha() const;
+  private:
+  bool _internal_has_alpha() const;
+  public:
   void clear_alpha();
-  static const int kAlphaFieldNumber = 14;
   float alpha() const;
   void set_alpha(float value);
+  private:
+  float _internal_alpha() const;
+  void _internal_set_alpha(float value);
+  public:
 
   // optional float beta = 15 [default = 0.75];
   bool has_beta() const;
+  private:
+  bool _internal_has_beta() const;
+  public:
   void clear_beta();
-  static const int kBetaFieldNumber = 15;
   float beta() const;
   void set_beta(float value);
+  private:
+  float _internal_beta() const;
+  void _internal_set_beta(float value);
+  public:
 
   // optional float scale = 17 [default = 1];
   bool has_scale() const;
+  private:
+  bool _internal_has_scale() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 17;
   float scale() const;
   void set_scale(float value);
+  private:
+  float _internal_scale() const;
+  void _internal_set_scale(float value);
+  public:
 
   // optional float k = 22 [default = 1];
   bool has_k() const;
+  private:
+  bool _internal_has_k() const;
+  public:
   void clear_k();
-  static const int kKFieldNumber = 22;
   float k() const;
   void set_k(float value);
+  private:
+  float _internal_k() const;
+  void _internal_set_k(float value);
+  public:
 
   // optional float det_fg_threshold = 54 [default = 0.5];
   bool has_det_fg_threshold() const;
+  private:
+  bool _internal_has_det_fg_threshold() const;
+  public:
   void clear_det_fg_threshold();
-  static const int kDetFgThresholdFieldNumber = 54;
   float det_fg_threshold() const;
   void set_det_fg_threshold(float value);
+  private:
+  float _internal_det_fg_threshold() const;
+  void _internal_set_det_fg_threshold(float value);
+  public:
 
   // optional float det_bg_threshold = 55 [default = 0.5];
   bool has_det_bg_threshold() const;
+  private:
+  bool _internal_has_det_bg_threshold() const;
+  public:
   void clear_det_bg_threshold();
-  static const int kDetBgThresholdFieldNumber = 55;
   float det_bg_threshold() const;
   void set_det_bg_threshold(float value);
+  private:
+  float _internal_det_bg_threshold() const;
+  void _internal_set_det_bg_threshold(float value);
+  public:
 
   // optional float det_fg_fraction = 56 [default = 0.25];
   bool has_det_fg_fraction() const;
+  private:
+  bool _internal_has_det_fg_fraction() const;
+  public:
   void clear_det_fg_fraction();
-  static const int kDetFgFractionFieldNumber = 56;
   float det_fg_fraction() const;
   void set_det_fg_fraction(float value);
+  private:
+  float _internal_det_fg_fraction() const;
+  void _internal_set_det_fg_fraction(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.V0LayerParameter)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_type();
-  void clear_has_type();
-  void set_has_num_output();
-  void clear_has_num_output();
-  void set_has_biasterm();
-  void clear_has_biasterm();
-  void set_has_weight_filler();
-  void clear_has_weight_filler();
-  void set_has_bias_filler();
-  void clear_has_bias_filler();
-  void set_has_pad();
-  void clear_has_pad();
-  void set_has_kernelsize();
-  void clear_has_kernelsize();
-  void set_has_group();
-  void clear_has_group();
-  void set_has_stride();
-  void clear_has_stride();
-  void set_has_pool();
-  void clear_has_pool();
-  void set_has_dropout_ratio();
-  void clear_has_dropout_ratio();
-  void set_has_local_size();
-  void clear_has_local_size();
-  void set_has_alpha();
-  void clear_has_alpha();
-  void set_has_beta();
-  void clear_has_beta();
-  void set_has_k();
-  void clear_has_k();
-  void set_has_source();
-  void clear_has_source();
-  void set_has_scale();
-  void clear_has_scale();
-  void set_has_meanfile();
-  void clear_has_meanfile();
-  void set_has_batchsize();
-  void clear_has_batchsize();
-  void set_has_cropsize();
-  void clear_has_cropsize();
-  void set_has_mirror();
-  void clear_has_mirror();
-  void set_has_rand_skip();
-  void clear_has_rand_skip();
-  void set_has_det_fg_threshold();
-  void clear_has_det_fg_threshold();
-  void set_has_det_bg_threshold();
-  void clear_has_det_bg_threshold();
-  void set_has_det_fg_fraction();
-  void clear_has_det_fg_fraction();
-  void set_has_det_context_pad();
-  void clear_has_det_context_pad();
-  void set_has_det_crop_mode();
-  void clear_has_det_crop_mode();
-  void set_has_new_num();
-  void clear_has_new_num();
-  void set_has_new_channels();
-  void clear_has_new_channels();
-  void set_has_new_height();
-  void clear_has_new_height();
-  void set_has_new_width();
-  void clear_has_new_width();
-  void set_has_shuffle_images();
-  void clear_has_shuffle_images();
-  void set_has_concat_dim();
-  void clear_has_concat_dim();
-  void set_has_hdf5_output_param();
-  void clear_has_hdf5_output_param();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<2> _has_bits_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto > blobs_;
-  ::google::protobuf::RepeatedField< float > blobs_lr_;
-  ::google::protobuf::RepeatedField< float > weight_decay_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr type_;
-  ::google::protobuf::internal::ArenaStringPtr source_;
-  ::google::protobuf::internal::ArenaStringPtr meanfile_;
-  static ::google::protobuf::internal::ExplicitlyConstructed< ::std::string> _default_det_crop_mode_;
-  ::google::protobuf::internal::ArenaStringPtr det_crop_mode_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<2> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto > blobs_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > blobs_lr_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > weight_decay_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr meanfile_;
+  static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_det_crop_mode_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr det_crop_mode_;
   ::opencv_caffe::FillerParameter* weight_filler_;
   ::opencv_caffe::FillerParameter* bias_filler_;
   ::opencv_caffe::HDF5OutputParameter* hdf5_output_param_;
-  ::google::protobuf::uint32 num_output_;
-  ::google::protobuf::uint32 pad_;
-  ::google::protobuf::uint32 kernelsize_;
+  uint32_t num_output_;
+  uint32_t pad_;
+  uint32_t kernelsize_;
   int pool_;
-  ::google::protobuf::uint32 batchsize_;
-  ::google::protobuf::uint32 cropsize_;
-  ::google::protobuf::int32 new_width_;
+  uint32_t batchsize_;
+  uint32_t cropsize_;
+  int32_t new_width_;
   bool mirror_;
   bool shuffle_images_;
-  ::google::protobuf::uint32 rand_skip_;
-  ::google::protobuf::uint32 det_context_pad_;
-  ::google::protobuf::int32 new_num_;
-  ::google::protobuf::int32 new_channels_;
-  ::google::protobuf::int32 new_height_;
-  ::google::protobuf::uint32 concat_dim_;
+  uint32_t rand_skip_;
+  uint32_t det_context_pad_;
+  int32_t new_num_;
+  int32_t new_channels_;
+  int32_t new_height_;
+  uint32_t concat_dim_;
   bool biasterm_;
-  ::google::protobuf::uint32 group_;
-  ::google::protobuf::uint32 stride_;
+  uint32_t group_;
+  uint32_t stride_;
   float dropout_ratio_;
-  ::google::protobuf::uint32 local_size_;
+  uint32_t local_size_;
   float alpha_;
   float beta_;
   float scale_;
@@ -13917,760 +19609,1108 @@ class V0LayerParameter : public ::google::protobuf::Message /* @@protoc_insertio
   float det_fg_threshold_;
   float det_bg_threshold_;
   float det_fg_fraction_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsV0LayerParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class PReLUParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PReLUParameter) */ {
+class PReLUParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PReLUParameter) */ {
  public:
-  PReLUParameter();
-  virtual ~PReLUParameter();
+  inline PReLUParameter() : PReLUParameter(nullptr) {}
+  ~PReLUParameter() override;
+  explicit constexpr PReLUParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   PReLUParameter(const PReLUParameter& from);
-
-  inline PReLUParameter& operator=(const PReLUParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   PReLUParameter(PReLUParameter&& from) noexcept
     : PReLUParameter() {
     *this = ::std::move(from);
   }
 
+  inline PReLUParameter& operator=(const PReLUParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline PReLUParameter& operator=(PReLUParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const PReLUParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const PReLUParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const PReLUParameter* internal_default_instance() {
     return reinterpret_cast<const PReLUParameter*>(
                &_PReLUParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     66;
 
-  void Swap(PReLUParameter* other);
   friend void swap(PReLUParameter& a, PReLUParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(PReLUParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(PReLUParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline PReLUParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  PReLUParameter* 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;
+  PReLUParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<PReLUParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const PReLUParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const PReLUParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(PReLUParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.PReLUParameter";
   }
+  protected:
+  explicit PReLUParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFillerFieldNumber = 1,
+    kChannelSharedFieldNumber = 2,
+  };
   // optional .opencv_caffe.FillerParameter filler = 1;
   bool has_filler() const;
+  private:
+  bool _internal_has_filler() const;
+  public:
   void clear_filler();
-  static const int kFillerFieldNumber = 1;
   const ::opencv_caffe::FillerParameter& filler() const;
-  ::opencv_caffe::FillerParameter* release_filler();
+  PROTOBUF_NODISCARD ::opencv_caffe::FillerParameter* release_filler();
   ::opencv_caffe::FillerParameter* mutable_filler();
   void set_allocated_filler(::opencv_caffe::FillerParameter* filler);
+  private:
+  const ::opencv_caffe::FillerParameter& _internal_filler() const;
+  ::opencv_caffe::FillerParameter* _internal_mutable_filler();
+  public:
+  void unsafe_arena_set_allocated_filler(
+      ::opencv_caffe::FillerParameter* filler);
+  ::opencv_caffe::FillerParameter* unsafe_arena_release_filler();
 
   // optional bool channel_shared = 2 [default = false];
   bool has_channel_shared() const;
+  private:
+  bool _internal_has_channel_shared() const;
+  public:
   void clear_channel_shared();
-  static const int kChannelSharedFieldNumber = 2;
   bool channel_shared() const;
   void set_channel_shared(bool value);
+  private:
+  bool _internal_channel_shared() const;
+  void _internal_set_channel_shared(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.PReLUParameter)
  private:
-  void set_has_filler();
-  void clear_has_filler();
-  void set_has_channel_shared();
-  void clear_has_channel_shared();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_caffe::FillerParameter* filler_;
   bool channel_shared_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPReLUParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NormalizedBBox : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NormalizedBBox) */ {
+class NormalizedBBox final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.NormalizedBBox) */ {
  public:
-  NormalizedBBox();
-  virtual ~NormalizedBBox();
+  inline NormalizedBBox() : NormalizedBBox(nullptr) {}
+  ~NormalizedBBox() override;
+  explicit constexpr NormalizedBBox(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NormalizedBBox(const NormalizedBBox& from);
-
-  inline NormalizedBBox& operator=(const NormalizedBBox& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NormalizedBBox(NormalizedBBox&& from) noexcept
     : NormalizedBBox() {
     *this = ::std::move(from);
   }
 
+  inline NormalizedBBox& operator=(const NormalizedBBox& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NormalizedBBox& operator=(NormalizedBBox&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NormalizedBBox& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NormalizedBBox& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NormalizedBBox* internal_default_instance() {
     return reinterpret_cast<const NormalizedBBox*>(
                &_NormalizedBBox_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     67;
 
-  void Swap(NormalizedBBox* other);
   friend void swap(NormalizedBBox& a, NormalizedBBox& b) {
     a.Swap(&b);
   }
+  inline void Swap(NormalizedBBox* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NormalizedBBox* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NormalizedBBox* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NormalizedBBox* 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;
+  NormalizedBBox* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NormalizedBBox>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NormalizedBBox& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NormalizedBBox& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NormalizedBBox* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.NormalizedBBox";
   }
+  protected:
+  explicit NormalizedBBox(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kXminFieldNumber = 1,
+    kYminFieldNumber = 2,
+    kXmaxFieldNumber = 3,
+    kYmaxFieldNumber = 4,
+    kLabelFieldNumber = 5,
+    kDifficultFieldNumber = 6,
+    kScoreFieldNumber = 7,
+    kSizeFieldNumber = 8,
+  };
   // optional float xmin = 1;
   bool has_xmin() const;
+  private:
+  bool _internal_has_xmin() const;
+  public:
   void clear_xmin();
-  static const int kXminFieldNumber = 1;
   float xmin() const;
   void set_xmin(float value);
+  private:
+  float _internal_xmin() const;
+  void _internal_set_xmin(float value);
+  public:
 
   // optional float ymin = 2;
   bool has_ymin() const;
+  private:
+  bool _internal_has_ymin() const;
+  public:
   void clear_ymin();
-  static const int kYminFieldNumber = 2;
   float ymin() const;
   void set_ymin(float value);
+  private:
+  float _internal_ymin() const;
+  void _internal_set_ymin(float value);
+  public:
 
   // optional float xmax = 3;
   bool has_xmax() const;
+  private:
+  bool _internal_has_xmax() const;
+  public:
   void clear_xmax();
-  static const int kXmaxFieldNumber = 3;
   float xmax() const;
   void set_xmax(float value);
+  private:
+  float _internal_xmax() const;
+  void _internal_set_xmax(float value);
+  public:
 
   // optional float ymax = 4;
   bool has_ymax() const;
+  private:
+  bool _internal_has_ymax() const;
+  public:
   void clear_ymax();
-  static const int kYmaxFieldNumber = 4;
   float ymax() const;
   void set_ymax(float value);
+  private:
+  float _internal_ymax() const;
+  void _internal_set_ymax(float value);
+  public:
 
   // optional int32 label = 5;
   bool has_label() const;
+  private:
+  bool _internal_has_label() const;
+  public:
   void clear_label();
-  static const int kLabelFieldNumber = 5;
-  ::google::protobuf::int32 label() const;
-  void set_label(::google::protobuf::int32 value);
+  int32_t label() const;
+  void set_label(int32_t value);
+  private:
+  int32_t _internal_label() const;
+  void _internal_set_label(int32_t value);
+  public:
 
   // optional bool difficult = 6;
   bool has_difficult() const;
+  private:
+  bool _internal_has_difficult() const;
+  public:
   void clear_difficult();
-  static const int kDifficultFieldNumber = 6;
   bool difficult() const;
   void set_difficult(bool value);
+  private:
+  bool _internal_difficult() const;
+  void _internal_set_difficult(bool value);
+  public:
 
   // optional float score = 7;
   bool has_score() const;
+  private:
+  bool _internal_has_score() const;
+  public:
   void clear_score();
-  static const int kScoreFieldNumber = 7;
   float score() const;
   void set_score(float value);
+  private:
+  float _internal_score() const;
+  void _internal_set_score(float value);
+  public:
 
   // optional float size = 8;
   bool has_size() const;
+  private:
+  bool _internal_has_size() const;
+  public:
   void clear_size();
-  static const int kSizeFieldNumber = 8;
   float size() const;
   void set_size(float value);
+  private:
+  float _internal_size() const;
+  void _internal_set_size(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.NormalizedBBox)
  private:
-  void set_has_xmin();
-  void clear_has_xmin();
-  void set_has_ymin();
-  void clear_has_ymin();
-  void set_has_xmax();
-  void clear_has_xmax();
-  void set_has_ymax();
-  void clear_has_ymax();
-  void set_has_label();
-  void clear_has_label();
-  void set_has_difficult();
-  void clear_has_difficult();
-  void set_has_score();
-  void clear_has_score();
-  void set_has_size();
-  void clear_has_size();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float xmin_;
   float ymin_;
   float xmax_;
   float ymax_;
-  ::google::protobuf::int32 label_;
+  int32_t label_;
   bool difficult_;
   float score_;
   float size_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsNormalizedBBoxImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ROIPoolingParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ROIPoolingParameter) */ {
+class ROIPoolingParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ROIPoolingParameter) */ {
  public:
-  ROIPoolingParameter();
-  virtual ~ROIPoolingParameter();
+  inline ROIPoolingParameter() : ROIPoolingParameter(nullptr) {}
+  ~ROIPoolingParameter() override;
+  explicit constexpr ROIPoolingParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ROIPoolingParameter(const ROIPoolingParameter& from);
-
-  inline ROIPoolingParameter& operator=(const ROIPoolingParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ROIPoolingParameter(ROIPoolingParameter&& from) noexcept
     : ROIPoolingParameter() {
     *this = ::std::move(from);
   }
 
+  inline ROIPoolingParameter& operator=(const ROIPoolingParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ROIPoolingParameter& operator=(ROIPoolingParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ROIPoolingParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ROIPoolingParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ROIPoolingParameter* internal_default_instance() {
     return reinterpret_cast<const ROIPoolingParameter*>(
                &_ROIPoolingParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     68;
 
-  void Swap(ROIPoolingParameter* other);
   friend void swap(ROIPoolingParameter& a, ROIPoolingParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ROIPoolingParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ROIPoolingParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ROIPoolingParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ROIPoolingParameter* 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;
+  ROIPoolingParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ROIPoolingParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ROIPoolingParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ROIPoolingParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ROIPoolingParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ROIPoolingParameter";
   }
+  protected:
+  explicit ROIPoolingParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kPooledHFieldNumber = 1,
+    kPooledWFieldNumber = 2,
+    kSpatialScaleFieldNumber = 3,
+  };
   // optional uint32 pooled_h = 1 [default = 0];
   bool has_pooled_h() const;
+  private:
+  bool _internal_has_pooled_h() const;
+  public:
   void clear_pooled_h();
-  static const int kPooledHFieldNumber = 1;
-  ::google::protobuf::uint32 pooled_h() const;
-  void set_pooled_h(::google::protobuf::uint32 value);
+  uint32_t pooled_h() const;
+  void set_pooled_h(uint32_t value);
+  private:
+  uint32_t _internal_pooled_h() const;
+  void _internal_set_pooled_h(uint32_t value);
+  public:
 
   // optional uint32 pooled_w = 2 [default = 0];
   bool has_pooled_w() const;
+  private:
+  bool _internal_has_pooled_w() const;
+  public:
   void clear_pooled_w();
-  static const int kPooledWFieldNumber = 2;
-  ::google::protobuf::uint32 pooled_w() const;
-  void set_pooled_w(::google::protobuf::uint32 value);
+  uint32_t pooled_w() const;
+  void set_pooled_w(uint32_t value);
+  private:
+  uint32_t _internal_pooled_w() const;
+  void _internal_set_pooled_w(uint32_t value);
+  public:
 
   // optional float spatial_scale = 3 [default = 1];
   bool has_spatial_scale() const;
+  private:
+  bool _internal_has_spatial_scale() const;
+  public:
   void clear_spatial_scale();
-  static const int kSpatialScaleFieldNumber = 3;
   float spatial_scale() const;
   void set_spatial_scale(float value);
+  private:
+  float _internal_spatial_scale() const;
+  void _internal_set_spatial_scale(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ROIPoolingParameter)
  private:
-  void set_has_pooled_h();
-  void clear_has_pooled_h();
-  void set_has_pooled_w();
-  void clear_has_pooled_w();
-  void set_has_spatial_scale();
-  void clear_has_spatial_scale();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::uint32 pooled_h_;
-  ::google::protobuf::uint32 pooled_w_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  uint32_t pooled_h_;
+  uint32_t pooled_w_;
   float spatial_scale_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsROIPoolingParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ProposalParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ProposalParameter) */ {
+class ProposalParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.ProposalParameter) */ {
  public:
-  ProposalParameter();
-  virtual ~ProposalParameter();
+  inline ProposalParameter() : ProposalParameter(nullptr) {}
+  ~ProposalParameter() override;
+  explicit constexpr ProposalParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ProposalParameter(const ProposalParameter& from);
-
-  inline ProposalParameter& operator=(const ProposalParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ProposalParameter(ProposalParameter&& from) noexcept
     : ProposalParameter() {
     *this = ::std::move(from);
   }
 
+  inline ProposalParameter& operator=(const ProposalParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ProposalParameter& operator=(ProposalParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ProposalParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ProposalParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ProposalParameter* internal_default_instance() {
     return reinterpret_cast<const ProposalParameter*>(
                &_ProposalParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     69;
 
-  void Swap(ProposalParameter* other);
   friend void swap(ProposalParameter& a, ProposalParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(ProposalParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ProposalParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ProposalParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ProposalParameter* 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;
+  ProposalParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ProposalParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ProposalParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ProposalParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ProposalParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.ProposalParameter";
   }
+  protected:
+  explicit ProposalParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kRatioFieldNumber = 4,
+    kScaleFieldNumber = 5,
+    kFeatStrideFieldNumber = 1,
+    kBaseSizeFieldNumber = 2,
+    kMinSizeFieldNumber = 3,
+    kPreNmsTopnFieldNumber = 6,
+    kPostNmsTopnFieldNumber = 7,
+    kNmsThreshFieldNumber = 8,
+  };
   // repeated float ratio = 4;
   int ratio_size() const;
+  private:
+  int _internal_ratio_size() const;
+  public:
   void clear_ratio();
-  static const int kRatioFieldNumber = 4;
+  private:
+  float _internal_ratio(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_ratio() const;
+  void _internal_add_ratio(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_ratio();
+  public:
   float ratio(int index) const;
   void set_ratio(int index, float value);
   void add_ratio(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       ratio() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_ratio();
 
   // repeated float scale = 5;
   int scale_size() const;
+  private:
+  int _internal_scale_size() const;
+  public:
   void clear_scale();
-  static const int kScaleFieldNumber = 5;
+  private:
+  float _internal_scale(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_scale() const;
+  void _internal_add_scale(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_scale();
+  public:
   float scale(int index) const;
   void set_scale(int index, float value);
   void add_scale(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       scale() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_scale();
 
   // optional uint32 feat_stride = 1 [default = 16];
   bool has_feat_stride() const;
+  private:
+  bool _internal_has_feat_stride() const;
+  public:
   void clear_feat_stride();
-  static const int kFeatStrideFieldNumber = 1;
-  ::google::protobuf::uint32 feat_stride() const;
-  void set_feat_stride(::google::protobuf::uint32 value);
+  uint32_t feat_stride() const;
+  void set_feat_stride(uint32_t value);
+  private:
+  uint32_t _internal_feat_stride() const;
+  void _internal_set_feat_stride(uint32_t value);
+  public:
 
   // optional uint32 base_size = 2 [default = 16];
   bool has_base_size() const;
+  private:
+  bool _internal_has_base_size() const;
+  public:
   void clear_base_size();
-  static const int kBaseSizeFieldNumber = 2;
-  ::google::protobuf::uint32 base_size() const;
-  void set_base_size(::google::protobuf::uint32 value);
+  uint32_t base_size() const;
+  void set_base_size(uint32_t value);
+  private:
+  uint32_t _internal_base_size() const;
+  void _internal_set_base_size(uint32_t value);
+  public:
 
   // optional uint32 min_size = 3 [default = 16];
   bool has_min_size() const;
+  private:
+  bool _internal_has_min_size() const;
+  public:
   void clear_min_size();
-  static const int kMinSizeFieldNumber = 3;
-  ::google::protobuf::uint32 min_size() const;
-  void set_min_size(::google::protobuf::uint32 value);
+  uint32_t min_size() const;
+  void set_min_size(uint32_t value);
+  private:
+  uint32_t _internal_min_size() const;
+  void _internal_set_min_size(uint32_t value);
+  public:
 
   // optional uint32 pre_nms_topn = 6 [default = 6000];
   bool has_pre_nms_topn() const;
+  private:
+  bool _internal_has_pre_nms_topn() const;
+  public:
   void clear_pre_nms_topn();
-  static const int kPreNmsTopnFieldNumber = 6;
-  ::google::protobuf::uint32 pre_nms_topn() const;
-  void set_pre_nms_topn(::google::protobuf::uint32 value);
+  uint32_t pre_nms_topn() const;
+  void set_pre_nms_topn(uint32_t value);
+  private:
+  uint32_t _internal_pre_nms_topn() const;
+  void _internal_set_pre_nms_topn(uint32_t value);
+  public:
 
   // optional uint32 post_nms_topn = 7 [default = 300];
   bool has_post_nms_topn() const;
+  private:
+  bool _internal_has_post_nms_topn() const;
+  public:
   void clear_post_nms_topn();
-  static const int kPostNmsTopnFieldNumber = 7;
-  ::google::protobuf::uint32 post_nms_topn() const;
-  void set_post_nms_topn(::google::protobuf::uint32 value);
+  uint32_t post_nms_topn() const;
+  void set_post_nms_topn(uint32_t value);
+  private:
+  uint32_t _internal_post_nms_topn() const;
+  void _internal_set_post_nms_topn(uint32_t value);
+  public:
 
   // optional float nms_thresh = 8 [default = 0.7];
   bool has_nms_thresh() const;
+  private:
+  bool _internal_has_nms_thresh() const;
+  public:
   void clear_nms_thresh();
-  static const int kNmsThreshFieldNumber = 8;
   float nms_thresh() const;
   void set_nms_thresh(float value);
+  private:
+  float _internal_nms_thresh() const;
+  void _internal_set_nms_thresh(float value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.ProposalParameter)
  private:
-  void set_has_feat_stride();
-  void clear_has_feat_stride();
-  void set_has_base_size();
-  void clear_has_base_size();
-  void set_has_min_size();
-  void clear_has_min_size();
-  void set_has_pre_nms_topn();
-  void clear_has_pre_nms_topn();
-  void set_has_post_nms_topn();
-  void clear_has_post_nms_topn();
-  void set_has_nms_thresh();
-  void clear_has_nms_thresh();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< float > ratio_;
-  ::google::protobuf::RepeatedField< float > scale_;
-  ::google::protobuf::uint32 feat_stride_;
-  ::google::protobuf::uint32 base_size_;
-  ::google::protobuf::uint32 min_size_;
-  ::google::protobuf::uint32 pre_nms_topn_;
-  ::google::protobuf::uint32 post_nms_topn_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > ratio_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > scale_;
+  uint32_t feat_stride_;
+  uint32_t base_size_;
+  uint32_t min_size_;
+  uint32_t pre_nms_topn_;
+  uint32_t post_nms_topn_;
   float nms_thresh_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsProposalParameterImpl();
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // -------------------------------------------------------------------
 
-class PSROIPoolingParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PSROIPoolingParameter) */ {
+class PSROIPoolingParameter final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_caffe.PSROIPoolingParameter) */ {
  public:
-  PSROIPoolingParameter();
-  virtual ~PSROIPoolingParameter();
+  inline PSROIPoolingParameter() : PSROIPoolingParameter(nullptr) {}
+  ~PSROIPoolingParameter() override;
+  explicit constexpr PSROIPoolingParameter(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   PSROIPoolingParameter(const PSROIPoolingParameter& from);
-
-  inline PSROIPoolingParameter& operator=(const PSROIPoolingParameter& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   PSROIPoolingParameter(PSROIPoolingParameter&& from) noexcept
     : PSROIPoolingParameter() {
     *this = ::std::move(from);
   }
 
+  inline PSROIPoolingParameter& operator=(const PSROIPoolingParameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline PSROIPoolingParameter& operator=(PSROIPoolingParameter&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const PSROIPoolingParameter& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const PSROIPoolingParameter& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const PSROIPoolingParameter* internal_default_instance() {
     return reinterpret_cast<const PSROIPoolingParameter*>(
                &_PSROIPoolingParameter_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     70;
 
-  void Swap(PSROIPoolingParameter* other);
   friend void swap(PSROIPoolingParameter& a, PSROIPoolingParameter& b) {
     a.Swap(&b);
   }
+  inline void Swap(PSROIPoolingParameter* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(PSROIPoolingParameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline PSROIPoolingParameter* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  PSROIPoolingParameter* 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;
+  PSROIPoolingParameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<PSROIPoolingParameter>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const PSROIPoolingParameter& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const PSROIPoolingParameter& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(PSROIPoolingParameter* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_caffe.PSROIPoolingParameter";
   }
+  protected:
+  explicit PSROIPoolingParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSpatialScaleFieldNumber = 1,
+    kOutputDimFieldNumber = 2,
+    kGroupSizeFieldNumber = 3,
+  };
   // required float spatial_scale = 1;
   bool has_spatial_scale() const;
+  private:
+  bool _internal_has_spatial_scale() const;
+  public:
   void clear_spatial_scale();
-  static const int kSpatialScaleFieldNumber = 1;
   float spatial_scale() const;
   void set_spatial_scale(float value);
+  private:
+  float _internal_spatial_scale() const;
+  void _internal_set_spatial_scale(float value);
+  public:
 
   // required int32 output_dim = 2;
   bool has_output_dim() const;
+  private:
+  bool _internal_has_output_dim() const;
+  public:
   void clear_output_dim();
-  static const int kOutputDimFieldNumber = 2;
-  ::google::protobuf::int32 output_dim() const;
-  void set_output_dim(::google::protobuf::int32 value);
+  int32_t output_dim() const;
+  void set_output_dim(int32_t value);
+  private:
+  int32_t _internal_output_dim() const;
+  void _internal_set_output_dim(int32_t value);
+  public:
 
   // required int32 group_size = 3;
   bool has_group_size() const;
+  private:
+  bool _internal_has_group_size() const;
+  public:
   void clear_group_size();
-  static const int kGroupSizeFieldNumber = 3;
-  ::google::protobuf::int32 group_size() const;
-  void set_group_size(::google::protobuf::int32 value);
+  int32_t group_size() const;
+  void set_group_size(int32_t value);
+  private:
+  int32_t _internal_group_size() const;
+  void _internal_set_group_size(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_caffe.PSROIPoolingParameter)
  private:
-  void set_has_spatial_scale();
-  void clear_has_spatial_scale();
-  void set_has_output_dim();
-  void clear_has_output_dim();
-  void set_has_group_size();
-  void clear_has_group_size();
+  class _Internal;
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   float spatial_scale_;
-  ::google::protobuf::int32 output_dim_;
-  ::google::protobuf::int32 group_size_;
-  friend struct ::protobuf_opencv_2dcaffe_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2dcaffe_2eproto::InitDefaultsPSROIPoolingParameterImpl();
+  int32_t output_dim_;
+  int32_t group_size_;
+  friend struct ::TableStruct_opencv_2dcaffe_2eproto;
 };
 // ===================================================================
 
@@ -14684,33 +20724,50 @@ class PSROIPoolingParameter : public ::google::protobuf::Message /* @@protoc_ins
 // BlobShape
 
 // repeated int64 dim = 1 [packed = true];
-inline int BlobShape::dim_size() const {
+inline int BlobShape::_internal_dim_size() const {
   return dim_.size();
 }
+inline int BlobShape::dim_size() const {
+  return _internal_dim_size();
+}
 inline void BlobShape::clear_dim() {
   dim_.Clear();
 }
-inline ::google::protobuf::int64 BlobShape::dim(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.BlobShape.dim)
+inline int64_t BlobShape::_internal_dim(int index) const {
   return dim_.Get(index);
 }
-inline void BlobShape::set_dim(int index, ::google::protobuf::int64 value) {
+inline int64_t BlobShape::dim(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.BlobShape.dim)
+  return _internal_dim(index);
+}
+inline void BlobShape::set_dim(int index, int64_t value) {
   dim_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobShape.dim)
 }
-inline void BlobShape::add_dim(::google::protobuf::int64 value) {
+inline void BlobShape::_internal_add_dim(int64_t value) {
   dim_.Add(value);
+}
+inline void BlobShape::add_dim(int64_t value) {
+  _internal_add_dim(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.BlobShape.dim)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+BlobShape::_internal_dim() const {
+  return dim_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
 BlobShape::dim() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.BlobShape.dim)
-  return dim_;
+  return _internal_dim();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+BlobShape::_internal_mutable_dim() {
+  return &dim_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
 BlobShape::mutable_dim() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.BlobShape.dim)
-  return &dim_;
+  return _internal_mutable_dim();
 }
 
 // -------------------------------------------------------------------
@@ -14718,360 +20775,490 @@ BlobShape::mutable_dim() {
 // BlobProto
 
 // optional .opencv_caffe.BlobShape shape = 7;
-inline bool BlobProto::has_shape() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool BlobProto::_internal_has_shape() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || shape_ != nullptr);
+  return value;
 }
-inline void BlobProto::set_has_shape() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool BlobProto::has_shape() const {
+  return _internal_has_shape();
 }
-inline void BlobProto::clear_has_shape() {
+inline void BlobProto::clear_shape() {
+  if (shape_ != nullptr) shape_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void BlobProto::clear_shape() {
-  if (shape_ != NULL) shape_->Clear();
-  clear_has_shape();
+inline const ::opencv_caffe::BlobShape& BlobProto::_internal_shape() const {
+  const ::opencv_caffe::BlobShape* p = shape_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::BlobShape&>(
+      ::opencv_caffe::_BlobShape_default_instance_);
 }
 inline const ::opencv_caffe::BlobShape& BlobProto::shape() const {
-  const ::opencv_caffe::BlobShape* p = shape_;
   // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.shape)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::BlobShape*>(
-      &::opencv_caffe::_BlobShape_default_instance_);
+  return _internal_shape();
+}
+inline void BlobProto::unsafe_arena_set_allocated_shape(
+    ::opencv_caffe::BlobShape* shape) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(shape_);
+  }
+  shape_ = shape;
+  if (shape) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.BlobProto.shape)
 }
 inline ::opencv_caffe::BlobShape* BlobProto::release_shape() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::BlobShape* temp = shape_;
+  shape_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::BlobShape* BlobProto::unsafe_arena_release_shape() {
   // @@protoc_insertion_point(field_release:opencv_caffe.BlobProto.shape)
-  clear_has_shape();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::BlobShape* temp = shape_;
-  shape_ = NULL;
+  shape_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::BlobShape* BlobProto::mutable_shape() {
-  set_has_shape();
-  if (shape_ == NULL) {
-    shape_ = new ::opencv_caffe::BlobShape;
+inline ::opencv_caffe::BlobShape* BlobProto::_internal_mutable_shape() {
+  _has_bits_[0] |= 0x00000002u;
+  if (shape_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::BlobShape>(GetArenaForAllocation());
+    shape_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.BlobProto.shape)
   return shape_;
 }
+inline ::opencv_caffe::BlobShape* BlobProto::mutable_shape() {
+  ::opencv_caffe::BlobShape* _msg = _internal_mutable_shape();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.BlobProto.shape)
+  return _msg;
+}
 inline void BlobProto::set_allocated_shape(::opencv_caffe::BlobShape* shape) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete shape_;
   }
   if (shape) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::BlobShape>::GetOwningArena(shape);
     if (message_arena != submessage_arena) {
-      shape = ::google::protobuf::internal::GetOwnedMessage(
+      shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, shape, submessage_arena);
     }
-    set_has_shape();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_shape();
+    _has_bits_[0] &= ~0x00000002u;
   }
   shape_ = shape;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.BlobProto.shape)
 }
 
 // repeated float data = 5 [packed = true];
-inline int BlobProto::data_size() const {
+inline int BlobProto::_internal_data_size() const {
   return data_.size();
 }
+inline int BlobProto::data_size() const {
+  return _internal_data_size();
+}
 inline void BlobProto::clear_data() {
   data_.Clear();
 }
+inline float BlobProto::_internal_data(int index) const {
+  return data_.Get(index);
+}
 inline float BlobProto::data(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.data)
-  return data_.Get(index);
+  return _internal_data(index);
 }
 inline void BlobProto::set_data(int index, float value) {
   data_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.data)
 }
-inline void BlobProto::add_data(float value) {
+inline void BlobProto::_internal_add_data(float value) {
   data_.Add(value);
+}
+inline void BlobProto::add_data(float value) {
+  _internal_add_data(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.BlobProto.data)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+BlobProto::_internal_data() const {
+  return data_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 BlobProto::data() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.BlobProto.data)
-  return data_;
+  return _internal_data();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+BlobProto::_internal_mutable_data() {
+  return &data_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 BlobProto::mutable_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.BlobProto.data)
-  return &data_;
+  return _internal_mutable_data();
 }
 
 // repeated float diff = 6 [packed = true];
-inline int BlobProto::diff_size() const {
+inline int BlobProto::_internal_diff_size() const {
   return diff_.size();
 }
+inline int BlobProto::diff_size() const {
+  return _internal_diff_size();
+}
 inline void BlobProto::clear_diff() {
   diff_.Clear();
 }
+inline float BlobProto::_internal_diff(int index) const {
+  return diff_.Get(index);
+}
 inline float BlobProto::diff(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.diff)
-  return diff_.Get(index);
+  return _internal_diff(index);
 }
 inline void BlobProto::set_diff(int index, float value) {
   diff_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.diff)
 }
-inline void BlobProto::add_diff(float value) {
+inline void BlobProto::_internal_add_diff(float value) {
   diff_.Add(value);
+}
+inline void BlobProto::add_diff(float value) {
+  _internal_add_diff(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.BlobProto.diff)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+BlobProto::_internal_diff() const {
+  return diff_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 BlobProto::diff() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.BlobProto.diff)
-  return diff_;
+  return _internal_diff();
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+BlobProto::_internal_mutable_diff() {
+  return &diff_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 BlobProto::mutable_diff() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.BlobProto.diff)
-  return &diff_;
+  return _internal_mutable_diff();
 }
 
 // repeated double double_data = 8 [packed = true];
-inline int BlobProto::double_data_size() const {
+inline int BlobProto::_internal_double_data_size() const {
   return double_data_.size();
 }
+inline int BlobProto::double_data_size() const {
+  return _internal_double_data_size();
+}
 inline void BlobProto::clear_double_data() {
   double_data_.Clear();
 }
+inline double BlobProto::_internal_double_data(int index) const {
+  return double_data_.Get(index);
+}
 inline double BlobProto::double_data(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.double_data)
-  return double_data_.Get(index);
+  return _internal_double_data(index);
 }
 inline void BlobProto::set_double_data(int index, double value) {
   double_data_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.double_data)
 }
-inline void BlobProto::add_double_data(double value) {
+inline void BlobProto::_internal_add_double_data(double value) {
   double_data_.Add(value);
+}
+inline void BlobProto::add_double_data(double value) {
+  _internal_add_double_data(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.BlobProto.double_data)
 }
-inline const ::google::protobuf::RepeatedField< double >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+BlobProto::_internal_double_data() const {
+  return double_data_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
 BlobProto::double_data() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.BlobProto.double_data)
-  return double_data_;
+  return _internal_double_data();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+BlobProto::_internal_mutable_double_data() {
+  return &double_data_;
 }
-inline ::google::protobuf::RepeatedField< double >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
 BlobProto::mutable_double_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.BlobProto.double_data)
-  return &double_data_;
+  return _internal_mutable_double_data();
 }
 
 // repeated double double_diff = 9 [packed = true];
-inline int BlobProto::double_diff_size() const {
+inline int BlobProto::_internal_double_diff_size() const {
   return double_diff_.size();
 }
+inline int BlobProto::double_diff_size() const {
+  return _internal_double_diff_size();
+}
 inline void BlobProto::clear_double_diff() {
   double_diff_.Clear();
 }
+inline double BlobProto::_internal_double_diff(int index) const {
+  return double_diff_.Get(index);
+}
 inline double BlobProto::double_diff(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.double_diff)
-  return double_diff_.Get(index);
+  return _internal_double_diff(index);
 }
 inline void BlobProto::set_double_diff(int index, double value) {
   double_diff_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.double_diff)
 }
-inline void BlobProto::add_double_diff(double value) {
+inline void BlobProto::_internal_add_double_diff(double value) {
   double_diff_.Add(value);
+}
+inline void BlobProto::add_double_diff(double value) {
+  _internal_add_double_diff(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.BlobProto.double_diff)
 }
-inline const ::google::protobuf::RepeatedField< double >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+BlobProto::_internal_double_diff() const {
+  return double_diff_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
 BlobProto::double_diff() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.BlobProto.double_diff)
-  return double_diff_;
+  return _internal_double_diff();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+BlobProto::_internal_mutable_double_diff() {
+  return &double_diff_;
 }
-inline ::google::protobuf::RepeatedField< double >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
 BlobProto::mutable_double_diff() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.BlobProto.double_diff)
-  return &double_diff_;
+  return _internal_mutable_double_diff();
 }
 
 // optional .opencv_caffe.Type raw_data_type = 10;
-inline bool BlobProto::has_raw_data_type() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void BlobProto::set_has_raw_data_type() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool BlobProto::_internal_has_raw_data_type() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void BlobProto::clear_has_raw_data_type() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool BlobProto::has_raw_data_type() const {
+  return _internal_has_raw_data_type();
 }
 inline void BlobProto::clear_raw_data_type() {
   raw_data_type_ = 0;
-  clear_has_raw_data_type();
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline ::opencv_caffe::Type BlobProto::_internal_raw_data_type() const {
+  return static_cast< ::opencv_caffe::Type >(raw_data_type_);
 }
 inline ::opencv_caffe::Type BlobProto::raw_data_type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.raw_data_type)
-  return static_cast< ::opencv_caffe::Type >(raw_data_type_);
+  return _internal_raw_data_type();
 }
-inline void BlobProto::set_raw_data_type(::opencv_caffe::Type value) {
+inline void BlobProto::_internal_set_raw_data_type(::opencv_caffe::Type value) {
   assert(::opencv_caffe::Type_IsValid(value));
-  set_has_raw_data_type();
+  _has_bits_[0] |= 0x00000040u;
   raw_data_type_ = value;
+}
+inline void BlobProto::set_raw_data_type(::opencv_caffe::Type value) {
+  _internal_set_raw_data_type(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.raw_data_type)
 }
 
 // optional bytes raw_data = 12 [packed = false];
-inline bool BlobProto::has_raw_data() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void BlobProto::set_has_raw_data() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool BlobProto::_internal_has_raw_data() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void BlobProto::clear_has_raw_data() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool BlobProto::has_raw_data() const {
+  return _internal_has_raw_data();
 }
 inline void BlobProto::clear_raw_data() {
-  raw_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_raw_data();
+  raw_data_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& BlobProto::raw_data() const {
+inline const std::string& BlobProto::raw_data() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.raw_data)
-  return raw_data_.GetNoArena();
+  return _internal_raw_data();
 }
-inline void BlobProto::set_raw_data(const ::std::string& value) {
-  set_has_raw_data();
-  raw_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void BlobProto::set_raw_data(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ raw_data_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.raw_data)
 }
-#if LANG_CXX11
-inline void BlobProto::set_raw_data(::std::string&& value) {
-  set_has_raw_data();
-  raw_data_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.BlobProto.raw_data)
-}
-#endif
-inline void BlobProto::set_raw_data(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_raw_data();
-  raw_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.BlobProto.raw_data)
-}
-inline void BlobProto::set_raw_data(const void* value, size_t size) {
-  set_has_raw_data();
-  raw_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.BlobProto.raw_data)
-}
-inline ::std::string* BlobProto::mutable_raw_data() {
-  set_has_raw_data();
+inline std::string* BlobProto::mutable_raw_data() {
+  std::string* _s = _internal_mutable_raw_data();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.BlobProto.raw_data)
-  return raw_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& BlobProto::_internal_raw_data() const {
+  return raw_data_.Get();
+}
+inline void BlobProto::_internal_set_raw_data(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  raw_data_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* BlobProto::_internal_mutable_raw_data() {
+  _has_bits_[0] |= 0x00000001u;
+  return raw_data_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* BlobProto::release_raw_data() {
+inline std::string* BlobProto::release_raw_data() {
   // @@protoc_insertion_point(field_release:opencv_caffe.BlobProto.raw_data)
-  clear_has_raw_data();
-  return raw_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_raw_data()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = raw_data_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (raw_data_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    raw_data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void BlobProto::set_allocated_raw_data(::std::string* raw_data) {
-  if (raw_data != NULL) {
-    set_has_raw_data();
+inline void BlobProto::set_allocated_raw_data(std::string* raw_data) {
+  if (raw_data != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_raw_data();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  raw_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), raw_data);
+  raw_data_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), raw_data,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (raw_data_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    raw_data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.BlobProto.raw_data)
 }
 
 // optional int32 num = 1 [default = 0];
-inline bool BlobProto::has_num() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool BlobProto::_internal_has_num() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void BlobProto::set_has_num() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void BlobProto::clear_has_num() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool BlobProto::has_num() const {
+  return _internal_has_num();
 }
 inline void BlobProto::clear_num() {
   num_ = 0;
-  clear_has_num();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 BlobProto::num() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.num)
+inline int32_t BlobProto::_internal_num() const {
   return num_;
 }
-inline void BlobProto::set_num(::google::protobuf::int32 value) {
-  set_has_num();
+inline int32_t BlobProto::num() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.num)
+  return _internal_num();
+}
+inline void BlobProto::_internal_set_num(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   num_ = value;
+}
+inline void BlobProto::set_num(int32_t value) {
+  _internal_set_num(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.num)
 }
 
 // optional int32 channels = 2 [default = 0];
-inline bool BlobProto::has_channels() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void BlobProto::set_has_channels() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool BlobProto::_internal_has_channels() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void BlobProto::clear_has_channels() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool BlobProto::has_channels() const {
+  return _internal_has_channels();
 }
 inline void BlobProto::clear_channels() {
   channels_ = 0;
-  clear_has_channels();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::int32 BlobProto::channels() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.channels)
+inline int32_t BlobProto::_internal_channels() const {
   return channels_;
 }
-inline void BlobProto::set_channels(::google::protobuf::int32 value) {
-  set_has_channels();
+inline int32_t BlobProto::channels() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.channels)
+  return _internal_channels();
+}
+inline void BlobProto::_internal_set_channels(int32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   channels_ = value;
+}
+inline void BlobProto::set_channels(int32_t value) {
+  _internal_set_channels(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.channels)
 }
 
 // optional int32 height = 3 [default = 0];
-inline bool BlobProto::has_height() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void BlobProto::set_has_height() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool BlobProto::_internal_has_height() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void BlobProto::clear_has_height() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool BlobProto::has_height() const {
+  return _internal_has_height();
 }
 inline void BlobProto::clear_height() {
   height_ = 0;
-  clear_has_height();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::int32 BlobProto::height() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.height)
+inline int32_t BlobProto::_internal_height() const {
   return height_;
 }
-inline void BlobProto::set_height(::google::protobuf::int32 value) {
-  set_has_height();
+inline int32_t BlobProto::height() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.height)
+  return _internal_height();
+}
+inline void BlobProto::_internal_set_height(int32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   height_ = value;
+}
+inline void BlobProto::set_height(int32_t value) {
+  _internal_set_height(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.height)
 }
 
 // optional int32 width = 4 [default = 0];
-inline bool BlobProto::has_width() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool BlobProto::_internal_has_width() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void BlobProto::set_has_width() {
-  _has_bits_[0] |= 0x00000020u;
-}
-inline void BlobProto::clear_has_width() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool BlobProto::has_width() const {
+  return _internal_has_width();
 }
 inline void BlobProto::clear_width() {
   width_ = 0;
-  clear_has_width();
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline ::google::protobuf::int32 BlobProto::width() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.width)
+inline int32_t BlobProto::_internal_width() const {
   return width_;
 }
-inline void BlobProto::set_width(::google::protobuf::int32 value) {
-  set_has_width();
+inline int32_t BlobProto::width() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProto.width)
+  return _internal_width();
+}
+inline void BlobProto::_internal_set_width(int32_t value) {
+  _has_bits_[0] |= 0x00000020u;
   width_ = value;
+}
+inline void BlobProto::set_width(int32_t value) {
+  _internal_set_width(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BlobProto.width)
 }
 
@@ -15080,30 +21267,40 @@ inline void BlobProto::set_width(::google::protobuf::int32 value) {
 // BlobProtoVector
 
 // repeated .opencv_caffe.BlobProto blobs = 1;
-inline int BlobProtoVector::blobs_size() const {
+inline int BlobProtoVector::_internal_blobs_size() const {
   return blobs_.size();
 }
+inline int BlobProtoVector::blobs_size() const {
+  return _internal_blobs_size();
+}
 inline void BlobProtoVector::clear_blobs() {
   blobs_.Clear();
 }
-inline const ::opencv_caffe::BlobProto& BlobProtoVector::blobs(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProtoVector.blobs)
-  return blobs_.Get(index);
-}
 inline ::opencv_caffe::BlobProto* BlobProtoVector::mutable_blobs(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.BlobProtoVector.blobs)
   return blobs_.Mutable(index);
 }
-inline ::opencv_caffe::BlobProto* BlobProtoVector::add_blobs() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.BlobProtoVector.blobs)
-  return blobs_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
 BlobProtoVector::mutable_blobs() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.BlobProtoVector.blobs)
   return &blobs_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+inline const ::opencv_caffe::BlobProto& BlobProtoVector::_internal_blobs(int index) const {
+  return blobs_.Get(index);
+}
+inline const ::opencv_caffe::BlobProto& BlobProtoVector::blobs(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.BlobProtoVector.blobs)
+  return _internal_blobs(index);
+}
+inline ::opencv_caffe::BlobProto* BlobProtoVector::_internal_add_blobs() {
+  return blobs_.Add();
+}
+inline ::opencv_caffe::BlobProto* BlobProtoVector::add_blobs() {
+  ::opencv_caffe::BlobProto* _add = _internal_add_blobs();
+  // @@protoc_insertion_point(field_add:opencv_caffe.BlobProtoVector.blobs)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
 BlobProtoVector::blobs() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.BlobProtoVector.blobs)
   return blobs_;
@@ -15114,33 +21311,50 @@ BlobProtoVector::blobs() const {
 // PermuteParameter
 
 // repeated uint32 order = 1;
-inline int PermuteParameter::order_size() const {
+inline int PermuteParameter::_internal_order_size() const {
   return order_.size();
 }
+inline int PermuteParameter::order_size() const {
+  return _internal_order_size();
+}
 inline void PermuteParameter::clear_order() {
   order_.Clear();
 }
-inline ::google::protobuf::uint32 PermuteParameter::order(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PermuteParameter.order)
+inline uint32_t PermuteParameter::_internal_order(int index) const {
   return order_.Get(index);
 }
-inline void PermuteParameter::set_order(int index, ::google::protobuf::uint32 value) {
+inline uint32_t PermuteParameter::order(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PermuteParameter.order)
+  return _internal_order(index);
+}
+inline void PermuteParameter::set_order(int index, uint32_t value) {
   order_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PermuteParameter.order)
 }
-inline void PermuteParameter::add_order(::google::protobuf::uint32 value) {
+inline void PermuteParameter::_internal_add_order(uint32_t value) {
   order_.Add(value);
+}
+inline void PermuteParameter::add_order(uint32_t value) {
+  _internal_add_order(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PermuteParameter.order)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+PermuteParameter::_internal_order() const {
+  return order_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 PermuteParameter::order() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PermuteParameter.order)
-  return order_;
+  return _internal_order();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+PermuteParameter::_internal_mutable_order() {
+  return &order_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 PermuteParameter::mutable_order() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PermuteParameter.order)
-  return &order_;
+  return _internal_mutable_order();
 }
 
 // -------------------------------------------------------------------
@@ -15148,128 +21362,176 @@ PermuteParameter::mutable_order() {
 // NormalizeBBoxParameter
 
 // optional bool across_spatial = 1 [default = true];
-inline bool NormalizeBBoxParameter::has_across_spatial() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void NormalizeBBoxParameter::set_has_across_spatial() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool NormalizeBBoxParameter::_internal_has_across_spatial() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void NormalizeBBoxParameter::clear_has_across_spatial() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool NormalizeBBoxParameter::has_across_spatial() const {
+  return _internal_has_across_spatial();
 }
 inline void NormalizeBBoxParameter::clear_across_spatial() {
   across_spatial_ = true;
-  clear_has_across_spatial();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool NormalizeBBoxParameter::_internal_across_spatial() const {
+  return across_spatial_;
 }
 inline bool NormalizeBBoxParameter::across_spatial() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizeBBoxParameter.across_spatial)
-  return across_spatial_;
+  return _internal_across_spatial();
 }
-inline void NormalizeBBoxParameter::set_across_spatial(bool value) {
-  set_has_across_spatial();
+inline void NormalizeBBoxParameter::_internal_set_across_spatial(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   across_spatial_ = value;
+}
+inline void NormalizeBBoxParameter::set_across_spatial(bool value) {
+  _internal_set_across_spatial(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizeBBoxParameter.across_spatial)
 }
 
 // optional .opencv_caffe.FillerParameter scale_filler = 2;
-inline bool NormalizeBBoxParameter::has_scale_filler() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool NormalizeBBoxParameter::_internal_has_scale_filler() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || scale_filler_ != nullptr);
+  return value;
 }
-inline void NormalizeBBoxParameter::set_has_scale_filler() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool NormalizeBBoxParameter::has_scale_filler() const {
+  return _internal_has_scale_filler();
 }
-inline void NormalizeBBoxParameter::clear_has_scale_filler() {
+inline void NormalizeBBoxParameter::clear_scale_filler() {
+  if (scale_filler_ != nullptr) scale_filler_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void NormalizeBBoxParameter::clear_scale_filler() {
-  if (scale_filler_ != NULL) scale_filler_->Clear();
-  clear_has_scale_filler();
+inline const ::opencv_caffe::FillerParameter& NormalizeBBoxParameter::_internal_scale_filler() const {
+  const ::opencv_caffe::FillerParameter* p = scale_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& NormalizeBBoxParameter::scale_filler() const {
-  const ::opencv_caffe::FillerParameter* p = scale_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizeBBoxParameter.scale_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_scale_filler();
+}
+inline void NormalizeBBoxParameter::unsafe_arena_set_allocated_scale_filler(
+    ::opencv_caffe::FillerParameter* scale_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(scale_filler_);
+  }
+  scale_filler_ = scale_filler;
+  if (scale_filler) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.NormalizeBBoxParameter.scale_filler)
 }
 inline ::opencv_caffe::FillerParameter* NormalizeBBoxParameter::release_scale_filler() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::FillerParameter* temp = scale_filler_;
+  scale_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* NormalizeBBoxParameter::unsafe_arena_release_scale_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.NormalizeBBoxParameter.scale_filler)
-  clear_has_scale_filler();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::FillerParameter* temp = scale_filler_;
-  scale_filler_ = NULL;
+  scale_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* NormalizeBBoxParameter::mutable_scale_filler() {
-  set_has_scale_filler();
-  if (scale_filler_ == NULL) {
-    scale_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* NormalizeBBoxParameter::_internal_mutable_scale_filler() {
+  _has_bits_[0] |= 0x00000001u;
+  if (scale_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    scale_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.NormalizeBBoxParameter.scale_filler)
   return scale_filler_;
 }
+inline ::opencv_caffe::FillerParameter* NormalizeBBoxParameter::mutable_scale_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_scale_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.NormalizeBBoxParameter.scale_filler)
+  return _msg;
+}
 inline void NormalizeBBoxParameter::set_allocated_scale_filler(::opencv_caffe::FillerParameter* scale_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete scale_filler_;
   }
   if (scale_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(scale_filler);
     if (message_arena != submessage_arena) {
-      scale_filler = ::google::protobuf::internal::GetOwnedMessage(
+      scale_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, scale_filler, submessage_arena);
     }
-    set_has_scale_filler();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_scale_filler();
+    _has_bits_[0] &= ~0x00000001u;
   }
   scale_filler_ = scale_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.NormalizeBBoxParameter.scale_filler)
 }
 
 // optional bool channel_shared = 3 [default = true];
-inline bool NormalizeBBoxParameter::has_channel_shared() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void NormalizeBBoxParameter::set_has_channel_shared() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool NormalizeBBoxParameter::_internal_has_channel_shared() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void NormalizeBBoxParameter::clear_has_channel_shared() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool NormalizeBBoxParameter::has_channel_shared() const {
+  return _internal_has_channel_shared();
 }
 inline void NormalizeBBoxParameter::clear_channel_shared() {
   channel_shared_ = true;
-  clear_has_channel_shared();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline bool NormalizeBBoxParameter::_internal_channel_shared() const {
+  return channel_shared_;
 }
 inline bool NormalizeBBoxParameter::channel_shared() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizeBBoxParameter.channel_shared)
-  return channel_shared_;
+  return _internal_channel_shared();
 }
-inline void NormalizeBBoxParameter::set_channel_shared(bool value) {
-  set_has_channel_shared();
+inline void NormalizeBBoxParameter::_internal_set_channel_shared(bool value) {
+  _has_bits_[0] |= 0x00000004u;
   channel_shared_ = value;
+}
+inline void NormalizeBBoxParameter::set_channel_shared(bool value) {
+  _internal_set_channel_shared(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizeBBoxParameter.channel_shared)
 }
 
 // optional float eps = 4 [default = 1e-10];
-inline bool NormalizeBBoxParameter::has_eps() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool NormalizeBBoxParameter::_internal_has_eps() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void NormalizeBBoxParameter::set_has_eps() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void NormalizeBBoxParameter::clear_has_eps() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool NormalizeBBoxParameter::has_eps() const {
+  return _internal_has_eps();
 }
 inline void NormalizeBBoxParameter::clear_eps() {
   eps_ = 1e-10f;
-  clear_has_eps();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline float NormalizeBBoxParameter::_internal_eps() const {
+  return eps_;
 }
 inline float NormalizeBBoxParameter::eps() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizeBBoxParameter.eps)
-  return eps_;
+  return _internal_eps();
 }
-inline void NormalizeBBoxParameter::set_eps(float value) {
-  set_has_eps();
+inline void NormalizeBBoxParameter::_internal_set_eps(float value) {
+  _has_bits_[0] |= 0x00000008u;
   eps_ = value;
+}
+inline void NormalizeBBoxParameter::set_eps(float value) {
+  _internal_set_eps(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizeBBoxParameter.eps)
 }
 
@@ -15278,459 +21540,631 @@ inline void NormalizeBBoxParameter::set_eps(float value) {
 // PriorBoxParameter
 
 // repeated float min_size = 1;
-inline int PriorBoxParameter::min_size_size() const {
+inline int PriorBoxParameter::_internal_min_size_size() const {
   return min_size_.size();
 }
+inline int PriorBoxParameter::min_size_size() const {
+  return _internal_min_size_size();
+}
 inline void PriorBoxParameter::clear_min_size() {
   min_size_.Clear();
 }
+inline float PriorBoxParameter::_internal_min_size(int index) const {
+  return min_size_.Get(index);
+}
 inline float PriorBoxParameter::min_size(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.min_size)
-  return min_size_.Get(index);
+  return _internal_min_size(index);
 }
 inline void PriorBoxParameter::set_min_size(int index, float value) {
   min_size_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.min_size)
 }
-inline void PriorBoxParameter::add_min_size(float value) {
+inline void PriorBoxParameter::_internal_add_min_size(float value) {
   min_size_.Add(value);
+}
+inline void PriorBoxParameter::add_min_size(float value) {
+  _internal_add_min_size(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PriorBoxParameter.min_size)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+PriorBoxParameter::_internal_min_size() const {
+  return min_size_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 PriorBoxParameter::min_size() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PriorBoxParameter.min_size)
-  return min_size_;
+  return _internal_min_size();
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+PriorBoxParameter::_internal_mutable_min_size() {
+  return &min_size_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 PriorBoxParameter::mutable_min_size() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PriorBoxParameter.min_size)
-  return &min_size_;
+  return _internal_mutable_min_size();
 }
 
 // repeated float max_size = 2;
-inline int PriorBoxParameter::max_size_size() const {
+inline int PriorBoxParameter::_internal_max_size_size() const {
   return max_size_.size();
 }
+inline int PriorBoxParameter::max_size_size() const {
+  return _internal_max_size_size();
+}
 inline void PriorBoxParameter::clear_max_size() {
   max_size_.Clear();
 }
+inline float PriorBoxParameter::_internal_max_size(int index) const {
+  return max_size_.Get(index);
+}
 inline float PriorBoxParameter::max_size(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.max_size)
-  return max_size_.Get(index);
+  return _internal_max_size(index);
 }
 inline void PriorBoxParameter::set_max_size(int index, float value) {
   max_size_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.max_size)
 }
-inline void PriorBoxParameter::add_max_size(float value) {
+inline void PriorBoxParameter::_internal_add_max_size(float value) {
   max_size_.Add(value);
+}
+inline void PriorBoxParameter::add_max_size(float value) {
+  _internal_add_max_size(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PriorBoxParameter.max_size)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+PriorBoxParameter::_internal_max_size() const {
+  return max_size_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 PriorBoxParameter::max_size() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PriorBoxParameter.max_size)
-  return max_size_;
+  return _internal_max_size();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+PriorBoxParameter::_internal_mutable_max_size() {
+  return &max_size_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 PriorBoxParameter::mutable_max_size() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PriorBoxParameter.max_size)
-  return &max_size_;
+  return _internal_mutable_max_size();
 }
 
 // repeated float aspect_ratio = 3;
-inline int PriorBoxParameter::aspect_ratio_size() const {
+inline int PriorBoxParameter::_internal_aspect_ratio_size() const {
   return aspect_ratio_.size();
 }
+inline int PriorBoxParameter::aspect_ratio_size() const {
+  return _internal_aspect_ratio_size();
+}
 inline void PriorBoxParameter::clear_aspect_ratio() {
   aspect_ratio_.Clear();
 }
+inline float PriorBoxParameter::_internal_aspect_ratio(int index) const {
+  return aspect_ratio_.Get(index);
+}
 inline float PriorBoxParameter::aspect_ratio(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.aspect_ratio)
-  return aspect_ratio_.Get(index);
+  return _internal_aspect_ratio(index);
 }
 inline void PriorBoxParameter::set_aspect_ratio(int index, float value) {
   aspect_ratio_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.aspect_ratio)
 }
-inline void PriorBoxParameter::add_aspect_ratio(float value) {
+inline void PriorBoxParameter::_internal_add_aspect_ratio(float value) {
   aspect_ratio_.Add(value);
+}
+inline void PriorBoxParameter::add_aspect_ratio(float value) {
+  _internal_add_aspect_ratio(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PriorBoxParameter.aspect_ratio)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+PriorBoxParameter::_internal_aspect_ratio() const {
+  return aspect_ratio_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 PriorBoxParameter::aspect_ratio() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PriorBoxParameter.aspect_ratio)
-  return aspect_ratio_;
+  return _internal_aspect_ratio();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+PriorBoxParameter::_internal_mutable_aspect_ratio() {
+  return &aspect_ratio_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 PriorBoxParameter::mutable_aspect_ratio() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PriorBoxParameter.aspect_ratio)
-  return &aspect_ratio_;
+  return _internal_mutable_aspect_ratio();
 }
 
 // optional bool flip = 4 [default = true];
-inline bool PriorBoxParameter::has_flip() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void PriorBoxParameter::set_has_flip() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool PriorBoxParameter::_internal_has_flip() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::clear_has_flip() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool PriorBoxParameter::has_flip() const {
+  return _internal_has_flip();
 }
 inline void PriorBoxParameter::clear_flip() {
   flip_ = true;
-  clear_has_flip();
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline bool PriorBoxParameter::_internal_flip() const {
+  return flip_;
 }
 inline bool PriorBoxParameter::flip() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.flip)
-  return flip_;
+  return _internal_flip();
 }
-inline void PriorBoxParameter::set_flip(bool value) {
-  set_has_flip();
+inline void PriorBoxParameter::_internal_set_flip(bool value) {
+  _has_bits_[0] |= 0x00000040u;
   flip_ = value;
+}
+inline void PriorBoxParameter::set_flip(bool value) {
+  _internal_set_flip(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.flip)
 }
 
 // optional bool clip = 5 [default = true];
-inline bool PriorBoxParameter::has_clip() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void PriorBoxParameter::set_has_clip() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool PriorBoxParameter::_internal_has_clip() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::clear_has_clip() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool PriorBoxParameter::has_clip() const {
+  return _internal_has_clip();
 }
 inline void PriorBoxParameter::clear_clip() {
   clip_ = true;
-  clear_has_clip();
+  _has_bits_[0] &= ~0x00000080u;
+}
+inline bool PriorBoxParameter::_internal_clip() const {
+  return clip_;
 }
 inline bool PriorBoxParameter::clip() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.clip)
-  return clip_;
+  return _internal_clip();
 }
-inline void PriorBoxParameter::set_clip(bool value) {
-  set_has_clip();
+inline void PriorBoxParameter::_internal_set_clip(bool value) {
+  _has_bits_[0] |= 0x00000080u;
   clip_ = value;
+}
+inline void PriorBoxParameter::set_clip(bool value) {
+  _internal_set_clip(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.clip)
 }
 
 // repeated float variance = 6;
-inline int PriorBoxParameter::variance_size() const {
+inline int PriorBoxParameter::_internal_variance_size() const {
   return variance_.size();
 }
+inline int PriorBoxParameter::variance_size() const {
+  return _internal_variance_size();
+}
 inline void PriorBoxParameter::clear_variance() {
   variance_.Clear();
 }
+inline float PriorBoxParameter::_internal_variance(int index) const {
+  return variance_.Get(index);
+}
 inline float PriorBoxParameter::variance(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.variance)
-  return variance_.Get(index);
+  return _internal_variance(index);
 }
 inline void PriorBoxParameter::set_variance(int index, float value) {
   variance_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.variance)
 }
-inline void PriorBoxParameter::add_variance(float value) {
+inline void PriorBoxParameter::_internal_add_variance(float value) {
   variance_.Add(value);
+}
+inline void PriorBoxParameter::add_variance(float value) {
+  _internal_add_variance(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PriorBoxParameter.variance)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+PriorBoxParameter::_internal_variance() const {
+  return variance_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 PriorBoxParameter::variance() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PriorBoxParameter.variance)
-  return variance_;
+  return _internal_variance();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+PriorBoxParameter::_internal_mutable_variance() {
+  return &variance_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 PriorBoxParameter::mutable_variance() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PriorBoxParameter.variance)
-  return &variance_;
+  return _internal_mutable_variance();
 }
 
 // optional uint32 img_size = 7;
-inline bool PriorBoxParameter::has_img_size() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void PriorBoxParameter::set_has_img_size() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool PriorBoxParameter::_internal_has_img_size() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::clear_has_img_size() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool PriorBoxParameter::has_img_size() const {
+  return _internal_has_img_size();
 }
 inline void PriorBoxParameter::clear_img_size() {
   img_size_ = 0u;
-  clear_has_img_size();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::uint32 PriorBoxParameter::img_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.img_size)
+inline uint32_t PriorBoxParameter::_internal_img_size() const {
   return img_size_;
 }
-inline void PriorBoxParameter::set_img_size(::google::protobuf::uint32 value) {
-  set_has_img_size();
+inline uint32_t PriorBoxParameter::img_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.img_size)
+  return _internal_img_size();
+}
+inline void PriorBoxParameter::_internal_set_img_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   img_size_ = value;
+}
+inline void PriorBoxParameter::set_img_size(uint32_t value) {
+  _internal_set_img_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.img_size)
 }
 
 // optional uint32 img_h = 8;
-inline bool PriorBoxParameter::has_img_h() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void PriorBoxParameter::set_has_img_h() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool PriorBoxParameter::_internal_has_img_h() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::clear_has_img_h() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool PriorBoxParameter::has_img_h() const {
+  return _internal_has_img_h();
 }
 inline void PriorBoxParameter::clear_img_h() {
   img_h_ = 0u;
-  clear_has_img_h();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::uint32 PriorBoxParameter::img_h() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.img_h)
+inline uint32_t PriorBoxParameter::_internal_img_h() const {
   return img_h_;
 }
-inline void PriorBoxParameter::set_img_h(::google::protobuf::uint32 value) {
-  set_has_img_h();
+inline uint32_t PriorBoxParameter::img_h() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.img_h)
+  return _internal_img_h();
+}
+inline void PriorBoxParameter::_internal_set_img_h(uint32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   img_h_ = value;
+}
+inline void PriorBoxParameter::set_img_h(uint32_t value) {
+  _internal_set_img_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.img_h)
 }
 
 // optional uint32 img_w = 9;
-inline bool PriorBoxParameter::has_img_w() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void PriorBoxParameter::set_has_img_w() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool PriorBoxParameter::_internal_has_img_w() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::clear_has_img_w() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool PriorBoxParameter::has_img_w() const {
+  return _internal_has_img_w();
 }
 inline void PriorBoxParameter::clear_img_w() {
   img_w_ = 0u;
-  clear_has_img_w();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 PriorBoxParameter::img_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.img_w)
+inline uint32_t PriorBoxParameter::_internal_img_w() const {
   return img_w_;
 }
-inline void PriorBoxParameter::set_img_w(::google::protobuf::uint32 value) {
-  set_has_img_w();
+inline uint32_t PriorBoxParameter::img_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.img_w)
+  return _internal_img_w();
+}
+inline void PriorBoxParameter::_internal_set_img_w(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   img_w_ = value;
+}
+inline void PriorBoxParameter::set_img_w(uint32_t value) {
+  _internal_set_img_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.img_w)
 }
 
 // optional float step = 10;
-inline bool PriorBoxParameter::has_step() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool PriorBoxParameter::_internal_has_step() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::set_has_step() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void PriorBoxParameter::clear_has_step() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool PriorBoxParameter::has_step() const {
+  return _internal_has_step();
 }
 inline void PriorBoxParameter::clear_step() {
   step_ = 0;
-  clear_has_step();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline float PriorBoxParameter::_internal_step() const {
+  return step_;
 }
 inline float PriorBoxParameter::step() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.step)
-  return step_;
+  return _internal_step();
 }
-inline void PriorBoxParameter::set_step(float value) {
-  set_has_step();
+inline void PriorBoxParameter::_internal_set_step(float value) {
+  _has_bits_[0] |= 0x00000008u;
   step_ = value;
+}
+inline void PriorBoxParameter::set_step(float value) {
+  _internal_set_step(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.step)
 }
 
 // optional float step_h = 11;
-inline bool PriorBoxParameter::has_step_h() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void PriorBoxParameter::set_has_step_h() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool PriorBoxParameter::_internal_has_step_h() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::clear_has_step_h() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool PriorBoxParameter::has_step_h() const {
+  return _internal_has_step_h();
 }
 inline void PriorBoxParameter::clear_step_h() {
   step_h_ = 0;
-  clear_has_step_h();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline float PriorBoxParameter::_internal_step_h() const {
+  return step_h_;
 }
 inline float PriorBoxParameter::step_h() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.step_h)
-  return step_h_;
+  return _internal_step_h();
 }
-inline void PriorBoxParameter::set_step_h(float value) {
-  set_has_step_h();
+inline void PriorBoxParameter::_internal_set_step_h(float value) {
+  _has_bits_[0] |= 0x00000010u;
   step_h_ = value;
+}
+inline void PriorBoxParameter::set_step_h(float value) {
+  _internal_set_step_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.step_h)
 }
 
 // optional float step_w = 12;
-inline bool PriorBoxParameter::has_step_w() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void PriorBoxParameter::set_has_step_w() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool PriorBoxParameter::_internal_has_step_w() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::clear_has_step_w() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool PriorBoxParameter::has_step_w() const {
+  return _internal_has_step_w();
 }
 inline void PriorBoxParameter::clear_step_w() {
   step_w_ = 0;
-  clear_has_step_w();
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline float PriorBoxParameter::step_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.step_w)
+inline float PriorBoxParameter::_internal_step_w() const {
   return step_w_;
 }
-inline void PriorBoxParameter::set_step_w(float value) {
-  set_has_step_w();
+inline float PriorBoxParameter::step_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.step_w)
+  return _internal_step_w();
+}
+inline void PriorBoxParameter::_internal_set_step_w(float value) {
+  _has_bits_[0] |= 0x00000020u;
   step_w_ = value;
+}
+inline void PriorBoxParameter::set_step_w(float value) {
+  _internal_set_step_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.step_w)
 }
 
 // optional float offset = 13 [default = 0.5];
-inline bool PriorBoxParameter::has_offset() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void PriorBoxParameter::set_has_offset() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool PriorBoxParameter::_internal_has_offset() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void PriorBoxParameter::clear_has_offset() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool PriorBoxParameter::has_offset() const {
+  return _internal_has_offset();
 }
 inline void PriorBoxParameter::clear_offset() {
   offset_ = 0.5f;
-  clear_has_offset();
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline float PriorBoxParameter::_internal_offset() const {
+  return offset_;
 }
 inline float PriorBoxParameter::offset() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.offset)
-  return offset_;
+  return _internal_offset();
 }
-inline void PriorBoxParameter::set_offset(float value) {
-  set_has_offset();
+inline void PriorBoxParameter::_internal_set_offset(float value) {
+  _has_bits_[0] |= 0x00000100u;
   offset_ = value;
+}
+inline void PriorBoxParameter::set_offset(float value) {
+  _internal_set_offset(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.offset)
 }
 
 // repeated float offset_h = 14;
-inline int PriorBoxParameter::offset_h_size() const {
+inline int PriorBoxParameter::_internal_offset_h_size() const {
   return offset_h_.size();
 }
+inline int PriorBoxParameter::offset_h_size() const {
+  return _internal_offset_h_size();
+}
 inline void PriorBoxParameter::clear_offset_h() {
   offset_h_.Clear();
 }
+inline float PriorBoxParameter::_internal_offset_h(int index) const {
+  return offset_h_.Get(index);
+}
 inline float PriorBoxParameter::offset_h(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.offset_h)
-  return offset_h_.Get(index);
+  return _internal_offset_h(index);
 }
 inline void PriorBoxParameter::set_offset_h(int index, float value) {
   offset_h_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.offset_h)
 }
-inline void PriorBoxParameter::add_offset_h(float value) {
+inline void PriorBoxParameter::_internal_add_offset_h(float value) {
   offset_h_.Add(value);
+}
+inline void PriorBoxParameter::add_offset_h(float value) {
+  _internal_add_offset_h(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PriorBoxParameter.offset_h)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+PriorBoxParameter::_internal_offset_h() const {
+  return offset_h_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 PriorBoxParameter::offset_h() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PriorBoxParameter.offset_h)
-  return offset_h_;
+  return _internal_offset_h();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+PriorBoxParameter::_internal_mutable_offset_h() {
+  return &offset_h_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 PriorBoxParameter::mutable_offset_h() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PriorBoxParameter.offset_h)
-  return &offset_h_;
+  return _internal_mutable_offset_h();
 }
 
 // repeated float offset_w = 15;
-inline int PriorBoxParameter::offset_w_size() const {
+inline int PriorBoxParameter::_internal_offset_w_size() const {
   return offset_w_.size();
 }
+inline int PriorBoxParameter::offset_w_size() const {
+  return _internal_offset_w_size();
+}
 inline void PriorBoxParameter::clear_offset_w() {
   offset_w_.Clear();
 }
+inline float PriorBoxParameter::_internal_offset_w(int index) const {
+  return offset_w_.Get(index);
+}
 inline float PriorBoxParameter::offset_w(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.offset_w)
-  return offset_w_.Get(index);
+  return _internal_offset_w(index);
 }
 inline void PriorBoxParameter::set_offset_w(int index, float value) {
   offset_w_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.offset_w)
 }
-inline void PriorBoxParameter::add_offset_w(float value) {
+inline void PriorBoxParameter::_internal_add_offset_w(float value) {
   offset_w_.Add(value);
+}
+inline void PriorBoxParameter::add_offset_w(float value) {
+  _internal_add_offset_w(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PriorBoxParameter.offset_w)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+PriorBoxParameter::_internal_offset_w() const {
+  return offset_w_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 PriorBoxParameter::offset_w() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PriorBoxParameter.offset_w)
-  return offset_w_;
+  return _internal_offset_w();
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+PriorBoxParameter::_internal_mutable_offset_w() {
+  return &offset_w_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 PriorBoxParameter::mutable_offset_w() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PriorBoxParameter.offset_w)
-  return &offset_w_;
+  return _internal_mutable_offset_w();
 }
 
 // repeated float width = 16;
-inline int PriorBoxParameter::width_size() const {
+inline int PriorBoxParameter::_internal_width_size() const {
   return width_.size();
 }
+inline int PriorBoxParameter::width_size() const {
+  return _internal_width_size();
+}
 inline void PriorBoxParameter::clear_width() {
   width_.Clear();
 }
+inline float PriorBoxParameter::_internal_width(int index) const {
+  return width_.Get(index);
+}
 inline float PriorBoxParameter::width(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.width)
-  return width_.Get(index);
+  return _internal_width(index);
 }
 inline void PriorBoxParameter::set_width(int index, float value) {
   width_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.width)
 }
-inline void PriorBoxParameter::add_width(float value) {
+inline void PriorBoxParameter::_internal_add_width(float value) {
   width_.Add(value);
+}
+inline void PriorBoxParameter::add_width(float value) {
+  _internal_add_width(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PriorBoxParameter.width)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+PriorBoxParameter::_internal_width() const {
+  return width_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 PriorBoxParameter::width() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PriorBoxParameter.width)
-  return width_;
+  return _internal_width();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+PriorBoxParameter::_internal_mutable_width() {
+  return &width_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 PriorBoxParameter::mutable_width() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PriorBoxParameter.width)
-  return &width_;
+  return _internal_mutable_width();
 }
 
 // repeated float height = 17;
-inline int PriorBoxParameter::height_size() const {
+inline int PriorBoxParameter::_internal_height_size() const {
   return height_.size();
 }
+inline int PriorBoxParameter::height_size() const {
+  return _internal_height_size();
+}
 inline void PriorBoxParameter::clear_height() {
   height_.Clear();
 }
+inline float PriorBoxParameter::_internal_height(int index) const {
+  return height_.Get(index);
+}
 inline float PriorBoxParameter::height(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PriorBoxParameter.height)
-  return height_.Get(index);
+  return _internal_height(index);
 }
 inline void PriorBoxParameter::set_height(int index, float value) {
   height_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PriorBoxParameter.height)
 }
-inline void PriorBoxParameter::add_height(float value) {
+inline void PriorBoxParameter::_internal_add_height(float value) {
   height_.Add(value);
+}
+inline void PriorBoxParameter::add_height(float value) {
+  _internal_add_height(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.PriorBoxParameter.height)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+PriorBoxParameter::_internal_height() const {
+  return height_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 PriorBoxParameter::height() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.PriorBoxParameter.height)
-  return height_;
+  return _internal_height();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+PriorBoxParameter::_internal_mutable_height() {
+  return &height_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 PriorBoxParameter::mutable_height() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.PriorBoxParameter.height)
-  return &height_;
+  return _internal_mutable_height();
 }
 
 // -------------------------------------------------------------------
@@ -15738,520 +22172,695 @@ PriorBoxParameter::mutable_height() {
 // DetectionOutputParameter
 
 // optional uint32 num_classes = 1;
-inline bool DetectionOutputParameter::has_num_classes() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void DetectionOutputParameter::set_has_num_classes() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool DetectionOutputParameter::_internal_has_num_classes() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void DetectionOutputParameter::clear_has_num_classes() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool DetectionOutputParameter::has_num_classes() const {
+  return _internal_has_num_classes();
 }
 inline void DetectionOutputParameter::clear_num_classes() {
   num_classes_ = 0u;
-  clear_has_num_classes();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 DetectionOutputParameter::num_classes() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.num_classes)
+inline uint32_t DetectionOutputParameter::_internal_num_classes() const {
   return num_classes_;
 }
-inline void DetectionOutputParameter::set_num_classes(::google::protobuf::uint32 value) {
-  set_has_num_classes();
+inline uint32_t DetectionOutputParameter::num_classes() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.num_classes)
+  return _internal_num_classes();
+}
+inline void DetectionOutputParameter::_internal_set_num_classes(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   num_classes_ = value;
+}
+inline void DetectionOutputParameter::set_num_classes(uint32_t value) {
+  _internal_set_num_classes(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.num_classes)
 }
 
 // optional bool share_location = 2 [default = true];
-inline bool DetectionOutputParameter::has_share_location() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void DetectionOutputParameter::set_has_share_location() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool DetectionOutputParameter::_internal_has_share_location() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void DetectionOutputParameter::clear_has_share_location() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool DetectionOutputParameter::has_share_location() const {
+  return _internal_has_share_location();
 }
 inline void DetectionOutputParameter::clear_share_location() {
   share_location_ = true;
-  clear_has_share_location();
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline bool DetectionOutputParameter::_internal_share_location() const {
+  return share_location_;
 }
 inline bool DetectionOutputParameter::share_location() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.share_location)
-  return share_location_;
+  return _internal_share_location();
 }
-inline void DetectionOutputParameter::set_share_location(bool value) {
-  set_has_share_location();
+inline void DetectionOutputParameter::_internal_set_share_location(bool value) {
+  _has_bits_[0] |= 0x00000200u;
   share_location_ = value;
+}
+inline void DetectionOutputParameter::set_share_location(bool value) {
+  _internal_set_share_location(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.share_location)
 }
 
 // optional int32 background_label_id = 3 [default = 0];
-inline bool DetectionOutputParameter::has_background_label_id() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void DetectionOutputParameter::set_has_background_label_id() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool DetectionOutputParameter::_internal_has_background_label_id() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void DetectionOutputParameter::clear_has_background_label_id() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool DetectionOutputParameter::has_background_label_id() const {
+  return _internal_has_background_label_id();
 }
 inline void DetectionOutputParameter::clear_background_label_id() {
   background_label_id_ = 0;
-  clear_has_background_label_id();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::int32 DetectionOutputParameter::background_label_id() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.background_label_id)
+inline int32_t DetectionOutputParameter::_internal_background_label_id() const {
   return background_label_id_;
 }
-inline void DetectionOutputParameter::set_background_label_id(::google::protobuf::int32 value) {
-  set_has_background_label_id();
+inline int32_t DetectionOutputParameter::background_label_id() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.background_label_id)
+  return _internal_background_label_id();
+}
+inline void DetectionOutputParameter::_internal_set_background_label_id(int32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   background_label_id_ = value;
+}
+inline void DetectionOutputParameter::set_background_label_id(int32_t value) {
+  _internal_set_background_label_id(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.background_label_id)
 }
 
 // optional .opencv_caffe.NonMaximumSuppressionParameter nms_param = 4;
-inline bool DetectionOutputParameter::has_nms_param() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool DetectionOutputParameter::_internal_has_nms_param() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || nms_param_ != nullptr);
+  return value;
 }
-inline void DetectionOutputParameter::set_has_nms_param() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool DetectionOutputParameter::has_nms_param() const {
+  return _internal_has_nms_param();
 }
-inline void DetectionOutputParameter::clear_has_nms_param() {
+inline void DetectionOutputParameter::clear_nms_param() {
+  if (nms_param_ != nullptr) nms_param_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void DetectionOutputParameter::clear_nms_param() {
-  if (nms_param_ != NULL) nms_param_->Clear();
-  clear_has_nms_param();
+inline const ::opencv_caffe::NonMaximumSuppressionParameter& DetectionOutputParameter::_internal_nms_param() const {
+  const ::opencv_caffe::NonMaximumSuppressionParameter* p = nms_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::NonMaximumSuppressionParameter&>(
+      ::opencv_caffe::_NonMaximumSuppressionParameter_default_instance_);
 }
 inline const ::opencv_caffe::NonMaximumSuppressionParameter& DetectionOutputParameter::nms_param() const {
-  const ::opencv_caffe::NonMaximumSuppressionParameter* p = nms_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.nms_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::NonMaximumSuppressionParameter*>(
-      &::opencv_caffe::_NonMaximumSuppressionParameter_default_instance_);
+  return _internal_nms_param();
+}
+inline void DetectionOutputParameter::unsafe_arena_set_allocated_nms_param(
+    ::opencv_caffe::NonMaximumSuppressionParameter* nms_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(nms_param_);
+  }
+  nms_param_ = nms_param;
+  if (nms_param) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.DetectionOutputParameter.nms_param)
 }
 inline ::opencv_caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::release_nms_param() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::NonMaximumSuppressionParameter* temp = nms_param_;
+  nms_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::unsafe_arena_release_nms_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.DetectionOutputParameter.nms_param)
-  clear_has_nms_param();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::NonMaximumSuppressionParameter* temp = nms_param_;
-  nms_param_ = NULL;
+  nms_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::mutable_nms_param() {
-  set_has_nms_param();
-  if (nms_param_ == NULL) {
-    nms_param_ = new ::opencv_caffe::NonMaximumSuppressionParameter;
+inline ::opencv_caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::_internal_mutable_nms_param() {
+  _has_bits_[0] |= 0x00000001u;
+  if (nms_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::NonMaximumSuppressionParameter>(GetArenaForAllocation());
+    nms_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.DetectionOutputParameter.nms_param)
   return nms_param_;
 }
+inline ::opencv_caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::mutable_nms_param() {
+  ::opencv_caffe::NonMaximumSuppressionParameter* _msg = _internal_mutable_nms_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.DetectionOutputParameter.nms_param)
+  return _msg;
+}
 inline void DetectionOutputParameter::set_allocated_nms_param(::opencv_caffe::NonMaximumSuppressionParameter* nms_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete nms_param_;
   }
   if (nms_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::NonMaximumSuppressionParameter>::GetOwningArena(nms_param);
     if (message_arena != submessage_arena) {
-      nms_param = ::google::protobuf::internal::GetOwnedMessage(
+      nms_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, nms_param, submessage_arena);
     }
-    set_has_nms_param();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_nms_param();
+    _has_bits_[0] &= ~0x00000001u;
   }
   nms_param_ = nms_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.DetectionOutputParameter.nms_param)
 }
 
 // optional .opencv_caffe.SaveOutputParameter save_output_param = 5;
-inline bool DetectionOutputParameter::has_save_output_param() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool DetectionOutputParameter::_internal_has_save_output_param() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || save_output_param_ != nullptr);
+  return value;
 }
-inline void DetectionOutputParameter::set_has_save_output_param() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool DetectionOutputParameter::has_save_output_param() const {
+  return _internal_has_save_output_param();
 }
-inline void DetectionOutputParameter::clear_has_save_output_param() {
+inline void DetectionOutputParameter::clear_save_output_param() {
+  if (save_output_param_ != nullptr) save_output_param_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void DetectionOutputParameter::clear_save_output_param() {
-  if (save_output_param_ != NULL) save_output_param_->Clear();
-  clear_has_save_output_param();
+inline const ::opencv_caffe::SaveOutputParameter& DetectionOutputParameter::_internal_save_output_param() const {
+  const ::opencv_caffe::SaveOutputParameter* p = save_output_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::SaveOutputParameter&>(
+      ::opencv_caffe::_SaveOutputParameter_default_instance_);
 }
 inline const ::opencv_caffe::SaveOutputParameter& DetectionOutputParameter::save_output_param() const {
-  const ::opencv_caffe::SaveOutputParameter* p = save_output_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.save_output_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::SaveOutputParameter*>(
-      &::opencv_caffe::_SaveOutputParameter_default_instance_);
+  return _internal_save_output_param();
+}
+inline void DetectionOutputParameter::unsafe_arena_set_allocated_save_output_param(
+    ::opencv_caffe::SaveOutputParameter* save_output_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(save_output_param_);
+  }
+  save_output_param_ = save_output_param;
+  if (save_output_param) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.DetectionOutputParameter.save_output_param)
 }
 inline ::opencv_caffe::SaveOutputParameter* DetectionOutputParameter::release_save_output_param() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::SaveOutputParameter* temp = save_output_param_;
+  save_output_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::SaveOutputParameter* DetectionOutputParameter::unsafe_arena_release_save_output_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.DetectionOutputParameter.save_output_param)
-  clear_has_save_output_param();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::SaveOutputParameter* temp = save_output_param_;
-  save_output_param_ = NULL;
+  save_output_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::SaveOutputParameter* DetectionOutputParameter::mutable_save_output_param() {
-  set_has_save_output_param();
-  if (save_output_param_ == NULL) {
-    save_output_param_ = new ::opencv_caffe::SaveOutputParameter;
+inline ::opencv_caffe::SaveOutputParameter* DetectionOutputParameter::_internal_mutable_save_output_param() {
+  _has_bits_[0] |= 0x00000002u;
+  if (save_output_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::SaveOutputParameter>(GetArenaForAllocation());
+    save_output_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.DetectionOutputParameter.save_output_param)
   return save_output_param_;
 }
+inline ::opencv_caffe::SaveOutputParameter* DetectionOutputParameter::mutable_save_output_param() {
+  ::opencv_caffe::SaveOutputParameter* _msg = _internal_mutable_save_output_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.DetectionOutputParameter.save_output_param)
+  return _msg;
+}
 inline void DetectionOutputParameter::set_allocated_save_output_param(::opencv_caffe::SaveOutputParameter* save_output_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete save_output_param_;
   }
   if (save_output_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::SaveOutputParameter>::GetOwningArena(save_output_param);
     if (message_arena != submessage_arena) {
-      save_output_param = ::google::protobuf::internal::GetOwnedMessage(
+      save_output_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, save_output_param, submessage_arena);
     }
-    set_has_save_output_param();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_save_output_param();
+    _has_bits_[0] &= ~0x00000002u;
   }
   save_output_param_ = save_output_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.DetectionOutputParameter.save_output_param)
 }
 
 // optional .opencv_caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
-inline bool DetectionOutputParameter::has_code_type() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void DetectionOutputParameter::set_has_code_type() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool DetectionOutputParameter::_internal_has_code_type() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void DetectionOutputParameter::clear_has_code_type() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool DetectionOutputParameter::has_code_type() const {
+  return _internal_has_code_type();
 }
 inline void DetectionOutputParameter::clear_code_type() {
   code_type_ = 1;
-  clear_has_code_type();
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline ::opencv_caffe::PriorBoxParameter_CodeType DetectionOutputParameter::_internal_code_type() const {
+  return static_cast< ::opencv_caffe::PriorBoxParameter_CodeType >(code_type_);
 }
 inline ::opencv_caffe::PriorBoxParameter_CodeType DetectionOutputParameter::code_type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.code_type)
-  return static_cast< ::opencv_caffe::PriorBoxParameter_CodeType >(code_type_);
+  return _internal_code_type();
 }
-inline void DetectionOutputParameter::set_code_type(::opencv_caffe::PriorBoxParameter_CodeType value) {
+inline void DetectionOutputParameter::_internal_set_code_type(::opencv_caffe::PriorBoxParameter_CodeType value) {
   assert(::opencv_caffe::PriorBoxParameter_CodeType_IsValid(value));
-  set_has_code_type();
+  _has_bits_[0] |= 0x00000100u;
   code_type_ = value;
+}
+inline void DetectionOutputParameter::set_code_type(::opencv_caffe::PriorBoxParameter_CodeType value) {
+  _internal_set_code_type(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.code_type)
 }
 
 // optional bool variance_encoded_in_target = 8 [default = false];
-inline bool DetectionOutputParameter::has_variance_encoded_in_target() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void DetectionOutputParameter::set_has_variance_encoded_in_target() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool DetectionOutputParameter::_internal_has_variance_encoded_in_target() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void DetectionOutputParameter::clear_has_variance_encoded_in_target() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool DetectionOutputParameter::has_variance_encoded_in_target() const {
+  return _internal_has_variance_encoded_in_target();
 }
 inline void DetectionOutputParameter::clear_variance_encoded_in_target() {
   variance_encoded_in_target_ = false;
-  clear_has_variance_encoded_in_target();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline bool DetectionOutputParameter::_internal_variance_encoded_in_target() const {
+  return variance_encoded_in_target_;
 }
 inline bool DetectionOutputParameter::variance_encoded_in_target() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.variance_encoded_in_target)
-  return variance_encoded_in_target_;
+  return _internal_variance_encoded_in_target();
 }
-inline void DetectionOutputParameter::set_variance_encoded_in_target(bool value) {
-  set_has_variance_encoded_in_target();
+inline void DetectionOutputParameter::_internal_set_variance_encoded_in_target(bool value) {
+  _has_bits_[0] |= 0x00000020u;
   variance_encoded_in_target_ = value;
+}
+inline void DetectionOutputParameter::set_variance_encoded_in_target(bool value) {
+  _internal_set_variance_encoded_in_target(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.variance_encoded_in_target)
 }
 
 // optional int32 keep_top_k = 7 [default = -1];
-inline bool DetectionOutputParameter::has_keep_top_k() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void DetectionOutputParameter::set_has_keep_top_k() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool DetectionOutputParameter::_internal_has_keep_top_k() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void DetectionOutputParameter::clear_has_keep_top_k() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool DetectionOutputParameter::has_keep_top_k() const {
+  return _internal_has_keep_top_k();
 }
 inline void DetectionOutputParameter::clear_keep_top_k() {
   keep_top_k_ = -1;
-  clear_has_keep_top_k();
+  _has_bits_[0] &= ~0x00000080u;
 }
-inline ::google::protobuf::int32 DetectionOutputParameter::keep_top_k() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.keep_top_k)
+inline int32_t DetectionOutputParameter::_internal_keep_top_k() const {
   return keep_top_k_;
 }
-inline void DetectionOutputParameter::set_keep_top_k(::google::protobuf::int32 value) {
-  set_has_keep_top_k();
+inline int32_t DetectionOutputParameter::keep_top_k() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.keep_top_k)
+  return _internal_keep_top_k();
+}
+inline void DetectionOutputParameter::_internal_set_keep_top_k(int32_t value) {
+  _has_bits_[0] |= 0x00000080u;
   keep_top_k_ = value;
+}
+inline void DetectionOutputParameter::set_keep_top_k(int32_t value) {
+  _internal_set_keep_top_k(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.keep_top_k)
 }
 
 // optional float confidence_threshold = 9;
-inline bool DetectionOutputParameter::has_confidence_threshold() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void DetectionOutputParameter::set_has_confidence_threshold() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool DetectionOutputParameter::_internal_has_confidence_threshold() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void DetectionOutputParameter::clear_has_confidence_threshold() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool DetectionOutputParameter::has_confidence_threshold() const {
+  return _internal_has_confidence_threshold();
 }
 inline void DetectionOutputParameter::clear_confidence_threshold() {
   confidence_threshold_ = 0;
-  clear_has_confidence_threshold();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline float DetectionOutputParameter::_internal_confidence_threshold() const {
+  return confidence_threshold_;
 }
 inline float DetectionOutputParameter::confidence_threshold() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.confidence_threshold)
-  return confidence_threshold_;
+  return _internal_confidence_threshold();
 }
-inline void DetectionOutputParameter::set_confidence_threshold(float value) {
-  set_has_confidence_threshold();
+inline void DetectionOutputParameter::_internal_set_confidence_threshold(float value) {
+  _has_bits_[0] |= 0x00000010u;
   confidence_threshold_ = value;
+}
+inline void DetectionOutputParameter::set_confidence_threshold(float value) {
+  _internal_set_confidence_threshold(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.confidence_threshold)
 }
 
 // optional bool normalized_bbox = 10 [default = true];
-inline bool DetectionOutputParameter::has_normalized_bbox() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
-}
-inline void DetectionOutputParameter::set_has_normalized_bbox() {
-  _has_bits_[0] |= 0x00000200u;
+inline bool DetectionOutputParameter::_internal_has_normalized_bbox() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void DetectionOutputParameter::clear_has_normalized_bbox() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool DetectionOutputParameter::has_normalized_bbox() const {
+  return _internal_has_normalized_bbox();
 }
 inline void DetectionOutputParameter::clear_normalized_bbox() {
   normalized_bbox_ = true;
-  clear_has_normalized_bbox();
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline bool DetectionOutputParameter::_internal_normalized_bbox() const {
+  return normalized_bbox_;
 }
 inline bool DetectionOutputParameter::normalized_bbox() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.normalized_bbox)
-  return normalized_bbox_;
+  return _internal_normalized_bbox();
 }
-inline void DetectionOutputParameter::set_normalized_bbox(bool value) {
-  set_has_normalized_bbox();
+inline void DetectionOutputParameter::_internal_set_normalized_bbox(bool value) {
+  _has_bits_[0] |= 0x00000400u;
   normalized_bbox_ = value;
+}
+inline void DetectionOutputParameter::set_normalized_bbox(bool value) {
+  _internal_set_normalized_bbox(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.normalized_bbox)
 }
 
+// optional bool clip = 1000 [default = false];
+inline bool DetectionOutputParameter::_internal_has_clip() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
+}
+inline bool DetectionOutputParameter::has_clip() const {
+  return _internal_has_clip();
+}
+inline void DetectionOutputParameter::clear_clip() {
+  clip_ = false;
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline bool DetectionOutputParameter::_internal_clip() const {
+  return clip_;
+}
+inline bool DetectionOutputParameter::clip() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DetectionOutputParameter.clip)
+  return _internal_clip();
+}
+inline void DetectionOutputParameter::_internal_set_clip(bool value) {
+  _has_bits_[0] |= 0x00000040u;
+  clip_ = value;
+}
+inline void DetectionOutputParameter::set_clip(bool value) {
+  _internal_set_clip(value);
+  // @@protoc_insertion_point(field_set:opencv_caffe.DetectionOutputParameter.clip)
+}
+
 // -------------------------------------------------------------------
 
 // Datum
 
 // optional int32 channels = 1;
-inline bool Datum::has_channels() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool Datum::_internal_has_channels() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void Datum::set_has_channels() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void Datum::clear_has_channels() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool Datum::has_channels() const {
+  return _internal_has_channels();
 }
 inline void Datum::clear_channels() {
   channels_ = 0;
-  clear_has_channels();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 Datum::channels() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.Datum.channels)
+inline int32_t Datum::_internal_channels() const {
   return channels_;
 }
-inline void Datum::set_channels(::google::protobuf::int32 value) {
-  set_has_channels();
+inline int32_t Datum::channels() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.Datum.channels)
+  return _internal_channels();
+}
+inline void Datum::_internal_set_channels(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   channels_ = value;
+}
+inline void Datum::set_channels(int32_t value) {
+  _internal_set_channels(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.Datum.channels)
 }
 
 // optional int32 height = 2;
-inline bool Datum::has_height() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void Datum::set_has_height() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool Datum::_internal_has_height() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void Datum::clear_has_height() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool Datum::has_height() const {
+  return _internal_has_height();
 }
 inline void Datum::clear_height() {
   height_ = 0;
-  clear_has_height();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 Datum::height() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.Datum.height)
+inline int32_t Datum::_internal_height() const {
   return height_;
 }
-inline void Datum::set_height(::google::protobuf::int32 value) {
-  set_has_height();
+inline int32_t Datum::height() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.Datum.height)
+  return _internal_height();
+}
+inline void Datum::_internal_set_height(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   height_ = value;
+}
+inline void Datum::set_height(int32_t value) {
+  _internal_set_height(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.Datum.height)
 }
 
 // optional int32 width = 3;
-inline bool Datum::has_width() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void Datum::set_has_width() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool Datum::_internal_has_width() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void Datum::clear_has_width() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool Datum::has_width() const {
+  return _internal_has_width();
 }
 inline void Datum::clear_width() {
   width_ = 0;
-  clear_has_width();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::int32 Datum::width() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.Datum.width)
+inline int32_t Datum::_internal_width() const {
   return width_;
 }
-inline void Datum::set_width(::google::protobuf::int32 value) {
-  set_has_width();
+inline int32_t Datum::width() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.Datum.width)
+  return _internal_width();
+}
+inline void Datum::_internal_set_width(int32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   width_ = value;
+}
+inline void Datum::set_width(int32_t value) {
+  _internal_set_width(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.Datum.width)
 }
 
 // optional bytes data = 4;
-inline bool Datum::has_data() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void Datum::set_has_data() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool Datum::_internal_has_data() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void Datum::clear_has_data() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool Datum::has_data() const {
+  return _internal_has_data();
 }
 inline void Datum::clear_data() {
-  data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_data();
+  data_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& Datum::data() const {
+inline const std::string& Datum::data() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.Datum.data)
-  return data_.GetNoArena();
+  return _internal_data();
 }
-inline void Datum::set_data(const ::std::string& value) {
-  set_has_data();
-  data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void Datum::set_data(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ data_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.Datum.data)
 }
-#if LANG_CXX11
-inline void Datum::set_data(::std::string&& value) {
-  set_has_data();
-  data_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.Datum.data)
-}
-#endif
-inline void Datum::set_data(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_data();
-  data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.Datum.data)
-}
-inline void Datum::set_data(const void* value, size_t size) {
-  set_has_data();
-  data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.Datum.data)
-}
-inline ::std::string* Datum::mutable_data() {
-  set_has_data();
+inline std::string* Datum::mutable_data() {
+  std::string* _s = _internal_mutable_data();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.Datum.data)
-  return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* Datum::release_data() {
+inline const std::string& Datum::_internal_data() const {
+  return data_.Get();
+}
+inline void Datum::_internal_set_data(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  data_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* Datum::_internal_mutable_data() {
+  _has_bits_[0] |= 0x00000001u;
+  return data_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* Datum::release_data() {
   // @@protoc_insertion_point(field_release:opencv_caffe.Datum.data)
-  clear_has_data();
-  return data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_data()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = data_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (data_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void Datum::set_allocated_data(::std::string* data) {
-  if (data != NULL) {
-    set_has_data();
+inline void Datum::set_allocated_data(std::string* data) {
+  if (data != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_data();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), data);
+  data_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), data,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (data_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.Datum.data)
 }
 
 // optional int32 label = 5;
-inline bool Datum::has_label() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void Datum::set_has_label() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool Datum::_internal_has_label() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void Datum::clear_has_label() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool Datum::has_label() const {
+  return _internal_has_label();
 }
 inline void Datum::clear_label() {
   label_ = 0;
-  clear_has_label();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::int32 Datum::label() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.Datum.label)
+inline int32_t Datum::_internal_label() const {
   return label_;
 }
-inline void Datum::set_label(::google::protobuf::int32 value) {
-  set_has_label();
+inline int32_t Datum::label() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.Datum.label)
+  return _internal_label();
+}
+inline void Datum::_internal_set_label(int32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   label_ = value;
+}
+inline void Datum::set_label(int32_t value) {
+  _internal_set_label(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.Datum.label)
 }
 
 // repeated float float_data = 6;
-inline int Datum::float_data_size() const {
+inline int Datum::_internal_float_data_size() const {
   return float_data_.size();
 }
+inline int Datum::float_data_size() const {
+  return _internal_float_data_size();
+}
 inline void Datum::clear_float_data() {
   float_data_.Clear();
 }
+inline float Datum::_internal_float_data(int index) const {
+  return float_data_.Get(index);
+}
 inline float Datum::float_data(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.Datum.float_data)
-  return float_data_.Get(index);
+  return _internal_float_data(index);
 }
 inline void Datum::set_float_data(int index, float value) {
   float_data_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.Datum.float_data)
 }
-inline void Datum::add_float_data(float value) {
+inline void Datum::_internal_add_float_data(float value) {
   float_data_.Add(value);
+}
+inline void Datum::add_float_data(float value) {
+  _internal_add_float_data(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.Datum.float_data)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+Datum::_internal_float_data() const {
+  return float_data_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 Datum::float_data() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.Datum.float_data)
-  return float_data_;
+  return _internal_float_data();
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+Datum::_internal_mutable_float_data() {
+  return &float_data_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 Datum::mutable_float_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.Datum.float_data)
-  return &float_data_;
+  return _internal_mutable_float_data();
 }
 
 // optional bool encoded = 7 [default = false];
-inline bool Datum::has_encoded() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool Datum::_internal_has_encoded() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void Datum::set_has_encoded() {
-  _has_bits_[0] |= 0x00000020u;
-}
-inline void Datum::clear_has_encoded() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool Datum::has_encoded() const {
+  return _internal_has_encoded();
 }
 inline void Datum::clear_encoded() {
   encoded_ = false;
-  clear_has_encoded();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline bool Datum::_internal_encoded() const {
+  return encoded_;
 }
 inline bool Datum::encoded() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.Datum.encoded)
-  return encoded_;
+  return _internal_encoded();
 }
-inline void Datum::set_encoded(bool value) {
-  set_has_encoded();
+inline void Datum::_internal_set_encoded(bool value) {
+  _has_bits_[0] |= 0x00000020u;
   encoded_ = value;
+}
+inline void Datum::set_encoded(bool value) {
+  _internal_set_encoded(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.Datum.encoded)
 }
 
@@ -16260,234 +22869,259 @@ inline void Datum::set_encoded(bool value) {
 // FillerParameter
 
 // optional string type = 1 [default = "constant"];
-inline bool FillerParameter::has_type() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void FillerParameter::set_has_type() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool FillerParameter::_internal_has_type() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void FillerParameter::clear_has_type() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool FillerParameter::has_type() const {
+  return _internal_has_type();
 }
 inline void FillerParameter::clear_type() {
-  type_.ClearToDefaultNoArena(&::opencv_caffe::FillerParameter::_default_type_.get());
-  clear_has_type();
+  type_.ClearToDefault(::opencv_caffe::FillerParameter::_i_give_permission_to_break_this_code_default_type_, GetArenaForAllocation());
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& FillerParameter::type() const {
+inline const std::string& FillerParameter::type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.type)
-  return type_.GetNoArena();
-}
-inline void FillerParameter::set_type(const ::std::string& value) {
-  set_has_type();
-  type_.SetNoArena(&::opencv_caffe::FillerParameter::_default_type_.get(), value);
+  if (type_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_type_.get();
+  return _internal_type();
+}
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FillerParameter::set_type(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.FillerParameter.type)
 }
-#if LANG_CXX11
-inline void FillerParameter::set_type(::std::string&& value) {
-  set_has_type();
-  type_.SetNoArena(
-    &::opencv_caffe::FillerParameter::_default_type_.get(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.FillerParameter.type)
-}
-#endif
-inline void FillerParameter::set_type(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_type();
-  type_.SetNoArena(&::opencv_caffe::FillerParameter::_default_type_.get(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.FillerParameter.type)
-}
-inline void FillerParameter::set_type(const char* value, size_t size) {
-  set_has_type();
-  type_.SetNoArena(&::opencv_caffe::FillerParameter::_default_type_.get(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.FillerParameter.type)
-}
-inline ::std::string* FillerParameter::mutable_type() {
-  set_has_type();
+inline std::string* FillerParameter::mutable_type() {
+  std::string* _s = _internal_mutable_type();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.FillerParameter.type)
-  return type_.MutableNoArena(&::opencv_caffe::FillerParameter::_default_type_.get());
+  return _s;
+}
+inline const std::string& FillerParameter::_internal_type() const {
+  return type_.Get();
+}
+inline void FillerParameter::_internal_set_type(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* FillerParameter::release_type() {
+inline std::string* FillerParameter::_internal_mutable_type() {
+  _has_bits_[0] |= 0x00000001u;
+  return type_.Mutable(::opencv_caffe::FillerParameter::_i_give_permission_to_break_this_code_default_type_, GetArenaForAllocation());
+}
+inline std::string* FillerParameter::release_type() {
   // @@protoc_insertion_point(field_release:opencv_caffe.FillerParameter.type)
-  clear_has_type();
-  return type_.ReleaseNoArena(&::opencv_caffe::FillerParameter::_default_type_.get());
+  if (!_internal_has_type()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = type_.ReleaseNonDefault(nullptr, GetArenaForAllocation());
+  return p;
 }
-inline void FillerParameter::set_allocated_type(::std::string* type) {
-  if (type != NULL) {
-    set_has_type();
+inline void FillerParameter::set_allocated_type(std::string* type) {
+  if (type != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_type();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  type_.SetAllocatedNoArena(&::opencv_caffe::FillerParameter::_default_type_.get(), type);
+  type_.SetAllocated(nullptr, type,
+      GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.FillerParameter.type)
 }
 
 // optional float value = 2 [default = 0];
-inline bool FillerParameter::has_value() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void FillerParameter::set_has_value() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool FillerParameter::_internal_has_value() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void FillerParameter::clear_has_value() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool FillerParameter::has_value() const {
+  return _internal_has_value();
 }
 inline void FillerParameter::clear_value() {
   value_ = 0;
-  clear_has_value();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline float FillerParameter::_internal_value() const {
+  return value_;
 }
 inline float FillerParameter::value() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.value)
-  return value_;
+  return _internal_value();
 }
-inline void FillerParameter::set_value(float value) {
-  set_has_value();
+inline void FillerParameter::_internal_set_value(float value) {
+  _has_bits_[0] |= 0x00000002u;
   value_ = value;
+}
+inline void FillerParameter::set_value(float value) {
+  _internal_set_value(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FillerParameter.value)
 }
 
 // optional float min = 3 [default = 0];
-inline bool FillerParameter::has_min() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void FillerParameter::set_has_min() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool FillerParameter::_internal_has_min() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void FillerParameter::clear_has_min() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool FillerParameter::has_min() const {
+  return _internal_has_min();
 }
 inline void FillerParameter::clear_min() {
   min_ = 0;
-  clear_has_min();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float FillerParameter::_internal_min() const {
+  return min_;
 }
 inline float FillerParameter::min() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.min)
-  return min_;
+  return _internal_min();
 }
-inline void FillerParameter::set_min(float value) {
-  set_has_min();
+inline void FillerParameter::_internal_set_min(float value) {
+  _has_bits_[0] |= 0x00000004u;
   min_ = value;
+}
+inline void FillerParameter::set_min(float value) {
+  _internal_set_min(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FillerParameter.min)
 }
 
 // optional float max = 4 [default = 1];
-inline bool FillerParameter::has_max() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void FillerParameter::set_has_max() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool FillerParameter::_internal_has_max() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void FillerParameter::clear_has_max() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool FillerParameter::has_max() const {
+  return _internal_has_max();
 }
 inline void FillerParameter::clear_max() {
   max_ = 1;
-  clear_has_max();
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline float FillerParameter::_internal_max() const {
+  return max_;
 }
 inline float FillerParameter::max() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.max)
-  return max_;
+  return _internal_max();
 }
-inline void FillerParameter::set_max(float value) {
-  set_has_max();
+inline void FillerParameter::_internal_set_max(float value) {
+  _has_bits_[0] |= 0x00000040u;
   max_ = value;
+}
+inline void FillerParameter::set_max(float value) {
+  _internal_set_max(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FillerParameter.max)
 }
 
 // optional float mean = 5 [default = 0];
-inline bool FillerParameter::has_mean() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool FillerParameter::_internal_has_mean() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void FillerParameter::set_has_mean() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void FillerParameter::clear_has_mean() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool FillerParameter::has_mean() const {
+  return _internal_has_mean();
 }
 inline void FillerParameter::clear_mean() {
   mean_ = 0;
-  clear_has_mean();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline float FillerParameter::_internal_mean() const {
+  return mean_;
 }
 inline float FillerParameter::mean() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.mean)
-  return mean_;
+  return _internal_mean();
 }
-inline void FillerParameter::set_mean(float value) {
-  set_has_mean();
+inline void FillerParameter::_internal_set_mean(float value) {
+  _has_bits_[0] |= 0x00000008u;
   mean_ = value;
+}
+inline void FillerParameter::set_mean(float value) {
+  _internal_set_mean(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FillerParameter.mean)
 }
 
 // optional float std = 6 [default = 1];
-inline bool FillerParameter::has_std() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void FillerParameter::set_has_std() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool FillerParameter::_internal_has_std() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void FillerParameter::clear_has_std() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool FillerParameter::has_std() const {
+  return _internal_has_std();
 }
 inline void FillerParameter::clear_std() {
   std_ = 1;
-  clear_has_std();
+  _has_bits_[0] &= ~0x00000080u;
+}
+inline float FillerParameter::_internal_std() const {
+  return std_;
 }
 inline float FillerParameter::std() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.std)
-  return std_;
+  return _internal_std();
 }
-inline void FillerParameter::set_std(float value) {
-  set_has_std();
+inline void FillerParameter::_internal_set_std(float value) {
+  _has_bits_[0] |= 0x00000080u;
   std_ = value;
+}
+inline void FillerParameter::set_std(float value) {
+  _internal_set_std(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FillerParameter.std)
 }
 
 // optional int32 sparse = 7 [default = -1];
-inline bool FillerParameter::has_sparse() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void FillerParameter::set_has_sparse() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool FillerParameter::_internal_has_sparse() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void FillerParameter::clear_has_sparse() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool FillerParameter::has_sparse() const {
+  return _internal_has_sparse();
 }
 inline void FillerParameter::clear_sparse() {
   sparse_ = -1;
-  clear_has_sparse();
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline ::google::protobuf::int32 FillerParameter::sparse() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.sparse)
+inline int32_t FillerParameter::_internal_sparse() const {
   return sparse_;
 }
-inline void FillerParameter::set_sparse(::google::protobuf::int32 value) {
-  set_has_sparse();
+inline int32_t FillerParameter::sparse() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.sparse)
+  return _internal_sparse();
+}
+inline void FillerParameter::_internal_set_sparse(int32_t value) {
+  _has_bits_[0] |= 0x00000020u;
   sparse_ = value;
+}
+inline void FillerParameter::set_sparse(int32_t value) {
+  _internal_set_sparse(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FillerParameter.sparse)
 }
 
 // optional .opencv_caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN];
-inline bool FillerParameter::has_variance_norm() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void FillerParameter::set_has_variance_norm() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool FillerParameter::_internal_has_variance_norm() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void FillerParameter::clear_has_variance_norm() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool FillerParameter::has_variance_norm() const {
+  return _internal_has_variance_norm();
 }
 inline void FillerParameter::clear_variance_norm() {
   variance_norm_ = 0;
-  clear_has_variance_norm();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline ::opencv_caffe::FillerParameter_VarianceNorm FillerParameter::_internal_variance_norm() const {
+  return static_cast< ::opencv_caffe::FillerParameter_VarianceNorm >(variance_norm_);
 }
 inline ::opencv_caffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.FillerParameter.variance_norm)
-  return static_cast< ::opencv_caffe::FillerParameter_VarianceNorm >(variance_norm_);
+  return _internal_variance_norm();
 }
-inline void FillerParameter::set_variance_norm(::opencv_caffe::FillerParameter_VarianceNorm value) {
+inline void FillerParameter::_internal_set_variance_norm(::opencv_caffe::FillerParameter_VarianceNorm value) {
   assert(::opencv_caffe::FillerParameter_VarianceNorm_IsValid(value));
-  set_has_variance_norm();
+  _has_bits_[0] |= 0x00000010u;
   variance_norm_ = value;
+}
+inline void FillerParameter::set_variance_norm(::opencv_caffe::FillerParameter_VarianceNorm value) {
+  _internal_set_variance_norm(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FillerParameter.variance_norm)
 }
 
@@ -16496,95 +23130,110 @@ inline void FillerParameter::set_variance_norm(::opencv_caffe::FillerParameter_V
 // NetParameter
 
 // optional string name = 1;
-inline bool NetParameter::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void NetParameter::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool NetParameter::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void NetParameter::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool NetParameter::has_name() const {
+  return _internal_has_name();
 }
 inline void NetParameter::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& NetParameter::name() const {
+inline const std::string& NetParameter::name() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void NetParameter::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NetParameter::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.NetParameter.name)
 }
-#if LANG_CXX11
-inline void NetParameter::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.NetParameter.name)
-}
-#endif
-inline void NetParameter::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:opencv_caffe.NetParameter.name)
-}
-inline void NetParameter::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:opencv_caffe.NetParameter.name)
-}
-inline ::std::string* NetParameter::mutable_name() {
-  set_has_name();
+inline std::string* NetParameter::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.NetParameter.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& NetParameter::_internal_name() const {
+  return name_.Get();
+}
+inline void NetParameter::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* NetParameter::release_name() {
+inline std::string* NetParameter::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* NetParameter::release_name() {
   // @@protoc_insertion_point(field_release:opencv_caffe.NetParameter.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void NetParameter::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void NetParameter::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.NetParameter.name)
 }
 
 // repeated string input = 3;
-inline int NetParameter::input_size() const {
+inline int NetParameter::_internal_input_size() const {
   return input_.size();
 }
+inline int NetParameter::input_size() const {
+  return _internal_input_size();
+}
 inline void NetParameter::clear_input() {
   input_.Clear();
 }
-inline const ::std::string& NetParameter::input(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.input)
+inline std::string* NetParameter::add_input() {
+  std::string* _s = _internal_add_input();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.NetParameter.input)
+  return _s;
+}
+inline const std::string& NetParameter::_internal_input(int index) const {
   return input_.Get(index);
 }
-inline ::std::string* NetParameter::mutable_input(int index) {
+inline const std::string& NetParameter::input(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.input)
+  return _internal_input(index);
+}
+inline std::string* NetParameter::mutable_input(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.NetParameter.input)
   return input_.Mutable(index);
 }
-inline void NetParameter::set_input(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.NetParameter.input)
+inline void NetParameter::set_input(int index, const std::string& value) {
   input_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void NetParameter::set_input(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.NetParameter.input)
+}
+inline void NetParameter::set_input(int index, std::string&& value) {
   input_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.NetParameter.input)
 }
-#endif
 inline void NetParameter::set_input(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   input_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.NetParameter.input)
 }
@@ -16593,22 +23242,19 @@ inline void NetParameter::set_input(int index, const char* value, size_t size) {
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.NetParameter.input)
 }
-inline ::std::string* NetParameter::add_input() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.NetParameter.input)
+inline std::string* NetParameter::_internal_add_input() {
   return input_.Add();
 }
-inline void NetParameter::add_input(const ::std::string& value) {
+inline void NetParameter::add_input(const std::string& value) {
   input_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.input)
 }
-#if LANG_CXX11
-inline void NetParameter::add_input(::std::string&& value) {
+inline void NetParameter::add_input(std::string&& value) {
   input_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.input)
 }
-#endif
 inline void NetParameter::add_input(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   input_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.NetParameter.input)
 }
@@ -16616,234 +23262,325 @@ inline void NetParameter::add_input(const char* value, size_t size) {
   input_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.NetParameter.input)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 NetParameter::input() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.NetParameter.input)
   return input_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 NetParameter::mutable_input() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.NetParameter.input)
   return &input_;
 }
 
 // repeated .opencv_caffe.BlobShape input_shape = 8;
-inline int NetParameter::input_shape_size() const {
+inline int NetParameter::_internal_input_shape_size() const {
   return input_shape_.size();
 }
+inline int NetParameter::input_shape_size() const {
+  return _internal_input_shape_size();
+}
 inline void NetParameter::clear_input_shape() {
   input_shape_.Clear();
 }
-inline const ::opencv_caffe::BlobShape& NetParameter::input_shape(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.input_shape)
-  return input_shape_.Get(index);
-}
 inline ::opencv_caffe::BlobShape* NetParameter::mutable_input_shape(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.NetParameter.input_shape)
   return input_shape_.Mutable(index);
 }
-inline ::opencv_caffe::BlobShape* NetParameter::add_input_shape() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.input_shape)
-  return input_shape_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >*
 NetParameter::mutable_input_shape() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.NetParameter.input_shape)
   return &input_shape_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >&
+inline const ::opencv_caffe::BlobShape& NetParameter::_internal_input_shape(int index) const {
+  return input_shape_.Get(index);
+}
+inline const ::opencv_caffe::BlobShape& NetParameter::input_shape(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.input_shape)
+  return _internal_input_shape(index);
+}
+inline ::opencv_caffe::BlobShape* NetParameter::_internal_add_input_shape() {
+  return input_shape_.Add();
+}
+inline ::opencv_caffe::BlobShape* NetParameter::add_input_shape() {
+  ::opencv_caffe::BlobShape* _add = _internal_add_input_shape();
+  // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.input_shape)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >&
 NetParameter::input_shape() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.NetParameter.input_shape)
   return input_shape_;
 }
 
 // repeated int32 input_dim = 4;
-inline int NetParameter::input_dim_size() const {
+inline int NetParameter::_internal_input_dim_size() const {
   return input_dim_.size();
 }
+inline int NetParameter::input_dim_size() const {
+  return _internal_input_dim_size();
+}
 inline void NetParameter::clear_input_dim() {
   input_dim_.Clear();
 }
-inline ::google::protobuf::int32 NetParameter::input_dim(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.input_dim)
+inline int32_t NetParameter::_internal_input_dim(int index) const {
   return input_dim_.Get(index);
 }
-inline void NetParameter::set_input_dim(int index, ::google::protobuf::int32 value) {
+inline int32_t NetParameter::input_dim(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.input_dim)
+  return _internal_input_dim(index);
+}
+inline void NetParameter::set_input_dim(int index, int32_t value) {
   input_dim_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NetParameter.input_dim)
 }
-inline void NetParameter::add_input_dim(::google::protobuf::int32 value) {
+inline void NetParameter::_internal_add_input_dim(int32_t value) {
   input_dim_.Add(value);
+}
+inline void NetParameter::add_input_dim(int32_t value) {
+  _internal_add_input_dim(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.input_dim)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+NetParameter::_internal_input_dim() const {
+  return input_dim_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 NetParameter::input_dim() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.NetParameter.input_dim)
-  return input_dim_;
+  return _internal_input_dim();
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+NetParameter::_internal_mutable_input_dim() {
+  return &input_dim_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 NetParameter::mutable_input_dim() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.NetParameter.input_dim)
-  return &input_dim_;
+  return _internal_mutable_input_dim();
 }
 
 // optional bool force_backward = 5 [default = false];
-inline bool NetParameter::has_force_backward() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool NetParameter::_internal_has_force_backward() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void NetParameter::set_has_force_backward() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void NetParameter::clear_has_force_backward() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool NetParameter::has_force_backward() const {
+  return _internal_has_force_backward();
 }
 inline void NetParameter::clear_force_backward() {
   force_backward_ = false;
-  clear_has_force_backward();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline bool NetParameter::_internal_force_backward() const {
+  return force_backward_;
 }
 inline bool NetParameter::force_backward() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.force_backward)
-  return force_backward_;
+  return _internal_force_backward();
 }
-inline void NetParameter::set_force_backward(bool value) {
-  set_has_force_backward();
+inline void NetParameter::_internal_set_force_backward(bool value) {
+  _has_bits_[0] |= 0x00000004u;
   force_backward_ = value;
+}
+inline void NetParameter::set_force_backward(bool value) {
+  _internal_set_force_backward(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NetParameter.force_backward)
 }
 
 // optional .opencv_caffe.NetState state = 6;
-inline bool NetParameter::has_state() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool NetParameter::_internal_has_state() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || state_ != nullptr);
+  return value;
 }
-inline void NetParameter::set_has_state() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool NetParameter::has_state() const {
+  return _internal_has_state();
 }
-inline void NetParameter::clear_has_state() {
+inline void NetParameter::clear_state() {
+  if (state_ != nullptr) state_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void NetParameter::clear_state() {
-  if (state_ != NULL) state_->Clear();
-  clear_has_state();
+inline const ::opencv_caffe::NetState& NetParameter::_internal_state() const {
+  const ::opencv_caffe::NetState* p = state_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::NetState&>(
+      ::opencv_caffe::_NetState_default_instance_);
 }
 inline const ::opencv_caffe::NetState& NetParameter::state() const {
-  const ::opencv_caffe::NetState* p = state_;
   // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.state)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::NetState*>(
-      &::opencv_caffe::_NetState_default_instance_);
+  return _internal_state();
+}
+inline void NetParameter::unsafe_arena_set_allocated_state(
+    ::opencv_caffe::NetState* state) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(state_);
+  }
+  state_ = state;
+  if (state) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.NetParameter.state)
 }
 inline ::opencv_caffe::NetState* NetParameter::release_state() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::NetState* temp = state_;
+  state_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::NetState* NetParameter::unsafe_arena_release_state() {
   // @@protoc_insertion_point(field_release:opencv_caffe.NetParameter.state)
-  clear_has_state();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::NetState* temp = state_;
-  state_ = NULL;
+  state_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::NetState* NetParameter::mutable_state() {
-  set_has_state();
-  if (state_ == NULL) {
-    state_ = new ::opencv_caffe::NetState;
+inline ::opencv_caffe::NetState* NetParameter::_internal_mutable_state() {
+  _has_bits_[0] |= 0x00000002u;
+  if (state_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::NetState>(GetArenaForAllocation());
+    state_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.NetParameter.state)
   return state_;
 }
+inline ::opencv_caffe::NetState* NetParameter::mutable_state() {
+  ::opencv_caffe::NetState* _msg = _internal_mutable_state();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.NetParameter.state)
+  return _msg;
+}
 inline void NetParameter::set_allocated_state(::opencv_caffe::NetState* state) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete state_;
   }
   if (state) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::NetState>::GetOwningArena(state);
     if (message_arena != submessage_arena) {
-      state = ::google::protobuf::internal::GetOwnedMessage(
+      state = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, state, submessage_arena);
     }
-    set_has_state();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_state();
+    _has_bits_[0] &= ~0x00000002u;
   }
   state_ = state;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.NetParameter.state)
 }
 
 // optional bool debug_info = 7 [default = false];
-inline bool NetParameter::has_debug_info() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void NetParameter::set_has_debug_info() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool NetParameter::_internal_has_debug_info() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void NetParameter::clear_has_debug_info() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool NetParameter::has_debug_info() const {
+  return _internal_has_debug_info();
 }
 inline void NetParameter::clear_debug_info() {
   debug_info_ = false;
-  clear_has_debug_info();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline bool NetParameter::_internal_debug_info() const {
+  return debug_info_;
 }
 inline bool NetParameter::debug_info() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.debug_info)
-  return debug_info_;
+  return _internal_debug_info();
 }
-inline void NetParameter::set_debug_info(bool value) {
-  set_has_debug_info();
+inline void NetParameter::_internal_set_debug_info(bool value) {
+  _has_bits_[0] |= 0x00000008u;
   debug_info_ = value;
+}
+inline void NetParameter::set_debug_info(bool value) {
+  _internal_set_debug_info(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NetParameter.debug_info)
 }
 
 // repeated .opencv_caffe.LayerParameter layer = 100;
-inline int NetParameter::layer_size() const {
+inline int NetParameter::_internal_layer_size() const {
   return layer_.size();
 }
+inline int NetParameter::layer_size() const {
+  return _internal_layer_size();
+}
 inline void NetParameter::clear_layer() {
   layer_.Clear();
 }
-inline const ::opencv_caffe::LayerParameter& NetParameter::layer(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.layer)
-  return layer_.Get(index);
-}
 inline ::opencv_caffe::LayerParameter* NetParameter::mutable_layer(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.NetParameter.layer)
   return layer_.Mutable(index);
 }
-inline ::opencv_caffe::LayerParameter* NetParameter::add_layer() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.layer)
-  return layer_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::LayerParameter >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::LayerParameter >*
 NetParameter::mutable_layer() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.NetParameter.layer)
   return &layer_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::LayerParameter >&
+inline const ::opencv_caffe::LayerParameter& NetParameter::_internal_layer(int index) const {
+  return layer_.Get(index);
+}
+inline const ::opencv_caffe::LayerParameter& NetParameter::layer(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.layer)
+  return _internal_layer(index);
+}
+inline ::opencv_caffe::LayerParameter* NetParameter::_internal_add_layer() {
+  return layer_.Add();
+}
+inline ::opencv_caffe::LayerParameter* NetParameter::add_layer() {
+  ::opencv_caffe::LayerParameter* _add = _internal_add_layer();
+  // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.layer)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::LayerParameter >&
 NetParameter::layer() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.NetParameter.layer)
   return layer_;
 }
 
 // repeated .opencv_caffe.V1LayerParameter layers = 2;
-inline int NetParameter::layers_size() const {
+inline int NetParameter::_internal_layers_size() const {
   return layers_.size();
 }
+inline int NetParameter::layers_size() const {
+  return _internal_layers_size();
+}
 inline void NetParameter::clear_layers() {
   layers_.Clear();
 }
-inline const ::opencv_caffe::V1LayerParameter& NetParameter::layers(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.layers)
-  return layers_.Get(index);
-}
 inline ::opencv_caffe::V1LayerParameter* NetParameter::mutable_layers(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.NetParameter.layers)
   return layers_.Mutable(index);
 }
-inline ::opencv_caffe::V1LayerParameter* NetParameter::add_layers() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.layers)
-  return layers_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::V1LayerParameter >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::V1LayerParameter >*
 NetParameter::mutable_layers() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.NetParameter.layers)
   return &layers_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::V1LayerParameter >&
+inline const ::opencv_caffe::V1LayerParameter& NetParameter::_internal_layers(int index) const {
+  return layers_.Get(index);
+}
+inline const ::opencv_caffe::V1LayerParameter& NetParameter::layers(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetParameter.layers)
+  return _internal_layers(index);
+}
+inline ::opencv_caffe::V1LayerParameter* NetParameter::_internal_add_layers() {
+  return layers_.Add();
+}
+inline ::opencv_caffe::V1LayerParameter* NetParameter::add_layers() {
+  ::opencv_caffe::V1LayerParameter* _add = _internal_add_layers();
+  // @@protoc_insertion_point(field_add:opencv_caffe.NetParameter.layers)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::V1LayerParameter >&
 NetParameter::layers() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.NetParameter.layers)
   return layers_;
@@ -16854,212 +23591,269 @@ NetParameter::layers() const {
 // SolverParameter
 
 // optional string net = 24;
-inline bool SolverParameter::has_net() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool SolverParameter::_internal_has_net() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_net() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void SolverParameter::clear_has_net() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool SolverParameter::has_net() const {
+  return _internal_has_net();
 }
 inline void SolverParameter::clear_net() {
-  net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_net();
+  net_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::std::string& SolverParameter::net() const {
+inline const std::string& SolverParameter::net() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.net)
-  return net_.GetNoArena();
+  return _internal_net();
 }
-inline void SolverParameter::set_net(const ::std::string& value) {
-  set_has_net();
-  net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SolverParameter::set_net(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.net)
 }
-#if LANG_CXX11
-inline void SolverParameter::set_net(::std::string&& value) {
-  set_has_net();
-  net_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SolverParameter.net)
-}
-#endif
-inline void SolverParameter::set_net(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_net();
-  net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SolverParameter.net)
-}
-inline void SolverParameter::set_net(const char* value, size_t size) {
-  set_has_net();
-  net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SolverParameter.net)
-}
-inline ::std::string* SolverParameter::mutable_net() {
-  set_has_net();
+inline std::string* SolverParameter::mutable_net() {
+  std::string* _s = _internal_mutable_net();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.net)
-  return net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& SolverParameter::_internal_net() const {
+  return net_.Get();
 }
-inline ::std::string* SolverParameter::release_net() {
+inline void SolverParameter::_internal_set_net(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SolverParameter::_internal_mutable_net() {
+  _has_bits_[0] |= 0x00000008u;
+  return net_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SolverParameter::release_net() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.net)
-  clear_has_net();
-  return net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_net()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000008u;
+  auto* p = net_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (net_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SolverParameter::set_allocated_net(::std::string* net) {
-  if (net != NULL) {
-    set_has_net();
+inline void SolverParameter::set_allocated_net(std::string* net) {
+  if (net != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_net();
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  net_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), net,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (net_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), net);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.net)
 }
 
 // optional .opencv_caffe.NetParameter net_param = 25;
-inline bool SolverParameter::has_net_param() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
+inline bool SolverParameter::_internal_has_net_param() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  PROTOBUF_ASSUME(!value || net_param_ != nullptr);
+  return value;
 }
-inline void SolverParameter::set_has_net_param() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool SolverParameter::has_net_param() const {
+  return _internal_has_net_param();
 }
-inline void SolverParameter::clear_has_net_param() {
+inline void SolverParameter::clear_net_param() {
+  if (net_param_ != nullptr) net_param_->Clear();
   _has_bits_[0] &= ~0x00000080u;
 }
-inline void SolverParameter::clear_net_param() {
-  if (net_param_ != NULL) net_param_->Clear();
-  clear_has_net_param();
+inline const ::opencv_caffe::NetParameter& SolverParameter::_internal_net_param() const {
+  const ::opencv_caffe::NetParameter* p = net_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::NetParameter&>(
+      ::opencv_caffe::_NetParameter_default_instance_);
 }
 inline const ::opencv_caffe::NetParameter& SolverParameter::net_param() const {
-  const ::opencv_caffe::NetParameter* p = net_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.net_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::NetParameter*>(
-      &::opencv_caffe::_NetParameter_default_instance_);
+  return _internal_net_param();
+}
+inline void SolverParameter::unsafe_arena_set_allocated_net_param(
+    ::opencv_caffe::NetParameter* net_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(net_param_);
+  }
+  net_param_ = net_param;
+  if (net_param) {
+    _has_bits_[0] |= 0x00000080u;
+  } else {
+    _has_bits_[0] &= ~0x00000080u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.SolverParameter.net_param)
 }
 inline ::opencv_caffe::NetParameter* SolverParameter::release_net_param() {
+  _has_bits_[0] &= ~0x00000080u;
+  ::opencv_caffe::NetParameter* temp = net_param_;
+  net_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::NetParameter* SolverParameter::unsafe_arena_release_net_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.net_param)
-  clear_has_net_param();
+  _has_bits_[0] &= ~0x00000080u;
   ::opencv_caffe::NetParameter* temp = net_param_;
-  net_param_ = NULL;
+  net_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::NetParameter* SolverParameter::mutable_net_param() {
-  set_has_net_param();
-  if (net_param_ == NULL) {
-    net_param_ = new ::opencv_caffe::NetParameter;
+inline ::opencv_caffe::NetParameter* SolverParameter::_internal_mutable_net_param() {
+  _has_bits_[0] |= 0x00000080u;
+  if (net_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::NetParameter>(GetArenaForAllocation());
+    net_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.net_param)
   return net_param_;
 }
+inline ::opencv_caffe::NetParameter* SolverParameter::mutable_net_param() {
+  ::opencv_caffe::NetParameter* _msg = _internal_mutable_net_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.net_param)
+  return _msg;
+}
 inline void SolverParameter::set_allocated_net_param(::opencv_caffe::NetParameter* net_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete net_param_;
   }
   if (net_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::NetParameter>::GetOwningArena(net_param);
     if (message_arena != submessage_arena) {
-      net_param = ::google::protobuf::internal::GetOwnedMessage(
+      net_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, net_param, submessage_arena);
     }
-    set_has_net_param();
+    _has_bits_[0] |= 0x00000080u;
   } else {
-    clear_has_net_param();
+    _has_bits_[0] &= ~0x00000080u;
   }
   net_param_ = net_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.net_param)
 }
 
 // optional string train_net = 1;
-inline bool SolverParameter::has_train_net() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void SolverParameter::set_has_train_net() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool SolverParameter::_internal_has_train_net() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_train_net() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool SolverParameter::has_train_net() const {
+  return _internal_has_train_net();
 }
 inline void SolverParameter::clear_train_net() {
-  train_net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_train_net();
+  train_net_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& SolverParameter::train_net() const {
+inline const std::string& SolverParameter::train_net() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.train_net)
-  return train_net_.GetNoArena();
+  return _internal_train_net();
 }
-inline void SolverParameter::set_train_net(const ::std::string& value) {
-  set_has_train_net();
-  train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SolverParameter::set_train_net(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ train_net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.train_net)
 }
-#if LANG_CXX11
-inline void SolverParameter::set_train_net(::std::string&& value) {
-  set_has_train_net();
-  train_net_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SolverParameter.train_net)
-}
-#endif
-inline void SolverParameter::set_train_net(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_train_net();
-  train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SolverParameter.train_net)
-}
-inline void SolverParameter::set_train_net(const char* value, size_t size) {
-  set_has_train_net();
-  train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SolverParameter.train_net)
-}
-inline ::std::string* SolverParameter::mutable_train_net() {
-  set_has_train_net();
+inline std::string* SolverParameter::mutable_train_net() {
+  std::string* _s = _internal_mutable_train_net();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.train_net)
-  return train_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* SolverParameter::release_train_net() {
+inline const std::string& SolverParameter::_internal_train_net() const {
+  return train_net_.Get();
+}
+inline void SolverParameter::_internal_set_train_net(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  train_net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SolverParameter::_internal_mutable_train_net() {
+  _has_bits_[0] |= 0x00000001u;
+  return train_net_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SolverParameter::release_train_net() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.train_net)
-  clear_has_train_net();
-  return train_net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_train_net()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = train_net_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (train_net_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    train_net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SolverParameter::set_allocated_train_net(::std::string* train_net) {
-  if (train_net != NULL) {
-    set_has_train_net();
+inline void SolverParameter::set_allocated_train_net(std::string* train_net) {
+  if (train_net != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_train_net();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  train_net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), train_net);
+  train_net_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), train_net,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (train_net_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    train_net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.train_net)
 }
 
 // repeated string test_net = 2;
-inline int SolverParameter::test_net_size() const {
+inline int SolverParameter::_internal_test_net_size() const {
   return test_net_.size();
 }
+inline int SolverParameter::test_net_size() const {
+  return _internal_test_net_size();
+}
 inline void SolverParameter::clear_test_net() {
   test_net_.Clear();
 }
-inline const ::std::string& SolverParameter::test_net(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_net)
+inline std::string* SolverParameter::add_test_net() {
+  std::string* _s = _internal_add_test_net();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.SolverParameter.test_net)
+  return _s;
+}
+inline const std::string& SolverParameter::_internal_test_net(int index) const {
   return test_net_.Get(index);
 }
-inline ::std::string* SolverParameter::mutable_test_net(int index) {
+inline const std::string& SolverParameter::test_net(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_net)
+  return _internal_test_net(index);
+}
+inline std::string* SolverParameter::mutable_test_net(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.test_net)
   return test_net_.Mutable(index);
 }
-inline void SolverParameter::set_test_net(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.test_net)
+inline void SolverParameter::set_test_net(int index, const std::string& value) {
   test_net_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void SolverParameter::set_test_net(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.test_net)
+}
+inline void SolverParameter::set_test_net(int index, std::string&& value) {
   test_net_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.test_net)
 }
-#endif
 inline void SolverParameter::set_test_net(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   test_net_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.SolverParameter.test_net)
 }
@@ -17068,22 +23862,19 @@ inline void SolverParameter::set_test_net(int index, const char* value, size_t s
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SolverParameter.test_net)
 }
-inline ::std::string* SolverParameter::add_test_net() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.SolverParameter.test_net)
+inline std::string* SolverParameter::_internal_add_test_net() {
   return test_net_.Add();
 }
-inline void SolverParameter::add_test_net(const ::std::string& value) {
+inline void SolverParameter::add_test_net(const std::string& value) {
   test_net_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.SolverParameter.test_net)
 }
-#if LANG_CXX11
-inline void SolverParameter::add_test_net(::std::string&& value) {
+inline void SolverParameter::add_test_net(std::string&& value) {
   test_net_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.SolverParameter.test_net)
 }
-#endif
 inline void SolverParameter::add_test_net(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   test_net_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.SolverParameter.test_net)
 }
@@ -17091,1121 +23882,1357 @@ inline void SolverParameter::add_test_net(const char* value, size_t size) {
   test_net_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.SolverParameter.test_net)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 SolverParameter::test_net() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.SolverParameter.test_net)
   return test_net_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 SolverParameter::mutable_test_net() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.SolverParameter.test_net)
   return &test_net_;
 }
 
 // optional .opencv_caffe.NetParameter train_net_param = 21;
-inline bool SolverParameter::has_train_net_param() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+inline bool SolverParameter::_internal_has_train_net_param() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  PROTOBUF_ASSUME(!value || train_net_param_ != nullptr);
+  return value;
 }
-inline void SolverParameter::set_has_train_net_param() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool SolverParameter::has_train_net_param() const {
+  return _internal_has_train_net_param();
 }
-inline void SolverParameter::clear_has_train_net_param() {
+inline void SolverParameter::clear_train_net_param() {
+  if (train_net_param_ != nullptr) train_net_param_->Clear();
   _has_bits_[0] &= ~0x00000040u;
 }
-inline void SolverParameter::clear_train_net_param() {
-  if (train_net_param_ != NULL) train_net_param_->Clear();
-  clear_has_train_net_param();
+inline const ::opencv_caffe::NetParameter& SolverParameter::_internal_train_net_param() const {
+  const ::opencv_caffe::NetParameter* p = train_net_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::NetParameter&>(
+      ::opencv_caffe::_NetParameter_default_instance_);
 }
 inline const ::opencv_caffe::NetParameter& SolverParameter::train_net_param() const {
-  const ::opencv_caffe::NetParameter* p = train_net_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.train_net_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::NetParameter*>(
-      &::opencv_caffe::_NetParameter_default_instance_);
+  return _internal_train_net_param();
+}
+inline void SolverParameter::unsafe_arena_set_allocated_train_net_param(
+    ::opencv_caffe::NetParameter* train_net_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(train_net_param_);
+  }
+  train_net_param_ = train_net_param;
+  if (train_net_param) {
+    _has_bits_[0] |= 0x00000040u;
+  } else {
+    _has_bits_[0] &= ~0x00000040u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.SolverParameter.train_net_param)
 }
 inline ::opencv_caffe::NetParameter* SolverParameter::release_train_net_param() {
+  _has_bits_[0] &= ~0x00000040u;
+  ::opencv_caffe::NetParameter* temp = train_net_param_;
+  train_net_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::NetParameter* SolverParameter::unsafe_arena_release_train_net_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.train_net_param)
-  clear_has_train_net_param();
+  _has_bits_[0] &= ~0x00000040u;
   ::opencv_caffe::NetParameter* temp = train_net_param_;
-  train_net_param_ = NULL;
+  train_net_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::NetParameter* SolverParameter::mutable_train_net_param() {
-  set_has_train_net_param();
-  if (train_net_param_ == NULL) {
-    train_net_param_ = new ::opencv_caffe::NetParameter;
+inline ::opencv_caffe::NetParameter* SolverParameter::_internal_mutable_train_net_param() {
+  _has_bits_[0] |= 0x00000040u;
+  if (train_net_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::NetParameter>(GetArenaForAllocation());
+    train_net_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.train_net_param)
   return train_net_param_;
 }
+inline ::opencv_caffe::NetParameter* SolverParameter::mutable_train_net_param() {
+  ::opencv_caffe::NetParameter* _msg = _internal_mutable_train_net_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.train_net_param)
+  return _msg;
+}
 inline void SolverParameter::set_allocated_train_net_param(::opencv_caffe::NetParameter* train_net_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete train_net_param_;
   }
   if (train_net_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::NetParameter>::GetOwningArena(train_net_param);
     if (message_arena != submessage_arena) {
-      train_net_param = ::google::protobuf::internal::GetOwnedMessage(
+      train_net_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, train_net_param, submessage_arena);
     }
-    set_has_train_net_param();
+    _has_bits_[0] |= 0x00000040u;
   } else {
-    clear_has_train_net_param();
+    _has_bits_[0] &= ~0x00000040u;
   }
   train_net_param_ = train_net_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.train_net_param)
 }
 
 // repeated .opencv_caffe.NetParameter test_net_param = 22;
-inline int SolverParameter::test_net_param_size() const {
+inline int SolverParameter::_internal_test_net_param_size() const {
   return test_net_param_.size();
 }
+inline int SolverParameter::test_net_param_size() const {
+  return _internal_test_net_param_size();
+}
 inline void SolverParameter::clear_test_net_param() {
   test_net_param_.Clear();
 }
-inline const ::opencv_caffe::NetParameter& SolverParameter::test_net_param(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_net_param)
-  return test_net_param_.Get(index);
-}
 inline ::opencv_caffe::NetParameter* SolverParameter::mutable_test_net_param(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.test_net_param)
   return test_net_param_.Mutable(index);
 }
-inline ::opencv_caffe::NetParameter* SolverParameter::add_test_net_param() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.SolverParameter.test_net_param)
-  return test_net_param_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetParameter >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetParameter >*
 SolverParameter::mutable_test_net_param() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.SolverParameter.test_net_param)
   return &test_net_param_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetParameter >&
+inline const ::opencv_caffe::NetParameter& SolverParameter::_internal_test_net_param(int index) const {
+  return test_net_param_.Get(index);
+}
+inline const ::opencv_caffe::NetParameter& SolverParameter::test_net_param(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_net_param)
+  return _internal_test_net_param(index);
+}
+inline ::opencv_caffe::NetParameter* SolverParameter::_internal_add_test_net_param() {
+  return test_net_param_.Add();
+}
+inline ::opencv_caffe::NetParameter* SolverParameter::add_test_net_param() {
+  ::opencv_caffe::NetParameter* _add = _internal_add_test_net_param();
+  // @@protoc_insertion_point(field_add:opencv_caffe.SolverParameter.test_net_param)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetParameter >&
 SolverParameter::test_net_param() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.SolverParameter.test_net_param)
   return test_net_param_;
 }
 
 // optional .opencv_caffe.NetState train_state = 26;
-inline bool SolverParameter::has_train_state() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
+inline bool SolverParameter::_internal_has_train_state() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  PROTOBUF_ASSUME(!value || train_state_ != nullptr);
+  return value;
 }
-inline void SolverParameter::set_has_train_state() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool SolverParameter::has_train_state() const {
+  return _internal_has_train_state();
 }
-inline void SolverParameter::clear_has_train_state() {
+inline void SolverParameter::clear_train_state() {
+  if (train_state_ != nullptr) train_state_->Clear();
   _has_bits_[0] &= ~0x00000100u;
 }
-inline void SolverParameter::clear_train_state() {
-  if (train_state_ != NULL) train_state_->Clear();
-  clear_has_train_state();
+inline const ::opencv_caffe::NetState& SolverParameter::_internal_train_state() const {
+  const ::opencv_caffe::NetState* p = train_state_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::NetState&>(
+      ::opencv_caffe::_NetState_default_instance_);
 }
 inline const ::opencv_caffe::NetState& SolverParameter::train_state() const {
-  const ::opencv_caffe::NetState* p = train_state_;
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.train_state)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::NetState*>(
-      &::opencv_caffe::_NetState_default_instance_);
+  return _internal_train_state();
+}
+inline void SolverParameter::unsafe_arena_set_allocated_train_state(
+    ::opencv_caffe::NetState* train_state) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(train_state_);
+  }
+  train_state_ = train_state;
+  if (train_state) {
+    _has_bits_[0] |= 0x00000100u;
+  } else {
+    _has_bits_[0] &= ~0x00000100u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.SolverParameter.train_state)
 }
 inline ::opencv_caffe::NetState* SolverParameter::release_train_state() {
+  _has_bits_[0] &= ~0x00000100u;
+  ::opencv_caffe::NetState* temp = train_state_;
+  train_state_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::NetState* SolverParameter::unsafe_arena_release_train_state() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.train_state)
-  clear_has_train_state();
+  _has_bits_[0] &= ~0x00000100u;
   ::opencv_caffe::NetState* temp = train_state_;
-  train_state_ = NULL;
+  train_state_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::NetState* SolverParameter::mutable_train_state() {
-  set_has_train_state();
-  if (train_state_ == NULL) {
-    train_state_ = new ::opencv_caffe::NetState;
+inline ::opencv_caffe::NetState* SolverParameter::_internal_mutable_train_state() {
+  _has_bits_[0] |= 0x00000100u;
+  if (train_state_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::NetState>(GetArenaForAllocation());
+    train_state_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.train_state)
   return train_state_;
 }
+inline ::opencv_caffe::NetState* SolverParameter::mutable_train_state() {
+  ::opencv_caffe::NetState* _msg = _internal_mutable_train_state();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.train_state)
+  return _msg;
+}
 inline void SolverParameter::set_allocated_train_state(::opencv_caffe::NetState* train_state) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete train_state_;
   }
   if (train_state) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::NetState>::GetOwningArena(train_state);
     if (message_arena != submessage_arena) {
-      train_state = ::google::protobuf::internal::GetOwnedMessage(
+      train_state = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, train_state, submessage_arena);
     }
-    set_has_train_state();
+    _has_bits_[0] |= 0x00000100u;
   } else {
-    clear_has_train_state();
+    _has_bits_[0] &= ~0x00000100u;
   }
   train_state_ = train_state;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.train_state)
 }
 
 // repeated .opencv_caffe.NetState test_state = 27;
-inline int SolverParameter::test_state_size() const {
+inline int SolverParameter::_internal_test_state_size() const {
   return test_state_.size();
 }
+inline int SolverParameter::test_state_size() const {
+  return _internal_test_state_size();
+}
 inline void SolverParameter::clear_test_state() {
   test_state_.Clear();
 }
-inline const ::opencv_caffe::NetState& SolverParameter::test_state(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_state)
-  return test_state_.Get(index);
-}
 inline ::opencv_caffe::NetState* SolverParameter::mutable_test_state(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.test_state)
   return test_state_.Mutable(index);
 }
-inline ::opencv_caffe::NetState* SolverParameter::add_test_state() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.SolverParameter.test_state)
-  return test_state_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetState >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetState >*
 SolverParameter::mutable_test_state() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.SolverParameter.test_state)
   return &test_state_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetState >&
+inline const ::opencv_caffe::NetState& SolverParameter::_internal_test_state(int index) const {
+  return test_state_.Get(index);
+}
+inline const ::opencv_caffe::NetState& SolverParameter::test_state(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_state)
+  return _internal_test_state(index);
+}
+inline ::opencv_caffe::NetState* SolverParameter::_internal_add_test_state() {
+  return test_state_.Add();
+}
+inline ::opencv_caffe::NetState* SolverParameter::add_test_state() {
+  ::opencv_caffe::NetState* _add = _internal_add_test_state();
+  // @@protoc_insertion_point(field_add:opencv_caffe.SolverParameter.test_state)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetState >&
 SolverParameter::test_state() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.SolverParameter.test_state)
   return test_state_;
 }
 
 // repeated int32 test_iter = 3;
-inline int SolverParameter::test_iter_size() const {
+inline int SolverParameter::_internal_test_iter_size() const {
   return test_iter_.size();
 }
+inline int SolverParameter::test_iter_size() const {
+  return _internal_test_iter_size();
+}
 inline void SolverParameter::clear_test_iter() {
   test_iter_.Clear();
 }
-inline ::google::protobuf::int32 SolverParameter::test_iter(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_iter)
+inline int32_t SolverParameter::_internal_test_iter(int index) const {
   return test_iter_.Get(index);
 }
-inline void SolverParameter::set_test_iter(int index, ::google::protobuf::int32 value) {
+inline int32_t SolverParameter::test_iter(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_iter)
+  return _internal_test_iter(index);
+}
+inline void SolverParameter::set_test_iter(int index, int32_t value) {
   test_iter_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.test_iter)
 }
-inline void SolverParameter::add_test_iter(::google::protobuf::int32 value) {
+inline void SolverParameter::_internal_add_test_iter(int32_t value) {
   test_iter_.Add(value);
+}
+inline void SolverParameter::add_test_iter(int32_t value) {
+  _internal_add_test_iter(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.SolverParameter.test_iter)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+SolverParameter::_internal_test_iter() const {
+  return test_iter_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 SolverParameter::test_iter() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.SolverParameter.test_iter)
-  return test_iter_;
+  return _internal_test_iter();
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+SolverParameter::_internal_mutable_test_iter() {
+  return &test_iter_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 SolverParameter::mutable_test_iter() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.SolverParameter.test_iter)
-  return &test_iter_;
+  return _internal_mutable_test_iter();
 }
 
 // optional int32 test_interval = 4 [default = 0];
+inline bool SolverParameter::_internal_has_test_interval() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
+}
 inline bool SolverParameter::has_test_interval() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
-}
-inline void SolverParameter::set_has_test_interval() {
-  _has_bits_[0] |= 0x00000200u;
-}
-inline void SolverParameter::clear_has_test_interval() {
-  _has_bits_[0] &= ~0x00000200u;
+  return _internal_has_test_interval();
 }
 inline void SolverParameter::clear_test_interval() {
   test_interval_ = 0;
-  clear_has_test_interval();
+  _has_bits_[0] &= ~0x00000200u;
 }
-inline ::google::protobuf::int32 SolverParameter::test_interval() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_interval)
+inline int32_t SolverParameter::_internal_test_interval() const {
   return test_interval_;
 }
-inline void SolverParameter::set_test_interval(::google::protobuf::int32 value) {
-  set_has_test_interval();
+inline int32_t SolverParameter::test_interval() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_interval)
+  return _internal_test_interval();
+}
+inline void SolverParameter::_internal_set_test_interval(int32_t value) {
+  _has_bits_[0] |= 0x00000200u;
   test_interval_ = value;
+}
+inline void SolverParameter::set_test_interval(int32_t value) {
+  _internal_set_test_interval(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.test_interval)
 }
 
 // optional bool test_compute_loss = 19 [default = false];
-inline bool SolverParameter::has_test_compute_loss() const {
-  return (_has_bits_[0] & 0x00100000u) != 0;
-}
-inline void SolverParameter::set_has_test_compute_loss() {
-  _has_bits_[0] |= 0x00100000u;
+inline bool SolverParameter::_internal_has_test_compute_loss() const {
+  bool value = (_has_bits_[0] & 0x00100000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_test_compute_loss() {
-  _has_bits_[0] &= ~0x00100000u;
+inline bool SolverParameter::has_test_compute_loss() const {
+  return _internal_has_test_compute_loss();
 }
 inline void SolverParameter::clear_test_compute_loss() {
   test_compute_loss_ = false;
-  clear_has_test_compute_loss();
+  _has_bits_[0] &= ~0x00100000u;
+}
+inline bool SolverParameter::_internal_test_compute_loss() const {
+  return test_compute_loss_;
 }
 inline bool SolverParameter::test_compute_loss() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_compute_loss)
-  return test_compute_loss_;
+  return _internal_test_compute_loss();
 }
-inline void SolverParameter::set_test_compute_loss(bool value) {
-  set_has_test_compute_loss();
+inline void SolverParameter::_internal_set_test_compute_loss(bool value) {
+  _has_bits_[0] |= 0x00100000u;
   test_compute_loss_ = value;
+}
+inline void SolverParameter::set_test_compute_loss(bool value) {
+  _internal_set_test_compute_loss(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.test_compute_loss)
 }
 
 // optional bool test_initialization = 32 [default = true];
-inline bool SolverParameter::has_test_initialization() const {
-  return (_has_bits_[0] & 0x08000000u) != 0;
+inline bool SolverParameter::_internal_has_test_initialization() const {
+  bool value = (_has_bits_[0] & 0x08000000u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_test_initialization() {
-  _has_bits_[0] |= 0x08000000u;
-}
-inline void SolverParameter::clear_has_test_initialization() {
-  _has_bits_[0] &= ~0x08000000u;
+inline bool SolverParameter::has_test_initialization() const {
+  return _internal_has_test_initialization();
 }
 inline void SolverParameter::clear_test_initialization() {
   test_initialization_ = true;
-  clear_has_test_initialization();
+  _has_bits_[0] &= ~0x08000000u;
+}
+inline bool SolverParameter::_internal_test_initialization() const {
+  return test_initialization_;
 }
 inline bool SolverParameter::test_initialization() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.test_initialization)
-  return test_initialization_;
+  return _internal_test_initialization();
 }
-inline void SolverParameter::set_test_initialization(bool value) {
-  set_has_test_initialization();
+inline void SolverParameter::_internal_set_test_initialization(bool value) {
+  _has_bits_[0] |= 0x08000000u;
   test_initialization_ = value;
+}
+inline void SolverParameter::set_test_initialization(bool value) {
+  _internal_set_test_initialization(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.test_initialization)
 }
 
 // optional float base_lr = 5;
-inline bool SolverParameter::has_base_lr() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+inline bool SolverParameter::_internal_has_base_lr() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_base_lr() {
-  _has_bits_[0] |= 0x00000400u;
-}
-inline void SolverParameter::clear_has_base_lr() {
-  _has_bits_[0] &= ~0x00000400u;
+inline bool SolverParameter::has_base_lr() const {
+  return _internal_has_base_lr();
 }
 inline void SolverParameter::clear_base_lr() {
   base_lr_ = 0;
-  clear_has_base_lr();
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline float SolverParameter::_internal_base_lr() const {
+  return base_lr_;
 }
 inline float SolverParameter::base_lr() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.base_lr)
-  return base_lr_;
+  return _internal_base_lr();
 }
-inline void SolverParameter::set_base_lr(float value) {
-  set_has_base_lr();
+inline void SolverParameter::_internal_set_base_lr(float value) {
+  _has_bits_[0] |= 0x00000400u;
   base_lr_ = value;
+}
+inline void SolverParameter::set_base_lr(float value) {
+  _internal_set_base_lr(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.base_lr)
 }
 
 // optional int32 display = 6;
-inline bool SolverParameter::has_display() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
-}
-inline void SolverParameter::set_has_display() {
-  _has_bits_[0] |= 0x00000800u;
+inline bool SolverParameter::_internal_has_display() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_display() {
-  _has_bits_[0] &= ~0x00000800u;
+inline bool SolverParameter::has_display() const {
+  return _internal_has_display();
 }
 inline void SolverParameter::clear_display() {
   display_ = 0;
-  clear_has_display();
+  _has_bits_[0] &= ~0x00000800u;
 }
-inline ::google::protobuf::int32 SolverParameter::display() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.display)
+inline int32_t SolverParameter::_internal_display() const {
   return display_;
 }
-inline void SolverParameter::set_display(::google::protobuf::int32 value) {
-  set_has_display();
+inline int32_t SolverParameter::display() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.display)
+  return _internal_display();
+}
+inline void SolverParameter::_internal_set_display(int32_t value) {
+  _has_bits_[0] |= 0x00000800u;
   display_ = value;
+}
+inline void SolverParameter::set_display(int32_t value) {
+  _internal_set_display(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.display)
 }
 
 // optional int32 average_loss = 33 [default = 1];
-inline bool SolverParameter::has_average_loss() const {
-  return (_has_bits_[0] & 0x40000000u) != 0;
+inline bool SolverParameter::_internal_has_average_loss() const {
+  bool value = (_has_bits_[0] & 0x40000000u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_average_loss() {
-  _has_bits_[0] |= 0x40000000u;
-}
-inline void SolverParameter::clear_has_average_loss() {
-  _has_bits_[0] &= ~0x40000000u;
+inline bool SolverParameter::has_average_loss() const {
+  return _internal_has_average_loss();
 }
 inline void SolverParameter::clear_average_loss() {
   average_loss_ = 1;
-  clear_has_average_loss();
+  _has_bits_[0] &= ~0x40000000u;
 }
-inline ::google::protobuf::int32 SolverParameter::average_loss() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.average_loss)
+inline int32_t SolverParameter::_internal_average_loss() const {
   return average_loss_;
 }
-inline void SolverParameter::set_average_loss(::google::protobuf::int32 value) {
-  set_has_average_loss();
+inline int32_t SolverParameter::average_loss() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.average_loss)
+  return _internal_average_loss();
+}
+inline void SolverParameter::_internal_set_average_loss(int32_t value) {
+  _has_bits_[0] |= 0x40000000u;
   average_loss_ = value;
+}
+inline void SolverParameter::set_average_loss(int32_t value) {
+  _internal_set_average_loss(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.average_loss)
 }
 
 // optional int32 max_iter = 7;
-inline bool SolverParameter::has_max_iter() const {
-  return (_has_bits_[0] & 0x00001000u) != 0;
-}
-inline void SolverParameter::set_has_max_iter() {
-  _has_bits_[0] |= 0x00001000u;
+inline bool SolverParameter::_internal_has_max_iter() const {
+  bool value = (_has_bits_[0] & 0x00001000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_max_iter() {
-  _has_bits_[0] &= ~0x00001000u;
+inline bool SolverParameter::has_max_iter() const {
+  return _internal_has_max_iter();
 }
 inline void SolverParameter::clear_max_iter() {
   max_iter_ = 0;
-  clear_has_max_iter();
+  _has_bits_[0] &= ~0x00001000u;
 }
-inline ::google::protobuf::int32 SolverParameter::max_iter() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.max_iter)
+inline int32_t SolverParameter::_internal_max_iter() const {
   return max_iter_;
 }
-inline void SolverParameter::set_max_iter(::google::protobuf::int32 value) {
-  set_has_max_iter();
+inline int32_t SolverParameter::max_iter() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.max_iter)
+  return _internal_max_iter();
+}
+inline void SolverParameter::_internal_set_max_iter(int32_t value) {
+  _has_bits_[0] |= 0x00001000u;
   max_iter_ = value;
+}
+inline void SolverParameter::set_max_iter(int32_t value) {
+  _internal_set_max_iter(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.max_iter)
 }
 
 // optional int32 iter_size = 36 [default = 1];
-inline bool SolverParameter::has_iter_size() const {
-  return (_has_bits_[1] & 0x00000001u) != 0;
-}
-inline void SolverParameter::set_has_iter_size() {
-  _has_bits_[1] |= 0x00000001u;
+inline bool SolverParameter::_internal_has_iter_size() const {
+  bool value = (_has_bits_[1] & 0x00000001u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_iter_size() {
-  _has_bits_[1] &= ~0x00000001u;
+inline bool SolverParameter::has_iter_size() const {
+  return _internal_has_iter_size();
 }
 inline void SolverParameter::clear_iter_size() {
   iter_size_ = 1;
-  clear_has_iter_size();
+  _has_bits_[1] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 SolverParameter::iter_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.iter_size)
+inline int32_t SolverParameter::_internal_iter_size() const {
   return iter_size_;
 }
-inline void SolverParameter::set_iter_size(::google::protobuf::int32 value) {
-  set_has_iter_size();
+inline int32_t SolverParameter::iter_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.iter_size)
+  return _internal_iter_size();
+}
+inline void SolverParameter::_internal_set_iter_size(int32_t value) {
+  _has_bits_[1] |= 0x00000001u;
   iter_size_ = value;
+}
+inline void SolverParameter::set_iter_size(int32_t value) {
+  _internal_set_iter_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.iter_size)
 }
 
 // optional string lr_policy = 8;
-inline bool SolverParameter::has_lr_policy() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool SolverParameter::_internal_has_lr_policy() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_lr_policy() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void SolverParameter::clear_has_lr_policy() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool SolverParameter::has_lr_policy() const {
+  return _internal_has_lr_policy();
 }
 inline void SolverParameter::clear_lr_policy() {
-  lr_policy_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_lr_policy();
+  lr_policy_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& SolverParameter::lr_policy() const {
+inline const std::string& SolverParameter::lr_policy() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.lr_policy)
-  return lr_policy_.GetNoArena();
+  return _internal_lr_policy();
 }
-inline void SolverParameter::set_lr_policy(const ::std::string& value) {
-  set_has_lr_policy();
-  lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SolverParameter::set_lr_policy(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ lr_policy_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.lr_policy)
 }
-#if LANG_CXX11
-inline void SolverParameter::set_lr_policy(::std::string&& value) {
-  set_has_lr_policy();
-  lr_policy_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SolverParameter.lr_policy)
-}
-#endif
-inline void SolverParameter::set_lr_policy(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_lr_policy();
-  lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SolverParameter.lr_policy)
-}
-inline void SolverParameter::set_lr_policy(const char* value, size_t size) {
-  set_has_lr_policy();
-  lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SolverParameter.lr_policy)
-}
-inline ::std::string* SolverParameter::mutable_lr_policy() {
-  set_has_lr_policy();
+inline std::string* SolverParameter::mutable_lr_policy() {
+  std::string* _s = _internal_mutable_lr_policy();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.lr_policy)
-  return lr_policy_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& SolverParameter::_internal_lr_policy() const {
+  return lr_policy_.Get();
+}
+inline void SolverParameter::_internal_set_lr_policy(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  lr_policy_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* SolverParameter::release_lr_policy() {
+inline std::string* SolverParameter::_internal_mutable_lr_policy() {
+  _has_bits_[0] |= 0x00000002u;
+  return lr_policy_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SolverParameter::release_lr_policy() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.lr_policy)
-  clear_has_lr_policy();
-  return lr_policy_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_lr_policy()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = lr_policy_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (lr_policy_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    lr_policy_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SolverParameter::set_allocated_lr_policy(::std::string* lr_policy) {
-  if (lr_policy != NULL) {
-    set_has_lr_policy();
+inline void SolverParameter::set_allocated_lr_policy(std::string* lr_policy) {
+  if (lr_policy != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_lr_policy();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  lr_policy_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), lr_policy,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (lr_policy_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    lr_policy_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  lr_policy_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), lr_policy);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.lr_policy)
 }
 
 // optional float gamma = 9;
-inline bool SolverParameter::has_gamma() const {
-  return (_has_bits_[0] & 0x00002000u) != 0;
-}
-inline void SolverParameter::set_has_gamma() {
-  _has_bits_[0] |= 0x00002000u;
+inline bool SolverParameter::_internal_has_gamma() const {
+  bool value = (_has_bits_[0] & 0x00002000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_gamma() {
-  _has_bits_[0] &= ~0x00002000u;
+inline bool SolverParameter::has_gamma() const {
+  return _internal_has_gamma();
 }
 inline void SolverParameter::clear_gamma() {
   gamma_ = 0;
-  clear_has_gamma();
+  _has_bits_[0] &= ~0x00002000u;
+}
+inline float SolverParameter::_internal_gamma() const {
+  return gamma_;
 }
 inline float SolverParameter::gamma() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.gamma)
-  return gamma_;
+  return _internal_gamma();
 }
-inline void SolverParameter::set_gamma(float value) {
-  set_has_gamma();
+inline void SolverParameter::_internal_set_gamma(float value) {
+  _has_bits_[0] |= 0x00002000u;
   gamma_ = value;
+}
+inline void SolverParameter::set_gamma(float value) {
+  _internal_set_gamma(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.gamma)
 }
 
 // optional float power = 10;
-inline bool SolverParameter::has_power() const {
-  return (_has_bits_[0] & 0x00004000u) != 0;
-}
-inline void SolverParameter::set_has_power() {
-  _has_bits_[0] |= 0x00004000u;
+inline bool SolverParameter::_internal_has_power() const {
+  bool value = (_has_bits_[0] & 0x00004000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_power() {
-  _has_bits_[0] &= ~0x00004000u;
+inline bool SolverParameter::has_power() const {
+  return _internal_has_power();
 }
 inline void SolverParameter::clear_power() {
   power_ = 0;
-  clear_has_power();
+  _has_bits_[0] &= ~0x00004000u;
+}
+inline float SolverParameter::_internal_power() const {
+  return power_;
 }
 inline float SolverParameter::power() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.power)
-  return power_;
+  return _internal_power();
 }
-inline void SolverParameter::set_power(float value) {
-  set_has_power();
+inline void SolverParameter::_internal_set_power(float value) {
+  _has_bits_[0] |= 0x00004000u;
   power_ = value;
+}
+inline void SolverParameter::set_power(float value) {
+  _internal_set_power(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.power)
 }
 
 // optional float momentum = 11;
-inline bool SolverParameter::has_momentum() const {
-  return (_has_bits_[0] & 0x00008000u) != 0;
+inline bool SolverParameter::_internal_has_momentum() const {
+  bool value = (_has_bits_[0] & 0x00008000u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_momentum() {
-  _has_bits_[0] |= 0x00008000u;
-}
-inline void SolverParameter::clear_has_momentum() {
-  _has_bits_[0] &= ~0x00008000u;
+inline bool SolverParameter::has_momentum() const {
+  return _internal_has_momentum();
 }
 inline void SolverParameter::clear_momentum() {
   momentum_ = 0;
-  clear_has_momentum();
+  _has_bits_[0] &= ~0x00008000u;
+}
+inline float SolverParameter::_internal_momentum() const {
+  return momentum_;
 }
 inline float SolverParameter::momentum() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.momentum)
-  return momentum_;
+  return _internal_momentum();
 }
-inline void SolverParameter::set_momentum(float value) {
-  set_has_momentum();
+inline void SolverParameter::_internal_set_momentum(float value) {
+  _has_bits_[0] |= 0x00008000u;
   momentum_ = value;
+}
+inline void SolverParameter::set_momentum(float value) {
+  _internal_set_momentum(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.momentum)
 }
 
 // optional float weight_decay = 12;
-inline bool SolverParameter::has_weight_decay() const {
-  return (_has_bits_[0] & 0x00010000u) != 0;
-}
-inline void SolverParameter::set_has_weight_decay() {
-  _has_bits_[0] |= 0x00010000u;
+inline bool SolverParameter::_internal_has_weight_decay() const {
+  bool value = (_has_bits_[0] & 0x00010000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_weight_decay() {
-  _has_bits_[0] &= ~0x00010000u;
+inline bool SolverParameter::has_weight_decay() const {
+  return _internal_has_weight_decay();
 }
 inline void SolverParameter::clear_weight_decay() {
   weight_decay_ = 0;
-  clear_has_weight_decay();
+  _has_bits_[0] &= ~0x00010000u;
+}
+inline float SolverParameter::_internal_weight_decay() const {
+  return weight_decay_;
 }
 inline float SolverParameter::weight_decay() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.weight_decay)
-  return weight_decay_;
+  return _internal_weight_decay();
 }
-inline void SolverParameter::set_weight_decay(float value) {
-  set_has_weight_decay();
+inline void SolverParameter::_internal_set_weight_decay(float value) {
+  _has_bits_[0] |= 0x00010000u;
   weight_decay_ = value;
+}
+inline void SolverParameter::set_weight_decay(float value) {
+  _internal_set_weight_decay(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.weight_decay)
 }
 
 // optional string regularization_type = 29 [default = "L2"];
-inline bool SolverParameter::has_regularization_type() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void SolverParameter::set_has_regularization_type() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool SolverParameter::_internal_has_regularization_type() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_regularization_type() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool SolverParameter::has_regularization_type() const {
+  return _internal_has_regularization_type();
 }
 inline void SolverParameter::clear_regularization_type() {
-  regularization_type_.ClearToDefaultNoArena(&::opencv_caffe::SolverParameter::_default_regularization_type_.get());
-  clear_has_regularization_type();
+  regularization_type_.ClearToDefault(::opencv_caffe::SolverParameter::_i_give_permission_to_break_this_code_default_regularization_type_, GetArenaForAllocation());
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline const ::std::string& SolverParameter::regularization_type() const {
+inline const std::string& SolverParameter::regularization_type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.regularization_type)
-  return regularization_type_.GetNoArena();
-}
-inline void SolverParameter::set_regularization_type(const ::std::string& value) {
-  set_has_regularization_type();
-  regularization_type_.SetNoArena(&::opencv_caffe::SolverParameter::_default_regularization_type_.get(), value);
+  if (regularization_type_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_regularization_type_.get();
+  return _internal_regularization_type();
+}
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SolverParameter::set_regularization_type(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000010u;
+ regularization_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.regularization_type)
 }
-#if LANG_CXX11
-inline void SolverParameter::set_regularization_type(::std::string&& value) {
-  set_has_regularization_type();
-  regularization_type_.SetNoArena(
-    &::opencv_caffe::SolverParameter::_default_regularization_type_.get(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SolverParameter.regularization_type)
-}
-#endif
-inline void SolverParameter::set_regularization_type(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_regularization_type();
-  regularization_type_.SetNoArena(&::opencv_caffe::SolverParameter::_default_regularization_type_.get(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SolverParameter.regularization_type)
-}
-inline void SolverParameter::set_regularization_type(const char* value, size_t size) {
-  set_has_regularization_type();
-  regularization_type_.SetNoArena(&::opencv_caffe::SolverParameter::_default_regularization_type_.get(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SolverParameter.regularization_type)
-}
-inline ::std::string* SolverParameter::mutable_regularization_type() {
-  set_has_regularization_type();
+inline std::string* SolverParameter::mutable_regularization_type() {
+  std::string* _s = _internal_mutable_regularization_type();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.regularization_type)
-  return regularization_type_.MutableNoArena(&::opencv_caffe::SolverParameter::_default_regularization_type_.get());
+  return _s;
+}
+inline const std::string& SolverParameter::_internal_regularization_type() const {
+  return regularization_type_.Get();
+}
+inline void SolverParameter::_internal_set_regularization_type(const std::string& value) {
+  _has_bits_[0] |= 0x00000010u;
+  regularization_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SolverParameter::_internal_mutable_regularization_type() {
+  _has_bits_[0] |= 0x00000010u;
+  return regularization_type_.Mutable(::opencv_caffe::SolverParameter::_i_give_permission_to_break_this_code_default_regularization_type_, GetArenaForAllocation());
 }
-inline ::std::string* SolverParameter::release_regularization_type() {
+inline std::string* SolverParameter::release_regularization_type() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.regularization_type)
-  clear_has_regularization_type();
-  return regularization_type_.ReleaseNoArena(&::opencv_caffe::SolverParameter::_default_regularization_type_.get());
+  if (!_internal_has_regularization_type()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000010u;
+  auto* p = regularization_type_.ReleaseNonDefault(nullptr, GetArenaForAllocation());
+  return p;
 }
-inline void SolverParameter::set_allocated_regularization_type(::std::string* regularization_type) {
-  if (regularization_type != NULL) {
-    set_has_regularization_type();
+inline void SolverParameter::set_allocated_regularization_type(std::string* regularization_type) {
+  if (regularization_type != nullptr) {
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_regularization_type();
+    _has_bits_[0] &= ~0x00000010u;
   }
-  regularization_type_.SetAllocatedNoArena(&::opencv_caffe::SolverParameter::_default_regularization_type_.get(), regularization_type);
+  regularization_type_.SetAllocated(nullptr, regularization_type,
+      GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.regularization_type)
 }
 
 // optional int32 stepsize = 13;
-inline bool SolverParameter::has_stepsize() const {
-  return (_has_bits_[0] & 0x00020000u) != 0;
+inline bool SolverParameter::_internal_has_stepsize() const {
+  bool value = (_has_bits_[0] & 0x00020000u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_stepsize() {
-  _has_bits_[0] |= 0x00020000u;
-}
-inline void SolverParameter::clear_has_stepsize() {
-  _has_bits_[0] &= ~0x00020000u;
+inline bool SolverParameter::has_stepsize() const {
+  return _internal_has_stepsize();
 }
 inline void SolverParameter::clear_stepsize() {
   stepsize_ = 0;
-  clear_has_stepsize();
+  _has_bits_[0] &= ~0x00020000u;
 }
-inline ::google::protobuf::int32 SolverParameter::stepsize() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.stepsize)
+inline int32_t SolverParameter::_internal_stepsize() const {
   return stepsize_;
 }
-inline void SolverParameter::set_stepsize(::google::protobuf::int32 value) {
-  set_has_stepsize();
+inline int32_t SolverParameter::stepsize() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.stepsize)
+  return _internal_stepsize();
+}
+inline void SolverParameter::_internal_set_stepsize(int32_t value) {
+  _has_bits_[0] |= 0x00020000u;
   stepsize_ = value;
+}
+inline void SolverParameter::set_stepsize(int32_t value) {
+  _internal_set_stepsize(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.stepsize)
 }
 
 // repeated int32 stepvalue = 34;
-inline int SolverParameter::stepvalue_size() const {
+inline int SolverParameter::_internal_stepvalue_size() const {
   return stepvalue_.size();
 }
+inline int SolverParameter::stepvalue_size() const {
+  return _internal_stepvalue_size();
+}
 inline void SolverParameter::clear_stepvalue() {
   stepvalue_.Clear();
 }
-inline ::google::protobuf::int32 SolverParameter::stepvalue(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.stepvalue)
+inline int32_t SolverParameter::_internal_stepvalue(int index) const {
   return stepvalue_.Get(index);
 }
-inline void SolverParameter::set_stepvalue(int index, ::google::protobuf::int32 value) {
+inline int32_t SolverParameter::stepvalue(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.stepvalue)
+  return _internal_stepvalue(index);
+}
+inline void SolverParameter::set_stepvalue(int index, int32_t value) {
   stepvalue_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.stepvalue)
 }
-inline void SolverParameter::add_stepvalue(::google::protobuf::int32 value) {
+inline void SolverParameter::_internal_add_stepvalue(int32_t value) {
   stepvalue_.Add(value);
+}
+inline void SolverParameter::add_stepvalue(int32_t value) {
+  _internal_add_stepvalue(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.SolverParameter.stepvalue)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+SolverParameter::_internal_stepvalue() const {
+  return stepvalue_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 SolverParameter::stepvalue() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.SolverParameter.stepvalue)
-  return stepvalue_;
+  return _internal_stepvalue();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+SolverParameter::_internal_mutable_stepvalue() {
+  return &stepvalue_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 SolverParameter::mutable_stepvalue() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.SolverParameter.stepvalue)
-  return &stepvalue_;
+  return _internal_mutable_stepvalue();
 }
 
 // optional float clip_gradients = 35 [default = -1];
-inline bool SolverParameter::has_clip_gradients() const {
-  return (_has_bits_[0] & 0x80000000u) != 0;
-}
-inline void SolverParameter::set_has_clip_gradients() {
-  _has_bits_[0] |= 0x80000000u;
+inline bool SolverParameter::_internal_has_clip_gradients() const {
+  bool value = (_has_bits_[0] & 0x80000000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_clip_gradients() {
-  _has_bits_[0] &= ~0x80000000u;
+inline bool SolverParameter::has_clip_gradients() const {
+  return _internal_has_clip_gradients();
 }
 inline void SolverParameter::clear_clip_gradients() {
   clip_gradients_ = -1;
-  clear_has_clip_gradients();
+  _has_bits_[0] &= ~0x80000000u;
+}
+inline float SolverParameter::_internal_clip_gradients() const {
+  return clip_gradients_;
 }
 inline float SolverParameter::clip_gradients() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.clip_gradients)
-  return clip_gradients_;
+  return _internal_clip_gradients();
 }
-inline void SolverParameter::set_clip_gradients(float value) {
-  set_has_clip_gradients();
+inline void SolverParameter::_internal_set_clip_gradients(float value) {
+  _has_bits_[0] |= 0x80000000u;
   clip_gradients_ = value;
+}
+inline void SolverParameter::set_clip_gradients(float value) {
+  _internal_set_clip_gradients(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.clip_gradients)
 }
 
 // optional int32 snapshot = 14 [default = 0];
-inline bool SolverParameter::has_snapshot() const {
-  return (_has_bits_[0] & 0x00040000u) != 0;
+inline bool SolverParameter::_internal_has_snapshot() const {
+  bool value = (_has_bits_[0] & 0x00040000u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_snapshot() {
-  _has_bits_[0] |= 0x00040000u;
-}
-inline void SolverParameter::clear_has_snapshot() {
-  _has_bits_[0] &= ~0x00040000u;
+inline bool SolverParameter::has_snapshot() const {
+  return _internal_has_snapshot();
 }
 inline void SolverParameter::clear_snapshot() {
   snapshot_ = 0;
-  clear_has_snapshot();
+  _has_bits_[0] &= ~0x00040000u;
 }
-inline ::google::protobuf::int32 SolverParameter::snapshot() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.snapshot)
+inline int32_t SolverParameter::_internal_snapshot() const {
   return snapshot_;
 }
-inline void SolverParameter::set_snapshot(::google::protobuf::int32 value) {
-  set_has_snapshot();
+inline int32_t SolverParameter::snapshot() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.snapshot)
+  return _internal_snapshot();
+}
+inline void SolverParameter::_internal_set_snapshot(int32_t value) {
+  _has_bits_[0] |= 0x00040000u;
   snapshot_ = value;
+}
+inline void SolverParameter::set_snapshot(int32_t value) {
+  _internal_set_snapshot(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.snapshot)
 }
 
 // optional string snapshot_prefix = 15;
-inline bool SolverParameter::has_snapshot_prefix() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void SolverParameter::set_has_snapshot_prefix() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool SolverParameter::_internal_has_snapshot_prefix() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_snapshot_prefix() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool SolverParameter::has_snapshot_prefix() const {
+  return _internal_has_snapshot_prefix();
 }
 inline void SolverParameter::clear_snapshot_prefix() {
-  snapshot_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_snapshot_prefix();
+  snapshot_prefix_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& SolverParameter::snapshot_prefix() const {
+inline const std::string& SolverParameter::snapshot_prefix() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.snapshot_prefix)
-  return snapshot_prefix_.GetNoArena();
+  return _internal_snapshot_prefix();
 }
-inline void SolverParameter::set_snapshot_prefix(const ::std::string& value) {
-  set_has_snapshot_prefix();
-  snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SolverParameter::set_snapshot_prefix(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ snapshot_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.snapshot_prefix)
 }
-#if LANG_CXX11
-inline void SolverParameter::set_snapshot_prefix(::std::string&& value) {
-  set_has_snapshot_prefix();
-  snapshot_prefix_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SolverParameter.snapshot_prefix)
-}
-#endif
-inline void SolverParameter::set_snapshot_prefix(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_snapshot_prefix();
-  snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SolverParameter.snapshot_prefix)
-}
-inline void SolverParameter::set_snapshot_prefix(const char* value, size_t size) {
-  set_has_snapshot_prefix();
-  snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SolverParameter.snapshot_prefix)
-}
-inline ::std::string* SolverParameter::mutable_snapshot_prefix() {
-  set_has_snapshot_prefix();
+inline std::string* SolverParameter::mutable_snapshot_prefix() {
+  std::string* _s = _internal_mutable_snapshot_prefix();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.snapshot_prefix)
-  return snapshot_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& SolverParameter::_internal_snapshot_prefix() const {
+  return snapshot_prefix_.Get();
+}
+inline void SolverParameter::_internal_set_snapshot_prefix(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  snapshot_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* SolverParameter::release_snapshot_prefix() {
+inline std::string* SolverParameter::_internal_mutable_snapshot_prefix() {
+  _has_bits_[0] |= 0x00000004u;
+  return snapshot_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SolverParameter::release_snapshot_prefix() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.snapshot_prefix)
-  clear_has_snapshot_prefix();
-  return snapshot_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_snapshot_prefix()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = snapshot_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (snapshot_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    snapshot_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SolverParameter::set_allocated_snapshot_prefix(::std::string* snapshot_prefix) {
-  if (snapshot_prefix != NULL) {
-    set_has_snapshot_prefix();
+inline void SolverParameter::set_allocated_snapshot_prefix(std::string* snapshot_prefix) {
+  if (snapshot_prefix != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_snapshot_prefix();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  snapshot_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), snapshot_prefix,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (snapshot_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    snapshot_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  snapshot_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), snapshot_prefix);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.snapshot_prefix)
 }
 
 // optional bool snapshot_diff = 16 [default = false];
-inline bool SolverParameter::has_snapshot_diff() const {
-  return (_has_bits_[0] & 0x00200000u) != 0;
-}
-inline void SolverParameter::set_has_snapshot_diff() {
-  _has_bits_[0] |= 0x00200000u;
+inline bool SolverParameter::_internal_has_snapshot_diff() const {
+  bool value = (_has_bits_[0] & 0x00200000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_snapshot_diff() {
-  _has_bits_[0] &= ~0x00200000u;
+inline bool SolverParameter::has_snapshot_diff() const {
+  return _internal_has_snapshot_diff();
 }
 inline void SolverParameter::clear_snapshot_diff() {
   snapshot_diff_ = false;
-  clear_has_snapshot_diff();
+  _has_bits_[0] &= ~0x00200000u;
+}
+inline bool SolverParameter::_internal_snapshot_diff() const {
+  return snapshot_diff_;
 }
 inline bool SolverParameter::snapshot_diff() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.snapshot_diff)
-  return snapshot_diff_;
+  return _internal_snapshot_diff();
 }
-inline void SolverParameter::set_snapshot_diff(bool value) {
-  set_has_snapshot_diff();
+inline void SolverParameter::_internal_set_snapshot_diff(bool value) {
+  _has_bits_[0] |= 0x00200000u;
   snapshot_diff_ = value;
+}
+inline void SolverParameter::set_snapshot_diff(bool value) {
+  _internal_set_snapshot_diff(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.snapshot_diff)
 }
 
 // optional .opencv_caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
-inline bool SolverParameter::has_snapshot_format() const {
-  return (_has_bits_[1] & 0x00000002u) != 0;
-}
-inline void SolverParameter::set_has_snapshot_format() {
-  _has_bits_[1] |= 0x00000002u;
+inline bool SolverParameter::_internal_has_snapshot_format() const {
+  bool value = (_has_bits_[1] & 0x00000002u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_snapshot_format() {
-  _has_bits_[1] &= ~0x00000002u;
+inline bool SolverParameter::has_snapshot_format() const {
+  return _internal_has_snapshot_format();
 }
 inline void SolverParameter::clear_snapshot_format() {
   snapshot_format_ = 1;
-  clear_has_snapshot_format();
+  _has_bits_[1] &= ~0x00000002u;
+}
+inline ::opencv_caffe::SolverParameter_SnapshotFormat SolverParameter::_internal_snapshot_format() const {
+  return static_cast< ::opencv_caffe::SolverParameter_SnapshotFormat >(snapshot_format_);
 }
 inline ::opencv_caffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.snapshot_format)
-  return static_cast< ::opencv_caffe::SolverParameter_SnapshotFormat >(snapshot_format_);
+  return _internal_snapshot_format();
 }
-inline void SolverParameter::set_snapshot_format(::opencv_caffe::SolverParameter_SnapshotFormat value) {
+inline void SolverParameter::_internal_set_snapshot_format(::opencv_caffe::SolverParameter_SnapshotFormat value) {
   assert(::opencv_caffe::SolverParameter_SnapshotFormat_IsValid(value));
-  set_has_snapshot_format();
+  _has_bits_[1] |= 0x00000002u;
   snapshot_format_ = value;
+}
+inline void SolverParameter::set_snapshot_format(::opencv_caffe::SolverParameter_SnapshotFormat value) {
+  _internal_set_snapshot_format(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.snapshot_format)
 }
 
 // optional .opencv_caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU];
-inline bool SolverParameter::has_solver_mode() const {
-  return (_has_bits_[0] & 0x04000000u) != 0;
+inline bool SolverParameter::_internal_has_solver_mode() const {
+  bool value = (_has_bits_[0] & 0x04000000u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_solver_mode() {
-  _has_bits_[0] |= 0x04000000u;
-}
-inline void SolverParameter::clear_has_solver_mode() {
-  _has_bits_[0] &= ~0x04000000u;
+inline bool SolverParameter::has_solver_mode() const {
+  return _internal_has_solver_mode();
 }
 inline void SolverParameter::clear_solver_mode() {
   solver_mode_ = 1;
-  clear_has_solver_mode();
+  _has_bits_[0] &= ~0x04000000u;
+}
+inline ::opencv_caffe::SolverParameter_SolverMode SolverParameter::_internal_solver_mode() const {
+  return static_cast< ::opencv_caffe::SolverParameter_SolverMode >(solver_mode_);
 }
 inline ::opencv_caffe::SolverParameter_SolverMode SolverParameter::solver_mode() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.solver_mode)
-  return static_cast< ::opencv_caffe::SolverParameter_SolverMode >(solver_mode_);
+  return _internal_solver_mode();
 }
-inline void SolverParameter::set_solver_mode(::opencv_caffe::SolverParameter_SolverMode value) {
+inline void SolverParameter::_internal_set_solver_mode(::opencv_caffe::SolverParameter_SolverMode value) {
   assert(::opencv_caffe::SolverParameter_SolverMode_IsValid(value));
-  set_has_solver_mode();
+  _has_bits_[0] |= 0x04000000u;
   solver_mode_ = value;
+}
+inline void SolverParameter::set_solver_mode(::opencv_caffe::SolverParameter_SolverMode value) {
+  _internal_set_solver_mode(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.solver_mode)
 }
 
 // optional int32 device_id = 18 [default = 0];
-inline bool SolverParameter::has_device_id() const {
-  return (_has_bits_[0] & 0x00080000u) != 0;
-}
-inline void SolverParameter::set_has_device_id() {
-  _has_bits_[0] |= 0x00080000u;
+inline bool SolverParameter::_internal_has_device_id() const {
+  bool value = (_has_bits_[0] & 0x00080000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_device_id() {
-  _has_bits_[0] &= ~0x00080000u;
+inline bool SolverParameter::has_device_id() const {
+  return _internal_has_device_id();
 }
 inline void SolverParameter::clear_device_id() {
   device_id_ = 0;
-  clear_has_device_id();
+  _has_bits_[0] &= ~0x00080000u;
 }
-inline ::google::protobuf::int32 SolverParameter::device_id() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.device_id)
+inline int32_t SolverParameter::_internal_device_id() const {
   return device_id_;
 }
-inline void SolverParameter::set_device_id(::google::protobuf::int32 value) {
-  set_has_device_id();
+inline int32_t SolverParameter::device_id() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.device_id)
+  return _internal_device_id();
+}
+inline void SolverParameter::_internal_set_device_id(int32_t value) {
+  _has_bits_[0] |= 0x00080000u;
   device_id_ = value;
+}
+inline void SolverParameter::set_device_id(int32_t value) {
+  _internal_set_device_id(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.device_id)
 }
 
 // optional int64 random_seed = 20 [default = -1];
-inline bool SolverParameter::has_random_seed() const {
-  return (_has_bits_[0] & 0x02000000u) != 0;
+inline bool SolverParameter::_internal_has_random_seed() const {
+  bool value = (_has_bits_[0] & 0x02000000u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_random_seed() {
-  _has_bits_[0] |= 0x02000000u;
+inline bool SolverParameter::has_random_seed() const {
+  return _internal_has_random_seed();
 }
-inline void SolverParameter::clear_has_random_seed() {
+inline void SolverParameter::clear_random_seed() {
+  random_seed_ = int64_t{-1};
   _has_bits_[0] &= ~0x02000000u;
 }
-inline void SolverParameter::clear_random_seed() {
-  random_seed_ = GOOGLE_LONGLONG(-1);
-  clear_has_random_seed();
+inline int64_t SolverParameter::_internal_random_seed() const {
+  return random_seed_;
 }
-inline ::google::protobuf::int64 SolverParameter::random_seed() const {
+inline int64_t SolverParameter::random_seed() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.random_seed)
-  return random_seed_;
+  return _internal_random_seed();
 }
-inline void SolverParameter::set_random_seed(::google::protobuf::int64 value) {
-  set_has_random_seed();
+inline void SolverParameter::_internal_set_random_seed(int64_t value) {
+  _has_bits_[0] |= 0x02000000u;
   random_seed_ = value;
+}
+inline void SolverParameter::set_random_seed(int64_t value) {
+  _internal_set_random_seed(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.random_seed)
 }
 
 // optional string type = 40 [default = "SGD"];
-inline bool SolverParameter::has_type() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool SolverParameter::_internal_has_type() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_type() {
-  _has_bits_[0] |= 0x00000020u;
-}
-inline void SolverParameter::clear_has_type() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool SolverParameter::has_type() const {
+  return _internal_has_type();
 }
 inline void SolverParameter::clear_type() {
-  type_.ClearToDefaultNoArena(&::opencv_caffe::SolverParameter::_default_type_.get());
-  clear_has_type();
+  type_.ClearToDefault(::opencv_caffe::SolverParameter::_i_give_permission_to_break_this_code_default_type_, GetArenaForAllocation());
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline const ::std::string& SolverParameter::type() const {
+inline const std::string& SolverParameter::type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.type)
-  return type_.GetNoArena();
-}
-inline void SolverParameter::set_type(const ::std::string& value) {
-  set_has_type();
-  type_.SetNoArena(&::opencv_caffe::SolverParameter::_default_type_.get(), value);
+  if (type_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_type_.get();
+  return _internal_type();
+}
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SolverParameter::set_type(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000020u;
+ type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.type)
 }
-#if LANG_CXX11
-inline void SolverParameter::set_type(::std::string&& value) {
-  set_has_type();
-  type_.SetNoArena(
-    &::opencv_caffe::SolverParameter::_default_type_.get(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SolverParameter.type)
-}
-#endif
-inline void SolverParameter::set_type(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_type();
-  type_.SetNoArena(&::opencv_caffe::SolverParameter::_default_type_.get(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SolverParameter.type)
-}
-inline void SolverParameter::set_type(const char* value, size_t size) {
-  set_has_type();
-  type_.SetNoArena(&::opencv_caffe::SolverParameter::_default_type_.get(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SolverParameter.type)
-}
-inline ::std::string* SolverParameter::mutable_type() {
-  set_has_type();
+inline std::string* SolverParameter::mutable_type() {
+  std::string* _s = _internal_mutable_type();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverParameter.type)
-  return type_.MutableNoArena(&::opencv_caffe::SolverParameter::_default_type_.get());
+  return _s;
+}
+inline const std::string& SolverParameter::_internal_type() const {
+  return type_.Get();
+}
+inline void SolverParameter::_internal_set_type(const std::string& value) {
+  _has_bits_[0] |= 0x00000020u;
+  type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SolverParameter::_internal_mutable_type() {
+  _has_bits_[0] |= 0x00000020u;
+  return type_.Mutable(::opencv_caffe::SolverParameter::_i_give_permission_to_break_this_code_default_type_, GetArenaForAllocation());
 }
-inline ::std::string* SolverParameter::release_type() {
+inline std::string* SolverParameter::release_type() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverParameter.type)
-  clear_has_type();
-  return type_.ReleaseNoArena(&::opencv_caffe::SolverParameter::_default_type_.get());
+  if (!_internal_has_type()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000020u;
+  auto* p = type_.ReleaseNonDefault(nullptr, GetArenaForAllocation());
+  return p;
 }
-inline void SolverParameter::set_allocated_type(::std::string* type) {
-  if (type != NULL) {
-    set_has_type();
+inline void SolverParameter::set_allocated_type(std::string* type) {
+  if (type != nullptr) {
+    _has_bits_[0] |= 0x00000020u;
   } else {
-    clear_has_type();
+    _has_bits_[0] &= ~0x00000020u;
   }
-  type_.SetAllocatedNoArena(&::opencv_caffe::SolverParameter::_default_type_.get(), type);
+  type_.SetAllocated(nullptr, type,
+      GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverParameter.type)
 }
 
 // optional float delta = 31 [default = 1e-08];
-inline bool SolverParameter::has_delta() const {
-  return (_has_bits_[0] & 0x20000000u) != 0;
-}
-inline void SolverParameter::set_has_delta() {
-  _has_bits_[0] |= 0x20000000u;
+inline bool SolverParameter::_internal_has_delta() const {
+  bool value = (_has_bits_[0] & 0x20000000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_delta() {
-  _has_bits_[0] &= ~0x20000000u;
+inline bool SolverParameter::has_delta() const {
+  return _internal_has_delta();
 }
 inline void SolverParameter::clear_delta() {
   delta_ = 1e-08f;
-  clear_has_delta();
+  _has_bits_[0] &= ~0x20000000u;
+}
+inline float SolverParameter::_internal_delta() const {
+  return delta_;
 }
 inline float SolverParameter::delta() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.delta)
-  return delta_;
+  return _internal_delta();
 }
-inline void SolverParameter::set_delta(float value) {
-  set_has_delta();
+inline void SolverParameter::_internal_set_delta(float value) {
+  _has_bits_[0] |= 0x20000000u;
   delta_ = value;
+}
+inline void SolverParameter::set_delta(float value) {
+  _internal_set_delta(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.delta)
 }
 
 // optional float momentum2 = 39 [default = 0.999];
-inline bool SolverParameter::has_momentum2() const {
-  return (_has_bits_[0] & 0x01000000u) != 0;
-}
-inline void SolverParameter::set_has_momentum2() {
-  _has_bits_[0] |= 0x01000000u;
+inline bool SolverParameter::_internal_has_momentum2() const {
+  bool value = (_has_bits_[0] & 0x01000000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_momentum2() {
-  _has_bits_[0] &= ~0x01000000u;
+inline bool SolverParameter::has_momentum2() const {
+  return _internal_has_momentum2();
 }
 inline void SolverParameter::clear_momentum2() {
   momentum2_ = 0.999f;
-  clear_has_momentum2();
+  _has_bits_[0] &= ~0x01000000u;
+}
+inline float SolverParameter::_internal_momentum2() const {
+  return momentum2_;
 }
 inline float SolverParameter::momentum2() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.momentum2)
-  return momentum2_;
+  return _internal_momentum2();
 }
-inline void SolverParameter::set_momentum2(float value) {
-  set_has_momentum2();
+inline void SolverParameter::_internal_set_momentum2(float value) {
+  _has_bits_[0] |= 0x01000000u;
   momentum2_ = value;
+}
+inline void SolverParameter::set_momentum2(float value) {
+  _internal_set_momentum2(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.momentum2)
 }
 
 // optional float rms_decay = 38 [default = 0.99];
-inline bool SolverParameter::has_rms_decay() const {
-  return (_has_bits_[1] & 0x00000004u) != 0;
+inline bool SolverParameter::_internal_has_rms_decay() const {
+  bool value = (_has_bits_[1] & 0x00000004u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_rms_decay() {
-  _has_bits_[1] |= 0x00000004u;
-}
-inline void SolverParameter::clear_has_rms_decay() {
-  _has_bits_[1] &= ~0x00000004u;
+inline bool SolverParameter::has_rms_decay() const {
+  return _internal_has_rms_decay();
 }
 inline void SolverParameter::clear_rms_decay() {
   rms_decay_ = 0.99f;
-  clear_has_rms_decay();
+  _has_bits_[1] &= ~0x00000004u;
+}
+inline float SolverParameter::_internal_rms_decay() const {
+  return rms_decay_;
 }
 inline float SolverParameter::rms_decay() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.rms_decay)
-  return rms_decay_;
+  return _internal_rms_decay();
 }
-inline void SolverParameter::set_rms_decay(float value) {
-  set_has_rms_decay();
+inline void SolverParameter::_internal_set_rms_decay(float value) {
+  _has_bits_[1] |= 0x00000004u;
   rms_decay_ = value;
+}
+inline void SolverParameter::set_rms_decay(float value) {
+  _internal_set_rms_decay(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.rms_decay)
 }
 
 // optional bool debug_info = 23 [default = false];
-inline bool SolverParameter::has_debug_info() const {
-  return (_has_bits_[0] & 0x00400000u) != 0;
-}
-inline void SolverParameter::set_has_debug_info() {
-  _has_bits_[0] |= 0x00400000u;
+inline bool SolverParameter::_internal_has_debug_info() const {
+  bool value = (_has_bits_[0] & 0x00400000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_debug_info() {
-  _has_bits_[0] &= ~0x00400000u;
+inline bool SolverParameter::has_debug_info() const {
+  return _internal_has_debug_info();
 }
 inline void SolverParameter::clear_debug_info() {
   debug_info_ = false;
-  clear_has_debug_info();
+  _has_bits_[0] &= ~0x00400000u;
+}
+inline bool SolverParameter::_internal_debug_info() const {
+  return debug_info_;
 }
 inline bool SolverParameter::debug_info() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.debug_info)
-  return debug_info_;
+  return _internal_debug_info();
 }
-inline void SolverParameter::set_debug_info(bool value) {
-  set_has_debug_info();
+inline void SolverParameter::_internal_set_debug_info(bool value) {
+  _has_bits_[0] |= 0x00400000u;
   debug_info_ = value;
+}
+inline void SolverParameter::set_debug_info(bool value) {
+  _internal_set_debug_info(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.debug_info)
 }
 
 // optional bool snapshot_after_train = 28 [default = true];
-inline bool SolverParameter::has_snapshot_after_train() const {
-  return (_has_bits_[0] & 0x10000000u) != 0;
-}
-inline void SolverParameter::set_has_snapshot_after_train() {
-  _has_bits_[0] |= 0x10000000u;
+inline bool SolverParameter::_internal_has_snapshot_after_train() const {
+  bool value = (_has_bits_[0] & 0x10000000u) != 0;
+  return value;
 }
-inline void SolverParameter::clear_has_snapshot_after_train() {
-  _has_bits_[0] &= ~0x10000000u;
+inline bool SolverParameter::has_snapshot_after_train() const {
+  return _internal_has_snapshot_after_train();
 }
 inline void SolverParameter::clear_snapshot_after_train() {
   snapshot_after_train_ = true;
-  clear_has_snapshot_after_train();
+  _has_bits_[0] &= ~0x10000000u;
+}
+inline bool SolverParameter::_internal_snapshot_after_train() const {
+  return snapshot_after_train_;
 }
 inline bool SolverParameter::snapshot_after_train() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.snapshot_after_train)
-  return snapshot_after_train_;
+  return _internal_snapshot_after_train();
 }
-inline void SolverParameter::set_snapshot_after_train(bool value) {
-  set_has_snapshot_after_train();
+inline void SolverParameter::_internal_set_snapshot_after_train(bool value) {
+  _has_bits_[0] |= 0x10000000u;
   snapshot_after_train_ = value;
+}
+inline void SolverParameter::set_snapshot_after_train(bool value) {
+  _internal_set_snapshot_after_train(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.snapshot_after_train)
 }
 
 // optional .opencv_caffe.SolverParameter.SolverType solver_type = 30 [default = SGD];
-inline bool SolverParameter::has_solver_type() const {
-  return (_has_bits_[0] & 0x00800000u) != 0;
+inline bool SolverParameter::_internal_has_solver_type() const {
+  bool value = (_has_bits_[0] & 0x00800000u) != 0;
+  return value;
 }
-inline void SolverParameter::set_has_solver_type() {
-  _has_bits_[0] |= 0x00800000u;
-}
-inline void SolverParameter::clear_has_solver_type() {
-  _has_bits_[0] &= ~0x00800000u;
+inline bool SolverParameter::has_solver_type() const {
+  return _internal_has_solver_type();
 }
 inline void SolverParameter::clear_solver_type() {
   solver_type_ = 0;
-  clear_has_solver_type();
+  _has_bits_[0] &= ~0x00800000u;
+}
+inline ::opencv_caffe::SolverParameter_SolverType SolverParameter::_internal_solver_type() const {
+  return static_cast< ::opencv_caffe::SolverParameter_SolverType >(solver_type_);
 }
 inline ::opencv_caffe::SolverParameter_SolverType SolverParameter::solver_type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverParameter.solver_type)
-  return static_cast< ::opencv_caffe::SolverParameter_SolverType >(solver_type_);
+  return _internal_solver_type();
 }
-inline void SolverParameter::set_solver_type(::opencv_caffe::SolverParameter_SolverType value) {
+inline void SolverParameter::_internal_set_solver_type(::opencv_caffe::SolverParameter_SolverType value) {
   assert(::opencv_caffe::SolverParameter_SolverType_IsValid(value));
-  set_has_solver_type();
+  _has_bits_[0] |= 0x00800000u;
   solver_type_ = value;
+}
+inline void SolverParameter::set_solver_type(::opencv_caffe::SolverParameter_SolverType value) {
+  _internal_set_solver_type(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverParameter.solver_type)
 }
 
@@ -18214,143 +25241,167 @@ inline void SolverParameter::set_solver_type(::opencv_caffe::SolverParameter_Sol
 // SolverState
 
 // optional int32 iter = 1;
-inline bool SolverState::has_iter() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void SolverState::set_has_iter() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool SolverState::_internal_has_iter() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void SolverState::clear_has_iter() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool SolverState::has_iter() const {
+  return _internal_has_iter();
 }
 inline void SolverState::clear_iter() {
   iter_ = 0;
-  clear_has_iter();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 SolverState::iter() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverState.iter)
+inline int32_t SolverState::_internal_iter() const {
   return iter_;
 }
-inline void SolverState::set_iter(::google::protobuf::int32 value) {
-  set_has_iter();
+inline int32_t SolverState::iter() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverState.iter)
+  return _internal_iter();
+}
+inline void SolverState::_internal_set_iter(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   iter_ = value;
+}
+inline void SolverState::set_iter(int32_t value) {
+  _internal_set_iter(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverState.iter)
 }
 
 // optional string learned_net = 2;
-inline bool SolverState::has_learned_net() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void SolverState::set_has_learned_net() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool SolverState::_internal_has_learned_net() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void SolverState::clear_has_learned_net() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool SolverState::has_learned_net() const {
+  return _internal_has_learned_net();
 }
 inline void SolverState::clear_learned_net() {
-  learned_net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_learned_net();
+  learned_net_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& SolverState::learned_net() const {
+inline const std::string& SolverState::learned_net() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SolverState.learned_net)
-  return learned_net_.GetNoArena();
+  return _internal_learned_net();
 }
-inline void SolverState::set_learned_net(const ::std::string& value) {
-  set_has_learned_net();
-  learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SolverState::set_learned_net(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ learned_net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverState.learned_net)
 }
-#if LANG_CXX11
-inline void SolverState::set_learned_net(::std::string&& value) {
-  set_has_learned_net();
-  learned_net_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SolverState.learned_net)
-}
-#endif
-inline void SolverState::set_learned_net(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_learned_net();
-  learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SolverState.learned_net)
-}
-inline void SolverState::set_learned_net(const char* value, size_t size) {
-  set_has_learned_net();
-  learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SolverState.learned_net)
-}
-inline ::std::string* SolverState::mutable_learned_net() {
-  set_has_learned_net();
+inline std::string* SolverState::mutable_learned_net() {
+  std::string* _s = _internal_mutable_learned_net();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverState.learned_net)
-  return learned_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& SolverState::_internal_learned_net() const {
+  return learned_net_.Get();
+}
+inline void SolverState::_internal_set_learned_net(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  learned_net_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SolverState::_internal_mutable_learned_net() {
+  _has_bits_[0] |= 0x00000001u;
+  return learned_net_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* SolverState::release_learned_net() {
+inline std::string* SolverState::release_learned_net() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SolverState.learned_net)
-  clear_has_learned_net();
-  return learned_net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_learned_net()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = learned_net_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (learned_net_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    learned_net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SolverState::set_allocated_learned_net(::std::string* learned_net) {
-  if (learned_net != NULL) {
-    set_has_learned_net();
+inline void SolverState::set_allocated_learned_net(std::string* learned_net) {
+  if (learned_net != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_learned_net();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  learned_net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), learned_net);
+  learned_net_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), learned_net,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (learned_net_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    learned_net_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SolverState.learned_net)
 }
 
 // repeated .opencv_caffe.BlobProto history = 3;
-inline int SolverState::history_size() const {
+inline int SolverState::_internal_history_size() const {
   return history_.size();
 }
+inline int SolverState::history_size() const {
+  return _internal_history_size();
+}
 inline void SolverState::clear_history() {
   history_.Clear();
 }
-inline const ::opencv_caffe::BlobProto& SolverState::history(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverState.history)
-  return history_.Get(index);
-}
 inline ::opencv_caffe::BlobProto* SolverState::mutable_history(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SolverState.history)
   return history_.Mutable(index);
 }
-inline ::opencv_caffe::BlobProto* SolverState::add_history() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.SolverState.history)
-  return history_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
 SolverState::mutable_history() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.SolverState.history)
   return &history_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+inline const ::opencv_caffe::BlobProto& SolverState::_internal_history(int index) const {
+  return history_.Get(index);
+}
+inline const ::opencv_caffe::BlobProto& SolverState::history(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverState.history)
+  return _internal_history(index);
+}
+inline ::opencv_caffe::BlobProto* SolverState::_internal_add_history() {
+  return history_.Add();
+}
+inline ::opencv_caffe::BlobProto* SolverState::add_history() {
+  ::opencv_caffe::BlobProto* _add = _internal_add_history();
+  // @@protoc_insertion_point(field_add:opencv_caffe.SolverState.history)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
 SolverState::history() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.SolverState.history)
   return history_;
 }
 
 // optional int32 current_step = 4 [default = 0];
-inline bool SolverState::has_current_step() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void SolverState::set_has_current_step() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool SolverState::_internal_has_current_step() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void SolverState::clear_has_current_step() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool SolverState::has_current_step() const {
+  return _internal_has_current_step();
 }
 inline void SolverState::clear_current_step() {
   current_step_ = 0;
-  clear_has_current_step();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 SolverState::current_step() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SolverState.current_step)
+inline int32_t SolverState::_internal_current_step() const {
   return current_step_;
 }
-inline void SolverState::set_current_step(::google::protobuf::int32 value) {
-  set_has_current_step();
+inline int32_t SolverState::current_step() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SolverState.current_step)
+  return _internal_current_step();
+}
+inline void SolverState::_internal_set_current_step(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   current_step_ = value;
+}
+inline void SolverState::set_current_step(int32_t value) {
+  _internal_set_current_step(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SolverState.current_step)
 }
 
@@ -18359,81 +25410,98 @@ inline void SolverState::set_current_step(::google::protobuf::int32 value) {
 // NetState
 
 // optional .opencv_caffe.Phase phase = 1 [default = TEST];
-inline bool NetState::has_phase() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void NetState::set_has_phase() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool NetState::_internal_has_phase() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void NetState::clear_has_phase() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool NetState::has_phase() const {
+  return _internal_has_phase();
 }
 inline void NetState::clear_phase() {
   phase_ = 1;
-  clear_has_phase();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::opencv_caffe::Phase NetState::_internal_phase() const {
+  return static_cast< ::opencv_caffe::Phase >(phase_);
 }
 inline ::opencv_caffe::Phase NetState::phase() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NetState.phase)
-  return static_cast< ::opencv_caffe::Phase >(phase_);
+  return _internal_phase();
 }
-inline void NetState::set_phase(::opencv_caffe::Phase value) {
+inline void NetState::_internal_set_phase(::opencv_caffe::Phase value) {
   assert(::opencv_caffe::Phase_IsValid(value));
-  set_has_phase();
+  _has_bits_[0] |= 0x00000002u;
   phase_ = value;
+}
+inline void NetState::set_phase(::opencv_caffe::Phase value) {
+  _internal_set_phase(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NetState.phase)
 }
 
 // optional int32 level = 2 [default = 0];
-inline bool NetState::has_level() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void NetState::set_has_level() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool NetState::_internal_has_level() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void NetState::clear_has_level() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool NetState::has_level() const {
+  return _internal_has_level();
 }
 inline void NetState::clear_level() {
   level_ = 0;
-  clear_has_level();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 NetState::level() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetState.level)
+inline int32_t NetState::_internal_level() const {
   return level_;
 }
-inline void NetState::set_level(::google::protobuf::int32 value) {
-  set_has_level();
+inline int32_t NetState::level() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetState.level)
+  return _internal_level();
+}
+inline void NetState::_internal_set_level(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   level_ = value;
+}
+inline void NetState::set_level(int32_t value) {
+  _internal_set_level(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NetState.level)
 }
 
 // repeated string stage = 3;
-inline int NetState::stage_size() const {
+inline int NetState::_internal_stage_size() const {
   return stage_.size();
 }
+inline int NetState::stage_size() const {
+  return _internal_stage_size();
+}
 inline void NetState::clear_stage() {
   stage_.Clear();
 }
-inline const ::std::string& NetState::stage(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetState.stage)
+inline std::string* NetState::add_stage() {
+  std::string* _s = _internal_add_stage();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.NetState.stage)
+  return _s;
+}
+inline const std::string& NetState::_internal_stage(int index) const {
   return stage_.Get(index);
 }
-inline ::std::string* NetState::mutable_stage(int index) {
+inline const std::string& NetState::stage(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetState.stage)
+  return _internal_stage(index);
+}
+inline std::string* NetState::mutable_stage(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.NetState.stage)
   return stage_.Mutable(index);
 }
-inline void NetState::set_stage(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.NetState.stage)
+inline void NetState::set_stage(int index, const std::string& value) {
   stage_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void NetState::set_stage(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.NetState.stage)
+}
+inline void NetState::set_stage(int index, std::string&& value) {
   stage_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.NetState.stage)
 }
-#endif
 inline void NetState::set_stage(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   stage_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.NetState.stage)
 }
@@ -18442,22 +25510,19 @@ inline void NetState::set_stage(int index, const char* value, size_t size) {
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.NetState.stage)
 }
-inline ::std::string* NetState::add_stage() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.NetState.stage)
+inline std::string* NetState::_internal_add_stage() {
   return stage_.Add();
 }
-inline void NetState::add_stage(const ::std::string& value) {
+inline void NetState::add_stage(const std::string& value) {
   stage_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.NetState.stage)
 }
-#if LANG_CXX11
-inline void NetState::add_stage(::std::string&& value) {
+inline void NetState::add_stage(std::string&& value) {
   stage_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.NetState.stage)
 }
-#endif
 inline void NetState::add_stage(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   stage_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.NetState.stage)
 }
@@ -18465,12 +25530,12 @@ inline void NetState::add_stage(const char* value, size_t size) {
   stage_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.NetState.stage)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 NetState::stage() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.NetState.stage)
   return stage_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 NetState::mutable_stage() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.NetState.stage)
   return &stage_;
@@ -18481,105 +25546,126 @@ NetState::mutable_stage() {
 // NetStateRule
 
 // optional .opencv_caffe.Phase phase = 1;
-inline bool NetStateRule::has_phase() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void NetStateRule::set_has_phase() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool NetStateRule::_internal_has_phase() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void NetStateRule::clear_has_phase() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool NetStateRule::has_phase() const {
+  return _internal_has_phase();
 }
 inline void NetStateRule::clear_phase() {
   phase_ = 0;
-  clear_has_phase();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::opencv_caffe::Phase NetStateRule::_internal_phase() const {
+  return static_cast< ::opencv_caffe::Phase >(phase_);
 }
 inline ::opencv_caffe::Phase NetStateRule::phase() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.phase)
-  return static_cast< ::opencv_caffe::Phase >(phase_);
+  return _internal_phase();
 }
-inline void NetStateRule::set_phase(::opencv_caffe::Phase value) {
+inline void NetStateRule::_internal_set_phase(::opencv_caffe::Phase value) {
   assert(::opencv_caffe::Phase_IsValid(value));
-  set_has_phase();
+  _has_bits_[0] |= 0x00000001u;
   phase_ = value;
+}
+inline void NetStateRule::set_phase(::opencv_caffe::Phase value) {
+  _internal_set_phase(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.phase)
 }
 
 // optional int32 min_level = 2;
-inline bool NetStateRule::has_min_level() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void NetStateRule::set_has_min_level() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool NetStateRule::_internal_has_min_level() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void NetStateRule::clear_has_min_level() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool NetStateRule::has_min_level() const {
+  return _internal_has_min_level();
 }
 inline void NetStateRule::clear_min_level() {
   min_level_ = 0;
-  clear_has_min_level();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 NetStateRule::min_level() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.min_level)
+inline int32_t NetStateRule::_internal_min_level() const {
   return min_level_;
 }
-inline void NetStateRule::set_min_level(::google::protobuf::int32 value) {
-  set_has_min_level();
+inline int32_t NetStateRule::min_level() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.min_level)
+  return _internal_min_level();
+}
+inline void NetStateRule::_internal_set_min_level(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   min_level_ = value;
+}
+inline void NetStateRule::set_min_level(int32_t value) {
+  _internal_set_min_level(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.min_level)
 }
 
 // optional int32 max_level = 3;
-inline bool NetStateRule::has_max_level() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void NetStateRule::set_has_max_level() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool NetStateRule::_internal_has_max_level() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void NetStateRule::clear_has_max_level() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool NetStateRule::has_max_level() const {
+  return _internal_has_max_level();
 }
 inline void NetStateRule::clear_max_level() {
   max_level_ = 0;
-  clear_has_max_level();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 NetStateRule::max_level() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.max_level)
+inline int32_t NetStateRule::_internal_max_level() const {
   return max_level_;
 }
-inline void NetStateRule::set_max_level(::google::protobuf::int32 value) {
-  set_has_max_level();
+inline int32_t NetStateRule::max_level() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.max_level)
+  return _internal_max_level();
+}
+inline void NetStateRule::_internal_set_max_level(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   max_level_ = value;
+}
+inline void NetStateRule::set_max_level(int32_t value) {
+  _internal_set_max_level(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.max_level)
 }
 
 // repeated string stage = 4;
-inline int NetStateRule::stage_size() const {
+inline int NetStateRule::_internal_stage_size() const {
   return stage_.size();
 }
+inline int NetStateRule::stage_size() const {
+  return _internal_stage_size();
+}
 inline void NetStateRule::clear_stage() {
   stage_.Clear();
 }
-inline const ::std::string& NetStateRule::stage(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.stage)
+inline std::string* NetStateRule::add_stage() {
+  std::string* _s = _internal_add_stage();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.NetStateRule.stage)
+  return _s;
+}
+inline const std::string& NetStateRule::_internal_stage(int index) const {
   return stage_.Get(index);
 }
-inline ::std::string* NetStateRule::mutable_stage(int index) {
+inline const std::string& NetStateRule::stage(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.stage)
+  return _internal_stage(index);
+}
+inline std::string* NetStateRule::mutable_stage(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.NetStateRule.stage)
   return stage_.Mutable(index);
 }
-inline void NetStateRule::set_stage(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.stage)
+inline void NetStateRule::set_stage(int index, const std::string& value) {
   stage_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void NetStateRule::set_stage(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.stage)
+}
+inline void NetStateRule::set_stage(int index, std::string&& value) {
   stage_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.stage)
 }
-#endif
 inline void NetStateRule::set_stage(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   stage_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.NetStateRule.stage)
 }
@@ -18588,22 +25674,19 @@ inline void NetStateRule::set_stage(int index, const char* value, size_t size) {
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.NetStateRule.stage)
 }
-inline ::std::string* NetStateRule::add_stage() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.NetStateRule.stage)
+inline std::string* NetStateRule::_internal_add_stage() {
   return stage_.Add();
 }
-inline void NetStateRule::add_stage(const ::std::string& value) {
+inline void NetStateRule::add_stage(const std::string& value) {
   stage_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.NetStateRule.stage)
 }
-#if LANG_CXX11
-inline void NetStateRule::add_stage(::std::string&& value) {
+inline void NetStateRule::add_stage(std::string&& value) {
   stage_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.NetStateRule.stage)
 }
-#endif
 inline void NetStateRule::add_stage(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   stage_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.NetStateRule.stage)
 }
@@ -18611,44 +25694,53 @@ inline void NetStateRule::add_stage(const char* value, size_t size) {
   stage_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.NetStateRule.stage)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 NetStateRule::stage() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.NetStateRule.stage)
   return stage_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 NetStateRule::mutable_stage() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.NetStateRule.stage)
   return &stage_;
 }
 
 // repeated string not_stage = 5;
-inline int NetStateRule::not_stage_size() const {
+inline int NetStateRule::_internal_not_stage_size() const {
   return not_stage_.size();
 }
+inline int NetStateRule::not_stage_size() const {
+  return _internal_not_stage_size();
+}
 inline void NetStateRule::clear_not_stage() {
   not_stage_.Clear();
 }
-inline const ::std::string& NetStateRule::not_stage(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.not_stage)
+inline std::string* NetStateRule::add_not_stage() {
+  std::string* _s = _internal_add_not_stage();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.NetStateRule.not_stage)
+  return _s;
+}
+inline const std::string& NetStateRule::_internal_not_stage(int index) const {
   return not_stage_.Get(index);
 }
-inline ::std::string* NetStateRule::mutable_not_stage(int index) {
+inline const std::string& NetStateRule::not_stage(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NetStateRule.not_stage)
+  return _internal_not_stage(index);
+}
+inline std::string* NetStateRule::mutable_not_stage(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.NetStateRule.not_stage)
   return not_stage_.Mutable(index);
 }
-inline void NetStateRule::set_not_stage(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.not_stage)
+inline void NetStateRule::set_not_stage(int index, const std::string& value) {
   not_stage_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void NetStateRule::set_not_stage(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.not_stage)
+}
+inline void NetStateRule::set_not_stage(int index, std::string&& value) {
   not_stage_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.NetStateRule.not_stage)
 }
-#endif
 inline void NetStateRule::set_not_stage(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   not_stage_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.NetStateRule.not_stage)
 }
@@ -18657,22 +25749,19 @@ inline void NetStateRule::set_not_stage(int index, const char* value, size_t siz
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.NetStateRule.not_stage)
 }
-inline ::std::string* NetStateRule::add_not_stage() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.NetStateRule.not_stage)
+inline std::string* NetStateRule::_internal_add_not_stage() {
   return not_stage_.Add();
 }
-inline void NetStateRule::add_not_stage(const ::std::string& value) {
+inline void NetStateRule::add_not_stage(const std::string& value) {
   not_stage_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.NetStateRule.not_stage)
 }
-#if LANG_CXX11
-inline void NetStateRule::add_not_stage(::std::string&& value) {
+inline void NetStateRule::add_not_stage(std::string&& value) {
   not_stage_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.NetStateRule.not_stage)
 }
-#endif
 inline void NetStateRule::add_not_stage(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   not_stage_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.NetStateRule.not_stage)
 }
@@ -18680,12 +25769,12 @@ inline void NetStateRule::add_not_stage(const char* value, size_t size) {
   not_stage_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.NetStateRule.not_stage)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 NetStateRule::not_stage() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.NetStateRule.not_stage)
   return not_stage_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 NetStateRule::mutable_not_stage() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.NetStateRule.not_stage)
   return &not_stage_;
@@ -18696,138 +25785,156 @@ NetStateRule::mutable_not_stage() {
 // ParamSpec
 
 // optional string name = 1;
-inline bool ParamSpec::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ParamSpec::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ParamSpec::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ParamSpec::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ParamSpec::has_name() const {
+  return _internal_has_name();
 }
 inline void ParamSpec::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& ParamSpec::name() const {
+inline const std::string& ParamSpec::name() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ParamSpec.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void ParamSpec::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ParamSpec::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.ParamSpec.name)
 }
-#if LANG_CXX11
-inline void ParamSpec::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.ParamSpec.name)
-}
-#endif
-inline void ParamSpec::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:opencv_caffe.ParamSpec.name)
-}
-inline void ParamSpec::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:opencv_caffe.ParamSpec.name)
-}
-inline ::std::string* ParamSpec::mutable_name() {
-  set_has_name();
+inline std::string* ParamSpec::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.ParamSpec.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& ParamSpec::_internal_name() const {
+  return name_.Get();
+}
+inline void ParamSpec::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* ParamSpec::release_name() {
+inline std::string* ParamSpec::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* ParamSpec::release_name() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ParamSpec.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ParamSpec::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void ParamSpec::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ParamSpec.name)
 }
 
 // optional .opencv_caffe.ParamSpec.DimCheckMode share_mode = 2;
-inline bool ParamSpec::has_share_mode() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ParamSpec::set_has_share_mode() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ParamSpec::_internal_has_share_mode() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ParamSpec::clear_has_share_mode() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ParamSpec::has_share_mode() const {
+  return _internal_has_share_mode();
 }
 inline void ParamSpec::clear_share_mode() {
   share_mode_ = 0;
-  clear_has_share_mode();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::opencv_caffe::ParamSpec_DimCheckMode ParamSpec::_internal_share_mode() const {
+  return static_cast< ::opencv_caffe::ParamSpec_DimCheckMode >(share_mode_);
 }
 inline ::opencv_caffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ParamSpec.share_mode)
-  return static_cast< ::opencv_caffe::ParamSpec_DimCheckMode >(share_mode_);
+  return _internal_share_mode();
 }
-inline void ParamSpec::set_share_mode(::opencv_caffe::ParamSpec_DimCheckMode value) {
+inline void ParamSpec::_internal_set_share_mode(::opencv_caffe::ParamSpec_DimCheckMode value) {
   assert(::opencv_caffe::ParamSpec_DimCheckMode_IsValid(value));
-  set_has_share_mode();
+  _has_bits_[0] |= 0x00000002u;
   share_mode_ = value;
+}
+inline void ParamSpec::set_share_mode(::opencv_caffe::ParamSpec_DimCheckMode value) {
+  _internal_set_share_mode(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ParamSpec.share_mode)
 }
 
 // optional float lr_mult = 3 [default = 1];
-inline bool ParamSpec::has_lr_mult() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool ParamSpec::_internal_has_lr_mult() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ParamSpec::set_has_lr_mult() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void ParamSpec::clear_has_lr_mult() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ParamSpec::has_lr_mult() const {
+  return _internal_has_lr_mult();
 }
 inline void ParamSpec::clear_lr_mult() {
   lr_mult_ = 1;
-  clear_has_lr_mult();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float ParamSpec::_internal_lr_mult() const {
+  return lr_mult_;
 }
 inline float ParamSpec::lr_mult() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ParamSpec.lr_mult)
-  return lr_mult_;
+  return _internal_lr_mult();
 }
-inline void ParamSpec::set_lr_mult(float value) {
-  set_has_lr_mult();
+inline void ParamSpec::_internal_set_lr_mult(float value) {
+  _has_bits_[0] |= 0x00000004u;
   lr_mult_ = value;
+}
+inline void ParamSpec::set_lr_mult(float value) {
+  _internal_set_lr_mult(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ParamSpec.lr_mult)
 }
 
 // optional float decay_mult = 4 [default = 1];
-inline bool ParamSpec::has_decay_mult() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void ParamSpec::set_has_decay_mult() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool ParamSpec::_internal_has_decay_mult() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void ParamSpec::clear_has_decay_mult() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool ParamSpec::has_decay_mult() const {
+  return _internal_has_decay_mult();
 }
 inline void ParamSpec::clear_decay_mult() {
   decay_mult_ = 1;
-  clear_has_decay_mult();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline float ParamSpec::_internal_decay_mult() const {
+  return decay_mult_;
 }
 inline float ParamSpec::decay_mult() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ParamSpec.decay_mult)
-  return decay_mult_;
+  return _internal_decay_mult();
 }
-inline void ParamSpec::set_decay_mult(float value) {
-  set_has_decay_mult();
+inline void ParamSpec::_internal_set_decay_mult(float value) {
+  _has_bits_[0] |= 0x00000008u;
   decay_mult_ = value;
+}
+inline void ParamSpec::set_decay_mult(float value) {
+  _internal_set_decay_mult(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ParamSpec.decay_mult)
 }
 
@@ -18836,158 +25943,179 @@ inline void ParamSpec::set_decay_mult(float value) {
 // LayerParameter
 
 // optional string name = 1;
-inline bool LayerParameter::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void LayerParameter::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool LayerParameter::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void LayerParameter::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool LayerParameter::has_name() const {
+  return _internal_has_name();
 }
 inline void LayerParameter::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& LayerParameter::name() const {
+inline const std::string& LayerParameter::name() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void LayerParameter::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void LayerParameter::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.name)
 }
-#if LANG_CXX11
-inline void LayerParameter::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.LayerParameter.name)
-}
-#endif
-inline void LayerParameter::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:opencv_caffe.LayerParameter.name)
-}
-inline void LayerParameter::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:opencv_caffe.LayerParameter.name)
-}
-inline ::std::string* LayerParameter::mutable_name() {
-  set_has_name();
+inline std::string* LayerParameter::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& LayerParameter::_internal_name() const {
+  return name_.Get();
+}
+inline void LayerParameter::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* LayerParameter::release_name() {
+inline std::string* LayerParameter::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* LayerParameter::release_name() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void LayerParameter::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void LayerParameter::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.name)
 }
 
 // optional string type = 2;
-inline bool LayerParameter::has_type() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void LayerParameter::set_has_type() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool LayerParameter::_internal_has_type() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void LayerParameter::clear_has_type() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool LayerParameter::has_type() const {
+  return _internal_has_type();
 }
 inline void LayerParameter::clear_type() {
-  type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_type();
+  type_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& LayerParameter::type() const {
+inline const std::string& LayerParameter::type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.type)
-  return type_.GetNoArena();
+  return _internal_type();
 }
-inline void LayerParameter::set_type(const ::std::string& value) {
-  set_has_type();
-  type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void LayerParameter::set_type(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.type)
 }
-#if LANG_CXX11
-inline void LayerParameter::set_type(::std::string&& value) {
-  set_has_type();
-  type_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.LayerParameter.type)
+inline std::string* LayerParameter::mutable_type() {
+  std::string* _s = _internal_mutable_type();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.type)
+  return _s;
+}
+inline const std::string& LayerParameter::_internal_type() const {
+  return type_.Get();
+}
+inline void LayerParameter::_internal_set_type(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-#endif
-inline void LayerParameter::set_type(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_type();
-  type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.LayerParameter.type)
-}
-inline void LayerParameter::set_type(const char* value, size_t size) {
-  set_has_type();
-  type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.LayerParameter.type)
-}
-inline ::std::string* LayerParameter::mutable_type() {
-  set_has_type();
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.type)
-  return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline std::string* LayerParameter::_internal_mutable_type() {
+  _has_bits_[0] |= 0x00000002u;
+  return type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* LayerParameter::release_type() {
+inline std::string* LayerParameter::release_type() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.type)
-  clear_has_type();
-  return type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_type()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = type_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void LayerParameter::set_allocated_type(::std::string* type) {
-  if (type != NULL) {
-    set_has_type();
+inline void LayerParameter::set_allocated_type(std::string* type) {
+  if (type != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_type();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type);
+  type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.type)
 }
 
 // repeated string bottom = 3;
-inline int LayerParameter::bottom_size() const {
+inline int LayerParameter::_internal_bottom_size() const {
   return bottom_.size();
 }
+inline int LayerParameter::bottom_size() const {
+  return _internal_bottom_size();
+}
 inline void LayerParameter::clear_bottom() {
   bottom_.Clear();
 }
-inline const ::std::string& LayerParameter::bottom(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.bottom)
+inline std::string* LayerParameter::add_bottom() {
+  std::string* _s = _internal_add_bottom();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.LayerParameter.bottom)
+  return _s;
+}
+inline const std::string& LayerParameter::_internal_bottom(int index) const {
   return bottom_.Get(index);
 }
-inline ::std::string* LayerParameter::mutable_bottom(int index) {
+inline const std::string& LayerParameter::bottom(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.bottom)
+  return _internal_bottom(index);
+}
+inline std::string* LayerParameter::mutable_bottom(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.bottom)
   return bottom_.Mutable(index);
 }
-inline void LayerParameter::set_bottom(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.bottom)
+inline void LayerParameter::set_bottom(int index, const std::string& value) {
   bottom_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void LayerParameter::set_bottom(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.bottom)
+}
+inline void LayerParameter::set_bottom(int index, std::string&& value) {
   bottom_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.bottom)
 }
-#endif
 inline void LayerParameter::set_bottom(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   bottom_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.LayerParameter.bottom)
 }
@@ -18996,22 +26124,19 @@ inline void LayerParameter::set_bottom(int index, const char* value, size_t size
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.LayerParameter.bottom)
 }
-inline ::std::string* LayerParameter::add_bottom() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.LayerParameter.bottom)
+inline std::string* LayerParameter::_internal_add_bottom() {
   return bottom_.Add();
 }
-inline void LayerParameter::add_bottom(const ::std::string& value) {
+inline void LayerParameter::add_bottom(const std::string& value) {
   bottom_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.bottom)
 }
-#if LANG_CXX11
-inline void LayerParameter::add_bottom(::std::string&& value) {
+inline void LayerParameter::add_bottom(std::string&& value) {
   bottom_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.bottom)
 }
-#endif
 inline void LayerParameter::add_bottom(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   bottom_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.LayerParameter.bottom)
 }
@@ -19019,44 +26144,53 @@ inline void LayerParameter::add_bottom(const char* value, size_t size) {
   bottom_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.LayerParameter.bottom)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 LayerParameter::bottom() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.LayerParameter.bottom)
   return bottom_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 LayerParameter::mutable_bottom() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.LayerParameter.bottom)
   return &bottom_;
 }
 
 // repeated string top = 4;
-inline int LayerParameter::top_size() const {
+inline int LayerParameter::_internal_top_size() const {
   return top_.size();
 }
+inline int LayerParameter::top_size() const {
+  return _internal_top_size();
+}
 inline void LayerParameter::clear_top() {
   top_.Clear();
 }
-inline const ::std::string& LayerParameter::top(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.top)
+inline std::string* LayerParameter::add_top() {
+  std::string* _s = _internal_add_top();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.LayerParameter.top)
+  return _s;
+}
+inline const std::string& LayerParameter::_internal_top(int index) const {
   return top_.Get(index);
 }
-inline ::std::string* LayerParameter::mutable_top(int index) {
+inline const std::string& LayerParameter::top(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.top)
+  return _internal_top(index);
+}
+inline std::string* LayerParameter::mutable_top(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.top)
   return top_.Mutable(index);
 }
-inline void LayerParameter::set_top(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.top)
+inline void LayerParameter::set_top(int index, const std::string& value) {
   top_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void LayerParameter::set_top(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.top)
+}
+inline void LayerParameter::set_top(int index, std::string&& value) {
   top_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.top)
 }
-#endif
 inline void LayerParameter::set_top(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   top_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.LayerParameter.top)
 }
@@ -19065,22 +26199,19 @@ inline void LayerParameter::set_top(int index, const char* value, size_t size) {
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.LayerParameter.top)
 }
-inline ::std::string* LayerParameter::add_top() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.LayerParameter.top)
+inline std::string* LayerParameter::_internal_add_top() {
   return top_.Add();
 }
-inline void LayerParameter::add_top(const ::std::string& value) {
+inline void LayerParameter::add_top(const std::string& value) {
   top_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.top)
 }
-#if LANG_CXX11
-inline void LayerParameter::add_top(::std::string&& value) {
+inline void LayerParameter::add_top(std::string&& value) {
   top_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.top)
 }
-#endif
 inline void LayerParameter::add_top(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   top_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.LayerParameter.top)
 }
@@ -19088,3133 +26219,5155 @@ inline void LayerParameter::add_top(const char* value, size_t size) {
   top_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.LayerParameter.top)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 LayerParameter::top() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.LayerParameter.top)
   return top_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 LayerParameter::mutable_top() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.LayerParameter.top)
   return &top_;
 }
 
 // optional .opencv_caffe.Phase phase = 10;
-inline bool LayerParameter::has_phase() const {
-  return (_has_bits_[1] & 0x01000000u) != 0;
-}
-inline void LayerParameter::set_has_phase() {
-  _has_bits_[1] |= 0x01000000u;
+inline bool LayerParameter::_internal_has_phase() const {
+  bool value = (_has_bits_[1] & 0x01000000u) != 0;
+  return value;
 }
-inline void LayerParameter::clear_has_phase() {
-  _has_bits_[1] &= ~0x01000000u;
+inline bool LayerParameter::has_phase() const {
+  return _internal_has_phase();
 }
 inline void LayerParameter::clear_phase() {
   phase_ = 0;
-  clear_has_phase();
+  _has_bits_[1] &= ~0x01000000u;
+}
+inline ::opencv_caffe::Phase LayerParameter::_internal_phase() const {
+  return static_cast< ::opencv_caffe::Phase >(phase_);
 }
 inline ::opencv_caffe::Phase LayerParameter::phase() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.phase)
-  return static_cast< ::opencv_caffe::Phase >(phase_);
+  return _internal_phase();
 }
-inline void LayerParameter::set_phase(::opencv_caffe::Phase value) {
+inline void LayerParameter::_internal_set_phase(::opencv_caffe::Phase value) {
   assert(::opencv_caffe::Phase_IsValid(value));
-  set_has_phase();
+  _has_bits_[1] |= 0x01000000u;
   phase_ = value;
+}
+inline void LayerParameter::set_phase(::opencv_caffe::Phase value) {
+  _internal_set_phase(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.phase)
 }
 
 // repeated float loss_weight = 5;
-inline int LayerParameter::loss_weight_size() const {
+inline int LayerParameter::_internal_loss_weight_size() const {
   return loss_weight_.size();
 }
+inline int LayerParameter::loss_weight_size() const {
+  return _internal_loss_weight_size();
+}
 inline void LayerParameter::clear_loss_weight() {
   loss_weight_.Clear();
 }
+inline float LayerParameter::_internal_loss_weight(int index) const {
+  return loss_weight_.Get(index);
+}
 inline float LayerParameter::loss_weight(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.loss_weight)
-  return loss_weight_.Get(index);
+  return _internal_loss_weight(index);
 }
 inline void LayerParameter::set_loss_weight(int index, float value) {
   loss_weight_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.loss_weight)
 }
-inline void LayerParameter::add_loss_weight(float value) {
+inline void LayerParameter::_internal_add_loss_weight(float value) {
   loss_weight_.Add(value);
+}
+inline void LayerParameter::add_loss_weight(float value) {
+  _internal_add_loss_weight(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.loss_weight)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+LayerParameter::_internal_loss_weight() const {
+  return loss_weight_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 LayerParameter::loss_weight() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.LayerParameter.loss_weight)
-  return loss_weight_;
+  return _internal_loss_weight();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+LayerParameter::_internal_mutable_loss_weight() {
+  return &loss_weight_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 LayerParameter::mutable_loss_weight() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.LayerParameter.loss_weight)
-  return &loss_weight_;
+  return _internal_mutable_loss_weight();
 }
 
 // repeated .opencv_caffe.ParamSpec param = 6;
-inline int LayerParameter::param_size() const {
+inline int LayerParameter::_internal_param_size() const {
   return param_.size();
 }
+inline int LayerParameter::param_size() const {
+  return _internal_param_size();
+}
 inline void LayerParameter::clear_param() {
   param_.Clear();
 }
-inline const ::opencv_caffe::ParamSpec& LayerParameter::param(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.param)
-  return param_.Get(index);
-}
 inline ::opencv_caffe::ParamSpec* LayerParameter::mutable_param(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.param)
   return param_.Mutable(index);
 }
-inline ::opencv_caffe::ParamSpec* LayerParameter::add_param() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.param)
-  return param_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::ParamSpec >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::ParamSpec >*
 LayerParameter::mutable_param() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.LayerParameter.param)
   return &param_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::ParamSpec >&
+inline const ::opencv_caffe::ParamSpec& LayerParameter::_internal_param(int index) const {
+  return param_.Get(index);
+}
+inline const ::opencv_caffe::ParamSpec& LayerParameter::param(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.param)
+  return _internal_param(index);
+}
+inline ::opencv_caffe::ParamSpec* LayerParameter::_internal_add_param() {
+  return param_.Add();
+}
+inline ::opencv_caffe::ParamSpec* LayerParameter::add_param() {
+  ::opencv_caffe::ParamSpec* _add = _internal_add_param();
+  // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.param)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::ParamSpec >&
 LayerParameter::param() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.LayerParameter.param)
   return param_;
 }
 
 // repeated .opencv_caffe.BlobProto blobs = 7;
-inline int LayerParameter::blobs_size() const {
+inline int LayerParameter::_internal_blobs_size() const {
   return blobs_.size();
 }
+inline int LayerParameter::blobs_size() const {
+  return _internal_blobs_size();
+}
 inline void LayerParameter::clear_blobs() {
   blobs_.Clear();
 }
-inline const ::opencv_caffe::BlobProto& LayerParameter::blobs(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.blobs)
-  return blobs_.Get(index);
-}
 inline ::opencv_caffe::BlobProto* LayerParameter::mutable_blobs(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.blobs)
   return blobs_.Mutable(index);
 }
-inline ::opencv_caffe::BlobProto* LayerParameter::add_blobs() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.blobs)
-  return blobs_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
 LayerParameter::mutable_blobs() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.LayerParameter.blobs)
   return &blobs_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+inline const ::opencv_caffe::BlobProto& LayerParameter::_internal_blobs(int index) const {
+  return blobs_.Get(index);
+}
+inline const ::opencv_caffe::BlobProto& LayerParameter::blobs(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.blobs)
+  return _internal_blobs(index);
+}
+inline ::opencv_caffe::BlobProto* LayerParameter::_internal_add_blobs() {
+  return blobs_.Add();
+}
+inline ::opencv_caffe::BlobProto* LayerParameter::add_blobs() {
+  ::opencv_caffe::BlobProto* _add = _internal_add_blobs();
+  // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.blobs)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
 LayerParameter::blobs() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.LayerParameter.blobs)
   return blobs_;
 }
 
 // repeated bool propagate_down = 11;
-inline int LayerParameter::propagate_down_size() const {
+inline int LayerParameter::_internal_propagate_down_size() const {
   return propagate_down_.size();
 }
+inline int LayerParameter::propagate_down_size() const {
+  return _internal_propagate_down_size();
+}
 inline void LayerParameter::clear_propagate_down() {
   propagate_down_.Clear();
 }
+inline bool LayerParameter::_internal_propagate_down(int index) const {
+  return propagate_down_.Get(index);
+}
 inline bool LayerParameter::propagate_down(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.propagate_down)
-  return propagate_down_.Get(index);
+  return _internal_propagate_down(index);
 }
 inline void LayerParameter::set_propagate_down(int index, bool value) {
   propagate_down_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LayerParameter.propagate_down)
 }
-inline void LayerParameter::add_propagate_down(bool value) {
+inline void LayerParameter::_internal_add_propagate_down(bool value) {
   propagate_down_.Add(value);
+}
+inline void LayerParameter::add_propagate_down(bool value) {
+  _internal_add_propagate_down(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.propagate_down)
 }
-inline const ::google::protobuf::RepeatedField< bool >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
+LayerParameter::_internal_propagate_down() const {
+  return propagate_down_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
 LayerParameter::propagate_down() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.LayerParameter.propagate_down)
-  return propagate_down_;
+  return _internal_propagate_down();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
+LayerParameter::_internal_mutable_propagate_down() {
+  return &propagate_down_;
 }
-inline ::google::protobuf::RepeatedField< bool >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
 LayerParameter::mutable_propagate_down() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.LayerParameter.propagate_down)
-  return &propagate_down_;
+  return _internal_mutable_propagate_down();
 }
 
 // repeated .opencv_caffe.NetStateRule include = 8;
-inline int LayerParameter::include_size() const {
+inline int LayerParameter::_internal_include_size() const {
   return include_.size();
 }
+inline int LayerParameter::include_size() const {
+  return _internal_include_size();
+}
 inline void LayerParameter::clear_include() {
   include_.Clear();
 }
-inline const ::opencv_caffe::NetStateRule& LayerParameter::include(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.include)
-  return include_.Get(index);
-}
 inline ::opencv_caffe::NetStateRule* LayerParameter::mutable_include(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.include)
   return include_.Mutable(index);
 }
-inline ::opencv_caffe::NetStateRule* LayerParameter::add_include() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.include)
-  return include_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
 LayerParameter::mutable_include() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.LayerParameter.include)
   return &include_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
+inline const ::opencv_caffe::NetStateRule& LayerParameter::_internal_include(int index) const {
+  return include_.Get(index);
+}
+inline const ::opencv_caffe::NetStateRule& LayerParameter::include(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.include)
+  return _internal_include(index);
+}
+inline ::opencv_caffe::NetStateRule* LayerParameter::_internal_add_include() {
+  return include_.Add();
+}
+inline ::opencv_caffe::NetStateRule* LayerParameter::add_include() {
+  ::opencv_caffe::NetStateRule* _add = _internal_add_include();
+  // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.include)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
 LayerParameter::include() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.LayerParameter.include)
   return include_;
 }
 
 // repeated .opencv_caffe.NetStateRule exclude = 9;
-inline int LayerParameter::exclude_size() const {
+inline int LayerParameter::_internal_exclude_size() const {
   return exclude_.size();
 }
+inline int LayerParameter::exclude_size() const {
+  return _internal_exclude_size();
+}
 inline void LayerParameter::clear_exclude() {
   exclude_.Clear();
 }
-inline const ::opencv_caffe::NetStateRule& LayerParameter::exclude(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.exclude)
-  return exclude_.Get(index);
-}
 inline ::opencv_caffe::NetStateRule* LayerParameter::mutable_exclude(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.exclude)
   return exclude_.Mutable(index);
 }
-inline ::opencv_caffe::NetStateRule* LayerParameter::add_exclude() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.exclude)
-  return exclude_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
 LayerParameter::mutable_exclude() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.LayerParameter.exclude)
   return &exclude_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
+inline const ::opencv_caffe::NetStateRule& LayerParameter::_internal_exclude(int index) const {
+  return exclude_.Get(index);
+}
+inline const ::opencv_caffe::NetStateRule& LayerParameter::exclude(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.exclude)
+  return _internal_exclude(index);
+}
+inline ::opencv_caffe::NetStateRule* LayerParameter::_internal_add_exclude() {
+  return exclude_.Add();
+}
+inline ::opencv_caffe::NetStateRule* LayerParameter::add_exclude() {
+  ::opencv_caffe::NetStateRule* _add = _internal_add_exclude();
+  // @@protoc_insertion_point(field_add:opencv_caffe.LayerParameter.exclude)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
 LayerParameter::exclude() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.LayerParameter.exclude)
   return exclude_;
 }
 
 // optional .opencv_caffe.TransformationParameter transform_param = 100;
-inline bool LayerParameter::has_transform_param() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool LayerParameter::_internal_has_transform_param() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  PROTOBUF_ASSUME(!value || transform_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_transform_param() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool LayerParameter::has_transform_param() const {
+  return _internal_has_transform_param();
 }
-inline void LayerParameter::clear_has_transform_param() {
+inline void LayerParameter::clear_transform_param() {
+  if (transform_param_ != nullptr) transform_param_->Clear();
   _has_bits_[0] &= ~0x00000004u;
 }
-inline void LayerParameter::clear_transform_param() {
-  if (transform_param_ != NULL) transform_param_->Clear();
-  clear_has_transform_param();
+inline const ::opencv_caffe::TransformationParameter& LayerParameter::_internal_transform_param() const {
+  const ::opencv_caffe::TransformationParameter* p = transform_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::TransformationParameter&>(
+      ::opencv_caffe::_TransformationParameter_default_instance_);
 }
 inline const ::opencv_caffe::TransformationParameter& LayerParameter::transform_param() const {
-  const ::opencv_caffe::TransformationParameter* p = transform_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.transform_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::TransformationParameter*>(
-      &::opencv_caffe::_TransformationParameter_default_instance_);
+  return _internal_transform_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_transform_param(
+    ::opencv_caffe::TransformationParameter* transform_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(transform_param_);
+  }
+  transform_param_ = transform_param;
+  if (transform_param) {
+    _has_bits_[0] |= 0x00000004u;
+  } else {
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.transform_param)
 }
 inline ::opencv_caffe::TransformationParameter* LayerParameter::release_transform_param() {
+  _has_bits_[0] &= ~0x00000004u;
+  ::opencv_caffe::TransformationParameter* temp = transform_param_;
+  transform_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::TransformationParameter* LayerParameter::unsafe_arena_release_transform_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.transform_param)
-  clear_has_transform_param();
+  _has_bits_[0] &= ~0x00000004u;
   ::opencv_caffe::TransformationParameter* temp = transform_param_;
-  transform_param_ = NULL;
+  transform_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::TransformationParameter* LayerParameter::mutable_transform_param() {
-  set_has_transform_param();
-  if (transform_param_ == NULL) {
-    transform_param_ = new ::opencv_caffe::TransformationParameter;
+inline ::opencv_caffe::TransformationParameter* LayerParameter::_internal_mutable_transform_param() {
+  _has_bits_[0] |= 0x00000004u;
+  if (transform_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::TransformationParameter>(GetArenaForAllocation());
+    transform_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.transform_param)
   return transform_param_;
 }
+inline ::opencv_caffe::TransformationParameter* LayerParameter::mutable_transform_param() {
+  ::opencv_caffe::TransformationParameter* _msg = _internal_mutable_transform_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.transform_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_transform_param(::opencv_caffe::TransformationParameter* transform_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete transform_param_;
   }
   if (transform_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::TransformationParameter>::GetOwningArena(transform_param);
     if (message_arena != submessage_arena) {
-      transform_param = ::google::protobuf::internal::GetOwnedMessage(
+      transform_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, transform_param, submessage_arena);
     }
-    set_has_transform_param();
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_transform_param();
+    _has_bits_[0] &= ~0x00000004u;
   }
   transform_param_ = transform_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.transform_param)
 }
 
 // optional .opencv_caffe.LossParameter loss_param = 101;
-inline bool LayerParameter::has_loss_param() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool LayerParameter::_internal_has_loss_param() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  PROTOBUF_ASSUME(!value || loss_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_loss_param() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool LayerParameter::has_loss_param() const {
+  return _internal_has_loss_param();
 }
-inline void LayerParameter::clear_has_loss_param() {
+inline void LayerParameter::clear_loss_param() {
+  if (loss_param_ != nullptr) loss_param_->Clear();
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void LayerParameter::clear_loss_param() {
-  if (loss_param_ != NULL) loss_param_->Clear();
-  clear_has_loss_param();
+inline const ::opencv_caffe::LossParameter& LayerParameter::_internal_loss_param() const {
+  const ::opencv_caffe::LossParameter* p = loss_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::LossParameter&>(
+      ::opencv_caffe::_LossParameter_default_instance_);
 }
 inline const ::opencv_caffe::LossParameter& LayerParameter::loss_param() const {
-  const ::opencv_caffe::LossParameter* p = loss_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.loss_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::LossParameter*>(
-      &::opencv_caffe::_LossParameter_default_instance_);
+  return _internal_loss_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_loss_param(
+    ::opencv_caffe::LossParameter* loss_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(loss_param_);
+  }
+  loss_param_ = loss_param;
+  if (loss_param) {
+    _has_bits_[0] |= 0x00000008u;
+  } else {
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.loss_param)
 }
 inline ::opencv_caffe::LossParameter* LayerParameter::release_loss_param() {
+  _has_bits_[0] &= ~0x00000008u;
+  ::opencv_caffe::LossParameter* temp = loss_param_;
+  loss_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::LossParameter* LayerParameter::unsafe_arena_release_loss_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.loss_param)
-  clear_has_loss_param();
+  _has_bits_[0] &= ~0x00000008u;
   ::opencv_caffe::LossParameter* temp = loss_param_;
-  loss_param_ = NULL;
+  loss_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::LossParameter* LayerParameter::mutable_loss_param() {
-  set_has_loss_param();
-  if (loss_param_ == NULL) {
-    loss_param_ = new ::opencv_caffe::LossParameter;
+inline ::opencv_caffe::LossParameter* LayerParameter::_internal_mutable_loss_param() {
+  _has_bits_[0] |= 0x00000008u;
+  if (loss_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::LossParameter>(GetArenaForAllocation());
+    loss_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.loss_param)
   return loss_param_;
 }
+inline ::opencv_caffe::LossParameter* LayerParameter::mutable_loss_param() {
+  ::opencv_caffe::LossParameter* _msg = _internal_mutable_loss_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.loss_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_loss_param(::opencv_caffe::LossParameter* loss_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete loss_param_;
   }
   if (loss_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::LossParameter>::GetOwningArena(loss_param);
     if (message_arena != submessage_arena) {
-      loss_param = ::google::protobuf::internal::GetOwnedMessage(
+      loss_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, loss_param, submessage_arena);
     }
-    set_has_loss_param();
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_loss_param();
+    _has_bits_[0] &= ~0x00000008u;
   }
   loss_param_ = loss_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.loss_param)
 }
 
 // optional .opencv_caffe.AccuracyParameter accuracy_param = 102;
-inline bool LayerParameter::has_accuracy_param() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+inline bool LayerParameter::_internal_has_accuracy_param() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  PROTOBUF_ASSUME(!value || accuracy_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_accuracy_param() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool LayerParameter::has_accuracy_param() const {
+  return _internal_has_accuracy_param();
 }
-inline void LayerParameter::clear_has_accuracy_param() {
+inline void LayerParameter::clear_accuracy_param() {
+  if (accuracy_param_ != nullptr) accuracy_param_->Clear();
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void LayerParameter::clear_accuracy_param() {
-  if (accuracy_param_ != NULL) accuracy_param_->Clear();
-  clear_has_accuracy_param();
+inline const ::opencv_caffe::AccuracyParameter& LayerParameter::_internal_accuracy_param() const {
+  const ::opencv_caffe::AccuracyParameter* p = accuracy_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::AccuracyParameter&>(
+      ::opencv_caffe::_AccuracyParameter_default_instance_);
 }
 inline const ::opencv_caffe::AccuracyParameter& LayerParameter::accuracy_param() const {
-  const ::opencv_caffe::AccuracyParameter* p = accuracy_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.accuracy_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::AccuracyParameter*>(
-      &::opencv_caffe::_AccuracyParameter_default_instance_);
+  return _internal_accuracy_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_accuracy_param(
+    ::opencv_caffe::AccuracyParameter* accuracy_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(accuracy_param_);
+  }
+  accuracy_param_ = accuracy_param;
+  if (accuracy_param) {
+    _has_bits_[0] |= 0x00000010u;
+  } else {
+    _has_bits_[0] &= ~0x00000010u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.accuracy_param)
 }
 inline ::opencv_caffe::AccuracyParameter* LayerParameter::release_accuracy_param() {
+  _has_bits_[0] &= ~0x00000010u;
+  ::opencv_caffe::AccuracyParameter* temp = accuracy_param_;
+  accuracy_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::AccuracyParameter* LayerParameter::unsafe_arena_release_accuracy_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.accuracy_param)
-  clear_has_accuracy_param();
+  _has_bits_[0] &= ~0x00000010u;
   ::opencv_caffe::AccuracyParameter* temp = accuracy_param_;
-  accuracy_param_ = NULL;
+  accuracy_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() {
-  set_has_accuracy_param();
-  if (accuracy_param_ == NULL) {
-    accuracy_param_ = new ::opencv_caffe::AccuracyParameter;
+inline ::opencv_caffe::AccuracyParameter* LayerParameter::_internal_mutable_accuracy_param() {
+  _has_bits_[0] |= 0x00000010u;
+  if (accuracy_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::AccuracyParameter>(GetArenaForAllocation());
+    accuracy_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.accuracy_param)
   return accuracy_param_;
 }
+inline ::opencv_caffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() {
+  ::opencv_caffe::AccuracyParameter* _msg = _internal_mutable_accuracy_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.accuracy_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_accuracy_param(::opencv_caffe::AccuracyParameter* accuracy_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete accuracy_param_;
   }
   if (accuracy_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::AccuracyParameter>::GetOwningArena(accuracy_param);
     if (message_arena != submessage_arena) {
-      accuracy_param = ::google::protobuf::internal::GetOwnedMessage(
+      accuracy_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, accuracy_param, submessage_arena);
     }
-    set_has_accuracy_param();
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_accuracy_param();
+    _has_bits_[0] &= ~0x00000010u;
   }
   accuracy_param_ = accuracy_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.accuracy_param)
 }
 
 // optional .opencv_caffe.ArgMaxParameter argmax_param = 103;
-inline bool LayerParameter::has_argmax_param() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool LayerParameter::_internal_has_argmax_param() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  PROTOBUF_ASSUME(!value || argmax_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_argmax_param() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool LayerParameter::has_argmax_param() const {
+  return _internal_has_argmax_param();
 }
-inline void LayerParameter::clear_has_argmax_param() {
+inline void LayerParameter::clear_argmax_param() {
+  if (argmax_param_ != nullptr) argmax_param_->Clear();
   _has_bits_[0] &= ~0x00000020u;
 }
-inline void LayerParameter::clear_argmax_param() {
-  if (argmax_param_ != NULL) argmax_param_->Clear();
-  clear_has_argmax_param();
+inline const ::opencv_caffe::ArgMaxParameter& LayerParameter::_internal_argmax_param() const {
+  const ::opencv_caffe::ArgMaxParameter* p = argmax_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ArgMaxParameter&>(
+      ::opencv_caffe::_ArgMaxParameter_default_instance_);
 }
 inline const ::opencv_caffe::ArgMaxParameter& LayerParameter::argmax_param() const {
-  const ::opencv_caffe::ArgMaxParameter* p = argmax_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.argmax_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ArgMaxParameter*>(
-      &::opencv_caffe::_ArgMaxParameter_default_instance_);
+  return _internal_argmax_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_argmax_param(
+    ::opencv_caffe::ArgMaxParameter* argmax_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(argmax_param_);
+  }
+  argmax_param_ = argmax_param;
+  if (argmax_param) {
+    _has_bits_[0] |= 0x00000020u;
+  } else {
+    _has_bits_[0] &= ~0x00000020u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.argmax_param)
 }
 inline ::opencv_caffe::ArgMaxParameter* LayerParameter::release_argmax_param() {
+  _has_bits_[0] &= ~0x00000020u;
+  ::opencv_caffe::ArgMaxParameter* temp = argmax_param_;
+  argmax_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ArgMaxParameter* LayerParameter::unsafe_arena_release_argmax_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.argmax_param)
-  clear_has_argmax_param();
+  _has_bits_[0] &= ~0x00000020u;
   ::opencv_caffe::ArgMaxParameter* temp = argmax_param_;
-  argmax_param_ = NULL;
+  argmax_param_ = nullptr;
   return temp;
 }
+inline ::opencv_caffe::ArgMaxParameter* LayerParameter::_internal_mutable_argmax_param() {
+  _has_bits_[0] |= 0x00000020u;
+  if (argmax_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ArgMaxParameter>(GetArenaForAllocation());
+    argmax_param_ = p;
+  }
+  return argmax_param_;
+}
 inline ::opencv_caffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() {
-  set_has_argmax_param();
-  if (argmax_param_ == NULL) {
-    argmax_param_ = new ::opencv_caffe::ArgMaxParameter;
-  }
+  ::opencv_caffe::ArgMaxParameter* _msg = _internal_mutable_argmax_param();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.argmax_param)
-  return argmax_param_;
+  return _msg;
 }
 inline void LayerParameter::set_allocated_argmax_param(::opencv_caffe::ArgMaxParameter* argmax_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete argmax_param_;
   }
   if (argmax_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ArgMaxParameter>::GetOwningArena(argmax_param);
     if (message_arena != submessage_arena) {
-      argmax_param = ::google::protobuf::internal::GetOwnedMessage(
+      argmax_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, argmax_param, submessage_arena);
     }
-    set_has_argmax_param();
+    _has_bits_[0] |= 0x00000020u;
   } else {
-    clear_has_argmax_param();
+    _has_bits_[0] &= ~0x00000020u;
   }
   argmax_param_ = argmax_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.argmax_param)
 }
 
 // optional .opencv_caffe.BatchNormParameter batch_norm_param = 139;
-inline bool LayerParameter::has_batch_norm_param() const {
-  return (_has_bits_[1] & 0x00000200u) != 0;
+inline bool LayerParameter::_internal_has_batch_norm_param() const {
+  bool value = (_has_bits_[1] & 0x00000200u) != 0;
+  PROTOBUF_ASSUME(!value || batch_norm_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_batch_norm_param() {
-  _has_bits_[1] |= 0x00000200u;
+inline bool LayerParameter::has_batch_norm_param() const {
+  return _internal_has_batch_norm_param();
 }
-inline void LayerParameter::clear_has_batch_norm_param() {
+inline void LayerParameter::clear_batch_norm_param() {
+  if (batch_norm_param_ != nullptr) batch_norm_param_->Clear();
   _has_bits_[1] &= ~0x00000200u;
 }
-inline void LayerParameter::clear_batch_norm_param() {
-  if (batch_norm_param_ != NULL) batch_norm_param_->Clear();
-  clear_has_batch_norm_param();
+inline const ::opencv_caffe::BatchNormParameter& LayerParameter::_internal_batch_norm_param() const {
+  const ::opencv_caffe::BatchNormParameter* p = batch_norm_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::BatchNormParameter&>(
+      ::opencv_caffe::_BatchNormParameter_default_instance_);
 }
 inline const ::opencv_caffe::BatchNormParameter& LayerParameter::batch_norm_param() const {
-  const ::opencv_caffe::BatchNormParameter* p = batch_norm_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.batch_norm_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::BatchNormParameter*>(
-      &::opencv_caffe::_BatchNormParameter_default_instance_);
+  return _internal_batch_norm_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_batch_norm_param(
+    ::opencv_caffe::BatchNormParameter* batch_norm_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(batch_norm_param_);
+  }
+  batch_norm_param_ = batch_norm_param;
+  if (batch_norm_param) {
+    _has_bits_[1] |= 0x00000200u;
+  } else {
+    _has_bits_[1] &= ~0x00000200u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.batch_norm_param)
 }
 inline ::opencv_caffe::BatchNormParameter* LayerParameter::release_batch_norm_param() {
+  _has_bits_[1] &= ~0x00000200u;
+  ::opencv_caffe::BatchNormParameter* temp = batch_norm_param_;
+  batch_norm_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::BatchNormParameter* LayerParameter::unsafe_arena_release_batch_norm_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.batch_norm_param)
-  clear_has_batch_norm_param();
+  _has_bits_[1] &= ~0x00000200u;
   ::opencv_caffe::BatchNormParameter* temp = batch_norm_param_;
-  batch_norm_param_ = NULL;
+  batch_norm_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() {
-  set_has_batch_norm_param();
-  if (batch_norm_param_ == NULL) {
-    batch_norm_param_ = new ::opencv_caffe::BatchNormParameter;
+inline ::opencv_caffe::BatchNormParameter* LayerParameter::_internal_mutable_batch_norm_param() {
+  _has_bits_[1] |= 0x00000200u;
+  if (batch_norm_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::BatchNormParameter>(GetArenaForAllocation());
+    batch_norm_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.batch_norm_param)
   return batch_norm_param_;
 }
+inline ::opencv_caffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() {
+  ::opencv_caffe::BatchNormParameter* _msg = _internal_mutable_batch_norm_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.batch_norm_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_batch_norm_param(::opencv_caffe::BatchNormParameter* batch_norm_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete batch_norm_param_;
   }
   if (batch_norm_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::BatchNormParameter>::GetOwningArena(batch_norm_param);
     if (message_arena != submessage_arena) {
-      batch_norm_param = ::google::protobuf::internal::GetOwnedMessage(
+      batch_norm_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, batch_norm_param, submessage_arena);
     }
-    set_has_batch_norm_param();
+    _has_bits_[1] |= 0x00000200u;
   } else {
-    clear_has_batch_norm_param();
+    _has_bits_[1] &= ~0x00000200u;
   }
   batch_norm_param_ = batch_norm_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.batch_norm_param)
 }
 
 // optional .opencv_caffe.BiasParameter bias_param = 141;
-inline bool LayerParameter::has_bias_param() const {
-  return (_has_bits_[1] & 0x00000800u) != 0;
+inline bool LayerParameter::_internal_has_bias_param() const {
+  bool value = (_has_bits_[1] & 0x00000800u) != 0;
+  PROTOBUF_ASSUME(!value || bias_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_bias_param() {
-  _has_bits_[1] |= 0x00000800u;
+inline bool LayerParameter::has_bias_param() const {
+  return _internal_has_bias_param();
 }
-inline void LayerParameter::clear_has_bias_param() {
+inline void LayerParameter::clear_bias_param() {
+  if (bias_param_ != nullptr) bias_param_->Clear();
   _has_bits_[1] &= ~0x00000800u;
 }
-inline void LayerParameter::clear_bias_param() {
-  if (bias_param_ != NULL) bias_param_->Clear();
-  clear_has_bias_param();
+inline const ::opencv_caffe::BiasParameter& LayerParameter::_internal_bias_param() const {
+  const ::opencv_caffe::BiasParameter* p = bias_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::BiasParameter&>(
+      ::opencv_caffe::_BiasParameter_default_instance_);
 }
 inline const ::opencv_caffe::BiasParameter& LayerParameter::bias_param() const {
-  const ::opencv_caffe::BiasParameter* p = bias_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.bias_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::BiasParameter*>(
-      &::opencv_caffe::_BiasParameter_default_instance_);
+  return _internal_bias_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_bias_param(
+    ::opencv_caffe::BiasParameter* bias_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(bias_param_);
+  }
+  bias_param_ = bias_param;
+  if (bias_param) {
+    _has_bits_[1] |= 0x00000800u;
+  } else {
+    _has_bits_[1] &= ~0x00000800u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.bias_param)
 }
 inline ::opencv_caffe::BiasParameter* LayerParameter::release_bias_param() {
+  _has_bits_[1] &= ~0x00000800u;
+  ::opencv_caffe::BiasParameter* temp = bias_param_;
+  bias_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::BiasParameter* LayerParameter::unsafe_arena_release_bias_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.bias_param)
-  clear_has_bias_param();
+  _has_bits_[1] &= ~0x00000800u;
   ::opencv_caffe::BiasParameter* temp = bias_param_;
-  bias_param_ = NULL;
+  bias_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::BiasParameter* LayerParameter::mutable_bias_param() {
-  set_has_bias_param();
-  if (bias_param_ == NULL) {
-    bias_param_ = new ::opencv_caffe::BiasParameter;
+inline ::opencv_caffe::BiasParameter* LayerParameter::_internal_mutable_bias_param() {
+  _has_bits_[1] |= 0x00000800u;
+  if (bias_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::BiasParameter>(GetArenaForAllocation());
+    bias_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.bias_param)
   return bias_param_;
 }
+inline ::opencv_caffe::BiasParameter* LayerParameter::mutable_bias_param() {
+  ::opencv_caffe::BiasParameter* _msg = _internal_mutable_bias_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.bias_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_bias_param(::opencv_caffe::BiasParameter* bias_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete bias_param_;
   }
   if (bias_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::BiasParameter>::GetOwningArena(bias_param);
     if (message_arena != submessage_arena) {
-      bias_param = ::google::protobuf::internal::GetOwnedMessage(
+      bias_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, bias_param, submessage_arena);
     }
-    set_has_bias_param();
+    _has_bits_[1] |= 0x00000800u;
   } else {
-    clear_has_bias_param();
+    _has_bits_[1] &= ~0x00000800u;
   }
   bias_param_ = bias_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.bias_param)
 }
 
 // optional .opencv_caffe.ConcatParameter concat_param = 104;
-inline bool LayerParameter::has_concat_param() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+inline bool LayerParameter::_internal_has_concat_param() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  PROTOBUF_ASSUME(!value || concat_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_concat_param() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool LayerParameter::has_concat_param() const {
+  return _internal_has_concat_param();
 }
-inline void LayerParameter::clear_has_concat_param() {
+inline void LayerParameter::clear_concat_param() {
+  if (concat_param_ != nullptr) concat_param_->Clear();
   _has_bits_[0] &= ~0x00000040u;
 }
-inline void LayerParameter::clear_concat_param() {
-  if (concat_param_ != NULL) concat_param_->Clear();
-  clear_has_concat_param();
+inline const ::opencv_caffe::ConcatParameter& LayerParameter::_internal_concat_param() const {
+  const ::opencv_caffe::ConcatParameter* p = concat_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ConcatParameter&>(
+      ::opencv_caffe::_ConcatParameter_default_instance_);
 }
 inline const ::opencv_caffe::ConcatParameter& LayerParameter::concat_param() const {
-  const ::opencv_caffe::ConcatParameter* p = concat_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.concat_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ConcatParameter*>(
-      &::opencv_caffe::_ConcatParameter_default_instance_);
+  return _internal_concat_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_concat_param(
+    ::opencv_caffe::ConcatParameter* concat_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(concat_param_);
+  }
+  concat_param_ = concat_param;
+  if (concat_param) {
+    _has_bits_[0] |= 0x00000040u;
+  } else {
+    _has_bits_[0] &= ~0x00000040u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.concat_param)
 }
 inline ::opencv_caffe::ConcatParameter* LayerParameter::release_concat_param() {
+  _has_bits_[0] &= ~0x00000040u;
+  ::opencv_caffe::ConcatParameter* temp = concat_param_;
+  concat_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ConcatParameter* LayerParameter::unsafe_arena_release_concat_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.concat_param)
-  clear_has_concat_param();
+  _has_bits_[0] &= ~0x00000040u;
   ::opencv_caffe::ConcatParameter* temp = concat_param_;
-  concat_param_ = NULL;
+  concat_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ConcatParameter* LayerParameter::mutable_concat_param() {
-  set_has_concat_param();
-  if (concat_param_ == NULL) {
-    concat_param_ = new ::opencv_caffe::ConcatParameter;
+inline ::opencv_caffe::ConcatParameter* LayerParameter::_internal_mutable_concat_param() {
+  _has_bits_[0] |= 0x00000040u;
+  if (concat_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ConcatParameter>(GetArenaForAllocation());
+    concat_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.concat_param)
   return concat_param_;
 }
+inline ::opencv_caffe::ConcatParameter* LayerParameter::mutable_concat_param() {
+  ::opencv_caffe::ConcatParameter* _msg = _internal_mutable_concat_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.concat_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_concat_param(::opencv_caffe::ConcatParameter* concat_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete concat_param_;
   }
   if (concat_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ConcatParameter>::GetOwningArena(concat_param);
     if (message_arena != submessage_arena) {
-      concat_param = ::google::protobuf::internal::GetOwnedMessage(
+      concat_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, concat_param, submessage_arena);
     }
-    set_has_concat_param();
+    _has_bits_[0] |= 0x00000040u;
   } else {
-    clear_has_concat_param();
+    _has_bits_[0] &= ~0x00000040u;
   }
   concat_param_ = concat_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.concat_param)
 }
 
 // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 105;
-inline bool LayerParameter::has_contrastive_loss_param() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
+inline bool LayerParameter::_internal_has_contrastive_loss_param() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  PROTOBUF_ASSUME(!value || contrastive_loss_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_contrastive_loss_param() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool LayerParameter::has_contrastive_loss_param() const {
+  return _internal_has_contrastive_loss_param();
 }
-inline void LayerParameter::clear_has_contrastive_loss_param() {
+inline void LayerParameter::clear_contrastive_loss_param() {
+  if (contrastive_loss_param_ != nullptr) contrastive_loss_param_->Clear();
   _has_bits_[0] &= ~0x00000080u;
 }
-inline void LayerParameter::clear_contrastive_loss_param() {
-  if (contrastive_loss_param_ != NULL) contrastive_loss_param_->Clear();
-  clear_has_contrastive_loss_param();
+inline const ::opencv_caffe::ContrastiveLossParameter& LayerParameter::_internal_contrastive_loss_param() const {
+  const ::opencv_caffe::ContrastiveLossParameter* p = contrastive_loss_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ContrastiveLossParameter&>(
+      ::opencv_caffe::_ContrastiveLossParameter_default_instance_);
 }
 inline const ::opencv_caffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const {
-  const ::opencv_caffe::ContrastiveLossParameter* p = contrastive_loss_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.contrastive_loss_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ContrastiveLossParameter*>(
-      &::opencv_caffe::_ContrastiveLossParameter_default_instance_);
+  return _internal_contrastive_loss_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_contrastive_loss_param(
+    ::opencv_caffe::ContrastiveLossParameter* contrastive_loss_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(contrastive_loss_param_);
+  }
+  contrastive_loss_param_ = contrastive_loss_param;
+  if (contrastive_loss_param) {
+    _has_bits_[0] |= 0x00000080u;
+  } else {
+    _has_bits_[0] &= ~0x00000080u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.contrastive_loss_param)
 }
 inline ::opencv_caffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() {
+  _has_bits_[0] &= ~0x00000080u;
+  ::opencv_caffe::ContrastiveLossParameter* temp = contrastive_loss_param_;
+  contrastive_loss_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ContrastiveLossParameter* LayerParameter::unsafe_arena_release_contrastive_loss_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.contrastive_loss_param)
-  clear_has_contrastive_loss_param();
+  _has_bits_[0] &= ~0x00000080u;
   ::opencv_caffe::ContrastiveLossParameter* temp = contrastive_loss_param_;
-  contrastive_loss_param_ = NULL;
+  contrastive_loss_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() {
-  set_has_contrastive_loss_param();
-  if (contrastive_loss_param_ == NULL) {
-    contrastive_loss_param_ = new ::opencv_caffe::ContrastiveLossParameter;
+inline ::opencv_caffe::ContrastiveLossParameter* LayerParameter::_internal_mutable_contrastive_loss_param() {
+  _has_bits_[0] |= 0x00000080u;
+  if (contrastive_loss_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ContrastiveLossParameter>(GetArenaForAllocation());
+    contrastive_loss_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.contrastive_loss_param)
   return contrastive_loss_param_;
 }
+inline ::opencv_caffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() {
+  ::opencv_caffe::ContrastiveLossParameter* _msg = _internal_mutable_contrastive_loss_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.contrastive_loss_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_contrastive_loss_param(::opencv_caffe::ContrastiveLossParameter* contrastive_loss_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete contrastive_loss_param_;
   }
   if (contrastive_loss_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ContrastiveLossParameter>::GetOwningArena(contrastive_loss_param);
     if (message_arena != submessage_arena) {
-      contrastive_loss_param = ::google::protobuf::internal::GetOwnedMessage(
+      contrastive_loss_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, contrastive_loss_param, submessage_arena);
     }
-    set_has_contrastive_loss_param();
+    _has_bits_[0] |= 0x00000080u;
   } else {
-    clear_has_contrastive_loss_param();
+    _has_bits_[0] &= ~0x00000080u;
   }
   contrastive_loss_param_ = contrastive_loss_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.contrastive_loss_param)
 }
 
 // optional .opencv_caffe.ConvolutionParameter convolution_param = 106;
-inline bool LayerParameter::has_convolution_param() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
+inline bool LayerParameter::_internal_has_convolution_param() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  PROTOBUF_ASSUME(!value || convolution_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_convolution_param() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool LayerParameter::has_convolution_param() const {
+  return _internal_has_convolution_param();
 }
-inline void LayerParameter::clear_has_convolution_param() {
+inline void LayerParameter::clear_convolution_param() {
+  if (convolution_param_ != nullptr) convolution_param_->Clear();
   _has_bits_[0] &= ~0x00000100u;
 }
-inline void LayerParameter::clear_convolution_param() {
-  if (convolution_param_ != NULL) convolution_param_->Clear();
-  clear_has_convolution_param();
+inline const ::opencv_caffe::ConvolutionParameter& LayerParameter::_internal_convolution_param() const {
+  const ::opencv_caffe::ConvolutionParameter* p = convolution_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ConvolutionParameter&>(
+      ::opencv_caffe::_ConvolutionParameter_default_instance_);
 }
 inline const ::opencv_caffe::ConvolutionParameter& LayerParameter::convolution_param() const {
-  const ::opencv_caffe::ConvolutionParameter* p = convolution_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.convolution_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ConvolutionParameter*>(
-      &::opencv_caffe::_ConvolutionParameter_default_instance_);
+  return _internal_convolution_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_convolution_param(
+    ::opencv_caffe::ConvolutionParameter* convolution_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(convolution_param_);
+  }
+  convolution_param_ = convolution_param;
+  if (convolution_param) {
+    _has_bits_[0] |= 0x00000100u;
+  } else {
+    _has_bits_[0] &= ~0x00000100u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.convolution_param)
 }
 inline ::opencv_caffe::ConvolutionParameter* LayerParameter::release_convolution_param() {
+  _has_bits_[0] &= ~0x00000100u;
+  ::opencv_caffe::ConvolutionParameter* temp = convolution_param_;
+  convolution_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ConvolutionParameter* LayerParameter::unsafe_arena_release_convolution_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.convolution_param)
-  clear_has_convolution_param();
+  _has_bits_[0] &= ~0x00000100u;
   ::opencv_caffe::ConvolutionParameter* temp = convolution_param_;
-  convolution_param_ = NULL;
+  convolution_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() {
-  set_has_convolution_param();
-  if (convolution_param_ == NULL) {
-    convolution_param_ = new ::opencv_caffe::ConvolutionParameter;
+inline ::opencv_caffe::ConvolutionParameter* LayerParameter::_internal_mutable_convolution_param() {
+  _has_bits_[0] |= 0x00000100u;
+  if (convolution_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ConvolutionParameter>(GetArenaForAllocation());
+    convolution_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.convolution_param)
   return convolution_param_;
 }
+inline ::opencv_caffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() {
+  ::opencv_caffe::ConvolutionParameter* _msg = _internal_mutable_convolution_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.convolution_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_convolution_param(::opencv_caffe::ConvolutionParameter* convolution_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete convolution_param_;
   }
   if (convolution_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ConvolutionParameter>::GetOwningArena(convolution_param);
     if (message_arena != submessage_arena) {
-      convolution_param = ::google::protobuf::internal::GetOwnedMessage(
+      convolution_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, convolution_param, submessage_arena);
     }
-    set_has_convolution_param();
+    _has_bits_[0] |= 0x00000100u;
   } else {
-    clear_has_convolution_param();
+    _has_bits_[0] &= ~0x00000100u;
   }
   convolution_param_ = convolution_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.convolution_param)
 }
 
 // optional .opencv_caffe.CropParameter crop_param = 144;
-inline bool LayerParameter::has_crop_param() const {
-  return (_has_bits_[1] & 0x00004000u) != 0;
+inline bool LayerParameter::_internal_has_crop_param() const {
+  bool value = (_has_bits_[1] & 0x00004000u) != 0;
+  PROTOBUF_ASSUME(!value || crop_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_crop_param() {
-  _has_bits_[1] |= 0x00004000u;
+inline bool LayerParameter::has_crop_param() const {
+  return _internal_has_crop_param();
 }
-inline void LayerParameter::clear_has_crop_param() {
+inline void LayerParameter::clear_crop_param() {
+  if (crop_param_ != nullptr) crop_param_->Clear();
   _has_bits_[1] &= ~0x00004000u;
 }
-inline void LayerParameter::clear_crop_param() {
-  if (crop_param_ != NULL) crop_param_->Clear();
-  clear_has_crop_param();
+inline const ::opencv_caffe::CropParameter& LayerParameter::_internal_crop_param() const {
+  const ::opencv_caffe::CropParameter* p = crop_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::CropParameter&>(
+      ::opencv_caffe::_CropParameter_default_instance_);
 }
 inline const ::opencv_caffe::CropParameter& LayerParameter::crop_param() const {
-  const ::opencv_caffe::CropParameter* p = crop_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.crop_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::CropParameter*>(
-      &::opencv_caffe::_CropParameter_default_instance_);
+  return _internal_crop_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_crop_param(
+    ::opencv_caffe::CropParameter* crop_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(crop_param_);
+  }
+  crop_param_ = crop_param;
+  if (crop_param) {
+    _has_bits_[1] |= 0x00004000u;
+  } else {
+    _has_bits_[1] &= ~0x00004000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.crop_param)
 }
 inline ::opencv_caffe::CropParameter* LayerParameter::release_crop_param() {
+  _has_bits_[1] &= ~0x00004000u;
+  ::opencv_caffe::CropParameter* temp = crop_param_;
+  crop_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::CropParameter* LayerParameter::unsafe_arena_release_crop_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.crop_param)
-  clear_has_crop_param();
+  _has_bits_[1] &= ~0x00004000u;
   ::opencv_caffe::CropParameter* temp = crop_param_;
-  crop_param_ = NULL;
+  crop_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::CropParameter* LayerParameter::mutable_crop_param() {
-  set_has_crop_param();
-  if (crop_param_ == NULL) {
-    crop_param_ = new ::opencv_caffe::CropParameter;
+inline ::opencv_caffe::CropParameter* LayerParameter::_internal_mutable_crop_param() {
+  _has_bits_[1] |= 0x00004000u;
+  if (crop_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::CropParameter>(GetArenaForAllocation());
+    crop_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.crop_param)
   return crop_param_;
 }
+inline ::opencv_caffe::CropParameter* LayerParameter::mutable_crop_param() {
+  ::opencv_caffe::CropParameter* _msg = _internal_mutable_crop_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.crop_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_crop_param(::opencv_caffe::CropParameter* crop_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete crop_param_;
   }
   if (crop_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::CropParameter>::GetOwningArena(crop_param);
     if (message_arena != submessage_arena) {
-      crop_param = ::google::protobuf::internal::GetOwnedMessage(
+      crop_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, crop_param, submessage_arena);
     }
-    set_has_crop_param();
+    _has_bits_[1] |= 0x00004000u;
   } else {
-    clear_has_crop_param();
+    _has_bits_[1] &= ~0x00004000u;
   }
   crop_param_ = crop_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.crop_param)
 }
 
 // optional .opencv_caffe.DataParameter data_param = 107;
-inline bool LayerParameter::has_data_param() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
+inline bool LayerParameter::_internal_has_data_param() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  PROTOBUF_ASSUME(!value || data_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_data_param() {
-  _has_bits_[0] |= 0x00000200u;
+inline bool LayerParameter::has_data_param() const {
+  return _internal_has_data_param();
 }
-inline void LayerParameter::clear_has_data_param() {
+inline void LayerParameter::clear_data_param() {
+  if (data_param_ != nullptr) data_param_->Clear();
   _has_bits_[0] &= ~0x00000200u;
 }
-inline void LayerParameter::clear_data_param() {
-  if (data_param_ != NULL) data_param_->Clear();
-  clear_has_data_param();
+inline const ::opencv_caffe::DataParameter& LayerParameter::_internal_data_param() const {
+  const ::opencv_caffe::DataParameter* p = data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::DataParameter&>(
+      ::opencv_caffe::_DataParameter_default_instance_);
 }
 inline const ::opencv_caffe::DataParameter& LayerParameter::data_param() const {
-  const ::opencv_caffe::DataParameter* p = data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::DataParameter*>(
-      &::opencv_caffe::_DataParameter_default_instance_);
+  return _internal_data_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_data_param(
+    ::opencv_caffe::DataParameter* data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(data_param_);
+  }
+  data_param_ = data_param;
+  if (data_param) {
+    _has_bits_[0] |= 0x00000200u;
+  } else {
+    _has_bits_[0] &= ~0x00000200u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.data_param)
 }
 inline ::opencv_caffe::DataParameter* LayerParameter::release_data_param() {
+  _has_bits_[0] &= ~0x00000200u;
+  ::opencv_caffe::DataParameter* temp = data_param_;
+  data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::DataParameter* LayerParameter::unsafe_arena_release_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.data_param)
-  clear_has_data_param();
+  _has_bits_[0] &= ~0x00000200u;
   ::opencv_caffe::DataParameter* temp = data_param_;
-  data_param_ = NULL;
+  data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::DataParameter* LayerParameter::mutable_data_param() {
-  set_has_data_param();
-  if (data_param_ == NULL) {
-    data_param_ = new ::opencv_caffe::DataParameter;
+inline ::opencv_caffe::DataParameter* LayerParameter::_internal_mutable_data_param() {
+  _has_bits_[0] |= 0x00000200u;
+  if (data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::DataParameter>(GetArenaForAllocation());
+    data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.data_param)
   return data_param_;
 }
+inline ::opencv_caffe::DataParameter* LayerParameter::mutable_data_param() {
+  ::opencv_caffe::DataParameter* _msg = _internal_mutable_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.data_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_data_param(::opencv_caffe::DataParameter* data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete data_param_;
   }
   if (data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::DataParameter>::GetOwningArena(data_param);
     if (message_arena != submessage_arena) {
-      data_param = ::google::protobuf::internal::GetOwnedMessage(
+      data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, data_param, submessage_arena);
     }
-    set_has_data_param();
+    _has_bits_[0] |= 0x00000200u;
   } else {
-    clear_has_data_param();
+    _has_bits_[0] &= ~0x00000200u;
   }
   data_param_ = data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.data_param)
 }
 
 // optional .opencv_caffe.DetectionOutputParameter detection_output_param = 147;
-inline bool LayerParameter::has_detection_output_param() const {
-  return (_has_bits_[1] & 0x00020000u) != 0;
+inline bool LayerParameter::_internal_has_detection_output_param() const {
+  bool value = (_has_bits_[1] & 0x00020000u) != 0;
+  PROTOBUF_ASSUME(!value || detection_output_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_detection_output_param() {
-  _has_bits_[1] |= 0x00020000u;
+inline bool LayerParameter::has_detection_output_param() const {
+  return _internal_has_detection_output_param();
 }
-inline void LayerParameter::clear_has_detection_output_param() {
+inline void LayerParameter::clear_detection_output_param() {
+  if (detection_output_param_ != nullptr) detection_output_param_->Clear();
   _has_bits_[1] &= ~0x00020000u;
 }
-inline void LayerParameter::clear_detection_output_param() {
-  if (detection_output_param_ != NULL) detection_output_param_->Clear();
-  clear_has_detection_output_param();
+inline const ::opencv_caffe::DetectionOutputParameter& LayerParameter::_internal_detection_output_param() const {
+  const ::opencv_caffe::DetectionOutputParameter* p = detection_output_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::DetectionOutputParameter&>(
+      ::opencv_caffe::_DetectionOutputParameter_default_instance_);
 }
 inline const ::opencv_caffe::DetectionOutputParameter& LayerParameter::detection_output_param() const {
-  const ::opencv_caffe::DetectionOutputParameter* p = detection_output_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.detection_output_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::DetectionOutputParameter*>(
-      &::opencv_caffe::_DetectionOutputParameter_default_instance_);
+  return _internal_detection_output_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_detection_output_param(
+    ::opencv_caffe::DetectionOutputParameter* detection_output_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(detection_output_param_);
+  }
+  detection_output_param_ = detection_output_param;
+  if (detection_output_param) {
+    _has_bits_[1] |= 0x00020000u;
+  } else {
+    _has_bits_[1] &= ~0x00020000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.detection_output_param)
 }
 inline ::opencv_caffe::DetectionOutputParameter* LayerParameter::release_detection_output_param() {
+  _has_bits_[1] &= ~0x00020000u;
+  ::opencv_caffe::DetectionOutputParameter* temp = detection_output_param_;
+  detection_output_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::DetectionOutputParameter* LayerParameter::unsafe_arena_release_detection_output_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.detection_output_param)
-  clear_has_detection_output_param();
+  _has_bits_[1] &= ~0x00020000u;
   ::opencv_caffe::DetectionOutputParameter* temp = detection_output_param_;
-  detection_output_param_ = NULL;
+  detection_output_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::DetectionOutputParameter* LayerParameter::mutable_detection_output_param() {
-  set_has_detection_output_param();
-  if (detection_output_param_ == NULL) {
-    detection_output_param_ = new ::opencv_caffe::DetectionOutputParameter;
+inline ::opencv_caffe::DetectionOutputParameter* LayerParameter::_internal_mutable_detection_output_param() {
+  _has_bits_[1] |= 0x00020000u;
+  if (detection_output_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::DetectionOutputParameter>(GetArenaForAllocation());
+    detection_output_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.detection_output_param)
   return detection_output_param_;
 }
+inline ::opencv_caffe::DetectionOutputParameter* LayerParameter::mutable_detection_output_param() {
+  ::opencv_caffe::DetectionOutputParameter* _msg = _internal_mutable_detection_output_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.detection_output_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_detection_output_param(::opencv_caffe::DetectionOutputParameter* detection_output_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete detection_output_param_;
   }
   if (detection_output_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::DetectionOutputParameter>::GetOwningArena(detection_output_param);
     if (message_arena != submessage_arena) {
-      detection_output_param = ::google::protobuf::internal::GetOwnedMessage(
+      detection_output_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, detection_output_param, submessage_arena);
     }
-    set_has_detection_output_param();
+    _has_bits_[1] |= 0x00020000u;
   } else {
-    clear_has_detection_output_param();
+    _has_bits_[1] &= ~0x00020000u;
   }
   detection_output_param_ = detection_output_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.detection_output_param)
 }
 
 // optional .opencv_caffe.DropoutParameter dropout_param = 108;
-inline bool LayerParameter::has_dropout_param() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+inline bool LayerParameter::_internal_has_dropout_param() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  PROTOBUF_ASSUME(!value || dropout_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_dropout_param() {
-  _has_bits_[0] |= 0x00000400u;
+inline bool LayerParameter::has_dropout_param() const {
+  return _internal_has_dropout_param();
 }
-inline void LayerParameter::clear_has_dropout_param() {
+inline void LayerParameter::clear_dropout_param() {
+  if (dropout_param_ != nullptr) dropout_param_->Clear();
   _has_bits_[0] &= ~0x00000400u;
 }
-inline void LayerParameter::clear_dropout_param() {
-  if (dropout_param_ != NULL) dropout_param_->Clear();
-  clear_has_dropout_param();
+inline const ::opencv_caffe::DropoutParameter& LayerParameter::_internal_dropout_param() const {
+  const ::opencv_caffe::DropoutParameter* p = dropout_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::DropoutParameter&>(
+      ::opencv_caffe::_DropoutParameter_default_instance_);
 }
 inline const ::opencv_caffe::DropoutParameter& LayerParameter::dropout_param() const {
-  const ::opencv_caffe::DropoutParameter* p = dropout_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.dropout_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::DropoutParameter*>(
-      &::opencv_caffe::_DropoutParameter_default_instance_);
+  return _internal_dropout_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_dropout_param(
+    ::opencv_caffe::DropoutParameter* dropout_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(dropout_param_);
+  }
+  dropout_param_ = dropout_param;
+  if (dropout_param) {
+    _has_bits_[0] |= 0x00000400u;
+  } else {
+    _has_bits_[0] &= ~0x00000400u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.dropout_param)
 }
 inline ::opencv_caffe::DropoutParameter* LayerParameter::release_dropout_param() {
+  _has_bits_[0] &= ~0x00000400u;
+  ::opencv_caffe::DropoutParameter* temp = dropout_param_;
+  dropout_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::DropoutParameter* LayerParameter::unsafe_arena_release_dropout_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.dropout_param)
-  clear_has_dropout_param();
+  _has_bits_[0] &= ~0x00000400u;
   ::opencv_caffe::DropoutParameter* temp = dropout_param_;
-  dropout_param_ = NULL;
+  dropout_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::DropoutParameter* LayerParameter::mutable_dropout_param() {
-  set_has_dropout_param();
-  if (dropout_param_ == NULL) {
-    dropout_param_ = new ::opencv_caffe::DropoutParameter;
+inline ::opencv_caffe::DropoutParameter* LayerParameter::_internal_mutable_dropout_param() {
+  _has_bits_[0] |= 0x00000400u;
+  if (dropout_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::DropoutParameter>(GetArenaForAllocation());
+    dropout_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.dropout_param)
   return dropout_param_;
 }
+inline ::opencv_caffe::DropoutParameter* LayerParameter::mutable_dropout_param() {
+  ::opencv_caffe::DropoutParameter* _msg = _internal_mutable_dropout_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.dropout_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_dropout_param(::opencv_caffe::DropoutParameter* dropout_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete dropout_param_;
   }
   if (dropout_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::DropoutParameter>::GetOwningArena(dropout_param);
     if (message_arena != submessage_arena) {
-      dropout_param = ::google::protobuf::internal::GetOwnedMessage(
+      dropout_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, dropout_param, submessage_arena);
     }
-    set_has_dropout_param();
+    _has_bits_[0] |= 0x00000400u;
   } else {
-    clear_has_dropout_param();
+    _has_bits_[0] &= ~0x00000400u;
   }
   dropout_param_ = dropout_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.dropout_param)
 }
 
 // optional .opencv_caffe.DummyDataParameter dummy_data_param = 109;
-inline bool LayerParameter::has_dummy_data_param() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
+inline bool LayerParameter::_internal_has_dummy_data_param() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  PROTOBUF_ASSUME(!value || dummy_data_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_dummy_data_param() {
-  _has_bits_[0] |= 0x00000800u;
+inline bool LayerParameter::has_dummy_data_param() const {
+  return _internal_has_dummy_data_param();
 }
-inline void LayerParameter::clear_has_dummy_data_param() {
+inline void LayerParameter::clear_dummy_data_param() {
+  if (dummy_data_param_ != nullptr) dummy_data_param_->Clear();
   _has_bits_[0] &= ~0x00000800u;
 }
-inline void LayerParameter::clear_dummy_data_param() {
-  if (dummy_data_param_ != NULL) dummy_data_param_->Clear();
-  clear_has_dummy_data_param();
+inline const ::opencv_caffe::DummyDataParameter& LayerParameter::_internal_dummy_data_param() const {
+  const ::opencv_caffe::DummyDataParameter* p = dummy_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::DummyDataParameter&>(
+      ::opencv_caffe::_DummyDataParameter_default_instance_);
 }
 inline const ::opencv_caffe::DummyDataParameter& LayerParameter::dummy_data_param() const {
-  const ::opencv_caffe::DummyDataParameter* p = dummy_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.dummy_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::DummyDataParameter*>(
-      &::opencv_caffe::_DummyDataParameter_default_instance_);
+  return _internal_dummy_data_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_dummy_data_param(
+    ::opencv_caffe::DummyDataParameter* dummy_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(dummy_data_param_);
+  }
+  dummy_data_param_ = dummy_data_param;
+  if (dummy_data_param) {
+    _has_bits_[0] |= 0x00000800u;
+  } else {
+    _has_bits_[0] &= ~0x00000800u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.dummy_data_param)
 }
 inline ::opencv_caffe::DummyDataParameter* LayerParameter::release_dummy_data_param() {
+  _has_bits_[0] &= ~0x00000800u;
+  ::opencv_caffe::DummyDataParameter* temp = dummy_data_param_;
+  dummy_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::DummyDataParameter* LayerParameter::unsafe_arena_release_dummy_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.dummy_data_param)
-  clear_has_dummy_data_param();
+  _has_bits_[0] &= ~0x00000800u;
   ::opencv_caffe::DummyDataParameter* temp = dummy_data_param_;
-  dummy_data_param_ = NULL;
+  dummy_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() {
-  set_has_dummy_data_param();
-  if (dummy_data_param_ == NULL) {
-    dummy_data_param_ = new ::opencv_caffe::DummyDataParameter;
+inline ::opencv_caffe::DummyDataParameter* LayerParameter::_internal_mutable_dummy_data_param() {
+  _has_bits_[0] |= 0x00000800u;
+  if (dummy_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::DummyDataParameter>(GetArenaForAllocation());
+    dummy_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.dummy_data_param)
   return dummy_data_param_;
 }
+inline ::opencv_caffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() {
+  ::opencv_caffe::DummyDataParameter* _msg = _internal_mutable_dummy_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.dummy_data_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_dummy_data_param(::opencv_caffe::DummyDataParameter* dummy_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete dummy_data_param_;
   }
   if (dummy_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::DummyDataParameter>::GetOwningArena(dummy_data_param);
     if (message_arena != submessage_arena) {
-      dummy_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      dummy_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, dummy_data_param, submessage_arena);
     }
-    set_has_dummy_data_param();
+    _has_bits_[0] |= 0x00000800u;
   } else {
-    clear_has_dummy_data_param();
+    _has_bits_[0] &= ~0x00000800u;
   }
   dummy_data_param_ = dummy_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.dummy_data_param)
 }
 
 // optional .opencv_caffe.EltwiseParameter eltwise_param = 110;
-inline bool LayerParameter::has_eltwise_param() const {
-  return (_has_bits_[0] & 0x00001000u) != 0;
+inline bool LayerParameter::_internal_has_eltwise_param() const {
+  bool value = (_has_bits_[0] & 0x00001000u) != 0;
+  PROTOBUF_ASSUME(!value || eltwise_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_eltwise_param() {
-  _has_bits_[0] |= 0x00001000u;
+inline bool LayerParameter::has_eltwise_param() const {
+  return _internal_has_eltwise_param();
 }
-inline void LayerParameter::clear_has_eltwise_param() {
+inline void LayerParameter::clear_eltwise_param() {
+  if (eltwise_param_ != nullptr) eltwise_param_->Clear();
   _has_bits_[0] &= ~0x00001000u;
 }
-inline void LayerParameter::clear_eltwise_param() {
-  if (eltwise_param_ != NULL) eltwise_param_->Clear();
-  clear_has_eltwise_param();
+inline const ::opencv_caffe::EltwiseParameter& LayerParameter::_internal_eltwise_param() const {
+  const ::opencv_caffe::EltwiseParameter* p = eltwise_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::EltwiseParameter&>(
+      ::opencv_caffe::_EltwiseParameter_default_instance_);
 }
 inline const ::opencv_caffe::EltwiseParameter& LayerParameter::eltwise_param() const {
-  const ::opencv_caffe::EltwiseParameter* p = eltwise_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.eltwise_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::EltwiseParameter*>(
-      &::opencv_caffe::_EltwiseParameter_default_instance_);
+  return _internal_eltwise_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_eltwise_param(
+    ::opencv_caffe::EltwiseParameter* eltwise_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(eltwise_param_);
+  }
+  eltwise_param_ = eltwise_param;
+  if (eltwise_param) {
+    _has_bits_[0] |= 0x00001000u;
+  } else {
+    _has_bits_[0] &= ~0x00001000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.eltwise_param)
 }
 inline ::opencv_caffe::EltwiseParameter* LayerParameter::release_eltwise_param() {
+  _has_bits_[0] &= ~0x00001000u;
+  ::opencv_caffe::EltwiseParameter* temp = eltwise_param_;
+  eltwise_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::EltwiseParameter* LayerParameter::unsafe_arena_release_eltwise_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.eltwise_param)
-  clear_has_eltwise_param();
+  _has_bits_[0] &= ~0x00001000u;
   ::opencv_caffe::EltwiseParameter* temp = eltwise_param_;
-  eltwise_param_ = NULL;
+  eltwise_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() {
-  set_has_eltwise_param();
-  if (eltwise_param_ == NULL) {
-    eltwise_param_ = new ::opencv_caffe::EltwiseParameter;
+inline ::opencv_caffe::EltwiseParameter* LayerParameter::_internal_mutable_eltwise_param() {
+  _has_bits_[0] |= 0x00001000u;
+  if (eltwise_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::EltwiseParameter>(GetArenaForAllocation());
+    eltwise_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.eltwise_param)
   return eltwise_param_;
 }
+inline ::opencv_caffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() {
+  ::opencv_caffe::EltwiseParameter* _msg = _internal_mutable_eltwise_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.eltwise_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_eltwise_param(::opencv_caffe::EltwiseParameter* eltwise_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete eltwise_param_;
   }
   if (eltwise_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::EltwiseParameter>::GetOwningArena(eltwise_param);
     if (message_arena != submessage_arena) {
-      eltwise_param = ::google::protobuf::internal::GetOwnedMessage(
+      eltwise_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, eltwise_param, submessage_arena);
     }
-    set_has_eltwise_param();
+    _has_bits_[0] |= 0x00001000u;
   } else {
-    clear_has_eltwise_param();
+    _has_bits_[0] &= ~0x00001000u;
   }
   eltwise_param_ = eltwise_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.eltwise_param)
 }
 
 // optional .opencv_caffe.ELUParameter elu_param = 140;
-inline bool LayerParameter::has_elu_param() const {
-  return (_has_bits_[1] & 0x00000400u) != 0;
+inline bool LayerParameter::_internal_has_elu_param() const {
+  bool value = (_has_bits_[1] & 0x00000400u) != 0;
+  PROTOBUF_ASSUME(!value || elu_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_elu_param() {
-  _has_bits_[1] |= 0x00000400u;
+inline bool LayerParameter::has_elu_param() const {
+  return _internal_has_elu_param();
 }
-inline void LayerParameter::clear_has_elu_param() {
+inline void LayerParameter::clear_elu_param() {
+  if (elu_param_ != nullptr) elu_param_->Clear();
   _has_bits_[1] &= ~0x00000400u;
 }
-inline void LayerParameter::clear_elu_param() {
-  if (elu_param_ != NULL) elu_param_->Clear();
-  clear_has_elu_param();
+inline const ::opencv_caffe::ELUParameter& LayerParameter::_internal_elu_param() const {
+  const ::opencv_caffe::ELUParameter* p = elu_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ELUParameter&>(
+      ::opencv_caffe::_ELUParameter_default_instance_);
 }
 inline const ::opencv_caffe::ELUParameter& LayerParameter::elu_param() const {
-  const ::opencv_caffe::ELUParameter* p = elu_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.elu_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ELUParameter*>(
-      &::opencv_caffe::_ELUParameter_default_instance_);
+  return _internal_elu_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_elu_param(
+    ::opencv_caffe::ELUParameter* elu_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(elu_param_);
+  }
+  elu_param_ = elu_param;
+  if (elu_param) {
+    _has_bits_[1] |= 0x00000400u;
+  } else {
+    _has_bits_[1] &= ~0x00000400u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.elu_param)
 }
 inline ::opencv_caffe::ELUParameter* LayerParameter::release_elu_param() {
+  _has_bits_[1] &= ~0x00000400u;
+  ::opencv_caffe::ELUParameter* temp = elu_param_;
+  elu_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ELUParameter* LayerParameter::unsafe_arena_release_elu_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.elu_param)
-  clear_has_elu_param();
+  _has_bits_[1] &= ~0x00000400u;
   ::opencv_caffe::ELUParameter* temp = elu_param_;
-  elu_param_ = NULL;
+  elu_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ELUParameter* LayerParameter::mutable_elu_param() {
-  set_has_elu_param();
-  if (elu_param_ == NULL) {
-    elu_param_ = new ::opencv_caffe::ELUParameter;
+inline ::opencv_caffe::ELUParameter* LayerParameter::_internal_mutable_elu_param() {
+  _has_bits_[1] |= 0x00000400u;
+  if (elu_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ELUParameter>(GetArenaForAllocation());
+    elu_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.elu_param)
   return elu_param_;
 }
+inline ::opencv_caffe::ELUParameter* LayerParameter::mutable_elu_param() {
+  ::opencv_caffe::ELUParameter* _msg = _internal_mutable_elu_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.elu_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_elu_param(::opencv_caffe::ELUParameter* elu_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete elu_param_;
   }
   if (elu_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ELUParameter>::GetOwningArena(elu_param);
     if (message_arena != submessage_arena) {
-      elu_param = ::google::protobuf::internal::GetOwnedMessage(
+      elu_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, elu_param, submessage_arena);
     }
-    set_has_elu_param();
+    _has_bits_[1] |= 0x00000400u;
   } else {
-    clear_has_elu_param();
+    _has_bits_[1] &= ~0x00000400u;
   }
   elu_param_ = elu_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.elu_param)
 }
 
 // optional .opencv_caffe.EmbedParameter embed_param = 137;
-inline bool LayerParameter::has_embed_param() const {
-  return (_has_bits_[1] & 0x00000080u) != 0;
+inline bool LayerParameter::_internal_has_embed_param() const {
+  bool value = (_has_bits_[1] & 0x00000080u) != 0;
+  PROTOBUF_ASSUME(!value || embed_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_embed_param() {
-  _has_bits_[1] |= 0x00000080u;
+inline bool LayerParameter::has_embed_param() const {
+  return _internal_has_embed_param();
 }
-inline void LayerParameter::clear_has_embed_param() {
+inline void LayerParameter::clear_embed_param() {
+  if (embed_param_ != nullptr) embed_param_->Clear();
   _has_bits_[1] &= ~0x00000080u;
 }
-inline void LayerParameter::clear_embed_param() {
-  if (embed_param_ != NULL) embed_param_->Clear();
-  clear_has_embed_param();
+inline const ::opencv_caffe::EmbedParameter& LayerParameter::_internal_embed_param() const {
+  const ::opencv_caffe::EmbedParameter* p = embed_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::EmbedParameter&>(
+      ::opencv_caffe::_EmbedParameter_default_instance_);
 }
 inline const ::opencv_caffe::EmbedParameter& LayerParameter::embed_param() const {
-  const ::opencv_caffe::EmbedParameter* p = embed_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.embed_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::EmbedParameter*>(
-      &::opencv_caffe::_EmbedParameter_default_instance_);
+  return _internal_embed_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_embed_param(
+    ::opencv_caffe::EmbedParameter* embed_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(embed_param_);
+  }
+  embed_param_ = embed_param;
+  if (embed_param) {
+    _has_bits_[1] |= 0x00000080u;
+  } else {
+    _has_bits_[1] &= ~0x00000080u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.embed_param)
 }
 inline ::opencv_caffe::EmbedParameter* LayerParameter::release_embed_param() {
+  _has_bits_[1] &= ~0x00000080u;
+  ::opencv_caffe::EmbedParameter* temp = embed_param_;
+  embed_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::EmbedParameter* LayerParameter::unsafe_arena_release_embed_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.embed_param)
-  clear_has_embed_param();
+  _has_bits_[1] &= ~0x00000080u;
   ::opencv_caffe::EmbedParameter* temp = embed_param_;
-  embed_param_ = NULL;
+  embed_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::EmbedParameter* LayerParameter::mutable_embed_param() {
-  set_has_embed_param();
-  if (embed_param_ == NULL) {
-    embed_param_ = new ::opencv_caffe::EmbedParameter;
+inline ::opencv_caffe::EmbedParameter* LayerParameter::_internal_mutable_embed_param() {
+  _has_bits_[1] |= 0x00000080u;
+  if (embed_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::EmbedParameter>(GetArenaForAllocation());
+    embed_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.embed_param)
   return embed_param_;
 }
+inline ::opencv_caffe::EmbedParameter* LayerParameter::mutable_embed_param() {
+  ::opencv_caffe::EmbedParameter* _msg = _internal_mutable_embed_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.embed_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_embed_param(::opencv_caffe::EmbedParameter* embed_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete embed_param_;
   }
   if (embed_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::EmbedParameter>::GetOwningArena(embed_param);
     if (message_arena != submessage_arena) {
-      embed_param = ::google::protobuf::internal::GetOwnedMessage(
+      embed_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, embed_param, submessage_arena);
     }
-    set_has_embed_param();
+    _has_bits_[1] |= 0x00000080u;
   } else {
-    clear_has_embed_param();
+    _has_bits_[1] &= ~0x00000080u;
   }
   embed_param_ = embed_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.embed_param)
 }
 
 // optional .opencv_caffe.ExpParameter exp_param = 111;
-inline bool LayerParameter::has_exp_param() const {
-  return (_has_bits_[0] & 0x00002000u) != 0;
+inline bool LayerParameter::_internal_has_exp_param() const {
+  bool value = (_has_bits_[0] & 0x00002000u) != 0;
+  PROTOBUF_ASSUME(!value || exp_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_exp_param() {
-  _has_bits_[0] |= 0x00002000u;
+inline bool LayerParameter::has_exp_param() const {
+  return _internal_has_exp_param();
 }
-inline void LayerParameter::clear_has_exp_param() {
+inline void LayerParameter::clear_exp_param() {
+  if (exp_param_ != nullptr) exp_param_->Clear();
   _has_bits_[0] &= ~0x00002000u;
 }
-inline void LayerParameter::clear_exp_param() {
-  if (exp_param_ != NULL) exp_param_->Clear();
-  clear_has_exp_param();
+inline const ::opencv_caffe::ExpParameter& LayerParameter::_internal_exp_param() const {
+  const ::opencv_caffe::ExpParameter* p = exp_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ExpParameter&>(
+      ::opencv_caffe::_ExpParameter_default_instance_);
 }
 inline const ::opencv_caffe::ExpParameter& LayerParameter::exp_param() const {
-  const ::opencv_caffe::ExpParameter* p = exp_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.exp_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ExpParameter*>(
-      &::opencv_caffe::_ExpParameter_default_instance_);
+  return _internal_exp_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_exp_param(
+    ::opencv_caffe::ExpParameter* exp_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(exp_param_);
+  }
+  exp_param_ = exp_param;
+  if (exp_param) {
+    _has_bits_[0] |= 0x00002000u;
+  } else {
+    _has_bits_[0] &= ~0x00002000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.exp_param)
 }
 inline ::opencv_caffe::ExpParameter* LayerParameter::release_exp_param() {
+  _has_bits_[0] &= ~0x00002000u;
+  ::opencv_caffe::ExpParameter* temp = exp_param_;
+  exp_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ExpParameter* LayerParameter::unsafe_arena_release_exp_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.exp_param)
-  clear_has_exp_param();
+  _has_bits_[0] &= ~0x00002000u;
   ::opencv_caffe::ExpParameter* temp = exp_param_;
-  exp_param_ = NULL;
+  exp_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ExpParameter* LayerParameter::mutable_exp_param() {
-  set_has_exp_param();
-  if (exp_param_ == NULL) {
-    exp_param_ = new ::opencv_caffe::ExpParameter;
+inline ::opencv_caffe::ExpParameter* LayerParameter::_internal_mutable_exp_param() {
+  _has_bits_[0] |= 0x00002000u;
+  if (exp_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ExpParameter>(GetArenaForAllocation());
+    exp_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.exp_param)
   return exp_param_;
 }
+inline ::opencv_caffe::ExpParameter* LayerParameter::mutable_exp_param() {
+  ::opencv_caffe::ExpParameter* _msg = _internal_mutable_exp_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.exp_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_exp_param(::opencv_caffe::ExpParameter* exp_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete exp_param_;
   }
   if (exp_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ExpParameter>::GetOwningArena(exp_param);
     if (message_arena != submessage_arena) {
-      exp_param = ::google::protobuf::internal::GetOwnedMessage(
+      exp_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, exp_param, submessage_arena);
     }
-    set_has_exp_param();
+    _has_bits_[0] |= 0x00002000u;
   } else {
-    clear_has_exp_param();
+    _has_bits_[0] &= ~0x00002000u;
   }
   exp_param_ = exp_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.exp_param)
 }
 
 // optional .opencv_caffe.FlattenParameter flatten_param = 135;
-inline bool LayerParameter::has_flatten_param() const {
-  return (_has_bits_[1] & 0x00000020u) != 0;
+inline bool LayerParameter::_internal_has_flatten_param() const {
+  bool value = (_has_bits_[1] & 0x00000020u) != 0;
+  PROTOBUF_ASSUME(!value || flatten_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_flatten_param() {
-  _has_bits_[1] |= 0x00000020u;
+inline bool LayerParameter::has_flatten_param() const {
+  return _internal_has_flatten_param();
 }
-inline void LayerParameter::clear_has_flatten_param() {
+inline void LayerParameter::clear_flatten_param() {
+  if (flatten_param_ != nullptr) flatten_param_->Clear();
   _has_bits_[1] &= ~0x00000020u;
 }
-inline void LayerParameter::clear_flatten_param() {
-  if (flatten_param_ != NULL) flatten_param_->Clear();
-  clear_has_flatten_param();
+inline const ::opencv_caffe::FlattenParameter& LayerParameter::_internal_flatten_param() const {
+  const ::opencv_caffe::FlattenParameter* p = flatten_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FlattenParameter&>(
+      ::opencv_caffe::_FlattenParameter_default_instance_);
 }
 inline const ::opencv_caffe::FlattenParameter& LayerParameter::flatten_param() const {
-  const ::opencv_caffe::FlattenParameter* p = flatten_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.flatten_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FlattenParameter*>(
-      &::opencv_caffe::_FlattenParameter_default_instance_);
+  return _internal_flatten_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_flatten_param(
+    ::opencv_caffe::FlattenParameter* flatten_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(flatten_param_);
+  }
+  flatten_param_ = flatten_param;
+  if (flatten_param) {
+    _has_bits_[1] |= 0x00000020u;
+  } else {
+    _has_bits_[1] &= ~0x00000020u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.flatten_param)
 }
 inline ::opencv_caffe::FlattenParameter* LayerParameter::release_flatten_param() {
+  _has_bits_[1] &= ~0x00000020u;
+  ::opencv_caffe::FlattenParameter* temp = flatten_param_;
+  flatten_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FlattenParameter* LayerParameter::unsafe_arena_release_flatten_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.flatten_param)
-  clear_has_flatten_param();
+  _has_bits_[1] &= ~0x00000020u;
   ::opencv_caffe::FlattenParameter* temp = flatten_param_;
-  flatten_param_ = NULL;
+  flatten_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FlattenParameter* LayerParameter::mutable_flatten_param() {
-  set_has_flatten_param();
-  if (flatten_param_ == NULL) {
-    flatten_param_ = new ::opencv_caffe::FlattenParameter;
+inline ::opencv_caffe::FlattenParameter* LayerParameter::_internal_mutable_flatten_param() {
+  _has_bits_[1] |= 0x00000020u;
+  if (flatten_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FlattenParameter>(GetArenaForAllocation());
+    flatten_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.flatten_param)
   return flatten_param_;
 }
+inline ::opencv_caffe::FlattenParameter* LayerParameter::mutable_flatten_param() {
+  ::opencv_caffe::FlattenParameter* _msg = _internal_mutable_flatten_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.flatten_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_flatten_param(::opencv_caffe::FlattenParameter* flatten_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete flatten_param_;
   }
   if (flatten_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FlattenParameter>::GetOwningArena(flatten_param);
     if (message_arena != submessage_arena) {
-      flatten_param = ::google::protobuf::internal::GetOwnedMessage(
+      flatten_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, flatten_param, submessage_arena);
     }
-    set_has_flatten_param();
+    _has_bits_[1] |= 0x00000020u;
   } else {
-    clear_has_flatten_param();
+    _has_bits_[1] &= ~0x00000020u;
   }
   flatten_param_ = flatten_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.flatten_param)
 }
 
 // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 112;
-inline bool LayerParameter::has_hdf5_data_param() const {
-  return (_has_bits_[0] & 0x00004000u) != 0;
+inline bool LayerParameter::_internal_has_hdf5_data_param() const {
+  bool value = (_has_bits_[0] & 0x00004000u) != 0;
+  PROTOBUF_ASSUME(!value || hdf5_data_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_hdf5_data_param() {
-  _has_bits_[0] |= 0x00004000u;
+inline bool LayerParameter::has_hdf5_data_param() const {
+  return _internal_has_hdf5_data_param();
 }
-inline void LayerParameter::clear_has_hdf5_data_param() {
+inline void LayerParameter::clear_hdf5_data_param() {
+  if (hdf5_data_param_ != nullptr) hdf5_data_param_->Clear();
   _has_bits_[0] &= ~0x00004000u;
 }
-inline void LayerParameter::clear_hdf5_data_param() {
-  if (hdf5_data_param_ != NULL) hdf5_data_param_->Clear();
-  clear_has_hdf5_data_param();
+inline const ::opencv_caffe::HDF5DataParameter& LayerParameter::_internal_hdf5_data_param() const {
+  const ::opencv_caffe::HDF5DataParameter* p = hdf5_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::HDF5DataParameter&>(
+      ::opencv_caffe::_HDF5DataParameter_default_instance_);
 }
 inline const ::opencv_caffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const {
-  const ::opencv_caffe::HDF5DataParameter* p = hdf5_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.hdf5_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::HDF5DataParameter*>(
-      &::opencv_caffe::_HDF5DataParameter_default_instance_);
+  return _internal_hdf5_data_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_hdf5_data_param(
+    ::opencv_caffe::HDF5DataParameter* hdf5_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(hdf5_data_param_);
+  }
+  hdf5_data_param_ = hdf5_data_param;
+  if (hdf5_data_param) {
+    _has_bits_[0] |= 0x00004000u;
+  } else {
+    _has_bits_[0] &= ~0x00004000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.hdf5_data_param)
 }
 inline ::opencv_caffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() {
+  _has_bits_[0] &= ~0x00004000u;
+  ::opencv_caffe::HDF5DataParameter* temp = hdf5_data_param_;
+  hdf5_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::HDF5DataParameter* LayerParameter::unsafe_arena_release_hdf5_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.hdf5_data_param)
-  clear_has_hdf5_data_param();
+  _has_bits_[0] &= ~0x00004000u;
   ::opencv_caffe::HDF5DataParameter* temp = hdf5_data_param_;
-  hdf5_data_param_ = NULL;
+  hdf5_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() {
-  set_has_hdf5_data_param();
-  if (hdf5_data_param_ == NULL) {
-    hdf5_data_param_ = new ::opencv_caffe::HDF5DataParameter;
+inline ::opencv_caffe::HDF5DataParameter* LayerParameter::_internal_mutable_hdf5_data_param() {
+  _has_bits_[0] |= 0x00004000u;
+  if (hdf5_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::HDF5DataParameter>(GetArenaForAllocation());
+    hdf5_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.hdf5_data_param)
   return hdf5_data_param_;
 }
+inline ::opencv_caffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() {
+  ::opencv_caffe::HDF5DataParameter* _msg = _internal_mutable_hdf5_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.hdf5_data_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_hdf5_data_param(::opencv_caffe::HDF5DataParameter* hdf5_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete hdf5_data_param_;
   }
   if (hdf5_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::HDF5DataParameter>::GetOwningArena(hdf5_data_param);
     if (message_arena != submessage_arena) {
-      hdf5_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      hdf5_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, hdf5_data_param, submessage_arena);
     }
-    set_has_hdf5_data_param();
+    _has_bits_[0] |= 0x00004000u;
   } else {
-    clear_has_hdf5_data_param();
+    _has_bits_[0] &= ~0x00004000u;
   }
   hdf5_data_param_ = hdf5_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.hdf5_data_param)
 }
 
 // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 113;
-inline bool LayerParameter::has_hdf5_output_param() const {
-  return (_has_bits_[0] & 0x00008000u) != 0;
+inline bool LayerParameter::_internal_has_hdf5_output_param() const {
+  bool value = (_has_bits_[0] & 0x00008000u) != 0;
+  PROTOBUF_ASSUME(!value || hdf5_output_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_hdf5_output_param() {
-  _has_bits_[0] |= 0x00008000u;
+inline bool LayerParameter::has_hdf5_output_param() const {
+  return _internal_has_hdf5_output_param();
 }
-inline void LayerParameter::clear_has_hdf5_output_param() {
+inline void LayerParameter::clear_hdf5_output_param() {
+  if (hdf5_output_param_ != nullptr) hdf5_output_param_->Clear();
   _has_bits_[0] &= ~0x00008000u;
 }
-inline void LayerParameter::clear_hdf5_output_param() {
-  if (hdf5_output_param_ != NULL) hdf5_output_param_->Clear();
-  clear_has_hdf5_output_param();
+inline const ::opencv_caffe::HDF5OutputParameter& LayerParameter::_internal_hdf5_output_param() const {
+  const ::opencv_caffe::HDF5OutputParameter* p = hdf5_output_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::HDF5OutputParameter&>(
+      ::opencv_caffe::_HDF5OutputParameter_default_instance_);
 }
 inline const ::opencv_caffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const {
-  const ::opencv_caffe::HDF5OutputParameter* p = hdf5_output_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.hdf5_output_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::HDF5OutputParameter*>(
-      &::opencv_caffe::_HDF5OutputParameter_default_instance_);
+  return _internal_hdf5_output_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_hdf5_output_param(
+    ::opencv_caffe::HDF5OutputParameter* hdf5_output_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(hdf5_output_param_);
+  }
+  hdf5_output_param_ = hdf5_output_param;
+  if (hdf5_output_param) {
+    _has_bits_[0] |= 0x00008000u;
+  } else {
+    _has_bits_[0] &= ~0x00008000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.hdf5_output_param)
 }
 inline ::opencv_caffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() {
+  _has_bits_[0] &= ~0x00008000u;
+  ::opencv_caffe::HDF5OutputParameter* temp = hdf5_output_param_;
+  hdf5_output_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::HDF5OutputParameter* LayerParameter::unsafe_arena_release_hdf5_output_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.hdf5_output_param)
-  clear_has_hdf5_output_param();
+  _has_bits_[0] &= ~0x00008000u;
   ::opencv_caffe::HDF5OutputParameter* temp = hdf5_output_param_;
-  hdf5_output_param_ = NULL;
+  hdf5_output_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() {
-  set_has_hdf5_output_param();
-  if (hdf5_output_param_ == NULL) {
-    hdf5_output_param_ = new ::opencv_caffe::HDF5OutputParameter;
+inline ::opencv_caffe::HDF5OutputParameter* LayerParameter::_internal_mutable_hdf5_output_param() {
+  _has_bits_[0] |= 0x00008000u;
+  if (hdf5_output_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::HDF5OutputParameter>(GetArenaForAllocation());
+    hdf5_output_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.hdf5_output_param)
   return hdf5_output_param_;
 }
+inline ::opencv_caffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() {
+  ::opencv_caffe::HDF5OutputParameter* _msg = _internal_mutable_hdf5_output_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.hdf5_output_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_hdf5_output_param(::opencv_caffe::HDF5OutputParameter* hdf5_output_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete hdf5_output_param_;
   }
   if (hdf5_output_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::HDF5OutputParameter>::GetOwningArena(hdf5_output_param);
     if (message_arena != submessage_arena) {
-      hdf5_output_param = ::google::protobuf::internal::GetOwnedMessage(
+      hdf5_output_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, hdf5_output_param, submessage_arena);
     }
-    set_has_hdf5_output_param();
+    _has_bits_[0] |= 0x00008000u;
   } else {
-    clear_has_hdf5_output_param();
+    _has_bits_[0] &= ~0x00008000u;
   }
   hdf5_output_param_ = hdf5_output_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.hdf5_output_param)
 }
 
 // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 114;
-inline bool LayerParameter::has_hinge_loss_param() const {
-  return (_has_bits_[0] & 0x00010000u) != 0;
+inline bool LayerParameter::_internal_has_hinge_loss_param() const {
+  bool value = (_has_bits_[0] & 0x00010000u) != 0;
+  PROTOBUF_ASSUME(!value || hinge_loss_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_hinge_loss_param() {
-  _has_bits_[0] |= 0x00010000u;
+inline bool LayerParameter::has_hinge_loss_param() const {
+  return _internal_has_hinge_loss_param();
 }
-inline void LayerParameter::clear_has_hinge_loss_param() {
+inline void LayerParameter::clear_hinge_loss_param() {
+  if (hinge_loss_param_ != nullptr) hinge_loss_param_->Clear();
   _has_bits_[0] &= ~0x00010000u;
 }
-inline void LayerParameter::clear_hinge_loss_param() {
-  if (hinge_loss_param_ != NULL) hinge_loss_param_->Clear();
-  clear_has_hinge_loss_param();
+inline const ::opencv_caffe::HingeLossParameter& LayerParameter::_internal_hinge_loss_param() const {
+  const ::opencv_caffe::HingeLossParameter* p = hinge_loss_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::HingeLossParameter&>(
+      ::opencv_caffe::_HingeLossParameter_default_instance_);
 }
 inline const ::opencv_caffe::HingeLossParameter& LayerParameter::hinge_loss_param() const {
-  const ::opencv_caffe::HingeLossParameter* p = hinge_loss_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.hinge_loss_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::HingeLossParameter*>(
-      &::opencv_caffe::_HingeLossParameter_default_instance_);
+  return _internal_hinge_loss_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_hinge_loss_param(
+    ::opencv_caffe::HingeLossParameter* hinge_loss_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(hinge_loss_param_);
+  }
+  hinge_loss_param_ = hinge_loss_param;
+  if (hinge_loss_param) {
+    _has_bits_[0] |= 0x00010000u;
+  } else {
+    _has_bits_[0] &= ~0x00010000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.hinge_loss_param)
 }
 inline ::opencv_caffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() {
+  _has_bits_[0] &= ~0x00010000u;
+  ::opencv_caffe::HingeLossParameter* temp = hinge_loss_param_;
+  hinge_loss_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::HingeLossParameter* LayerParameter::unsafe_arena_release_hinge_loss_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.hinge_loss_param)
-  clear_has_hinge_loss_param();
+  _has_bits_[0] &= ~0x00010000u;
   ::opencv_caffe::HingeLossParameter* temp = hinge_loss_param_;
-  hinge_loss_param_ = NULL;
+  hinge_loss_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() {
-  set_has_hinge_loss_param();
-  if (hinge_loss_param_ == NULL) {
-    hinge_loss_param_ = new ::opencv_caffe::HingeLossParameter;
+inline ::opencv_caffe::HingeLossParameter* LayerParameter::_internal_mutable_hinge_loss_param() {
+  _has_bits_[0] |= 0x00010000u;
+  if (hinge_loss_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::HingeLossParameter>(GetArenaForAllocation());
+    hinge_loss_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.hinge_loss_param)
   return hinge_loss_param_;
 }
+inline ::opencv_caffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() {
+  ::opencv_caffe::HingeLossParameter* _msg = _internal_mutable_hinge_loss_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.hinge_loss_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_hinge_loss_param(::opencv_caffe::HingeLossParameter* hinge_loss_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete hinge_loss_param_;
   }
   if (hinge_loss_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::HingeLossParameter>::GetOwningArena(hinge_loss_param);
     if (message_arena != submessage_arena) {
-      hinge_loss_param = ::google::protobuf::internal::GetOwnedMessage(
+      hinge_loss_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, hinge_loss_param, submessage_arena);
     }
-    set_has_hinge_loss_param();
+    _has_bits_[0] |= 0x00010000u;
   } else {
-    clear_has_hinge_loss_param();
+    _has_bits_[0] &= ~0x00010000u;
   }
   hinge_loss_param_ = hinge_loss_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.hinge_loss_param)
 }
 
 // optional .opencv_caffe.ImageDataParameter image_data_param = 115;
-inline bool LayerParameter::has_image_data_param() const {
-  return (_has_bits_[0] & 0x00020000u) != 0;
+inline bool LayerParameter::_internal_has_image_data_param() const {
+  bool value = (_has_bits_[0] & 0x00020000u) != 0;
+  PROTOBUF_ASSUME(!value || image_data_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_image_data_param() {
-  _has_bits_[0] |= 0x00020000u;
+inline bool LayerParameter::has_image_data_param() const {
+  return _internal_has_image_data_param();
 }
-inline void LayerParameter::clear_has_image_data_param() {
+inline void LayerParameter::clear_image_data_param() {
+  if (image_data_param_ != nullptr) image_data_param_->Clear();
   _has_bits_[0] &= ~0x00020000u;
 }
-inline void LayerParameter::clear_image_data_param() {
-  if (image_data_param_ != NULL) image_data_param_->Clear();
-  clear_has_image_data_param();
+inline const ::opencv_caffe::ImageDataParameter& LayerParameter::_internal_image_data_param() const {
+  const ::opencv_caffe::ImageDataParameter* p = image_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ImageDataParameter&>(
+      ::opencv_caffe::_ImageDataParameter_default_instance_);
 }
 inline const ::opencv_caffe::ImageDataParameter& LayerParameter::image_data_param() const {
-  const ::opencv_caffe::ImageDataParameter* p = image_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.image_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ImageDataParameter*>(
-      &::opencv_caffe::_ImageDataParameter_default_instance_);
+  return _internal_image_data_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_image_data_param(
+    ::opencv_caffe::ImageDataParameter* image_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(image_data_param_);
+  }
+  image_data_param_ = image_data_param;
+  if (image_data_param) {
+    _has_bits_[0] |= 0x00020000u;
+  } else {
+    _has_bits_[0] &= ~0x00020000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.image_data_param)
 }
 inline ::opencv_caffe::ImageDataParameter* LayerParameter::release_image_data_param() {
+  _has_bits_[0] &= ~0x00020000u;
+  ::opencv_caffe::ImageDataParameter* temp = image_data_param_;
+  image_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ImageDataParameter* LayerParameter::unsafe_arena_release_image_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.image_data_param)
-  clear_has_image_data_param();
+  _has_bits_[0] &= ~0x00020000u;
   ::opencv_caffe::ImageDataParameter* temp = image_data_param_;
-  image_data_param_ = NULL;
+  image_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ImageDataParameter* LayerParameter::mutable_image_data_param() {
-  set_has_image_data_param();
-  if (image_data_param_ == NULL) {
-    image_data_param_ = new ::opencv_caffe::ImageDataParameter;
+inline ::opencv_caffe::ImageDataParameter* LayerParameter::_internal_mutable_image_data_param() {
+  _has_bits_[0] |= 0x00020000u;
+  if (image_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ImageDataParameter>(GetArenaForAllocation());
+    image_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.image_data_param)
   return image_data_param_;
 }
+inline ::opencv_caffe::ImageDataParameter* LayerParameter::mutable_image_data_param() {
+  ::opencv_caffe::ImageDataParameter* _msg = _internal_mutable_image_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.image_data_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_image_data_param(::opencv_caffe::ImageDataParameter* image_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete image_data_param_;
   }
   if (image_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ImageDataParameter>::GetOwningArena(image_data_param);
     if (message_arena != submessage_arena) {
-      image_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      image_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, image_data_param, submessage_arena);
     }
-    set_has_image_data_param();
+    _has_bits_[0] |= 0x00020000u;
   } else {
-    clear_has_image_data_param();
+    _has_bits_[0] &= ~0x00020000u;
   }
   image_data_param_ = image_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.image_data_param)
 }
 
 // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 116;
-inline bool LayerParameter::has_infogain_loss_param() const {
-  return (_has_bits_[0] & 0x00040000u) != 0;
+inline bool LayerParameter::_internal_has_infogain_loss_param() const {
+  bool value = (_has_bits_[0] & 0x00040000u) != 0;
+  PROTOBUF_ASSUME(!value || infogain_loss_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_infogain_loss_param() {
-  _has_bits_[0] |= 0x00040000u;
+inline bool LayerParameter::has_infogain_loss_param() const {
+  return _internal_has_infogain_loss_param();
 }
-inline void LayerParameter::clear_has_infogain_loss_param() {
+inline void LayerParameter::clear_infogain_loss_param() {
+  if (infogain_loss_param_ != nullptr) infogain_loss_param_->Clear();
   _has_bits_[0] &= ~0x00040000u;
 }
-inline void LayerParameter::clear_infogain_loss_param() {
-  if (infogain_loss_param_ != NULL) infogain_loss_param_->Clear();
-  clear_has_infogain_loss_param();
+inline const ::opencv_caffe::InfogainLossParameter& LayerParameter::_internal_infogain_loss_param() const {
+  const ::opencv_caffe::InfogainLossParameter* p = infogain_loss_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::InfogainLossParameter&>(
+      ::opencv_caffe::_InfogainLossParameter_default_instance_);
 }
 inline const ::opencv_caffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const {
-  const ::opencv_caffe::InfogainLossParameter* p = infogain_loss_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.infogain_loss_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::InfogainLossParameter*>(
-      &::opencv_caffe::_InfogainLossParameter_default_instance_);
+  return _internal_infogain_loss_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_infogain_loss_param(
+    ::opencv_caffe::InfogainLossParameter* infogain_loss_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(infogain_loss_param_);
+  }
+  infogain_loss_param_ = infogain_loss_param;
+  if (infogain_loss_param) {
+    _has_bits_[0] |= 0x00040000u;
+  } else {
+    _has_bits_[0] &= ~0x00040000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.infogain_loss_param)
 }
 inline ::opencv_caffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() {
+  _has_bits_[0] &= ~0x00040000u;
+  ::opencv_caffe::InfogainLossParameter* temp = infogain_loss_param_;
+  infogain_loss_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::InfogainLossParameter* LayerParameter::unsafe_arena_release_infogain_loss_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.infogain_loss_param)
-  clear_has_infogain_loss_param();
+  _has_bits_[0] &= ~0x00040000u;
   ::opencv_caffe::InfogainLossParameter* temp = infogain_loss_param_;
-  infogain_loss_param_ = NULL;
+  infogain_loss_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() {
-  set_has_infogain_loss_param();
-  if (infogain_loss_param_ == NULL) {
-    infogain_loss_param_ = new ::opencv_caffe::InfogainLossParameter;
+inline ::opencv_caffe::InfogainLossParameter* LayerParameter::_internal_mutable_infogain_loss_param() {
+  _has_bits_[0] |= 0x00040000u;
+  if (infogain_loss_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::InfogainLossParameter>(GetArenaForAllocation());
+    infogain_loss_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.infogain_loss_param)
   return infogain_loss_param_;
 }
+inline ::opencv_caffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() {
+  ::opencv_caffe::InfogainLossParameter* _msg = _internal_mutable_infogain_loss_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.infogain_loss_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_infogain_loss_param(::opencv_caffe::InfogainLossParameter* infogain_loss_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete infogain_loss_param_;
   }
   if (infogain_loss_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::InfogainLossParameter>::GetOwningArena(infogain_loss_param);
     if (message_arena != submessage_arena) {
-      infogain_loss_param = ::google::protobuf::internal::GetOwnedMessage(
+      infogain_loss_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, infogain_loss_param, submessage_arena);
     }
-    set_has_infogain_loss_param();
+    _has_bits_[0] |= 0x00040000u;
   } else {
-    clear_has_infogain_loss_param();
+    _has_bits_[0] &= ~0x00040000u;
   }
   infogain_loss_param_ = infogain_loss_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.infogain_loss_param)
 }
 
 // optional .opencv_caffe.InnerProductParameter inner_product_param = 117;
-inline bool LayerParameter::has_inner_product_param() const {
-  return (_has_bits_[0] & 0x00080000u) != 0;
+inline bool LayerParameter::_internal_has_inner_product_param() const {
+  bool value = (_has_bits_[0] & 0x00080000u) != 0;
+  PROTOBUF_ASSUME(!value || inner_product_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_inner_product_param() {
-  _has_bits_[0] |= 0x00080000u;
+inline bool LayerParameter::has_inner_product_param() const {
+  return _internal_has_inner_product_param();
 }
-inline void LayerParameter::clear_has_inner_product_param() {
+inline void LayerParameter::clear_inner_product_param() {
+  if (inner_product_param_ != nullptr) inner_product_param_->Clear();
   _has_bits_[0] &= ~0x00080000u;
 }
-inline void LayerParameter::clear_inner_product_param() {
-  if (inner_product_param_ != NULL) inner_product_param_->Clear();
-  clear_has_inner_product_param();
+inline const ::opencv_caffe::InnerProductParameter& LayerParameter::_internal_inner_product_param() const {
+  const ::opencv_caffe::InnerProductParameter* p = inner_product_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::InnerProductParameter&>(
+      ::opencv_caffe::_InnerProductParameter_default_instance_);
 }
 inline const ::opencv_caffe::InnerProductParameter& LayerParameter::inner_product_param() const {
-  const ::opencv_caffe::InnerProductParameter* p = inner_product_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.inner_product_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::InnerProductParameter*>(
-      &::opencv_caffe::_InnerProductParameter_default_instance_);
+  return _internal_inner_product_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_inner_product_param(
+    ::opencv_caffe::InnerProductParameter* inner_product_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(inner_product_param_);
+  }
+  inner_product_param_ = inner_product_param;
+  if (inner_product_param) {
+    _has_bits_[0] |= 0x00080000u;
+  } else {
+    _has_bits_[0] &= ~0x00080000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.inner_product_param)
 }
 inline ::opencv_caffe::InnerProductParameter* LayerParameter::release_inner_product_param() {
+  _has_bits_[0] &= ~0x00080000u;
+  ::opencv_caffe::InnerProductParameter* temp = inner_product_param_;
+  inner_product_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::InnerProductParameter* LayerParameter::unsafe_arena_release_inner_product_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.inner_product_param)
-  clear_has_inner_product_param();
+  _has_bits_[0] &= ~0x00080000u;
   ::opencv_caffe::InnerProductParameter* temp = inner_product_param_;
-  inner_product_param_ = NULL;
+  inner_product_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() {
-  set_has_inner_product_param();
-  if (inner_product_param_ == NULL) {
-    inner_product_param_ = new ::opencv_caffe::InnerProductParameter;
+inline ::opencv_caffe::InnerProductParameter* LayerParameter::_internal_mutable_inner_product_param() {
+  _has_bits_[0] |= 0x00080000u;
+  if (inner_product_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::InnerProductParameter>(GetArenaForAllocation());
+    inner_product_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.inner_product_param)
   return inner_product_param_;
 }
+inline ::opencv_caffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() {
+  ::opencv_caffe::InnerProductParameter* _msg = _internal_mutable_inner_product_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.inner_product_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_inner_product_param(::opencv_caffe::InnerProductParameter* inner_product_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete inner_product_param_;
   }
   if (inner_product_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::InnerProductParameter>::GetOwningArena(inner_product_param);
     if (message_arena != submessage_arena) {
-      inner_product_param = ::google::protobuf::internal::GetOwnedMessage(
+      inner_product_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, inner_product_param, submessage_arena);
     }
-    set_has_inner_product_param();
+    _has_bits_[0] |= 0x00080000u;
   } else {
-    clear_has_inner_product_param();
+    _has_bits_[0] &= ~0x00080000u;
   }
   inner_product_param_ = inner_product_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.inner_product_param)
 }
 
 // optional .opencv_caffe.InputParameter input_param = 143;
-inline bool LayerParameter::has_input_param() const {
-  return (_has_bits_[1] & 0x00002000u) != 0;
+inline bool LayerParameter::_internal_has_input_param() const {
+  bool value = (_has_bits_[1] & 0x00002000u) != 0;
+  PROTOBUF_ASSUME(!value || input_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_input_param() {
-  _has_bits_[1] |= 0x00002000u;
+inline bool LayerParameter::has_input_param() const {
+  return _internal_has_input_param();
 }
-inline void LayerParameter::clear_has_input_param() {
+inline void LayerParameter::clear_input_param() {
+  if (input_param_ != nullptr) input_param_->Clear();
   _has_bits_[1] &= ~0x00002000u;
 }
-inline void LayerParameter::clear_input_param() {
-  if (input_param_ != NULL) input_param_->Clear();
-  clear_has_input_param();
+inline const ::opencv_caffe::InputParameter& LayerParameter::_internal_input_param() const {
+  const ::opencv_caffe::InputParameter* p = input_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::InputParameter&>(
+      ::opencv_caffe::_InputParameter_default_instance_);
 }
 inline const ::opencv_caffe::InputParameter& LayerParameter::input_param() const {
-  const ::opencv_caffe::InputParameter* p = input_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.input_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::InputParameter*>(
-      &::opencv_caffe::_InputParameter_default_instance_);
+  return _internal_input_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_input_param(
+    ::opencv_caffe::InputParameter* input_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(input_param_);
+  }
+  input_param_ = input_param;
+  if (input_param) {
+    _has_bits_[1] |= 0x00002000u;
+  } else {
+    _has_bits_[1] &= ~0x00002000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.input_param)
 }
 inline ::opencv_caffe::InputParameter* LayerParameter::release_input_param() {
+  _has_bits_[1] &= ~0x00002000u;
+  ::opencv_caffe::InputParameter* temp = input_param_;
+  input_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::InputParameter* LayerParameter::unsafe_arena_release_input_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.input_param)
-  clear_has_input_param();
+  _has_bits_[1] &= ~0x00002000u;
   ::opencv_caffe::InputParameter* temp = input_param_;
-  input_param_ = NULL;
+  input_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::InputParameter* LayerParameter::mutable_input_param() {
-  set_has_input_param();
-  if (input_param_ == NULL) {
-    input_param_ = new ::opencv_caffe::InputParameter;
+inline ::opencv_caffe::InputParameter* LayerParameter::_internal_mutable_input_param() {
+  _has_bits_[1] |= 0x00002000u;
+  if (input_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::InputParameter>(GetArenaForAllocation());
+    input_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.input_param)
   return input_param_;
 }
+inline ::opencv_caffe::InputParameter* LayerParameter::mutable_input_param() {
+  ::opencv_caffe::InputParameter* _msg = _internal_mutable_input_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.input_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_input_param(::opencv_caffe::InputParameter* input_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete input_param_;
   }
   if (input_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::InputParameter>::GetOwningArena(input_param);
     if (message_arena != submessage_arena) {
-      input_param = ::google::protobuf::internal::GetOwnedMessage(
+      input_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, input_param, submessage_arena);
     }
-    set_has_input_param();
+    _has_bits_[1] |= 0x00002000u;
   } else {
-    clear_has_input_param();
+    _has_bits_[1] &= ~0x00002000u;
   }
   input_param_ = input_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.input_param)
 }
 
 // optional .opencv_caffe.LogParameter log_param = 134;
-inline bool LayerParameter::has_log_param() const {
-  return (_has_bits_[1] & 0x00000010u) != 0;
+inline bool LayerParameter::_internal_has_log_param() const {
+  bool value = (_has_bits_[1] & 0x00000010u) != 0;
+  PROTOBUF_ASSUME(!value || log_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_log_param() {
-  _has_bits_[1] |= 0x00000010u;
+inline bool LayerParameter::has_log_param() const {
+  return _internal_has_log_param();
 }
-inline void LayerParameter::clear_has_log_param() {
+inline void LayerParameter::clear_log_param() {
+  if (log_param_ != nullptr) log_param_->Clear();
   _has_bits_[1] &= ~0x00000010u;
 }
-inline void LayerParameter::clear_log_param() {
-  if (log_param_ != NULL) log_param_->Clear();
-  clear_has_log_param();
+inline const ::opencv_caffe::LogParameter& LayerParameter::_internal_log_param() const {
+  const ::opencv_caffe::LogParameter* p = log_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::LogParameter&>(
+      ::opencv_caffe::_LogParameter_default_instance_);
 }
 inline const ::opencv_caffe::LogParameter& LayerParameter::log_param() const {
-  const ::opencv_caffe::LogParameter* p = log_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.log_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::LogParameter*>(
-      &::opencv_caffe::_LogParameter_default_instance_);
+  return _internal_log_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_log_param(
+    ::opencv_caffe::LogParameter* log_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(log_param_);
+  }
+  log_param_ = log_param;
+  if (log_param) {
+    _has_bits_[1] |= 0x00000010u;
+  } else {
+    _has_bits_[1] &= ~0x00000010u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.log_param)
 }
 inline ::opencv_caffe::LogParameter* LayerParameter::release_log_param() {
+  _has_bits_[1] &= ~0x00000010u;
+  ::opencv_caffe::LogParameter* temp = log_param_;
+  log_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::LogParameter* LayerParameter::unsafe_arena_release_log_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.log_param)
-  clear_has_log_param();
+  _has_bits_[1] &= ~0x00000010u;
   ::opencv_caffe::LogParameter* temp = log_param_;
-  log_param_ = NULL;
+  log_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::LogParameter* LayerParameter::mutable_log_param() {
-  set_has_log_param();
-  if (log_param_ == NULL) {
-    log_param_ = new ::opencv_caffe::LogParameter;
+inline ::opencv_caffe::LogParameter* LayerParameter::_internal_mutable_log_param() {
+  _has_bits_[1] |= 0x00000010u;
+  if (log_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::LogParameter>(GetArenaForAllocation());
+    log_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.log_param)
   return log_param_;
 }
+inline ::opencv_caffe::LogParameter* LayerParameter::mutable_log_param() {
+  ::opencv_caffe::LogParameter* _msg = _internal_mutable_log_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.log_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_log_param(::opencv_caffe::LogParameter* log_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete log_param_;
   }
   if (log_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::LogParameter>::GetOwningArena(log_param);
     if (message_arena != submessage_arena) {
-      log_param = ::google::protobuf::internal::GetOwnedMessage(
+      log_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, log_param, submessage_arena);
     }
-    set_has_log_param();
+    _has_bits_[1] |= 0x00000010u;
   } else {
-    clear_has_log_param();
+    _has_bits_[1] &= ~0x00000010u;
   }
   log_param_ = log_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.log_param)
 }
 
 // optional .opencv_caffe.LRNParameter lrn_param = 118;
-inline bool LayerParameter::has_lrn_param() const {
-  return (_has_bits_[0] & 0x00100000u) != 0;
+inline bool LayerParameter::_internal_has_lrn_param() const {
+  bool value = (_has_bits_[0] & 0x00100000u) != 0;
+  PROTOBUF_ASSUME(!value || lrn_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_lrn_param() {
-  _has_bits_[0] |= 0x00100000u;
+inline bool LayerParameter::has_lrn_param() const {
+  return _internal_has_lrn_param();
 }
-inline void LayerParameter::clear_has_lrn_param() {
+inline void LayerParameter::clear_lrn_param() {
+  if (lrn_param_ != nullptr) lrn_param_->Clear();
   _has_bits_[0] &= ~0x00100000u;
 }
-inline void LayerParameter::clear_lrn_param() {
-  if (lrn_param_ != NULL) lrn_param_->Clear();
-  clear_has_lrn_param();
+inline const ::opencv_caffe::LRNParameter& LayerParameter::_internal_lrn_param() const {
+  const ::opencv_caffe::LRNParameter* p = lrn_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::LRNParameter&>(
+      ::opencv_caffe::_LRNParameter_default_instance_);
 }
 inline const ::opencv_caffe::LRNParameter& LayerParameter::lrn_param() const {
-  const ::opencv_caffe::LRNParameter* p = lrn_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.lrn_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::LRNParameter*>(
-      &::opencv_caffe::_LRNParameter_default_instance_);
+  return _internal_lrn_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_lrn_param(
+    ::opencv_caffe::LRNParameter* lrn_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(lrn_param_);
+  }
+  lrn_param_ = lrn_param;
+  if (lrn_param) {
+    _has_bits_[0] |= 0x00100000u;
+  } else {
+    _has_bits_[0] &= ~0x00100000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.lrn_param)
 }
 inline ::opencv_caffe::LRNParameter* LayerParameter::release_lrn_param() {
+  _has_bits_[0] &= ~0x00100000u;
+  ::opencv_caffe::LRNParameter* temp = lrn_param_;
+  lrn_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::LRNParameter* LayerParameter::unsafe_arena_release_lrn_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.lrn_param)
-  clear_has_lrn_param();
+  _has_bits_[0] &= ~0x00100000u;
   ::opencv_caffe::LRNParameter* temp = lrn_param_;
-  lrn_param_ = NULL;
+  lrn_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::LRNParameter* LayerParameter::mutable_lrn_param() {
-  set_has_lrn_param();
-  if (lrn_param_ == NULL) {
-    lrn_param_ = new ::opencv_caffe::LRNParameter;
+inline ::opencv_caffe::LRNParameter* LayerParameter::_internal_mutable_lrn_param() {
+  _has_bits_[0] |= 0x00100000u;
+  if (lrn_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::LRNParameter>(GetArenaForAllocation());
+    lrn_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.lrn_param)
   return lrn_param_;
 }
+inline ::opencv_caffe::LRNParameter* LayerParameter::mutable_lrn_param() {
+  ::opencv_caffe::LRNParameter* _msg = _internal_mutable_lrn_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.lrn_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_lrn_param(::opencv_caffe::LRNParameter* lrn_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete lrn_param_;
   }
   if (lrn_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::LRNParameter>::GetOwningArena(lrn_param);
     if (message_arena != submessage_arena) {
-      lrn_param = ::google::protobuf::internal::GetOwnedMessage(
+      lrn_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, lrn_param, submessage_arena);
     }
-    set_has_lrn_param();
+    _has_bits_[0] |= 0x00100000u;
   } else {
-    clear_has_lrn_param();
+    _has_bits_[0] &= ~0x00100000u;
   }
   lrn_param_ = lrn_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.lrn_param)
 }
 
 // optional .opencv_caffe.MemoryDataParameter memory_data_param = 119;
-inline bool LayerParameter::has_memory_data_param() const {
-  return (_has_bits_[0] & 0x00200000u) != 0;
+inline bool LayerParameter::_internal_has_memory_data_param() const {
+  bool value = (_has_bits_[0] & 0x00200000u) != 0;
+  PROTOBUF_ASSUME(!value || memory_data_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_memory_data_param() {
-  _has_bits_[0] |= 0x00200000u;
+inline bool LayerParameter::has_memory_data_param() const {
+  return _internal_has_memory_data_param();
 }
-inline void LayerParameter::clear_has_memory_data_param() {
+inline void LayerParameter::clear_memory_data_param() {
+  if (memory_data_param_ != nullptr) memory_data_param_->Clear();
   _has_bits_[0] &= ~0x00200000u;
 }
-inline void LayerParameter::clear_memory_data_param() {
-  if (memory_data_param_ != NULL) memory_data_param_->Clear();
-  clear_has_memory_data_param();
+inline const ::opencv_caffe::MemoryDataParameter& LayerParameter::_internal_memory_data_param() const {
+  const ::opencv_caffe::MemoryDataParameter* p = memory_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::MemoryDataParameter&>(
+      ::opencv_caffe::_MemoryDataParameter_default_instance_);
 }
 inline const ::opencv_caffe::MemoryDataParameter& LayerParameter::memory_data_param() const {
-  const ::opencv_caffe::MemoryDataParameter* p = memory_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.memory_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::MemoryDataParameter*>(
-      &::opencv_caffe::_MemoryDataParameter_default_instance_);
+  return _internal_memory_data_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_memory_data_param(
+    ::opencv_caffe::MemoryDataParameter* memory_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(memory_data_param_);
+  }
+  memory_data_param_ = memory_data_param;
+  if (memory_data_param) {
+    _has_bits_[0] |= 0x00200000u;
+  } else {
+    _has_bits_[0] &= ~0x00200000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.memory_data_param)
 }
 inline ::opencv_caffe::MemoryDataParameter* LayerParameter::release_memory_data_param() {
+  _has_bits_[0] &= ~0x00200000u;
+  ::opencv_caffe::MemoryDataParameter* temp = memory_data_param_;
+  memory_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::MemoryDataParameter* LayerParameter::unsafe_arena_release_memory_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.memory_data_param)
-  clear_has_memory_data_param();
+  _has_bits_[0] &= ~0x00200000u;
   ::opencv_caffe::MemoryDataParameter* temp = memory_data_param_;
-  memory_data_param_ = NULL;
+  memory_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() {
-  set_has_memory_data_param();
-  if (memory_data_param_ == NULL) {
-    memory_data_param_ = new ::opencv_caffe::MemoryDataParameter;
+inline ::opencv_caffe::MemoryDataParameter* LayerParameter::_internal_mutable_memory_data_param() {
+  _has_bits_[0] |= 0x00200000u;
+  if (memory_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::MemoryDataParameter>(GetArenaForAllocation());
+    memory_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.memory_data_param)
   return memory_data_param_;
 }
+inline ::opencv_caffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() {
+  ::opencv_caffe::MemoryDataParameter* _msg = _internal_mutable_memory_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.memory_data_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_memory_data_param(::opencv_caffe::MemoryDataParameter* memory_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete memory_data_param_;
   }
   if (memory_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::MemoryDataParameter>::GetOwningArena(memory_data_param);
     if (message_arena != submessage_arena) {
-      memory_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      memory_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, memory_data_param, submessage_arena);
     }
-    set_has_memory_data_param();
+    _has_bits_[0] |= 0x00200000u;
   } else {
-    clear_has_memory_data_param();
+    _has_bits_[0] &= ~0x00200000u;
   }
   memory_data_param_ = memory_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.memory_data_param)
 }
 
 // optional .opencv_caffe.MVNParameter mvn_param = 120;
-inline bool LayerParameter::has_mvn_param() const {
-  return (_has_bits_[0] & 0x00400000u) != 0;
+inline bool LayerParameter::_internal_has_mvn_param() const {
+  bool value = (_has_bits_[0] & 0x00400000u) != 0;
+  PROTOBUF_ASSUME(!value || mvn_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_mvn_param() {
-  _has_bits_[0] |= 0x00400000u;
+inline bool LayerParameter::has_mvn_param() const {
+  return _internal_has_mvn_param();
 }
-inline void LayerParameter::clear_has_mvn_param() {
+inline void LayerParameter::clear_mvn_param() {
+  if (mvn_param_ != nullptr) mvn_param_->Clear();
   _has_bits_[0] &= ~0x00400000u;
 }
-inline void LayerParameter::clear_mvn_param() {
-  if (mvn_param_ != NULL) mvn_param_->Clear();
-  clear_has_mvn_param();
+inline const ::opencv_caffe::MVNParameter& LayerParameter::_internal_mvn_param() const {
+  const ::opencv_caffe::MVNParameter* p = mvn_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::MVNParameter&>(
+      ::opencv_caffe::_MVNParameter_default_instance_);
 }
 inline const ::opencv_caffe::MVNParameter& LayerParameter::mvn_param() const {
-  const ::opencv_caffe::MVNParameter* p = mvn_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.mvn_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::MVNParameter*>(
-      &::opencv_caffe::_MVNParameter_default_instance_);
+  return _internal_mvn_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_mvn_param(
+    ::opencv_caffe::MVNParameter* mvn_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(mvn_param_);
+  }
+  mvn_param_ = mvn_param;
+  if (mvn_param) {
+    _has_bits_[0] |= 0x00400000u;
+  } else {
+    _has_bits_[0] &= ~0x00400000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.mvn_param)
 }
 inline ::opencv_caffe::MVNParameter* LayerParameter::release_mvn_param() {
+  _has_bits_[0] &= ~0x00400000u;
+  ::opencv_caffe::MVNParameter* temp = mvn_param_;
+  mvn_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::MVNParameter* LayerParameter::unsafe_arena_release_mvn_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.mvn_param)
-  clear_has_mvn_param();
+  _has_bits_[0] &= ~0x00400000u;
   ::opencv_caffe::MVNParameter* temp = mvn_param_;
-  mvn_param_ = NULL;
+  mvn_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::MVNParameter* LayerParameter::mutable_mvn_param() {
-  set_has_mvn_param();
-  if (mvn_param_ == NULL) {
-    mvn_param_ = new ::opencv_caffe::MVNParameter;
+inline ::opencv_caffe::MVNParameter* LayerParameter::_internal_mutable_mvn_param() {
+  _has_bits_[0] |= 0x00400000u;
+  if (mvn_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::MVNParameter>(GetArenaForAllocation());
+    mvn_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.mvn_param)
   return mvn_param_;
 }
+inline ::opencv_caffe::MVNParameter* LayerParameter::mutable_mvn_param() {
+  ::opencv_caffe::MVNParameter* _msg = _internal_mutable_mvn_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.mvn_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_mvn_param(::opencv_caffe::MVNParameter* mvn_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete mvn_param_;
   }
   if (mvn_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::MVNParameter>::GetOwningArena(mvn_param);
     if (message_arena != submessage_arena) {
-      mvn_param = ::google::protobuf::internal::GetOwnedMessage(
+      mvn_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, mvn_param, submessage_arena);
     }
-    set_has_mvn_param();
+    _has_bits_[0] |= 0x00400000u;
   } else {
-    clear_has_mvn_param();
+    _has_bits_[0] &= ~0x00400000u;
   }
   mvn_param_ = mvn_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.mvn_param)
 }
 
 // optional .opencv_caffe.NormalizeBBoxParameter norm_param = 149;
-inline bool LayerParameter::has_norm_param() const {
-  return (_has_bits_[1] & 0x00080000u) != 0;
+inline bool LayerParameter::_internal_has_norm_param() const {
+  bool value = (_has_bits_[1] & 0x00080000u) != 0;
+  PROTOBUF_ASSUME(!value || norm_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_norm_param() {
-  _has_bits_[1] |= 0x00080000u;
+inline bool LayerParameter::has_norm_param() const {
+  return _internal_has_norm_param();
 }
-inline void LayerParameter::clear_has_norm_param() {
+inline void LayerParameter::clear_norm_param() {
+  if (norm_param_ != nullptr) norm_param_->Clear();
   _has_bits_[1] &= ~0x00080000u;
 }
-inline void LayerParameter::clear_norm_param() {
-  if (norm_param_ != NULL) norm_param_->Clear();
-  clear_has_norm_param();
+inline const ::opencv_caffe::NormalizeBBoxParameter& LayerParameter::_internal_norm_param() const {
+  const ::opencv_caffe::NormalizeBBoxParameter* p = norm_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::NormalizeBBoxParameter&>(
+      ::opencv_caffe::_NormalizeBBoxParameter_default_instance_);
 }
 inline const ::opencv_caffe::NormalizeBBoxParameter& LayerParameter::norm_param() const {
-  const ::opencv_caffe::NormalizeBBoxParameter* p = norm_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.norm_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::NormalizeBBoxParameter*>(
-      &::opencv_caffe::_NormalizeBBoxParameter_default_instance_);
+  return _internal_norm_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_norm_param(
+    ::opencv_caffe::NormalizeBBoxParameter* norm_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(norm_param_);
+  }
+  norm_param_ = norm_param;
+  if (norm_param) {
+    _has_bits_[1] |= 0x00080000u;
+  } else {
+    _has_bits_[1] &= ~0x00080000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.norm_param)
 }
 inline ::opencv_caffe::NormalizeBBoxParameter* LayerParameter::release_norm_param() {
+  _has_bits_[1] &= ~0x00080000u;
+  ::opencv_caffe::NormalizeBBoxParameter* temp = norm_param_;
+  norm_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::NormalizeBBoxParameter* LayerParameter::unsafe_arena_release_norm_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.norm_param)
-  clear_has_norm_param();
+  _has_bits_[1] &= ~0x00080000u;
   ::opencv_caffe::NormalizeBBoxParameter* temp = norm_param_;
-  norm_param_ = NULL;
+  norm_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::NormalizeBBoxParameter* LayerParameter::mutable_norm_param() {
-  set_has_norm_param();
-  if (norm_param_ == NULL) {
-    norm_param_ = new ::opencv_caffe::NormalizeBBoxParameter;
+inline ::opencv_caffe::NormalizeBBoxParameter* LayerParameter::_internal_mutable_norm_param() {
+  _has_bits_[1] |= 0x00080000u;
+  if (norm_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::NormalizeBBoxParameter>(GetArenaForAllocation());
+    norm_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.norm_param)
   return norm_param_;
 }
+inline ::opencv_caffe::NormalizeBBoxParameter* LayerParameter::mutable_norm_param() {
+  ::opencv_caffe::NormalizeBBoxParameter* _msg = _internal_mutable_norm_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.norm_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_norm_param(::opencv_caffe::NormalizeBBoxParameter* norm_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete norm_param_;
   }
   if (norm_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::NormalizeBBoxParameter>::GetOwningArena(norm_param);
     if (message_arena != submessage_arena) {
-      norm_param = ::google::protobuf::internal::GetOwnedMessage(
+      norm_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, norm_param, submessage_arena);
     }
-    set_has_norm_param();
+    _has_bits_[1] |= 0x00080000u;
   } else {
-    clear_has_norm_param();
+    _has_bits_[1] &= ~0x00080000u;
   }
   norm_param_ = norm_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.norm_param)
 }
 
 // optional .opencv_caffe.PermuteParameter permute_param = 148;
-inline bool LayerParameter::has_permute_param() const {
-  return (_has_bits_[1] & 0x00040000u) != 0;
+inline bool LayerParameter::_internal_has_permute_param() const {
+  bool value = (_has_bits_[1] & 0x00040000u) != 0;
+  PROTOBUF_ASSUME(!value || permute_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_permute_param() {
-  _has_bits_[1] |= 0x00040000u;
+inline bool LayerParameter::has_permute_param() const {
+  return _internal_has_permute_param();
 }
-inline void LayerParameter::clear_has_permute_param() {
+inline void LayerParameter::clear_permute_param() {
+  if (permute_param_ != nullptr) permute_param_->Clear();
   _has_bits_[1] &= ~0x00040000u;
 }
-inline void LayerParameter::clear_permute_param() {
-  if (permute_param_ != NULL) permute_param_->Clear();
-  clear_has_permute_param();
+inline const ::opencv_caffe::PermuteParameter& LayerParameter::_internal_permute_param() const {
+  const ::opencv_caffe::PermuteParameter* p = permute_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PermuteParameter&>(
+      ::opencv_caffe::_PermuteParameter_default_instance_);
 }
 inline const ::opencv_caffe::PermuteParameter& LayerParameter::permute_param() const {
-  const ::opencv_caffe::PermuteParameter* p = permute_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.permute_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PermuteParameter*>(
-      &::opencv_caffe::_PermuteParameter_default_instance_);
+  return _internal_permute_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_permute_param(
+    ::opencv_caffe::PermuteParameter* permute_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(permute_param_);
+  }
+  permute_param_ = permute_param;
+  if (permute_param) {
+    _has_bits_[1] |= 0x00040000u;
+  } else {
+    _has_bits_[1] &= ~0x00040000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.permute_param)
 }
 inline ::opencv_caffe::PermuteParameter* LayerParameter::release_permute_param() {
+  _has_bits_[1] &= ~0x00040000u;
+  ::opencv_caffe::PermuteParameter* temp = permute_param_;
+  permute_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PermuteParameter* LayerParameter::unsafe_arena_release_permute_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.permute_param)
-  clear_has_permute_param();
+  _has_bits_[1] &= ~0x00040000u;
   ::opencv_caffe::PermuteParameter* temp = permute_param_;
-  permute_param_ = NULL;
+  permute_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::PermuteParameter* LayerParameter::mutable_permute_param() {
-  set_has_permute_param();
-  if (permute_param_ == NULL) {
-    permute_param_ = new ::opencv_caffe::PermuteParameter;
+inline ::opencv_caffe::PermuteParameter* LayerParameter::_internal_mutable_permute_param() {
+  _has_bits_[1] |= 0x00040000u;
+  if (permute_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PermuteParameter>(GetArenaForAllocation());
+    permute_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.permute_param)
   return permute_param_;
 }
+inline ::opencv_caffe::PermuteParameter* LayerParameter::mutable_permute_param() {
+  ::opencv_caffe::PermuteParameter* _msg = _internal_mutable_permute_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.permute_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_permute_param(::opencv_caffe::PermuteParameter* permute_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete permute_param_;
   }
   if (permute_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PermuteParameter>::GetOwningArena(permute_param);
     if (message_arena != submessage_arena) {
-      permute_param = ::google::protobuf::internal::GetOwnedMessage(
+      permute_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, permute_param, submessage_arena);
     }
-    set_has_permute_param();
+    _has_bits_[1] |= 0x00040000u;
   } else {
-    clear_has_permute_param();
+    _has_bits_[1] &= ~0x00040000u;
   }
   permute_param_ = permute_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.permute_param)
 }
 
 // optional .opencv_caffe.ParameterParameter parameter_param = 145;
-inline bool LayerParameter::has_parameter_param() const {
-  return (_has_bits_[1] & 0x00008000u) != 0;
+inline bool LayerParameter::_internal_has_parameter_param() const {
+  bool value = (_has_bits_[1] & 0x00008000u) != 0;
+  PROTOBUF_ASSUME(!value || parameter_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_parameter_param() {
-  _has_bits_[1] |= 0x00008000u;
+inline bool LayerParameter::has_parameter_param() const {
+  return _internal_has_parameter_param();
 }
-inline void LayerParameter::clear_has_parameter_param() {
+inline void LayerParameter::clear_parameter_param() {
+  if (parameter_param_ != nullptr) parameter_param_->Clear();
   _has_bits_[1] &= ~0x00008000u;
 }
-inline void LayerParameter::clear_parameter_param() {
-  if (parameter_param_ != NULL) parameter_param_->Clear();
-  clear_has_parameter_param();
+inline const ::opencv_caffe::ParameterParameter& LayerParameter::_internal_parameter_param() const {
+  const ::opencv_caffe::ParameterParameter* p = parameter_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ParameterParameter&>(
+      ::opencv_caffe::_ParameterParameter_default_instance_);
 }
 inline const ::opencv_caffe::ParameterParameter& LayerParameter::parameter_param() const {
-  const ::opencv_caffe::ParameterParameter* p = parameter_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.parameter_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ParameterParameter*>(
-      &::opencv_caffe::_ParameterParameter_default_instance_);
+  return _internal_parameter_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_parameter_param(
+    ::opencv_caffe::ParameterParameter* parameter_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(parameter_param_);
+  }
+  parameter_param_ = parameter_param;
+  if (parameter_param) {
+    _has_bits_[1] |= 0x00008000u;
+  } else {
+    _has_bits_[1] &= ~0x00008000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.parameter_param)
 }
 inline ::opencv_caffe::ParameterParameter* LayerParameter::release_parameter_param() {
+  _has_bits_[1] &= ~0x00008000u;
+  ::opencv_caffe::ParameterParameter* temp = parameter_param_;
+  parameter_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ParameterParameter* LayerParameter::unsafe_arena_release_parameter_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.parameter_param)
-  clear_has_parameter_param();
+  _has_bits_[1] &= ~0x00008000u;
   ::opencv_caffe::ParameterParameter* temp = parameter_param_;
-  parameter_param_ = NULL;
+  parameter_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ParameterParameter* LayerParameter::mutable_parameter_param() {
-  set_has_parameter_param();
-  if (parameter_param_ == NULL) {
-    parameter_param_ = new ::opencv_caffe::ParameterParameter;
+inline ::opencv_caffe::ParameterParameter* LayerParameter::_internal_mutable_parameter_param() {
+  _has_bits_[1] |= 0x00008000u;
+  if (parameter_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ParameterParameter>(GetArenaForAllocation());
+    parameter_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.parameter_param)
   return parameter_param_;
 }
+inline ::opencv_caffe::ParameterParameter* LayerParameter::mutable_parameter_param() {
+  ::opencv_caffe::ParameterParameter* _msg = _internal_mutable_parameter_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.parameter_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_parameter_param(::opencv_caffe::ParameterParameter* parameter_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete parameter_param_;
   }
   if (parameter_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ParameterParameter>::GetOwningArena(parameter_param);
     if (message_arena != submessage_arena) {
-      parameter_param = ::google::protobuf::internal::GetOwnedMessage(
+      parameter_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, parameter_param, submessage_arena);
     }
-    set_has_parameter_param();
+    _has_bits_[1] |= 0x00008000u;
   } else {
-    clear_has_parameter_param();
+    _has_bits_[1] &= ~0x00008000u;
   }
   parameter_param_ = parameter_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.parameter_param)
 }
 
 // optional .opencv_caffe.PoolingParameter pooling_param = 121;
-inline bool LayerParameter::has_pooling_param() const {
-  return (_has_bits_[0] & 0x00800000u) != 0;
+inline bool LayerParameter::_internal_has_pooling_param() const {
+  bool value = (_has_bits_[0] & 0x00800000u) != 0;
+  PROTOBUF_ASSUME(!value || pooling_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_pooling_param() {
-  _has_bits_[0] |= 0x00800000u;
+inline bool LayerParameter::has_pooling_param() const {
+  return _internal_has_pooling_param();
 }
-inline void LayerParameter::clear_has_pooling_param() {
+inline void LayerParameter::clear_pooling_param() {
+  if (pooling_param_ != nullptr) pooling_param_->Clear();
   _has_bits_[0] &= ~0x00800000u;
 }
-inline void LayerParameter::clear_pooling_param() {
-  if (pooling_param_ != NULL) pooling_param_->Clear();
-  clear_has_pooling_param();
+inline const ::opencv_caffe::PoolingParameter& LayerParameter::_internal_pooling_param() const {
+  const ::opencv_caffe::PoolingParameter* p = pooling_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PoolingParameter&>(
+      ::opencv_caffe::_PoolingParameter_default_instance_);
 }
 inline const ::opencv_caffe::PoolingParameter& LayerParameter::pooling_param() const {
-  const ::opencv_caffe::PoolingParameter* p = pooling_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.pooling_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PoolingParameter*>(
-      &::opencv_caffe::_PoolingParameter_default_instance_);
+  return _internal_pooling_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_pooling_param(
+    ::opencv_caffe::PoolingParameter* pooling_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(pooling_param_);
+  }
+  pooling_param_ = pooling_param;
+  if (pooling_param) {
+    _has_bits_[0] |= 0x00800000u;
+  } else {
+    _has_bits_[0] &= ~0x00800000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.pooling_param)
 }
 inline ::opencv_caffe::PoolingParameter* LayerParameter::release_pooling_param() {
+  _has_bits_[0] &= ~0x00800000u;
+  ::opencv_caffe::PoolingParameter* temp = pooling_param_;
+  pooling_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PoolingParameter* LayerParameter::unsafe_arena_release_pooling_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.pooling_param)
-  clear_has_pooling_param();
+  _has_bits_[0] &= ~0x00800000u;
   ::opencv_caffe::PoolingParameter* temp = pooling_param_;
-  pooling_param_ = NULL;
+  pooling_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::PoolingParameter* LayerParameter::mutable_pooling_param() {
-  set_has_pooling_param();
-  if (pooling_param_ == NULL) {
-    pooling_param_ = new ::opencv_caffe::PoolingParameter;
+inline ::opencv_caffe::PoolingParameter* LayerParameter::_internal_mutable_pooling_param() {
+  _has_bits_[0] |= 0x00800000u;
+  if (pooling_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PoolingParameter>(GetArenaForAllocation());
+    pooling_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.pooling_param)
   return pooling_param_;
 }
+inline ::opencv_caffe::PoolingParameter* LayerParameter::mutable_pooling_param() {
+  ::opencv_caffe::PoolingParameter* _msg = _internal_mutable_pooling_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.pooling_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_pooling_param(::opencv_caffe::PoolingParameter* pooling_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete pooling_param_;
   }
   if (pooling_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PoolingParameter>::GetOwningArena(pooling_param);
     if (message_arena != submessage_arena) {
-      pooling_param = ::google::protobuf::internal::GetOwnedMessage(
+      pooling_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, pooling_param, submessage_arena);
     }
-    set_has_pooling_param();
+    _has_bits_[0] |= 0x00800000u;
   } else {
-    clear_has_pooling_param();
+    _has_bits_[0] &= ~0x00800000u;
   }
   pooling_param_ = pooling_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.pooling_param)
 }
 
 // optional .opencv_caffe.PowerParameter power_param = 122;
-inline bool LayerParameter::has_power_param() const {
-  return (_has_bits_[0] & 0x01000000u) != 0;
+inline bool LayerParameter::_internal_has_power_param() const {
+  bool value = (_has_bits_[0] & 0x01000000u) != 0;
+  PROTOBUF_ASSUME(!value || power_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_power_param() {
-  _has_bits_[0] |= 0x01000000u;
+inline bool LayerParameter::has_power_param() const {
+  return _internal_has_power_param();
 }
-inline void LayerParameter::clear_has_power_param() {
+inline void LayerParameter::clear_power_param() {
+  if (power_param_ != nullptr) power_param_->Clear();
   _has_bits_[0] &= ~0x01000000u;
 }
-inline void LayerParameter::clear_power_param() {
-  if (power_param_ != NULL) power_param_->Clear();
-  clear_has_power_param();
+inline const ::opencv_caffe::PowerParameter& LayerParameter::_internal_power_param() const {
+  const ::opencv_caffe::PowerParameter* p = power_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PowerParameter&>(
+      ::opencv_caffe::_PowerParameter_default_instance_);
 }
 inline const ::opencv_caffe::PowerParameter& LayerParameter::power_param() const {
-  const ::opencv_caffe::PowerParameter* p = power_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.power_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PowerParameter*>(
-      &::opencv_caffe::_PowerParameter_default_instance_);
+  return _internal_power_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_power_param(
+    ::opencv_caffe::PowerParameter* power_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(power_param_);
+  }
+  power_param_ = power_param;
+  if (power_param) {
+    _has_bits_[0] |= 0x01000000u;
+  } else {
+    _has_bits_[0] &= ~0x01000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.power_param)
 }
 inline ::opencv_caffe::PowerParameter* LayerParameter::release_power_param() {
+  _has_bits_[0] &= ~0x01000000u;
+  ::opencv_caffe::PowerParameter* temp = power_param_;
+  power_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PowerParameter* LayerParameter::unsafe_arena_release_power_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.power_param)
-  clear_has_power_param();
+  _has_bits_[0] &= ~0x01000000u;
   ::opencv_caffe::PowerParameter* temp = power_param_;
-  power_param_ = NULL;
+  power_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::PowerParameter* LayerParameter::mutable_power_param() {
-  set_has_power_param();
-  if (power_param_ == NULL) {
-    power_param_ = new ::opencv_caffe::PowerParameter;
+inline ::opencv_caffe::PowerParameter* LayerParameter::_internal_mutable_power_param() {
+  _has_bits_[0] |= 0x01000000u;
+  if (power_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PowerParameter>(GetArenaForAllocation());
+    power_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.power_param)
   return power_param_;
 }
+inline ::opencv_caffe::PowerParameter* LayerParameter::mutable_power_param() {
+  ::opencv_caffe::PowerParameter* _msg = _internal_mutable_power_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.power_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_power_param(::opencv_caffe::PowerParameter* power_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete power_param_;
   }
   if (power_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PowerParameter>::GetOwningArena(power_param);
     if (message_arena != submessage_arena) {
-      power_param = ::google::protobuf::internal::GetOwnedMessage(
+      power_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, power_param, submessage_arena);
     }
-    set_has_power_param();
+    _has_bits_[0] |= 0x01000000u;
   } else {
-    clear_has_power_param();
+    _has_bits_[0] &= ~0x01000000u;
   }
   power_param_ = power_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.power_param)
 }
 
 // optional .opencv_caffe.PReLUParameter prelu_param = 131;
-inline bool LayerParameter::has_prelu_param() const {
-  return (_has_bits_[1] & 0x00000002u) != 0;
+inline bool LayerParameter::_internal_has_prelu_param() const {
+  bool value = (_has_bits_[1] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || prelu_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_prelu_param() {
-  _has_bits_[1] |= 0x00000002u;
+inline bool LayerParameter::has_prelu_param() const {
+  return _internal_has_prelu_param();
 }
-inline void LayerParameter::clear_has_prelu_param() {
+inline void LayerParameter::clear_prelu_param() {
+  if (prelu_param_ != nullptr) prelu_param_->Clear();
   _has_bits_[1] &= ~0x00000002u;
 }
-inline void LayerParameter::clear_prelu_param() {
-  if (prelu_param_ != NULL) prelu_param_->Clear();
-  clear_has_prelu_param();
+inline const ::opencv_caffe::PReLUParameter& LayerParameter::_internal_prelu_param() const {
+  const ::opencv_caffe::PReLUParameter* p = prelu_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PReLUParameter&>(
+      ::opencv_caffe::_PReLUParameter_default_instance_);
 }
 inline const ::opencv_caffe::PReLUParameter& LayerParameter::prelu_param() const {
-  const ::opencv_caffe::PReLUParameter* p = prelu_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.prelu_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PReLUParameter*>(
-      &::opencv_caffe::_PReLUParameter_default_instance_);
+  return _internal_prelu_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_prelu_param(
+    ::opencv_caffe::PReLUParameter* prelu_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(prelu_param_);
+  }
+  prelu_param_ = prelu_param;
+  if (prelu_param) {
+    _has_bits_[1] |= 0x00000002u;
+  } else {
+    _has_bits_[1] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.prelu_param)
 }
 inline ::opencv_caffe::PReLUParameter* LayerParameter::release_prelu_param() {
+  _has_bits_[1] &= ~0x00000002u;
+  ::opencv_caffe::PReLUParameter* temp = prelu_param_;
+  prelu_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PReLUParameter* LayerParameter::unsafe_arena_release_prelu_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.prelu_param)
-  clear_has_prelu_param();
+  _has_bits_[1] &= ~0x00000002u;
   ::opencv_caffe::PReLUParameter* temp = prelu_param_;
-  prelu_param_ = NULL;
+  prelu_param_ = nullptr;
   return temp;
 }
+inline ::opencv_caffe::PReLUParameter* LayerParameter::_internal_mutable_prelu_param() {
+  _has_bits_[1] |= 0x00000002u;
+  if (prelu_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PReLUParameter>(GetArenaForAllocation());
+    prelu_param_ = p;
+  }
+  return prelu_param_;
+}
 inline ::opencv_caffe::PReLUParameter* LayerParameter::mutable_prelu_param() {
-  set_has_prelu_param();
-  if (prelu_param_ == NULL) {
-    prelu_param_ = new ::opencv_caffe::PReLUParameter;
-  }
+  ::opencv_caffe::PReLUParameter* _msg = _internal_mutable_prelu_param();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.prelu_param)
-  return prelu_param_;
+  return _msg;
 }
 inline void LayerParameter::set_allocated_prelu_param(::opencv_caffe::PReLUParameter* prelu_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete prelu_param_;
   }
   if (prelu_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PReLUParameter>::GetOwningArena(prelu_param);
     if (message_arena != submessage_arena) {
-      prelu_param = ::google::protobuf::internal::GetOwnedMessage(
+      prelu_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, prelu_param, submessage_arena);
     }
-    set_has_prelu_param();
+    _has_bits_[1] |= 0x00000002u;
   } else {
-    clear_has_prelu_param();
+    _has_bits_[1] &= ~0x00000002u;
   }
   prelu_param_ = prelu_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.prelu_param)
 }
 
 // optional .opencv_caffe.PriorBoxParameter prior_box_param = 150;
-inline bool LayerParameter::has_prior_box_param() const {
-  return (_has_bits_[1] & 0x00100000u) != 0;
+inline bool LayerParameter::_internal_has_prior_box_param() const {
+  bool value = (_has_bits_[1] & 0x00100000u) != 0;
+  PROTOBUF_ASSUME(!value || prior_box_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_prior_box_param() {
-  _has_bits_[1] |= 0x00100000u;
+inline bool LayerParameter::has_prior_box_param() const {
+  return _internal_has_prior_box_param();
 }
-inline void LayerParameter::clear_has_prior_box_param() {
+inline void LayerParameter::clear_prior_box_param() {
+  if (prior_box_param_ != nullptr) prior_box_param_->Clear();
   _has_bits_[1] &= ~0x00100000u;
 }
-inline void LayerParameter::clear_prior_box_param() {
-  if (prior_box_param_ != NULL) prior_box_param_->Clear();
-  clear_has_prior_box_param();
+inline const ::opencv_caffe::PriorBoxParameter& LayerParameter::_internal_prior_box_param() const {
+  const ::opencv_caffe::PriorBoxParameter* p = prior_box_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PriorBoxParameter&>(
+      ::opencv_caffe::_PriorBoxParameter_default_instance_);
 }
 inline const ::opencv_caffe::PriorBoxParameter& LayerParameter::prior_box_param() const {
-  const ::opencv_caffe::PriorBoxParameter* p = prior_box_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.prior_box_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PriorBoxParameter*>(
-      &::opencv_caffe::_PriorBoxParameter_default_instance_);
+  return _internal_prior_box_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_prior_box_param(
+    ::opencv_caffe::PriorBoxParameter* prior_box_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(prior_box_param_);
+  }
+  prior_box_param_ = prior_box_param;
+  if (prior_box_param) {
+    _has_bits_[1] |= 0x00100000u;
+  } else {
+    _has_bits_[1] &= ~0x00100000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.prior_box_param)
 }
 inline ::opencv_caffe::PriorBoxParameter* LayerParameter::release_prior_box_param() {
+  _has_bits_[1] &= ~0x00100000u;
+  ::opencv_caffe::PriorBoxParameter* temp = prior_box_param_;
+  prior_box_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PriorBoxParameter* LayerParameter::unsafe_arena_release_prior_box_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.prior_box_param)
-  clear_has_prior_box_param();
+  _has_bits_[1] &= ~0x00100000u;
   ::opencv_caffe::PriorBoxParameter* temp = prior_box_param_;
-  prior_box_param_ = NULL;
+  prior_box_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::PriorBoxParameter* LayerParameter::mutable_prior_box_param() {
-  set_has_prior_box_param();
-  if (prior_box_param_ == NULL) {
-    prior_box_param_ = new ::opencv_caffe::PriorBoxParameter;
+inline ::opencv_caffe::PriorBoxParameter* LayerParameter::_internal_mutable_prior_box_param() {
+  _has_bits_[1] |= 0x00100000u;
+  if (prior_box_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PriorBoxParameter>(GetArenaForAllocation());
+    prior_box_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.prior_box_param)
   return prior_box_param_;
 }
+inline ::opencv_caffe::PriorBoxParameter* LayerParameter::mutable_prior_box_param() {
+  ::opencv_caffe::PriorBoxParameter* _msg = _internal_mutable_prior_box_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.prior_box_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_prior_box_param(::opencv_caffe::PriorBoxParameter* prior_box_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete prior_box_param_;
   }
   if (prior_box_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PriorBoxParameter>::GetOwningArena(prior_box_param);
     if (message_arena != submessage_arena) {
-      prior_box_param = ::google::protobuf::internal::GetOwnedMessage(
+      prior_box_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, prior_box_param, submessage_arena);
     }
-    set_has_prior_box_param();
+    _has_bits_[1] |= 0x00100000u;
   } else {
-    clear_has_prior_box_param();
+    _has_bits_[1] &= ~0x00100000u;
   }
   prior_box_param_ = prior_box_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.prior_box_param)
 }
 
 // optional .opencv_caffe.ProposalParameter proposal_param = 201;
-inline bool LayerParameter::has_proposal_param() const {
-  return (_has_bits_[1] & 0x00200000u) != 0;
+inline bool LayerParameter::_internal_has_proposal_param() const {
+  bool value = (_has_bits_[1] & 0x00200000u) != 0;
+  PROTOBUF_ASSUME(!value || proposal_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_proposal_param() {
-  _has_bits_[1] |= 0x00200000u;
+inline bool LayerParameter::has_proposal_param() const {
+  return _internal_has_proposal_param();
 }
-inline void LayerParameter::clear_has_proposal_param() {
+inline void LayerParameter::clear_proposal_param() {
+  if (proposal_param_ != nullptr) proposal_param_->Clear();
   _has_bits_[1] &= ~0x00200000u;
 }
-inline void LayerParameter::clear_proposal_param() {
-  if (proposal_param_ != NULL) proposal_param_->Clear();
-  clear_has_proposal_param();
+inline const ::opencv_caffe::ProposalParameter& LayerParameter::_internal_proposal_param() const {
+  const ::opencv_caffe::ProposalParameter* p = proposal_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ProposalParameter&>(
+      ::opencv_caffe::_ProposalParameter_default_instance_);
 }
 inline const ::opencv_caffe::ProposalParameter& LayerParameter::proposal_param() const {
-  const ::opencv_caffe::ProposalParameter* p = proposal_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.proposal_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ProposalParameter*>(
-      &::opencv_caffe::_ProposalParameter_default_instance_);
+  return _internal_proposal_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_proposal_param(
+    ::opencv_caffe::ProposalParameter* proposal_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(proposal_param_);
+  }
+  proposal_param_ = proposal_param;
+  if (proposal_param) {
+    _has_bits_[1] |= 0x00200000u;
+  } else {
+    _has_bits_[1] &= ~0x00200000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.proposal_param)
 }
 inline ::opencv_caffe::ProposalParameter* LayerParameter::release_proposal_param() {
+  _has_bits_[1] &= ~0x00200000u;
+  ::opencv_caffe::ProposalParameter* temp = proposal_param_;
+  proposal_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ProposalParameter* LayerParameter::unsafe_arena_release_proposal_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.proposal_param)
-  clear_has_proposal_param();
+  _has_bits_[1] &= ~0x00200000u;
   ::opencv_caffe::ProposalParameter* temp = proposal_param_;
-  proposal_param_ = NULL;
+  proposal_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ProposalParameter* LayerParameter::mutable_proposal_param() {
-  set_has_proposal_param();
-  if (proposal_param_ == NULL) {
-    proposal_param_ = new ::opencv_caffe::ProposalParameter;
+inline ::opencv_caffe::ProposalParameter* LayerParameter::_internal_mutable_proposal_param() {
+  _has_bits_[1] |= 0x00200000u;
+  if (proposal_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ProposalParameter>(GetArenaForAllocation());
+    proposal_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.proposal_param)
   return proposal_param_;
 }
+inline ::opencv_caffe::ProposalParameter* LayerParameter::mutable_proposal_param() {
+  ::opencv_caffe::ProposalParameter* _msg = _internal_mutable_proposal_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.proposal_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_proposal_param(::opencv_caffe::ProposalParameter* proposal_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete proposal_param_;
   }
   if (proposal_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ProposalParameter>::GetOwningArena(proposal_param);
     if (message_arena != submessage_arena) {
-      proposal_param = ::google::protobuf::internal::GetOwnedMessage(
+      proposal_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, proposal_param, submessage_arena);
     }
-    set_has_proposal_param();
+    _has_bits_[1] |= 0x00200000u;
   } else {
-    clear_has_proposal_param();
+    _has_bits_[1] &= ~0x00200000u;
   }
   proposal_param_ = proposal_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.proposal_param)
 }
 
 // optional .opencv_caffe.PSROIPoolingParameter psroi_pooling_param = 10002;
-inline bool LayerParameter::has_psroi_pooling_param() const {
-  return (_has_bits_[1] & 0x00400000u) != 0;
+inline bool LayerParameter::_internal_has_psroi_pooling_param() const {
+  bool value = (_has_bits_[1] & 0x00400000u) != 0;
+  PROTOBUF_ASSUME(!value || psroi_pooling_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_psroi_pooling_param() {
-  _has_bits_[1] |= 0x00400000u;
+inline bool LayerParameter::has_psroi_pooling_param() const {
+  return _internal_has_psroi_pooling_param();
 }
-inline void LayerParameter::clear_has_psroi_pooling_param() {
+inline void LayerParameter::clear_psroi_pooling_param() {
+  if (psroi_pooling_param_ != nullptr) psroi_pooling_param_->Clear();
   _has_bits_[1] &= ~0x00400000u;
 }
-inline void LayerParameter::clear_psroi_pooling_param() {
-  if (psroi_pooling_param_ != NULL) psroi_pooling_param_->Clear();
-  clear_has_psroi_pooling_param();
+inline const ::opencv_caffe::PSROIPoolingParameter& LayerParameter::_internal_psroi_pooling_param() const {
+  const ::opencv_caffe::PSROIPoolingParameter* p = psroi_pooling_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PSROIPoolingParameter&>(
+      ::opencv_caffe::_PSROIPoolingParameter_default_instance_);
 }
 inline const ::opencv_caffe::PSROIPoolingParameter& LayerParameter::psroi_pooling_param() const {
-  const ::opencv_caffe::PSROIPoolingParameter* p = psroi_pooling_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.psroi_pooling_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PSROIPoolingParameter*>(
-      &::opencv_caffe::_PSROIPoolingParameter_default_instance_);
+  return _internal_psroi_pooling_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_psroi_pooling_param(
+    ::opencv_caffe::PSROIPoolingParameter* psroi_pooling_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(psroi_pooling_param_);
+  }
+  psroi_pooling_param_ = psroi_pooling_param;
+  if (psroi_pooling_param) {
+    _has_bits_[1] |= 0x00400000u;
+  } else {
+    _has_bits_[1] &= ~0x00400000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.psroi_pooling_param)
 }
 inline ::opencv_caffe::PSROIPoolingParameter* LayerParameter::release_psroi_pooling_param() {
+  _has_bits_[1] &= ~0x00400000u;
+  ::opencv_caffe::PSROIPoolingParameter* temp = psroi_pooling_param_;
+  psroi_pooling_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PSROIPoolingParameter* LayerParameter::unsafe_arena_release_psroi_pooling_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.psroi_pooling_param)
-  clear_has_psroi_pooling_param();
+  _has_bits_[1] &= ~0x00400000u;
   ::opencv_caffe::PSROIPoolingParameter* temp = psroi_pooling_param_;
-  psroi_pooling_param_ = NULL;
+  psroi_pooling_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::PSROIPoolingParameter* LayerParameter::mutable_psroi_pooling_param() {
-  set_has_psroi_pooling_param();
-  if (psroi_pooling_param_ == NULL) {
-    psroi_pooling_param_ = new ::opencv_caffe::PSROIPoolingParameter;
+inline ::opencv_caffe::PSROIPoolingParameter* LayerParameter::_internal_mutable_psroi_pooling_param() {
+  _has_bits_[1] |= 0x00400000u;
+  if (psroi_pooling_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PSROIPoolingParameter>(GetArenaForAllocation());
+    psroi_pooling_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.psroi_pooling_param)
   return psroi_pooling_param_;
 }
+inline ::opencv_caffe::PSROIPoolingParameter* LayerParameter::mutable_psroi_pooling_param() {
+  ::opencv_caffe::PSROIPoolingParameter* _msg = _internal_mutable_psroi_pooling_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.psroi_pooling_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_psroi_pooling_param(::opencv_caffe::PSROIPoolingParameter* psroi_pooling_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete psroi_pooling_param_;
   }
   if (psroi_pooling_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PSROIPoolingParameter>::GetOwningArena(psroi_pooling_param);
     if (message_arena != submessage_arena) {
-      psroi_pooling_param = ::google::protobuf::internal::GetOwnedMessage(
+      psroi_pooling_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, psroi_pooling_param, submessage_arena);
     }
-    set_has_psroi_pooling_param();
+    _has_bits_[1] |= 0x00400000u;
   } else {
-    clear_has_psroi_pooling_param();
+    _has_bits_[1] &= ~0x00400000u;
   }
   psroi_pooling_param_ = psroi_pooling_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.psroi_pooling_param)
 }
 
 // optional .opencv_caffe.PythonParameter python_param = 130;
-inline bool LayerParameter::has_python_param() const {
-  return (_has_bits_[1] & 0x00000001u) != 0;
+inline bool LayerParameter::_internal_has_python_param() const {
+  bool value = (_has_bits_[1] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || python_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_python_param() {
-  _has_bits_[1] |= 0x00000001u;
+inline bool LayerParameter::has_python_param() const {
+  return _internal_has_python_param();
 }
-inline void LayerParameter::clear_has_python_param() {
+inline void LayerParameter::clear_python_param() {
+  if (python_param_ != nullptr) python_param_->Clear();
   _has_bits_[1] &= ~0x00000001u;
 }
-inline void LayerParameter::clear_python_param() {
-  if (python_param_ != NULL) python_param_->Clear();
-  clear_has_python_param();
+inline const ::opencv_caffe::PythonParameter& LayerParameter::_internal_python_param() const {
+  const ::opencv_caffe::PythonParameter* p = python_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PythonParameter&>(
+      ::opencv_caffe::_PythonParameter_default_instance_);
 }
 inline const ::opencv_caffe::PythonParameter& LayerParameter::python_param() const {
-  const ::opencv_caffe::PythonParameter* p = python_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.python_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PythonParameter*>(
-      &::opencv_caffe::_PythonParameter_default_instance_);
+  return _internal_python_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_python_param(
+    ::opencv_caffe::PythonParameter* python_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(python_param_);
+  }
+  python_param_ = python_param;
+  if (python_param) {
+    _has_bits_[1] |= 0x00000001u;
+  } else {
+    _has_bits_[1] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.python_param)
 }
 inline ::opencv_caffe::PythonParameter* LayerParameter::release_python_param() {
+  _has_bits_[1] &= ~0x00000001u;
+  ::opencv_caffe::PythonParameter* temp = python_param_;
+  python_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PythonParameter* LayerParameter::unsafe_arena_release_python_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.python_param)
-  clear_has_python_param();
+  _has_bits_[1] &= ~0x00000001u;
   ::opencv_caffe::PythonParameter* temp = python_param_;
-  python_param_ = NULL;
+  python_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::PythonParameter* LayerParameter::mutable_python_param() {
-  set_has_python_param();
-  if (python_param_ == NULL) {
-    python_param_ = new ::opencv_caffe::PythonParameter;
+inline ::opencv_caffe::PythonParameter* LayerParameter::_internal_mutable_python_param() {
+  _has_bits_[1] |= 0x00000001u;
+  if (python_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PythonParameter>(GetArenaForAllocation());
+    python_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.python_param)
   return python_param_;
 }
+inline ::opencv_caffe::PythonParameter* LayerParameter::mutable_python_param() {
+  ::opencv_caffe::PythonParameter* _msg = _internal_mutable_python_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.python_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_python_param(::opencv_caffe::PythonParameter* python_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete python_param_;
   }
   if (python_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PythonParameter>::GetOwningArena(python_param);
     if (message_arena != submessage_arena) {
-      python_param = ::google::protobuf::internal::GetOwnedMessage(
+      python_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, python_param, submessage_arena);
     }
-    set_has_python_param();
+    _has_bits_[1] |= 0x00000001u;
   } else {
-    clear_has_python_param();
+    _has_bits_[1] &= ~0x00000001u;
   }
   python_param_ = python_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.python_param)
 }
 
 // optional .opencv_caffe.RecurrentParameter recurrent_param = 146;
-inline bool LayerParameter::has_recurrent_param() const {
-  return (_has_bits_[1] & 0x00010000u) != 0;
+inline bool LayerParameter::_internal_has_recurrent_param() const {
+  bool value = (_has_bits_[1] & 0x00010000u) != 0;
+  PROTOBUF_ASSUME(!value || recurrent_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_recurrent_param() {
-  _has_bits_[1] |= 0x00010000u;
+inline bool LayerParameter::has_recurrent_param() const {
+  return _internal_has_recurrent_param();
 }
-inline void LayerParameter::clear_has_recurrent_param() {
+inline void LayerParameter::clear_recurrent_param() {
+  if (recurrent_param_ != nullptr) recurrent_param_->Clear();
   _has_bits_[1] &= ~0x00010000u;
 }
-inline void LayerParameter::clear_recurrent_param() {
-  if (recurrent_param_ != NULL) recurrent_param_->Clear();
-  clear_has_recurrent_param();
+inline const ::opencv_caffe::RecurrentParameter& LayerParameter::_internal_recurrent_param() const {
+  const ::opencv_caffe::RecurrentParameter* p = recurrent_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::RecurrentParameter&>(
+      ::opencv_caffe::_RecurrentParameter_default_instance_);
 }
 inline const ::opencv_caffe::RecurrentParameter& LayerParameter::recurrent_param() const {
-  const ::opencv_caffe::RecurrentParameter* p = recurrent_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.recurrent_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::RecurrentParameter*>(
-      &::opencv_caffe::_RecurrentParameter_default_instance_);
+  return _internal_recurrent_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_recurrent_param(
+    ::opencv_caffe::RecurrentParameter* recurrent_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(recurrent_param_);
+  }
+  recurrent_param_ = recurrent_param;
+  if (recurrent_param) {
+    _has_bits_[1] |= 0x00010000u;
+  } else {
+    _has_bits_[1] &= ~0x00010000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.recurrent_param)
 }
 inline ::opencv_caffe::RecurrentParameter* LayerParameter::release_recurrent_param() {
+  _has_bits_[1] &= ~0x00010000u;
+  ::opencv_caffe::RecurrentParameter* temp = recurrent_param_;
+  recurrent_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::RecurrentParameter* LayerParameter::unsafe_arena_release_recurrent_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.recurrent_param)
-  clear_has_recurrent_param();
+  _has_bits_[1] &= ~0x00010000u;
   ::opencv_caffe::RecurrentParameter* temp = recurrent_param_;
-  recurrent_param_ = NULL;
+  recurrent_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::RecurrentParameter* LayerParameter::mutable_recurrent_param() {
-  set_has_recurrent_param();
-  if (recurrent_param_ == NULL) {
-    recurrent_param_ = new ::opencv_caffe::RecurrentParameter;
+inline ::opencv_caffe::RecurrentParameter* LayerParameter::_internal_mutable_recurrent_param() {
+  _has_bits_[1] |= 0x00010000u;
+  if (recurrent_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::RecurrentParameter>(GetArenaForAllocation());
+    recurrent_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.recurrent_param)
   return recurrent_param_;
 }
+inline ::opencv_caffe::RecurrentParameter* LayerParameter::mutable_recurrent_param() {
+  ::opencv_caffe::RecurrentParameter* _msg = _internal_mutable_recurrent_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.recurrent_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_recurrent_param(::opencv_caffe::RecurrentParameter* recurrent_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete recurrent_param_;
   }
   if (recurrent_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::RecurrentParameter>::GetOwningArena(recurrent_param);
     if (message_arena != submessage_arena) {
-      recurrent_param = ::google::protobuf::internal::GetOwnedMessage(
+      recurrent_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, recurrent_param, submessage_arena);
     }
-    set_has_recurrent_param();
+    _has_bits_[1] |= 0x00010000u;
   } else {
-    clear_has_recurrent_param();
+    _has_bits_[1] &= ~0x00010000u;
   }
   recurrent_param_ = recurrent_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.recurrent_param)
 }
 
 // optional .opencv_caffe.ReductionParameter reduction_param = 136;
-inline bool LayerParameter::has_reduction_param() const {
-  return (_has_bits_[1] & 0x00000040u) != 0;
+inline bool LayerParameter::_internal_has_reduction_param() const {
+  bool value = (_has_bits_[1] & 0x00000040u) != 0;
+  PROTOBUF_ASSUME(!value || reduction_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_reduction_param() {
-  _has_bits_[1] |= 0x00000040u;
+inline bool LayerParameter::has_reduction_param() const {
+  return _internal_has_reduction_param();
 }
-inline void LayerParameter::clear_has_reduction_param() {
+inline void LayerParameter::clear_reduction_param() {
+  if (reduction_param_ != nullptr) reduction_param_->Clear();
   _has_bits_[1] &= ~0x00000040u;
 }
-inline void LayerParameter::clear_reduction_param() {
-  if (reduction_param_ != NULL) reduction_param_->Clear();
-  clear_has_reduction_param();
+inline const ::opencv_caffe::ReductionParameter& LayerParameter::_internal_reduction_param() const {
+  const ::opencv_caffe::ReductionParameter* p = reduction_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ReductionParameter&>(
+      ::opencv_caffe::_ReductionParameter_default_instance_);
 }
 inline const ::opencv_caffe::ReductionParameter& LayerParameter::reduction_param() const {
-  const ::opencv_caffe::ReductionParameter* p = reduction_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.reduction_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ReductionParameter*>(
-      &::opencv_caffe::_ReductionParameter_default_instance_);
+  return _internal_reduction_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_reduction_param(
+    ::opencv_caffe::ReductionParameter* reduction_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(reduction_param_);
+  }
+  reduction_param_ = reduction_param;
+  if (reduction_param) {
+    _has_bits_[1] |= 0x00000040u;
+  } else {
+    _has_bits_[1] &= ~0x00000040u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.reduction_param)
 }
 inline ::opencv_caffe::ReductionParameter* LayerParameter::release_reduction_param() {
+  _has_bits_[1] &= ~0x00000040u;
+  ::opencv_caffe::ReductionParameter* temp = reduction_param_;
+  reduction_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ReductionParameter* LayerParameter::unsafe_arena_release_reduction_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.reduction_param)
-  clear_has_reduction_param();
+  _has_bits_[1] &= ~0x00000040u;
   ::opencv_caffe::ReductionParameter* temp = reduction_param_;
-  reduction_param_ = NULL;
+  reduction_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ReductionParameter* LayerParameter::mutable_reduction_param() {
-  set_has_reduction_param();
-  if (reduction_param_ == NULL) {
-    reduction_param_ = new ::opencv_caffe::ReductionParameter;
+inline ::opencv_caffe::ReductionParameter* LayerParameter::_internal_mutable_reduction_param() {
+  _has_bits_[1] |= 0x00000040u;
+  if (reduction_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ReductionParameter>(GetArenaForAllocation());
+    reduction_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.reduction_param)
   return reduction_param_;
 }
+inline ::opencv_caffe::ReductionParameter* LayerParameter::mutable_reduction_param() {
+  ::opencv_caffe::ReductionParameter* _msg = _internal_mutable_reduction_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.reduction_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_reduction_param(::opencv_caffe::ReductionParameter* reduction_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete reduction_param_;
   }
   if (reduction_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ReductionParameter>::GetOwningArena(reduction_param);
     if (message_arena != submessage_arena) {
-      reduction_param = ::google::protobuf::internal::GetOwnedMessage(
+      reduction_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, reduction_param, submessage_arena);
     }
-    set_has_reduction_param();
+    _has_bits_[1] |= 0x00000040u;
   } else {
-    clear_has_reduction_param();
+    _has_bits_[1] &= ~0x00000040u;
   }
   reduction_param_ = reduction_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.reduction_param)
 }
 
 // optional .opencv_caffe.ReLUParameter relu_param = 123;
-inline bool LayerParameter::has_relu_param() const {
-  return (_has_bits_[0] & 0x02000000u) != 0;
+inline bool LayerParameter::_internal_has_relu_param() const {
+  bool value = (_has_bits_[0] & 0x02000000u) != 0;
+  PROTOBUF_ASSUME(!value || relu_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_relu_param() {
-  _has_bits_[0] |= 0x02000000u;
+inline bool LayerParameter::has_relu_param() const {
+  return _internal_has_relu_param();
 }
-inline void LayerParameter::clear_has_relu_param() {
+inline void LayerParameter::clear_relu_param() {
+  if (relu_param_ != nullptr) relu_param_->Clear();
   _has_bits_[0] &= ~0x02000000u;
 }
-inline void LayerParameter::clear_relu_param() {
-  if (relu_param_ != NULL) relu_param_->Clear();
-  clear_has_relu_param();
+inline const ::opencv_caffe::ReLUParameter& LayerParameter::_internal_relu_param() const {
+  const ::opencv_caffe::ReLUParameter* p = relu_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ReLUParameter&>(
+      ::opencv_caffe::_ReLUParameter_default_instance_);
 }
 inline const ::opencv_caffe::ReLUParameter& LayerParameter::relu_param() const {
-  const ::opencv_caffe::ReLUParameter* p = relu_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.relu_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ReLUParameter*>(
-      &::opencv_caffe::_ReLUParameter_default_instance_);
+  return _internal_relu_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_relu_param(
+    ::opencv_caffe::ReLUParameter* relu_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(relu_param_);
+  }
+  relu_param_ = relu_param;
+  if (relu_param) {
+    _has_bits_[0] |= 0x02000000u;
+  } else {
+    _has_bits_[0] &= ~0x02000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.relu_param)
 }
 inline ::opencv_caffe::ReLUParameter* LayerParameter::release_relu_param() {
+  _has_bits_[0] &= ~0x02000000u;
+  ::opencv_caffe::ReLUParameter* temp = relu_param_;
+  relu_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ReLUParameter* LayerParameter::unsafe_arena_release_relu_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.relu_param)
-  clear_has_relu_param();
+  _has_bits_[0] &= ~0x02000000u;
   ::opencv_caffe::ReLUParameter* temp = relu_param_;
-  relu_param_ = NULL;
+  relu_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ReLUParameter* LayerParameter::mutable_relu_param() {
-  set_has_relu_param();
-  if (relu_param_ == NULL) {
-    relu_param_ = new ::opencv_caffe::ReLUParameter;
+inline ::opencv_caffe::ReLUParameter* LayerParameter::_internal_mutable_relu_param() {
+  _has_bits_[0] |= 0x02000000u;
+  if (relu_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ReLUParameter>(GetArenaForAllocation());
+    relu_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.relu_param)
   return relu_param_;
 }
+inline ::opencv_caffe::ReLUParameter* LayerParameter::mutable_relu_param() {
+  ::opencv_caffe::ReLUParameter* _msg = _internal_mutable_relu_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.relu_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_relu_param(::opencv_caffe::ReLUParameter* relu_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete relu_param_;
   }
   if (relu_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ReLUParameter>::GetOwningArena(relu_param);
     if (message_arena != submessage_arena) {
-      relu_param = ::google::protobuf::internal::GetOwnedMessage(
+      relu_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, relu_param, submessage_arena);
     }
-    set_has_relu_param();
+    _has_bits_[0] |= 0x02000000u;
   } else {
-    clear_has_relu_param();
+    _has_bits_[0] &= ~0x02000000u;
   }
   relu_param_ = relu_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.relu_param)
 }
 
 // optional .opencv_caffe.ReshapeParameter reshape_param = 133;
-inline bool LayerParameter::has_reshape_param() const {
-  return (_has_bits_[1] & 0x00000008u) != 0;
+inline bool LayerParameter::_internal_has_reshape_param() const {
+  bool value = (_has_bits_[1] & 0x00000008u) != 0;
+  PROTOBUF_ASSUME(!value || reshape_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_reshape_param() {
-  _has_bits_[1] |= 0x00000008u;
+inline bool LayerParameter::has_reshape_param() const {
+  return _internal_has_reshape_param();
 }
-inline void LayerParameter::clear_has_reshape_param() {
+inline void LayerParameter::clear_reshape_param() {
+  if (reshape_param_ != nullptr) reshape_param_->Clear();
   _has_bits_[1] &= ~0x00000008u;
 }
-inline void LayerParameter::clear_reshape_param() {
-  if (reshape_param_ != NULL) reshape_param_->Clear();
-  clear_has_reshape_param();
+inline const ::opencv_caffe::ReshapeParameter& LayerParameter::_internal_reshape_param() const {
+  const ::opencv_caffe::ReshapeParameter* p = reshape_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ReshapeParameter&>(
+      ::opencv_caffe::_ReshapeParameter_default_instance_);
 }
 inline const ::opencv_caffe::ReshapeParameter& LayerParameter::reshape_param() const {
-  const ::opencv_caffe::ReshapeParameter* p = reshape_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.reshape_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ReshapeParameter*>(
-      &::opencv_caffe::_ReshapeParameter_default_instance_);
+  return _internal_reshape_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_reshape_param(
+    ::opencv_caffe::ReshapeParameter* reshape_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(reshape_param_);
+  }
+  reshape_param_ = reshape_param;
+  if (reshape_param) {
+    _has_bits_[1] |= 0x00000008u;
+  } else {
+    _has_bits_[1] &= ~0x00000008u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.reshape_param)
 }
 inline ::opencv_caffe::ReshapeParameter* LayerParameter::release_reshape_param() {
+  _has_bits_[1] &= ~0x00000008u;
+  ::opencv_caffe::ReshapeParameter* temp = reshape_param_;
+  reshape_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ReshapeParameter* LayerParameter::unsafe_arena_release_reshape_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.reshape_param)
-  clear_has_reshape_param();
+  _has_bits_[1] &= ~0x00000008u;
   ::opencv_caffe::ReshapeParameter* temp = reshape_param_;
-  reshape_param_ = NULL;
+  reshape_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ReshapeParameter* LayerParameter::mutable_reshape_param() {
-  set_has_reshape_param();
-  if (reshape_param_ == NULL) {
-    reshape_param_ = new ::opencv_caffe::ReshapeParameter;
+inline ::opencv_caffe::ReshapeParameter* LayerParameter::_internal_mutable_reshape_param() {
+  _has_bits_[1] |= 0x00000008u;
+  if (reshape_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ReshapeParameter>(GetArenaForAllocation());
+    reshape_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.reshape_param)
   return reshape_param_;
 }
+inline ::opencv_caffe::ReshapeParameter* LayerParameter::mutable_reshape_param() {
+  ::opencv_caffe::ReshapeParameter* _msg = _internal_mutable_reshape_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.reshape_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_reshape_param(::opencv_caffe::ReshapeParameter* reshape_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete reshape_param_;
   }
   if (reshape_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ReshapeParameter>::GetOwningArena(reshape_param);
     if (message_arena != submessage_arena) {
-      reshape_param = ::google::protobuf::internal::GetOwnedMessage(
+      reshape_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, reshape_param, submessage_arena);
     }
-    set_has_reshape_param();
+    _has_bits_[1] |= 0x00000008u;
   } else {
-    clear_has_reshape_param();
+    _has_bits_[1] &= ~0x00000008u;
   }
   reshape_param_ = reshape_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.reshape_param)
 }
 
 // optional .opencv_caffe.ROIPoolingParameter roi_pooling_param = 8266711;
-inline bool LayerParameter::has_roi_pooling_param() const {
-  return (_has_bits_[1] & 0x00800000u) != 0;
+inline bool LayerParameter::_internal_has_roi_pooling_param() const {
+  bool value = (_has_bits_[1] & 0x00800000u) != 0;
+  PROTOBUF_ASSUME(!value || roi_pooling_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_roi_pooling_param() {
-  _has_bits_[1] |= 0x00800000u;
+inline bool LayerParameter::has_roi_pooling_param() const {
+  return _internal_has_roi_pooling_param();
 }
-inline void LayerParameter::clear_has_roi_pooling_param() {
+inline void LayerParameter::clear_roi_pooling_param() {
+  if (roi_pooling_param_ != nullptr) roi_pooling_param_->Clear();
   _has_bits_[1] &= ~0x00800000u;
 }
-inline void LayerParameter::clear_roi_pooling_param() {
-  if (roi_pooling_param_ != NULL) roi_pooling_param_->Clear();
-  clear_has_roi_pooling_param();
+inline const ::opencv_caffe::ROIPoolingParameter& LayerParameter::_internal_roi_pooling_param() const {
+  const ::opencv_caffe::ROIPoolingParameter* p = roi_pooling_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ROIPoolingParameter&>(
+      ::opencv_caffe::_ROIPoolingParameter_default_instance_);
 }
 inline const ::opencv_caffe::ROIPoolingParameter& LayerParameter::roi_pooling_param() const {
-  const ::opencv_caffe::ROIPoolingParameter* p = roi_pooling_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.roi_pooling_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ROIPoolingParameter*>(
-      &::opencv_caffe::_ROIPoolingParameter_default_instance_);
+  return _internal_roi_pooling_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_roi_pooling_param(
+    ::opencv_caffe::ROIPoolingParameter* roi_pooling_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(roi_pooling_param_);
+  }
+  roi_pooling_param_ = roi_pooling_param;
+  if (roi_pooling_param) {
+    _has_bits_[1] |= 0x00800000u;
+  } else {
+    _has_bits_[1] &= ~0x00800000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.roi_pooling_param)
 }
 inline ::opencv_caffe::ROIPoolingParameter* LayerParameter::release_roi_pooling_param() {
+  _has_bits_[1] &= ~0x00800000u;
+  ::opencv_caffe::ROIPoolingParameter* temp = roi_pooling_param_;
+  roi_pooling_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ROIPoolingParameter* LayerParameter::unsafe_arena_release_roi_pooling_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.roi_pooling_param)
-  clear_has_roi_pooling_param();
+  _has_bits_[1] &= ~0x00800000u;
   ::opencv_caffe::ROIPoolingParameter* temp = roi_pooling_param_;
-  roi_pooling_param_ = NULL;
+  roi_pooling_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ROIPoolingParameter* LayerParameter::mutable_roi_pooling_param() {
-  set_has_roi_pooling_param();
-  if (roi_pooling_param_ == NULL) {
-    roi_pooling_param_ = new ::opencv_caffe::ROIPoolingParameter;
+inline ::opencv_caffe::ROIPoolingParameter* LayerParameter::_internal_mutable_roi_pooling_param() {
+  _has_bits_[1] |= 0x00800000u;
+  if (roi_pooling_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ROIPoolingParameter>(GetArenaForAllocation());
+    roi_pooling_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.roi_pooling_param)
   return roi_pooling_param_;
 }
+inline ::opencv_caffe::ROIPoolingParameter* LayerParameter::mutable_roi_pooling_param() {
+  ::opencv_caffe::ROIPoolingParameter* _msg = _internal_mutable_roi_pooling_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.roi_pooling_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_roi_pooling_param(::opencv_caffe::ROIPoolingParameter* roi_pooling_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete roi_pooling_param_;
   }
   if (roi_pooling_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ROIPoolingParameter>::GetOwningArena(roi_pooling_param);
     if (message_arena != submessage_arena) {
-      roi_pooling_param = ::google::protobuf::internal::GetOwnedMessage(
+      roi_pooling_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, roi_pooling_param, submessage_arena);
     }
-    set_has_roi_pooling_param();
+    _has_bits_[1] |= 0x00800000u;
   } else {
-    clear_has_roi_pooling_param();
+    _has_bits_[1] &= ~0x00800000u;
   }
   roi_pooling_param_ = roi_pooling_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.roi_pooling_param)
 }
 
 // optional .opencv_caffe.ScaleParameter scale_param = 142;
-inline bool LayerParameter::has_scale_param() const {
-  return (_has_bits_[1] & 0x00001000u) != 0;
+inline bool LayerParameter::_internal_has_scale_param() const {
+  bool value = (_has_bits_[1] & 0x00001000u) != 0;
+  PROTOBUF_ASSUME(!value || scale_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_scale_param() {
-  _has_bits_[1] |= 0x00001000u;
+inline bool LayerParameter::has_scale_param() const {
+  return _internal_has_scale_param();
 }
-inline void LayerParameter::clear_has_scale_param() {
+inline void LayerParameter::clear_scale_param() {
+  if (scale_param_ != nullptr) scale_param_->Clear();
   _has_bits_[1] &= ~0x00001000u;
 }
-inline void LayerParameter::clear_scale_param() {
-  if (scale_param_ != NULL) scale_param_->Clear();
-  clear_has_scale_param();
+inline const ::opencv_caffe::ScaleParameter& LayerParameter::_internal_scale_param() const {
+  const ::opencv_caffe::ScaleParameter* p = scale_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ScaleParameter&>(
+      ::opencv_caffe::_ScaleParameter_default_instance_);
 }
 inline const ::opencv_caffe::ScaleParameter& LayerParameter::scale_param() const {
-  const ::opencv_caffe::ScaleParameter* p = scale_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.scale_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ScaleParameter*>(
-      &::opencv_caffe::_ScaleParameter_default_instance_);
+  return _internal_scale_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_scale_param(
+    ::opencv_caffe::ScaleParameter* scale_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(scale_param_);
+  }
+  scale_param_ = scale_param;
+  if (scale_param) {
+    _has_bits_[1] |= 0x00001000u;
+  } else {
+    _has_bits_[1] &= ~0x00001000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.scale_param)
 }
 inline ::opencv_caffe::ScaleParameter* LayerParameter::release_scale_param() {
+  _has_bits_[1] &= ~0x00001000u;
+  ::opencv_caffe::ScaleParameter* temp = scale_param_;
+  scale_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ScaleParameter* LayerParameter::unsafe_arena_release_scale_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.scale_param)
-  clear_has_scale_param();
+  _has_bits_[1] &= ~0x00001000u;
   ::opencv_caffe::ScaleParameter* temp = scale_param_;
-  scale_param_ = NULL;
+  scale_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ScaleParameter* LayerParameter::mutable_scale_param() {
-  set_has_scale_param();
-  if (scale_param_ == NULL) {
-    scale_param_ = new ::opencv_caffe::ScaleParameter;
+inline ::opencv_caffe::ScaleParameter* LayerParameter::_internal_mutable_scale_param() {
+  _has_bits_[1] |= 0x00001000u;
+  if (scale_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ScaleParameter>(GetArenaForAllocation());
+    scale_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.scale_param)
   return scale_param_;
 }
+inline ::opencv_caffe::ScaleParameter* LayerParameter::mutable_scale_param() {
+  ::opencv_caffe::ScaleParameter* _msg = _internal_mutable_scale_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.scale_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_scale_param(::opencv_caffe::ScaleParameter* scale_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete scale_param_;
   }
   if (scale_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ScaleParameter>::GetOwningArena(scale_param);
     if (message_arena != submessage_arena) {
-      scale_param = ::google::protobuf::internal::GetOwnedMessage(
+      scale_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, scale_param, submessage_arena);
     }
-    set_has_scale_param();
+    _has_bits_[1] |= 0x00001000u;
   } else {
-    clear_has_scale_param();
+    _has_bits_[1] &= ~0x00001000u;
   }
   scale_param_ = scale_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.scale_param)
 }
 
 // optional .opencv_caffe.SigmoidParameter sigmoid_param = 124;
-inline bool LayerParameter::has_sigmoid_param() const {
-  return (_has_bits_[0] & 0x04000000u) != 0;
+inline bool LayerParameter::_internal_has_sigmoid_param() const {
+  bool value = (_has_bits_[0] & 0x04000000u) != 0;
+  PROTOBUF_ASSUME(!value || sigmoid_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_sigmoid_param() {
-  _has_bits_[0] |= 0x04000000u;
+inline bool LayerParameter::has_sigmoid_param() const {
+  return _internal_has_sigmoid_param();
 }
-inline void LayerParameter::clear_has_sigmoid_param() {
+inline void LayerParameter::clear_sigmoid_param() {
+  if (sigmoid_param_ != nullptr) sigmoid_param_->Clear();
   _has_bits_[0] &= ~0x04000000u;
 }
-inline void LayerParameter::clear_sigmoid_param() {
-  if (sigmoid_param_ != NULL) sigmoid_param_->Clear();
-  clear_has_sigmoid_param();
+inline const ::opencv_caffe::SigmoidParameter& LayerParameter::_internal_sigmoid_param() const {
+  const ::opencv_caffe::SigmoidParameter* p = sigmoid_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::SigmoidParameter&>(
+      ::opencv_caffe::_SigmoidParameter_default_instance_);
 }
 inline const ::opencv_caffe::SigmoidParameter& LayerParameter::sigmoid_param() const {
-  const ::opencv_caffe::SigmoidParameter* p = sigmoid_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.sigmoid_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::SigmoidParameter*>(
-      &::opencv_caffe::_SigmoidParameter_default_instance_);
+  return _internal_sigmoid_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_sigmoid_param(
+    ::opencv_caffe::SigmoidParameter* sigmoid_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(sigmoid_param_);
+  }
+  sigmoid_param_ = sigmoid_param;
+  if (sigmoid_param) {
+    _has_bits_[0] |= 0x04000000u;
+  } else {
+    _has_bits_[0] &= ~0x04000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.sigmoid_param)
 }
 inline ::opencv_caffe::SigmoidParameter* LayerParameter::release_sigmoid_param() {
+  _has_bits_[0] &= ~0x04000000u;
+  ::opencv_caffe::SigmoidParameter* temp = sigmoid_param_;
+  sigmoid_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::SigmoidParameter* LayerParameter::unsafe_arena_release_sigmoid_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.sigmoid_param)
-  clear_has_sigmoid_param();
+  _has_bits_[0] &= ~0x04000000u;
   ::opencv_caffe::SigmoidParameter* temp = sigmoid_param_;
-  sigmoid_param_ = NULL;
+  sigmoid_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() {
-  set_has_sigmoid_param();
-  if (sigmoid_param_ == NULL) {
-    sigmoid_param_ = new ::opencv_caffe::SigmoidParameter;
+inline ::opencv_caffe::SigmoidParameter* LayerParameter::_internal_mutable_sigmoid_param() {
+  _has_bits_[0] |= 0x04000000u;
+  if (sigmoid_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::SigmoidParameter>(GetArenaForAllocation());
+    sigmoid_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.sigmoid_param)
   return sigmoid_param_;
 }
+inline ::opencv_caffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() {
+  ::opencv_caffe::SigmoidParameter* _msg = _internal_mutable_sigmoid_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.sigmoid_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_sigmoid_param(::opencv_caffe::SigmoidParameter* sigmoid_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete sigmoid_param_;
   }
   if (sigmoid_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::SigmoidParameter>::GetOwningArena(sigmoid_param);
     if (message_arena != submessage_arena) {
-      sigmoid_param = ::google::protobuf::internal::GetOwnedMessage(
+      sigmoid_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, sigmoid_param, submessage_arena);
     }
-    set_has_sigmoid_param();
+    _has_bits_[0] |= 0x04000000u;
   } else {
-    clear_has_sigmoid_param();
+    _has_bits_[0] &= ~0x04000000u;
   }
   sigmoid_param_ = sigmoid_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.sigmoid_param)
 }
 
 // optional .opencv_caffe.SoftmaxParameter softmax_param = 125;
-inline bool LayerParameter::has_softmax_param() const {
-  return (_has_bits_[0] & 0x08000000u) != 0;
+inline bool LayerParameter::_internal_has_softmax_param() const {
+  bool value = (_has_bits_[0] & 0x08000000u) != 0;
+  PROTOBUF_ASSUME(!value || softmax_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_softmax_param() {
-  _has_bits_[0] |= 0x08000000u;
+inline bool LayerParameter::has_softmax_param() const {
+  return _internal_has_softmax_param();
 }
-inline void LayerParameter::clear_has_softmax_param() {
+inline void LayerParameter::clear_softmax_param() {
+  if (softmax_param_ != nullptr) softmax_param_->Clear();
   _has_bits_[0] &= ~0x08000000u;
 }
-inline void LayerParameter::clear_softmax_param() {
-  if (softmax_param_ != NULL) softmax_param_->Clear();
-  clear_has_softmax_param();
+inline const ::opencv_caffe::SoftmaxParameter& LayerParameter::_internal_softmax_param() const {
+  const ::opencv_caffe::SoftmaxParameter* p = softmax_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::SoftmaxParameter&>(
+      ::opencv_caffe::_SoftmaxParameter_default_instance_);
 }
 inline const ::opencv_caffe::SoftmaxParameter& LayerParameter::softmax_param() const {
-  const ::opencv_caffe::SoftmaxParameter* p = softmax_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.softmax_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::SoftmaxParameter*>(
-      &::opencv_caffe::_SoftmaxParameter_default_instance_);
+  return _internal_softmax_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_softmax_param(
+    ::opencv_caffe::SoftmaxParameter* softmax_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(softmax_param_);
+  }
+  softmax_param_ = softmax_param;
+  if (softmax_param) {
+    _has_bits_[0] |= 0x08000000u;
+  } else {
+    _has_bits_[0] &= ~0x08000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.softmax_param)
 }
 inline ::opencv_caffe::SoftmaxParameter* LayerParameter::release_softmax_param() {
+  _has_bits_[0] &= ~0x08000000u;
+  ::opencv_caffe::SoftmaxParameter* temp = softmax_param_;
+  softmax_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::SoftmaxParameter* LayerParameter::unsafe_arena_release_softmax_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.softmax_param)
-  clear_has_softmax_param();
+  _has_bits_[0] &= ~0x08000000u;
   ::opencv_caffe::SoftmaxParameter* temp = softmax_param_;
-  softmax_param_ = NULL;
+  softmax_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() {
-  set_has_softmax_param();
-  if (softmax_param_ == NULL) {
-    softmax_param_ = new ::opencv_caffe::SoftmaxParameter;
+inline ::opencv_caffe::SoftmaxParameter* LayerParameter::_internal_mutable_softmax_param() {
+  _has_bits_[0] |= 0x08000000u;
+  if (softmax_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::SoftmaxParameter>(GetArenaForAllocation());
+    softmax_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.softmax_param)
   return softmax_param_;
 }
+inline ::opencv_caffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() {
+  ::opencv_caffe::SoftmaxParameter* _msg = _internal_mutable_softmax_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.softmax_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_softmax_param(::opencv_caffe::SoftmaxParameter* softmax_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete softmax_param_;
   }
   if (softmax_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::SoftmaxParameter>::GetOwningArena(softmax_param);
     if (message_arena != submessage_arena) {
-      softmax_param = ::google::protobuf::internal::GetOwnedMessage(
+      softmax_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, softmax_param, submessage_arena);
     }
-    set_has_softmax_param();
+    _has_bits_[0] |= 0x08000000u;
   } else {
-    clear_has_softmax_param();
+    _has_bits_[0] &= ~0x08000000u;
   }
   softmax_param_ = softmax_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.softmax_param)
 }
 
 // optional .opencv_caffe.SPPParameter spp_param = 132;
-inline bool LayerParameter::has_spp_param() const {
-  return (_has_bits_[1] & 0x00000004u) != 0;
+inline bool LayerParameter::_internal_has_spp_param() const {
+  bool value = (_has_bits_[1] & 0x00000004u) != 0;
+  PROTOBUF_ASSUME(!value || spp_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_spp_param() {
-  _has_bits_[1] |= 0x00000004u;
+inline bool LayerParameter::has_spp_param() const {
+  return _internal_has_spp_param();
 }
-inline void LayerParameter::clear_has_spp_param() {
+inline void LayerParameter::clear_spp_param() {
+  if (spp_param_ != nullptr) spp_param_->Clear();
   _has_bits_[1] &= ~0x00000004u;
 }
-inline void LayerParameter::clear_spp_param() {
-  if (spp_param_ != NULL) spp_param_->Clear();
-  clear_has_spp_param();
+inline const ::opencv_caffe::SPPParameter& LayerParameter::_internal_spp_param() const {
+  const ::opencv_caffe::SPPParameter* p = spp_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::SPPParameter&>(
+      ::opencv_caffe::_SPPParameter_default_instance_);
 }
 inline const ::opencv_caffe::SPPParameter& LayerParameter::spp_param() const {
-  const ::opencv_caffe::SPPParameter* p = spp_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.spp_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::SPPParameter*>(
-      &::opencv_caffe::_SPPParameter_default_instance_);
+  return _internal_spp_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_spp_param(
+    ::opencv_caffe::SPPParameter* spp_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(spp_param_);
+  }
+  spp_param_ = spp_param;
+  if (spp_param) {
+    _has_bits_[1] |= 0x00000004u;
+  } else {
+    _has_bits_[1] &= ~0x00000004u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.spp_param)
 }
 inline ::opencv_caffe::SPPParameter* LayerParameter::release_spp_param() {
+  _has_bits_[1] &= ~0x00000004u;
+  ::opencv_caffe::SPPParameter* temp = spp_param_;
+  spp_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::SPPParameter* LayerParameter::unsafe_arena_release_spp_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.spp_param)
-  clear_has_spp_param();
+  _has_bits_[1] &= ~0x00000004u;
   ::opencv_caffe::SPPParameter* temp = spp_param_;
-  spp_param_ = NULL;
+  spp_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::SPPParameter* LayerParameter::mutable_spp_param() {
-  set_has_spp_param();
-  if (spp_param_ == NULL) {
-    spp_param_ = new ::opencv_caffe::SPPParameter;
+inline ::opencv_caffe::SPPParameter* LayerParameter::_internal_mutable_spp_param() {
+  _has_bits_[1] |= 0x00000004u;
+  if (spp_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::SPPParameter>(GetArenaForAllocation());
+    spp_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.spp_param)
   return spp_param_;
 }
+inline ::opencv_caffe::SPPParameter* LayerParameter::mutable_spp_param() {
+  ::opencv_caffe::SPPParameter* _msg = _internal_mutable_spp_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.spp_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_spp_param(::opencv_caffe::SPPParameter* spp_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete spp_param_;
   }
   if (spp_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::SPPParameter>::GetOwningArena(spp_param);
     if (message_arena != submessage_arena) {
-      spp_param = ::google::protobuf::internal::GetOwnedMessage(
+      spp_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, spp_param, submessage_arena);
     }
-    set_has_spp_param();
+    _has_bits_[1] |= 0x00000004u;
   } else {
-    clear_has_spp_param();
+    _has_bits_[1] &= ~0x00000004u;
   }
   spp_param_ = spp_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.spp_param)
 }
 
 // optional .opencv_caffe.SliceParameter slice_param = 126;
-inline bool LayerParameter::has_slice_param() const {
-  return (_has_bits_[0] & 0x10000000u) != 0;
+inline bool LayerParameter::_internal_has_slice_param() const {
+  bool value = (_has_bits_[0] & 0x10000000u) != 0;
+  PROTOBUF_ASSUME(!value || slice_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_slice_param() {
-  _has_bits_[0] |= 0x10000000u;
+inline bool LayerParameter::has_slice_param() const {
+  return _internal_has_slice_param();
 }
-inline void LayerParameter::clear_has_slice_param() {
+inline void LayerParameter::clear_slice_param() {
+  if (slice_param_ != nullptr) slice_param_->Clear();
   _has_bits_[0] &= ~0x10000000u;
 }
-inline void LayerParameter::clear_slice_param() {
-  if (slice_param_ != NULL) slice_param_->Clear();
-  clear_has_slice_param();
+inline const ::opencv_caffe::SliceParameter& LayerParameter::_internal_slice_param() const {
+  const ::opencv_caffe::SliceParameter* p = slice_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::SliceParameter&>(
+      ::opencv_caffe::_SliceParameter_default_instance_);
 }
 inline const ::opencv_caffe::SliceParameter& LayerParameter::slice_param() const {
-  const ::opencv_caffe::SliceParameter* p = slice_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.slice_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::SliceParameter*>(
-      &::opencv_caffe::_SliceParameter_default_instance_);
+  return _internal_slice_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_slice_param(
+    ::opencv_caffe::SliceParameter* slice_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(slice_param_);
+  }
+  slice_param_ = slice_param;
+  if (slice_param) {
+    _has_bits_[0] |= 0x10000000u;
+  } else {
+    _has_bits_[0] &= ~0x10000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.slice_param)
 }
 inline ::opencv_caffe::SliceParameter* LayerParameter::release_slice_param() {
+  _has_bits_[0] &= ~0x10000000u;
+  ::opencv_caffe::SliceParameter* temp = slice_param_;
+  slice_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::SliceParameter* LayerParameter::unsafe_arena_release_slice_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.slice_param)
-  clear_has_slice_param();
+  _has_bits_[0] &= ~0x10000000u;
   ::opencv_caffe::SliceParameter* temp = slice_param_;
-  slice_param_ = NULL;
+  slice_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::SliceParameter* LayerParameter::mutable_slice_param() {
-  set_has_slice_param();
-  if (slice_param_ == NULL) {
-    slice_param_ = new ::opencv_caffe::SliceParameter;
+inline ::opencv_caffe::SliceParameter* LayerParameter::_internal_mutable_slice_param() {
+  _has_bits_[0] |= 0x10000000u;
+  if (slice_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::SliceParameter>(GetArenaForAllocation());
+    slice_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.slice_param)
   return slice_param_;
 }
+inline ::opencv_caffe::SliceParameter* LayerParameter::mutable_slice_param() {
+  ::opencv_caffe::SliceParameter* _msg = _internal_mutable_slice_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.slice_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_slice_param(::opencv_caffe::SliceParameter* slice_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete slice_param_;
   }
   if (slice_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::SliceParameter>::GetOwningArena(slice_param);
     if (message_arena != submessage_arena) {
-      slice_param = ::google::protobuf::internal::GetOwnedMessage(
+      slice_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, slice_param, submessage_arena);
     }
-    set_has_slice_param();
+    _has_bits_[0] |= 0x10000000u;
   } else {
-    clear_has_slice_param();
+    _has_bits_[0] &= ~0x10000000u;
   }
   slice_param_ = slice_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.slice_param)
 }
 
 // optional .opencv_caffe.TanHParameter tanh_param = 127;
-inline bool LayerParameter::has_tanh_param() const {
-  return (_has_bits_[0] & 0x20000000u) != 0;
+inline bool LayerParameter::_internal_has_tanh_param() const {
+  bool value = (_has_bits_[0] & 0x20000000u) != 0;
+  PROTOBUF_ASSUME(!value || tanh_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_tanh_param() {
-  _has_bits_[0] |= 0x20000000u;
+inline bool LayerParameter::has_tanh_param() const {
+  return _internal_has_tanh_param();
 }
-inline void LayerParameter::clear_has_tanh_param() {
+inline void LayerParameter::clear_tanh_param() {
+  if (tanh_param_ != nullptr) tanh_param_->Clear();
   _has_bits_[0] &= ~0x20000000u;
 }
-inline void LayerParameter::clear_tanh_param() {
-  if (tanh_param_ != NULL) tanh_param_->Clear();
-  clear_has_tanh_param();
+inline const ::opencv_caffe::TanHParameter& LayerParameter::_internal_tanh_param() const {
+  const ::opencv_caffe::TanHParameter* p = tanh_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::TanHParameter&>(
+      ::opencv_caffe::_TanHParameter_default_instance_);
 }
 inline const ::opencv_caffe::TanHParameter& LayerParameter::tanh_param() const {
-  const ::opencv_caffe::TanHParameter* p = tanh_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.tanh_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::TanHParameter*>(
-      &::opencv_caffe::_TanHParameter_default_instance_);
+  return _internal_tanh_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_tanh_param(
+    ::opencv_caffe::TanHParameter* tanh_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(tanh_param_);
+  }
+  tanh_param_ = tanh_param;
+  if (tanh_param) {
+    _has_bits_[0] |= 0x20000000u;
+  } else {
+    _has_bits_[0] &= ~0x20000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.tanh_param)
 }
 inline ::opencv_caffe::TanHParameter* LayerParameter::release_tanh_param() {
+  _has_bits_[0] &= ~0x20000000u;
+  ::opencv_caffe::TanHParameter* temp = tanh_param_;
+  tanh_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::TanHParameter* LayerParameter::unsafe_arena_release_tanh_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.tanh_param)
-  clear_has_tanh_param();
+  _has_bits_[0] &= ~0x20000000u;
   ::opencv_caffe::TanHParameter* temp = tanh_param_;
-  tanh_param_ = NULL;
+  tanh_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::TanHParameter* LayerParameter::mutable_tanh_param() {
-  set_has_tanh_param();
-  if (tanh_param_ == NULL) {
-    tanh_param_ = new ::opencv_caffe::TanHParameter;
+inline ::opencv_caffe::TanHParameter* LayerParameter::_internal_mutable_tanh_param() {
+  _has_bits_[0] |= 0x20000000u;
+  if (tanh_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::TanHParameter>(GetArenaForAllocation());
+    tanh_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.tanh_param)
   return tanh_param_;
 }
+inline ::opencv_caffe::TanHParameter* LayerParameter::mutable_tanh_param() {
+  ::opencv_caffe::TanHParameter* _msg = _internal_mutable_tanh_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.tanh_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_tanh_param(::opencv_caffe::TanHParameter* tanh_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete tanh_param_;
   }
   if (tanh_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::TanHParameter>::GetOwningArena(tanh_param);
     if (message_arena != submessage_arena) {
-      tanh_param = ::google::protobuf::internal::GetOwnedMessage(
+      tanh_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, tanh_param, submessage_arena);
     }
-    set_has_tanh_param();
+    _has_bits_[0] |= 0x20000000u;
   } else {
-    clear_has_tanh_param();
+    _has_bits_[0] &= ~0x20000000u;
   }
   tanh_param_ = tanh_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.tanh_param)
 }
 
 // optional .opencv_caffe.ThresholdParameter threshold_param = 128;
-inline bool LayerParameter::has_threshold_param() const {
-  return (_has_bits_[0] & 0x40000000u) != 0;
+inline bool LayerParameter::_internal_has_threshold_param() const {
+  bool value = (_has_bits_[0] & 0x40000000u) != 0;
+  PROTOBUF_ASSUME(!value || threshold_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_threshold_param() {
-  _has_bits_[0] |= 0x40000000u;
+inline bool LayerParameter::has_threshold_param() const {
+  return _internal_has_threshold_param();
 }
-inline void LayerParameter::clear_has_threshold_param() {
+inline void LayerParameter::clear_threshold_param() {
+  if (threshold_param_ != nullptr) threshold_param_->Clear();
   _has_bits_[0] &= ~0x40000000u;
 }
-inline void LayerParameter::clear_threshold_param() {
-  if (threshold_param_ != NULL) threshold_param_->Clear();
-  clear_has_threshold_param();
+inline const ::opencv_caffe::ThresholdParameter& LayerParameter::_internal_threshold_param() const {
+  const ::opencv_caffe::ThresholdParameter* p = threshold_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ThresholdParameter&>(
+      ::opencv_caffe::_ThresholdParameter_default_instance_);
 }
 inline const ::opencv_caffe::ThresholdParameter& LayerParameter::threshold_param() const {
-  const ::opencv_caffe::ThresholdParameter* p = threshold_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.threshold_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ThresholdParameter*>(
-      &::opencv_caffe::_ThresholdParameter_default_instance_);
+  return _internal_threshold_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_threshold_param(
+    ::opencv_caffe::ThresholdParameter* threshold_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(threshold_param_);
+  }
+  threshold_param_ = threshold_param;
+  if (threshold_param) {
+    _has_bits_[0] |= 0x40000000u;
+  } else {
+    _has_bits_[0] &= ~0x40000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.threshold_param)
 }
 inline ::opencv_caffe::ThresholdParameter* LayerParameter::release_threshold_param() {
+  _has_bits_[0] &= ~0x40000000u;
+  ::opencv_caffe::ThresholdParameter* temp = threshold_param_;
+  threshold_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ThresholdParameter* LayerParameter::unsafe_arena_release_threshold_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.threshold_param)
-  clear_has_threshold_param();
+  _has_bits_[0] &= ~0x40000000u;
   ::opencv_caffe::ThresholdParameter* temp = threshold_param_;
-  threshold_param_ = NULL;
+  threshold_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ThresholdParameter* LayerParameter::mutable_threshold_param() {
-  set_has_threshold_param();
-  if (threshold_param_ == NULL) {
-    threshold_param_ = new ::opencv_caffe::ThresholdParameter;
+inline ::opencv_caffe::ThresholdParameter* LayerParameter::_internal_mutable_threshold_param() {
+  _has_bits_[0] |= 0x40000000u;
+  if (threshold_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ThresholdParameter>(GetArenaForAllocation());
+    threshold_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.threshold_param)
   return threshold_param_;
 }
+inline ::opencv_caffe::ThresholdParameter* LayerParameter::mutable_threshold_param() {
+  ::opencv_caffe::ThresholdParameter* _msg = _internal_mutable_threshold_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.threshold_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_threshold_param(::opencv_caffe::ThresholdParameter* threshold_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete threshold_param_;
   }
   if (threshold_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ThresholdParameter>::GetOwningArena(threshold_param);
     if (message_arena != submessage_arena) {
-      threshold_param = ::google::protobuf::internal::GetOwnedMessage(
+      threshold_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, threshold_param, submessage_arena);
     }
-    set_has_threshold_param();
+    _has_bits_[0] |= 0x40000000u;
   } else {
-    clear_has_threshold_param();
+    _has_bits_[0] &= ~0x40000000u;
   }
   threshold_param_ = threshold_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.threshold_param)
 }
 
 // optional .opencv_caffe.TileParameter tile_param = 138;
-inline bool LayerParameter::has_tile_param() const {
-  return (_has_bits_[1] & 0x00000100u) != 0;
+inline bool LayerParameter::_internal_has_tile_param() const {
+  bool value = (_has_bits_[1] & 0x00000100u) != 0;
+  PROTOBUF_ASSUME(!value || tile_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_tile_param() {
-  _has_bits_[1] |= 0x00000100u;
+inline bool LayerParameter::has_tile_param() const {
+  return _internal_has_tile_param();
 }
-inline void LayerParameter::clear_has_tile_param() {
+inline void LayerParameter::clear_tile_param() {
+  if (tile_param_ != nullptr) tile_param_->Clear();
   _has_bits_[1] &= ~0x00000100u;
 }
-inline void LayerParameter::clear_tile_param() {
-  if (tile_param_ != NULL) tile_param_->Clear();
-  clear_has_tile_param();
+inline const ::opencv_caffe::TileParameter& LayerParameter::_internal_tile_param() const {
+  const ::opencv_caffe::TileParameter* p = tile_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::TileParameter&>(
+      ::opencv_caffe::_TileParameter_default_instance_);
 }
 inline const ::opencv_caffe::TileParameter& LayerParameter::tile_param() const {
-  const ::opencv_caffe::TileParameter* p = tile_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.tile_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::TileParameter*>(
-      &::opencv_caffe::_TileParameter_default_instance_);
+  return _internal_tile_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_tile_param(
+    ::opencv_caffe::TileParameter* tile_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(tile_param_);
+  }
+  tile_param_ = tile_param;
+  if (tile_param) {
+    _has_bits_[1] |= 0x00000100u;
+  } else {
+    _has_bits_[1] &= ~0x00000100u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.tile_param)
 }
 inline ::opencv_caffe::TileParameter* LayerParameter::release_tile_param() {
+  _has_bits_[1] &= ~0x00000100u;
+  ::opencv_caffe::TileParameter* temp = tile_param_;
+  tile_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::TileParameter* LayerParameter::unsafe_arena_release_tile_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.tile_param)
-  clear_has_tile_param();
+  _has_bits_[1] &= ~0x00000100u;
   ::opencv_caffe::TileParameter* temp = tile_param_;
-  tile_param_ = NULL;
+  tile_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::TileParameter* LayerParameter::mutable_tile_param() {
-  set_has_tile_param();
-  if (tile_param_ == NULL) {
-    tile_param_ = new ::opencv_caffe::TileParameter;
+inline ::opencv_caffe::TileParameter* LayerParameter::_internal_mutable_tile_param() {
+  _has_bits_[1] |= 0x00000100u;
+  if (tile_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::TileParameter>(GetArenaForAllocation());
+    tile_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.tile_param)
   return tile_param_;
 }
+inline ::opencv_caffe::TileParameter* LayerParameter::mutable_tile_param() {
+  ::opencv_caffe::TileParameter* _msg = _internal_mutable_tile_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.tile_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_tile_param(::opencv_caffe::TileParameter* tile_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete tile_param_;
   }
   if (tile_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::TileParameter>::GetOwningArena(tile_param);
     if (message_arena != submessage_arena) {
-      tile_param = ::google::protobuf::internal::GetOwnedMessage(
+      tile_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, tile_param, submessage_arena);
     }
-    set_has_tile_param();
+    _has_bits_[1] |= 0x00000100u;
   } else {
-    clear_has_tile_param();
+    _has_bits_[1] &= ~0x00000100u;
   }
   tile_param_ = tile_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.tile_param)
 }
 
 // optional .opencv_caffe.WindowDataParameter window_data_param = 129;
-inline bool LayerParameter::has_window_data_param() const {
-  return (_has_bits_[0] & 0x80000000u) != 0;
+inline bool LayerParameter::_internal_has_window_data_param() const {
+  bool value = (_has_bits_[0] & 0x80000000u) != 0;
+  PROTOBUF_ASSUME(!value || window_data_param_ != nullptr);
+  return value;
 }
-inline void LayerParameter::set_has_window_data_param() {
-  _has_bits_[0] |= 0x80000000u;
+inline bool LayerParameter::has_window_data_param() const {
+  return _internal_has_window_data_param();
 }
-inline void LayerParameter::clear_has_window_data_param() {
+inline void LayerParameter::clear_window_data_param() {
+  if (window_data_param_ != nullptr) window_data_param_->Clear();
   _has_bits_[0] &= ~0x80000000u;
 }
-inline void LayerParameter::clear_window_data_param() {
-  if (window_data_param_ != NULL) window_data_param_->Clear();
-  clear_has_window_data_param();
+inline const ::opencv_caffe::WindowDataParameter& LayerParameter::_internal_window_data_param() const {
+  const ::opencv_caffe::WindowDataParameter* p = window_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::WindowDataParameter&>(
+      ::opencv_caffe::_WindowDataParameter_default_instance_);
 }
 inline const ::opencv_caffe::WindowDataParameter& LayerParameter::window_data_param() const {
-  const ::opencv_caffe::WindowDataParameter* p = window_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.LayerParameter.window_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::WindowDataParameter*>(
-      &::opencv_caffe::_WindowDataParameter_default_instance_);
+  return _internal_window_data_param();
+}
+inline void LayerParameter::unsafe_arena_set_allocated_window_data_param(
+    ::opencv_caffe::WindowDataParameter* window_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(window_data_param_);
+  }
+  window_data_param_ = window_data_param;
+  if (window_data_param) {
+    _has_bits_[0] |= 0x80000000u;
+  } else {
+    _has_bits_[0] &= ~0x80000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.LayerParameter.window_data_param)
 }
 inline ::opencv_caffe::WindowDataParameter* LayerParameter::release_window_data_param() {
+  _has_bits_[0] &= ~0x80000000u;
+  ::opencv_caffe::WindowDataParameter* temp = window_data_param_;
+  window_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::WindowDataParameter* LayerParameter::unsafe_arena_release_window_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.LayerParameter.window_data_param)
-  clear_has_window_data_param();
+  _has_bits_[0] &= ~0x80000000u;
   ::opencv_caffe::WindowDataParameter* temp = window_data_param_;
-  window_data_param_ = NULL;
+  window_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::WindowDataParameter* LayerParameter::mutable_window_data_param() {
-  set_has_window_data_param();
-  if (window_data_param_ == NULL) {
-    window_data_param_ = new ::opencv_caffe::WindowDataParameter;
+inline ::opencv_caffe::WindowDataParameter* LayerParameter::_internal_mutable_window_data_param() {
+  _has_bits_[0] |= 0x80000000u;
+  if (window_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::WindowDataParameter>(GetArenaForAllocation());
+    window_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.window_data_param)
   return window_data_param_;
 }
+inline ::opencv_caffe::WindowDataParameter* LayerParameter::mutable_window_data_param() {
+  ::opencv_caffe::WindowDataParameter* _msg = _internal_mutable_window_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.LayerParameter.window_data_param)
+  return _msg;
+}
 inline void LayerParameter::set_allocated_window_data_param(::opencv_caffe::WindowDataParameter* window_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete window_data_param_;
   }
   if (window_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::WindowDataParameter>::GetOwningArena(window_data_param);
     if (message_arena != submessage_arena) {
-      window_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      window_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, window_data_param, submessage_arena);
     }
-    set_has_window_data_param();
+    _has_bits_[0] |= 0x80000000u;
   } else {
-    clear_has_window_data_param();
+    _has_bits_[0] &= ~0x80000000u;
   }
   window_data_param_ = window_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.LayerParameter.window_data_param)
@@ -22225,215 +31378,258 @@ inline void LayerParameter::set_allocated_window_data_param(::opencv_caffe::Wind
 // TransformationParameter
 
 // optional float scale = 1 [default = 1];
-inline bool TransformationParameter::has_scale() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void TransformationParameter::set_has_scale() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool TransformationParameter::_internal_has_scale() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void TransformationParameter::clear_has_scale() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool TransformationParameter::has_scale() const {
+  return _internal_has_scale();
 }
 inline void TransformationParameter::clear_scale() {
   scale_ = 1;
-  clear_has_scale();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline float TransformationParameter::_internal_scale() const {
+  return scale_;
 }
 inline float TransformationParameter::scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.TransformationParameter.scale)
-  return scale_;
+  return _internal_scale();
 }
-inline void TransformationParameter::set_scale(float value) {
-  set_has_scale();
+inline void TransformationParameter::_internal_set_scale(float value) {
+  _has_bits_[0] |= 0x00000020u;
   scale_ = value;
+}
+inline void TransformationParameter::set_scale(float value) {
+  _internal_set_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TransformationParameter.scale)
 }
 
 // optional bool mirror = 2 [default = false];
-inline bool TransformationParameter::has_mirror() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void TransformationParameter::set_has_mirror() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool TransformationParameter::_internal_has_mirror() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void TransformationParameter::clear_has_mirror() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool TransformationParameter::has_mirror() const {
+  return _internal_has_mirror();
 }
 inline void TransformationParameter::clear_mirror() {
   mirror_ = false;
-  clear_has_mirror();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline bool TransformationParameter::_internal_mirror() const {
+  return mirror_;
 }
 inline bool TransformationParameter::mirror() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.TransformationParameter.mirror)
-  return mirror_;
+  return _internal_mirror();
 }
-inline void TransformationParameter::set_mirror(bool value) {
-  set_has_mirror();
+inline void TransformationParameter::_internal_set_mirror(bool value) {
+  _has_bits_[0] |= 0x00000004u;
   mirror_ = value;
+}
+inline void TransformationParameter::set_mirror(bool value) {
+  _internal_set_mirror(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TransformationParameter.mirror)
 }
 
 // optional uint32 crop_size = 3 [default = 0];
-inline bool TransformationParameter::has_crop_size() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void TransformationParameter::set_has_crop_size() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool TransformationParameter::_internal_has_crop_size() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void TransformationParameter::clear_has_crop_size() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool TransformationParameter::has_crop_size() const {
+  return _internal_has_crop_size();
 }
 inline void TransformationParameter::clear_crop_size() {
   crop_size_ = 0u;
-  clear_has_crop_size();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::uint32 TransformationParameter::crop_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.TransformationParameter.crop_size)
+inline uint32_t TransformationParameter::_internal_crop_size() const {
   return crop_size_;
 }
-inline void TransformationParameter::set_crop_size(::google::protobuf::uint32 value) {
-  set_has_crop_size();
+inline uint32_t TransformationParameter::crop_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.TransformationParameter.crop_size)
+  return _internal_crop_size();
+}
+inline void TransformationParameter::_internal_set_crop_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   crop_size_ = value;
+}
+inline void TransformationParameter::set_crop_size(uint32_t value) {
+  _internal_set_crop_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TransformationParameter.crop_size)
 }
 
 // optional string mean_file = 4;
-inline bool TransformationParameter::has_mean_file() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void TransformationParameter::set_has_mean_file() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool TransformationParameter::_internal_has_mean_file() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void TransformationParameter::clear_has_mean_file() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool TransformationParameter::has_mean_file() const {
+  return _internal_has_mean_file();
 }
 inline void TransformationParameter::clear_mean_file() {
-  mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_mean_file();
+  mean_file_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& TransformationParameter::mean_file() const {
+inline const std::string& TransformationParameter::mean_file() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.TransformationParameter.mean_file)
-  return mean_file_.GetNoArena();
+  return _internal_mean_file();
 }
-inline void TransformationParameter::set_mean_file(const ::std::string& value) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TransformationParameter::set_mean_file(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.TransformationParameter.mean_file)
 }
-#if LANG_CXX11
-inline void TransformationParameter::set_mean_file(::std::string&& value) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.TransformationParameter.mean_file)
-}
-#endif
-inline void TransformationParameter::set_mean_file(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.TransformationParameter.mean_file)
-}
-inline void TransformationParameter::set_mean_file(const char* value, size_t size) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.TransformationParameter.mean_file)
-}
-inline ::std::string* TransformationParameter::mutable_mean_file() {
-  set_has_mean_file();
+inline std::string* TransformationParameter::mutable_mean_file() {
+  std::string* _s = _internal_mutable_mean_file();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.TransformationParameter.mean_file)
-  return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& TransformationParameter::_internal_mean_file() const {
+  return mean_file_.Get();
+}
+inline void TransformationParameter::_internal_set_mean_file(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* TransformationParameter::release_mean_file() {
+inline std::string* TransformationParameter::_internal_mutable_mean_file() {
+  _has_bits_[0] |= 0x00000001u;
+  return mean_file_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* TransformationParameter::release_mean_file() {
   // @@protoc_insertion_point(field_release:opencv_caffe.TransformationParameter.mean_file)
-  clear_has_mean_file();
-  return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_mean_file()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = mean_file_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (mean_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void TransformationParameter::set_allocated_mean_file(::std::string* mean_file) {
-  if (mean_file != NULL) {
-    set_has_mean_file();
+inline void TransformationParameter::set_allocated_mean_file(std::string* mean_file) {
+  if (mean_file != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_mean_file();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  mean_file_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), mean_file,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (mean_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.TransformationParameter.mean_file)
 }
 
 // repeated float mean_value = 5;
-inline int TransformationParameter::mean_value_size() const {
+inline int TransformationParameter::_internal_mean_value_size() const {
   return mean_value_.size();
 }
+inline int TransformationParameter::mean_value_size() const {
+  return _internal_mean_value_size();
+}
 inline void TransformationParameter::clear_mean_value() {
   mean_value_.Clear();
 }
+inline float TransformationParameter::_internal_mean_value(int index) const {
+  return mean_value_.Get(index);
+}
 inline float TransformationParameter::mean_value(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.TransformationParameter.mean_value)
-  return mean_value_.Get(index);
+  return _internal_mean_value(index);
 }
 inline void TransformationParameter::set_mean_value(int index, float value) {
   mean_value_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TransformationParameter.mean_value)
 }
-inline void TransformationParameter::add_mean_value(float value) {
+inline void TransformationParameter::_internal_add_mean_value(float value) {
   mean_value_.Add(value);
+}
+inline void TransformationParameter::add_mean_value(float value) {
+  _internal_add_mean_value(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.TransformationParameter.mean_value)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+TransformationParameter::_internal_mean_value() const {
+  return mean_value_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 TransformationParameter::mean_value() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.TransformationParameter.mean_value)
-  return mean_value_;
+  return _internal_mean_value();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+TransformationParameter::_internal_mutable_mean_value() {
+  return &mean_value_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 TransformationParameter::mutable_mean_value() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.TransformationParameter.mean_value)
-  return &mean_value_;
+  return _internal_mutable_mean_value();
 }
 
 // optional bool force_color = 6 [default = false];
-inline bool TransformationParameter::has_force_color() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void TransformationParameter::set_has_force_color() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool TransformationParameter::_internal_has_force_color() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void TransformationParameter::clear_has_force_color() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool TransformationParameter::has_force_color() const {
+  return _internal_has_force_color();
 }
 inline void TransformationParameter::clear_force_color() {
   force_color_ = false;
-  clear_has_force_color();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline bool TransformationParameter::_internal_force_color() const {
+  return force_color_;
 }
 inline bool TransformationParameter::force_color() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.TransformationParameter.force_color)
-  return force_color_;
+  return _internal_force_color();
 }
-inline void TransformationParameter::set_force_color(bool value) {
-  set_has_force_color();
+inline void TransformationParameter::_internal_set_force_color(bool value) {
+  _has_bits_[0] |= 0x00000008u;
   force_color_ = value;
+}
+inline void TransformationParameter::set_force_color(bool value) {
+  _internal_set_force_color(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TransformationParameter.force_color)
 }
 
 // optional bool force_gray = 7 [default = false];
-inline bool TransformationParameter::has_force_gray() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void TransformationParameter::set_has_force_gray() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool TransformationParameter::_internal_has_force_gray() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void TransformationParameter::clear_has_force_gray() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool TransformationParameter::has_force_gray() const {
+  return _internal_has_force_gray();
 }
 inline void TransformationParameter::clear_force_gray() {
   force_gray_ = false;
-  clear_has_force_gray();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline bool TransformationParameter::_internal_force_gray() const {
+  return force_gray_;
 }
 inline bool TransformationParameter::force_gray() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.TransformationParameter.force_gray)
-  return force_gray_;
+  return _internal_force_gray();
 }
-inline void TransformationParameter::set_force_gray(bool value) {
-  set_has_force_gray();
+inline void TransformationParameter::_internal_set_force_gray(bool value) {
+  _has_bits_[0] |= 0x00000010u;
   force_gray_ = value;
+}
+inline void TransformationParameter::set_force_gray(bool value) {
+  _internal_set_force_gray(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TransformationParameter.force_gray)
 }
 
@@ -22442,75 +31638,87 @@ inline void TransformationParameter::set_force_gray(bool value) {
 // LossParameter
 
 // optional int32 ignore_label = 1;
-inline bool LossParameter::has_ignore_label() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool LossParameter::_internal_has_ignore_label() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void LossParameter::set_has_ignore_label() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void LossParameter::clear_has_ignore_label() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool LossParameter::has_ignore_label() const {
+  return _internal_has_ignore_label();
 }
 inline void LossParameter::clear_ignore_label() {
   ignore_label_ = 0;
-  clear_has_ignore_label();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 LossParameter::ignore_label() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.LossParameter.ignore_label)
+inline int32_t LossParameter::_internal_ignore_label() const {
   return ignore_label_;
 }
-inline void LossParameter::set_ignore_label(::google::protobuf::int32 value) {
-  set_has_ignore_label();
+inline int32_t LossParameter::ignore_label() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.LossParameter.ignore_label)
+  return _internal_ignore_label();
+}
+inline void LossParameter::_internal_set_ignore_label(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   ignore_label_ = value;
+}
+inline void LossParameter::set_ignore_label(int32_t value) {
+  _internal_set_ignore_label(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LossParameter.ignore_label)
 }
 
 // optional .opencv_caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID];
-inline bool LossParameter::has_normalization() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void LossParameter::set_has_normalization() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool LossParameter::_internal_has_normalization() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void LossParameter::clear_has_normalization() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool LossParameter::has_normalization() const {
+  return _internal_has_normalization();
 }
 inline void LossParameter::clear_normalization() {
   normalization_ = 1;
-  clear_has_normalization();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline ::opencv_caffe::LossParameter_NormalizationMode LossParameter::_internal_normalization() const {
+  return static_cast< ::opencv_caffe::LossParameter_NormalizationMode >(normalization_);
 }
 inline ::opencv_caffe::LossParameter_NormalizationMode LossParameter::normalization() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LossParameter.normalization)
-  return static_cast< ::opencv_caffe::LossParameter_NormalizationMode >(normalization_);
+  return _internal_normalization();
 }
-inline void LossParameter::set_normalization(::opencv_caffe::LossParameter_NormalizationMode value) {
+inline void LossParameter::_internal_set_normalization(::opencv_caffe::LossParameter_NormalizationMode value) {
   assert(::opencv_caffe::LossParameter_NormalizationMode_IsValid(value));
-  set_has_normalization();
+  _has_bits_[0] |= 0x00000004u;
   normalization_ = value;
+}
+inline void LossParameter::set_normalization(::opencv_caffe::LossParameter_NormalizationMode value) {
+  _internal_set_normalization(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LossParameter.normalization)
 }
 
 // optional bool normalize = 2;
-inline bool LossParameter::has_normalize() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool LossParameter::_internal_has_normalize() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void LossParameter::set_has_normalize() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void LossParameter::clear_has_normalize() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool LossParameter::has_normalize() const {
+  return _internal_has_normalize();
 }
 inline void LossParameter::clear_normalize() {
   normalize_ = false;
-  clear_has_normalize();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool LossParameter::_internal_normalize() const {
+  return normalize_;
 }
 inline bool LossParameter::normalize() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LossParameter.normalize)
-  return normalize_;
+  return _internal_normalize();
 }
-inline void LossParameter::set_normalize(bool value) {
-  set_has_normalize();
+inline void LossParameter::_internal_set_normalize(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   normalize_ = value;
+}
+inline void LossParameter::set_normalize(bool value) {
+  _internal_set_normalize(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LossParameter.normalize)
 }
 
@@ -22519,74 +31727,86 @@ inline void LossParameter::set_normalize(bool value) {
 // AccuracyParameter
 
 // optional uint32 top_k = 1 [default = 1];
-inline bool AccuracyParameter::has_top_k() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void AccuracyParameter::set_has_top_k() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool AccuracyParameter::_internal_has_top_k() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void AccuracyParameter::clear_has_top_k() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool AccuracyParameter::has_top_k() const {
+  return _internal_has_top_k();
 }
 inline void AccuracyParameter::clear_top_k() {
   top_k_ = 1u;
-  clear_has_top_k();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::uint32 AccuracyParameter::top_k() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.AccuracyParameter.top_k)
+inline uint32_t AccuracyParameter::_internal_top_k() const {
   return top_k_;
 }
-inline void AccuracyParameter::set_top_k(::google::protobuf::uint32 value) {
-  set_has_top_k();
+inline uint32_t AccuracyParameter::top_k() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.AccuracyParameter.top_k)
+  return _internal_top_k();
+}
+inline void AccuracyParameter::_internal_set_top_k(uint32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   top_k_ = value;
+}
+inline void AccuracyParameter::set_top_k(uint32_t value) {
+  _internal_set_top_k(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.AccuracyParameter.top_k)
 }
 
 // optional int32 axis = 2 [default = 1];
-inline bool AccuracyParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool AccuracyParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void AccuracyParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void AccuracyParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool AccuracyParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void AccuracyParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 AccuracyParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.AccuracyParameter.axis)
+inline int32_t AccuracyParameter::_internal_axis() const {
   return axis_;
 }
-inline void AccuracyParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t AccuracyParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.AccuracyParameter.axis)
+  return _internal_axis();
+}
+inline void AccuracyParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   axis_ = value;
+}
+inline void AccuracyParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.AccuracyParameter.axis)
 }
 
 // optional int32 ignore_label = 3;
-inline bool AccuracyParameter::has_ignore_label() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void AccuracyParameter::set_has_ignore_label() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool AccuracyParameter::_internal_has_ignore_label() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void AccuracyParameter::clear_has_ignore_label() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool AccuracyParameter::has_ignore_label() const {
+  return _internal_has_ignore_label();
 }
 inline void AccuracyParameter::clear_ignore_label() {
   ignore_label_ = 0;
-  clear_has_ignore_label();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 AccuracyParameter::ignore_label() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.AccuracyParameter.ignore_label)
+inline int32_t AccuracyParameter::_internal_ignore_label() const {
   return ignore_label_;
 }
-inline void AccuracyParameter::set_ignore_label(::google::protobuf::int32 value) {
-  set_has_ignore_label();
+inline int32_t AccuracyParameter::ignore_label() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.AccuracyParameter.ignore_label)
+  return _internal_ignore_label();
+}
+inline void AccuracyParameter::_internal_set_ignore_label(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   ignore_label_ = value;
+}
+inline void AccuracyParameter::set_ignore_label(int32_t value) {
+  _internal_set_ignore_label(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.AccuracyParameter.ignore_label)
 }
 
@@ -22595,74 +31815,86 @@ inline void AccuracyParameter::set_ignore_label(::google::protobuf::int32 value)
 // ArgMaxParameter
 
 // optional bool out_max_val = 1 [default = false];
-inline bool ArgMaxParameter::has_out_max_val() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ArgMaxParameter::set_has_out_max_val() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ArgMaxParameter::_internal_has_out_max_val() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ArgMaxParameter::clear_has_out_max_val() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ArgMaxParameter::has_out_max_val() const {
+  return _internal_has_out_max_val();
 }
 inline void ArgMaxParameter::clear_out_max_val() {
   out_max_val_ = false;
-  clear_has_out_max_val();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool ArgMaxParameter::_internal_out_max_val() const {
+  return out_max_val_;
 }
 inline bool ArgMaxParameter::out_max_val() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ArgMaxParameter.out_max_val)
-  return out_max_val_;
+  return _internal_out_max_val();
 }
-inline void ArgMaxParameter::set_out_max_val(bool value) {
-  set_has_out_max_val();
+inline void ArgMaxParameter::_internal_set_out_max_val(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   out_max_val_ = value;
+}
+inline void ArgMaxParameter::set_out_max_val(bool value) {
+  _internal_set_out_max_val(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ArgMaxParameter.out_max_val)
 }
 
 // optional uint32 top_k = 2 [default = 1];
-inline bool ArgMaxParameter::has_top_k() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ArgMaxParameter::set_has_top_k() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ArgMaxParameter::_internal_has_top_k() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ArgMaxParameter::clear_has_top_k() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ArgMaxParameter::has_top_k() const {
+  return _internal_has_top_k();
 }
 inline void ArgMaxParameter::clear_top_k() {
   top_k_ = 1u;
-  clear_has_top_k();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 ArgMaxParameter::top_k() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ArgMaxParameter.top_k)
+inline uint32_t ArgMaxParameter::_internal_top_k() const {
   return top_k_;
 }
-inline void ArgMaxParameter::set_top_k(::google::protobuf::uint32 value) {
-  set_has_top_k();
+inline uint32_t ArgMaxParameter::top_k() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ArgMaxParameter.top_k)
+  return _internal_top_k();
+}
+inline void ArgMaxParameter::_internal_set_top_k(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   top_k_ = value;
+}
+inline void ArgMaxParameter::set_top_k(uint32_t value) {
+  _internal_set_top_k(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ArgMaxParameter.top_k)
 }
 
 // optional int32 axis = 3;
-inline bool ArgMaxParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ArgMaxParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ArgMaxParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ArgMaxParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ArgMaxParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void ArgMaxParameter::clear_axis() {
   axis_ = 0;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 ArgMaxParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ArgMaxParameter.axis)
+inline int32_t ArgMaxParameter::_internal_axis() const {
   return axis_;
 }
-inline void ArgMaxParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t ArgMaxParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ArgMaxParameter.axis)
+  return _internal_axis();
+}
+inline void ArgMaxParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   axis_ = value;
+}
+inline void ArgMaxParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ArgMaxParameter.axis)
 }
 
@@ -22671,50 +31903,58 @@ inline void ArgMaxParameter::set_axis(::google::protobuf::int32 value) {
 // ConcatParameter
 
 // optional int32 axis = 2 [default = 1];
-inline bool ConcatParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ConcatParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ConcatParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ConcatParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ConcatParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void ConcatParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 ConcatParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConcatParameter.axis)
+inline int32_t ConcatParameter::_internal_axis() const {
   return axis_;
 }
-inline void ConcatParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t ConcatParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConcatParameter.axis)
+  return _internal_axis();
+}
+inline void ConcatParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   axis_ = value;
+}
+inline void ConcatParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConcatParameter.axis)
 }
 
 // optional uint32 concat_dim = 1 [default = 1];
-inline bool ConcatParameter::has_concat_dim() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool ConcatParameter::_internal_has_concat_dim() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ConcatParameter::set_has_concat_dim() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void ConcatParameter::clear_has_concat_dim() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ConcatParameter::has_concat_dim() const {
+  return _internal_has_concat_dim();
 }
 inline void ConcatParameter::clear_concat_dim() {
   concat_dim_ = 1u;
-  clear_has_concat_dim();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::uint32 ConcatParameter::concat_dim() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConcatParameter.concat_dim)
+inline uint32_t ConcatParameter::_internal_concat_dim() const {
   return concat_dim_;
 }
-inline void ConcatParameter::set_concat_dim(::google::protobuf::uint32 value) {
-  set_has_concat_dim();
+inline uint32_t ConcatParameter::concat_dim() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConcatParameter.concat_dim)
+  return _internal_concat_dim();
+}
+inline void ConcatParameter::_internal_set_concat_dim(uint32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   concat_dim_ = value;
+}
+inline void ConcatParameter::set_concat_dim(uint32_t value) {
+  _internal_set_concat_dim(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConcatParameter.concat_dim)
 }
 
@@ -22723,98 +31963,114 @@ inline void ConcatParameter::set_concat_dim(::google::protobuf::uint32 value) {
 // BatchNormParameter
 
 // optional bool use_global_stats = 1;
-inline bool BatchNormParameter::has_use_global_stats() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void BatchNormParameter::set_has_use_global_stats() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool BatchNormParameter::_internal_has_use_global_stats() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void BatchNormParameter::clear_has_use_global_stats() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool BatchNormParameter::has_use_global_stats() const {
+  return _internal_has_use_global_stats();
 }
 inline void BatchNormParameter::clear_use_global_stats() {
   use_global_stats_ = false;
-  clear_has_use_global_stats();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool BatchNormParameter::_internal_use_global_stats() const {
+  return use_global_stats_;
 }
 inline bool BatchNormParameter::use_global_stats() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BatchNormParameter.use_global_stats)
-  return use_global_stats_;
+  return _internal_use_global_stats();
 }
-inline void BatchNormParameter::set_use_global_stats(bool value) {
-  set_has_use_global_stats();
+inline void BatchNormParameter::_internal_set_use_global_stats(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   use_global_stats_ = value;
+}
+inline void BatchNormParameter::set_use_global_stats(bool value) {
+  _internal_set_use_global_stats(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BatchNormParameter.use_global_stats)
 }
 
 // optional float moving_average_fraction = 2 [default = 0.999];
-inline bool BatchNormParameter::has_moving_average_fraction() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool BatchNormParameter::_internal_has_moving_average_fraction() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void BatchNormParameter::set_has_moving_average_fraction() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void BatchNormParameter::clear_has_moving_average_fraction() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool BatchNormParameter::has_moving_average_fraction() const {
+  return _internal_has_moving_average_fraction();
 }
 inline void BatchNormParameter::clear_moving_average_fraction() {
   moving_average_fraction_ = 0.999f;
-  clear_has_moving_average_fraction();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float BatchNormParameter::_internal_moving_average_fraction() const {
+  return moving_average_fraction_;
 }
 inline float BatchNormParameter::moving_average_fraction() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BatchNormParameter.moving_average_fraction)
-  return moving_average_fraction_;
+  return _internal_moving_average_fraction();
 }
-inline void BatchNormParameter::set_moving_average_fraction(float value) {
-  set_has_moving_average_fraction();
+inline void BatchNormParameter::_internal_set_moving_average_fraction(float value) {
+  _has_bits_[0] |= 0x00000004u;
   moving_average_fraction_ = value;
+}
+inline void BatchNormParameter::set_moving_average_fraction(float value) {
+  _internal_set_moving_average_fraction(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BatchNormParameter.moving_average_fraction)
 }
 
 // optional float eps = 3 [default = 1e-05];
-inline bool BatchNormParameter::has_eps() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void BatchNormParameter::set_has_eps() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool BatchNormParameter::_internal_has_eps() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void BatchNormParameter::clear_has_eps() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool BatchNormParameter::has_eps() const {
+  return _internal_has_eps();
 }
 inline void BatchNormParameter::clear_eps() {
   eps_ = 1e-05f;
-  clear_has_eps();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline float BatchNormParameter::_internal_eps() const {
+  return eps_;
 }
 inline float BatchNormParameter::eps() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BatchNormParameter.eps)
-  return eps_;
+  return _internal_eps();
 }
-inline void BatchNormParameter::set_eps(float value) {
-  set_has_eps();
+inline void BatchNormParameter::_internal_set_eps(float value) {
+  _has_bits_[0] |= 0x00000008u;
   eps_ = value;
+}
+inline void BatchNormParameter::set_eps(float value) {
+  _internal_set_eps(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BatchNormParameter.eps)
 }
 
 // optional bool scale_bias = 7 [default = false];
-inline bool BatchNormParameter::has_scale_bias() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void BatchNormParameter::set_has_scale_bias() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool BatchNormParameter::_internal_has_scale_bias() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void BatchNormParameter::clear_has_scale_bias() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool BatchNormParameter::has_scale_bias() const {
+  return _internal_has_scale_bias();
 }
 inline void BatchNormParameter::clear_scale_bias() {
   scale_bias_ = false;
-  clear_has_scale_bias();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool BatchNormParameter::_internal_scale_bias() const {
+  return scale_bias_;
 }
 inline bool BatchNormParameter::scale_bias() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.BatchNormParameter.scale_bias)
-  return scale_bias_;
+  return _internal_scale_bias();
 }
-inline void BatchNormParameter::set_scale_bias(bool value) {
-  set_has_scale_bias();
+inline void BatchNormParameter::_internal_set_scale_bias(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   scale_bias_ = value;
+}
+inline void BatchNormParameter::set_scale_bias(bool value) {
+  _internal_set_scale_bias(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BatchNormParameter.scale_bias)
 }
 
@@ -22823,102 +32079,146 @@ inline void BatchNormParameter::set_scale_bias(bool value) {
 // BiasParameter
 
 // optional int32 axis = 1 [default = 1];
-inline bool BiasParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void BiasParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool BiasParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void BiasParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool BiasParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void BiasParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 BiasParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.BiasParameter.axis)
+inline int32_t BiasParameter::_internal_axis() const {
   return axis_;
 }
-inline void BiasParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t BiasParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.BiasParameter.axis)
+  return _internal_axis();
+}
+inline void BiasParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   axis_ = value;
+}
+inline void BiasParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BiasParameter.axis)
 }
 
 // optional int32 num_axes = 2 [default = 1];
-inline bool BiasParameter::has_num_axes() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void BiasParameter::set_has_num_axes() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool BiasParameter::_internal_has_num_axes() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void BiasParameter::clear_has_num_axes() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool BiasParameter::has_num_axes() const {
+  return _internal_has_num_axes();
 }
 inline void BiasParameter::clear_num_axes() {
   num_axes_ = 1;
-  clear_has_num_axes();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 BiasParameter::num_axes() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.BiasParameter.num_axes)
+inline int32_t BiasParameter::_internal_num_axes() const {
   return num_axes_;
 }
-inline void BiasParameter::set_num_axes(::google::protobuf::int32 value) {
-  set_has_num_axes();
+inline int32_t BiasParameter::num_axes() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.BiasParameter.num_axes)
+  return _internal_num_axes();
+}
+inline void BiasParameter::_internal_set_num_axes(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   num_axes_ = value;
+}
+inline void BiasParameter::set_num_axes(int32_t value) {
+  _internal_set_num_axes(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.BiasParameter.num_axes)
 }
 
 // optional .opencv_caffe.FillerParameter filler = 3;
-inline bool BiasParameter::has_filler() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool BiasParameter::_internal_has_filler() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || filler_ != nullptr);
+  return value;
 }
-inline void BiasParameter::set_has_filler() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool BiasParameter::has_filler() const {
+  return _internal_has_filler();
 }
-inline void BiasParameter::clear_has_filler() {
+inline void BiasParameter::clear_filler() {
+  if (filler_ != nullptr) filler_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void BiasParameter::clear_filler() {
-  if (filler_ != NULL) filler_->Clear();
-  clear_has_filler();
+inline const ::opencv_caffe::FillerParameter& BiasParameter::_internal_filler() const {
+  const ::opencv_caffe::FillerParameter* p = filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& BiasParameter::filler() const {
-  const ::opencv_caffe::FillerParameter* p = filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.BiasParameter.filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_filler();
+}
+inline void BiasParameter::unsafe_arena_set_allocated_filler(
+    ::opencv_caffe::FillerParameter* filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(filler_);
+  }
+  filler_ = filler;
+  if (filler) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.BiasParameter.filler)
 }
 inline ::opencv_caffe::FillerParameter* BiasParameter::release_filler() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::FillerParameter* temp = filler_;
+  filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* BiasParameter::unsafe_arena_release_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.BiasParameter.filler)
-  clear_has_filler();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::FillerParameter* temp = filler_;
-  filler_ = NULL;
+  filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* BiasParameter::mutable_filler() {
-  set_has_filler();
-  if (filler_ == NULL) {
-    filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* BiasParameter::_internal_mutable_filler() {
+  _has_bits_[0] |= 0x00000001u;
+  if (filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.BiasParameter.filler)
   return filler_;
 }
+inline ::opencv_caffe::FillerParameter* BiasParameter::mutable_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.BiasParameter.filler)
+  return _msg;
+}
 inline void BiasParameter::set_allocated_filler(::opencv_caffe::FillerParameter* filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete filler_;
   }
   if (filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(filler);
     if (message_arena != submessage_arena) {
-      filler = ::google::protobuf::internal::GetOwnedMessage(
+      filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, filler, submessage_arena);
     }
-    set_has_filler();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_filler();
+    _has_bits_[0] &= ~0x00000001u;
   }
   filler_ = filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.BiasParameter.filler)
@@ -22929,50 +32229,58 @@ inline void BiasParameter::set_allocated_filler(::opencv_caffe::FillerParameter*
 // ContrastiveLossParameter
 
 // optional float margin = 1 [default = 1];
-inline bool ContrastiveLossParameter::has_margin() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ContrastiveLossParameter::set_has_margin() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ContrastiveLossParameter::_internal_has_margin() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ContrastiveLossParameter::clear_has_margin() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ContrastiveLossParameter::has_margin() const {
+  return _internal_has_margin();
 }
 inline void ContrastiveLossParameter::clear_margin() {
   margin_ = 1;
-  clear_has_margin();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline float ContrastiveLossParameter::_internal_margin() const {
+  return margin_;
 }
 inline float ContrastiveLossParameter::margin() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ContrastiveLossParameter.margin)
-  return margin_;
+  return _internal_margin();
+}
+inline void ContrastiveLossParameter::_internal_set_margin(float value) {
+  _has_bits_[0] |= 0x00000002u;
+  margin_ = value;
 }
 inline void ContrastiveLossParameter::set_margin(float value) {
-  set_has_margin();
-  margin_ = value;
+  _internal_set_margin(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ContrastiveLossParameter.margin)
 }
 
 // optional bool legacy_version = 2 [default = false];
-inline bool ContrastiveLossParameter::has_legacy_version() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ContrastiveLossParameter::set_has_legacy_version() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ContrastiveLossParameter::_internal_has_legacy_version() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ContrastiveLossParameter::clear_has_legacy_version() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ContrastiveLossParameter::has_legacy_version() const {
+  return _internal_has_legacy_version();
 }
 inline void ContrastiveLossParameter::clear_legacy_version() {
   legacy_version_ = false;
-  clear_has_legacy_version();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool ContrastiveLossParameter::_internal_legacy_version() const {
+  return legacy_version_;
 }
 inline bool ContrastiveLossParameter::legacy_version() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ContrastiveLossParameter.legacy_version)
-  return legacy_version_;
+  return _internal_legacy_version();
 }
-inline void ContrastiveLossParameter::set_legacy_version(bool value) {
-  set_has_legacy_version();
+inline void ContrastiveLossParameter::_internal_set_legacy_version(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   legacy_version_ = value;
+}
+inline void ContrastiveLossParameter::set_legacy_version(bool value) {
+  _internal_set_legacy_version(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ContrastiveLossParameter.legacy_version)
 }
 
@@ -22981,519 +32289,707 @@ inline void ContrastiveLossParameter::set_legacy_version(bool value) {
 // ConvolutionParameter
 
 // optional uint32 num_output = 1;
-inline bool ConvolutionParameter::has_num_output() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ConvolutionParameter::set_has_num_output() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ConvolutionParameter::_internal_has_num_output() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_num_output() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ConvolutionParameter::has_num_output() const {
+  return _internal_has_num_output();
 }
 inline void ConvolutionParameter::clear_num_output() {
   num_output_ = 0u;
-  clear_has_num_output();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::num_output() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.num_output)
+inline uint32_t ConvolutionParameter::_internal_num_output() const {
   return num_output_;
 }
-inline void ConvolutionParameter::set_num_output(::google::protobuf::uint32 value) {
-  set_has_num_output();
+inline uint32_t ConvolutionParameter::num_output() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.num_output)
+  return _internal_num_output();
+}
+inline void ConvolutionParameter::_internal_set_num_output(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   num_output_ = value;
+}
+inline void ConvolutionParameter::set_num_output(uint32_t value) {
+  _internal_set_num_output(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.num_output)
 }
 
 // optional bool bias_term = 2 [default = true];
-inline bool ConvolutionParameter::has_bias_term() const {
-  return (_has_bits_[0] & 0x00001000u) != 0;
-}
-inline void ConvolutionParameter::set_has_bias_term() {
-  _has_bits_[0] |= 0x00001000u;
+inline bool ConvolutionParameter::_internal_has_bias_term() const {
+  bool value = (_has_bits_[0] & 0x00001000u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_bias_term() {
-  _has_bits_[0] &= ~0x00001000u;
+inline bool ConvolutionParameter::has_bias_term() const {
+  return _internal_has_bias_term();
 }
 inline void ConvolutionParameter::clear_bias_term() {
   bias_term_ = true;
-  clear_has_bias_term();
+  _has_bits_[0] &= ~0x00001000u;
+}
+inline bool ConvolutionParameter::_internal_bias_term() const {
+  return bias_term_;
 }
 inline bool ConvolutionParameter::bias_term() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.bias_term)
-  return bias_term_;
+  return _internal_bias_term();
 }
-inline void ConvolutionParameter::set_bias_term(bool value) {
-  set_has_bias_term();
+inline void ConvolutionParameter::_internal_set_bias_term(bool value) {
+  _has_bits_[0] |= 0x00001000u;
   bias_term_ = value;
+}
+inline void ConvolutionParameter::set_bias_term(bool value) {
+  _internal_set_bias_term(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.bias_term)
 }
 
 // repeated uint32 pad = 3;
-inline int ConvolutionParameter::pad_size() const {
+inline int ConvolutionParameter::_internal_pad_size() const {
   return pad_.size();
 }
+inline int ConvolutionParameter::pad_size() const {
+  return _internal_pad_size();
+}
 inline void ConvolutionParameter::clear_pad() {
   pad_.Clear();
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::pad(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.pad)
+inline uint32_t ConvolutionParameter::_internal_pad(int index) const {
   return pad_.Get(index);
 }
-inline void ConvolutionParameter::set_pad(int index, ::google::protobuf::uint32 value) {
+inline uint32_t ConvolutionParameter::pad(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.pad)
+  return _internal_pad(index);
+}
+inline void ConvolutionParameter::set_pad(int index, uint32_t value) {
   pad_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.pad)
 }
-inline void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) {
+inline void ConvolutionParameter::_internal_add_pad(uint32_t value) {
   pad_.Add(value);
+}
+inline void ConvolutionParameter::add_pad(uint32_t value) {
+  _internal_add_pad(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.ConvolutionParameter.pad)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+ConvolutionParameter::_internal_pad() const {
+  return pad_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 ConvolutionParameter::pad() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.ConvolutionParameter.pad)
-  return pad_;
+  return _internal_pad();
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+ConvolutionParameter::_internal_mutable_pad() {
+  return &pad_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 ConvolutionParameter::mutable_pad() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.ConvolutionParameter.pad)
-  return &pad_;
+  return _internal_mutable_pad();
 }
 
 // repeated uint32 kernel_size = 4;
-inline int ConvolutionParameter::kernel_size_size() const {
+inline int ConvolutionParameter::_internal_kernel_size_size() const {
   return kernel_size_.size();
 }
+inline int ConvolutionParameter::kernel_size_size() const {
+  return _internal_kernel_size_size();
+}
 inline void ConvolutionParameter::clear_kernel_size() {
   kernel_size_.Clear();
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::kernel_size(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.kernel_size)
+inline uint32_t ConvolutionParameter::_internal_kernel_size(int index) const {
   return kernel_size_.Get(index);
 }
-inline void ConvolutionParameter::set_kernel_size(int index, ::google::protobuf::uint32 value) {
+inline uint32_t ConvolutionParameter::kernel_size(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.kernel_size)
+  return _internal_kernel_size(index);
+}
+inline void ConvolutionParameter::set_kernel_size(int index, uint32_t value) {
   kernel_size_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.kernel_size)
 }
-inline void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) {
+inline void ConvolutionParameter::_internal_add_kernel_size(uint32_t value) {
   kernel_size_.Add(value);
+}
+inline void ConvolutionParameter::add_kernel_size(uint32_t value) {
+  _internal_add_kernel_size(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.ConvolutionParameter.kernel_size)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+ConvolutionParameter::_internal_kernel_size() const {
+  return kernel_size_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 ConvolutionParameter::kernel_size() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.ConvolutionParameter.kernel_size)
-  return kernel_size_;
+  return _internal_kernel_size();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+ConvolutionParameter::_internal_mutable_kernel_size() {
+  return &kernel_size_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 ConvolutionParameter::mutable_kernel_size() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.ConvolutionParameter.kernel_size)
-  return &kernel_size_;
+  return _internal_mutable_kernel_size();
 }
 
 // repeated uint32 stride = 6;
-inline int ConvolutionParameter::stride_size() const {
+inline int ConvolutionParameter::_internal_stride_size() const {
   return stride_.size();
 }
+inline int ConvolutionParameter::stride_size() const {
+  return _internal_stride_size();
+}
 inline void ConvolutionParameter::clear_stride() {
   stride_.Clear();
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::stride(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.stride)
+inline uint32_t ConvolutionParameter::_internal_stride(int index) const {
   return stride_.Get(index);
 }
-inline void ConvolutionParameter::set_stride(int index, ::google::protobuf::uint32 value) {
+inline uint32_t ConvolutionParameter::stride(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.stride)
+  return _internal_stride(index);
+}
+inline void ConvolutionParameter::set_stride(int index, uint32_t value) {
   stride_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.stride)
 }
-inline void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) {
+inline void ConvolutionParameter::_internal_add_stride(uint32_t value) {
   stride_.Add(value);
+}
+inline void ConvolutionParameter::add_stride(uint32_t value) {
+  _internal_add_stride(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.ConvolutionParameter.stride)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+ConvolutionParameter::_internal_stride() const {
+  return stride_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 ConvolutionParameter::stride() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.ConvolutionParameter.stride)
-  return stride_;
+  return _internal_stride();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+ConvolutionParameter::_internal_mutable_stride() {
+  return &stride_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 ConvolutionParameter::mutable_stride() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.ConvolutionParameter.stride)
-  return &stride_;
+  return _internal_mutable_stride();
 }
 
 // repeated uint32 dilation = 18;
-inline int ConvolutionParameter::dilation_size() const {
+inline int ConvolutionParameter::_internal_dilation_size() const {
   return dilation_.size();
 }
+inline int ConvolutionParameter::dilation_size() const {
+  return _internal_dilation_size();
+}
 inline void ConvolutionParameter::clear_dilation() {
   dilation_.Clear();
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::dilation(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.dilation)
+inline uint32_t ConvolutionParameter::_internal_dilation(int index) const {
   return dilation_.Get(index);
 }
-inline void ConvolutionParameter::set_dilation(int index, ::google::protobuf::uint32 value) {
+inline uint32_t ConvolutionParameter::dilation(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.dilation)
+  return _internal_dilation(index);
+}
+inline void ConvolutionParameter::set_dilation(int index, uint32_t value) {
   dilation_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.dilation)
 }
-inline void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) {
+inline void ConvolutionParameter::_internal_add_dilation(uint32_t value) {
   dilation_.Add(value);
+}
+inline void ConvolutionParameter::add_dilation(uint32_t value) {
+  _internal_add_dilation(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.ConvolutionParameter.dilation)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+ConvolutionParameter::_internal_dilation() const {
+  return dilation_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 ConvolutionParameter::dilation() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.ConvolutionParameter.dilation)
-  return dilation_;
+  return _internal_dilation();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+ConvolutionParameter::_internal_mutable_dilation() {
+  return &dilation_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 ConvolutionParameter::mutable_dilation() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.ConvolutionParameter.dilation)
-  return &dilation_;
+  return _internal_mutable_dilation();
 }
 
 // optional uint32 pad_h = 9 [default = 0];
-inline bool ConvolutionParameter::has_pad_h() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void ConvolutionParameter::set_has_pad_h() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool ConvolutionParameter::_internal_has_pad_h() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_pad_h() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool ConvolutionParameter::has_pad_h() const {
+  return _internal_has_pad_h();
 }
 inline void ConvolutionParameter::clear_pad_h() {
   pad_h_ = 0u;
-  clear_has_pad_h();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::pad_h() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.pad_h)
+inline uint32_t ConvolutionParameter::_internal_pad_h() const {
   return pad_h_;
 }
-inline void ConvolutionParameter::set_pad_h(::google::protobuf::uint32 value) {
-  set_has_pad_h();
+inline uint32_t ConvolutionParameter::pad_h() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.pad_h)
+  return _internal_pad_h();
+}
+inline void ConvolutionParameter::_internal_set_pad_h(uint32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   pad_h_ = value;
+}
+inline void ConvolutionParameter::set_pad_h(uint32_t value) {
+  _internal_set_pad_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.pad_h)
 }
 
 // optional uint32 pad_w = 10 [default = 0];
-inline bool ConvolutionParameter::has_pad_w() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void ConvolutionParameter::set_has_pad_w() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool ConvolutionParameter::_internal_has_pad_w() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_pad_w() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool ConvolutionParameter::has_pad_w() const {
+  return _internal_has_pad_w();
 }
 inline void ConvolutionParameter::clear_pad_w() {
   pad_w_ = 0u;
-  clear_has_pad_w();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::pad_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.pad_w)
+inline uint32_t ConvolutionParameter::_internal_pad_w() const {
   return pad_w_;
 }
-inline void ConvolutionParameter::set_pad_w(::google::protobuf::uint32 value) {
-  set_has_pad_w();
+inline uint32_t ConvolutionParameter::pad_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.pad_w)
+  return _internal_pad_w();
+}
+inline void ConvolutionParameter::_internal_set_pad_w(uint32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   pad_w_ = value;
+}
+inline void ConvolutionParameter::set_pad_w(uint32_t value) {
+  _internal_set_pad_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.pad_w)
 }
 
 // optional uint32 kernel_h = 11;
-inline bool ConvolutionParameter::has_kernel_h() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void ConvolutionParameter::set_has_kernel_h() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool ConvolutionParameter::_internal_has_kernel_h() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_kernel_h() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool ConvolutionParameter::has_kernel_h() const {
+  return _internal_has_kernel_h();
 }
 inline void ConvolutionParameter::clear_kernel_h() {
   kernel_h_ = 0u;
-  clear_has_kernel_h();
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::kernel_h() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.kernel_h)
+inline uint32_t ConvolutionParameter::_internal_kernel_h() const {
   return kernel_h_;
 }
-inline void ConvolutionParameter::set_kernel_h(::google::protobuf::uint32 value) {
-  set_has_kernel_h();
+inline uint32_t ConvolutionParameter::kernel_h() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.kernel_h)
+  return _internal_kernel_h();
+}
+inline void ConvolutionParameter::_internal_set_kernel_h(uint32_t value) {
+  _has_bits_[0] |= 0x00000020u;
   kernel_h_ = value;
+}
+inline void ConvolutionParameter::set_kernel_h(uint32_t value) {
+  _internal_set_kernel_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.kernel_h)
 }
 
 // optional uint32 kernel_w = 12;
-inline bool ConvolutionParameter::has_kernel_w() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+inline bool ConvolutionParameter::_internal_has_kernel_w() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::set_has_kernel_w() {
-  _has_bits_[0] |= 0x00000040u;
-}
-inline void ConvolutionParameter::clear_has_kernel_w() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool ConvolutionParameter::has_kernel_w() const {
+  return _internal_has_kernel_w();
 }
 inline void ConvolutionParameter::clear_kernel_w() {
   kernel_w_ = 0u;
-  clear_has_kernel_w();
+  _has_bits_[0] &= ~0x00000040u;
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::kernel_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.kernel_w)
+inline uint32_t ConvolutionParameter::_internal_kernel_w() const {
   return kernel_w_;
 }
-inline void ConvolutionParameter::set_kernel_w(::google::protobuf::uint32 value) {
-  set_has_kernel_w();
+inline uint32_t ConvolutionParameter::kernel_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.kernel_w)
+  return _internal_kernel_w();
+}
+inline void ConvolutionParameter::_internal_set_kernel_w(uint32_t value) {
+  _has_bits_[0] |= 0x00000040u;
   kernel_w_ = value;
+}
+inline void ConvolutionParameter::set_kernel_w(uint32_t value) {
+  _internal_set_kernel_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.kernel_w)
 }
 
 // optional uint32 stride_h = 13;
-inline bool ConvolutionParameter::has_stride_h() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void ConvolutionParameter::set_has_stride_h() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool ConvolutionParameter::_internal_has_stride_h() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_stride_h() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool ConvolutionParameter::has_stride_h() const {
+  return _internal_has_stride_h();
 }
 inline void ConvolutionParameter::clear_stride_h() {
   stride_h_ = 0u;
-  clear_has_stride_h();
+  _has_bits_[0] &= ~0x00000080u;
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::stride_h() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.stride_h)
+inline uint32_t ConvolutionParameter::_internal_stride_h() const {
   return stride_h_;
 }
-inline void ConvolutionParameter::set_stride_h(::google::protobuf::uint32 value) {
-  set_has_stride_h();
+inline uint32_t ConvolutionParameter::stride_h() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.stride_h)
+  return _internal_stride_h();
+}
+inline void ConvolutionParameter::_internal_set_stride_h(uint32_t value) {
+  _has_bits_[0] |= 0x00000080u;
   stride_h_ = value;
+}
+inline void ConvolutionParameter::set_stride_h(uint32_t value) {
+  _internal_set_stride_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.stride_h)
 }
 
 // optional uint32 stride_w = 14;
-inline bool ConvolutionParameter::has_stride_w() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void ConvolutionParameter::set_has_stride_w() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool ConvolutionParameter::_internal_has_stride_w() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_stride_w() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool ConvolutionParameter::has_stride_w() const {
+  return _internal_has_stride_w();
 }
 inline void ConvolutionParameter::clear_stride_w() {
   stride_w_ = 0u;
-  clear_has_stride_w();
+  _has_bits_[0] &= ~0x00000100u;
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::stride_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.stride_w)
+inline uint32_t ConvolutionParameter::_internal_stride_w() const {
   return stride_w_;
 }
-inline void ConvolutionParameter::set_stride_w(::google::protobuf::uint32 value) {
-  set_has_stride_w();
+inline uint32_t ConvolutionParameter::stride_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.stride_w)
+  return _internal_stride_w();
+}
+inline void ConvolutionParameter::_internal_set_stride_w(uint32_t value) {
+  _has_bits_[0] |= 0x00000100u;
   stride_w_ = value;
+}
+inline void ConvolutionParameter::set_stride_w(uint32_t value) {
+  _internal_set_stride_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.stride_w)
 }
 
 // optional uint32 group = 5 [default = 1];
-inline bool ConvolutionParameter::has_group() const {
-  return (_has_bits_[0] & 0x00002000u) != 0;
-}
-inline void ConvolutionParameter::set_has_group() {
-  _has_bits_[0] |= 0x00002000u;
+inline bool ConvolutionParameter::_internal_has_group() const {
+  bool value = (_has_bits_[0] & 0x00002000u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_group() {
-  _has_bits_[0] &= ~0x00002000u;
+inline bool ConvolutionParameter::has_group() const {
+  return _internal_has_group();
 }
 inline void ConvolutionParameter::clear_group() {
   group_ = 1u;
-  clear_has_group();
+  _has_bits_[0] &= ~0x00002000u;
 }
-inline ::google::protobuf::uint32 ConvolutionParameter::group() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.group)
+inline uint32_t ConvolutionParameter::_internal_group() const {
   return group_;
 }
-inline void ConvolutionParameter::set_group(::google::protobuf::uint32 value) {
-  set_has_group();
+inline uint32_t ConvolutionParameter::group() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.group)
+  return _internal_group();
+}
+inline void ConvolutionParameter::_internal_set_group(uint32_t value) {
+  _has_bits_[0] |= 0x00002000u;
   group_ = value;
+}
+inline void ConvolutionParameter::set_group(uint32_t value) {
+  _internal_set_group(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.group)
 }
 
 // optional .opencv_caffe.FillerParameter weight_filler = 7;
-inline bool ConvolutionParameter::has_weight_filler() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool ConvolutionParameter::_internal_has_weight_filler() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || weight_filler_ != nullptr);
+  return value;
 }
-inline void ConvolutionParameter::set_has_weight_filler() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ConvolutionParameter::has_weight_filler() const {
+  return _internal_has_weight_filler();
 }
-inline void ConvolutionParameter::clear_has_weight_filler() {
+inline void ConvolutionParameter::clear_weight_filler() {
+  if (weight_filler_ != nullptr) weight_filler_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void ConvolutionParameter::clear_weight_filler() {
-  if (weight_filler_ != NULL) weight_filler_->Clear();
-  clear_has_weight_filler();
+inline const ::opencv_caffe::FillerParameter& ConvolutionParameter::_internal_weight_filler() const {
+  const ::opencv_caffe::FillerParameter* p = weight_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& ConvolutionParameter::weight_filler() const {
-  const ::opencv_caffe::FillerParameter* p = weight_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.weight_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_weight_filler();
+}
+inline void ConvolutionParameter::unsafe_arena_set_allocated_weight_filler(
+    ::opencv_caffe::FillerParameter* weight_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(weight_filler_);
+  }
+  weight_filler_ = weight_filler;
+  if (weight_filler) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.ConvolutionParameter.weight_filler)
 }
 inline ::opencv_caffe::FillerParameter* ConvolutionParameter::release_weight_filler() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::FillerParameter* temp = weight_filler_;
+  weight_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* ConvolutionParameter::unsafe_arena_release_weight_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ConvolutionParameter.weight_filler)
-  clear_has_weight_filler();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::FillerParameter* temp = weight_filler_;
-  weight_filler_ = NULL;
+  weight_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() {
-  set_has_weight_filler();
-  if (weight_filler_ == NULL) {
-    weight_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* ConvolutionParameter::_internal_mutable_weight_filler() {
+  _has_bits_[0] |= 0x00000001u;
+  if (weight_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    weight_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.ConvolutionParameter.weight_filler)
   return weight_filler_;
 }
+inline ::opencv_caffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_weight_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.ConvolutionParameter.weight_filler)
+  return _msg;
+}
 inline void ConvolutionParameter::set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete weight_filler_;
   }
   if (weight_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(weight_filler);
     if (message_arena != submessage_arena) {
-      weight_filler = ::google::protobuf::internal::GetOwnedMessage(
+      weight_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, weight_filler, submessage_arena);
     }
-    set_has_weight_filler();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_weight_filler();
+    _has_bits_[0] &= ~0x00000001u;
   }
   weight_filler_ = weight_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ConvolutionParameter.weight_filler)
 }
 
 // optional .opencv_caffe.FillerParameter bias_filler = 8;
-inline bool ConvolutionParameter::has_bias_filler() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool ConvolutionParameter::_internal_has_bias_filler() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || bias_filler_ != nullptr);
+  return value;
 }
-inline void ConvolutionParameter::set_has_bias_filler() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ConvolutionParameter::has_bias_filler() const {
+  return _internal_has_bias_filler();
 }
-inline void ConvolutionParameter::clear_has_bias_filler() {
+inline void ConvolutionParameter::clear_bias_filler() {
+  if (bias_filler_ != nullptr) bias_filler_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void ConvolutionParameter::clear_bias_filler() {
-  if (bias_filler_ != NULL) bias_filler_->Clear();
-  clear_has_bias_filler();
+inline const ::opencv_caffe::FillerParameter& ConvolutionParameter::_internal_bias_filler() const {
+  const ::opencv_caffe::FillerParameter* p = bias_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& ConvolutionParameter::bias_filler() const {
-  const ::opencv_caffe::FillerParameter* p = bias_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.bias_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_bias_filler();
+}
+inline void ConvolutionParameter::unsafe_arena_set_allocated_bias_filler(
+    ::opencv_caffe::FillerParameter* bias_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(bias_filler_);
+  }
+  bias_filler_ = bias_filler;
+  if (bias_filler) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.ConvolutionParameter.bias_filler)
 }
 inline ::opencv_caffe::FillerParameter* ConvolutionParameter::release_bias_filler() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::FillerParameter* temp = bias_filler_;
+  bias_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* ConvolutionParameter::unsafe_arena_release_bias_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ConvolutionParameter.bias_filler)
-  clear_has_bias_filler();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::FillerParameter* temp = bias_filler_;
-  bias_filler_ = NULL;
+  bias_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() {
-  set_has_bias_filler();
-  if (bias_filler_ == NULL) {
-    bias_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* ConvolutionParameter::_internal_mutable_bias_filler() {
+  _has_bits_[0] |= 0x00000002u;
+  if (bias_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    bias_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.ConvolutionParameter.bias_filler)
   return bias_filler_;
 }
+inline ::opencv_caffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_bias_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.ConvolutionParameter.bias_filler)
+  return _msg;
+}
 inline void ConvolutionParameter::set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete bias_filler_;
   }
   if (bias_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(bias_filler);
     if (message_arena != submessage_arena) {
-      bias_filler = ::google::protobuf::internal::GetOwnedMessage(
+      bias_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, bias_filler, submessage_arena);
     }
-    set_has_bias_filler();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_bias_filler();
+    _has_bits_[0] &= ~0x00000002u;
   }
   bias_filler_ = bias_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ConvolutionParameter.bias_filler)
 }
 
 // optional .opencv_caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT];
-inline bool ConvolutionParameter::has_engine() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
+inline bool ConvolutionParameter::_internal_has_engine() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::set_has_engine() {
-  _has_bits_[0] |= 0x00000200u;
-}
-inline void ConvolutionParameter::clear_has_engine() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool ConvolutionParameter::has_engine() const {
+  return _internal_has_engine();
 }
 inline void ConvolutionParameter::clear_engine() {
   engine_ = 0;
-  clear_has_engine();
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline ::opencv_caffe::ConvolutionParameter_Engine ConvolutionParameter::_internal_engine() const {
+  return static_cast< ::opencv_caffe::ConvolutionParameter_Engine >(engine_);
 }
 inline ::opencv_caffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.engine)
-  return static_cast< ::opencv_caffe::ConvolutionParameter_Engine >(engine_);
+  return _internal_engine();
 }
-inline void ConvolutionParameter::set_engine(::opencv_caffe::ConvolutionParameter_Engine value) {
+inline void ConvolutionParameter::_internal_set_engine(::opencv_caffe::ConvolutionParameter_Engine value) {
   assert(::opencv_caffe::ConvolutionParameter_Engine_IsValid(value));
-  set_has_engine();
+  _has_bits_[0] |= 0x00000200u;
   engine_ = value;
+}
+inline void ConvolutionParameter::set_engine(::opencv_caffe::ConvolutionParameter_Engine value) {
+  _internal_set_engine(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.engine)
 }
 
 // optional int32 axis = 16 [default = 1];
-inline bool ConvolutionParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
-}
-inline void ConvolutionParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000800u;
+inline bool ConvolutionParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000800u;
+inline bool ConvolutionParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void ConvolutionParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000800u;
 }
-inline ::google::protobuf::int32 ConvolutionParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.axis)
+inline int32_t ConvolutionParameter::_internal_axis() const {
   return axis_;
 }
-inline void ConvolutionParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t ConvolutionParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.axis)
+  return _internal_axis();
+}
+inline void ConvolutionParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000800u;
   axis_ = value;
+}
+inline void ConvolutionParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.axis)
 }
 
 // optional bool force_nd_im2col = 17 [default = false];
-inline bool ConvolutionParameter::has_force_nd_im2col() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+inline bool ConvolutionParameter::_internal_has_force_nd_im2col() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void ConvolutionParameter::set_has_force_nd_im2col() {
-  _has_bits_[0] |= 0x00000400u;
-}
-inline void ConvolutionParameter::clear_has_force_nd_im2col() {
-  _has_bits_[0] &= ~0x00000400u;
+inline bool ConvolutionParameter::has_force_nd_im2col() const {
+  return _internal_has_force_nd_im2col();
 }
 inline void ConvolutionParameter::clear_force_nd_im2col() {
   force_nd_im2col_ = false;
-  clear_has_force_nd_im2col();
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline bool ConvolutionParameter::_internal_force_nd_im2col() const {
+  return force_nd_im2col_;
 }
 inline bool ConvolutionParameter::force_nd_im2col() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ConvolutionParameter.force_nd_im2col)
-  return force_nd_im2col_;
+  return _internal_force_nd_im2col();
 }
-inline void ConvolutionParameter::set_force_nd_im2col(bool value) {
-  set_has_force_nd_im2col();
+inline void ConvolutionParameter::_internal_set_force_nd_im2col(bool value) {
+  _has_bits_[0] |= 0x00000400u;
   force_nd_im2col_ = value;
+}
+inline void ConvolutionParameter::set_force_nd_im2col(bool value) {
+  _internal_set_force_nd_im2col(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ConvolutionParameter.force_nd_im2col)
 }
 
@@ -23501,58 +32997,79 @@ inline void ConvolutionParameter::set_force_nd_im2col(bool value) {
 
 // CropParameter
 
-// optional int32 axis = 1 [default = 2];
-inline bool CropParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void CropParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000001u;
+// optional int32 axis = 1 [default = 2];
+inline bool CropParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void CropParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool CropParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void CropParameter::clear_axis() {
   axis_ = 2;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 CropParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.CropParameter.axis)
+inline int32_t CropParameter::_internal_axis() const {
   return axis_;
 }
-inline void CropParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t CropParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.CropParameter.axis)
+  return _internal_axis();
+}
+inline void CropParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   axis_ = value;
+}
+inline void CropParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.CropParameter.axis)
 }
 
 // repeated uint32 offset = 2;
-inline int CropParameter::offset_size() const {
+inline int CropParameter::_internal_offset_size() const {
   return offset_.size();
 }
+inline int CropParameter::offset_size() const {
+  return _internal_offset_size();
+}
 inline void CropParameter::clear_offset() {
   offset_.Clear();
 }
-inline ::google::protobuf::uint32 CropParameter::offset(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.CropParameter.offset)
+inline uint32_t CropParameter::_internal_offset(int index) const {
   return offset_.Get(index);
 }
-inline void CropParameter::set_offset(int index, ::google::protobuf::uint32 value) {
+inline uint32_t CropParameter::offset(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.CropParameter.offset)
+  return _internal_offset(index);
+}
+inline void CropParameter::set_offset(int index, uint32_t value) {
   offset_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.CropParameter.offset)
 }
-inline void CropParameter::add_offset(::google::protobuf::uint32 value) {
+inline void CropParameter::_internal_add_offset(uint32_t value) {
   offset_.Add(value);
+}
+inline void CropParameter::add_offset(uint32_t value) {
+  _internal_add_offset(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.CropParameter.offset)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+CropParameter::_internal_offset() const {
+  return offset_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 CropParameter::offset() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.CropParameter.offset)
-  return offset_;
+  return _internal_offset();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+CropParameter::_internal_mutable_offset() {
+  return &offset_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 CropParameter::mutable_offset() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.CropParameter.offset)
-  return &offset_;
+  return _internal_mutable_offset();
 }
 
 // -------------------------------------------------------------------
@@ -23560,321 +33077,365 @@ CropParameter::mutable_offset() {
 // DataParameter
 
 // optional string source = 1;
-inline bool DataParameter::has_source() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void DataParameter::set_has_source() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool DataParameter::_internal_has_source() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void DataParameter::clear_has_source() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool DataParameter::has_source() const {
+  return _internal_has_source();
 }
 inline void DataParameter::clear_source() {
-  source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_source();
+  source_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& DataParameter::source() const {
+inline const std::string& DataParameter::source() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.source)
-  return source_.GetNoArena();
+  return _internal_source();
 }
-inline void DataParameter::set_source(const ::std::string& value) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void DataParameter::set_source(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.source)
 }
-#if LANG_CXX11
-inline void DataParameter::set_source(::std::string&& value) {
-  set_has_source();
-  source_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.DataParameter.source)
-}
-#endif
-inline void DataParameter::set_source(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.DataParameter.source)
-}
-inline void DataParameter::set_source(const char* value, size_t size) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.DataParameter.source)
-}
-inline ::std::string* DataParameter::mutable_source() {
-  set_has_source();
+inline std::string* DataParameter::mutable_source() {
+  std::string* _s = _internal_mutable_source();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.DataParameter.source)
-  return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& DataParameter::_internal_source() const {
+  return source_.Get();
+}
+inline void DataParameter::_internal_set_source(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* DataParameter::_internal_mutable_source() {
+  _has_bits_[0] |= 0x00000001u;
+  return source_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* DataParameter::release_source() {
+inline std::string* DataParameter::release_source() {
   // @@protoc_insertion_point(field_release:opencv_caffe.DataParameter.source)
-  clear_has_source();
-  return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_source()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = source_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void DataParameter::set_allocated_source(::std::string* source) {
-  if (source != NULL) {
-    set_has_source();
+inline void DataParameter::set_allocated_source(std::string* source) {
+  if (source != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_source();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source);
+  source_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), source,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.DataParameter.source)
 }
 
 // optional uint32 batch_size = 4;
-inline bool DataParameter::has_batch_size() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool DataParameter::_internal_has_batch_size() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void DataParameter::set_has_batch_size() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void DataParameter::clear_has_batch_size() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool DataParameter::has_batch_size() const {
+  return _internal_has_batch_size();
 }
 inline void DataParameter::clear_batch_size() {
   batch_size_ = 0u;
-  clear_has_batch_size();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 DataParameter::batch_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.batch_size)
+inline uint32_t DataParameter::_internal_batch_size() const {
   return batch_size_;
 }
-inline void DataParameter::set_batch_size(::google::protobuf::uint32 value) {
-  set_has_batch_size();
+inline uint32_t DataParameter::batch_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.batch_size)
+  return _internal_batch_size();
+}
+inline void DataParameter::_internal_set_batch_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   batch_size_ = value;
+}
+inline void DataParameter::set_batch_size(uint32_t value) {
+  _internal_set_batch_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.batch_size)
 }
 
 // optional uint32 rand_skip = 7 [default = 0];
-inline bool DataParameter::has_rand_skip() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void DataParameter::set_has_rand_skip() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool DataParameter::_internal_has_rand_skip() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void DataParameter::clear_has_rand_skip() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool DataParameter::has_rand_skip() const {
+  return _internal_has_rand_skip();
 }
 inline void DataParameter::clear_rand_skip() {
   rand_skip_ = 0u;
-  clear_has_rand_skip();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::uint32 DataParameter::rand_skip() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.rand_skip)
+inline uint32_t DataParameter::_internal_rand_skip() const {
   return rand_skip_;
 }
-inline void DataParameter::set_rand_skip(::google::protobuf::uint32 value) {
-  set_has_rand_skip();
+inline uint32_t DataParameter::rand_skip() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.rand_skip)
+  return _internal_rand_skip();
+}
+inline void DataParameter::_internal_set_rand_skip(uint32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   rand_skip_ = value;
+}
+inline void DataParameter::set_rand_skip(uint32_t value) {
+  _internal_set_rand_skip(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.rand_skip)
 }
 
 // optional .opencv_caffe.DataParameter.DB backend = 8 [default = LEVELDB];
-inline bool DataParameter::has_backend() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void DataParameter::set_has_backend() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool DataParameter::_internal_has_backend() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void DataParameter::clear_has_backend() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool DataParameter::has_backend() const {
+  return _internal_has_backend();
 }
 inline void DataParameter::clear_backend() {
   backend_ = 0;
-  clear_has_backend();
+  _has_bits_[0] &= ~0x00000080u;
+}
+inline ::opencv_caffe::DataParameter_DB DataParameter::_internal_backend() const {
+  return static_cast< ::opencv_caffe::DataParameter_DB >(backend_);
 }
 inline ::opencv_caffe::DataParameter_DB DataParameter::backend() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.backend)
-  return static_cast< ::opencv_caffe::DataParameter_DB >(backend_);
+  return _internal_backend();
 }
-inline void DataParameter::set_backend(::opencv_caffe::DataParameter_DB value) {
+inline void DataParameter::_internal_set_backend(::opencv_caffe::DataParameter_DB value) {
   assert(::opencv_caffe::DataParameter_DB_IsValid(value));
-  set_has_backend();
+  _has_bits_[0] |= 0x00000080u;
   backend_ = value;
+}
+inline void DataParameter::set_backend(::opencv_caffe::DataParameter_DB value) {
+  _internal_set_backend(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.backend)
 }
 
 // optional float scale = 2 [default = 1];
-inline bool DataParameter::has_scale() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void DataParameter::set_has_scale() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool DataParameter::_internal_has_scale() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void DataParameter::clear_has_scale() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool DataParameter::has_scale() const {
+  return _internal_has_scale();
 }
 inline void DataParameter::clear_scale() {
   scale_ = 1;
-  clear_has_scale();
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline float DataParameter::_internal_scale() const {
+  return scale_;
 }
 inline float DataParameter::scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.scale)
-  return scale_;
+  return _internal_scale();
 }
-inline void DataParameter::set_scale(float value) {
-  set_has_scale();
+inline void DataParameter::_internal_set_scale(float value) {
+  _has_bits_[0] |= 0x00000100u;
   scale_ = value;
+}
+inline void DataParameter::set_scale(float value) {
+  _internal_set_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.scale)
 }
 
 // optional string mean_file = 3;
-inline bool DataParameter::has_mean_file() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool DataParameter::_internal_has_mean_file() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void DataParameter::set_has_mean_file() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void DataParameter::clear_has_mean_file() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool DataParameter::has_mean_file() const {
+  return _internal_has_mean_file();
 }
 inline void DataParameter::clear_mean_file() {
-  mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_mean_file();
+  mean_file_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& DataParameter::mean_file() const {
+inline const std::string& DataParameter::mean_file() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.mean_file)
-  return mean_file_.GetNoArena();
+  return _internal_mean_file();
 }
-inline void DataParameter::set_mean_file(const ::std::string& value) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void DataParameter::set_mean_file(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.mean_file)
 }
-#if LANG_CXX11
-inline void DataParameter::set_mean_file(::std::string&& value) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.DataParameter.mean_file)
-}
-#endif
-inline void DataParameter::set_mean_file(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.DataParameter.mean_file)
-}
-inline void DataParameter::set_mean_file(const char* value, size_t size) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.DataParameter.mean_file)
-}
-inline ::std::string* DataParameter::mutable_mean_file() {
-  set_has_mean_file();
+inline std::string* DataParameter::mutable_mean_file() {
+  std::string* _s = _internal_mutable_mean_file();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.DataParameter.mean_file)
-  return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& DataParameter::_internal_mean_file() const {
+  return mean_file_.Get();
 }
-inline ::std::string* DataParameter::release_mean_file() {
+inline void DataParameter::_internal_set_mean_file(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* DataParameter::_internal_mutable_mean_file() {
+  _has_bits_[0] |= 0x00000002u;
+  return mean_file_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* DataParameter::release_mean_file() {
   // @@protoc_insertion_point(field_release:opencv_caffe.DataParameter.mean_file)
-  clear_has_mean_file();
-  return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_mean_file()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = mean_file_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (mean_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void DataParameter::set_allocated_mean_file(::std::string* mean_file) {
-  if (mean_file != NULL) {
-    set_has_mean_file();
+inline void DataParameter::set_allocated_mean_file(std::string* mean_file) {
+  if (mean_file != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_mean_file();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  mean_file_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), mean_file,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (mean_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.DataParameter.mean_file)
 }
 
 // optional uint32 crop_size = 5 [default = 0];
-inline bool DataParameter::has_crop_size() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void DataParameter::set_has_crop_size() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool DataParameter::_internal_has_crop_size() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void DataParameter::clear_has_crop_size() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool DataParameter::has_crop_size() const {
+  return _internal_has_crop_size();
 }
 inline void DataParameter::clear_crop_size() {
   crop_size_ = 0u;
-  clear_has_crop_size();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::uint32 DataParameter::crop_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.crop_size)
+inline uint32_t DataParameter::_internal_crop_size() const {
   return crop_size_;
 }
-inline void DataParameter::set_crop_size(::google::protobuf::uint32 value) {
-  set_has_crop_size();
+inline uint32_t DataParameter::crop_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.crop_size)
+  return _internal_crop_size();
+}
+inline void DataParameter::_internal_set_crop_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   crop_size_ = value;
+}
+inline void DataParameter::set_crop_size(uint32_t value) {
+  _internal_set_crop_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.crop_size)
 }
 
 // optional bool mirror = 6 [default = false];
-inline bool DataParameter::has_mirror() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool DataParameter::_internal_has_mirror() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void DataParameter::set_has_mirror() {
-  _has_bits_[0] |= 0x00000020u;
-}
-inline void DataParameter::clear_has_mirror() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool DataParameter::has_mirror() const {
+  return _internal_has_mirror();
 }
 inline void DataParameter::clear_mirror() {
   mirror_ = false;
-  clear_has_mirror();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline bool DataParameter::_internal_mirror() const {
+  return mirror_;
 }
 inline bool DataParameter::mirror() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.mirror)
-  return mirror_;
+  return _internal_mirror();
 }
-inline void DataParameter::set_mirror(bool value) {
-  set_has_mirror();
+inline void DataParameter::_internal_set_mirror(bool value) {
+  _has_bits_[0] |= 0x00000020u;
   mirror_ = value;
+}
+inline void DataParameter::set_mirror(bool value) {
+  _internal_set_mirror(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.mirror)
 }
 
 // optional bool force_encoded_color = 9 [default = false];
-inline bool DataParameter::has_force_encoded_color() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void DataParameter::set_has_force_encoded_color() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool DataParameter::_internal_has_force_encoded_color() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void DataParameter::clear_has_force_encoded_color() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool DataParameter::has_force_encoded_color() const {
+  return _internal_has_force_encoded_color();
 }
 inline void DataParameter::clear_force_encoded_color() {
   force_encoded_color_ = false;
-  clear_has_force_encoded_color();
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline bool DataParameter::_internal_force_encoded_color() const {
+  return force_encoded_color_;
 }
 inline bool DataParameter::force_encoded_color() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.force_encoded_color)
-  return force_encoded_color_;
+  return _internal_force_encoded_color();
 }
-inline void DataParameter::set_force_encoded_color(bool value) {
-  set_has_force_encoded_color();
+inline void DataParameter::_internal_set_force_encoded_color(bool value) {
+  _has_bits_[0] |= 0x00000040u;
   force_encoded_color_ = value;
+}
+inline void DataParameter::set_force_encoded_color(bool value) {
+  _internal_set_force_encoded_color(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.force_encoded_color)
 }
 
 // optional uint32 prefetch = 10 [default = 4];
-inline bool DataParameter::has_prefetch() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
-}
-inline void DataParameter::set_has_prefetch() {
-  _has_bits_[0] |= 0x00000200u;
+inline bool DataParameter::_internal_has_prefetch() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void DataParameter::clear_has_prefetch() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool DataParameter::has_prefetch() const {
+  return _internal_has_prefetch();
 }
 inline void DataParameter::clear_prefetch() {
   prefetch_ = 4u;
-  clear_has_prefetch();
+  _has_bits_[0] &= ~0x00000200u;
 }
-inline ::google::protobuf::uint32 DataParameter::prefetch() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.prefetch)
+inline uint32_t DataParameter::_internal_prefetch() const {
   return prefetch_;
 }
-inline void DataParameter::set_prefetch(::google::protobuf::uint32 value) {
-  set_has_prefetch();
+inline uint32_t DataParameter::prefetch() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DataParameter.prefetch)
+  return _internal_prefetch();
+}
+inline void DataParameter::_internal_set_prefetch(uint32_t value) {
+  _has_bits_[0] |= 0x00000200u;
   prefetch_ = value;
+}
+inline void DataParameter::set_prefetch(uint32_t value) {
+  _internal_set_prefetch(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DataParameter.prefetch)
 }
 
@@ -23883,74 +33444,86 @@ inline void DataParameter::set_prefetch(::google::protobuf::uint32 value) {
 // NonMaximumSuppressionParameter
 
 // optional float nms_threshold = 1 [default = 0.3];
-inline bool NonMaximumSuppressionParameter::has_nms_threshold() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void NonMaximumSuppressionParameter::set_has_nms_threshold() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool NonMaximumSuppressionParameter::_internal_has_nms_threshold() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void NonMaximumSuppressionParameter::clear_has_nms_threshold() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool NonMaximumSuppressionParameter::has_nms_threshold() const {
+  return _internal_has_nms_threshold();
 }
 inline void NonMaximumSuppressionParameter::clear_nms_threshold() {
   nms_threshold_ = 0.3f;
-  clear_has_nms_threshold();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline float NonMaximumSuppressionParameter::_internal_nms_threshold() const {
+  return nms_threshold_;
 }
 inline float NonMaximumSuppressionParameter::nms_threshold() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NonMaximumSuppressionParameter.nms_threshold)
-  return nms_threshold_;
+  return _internal_nms_threshold();
 }
-inline void NonMaximumSuppressionParameter::set_nms_threshold(float value) {
-  set_has_nms_threshold();
+inline void NonMaximumSuppressionParameter::_internal_set_nms_threshold(float value) {
+  _has_bits_[0] |= 0x00000002u;
   nms_threshold_ = value;
+}
+inline void NonMaximumSuppressionParameter::set_nms_threshold(float value) {
+  _internal_set_nms_threshold(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NonMaximumSuppressionParameter.nms_threshold)
 }
 
 // optional int32 top_k = 2;
-inline bool NonMaximumSuppressionParameter::has_top_k() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void NonMaximumSuppressionParameter::set_has_top_k() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool NonMaximumSuppressionParameter::_internal_has_top_k() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void NonMaximumSuppressionParameter::clear_has_top_k() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool NonMaximumSuppressionParameter::has_top_k() const {
+  return _internal_has_top_k();
 }
 inline void NonMaximumSuppressionParameter::clear_top_k() {
   top_k_ = 0;
-  clear_has_top_k();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 NonMaximumSuppressionParameter::top_k() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NonMaximumSuppressionParameter.top_k)
+inline int32_t NonMaximumSuppressionParameter::_internal_top_k() const {
   return top_k_;
 }
-inline void NonMaximumSuppressionParameter::set_top_k(::google::protobuf::int32 value) {
-  set_has_top_k();
+inline int32_t NonMaximumSuppressionParameter::top_k() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NonMaximumSuppressionParameter.top_k)
+  return _internal_top_k();
+}
+inline void NonMaximumSuppressionParameter::_internal_set_top_k(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   top_k_ = value;
+}
+inline void NonMaximumSuppressionParameter::set_top_k(int32_t value) {
+  _internal_set_top_k(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NonMaximumSuppressionParameter.top_k)
 }
 
 // optional float eta = 3 [default = 1];
-inline bool NonMaximumSuppressionParameter::has_eta() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void NonMaximumSuppressionParameter::set_has_eta() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool NonMaximumSuppressionParameter::_internal_has_eta() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void NonMaximumSuppressionParameter::clear_has_eta() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool NonMaximumSuppressionParameter::has_eta() const {
+  return _internal_has_eta();
 }
 inline void NonMaximumSuppressionParameter::clear_eta() {
   eta_ = 1;
-  clear_has_eta();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float NonMaximumSuppressionParameter::_internal_eta() const {
+  return eta_;
 }
 inline float NonMaximumSuppressionParameter::eta() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NonMaximumSuppressionParameter.eta)
-  return eta_;
+  return _internal_eta();
 }
-inline void NonMaximumSuppressionParameter::set_eta(float value) {
-  set_has_eta();
+inline void NonMaximumSuppressionParameter::_internal_set_eta(float value) {
+  _has_bits_[0] |= 0x00000004u;
   eta_ = value;
+}
+inline void NonMaximumSuppressionParameter::set_eta(float value) {
+  _internal_set_eta(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NonMaximumSuppressionParameter.eta)
 }
 
@@ -23959,341 +33532,375 @@ inline void NonMaximumSuppressionParameter::set_eta(float value) {
 // SaveOutputParameter
 
 // optional string output_directory = 1;
-inline bool SaveOutputParameter::has_output_directory() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void SaveOutputParameter::set_has_output_directory() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool SaveOutputParameter::_internal_has_output_directory() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void SaveOutputParameter::clear_has_output_directory() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool SaveOutputParameter::has_output_directory() const {
+  return _internal_has_output_directory();
 }
 inline void SaveOutputParameter::clear_output_directory() {
-  output_directory_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_output_directory();
+  output_directory_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& SaveOutputParameter::output_directory() const {
+inline const std::string& SaveOutputParameter::output_directory() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SaveOutputParameter.output_directory)
-  return output_directory_.GetNoArena();
+  return _internal_output_directory();
 }
-inline void SaveOutputParameter::set_output_directory(const ::std::string& value) {
-  set_has_output_directory();
-  output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SaveOutputParameter::set_output_directory(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ output_directory_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SaveOutputParameter.output_directory)
 }
-#if LANG_CXX11
-inline void SaveOutputParameter::set_output_directory(::std::string&& value) {
-  set_has_output_directory();
-  output_directory_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SaveOutputParameter.output_directory)
-}
-#endif
-inline void SaveOutputParameter::set_output_directory(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_output_directory();
-  output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SaveOutputParameter.output_directory)
-}
-inline void SaveOutputParameter::set_output_directory(const char* value, size_t size) {
-  set_has_output_directory();
-  output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SaveOutputParameter.output_directory)
-}
-inline ::std::string* SaveOutputParameter::mutable_output_directory() {
-  set_has_output_directory();
+inline std::string* SaveOutputParameter::mutable_output_directory() {
+  std::string* _s = _internal_mutable_output_directory();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SaveOutputParameter.output_directory)
-  return output_directory_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& SaveOutputParameter::_internal_output_directory() const {
+  return output_directory_.Get();
+}
+inline void SaveOutputParameter::_internal_set_output_directory(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  output_directory_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* SaveOutputParameter::release_output_directory() {
+inline std::string* SaveOutputParameter::_internal_mutable_output_directory() {
+  _has_bits_[0] |= 0x00000001u;
+  return output_directory_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SaveOutputParameter::release_output_directory() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SaveOutputParameter.output_directory)
-  clear_has_output_directory();
-  return output_directory_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_output_directory()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = output_directory_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (output_directory_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    output_directory_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SaveOutputParameter::set_allocated_output_directory(::std::string* output_directory) {
-  if (output_directory != NULL) {
-    set_has_output_directory();
+inline void SaveOutputParameter::set_allocated_output_directory(std::string* output_directory) {
+  if (output_directory != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_output_directory();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  output_directory_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), output_directory,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (output_directory_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    output_directory_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  output_directory_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_directory);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SaveOutputParameter.output_directory)
 }
 
 // optional string output_name_prefix = 2;
-inline bool SaveOutputParameter::has_output_name_prefix() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void SaveOutputParameter::set_has_output_name_prefix() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool SaveOutputParameter::_internal_has_output_name_prefix() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void SaveOutputParameter::clear_has_output_name_prefix() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool SaveOutputParameter::has_output_name_prefix() const {
+  return _internal_has_output_name_prefix();
 }
 inline void SaveOutputParameter::clear_output_name_prefix() {
-  output_name_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_output_name_prefix();
+  output_name_prefix_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& SaveOutputParameter::output_name_prefix() const {
+inline const std::string& SaveOutputParameter::output_name_prefix() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SaveOutputParameter.output_name_prefix)
-  return output_name_prefix_.GetNoArena();
+  return _internal_output_name_prefix();
 }
-inline void SaveOutputParameter::set_output_name_prefix(const ::std::string& value) {
-  set_has_output_name_prefix();
-  output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SaveOutputParameter::set_output_name_prefix(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ output_name_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SaveOutputParameter.output_name_prefix)
 }
-#if LANG_CXX11
-inline void SaveOutputParameter::set_output_name_prefix(::std::string&& value) {
-  set_has_output_name_prefix();
-  output_name_prefix_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SaveOutputParameter.output_name_prefix)
-}
-#endif
-inline void SaveOutputParameter::set_output_name_prefix(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_output_name_prefix();
-  output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SaveOutputParameter.output_name_prefix)
-}
-inline void SaveOutputParameter::set_output_name_prefix(const char* value, size_t size) {
-  set_has_output_name_prefix();
-  output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SaveOutputParameter.output_name_prefix)
-}
-inline ::std::string* SaveOutputParameter::mutable_output_name_prefix() {
-  set_has_output_name_prefix();
+inline std::string* SaveOutputParameter::mutable_output_name_prefix() {
+  std::string* _s = _internal_mutable_output_name_prefix();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SaveOutputParameter.output_name_prefix)
-  return output_name_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& SaveOutputParameter::_internal_output_name_prefix() const {
+  return output_name_prefix_.Get();
+}
+inline void SaveOutputParameter::_internal_set_output_name_prefix(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  output_name_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SaveOutputParameter::_internal_mutable_output_name_prefix() {
+  _has_bits_[0] |= 0x00000002u;
+  return output_name_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* SaveOutputParameter::release_output_name_prefix() {
+inline std::string* SaveOutputParameter::release_output_name_prefix() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SaveOutputParameter.output_name_prefix)
-  clear_has_output_name_prefix();
-  return output_name_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_output_name_prefix()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = output_name_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (output_name_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    output_name_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SaveOutputParameter::set_allocated_output_name_prefix(::std::string* output_name_prefix) {
-  if (output_name_prefix != NULL) {
-    set_has_output_name_prefix();
+inline void SaveOutputParameter::set_allocated_output_name_prefix(std::string* output_name_prefix) {
+  if (output_name_prefix != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_output_name_prefix();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  output_name_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_name_prefix);
+  output_name_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), output_name_prefix,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (output_name_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    output_name_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SaveOutputParameter.output_name_prefix)
 }
 
 // optional string output_format = 3;
-inline bool SaveOutputParameter::has_output_format() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool SaveOutputParameter::_internal_has_output_format() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void SaveOutputParameter::set_has_output_format() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void SaveOutputParameter::clear_has_output_format() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool SaveOutputParameter::has_output_format() const {
+  return _internal_has_output_format();
 }
 inline void SaveOutputParameter::clear_output_format() {
-  output_format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_output_format();
+  output_format_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& SaveOutputParameter::output_format() const {
+inline const std::string& SaveOutputParameter::output_format() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SaveOutputParameter.output_format)
-  return output_format_.GetNoArena();
+  return _internal_output_format();
 }
-inline void SaveOutputParameter::set_output_format(const ::std::string& value) {
-  set_has_output_format();
-  output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SaveOutputParameter::set_output_format(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ output_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SaveOutputParameter.output_format)
 }
-#if LANG_CXX11
-inline void SaveOutputParameter::set_output_format(::std::string&& value) {
-  set_has_output_format();
-  output_format_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SaveOutputParameter.output_format)
-}
-#endif
-inline void SaveOutputParameter::set_output_format(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_output_format();
-  output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SaveOutputParameter.output_format)
-}
-inline void SaveOutputParameter::set_output_format(const char* value, size_t size) {
-  set_has_output_format();
-  output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SaveOutputParameter.output_format)
-}
-inline ::std::string* SaveOutputParameter::mutable_output_format() {
-  set_has_output_format();
+inline std::string* SaveOutputParameter::mutable_output_format() {
+  std::string* _s = _internal_mutable_output_format();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SaveOutputParameter.output_format)
-  return output_format_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& SaveOutputParameter::_internal_output_format() const {
+  return output_format_.Get();
 }
-inline ::std::string* SaveOutputParameter::release_output_format() {
+inline void SaveOutputParameter::_internal_set_output_format(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  output_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SaveOutputParameter::_internal_mutable_output_format() {
+  _has_bits_[0] |= 0x00000004u;
+  return output_format_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SaveOutputParameter::release_output_format() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SaveOutputParameter.output_format)
-  clear_has_output_format();
-  return output_format_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_output_format()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = output_format_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (output_format_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    output_format_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SaveOutputParameter::set_allocated_output_format(::std::string* output_format) {
-  if (output_format != NULL) {
-    set_has_output_format();
+inline void SaveOutputParameter::set_allocated_output_format(std::string* output_format) {
+  if (output_format != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_output_format();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  output_format_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), output_format,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (output_format_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    output_format_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  output_format_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_format);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SaveOutputParameter.output_format)
 }
 
 // optional string label_map_file = 4;
-inline bool SaveOutputParameter::has_label_map_file() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void SaveOutputParameter::set_has_label_map_file() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool SaveOutputParameter::_internal_has_label_map_file() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void SaveOutputParameter::clear_has_label_map_file() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool SaveOutputParameter::has_label_map_file() const {
+  return _internal_has_label_map_file();
 }
 inline void SaveOutputParameter::clear_label_map_file() {
-  label_map_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_label_map_file();
+  label_map_file_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::std::string& SaveOutputParameter::label_map_file() const {
+inline const std::string& SaveOutputParameter::label_map_file() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SaveOutputParameter.label_map_file)
-  return label_map_file_.GetNoArena();
+  return _internal_label_map_file();
 }
-inline void SaveOutputParameter::set_label_map_file(const ::std::string& value) {
-  set_has_label_map_file();
-  label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SaveOutputParameter::set_label_map_file(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ label_map_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SaveOutputParameter.label_map_file)
 }
-#if LANG_CXX11
-inline void SaveOutputParameter::set_label_map_file(::std::string&& value) {
-  set_has_label_map_file();
-  label_map_file_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SaveOutputParameter.label_map_file)
-}
-#endif
-inline void SaveOutputParameter::set_label_map_file(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_label_map_file();
-  label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SaveOutputParameter.label_map_file)
-}
-inline void SaveOutputParameter::set_label_map_file(const char* value, size_t size) {
-  set_has_label_map_file();
-  label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SaveOutputParameter.label_map_file)
-}
-inline ::std::string* SaveOutputParameter::mutable_label_map_file() {
-  set_has_label_map_file();
+inline std::string* SaveOutputParameter::mutable_label_map_file() {
+  std::string* _s = _internal_mutable_label_map_file();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SaveOutputParameter.label_map_file)
-  return label_map_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* SaveOutputParameter::release_label_map_file() {
+inline const std::string& SaveOutputParameter::_internal_label_map_file() const {
+  return label_map_file_.Get();
+}
+inline void SaveOutputParameter::_internal_set_label_map_file(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  label_map_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* SaveOutputParameter::_internal_mutable_label_map_file() {
+  _has_bits_[0] |= 0x00000008u;
+  return label_map_file_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SaveOutputParameter::release_label_map_file() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SaveOutputParameter.label_map_file)
-  clear_has_label_map_file();
-  return label_map_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_label_map_file()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000008u;
+  auto* p = label_map_file_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (label_map_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    label_map_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SaveOutputParameter::set_allocated_label_map_file(::std::string* label_map_file) {
-  if (label_map_file != NULL) {
-    set_has_label_map_file();
+inline void SaveOutputParameter::set_allocated_label_map_file(std::string* label_map_file) {
+  if (label_map_file != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_label_map_file();
+    _has_bits_[0] &= ~0x00000008u;
   }
-  label_map_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), label_map_file);
+  label_map_file_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), label_map_file,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (label_map_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    label_map_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SaveOutputParameter.label_map_file)
 }
 
 // optional string name_size_file = 5;
-inline bool SaveOutputParameter::has_name_size_file() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void SaveOutputParameter::set_has_name_size_file() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool SaveOutputParameter::_internal_has_name_size_file() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void SaveOutputParameter::clear_has_name_size_file() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool SaveOutputParameter::has_name_size_file() const {
+  return _internal_has_name_size_file();
 }
 inline void SaveOutputParameter::clear_name_size_file() {
-  name_size_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name_size_file();
+  name_size_file_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline const ::std::string& SaveOutputParameter::name_size_file() const {
+inline const std::string& SaveOutputParameter::name_size_file() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SaveOutputParameter.name_size_file)
-  return name_size_file_.GetNoArena();
+  return _internal_name_size_file();
 }
-inline void SaveOutputParameter::set_name_size_file(const ::std::string& value) {
-  set_has_name_size_file();
-  name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SaveOutputParameter::set_name_size_file(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000010u;
+ name_size_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.SaveOutputParameter.name_size_file)
 }
-#if LANG_CXX11
-inline void SaveOutputParameter::set_name_size_file(::std::string&& value) {
-  set_has_name_size_file();
-  name_size_file_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.SaveOutputParameter.name_size_file)
-}
-#endif
-inline void SaveOutputParameter::set_name_size_file(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_name_size_file();
-  name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.SaveOutputParameter.name_size_file)
-}
-inline void SaveOutputParameter::set_name_size_file(const char* value, size_t size) {
-  set_has_name_size_file();
-  name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.SaveOutputParameter.name_size_file)
-}
-inline ::std::string* SaveOutputParameter::mutable_name_size_file() {
-  set_has_name_size_file();
+inline std::string* SaveOutputParameter::mutable_name_size_file() {
+  std::string* _s = _internal_mutable_name_size_file();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.SaveOutputParameter.name_size_file)
-  return name_size_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& SaveOutputParameter::_internal_name_size_file() const {
+  return name_size_file_.Get();
+}
+inline void SaveOutputParameter::_internal_set_name_size_file(const std::string& value) {
+  _has_bits_[0] |= 0x00000010u;
+  name_size_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* SaveOutputParameter::release_name_size_file() {
+inline std::string* SaveOutputParameter::_internal_mutable_name_size_file() {
+  _has_bits_[0] |= 0x00000010u;
+  return name_size_file_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* SaveOutputParameter::release_name_size_file() {
   // @@protoc_insertion_point(field_release:opencv_caffe.SaveOutputParameter.name_size_file)
-  clear_has_name_size_file();
-  return name_size_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name_size_file()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000010u;
+  auto* p = name_size_file_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_size_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_size_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void SaveOutputParameter::set_allocated_name_size_file(::std::string* name_size_file) {
-  if (name_size_file != NULL) {
-    set_has_name_size_file();
+inline void SaveOutputParameter::set_allocated_name_size_file(std::string* name_size_file) {
+  if (name_size_file != nullptr) {
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_name_size_file();
+    _has_bits_[0] &= ~0x00000010u;
+  }
+  name_size_file_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name_size_file,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_size_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_size_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_size_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_size_file);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.SaveOutputParameter.name_size_file)
 }
 
 // optional uint32 num_test_image = 6;
-inline bool SaveOutputParameter::has_num_test_image() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void SaveOutputParameter::set_has_num_test_image() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool SaveOutputParameter::_internal_has_num_test_image() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void SaveOutputParameter::clear_has_num_test_image() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool SaveOutputParameter::has_num_test_image() const {
+  return _internal_has_num_test_image();
 }
 inline void SaveOutputParameter::clear_num_test_image() {
   num_test_image_ = 0u;
-  clear_has_num_test_image();
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline ::google::protobuf::uint32 SaveOutputParameter::num_test_image() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SaveOutputParameter.num_test_image)
+inline uint32_t SaveOutputParameter::_internal_num_test_image() const {
   return num_test_image_;
 }
-inline void SaveOutputParameter::set_num_test_image(::google::protobuf::uint32 value) {
-  set_has_num_test_image();
+inline uint32_t SaveOutputParameter::num_test_image() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SaveOutputParameter.num_test_image)
+  return _internal_num_test_image();
+}
+inline void SaveOutputParameter::_internal_set_num_test_image(uint32_t value) {
+  _has_bits_[0] |= 0x00000020u;
   num_test_image_ = value;
+}
+inline void SaveOutputParameter::set_num_test_image(uint32_t value) {
+  _internal_set_num_test_image(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SaveOutputParameter.num_test_image)
 }
 
@@ -24302,50 +33909,58 @@ inline void SaveOutputParameter::set_num_test_image(::google::protobuf::uint32 v
 // DropoutParameter
 
 // optional float dropout_ratio = 1 [default = 0.5];
-inline bool DropoutParameter::has_dropout_ratio() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void DropoutParameter::set_has_dropout_ratio() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool DropoutParameter::_internal_has_dropout_ratio() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void DropoutParameter::clear_has_dropout_ratio() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool DropoutParameter::has_dropout_ratio() const {
+  return _internal_has_dropout_ratio();
 }
 inline void DropoutParameter::clear_dropout_ratio() {
   dropout_ratio_ = 0.5f;
-  clear_has_dropout_ratio();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float DropoutParameter::_internal_dropout_ratio() const {
+  return dropout_ratio_;
 }
 inline float DropoutParameter::dropout_ratio() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DropoutParameter.dropout_ratio)
-  return dropout_ratio_;
+  return _internal_dropout_ratio();
 }
-inline void DropoutParameter::set_dropout_ratio(float value) {
-  set_has_dropout_ratio();
+inline void DropoutParameter::_internal_set_dropout_ratio(float value) {
+  _has_bits_[0] |= 0x00000001u;
   dropout_ratio_ = value;
+}
+inline void DropoutParameter::set_dropout_ratio(float value) {
+  _internal_set_dropout_ratio(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DropoutParameter.dropout_ratio)
 }
 
 // optional bool scale_train = 2 [default = true];
-inline bool DropoutParameter::has_scale_train() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void DropoutParameter::set_has_scale_train() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool DropoutParameter::_internal_has_scale_train() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void DropoutParameter::clear_has_scale_train() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool DropoutParameter::has_scale_train() const {
+  return _internal_has_scale_train();
 }
 inline void DropoutParameter::clear_scale_train() {
   scale_train_ = true;
-  clear_has_scale_train();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool DropoutParameter::_internal_scale_train() const {
+  return scale_train_;
 }
 inline bool DropoutParameter::scale_train() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.DropoutParameter.scale_train)
-  return scale_train_;
+  return _internal_scale_train();
 }
-inline void DropoutParameter::set_scale_train(bool value) {
-  set_has_scale_train();
+inline void DropoutParameter::_internal_set_scale_train(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   scale_train_ = value;
+}
+inline void DropoutParameter::set_scale_train(bool value) {
+  _internal_set_scale_train(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DropoutParameter.scale_train)
 }
 
@@ -24354,183 +33969,271 @@ inline void DropoutParameter::set_scale_train(bool value) {
 // DummyDataParameter
 
 // repeated .opencv_caffe.FillerParameter data_filler = 1;
-inline int DummyDataParameter::data_filler_size() const {
+inline int DummyDataParameter::_internal_data_filler_size() const {
   return data_filler_.size();
 }
+inline int DummyDataParameter::data_filler_size() const {
+  return _internal_data_filler_size();
+}
 inline void DummyDataParameter::clear_data_filler() {
   data_filler_.Clear();
 }
-inline const ::opencv_caffe::FillerParameter& DummyDataParameter::data_filler(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.data_filler)
-  return data_filler_.Get(index);
-}
 inline ::opencv_caffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.DummyDataParameter.data_filler)
   return data_filler_.Mutable(index);
 }
-inline ::opencv_caffe::FillerParameter* DummyDataParameter::add_data_filler() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.DummyDataParameter.data_filler)
-  return data_filler_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::FillerParameter >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::FillerParameter >*
 DummyDataParameter::mutable_data_filler() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.DummyDataParameter.data_filler)
   return &data_filler_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::FillerParameter >&
+inline const ::opencv_caffe::FillerParameter& DummyDataParameter::_internal_data_filler(int index) const {
+  return data_filler_.Get(index);
+}
+inline const ::opencv_caffe::FillerParameter& DummyDataParameter::data_filler(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.data_filler)
+  return _internal_data_filler(index);
+}
+inline ::opencv_caffe::FillerParameter* DummyDataParameter::_internal_add_data_filler() {
+  return data_filler_.Add();
+}
+inline ::opencv_caffe::FillerParameter* DummyDataParameter::add_data_filler() {
+  ::opencv_caffe::FillerParameter* _add = _internal_add_data_filler();
+  // @@protoc_insertion_point(field_add:opencv_caffe.DummyDataParameter.data_filler)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::FillerParameter >&
 DummyDataParameter::data_filler() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.DummyDataParameter.data_filler)
   return data_filler_;
 }
 
 // repeated .opencv_caffe.BlobShape shape = 6;
-inline int DummyDataParameter::shape_size() const {
+inline int DummyDataParameter::_internal_shape_size() const {
   return shape_.size();
 }
+inline int DummyDataParameter::shape_size() const {
+  return _internal_shape_size();
+}
 inline void DummyDataParameter::clear_shape() {
   shape_.Clear();
 }
-inline const ::opencv_caffe::BlobShape& DummyDataParameter::shape(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.shape)
-  return shape_.Get(index);
-}
 inline ::opencv_caffe::BlobShape* DummyDataParameter::mutable_shape(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.DummyDataParameter.shape)
   return shape_.Mutable(index);
 }
-inline ::opencv_caffe::BlobShape* DummyDataParameter::add_shape() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.DummyDataParameter.shape)
-  return shape_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >*
 DummyDataParameter::mutable_shape() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.DummyDataParameter.shape)
   return &shape_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >&
+inline const ::opencv_caffe::BlobShape& DummyDataParameter::_internal_shape(int index) const {
+  return shape_.Get(index);
+}
+inline const ::opencv_caffe::BlobShape& DummyDataParameter::shape(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.shape)
+  return _internal_shape(index);
+}
+inline ::opencv_caffe::BlobShape* DummyDataParameter::_internal_add_shape() {
+  return shape_.Add();
+}
+inline ::opencv_caffe::BlobShape* DummyDataParameter::add_shape() {
+  ::opencv_caffe::BlobShape* _add = _internal_add_shape();
+  // @@protoc_insertion_point(field_add:opencv_caffe.DummyDataParameter.shape)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >&
 DummyDataParameter::shape() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.DummyDataParameter.shape)
   return shape_;
 }
 
 // repeated uint32 num = 2;
-inline int DummyDataParameter::num_size() const {
+inline int DummyDataParameter::_internal_num_size() const {
   return num_.size();
 }
+inline int DummyDataParameter::num_size() const {
+  return _internal_num_size();
+}
 inline void DummyDataParameter::clear_num() {
   num_.Clear();
 }
-inline ::google::protobuf::uint32 DummyDataParameter::num(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.num)
+inline uint32_t DummyDataParameter::_internal_num(int index) const {
   return num_.Get(index);
 }
-inline void DummyDataParameter::set_num(int index, ::google::protobuf::uint32 value) {
+inline uint32_t DummyDataParameter::num(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.num)
+  return _internal_num(index);
+}
+inline void DummyDataParameter::set_num(int index, uint32_t value) {
   num_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DummyDataParameter.num)
 }
-inline void DummyDataParameter::add_num(::google::protobuf::uint32 value) {
+inline void DummyDataParameter::_internal_add_num(uint32_t value) {
   num_.Add(value);
+}
+inline void DummyDataParameter::add_num(uint32_t value) {
+  _internal_add_num(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.DummyDataParameter.num)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+DummyDataParameter::_internal_num() const {
+  return num_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 DummyDataParameter::num() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.DummyDataParameter.num)
-  return num_;
+  return _internal_num();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+DummyDataParameter::_internal_mutable_num() {
+  return &num_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 DummyDataParameter::mutable_num() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.DummyDataParameter.num)
-  return &num_;
+  return _internal_mutable_num();
 }
 
 // repeated uint32 channels = 3;
-inline int DummyDataParameter::channels_size() const {
+inline int DummyDataParameter::_internal_channels_size() const {
   return channels_.size();
 }
+inline int DummyDataParameter::channels_size() const {
+  return _internal_channels_size();
+}
 inline void DummyDataParameter::clear_channels() {
   channels_.Clear();
 }
-inline ::google::protobuf::uint32 DummyDataParameter::channels(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.channels)
+inline uint32_t DummyDataParameter::_internal_channels(int index) const {
   return channels_.Get(index);
 }
-inline void DummyDataParameter::set_channels(int index, ::google::protobuf::uint32 value) {
+inline uint32_t DummyDataParameter::channels(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.channels)
+  return _internal_channels(index);
+}
+inline void DummyDataParameter::set_channels(int index, uint32_t value) {
   channels_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DummyDataParameter.channels)
 }
-inline void DummyDataParameter::add_channels(::google::protobuf::uint32 value) {
+inline void DummyDataParameter::_internal_add_channels(uint32_t value) {
   channels_.Add(value);
+}
+inline void DummyDataParameter::add_channels(uint32_t value) {
+  _internal_add_channels(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.DummyDataParameter.channels)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+DummyDataParameter::_internal_channels() const {
+  return channels_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 DummyDataParameter::channels() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.DummyDataParameter.channels)
-  return channels_;
+  return _internal_channels();
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+DummyDataParameter::_internal_mutable_channels() {
+  return &channels_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 DummyDataParameter::mutable_channels() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.DummyDataParameter.channels)
-  return &channels_;
+  return _internal_mutable_channels();
 }
 
 // repeated uint32 height = 4;
-inline int DummyDataParameter::height_size() const {
+inline int DummyDataParameter::_internal_height_size() const {
   return height_.size();
 }
+inline int DummyDataParameter::height_size() const {
+  return _internal_height_size();
+}
 inline void DummyDataParameter::clear_height() {
   height_.Clear();
 }
-inline ::google::protobuf::uint32 DummyDataParameter::height(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.height)
+inline uint32_t DummyDataParameter::_internal_height(int index) const {
   return height_.Get(index);
 }
-inline void DummyDataParameter::set_height(int index, ::google::protobuf::uint32 value) {
+inline uint32_t DummyDataParameter::height(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.height)
+  return _internal_height(index);
+}
+inline void DummyDataParameter::set_height(int index, uint32_t value) {
   height_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DummyDataParameter.height)
 }
-inline void DummyDataParameter::add_height(::google::protobuf::uint32 value) {
+inline void DummyDataParameter::_internal_add_height(uint32_t value) {
   height_.Add(value);
+}
+inline void DummyDataParameter::add_height(uint32_t value) {
+  _internal_add_height(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.DummyDataParameter.height)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+DummyDataParameter::_internal_height() const {
+  return height_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 DummyDataParameter::height() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.DummyDataParameter.height)
-  return height_;
+  return _internal_height();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+DummyDataParameter::_internal_mutable_height() {
+  return &height_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 DummyDataParameter::mutable_height() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.DummyDataParameter.height)
-  return &height_;
+  return _internal_mutable_height();
 }
 
 // repeated uint32 width = 5;
-inline int DummyDataParameter::width_size() const {
+inline int DummyDataParameter::_internal_width_size() const {
   return width_.size();
 }
+inline int DummyDataParameter::width_size() const {
+  return _internal_width_size();
+}
 inline void DummyDataParameter::clear_width() {
   width_.Clear();
 }
-inline ::google::protobuf::uint32 DummyDataParameter::width(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.width)
+inline uint32_t DummyDataParameter::_internal_width(int index) const {
   return width_.Get(index);
 }
-inline void DummyDataParameter::set_width(int index, ::google::protobuf::uint32 value) {
+inline uint32_t DummyDataParameter::width(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.DummyDataParameter.width)
+  return _internal_width(index);
+}
+inline void DummyDataParameter::set_width(int index, uint32_t value) {
   width_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.DummyDataParameter.width)
 }
-inline void DummyDataParameter::add_width(::google::protobuf::uint32 value) {
+inline void DummyDataParameter::_internal_add_width(uint32_t value) {
   width_.Add(value);
+}
+inline void DummyDataParameter::add_width(uint32_t value) {
+  _internal_add_width(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.DummyDataParameter.width)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+DummyDataParameter::_internal_width() const {
+  return width_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 DummyDataParameter::width() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.DummyDataParameter.width)
-  return width_;
+  return _internal_width();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+DummyDataParameter::_internal_mutable_width() {
+  return &width_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 DummyDataParameter::mutable_width() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.DummyDataParameter.width)
-  return &width_;
+  return _internal_mutable_width();
 }
 
 // -------------------------------------------------------------------
@@ -24538,81 +34241,106 @@ DummyDataParameter::mutable_width() {
 // EltwiseParameter
 
 // optional .opencv_caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM];
-inline bool EltwiseParameter::has_operation() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void EltwiseParameter::set_has_operation() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool EltwiseParameter::_internal_has_operation() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void EltwiseParameter::clear_has_operation() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool EltwiseParameter::has_operation() const {
+  return _internal_has_operation();
 }
 inline void EltwiseParameter::clear_operation() {
   operation_ = 1;
-  clear_has_operation();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::opencv_caffe::EltwiseParameter_EltwiseOp EltwiseParameter::_internal_operation() const {
+  return static_cast< ::opencv_caffe::EltwiseParameter_EltwiseOp >(operation_);
 }
 inline ::opencv_caffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.EltwiseParameter.operation)
-  return static_cast< ::opencv_caffe::EltwiseParameter_EltwiseOp >(operation_);
+  return _internal_operation();
 }
-inline void EltwiseParameter::set_operation(::opencv_caffe::EltwiseParameter_EltwiseOp value) {
+inline void EltwiseParameter::_internal_set_operation(::opencv_caffe::EltwiseParameter_EltwiseOp value) {
   assert(::opencv_caffe::EltwiseParameter_EltwiseOp_IsValid(value));
-  set_has_operation();
+  _has_bits_[0] |= 0x00000001u;
   operation_ = value;
+}
+inline void EltwiseParameter::set_operation(::opencv_caffe::EltwiseParameter_EltwiseOp value) {
+  _internal_set_operation(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.EltwiseParameter.operation)
 }
 
 // repeated float coeff = 2;
-inline int EltwiseParameter::coeff_size() const {
+inline int EltwiseParameter::_internal_coeff_size() const {
   return coeff_.size();
 }
+inline int EltwiseParameter::coeff_size() const {
+  return _internal_coeff_size();
+}
 inline void EltwiseParameter::clear_coeff() {
   coeff_.Clear();
 }
+inline float EltwiseParameter::_internal_coeff(int index) const {
+  return coeff_.Get(index);
+}
 inline float EltwiseParameter::coeff(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.EltwiseParameter.coeff)
-  return coeff_.Get(index);
+  return _internal_coeff(index);
 }
 inline void EltwiseParameter::set_coeff(int index, float value) {
   coeff_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.EltwiseParameter.coeff)
 }
-inline void EltwiseParameter::add_coeff(float value) {
+inline void EltwiseParameter::_internal_add_coeff(float value) {
   coeff_.Add(value);
+}
+inline void EltwiseParameter::add_coeff(float value) {
+  _internal_add_coeff(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.EltwiseParameter.coeff)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+EltwiseParameter::_internal_coeff() const {
+  return coeff_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 EltwiseParameter::coeff() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.EltwiseParameter.coeff)
-  return coeff_;
+  return _internal_coeff();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+EltwiseParameter::_internal_mutable_coeff() {
+  return &coeff_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 EltwiseParameter::mutable_coeff() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.EltwiseParameter.coeff)
-  return &coeff_;
+  return _internal_mutable_coeff();
 }
 
 // optional bool stable_prod_grad = 3 [default = true];
-inline bool EltwiseParameter::has_stable_prod_grad() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void EltwiseParameter::set_has_stable_prod_grad() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool EltwiseParameter::_internal_has_stable_prod_grad() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void EltwiseParameter::clear_has_stable_prod_grad() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool EltwiseParameter::has_stable_prod_grad() const {
+  return _internal_has_stable_prod_grad();
 }
 inline void EltwiseParameter::clear_stable_prod_grad() {
   stable_prod_grad_ = true;
-  clear_has_stable_prod_grad();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool EltwiseParameter::_internal_stable_prod_grad() const {
+  return stable_prod_grad_;
 }
 inline bool EltwiseParameter::stable_prod_grad() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.EltwiseParameter.stable_prod_grad)
-  return stable_prod_grad_;
+  return _internal_stable_prod_grad();
 }
-inline void EltwiseParameter::set_stable_prod_grad(bool value) {
-  set_has_stable_prod_grad();
+inline void EltwiseParameter::_internal_set_stable_prod_grad(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   stable_prod_grad_ = value;
+}
+inline void EltwiseParameter::set_stable_prod_grad(bool value) {
+  _internal_set_stable_prod_grad(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.EltwiseParameter.stable_prod_grad)
 }
 
@@ -24621,26 +34349,30 @@ inline void EltwiseParameter::set_stable_prod_grad(bool value) {
 // ELUParameter
 
 // optional float alpha = 1 [default = 1];
-inline bool ELUParameter::has_alpha() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ELUParameter::set_has_alpha() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ELUParameter::_internal_has_alpha() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ELUParameter::clear_has_alpha() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ELUParameter::has_alpha() const {
+  return _internal_has_alpha();
 }
 inline void ELUParameter::clear_alpha() {
   alpha_ = 1;
-  clear_has_alpha();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float ELUParameter::_internal_alpha() const {
+  return alpha_;
 }
 inline float ELUParameter::alpha() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ELUParameter.alpha)
-  return alpha_;
+  return _internal_alpha();
 }
-inline void ELUParameter::set_alpha(float value) {
-  set_has_alpha();
+inline void ELUParameter::_internal_set_alpha(float value) {
+  _has_bits_[0] |= 0x00000001u;
   alpha_ = value;
+}
+inline void ELUParameter::set_alpha(float value) {
+  _internal_set_alpha(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ELUParameter.alpha)
 }
 
@@ -24649,180 +34381,264 @@ inline void ELUParameter::set_alpha(float value) {
 // EmbedParameter
 
 // optional uint32 num_output = 1;
-inline bool EmbedParameter::has_num_output() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool EmbedParameter::_internal_has_num_output() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void EmbedParameter::set_has_num_output() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void EmbedParameter::clear_has_num_output() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool EmbedParameter::has_num_output() const {
+  return _internal_has_num_output();
 }
 inline void EmbedParameter::clear_num_output() {
   num_output_ = 0u;
-  clear_has_num_output();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 EmbedParameter::num_output() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.EmbedParameter.num_output)
+inline uint32_t EmbedParameter::_internal_num_output() const {
   return num_output_;
 }
-inline void EmbedParameter::set_num_output(::google::protobuf::uint32 value) {
-  set_has_num_output();
+inline uint32_t EmbedParameter::num_output() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.EmbedParameter.num_output)
+  return _internal_num_output();
+}
+inline void EmbedParameter::_internal_set_num_output(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   num_output_ = value;
+}
+inline void EmbedParameter::set_num_output(uint32_t value) {
+  _internal_set_num_output(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.EmbedParameter.num_output)
 }
 
 // optional uint32 input_dim = 2;
-inline bool EmbedParameter::has_input_dim() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void EmbedParameter::set_has_input_dim() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool EmbedParameter::_internal_has_input_dim() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void EmbedParameter::clear_has_input_dim() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool EmbedParameter::has_input_dim() const {
+  return _internal_has_input_dim();
 }
 inline void EmbedParameter::clear_input_dim() {
   input_dim_ = 0u;
-  clear_has_input_dim();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::uint32 EmbedParameter::input_dim() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.EmbedParameter.input_dim)
+inline uint32_t EmbedParameter::_internal_input_dim() const {
   return input_dim_;
 }
-inline void EmbedParameter::set_input_dim(::google::protobuf::uint32 value) {
-  set_has_input_dim();
+inline uint32_t EmbedParameter::input_dim() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.EmbedParameter.input_dim)
+  return _internal_input_dim();
+}
+inline void EmbedParameter::_internal_set_input_dim(uint32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   input_dim_ = value;
+}
+inline void EmbedParameter::set_input_dim(uint32_t value) {
+  _internal_set_input_dim(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.EmbedParameter.input_dim)
 }
 
 // optional bool bias_term = 3 [default = true];
-inline bool EmbedParameter::has_bias_term() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void EmbedParameter::set_has_bias_term() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool EmbedParameter::_internal_has_bias_term() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void EmbedParameter::clear_has_bias_term() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool EmbedParameter::has_bias_term() const {
+  return _internal_has_bias_term();
 }
 inline void EmbedParameter::clear_bias_term() {
   bias_term_ = true;
-  clear_has_bias_term();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline bool EmbedParameter::_internal_bias_term() const {
+  return bias_term_;
 }
 inline bool EmbedParameter::bias_term() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.EmbedParameter.bias_term)
-  return bias_term_;
+  return _internal_bias_term();
 }
-inline void EmbedParameter::set_bias_term(bool value) {
-  set_has_bias_term();
+inline void EmbedParameter::_internal_set_bias_term(bool value) {
+  _has_bits_[0] |= 0x00000010u;
   bias_term_ = value;
+}
+inline void EmbedParameter::set_bias_term(bool value) {
+  _internal_set_bias_term(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.EmbedParameter.bias_term)
 }
 
 // optional .opencv_caffe.FillerParameter weight_filler = 4;
-inline bool EmbedParameter::has_weight_filler() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool EmbedParameter::_internal_has_weight_filler() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || weight_filler_ != nullptr);
+  return value;
 }
-inline void EmbedParameter::set_has_weight_filler() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool EmbedParameter::has_weight_filler() const {
+  return _internal_has_weight_filler();
 }
-inline void EmbedParameter::clear_has_weight_filler() {
+inline void EmbedParameter::clear_weight_filler() {
+  if (weight_filler_ != nullptr) weight_filler_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void EmbedParameter::clear_weight_filler() {
-  if (weight_filler_ != NULL) weight_filler_->Clear();
-  clear_has_weight_filler();
+inline const ::opencv_caffe::FillerParameter& EmbedParameter::_internal_weight_filler() const {
+  const ::opencv_caffe::FillerParameter* p = weight_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& EmbedParameter::weight_filler() const {
-  const ::opencv_caffe::FillerParameter* p = weight_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.EmbedParameter.weight_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_weight_filler();
+}
+inline void EmbedParameter::unsafe_arena_set_allocated_weight_filler(
+    ::opencv_caffe::FillerParameter* weight_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(weight_filler_);
+  }
+  weight_filler_ = weight_filler;
+  if (weight_filler) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.EmbedParameter.weight_filler)
+}
+inline ::opencv_caffe::FillerParameter* EmbedParameter::release_weight_filler() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::FillerParameter* temp = weight_filler_;
+  weight_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
 }
-inline ::opencv_caffe::FillerParameter* EmbedParameter::release_weight_filler() {
+inline ::opencv_caffe::FillerParameter* EmbedParameter::unsafe_arena_release_weight_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.EmbedParameter.weight_filler)
-  clear_has_weight_filler();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::FillerParameter* temp = weight_filler_;
-  weight_filler_ = NULL;
+  weight_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* EmbedParameter::mutable_weight_filler() {
-  set_has_weight_filler();
-  if (weight_filler_ == NULL) {
-    weight_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* EmbedParameter::_internal_mutable_weight_filler() {
+  _has_bits_[0] |= 0x00000001u;
+  if (weight_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    weight_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.EmbedParameter.weight_filler)
   return weight_filler_;
 }
+inline ::opencv_caffe::FillerParameter* EmbedParameter::mutable_weight_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_weight_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.EmbedParameter.weight_filler)
+  return _msg;
+}
 inline void EmbedParameter::set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete weight_filler_;
   }
   if (weight_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(weight_filler);
     if (message_arena != submessage_arena) {
-      weight_filler = ::google::protobuf::internal::GetOwnedMessage(
+      weight_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, weight_filler, submessage_arena);
     }
-    set_has_weight_filler();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_weight_filler();
+    _has_bits_[0] &= ~0x00000001u;
   }
   weight_filler_ = weight_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.EmbedParameter.weight_filler)
 }
 
 // optional .opencv_caffe.FillerParameter bias_filler = 5;
-inline bool EmbedParameter::has_bias_filler() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool EmbedParameter::_internal_has_bias_filler() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || bias_filler_ != nullptr);
+  return value;
 }
-inline void EmbedParameter::set_has_bias_filler() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool EmbedParameter::has_bias_filler() const {
+  return _internal_has_bias_filler();
 }
-inline void EmbedParameter::clear_has_bias_filler() {
+inline void EmbedParameter::clear_bias_filler() {
+  if (bias_filler_ != nullptr) bias_filler_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void EmbedParameter::clear_bias_filler() {
-  if (bias_filler_ != NULL) bias_filler_->Clear();
-  clear_has_bias_filler();
+inline const ::opencv_caffe::FillerParameter& EmbedParameter::_internal_bias_filler() const {
+  const ::opencv_caffe::FillerParameter* p = bias_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& EmbedParameter::bias_filler() const {
-  const ::opencv_caffe::FillerParameter* p = bias_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.EmbedParameter.bias_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_bias_filler();
+}
+inline void EmbedParameter::unsafe_arena_set_allocated_bias_filler(
+    ::opencv_caffe::FillerParameter* bias_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(bias_filler_);
+  }
+  bias_filler_ = bias_filler;
+  if (bias_filler) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.EmbedParameter.bias_filler)
 }
 inline ::opencv_caffe::FillerParameter* EmbedParameter::release_bias_filler() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::FillerParameter* temp = bias_filler_;
+  bias_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* EmbedParameter::unsafe_arena_release_bias_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.EmbedParameter.bias_filler)
-  clear_has_bias_filler();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::FillerParameter* temp = bias_filler_;
-  bias_filler_ = NULL;
+  bias_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* EmbedParameter::mutable_bias_filler() {
-  set_has_bias_filler();
-  if (bias_filler_ == NULL) {
-    bias_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* EmbedParameter::_internal_mutable_bias_filler() {
+  _has_bits_[0] |= 0x00000002u;
+  if (bias_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    bias_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.EmbedParameter.bias_filler)
   return bias_filler_;
 }
+inline ::opencv_caffe::FillerParameter* EmbedParameter::mutable_bias_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_bias_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.EmbedParameter.bias_filler)
+  return _msg;
+}
 inline void EmbedParameter::set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete bias_filler_;
   }
   if (bias_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(bias_filler);
     if (message_arena != submessage_arena) {
-      bias_filler = ::google::protobuf::internal::GetOwnedMessage(
+      bias_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, bias_filler, submessage_arena);
     }
-    set_has_bias_filler();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_bias_filler();
+    _has_bits_[0] &= ~0x00000002u;
   }
   bias_filler_ = bias_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.EmbedParameter.bias_filler)
@@ -24833,74 +34649,86 @@ inline void EmbedParameter::set_allocated_bias_filler(::opencv_caffe::FillerPara
 // ExpParameter
 
 // optional float base = 1 [default = -1];
-inline bool ExpParameter::has_base() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ExpParameter::set_has_base() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ExpParameter::_internal_has_base() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ExpParameter::clear_has_base() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ExpParameter::has_base() const {
+  return _internal_has_base();
 }
 inline void ExpParameter::clear_base() {
   base_ = -1;
-  clear_has_base();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline float ExpParameter::_internal_base() const {
+  return base_;
 }
 inline float ExpParameter::base() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ExpParameter.base)
-  return base_;
+  return _internal_base();
 }
-inline void ExpParameter::set_base(float value) {
-  set_has_base();
+inline void ExpParameter::_internal_set_base(float value) {
+  _has_bits_[0] |= 0x00000002u;
   base_ = value;
+}
+inline void ExpParameter::set_base(float value) {
+  _internal_set_base(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ExpParameter.base)
 }
 
 // optional float scale = 2 [default = 1];
-inline bool ExpParameter::has_scale() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ExpParameter::set_has_scale() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ExpParameter::_internal_has_scale() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ExpParameter::clear_has_scale() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ExpParameter::has_scale() const {
+  return _internal_has_scale();
 }
 inline void ExpParameter::clear_scale() {
   scale_ = 1;
-  clear_has_scale();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float ExpParameter::_internal_scale() const {
+  return scale_;
 }
 inline float ExpParameter::scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ExpParameter.scale)
-  return scale_;
+  return _internal_scale();
 }
-inline void ExpParameter::set_scale(float value) {
-  set_has_scale();
+inline void ExpParameter::_internal_set_scale(float value) {
+  _has_bits_[0] |= 0x00000004u;
   scale_ = value;
+}
+inline void ExpParameter::set_scale(float value) {
+  _internal_set_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ExpParameter.scale)
 }
 
 // optional float shift = 3 [default = 0];
-inline bool ExpParameter::has_shift() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ExpParameter::set_has_shift() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ExpParameter::_internal_has_shift() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ExpParameter::clear_has_shift() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ExpParameter::has_shift() const {
+  return _internal_has_shift();
 }
 inline void ExpParameter::clear_shift() {
   shift_ = 0;
-  clear_has_shift();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float ExpParameter::_internal_shift() const {
+  return shift_;
 }
 inline float ExpParameter::shift() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ExpParameter.shift)
-  return shift_;
+  return _internal_shift();
 }
-inline void ExpParameter::set_shift(float value) {
-  set_has_shift();
+inline void ExpParameter::_internal_set_shift(float value) {
+  _has_bits_[0] |= 0x00000001u;
   shift_ = value;
+}
+inline void ExpParameter::set_shift(float value) {
+  _internal_set_shift(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ExpParameter.shift)
 }
 
@@ -24909,50 +34737,58 @@ inline void ExpParameter::set_shift(float value) {
 // FlattenParameter
 
 // optional int32 axis = 1 [default = 1];
-inline bool FlattenParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool FlattenParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void FlattenParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void FlattenParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool FlattenParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void FlattenParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 FlattenParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.FlattenParameter.axis)
+inline int32_t FlattenParameter::_internal_axis() const {
   return axis_;
 }
-inline void FlattenParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t FlattenParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.FlattenParameter.axis)
+  return _internal_axis();
+}
+inline void FlattenParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   axis_ = value;
+}
+inline void FlattenParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FlattenParameter.axis)
 }
 
 // optional int32 end_axis = 2 [default = -1];
-inline bool FlattenParameter::has_end_axis() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void FlattenParameter::set_has_end_axis() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool FlattenParameter::_internal_has_end_axis() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void FlattenParameter::clear_has_end_axis() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool FlattenParameter::has_end_axis() const {
+  return _internal_has_end_axis();
 }
 inline void FlattenParameter::clear_end_axis() {
   end_axis_ = -1;
-  clear_has_end_axis();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 FlattenParameter::end_axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.FlattenParameter.end_axis)
+inline int32_t FlattenParameter::_internal_end_axis() const {
   return end_axis_;
 }
-inline void FlattenParameter::set_end_axis(::google::protobuf::int32 value) {
-  set_has_end_axis();
+inline int32_t FlattenParameter::end_axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.FlattenParameter.end_axis)
+  return _internal_end_axis();
+}
+inline void FlattenParameter::_internal_set_end_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   end_axis_ = value;
+}
+inline void FlattenParameter::set_end_axis(int32_t value) {
+  _internal_set_end_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.FlattenParameter.end_axis)
 }
 
@@ -24961,113 +34797,127 @@ inline void FlattenParameter::set_end_axis(::google::protobuf::int32 value) {
 // HDF5DataParameter
 
 // optional string source = 1;
-inline bool HDF5DataParameter::has_source() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void HDF5DataParameter::set_has_source() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool HDF5DataParameter::_internal_has_source() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void HDF5DataParameter::clear_has_source() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool HDF5DataParameter::has_source() const {
+  return _internal_has_source();
 }
 inline void HDF5DataParameter::clear_source() {
-  source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_source();
+  source_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& HDF5DataParameter::source() const {
+inline const std::string& HDF5DataParameter::source() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.HDF5DataParameter.source)
-  return source_.GetNoArena();
+  return _internal_source();
 }
-inline void HDF5DataParameter::set_source(const ::std::string& value) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void HDF5DataParameter::set_source(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.HDF5DataParameter.source)
 }
-#if LANG_CXX11
-inline void HDF5DataParameter::set_source(::std::string&& value) {
-  set_has_source();
-  source_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.HDF5DataParameter.source)
-}
-#endif
-inline void HDF5DataParameter::set_source(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.HDF5DataParameter.source)
-}
-inline void HDF5DataParameter::set_source(const char* value, size_t size) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.HDF5DataParameter.source)
-}
-inline ::std::string* HDF5DataParameter::mutable_source() {
-  set_has_source();
+inline std::string* HDF5DataParameter::mutable_source() {
+  std::string* _s = _internal_mutable_source();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.HDF5DataParameter.source)
-  return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& HDF5DataParameter::_internal_source() const {
+  return source_.Get();
+}
+inline void HDF5DataParameter::_internal_set_source(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* HDF5DataParameter::release_source() {
+inline std::string* HDF5DataParameter::_internal_mutable_source() {
+  _has_bits_[0] |= 0x00000001u;
+  return source_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* HDF5DataParameter::release_source() {
   // @@protoc_insertion_point(field_release:opencv_caffe.HDF5DataParameter.source)
-  clear_has_source();
-  return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_source()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = source_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void HDF5DataParameter::set_allocated_source(::std::string* source) {
-  if (source != NULL) {
-    set_has_source();
+inline void HDF5DataParameter::set_allocated_source(std::string* source) {
+  if (source != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_source();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  source_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), source,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.HDF5DataParameter.source)
 }
 
 // optional uint32 batch_size = 2;
-inline bool HDF5DataParameter::has_batch_size() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void HDF5DataParameter::set_has_batch_size() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool HDF5DataParameter::_internal_has_batch_size() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void HDF5DataParameter::clear_has_batch_size() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool HDF5DataParameter::has_batch_size() const {
+  return _internal_has_batch_size();
 }
 inline void HDF5DataParameter::clear_batch_size() {
   batch_size_ = 0u;
-  clear_has_batch_size();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::uint32 HDF5DataParameter::batch_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.HDF5DataParameter.batch_size)
+inline uint32_t HDF5DataParameter::_internal_batch_size() const {
   return batch_size_;
 }
-inline void HDF5DataParameter::set_batch_size(::google::protobuf::uint32 value) {
-  set_has_batch_size();
+inline uint32_t HDF5DataParameter::batch_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.HDF5DataParameter.batch_size)
+  return _internal_batch_size();
+}
+inline void HDF5DataParameter::_internal_set_batch_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   batch_size_ = value;
+}
+inline void HDF5DataParameter::set_batch_size(uint32_t value) {
+  _internal_set_batch_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.HDF5DataParameter.batch_size)
 }
 
 // optional bool shuffle = 3 [default = false];
-inline bool HDF5DataParameter::has_shuffle() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void HDF5DataParameter::set_has_shuffle() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool HDF5DataParameter::_internal_has_shuffle() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void HDF5DataParameter::clear_has_shuffle() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool HDF5DataParameter::has_shuffle() const {
+  return _internal_has_shuffle();
 }
 inline void HDF5DataParameter::clear_shuffle() {
   shuffle_ = false;
-  clear_has_shuffle();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline bool HDF5DataParameter::_internal_shuffle() const {
+  return shuffle_;
 }
 inline bool HDF5DataParameter::shuffle() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.HDF5DataParameter.shuffle)
-  return shuffle_;
+  return _internal_shuffle();
 }
-inline void HDF5DataParameter::set_shuffle(bool value) {
-  set_has_shuffle();
+inline void HDF5DataParameter::_internal_set_shuffle(bool value) {
+  _has_bits_[0] |= 0x00000004u;
   shuffle_ = value;
+}
+inline void HDF5DataParameter::set_shuffle(bool value) {
+  _internal_set_shuffle(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.HDF5DataParameter.shuffle)
 }
 
@@ -25076,65 +34926,71 @@ inline void HDF5DataParameter::set_shuffle(bool value) {
 // HDF5OutputParameter
 
 // optional string file_name = 1;
-inline bool HDF5OutputParameter::has_file_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void HDF5OutputParameter::set_has_file_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool HDF5OutputParameter::_internal_has_file_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void HDF5OutputParameter::clear_has_file_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool HDF5OutputParameter::has_file_name() const {
+  return _internal_has_file_name();
 }
 inline void HDF5OutputParameter::clear_file_name() {
-  file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_file_name();
+  file_name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& HDF5OutputParameter::file_name() const {
+inline const std::string& HDF5OutputParameter::file_name() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.HDF5OutputParameter.file_name)
-  return file_name_.GetNoArena();
+  return _internal_file_name();
 }
-inline void HDF5OutputParameter::set_file_name(const ::std::string& value) {
-  set_has_file_name();
-  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void HDF5OutputParameter::set_file_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ file_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.HDF5OutputParameter.file_name)
 }
-#if LANG_CXX11
-inline void HDF5OutputParameter::set_file_name(::std::string&& value) {
-  set_has_file_name();
-  file_name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.HDF5OutputParameter.file_name)
-}
-#endif
-inline void HDF5OutputParameter::set_file_name(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_file_name();
-  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.HDF5OutputParameter.file_name)
-}
-inline void HDF5OutputParameter::set_file_name(const char* value, size_t size) {
-  set_has_file_name();
-  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.HDF5OutputParameter.file_name)
-}
-inline ::std::string* HDF5OutputParameter::mutable_file_name() {
-  set_has_file_name();
+inline std::string* HDF5OutputParameter::mutable_file_name() {
+  std::string* _s = _internal_mutable_file_name();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.HDF5OutputParameter.file_name)
-  return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& HDF5OutputParameter::_internal_file_name() const {
+  return file_name_.Get();
+}
+inline void HDF5OutputParameter::_internal_set_file_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  file_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* HDF5OutputParameter::_internal_mutable_file_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return file_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* HDF5OutputParameter::release_file_name() {
+inline std::string* HDF5OutputParameter::release_file_name() {
   // @@protoc_insertion_point(field_release:opencv_caffe.HDF5OutputParameter.file_name)
-  clear_has_file_name();
-  return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_file_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = file_name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (file_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    file_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void HDF5OutputParameter::set_allocated_file_name(::std::string* file_name) {
-  if (file_name != NULL) {
-    set_has_file_name();
+inline void HDF5OutputParameter::set_allocated_file_name(std::string* file_name) {
+  if (file_name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_file_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  file_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), file_name);
+  file_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), file_name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (file_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    file_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.HDF5OutputParameter.file_name)
 }
 
@@ -25143,27 +34999,31 @@ inline void HDF5OutputParameter::set_allocated_file_name(::std::string* file_nam
 // HingeLossParameter
 
 // optional .opencv_caffe.HingeLossParameter.Norm norm = 1 [default = L1];
-inline bool HingeLossParameter::has_norm() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool HingeLossParameter::_internal_has_norm() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void HingeLossParameter::set_has_norm() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void HingeLossParameter::clear_has_norm() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool HingeLossParameter::has_norm() const {
+  return _internal_has_norm();
 }
 inline void HingeLossParameter::clear_norm() {
   norm_ = 1;
-  clear_has_norm();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::opencv_caffe::HingeLossParameter_Norm HingeLossParameter::_internal_norm() const {
+  return static_cast< ::opencv_caffe::HingeLossParameter_Norm >(norm_);
 }
 inline ::opencv_caffe::HingeLossParameter_Norm HingeLossParameter::norm() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.HingeLossParameter.norm)
-  return static_cast< ::opencv_caffe::HingeLossParameter_Norm >(norm_);
+  return _internal_norm();
 }
-inline void HingeLossParameter::set_norm(::opencv_caffe::HingeLossParameter_Norm value) {
+inline void HingeLossParameter::_internal_set_norm(::opencv_caffe::HingeLossParameter_Norm value) {
   assert(::opencv_caffe::HingeLossParameter_Norm_IsValid(value));
-  set_has_norm();
+  _has_bits_[0] |= 0x00000001u;
   norm_ = value;
+}
+inline void HingeLossParameter::set_norm(::opencv_caffe::HingeLossParameter_Norm value) {
+  _internal_set_norm(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.HingeLossParameter.norm)
 }
 
@@ -25172,407 +35032,461 @@ inline void HingeLossParameter::set_norm(::opencv_caffe::HingeLossParameter_Norm
 // ImageDataParameter
 
 // optional string source = 1;
-inline bool ImageDataParameter::has_source() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ImageDataParameter::set_has_source() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ImageDataParameter::_internal_has_source() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_source() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ImageDataParameter::has_source() const {
+  return _internal_has_source();
 }
 inline void ImageDataParameter::clear_source() {
-  source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_source();
+  source_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& ImageDataParameter::source() const {
+inline const std::string& ImageDataParameter::source() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.source)
-  return source_.GetNoArena();
+  return _internal_source();
 }
-inline void ImageDataParameter::set_source(const ::std::string& value) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ImageDataParameter::set_source(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.source)
 }
-#if LANG_CXX11
-inline void ImageDataParameter::set_source(::std::string&& value) {
-  set_has_source();
-  source_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.ImageDataParameter.source)
-}
-#endif
-inline void ImageDataParameter::set_source(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.ImageDataParameter.source)
-}
-inline void ImageDataParameter::set_source(const char* value, size_t size) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.ImageDataParameter.source)
-}
-inline ::std::string* ImageDataParameter::mutable_source() {
-  set_has_source();
+inline std::string* ImageDataParameter::mutable_source() {
+  std::string* _s = _internal_mutable_source();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.ImageDataParameter.source)
-  return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& ImageDataParameter::_internal_source() const {
+  return source_.Get();
+}
+inline void ImageDataParameter::_internal_set_source(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* ImageDataParameter::_internal_mutable_source() {
+  _has_bits_[0] |= 0x00000001u;
+  return source_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* ImageDataParameter::release_source() {
+inline std::string* ImageDataParameter::release_source() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ImageDataParameter.source)
-  clear_has_source();
-  return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_source()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = source_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ImageDataParameter::set_allocated_source(::std::string* source) {
-  if (source != NULL) {
-    set_has_source();
+inline void ImageDataParameter::set_allocated_source(std::string* source) {
+  if (source != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_source();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source);
+  source_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), source,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ImageDataParameter.source)
 }
 
 // optional uint32 batch_size = 4 [default = 1];
-inline bool ImageDataParameter::has_batch_size() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
-}
-inline void ImageDataParameter::set_has_batch_size() {
-  _has_bits_[0] |= 0x00000800u;
+inline bool ImageDataParameter::_internal_has_batch_size() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_batch_size() {
-  _has_bits_[0] &= ~0x00000800u;
+inline bool ImageDataParameter::has_batch_size() const {
+  return _internal_has_batch_size();
 }
 inline void ImageDataParameter::clear_batch_size() {
   batch_size_ = 1u;
-  clear_has_batch_size();
+  _has_bits_[0] &= ~0x00000800u;
 }
-inline ::google::protobuf::uint32 ImageDataParameter::batch_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.batch_size)
+inline uint32_t ImageDataParameter::_internal_batch_size() const {
   return batch_size_;
 }
-inline void ImageDataParameter::set_batch_size(::google::protobuf::uint32 value) {
-  set_has_batch_size();
+inline uint32_t ImageDataParameter::batch_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.batch_size)
+  return _internal_batch_size();
+}
+inline void ImageDataParameter::_internal_set_batch_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000800u;
   batch_size_ = value;
+}
+inline void ImageDataParameter::set_batch_size(uint32_t value) {
+  _internal_set_batch_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.batch_size)
 }
 
 // optional uint32 rand_skip = 7 [default = 0];
-inline bool ImageDataParameter::has_rand_skip() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void ImageDataParameter::set_has_rand_skip() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool ImageDataParameter::_internal_has_rand_skip() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_rand_skip() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool ImageDataParameter::has_rand_skip() const {
+  return _internal_has_rand_skip();
 }
 inline void ImageDataParameter::clear_rand_skip() {
   rand_skip_ = 0u;
-  clear_has_rand_skip();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::uint32 ImageDataParameter::rand_skip() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.rand_skip)
+inline uint32_t ImageDataParameter::_internal_rand_skip() const {
   return rand_skip_;
 }
-inline void ImageDataParameter::set_rand_skip(::google::protobuf::uint32 value) {
-  set_has_rand_skip();
+inline uint32_t ImageDataParameter::rand_skip() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.rand_skip)
+  return _internal_rand_skip();
+}
+inline void ImageDataParameter::_internal_set_rand_skip(uint32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   rand_skip_ = value;
+}
+inline void ImageDataParameter::set_rand_skip(uint32_t value) {
+  _internal_set_rand_skip(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.rand_skip)
 }
 
 // optional bool shuffle = 8 [default = false];
-inline bool ImageDataParameter::has_shuffle() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool ImageDataParameter::_internal_has_shuffle() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void ImageDataParameter::set_has_shuffle() {
-  _has_bits_[0] |= 0x00000020u;
-}
-inline void ImageDataParameter::clear_has_shuffle() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool ImageDataParameter::has_shuffle() const {
+  return _internal_has_shuffle();
 }
 inline void ImageDataParameter::clear_shuffle() {
   shuffle_ = false;
-  clear_has_shuffle();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline bool ImageDataParameter::_internal_shuffle() const {
+  return shuffle_;
 }
 inline bool ImageDataParameter::shuffle() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.shuffle)
-  return shuffle_;
+  return _internal_shuffle();
 }
-inline void ImageDataParameter::set_shuffle(bool value) {
-  set_has_shuffle();
+inline void ImageDataParameter::_internal_set_shuffle(bool value) {
+  _has_bits_[0] |= 0x00000020u;
   shuffle_ = value;
+}
+inline void ImageDataParameter::set_shuffle(bool value) {
+  _internal_set_shuffle(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.shuffle)
 }
 
 // optional uint32 new_height = 9 [default = 0];
-inline bool ImageDataParameter::has_new_height() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void ImageDataParameter::set_has_new_height() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool ImageDataParameter::_internal_has_new_height() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_new_height() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool ImageDataParameter::has_new_height() const {
+  return _internal_has_new_height();
 }
 inline void ImageDataParameter::clear_new_height() {
   new_height_ = 0u;
-  clear_has_new_height();
+  _has_bits_[0] &= ~0x00000080u;
 }
-inline ::google::protobuf::uint32 ImageDataParameter::new_height() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.new_height)
+inline uint32_t ImageDataParameter::_internal_new_height() const {
   return new_height_;
 }
-inline void ImageDataParameter::set_new_height(::google::protobuf::uint32 value) {
-  set_has_new_height();
+inline uint32_t ImageDataParameter::new_height() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.new_height)
+  return _internal_new_height();
+}
+inline void ImageDataParameter::_internal_set_new_height(uint32_t value) {
+  _has_bits_[0] |= 0x00000080u;
   new_height_ = value;
+}
+inline void ImageDataParameter::set_new_height(uint32_t value) {
+  _internal_set_new_height(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.new_height)
 }
 
 // optional uint32 new_width = 10 [default = 0];
-inline bool ImageDataParameter::has_new_width() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
+inline bool ImageDataParameter::_internal_has_new_width() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void ImageDataParameter::set_has_new_width() {
-  _has_bits_[0] |= 0x00000100u;
-}
-inline void ImageDataParameter::clear_has_new_width() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool ImageDataParameter::has_new_width() const {
+  return _internal_has_new_width();
 }
 inline void ImageDataParameter::clear_new_width() {
   new_width_ = 0u;
-  clear_has_new_width();
+  _has_bits_[0] &= ~0x00000100u;
 }
-inline ::google::protobuf::uint32 ImageDataParameter::new_width() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.new_width)
+inline uint32_t ImageDataParameter::_internal_new_width() const {
   return new_width_;
 }
-inline void ImageDataParameter::set_new_width(::google::protobuf::uint32 value) {
-  set_has_new_width();
+inline uint32_t ImageDataParameter::new_width() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.new_width)
+  return _internal_new_width();
+}
+inline void ImageDataParameter::_internal_set_new_width(uint32_t value) {
+  _has_bits_[0] |= 0x00000100u;
   new_width_ = value;
+}
+inline void ImageDataParameter::set_new_width(uint32_t value) {
+  _internal_set_new_width(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.new_width)
 }
 
 // optional bool is_color = 11 [default = true];
-inline bool ImageDataParameter::has_is_color() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
-}
-inline void ImageDataParameter::set_has_is_color() {
-  _has_bits_[0] |= 0x00000200u;
+inline bool ImageDataParameter::_internal_has_is_color() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_is_color() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool ImageDataParameter::has_is_color() const {
+  return _internal_has_is_color();
 }
 inline void ImageDataParameter::clear_is_color() {
   is_color_ = true;
-  clear_has_is_color();
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline bool ImageDataParameter::_internal_is_color() const {
+  return is_color_;
 }
 inline bool ImageDataParameter::is_color() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.is_color)
-  return is_color_;
+  return _internal_is_color();
 }
-inline void ImageDataParameter::set_is_color(bool value) {
-  set_has_is_color();
+inline void ImageDataParameter::_internal_set_is_color(bool value) {
+  _has_bits_[0] |= 0x00000200u;
   is_color_ = value;
+}
+inline void ImageDataParameter::set_is_color(bool value) {
+  _internal_set_is_color(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.is_color)
 }
 
 // optional float scale = 2 [default = 1];
-inline bool ImageDataParameter::has_scale() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+inline bool ImageDataParameter::_internal_has_scale() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void ImageDataParameter::set_has_scale() {
-  _has_bits_[0] |= 0x00000400u;
-}
-inline void ImageDataParameter::clear_has_scale() {
-  _has_bits_[0] &= ~0x00000400u;
+inline bool ImageDataParameter::has_scale() const {
+  return _internal_has_scale();
 }
 inline void ImageDataParameter::clear_scale() {
   scale_ = 1;
-  clear_has_scale();
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline float ImageDataParameter::_internal_scale() const {
+  return scale_;
 }
 inline float ImageDataParameter::scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.scale)
-  return scale_;
+  return _internal_scale();
 }
-inline void ImageDataParameter::set_scale(float value) {
-  set_has_scale();
+inline void ImageDataParameter::_internal_set_scale(float value) {
+  _has_bits_[0] |= 0x00000400u;
   scale_ = value;
+}
+inline void ImageDataParameter::set_scale(float value) {
+  _internal_set_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.scale)
 }
 
 // optional string mean_file = 3;
-inline bool ImageDataParameter::has_mean_file() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ImageDataParameter::set_has_mean_file() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ImageDataParameter::_internal_has_mean_file() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_mean_file() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ImageDataParameter::has_mean_file() const {
+  return _internal_has_mean_file();
 }
 inline void ImageDataParameter::clear_mean_file() {
-  mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_mean_file();
+  mean_file_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& ImageDataParameter::mean_file() const {
+inline const std::string& ImageDataParameter::mean_file() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.mean_file)
-  return mean_file_.GetNoArena();
+  return _internal_mean_file();
 }
-inline void ImageDataParameter::set_mean_file(const ::std::string& value) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ImageDataParameter::set_mean_file(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.mean_file)
 }
-#if LANG_CXX11
-inline void ImageDataParameter::set_mean_file(::std::string&& value) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.ImageDataParameter.mean_file)
-}
-#endif
-inline void ImageDataParameter::set_mean_file(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.ImageDataParameter.mean_file)
-}
-inline void ImageDataParameter::set_mean_file(const char* value, size_t size) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.ImageDataParameter.mean_file)
-}
-inline ::std::string* ImageDataParameter::mutable_mean_file() {
-  set_has_mean_file();
+inline std::string* ImageDataParameter::mutable_mean_file() {
+  std::string* _s = _internal_mutable_mean_file();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.ImageDataParameter.mean_file)
-  return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* ImageDataParameter::release_mean_file() {
+inline const std::string& ImageDataParameter::_internal_mean_file() const {
+  return mean_file_.Get();
+}
+inline void ImageDataParameter::_internal_set_mean_file(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* ImageDataParameter::_internal_mutable_mean_file() {
+  _has_bits_[0] |= 0x00000002u;
+  return mean_file_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* ImageDataParameter::release_mean_file() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ImageDataParameter.mean_file)
-  clear_has_mean_file();
-  return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_mean_file()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = mean_file_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (mean_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ImageDataParameter::set_allocated_mean_file(::std::string* mean_file) {
-  if (mean_file != NULL) {
-    set_has_mean_file();
+inline void ImageDataParameter::set_allocated_mean_file(std::string* mean_file) {
+  if (mean_file != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_mean_file();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file);
+  mean_file_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), mean_file,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (mean_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ImageDataParameter.mean_file)
 }
 
 // optional uint32 crop_size = 5 [default = 0];
-inline bool ImageDataParameter::has_crop_size() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void ImageDataParameter::set_has_crop_size() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool ImageDataParameter::_internal_has_crop_size() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_crop_size() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool ImageDataParameter::has_crop_size() const {
+  return _internal_has_crop_size();
 }
 inline void ImageDataParameter::clear_crop_size() {
   crop_size_ = 0u;
-  clear_has_crop_size();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::uint32 ImageDataParameter::crop_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.crop_size)
+inline uint32_t ImageDataParameter::_internal_crop_size() const {
   return crop_size_;
 }
-inline void ImageDataParameter::set_crop_size(::google::protobuf::uint32 value) {
-  set_has_crop_size();
+inline uint32_t ImageDataParameter::crop_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.crop_size)
+  return _internal_crop_size();
+}
+inline void ImageDataParameter::_internal_set_crop_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   crop_size_ = value;
+}
+inline void ImageDataParameter::set_crop_size(uint32_t value) {
+  _internal_set_crop_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.crop_size)
 }
 
 // optional bool mirror = 6 [default = false];
-inline bool ImageDataParameter::has_mirror() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void ImageDataParameter::set_has_mirror() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool ImageDataParameter::_internal_has_mirror() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_mirror() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool ImageDataParameter::has_mirror() const {
+  return _internal_has_mirror();
 }
 inline void ImageDataParameter::clear_mirror() {
   mirror_ = false;
-  clear_has_mirror();
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline bool ImageDataParameter::_internal_mirror() const {
+  return mirror_;
 }
 inline bool ImageDataParameter::mirror() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.mirror)
-  return mirror_;
+  return _internal_mirror();
 }
-inline void ImageDataParameter::set_mirror(bool value) {
-  set_has_mirror();
+inline void ImageDataParameter::_internal_set_mirror(bool value) {
+  _has_bits_[0] |= 0x00000040u;
   mirror_ = value;
+}
+inline void ImageDataParameter::set_mirror(bool value) {
+  _internal_set_mirror(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.mirror)
 }
 
 // optional string root_folder = 12 [default = ""];
-inline bool ImageDataParameter::has_root_folder() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ImageDataParameter::set_has_root_folder() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ImageDataParameter::_internal_has_root_folder() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ImageDataParameter::clear_has_root_folder() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ImageDataParameter::has_root_folder() const {
+  return _internal_has_root_folder();
 }
 inline void ImageDataParameter::clear_root_folder() {
-  root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_root_folder();
+  root_folder_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& ImageDataParameter::root_folder() const {
+inline const std::string& ImageDataParameter::root_folder() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ImageDataParameter.root_folder)
-  return root_folder_.GetNoArena();
+  return _internal_root_folder();
 }
-inline void ImageDataParameter::set_root_folder(const ::std::string& value) {
-  set_has_root_folder();
-  root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ImageDataParameter::set_root_folder(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ root_folder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.ImageDataParameter.root_folder)
 }
-#if LANG_CXX11
-inline void ImageDataParameter::set_root_folder(::std::string&& value) {
-  set_has_root_folder();
-  root_folder_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.ImageDataParameter.root_folder)
-}
-#endif
-inline void ImageDataParameter::set_root_folder(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_root_folder();
-  root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.ImageDataParameter.root_folder)
-}
-inline void ImageDataParameter::set_root_folder(const char* value, size_t size) {
-  set_has_root_folder();
-  root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.ImageDataParameter.root_folder)
-}
-inline ::std::string* ImageDataParameter::mutable_root_folder() {
-  set_has_root_folder();
+inline std::string* ImageDataParameter::mutable_root_folder() {
+  std::string* _s = _internal_mutable_root_folder();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.ImageDataParameter.root_folder)
-  return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& ImageDataParameter::_internal_root_folder() const {
+  return root_folder_.Get();
+}
+inline void ImageDataParameter::_internal_set_root_folder(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  root_folder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* ImageDataParameter::release_root_folder() {
+inline std::string* ImageDataParameter::_internal_mutable_root_folder() {
+  _has_bits_[0] |= 0x00000004u;
+  return root_folder_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* ImageDataParameter::release_root_folder() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ImageDataParameter.root_folder)
-  clear_has_root_folder();
-  return root_folder_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_root_folder()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = root_folder_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (root_folder_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    root_folder_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ImageDataParameter::set_allocated_root_folder(::std::string* root_folder) {
-  if (root_folder != NULL) {
-    set_has_root_folder();
+inline void ImageDataParameter::set_allocated_root_folder(std::string* root_folder) {
+  if (root_folder != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_root_folder();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  root_folder_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), root_folder,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (root_folder_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    root_folder_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  root_folder_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root_folder);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ImageDataParameter.root_folder)
 }
 
@@ -25581,65 +35495,71 @@ inline void ImageDataParameter::set_allocated_root_folder(::std::string* root_fo
 // InfogainLossParameter
 
 // optional string source = 1;
-inline bool InfogainLossParameter::has_source() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void InfogainLossParameter::set_has_source() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool InfogainLossParameter::_internal_has_source() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void InfogainLossParameter::clear_has_source() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool InfogainLossParameter::has_source() const {
+  return _internal_has_source();
 }
 inline void InfogainLossParameter::clear_source() {
-  source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_source();
+  source_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& InfogainLossParameter::source() const {
+inline const std::string& InfogainLossParameter::source() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.InfogainLossParameter.source)
-  return source_.GetNoArena();
+  return _internal_source();
 }
-inline void InfogainLossParameter::set_source(const ::std::string& value) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void InfogainLossParameter::set_source(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.InfogainLossParameter.source)
 }
-#if LANG_CXX11
-inline void InfogainLossParameter::set_source(::std::string&& value) {
-  set_has_source();
-  source_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.InfogainLossParameter.source)
-}
-#endif
-inline void InfogainLossParameter::set_source(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.InfogainLossParameter.source)
-}
-inline void InfogainLossParameter::set_source(const char* value, size_t size) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.InfogainLossParameter.source)
-}
-inline ::std::string* InfogainLossParameter::mutable_source() {
-  set_has_source();
+inline std::string* InfogainLossParameter::mutable_source() {
+  std::string* _s = _internal_mutable_source();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.InfogainLossParameter.source)
-  return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& InfogainLossParameter::_internal_source() const {
+  return source_.Get();
+}
+inline void InfogainLossParameter::_internal_set_source(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* InfogainLossParameter::_internal_mutable_source() {
+  _has_bits_[0] |= 0x00000001u;
+  return source_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* InfogainLossParameter::release_source() {
+inline std::string* InfogainLossParameter::release_source() {
   // @@protoc_insertion_point(field_release:opencv_caffe.InfogainLossParameter.source)
-  clear_has_source();
-  return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_source()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = source_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void InfogainLossParameter::set_allocated_source(::std::string* source) {
-  if (source != NULL) {
-    set_has_source();
+inline void InfogainLossParameter::set_allocated_source(std::string* source) {
+  if (source != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_source();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source);
+  source_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), source,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.InfogainLossParameter.source)
 }
 
@@ -25648,206 +35568,294 @@ inline void InfogainLossParameter::set_allocated_source(::std::string* source) {
 // InnerProductParameter
 
 // optional uint32 num_output = 1;
-inline bool InnerProductParameter::has_num_output() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool InnerProductParameter::_internal_has_num_output() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void InnerProductParameter::set_has_num_output() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void InnerProductParameter::clear_has_num_output() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool InnerProductParameter::has_num_output() const {
+  return _internal_has_num_output();
 }
 inline void InnerProductParameter::clear_num_output() {
   num_output_ = 0u;
-  clear_has_num_output();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 InnerProductParameter::num_output() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.InnerProductParameter.num_output)
+inline uint32_t InnerProductParameter::_internal_num_output() const {
   return num_output_;
 }
-inline void InnerProductParameter::set_num_output(::google::protobuf::uint32 value) {
-  set_has_num_output();
+inline uint32_t InnerProductParameter::num_output() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.InnerProductParameter.num_output)
+  return _internal_num_output();
+}
+inline void InnerProductParameter::_internal_set_num_output(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   num_output_ = value;
+}
+inline void InnerProductParameter::set_num_output(uint32_t value) {
+  _internal_set_num_output(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.InnerProductParameter.num_output)
 }
 
 // optional bool bias_term = 2 [default = true];
-inline bool InnerProductParameter::has_bias_term() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void InnerProductParameter::set_has_bias_term() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool InnerProductParameter::_internal_has_bias_term() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void InnerProductParameter::clear_has_bias_term() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool InnerProductParameter::has_bias_term() const {
+  return _internal_has_bias_term();
 }
 inline void InnerProductParameter::clear_bias_term() {
   bias_term_ = true;
-  clear_has_bias_term();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline bool InnerProductParameter::_internal_bias_term() const {
+  return bias_term_;
 }
 inline bool InnerProductParameter::bias_term() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.InnerProductParameter.bias_term)
-  return bias_term_;
+  return _internal_bias_term();
 }
-inline void InnerProductParameter::set_bias_term(bool value) {
-  set_has_bias_term();
+inline void InnerProductParameter::_internal_set_bias_term(bool value) {
+  _has_bits_[0] |= 0x00000010u;
   bias_term_ = value;
+}
+inline void InnerProductParameter::set_bias_term(bool value) {
+  _internal_set_bias_term(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.InnerProductParameter.bias_term)
 }
 
 // optional .opencv_caffe.FillerParameter weight_filler = 3;
-inline bool InnerProductParameter::has_weight_filler() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool InnerProductParameter::_internal_has_weight_filler() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || weight_filler_ != nullptr);
+  return value;
 }
-inline void InnerProductParameter::set_has_weight_filler() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool InnerProductParameter::has_weight_filler() const {
+  return _internal_has_weight_filler();
 }
-inline void InnerProductParameter::clear_has_weight_filler() {
+inline void InnerProductParameter::clear_weight_filler() {
+  if (weight_filler_ != nullptr) weight_filler_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void InnerProductParameter::clear_weight_filler() {
-  if (weight_filler_ != NULL) weight_filler_->Clear();
-  clear_has_weight_filler();
+inline const ::opencv_caffe::FillerParameter& InnerProductParameter::_internal_weight_filler() const {
+  const ::opencv_caffe::FillerParameter* p = weight_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& InnerProductParameter::weight_filler() const {
-  const ::opencv_caffe::FillerParameter* p = weight_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.InnerProductParameter.weight_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_weight_filler();
+}
+inline void InnerProductParameter::unsafe_arena_set_allocated_weight_filler(
+    ::opencv_caffe::FillerParameter* weight_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(weight_filler_);
+  }
+  weight_filler_ = weight_filler;
+  if (weight_filler) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.InnerProductParameter.weight_filler)
 }
 inline ::opencv_caffe::FillerParameter* InnerProductParameter::release_weight_filler() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::FillerParameter* temp = weight_filler_;
+  weight_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* InnerProductParameter::unsafe_arena_release_weight_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.InnerProductParameter.weight_filler)
-  clear_has_weight_filler();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::FillerParameter* temp = weight_filler_;
-  weight_filler_ = NULL;
+  weight_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* InnerProductParameter::mutable_weight_filler() {
-  set_has_weight_filler();
-  if (weight_filler_ == NULL) {
-    weight_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* InnerProductParameter::_internal_mutable_weight_filler() {
+  _has_bits_[0] |= 0x00000001u;
+  if (weight_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    weight_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.InnerProductParameter.weight_filler)
   return weight_filler_;
 }
+inline ::opencv_caffe::FillerParameter* InnerProductParameter::mutable_weight_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_weight_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.InnerProductParameter.weight_filler)
+  return _msg;
+}
 inline void InnerProductParameter::set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete weight_filler_;
   }
   if (weight_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(weight_filler);
     if (message_arena != submessage_arena) {
-      weight_filler = ::google::protobuf::internal::GetOwnedMessage(
+      weight_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, weight_filler, submessage_arena);
     }
-    set_has_weight_filler();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_weight_filler();
+    _has_bits_[0] &= ~0x00000001u;
   }
   weight_filler_ = weight_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.InnerProductParameter.weight_filler)
 }
 
 // optional .opencv_caffe.FillerParameter bias_filler = 4;
-inline bool InnerProductParameter::has_bias_filler() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool InnerProductParameter::_internal_has_bias_filler() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || bias_filler_ != nullptr);
+  return value;
 }
-inline void InnerProductParameter::set_has_bias_filler() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool InnerProductParameter::has_bias_filler() const {
+  return _internal_has_bias_filler();
 }
-inline void InnerProductParameter::clear_has_bias_filler() {
+inline void InnerProductParameter::clear_bias_filler() {
+  if (bias_filler_ != nullptr) bias_filler_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void InnerProductParameter::clear_bias_filler() {
-  if (bias_filler_ != NULL) bias_filler_->Clear();
-  clear_has_bias_filler();
+inline const ::opencv_caffe::FillerParameter& InnerProductParameter::_internal_bias_filler() const {
+  const ::opencv_caffe::FillerParameter* p = bias_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& InnerProductParameter::bias_filler() const {
-  const ::opencv_caffe::FillerParameter* p = bias_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.InnerProductParameter.bias_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_bias_filler();
+}
+inline void InnerProductParameter::unsafe_arena_set_allocated_bias_filler(
+    ::opencv_caffe::FillerParameter* bias_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(bias_filler_);
+  }
+  bias_filler_ = bias_filler;
+  if (bias_filler) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.InnerProductParameter.bias_filler)
 }
 inline ::opencv_caffe::FillerParameter* InnerProductParameter::release_bias_filler() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::FillerParameter* temp = bias_filler_;
+  bias_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* InnerProductParameter::unsafe_arena_release_bias_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.InnerProductParameter.bias_filler)
-  clear_has_bias_filler();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::FillerParameter* temp = bias_filler_;
-  bias_filler_ = NULL;
+  bias_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* InnerProductParameter::mutable_bias_filler() {
-  set_has_bias_filler();
-  if (bias_filler_ == NULL) {
-    bias_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* InnerProductParameter::_internal_mutable_bias_filler() {
+  _has_bits_[0] |= 0x00000002u;
+  if (bias_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    bias_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.InnerProductParameter.bias_filler)
   return bias_filler_;
 }
+inline ::opencv_caffe::FillerParameter* InnerProductParameter::mutable_bias_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_bias_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.InnerProductParameter.bias_filler)
+  return _msg;
+}
 inline void InnerProductParameter::set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete bias_filler_;
   }
   if (bias_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(bias_filler);
     if (message_arena != submessage_arena) {
-      bias_filler = ::google::protobuf::internal::GetOwnedMessage(
+      bias_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, bias_filler, submessage_arena);
     }
-    set_has_bias_filler();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_bias_filler();
+    _has_bits_[0] &= ~0x00000002u;
   }
   bias_filler_ = bias_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.InnerProductParameter.bias_filler)
 }
 
 // optional int32 axis = 5 [default = 1];
-inline bool InnerProductParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool InnerProductParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void InnerProductParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000020u;
-}
-inline void InnerProductParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool InnerProductParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void InnerProductParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline ::google::protobuf::int32 InnerProductParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.InnerProductParameter.axis)
+inline int32_t InnerProductParameter::_internal_axis() const {
   return axis_;
 }
-inline void InnerProductParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t InnerProductParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.InnerProductParameter.axis)
+  return _internal_axis();
+}
+inline void InnerProductParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000020u;
   axis_ = value;
+}
+inline void InnerProductParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.InnerProductParameter.axis)
 }
 
 // optional bool transpose = 6 [default = false];
-inline bool InnerProductParameter::has_transpose() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void InnerProductParameter::set_has_transpose() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool InnerProductParameter::_internal_has_transpose() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void InnerProductParameter::clear_has_transpose() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool InnerProductParameter::has_transpose() const {
+  return _internal_has_transpose();
 }
 inline void InnerProductParameter::clear_transpose() {
   transpose_ = false;
-  clear_has_transpose();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline bool InnerProductParameter::_internal_transpose() const {
+  return transpose_;
 }
 inline bool InnerProductParameter::transpose() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.InnerProductParameter.transpose)
-  return transpose_;
+  return _internal_transpose();
 }
-inline void InnerProductParameter::set_transpose(bool value) {
-  set_has_transpose();
+inline void InnerProductParameter::_internal_set_transpose(bool value) {
+  _has_bits_[0] |= 0x00000008u;
   transpose_ = value;
+}
+inline void InnerProductParameter::set_transpose(bool value) {
+  _internal_set_transpose(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.InnerProductParameter.transpose)
 }
 
@@ -25856,30 +35864,40 @@ inline void InnerProductParameter::set_transpose(bool value) {
 // InputParameter
 
 // repeated .opencv_caffe.BlobShape shape = 1;
-inline int InputParameter::shape_size() const {
+inline int InputParameter::_internal_shape_size() const {
   return shape_.size();
 }
+inline int InputParameter::shape_size() const {
+  return _internal_shape_size();
+}
 inline void InputParameter::clear_shape() {
   shape_.Clear();
 }
-inline const ::opencv_caffe::BlobShape& InputParameter::shape(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.InputParameter.shape)
-  return shape_.Get(index);
-}
 inline ::opencv_caffe::BlobShape* InputParameter::mutable_shape(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.InputParameter.shape)
   return shape_.Mutable(index);
 }
-inline ::opencv_caffe::BlobShape* InputParameter::add_shape() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.InputParameter.shape)
-  return shape_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >*
 InputParameter::mutable_shape() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.InputParameter.shape)
   return &shape_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobShape >&
+inline const ::opencv_caffe::BlobShape& InputParameter::_internal_shape(int index) const {
+  return shape_.Get(index);
+}
+inline const ::opencv_caffe::BlobShape& InputParameter::shape(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.InputParameter.shape)
+  return _internal_shape(index);
+}
+inline ::opencv_caffe::BlobShape* InputParameter::_internal_add_shape() {
+  return shape_.Add();
+}
+inline ::opencv_caffe::BlobShape* InputParameter::add_shape() {
+  ::opencv_caffe::BlobShape* _add = _internal_add_shape();
+  // @@protoc_insertion_point(field_add:opencv_caffe.InputParameter.shape)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobShape >&
 InputParameter::shape() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.InputParameter.shape)
   return shape_;
@@ -25890,74 +35908,86 @@ InputParameter::shape() const {
 // LogParameter
 
 // optional float base = 1 [default = -1];
-inline bool LogParameter::has_base() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void LogParameter::set_has_base() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool LogParameter::_internal_has_base() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void LogParameter::clear_has_base() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool LogParameter::has_base() const {
+  return _internal_has_base();
 }
 inline void LogParameter::clear_base() {
   base_ = -1;
-  clear_has_base();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline float LogParameter::_internal_base() const {
+  return base_;
 }
 inline float LogParameter::base() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LogParameter.base)
-  return base_;
+  return _internal_base();
 }
-inline void LogParameter::set_base(float value) {
-  set_has_base();
+inline void LogParameter::_internal_set_base(float value) {
+  _has_bits_[0] |= 0x00000002u;
   base_ = value;
+}
+inline void LogParameter::set_base(float value) {
+  _internal_set_base(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LogParameter.base)
 }
 
 // optional float scale = 2 [default = 1];
-inline bool LogParameter::has_scale() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void LogParameter::set_has_scale() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool LogParameter::_internal_has_scale() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void LogParameter::clear_has_scale() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool LogParameter::has_scale() const {
+  return _internal_has_scale();
 }
 inline void LogParameter::clear_scale() {
   scale_ = 1;
-  clear_has_scale();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float LogParameter::_internal_scale() const {
+  return scale_;
 }
 inline float LogParameter::scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LogParameter.scale)
-  return scale_;
+  return _internal_scale();
 }
-inline void LogParameter::set_scale(float value) {
-  set_has_scale();
+inline void LogParameter::_internal_set_scale(float value) {
+  _has_bits_[0] |= 0x00000004u;
   scale_ = value;
+}
+inline void LogParameter::set_scale(float value) {
+  _internal_set_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LogParameter.scale)
 }
 
 // optional float shift = 3 [default = 0];
-inline bool LogParameter::has_shift() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void LogParameter::set_has_shift() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool LogParameter::_internal_has_shift() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void LogParameter::clear_has_shift() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool LogParameter::has_shift() const {
+  return _internal_has_shift();
 }
 inline void LogParameter::clear_shift() {
   shift_ = 0;
-  clear_has_shift();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float LogParameter::_internal_shift() const {
+  return shift_;
 }
 inline float LogParameter::shift() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LogParameter.shift)
-  return shift_;
+  return _internal_shift();
 }
-inline void LogParameter::set_shift(float value) {
-  set_has_shift();
+inline void LogParameter::_internal_set_shift(float value) {
+  _has_bits_[0] |= 0x00000001u;
   shift_ = value;
+}
+inline void LogParameter::set_shift(float value) {
+  _internal_set_shift(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LogParameter.shift)
 }
 
@@ -25966,148 +35996,172 @@ inline void LogParameter::set_shift(float value) {
 // LRNParameter
 
 // optional uint32 local_size = 1 [default = 5];
-inline bool LRNParameter::has_local_size() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool LRNParameter::_internal_has_local_size() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void LRNParameter::set_has_local_size() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void LRNParameter::clear_has_local_size() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool LRNParameter::has_local_size() const {
+  return _internal_has_local_size();
 }
 inline void LRNParameter::clear_local_size() {
   local_size_ = 5u;
-  clear_has_local_size();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 LRNParameter::local_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.LRNParameter.local_size)
+inline uint32_t LRNParameter::_internal_local_size() const {
   return local_size_;
 }
-inline void LRNParameter::set_local_size(::google::protobuf::uint32 value) {
-  set_has_local_size();
+inline uint32_t LRNParameter::local_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.LRNParameter.local_size)
+  return _internal_local_size();
+}
+inline void LRNParameter::_internal_set_local_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   local_size_ = value;
+}
+inline void LRNParameter::set_local_size(uint32_t value) {
+  _internal_set_local_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LRNParameter.local_size)
 }
 
 // optional float alpha = 2 [default = 1];
-inline bool LRNParameter::has_alpha() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void LRNParameter::set_has_alpha() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool LRNParameter::_internal_has_alpha() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void LRNParameter::clear_has_alpha() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool LRNParameter::has_alpha() const {
+  return _internal_has_alpha();
 }
 inline void LRNParameter::clear_alpha() {
   alpha_ = 1;
-  clear_has_alpha();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline float LRNParameter::_internal_alpha() const {
+  return alpha_;
 }
 inline float LRNParameter::alpha() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LRNParameter.alpha)
-  return alpha_;
+  return _internal_alpha();
 }
-inline void LRNParameter::set_alpha(float value) {
-  set_has_alpha();
+inline void LRNParameter::_internal_set_alpha(float value) {
+  _has_bits_[0] |= 0x00000008u;
   alpha_ = value;
+}
+inline void LRNParameter::set_alpha(float value) {
+  _internal_set_alpha(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LRNParameter.alpha)
 }
 
 // optional float beta = 3 [default = 0.75];
-inline bool LRNParameter::has_beta() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+inline bool LRNParameter::_internal_has_beta() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void LRNParameter::set_has_beta() {
-  _has_bits_[0] |= 0x00000010u;
-}
-inline void LRNParameter::clear_has_beta() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool LRNParameter::has_beta() const {
+  return _internal_has_beta();
 }
 inline void LRNParameter::clear_beta() {
   beta_ = 0.75f;
-  clear_has_beta();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline float LRNParameter::_internal_beta() const {
+  return beta_;
 }
 inline float LRNParameter::beta() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LRNParameter.beta)
-  return beta_;
+  return _internal_beta();
 }
-inline void LRNParameter::set_beta(float value) {
-  set_has_beta();
+inline void LRNParameter::_internal_set_beta(float value) {
+  _has_bits_[0] |= 0x00000010u;
   beta_ = value;
+}
+inline void LRNParameter::set_beta(float value) {
+  _internal_set_beta(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LRNParameter.beta)
 }
 
 // optional .opencv_caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
-inline bool LRNParameter::has_norm_region() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void LRNParameter::set_has_norm_region() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool LRNParameter::_internal_has_norm_region() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void LRNParameter::clear_has_norm_region() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool LRNParameter::has_norm_region() const {
+  return _internal_has_norm_region();
 }
 inline void LRNParameter::clear_norm_region() {
   norm_region_ = 0;
-  clear_has_norm_region();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::opencv_caffe::LRNParameter_NormRegion LRNParameter::_internal_norm_region() const {
+  return static_cast< ::opencv_caffe::LRNParameter_NormRegion >(norm_region_);
 }
 inline ::opencv_caffe::LRNParameter_NormRegion LRNParameter::norm_region() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LRNParameter.norm_region)
-  return static_cast< ::opencv_caffe::LRNParameter_NormRegion >(norm_region_);
+  return _internal_norm_region();
 }
-inline void LRNParameter::set_norm_region(::opencv_caffe::LRNParameter_NormRegion value) {
+inline void LRNParameter::_internal_set_norm_region(::opencv_caffe::LRNParameter_NormRegion value) {
   assert(::opencv_caffe::LRNParameter_NormRegion_IsValid(value));
-  set_has_norm_region();
+  _has_bits_[0] |= 0x00000001u;
   norm_region_ = value;
+}
+inline void LRNParameter::set_norm_region(::opencv_caffe::LRNParameter_NormRegion value) {
+  _internal_set_norm_region(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LRNParameter.norm_region)
 }
 
 // optional float k = 5 [default = 1];
-inline bool LRNParameter::has_k() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void LRNParameter::set_has_k() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool LRNParameter::_internal_has_k() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void LRNParameter::clear_has_k() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool LRNParameter::has_k() const {
+  return _internal_has_k();
 }
 inline void LRNParameter::clear_k() {
   k_ = 1;
-  clear_has_k();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline float LRNParameter::_internal_k() const {
+  return k_;
 }
 inline float LRNParameter::k() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LRNParameter.k)
-  return k_;
+  return _internal_k();
 }
-inline void LRNParameter::set_k(float value) {
-  set_has_k();
+inline void LRNParameter::_internal_set_k(float value) {
+  _has_bits_[0] |= 0x00000020u;
   k_ = value;
+}
+inline void LRNParameter::set_k(float value) {
+  _internal_set_k(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LRNParameter.k)
 }
 
 // optional .opencv_caffe.LRNParameter.Engine engine = 6 [default = DEFAULT];
-inline bool LRNParameter::has_engine() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void LRNParameter::set_has_engine() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool LRNParameter::_internal_has_engine() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void LRNParameter::clear_has_engine() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool LRNParameter::has_engine() const {
+  return _internal_has_engine();
 }
 inline void LRNParameter::clear_engine() {
   engine_ = 0;
-  clear_has_engine();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::opencv_caffe::LRNParameter_Engine LRNParameter::_internal_engine() const {
+  return static_cast< ::opencv_caffe::LRNParameter_Engine >(engine_);
 }
 inline ::opencv_caffe::LRNParameter_Engine LRNParameter::engine() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.LRNParameter.engine)
-  return static_cast< ::opencv_caffe::LRNParameter_Engine >(engine_);
+  return _internal_engine();
 }
-inline void LRNParameter::set_engine(::opencv_caffe::LRNParameter_Engine value) {
+inline void LRNParameter::_internal_set_engine(::opencv_caffe::LRNParameter_Engine value) {
   assert(::opencv_caffe::LRNParameter_Engine_IsValid(value));
-  set_has_engine();
+  _has_bits_[0] |= 0x00000002u;
   engine_ = value;
+}
+inline void LRNParameter::set_engine(::opencv_caffe::LRNParameter_Engine value) {
+  _internal_set_engine(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.LRNParameter.engine)
 }
 
@@ -26116,98 +36170,114 @@ inline void LRNParameter::set_engine(::opencv_caffe::LRNParameter_Engine value)
 // MemoryDataParameter
 
 // optional uint32 batch_size = 1;
-inline bool MemoryDataParameter::has_batch_size() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool MemoryDataParameter::_internal_has_batch_size() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void MemoryDataParameter::set_has_batch_size() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void MemoryDataParameter::clear_has_batch_size() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool MemoryDataParameter::has_batch_size() const {
+  return _internal_has_batch_size();
 }
 inline void MemoryDataParameter::clear_batch_size() {
   batch_size_ = 0u;
-  clear_has_batch_size();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::uint32 MemoryDataParameter::batch_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.MemoryDataParameter.batch_size)
+inline uint32_t MemoryDataParameter::_internal_batch_size() const {
   return batch_size_;
 }
-inline void MemoryDataParameter::set_batch_size(::google::protobuf::uint32 value) {
-  set_has_batch_size();
+inline uint32_t MemoryDataParameter::batch_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.MemoryDataParameter.batch_size)
+  return _internal_batch_size();
+}
+inline void MemoryDataParameter::_internal_set_batch_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   batch_size_ = value;
+}
+inline void MemoryDataParameter::set_batch_size(uint32_t value) {
+  _internal_set_batch_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.MemoryDataParameter.batch_size)
 }
 
 // optional uint32 channels = 2;
-inline bool MemoryDataParameter::has_channels() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void MemoryDataParameter::set_has_channels() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool MemoryDataParameter::_internal_has_channels() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void MemoryDataParameter::clear_has_channels() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool MemoryDataParameter::has_channels() const {
+  return _internal_has_channels();
 }
 inline void MemoryDataParameter::clear_channels() {
   channels_ = 0u;
-  clear_has_channels();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::uint32 MemoryDataParameter::channels() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.MemoryDataParameter.channels)
+inline uint32_t MemoryDataParameter::_internal_channels() const {
   return channels_;
 }
-inline void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) {
-  set_has_channels();
+inline uint32_t MemoryDataParameter::channels() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.MemoryDataParameter.channels)
+  return _internal_channels();
+}
+inline void MemoryDataParameter::_internal_set_channels(uint32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   channels_ = value;
+}
+inline void MemoryDataParameter::set_channels(uint32_t value) {
+  _internal_set_channels(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.MemoryDataParameter.channels)
 }
 
 // optional uint32 height = 3;
-inline bool MemoryDataParameter::has_height() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void MemoryDataParameter::set_has_height() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool MemoryDataParameter::_internal_has_height() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void MemoryDataParameter::clear_has_height() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool MemoryDataParameter::has_height() const {
+  return _internal_has_height();
 }
 inline void MemoryDataParameter::clear_height() {
   height_ = 0u;
-  clear_has_height();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 MemoryDataParameter::height() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.MemoryDataParameter.height)
+inline uint32_t MemoryDataParameter::_internal_height() const {
   return height_;
 }
-inline void MemoryDataParameter::set_height(::google::protobuf::uint32 value) {
-  set_has_height();
+inline uint32_t MemoryDataParameter::height() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.MemoryDataParameter.height)
+  return _internal_height();
+}
+inline void MemoryDataParameter::_internal_set_height(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   height_ = value;
+}
+inline void MemoryDataParameter::set_height(uint32_t value) {
+  _internal_set_height(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.MemoryDataParameter.height)
 }
 
 // optional uint32 width = 4;
-inline bool MemoryDataParameter::has_width() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void MemoryDataParameter::set_has_width() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool MemoryDataParameter::_internal_has_width() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void MemoryDataParameter::clear_has_width() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool MemoryDataParameter::has_width() const {
+  return _internal_has_width();
 }
 inline void MemoryDataParameter::clear_width() {
   width_ = 0u;
-  clear_has_width();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::uint32 MemoryDataParameter::width() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.MemoryDataParameter.width)
+inline uint32_t MemoryDataParameter::_internal_width() const {
   return width_;
 }
-inline void MemoryDataParameter::set_width(::google::protobuf::uint32 value) {
-  set_has_width();
+inline uint32_t MemoryDataParameter::width() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.MemoryDataParameter.width)
+  return _internal_width();
+}
+inline void MemoryDataParameter::_internal_set_width(uint32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   width_ = value;
+}
+inline void MemoryDataParameter::set_width(uint32_t value) {
+  _internal_set_width(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.MemoryDataParameter.width)
 }
 
@@ -26216,74 +36286,86 @@ inline void MemoryDataParameter::set_width(::google::protobuf::uint32 value) {
 // MVNParameter
 
 // optional bool normalize_variance = 1 [default = true];
-inline bool MVNParameter::has_normalize_variance() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool MVNParameter::_internal_has_normalize_variance() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void MVNParameter::set_has_normalize_variance() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void MVNParameter::clear_has_normalize_variance() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool MVNParameter::has_normalize_variance() const {
+  return _internal_has_normalize_variance();
 }
 inline void MVNParameter::clear_normalize_variance() {
   normalize_variance_ = true;
-  clear_has_normalize_variance();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool MVNParameter::_internal_normalize_variance() const {
+  return normalize_variance_;
 }
 inline bool MVNParameter::normalize_variance() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.MVNParameter.normalize_variance)
-  return normalize_variance_;
+  return _internal_normalize_variance();
 }
-inline void MVNParameter::set_normalize_variance(bool value) {
-  set_has_normalize_variance();
+inline void MVNParameter::_internal_set_normalize_variance(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   normalize_variance_ = value;
+}
+inline void MVNParameter::set_normalize_variance(bool value) {
+  _internal_set_normalize_variance(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.MVNParameter.normalize_variance)
 }
 
 // optional bool across_channels = 2 [default = false];
-inline bool MVNParameter::has_across_channels() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void MVNParameter::set_has_across_channels() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool MVNParameter::_internal_has_across_channels() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void MVNParameter::clear_has_across_channels() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool MVNParameter::has_across_channels() const {
+  return _internal_has_across_channels();
 }
 inline void MVNParameter::clear_across_channels() {
   across_channels_ = false;
-  clear_has_across_channels();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline bool MVNParameter::_internal_across_channels() const {
+  return across_channels_;
 }
 inline bool MVNParameter::across_channels() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.MVNParameter.across_channels)
-  return across_channels_;
+  return _internal_across_channels();
 }
-inline void MVNParameter::set_across_channels(bool value) {
-  set_has_across_channels();
+inline void MVNParameter::_internal_set_across_channels(bool value) {
+  _has_bits_[0] |= 0x00000001u;
   across_channels_ = value;
+}
+inline void MVNParameter::set_across_channels(bool value) {
+  _internal_set_across_channels(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.MVNParameter.across_channels)
 }
 
 // optional float eps = 3 [default = 1e-09];
-inline bool MVNParameter::has_eps() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void MVNParameter::set_has_eps() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool MVNParameter::_internal_has_eps() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void MVNParameter::clear_has_eps() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool MVNParameter::has_eps() const {
+  return _internal_has_eps();
 }
 inline void MVNParameter::clear_eps() {
   eps_ = 1e-09f;
-  clear_has_eps();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float MVNParameter::_internal_eps() const {
+  return eps_;
 }
 inline float MVNParameter::eps() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.MVNParameter.eps)
-  return eps_;
+  return _internal_eps();
 }
-inline void MVNParameter::set_eps(float value) {
-  set_has_eps();
+inline void MVNParameter::_internal_set_eps(float value) {
+  _has_bits_[0] |= 0x00000004u;
   eps_ = value;
+}
+inline void MVNParameter::set_eps(float value) {
+  _internal_set_eps(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.MVNParameter.eps)
 }
 
@@ -26292,54 +36374,90 @@ inline void MVNParameter::set_eps(float value) {
 // ParameterParameter
 
 // optional .opencv_caffe.BlobShape shape = 1;
-inline bool ParameterParameter::has_shape() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool ParameterParameter::_internal_has_shape() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || shape_ != nullptr);
+  return value;
 }
-inline void ParameterParameter::set_has_shape() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ParameterParameter::has_shape() const {
+  return _internal_has_shape();
 }
-inline void ParameterParameter::clear_has_shape() {
+inline void ParameterParameter::clear_shape() {
+  if (shape_ != nullptr) shape_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void ParameterParameter::clear_shape() {
-  if (shape_ != NULL) shape_->Clear();
-  clear_has_shape();
+inline const ::opencv_caffe::BlobShape& ParameterParameter::_internal_shape() const {
+  const ::opencv_caffe::BlobShape* p = shape_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::BlobShape&>(
+      ::opencv_caffe::_BlobShape_default_instance_);
 }
 inline const ::opencv_caffe::BlobShape& ParameterParameter::shape() const {
-  const ::opencv_caffe::BlobShape* p = shape_;
   // @@protoc_insertion_point(field_get:opencv_caffe.ParameterParameter.shape)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::BlobShape*>(
-      &::opencv_caffe::_BlobShape_default_instance_);
+  return _internal_shape();
+}
+inline void ParameterParameter::unsafe_arena_set_allocated_shape(
+    ::opencv_caffe::BlobShape* shape) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(shape_);
+  }
+  shape_ = shape;
+  if (shape) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.ParameterParameter.shape)
 }
 inline ::opencv_caffe::BlobShape* ParameterParameter::release_shape() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::BlobShape* temp = shape_;
+  shape_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::BlobShape* ParameterParameter::unsafe_arena_release_shape() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ParameterParameter.shape)
-  clear_has_shape();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::BlobShape* temp = shape_;
-  shape_ = NULL;
+  shape_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::BlobShape* ParameterParameter::mutable_shape() {
-  set_has_shape();
-  if (shape_ == NULL) {
-    shape_ = new ::opencv_caffe::BlobShape;
+inline ::opencv_caffe::BlobShape* ParameterParameter::_internal_mutable_shape() {
+  _has_bits_[0] |= 0x00000001u;
+  if (shape_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::BlobShape>(GetArenaForAllocation());
+    shape_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.ParameterParameter.shape)
   return shape_;
 }
+inline ::opencv_caffe::BlobShape* ParameterParameter::mutable_shape() {
+  ::opencv_caffe::BlobShape* _msg = _internal_mutable_shape();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.ParameterParameter.shape)
+  return _msg;
+}
 inline void ParameterParameter::set_allocated_shape(::opencv_caffe::BlobShape* shape) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete shape_;
   }
   if (shape) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::BlobShape>::GetOwningArena(shape);
     if (message_arena != submessage_arena) {
-      shape = ::google::protobuf::internal::GetOwnedMessage(
+      shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, shape, submessage_arena);
     }
-    set_has_shape();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_shape();
+    _has_bits_[0] &= ~0x00000001u;
   }
   shape_ = shape;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ParameterParameter.shape)
@@ -26350,316 +36468,368 @@ inline void ParameterParameter::set_allocated_shape(::opencv_caffe::BlobShape* s
 // PoolingParameter
 
 // optional .opencv_caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX];
-inline bool PoolingParameter::has_pool() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void PoolingParameter::set_has_pool() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool PoolingParameter::_internal_has_pool() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_pool() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool PoolingParameter::has_pool() const {
+  return _internal_has_pool();
 }
 inline void PoolingParameter::clear_pool() {
   pool_ = 0;
-  clear_has_pool();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::opencv_caffe::PoolingParameter_PoolMethod PoolingParameter::_internal_pool() const {
+  return static_cast< ::opencv_caffe::PoolingParameter_PoolMethod >(pool_);
 }
 inline ::opencv_caffe::PoolingParameter_PoolMethod PoolingParameter::pool() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.pool)
-  return static_cast< ::opencv_caffe::PoolingParameter_PoolMethod >(pool_);
+  return _internal_pool();
 }
-inline void PoolingParameter::set_pool(::opencv_caffe::PoolingParameter_PoolMethod value) {
+inline void PoolingParameter::_internal_set_pool(::opencv_caffe::PoolingParameter_PoolMethod value) {
   assert(::opencv_caffe::PoolingParameter_PoolMethod_IsValid(value));
-  set_has_pool();
+  _has_bits_[0] |= 0x00000001u;
   pool_ = value;
+}
+inline void PoolingParameter::set_pool(::opencv_caffe::PoolingParameter_PoolMethod value) {
+  _internal_set_pool(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.pool)
 }
 
 // optional uint32 pad = 4 [default = 0];
-inline bool PoolingParameter::has_pad() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool PoolingParameter::_internal_has_pad() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void PoolingParameter::set_has_pad() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void PoolingParameter::clear_has_pad() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool PoolingParameter::has_pad() const {
+  return _internal_has_pad();
 }
 inline void PoolingParameter::clear_pad() {
   pad_ = 0u;
-  clear_has_pad();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::pad() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.pad)
+inline uint32_t PoolingParameter::_internal_pad() const {
   return pad_;
 }
-inline void PoolingParameter::set_pad(::google::protobuf::uint32 value) {
-  set_has_pad();
+inline uint32_t PoolingParameter::pad() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.pad)
+  return _internal_pad();
+}
+inline void PoolingParameter::_internal_set_pad(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   pad_ = value;
+}
+inline void PoolingParameter::set_pad(uint32_t value) {
+  _internal_set_pad(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.pad)
 }
 
 // optional uint32 pad_h = 9 [default = 0];
-inline bool PoolingParameter::has_pad_h() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void PoolingParameter::set_has_pad_h() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool PoolingParameter::_internal_has_pad_h() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_pad_h() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool PoolingParameter::has_pad_h() const {
+  return _internal_has_pad_h();
 }
 inline void PoolingParameter::clear_pad_h() {
   pad_h_ = 0u;
-  clear_has_pad_h();
+  _has_bits_[0] &= ~0x00000080u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::pad_h() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.pad_h)
+inline uint32_t PoolingParameter::_internal_pad_h() const {
   return pad_h_;
 }
-inline void PoolingParameter::set_pad_h(::google::protobuf::uint32 value) {
-  set_has_pad_h();
+inline uint32_t PoolingParameter::pad_h() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.pad_h)
+  return _internal_pad_h();
+}
+inline void PoolingParameter::_internal_set_pad_h(uint32_t value) {
+  _has_bits_[0] |= 0x00000080u;
   pad_h_ = value;
+}
+inline void PoolingParameter::set_pad_h(uint32_t value) {
+  _internal_set_pad_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.pad_h)
 }
 
 // optional uint32 pad_w = 10 [default = 0];
-inline bool PoolingParameter::has_pad_w() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void PoolingParameter::set_has_pad_w() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool PoolingParameter::_internal_has_pad_w() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_pad_w() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool PoolingParameter::has_pad_w() const {
+  return _internal_has_pad_w();
 }
 inline void PoolingParameter::clear_pad_w() {
   pad_w_ = 0u;
-  clear_has_pad_w();
+  _has_bits_[0] &= ~0x00000100u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::pad_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.pad_w)
+inline uint32_t PoolingParameter::_internal_pad_w() const {
   return pad_w_;
 }
-inline void PoolingParameter::set_pad_w(::google::protobuf::uint32 value) {
-  set_has_pad_w();
+inline uint32_t PoolingParameter::pad_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.pad_w)
+  return _internal_pad_w();
+}
+inline void PoolingParameter::_internal_set_pad_w(uint32_t value) {
+  _has_bits_[0] |= 0x00000100u;
   pad_w_ = value;
+}
+inline void PoolingParameter::set_pad_w(uint32_t value) {
+  _internal_set_pad_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.pad_w)
 }
 
 // optional uint32 kernel_size = 2;
-inline bool PoolingParameter::has_kernel_size() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void PoolingParameter::set_has_kernel_size() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool PoolingParameter::_internal_has_kernel_size() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_kernel_size() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool PoolingParameter::has_kernel_size() const {
+  return _internal_has_kernel_size();
 }
 inline void PoolingParameter::clear_kernel_size() {
   kernel_size_ = 0u;
-  clear_has_kernel_size();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::kernel_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.kernel_size)
+inline uint32_t PoolingParameter::_internal_kernel_size() const {
   return kernel_size_;
 }
-inline void PoolingParameter::set_kernel_size(::google::protobuf::uint32 value) {
-  set_has_kernel_size();
+inline uint32_t PoolingParameter::kernel_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.kernel_size)
+  return _internal_kernel_size();
+}
+inline void PoolingParameter::_internal_set_kernel_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   kernel_size_ = value;
+}
+inline void PoolingParameter::set_kernel_size(uint32_t value) {
+  _internal_set_kernel_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.kernel_size)
 }
 
 // optional uint32 kernel_h = 5;
-inline bool PoolingParameter::has_kernel_h() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool PoolingParameter::_internal_has_kernel_h() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void PoolingParameter::set_has_kernel_h() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void PoolingParameter::clear_has_kernel_h() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool PoolingParameter::has_kernel_h() const {
+  return _internal_has_kernel_h();
 }
 inline void PoolingParameter::clear_kernel_h() {
   kernel_h_ = 0u;
-  clear_has_kernel_h();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::kernel_h() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.kernel_h)
+inline uint32_t PoolingParameter::_internal_kernel_h() const {
   return kernel_h_;
 }
-inline void PoolingParameter::set_kernel_h(::google::protobuf::uint32 value) {
-  set_has_kernel_h();
+inline uint32_t PoolingParameter::kernel_h() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.kernel_h)
+  return _internal_kernel_h();
+}
+inline void PoolingParameter::_internal_set_kernel_h(uint32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   kernel_h_ = value;
+}
+inline void PoolingParameter::set_kernel_h(uint32_t value) {
+  _internal_set_kernel_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.kernel_h)
 }
 
 // optional uint32 kernel_w = 6;
-inline bool PoolingParameter::has_kernel_w() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void PoolingParameter::set_has_kernel_w() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool PoolingParameter::_internal_has_kernel_w() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_kernel_w() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool PoolingParameter::has_kernel_w() const {
+  return _internal_has_kernel_w();
 }
 inline void PoolingParameter::clear_kernel_w() {
   kernel_w_ = 0u;
-  clear_has_kernel_w();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::kernel_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.kernel_w)
+inline uint32_t PoolingParameter::_internal_kernel_w() const {
   return kernel_w_;
 }
-inline void PoolingParameter::set_kernel_w(::google::protobuf::uint32 value) {
-  set_has_kernel_w();
+inline uint32_t PoolingParameter::kernel_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.kernel_w)
+  return _internal_kernel_w();
+}
+inline void PoolingParameter::_internal_set_kernel_w(uint32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   kernel_w_ = value;
+}
+inline void PoolingParameter::set_kernel_w(uint32_t value) {
+  _internal_set_kernel_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.kernel_w)
 }
 
 // optional uint32 stride = 3 [default = 1];
-inline bool PoolingParameter::has_stride() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
-}
-inline void PoolingParameter::set_has_stride() {
-  _has_bits_[0] |= 0x00000800u;
+inline bool PoolingParameter::_internal_has_stride() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_stride() {
-  _has_bits_[0] &= ~0x00000800u;
+inline bool PoolingParameter::has_stride() const {
+  return _internal_has_stride();
 }
 inline void PoolingParameter::clear_stride() {
   stride_ = 1u;
-  clear_has_stride();
+  _has_bits_[0] &= ~0x00000800u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::stride() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.stride)
+inline uint32_t PoolingParameter::_internal_stride() const {
   return stride_;
 }
-inline void PoolingParameter::set_stride(::google::protobuf::uint32 value) {
-  set_has_stride();
+inline uint32_t PoolingParameter::stride() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.stride)
+  return _internal_stride();
+}
+inline void PoolingParameter::_internal_set_stride(uint32_t value) {
+  _has_bits_[0] |= 0x00000800u;
   stride_ = value;
+}
+inline void PoolingParameter::set_stride(uint32_t value) {
+  _internal_set_stride(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.stride)
 }
 
 // optional uint32 stride_h = 7;
-inline bool PoolingParameter::has_stride_h() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void PoolingParameter::set_has_stride_h() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool PoolingParameter::_internal_has_stride_h() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_stride_h() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool PoolingParameter::has_stride_h() const {
+  return _internal_has_stride_h();
 }
 inline void PoolingParameter::clear_stride_h() {
   stride_h_ = 0u;
-  clear_has_stride_h();
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::stride_h() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.stride_h)
+inline uint32_t PoolingParameter::_internal_stride_h() const {
   return stride_h_;
 }
-inline void PoolingParameter::set_stride_h(::google::protobuf::uint32 value) {
-  set_has_stride_h();
+inline uint32_t PoolingParameter::stride_h() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.stride_h)
+  return _internal_stride_h();
+}
+inline void PoolingParameter::_internal_set_stride_h(uint32_t value) {
+  _has_bits_[0] |= 0x00000020u;
   stride_h_ = value;
+}
+inline void PoolingParameter::set_stride_h(uint32_t value) {
+  _internal_set_stride_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.stride_h)
 }
 
 // optional uint32 stride_w = 8;
-inline bool PoolingParameter::has_stride_w() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+inline bool PoolingParameter::_internal_has_stride_w() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void PoolingParameter::set_has_stride_w() {
-  _has_bits_[0] |= 0x00000040u;
-}
-inline void PoolingParameter::clear_has_stride_w() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool PoolingParameter::has_stride_w() const {
+  return _internal_has_stride_w();
 }
 inline void PoolingParameter::clear_stride_w() {
   stride_w_ = 0u;
-  clear_has_stride_w();
+  _has_bits_[0] &= ~0x00000040u;
 }
-inline ::google::protobuf::uint32 PoolingParameter::stride_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.stride_w)
+inline uint32_t PoolingParameter::_internal_stride_w() const {
   return stride_w_;
 }
-inline void PoolingParameter::set_stride_w(::google::protobuf::uint32 value) {
-  set_has_stride_w();
+inline uint32_t PoolingParameter::stride_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.stride_w)
+  return _internal_stride_w();
+}
+inline void PoolingParameter::_internal_set_stride_w(uint32_t value) {
+  _has_bits_[0] |= 0x00000040u;
   stride_w_ = value;
+}
+inline void PoolingParameter::set_stride_w(uint32_t value) {
+  _internal_set_stride_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.stride_w)
 }
 
 // optional .opencv_caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT];
-inline bool PoolingParameter::has_engine() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
-}
-inline void PoolingParameter::set_has_engine() {
-  _has_bits_[0] |= 0x00000200u;
+inline bool PoolingParameter::_internal_has_engine() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_engine() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool PoolingParameter::has_engine() const {
+  return _internal_has_engine();
 }
 inline void PoolingParameter::clear_engine() {
   engine_ = 0;
-  clear_has_engine();
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline ::opencv_caffe::PoolingParameter_Engine PoolingParameter::_internal_engine() const {
+  return static_cast< ::opencv_caffe::PoolingParameter_Engine >(engine_);
 }
 inline ::opencv_caffe::PoolingParameter_Engine PoolingParameter::engine() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.engine)
-  return static_cast< ::opencv_caffe::PoolingParameter_Engine >(engine_);
+  return _internal_engine();
 }
-inline void PoolingParameter::set_engine(::opencv_caffe::PoolingParameter_Engine value) {
+inline void PoolingParameter::_internal_set_engine(::opencv_caffe::PoolingParameter_Engine value) {
   assert(::opencv_caffe::PoolingParameter_Engine_IsValid(value));
-  set_has_engine();
+  _has_bits_[0] |= 0x00000200u;
   engine_ = value;
+}
+inline void PoolingParameter::set_engine(::opencv_caffe::PoolingParameter_Engine value) {
+  _internal_set_engine(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.engine)
 }
 
 // optional bool global_pooling = 12 [default = false];
-inline bool PoolingParameter::has_global_pooling() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+inline bool PoolingParameter::_internal_has_global_pooling() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void PoolingParameter::set_has_global_pooling() {
-  _has_bits_[0] |= 0x00000400u;
-}
-inline void PoolingParameter::clear_has_global_pooling() {
-  _has_bits_[0] &= ~0x00000400u;
+inline bool PoolingParameter::has_global_pooling() const {
+  return _internal_has_global_pooling();
 }
 inline void PoolingParameter::clear_global_pooling() {
   global_pooling_ = false;
-  clear_has_global_pooling();
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline bool PoolingParameter::_internal_global_pooling() const {
+  return global_pooling_;
 }
 inline bool PoolingParameter::global_pooling() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.global_pooling)
-  return global_pooling_;
+  return _internal_global_pooling();
 }
-inline void PoolingParameter::set_global_pooling(bool value) {
-  set_has_global_pooling();
+inline void PoolingParameter::_internal_set_global_pooling(bool value) {
+  _has_bits_[0] |= 0x00000400u;
   global_pooling_ = value;
+}
+inline void PoolingParameter::set_global_pooling(bool value) {
+  _internal_set_global_pooling(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.global_pooling)
 }
 
 // optional bool ceil_mode = 13 [default = true];
-inline bool PoolingParameter::has_ceil_mode() const {
-  return (_has_bits_[0] & 0x00001000u) != 0;
-}
-inline void PoolingParameter::set_has_ceil_mode() {
-  _has_bits_[0] |= 0x00001000u;
+inline bool PoolingParameter::_internal_has_ceil_mode() const {
+  bool value = (_has_bits_[0] & 0x00001000u) != 0;
+  return value;
 }
-inline void PoolingParameter::clear_has_ceil_mode() {
-  _has_bits_[0] &= ~0x00001000u;
+inline bool PoolingParameter::has_ceil_mode() const {
+  return _internal_has_ceil_mode();
 }
 inline void PoolingParameter::clear_ceil_mode() {
   ceil_mode_ = true;
-  clear_has_ceil_mode();
+  _has_bits_[0] &= ~0x00001000u;
+}
+inline bool PoolingParameter::_internal_ceil_mode() const {
+  return ceil_mode_;
 }
 inline bool PoolingParameter::ceil_mode() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PoolingParameter.ceil_mode)
-  return ceil_mode_;
+  return _internal_ceil_mode();
 }
-inline void PoolingParameter::set_ceil_mode(bool value) {
-  set_has_ceil_mode();
+inline void PoolingParameter::_internal_set_ceil_mode(bool value) {
+  _has_bits_[0] |= 0x00001000u;
   ceil_mode_ = value;
+}
+inline void PoolingParameter::set_ceil_mode(bool value) {
+  _internal_set_ceil_mode(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PoolingParameter.ceil_mode)
 }
 
@@ -26668,74 +36838,86 @@ inline void PoolingParameter::set_ceil_mode(bool value) {
 // PowerParameter
 
 // optional float power = 1 [default = 1];
-inline bool PowerParameter::has_power() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void PowerParameter::set_has_power() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool PowerParameter::_internal_has_power() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void PowerParameter::clear_has_power() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool PowerParameter::has_power() const {
+  return _internal_has_power();
 }
 inline void PowerParameter::clear_power() {
   power_ = 1;
-  clear_has_power();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline float PowerParameter::_internal_power() const {
+  return power_;
 }
 inline float PowerParameter::power() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PowerParameter.power)
-  return power_;
+  return _internal_power();
 }
-inline void PowerParameter::set_power(float value) {
-  set_has_power();
+inline void PowerParameter::_internal_set_power(float value) {
+  _has_bits_[0] |= 0x00000002u;
   power_ = value;
+}
+inline void PowerParameter::set_power(float value) {
+  _internal_set_power(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PowerParameter.power)
 }
 
 // optional float scale = 2 [default = 1];
-inline bool PowerParameter::has_scale() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void PowerParameter::set_has_scale() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool PowerParameter::_internal_has_scale() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void PowerParameter::clear_has_scale() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool PowerParameter::has_scale() const {
+  return _internal_has_scale();
 }
 inline void PowerParameter::clear_scale() {
   scale_ = 1;
-  clear_has_scale();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float PowerParameter::_internal_scale() const {
+  return scale_;
 }
 inline float PowerParameter::scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PowerParameter.scale)
-  return scale_;
+  return _internal_scale();
 }
-inline void PowerParameter::set_scale(float value) {
-  set_has_scale();
+inline void PowerParameter::_internal_set_scale(float value) {
+  _has_bits_[0] |= 0x00000004u;
   scale_ = value;
+}
+inline void PowerParameter::set_scale(float value) {
+  _internal_set_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PowerParameter.scale)
 }
 
 // optional float shift = 3 [default = 0];
-inline bool PowerParameter::has_shift() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool PowerParameter::_internal_has_shift() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void PowerParameter::set_has_shift() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void PowerParameter::clear_has_shift() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool PowerParameter::has_shift() const {
+  return _internal_has_shift();
 }
 inline void PowerParameter::clear_shift() {
   shift_ = 0;
-  clear_has_shift();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float PowerParameter::_internal_shift() const {
+  return shift_;
 }
 inline float PowerParameter::shift() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PowerParameter.shift)
-  return shift_;
+  return _internal_shift();
 }
-inline void PowerParameter::set_shift(float value) {
-  set_has_shift();
+inline void PowerParameter::_internal_set_shift(float value) {
+  _has_bits_[0] |= 0x00000001u;
   shift_ = value;
+}
+inline void PowerParameter::set_shift(float value) {
+  _internal_set_shift(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PowerParameter.shift)
 }
 
@@ -26744,215 +36926,237 @@ inline void PowerParameter::set_shift(float value) {
 // PythonParameter
 
 // optional string module = 1;
-inline bool PythonParameter::has_module() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void PythonParameter::set_has_module() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool PythonParameter::_internal_has_module() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void PythonParameter::clear_has_module() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool PythonParameter::has_module() const {
+  return _internal_has_module();
 }
 inline void PythonParameter::clear_module() {
-  module_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_module();
+  module_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& PythonParameter::module() const {
+inline const std::string& PythonParameter::module() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PythonParameter.module)
-  return module_.GetNoArena();
+  return _internal_module();
 }
-inline void PythonParameter::set_module(const ::std::string& value) {
-  set_has_module();
-  module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void PythonParameter::set_module(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ module_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.PythonParameter.module)
 }
-#if LANG_CXX11
-inline void PythonParameter::set_module(::std::string&& value) {
-  set_has_module();
-  module_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.PythonParameter.module)
-}
-#endif
-inline void PythonParameter::set_module(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_module();
-  module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.PythonParameter.module)
-}
-inline void PythonParameter::set_module(const char* value, size_t size) {
-  set_has_module();
-  module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.PythonParameter.module)
-}
-inline ::std::string* PythonParameter::mutable_module() {
-  set_has_module();
+inline std::string* PythonParameter::mutable_module() {
+  std::string* _s = _internal_mutable_module();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.PythonParameter.module)
-  return module_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& PythonParameter::_internal_module() const {
+  return module_.Get();
+}
+inline void PythonParameter::_internal_set_module(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  module_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* PythonParameter::_internal_mutable_module() {
+  _has_bits_[0] |= 0x00000001u;
+  return module_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* PythonParameter::release_module() {
+inline std::string* PythonParameter::release_module() {
   // @@protoc_insertion_point(field_release:opencv_caffe.PythonParameter.module)
-  clear_has_module();
-  return module_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_module()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = module_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (module_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    module_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void PythonParameter::set_allocated_module(::std::string* module) {
-  if (module != NULL) {
-    set_has_module();
+inline void PythonParameter::set_allocated_module(std::string* module) {
+  if (module != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_module();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  module_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), module);
+  module_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), module,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (module_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    module_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.PythonParameter.module)
 }
 
 // optional string layer = 2;
-inline bool PythonParameter::has_layer() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void PythonParameter::set_has_layer() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool PythonParameter::_internal_has_layer() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void PythonParameter::clear_has_layer() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool PythonParameter::has_layer() const {
+  return _internal_has_layer();
 }
 inline void PythonParameter::clear_layer() {
-  layer_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_layer();
+  layer_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& PythonParameter::layer() const {
+inline const std::string& PythonParameter::layer() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PythonParameter.layer)
-  return layer_.GetNoArena();
+  return _internal_layer();
 }
-inline void PythonParameter::set_layer(const ::std::string& value) {
-  set_has_layer();
-  layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void PythonParameter::set_layer(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ layer_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.PythonParameter.layer)
 }
-#if LANG_CXX11
-inline void PythonParameter::set_layer(::std::string&& value) {
-  set_has_layer();
-  layer_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.PythonParameter.layer)
-}
-#endif
-inline void PythonParameter::set_layer(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_layer();
-  layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.PythonParameter.layer)
-}
-inline void PythonParameter::set_layer(const char* value, size_t size) {
-  set_has_layer();
-  layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.PythonParameter.layer)
-}
-inline ::std::string* PythonParameter::mutable_layer() {
-  set_has_layer();
+inline std::string* PythonParameter::mutable_layer() {
+  std::string* _s = _internal_mutable_layer();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.PythonParameter.layer)
-  return layer_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& PythonParameter::_internal_layer() const {
+  return layer_.Get();
+}
+inline void PythonParameter::_internal_set_layer(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  layer_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* PythonParameter::release_layer() {
+inline std::string* PythonParameter::_internal_mutable_layer() {
+  _has_bits_[0] |= 0x00000002u;
+  return layer_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* PythonParameter::release_layer() {
   // @@protoc_insertion_point(field_release:opencv_caffe.PythonParameter.layer)
-  clear_has_layer();
-  return layer_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_layer()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = layer_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (layer_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    layer_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void PythonParameter::set_allocated_layer(::std::string* layer) {
-  if (layer != NULL) {
-    set_has_layer();
+inline void PythonParameter::set_allocated_layer(std::string* layer) {
+  if (layer != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_layer();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  layer_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), layer,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (layer_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    layer_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  layer_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), layer);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.PythonParameter.layer)
 }
 
 // optional string param_str = 3 [default = ""];
-inline bool PythonParameter::has_param_str() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void PythonParameter::set_has_param_str() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool PythonParameter::_internal_has_param_str() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void PythonParameter::clear_has_param_str() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool PythonParameter::has_param_str() const {
+  return _internal_has_param_str();
 }
 inline void PythonParameter::clear_param_str() {
-  param_str_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_param_str();
+  param_str_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& PythonParameter::param_str() const {
+inline const std::string& PythonParameter::param_str() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PythonParameter.param_str)
-  return param_str_.GetNoArena();
+  return _internal_param_str();
 }
-inline void PythonParameter::set_param_str(const ::std::string& value) {
-  set_has_param_str();
-  param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void PythonParameter::set_param_str(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ param_str_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.PythonParameter.param_str)
 }
-#if LANG_CXX11
-inline void PythonParameter::set_param_str(::std::string&& value) {
-  set_has_param_str();
-  param_str_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.PythonParameter.param_str)
-}
-#endif
-inline void PythonParameter::set_param_str(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_param_str();
-  param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.PythonParameter.param_str)
-}
-inline void PythonParameter::set_param_str(const char* value, size_t size) {
-  set_has_param_str();
-  param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.PythonParameter.param_str)
-}
-inline ::std::string* PythonParameter::mutable_param_str() {
-  set_has_param_str();
+inline std::string* PythonParameter::mutable_param_str() {
+  std::string* _s = _internal_mutable_param_str();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.PythonParameter.param_str)
-  return param_str_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& PythonParameter::_internal_param_str() const {
+  return param_str_.Get();
+}
+inline void PythonParameter::_internal_set_param_str(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  param_str_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* PythonParameter::_internal_mutable_param_str() {
+  _has_bits_[0] |= 0x00000004u;
+  return param_str_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* PythonParameter::release_param_str() {
+inline std::string* PythonParameter::release_param_str() {
   // @@protoc_insertion_point(field_release:opencv_caffe.PythonParameter.param_str)
-  clear_has_param_str();
-  return param_str_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_param_str()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = param_str_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (param_str_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    param_str_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void PythonParameter::set_allocated_param_str(::std::string* param_str) {
-  if (param_str != NULL) {
-    set_has_param_str();
+inline void PythonParameter::set_allocated_param_str(std::string* param_str) {
+  if (param_str != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_param_str();
+    _has_bits_[0] &= ~0x00000004u;
   }
-  param_str_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), param_str);
+  param_str_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), param_str,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (param_str_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    param_str_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.PythonParameter.param_str)
 }
 
 // optional bool share_in_parallel = 4 [default = false];
-inline bool PythonParameter::has_share_in_parallel() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool PythonParameter::_internal_has_share_in_parallel() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void PythonParameter::set_has_share_in_parallel() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void PythonParameter::clear_has_share_in_parallel() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool PythonParameter::has_share_in_parallel() const {
+  return _internal_has_share_in_parallel();
 }
 inline void PythonParameter::clear_share_in_parallel() {
   share_in_parallel_ = false;
-  clear_has_share_in_parallel();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline bool PythonParameter::_internal_share_in_parallel() const {
+  return share_in_parallel_;
 }
 inline bool PythonParameter::share_in_parallel() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PythonParameter.share_in_parallel)
-  return share_in_parallel_;
+  return _internal_share_in_parallel();
 }
-inline void PythonParameter::set_share_in_parallel(bool value) {
-  set_has_share_in_parallel();
+inline void PythonParameter::_internal_set_share_in_parallel(bool value) {
+  _has_bits_[0] |= 0x00000008u;
   share_in_parallel_ = value;
+}
+inline void PythonParameter::set_share_in_parallel(bool value) {
+  _internal_set_share_in_parallel(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PythonParameter.share_in_parallel)
 }
 
@@ -26961,182 +37165,266 @@ inline void PythonParameter::set_share_in_parallel(bool value) {
 // RecurrentParameter
 
 // optional uint32 num_output = 1 [default = 0];
-inline bool RecurrentParameter::has_num_output() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void RecurrentParameter::set_has_num_output() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool RecurrentParameter::_internal_has_num_output() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void RecurrentParameter::clear_has_num_output() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool RecurrentParameter::has_num_output() const {
+  return _internal_has_num_output();
 }
 inline void RecurrentParameter::clear_num_output() {
   num_output_ = 0u;
-  clear_has_num_output();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 RecurrentParameter::num_output() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.RecurrentParameter.num_output)
+inline uint32_t RecurrentParameter::_internal_num_output() const {
   return num_output_;
 }
-inline void RecurrentParameter::set_num_output(::google::protobuf::uint32 value) {
-  set_has_num_output();
+inline uint32_t RecurrentParameter::num_output() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.RecurrentParameter.num_output)
+  return _internal_num_output();
+}
+inline void RecurrentParameter::_internal_set_num_output(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   num_output_ = value;
+}
+inline void RecurrentParameter::set_num_output(uint32_t value) {
+  _internal_set_num_output(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.RecurrentParameter.num_output)
 }
 
 // optional .opencv_caffe.FillerParameter weight_filler = 2;
-inline bool RecurrentParameter::has_weight_filler() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool RecurrentParameter::_internal_has_weight_filler() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || weight_filler_ != nullptr);
+  return value;
 }
-inline void RecurrentParameter::set_has_weight_filler() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool RecurrentParameter::has_weight_filler() const {
+  return _internal_has_weight_filler();
 }
-inline void RecurrentParameter::clear_has_weight_filler() {
+inline void RecurrentParameter::clear_weight_filler() {
+  if (weight_filler_ != nullptr) weight_filler_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void RecurrentParameter::clear_weight_filler() {
-  if (weight_filler_ != NULL) weight_filler_->Clear();
-  clear_has_weight_filler();
+inline const ::opencv_caffe::FillerParameter& RecurrentParameter::_internal_weight_filler() const {
+  const ::opencv_caffe::FillerParameter* p = weight_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& RecurrentParameter::weight_filler() const {
-  const ::opencv_caffe::FillerParameter* p = weight_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.RecurrentParameter.weight_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_weight_filler();
+}
+inline void RecurrentParameter::unsafe_arena_set_allocated_weight_filler(
+    ::opencv_caffe::FillerParameter* weight_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(weight_filler_);
+  }
+  weight_filler_ = weight_filler;
+  if (weight_filler) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.RecurrentParameter.weight_filler)
 }
 inline ::opencv_caffe::FillerParameter* RecurrentParameter::release_weight_filler() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::FillerParameter* temp = weight_filler_;
+  weight_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* RecurrentParameter::unsafe_arena_release_weight_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.RecurrentParameter.weight_filler)
-  clear_has_weight_filler();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::FillerParameter* temp = weight_filler_;
-  weight_filler_ = NULL;
+  weight_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* RecurrentParameter::mutable_weight_filler() {
-  set_has_weight_filler();
-  if (weight_filler_ == NULL) {
-    weight_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* RecurrentParameter::_internal_mutable_weight_filler() {
+  _has_bits_[0] |= 0x00000001u;
+  if (weight_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    weight_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.RecurrentParameter.weight_filler)
   return weight_filler_;
 }
+inline ::opencv_caffe::FillerParameter* RecurrentParameter::mutable_weight_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_weight_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.RecurrentParameter.weight_filler)
+  return _msg;
+}
 inline void RecurrentParameter::set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete weight_filler_;
   }
   if (weight_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(weight_filler);
     if (message_arena != submessage_arena) {
-      weight_filler = ::google::protobuf::internal::GetOwnedMessage(
+      weight_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, weight_filler, submessage_arena);
     }
-    set_has_weight_filler();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_weight_filler();
+    _has_bits_[0] &= ~0x00000001u;
   }
   weight_filler_ = weight_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.RecurrentParameter.weight_filler)
 }
 
 // optional .opencv_caffe.FillerParameter bias_filler = 3;
-inline bool RecurrentParameter::has_bias_filler() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool RecurrentParameter::_internal_has_bias_filler() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || bias_filler_ != nullptr);
+  return value;
 }
-inline void RecurrentParameter::set_has_bias_filler() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool RecurrentParameter::has_bias_filler() const {
+  return _internal_has_bias_filler();
 }
-inline void RecurrentParameter::clear_has_bias_filler() {
+inline void RecurrentParameter::clear_bias_filler() {
+  if (bias_filler_ != nullptr) bias_filler_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void RecurrentParameter::clear_bias_filler() {
-  if (bias_filler_ != NULL) bias_filler_->Clear();
-  clear_has_bias_filler();
+inline const ::opencv_caffe::FillerParameter& RecurrentParameter::_internal_bias_filler() const {
+  const ::opencv_caffe::FillerParameter* p = bias_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& RecurrentParameter::bias_filler() const {
-  const ::opencv_caffe::FillerParameter* p = bias_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.RecurrentParameter.bias_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_bias_filler();
+}
+inline void RecurrentParameter::unsafe_arena_set_allocated_bias_filler(
+    ::opencv_caffe::FillerParameter* bias_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(bias_filler_);
+  }
+  bias_filler_ = bias_filler;
+  if (bias_filler) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.RecurrentParameter.bias_filler)
 }
 inline ::opencv_caffe::FillerParameter* RecurrentParameter::release_bias_filler() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::FillerParameter* temp = bias_filler_;
+  bias_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* RecurrentParameter::unsafe_arena_release_bias_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.RecurrentParameter.bias_filler)
-  clear_has_bias_filler();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::FillerParameter* temp = bias_filler_;
-  bias_filler_ = NULL;
+  bias_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* RecurrentParameter::mutable_bias_filler() {
-  set_has_bias_filler();
-  if (bias_filler_ == NULL) {
-    bias_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* RecurrentParameter::_internal_mutable_bias_filler() {
+  _has_bits_[0] |= 0x00000002u;
+  if (bias_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    bias_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.RecurrentParameter.bias_filler)
   return bias_filler_;
 }
+inline ::opencv_caffe::FillerParameter* RecurrentParameter::mutable_bias_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_bias_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.RecurrentParameter.bias_filler)
+  return _msg;
+}
 inline void RecurrentParameter::set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete bias_filler_;
   }
   if (bias_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(bias_filler);
     if (message_arena != submessage_arena) {
-      bias_filler = ::google::protobuf::internal::GetOwnedMessage(
+      bias_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, bias_filler, submessage_arena);
     }
-    set_has_bias_filler();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_bias_filler();
+    _has_bits_[0] &= ~0x00000002u;
   }
   bias_filler_ = bias_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.RecurrentParameter.bias_filler)
 }
 
 // optional bool debug_info = 4 [default = false];
-inline bool RecurrentParameter::has_debug_info() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool RecurrentParameter::_internal_has_debug_info() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void RecurrentParameter::set_has_debug_info() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void RecurrentParameter::clear_has_debug_info() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool RecurrentParameter::has_debug_info() const {
+  return _internal_has_debug_info();
 }
 inline void RecurrentParameter::clear_debug_info() {
   debug_info_ = false;
-  clear_has_debug_info();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline bool RecurrentParameter::_internal_debug_info() const {
+  return debug_info_;
 }
 inline bool RecurrentParameter::debug_info() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.RecurrentParameter.debug_info)
-  return debug_info_;
+  return _internal_debug_info();
 }
-inline void RecurrentParameter::set_debug_info(bool value) {
-  set_has_debug_info();
+inline void RecurrentParameter::_internal_set_debug_info(bool value) {
+  _has_bits_[0] |= 0x00000008u;
   debug_info_ = value;
+}
+inline void RecurrentParameter::set_debug_info(bool value) {
+  _internal_set_debug_info(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.RecurrentParameter.debug_info)
 }
 
 // optional bool expose_hidden = 5 [default = false];
-inline bool RecurrentParameter::has_expose_hidden() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void RecurrentParameter::set_has_expose_hidden() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool RecurrentParameter::_internal_has_expose_hidden() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void RecurrentParameter::clear_has_expose_hidden() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool RecurrentParameter::has_expose_hidden() const {
+  return _internal_has_expose_hidden();
 }
 inline void RecurrentParameter::clear_expose_hidden() {
   expose_hidden_ = false;
-  clear_has_expose_hidden();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline bool RecurrentParameter::_internal_expose_hidden() const {
+  return expose_hidden_;
 }
 inline bool RecurrentParameter::expose_hidden() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.RecurrentParameter.expose_hidden)
-  return expose_hidden_;
+  return _internal_expose_hidden();
 }
-inline void RecurrentParameter::set_expose_hidden(bool value) {
-  set_has_expose_hidden();
+inline void RecurrentParameter::_internal_set_expose_hidden(bool value) {
+  _has_bits_[0] |= 0x00000010u;
   expose_hidden_ = value;
+}
+inline void RecurrentParameter::set_expose_hidden(bool value) {
+  _internal_set_expose_hidden(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.RecurrentParameter.expose_hidden)
 }
 
@@ -27145,75 +37433,87 @@ inline void RecurrentParameter::set_expose_hidden(bool value) {
 // ReductionParameter
 
 // optional .opencv_caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM];
-inline bool ReductionParameter::has_operation() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ReductionParameter::set_has_operation() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ReductionParameter::_internal_has_operation() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ReductionParameter::clear_has_operation() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ReductionParameter::has_operation() const {
+  return _internal_has_operation();
 }
 inline void ReductionParameter::clear_operation() {
   operation_ = 1;
-  clear_has_operation();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::opencv_caffe::ReductionParameter_ReductionOp ReductionParameter::_internal_operation() const {
+  return static_cast< ::opencv_caffe::ReductionParameter_ReductionOp >(operation_);
 }
 inline ::opencv_caffe::ReductionParameter_ReductionOp ReductionParameter::operation() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ReductionParameter.operation)
-  return static_cast< ::opencv_caffe::ReductionParameter_ReductionOp >(operation_);
+  return _internal_operation();
 }
-inline void ReductionParameter::set_operation(::opencv_caffe::ReductionParameter_ReductionOp value) {
+inline void ReductionParameter::_internal_set_operation(::opencv_caffe::ReductionParameter_ReductionOp value) {
   assert(::opencv_caffe::ReductionParameter_ReductionOp_IsValid(value));
-  set_has_operation();
+  _has_bits_[0] |= 0x00000002u;
   operation_ = value;
+}
+inline void ReductionParameter::set_operation(::opencv_caffe::ReductionParameter_ReductionOp value) {
+  _internal_set_operation(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ReductionParameter.operation)
 }
 
 // optional int32 axis = 2 [default = 0];
-inline bool ReductionParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ReductionParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ReductionParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ReductionParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ReductionParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void ReductionParameter::clear_axis() {
   axis_ = 0;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 ReductionParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ReductionParameter.axis)
+inline int32_t ReductionParameter::_internal_axis() const {
   return axis_;
 }
-inline void ReductionParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t ReductionParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ReductionParameter.axis)
+  return _internal_axis();
+}
+inline void ReductionParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   axis_ = value;
+}
+inline void ReductionParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ReductionParameter.axis)
 }
 
 // optional float coeff = 3 [default = 1];
-inline bool ReductionParameter::has_coeff() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ReductionParameter::set_has_coeff() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ReductionParameter::_internal_has_coeff() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ReductionParameter::clear_has_coeff() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ReductionParameter::has_coeff() const {
+  return _internal_has_coeff();
 }
 inline void ReductionParameter::clear_coeff() {
   coeff_ = 1;
-  clear_has_coeff();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float ReductionParameter::_internal_coeff() const {
+  return coeff_;
 }
 inline float ReductionParameter::coeff() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ReductionParameter.coeff)
-  return coeff_;
+  return _internal_coeff();
 }
-inline void ReductionParameter::set_coeff(float value) {
-  set_has_coeff();
+inline void ReductionParameter::_internal_set_coeff(float value) {
+  _has_bits_[0] |= 0x00000004u;
   coeff_ = value;
+}
+inline void ReductionParameter::set_coeff(float value) {
+  _internal_set_coeff(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ReductionParameter.coeff)
 }
 
@@ -27222,51 +37522,59 @@ inline void ReductionParameter::set_coeff(float value) {
 // ReLUParameter
 
 // optional float negative_slope = 1 [default = 0];
-inline bool ReLUParameter::has_negative_slope() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ReLUParameter::set_has_negative_slope() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ReLUParameter::_internal_has_negative_slope() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ReLUParameter::clear_has_negative_slope() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ReLUParameter::has_negative_slope() const {
+  return _internal_has_negative_slope();
 }
 inline void ReLUParameter::clear_negative_slope() {
   negative_slope_ = 0;
-  clear_has_negative_slope();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float ReLUParameter::_internal_negative_slope() const {
+  return negative_slope_;
 }
 inline float ReLUParameter::negative_slope() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ReLUParameter.negative_slope)
-  return negative_slope_;
+  return _internal_negative_slope();
 }
-inline void ReLUParameter::set_negative_slope(float value) {
-  set_has_negative_slope();
+inline void ReLUParameter::_internal_set_negative_slope(float value) {
+  _has_bits_[0] |= 0x00000001u;
   negative_slope_ = value;
+}
+inline void ReLUParameter::set_negative_slope(float value) {
+  _internal_set_negative_slope(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ReLUParameter.negative_slope)
 }
 
 // optional .opencv_caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT];
-inline bool ReLUParameter::has_engine() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool ReLUParameter::_internal_has_engine() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ReLUParameter::set_has_engine() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void ReLUParameter::clear_has_engine() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ReLUParameter::has_engine() const {
+  return _internal_has_engine();
 }
 inline void ReLUParameter::clear_engine() {
   engine_ = 0;
-  clear_has_engine();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::opencv_caffe::ReLUParameter_Engine ReLUParameter::_internal_engine() const {
+  return static_cast< ::opencv_caffe::ReLUParameter_Engine >(engine_);
 }
 inline ::opencv_caffe::ReLUParameter_Engine ReLUParameter::engine() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ReLUParameter.engine)
-  return static_cast< ::opencv_caffe::ReLUParameter_Engine >(engine_);
+  return _internal_engine();
 }
-inline void ReLUParameter::set_engine(::opencv_caffe::ReLUParameter_Engine value) {
+inline void ReLUParameter::_internal_set_engine(::opencv_caffe::ReLUParameter_Engine value) {
   assert(::opencv_caffe::ReLUParameter_Engine_IsValid(value));
-  set_has_engine();
+  _has_bits_[0] |= 0x00000002u;
   engine_ = value;
+}
+inline void ReLUParameter::set_engine(::opencv_caffe::ReLUParameter_Engine value) {
+  _internal_set_engine(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ReLUParameter.engine)
 }
 
@@ -27275,104 +37583,148 @@ inline void ReLUParameter::set_engine(::opencv_caffe::ReLUParameter_Engine value
 // ReshapeParameter
 
 // optional .opencv_caffe.BlobShape shape = 1;
-inline bool ReshapeParameter::has_shape() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool ReshapeParameter::_internal_has_shape() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || shape_ != nullptr);
+  return value;
 }
-inline void ReshapeParameter::set_has_shape() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ReshapeParameter::has_shape() const {
+  return _internal_has_shape();
 }
-inline void ReshapeParameter::clear_has_shape() {
+inline void ReshapeParameter::clear_shape() {
+  if (shape_ != nullptr) shape_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void ReshapeParameter::clear_shape() {
-  if (shape_ != NULL) shape_->Clear();
-  clear_has_shape();
+inline const ::opencv_caffe::BlobShape& ReshapeParameter::_internal_shape() const {
+  const ::opencv_caffe::BlobShape* p = shape_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::BlobShape&>(
+      ::opencv_caffe::_BlobShape_default_instance_);
 }
 inline const ::opencv_caffe::BlobShape& ReshapeParameter::shape() const {
-  const ::opencv_caffe::BlobShape* p = shape_;
   // @@protoc_insertion_point(field_get:opencv_caffe.ReshapeParameter.shape)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::BlobShape*>(
-      &::opencv_caffe::_BlobShape_default_instance_);
+  return _internal_shape();
+}
+inline void ReshapeParameter::unsafe_arena_set_allocated_shape(
+    ::opencv_caffe::BlobShape* shape) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(shape_);
+  }
+  shape_ = shape;
+  if (shape) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.ReshapeParameter.shape)
 }
 inline ::opencv_caffe::BlobShape* ReshapeParameter::release_shape() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::BlobShape* temp = shape_;
+  shape_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::BlobShape* ReshapeParameter::unsafe_arena_release_shape() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ReshapeParameter.shape)
-  clear_has_shape();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::BlobShape* temp = shape_;
-  shape_ = NULL;
+  shape_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::BlobShape* ReshapeParameter::mutable_shape() {
-  set_has_shape();
-  if (shape_ == NULL) {
-    shape_ = new ::opencv_caffe::BlobShape;
+inline ::opencv_caffe::BlobShape* ReshapeParameter::_internal_mutable_shape() {
+  _has_bits_[0] |= 0x00000001u;
+  if (shape_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::BlobShape>(GetArenaForAllocation());
+    shape_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.ReshapeParameter.shape)
   return shape_;
 }
+inline ::opencv_caffe::BlobShape* ReshapeParameter::mutable_shape() {
+  ::opencv_caffe::BlobShape* _msg = _internal_mutable_shape();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.ReshapeParameter.shape)
+  return _msg;
+}
 inline void ReshapeParameter::set_allocated_shape(::opencv_caffe::BlobShape* shape) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete shape_;
   }
   if (shape) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::BlobShape>::GetOwningArena(shape);
     if (message_arena != submessage_arena) {
-      shape = ::google::protobuf::internal::GetOwnedMessage(
+      shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, shape, submessage_arena);
     }
-    set_has_shape();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_shape();
+    _has_bits_[0] &= ~0x00000001u;
   }
   shape_ = shape;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ReshapeParameter.shape)
 }
 
 // optional int32 axis = 2 [default = 0];
-inline bool ReshapeParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ReshapeParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ReshapeParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ReshapeParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ReshapeParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void ReshapeParameter::clear_axis() {
   axis_ = 0;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 ReshapeParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ReshapeParameter.axis)
+inline int32_t ReshapeParameter::_internal_axis() const {
   return axis_;
 }
-inline void ReshapeParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t ReshapeParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ReshapeParameter.axis)
+  return _internal_axis();
+}
+inline void ReshapeParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   axis_ = value;
+}
+inline void ReshapeParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ReshapeParameter.axis)
 }
 
 // optional int32 num_axes = 3 [default = -1];
-inline bool ReshapeParameter::has_num_axes() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool ReshapeParameter::_internal_has_num_axes() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ReshapeParameter::set_has_num_axes() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void ReshapeParameter::clear_has_num_axes() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ReshapeParameter::has_num_axes() const {
+  return _internal_has_num_axes();
 }
 inline void ReshapeParameter::clear_num_axes() {
   num_axes_ = -1;
-  clear_has_num_axes();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 ReshapeParameter::num_axes() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ReshapeParameter.num_axes)
+inline int32_t ReshapeParameter::_internal_num_axes() const {
   return num_axes_;
 }
-inline void ReshapeParameter::set_num_axes(::google::protobuf::int32 value) {
-  set_has_num_axes();
+inline int32_t ReshapeParameter::num_axes() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ReshapeParameter.num_axes)
+  return _internal_num_axes();
+}
+inline void ReshapeParameter::_internal_set_num_axes(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   num_axes_ = value;
+}
+inline void ReshapeParameter::set_num_axes(int32_t value) {
+  _internal_set_num_axes(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ReshapeParameter.num_axes)
 }
 
@@ -27381,180 +37733,264 @@ inline void ReshapeParameter::set_num_axes(::google::protobuf::int32 value) {
 // ScaleParameter
 
 // optional int32 axis = 1 [default = 1];
-inline bool ScaleParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void ScaleParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool ScaleParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void ScaleParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool ScaleParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void ScaleParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::int32 ScaleParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ScaleParameter.axis)
+inline int32_t ScaleParameter::_internal_axis() const {
   return axis_;
 }
-inline void ScaleParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t ScaleParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ScaleParameter.axis)
+  return _internal_axis();
+}
+inline void ScaleParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   axis_ = value;
+}
+inline void ScaleParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ScaleParameter.axis)
 }
 
 // optional int32 num_axes = 2 [default = 1];
-inline bool ScaleParameter::has_num_axes() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void ScaleParameter::set_has_num_axes() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool ScaleParameter::_internal_has_num_axes() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void ScaleParameter::clear_has_num_axes() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool ScaleParameter::has_num_axes() const {
+  return _internal_has_num_axes();
 }
 inline void ScaleParameter::clear_num_axes() {
   num_axes_ = 1;
-  clear_has_num_axes();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::int32 ScaleParameter::num_axes() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ScaleParameter.num_axes)
+inline int32_t ScaleParameter::_internal_num_axes() const {
   return num_axes_;
 }
-inline void ScaleParameter::set_num_axes(::google::protobuf::int32 value) {
-  set_has_num_axes();
+inline int32_t ScaleParameter::num_axes() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ScaleParameter.num_axes)
+  return _internal_num_axes();
+}
+inline void ScaleParameter::_internal_set_num_axes(int32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   num_axes_ = value;
+}
+inline void ScaleParameter::set_num_axes(int32_t value) {
+  _internal_set_num_axes(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ScaleParameter.num_axes)
 }
 
 // optional .opencv_caffe.FillerParameter filler = 3;
-inline bool ScaleParameter::has_filler() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool ScaleParameter::_internal_has_filler() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || filler_ != nullptr);
+  return value;
 }
-inline void ScaleParameter::set_has_filler() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ScaleParameter::has_filler() const {
+  return _internal_has_filler();
 }
-inline void ScaleParameter::clear_has_filler() {
+inline void ScaleParameter::clear_filler() {
+  if (filler_ != nullptr) filler_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void ScaleParameter::clear_filler() {
-  if (filler_ != NULL) filler_->Clear();
-  clear_has_filler();
+inline const ::opencv_caffe::FillerParameter& ScaleParameter::_internal_filler() const {
+  const ::opencv_caffe::FillerParameter* p = filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& ScaleParameter::filler() const {
-  const ::opencv_caffe::FillerParameter* p = filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.ScaleParameter.filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_filler();
+}
+inline void ScaleParameter::unsafe_arena_set_allocated_filler(
+    ::opencv_caffe::FillerParameter* filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(filler_);
+  }
+  filler_ = filler;
+  if (filler) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.ScaleParameter.filler)
 }
 inline ::opencv_caffe::FillerParameter* ScaleParameter::release_filler() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::FillerParameter* temp = filler_;
+  filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* ScaleParameter::unsafe_arena_release_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ScaleParameter.filler)
-  clear_has_filler();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::FillerParameter* temp = filler_;
-  filler_ = NULL;
+  filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* ScaleParameter::mutable_filler() {
-  set_has_filler();
-  if (filler_ == NULL) {
-    filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* ScaleParameter::_internal_mutable_filler() {
+  _has_bits_[0] |= 0x00000001u;
+  if (filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.ScaleParameter.filler)
   return filler_;
 }
+inline ::opencv_caffe::FillerParameter* ScaleParameter::mutable_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.ScaleParameter.filler)
+  return _msg;
+}
 inline void ScaleParameter::set_allocated_filler(::opencv_caffe::FillerParameter* filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete filler_;
   }
   if (filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(filler);
     if (message_arena != submessage_arena) {
-      filler = ::google::protobuf::internal::GetOwnedMessage(
+      filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, filler, submessage_arena);
     }
-    set_has_filler();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_filler();
+    _has_bits_[0] &= ~0x00000001u;
   }
   filler_ = filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ScaleParameter.filler)
 }
 
 // optional bool bias_term = 4 [default = false];
-inline bool ScaleParameter::has_bias_term() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ScaleParameter::set_has_bias_term() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ScaleParameter::_internal_has_bias_term() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ScaleParameter::clear_has_bias_term() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ScaleParameter::has_bias_term() const {
+  return _internal_has_bias_term();
 }
 inline void ScaleParameter::clear_bias_term() {
   bias_term_ = false;
-  clear_has_bias_term();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline bool ScaleParameter::_internal_bias_term() const {
+  return bias_term_;
 }
 inline bool ScaleParameter::bias_term() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ScaleParameter.bias_term)
-  return bias_term_;
+  return _internal_bias_term();
 }
-inline void ScaleParameter::set_bias_term(bool value) {
-  set_has_bias_term();
+inline void ScaleParameter::_internal_set_bias_term(bool value) {
+  _has_bits_[0] |= 0x00000004u;
   bias_term_ = value;
+}
+inline void ScaleParameter::set_bias_term(bool value) {
+  _internal_set_bias_term(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ScaleParameter.bias_term)
 }
 
 // optional .opencv_caffe.FillerParameter bias_filler = 5;
-inline bool ScaleParameter::has_bias_filler() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool ScaleParameter::_internal_has_bias_filler() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || bias_filler_ != nullptr);
+  return value;
 }
-inline void ScaleParameter::set_has_bias_filler() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ScaleParameter::has_bias_filler() const {
+  return _internal_has_bias_filler();
 }
-inline void ScaleParameter::clear_has_bias_filler() {
+inline void ScaleParameter::clear_bias_filler() {
+  if (bias_filler_ != nullptr) bias_filler_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void ScaleParameter::clear_bias_filler() {
-  if (bias_filler_ != NULL) bias_filler_->Clear();
-  clear_has_bias_filler();
+inline const ::opencv_caffe::FillerParameter& ScaleParameter::_internal_bias_filler() const {
+  const ::opencv_caffe::FillerParameter* p = bias_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& ScaleParameter::bias_filler() const {
-  const ::opencv_caffe::FillerParameter* p = bias_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.ScaleParameter.bias_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_bias_filler();
+}
+inline void ScaleParameter::unsafe_arena_set_allocated_bias_filler(
+    ::opencv_caffe::FillerParameter* bias_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(bias_filler_);
+  }
+  bias_filler_ = bias_filler;
+  if (bias_filler) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.ScaleParameter.bias_filler)
 }
 inline ::opencv_caffe::FillerParameter* ScaleParameter::release_bias_filler() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::FillerParameter* temp = bias_filler_;
+  bias_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* ScaleParameter::unsafe_arena_release_bias_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.ScaleParameter.bias_filler)
-  clear_has_bias_filler();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::FillerParameter* temp = bias_filler_;
-  bias_filler_ = NULL;
+  bias_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* ScaleParameter::mutable_bias_filler() {
-  set_has_bias_filler();
-  if (bias_filler_ == NULL) {
-    bias_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* ScaleParameter::_internal_mutable_bias_filler() {
+  _has_bits_[0] |= 0x00000002u;
+  if (bias_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    bias_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.ScaleParameter.bias_filler)
   return bias_filler_;
 }
+inline ::opencv_caffe::FillerParameter* ScaleParameter::mutable_bias_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_bias_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.ScaleParameter.bias_filler)
+  return _msg;
+}
 inline void ScaleParameter::set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete bias_filler_;
   }
   if (bias_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(bias_filler);
     if (message_arena != submessage_arena) {
-      bias_filler = ::google::protobuf::internal::GetOwnedMessage(
+      bias_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, bias_filler, submessage_arena);
     }
-    set_has_bias_filler();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_bias_filler();
+    _has_bits_[0] &= ~0x00000002u;
   }
   bias_filler_ = bias_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.ScaleParameter.bias_filler)
@@ -27565,27 +38001,31 @@ inline void ScaleParameter::set_allocated_bias_filler(::opencv_caffe::FillerPara
 // SigmoidParameter
 
 // optional .opencv_caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT];
-inline bool SigmoidParameter::has_engine() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void SigmoidParameter::set_has_engine() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool SigmoidParameter::_internal_has_engine() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void SigmoidParameter::clear_has_engine() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool SigmoidParameter::has_engine() const {
+  return _internal_has_engine();
 }
 inline void SigmoidParameter::clear_engine() {
   engine_ = 0;
-  clear_has_engine();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::opencv_caffe::SigmoidParameter_Engine SigmoidParameter::_internal_engine() const {
+  return static_cast< ::opencv_caffe::SigmoidParameter_Engine >(engine_);
 }
 inline ::opencv_caffe::SigmoidParameter_Engine SigmoidParameter::engine() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SigmoidParameter.engine)
-  return static_cast< ::opencv_caffe::SigmoidParameter_Engine >(engine_);
+  return _internal_engine();
 }
-inline void SigmoidParameter::set_engine(::opencv_caffe::SigmoidParameter_Engine value) {
+inline void SigmoidParameter::_internal_set_engine(::opencv_caffe::SigmoidParameter_Engine value) {
   assert(::opencv_caffe::SigmoidParameter_Engine_IsValid(value));
-  set_has_engine();
+  _has_bits_[0] |= 0x00000001u;
   engine_ = value;
+}
+inline void SigmoidParameter::set_engine(::opencv_caffe::SigmoidParameter_Engine value) {
+  _internal_set_engine(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SigmoidParameter.engine)
 }
 
@@ -27594,80 +38034,105 @@ inline void SigmoidParameter::set_engine(::opencv_caffe::SigmoidParameter_Engine
 // SliceParameter
 
 // optional int32 axis = 3 [default = 1];
-inline bool SliceParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void SliceParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool SliceParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void SliceParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool SliceParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void SliceParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 SliceParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SliceParameter.axis)
+inline int32_t SliceParameter::_internal_axis() const {
   return axis_;
 }
-inline void SliceParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t SliceParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SliceParameter.axis)
+  return _internal_axis();
+}
+inline void SliceParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   axis_ = value;
+}
+inline void SliceParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SliceParameter.axis)
 }
 
 // repeated uint32 slice_point = 2;
-inline int SliceParameter::slice_point_size() const {
+inline int SliceParameter::_internal_slice_point_size() const {
   return slice_point_.size();
 }
+inline int SliceParameter::slice_point_size() const {
+  return _internal_slice_point_size();
+}
 inline void SliceParameter::clear_slice_point() {
   slice_point_.Clear();
 }
-inline ::google::protobuf::uint32 SliceParameter::slice_point(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SliceParameter.slice_point)
+inline uint32_t SliceParameter::_internal_slice_point(int index) const {
   return slice_point_.Get(index);
 }
-inline void SliceParameter::set_slice_point(int index, ::google::protobuf::uint32 value) {
+inline uint32_t SliceParameter::slice_point(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SliceParameter.slice_point)
+  return _internal_slice_point(index);
+}
+inline void SliceParameter::set_slice_point(int index, uint32_t value) {
   slice_point_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SliceParameter.slice_point)
 }
-inline void SliceParameter::add_slice_point(::google::protobuf::uint32 value) {
+inline void SliceParameter::_internal_add_slice_point(uint32_t value) {
   slice_point_.Add(value);
+}
+inline void SliceParameter::add_slice_point(uint32_t value) {
+  _internal_add_slice_point(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.SliceParameter.slice_point)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
+SliceParameter::_internal_slice_point() const {
+  return slice_point_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >&
 SliceParameter::slice_point() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.SliceParameter.slice_point)
-  return slice_point_;
+  return _internal_slice_point();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
+SliceParameter::_internal_mutable_slice_point() {
+  return &slice_point_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint32_t >*
 SliceParameter::mutable_slice_point() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.SliceParameter.slice_point)
-  return &slice_point_;
+  return _internal_mutable_slice_point();
 }
 
 // optional uint32 slice_dim = 1 [default = 1];
-inline bool SliceParameter::has_slice_dim() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void SliceParameter::set_has_slice_dim() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool SliceParameter::_internal_has_slice_dim() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void SliceParameter::clear_has_slice_dim() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool SliceParameter::has_slice_dim() const {
+  return _internal_has_slice_dim();
 }
 inline void SliceParameter::clear_slice_dim() {
   slice_dim_ = 1u;
-  clear_has_slice_dim();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::uint32 SliceParameter::slice_dim() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SliceParameter.slice_dim)
+inline uint32_t SliceParameter::_internal_slice_dim() const {
   return slice_dim_;
 }
-inline void SliceParameter::set_slice_dim(::google::protobuf::uint32 value) {
-  set_has_slice_dim();
+inline uint32_t SliceParameter::slice_dim() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SliceParameter.slice_dim)
+  return _internal_slice_dim();
+}
+inline void SliceParameter::_internal_set_slice_dim(uint32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   slice_dim_ = value;
+}
+inline void SliceParameter::set_slice_dim(uint32_t value) {
+  _internal_set_slice_dim(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SliceParameter.slice_dim)
 }
 
@@ -27676,51 +38141,59 @@ inline void SliceParameter::set_slice_dim(::google::protobuf::uint32 value) {
 // SoftmaxParameter
 
 // optional .opencv_caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT];
-inline bool SoftmaxParameter::has_engine() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void SoftmaxParameter::set_has_engine() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool SoftmaxParameter::_internal_has_engine() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void SoftmaxParameter::clear_has_engine() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool SoftmaxParameter::has_engine() const {
+  return _internal_has_engine();
 }
 inline void SoftmaxParameter::clear_engine() {
   engine_ = 0;
-  clear_has_engine();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::opencv_caffe::SoftmaxParameter_Engine SoftmaxParameter::_internal_engine() const {
+  return static_cast< ::opencv_caffe::SoftmaxParameter_Engine >(engine_);
 }
 inline ::opencv_caffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SoftmaxParameter.engine)
-  return static_cast< ::opencv_caffe::SoftmaxParameter_Engine >(engine_);
+  return _internal_engine();
 }
-inline void SoftmaxParameter::set_engine(::opencv_caffe::SoftmaxParameter_Engine value) {
+inline void SoftmaxParameter::_internal_set_engine(::opencv_caffe::SoftmaxParameter_Engine value) {
   assert(::opencv_caffe::SoftmaxParameter_Engine_IsValid(value));
-  set_has_engine();
+  _has_bits_[0] |= 0x00000001u;
   engine_ = value;
+}
+inline void SoftmaxParameter::set_engine(::opencv_caffe::SoftmaxParameter_Engine value) {
+  _internal_set_engine(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SoftmaxParameter.engine)
 }
 
 // optional int32 axis = 2 [default = 1];
-inline bool SoftmaxParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void SoftmaxParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool SoftmaxParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void SoftmaxParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool SoftmaxParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void SoftmaxParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 SoftmaxParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SoftmaxParameter.axis)
+inline int32_t SoftmaxParameter::_internal_axis() const {
   return axis_;
 }
-inline void SoftmaxParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t SoftmaxParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SoftmaxParameter.axis)
+  return _internal_axis();
+}
+inline void SoftmaxParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   axis_ = value;
+}
+inline void SoftmaxParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SoftmaxParameter.axis)
 }
 
@@ -27729,27 +38202,31 @@ inline void SoftmaxParameter::set_axis(::google::protobuf::int32 value) {
 // TanHParameter
 
 // optional .opencv_caffe.TanHParameter.Engine engine = 1 [default = DEFAULT];
-inline bool TanHParameter::has_engine() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void TanHParameter::set_has_engine() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool TanHParameter::_internal_has_engine() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void TanHParameter::clear_has_engine() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool TanHParameter::has_engine() const {
+  return _internal_has_engine();
 }
 inline void TanHParameter::clear_engine() {
   engine_ = 0;
-  clear_has_engine();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline ::opencv_caffe::TanHParameter_Engine TanHParameter::_internal_engine() const {
+  return static_cast< ::opencv_caffe::TanHParameter_Engine >(engine_);
 }
 inline ::opencv_caffe::TanHParameter_Engine TanHParameter::engine() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.TanHParameter.engine)
-  return static_cast< ::opencv_caffe::TanHParameter_Engine >(engine_);
+  return _internal_engine();
 }
-inline void TanHParameter::set_engine(::opencv_caffe::TanHParameter_Engine value) {
+inline void TanHParameter::_internal_set_engine(::opencv_caffe::TanHParameter_Engine value) {
   assert(::opencv_caffe::TanHParameter_Engine_IsValid(value));
-  set_has_engine();
+  _has_bits_[0] |= 0x00000001u;
   engine_ = value;
+}
+inline void TanHParameter::set_engine(::opencv_caffe::TanHParameter_Engine value) {
+  _internal_set_engine(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TanHParameter.engine)
 }
 
@@ -27758,50 +38235,58 @@ inline void TanHParameter::set_engine(::opencv_caffe::TanHParameter_Engine value
 // TileParameter
 
 // optional int32 axis = 1 [default = 1];
-inline bool TileParameter::has_axis() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void TileParameter::set_has_axis() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool TileParameter::_internal_has_axis() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void TileParameter::clear_has_axis() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool TileParameter::has_axis() const {
+  return _internal_has_axis();
 }
 inline void TileParameter::clear_axis() {
   axis_ = 1;
-  clear_has_axis();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 TileParameter::axis() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.TileParameter.axis)
+inline int32_t TileParameter::_internal_axis() const {
   return axis_;
 }
-inline void TileParameter::set_axis(::google::protobuf::int32 value) {
-  set_has_axis();
+inline int32_t TileParameter::axis() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.TileParameter.axis)
+  return _internal_axis();
+}
+inline void TileParameter::_internal_set_axis(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   axis_ = value;
+}
+inline void TileParameter::set_axis(int32_t value) {
+  _internal_set_axis(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TileParameter.axis)
 }
 
 // optional int32 tiles = 2;
-inline bool TileParameter::has_tiles() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void TileParameter::set_has_tiles() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool TileParameter::_internal_has_tiles() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void TileParameter::clear_has_tiles() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool TileParameter::has_tiles() const {
+  return _internal_has_tiles();
 }
 inline void TileParameter::clear_tiles() {
   tiles_ = 0;
-  clear_has_tiles();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::int32 TileParameter::tiles() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.TileParameter.tiles)
+inline int32_t TileParameter::_internal_tiles() const {
   return tiles_;
 }
-inline void TileParameter::set_tiles(::google::protobuf::int32 value) {
-  set_has_tiles();
+inline int32_t TileParameter::tiles() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.TileParameter.tiles)
+  return _internal_tiles();
+}
+inline void TileParameter::_internal_set_tiles(int32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   tiles_ = value;
+}
+inline void TileParameter::set_tiles(int32_t value) {
+  _internal_set_tiles(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.TileParameter.tiles)
 }
 
@@ -27810,26 +38295,30 @@ inline void TileParameter::set_tiles(::google::protobuf::int32 value) {
 // ThresholdParameter
 
 // optional float threshold = 1 [default = 0];
-inline bool ThresholdParameter::has_threshold() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ThresholdParameter::set_has_threshold() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ThresholdParameter::_internal_has_threshold() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ThresholdParameter::clear_has_threshold() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ThresholdParameter::has_threshold() const {
+  return _internal_has_threshold();
 }
 inline void ThresholdParameter::clear_threshold() {
   threshold_ = 0;
-  clear_has_threshold();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float ThresholdParameter::_internal_threshold() const {
+  return threshold_;
 }
 inline float ThresholdParameter::threshold() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ThresholdParameter.threshold)
-  return threshold_;
+  return _internal_threshold();
 }
-inline void ThresholdParameter::set_threshold(float value) {
-  set_has_threshold();
+inline void ThresholdParameter::_internal_set_threshold(float value) {
+  _has_bits_[0] |= 0x00000001u;
   threshold_ = value;
+}
+inline void ThresholdParameter::set_threshold(float value) {
+  _internal_set_threshold(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ThresholdParameter.threshold)
 }
 
@@ -27838,470 +38327,521 @@ inline void ThresholdParameter::set_threshold(float value) {
 // WindowDataParameter
 
 // optional string source = 1;
-inline bool WindowDataParameter::has_source() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void WindowDataParameter::set_has_source() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool WindowDataParameter::_internal_has_source() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_source() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool WindowDataParameter::has_source() const {
+  return _internal_has_source();
 }
 inline void WindowDataParameter::clear_source() {
-  source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_source();
+  source_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& WindowDataParameter::source() const {
+inline const std::string& WindowDataParameter::source() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.source)
-  return source_.GetNoArena();
+  return _internal_source();
 }
-inline void WindowDataParameter::set_source(const ::std::string& value) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void WindowDataParameter::set_source(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.source)
 }
-#if LANG_CXX11
-inline void WindowDataParameter::set_source(::std::string&& value) {
-  set_has_source();
-  source_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.WindowDataParameter.source)
-}
-#endif
-inline void WindowDataParameter::set_source(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.WindowDataParameter.source)
-}
-inline void WindowDataParameter::set_source(const char* value, size_t size) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.WindowDataParameter.source)
-}
-inline ::std::string* WindowDataParameter::mutable_source() {
-  set_has_source();
+inline std::string* WindowDataParameter::mutable_source() {
+  std::string* _s = _internal_mutable_source();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.WindowDataParameter.source)
-  return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& WindowDataParameter::_internal_source() const {
+  return source_.Get();
+}
+inline void WindowDataParameter::_internal_set_source(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* WindowDataParameter::release_source() {
+inline std::string* WindowDataParameter::_internal_mutable_source() {
+  _has_bits_[0] |= 0x00000001u;
+  return source_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* WindowDataParameter::release_source() {
   // @@protoc_insertion_point(field_release:opencv_caffe.WindowDataParameter.source)
-  clear_has_source();
-  return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_source()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = source_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void WindowDataParameter::set_allocated_source(::std::string* source) {
-  if (source != NULL) {
-    set_has_source();
+inline void WindowDataParameter::set_allocated_source(std::string* source) {
+  if (source != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_source();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  source_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), source,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.WindowDataParameter.source)
 }
 
 // optional float scale = 2 [default = 1];
-inline bool WindowDataParameter::has_scale() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
-}
-inline void WindowDataParameter::set_has_scale() {
-  _has_bits_[0] |= 0x00000200u;
+inline bool WindowDataParameter::_internal_has_scale() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_scale() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool WindowDataParameter::has_scale() const {
+  return _internal_has_scale();
 }
 inline void WindowDataParameter::clear_scale() {
   scale_ = 1;
-  clear_has_scale();
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline float WindowDataParameter::_internal_scale() const {
+  return scale_;
 }
 inline float WindowDataParameter::scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.scale)
-  return scale_;
+  return _internal_scale();
 }
-inline void WindowDataParameter::set_scale(float value) {
-  set_has_scale();
+inline void WindowDataParameter::_internal_set_scale(float value) {
+  _has_bits_[0] |= 0x00000200u;
   scale_ = value;
+}
+inline void WindowDataParameter::set_scale(float value) {
+  _internal_set_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.scale)
 }
 
 // optional string mean_file = 3;
-inline bool WindowDataParameter::has_mean_file() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool WindowDataParameter::_internal_has_mean_file() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void WindowDataParameter::set_has_mean_file() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void WindowDataParameter::clear_has_mean_file() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool WindowDataParameter::has_mean_file() const {
+  return _internal_has_mean_file();
 }
 inline void WindowDataParameter::clear_mean_file() {
-  mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_mean_file();
+  mean_file_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& WindowDataParameter::mean_file() const {
+inline const std::string& WindowDataParameter::mean_file() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.mean_file)
-  return mean_file_.GetNoArena();
+  return _internal_mean_file();
 }
-inline void WindowDataParameter::set_mean_file(const ::std::string& value) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void WindowDataParameter::set_mean_file(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.mean_file)
 }
-#if LANG_CXX11
-inline void WindowDataParameter::set_mean_file(::std::string&& value) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.WindowDataParameter.mean_file)
-}
-#endif
-inline void WindowDataParameter::set_mean_file(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.WindowDataParameter.mean_file)
-}
-inline void WindowDataParameter::set_mean_file(const char* value, size_t size) {
-  set_has_mean_file();
-  mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.WindowDataParameter.mean_file)
-}
-inline ::std::string* WindowDataParameter::mutable_mean_file() {
-  set_has_mean_file();
+inline std::string* WindowDataParameter::mutable_mean_file() {
+  std::string* _s = _internal_mutable_mean_file();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.WindowDataParameter.mean_file)
-  return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& WindowDataParameter::_internal_mean_file() const {
+  return mean_file_.Get();
 }
-inline ::std::string* WindowDataParameter::release_mean_file() {
+inline void WindowDataParameter::_internal_set_mean_file(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  mean_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* WindowDataParameter::_internal_mutable_mean_file() {
+  _has_bits_[0] |= 0x00000002u;
+  return mean_file_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* WindowDataParameter::release_mean_file() {
   // @@protoc_insertion_point(field_release:opencv_caffe.WindowDataParameter.mean_file)
-  clear_has_mean_file();
-  return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_mean_file()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = mean_file_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (mean_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void WindowDataParameter::set_allocated_mean_file(::std::string* mean_file) {
-  if (mean_file != NULL) {
-    set_has_mean_file();
+inline void WindowDataParameter::set_allocated_mean_file(std::string* mean_file) {
+  if (mean_file != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_mean_file();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  mean_file_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), mean_file,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (mean_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    mean_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.WindowDataParameter.mean_file)
 }
 
 // optional uint32 batch_size = 4;
-inline bool WindowDataParameter::has_batch_size() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void WindowDataParameter::set_has_batch_size() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool WindowDataParameter::_internal_has_batch_size() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_batch_size() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool WindowDataParameter::has_batch_size() const {
+  return _internal_has_batch_size();
 }
 inline void WindowDataParameter::clear_batch_size() {
   batch_size_ = 0u;
-  clear_has_batch_size();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::uint32 WindowDataParameter::batch_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.batch_size)
+inline uint32_t WindowDataParameter::_internal_batch_size() const {
   return batch_size_;
 }
-inline void WindowDataParameter::set_batch_size(::google::protobuf::uint32 value) {
-  set_has_batch_size();
+inline uint32_t WindowDataParameter::batch_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.batch_size)
+  return _internal_batch_size();
+}
+inline void WindowDataParameter::_internal_set_batch_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   batch_size_ = value;
+}
+inline void WindowDataParameter::set_batch_size(uint32_t value) {
+  _internal_set_batch_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.batch_size)
 }
 
 // optional uint32 crop_size = 5 [default = 0];
-inline bool WindowDataParameter::has_crop_size() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool WindowDataParameter::_internal_has_crop_size() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void WindowDataParameter::set_has_crop_size() {
-  _has_bits_[0] |= 0x00000020u;
-}
-inline void WindowDataParameter::clear_has_crop_size() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool WindowDataParameter::has_crop_size() const {
+  return _internal_has_crop_size();
 }
 inline void WindowDataParameter::clear_crop_size() {
   crop_size_ = 0u;
-  clear_has_crop_size();
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline ::google::protobuf::uint32 WindowDataParameter::crop_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.crop_size)
+inline uint32_t WindowDataParameter::_internal_crop_size() const {
   return crop_size_;
 }
-inline void WindowDataParameter::set_crop_size(::google::protobuf::uint32 value) {
-  set_has_crop_size();
+inline uint32_t WindowDataParameter::crop_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.crop_size)
+  return _internal_crop_size();
+}
+inline void WindowDataParameter::_internal_set_crop_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000020u;
   crop_size_ = value;
+}
+inline void WindowDataParameter::set_crop_size(uint32_t value) {
+  _internal_set_crop_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.crop_size)
 }
 
 // optional bool mirror = 6 [default = false];
-inline bool WindowDataParameter::has_mirror() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void WindowDataParameter::set_has_mirror() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool WindowDataParameter::_internal_has_mirror() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_mirror() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool WindowDataParameter::has_mirror() const {
+  return _internal_has_mirror();
 }
 inline void WindowDataParameter::clear_mirror() {
   mirror_ = false;
-  clear_has_mirror();
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline bool WindowDataParameter::_internal_mirror() const {
+  return mirror_;
 }
 inline bool WindowDataParameter::mirror() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.mirror)
-  return mirror_;
+  return _internal_mirror();
 }
-inline void WindowDataParameter::set_mirror(bool value) {
-  set_has_mirror();
+inline void WindowDataParameter::_internal_set_mirror(bool value) {
+  _has_bits_[0] |= 0x00000040u;
   mirror_ = value;
+}
+inline void WindowDataParameter::set_mirror(bool value) {
+  _internal_set_mirror(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.mirror)
 }
 
 // optional float fg_threshold = 7 [default = 0.5];
-inline bool WindowDataParameter::has_fg_threshold() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+inline bool WindowDataParameter::_internal_has_fg_threshold() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void WindowDataParameter::set_has_fg_threshold() {
-  _has_bits_[0] |= 0x00000400u;
-}
-inline void WindowDataParameter::clear_has_fg_threshold() {
-  _has_bits_[0] &= ~0x00000400u;
+inline bool WindowDataParameter::has_fg_threshold() const {
+  return _internal_has_fg_threshold();
 }
 inline void WindowDataParameter::clear_fg_threshold() {
   fg_threshold_ = 0.5f;
-  clear_has_fg_threshold();
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline float WindowDataParameter::_internal_fg_threshold() const {
+  return fg_threshold_;
 }
 inline float WindowDataParameter::fg_threshold() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.fg_threshold)
-  return fg_threshold_;
+  return _internal_fg_threshold();
 }
-inline void WindowDataParameter::set_fg_threshold(float value) {
-  set_has_fg_threshold();
+inline void WindowDataParameter::_internal_set_fg_threshold(float value) {
+  _has_bits_[0] |= 0x00000400u;
   fg_threshold_ = value;
+}
+inline void WindowDataParameter::set_fg_threshold(float value) {
+  _internal_set_fg_threshold(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.fg_threshold)
 }
 
 // optional float bg_threshold = 8 [default = 0.5];
-inline bool WindowDataParameter::has_bg_threshold() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
-}
-inline void WindowDataParameter::set_has_bg_threshold() {
-  _has_bits_[0] |= 0x00000800u;
+inline bool WindowDataParameter::_internal_has_bg_threshold() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_bg_threshold() {
-  _has_bits_[0] &= ~0x00000800u;
+inline bool WindowDataParameter::has_bg_threshold() const {
+  return _internal_has_bg_threshold();
 }
 inline void WindowDataParameter::clear_bg_threshold() {
   bg_threshold_ = 0.5f;
-  clear_has_bg_threshold();
+  _has_bits_[0] &= ~0x00000800u;
+}
+inline float WindowDataParameter::_internal_bg_threshold() const {
+  return bg_threshold_;
 }
 inline float WindowDataParameter::bg_threshold() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.bg_threshold)
-  return bg_threshold_;
+  return _internal_bg_threshold();
 }
-inline void WindowDataParameter::set_bg_threshold(float value) {
-  set_has_bg_threshold();
+inline void WindowDataParameter::_internal_set_bg_threshold(float value) {
+  _has_bits_[0] |= 0x00000800u;
   bg_threshold_ = value;
+}
+inline void WindowDataParameter::set_bg_threshold(float value) {
+  _internal_set_bg_threshold(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.bg_threshold)
 }
 
 // optional float fg_fraction = 9 [default = 0.25];
-inline bool WindowDataParameter::has_fg_fraction() const {
-  return (_has_bits_[0] & 0x00001000u) != 0;
-}
-inline void WindowDataParameter::set_has_fg_fraction() {
-  _has_bits_[0] |= 0x00001000u;
+inline bool WindowDataParameter::_internal_has_fg_fraction() const {
+  bool value = (_has_bits_[0] & 0x00001000u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_fg_fraction() {
-  _has_bits_[0] &= ~0x00001000u;
+inline bool WindowDataParameter::has_fg_fraction() const {
+  return _internal_has_fg_fraction();
 }
 inline void WindowDataParameter::clear_fg_fraction() {
   fg_fraction_ = 0.25f;
-  clear_has_fg_fraction();
+  _has_bits_[0] &= ~0x00001000u;
+}
+inline float WindowDataParameter::_internal_fg_fraction() const {
+  return fg_fraction_;
 }
 inline float WindowDataParameter::fg_fraction() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.fg_fraction)
-  return fg_fraction_;
+  return _internal_fg_fraction();
 }
-inline void WindowDataParameter::set_fg_fraction(float value) {
-  set_has_fg_fraction();
+inline void WindowDataParameter::_internal_set_fg_fraction(float value) {
+  _has_bits_[0] |= 0x00001000u;
   fg_fraction_ = value;
+}
+inline void WindowDataParameter::set_fg_fraction(float value) {
+  _internal_set_fg_fraction(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.fg_fraction)
 }
 
 // optional uint32 context_pad = 10 [default = 0];
-inline bool WindowDataParameter::has_context_pad() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void WindowDataParameter::set_has_context_pad() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool WindowDataParameter::_internal_has_context_pad() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_context_pad() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool WindowDataParameter::has_context_pad() const {
+  return _internal_has_context_pad();
 }
 inline void WindowDataParameter::clear_context_pad() {
   context_pad_ = 0u;
-  clear_has_context_pad();
+  _has_bits_[0] &= ~0x00000100u;
 }
-inline ::google::protobuf::uint32 WindowDataParameter::context_pad() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.context_pad)
+inline uint32_t WindowDataParameter::_internal_context_pad() const {
   return context_pad_;
 }
-inline void WindowDataParameter::set_context_pad(::google::protobuf::uint32 value) {
-  set_has_context_pad();
+inline uint32_t WindowDataParameter::context_pad() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.context_pad)
+  return _internal_context_pad();
+}
+inline void WindowDataParameter::_internal_set_context_pad(uint32_t value) {
+  _has_bits_[0] |= 0x00000100u;
   context_pad_ = value;
+}
+inline void WindowDataParameter::set_context_pad(uint32_t value) {
+  _internal_set_context_pad(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.context_pad)
 }
 
 // optional string crop_mode = 11 [default = "warp"];
-inline bool WindowDataParameter::has_crop_mode() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void WindowDataParameter::set_has_crop_mode() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool WindowDataParameter::_internal_has_crop_mode() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_crop_mode() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool WindowDataParameter::has_crop_mode() const {
+  return _internal_has_crop_mode();
 }
 inline void WindowDataParameter::clear_crop_mode() {
-  crop_mode_.ClearToDefaultNoArena(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get());
-  clear_has_crop_mode();
+  crop_mode_.ClearToDefault(::opencv_caffe::WindowDataParameter::_i_give_permission_to_break_this_code_default_crop_mode_, GetArenaForAllocation());
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& WindowDataParameter::crop_mode() const {
+inline const std::string& WindowDataParameter::crop_mode() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.crop_mode)
-  return crop_mode_.GetNoArena();
-}
-inline void WindowDataParameter::set_crop_mode(const ::std::string& value) {
-  set_has_crop_mode();
-  crop_mode_.SetNoArena(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get(), value);
+  if (crop_mode_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_crop_mode_.get();
+  return _internal_crop_mode();
+}
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void WindowDataParameter::set_crop_mode(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ crop_mode_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.crop_mode)
 }
-#if LANG_CXX11
-inline void WindowDataParameter::set_crop_mode(::std::string&& value) {
-  set_has_crop_mode();
-  crop_mode_.SetNoArena(
-    &::opencv_caffe::WindowDataParameter::_default_crop_mode_.get(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.WindowDataParameter.crop_mode)
-}
-#endif
-inline void WindowDataParameter::set_crop_mode(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_crop_mode();
-  crop_mode_.SetNoArena(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.WindowDataParameter.crop_mode)
-}
-inline void WindowDataParameter::set_crop_mode(const char* value, size_t size) {
-  set_has_crop_mode();
-  crop_mode_.SetNoArena(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.WindowDataParameter.crop_mode)
-}
-inline ::std::string* WindowDataParameter::mutable_crop_mode() {
-  set_has_crop_mode();
+inline std::string* WindowDataParameter::mutable_crop_mode() {
+  std::string* _s = _internal_mutable_crop_mode();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.WindowDataParameter.crop_mode)
-  return crop_mode_.MutableNoArena(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get());
+  return _s;
+}
+inline const std::string& WindowDataParameter::_internal_crop_mode() const {
+  return crop_mode_.Get();
+}
+inline void WindowDataParameter::_internal_set_crop_mode(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  crop_mode_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* WindowDataParameter::_internal_mutable_crop_mode() {
+  _has_bits_[0] |= 0x00000004u;
+  return crop_mode_.Mutable(::opencv_caffe::WindowDataParameter::_i_give_permission_to_break_this_code_default_crop_mode_, GetArenaForAllocation());
 }
-inline ::std::string* WindowDataParameter::release_crop_mode() {
+inline std::string* WindowDataParameter::release_crop_mode() {
   // @@protoc_insertion_point(field_release:opencv_caffe.WindowDataParameter.crop_mode)
-  clear_has_crop_mode();
-  return crop_mode_.ReleaseNoArena(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get());
+  if (!_internal_has_crop_mode()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = crop_mode_.ReleaseNonDefault(nullptr, GetArenaForAllocation());
+  return p;
 }
-inline void WindowDataParameter::set_allocated_crop_mode(::std::string* crop_mode) {
-  if (crop_mode != NULL) {
-    set_has_crop_mode();
+inline void WindowDataParameter::set_allocated_crop_mode(std::string* crop_mode) {
+  if (crop_mode != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_crop_mode();
+    _has_bits_[0] &= ~0x00000004u;
   }
-  crop_mode_.SetAllocatedNoArena(&::opencv_caffe::WindowDataParameter::_default_crop_mode_.get(), crop_mode);
+  crop_mode_.SetAllocated(nullptr, crop_mode,
+      GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.WindowDataParameter.crop_mode)
 }
 
 // optional bool cache_images = 12 [default = false];
-inline bool WindowDataParameter::has_cache_images() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void WindowDataParameter::set_has_cache_images() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool WindowDataParameter::_internal_has_cache_images() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_cache_images() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool WindowDataParameter::has_cache_images() const {
+  return _internal_has_cache_images();
 }
 inline void WindowDataParameter::clear_cache_images() {
   cache_images_ = false;
-  clear_has_cache_images();
+  _has_bits_[0] &= ~0x00000080u;
+}
+inline bool WindowDataParameter::_internal_cache_images() const {
+  return cache_images_;
 }
 inline bool WindowDataParameter::cache_images() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.cache_images)
-  return cache_images_;
+  return _internal_cache_images();
 }
-inline void WindowDataParameter::set_cache_images(bool value) {
-  set_has_cache_images();
+inline void WindowDataParameter::_internal_set_cache_images(bool value) {
+  _has_bits_[0] |= 0x00000080u;
   cache_images_ = value;
+}
+inline void WindowDataParameter::set_cache_images(bool value) {
+  _internal_set_cache_images(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.cache_images)
 }
 
 // optional string root_folder = 13 [default = ""];
-inline bool WindowDataParameter::has_root_folder() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void WindowDataParameter::set_has_root_folder() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool WindowDataParameter::_internal_has_root_folder() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void WindowDataParameter::clear_has_root_folder() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool WindowDataParameter::has_root_folder() const {
+  return _internal_has_root_folder();
 }
 inline void WindowDataParameter::clear_root_folder() {
-  root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_root_folder();
+  root_folder_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::std::string& WindowDataParameter::root_folder() const {
+inline const std::string& WindowDataParameter::root_folder() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.WindowDataParameter.root_folder)
-  return root_folder_.GetNoArena();
+  return _internal_root_folder();
 }
-inline void WindowDataParameter::set_root_folder(const ::std::string& value) {
-  set_has_root_folder();
-  root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void WindowDataParameter::set_root_folder(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ root_folder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.WindowDataParameter.root_folder)
 }
-#if LANG_CXX11
-inline void WindowDataParameter::set_root_folder(::std::string&& value) {
-  set_has_root_folder();
-  root_folder_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.WindowDataParameter.root_folder)
-}
-#endif
-inline void WindowDataParameter::set_root_folder(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_root_folder();
-  root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.WindowDataParameter.root_folder)
-}
-inline void WindowDataParameter::set_root_folder(const char* value, size_t size) {
-  set_has_root_folder();
-  root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.WindowDataParameter.root_folder)
-}
-inline ::std::string* WindowDataParameter::mutable_root_folder() {
-  set_has_root_folder();
+inline std::string* WindowDataParameter::mutable_root_folder() {
+  std::string* _s = _internal_mutable_root_folder();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.WindowDataParameter.root_folder)
-  return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& WindowDataParameter::_internal_root_folder() const {
+  return root_folder_.Get();
+}
+inline void WindowDataParameter::_internal_set_root_folder(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  root_folder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* WindowDataParameter::_internal_mutable_root_folder() {
+  _has_bits_[0] |= 0x00000008u;
+  return root_folder_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* WindowDataParameter::release_root_folder() {
+inline std::string* WindowDataParameter::release_root_folder() {
   // @@protoc_insertion_point(field_release:opencv_caffe.WindowDataParameter.root_folder)
-  clear_has_root_folder();
-  return root_folder_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_root_folder()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000008u;
+  auto* p = root_folder_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (root_folder_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    root_folder_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void WindowDataParameter::set_allocated_root_folder(::std::string* root_folder) {
-  if (root_folder != NULL) {
-    set_has_root_folder();
+inline void WindowDataParameter::set_allocated_root_folder(std::string* root_folder) {
+  if (root_folder != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_root_folder();
+    _has_bits_[0] &= ~0x00000008u;
   }
-  root_folder_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root_folder);
+  root_folder_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), root_folder,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (root_folder_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    root_folder_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.WindowDataParameter.root_folder)
 }
 
@@ -28310,76 +38850,88 @@ inline void WindowDataParameter::set_allocated_root_folder(::std::string* root_f
 // SPPParameter
 
 // optional uint32 pyramid_height = 1;
-inline bool SPPParameter::has_pyramid_height() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool SPPParameter::_internal_has_pyramid_height() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void SPPParameter::set_has_pyramid_height() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void SPPParameter::clear_has_pyramid_height() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool SPPParameter::has_pyramid_height() const {
+  return _internal_has_pyramid_height();
 }
 inline void SPPParameter::clear_pyramid_height() {
   pyramid_height_ = 0u;
-  clear_has_pyramid_height();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::uint32 SPPParameter::pyramid_height() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.SPPParameter.pyramid_height)
+inline uint32_t SPPParameter::_internal_pyramid_height() const {
   return pyramid_height_;
 }
-inline void SPPParameter::set_pyramid_height(::google::protobuf::uint32 value) {
-  set_has_pyramid_height();
+inline uint32_t SPPParameter::pyramid_height() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.SPPParameter.pyramid_height)
+  return _internal_pyramid_height();
+}
+inline void SPPParameter::_internal_set_pyramid_height(uint32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   pyramid_height_ = value;
+}
+inline void SPPParameter::set_pyramid_height(uint32_t value) {
+  _internal_set_pyramid_height(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SPPParameter.pyramid_height)
 }
 
 // optional .opencv_caffe.SPPParameter.PoolMethod pool = 2 [default = MAX];
-inline bool SPPParameter::has_pool() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void SPPParameter::set_has_pool() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool SPPParameter::_internal_has_pool() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void SPPParameter::clear_has_pool() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool SPPParameter::has_pool() const {
+  return _internal_has_pool();
 }
 inline void SPPParameter::clear_pool() {
   pool_ = 0;
-  clear_has_pool();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::opencv_caffe::SPPParameter_PoolMethod SPPParameter::_internal_pool() const {
+  return static_cast< ::opencv_caffe::SPPParameter_PoolMethod >(pool_);
 }
 inline ::opencv_caffe::SPPParameter_PoolMethod SPPParameter::pool() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SPPParameter.pool)
-  return static_cast< ::opencv_caffe::SPPParameter_PoolMethod >(pool_);
+  return _internal_pool();
 }
-inline void SPPParameter::set_pool(::opencv_caffe::SPPParameter_PoolMethod value) {
+inline void SPPParameter::_internal_set_pool(::opencv_caffe::SPPParameter_PoolMethod value) {
   assert(::opencv_caffe::SPPParameter_PoolMethod_IsValid(value));
-  set_has_pool();
+  _has_bits_[0] |= 0x00000002u;
   pool_ = value;
-  // @@protoc_insertion_point(field_set:opencv_caffe.SPPParameter.pool)
 }
-
-// optional .opencv_caffe.SPPParameter.Engine engine = 6 [default = DEFAULT];
-inline bool SPPParameter::has_engine() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline void SPPParameter::set_pool(::opencv_caffe::SPPParameter_PoolMethod value) {
+  _internal_set_pool(value);
+  // @@protoc_insertion_point(field_set:opencv_caffe.SPPParameter.pool)
 }
-inline void SPPParameter::set_has_engine() {
-  _has_bits_[0] |= 0x00000004u;
+
+// optional .opencv_caffe.SPPParameter.Engine engine = 6 [default = DEFAULT];
+inline bool SPPParameter::_internal_has_engine() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void SPPParameter::clear_has_engine() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool SPPParameter::has_engine() const {
+  return _internal_has_engine();
 }
 inline void SPPParameter::clear_engine() {
   engine_ = 0;
-  clear_has_engine();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline ::opencv_caffe::SPPParameter_Engine SPPParameter::_internal_engine() const {
+  return static_cast< ::opencv_caffe::SPPParameter_Engine >(engine_);
 }
 inline ::opencv_caffe::SPPParameter_Engine SPPParameter::engine() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.SPPParameter.engine)
-  return static_cast< ::opencv_caffe::SPPParameter_Engine >(engine_);
+  return _internal_engine();
 }
-inline void SPPParameter::set_engine(::opencv_caffe::SPPParameter_Engine value) {
+inline void SPPParameter::_internal_set_engine(::opencv_caffe::SPPParameter_Engine value) {
   assert(::opencv_caffe::SPPParameter_Engine_IsValid(value));
-  set_has_engine();
+  _has_bits_[0] |= 0x00000004u;
   engine_ = value;
+}
+inline void SPPParameter::set_engine(::opencv_caffe::SPPParameter_Engine value) {
+  _internal_set_engine(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.SPPParameter.engine)
 }
 
@@ -28388,32 +38940,41 @@ inline void SPPParameter::set_engine(::opencv_caffe::SPPParameter_Engine value)
 // V1LayerParameter
 
 // repeated string bottom = 2;
-inline int V1LayerParameter::bottom_size() const {
+inline int V1LayerParameter::_internal_bottom_size() const {
   return bottom_.size();
 }
+inline int V1LayerParameter::bottom_size() const {
+  return _internal_bottom_size();
+}
 inline void V1LayerParameter::clear_bottom() {
   bottom_.Clear();
 }
-inline const ::std::string& V1LayerParameter::bottom(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.bottom)
+inline std::string* V1LayerParameter::add_bottom() {
+  std::string* _s = _internal_add_bottom();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.V1LayerParameter.bottom)
+  return _s;
+}
+inline const std::string& V1LayerParameter::_internal_bottom(int index) const {
   return bottom_.Get(index);
 }
-inline ::std::string* V1LayerParameter::mutable_bottom(int index) {
+inline const std::string& V1LayerParameter::bottom(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.bottom)
+  return _internal_bottom(index);
+}
+inline std::string* V1LayerParameter::mutable_bottom(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.bottom)
   return bottom_.Mutable(index);
 }
-inline void V1LayerParameter::set_bottom(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.bottom)
+inline void V1LayerParameter::set_bottom(int index, const std::string& value) {
   bottom_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void V1LayerParameter::set_bottom(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.bottom)
+}
+inline void V1LayerParameter::set_bottom(int index, std::string&& value) {
   bottom_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.bottom)
 }
-#endif
 inline void V1LayerParameter::set_bottom(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   bottom_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.V1LayerParameter.bottom)
 }
@@ -28422,22 +38983,19 @@ inline void V1LayerParameter::set_bottom(int index, const char* value, size_t si
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.V1LayerParameter.bottom)
 }
-inline ::std::string* V1LayerParameter::add_bottom() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.V1LayerParameter.bottom)
+inline std::string* V1LayerParameter::_internal_add_bottom() {
   return bottom_.Add();
 }
-inline void V1LayerParameter::add_bottom(const ::std::string& value) {
+inline void V1LayerParameter::add_bottom(const std::string& value) {
   bottom_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.bottom)
 }
-#if LANG_CXX11
-inline void V1LayerParameter::add_bottom(::std::string&& value) {
+inline void V1LayerParameter::add_bottom(std::string&& value) {
   bottom_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.bottom)
 }
-#endif
 inline void V1LayerParameter::add_bottom(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   bottom_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.V1LayerParameter.bottom)
 }
@@ -28445,44 +39003,53 @@ inline void V1LayerParameter::add_bottom(const char* value, size_t size) {
   bottom_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.V1LayerParameter.bottom)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 V1LayerParameter::bottom() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.bottom)
   return bottom_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 V1LayerParameter::mutable_bottom() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.bottom)
   return &bottom_;
 }
 
 // repeated string top = 3;
-inline int V1LayerParameter::top_size() const {
+inline int V1LayerParameter::_internal_top_size() const {
   return top_.size();
 }
+inline int V1LayerParameter::top_size() const {
+  return _internal_top_size();
+}
 inline void V1LayerParameter::clear_top() {
   top_.Clear();
 }
-inline const ::std::string& V1LayerParameter::top(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.top)
+inline std::string* V1LayerParameter::add_top() {
+  std::string* _s = _internal_add_top();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.V1LayerParameter.top)
+  return _s;
+}
+inline const std::string& V1LayerParameter::_internal_top(int index) const {
   return top_.Get(index);
 }
-inline ::std::string* V1LayerParameter::mutable_top(int index) {
+inline const std::string& V1LayerParameter::top(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.top)
+  return _internal_top(index);
+}
+inline std::string* V1LayerParameter::mutable_top(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.top)
   return top_.Mutable(index);
 }
-inline void V1LayerParameter::set_top(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.top)
+inline void V1LayerParameter::set_top(int index, const std::string& value) {
   top_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void V1LayerParameter::set_top(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.top)
+}
+inline void V1LayerParameter::set_top(int index, std::string&& value) {
   top_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.top)
 }
-#endif
 inline void V1LayerParameter::set_top(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   top_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.V1LayerParameter.top)
 }
@@ -28491,22 +39058,19 @@ inline void V1LayerParameter::set_top(int index, const char* value, size_t size)
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.V1LayerParameter.top)
 }
-inline ::std::string* V1LayerParameter::add_top() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.V1LayerParameter.top)
+inline std::string* V1LayerParameter::_internal_add_top() {
   return top_.Add();
 }
-inline void V1LayerParameter::add_top(const ::std::string& value) {
+inline void V1LayerParameter::add_top(const std::string& value) {
   top_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.top)
 }
-#if LANG_CXX11
-inline void V1LayerParameter::add_top(::std::string&& value) {
+inline void V1LayerParameter::add_top(std::string&& value) {
   top_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.top)
 }
-#endif
 inline void V1LayerParameter::add_top(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   top_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.V1LayerParameter.top)
 }
@@ -28514,222 +39078,271 @@ inline void V1LayerParameter::add_top(const char* value, size_t size) {
   top_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.V1LayerParameter.top)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 V1LayerParameter::top() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.top)
   return top_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 V1LayerParameter::mutable_top() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.top)
   return &top_;
 }
 
 // optional string name = 4;
-inline bool V1LayerParameter::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void V1LayerParameter::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool V1LayerParameter::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void V1LayerParameter::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool V1LayerParameter::has_name() const {
+  return _internal_has_name();
 }
 inline void V1LayerParameter::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& V1LayerParameter::name() const {
+inline const std::string& V1LayerParameter::name() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void V1LayerParameter::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void V1LayerParameter::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.name)
 }
-#if LANG_CXX11
-inline void V1LayerParameter::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.V1LayerParameter.name)
-}
-#endif
-inline void V1LayerParameter::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:opencv_caffe.V1LayerParameter.name)
-}
-inline void V1LayerParameter::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:opencv_caffe.V1LayerParameter.name)
-}
-inline ::std::string* V1LayerParameter::mutable_name() {
-  set_has_name();
+inline std::string* V1LayerParameter::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& V1LayerParameter::_internal_name() const {
+  return name_.Get();
+}
+inline void V1LayerParameter::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* V1LayerParameter::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* V1LayerParameter::release_name() {
+inline std::string* V1LayerParameter::release_name() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void V1LayerParameter::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void V1LayerParameter::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.name)
 }
 
 // repeated .opencv_caffe.NetStateRule include = 32;
-inline int V1LayerParameter::include_size() const {
+inline int V1LayerParameter::_internal_include_size() const {
   return include_.size();
 }
+inline int V1LayerParameter::include_size() const {
+  return _internal_include_size();
+}
 inline void V1LayerParameter::clear_include() {
   include_.Clear();
 }
-inline const ::opencv_caffe::NetStateRule& V1LayerParameter::include(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.include)
-  return include_.Get(index);
-}
 inline ::opencv_caffe::NetStateRule* V1LayerParameter::mutable_include(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.include)
   return include_.Mutable(index);
 }
-inline ::opencv_caffe::NetStateRule* V1LayerParameter::add_include() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.include)
-  return include_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
 V1LayerParameter::mutable_include() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.include)
   return &include_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
+inline const ::opencv_caffe::NetStateRule& V1LayerParameter::_internal_include(int index) const {
+  return include_.Get(index);
+}
+inline const ::opencv_caffe::NetStateRule& V1LayerParameter::include(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.include)
+  return _internal_include(index);
+}
+inline ::opencv_caffe::NetStateRule* V1LayerParameter::_internal_add_include() {
+  return include_.Add();
+}
+inline ::opencv_caffe::NetStateRule* V1LayerParameter::add_include() {
+  ::opencv_caffe::NetStateRule* _add = _internal_add_include();
+  // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.include)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
 V1LayerParameter::include() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.include)
   return include_;
 }
 
 // repeated .opencv_caffe.NetStateRule exclude = 33;
-inline int V1LayerParameter::exclude_size() const {
+inline int V1LayerParameter::_internal_exclude_size() const {
   return exclude_.size();
 }
+inline int V1LayerParameter::exclude_size() const {
+  return _internal_exclude_size();
+}
 inline void V1LayerParameter::clear_exclude() {
   exclude_.Clear();
 }
-inline const ::opencv_caffe::NetStateRule& V1LayerParameter::exclude(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.exclude)
-  return exclude_.Get(index);
-}
 inline ::opencv_caffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.exclude)
   return exclude_.Mutable(index);
 }
-inline ::opencv_caffe::NetStateRule* V1LayerParameter::add_exclude() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.exclude)
-  return exclude_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >*
 V1LayerParameter::mutable_exclude() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.exclude)
   return &exclude_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
+inline const ::opencv_caffe::NetStateRule& V1LayerParameter::_internal_exclude(int index) const {
+  return exclude_.Get(index);
+}
+inline const ::opencv_caffe::NetStateRule& V1LayerParameter::exclude(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.exclude)
+  return _internal_exclude(index);
+}
+inline ::opencv_caffe::NetStateRule* V1LayerParameter::_internal_add_exclude() {
+  return exclude_.Add();
+}
+inline ::opencv_caffe::NetStateRule* V1LayerParameter::add_exclude() {
+  ::opencv_caffe::NetStateRule* _add = _internal_add_exclude();
+  // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.exclude)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::NetStateRule >&
 V1LayerParameter::exclude() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.exclude)
   return exclude_;
 }
 
 // optional .opencv_caffe.V1LayerParameter.LayerType type = 5;
-inline bool V1LayerParameter::has_type() const {
-  return (_has_bits_[1] & 0x00000001u) != 0;
-}
-inline void V1LayerParameter::set_has_type() {
-  _has_bits_[1] |= 0x00000001u;
+inline bool V1LayerParameter::_internal_has_type() const {
+  bool value = (_has_bits_[1] & 0x00000001u) != 0;
+  return value;
 }
-inline void V1LayerParameter::clear_has_type() {
-  _has_bits_[1] &= ~0x00000001u;
+inline bool V1LayerParameter::has_type() const {
+  return _internal_has_type();
 }
 inline void V1LayerParameter::clear_type() {
   type_ = 0;
-  clear_has_type();
+  _has_bits_[1] &= ~0x00000001u;
+}
+inline ::opencv_caffe::V1LayerParameter_LayerType V1LayerParameter::_internal_type() const {
+  return static_cast< ::opencv_caffe::V1LayerParameter_LayerType >(type_);
 }
 inline ::opencv_caffe::V1LayerParameter_LayerType V1LayerParameter::type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.type)
-  return static_cast< ::opencv_caffe::V1LayerParameter_LayerType >(type_);
+  return _internal_type();
 }
-inline void V1LayerParameter::set_type(::opencv_caffe::V1LayerParameter_LayerType value) {
+inline void V1LayerParameter::_internal_set_type(::opencv_caffe::V1LayerParameter_LayerType value) {
   assert(::opencv_caffe::V1LayerParameter_LayerType_IsValid(value));
-  set_has_type();
+  _has_bits_[1] |= 0x00000001u;
   type_ = value;
+}
+inline void V1LayerParameter::set_type(::opencv_caffe::V1LayerParameter_LayerType value) {
+  _internal_set_type(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.type)
 }
 
 // repeated .opencv_caffe.BlobProto blobs = 6;
-inline int V1LayerParameter::blobs_size() const {
+inline int V1LayerParameter::_internal_blobs_size() const {
   return blobs_.size();
 }
+inline int V1LayerParameter::blobs_size() const {
+  return _internal_blobs_size();
+}
 inline void V1LayerParameter::clear_blobs() {
   blobs_.Clear();
 }
-inline const ::opencv_caffe::BlobProto& V1LayerParameter::blobs(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.blobs)
-  return blobs_.Get(index);
-}
 inline ::opencv_caffe::BlobProto* V1LayerParameter::mutable_blobs(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.blobs)
   return blobs_.Mutable(index);
 }
-inline ::opencv_caffe::BlobProto* V1LayerParameter::add_blobs() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.blobs)
-  return blobs_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
 V1LayerParameter::mutable_blobs() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.blobs)
   return &blobs_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+inline const ::opencv_caffe::BlobProto& V1LayerParameter::_internal_blobs(int index) const {
+  return blobs_.Get(index);
+}
+inline const ::opencv_caffe::BlobProto& V1LayerParameter::blobs(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.blobs)
+  return _internal_blobs(index);
+}
+inline ::opencv_caffe::BlobProto* V1LayerParameter::_internal_add_blobs() {
+  return blobs_.Add();
+}
+inline ::opencv_caffe::BlobProto* V1LayerParameter::add_blobs() {
+  ::opencv_caffe::BlobProto* _add = _internal_add_blobs();
+  // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.blobs)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
 V1LayerParameter::blobs() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.blobs)
   return blobs_;
 }
 
 // repeated string param = 1001;
-inline int V1LayerParameter::param_size() const {
+inline int V1LayerParameter::_internal_param_size() const {
   return param_.size();
 }
+inline int V1LayerParameter::param_size() const {
+  return _internal_param_size();
+}
 inline void V1LayerParameter::clear_param() {
   param_.Clear();
 }
-inline const ::std::string& V1LayerParameter::param(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.param)
+inline std::string* V1LayerParameter::add_param() {
+  std::string* _s = _internal_add_param();
+  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.V1LayerParameter.param)
+  return _s;
+}
+inline const std::string& V1LayerParameter::_internal_param(int index) const {
   return param_.Get(index);
 }
-inline ::std::string* V1LayerParameter::mutable_param(int index) {
+inline const std::string& V1LayerParameter::param(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.param)
+  return _internal_param(index);
+}
+inline std::string* V1LayerParameter::mutable_param(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.param)
   return param_.Mutable(index);
 }
-inline void V1LayerParameter::set_param(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.param)
+inline void V1LayerParameter::set_param(int index, const std::string& value) {
   param_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void V1LayerParameter::set_param(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.param)
+}
+inline void V1LayerParameter::set_param(int index, std::string&& value) {
   param_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.param)
 }
-#endif
 inline void V1LayerParameter::set_param(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   param_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_caffe.V1LayerParameter.param)
 }
@@ -28738,22 +39351,19 @@ inline void V1LayerParameter::set_param(int index, const char* value, size_t siz
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_caffe.V1LayerParameter.param)
 }
-inline ::std::string* V1LayerParameter::add_param() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_caffe.V1LayerParameter.param)
+inline std::string* V1LayerParameter::_internal_add_param() {
   return param_.Add();
 }
-inline void V1LayerParameter::add_param(const ::std::string& value) {
+inline void V1LayerParameter::add_param(const std::string& value) {
   param_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.param)
 }
-#if LANG_CXX11
-inline void V1LayerParameter::add_param(::std::string&& value) {
+inline void V1LayerParameter::add_param(std::string&& value) {
   param_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.param)
 }
-#endif
 inline void V1LayerParameter::add_param(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   param_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_caffe.V1LayerParameter.param)
 }
@@ -28761,1808 +39371,2988 @@ inline void V1LayerParameter::add_param(const char* value, size_t size) {
   param_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_caffe.V1LayerParameter.param)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 V1LayerParameter::param() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.param)
   return param_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 V1LayerParameter::mutable_param() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.param)
   return &param_;
 }
 
 // repeated .opencv_caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002;
-inline int V1LayerParameter::blob_share_mode_size() const {
+inline int V1LayerParameter::_internal_blob_share_mode_size() const {
   return blob_share_mode_.size();
 }
+inline int V1LayerParameter::blob_share_mode_size() const {
+  return _internal_blob_share_mode_size();
+}
 inline void V1LayerParameter::clear_blob_share_mode() {
   blob_share_mode_.Clear();
 }
+inline ::opencv_caffe::V1LayerParameter_DimCheckMode V1LayerParameter::_internal_blob_share_mode(int index) const {
+  return static_cast< ::opencv_caffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index));
+}
 inline ::opencv_caffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.blob_share_mode)
-  return static_cast< ::opencv_caffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index));
+  return _internal_blob_share_mode(index);
 }
 inline void V1LayerParameter::set_blob_share_mode(int index, ::opencv_caffe::V1LayerParameter_DimCheckMode value) {
   assert(::opencv_caffe::V1LayerParameter_DimCheckMode_IsValid(value));
   blob_share_mode_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.blob_share_mode)
 }
-inline void V1LayerParameter::add_blob_share_mode(::opencv_caffe::V1LayerParameter_DimCheckMode value) {
+inline void V1LayerParameter::_internal_add_blob_share_mode(::opencv_caffe::V1LayerParameter_DimCheckMode value) {
   assert(::opencv_caffe::V1LayerParameter_DimCheckMode_IsValid(value));
   blob_share_mode_.Add(value);
+}
+inline void V1LayerParameter::add_blob_share_mode(::opencv_caffe::V1LayerParameter_DimCheckMode value) {
+  _internal_add_blob_share_mode(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.blob_share_mode)
 }
-inline const ::google::protobuf::RepeatedField<int>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>&
 V1LayerParameter::blob_share_mode() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.blob_share_mode)
   return blob_share_mode_;
 }
-inline ::google::protobuf::RepeatedField<int>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>*
+V1LayerParameter::_internal_mutable_blob_share_mode() {
+  return &blob_share_mode_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>*
 V1LayerParameter::mutable_blob_share_mode() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.blob_share_mode)
-  return &blob_share_mode_;
+  return _internal_mutable_blob_share_mode();
 }
 
 // repeated float blobs_lr = 7;
-inline int V1LayerParameter::blobs_lr_size() const {
+inline int V1LayerParameter::_internal_blobs_lr_size() const {
   return blobs_lr_.size();
 }
+inline int V1LayerParameter::blobs_lr_size() const {
+  return _internal_blobs_lr_size();
+}
 inline void V1LayerParameter::clear_blobs_lr() {
   blobs_lr_.Clear();
 }
+inline float V1LayerParameter::_internal_blobs_lr(int index) const {
+  return blobs_lr_.Get(index);
+}
 inline float V1LayerParameter::blobs_lr(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.blobs_lr)
-  return blobs_lr_.Get(index);
+  return _internal_blobs_lr(index);
 }
 inline void V1LayerParameter::set_blobs_lr(int index, float value) {
   blobs_lr_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.blobs_lr)
 }
-inline void V1LayerParameter::add_blobs_lr(float value) {
+inline void V1LayerParameter::_internal_add_blobs_lr(float value) {
   blobs_lr_.Add(value);
+}
+inline void V1LayerParameter::add_blobs_lr(float value) {
+  _internal_add_blobs_lr(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.blobs_lr)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+V1LayerParameter::_internal_blobs_lr() const {
+  return blobs_lr_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 V1LayerParameter::blobs_lr() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.blobs_lr)
-  return blobs_lr_;
+  return _internal_blobs_lr();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+V1LayerParameter::_internal_mutable_blobs_lr() {
+  return &blobs_lr_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 V1LayerParameter::mutable_blobs_lr() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.blobs_lr)
-  return &blobs_lr_;
+  return _internal_mutable_blobs_lr();
 }
 
 // repeated float weight_decay = 8;
-inline int V1LayerParameter::weight_decay_size() const {
+inline int V1LayerParameter::_internal_weight_decay_size() const {
   return weight_decay_.size();
 }
+inline int V1LayerParameter::weight_decay_size() const {
+  return _internal_weight_decay_size();
+}
 inline void V1LayerParameter::clear_weight_decay() {
   weight_decay_.Clear();
 }
+inline float V1LayerParameter::_internal_weight_decay(int index) const {
+  return weight_decay_.Get(index);
+}
 inline float V1LayerParameter::weight_decay(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.weight_decay)
-  return weight_decay_.Get(index);
+  return _internal_weight_decay(index);
 }
 inline void V1LayerParameter::set_weight_decay(int index, float value) {
   weight_decay_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.weight_decay)
 }
-inline void V1LayerParameter::add_weight_decay(float value) {
+inline void V1LayerParameter::_internal_add_weight_decay(float value) {
   weight_decay_.Add(value);
+}
+inline void V1LayerParameter::add_weight_decay(float value) {
+  _internal_add_weight_decay(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.weight_decay)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+V1LayerParameter::_internal_weight_decay() const {
+  return weight_decay_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 V1LayerParameter::weight_decay() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.weight_decay)
-  return weight_decay_;
+  return _internal_weight_decay();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+V1LayerParameter::_internal_mutable_weight_decay() {
+  return &weight_decay_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 V1LayerParameter::mutable_weight_decay() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.weight_decay)
-  return &weight_decay_;
+  return _internal_mutable_weight_decay();
 }
 
 // repeated float loss_weight = 35;
-inline int V1LayerParameter::loss_weight_size() const {
+inline int V1LayerParameter::_internal_loss_weight_size() const {
   return loss_weight_.size();
 }
+inline int V1LayerParameter::loss_weight_size() const {
+  return _internal_loss_weight_size();
+}
 inline void V1LayerParameter::clear_loss_weight() {
   loss_weight_.Clear();
 }
+inline float V1LayerParameter::_internal_loss_weight(int index) const {
+  return loss_weight_.Get(index);
+}
 inline float V1LayerParameter::loss_weight(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.loss_weight)
-  return loss_weight_.Get(index);
+  return _internal_loss_weight(index);
 }
 inline void V1LayerParameter::set_loss_weight(int index, float value) {
   loss_weight_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V1LayerParameter.loss_weight)
 }
-inline void V1LayerParameter::add_loss_weight(float value) {
+inline void V1LayerParameter::_internal_add_loss_weight(float value) {
   loss_weight_.Add(value);
+}
+inline void V1LayerParameter::add_loss_weight(float value) {
+  _internal_add_loss_weight(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V1LayerParameter.loss_weight)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+V1LayerParameter::_internal_loss_weight() const {
+  return loss_weight_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 V1LayerParameter::loss_weight() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V1LayerParameter.loss_weight)
-  return loss_weight_;
+  return _internal_loss_weight();
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+V1LayerParameter::_internal_mutable_loss_weight() {
+  return &loss_weight_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 V1LayerParameter::mutable_loss_weight() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V1LayerParameter.loss_weight)
-  return &loss_weight_;
+  return _internal_mutable_loss_weight();
 }
 
 // optional .opencv_caffe.AccuracyParameter accuracy_param = 27;
-inline bool V1LayerParameter::has_accuracy_param() const {
-  return (_has_bits_[0] & 0x00100000u) != 0;
+inline bool V1LayerParameter::_internal_has_accuracy_param() const {
+  bool value = (_has_bits_[0] & 0x00100000u) != 0;
+  PROTOBUF_ASSUME(!value || accuracy_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_accuracy_param() {
-  _has_bits_[0] |= 0x00100000u;
+inline bool V1LayerParameter::has_accuracy_param() const {
+  return _internal_has_accuracy_param();
 }
-inline void V1LayerParameter::clear_has_accuracy_param() {
+inline void V1LayerParameter::clear_accuracy_param() {
+  if (accuracy_param_ != nullptr) accuracy_param_->Clear();
   _has_bits_[0] &= ~0x00100000u;
 }
-inline void V1LayerParameter::clear_accuracy_param() {
-  if (accuracy_param_ != NULL) accuracy_param_->Clear();
-  clear_has_accuracy_param();
+inline const ::opencv_caffe::AccuracyParameter& V1LayerParameter::_internal_accuracy_param() const {
+  const ::opencv_caffe::AccuracyParameter* p = accuracy_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::AccuracyParameter&>(
+      ::opencv_caffe::_AccuracyParameter_default_instance_);
 }
 inline const ::opencv_caffe::AccuracyParameter& V1LayerParameter::accuracy_param() const {
-  const ::opencv_caffe::AccuracyParameter* p = accuracy_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.accuracy_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::AccuracyParameter*>(
-      &::opencv_caffe::_AccuracyParameter_default_instance_);
+  return _internal_accuracy_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_accuracy_param(
+    ::opencv_caffe::AccuracyParameter* accuracy_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(accuracy_param_);
+  }
+  accuracy_param_ = accuracy_param;
+  if (accuracy_param) {
+    _has_bits_[0] |= 0x00100000u;
+  } else {
+    _has_bits_[0] &= ~0x00100000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.accuracy_param)
 }
 inline ::opencv_caffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() {
+  _has_bits_[0] &= ~0x00100000u;
+  ::opencv_caffe::AccuracyParameter* temp = accuracy_param_;
+  accuracy_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::AccuracyParameter* V1LayerParameter::unsafe_arena_release_accuracy_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.accuracy_param)
-  clear_has_accuracy_param();
+  _has_bits_[0] &= ~0x00100000u;
   ::opencv_caffe::AccuracyParameter* temp = accuracy_param_;
-  accuracy_param_ = NULL;
+  accuracy_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() {
-  set_has_accuracy_param();
-  if (accuracy_param_ == NULL) {
-    accuracy_param_ = new ::opencv_caffe::AccuracyParameter;
+inline ::opencv_caffe::AccuracyParameter* V1LayerParameter::_internal_mutable_accuracy_param() {
+  _has_bits_[0] |= 0x00100000u;
+  if (accuracy_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::AccuracyParameter>(GetArenaForAllocation());
+    accuracy_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.accuracy_param)
   return accuracy_param_;
 }
+inline ::opencv_caffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() {
+  ::opencv_caffe::AccuracyParameter* _msg = _internal_mutable_accuracy_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.accuracy_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_accuracy_param(::opencv_caffe::AccuracyParameter* accuracy_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete accuracy_param_;
   }
   if (accuracy_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::AccuracyParameter>::GetOwningArena(accuracy_param);
     if (message_arena != submessage_arena) {
-      accuracy_param = ::google::protobuf::internal::GetOwnedMessage(
+      accuracy_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, accuracy_param, submessage_arena);
     }
-    set_has_accuracy_param();
+    _has_bits_[0] |= 0x00100000u;
   } else {
-    clear_has_accuracy_param();
+    _has_bits_[0] &= ~0x00100000u;
   }
   accuracy_param_ = accuracy_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.accuracy_param)
 }
 
 // optional .opencv_caffe.ArgMaxParameter argmax_param = 23;
-inline bool V1LayerParameter::has_argmax_param() const {
-  return (_has_bits_[0] & 0x00010000u) != 0;
+inline bool V1LayerParameter::_internal_has_argmax_param() const {
+  bool value = (_has_bits_[0] & 0x00010000u) != 0;
+  PROTOBUF_ASSUME(!value || argmax_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_argmax_param() {
-  _has_bits_[0] |= 0x00010000u;
+inline bool V1LayerParameter::has_argmax_param() const {
+  return _internal_has_argmax_param();
 }
-inline void V1LayerParameter::clear_has_argmax_param() {
+inline void V1LayerParameter::clear_argmax_param() {
+  if (argmax_param_ != nullptr) argmax_param_->Clear();
   _has_bits_[0] &= ~0x00010000u;
 }
-inline void V1LayerParameter::clear_argmax_param() {
-  if (argmax_param_ != NULL) argmax_param_->Clear();
-  clear_has_argmax_param();
+inline const ::opencv_caffe::ArgMaxParameter& V1LayerParameter::_internal_argmax_param() const {
+  const ::opencv_caffe::ArgMaxParameter* p = argmax_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ArgMaxParameter&>(
+      ::opencv_caffe::_ArgMaxParameter_default_instance_);
 }
 inline const ::opencv_caffe::ArgMaxParameter& V1LayerParameter::argmax_param() const {
-  const ::opencv_caffe::ArgMaxParameter* p = argmax_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.argmax_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ArgMaxParameter*>(
-      &::opencv_caffe::_ArgMaxParameter_default_instance_);
+  return _internal_argmax_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_argmax_param(
+    ::opencv_caffe::ArgMaxParameter* argmax_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(argmax_param_);
+  }
+  argmax_param_ = argmax_param;
+  if (argmax_param) {
+    _has_bits_[0] |= 0x00010000u;
+  } else {
+    _has_bits_[0] &= ~0x00010000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.argmax_param)
 }
 inline ::opencv_caffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() {
+  _has_bits_[0] &= ~0x00010000u;
+  ::opencv_caffe::ArgMaxParameter* temp = argmax_param_;
+  argmax_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ArgMaxParameter* V1LayerParameter::unsafe_arena_release_argmax_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.argmax_param)
-  clear_has_argmax_param();
+  _has_bits_[0] &= ~0x00010000u;
   ::opencv_caffe::ArgMaxParameter* temp = argmax_param_;
-  argmax_param_ = NULL;
+  argmax_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() {
-  set_has_argmax_param();
-  if (argmax_param_ == NULL) {
-    argmax_param_ = new ::opencv_caffe::ArgMaxParameter;
+inline ::opencv_caffe::ArgMaxParameter* V1LayerParameter::_internal_mutable_argmax_param() {
+  _has_bits_[0] |= 0x00010000u;
+  if (argmax_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ArgMaxParameter>(GetArenaForAllocation());
+    argmax_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.argmax_param)
   return argmax_param_;
 }
+inline ::opencv_caffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() {
+  ::opencv_caffe::ArgMaxParameter* _msg = _internal_mutable_argmax_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.argmax_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_argmax_param(::opencv_caffe::ArgMaxParameter* argmax_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete argmax_param_;
   }
   if (argmax_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ArgMaxParameter>::GetOwningArena(argmax_param);
     if (message_arena != submessage_arena) {
-      argmax_param = ::google::protobuf::internal::GetOwnedMessage(
+      argmax_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, argmax_param, submessage_arena);
     }
-    set_has_argmax_param();
+    _has_bits_[0] |= 0x00010000u;
   } else {
-    clear_has_argmax_param();
+    _has_bits_[0] &= ~0x00010000u;
   }
   argmax_param_ = argmax_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.argmax_param)
 }
 
 // optional .opencv_caffe.ConcatParameter concat_param = 9;
-inline bool V1LayerParameter::has_concat_param() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool V1LayerParameter::_internal_has_concat_param() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  PROTOBUF_ASSUME(!value || concat_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_concat_param() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool V1LayerParameter::has_concat_param() const {
+  return _internal_has_concat_param();
 }
-inline void V1LayerParameter::clear_has_concat_param() {
+inline void V1LayerParameter::clear_concat_param() {
+  if (concat_param_ != nullptr) concat_param_->Clear();
   _has_bits_[0] &= ~0x00000004u;
 }
-inline void V1LayerParameter::clear_concat_param() {
-  if (concat_param_ != NULL) concat_param_->Clear();
-  clear_has_concat_param();
+inline const ::opencv_caffe::ConcatParameter& V1LayerParameter::_internal_concat_param() const {
+  const ::opencv_caffe::ConcatParameter* p = concat_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ConcatParameter&>(
+      ::opencv_caffe::_ConcatParameter_default_instance_);
 }
 inline const ::opencv_caffe::ConcatParameter& V1LayerParameter::concat_param() const {
-  const ::opencv_caffe::ConcatParameter* p = concat_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.concat_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ConcatParameter*>(
-      &::opencv_caffe::_ConcatParameter_default_instance_);
+  return _internal_concat_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_concat_param(
+    ::opencv_caffe::ConcatParameter* concat_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(concat_param_);
+  }
+  concat_param_ = concat_param;
+  if (concat_param) {
+    _has_bits_[0] |= 0x00000004u;
+  } else {
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.concat_param)
 }
 inline ::opencv_caffe::ConcatParameter* V1LayerParameter::release_concat_param() {
+  _has_bits_[0] &= ~0x00000004u;
+  ::opencv_caffe::ConcatParameter* temp = concat_param_;
+  concat_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ConcatParameter* V1LayerParameter::unsafe_arena_release_concat_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.concat_param)
-  clear_has_concat_param();
+  _has_bits_[0] &= ~0x00000004u;
   ::opencv_caffe::ConcatParameter* temp = concat_param_;
-  concat_param_ = NULL;
+  concat_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ConcatParameter* V1LayerParameter::mutable_concat_param() {
-  set_has_concat_param();
-  if (concat_param_ == NULL) {
-    concat_param_ = new ::opencv_caffe::ConcatParameter;
+inline ::opencv_caffe::ConcatParameter* V1LayerParameter::_internal_mutable_concat_param() {
+  _has_bits_[0] |= 0x00000004u;
+  if (concat_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ConcatParameter>(GetArenaForAllocation());
+    concat_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.concat_param)
   return concat_param_;
 }
+inline ::opencv_caffe::ConcatParameter* V1LayerParameter::mutable_concat_param() {
+  ::opencv_caffe::ConcatParameter* _msg = _internal_mutable_concat_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.concat_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_concat_param(::opencv_caffe::ConcatParameter* concat_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete concat_param_;
   }
   if (concat_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ConcatParameter>::GetOwningArena(concat_param);
     if (message_arena != submessage_arena) {
-      concat_param = ::google::protobuf::internal::GetOwnedMessage(
+      concat_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, concat_param, submessage_arena);
     }
-    set_has_concat_param();
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_concat_param();
+    _has_bits_[0] &= ~0x00000004u;
   }
   concat_param_ = concat_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.concat_param)
 }
 
 // optional .opencv_caffe.ContrastiveLossParameter contrastive_loss_param = 40;
-inline bool V1LayerParameter::has_contrastive_loss_param() const {
-  return (_has_bits_[0] & 0x20000000u) != 0;
+inline bool V1LayerParameter::_internal_has_contrastive_loss_param() const {
+  bool value = (_has_bits_[0] & 0x20000000u) != 0;
+  PROTOBUF_ASSUME(!value || contrastive_loss_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_contrastive_loss_param() {
-  _has_bits_[0] |= 0x20000000u;
+inline bool V1LayerParameter::has_contrastive_loss_param() const {
+  return _internal_has_contrastive_loss_param();
 }
-inline void V1LayerParameter::clear_has_contrastive_loss_param() {
+inline void V1LayerParameter::clear_contrastive_loss_param() {
+  if (contrastive_loss_param_ != nullptr) contrastive_loss_param_->Clear();
   _has_bits_[0] &= ~0x20000000u;
 }
-inline void V1LayerParameter::clear_contrastive_loss_param() {
-  if (contrastive_loss_param_ != NULL) contrastive_loss_param_->Clear();
-  clear_has_contrastive_loss_param();
+inline const ::opencv_caffe::ContrastiveLossParameter& V1LayerParameter::_internal_contrastive_loss_param() const {
+  const ::opencv_caffe::ContrastiveLossParameter* p = contrastive_loss_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ContrastiveLossParameter&>(
+      ::opencv_caffe::_ContrastiveLossParameter_default_instance_);
 }
 inline const ::opencv_caffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const {
-  const ::opencv_caffe::ContrastiveLossParameter* p = contrastive_loss_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.contrastive_loss_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ContrastiveLossParameter*>(
-      &::opencv_caffe::_ContrastiveLossParameter_default_instance_);
+  return _internal_contrastive_loss_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_contrastive_loss_param(
+    ::opencv_caffe::ContrastiveLossParameter* contrastive_loss_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(contrastive_loss_param_);
+  }
+  contrastive_loss_param_ = contrastive_loss_param;
+  if (contrastive_loss_param) {
+    _has_bits_[0] |= 0x20000000u;
+  } else {
+    _has_bits_[0] &= ~0x20000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.contrastive_loss_param)
 }
 inline ::opencv_caffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() {
+  _has_bits_[0] &= ~0x20000000u;
+  ::opencv_caffe::ContrastiveLossParameter* temp = contrastive_loss_param_;
+  contrastive_loss_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ContrastiveLossParameter* V1LayerParameter::unsafe_arena_release_contrastive_loss_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.contrastive_loss_param)
-  clear_has_contrastive_loss_param();
+  _has_bits_[0] &= ~0x20000000u;
   ::opencv_caffe::ContrastiveLossParameter* temp = contrastive_loss_param_;
-  contrastive_loss_param_ = NULL;
+  contrastive_loss_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() {
-  set_has_contrastive_loss_param();
-  if (contrastive_loss_param_ == NULL) {
-    contrastive_loss_param_ = new ::opencv_caffe::ContrastiveLossParameter;
+inline ::opencv_caffe::ContrastiveLossParameter* V1LayerParameter::_internal_mutable_contrastive_loss_param() {
+  _has_bits_[0] |= 0x20000000u;
+  if (contrastive_loss_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ContrastiveLossParameter>(GetArenaForAllocation());
+    contrastive_loss_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.contrastive_loss_param)
   return contrastive_loss_param_;
 }
+inline ::opencv_caffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() {
+  ::opencv_caffe::ContrastiveLossParameter* _msg = _internal_mutable_contrastive_loss_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.contrastive_loss_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_contrastive_loss_param(::opencv_caffe::ContrastiveLossParameter* contrastive_loss_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete contrastive_loss_param_;
   }
   if (contrastive_loss_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ContrastiveLossParameter>::GetOwningArena(contrastive_loss_param);
     if (message_arena != submessage_arena) {
-      contrastive_loss_param = ::google::protobuf::internal::GetOwnedMessage(
+      contrastive_loss_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, contrastive_loss_param, submessage_arena);
     }
-    set_has_contrastive_loss_param();
+    _has_bits_[0] |= 0x20000000u;
   } else {
-    clear_has_contrastive_loss_param();
+    _has_bits_[0] &= ~0x20000000u;
   }
   contrastive_loss_param_ = contrastive_loss_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.contrastive_loss_param)
 }
 
 // optional .opencv_caffe.ConvolutionParameter convolution_param = 10;
-inline bool V1LayerParameter::has_convolution_param() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool V1LayerParameter::_internal_has_convolution_param() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  PROTOBUF_ASSUME(!value || convolution_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_convolution_param() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool V1LayerParameter::has_convolution_param() const {
+  return _internal_has_convolution_param();
 }
-inline void V1LayerParameter::clear_has_convolution_param() {
+inline void V1LayerParameter::clear_convolution_param() {
+  if (convolution_param_ != nullptr) convolution_param_->Clear();
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void V1LayerParameter::clear_convolution_param() {
-  if (convolution_param_ != NULL) convolution_param_->Clear();
-  clear_has_convolution_param();
+inline const ::opencv_caffe::ConvolutionParameter& V1LayerParameter::_internal_convolution_param() const {
+  const ::opencv_caffe::ConvolutionParameter* p = convolution_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ConvolutionParameter&>(
+      ::opencv_caffe::_ConvolutionParameter_default_instance_);
 }
 inline const ::opencv_caffe::ConvolutionParameter& V1LayerParameter::convolution_param() const {
-  const ::opencv_caffe::ConvolutionParameter* p = convolution_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.convolution_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ConvolutionParameter*>(
-      &::opencv_caffe::_ConvolutionParameter_default_instance_);
+  return _internal_convolution_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_convolution_param(
+    ::opencv_caffe::ConvolutionParameter* convolution_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(convolution_param_);
+  }
+  convolution_param_ = convolution_param;
+  if (convolution_param) {
+    _has_bits_[0] |= 0x00000008u;
+  } else {
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.convolution_param)
 }
 inline ::opencv_caffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() {
+  _has_bits_[0] &= ~0x00000008u;
+  ::opencv_caffe::ConvolutionParameter* temp = convolution_param_;
+  convolution_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ConvolutionParameter* V1LayerParameter::unsafe_arena_release_convolution_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.convolution_param)
-  clear_has_convolution_param();
+  _has_bits_[0] &= ~0x00000008u;
   ::opencv_caffe::ConvolutionParameter* temp = convolution_param_;
-  convolution_param_ = NULL;
+  convolution_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() {
-  set_has_convolution_param();
-  if (convolution_param_ == NULL) {
-    convolution_param_ = new ::opencv_caffe::ConvolutionParameter;
+inline ::opencv_caffe::ConvolutionParameter* V1LayerParameter::_internal_mutable_convolution_param() {
+  _has_bits_[0] |= 0x00000008u;
+  if (convolution_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ConvolutionParameter>(GetArenaForAllocation());
+    convolution_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.convolution_param)
   return convolution_param_;
 }
+inline ::opencv_caffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() {
+  ::opencv_caffe::ConvolutionParameter* _msg = _internal_mutable_convolution_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.convolution_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_convolution_param(::opencv_caffe::ConvolutionParameter* convolution_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete convolution_param_;
   }
   if (convolution_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ConvolutionParameter>::GetOwningArena(convolution_param);
     if (message_arena != submessage_arena) {
-      convolution_param = ::google::protobuf::internal::GetOwnedMessage(
+      convolution_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, convolution_param, submessage_arena);
     }
-    set_has_convolution_param();
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_convolution_param();
+    _has_bits_[0] &= ~0x00000008u;
   }
   convolution_param_ = convolution_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.convolution_param)
 }
 
 // optional .opencv_caffe.DataParameter data_param = 11;
-inline bool V1LayerParameter::has_data_param() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+inline bool V1LayerParameter::_internal_has_data_param() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  PROTOBUF_ASSUME(!value || data_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_data_param() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool V1LayerParameter::has_data_param() const {
+  return _internal_has_data_param();
 }
-inline void V1LayerParameter::clear_has_data_param() {
+inline void V1LayerParameter::clear_data_param() {
+  if (data_param_ != nullptr) data_param_->Clear();
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void V1LayerParameter::clear_data_param() {
-  if (data_param_ != NULL) data_param_->Clear();
-  clear_has_data_param();
+inline const ::opencv_caffe::DataParameter& V1LayerParameter::_internal_data_param() const {
+  const ::opencv_caffe::DataParameter* p = data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::DataParameter&>(
+      ::opencv_caffe::_DataParameter_default_instance_);
 }
 inline const ::opencv_caffe::DataParameter& V1LayerParameter::data_param() const {
-  const ::opencv_caffe::DataParameter* p = data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::DataParameter*>(
-      &::opencv_caffe::_DataParameter_default_instance_);
+  return _internal_data_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_data_param(
+    ::opencv_caffe::DataParameter* data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(data_param_);
+  }
+  data_param_ = data_param;
+  if (data_param) {
+    _has_bits_[0] |= 0x00000010u;
+  } else {
+    _has_bits_[0] &= ~0x00000010u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.data_param)
 }
 inline ::opencv_caffe::DataParameter* V1LayerParameter::release_data_param() {
+  _has_bits_[0] &= ~0x00000010u;
+  ::opencv_caffe::DataParameter* temp = data_param_;
+  data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::DataParameter* V1LayerParameter::unsafe_arena_release_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.data_param)
-  clear_has_data_param();
+  _has_bits_[0] &= ~0x00000010u;
   ::opencv_caffe::DataParameter* temp = data_param_;
-  data_param_ = NULL;
+  data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::DataParameter* V1LayerParameter::mutable_data_param() {
-  set_has_data_param();
-  if (data_param_ == NULL) {
-    data_param_ = new ::opencv_caffe::DataParameter;
+inline ::opencv_caffe::DataParameter* V1LayerParameter::_internal_mutable_data_param() {
+  _has_bits_[0] |= 0x00000010u;
+  if (data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::DataParameter>(GetArenaForAllocation());
+    data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.data_param)
   return data_param_;
 }
+inline ::opencv_caffe::DataParameter* V1LayerParameter::mutable_data_param() {
+  ::opencv_caffe::DataParameter* _msg = _internal_mutable_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.data_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_data_param(::opencv_caffe::DataParameter* data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete data_param_;
   }
   if (data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::DataParameter>::GetOwningArena(data_param);
     if (message_arena != submessage_arena) {
-      data_param = ::google::protobuf::internal::GetOwnedMessage(
+      data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, data_param, submessage_arena);
     }
-    set_has_data_param();
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_data_param();
+    _has_bits_[0] &= ~0x00000010u;
   }
   data_param_ = data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.data_param)
 }
 
 // optional .opencv_caffe.DropoutParameter dropout_param = 12;
-inline bool V1LayerParameter::has_dropout_param() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool V1LayerParameter::_internal_has_dropout_param() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  PROTOBUF_ASSUME(!value || dropout_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_dropout_param() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool V1LayerParameter::has_dropout_param() const {
+  return _internal_has_dropout_param();
 }
-inline void V1LayerParameter::clear_has_dropout_param() {
+inline void V1LayerParameter::clear_dropout_param() {
+  if (dropout_param_ != nullptr) dropout_param_->Clear();
   _has_bits_[0] &= ~0x00000020u;
 }
-inline void V1LayerParameter::clear_dropout_param() {
-  if (dropout_param_ != NULL) dropout_param_->Clear();
-  clear_has_dropout_param();
+inline const ::opencv_caffe::DropoutParameter& V1LayerParameter::_internal_dropout_param() const {
+  const ::opencv_caffe::DropoutParameter* p = dropout_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::DropoutParameter&>(
+      ::opencv_caffe::_DropoutParameter_default_instance_);
 }
 inline const ::opencv_caffe::DropoutParameter& V1LayerParameter::dropout_param() const {
-  const ::opencv_caffe::DropoutParameter* p = dropout_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.dropout_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::DropoutParameter*>(
-      &::opencv_caffe::_DropoutParameter_default_instance_);
+  return _internal_dropout_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_dropout_param(
+    ::opencv_caffe::DropoutParameter* dropout_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(dropout_param_);
+  }
+  dropout_param_ = dropout_param;
+  if (dropout_param) {
+    _has_bits_[0] |= 0x00000020u;
+  } else {
+    _has_bits_[0] &= ~0x00000020u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.dropout_param)
 }
 inline ::opencv_caffe::DropoutParameter* V1LayerParameter::release_dropout_param() {
+  _has_bits_[0] &= ~0x00000020u;
+  ::opencv_caffe::DropoutParameter* temp = dropout_param_;
+  dropout_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::DropoutParameter* V1LayerParameter::unsafe_arena_release_dropout_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.dropout_param)
-  clear_has_dropout_param();
+  _has_bits_[0] &= ~0x00000020u;
   ::opencv_caffe::DropoutParameter* temp = dropout_param_;
-  dropout_param_ = NULL;
+  dropout_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() {
-  set_has_dropout_param();
-  if (dropout_param_ == NULL) {
-    dropout_param_ = new ::opencv_caffe::DropoutParameter;
+inline ::opencv_caffe::DropoutParameter* V1LayerParameter::_internal_mutable_dropout_param() {
+  _has_bits_[0] |= 0x00000020u;
+  if (dropout_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::DropoutParameter>(GetArenaForAllocation());
+    dropout_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.dropout_param)
   return dropout_param_;
 }
+inline ::opencv_caffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() {
+  ::opencv_caffe::DropoutParameter* _msg = _internal_mutable_dropout_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.dropout_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_dropout_param(::opencv_caffe::DropoutParameter* dropout_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete dropout_param_;
   }
   if (dropout_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::DropoutParameter>::GetOwningArena(dropout_param);
     if (message_arena != submessage_arena) {
-      dropout_param = ::google::protobuf::internal::GetOwnedMessage(
+      dropout_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, dropout_param, submessage_arena);
     }
-    set_has_dropout_param();
+    _has_bits_[0] |= 0x00000020u;
   } else {
-    clear_has_dropout_param();
+    _has_bits_[0] &= ~0x00000020u;
   }
   dropout_param_ = dropout_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.dropout_param)
 }
 
 // optional .opencv_caffe.DummyDataParameter dummy_data_param = 26;
-inline bool V1LayerParameter::has_dummy_data_param() const {
-  return (_has_bits_[0] & 0x00080000u) != 0;
+inline bool V1LayerParameter::_internal_has_dummy_data_param() const {
+  bool value = (_has_bits_[0] & 0x00080000u) != 0;
+  PROTOBUF_ASSUME(!value || dummy_data_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_dummy_data_param() {
-  _has_bits_[0] |= 0x00080000u;
+inline bool V1LayerParameter::has_dummy_data_param() const {
+  return _internal_has_dummy_data_param();
 }
-inline void V1LayerParameter::clear_has_dummy_data_param() {
+inline void V1LayerParameter::clear_dummy_data_param() {
+  if (dummy_data_param_ != nullptr) dummy_data_param_->Clear();
   _has_bits_[0] &= ~0x00080000u;
 }
-inline void V1LayerParameter::clear_dummy_data_param() {
-  if (dummy_data_param_ != NULL) dummy_data_param_->Clear();
-  clear_has_dummy_data_param();
+inline const ::opencv_caffe::DummyDataParameter& V1LayerParameter::_internal_dummy_data_param() const {
+  const ::opencv_caffe::DummyDataParameter* p = dummy_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::DummyDataParameter&>(
+      ::opencv_caffe::_DummyDataParameter_default_instance_);
 }
 inline const ::opencv_caffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const {
-  const ::opencv_caffe::DummyDataParameter* p = dummy_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.dummy_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::DummyDataParameter*>(
-      &::opencv_caffe::_DummyDataParameter_default_instance_);
+  return _internal_dummy_data_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_dummy_data_param(
+    ::opencv_caffe::DummyDataParameter* dummy_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(dummy_data_param_);
+  }
+  dummy_data_param_ = dummy_data_param;
+  if (dummy_data_param) {
+    _has_bits_[0] |= 0x00080000u;
+  } else {
+    _has_bits_[0] &= ~0x00080000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.dummy_data_param)
 }
 inline ::opencv_caffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() {
+  _has_bits_[0] &= ~0x00080000u;
+  ::opencv_caffe::DummyDataParameter* temp = dummy_data_param_;
+  dummy_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::DummyDataParameter* V1LayerParameter::unsafe_arena_release_dummy_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.dummy_data_param)
-  clear_has_dummy_data_param();
+  _has_bits_[0] &= ~0x00080000u;
   ::opencv_caffe::DummyDataParameter* temp = dummy_data_param_;
-  dummy_data_param_ = NULL;
+  dummy_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() {
-  set_has_dummy_data_param();
-  if (dummy_data_param_ == NULL) {
-    dummy_data_param_ = new ::opencv_caffe::DummyDataParameter;
+inline ::opencv_caffe::DummyDataParameter* V1LayerParameter::_internal_mutable_dummy_data_param() {
+  _has_bits_[0] |= 0x00080000u;
+  if (dummy_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::DummyDataParameter>(GetArenaForAllocation());
+    dummy_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.dummy_data_param)
   return dummy_data_param_;
 }
+inline ::opencv_caffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() {
+  ::opencv_caffe::DummyDataParameter* _msg = _internal_mutable_dummy_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.dummy_data_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_dummy_data_param(::opencv_caffe::DummyDataParameter* dummy_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete dummy_data_param_;
   }
   if (dummy_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::DummyDataParameter>::GetOwningArena(dummy_data_param);
     if (message_arena != submessage_arena) {
-      dummy_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      dummy_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, dummy_data_param, submessage_arena);
     }
-    set_has_dummy_data_param();
+    _has_bits_[0] |= 0x00080000u;
   } else {
-    clear_has_dummy_data_param();
+    _has_bits_[0] &= ~0x00080000u;
   }
   dummy_data_param_ = dummy_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.dummy_data_param)
 }
 
 // optional .opencv_caffe.EltwiseParameter eltwise_param = 24;
-inline bool V1LayerParameter::has_eltwise_param() const {
-  return (_has_bits_[0] & 0x00020000u) != 0;
+inline bool V1LayerParameter::_internal_has_eltwise_param() const {
+  bool value = (_has_bits_[0] & 0x00020000u) != 0;
+  PROTOBUF_ASSUME(!value || eltwise_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_eltwise_param() {
-  _has_bits_[0] |= 0x00020000u;
+inline bool V1LayerParameter::has_eltwise_param() const {
+  return _internal_has_eltwise_param();
 }
-inline void V1LayerParameter::clear_has_eltwise_param() {
+inline void V1LayerParameter::clear_eltwise_param() {
+  if (eltwise_param_ != nullptr) eltwise_param_->Clear();
   _has_bits_[0] &= ~0x00020000u;
 }
-inline void V1LayerParameter::clear_eltwise_param() {
-  if (eltwise_param_ != NULL) eltwise_param_->Clear();
-  clear_has_eltwise_param();
+inline const ::opencv_caffe::EltwiseParameter& V1LayerParameter::_internal_eltwise_param() const {
+  const ::opencv_caffe::EltwiseParameter* p = eltwise_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::EltwiseParameter&>(
+      ::opencv_caffe::_EltwiseParameter_default_instance_);
 }
 inline const ::opencv_caffe::EltwiseParameter& V1LayerParameter::eltwise_param() const {
-  const ::opencv_caffe::EltwiseParameter* p = eltwise_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.eltwise_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::EltwiseParameter*>(
-      &::opencv_caffe::_EltwiseParameter_default_instance_);
+  return _internal_eltwise_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_eltwise_param(
+    ::opencv_caffe::EltwiseParameter* eltwise_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(eltwise_param_);
+  }
+  eltwise_param_ = eltwise_param;
+  if (eltwise_param) {
+    _has_bits_[0] |= 0x00020000u;
+  } else {
+    _has_bits_[0] &= ~0x00020000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.eltwise_param)
 }
 inline ::opencv_caffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() {
+  _has_bits_[0] &= ~0x00020000u;
+  ::opencv_caffe::EltwiseParameter* temp = eltwise_param_;
+  eltwise_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::EltwiseParameter* V1LayerParameter::unsafe_arena_release_eltwise_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.eltwise_param)
-  clear_has_eltwise_param();
+  _has_bits_[0] &= ~0x00020000u;
   ::opencv_caffe::EltwiseParameter* temp = eltwise_param_;
-  eltwise_param_ = NULL;
+  eltwise_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() {
-  set_has_eltwise_param();
-  if (eltwise_param_ == NULL) {
-    eltwise_param_ = new ::opencv_caffe::EltwiseParameter;
+inline ::opencv_caffe::EltwiseParameter* V1LayerParameter::_internal_mutable_eltwise_param() {
+  _has_bits_[0] |= 0x00020000u;
+  if (eltwise_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::EltwiseParameter>(GetArenaForAllocation());
+    eltwise_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.eltwise_param)
   return eltwise_param_;
 }
+inline ::opencv_caffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() {
+  ::opencv_caffe::EltwiseParameter* _msg = _internal_mutable_eltwise_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.eltwise_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_eltwise_param(::opencv_caffe::EltwiseParameter* eltwise_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete eltwise_param_;
   }
   if (eltwise_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::EltwiseParameter>::GetOwningArena(eltwise_param);
     if (message_arena != submessage_arena) {
-      eltwise_param = ::google::protobuf::internal::GetOwnedMessage(
+      eltwise_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, eltwise_param, submessage_arena);
     }
-    set_has_eltwise_param();
+    _has_bits_[0] |= 0x00020000u;
   } else {
-    clear_has_eltwise_param();
+    _has_bits_[0] &= ~0x00020000u;
   }
   eltwise_param_ = eltwise_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.eltwise_param)
 }
 
 // optional .opencv_caffe.ExpParameter exp_param = 41;
-inline bool V1LayerParameter::has_exp_param() const {
-  return (_has_bits_[0] & 0x40000000u) != 0;
+inline bool V1LayerParameter::_internal_has_exp_param() const {
+  bool value = (_has_bits_[0] & 0x40000000u) != 0;
+  PROTOBUF_ASSUME(!value || exp_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_exp_param() {
-  _has_bits_[0] |= 0x40000000u;
+inline bool V1LayerParameter::has_exp_param() const {
+  return _internal_has_exp_param();
 }
-inline void V1LayerParameter::clear_has_exp_param() {
+inline void V1LayerParameter::clear_exp_param() {
+  if (exp_param_ != nullptr) exp_param_->Clear();
   _has_bits_[0] &= ~0x40000000u;
 }
-inline void V1LayerParameter::clear_exp_param() {
-  if (exp_param_ != NULL) exp_param_->Clear();
-  clear_has_exp_param();
+inline const ::opencv_caffe::ExpParameter& V1LayerParameter::_internal_exp_param() const {
+  const ::opencv_caffe::ExpParameter* p = exp_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ExpParameter&>(
+      ::opencv_caffe::_ExpParameter_default_instance_);
 }
 inline const ::opencv_caffe::ExpParameter& V1LayerParameter::exp_param() const {
-  const ::opencv_caffe::ExpParameter* p = exp_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.exp_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ExpParameter*>(
-      &::opencv_caffe::_ExpParameter_default_instance_);
+  return _internal_exp_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_exp_param(
+    ::opencv_caffe::ExpParameter* exp_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(exp_param_);
+  }
+  exp_param_ = exp_param;
+  if (exp_param) {
+    _has_bits_[0] |= 0x40000000u;
+  } else {
+    _has_bits_[0] &= ~0x40000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.exp_param)
 }
 inline ::opencv_caffe::ExpParameter* V1LayerParameter::release_exp_param() {
+  _has_bits_[0] &= ~0x40000000u;
+  ::opencv_caffe::ExpParameter* temp = exp_param_;
+  exp_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ExpParameter* V1LayerParameter::unsafe_arena_release_exp_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.exp_param)
-  clear_has_exp_param();
+  _has_bits_[0] &= ~0x40000000u;
   ::opencv_caffe::ExpParameter* temp = exp_param_;
-  exp_param_ = NULL;
+  exp_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ExpParameter* V1LayerParameter::mutable_exp_param() {
-  set_has_exp_param();
-  if (exp_param_ == NULL) {
-    exp_param_ = new ::opencv_caffe::ExpParameter;
+inline ::opencv_caffe::ExpParameter* V1LayerParameter::_internal_mutable_exp_param() {
+  _has_bits_[0] |= 0x40000000u;
+  if (exp_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ExpParameter>(GetArenaForAllocation());
+    exp_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.exp_param)
   return exp_param_;
 }
+inline ::opencv_caffe::ExpParameter* V1LayerParameter::mutable_exp_param() {
+  ::opencv_caffe::ExpParameter* _msg = _internal_mutable_exp_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.exp_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_exp_param(::opencv_caffe::ExpParameter* exp_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete exp_param_;
   }
   if (exp_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ExpParameter>::GetOwningArena(exp_param);
     if (message_arena != submessage_arena) {
-      exp_param = ::google::protobuf::internal::GetOwnedMessage(
+      exp_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, exp_param, submessage_arena);
     }
-    set_has_exp_param();
+    _has_bits_[0] |= 0x40000000u;
   } else {
-    clear_has_exp_param();
+    _has_bits_[0] &= ~0x40000000u;
   }
   exp_param_ = exp_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.exp_param)
 }
 
 // optional .opencv_caffe.HDF5DataParameter hdf5_data_param = 13;
-inline bool V1LayerParameter::has_hdf5_data_param() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+inline bool V1LayerParameter::_internal_has_hdf5_data_param() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  PROTOBUF_ASSUME(!value || hdf5_data_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_hdf5_data_param() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool V1LayerParameter::has_hdf5_data_param() const {
+  return _internal_has_hdf5_data_param();
 }
-inline void V1LayerParameter::clear_has_hdf5_data_param() {
+inline void V1LayerParameter::clear_hdf5_data_param() {
+  if (hdf5_data_param_ != nullptr) hdf5_data_param_->Clear();
   _has_bits_[0] &= ~0x00000040u;
 }
-inline void V1LayerParameter::clear_hdf5_data_param() {
-  if (hdf5_data_param_ != NULL) hdf5_data_param_->Clear();
-  clear_has_hdf5_data_param();
+inline const ::opencv_caffe::HDF5DataParameter& V1LayerParameter::_internal_hdf5_data_param() const {
+  const ::opencv_caffe::HDF5DataParameter* p = hdf5_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::HDF5DataParameter&>(
+      ::opencv_caffe::_HDF5DataParameter_default_instance_);
 }
 inline const ::opencv_caffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const {
-  const ::opencv_caffe::HDF5DataParameter* p = hdf5_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.hdf5_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::HDF5DataParameter*>(
-      &::opencv_caffe::_HDF5DataParameter_default_instance_);
+  return _internal_hdf5_data_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_hdf5_data_param(
+    ::opencv_caffe::HDF5DataParameter* hdf5_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(hdf5_data_param_);
+  }
+  hdf5_data_param_ = hdf5_data_param;
+  if (hdf5_data_param) {
+    _has_bits_[0] |= 0x00000040u;
+  } else {
+    _has_bits_[0] &= ~0x00000040u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.hdf5_data_param)
 }
 inline ::opencv_caffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() {
+  _has_bits_[0] &= ~0x00000040u;
+  ::opencv_caffe::HDF5DataParameter* temp = hdf5_data_param_;
+  hdf5_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::HDF5DataParameter* V1LayerParameter::unsafe_arena_release_hdf5_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.hdf5_data_param)
-  clear_has_hdf5_data_param();
+  _has_bits_[0] &= ~0x00000040u;
   ::opencv_caffe::HDF5DataParameter* temp = hdf5_data_param_;
-  hdf5_data_param_ = NULL;
+  hdf5_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() {
-  set_has_hdf5_data_param();
-  if (hdf5_data_param_ == NULL) {
-    hdf5_data_param_ = new ::opencv_caffe::HDF5DataParameter;
+inline ::opencv_caffe::HDF5DataParameter* V1LayerParameter::_internal_mutable_hdf5_data_param() {
+  _has_bits_[0] |= 0x00000040u;
+  if (hdf5_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::HDF5DataParameter>(GetArenaForAllocation());
+    hdf5_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.hdf5_data_param)
   return hdf5_data_param_;
 }
+inline ::opencv_caffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() {
+  ::opencv_caffe::HDF5DataParameter* _msg = _internal_mutable_hdf5_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.hdf5_data_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_hdf5_data_param(::opencv_caffe::HDF5DataParameter* hdf5_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete hdf5_data_param_;
   }
   if (hdf5_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::HDF5DataParameter>::GetOwningArena(hdf5_data_param);
     if (message_arena != submessage_arena) {
-      hdf5_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      hdf5_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, hdf5_data_param, submessage_arena);
     }
-    set_has_hdf5_data_param();
+    _has_bits_[0] |= 0x00000040u;
   } else {
-    clear_has_hdf5_data_param();
+    _has_bits_[0] &= ~0x00000040u;
   }
   hdf5_data_param_ = hdf5_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.hdf5_data_param)
 }
 
 // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 14;
-inline bool V1LayerParameter::has_hdf5_output_param() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
+inline bool V1LayerParameter::_internal_has_hdf5_output_param() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  PROTOBUF_ASSUME(!value || hdf5_output_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_hdf5_output_param() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool V1LayerParameter::has_hdf5_output_param() const {
+  return _internal_has_hdf5_output_param();
 }
-inline void V1LayerParameter::clear_has_hdf5_output_param() {
+inline void V1LayerParameter::clear_hdf5_output_param() {
+  if (hdf5_output_param_ != nullptr) hdf5_output_param_->Clear();
   _has_bits_[0] &= ~0x00000080u;
 }
-inline void V1LayerParameter::clear_hdf5_output_param() {
-  if (hdf5_output_param_ != NULL) hdf5_output_param_->Clear();
-  clear_has_hdf5_output_param();
+inline const ::opencv_caffe::HDF5OutputParameter& V1LayerParameter::_internal_hdf5_output_param() const {
+  const ::opencv_caffe::HDF5OutputParameter* p = hdf5_output_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::HDF5OutputParameter&>(
+      ::opencv_caffe::_HDF5OutputParameter_default_instance_);
 }
 inline const ::opencv_caffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const {
-  const ::opencv_caffe::HDF5OutputParameter* p = hdf5_output_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.hdf5_output_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::HDF5OutputParameter*>(
-      &::opencv_caffe::_HDF5OutputParameter_default_instance_);
+  return _internal_hdf5_output_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_hdf5_output_param(
+    ::opencv_caffe::HDF5OutputParameter* hdf5_output_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(hdf5_output_param_);
+  }
+  hdf5_output_param_ = hdf5_output_param;
+  if (hdf5_output_param) {
+    _has_bits_[0] |= 0x00000080u;
+  } else {
+    _has_bits_[0] &= ~0x00000080u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.hdf5_output_param)
 }
 inline ::opencv_caffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() {
+  _has_bits_[0] &= ~0x00000080u;
+  ::opencv_caffe::HDF5OutputParameter* temp = hdf5_output_param_;
+  hdf5_output_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::HDF5OutputParameter* V1LayerParameter::unsafe_arena_release_hdf5_output_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.hdf5_output_param)
-  clear_has_hdf5_output_param();
+  _has_bits_[0] &= ~0x00000080u;
   ::opencv_caffe::HDF5OutputParameter* temp = hdf5_output_param_;
-  hdf5_output_param_ = NULL;
+  hdf5_output_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() {
-  set_has_hdf5_output_param();
-  if (hdf5_output_param_ == NULL) {
-    hdf5_output_param_ = new ::opencv_caffe::HDF5OutputParameter;
+inline ::opencv_caffe::HDF5OutputParameter* V1LayerParameter::_internal_mutable_hdf5_output_param() {
+  _has_bits_[0] |= 0x00000080u;
+  if (hdf5_output_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::HDF5OutputParameter>(GetArenaForAllocation());
+    hdf5_output_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.hdf5_output_param)
   return hdf5_output_param_;
 }
+inline ::opencv_caffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() {
+  ::opencv_caffe::HDF5OutputParameter* _msg = _internal_mutable_hdf5_output_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.hdf5_output_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_hdf5_output_param(::opencv_caffe::HDF5OutputParameter* hdf5_output_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete hdf5_output_param_;
   }
   if (hdf5_output_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::HDF5OutputParameter>::GetOwningArena(hdf5_output_param);
     if (message_arena != submessage_arena) {
-      hdf5_output_param = ::google::protobuf::internal::GetOwnedMessage(
+      hdf5_output_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, hdf5_output_param, submessage_arena);
     }
-    set_has_hdf5_output_param();
+    _has_bits_[0] |= 0x00000080u;
   } else {
-    clear_has_hdf5_output_param();
+    _has_bits_[0] &= ~0x00000080u;
   }
   hdf5_output_param_ = hdf5_output_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.hdf5_output_param)
 }
 
 // optional .opencv_caffe.HingeLossParameter hinge_loss_param = 29;
-inline bool V1LayerParameter::has_hinge_loss_param() const {
-  return (_has_bits_[0] & 0x00200000u) != 0;
+inline bool V1LayerParameter::_internal_has_hinge_loss_param() const {
+  bool value = (_has_bits_[0] & 0x00200000u) != 0;
+  PROTOBUF_ASSUME(!value || hinge_loss_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_hinge_loss_param() {
-  _has_bits_[0] |= 0x00200000u;
+inline bool V1LayerParameter::has_hinge_loss_param() const {
+  return _internal_has_hinge_loss_param();
 }
-inline void V1LayerParameter::clear_has_hinge_loss_param() {
+inline void V1LayerParameter::clear_hinge_loss_param() {
+  if (hinge_loss_param_ != nullptr) hinge_loss_param_->Clear();
   _has_bits_[0] &= ~0x00200000u;
 }
-inline void V1LayerParameter::clear_hinge_loss_param() {
-  if (hinge_loss_param_ != NULL) hinge_loss_param_->Clear();
-  clear_has_hinge_loss_param();
+inline const ::opencv_caffe::HingeLossParameter& V1LayerParameter::_internal_hinge_loss_param() const {
+  const ::opencv_caffe::HingeLossParameter* p = hinge_loss_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::HingeLossParameter&>(
+      ::opencv_caffe::_HingeLossParameter_default_instance_);
 }
 inline const ::opencv_caffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const {
-  const ::opencv_caffe::HingeLossParameter* p = hinge_loss_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.hinge_loss_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::HingeLossParameter*>(
-      &::opencv_caffe::_HingeLossParameter_default_instance_);
+  return _internal_hinge_loss_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_hinge_loss_param(
+    ::opencv_caffe::HingeLossParameter* hinge_loss_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(hinge_loss_param_);
+  }
+  hinge_loss_param_ = hinge_loss_param;
+  if (hinge_loss_param) {
+    _has_bits_[0] |= 0x00200000u;
+  } else {
+    _has_bits_[0] &= ~0x00200000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.hinge_loss_param)
+}
+inline ::opencv_caffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() {
+  _has_bits_[0] &= ~0x00200000u;
+  ::opencv_caffe::HingeLossParameter* temp = hinge_loss_param_;
+  hinge_loss_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
 }
-inline ::opencv_caffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() {
+inline ::opencv_caffe::HingeLossParameter* V1LayerParameter::unsafe_arena_release_hinge_loss_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.hinge_loss_param)
-  clear_has_hinge_loss_param();
+  _has_bits_[0] &= ~0x00200000u;
   ::opencv_caffe::HingeLossParameter* temp = hinge_loss_param_;
-  hinge_loss_param_ = NULL;
+  hinge_loss_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() {
-  set_has_hinge_loss_param();
-  if (hinge_loss_param_ == NULL) {
-    hinge_loss_param_ = new ::opencv_caffe::HingeLossParameter;
+inline ::opencv_caffe::HingeLossParameter* V1LayerParameter::_internal_mutable_hinge_loss_param() {
+  _has_bits_[0] |= 0x00200000u;
+  if (hinge_loss_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::HingeLossParameter>(GetArenaForAllocation());
+    hinge_loss_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.hinge_loss_param)
   return hinge_loss_param_;
 }
+inline ::opencv_caffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() {
+  ::opencv_caffe::HingeLossParameter* _msg = _internal_mutable_hinge_loss_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.hinge_loss_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_hinge_loss_param(::opencv_caffe::HingeLossParameter* hinge_loss_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete hinge_loss_param_;
   }
   if (hinge_loss_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::HingeLossParameter>::GetOwningArena(hinge_loss_param);
     if (message_arena != submessage_arena) {
-      hinge_loss_param = ::google::protobuf::internal::GetOwnedMessage(
+      hinge_loss_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, hinge_loss_param, submessage_arena);
     }
-    set_has_hinge_loss_param();
+    _has_bits_[0] |= 0x00200000u;
   } else {
-    clear_has_hinge_loss_param();
+    _has_bits_[0] &= ~0x00200000u;
   }
   hinge_loss_param_ = hinge_loss_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.hinge_loss_param)
 }
 
 // optional .opencv_caffe.ImageDataParameter image_data_param = 15;
-inline bool V1LayerParameter::has_image_data_param() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
+inline bool V1LayerParameter::_internal_has_image_data_param() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  PROTOBUF_ASSUME(!value || image_data_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_image_data_param() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool V1LayerParameter::has_image_data_param() const {
+  return _internal_has_image_data_param();
 }
-inline void V1LayerParameter::clear_has_image_data_param() {
+inline void V1LayerParameter::clear_image_data_param() {
+  if (image_data_param_ != nullptr) image_data_param_->Clear();
   _has_bits_[0] &= ~0x00000100u;
 }
-inline void V1LayerParameter::clear_image_data_param() {
-  if (image_data_param_ != NULL) image_data_param_->Clear();
-  clear_has_image_data_param();
+inline const ::opencv_caffe::ImageDataParameter& V1LayerParameter::_internal_image_data_param() const {
+  const ::opencv_caffe::ImageDataParameter* p = image_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ImageDataParameter&>(
+      ::opencv_caffe::_ImageDataParameter_default_instance_);
 }
 inline const ::opencv_caffe::ImageDataParameter& V1LayerParameter::image_data_param() const {
-  const ::opencv_caffe::ImageDataParameter* p = image_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.image_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ImageDataParameter*>(
-      &::opencv_caffe::_ImageDataParameter_default_instance_);
+  return _internal_image_data_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_image_data_param(
+    ::opencv_caffe::ImageDataParameter* image_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(image_data_param_);
+  }
+  image_data_param_ = image_data_param;
+  if (image_data_param) {
+    _has_bits_[0] |= 0x00000100u;
+  } else {
+    _has_bits_[0] &= ~0x00000100u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.image_data_param)
 }
 inline ::opencv_caffe::ImageDataParameter* V1LayerParameter::release_image_data_param() {
+  _has_bits_[0] &= ~0x00000100u;
+  ::opencv_caffe::ImageDataParameter* temp = image_data_param_;
+  image_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ImageDataParameter* V1LayerParameter::unsafe_arena_release_image_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.image_data_param)
-  clear_has_image_data_param();
+  _has_bits_[0] &= ~0x00000100u;
   ::opencv_caffe::ImageDataParameter* temp = image_data_param_;
-  image_data_param_ = NULL;
+  image_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() {
-  set_has_image_data_param();
-  if (image_data_param_ == NULL) {
-    image_data_param_ = new ::opencv_caffe::ImageDataParameter;
+inline ::opencv_caffe::ImageDataParameter* V1LayerParameter::_internal_mutable_image_data_param() {
+  _has_bits_[0] |= 0x00000100u;
+  if (image_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ImageDataParameter>(GetArenaForAllocation());
+    image_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.image_data_param)
   return image_data_param_;
 }
+inline ::opencv_caffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() {
+  ::opencv_caffe::ImageDataParameter* _msg = _internal_mutable_image_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.image_data_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_image_data_param(::opencv_caffe::ImageDataParameter* image_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete image_data_param_;
   }
   if (image_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ImageDataParameter>::GetOwningArena(image_data_param);
     if (message_arena != submessage_arena) {
-      image_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      image_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, image_data_param, submessage_arena);
     }
-    set_has_image_data_param();
+    _has_bits_[0] |= 0x00000100u;
   } else {
-    clear_has_image_data_param();
+    _has_bits_[0] &= ~0x00000100u;
   }
   image_data_param_ = image_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.image_data_param)
 }
 
 // optional .opencv_caffe.InfogainLossParameter infogain_loss_param = 16;
-inline bool V1LayerParameter::has_infogain_loss_param() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
+inline bool V1LayerParameter::_internal_has_infogain_loss_param() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  PROTOBUF_ASSUME(!value || infogain_loss_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_infogain_loss_param() {
-  _has_bits_[0] |= 0x00000200u;
+inline bool V1LayerParameter::has_infogain_loss_param() const {
+  return _internal_has_infogain_loss_param();
 }
-inline void V1LayerParameter::clear_has_infogain_loss_param() {
+inline void V1LayerParameter::clear_infogain_loss_param() {
+  if (infogain_loss_param_ != nullptr) infogain_loss_param_->Clear();
   _has_bits_[0] &= ~0x00000200u;
 }
-inline void V1LayerParameter::clear_infogain_loss_param() {
-  if (infogain_loss_param_ != NULL) infogain_loss_param_->Clear();
-  clear_has_infogain_loss_param();
+inline const ::opencv_caffe::InfogainLossParameter& V1LayerParameter::_internal_infogain_loss_param() const {
+  const ::opencv_caffe::InfogainLossParameter* p = infogain_loss_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::InfogainLossParameter&>(
+      ::opencv_caffe::_InfogainLossParameter_default_instance_);
 }
 inline const ::opencv_caffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const {
-  const ::opencv_caffe::InfogainLossParameter* p = infogain_loss_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.infogain_loss_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::InfogainLossParameter*>(
-      &::opencv_caffe::_InfogainLossParameter_default_instance_);
+  return _internal_infogain_loss_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_infogain_loss_param(
+    ::opencv_caffe::InfogainLossParameter* infogain_loss_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(infogain_loss_param_);
+  }
+  infogain_loss_param_ = infogain_loss_param;
+  if (infogain_loss_param) {
+    _has_bits_[0] |= 0x00000200u;
+  } else {
+    _has_bits_[0] &= ~0x00000200u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.infogain_loss_param)
 }
 inline ::opencv_caffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() {
+  _has_bits_[0] &= ~0x00000200u;
+  ::opencv_caffe::InfogainLossParameter* temp = infogain_loss_param_;
+  infogain_loss_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::InfogainLossParameter* V1LayerParameter::unsafe_arena_release_infogain_loss_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.infogain_loss_param)
-  clear_has_infogain_loss_param();
+  _has_bits_[0] &= ~0x00000200u;
   ::opencv_caffe::InfogainLossParameter* temp = infogain_loss_param_;
-  infogain_loss_param_ = NULL;
+  infogain_loss_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() {
-  set_has_infogain_loss_param();
-  if (infogain_loss_param_ == NULL) {
-    infogain_loss_param_ = new ::opencv_caffe::InfogainLossParameter;
+inline ::opencv_caffe::InfogainLossParameter* V1LayerParameter::_internal_mutable_infogain_loss_param() {
+  _has_bits_[0] |= 0x00000200u;
+  if (infogain_loss_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::InfogainLossParameter>(GetArenaForAllocation());
+    infogain_loss_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.infogain_loss_param)
   return infogain_loss_param_;
 }
+inline ::opencv_caffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() {
+  ::opencv_caffe::InfogainLossParameter* _msg = _internal_mutable_infogain_loss_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.infogain_loss_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_infogain_loss_param(::opencv_caffe::InfogainLossParameter* infogain_loss_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete infogain_loss_param_;
   }
   if (infogain_loss_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::InfogainLossParameter>::GetOwningArena(infogain_loss_param);
     if (message_arena != submessage_arena) {
-      infogain_loss_param = ::google::protobuf::internal::GetOwnedMessage(
+      infogain_loss_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, infogain_loss_param, submessage_arena);
     }
-    set_has_infogain_loss_param();
+    _has_bits_[0] |= 0x00000200u;
   } else {
-    clear_has_infogain_loss_param();
+    _has_bits_[0] &= ~0x00000200u;
   }
   infogain_loss_param_ = infogain_loss_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.infogain_loss_param)
 }
 
 // optional .opencv_caffe.InnerProductParameter inner_product_param = 17;
-inline bool V1LayerParameter::has_inner_product_param() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+inline bool V1LayerParameter::_internal_has_inner_product_param() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  PROTOBUF_ASSUME(!value || inner_product_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_inner_product_param() {
-  _has_bits_[0] |= 0x00000400u;
+inline bool V1LayerParameter::has_inner_product_param() const {
+  return _internal_has_inner_product_param();
 }
-inline void V1LayerParameter::clear_has_inner_product_param() {
+inline void V1LayerParameter::clear_inner_product_param() {
+  if (inner_product_param_ != nullptr) inner_product_param_->Clear();
   _has_bits_[0] &= ~0x00000400u;
 }
-inline void V1LayerParameter::clear_inner_product_param() {
-  if (inner_product_param_ != NULL) inner_product_param_->Clear();
-  clear_has_inner_product_param();
+inline const ::opencv_caffe::InnerProductParameter& V1LayerParameter::_internal_inner_product_param() const {
+  const ::opencv_caffe::InnerProductParameter* p = inner_product_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::InnerProductParameter&>(
+      ::opencv_caffe::_InnerProductParameter_default_instance_);
 }
 inline const ::opencv_caffe::InnerProductParameter& V1LayerParameter::inner_product_param() const {
-  const ::opencv_caffe::InnerProductParameter* p = inner_product_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.inner_product_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::InnerProductParameter*>(
-      &::opencv_caffe::_InnerProductParameter_default_instance_);
+  return _internal_inner_product_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_inner_product_param(
+    ::opencv_caffe::InnerProductParameter* inner_product_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(inner_product_param_);
+  }
+  inner_product_param_ = inner_product_param;
+  if (inner_product_param) {
+    _has_bits_[0] |= 0x00000400u;
+  } else {
+    _has_bits_[0] &= ~0x00000400u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.inner_product_param)
 }
 inline ::opencv_caffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() {
+  _has_bits_[0] &= ~0x00000400u;
+  ::opencv_caffe::InnerProductParameter* temp = inner_product_param_;
+  inner_product_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::InnerProductParameter* V1LayerParameter::unsafe_arena_release_inner_product_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.inner_product_param)
-  clear_has_inner_product_param();
+  _has_bits_[0] &= ~0x00000400u;
   ::opencv_caffe::InnerProductParameter* temp = inner_product_param_;
-  inner_product_param_ = NULL;
+  inner_product_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() {
-  set_has_inner_product_param();
-  if (inner_product_param_ == NULL) {
-    inner_product_param_ = new ::opencv_caffe::InnerProductParameter;
+inline ::opencv_caffe::InnerProductParameter* V1LayerParameter::_internal_mutable_inner_product_param() {
+  _has_bits_[0] |= 0x00000400u;
+  if (inner_product_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::InnerProductParameter>(GetArenaForAllocation());
+    inner_product_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.inner_product_param)
   return inner_product_param_;
 }
+inline ::opencv_caffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() {
+  ::opencv_caffe::InnerProductParameter* _msg = _internal_mutable_inner_product_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.inner_product_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_inner_product_param(::opencv_caffe::InnerProductParameter* inner_product_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete inner_product_param_;
   }
   if (inner_product_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::InnerProductParameter>::GetOwningArena(inner_product_param);
     if (message_arena != submessage_arena) {
-      inner_product_param = ::google::protobuf::internal::GetOwnedMessage(
+      inner_product_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, inner_product_param, submessage_arena);
     }
-    set_has_inner_product_param();
+    _has_bits_[0] |= 0x00000400u;
   } else {
-    clear_has_inner_product_param();
+    _has_bits_[0] &= ~0x00000400u;
   }
   inner_product_param_ = inner_product_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.inner_product_param)
 }
 
 // optional .opencv_caffe.LRNParameter lrn_param = 18;
-inline bool V1LayerParameter::has_lrn_param() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
+inline bool V1LayerParameter::_internal_has_lrn_param() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  PROTOBUF_ASSUME(!value || lrn_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_lrn_param() {
-  _has_bits_[0] |= 0x00000800u;
+inline bool V1LayerParameter::has_lrn_param() const {
+  return _internal_has_lrn_param();
 }
-inline void V1LayerParameter::clear_has_lrn_param() {
+inline void V1LayerParameter::clear_lrn_param() {
+  if (lrn_param_ != nullptr) lrn_param_->Clear();
   _has_bits_[0] &= ~0x00000800u;
 }
-inline void V1LayerParameter::clear_lrn_param() {
-  if (lrn_param_ != NULL) lrn_param_->Clear();
-  clear_has_lrn_param();
+inline const ::opencv_caffe::LRNParameter& V1LayerParameter::_internal_lrn_param() const {
+  const ::opencv_caffe::LRNParameter* p = lrn_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::LRNParameter&>(
+      ::opencv_caffe::_LRNParameter_default_instance_);
 }
 inline const ::opencv_caffe::LRNParameter& V1LayerParameter::lrn_param() const {
-  const ::opencv_caffe::LRNParameter* p = lrn_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.lrn_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::LRNParameter*>(
-      &::opencv_caffe::_LRNParameter_default_instance_);
+  return _internal_lrn_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_lrn_param(
+    ::opencv_caffe::LRNParameter* lrn_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(lrn_param_);
+  }
+  lrn_param_ = lrn_param;
+  if (lrn_param) {
+    _has_bits_[0] |= 0x00000800u;
+  } else {
+    _has_bits_[0] &= ~0x00000800u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.lrn_param)
 }
 inline ::opencv_caffe::LRNParameter* V1LayerParameter::release_lrn_param() {
+  _has_bits_[0] &= ~0x00000800u;
+  ::opencv_caffe::LRNParameter* temp = lrn_param_;
+  lrn_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::LRNParameter* V1LayerParameter::unsafe_arena_release_lrn_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.lrn_param)
-  clear_has_lrn_param();
+  _has_bits_[0] &= ~0x00000800u;
   ::opencv_caffe::LRNParameter* temp = lrn_param_;
-  lrn_param_ = NULL;
+  lrn_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::LRNParameter* V1LayerParameter::mutable_lrn_param() {
-  set_has_lrn_param();
-  if (lrn_param_ == NULL) {
-    lrn_param_ = new ::opencv_caffe::LRNParameter;
+inline ::opencv_caffe::LRNParameter* V1LayerParameter::_internal_mutable_lrn_param() {
+  _has_bits_[0] |= 0x00000800u;
+  if (lrn_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::LRNParameter>(GetArenaForAllocation());
+    lrn_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.lrn_param)
   return lrn_param_;
 }
+inline ::opencv_caffe::LRNParameter* V1LayerParameter::mutable_lrn_param() {
+  ::opencv_caffe::LRNParameter* _msg = _internal_mutable_lrn_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.lrn_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_lrn_param(::opencv_caffe::LRNParameter* lrn_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete lrn_param_;
   }
   if (lrn_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::LRNParameter>::GetOwningArena(lrn_param);
     if (message_arena != submessage_arena) {
-      lrn_param = ::google::protobuf::internal::GetOwnedMessage(
+      lrn_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, lrn_param, submessage_arena);
     }
-    set_has_lrn_param();
+    _has_bits_[0] |= 0x00000800u;
   } else {
-    clear_has_lrn_param();
+    _has_bits_[0] &= ~0x00000800u;
   }
   lrn_param_ = lrn_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.lrn_param)
 }
 
 // optional .opencv_caffe.MemoryDataParameter memory_data_param = 22;
-inline bool V1LayerParameter::has_memory_data_param() const {
-  return (_has_bits_[0] & 0x00008000u) != 0;
+inline bool V1LayerParameter::_internal_has_memory_data_param() const {
+  bool value = (_has_bits_[0] & 0x00008000u) != 0;
+  PROTOBUF_ASSUME(!value || memory_data_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_memory_data_param() {
-  _has_bits_[0] |= 0x00008000u;
+inline bool V1LayerParameter::has_memory_data_param() const {
+  return _internal_has_memory_data_param();
 }
-inline void V1LayerParameter::clear_has_memory_data_param() {
+inline void V1LayerParameter::clear_memory_data_param() {
+  if (memory_data_param_ != nullptr) memory_data_param_->Clear();
   _has_bits_[0] &= ~0x00008000u;
 }
-inline void V1LayerParameter::clear_memory_data_param() {
-  if (memory_data_param_ != NULL) memory_data_param_->Clear();
-  clear_has_memory_data_param();
+inline const ::opencv_caffe::MemoryDataParameter& V1LayerParameter::_internal_memory_data_param() const {
+  const ::opencv_caffe::MemoryDataParameter* p = memory_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::MemoryDataParameter&>(
+      ::opencv_caffe::_MemoryDataParameter_default_instance_);
 }
 inline const ::opencv_caffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const {
-  const ::opencv_caffe::MemoryDataParameter* p = memory_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.memory_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::MemoryDataParameter*>(
-      &::opencv_caffe::_MemoryDataParameter_default_instance_);
+  return _internal_memory_data_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_memory_data_param(
+    ::opencv_caffe::MemoryDataParameter* memory_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(memory_data_param_);
+  }
+  memory_data_param_ = memory_data_param;
+  if (memory_data_param) {
+    _has_bits_[0] |= 0x00008000u;
+  } else {
+    _has_bits_[0] &= ~0x00008000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.memory_data_param)
 }
 inline ::opencv_caffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() {
+  _has_bits_[0] &= ~0x00008000u;
+  ::opencv_caffe::MemoryDataParameter* temp = memory_data_param_;
+  memory_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::MemoryDataParameter* V1LayerParameter::unsafe_arena_release_memory_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.memory_data_param)
-  clear_has_memory_data_param();
+  _has_bits_[0] &= ~0x00008000u;
   ::opencv_caffe::MemoryDataParameter* temp = memory_data_param_;
-  memory_data_param_ = NULL;
+  memory_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() {
-  set_has_memory_data_param();
-  if (memory_data_param_ == NULL) {
-    memory_data_param_ = new ::opencv_caffe::MemoryDataParameter;
+inline ::opencv_caffe::MemoryDataParameter* V1LayerParameter::_internal_mutable_memory_data_param() {
+  _has_bits_[0] |= 0x00008000u;
+  if (memory_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::MemoryDataParameter>(GetArenaForAllocation());
+    memory_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.memory_data_param)
   return memory_data_param_;
 }
+inline ::opencv_caffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() {
+  ::opencv_caffe::MemoryDataParameter* _msg = _internal_mutable_memory_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.memory_data_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_memory_data_param(::opencv_caffe::MemoryDataParameter* memory_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete memory_data_param_;
   }
   if (memory_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::MemoryDataParameter>::GetOwningArena(memory_data_param);
     if (message_arena != submessage_arena) {
-      memory_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      memory_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, memory_data_param, submessage_arena);
     }
-    set_has_memory_data_param();
+    _has_bits_[0] |= 0x00008000u;
   } else {
-    clear_has_memory_data_param();
+    _has_bits_[0] &= ~0x00008000u;
   }
   memory_data_param_ = memory_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.memory_data_param)
 }
 
 // optional .opencv_caffe.MVNParameter mvn_param = 34;
-inline bool V1LayerParameter::has_mvn_param() const {
-  return (_has_bits_[0] & 0x01000000u) != 0;
+inline bool V1LayerParameter::_internal_has_mvn_param() const {
+  bool value = (_has_bits_[0] & 0x01000000u) != 0;
+  PROTOBUF_ASSUME(!value || mvn_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_mvn_param() {
-  _has_bits_[0] |= 0x01000000u;
+inline bool V1LayerParameter::has_mvn_param() const {
+  return _internal_has_mvn_param();
 }
-inline void V1LayerParameter::clear_has_mvn_param() {
+inline void V1LayerParameter::clear_mvn_param() {
+  if (mvn_param_ != nullptr) mvn_param_->Clear();
   _has_bits_[0] &= ~0x01000000u;
 }
-inline void V1LayerParameter::clear_mvn_param() {
-  if (mvn_param_ != NULL) mvn_param_->Clear();
-  clear_has_mvn_param();
+inline const ::opencv_caffe::MVNParameter& V1LayerParameter::_internal_mvn_param() const {
+  const ::opencv_caffe::MVNParameter* p = mvn_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::MVNParameter&>(
+      ::opencv_caffe::_MVNParameter_default_instance_);
 }
 inline const ::opencv_caffe::MVNParameter& V1LayerParameter::mvn_param() const {
-  const ::opencv_caffe::MVNParameter* p = mvn_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.mvn_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::MVNParameter*>(
-      &::opencv_caffe::_MVNParameter_default_instance_);
+  return _internal_mvn_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_mvn_param(
+    ::opencv_caffe::MVNParameter* mvn_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(mvn_param_);
+  }
+  mvn_param_ = mvn_param;
+  if (mvn_param) {
+    _has_bits_[0] |= 0x01000000u;
+  } else {
+    _has_bits_[0] &= ~0x01000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.mvn_param)
 }
 inline ::opencv_caffe::MVNParameter* V1LayerParameter::release_mvn_param() {
+  _has_bits_[0] &= ~0x01000000u;
+  ::opencv_caffe::MVNParameter* temp = mvn_param_;
+  mvn_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::MVNParameter* V1LayerParameter::unsafe_arena_release_mvn_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.mvn_param)
-  clear_has_mvn_param();
+  _has_bits_[0] &= ~0x01000000u;
   ::opencv_caffe::MVNParameter* temp = mvn_param_;
-  mvn_param_ = NULL;
+  mvn_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::MVNParameter* V1LayerParameter::mutable_mvn_param() {
-  set_has_mvn_param();
-  if (mvn_param_ == NULL) {
-    mvn_param_ = new ::opencv_caffe::MVNParameter;
+inline ::opencv_caffe::MVNParameter* V1LayerParameter::_internal_mutable_mvn_param() {
+  _has_bits_[0] |= 0x01000000u;
+  if (mvn_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::MVNParameter>(GetArenaForAllocation());
+    mvn_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.mvn_param)
   return mvn_param_;
 }
+inline ::opencv_caffe::MVNParameter* V1LayerParameter::mutable_mvn_param() {
+  ::opencv_caffe::MVNParameter* _msg = _internal_mutable_mvn_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.mvn_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_mvn_param(::opencv_caffe::MVNParameter* mvn_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete mvn_param_;
   }
   if (mvn_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::MVNParameter>::GetOwningArena(mvn_param);
     if (message_arena != submessage_arena) {
-      mvn_param = ::google::protobuf::internal::GetOwnedMessage(
+      mvn_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, mvn_param, submessage_arena);
     }
-    set_has_mvn_param();
+    _has_bits_[0] |= 0x01000000u;
   } else {
-    clear_has_mvn_param();
+    _has_bits_[0] &= ~0x01000000u;
   }
   mvn_param_ = mvn_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.mvn_param)
 }
 
 // optional .opencv_caffe.PoolingParameter pooling_param = 19;
-inline bool V1LayerParameter::has_pooling_param() const {
-  return (_has_bits_[0] & 0x00001000u) != 0;
+inline bool V1LayerParameter::_internal_has_pooling_param() const {
+  bool value = (_has_bits_[0] & 0x00001000u) != 0;
+  PROTOBUF_ASSUME(!value || pooling_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_pooling_param() {
-  _has_bits_[0] |= 0x00001000u;
+inline bool V1LayerParameter::has_pooling_param() const {
+  return _internal_has_pooling_param();
 }
-inline void V1LayerParameter::clear_has_pooling_param() {
+inline void V1LayerParameter::clear_pooling_param() {
+  if (pooling_param_ != nullptr) pooling_param_->Clear();
   _has_bits_[0] &= ~0x00001000u;
 }
-inline void V1LayerParameter::clear_pooling_param() {
-  if (pooling_param_ != NULL) pooling_param_->Clear();
-  clear_has_pooling_param();
+inline const ::opencv_caffe::PoolingParameter& V1LayerParameter::_internal_pooling_param() const {
+  const ::opencv_caffe::PoolingParameter* p = pooling_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PoolingParameter&>(
+      ::opencv_caffe::_PoolingParameter_default_instance_);
 }
 inline const ::opencv_caffe::PoolingParameter& V1LayerParameter::pooling_param() const {
-  const ::opencv_caffe::PoolingParameter* p = pooling_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.pooling_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PoolingParameter*>(
-      &::opencv_caffe::_PoolingParameter_default_instance_);
+  return _internal_pooling_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_pooling_param(
+    ::opencv_caffe::PoolingParameter* pooling_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(pooling_param_);
+  }
+  pooling_param_ = pooling_param;
+  if (pooling_param) {
+    _has_bits_[0] |= 0x00001000u;
+  } else {
+    _has_bits_[0] &= ~0x00001000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.pooling_param)
 }
 inline ::opencv_caffe::PoolingParameter* V1LayerParameter::release_pooling_param() {
+  _has_bits_[0] &= ~0x00001000u;
+  ::opencv_caffe::PoolingParameter* temp = pooling_param_;
+  pooling_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PoolingParameter* V1LayerParameter::unsafe_arena_release_pooling_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.pooling_param)
-  clear_has_pooling_param();
+  _has_bits_[0] &= ~0x00001000u;
   ::opencv_caffe::PoolingParameter* temp = pooling_param_;
-  pooling_param_ = NULL;
+  pooling_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() {
-  set_has_pooling_param();
-  if (pooling_param_ == NULL) {
-    pooling_param_ = new ::opencv_caffe::PoolingParameter;
+inline ::opencv_caffe::PoolingParameter* V1LayerParameter::_internal_mutable_pooling_param() {
+  _has_bits_[0] |= 0x00001000u;
+  if (pooling_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PoolingParameter>(GetArenaForAllocation());
+    pooling_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.pooling_param)
   return pooling_param_;
 }
+inline ::opencv_caffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() {
+  ::opencv_caffe::PoolingParameter* _msg = _internal_mutable_pooling_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.pooling_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_pooling_param(::opencv_caffe::PoolingParameter* pooling_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete pooling_param_;
   }
   if (pooling_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PoolingParameter>::GetOwningArena(pooling_param);
     if (message_arena != submessage_arena) {
-      pooling_param = ::google::protobuf::internal::GetOwnedMessage(
+      pooling_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, pooling_param, submessage_arena);
     }
-    set_has_pooling_param();
+    _has_bits_[0] |= 0x00001000u;
   } else {
-    clear_has_pooling_param();
+    _has_bits_[0] &= ~0x00001000u;
   }
   pooling_param_ = pooling_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.pooling_param)
 }
 
 // optional .opencv_caffe.PowerParameter power_param = 21;
-inline bool V1LayerParameter::has_power_param() const {
-  return (_has_bits_[0] & 0x00004000u) != 0;
+inline bool V1LayerParameter::_internal_has_power_param() const {
+  bool value = (_has_bits_[0] & 0x00004000u) != 0;
+  PROTOBUF_ASSUME(!value || power_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_power_param() {
-  _has_bits_[0] |= 0x00004000u;
+inline bool V1LayerParameter::has_power_param() const {
+  return _internal_has_power_param();
 }
-inline void V1LayerParameter::clear_has_power_param() {
+inline void V1LayerParameter::clear_power_param() {
+  if (power_param_ != nullptr) power_param_->Clear();
   _has_bits_[0] &= ~0x00004000u;
 }
-inline void V1LayerParameter::clear_power_param() {
-  if (power_param_ != NULL) power_param_->Clear();
-  clear_has_power_param();
+inline const ::opencv_caffe::PowerParameter& V1LayerParameter::_internal_power_param() const {
+  const ::opencv_caffe::PowerParameter* p = power_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::PowerParameter&>(
+      ::opencv_caffe::_PowerParameter_default_instance_);
 }
 inline const ::opencv_caffe::PowerParameter& V1LayerParameter::power_param() const {
-  const ::opencv_caffe::PowerParameter* p = power_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.power_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::PowerParameter*>(
-      &::opencv_caffe::_PowerParameter_default_instance_);
+  return _internal_power_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_power_param(
+    ::opencv_caffe::PowerParameter* power_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(power_param_);
+  }
+  power_param_ = power_param;
+  if (power_param) {
+    _has_bits_[0] |= 0x00004000u;
+  } else {
+    _has_bits_[0] &= ~0x00004000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.power_param)
 }
 inline ::opencv_caffe::PowerParameter* V1LayerParameter::release_power_param() {
+  _has_bits_[0] &= ~0x00004000u;
+  ::opencv_caffe::PowerParameter* temp = power_param_;
+  power_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::PowerParameter* V1LayerParameter::unsafe_arena_release_power_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.power_param)
-  clear_has_power_param();
+  _has_bits_[0] &= ~0x00004000u;
   ::opencv_caffe::PowerParameter* temp = power_param_;
-  power_param_ = NULL;
+  power_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::PowerParameter* V1LayerParameter::mutable_power_param() {
-  set_has_power_param();
-  if (power_param_ == NULL) {
-    power_param_ = new ::opencv_caffe::PowerParameter;
+inline ::opencv_caffe::PowerParameter* V1LayerParameter::_internal_mutable_power_param() {
+  _has_bits_[0] |= 0x00004000u;
+  if (power_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::PowerParameter>(GetArenaForAllocation());
+    power_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.power_param)
   return power_param_;
 }
+inline ::opencv_caffe::PowerParameter* V1LayerParameter::mutable_power_param() {
+  ::opencv_caffe::PowerParameter* _msg = _internal_mutable_power_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.power_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_power_param(::opencv_caffe::PowerParameter* power_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete power_param_;
   }
   if (power_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::PowerParameter>::GetOwningArena(power_param);
     if (message_arena != submessage_arena) {
-      power_param = ::google::protobuf::internal::GetOwnedMessage(
+      power_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, power_param, submessage_arena);
     }
-    set_has_power_param();
+    _has_bits_[0] |= 0x00004000u;
   } else {
-    clear_has_power_param();
+    _has_bits_[0] &= ~0x00004000u;
   }
   power_param_ = power_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.power_param)
 }
 
 // optional .opencv_caffe.ReLUParameter relu_param = 30;
-inline bool V1LayerParameter::has_relu_param() const {
-  return (_has_bits_[0] & 0x00400000u) != 0;
+inline bool V1LayerParameter::_internal_has_relu_param() const {
+  bool value = (_has_bits_[0] & 0x00400000u) != 0;
+  PROTOBUF_ASSUME(!value || relu_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_relu_param() {
-  _has_bits_[0] |= 0x00400000u;
+inline bool V1LayerParameter::has_relu_param() const {
+  return _internal_has_relu_param();
 }
-inline void V1LayerParameter::clear_has_relu_param() {
+inline void V1LayerParameter::clear_relu_param() {
+  if (relu_param_ != nullptr) relu_param_->Clear();
   _has_bits_[0] &= ~0x00400000u;
 }
-inline void V1LayerParameter::clear_relu_param() {
-  if (relu_param_ != NULL) relu_param_->Clear();
-  clear_has_relu_param();
+inline const ::opencv_caffe::ReLUParameter& V1LayerParameter::_internal_relu_param() const {
+  const ::opencv_caffe::ReLUParameter* p = relu_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ReLUParameter&>(
+      ::opencv_caffe::_ReLUParameter_default_instance_);
 }
 inline const ::opencv_caffe::ReLUParameter& V1LayerParameter::relu_param() const {
-  const ::opencv_caffe::ReLUParameter* p = relu_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.relu_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ReLUParameter*>(
-      &::opencv_caffe::_ReLUParameter_default_instance_);
+  return _internal_relu_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_relu_param(
+    ::opencv_caffe::ReLUParameter* relu_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(relu_param_);
+  }
+  relu_param_ = relu_param;
+  if (relu_param) {
+    _has_bits_[0] |= 0x00400000u;
+  } else {
+    _has_bits_[0] &= ~0x00400000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.relu_param)
 }
 inline ::opencv_caffe::ReLUParameter* V1LayerParameter::release_relu_param() {
+  _has_bits_[0] &= ~0x00400000u;
+  ::opencv_caffe::ReLUParameter* temp = relu_param_;
+  relu_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ReLUParameter* V1LayerParameter::unsafe_arena_release_relu_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.relu_param)
-  clear_has_relu_param();
+  _has_bits_[0] &= ~0x00400000u;
   ::opencv_caffe::ReLUParameter* temp = relu_param_;
-  relu_param_ = NULL;
+  relu_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ReLUParameter* V1LayerParameter::mutable_relu_param() {
-  set_has_relu_param();
-  if (relu_param_ == NULL) {
-    relu_param_ = new ::opencv_caffe::ReLUParameter;
+inline ::opencv_caffe::ReLUParameter* V1LayerParameter::_internal_mutable_relu_param() {
+  _has_bits_[0] |= 0x00400000u;
+  if (relu_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ReLUParameter>(GetArenaForAllocation());
+    relu_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.relu_param)
   return relu_param_;
 }
+inline ::opencv_caffe::ReLUParameter* V1LayerParameter::mutable_relu_param() {
+  ::opencv_caffe::ReLUParameter* _msg = _internal_mutable_relu_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.relu_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_relu_param(::opencv_caffe::ReLUParameter* relu_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete relu_param_;
   }
   if (relu_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ReLUParameter>::GetOwningArena(relu_param);
     if (message_arena != submessage_arena) {
-      relu_param = ::google::protobuf::internal::GetOwnedMessage(
+      relu_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, relu_param, submessage_arena);
     }
-    set_has_relu_param();
+    _has_bits_[0] |= 0x00400000u;
   } else {
-    clear_has_relu_param();
+    _has_bits_[0] &= ~0x00400000u;
   }
   relu_param_ = relu_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.relu_param)
 }
 
 // optional .opencv_caffe.SigmoidParameter sigmoid_param = 38;
-inline bool V1LayerParameter::has_sigmoid_param() const {
-  return (_has_bits_[0] & 0x08000000u) != 0;
+inline bool V1LayerParameter::_internal_has_sigmoid_param() const {
+  bool value = (_has_bits_[0] & 0x08000000u) != 0;
+  PROTOBUF_ASSUME(!value || sigmoid_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_sigmoid_param() {
-  _has_bits_[0] |= 0x08000000u;
+inline bool V1LayerParameter::has_sigmoid_param() const {
+  return _internal_has_sigmoid_param();
 }
-inline void V1LayerParameter::clear_has_sigmoid_param() {
+inline void V1LayerParameter::clear_sigmoid_param() {
+  if (sigmoid_param_ != nullptr) sigmoid_param_->Clear();
   _has_bits_[0] &= ~0x08000000u;
 }
-inline void V1LayerParameter::clear_sigmoid_param() {
-  if (sigmoid_param_ != NULL) sigmoid_param_->Clear();
-  clear_has_sigmoid_param();
+inline const ::opencv_caffe::SigmoidParameter& V1LayerParameter::_internal_sigmoid_param() const {
+  const ::opencv_caffe::SigmoidParameter* p = sigmoid_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::SigmoidParameter&>(
+      ::opencv_caffe::_SigmoidParameter_default_instance_);
 }
 inline const ::opencv_caffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const {
-  const ::opencv_caffe::SigmoidParameter* p = sigmoid_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.sigmoid_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::SigmoidParameter*>(
-      &::opencv_caffe::_SigmoidParameter_default_instance_);
+  return _internal_sigmoid_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_sigmoid_param(
+    ::opencv_caffe::SigmoidParameter* sigmoid_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(sigmoid_param_);
+  }
+  sigmoid_param_ = sigmoid_param;
+  if (sigmoid_param) {
+    _has_bits_[0] |= 0x08000000u;
+  } else {
+    _has_bits_[0] &= ~0x08000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.sigmoid_param)
 }
 inline ::opencv_caffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() {
+  _has_bits_[0] &= ~0x08000000u;
+  ::opencv_caffe::SigmoidParameter* temp = sigmoid_param_;
+  sigmoid_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::SigmoidParameter* V1LayerParameter::unsafe_arena_release_sigmoid_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.sigmoid_param)
-  clear_has_sigmoid_param();
+  _has_bits_[0] &= ~0x08000000u;
   ::opencv_caffe::SigmoidParameter* temp = sigmoid_param_;
-  sigmoid_param_ = NULL;
+  sigmoid_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() {
-  set_has_sigmoid_param();
-  if (sigmoid_param_ == NULL) {
-    sigmoid_param_ = new ::opencv_caffe::SigmoidParameter;
+inline ::opencv_caffe::SigmoidParameter* V1LayerParameter::_internal_mutable_sigmoid_param() {
+  _has_bits_[0] |= 0x08000000u;
+  if (sigmoid_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::SigmoidParameter>(GetArenaForAllocation());
+    sigmoid_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.sigmoid_param)
   return sigmoid_param_;
 }
+inline ::opencv_caffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() {
+  ::opencv_caffe::SigmoidParameter* _msg = _internal_mutable_sigmoid_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.sigmoid_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_sigmoid_param(::opencv_caffe::SigmoidParameter* sigmoid_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete sigmoid_param_;
   }
   if (sigmoid_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::SigmoidParameter>::GetOwningArena(sigmoid_param);
     if (message_arena != submessage_arena) {
-      sigmoid_param = ::google::protobuf::internal::GetOwnedMessage(
+      sigmoid_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, sigmoid_param, submessage_arena);
     }
-    set_has_sigmoid_param();
+    _has_bits_[0] |= 0x08000000u;
   } else {
-    clear_has_sigmoid_param();
+    _has_bits_[0] &= ~0x08000000u;
   }
   sigmoid_param_ = sigmoid_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.sigmoid_param)
 }
 
 // optional .opencv_caffe.SoftmaxParameter softmax_param = 39;
-inline bool V1LayerParameter::has_softmax_param() const {
-  return (_has_bits_[0] & 0x10000000u) != 0;
+inline bool V1LayerParameter::_internal_has_softmax_param() const {
+  bool value = (_has_bits_[0] & 0x10000000u) != 0;
+  PROTOBUF_ASSUME(!value || softmax_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_softmax_param() {
-  _has_bits_[0] |= 0x10000000u;
+inline bool V1LayerParameter::has_softmax_param() const {
+  return _internal_has_softmax_param();
 }
-inline void V1LayerParameter::clear_has_softmax_param() {
+inline void V1LayerParameter::clear_softmax_param() {
+  if (softmax_param_ != nullptr) softmax_param_->Clear();
   _has_bits_[0] &= ~0x10000000u;
 }
-inline void V1LayerParameter::clear_softmax_param() {
-  if (softmax_param_ != NULL) softmax_param_->Clear();
-  clear_has_softmax_param();
+inline const ::opencv_caffe::SoftmaxParameter& V1LayerParameter::_internal_softmax_param() const {
+  const ::opencv_caffe::SoftmaxParameter* p = softmax_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::SoftmaxParameter&>(
+      ::opencv_caffe::_SoftmaxParameter_default_instance_);
 }
 inline const ::opencv_caffe::SoftmaxParameter& V1LayerParameter::softmax_param() const {
-  const ::opencv_caffe::SoftmaxParameter* p = softmax_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.softmax_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::SoftmaxParameter*>(
-      &::opencv_caffe::_SoftmaxParameter_default_instance_);
+  return _internal_softmax_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_softmax_param(
+    ::opencv_caffe::SoftmaxParameter* softmax_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(softmax_param_);
+  }
+  softmax_param_ = softmax_param;
+  if (softmax_param) {
+    _has_bits_[0] |= 0x10000000u;
+  } else {
+    _has_bits_[0] &= ~0x10000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.softmax_param)
 }
 inline ::opencv_caffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() {
+  _has_bits_[0] &= ~0x10000000u;
+  ::opencv_caffe::SoftmaxParameter* temp = softmax_param_;
+  softmax_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::SoftmaxParameter* V1LayerParameter::unsafe_arena_release_softmax_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.softmax_param)
-  clear_has_softmax_param();
+  _has_bits_[0] &= ~0x10000000u;
   ::opencv_caffe::SoftmaxParameter* temp = softmax_param_;
-  softmax_param_ = NULL;
+  softmax_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() {
-  set_has_softmax_param();
-  if (softmax_param_ == NULL) {
-    softmax_param_ = new ::opencv_caffe::SoftmaxParameter;
+inline ::opencv_caffe::SoftmaxParameter* V1LayerParameter::_internal_mutable_softmax_param() {
+  _has_bits_[0] |= 0x10000000u;
+  if (softmax_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::SoftmaxParameter>(GetArenaForAllocation());
+    softmax_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.softmax_param)
   return softmax_param_;
 }
+inline ::opencv_caffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() {
+  ::opencv_caffe::SoftmaxParameter* _msg = _internal_mutable_softmax_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.softmax_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_softmax_param(::opencv_caffe::SoftmaxParameter* softmax_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete softmax_param_;
   }
   if (softmax_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::SoftmaxParameter>::GetOwningArena(softmax_param);
     if (message_arena != submessage_arena) {
-      softmax_param = ::google::protobuf::internal::GetOwnedMessage(
+      softmax_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, softmax_param, submessage_arena);
     }
-    set_has_softmax_param();
+    _has_bits_[0] |= 0x10000000u;
   } else {
-    clear_has_softmax_param();
+    _has_bits_[0] &= ~0x10000000u;
   }
   softmax_param_ = softmax_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.softmax_param)
 }
 
 // optional .opencv_caffe.SliceParameter slice_param = 31;
-inline bool V1LayerParameter::has_slice_param() const {
-  return (_has_bits_[0] & 0x00800000u) != 0;
+inline bool V1LayerParameter::_internal_has_slice_param() const {
+  bool value = (_has_bits_[0] & 0x00800000u) != 0;
+  PROTOBUF_ASSUME(!value || slice_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_slice_param() {
-  _has_bits_[0] |= 0x00800000u;
+inline bool V1LayerParameter::has_slice_param() const {
+  return _internal_has_slice_param();
 }
-inline void V1LayerParameter::clear_has_slice_param() {
+inline void V1LayerParameter::clear_slice_param() {
+  if (slice_param_ != nullptr) slice_param_->Clear();
   _has_bits_[0] &= ~0x00800000u;
 }
-inline void V1LayerParameter::clear_slice_param() {
-  if (slice_param_ != NULL) slice_param_->Clear();
-  clear_has_slice_param();
+inline const ::opencv_caffe::SliceParameter& V1LayerParameter::_internal_slice_param() const {
+  const ::opencv_caffe::SliceParameter* p = slice_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::SliceParameter&>(
+      ::opencv_caffe::_SliceParameter_default_instance_);
 }
 inline const ::opencv_caffe::SliceParameter& V1LayerParameter::slice_param() const {
-  const ::opencv_caffe::SliceParameter* p = slice_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.slice_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::SliceParameter*>(
-      &::opencv_caffe::_SliceParameter_default_instance_);
+  return _internal_slice_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_slice_param(
+    ::opencv_caffe::SliceParameter* slice_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(slice_param_);
+  }
+  slice_param_ = slice_param;
+  if (slice_param) {
+    _has_bits_[0] |= 0x00800000u;
+  } else {
+    _has_bits_[0] &= ~0x00800000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.slice_param)
 }
 inline ::opencv_caffe::SliceParameter* V1LayerParameter::release_slice_param() {
+  _has_bits_[0] &= ~0x00800000u;
+  ::opencv_caffe::SliceParameter* temp = slice_param_;
+  slice_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::SliceParameter* V1LayerParameter::unsafe_arena_release_slice_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.slice_param)
-  clear_has_slice_param();
+  _has_bits_[0] &= ~0x00800000u;
   ::opencv_caffe::SliceParameter* temp = slice_param_;
-  slice_param_ = NULL;
+  slice_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::SliceParameter* V1LayerParameter::mutable_slice_param() {
-  set_has_slice_param();
-  if (slice_param_ == NULL) {
-    slice_param_ = new ::opencv_caffe::SliceParameter;
+inline ::opencv_caffe::SliceParameter* V1LayerParameter::_internal_mutable_slice_param() {
+  _has_bits_[0] |= 0x00800000u;
+  if (slice_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::SliceParameter>(GetArenaForAllocation());
+    slice_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.slice_param)
   return slice_param_;
 }
+inline ::opencv_caffe::SliceParameter* V1LayerParameter::mutable_slice_param() {
+  ::opencv_caffe::SliceParameter* _msg = _internal_mutable_slice_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.slice_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_slice_param(::opencv_caffe::SliceParameter* slice_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete slice_param_;
   }
   if (slice_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::SliceParameter>::GetOwningArena(slice_param);
     if (message_arena != submessage_arena) {
-      slice_param = ::google::protobuf::internal::GetOwnedMessage(
+      slice_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, slice_param, submessage_arena);
     }
-    set_has_slice_param();
+    _has_bits_[0] |= 0x00800000u;
   } else {
-    clear_has_slice_param();
+    _has_bits_[0] &= ~0x00800000u;
   }
   slice_param_ = slice_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.slice_param)
 }
 
 // optional .opencv_caffe.TanHParameter tanh_param = 37;
-inline bool V1LayerParameter::has_tanh_param() const {
-  return (_has_bits_[0] & 0x04000000u) != 0;
+inline bool V1LayerParameter::_internal_has_tanh_param() const {
+  bool value = (_has_bits_[0] & 0x04000000u) != 0;
+  PROTOBUF_ASSUME(!value || tanh_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_tanh_param() {
-  _has_bits_[0] |= 0x04000000u;
+inline bool V1LayerParameter::has_tanh_param() const {
+  return _internal_has_tanh_param();
 }
-inline void V1LayerParameter::clear_has_tanh_param() {
+inline void V1LayerParameter::clear_tanh_param() {
+  if (tanh_param_ != nullptr) tanh_param_->Clear();
   _has_bits_[0] &= ~0x04000000u;
 }
-inline void V1LayerParameter::clear_tanh_param() {
-  if (tanh_param_ != NULL) tanh_param_->Clear();
-  clear_has_tanh_param();
+inline const ::opencv_caffe::TanHParameter& V1LayerParameter::_internal_tanh_param() const {
+  const ::opencv_caffe::TanHParameter* p = tanh_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::TanHParameter&>(
+      ::opencv_caffe::_TanHParameter_default_instance_);
 }
 inline const ::opencv_caffe::TanHParameter& V1LayerParameter::tanh_param() const {
-  const ::opencv_caffe::TanHParameter* p = tanh_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.tanh_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::TanHParameter*>(
-      &::opencv_caffe::_TanHParameter_default_instance_);
+  return _internal_tanh_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_tanh_param(
+    ::opencv_caffe::TanHParameter* tanh_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(tanh_param_);
+  }
+  tanh_param_ = tanh_param;
+  if (tanh_param) {
+    _has_bits_[0] |= 0x04000000u;
+  } else {
+    _has_bits_[0] &= ~0x04000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.tanh_param)
 }
 inline ::opencv_caffe::TanHParameter* V1LayerParameter::release_tanh_param() {
+  _has_bits_[0] &= ~0x04000000u;
+  ::opencv_caffe::TanHParameter* temp = tanh_param_;
+  tanh_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::TanHParameter* V1LayerParameter::unsafe_arena_release_tanh_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.tanh_param)
-  clear_has_tanh_param();
+  _has_bits_[0] &= ~0x04000000u;
   ::opencv_caffe::TanHParameter* temp = tanh_param_;
-  tanh_param_ = NULL;
+  tanh_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::TanHParameter* V1LayerParameter::mutable_tanh_param() {
-  set_has_tanh_param();
-  if (tanh_param_ == NULL) {
-    tanh_param_ = new ::opencv_caffe::TanHParameter;
+inline ::opencv_caffe::TanHParameter* V1LayerParameter::_internal_mutable_tanh_param() {
+  _has_bits_[0] |= 0x04000000u;
+  if (tanh_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::TanHParameter>(GetArenaForAllocation());
+    tanh_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.tanh_param)
   return tanh_param_;
 }
+inline ::opencv_caffe::TanHParameter* V1LayerParameter::mutable_tanh_param() {
+  ::opencv_caffe::TanHParameter* _msg = _internal_mutable_tanh_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.tanh_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_tanh_param(::opencv_caffe::TanHParameter* tanh_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete tanh_param_;
   }
   if (tanh_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::TanHParameter>::GetOwningArena(tanh_param);
     if (message_arena != submessage_arena) {
-      tanh_param = ::google::protobuf::internal::GetOwnedMessage(
+      tanh_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, tanh_param, submessage_arena);
     }
-    set_has_tanh_param();
+    _has_bits_[0] |= 0x04000000u;
   } else {
-    clear_has_tanh_param();
+    _has_bits_[0] &= ~0x04000000u;
   }
   tanh_param_ = tanh_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.tanh_param)
 }
 
 // optional .opencv_caffe.ThresholdParameter threshold_param = 25;
-inline bool V1LayerParameter::has_threshold_param() const {
-  return (_has_bits_[0] & 0x00040000u) != 0;
+inline bool V1LayerParameter::_internal_has_threshold_param() const {
+  bool value = (_has_bits_[0] & 0x00040000u) != 0;
+  PROTOBUF_ASSUME(!value || threshold_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_threshold_param() {
-  _has_bits_[0] |= 0x00040000u;
+inline bool V1LayerParameter::has_threshold_param() const {
+  return _internal_has_threshold_param();
 }
-inline void V1LayerParameter::clear_has_threshold_param() {
+inline void V1LayerParameter::clear_threshold_param() {
+  if (threshold_param_ != nullptr) threshold_param_->Clear();
   _has_bits_[0] &= ~0x00040000u;
 }
-inline void V1LayerParameter::clear_threshold_param() {
-  if (threshold_param_ != NULL) threshold_param_->Clear();
-  clear_has_threshold_param();
+inline const ::opencv_caffe::ThresholdParameter& V1LayerParameter::_internal_threshold_param() const {
+  const ::opencv_caffe::ThresholdParameter* p = threshold_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::ThresholdParameter&>(
+      ::opencv_caffe::_ThresholdParameter_default_instance_);
 }
 inline const ::opencv_caffe::ThresholdParameter& V1LayerParameter::threshold_param() const {
-  const ::opencv_caffe::ThresholdParameter* p = threshold_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.threshold_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::ThresholdParameter*>(
-      &::opencv_caffe::_ThresholdParameter_default_instance_);
+  return _internal_threshold_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_threshold_param(
+    ::opencv_caffe::ThresholdParameter* threshold_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(threshold_param_);
+  }
+  threshold_param_ = threshold_param;
+  if (threshold_param) {
+    _has_bits_[0] |= 0x00040000u;
+  } else {
+    _has_bits_[0] &= ~0x00040000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.threshold_param)
 }
 inline ::opencv_caffe::ThresholdParameter* V1LayerParameter::release_threshold_param() {
+  _has_bits_[0] &= ~0x00040000u;
+  ::opencv_caffe::ThresholdParameter* temp = threshold_param_;
+  threshold_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::ThresholdParameter* V1LayerParameter::unsafe_arena_release_threshold_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.threshold_param)
-  clear_has_threshold_param();
+  _has_bits_[0] &= ~0x00040000u;
   ::opencv_caffe::ThresholdParameter* temp = threshold_param_;
-  threshold_param_ = NULL;
+  threshold_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() {
-  set_has_threshold_param();
-  if (threshold_param_ == NULL) {
-    threshold_param_ = new ::opencv_caffe::ThresholdParameter;
+inline ::opencv_caffe::ThresholdParameter* V1LayerParameter::_internal_mutable_threshold_param() {
+  _has_bits_[0] |= 0x00040000u;
+  if (threshold_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::ThresholdParameter>(GetArenaForAllocation());
+    threshold_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.threshold_param)
   return threshold_param_;
 }
+inline ::opencv_caffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() {
+  ::opencv_caffe::ThresholdParameter* _msg = _internal_mutable_threshold_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.threshold_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_threshold_param(::opencv_caffe::ThresholdParameter* threshold_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete threshold_param_;
   }
   if (threshold_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::ThresholdParameter>::GetOwningArena(threshold_param);
     if (message_arena != submessage_arena) {
-      threshold_param = ::google::protobuf::internal::GetOwnedMessage(
+      threshold_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, threshold_param, submessage_arena);
     }
-    set_has_threshold_param();
+    _has_bits_[0] |= 0x00040000u;
   } else {
-    clear_has_threshold_param();
+    _has_bits_[0] &= ~0x00040000u;
   }
   threshold_param_ = threshold_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.threshold_param)
 }
 
 // optional .opencv_caffe.WindowDataParameter window_data_param = 20;
-inline bool V1LayerParameter::has_window_data_param() const {
-  return (_has_bits_[0] & 0x00002000u) != 0;
+inline bool V1LayerParameter::_internal_has_window_data_param() const {
+  bool value = (_has_bits_[0] & 0x00002000u) != 0;
+  PROTOBUF_ASSUME(!value || window_data_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_window_data_param() {
-  _has_bits_[0] |= 0x00002000u;
+inline bool V1LayerParameter::has_window_data_param() const {
+  return _internal_has_window_data_param();
 }
-inline void V1LayerParameter::clear_has_window_data_param() {
+inline void V1LayerParameter::clear_window_data_param() {
+  if (window_data_param_ != nullptr) window_data_param_->Clear();
   _has_bits_[0] &= ~0x00002000u;
 }
-inline void V1LayerParameter::clear_window_data_param() {
-  if (window_data_param_ != NULL) window_data_param_->Clear();
-  clear_has_window_data_param();
+inline const ::opencv_caffe::WindowDataParameter& V1LayerParameter::_internal_window_data_param() const {
+  const ::opencv_caffe::WindowDataParameter* p = window_data_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::WindowDataParameter&>(
+      ::opencv_caffe::_WindowDataParameter_default_instance_);
 }
 inline const ::opencv_caffe::WindowDataParameter& V1LayerParameter::window_data_param() const {
-  const ::opencv_caffe::WindowDataParameter* p = window_data_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.window_data_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::WindowDataParameter*>(
-      &::opencv_caffe::_WindowDataParameter_default_instance_);
+  return _internal_window_data_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_window_data_param(
+    ::opencv_caffe::WindowDataParameter* window_data_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(window_data_param_);
+  }
+  window_data_param_ = window_data_param;
+  if (window_data_param) {
+    _has_bits_[0] |= 0x00002000u;
+  } else {
+    _has_bits_[0] &= ~0x00002000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.window_data_param)
 }
 inline ::opencv_caffe::WindowDataParameter* V1LayerParameter::release_window_data_param() {
+  _has_bits_[0] &= ~0x00002000u;
+  ::opencv_caffe::WindowDataParameter* temp = window_data_param_;
+  window_data_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::WindowDataParameter* V1LayerParameter::unsafe_arena_release_window_data_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.window_data_param)
-  clear_has_window_data_param();
+  _has_bits_[0] &= ~0x00002000u;
   ::opencv_caffe::WindowDataParameter* temp = window_data_param_;
-  window_data_param_ = NULL;
+  window_data_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() {
-  set_has_window_data_param();
-  if (window_data_param_ == NULL) {
-    window_data_param_ = new ::opencv_caffe::WindowDataParameter;
+inline ::opencv_caffe::WindowDataParameter* V1LayerParameter::_internal_mutable_window_data_param() {
+  _has_bits_[0] |= 0x00002000u;
+  if (window_data_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::WindowDataParameter>(GetArenaForAllocation());
+    window_data_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.window_data_param)
   return window_data_param_;
 }
+inline ::opencv_caffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() {
+  ::opencv_caffe::WindowDataParameter* _msg = _internal_mutable_window_data_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.window_data_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_window_data_param(::opencv_caffe::WindowDataParameter* window_data_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete window_data_param_;
   }
   if (window_data_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::WindowDataParameter>::GetOwningArena(window_data_param);
     if (message_arena != submessage_arena) {
-      window_data_param = ::google::protobuf::internal::GetOwnedMessage(
+      window_data_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, window_data_param, submessage_arena);
     }
-    set_has_window_data_param();
+    _has_bits_[0] |= 0x00002000u;
   } else {
-    clear_has_window_data_param();
+    _has_bits_[0] &= ~0x00002000u;
   }
   window_data_param_ = window_data_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.window_data_param)
 }
 
 // optional .opencv_caffe.TransformationParameter transform_param = 36;
-inline bool V1LayerParameter::has_transform_param() const {
-  return (_has_bits_[0] & 0x02000000u) != 0;
+inline bool V1LayerParameter::_internal_has_transform_param() const {
+  bool value = (_has_bits_[0] & 0x02000000u) != 0;
+  PROTOBUF_ASSUME(!value || transform_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_transform_param() {
-  _has_bits_[0] |= 0x02000000u;
+inline bool V1LayerParameter::has_transform_param() const {
+  return _internal_has_transform_param();
 }
-inline void V1LayerParameter::clear_has_transform_param() {
+inline void V1LayerParameter::clear_transform_param() {
+  if (transform_param_ != nullptr) transform_param_->Clear();
   _has_bits_[0] &= ~0x02000000u;
 }
-inline void V1LayerParameter::clear_transform_param() {
-  if (transform_param_ != NULL) transform_param_->Clear();
-  clear_has_transform_param();
+inline const ::opencv_caffe::TransformationParameter& V1LayerParameter::_internal_transform_param() const {
+  const ::opencv_caffe::TransformationParameter* p = transform_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::TransformationParameter&>(
+      ::opencv_caffe::_TransformationParameter_default_instance_);
 }
 inline const ::opencv_caffe::TransformationParameter& V1LayerParameter::transform_param() const {
-  const ::opencv_caffe::TransformationParameter* p = transform_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.transform_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::TransformationParameter*>(
-      &::opencv_caffe::_TransformationParameter_default_instance_);
+  return _internal_transform_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_transform_param(
+    ::opencv_caffe::TransformationParameter* transform_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(transform_param_);
+  }
+  transform_param_ = transform_param;
+  if (transform_param) {
+    _has_bits_[0] |= 0x02000000u;
+  } else {
+    _has_bits_[0] &= ~0x02000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.transform_param)
 }
 inline ::opencv_caffe::TransformationParameter* V1LayerParameter::release_transform_param() {
+  _has_bits_[0] &= ~0x02000000u;
+  ::opencv_caffe::TransformationParameter* temp = transform_param_;
+  transform_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::TransformationParameter* V1LayerParameter::unsafe_arena_release_transform_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.transform_param)
-  clear_has_transform_param();
+  _has_bits_[0] &= ~0x02000000u;
   ::opencv_caffe::TransformationParameter* temp = transform_param_;
-  transform_param_ = NULL;
+  transform_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::TransformationParameter* V1LayerParameter::mutable_transform_param() {
-  set_has_transform_param();
-  if (transform_param_ == NULL) {
-    transform_param_ = new ::opencv_caffe::TransformationParameter;
+inline ::opencv_caffe::TransformationParameter* V1LayerParameter::_internal_mutable_transform_param() {
+  _has_bits_[0] |= 0x02000000u;
+  if (transform_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::TransformationParameter>(GetArenaForAllocation());
+    transform_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.transform_param)
   return transform_param_;
 }
+inline ::opencv_caffe::TransformationParameter* V1LayerParameter::mutable_transform_param() {
+  ::opencv_caffe::TransformationParameter* _msg = _internal_mutable_transform_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.transform_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_transform_param(::opencv_caffe::TransformationParameter* transform_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete transform_param_;
   }
   if (transform_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::TransformationParameter>::GetOwningArena(transform_param);
     if (message_arena != submessage_arena) {
-      transform_param = ::google::protobuf::internal::GetOwnedMessage(
+      transform_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, transform_param, submessage_arena);
     }
-    set_has_transform_param();
+    _has_bits_[0] |= 0x02000000u;
   } else {
-    clear_has_transform_param();
+    _has_bits_[0] &= ~0x02000000u;
   }
   transform_param_ = transform_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.transform_param)
 }
 
 // optional .opencv_caffe.LossParameter loss_param = 42;
-inline bool V1LayerParameter::has_loss_param() const {
-  return (_has_bits_[0] & 0x80000000u) != 0;
+inline bool V1LayerParameter::_internal_has_loss_param() const {
+  bool value = (_has_bits_[0] & 0x80000000u) != 0;
+  PROTOBUF_ASSUME(!value || loss_param_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_loss_param() {
-  _has_bits_[0] |= 0x80000000u;
+inline bool V1LayerParameter::has_loss_param() const {
+  return _internal_has_loss_param();
 }
-inline void V1LayerParameter::clear_has_loss_param() {
+inline void V1LayerParameter::clear_loss_param() {
+  if (loss_param_ != nullptr) loss_param_->Clear();
   _has_bits_[0] &= ~0x80000000u;
 }
-inline void V1LayerParameter::clear_loss_param() {
-  if (loss_param_ != NULL) loss_param_->Clear();
-  clear_has_loss_param();
+inline const ::opencv_caffe::LossParameter& V1LayerParameter::_internal_loss_param() const {
+  const ::opencv_caffe::LossParameter* p = loss_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::LossParameter&>(
+      ::opencv_caffe::_LossParameter_default_instance_);
 }
 inline const ::opencv_caffe::LossParameter& V1LayerParameter::loss_param() const {
-  const ::opencv_caffe::LossParameter* p = loss_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.loss_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::LossParameter*>(
-      &::opencv_caffe::_LossParameter_default_instance_);
+  return _internal_loss_param();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_loss_param(
+    ::opencv_caffe::LossParameter* loss_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(loss_param_);
+  }
+  loss_param_ = loss_param;
+  if (loss_param) {
+    _has_bits_[0] |= 0x80000000u;
+  } else {
+    _has_bits_[0] &= ~0x80000000u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.loss_param)
 }
 inline ::opencv_caffe::LossParameter* V1LayerParameter::release_loss_param() {
+  _has_bits_[0] &= ~0x80000000u;
+  ::opencv_caffe::LossParameter* temp = loss_param_;
+  loss_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::LossParameter* V1LayerParameter::unsafe_arena_release_loss_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.loss_param)
-  clear_has_loss_param();
+  _has_bits_[0] &= ~0x80000000u;
   ::opencv_caffe::LossParameter* temp = loss_param_;
-  loss_param_ = NULL;
+  loss_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::LossParameter* V1LayerParameter::mutable_loss_param() {
-  set_has_loss_param();
-  if (loss_param_ == NULL) {
-    loss_param_ = new ::opencv_caffe::LossParameter;
+inline ::opencv_caffe::LossParameter* V1LayerParameter::_internal_mutable_loss_param() {
+  _has_bits_[0] |= 0x80000000u;
+  if (loss_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::LossParameter>(GetArenaForAllocation());
+    loss_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.loss_param)
   return loss_param_;
 }
+inline ::opencv_caffe::LossParameter* V1LayerParameter::mutable_loss_param() {
+  ::opencv_caffe::LossParameter* _msg = _internal_mutable_loss_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.loss_param)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_loss_param(::opencv_caffe::LossParameter* loss_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete loss_param_;
   }
   if (loss_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::LossParameter>::GetOwningArena(loss_param);
     if (message_arena != submessage_arena) {
-      loss_param = ::google::protobuf::internal::GetOwnedMessage(
+      loss_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, loss_param, submessage_arena);
     }
-    set_has_loss_param();
+    _has_bits_[0] |= 0x80000000u;
   } else {
-    clear_has_loss_param();
+    _has_bits_[0] &= ~0x80000000u;
   }
   loss_param_ = loss_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.loss_param)
 }
 
 // optional .opencv_caffe.V0LayerParameter layer = 1;
-inline bool V1LayerParameter::has_layer() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool V1LayerParameter::_internal_has_layer() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || layer_ != nullptr);
+  return value;
 }
-inline void V1LayerParameter::set_has_layer() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool V1LayerParameter::has_layer() const {
+  return _internal_has_layer();
 }
-inline void V1LayerParameter::clear_has_layer() {
+inline void V1LayerParameter::clear_layer() {
+  if (layer_ != nullptr) layer_->Clear();
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void V1LayerParameter::clear_layer() {
-  if (layer_ != NULL) layer_->Clear();
-  clear_has_layer();
+inline const ::opencv_caffe::V0LayerParameter& V1LayerParameter::_internal_layer() const {
+  const ::opencv_caffe::V0LayerParameter* p = layer_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::V0LayerParameter&>(
+      ::opencv_caffe::_V0LayerParameter_default_instance_);
 }
 inline const ::opencv_caffe::V0LayerParameter& V1LayerParameter::layer() const {
-  const ::opencv_caffe::V0LayerParameter* p = layer_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V1LayerParameter.layer)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::V0LayerParameter*>(
-      &::opencv_caffe::_V0LayerParameter_default_instance_);
+  return _internal_layer();
+}
+inline void V1LayerParameter::unsafe_arena_set_allocated_layer(
+    ::opencv_caffe::V0LayerParameter* layer) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(layer_);
+  }
+  layer_ = layer;
+  if (layer) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V1LayerParameter.layer)
 }
 inline ::opencv_caffe::V0LayerParameter* V1LayerParameter::release_layer() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::opencv_caffe::V0LayerParameter* temp = layer_;
+  layer_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::V0LayerParameter* V1LayerParameter::unsafe_arena_release_layer() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V1LayerParameter.layer)
-  clear_has_layer();
+  _has_bits_[0] &= ~0x00000002u;
   ::opencv_caffe::V0LayerParameter* temp = layer_;
-  layer_ = NULL;
+  layer_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::V0LayerParameter* V1LayerParameter::mutable_layer() {
-  set_has_layer();
-  if (layer_ == NULL) {
-    layer_ = new ::opencv_caffe::V0LayerParameter;
+inline ::opencv_caffe::V0LayerParameter* V1LayerParameter::_internal_mutable_layer() {
+  _has_bits_[0] |= 0x00000002u;
+  if (layer_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::V0LayerParameter>(GetArenaForAllocation());
+    layer_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.layer)
   return layer_;
 }
+inline ::opencv_caffe::V0LayerParameter* V1LayerParameter::mutable_layer() {
+  ::opencv_caffe::V0LayerParameter* _msg = _internal_mutable_layer();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V1LayerParameter.layer)
+  return _msg;
+}
 inline void V1LayerParameter::set_allocated_layer(::opencv_caffe::V0LayerParameter* layer) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete layer_;
   }
   if (layer) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::V0LayerParameter>::GetOwningArena(layer);
     if (message_arena != submessage_arena) {
-      layer = ::google::protobuf::internal::GetOwnedMessage(
+      layer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, layer, submessage_arena);
     }
-    set_has_layer();
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_layer();
+    _has_bits_[0] &= ~0x00000002u;
   }
   layer_ = layer;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V1LayerParameter.layer)
@@ -30573,1216 +42363,1497 @@ inline void V1LayerParameter::set_allocated_layer(::opencv_caffe::V0LayerParamet
 // V0LayerParameter
 
 // optional string name = 1;
-inline bool V0LayerParameter::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void V0LayerParameter::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool V0LayerParameter::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool V0LayerParameter::has_name() const {
+  return _internal_has_name();
 }
 inline void V0LayerParameter::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& V0LayerParameter::name() const {
+inline const std::string& V0LayerParameter::name() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void V0LayerParameter::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void V0LayerParameter::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.name)
 }
-#if LANG_CXX11
-inline void V0LayerParameter::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.V0LayerParameter.name)
-}
-#endif
-inline void V0LayerParameter::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:opencv_caffe.V0LayerParameter.name)
-}
-inline void V0LayerParameter::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:opencv_caffe.V0LayerParameter.name)
-}
-inline ::std::string* V0LayerParameter::mutable_name() {
-  set_has_name();
+inline std::string* V0LayerParameter::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& V0LayerParameter::_internal_name() const {
+  return name_.Get();
+}
+inline void V0LayerParameter::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* V0LayerParameter::release_name() {
+inline std::string* V0LayerParameter::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* V0LayerParameter::release_name() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V0LayerParameter.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void V0LayerParameter::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void V0LayerParameter::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V0LayerParameter.name)
 }
 
 // optional string type = 2;
-inline bool V0LayerParameter::has_type() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void V0LayerParameter::set_has_type() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool V0LayerParameter::_internal_has_type() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_type() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool V0LayerParameter::has_type() const {
+  return _internal_has_type();
 }
 inline void V0LayerParameter::clear_type() {
-  type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_type();
+  type_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& V0LayerParameter::type() const {
+inline const std::string& V0LayerParameter::type() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.type)
-  return type_.GetNoArena();
+  return _internal_type();
 }
-inline void V0LayerParameter::set_type(const ::std::string& value) {
-  set_has_type();
-  type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void V0LayerParameter::set_type(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.type)
 }
-#if LANG_CXX11
-inline void V0LayerParameter::set_type(::std::string&& value) {
-  set_has_type();
-  type_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.V0LayerParameter.type)
-}
-#endif
-inline void V0LayerParameter::set_type(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_type();
-  type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.V0LayerParameter.type)
-}
-inline void V0LayerParameter::set_type(const char* value, size_t size) {
-  set_has_type();
-  type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.V0LayerParameter.type)
-}
-inline ::std::string* V0LayerParameter::mutable_type() {
-  set_has_type();
+inline std::string* V0LayerParameter::mutable_type() {
+  std::string* _s = _internal_mutable_type();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.type)
-  return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& V0LayerParameter::_internal_type() const {
+  return type_.Get();
+}
+inline void V0LayerParameter::_internal_set_type(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* V0LayerParameter::_internal_mutable_type() {
+  _has_bits_[0] |= 0x00000002u;
+  return type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* V0LayerParameter::release_type() {
+inline std::string* V0LayerParameter::release_type() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V0LayerParameter.type)
-  clear_has_type();
-  return type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_type()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = type_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void V0LayerParameter::set_allocated_type(::std::string* type) {
-  if (type != NULL) {
-    set_has_type();
+inline void V0LayerParameter::set_allocated_type(std::string* type) {
+  if (type != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_type();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type);
+  type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V0LayerParameter.type)
 }
 
 // optional uint32 num_output = 3;
-inline bool V0LayerParameter::has_num_output() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
+inline bool V0LayerParameter::_internal_has_num_output() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void V0LayerParameter::set_has_num_output() {
-  _has_bits_[0] |= 0x00000100u;
-}
-inline void V0LayerParameter::clear_has_num_output() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool V0LayerParameter::has_num_output() const {
+  return _internal_has_num_output();
 }
 inline void V0LayerParameter::clear_num_output() {
   num_output_ = 0u;
-  clear_has_num_output();
+  _has_bits_[0] &= ~0x00000100u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::num_output() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.num_output)
+inline uint32_t V0LayerParameter::_internal_num_output() const {
   return num_output_;
 }
-inline void V0LayerParameter::set_num_output(::google::protobuf::uint32 value) {
-  set_has_num_output();
+inline uint32_t V0LayerParameter::num_output() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.num_output)
+  return _internal_num_output();
+}
+inline void V0LayerParameter::_internal_set_num_output(uint32_t value) {
+  _has_bits_[0] |= 0x00000100u;
   num_output_ = value;
+}
+inline void V0LayerParameter::set_num_output(uint32_t value) {
+  _internal_set_num_output(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.num_output)
 }
 
 // optional bool biasterm = 4 [default = true];
-inline bool V0LayerParameter::has_biasterm() const {
-  return (_has_bits_[0] & 0x00800000u) != 0;
-}
-inline void V0LayerParameter::set_has_biasterm() {
-  _has_bits_[0] |= 0x00800000u;
+inline bool V0LayerParameter::_internal_has_biasterm() const {
+  bool value = (_has_bits_[0] & 0x00800000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_biasterm() {
-  _has_bits_[0] &= ~0x00800000u;
+inline bool V0LayerParameter::has_biasterm() const {
+  return _internal_has_biasterm();
 }
 inline void V0LayerParameter::clear_biasterm() {
   biasterm_ = true;
-  clear_has_biasterm();
+  _has_bits_[0] &= ~0x00800000u;
+}
+inline bool V0LayerParameter::_internal_biasterm() const {
+  return biasterm_;
 }
 inline bool V0LayerParameter::biasterm() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.biasterm)
-  return biasterm_;
+  return _internal_biasterm();
 }
-inline void V0LayerParameter::set_biasterm(bool value) {
-  set_has_biasterm();
+inline void V0LayerParameter::_internal_set_biasterm(bool value) {
+  _has_bits_[0] |= 0x00800000u;
   biasterm_ = value;
+}
+inline void V0LayerParameter::set_biasterm(bool value) {
+  _internal_set_biasterm(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.biasterm)
 }
 
 // optional .opencv_caffe.FillerParameter weight_filler = 5;
-inline bool V0LayerParameter::has_weight_filler() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool V0LayerParameter::_internal_has_weight_filler() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  PROTOBUF_ASSUME(!value || weight_filler_ != nullptr);
+  return value;
 }
-inline void V0LayerParameter::set_has_weight_filler() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool V0LayerParameter::has_weight_filler() const {
+  return _internal_has_weight_filler();
 }
-inline void V0LayerParameter::clear_has_weight_filler() {
+inline void V0LayerParameter::clear_weight_filler() {
+  if (weight_filler_ != nullptr) weight_filler_->Clear();
   _has_bits_[0] &= ~0x00000020u;
 }
-inline void V0LayerParameter::clear_weight_filler() {
-  if (weight_filler_ != NULL) weight_filler_->Clear();
-  clear_has_weight_filler();
+inline const ::opencv_caffe::FillerParameter& V0LayerParameter::_internal_weight_filler() const {
+  const ::opencv_caffe::FillerParameter* p = weight_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& V0LayerParameter::weight_filler() const {
-  const ::opencv_caffe::FillerParameter* p = weight_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.weight_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_weight_filler();
+}
+inline void V0LayerParameter::unsafe_arena_set_allocated_weight_filler(
+    ::opencv_caffe::FillerParameter* weight_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(weight_filler_);
+  }
+  weight_filler_ = weight_filler;
+  if (weight_filler) {
+    _has_bits_[0] |= 0x00000020u;
+  } else {
+    _has_bits_[0] &= ~0x00000020u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V0LayerParameter.weight_filler)
 }
 inline ::opencv_caffe::FillerParameter* V0LayerParameter::release_weight_filler() {
+  _has_bits_[0] &= ~0x00000020u;
+  ::opencv_caffe::FillerParameter* temp = weight_filler_;
+  weight_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* V0LayerParameter::unsafe_arena_release_weight_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V0LayerParameter.weight_filler)
-  clear_has_weight_filler();
+  _has_bits_[0] &= ~0x00000020u;
   ::opencv_caffe::FillerParameter* temp = weight_filler_;
-  weight_filler_ = NULL;
+  weight_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* V0LayerParameter::mutable_weight_filler() {
-  set_has_weight_filler();
-  if (weight_filler_ == NULL) {
-    weight_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* V0LayerParameter::_internal_mutable_weight_filler() {
+  _has_bits_[0] |= 0x00000020u;
+  if (weight_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    weight_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.weight_filler)
   return weight_filler_;
 }
+inline ::opencv_caffe::FillerParameter* V0LayerParameter::mutable_weight_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_weight_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.weight_filler)
+  return _msg;
+}
 inline void V0LayerParameter::set_allocated_weight_filler(::opencv_caffe::FillerParameter* weight_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete weight_filler_;
   }
   if (weight_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(weight_filler);
     if (message_arena != submessage_arena) {
-      weight_filler = ::google::protobuf::internal::GetOwnedMessage(
+      weight_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, weight_filler, submessage_arena);
     }
-    set_has_weight_filler();
+    _has_bits_[0] |= 0x00000020u;
   } else {
-    clear_has_weight_filler();
+    _has_bits_[0] &= ~0x00000020u;
   }
   weight_filler_ = weight_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V0LayerParameter.weight_filler)
 }
 
 // optional .opencv_caffe.FillerParameter bias_filler = 6;
-inline bool V0LayerParameter::has_bias_filler() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+inline bool V0LayerParameter::_internal_has_bias_filler() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  PROTOBUF_ASSUME(!value || bias_filler_ != nullptr);
+  return value;
 }
-inline void V0LayerParameter::set_has_bias_filler() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool V0LayerParameter::has_bias_filler() const {
+  return _internal_has_bias_filler();
 }
-inline void V0LayerParameter::clear_has_bias_filler() {
+inline void V0LayerParameter::clear_bias_filler() {
+  if (bias_filler_ != nullptr) bias_filler_->Clear();
   _has_bits_[0] &= ~0x00000040u;
 }
-inline void V0LayerParameter::clear_bias_filler() {
-  if (bias_filler_ != NULL) bias_filler_->Clear();
-  clear_has_bias_filler();
+inline const ::opencv_caffe::FillerParameter& V0LayerParameter::_internal_bias_filler() const {
+  const ::opencv_caffe::FillerParameter* p = bias_filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& V0LayerParameter::bias_filler() const {
-  const ::opencv_caffe::FillerParameter* p = bias_filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.bias_filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_bias_filler();
+}
+inline void V0LayerParameter::unsafe_arena_set_allocated_bias_filler(
+    ::opencv_caffe::FillerParameter* bias_filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(bias_filler_);
+  }
+  bias_filler_ = bias_filler;
+  if (bias_filler) {
+    _has_bits_[0] |= 0x00000040u;
+  } else {
+    _has_bits_[0] &= ~0x00000040u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V0LayerParameter.bias_filler)
 }
 inline ::opencv_caffe::FillerParameter* V0LayerParameter::release_bias_filler() {
+  _has_bits_[0] &= ~0x00000040u;
+  ::opencv_caffe::FillerParameter* temp = bias_filler_;
+  bias_filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* V0LayerParameter::unsafe_arena_release_bias_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V0LayerParameter.bias_filler)
-  clear_has_bias_filler();
+  _has_bits_[0] &= ~0x00000040u;
   ::opencv_caffe::FillerParameter* temp = bias_filler_;
-  bias_filler_ = NULL;
+  bias_filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* V0LayerParameter::mutable_bias_filler() {
-  set_has_bias_filler();
-  if (bias_filler_ == NULL) {
-    bias_filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* V0LayerParameter::_internal_mutable_bias_filler() {
+  _has_bits_[0] |= 0x00000040u;
+  if (bias_filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    bias_filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.bias_filler)
   return bias_filler_;
 }
+inline ::opencv_caffe::FillerParameter* V0LayerParameter::mutable_bias_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_bias_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.bias_filler)
+  return _msg;
+}
 inline void V0LayerParameter::set_allocated_bias_filler(::opencv_caffe::FillerParameter* bias_filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete bias_filler_;
   }
   if (bias_filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(bias_filler);
     if (message_arena != submessage_arena) {
-      bias_filler = ::google::protobuf::internal::GetOwnedMessage(
+      bias_filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, bias_filler, submessage_arena);
     }
-    set_has_bias_filler();
+    _has_bits_[0] |= 0x00000040u;
   } else {
-    clear_has_bias_filler();
+    _has_bits_[0] &= ~0x00000040u;
   }
   bias_filler_ = bias_filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V0LayerParameter.bias_filler)
 }
 
 // optional uint32 pad = 7 [default = 0];
-inline bool V0LayerParameter::has_pad() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
+inline bool V0LayerParameter::_internal_has_pad() const {
+  bool value = (_has_bits_[0] & 0x00000200u) != 0;
+  return value;
 }
-inline void V0LayerParameter::set_has_pad() {
-  _has_bits_[0] |= 0x00000200u;
-}
-inline void V0LayerParameter::clear_has_pad() {
-  _has_bits_[0] &= ~0x00000200u;
+inline bool V0LayerParameter::has_pad() const {
+  return _internal_has_pad();
 }
 inline void V0LayerParameter::clear_pad() {
   pad_ = 0u;
-  clear_has_pad();
+  _has_bits_[0] &= ~0x00000200u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::pad() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.pad)
+inline uint32_t V0LayerParameter::_internal_pad() const {
   return pad_;
 }
-inline void V0LayerParameter::set_pad(::google::protobuf::uint32 value) {
-  set_has_pad();
+inline uint32_t V0LayerParameter::pad() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.pad)
+  return _internal_pad();
+}
+inline void V0LayerParameter::_internal_set_pad(uint32_t value) {
+  _has_bits_[0] |= 0x00000200u;
   pad_ = value;
+}
+inline void V0LayerParameter::set_pad(uint32_t value) {
+  _internal_set_pad(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.pad)
 }
 
 // optional uint32 kernelsize = 8;
-inline bool V0LayerParameter::has_kernelsize() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
-}
-inline void V0LayerParameter::set_has_kernelsize() {
-  _has_bits_[0] |= 0x00000400u;
+inline bool V0LayerParameter::_internal_has_kernelsize() const {
+  bool value = (_has_bits_[0] & 0x00000400u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_kernelsize() {
-  _has_bits_[0] &= ~0x00000400u;
+inline bool V0LayerParameter::has_kernelsize() const {
+  return _internal_has_kernelsize();
 }
 inline void V0LayerParameter::clear_kernelsize() {
   kernelsize_ = 0u;
-  clear_has_kernelsize();
+  _has_bits_[0] &= ~0x00000400u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::kernelsize() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.kernelsize)
+inline uint32_t V0LayerParameter::_internal_kernelsize() const {
   return kernelsize_;
 }
-inline void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) {
-  set_has_kernelsize();
+inline uint32_t V0LayerParameter::kernelsize() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.kernelsize)
+  return _internal_kernelsize();
+}
+inline void V0LayerParameter::_internal_set_kernelsize(uint32_t value) {
+  _has_bits_[0] |= 0x00000400u;
   kernelsize_ = value;
+}
+inline void V0LayerParameter::set_kernelsize(uint32_t value) {
+  _internal_set_kernelsize(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.kernelsize)
 }
 
 // optional uint32 group = 9 [default = 1];
-inline bool V0LayerParameter::has_group() const {
-  return (_has_bits_[0] & 0x01000000u) != 0;
-}
-inline void V0LayerParameter::set_has_group() {
-  _has_bits_[0] |= 0x01000000u;
+inline bool V0LayerParameter::_internal_has_group() const {
+  bool value = (_has_bits_[0] & 0x01000000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_group() {
-  _has_bits_[0] &= ~0x01000000u;
+inline bool V0LayerParameter::has_group() const {
+  return _internal_has_group();
 }
 inline void V0LayerParameter::clear_group() {
   group_ = 1u;
-  clear_has_group();
+  _has_bits_[0] &= ~0x01000000u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::group() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.group)
+inline uint32_t V0LayerParameter::_internal_group() const {
   return group_;
 }
-inline void V0LayerParameter::set_group(::google::protobuf::uint32 value) {
-  set_has_group();
+inline uint32_t V0LayerParameter::group() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.group)
+  return _internal_group();
+}
+inline void V0LayerParameter::_internal_set_group(uint32_t value) {
+  _has_bits_[0] |= 0x01000000u;
   group_ = value;
+}
+inline void V0LayerParameter::set_group(uint32_t value) {
+  _internal_set_group(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.group)
 }
 
 // optional uint32 stride = 10 [default = 1];
-inline bool V0LayerParameter::has_stride() const {
-  return (_has_bits_[0] & 0x02000000u) != 0;
-}
-inline void V0LayerParameter::set_has_stride() {
-  _has_bits_[0] |= 0x02000000u;
+inline bool V0LayerParameter::_internal_has_stride() const {
+  bool value = (_has_bits_[0] & 0x02000000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_stride() {
-  _has_bits_[0] &= ~0x02000000u;
+inline bool V0LayerParameter::has_stride() const {
+  return _internal_has_stride();
 }
 inline void V0LayerParameter::clear_stride() {
   stride_ = 1u;
-  clear_has_stride();
+  _has_bits_[0] &= ~0x02000000u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::stride() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.stride)
+inline uint32_t V0LayerParameter::_internal_stride() const {
   return stride_;
 }
-inline void V0LayerParameter::set_stride(::google::protobuf::uint32 value) {
-  set_has_stride();
+inline uint32_t V0LayerParameter::stride() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.stride)
+  return _internal_stride();
+}
+inline void V0LayerParameter::_internal_set_stride(uint32_t value) {
+  _has_bits_[0] |= 0x02000000u;
   stride_ = value;
+}
+inline void V0LayerParameter::set_stride(uint32_t value) {
+  _internal_set_stride(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.stride)
 }
 
 // optional .opencv_caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX];
-inline bool V0LayerParameter::has_pool() const {
-  return (_has_bits_[0] & 0x00000800u) != 0;
+inline bool V0LayerParameter::_internal_has_pool() const {
+  bool value = (_has_bits_[0] & 0x00000800u) != 0;
+  return value;
 }
-inline void V0LayerParameter::set_has_pool() {
-  _has_bits_[0] |= 0x00000800u;
-}
-inline void V0LayerParameter::clear_has_pool() {
-  _has_bits_[0] &= ~0x00000800u;
+inline bool V0LayerParameter::has_pool() const {
+  return _internal_has_pool();
 }
 inline void V0LayerParameter::clear_pool() {
   pool_ = 0;
-  clear_has_pool();
+  _has_bits_[0] &= ~0x00000800u;
+}
+inline ::opencv_caffe::V0LayerParameter_PoolMethod V0LayerParameter::_internal_pool() const {
+  return static_cast< ::opencv_caffe::V0LayerParameter_PoolMethod >(pool_);
 }
 inline ::opencv_caffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.pool)
-  return static_cast< ::opencv_caffe::V0LayerParameter_PoolMethod >(pool_);
+  return _internal_pool();
 }
-inline void V0LayerParameter::set_pool(::opencv_caffe::V0LayerParameter_PoolMethod value) {
+inline void V0LayerParameter::_internal_set_pool(::opencv_caffe::V0LayerParameter_PoolMethod value) {
   assert(::opencv_caffe::V0LayerParameter_PoolMethod_IsValid(value));
-  set_has_pool();
+  _has_bits_[0] |= 0x00000800u;
   pool_ = value;
+}
+inline void V0LayerParameter::set_pool(::opencv_caffe::V0LayerParameter_PoolMethod value) {
+  _internal_set_pool(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.pool)
 }
 
 // optional float dropout_ratio = 12 [default = 0.5];
-inline bool V0LayerParameter::has_dropout_ratio() const {
-  return (_has_bits_[0] & 0x04000000u) != 0;
-}
-inline void V0LayerParameter::set_has_dropout_ratio() {
-  _has_bits_[0] |= 0x04000000u;
+inline bool V0LayerParameter::_internal_has_dropout_ratio() const {
+  bool value = (_has_bits_[0] & 0x04000000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_dropout_ratio() {
-  _has_bits_[0] &= ~0x04000000u;
+inline bool V0LayerParameter::has_dropout_ratio() const {
+  return _internal_has_dropout_ratio();
 }
 inline void V0LayerParameter::clear_dropout_ratio() {
   dropout_ratio_ = 0.5f;
-  clear_has_dropout_ratio();
+  _has_bits_[0] &= ~0x04000000u;
+}
+inline float V0LayerParameter::_internal_dropout_ratio() const {
+  return dropout_ratio_;
 }
 inline float V0LayerParameter::dropout_ratio() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.dropout_ratio)
-  return dropout_ratio_;
+  return _internal_dropout_ratio();
 }
-inline void V0LayerParameter::set_dropout_ratio(float value) {
-  set_has_dropout_ratio();
+inline void V0LayerParameter::_internal_set_dropout_ratio(float value) {
+  _has_bits_[0] |= 0x04000000u;
   dropout_ratio_ = value;
+}
+inline void V0LayerParameter::set_dropout_ratio(float value) {
+  _internal_set_dropout_ratio(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.dropout_ratio)
 }
 
 // optional uint32 local_size = 13 [default = 5];
-inline bool V0LayerParameter::has_local_size() const {
-  return (_has_bits_[0] & 0x08000000u) != 0;
-}
-inline void V0LayerParameter::set_has_local_size() {
-  _has_bits_[0] |= 0x08000000u;
+inline bool V0LayerParameter::_internal_has_local_size() const {
+  bool value = (_has_bits_[0] & 0x08000000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_local_size() {
-  _has_bits_[0] &= ~0x08000000u;
+inline bool V0LayerParameter::has_local_size() const {
+  return _internal_has_local_size();
 }
 inline void V0LayerParameter::clear_local_size() {
   local_size_ = 5u;
-  clear_has_local_size();
+  _has_bits_[0] &= ~0x08000000u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::local_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.local_size)
+inline uint32_t V0LayerParameter::_internal_local_size() const {
   return local_size_;
 }
-inline void V0LayerParameter::set_local_size(::google::protobuf::uint32 value) {
-  set_has_local_size();
+inline uint32_t V0LayerParameter::local_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.local_size)
+  return _internal_local_size();
+}
+inline void V0LayerParameter::_internal_set_local_size(uint32_t value) {
+  _has_bits_[0] |= 0x08000000u;
   local_size_ = value;
+}
+inline void V0LayerParameter::set_local_size(uint32_t value) {
+  _internal_set_local_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.local_size)
 }
 
 // optional float alpha = 14 [default = 1];
-inline bool V0LayerParameter::has_alpha() const {
-  return (_has_bits_[0] & 0x10000000u) != 0;
-}
-inline void V0LayerParameter::set_has_alpha() {
-  _has_bits_[0] |= 0x10000000u;
+inline bool V0LayerParameter::_internal_has_alpha() const {
+  bool value = (_has_bits_[0] & 0x10000000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_alpha() {
-  _has_bits_[0] &= ~0x10000000u;
+inline bool V0LayerParameter::has_alpha() const {
+  return _internal_has_alpha();
 }
 inline void V0LayerParameter::clear_alpha() {
   alpha_ = 1;
-  clear_has_alpha();
+  _has_bits_[0] &= ~0x10000000u;
+}
+inline float V0LayerParameter::_internal_alpha() const {
+  return alpha_;
 }
 inline float V0LayerParameter::alpha() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.alpha)
-  return alpha_;
+  return _internal_alpha();
 }
-inline void V0LayerParameter::set_alpha(float value) {
-  set_has_alpha();
+inline void V0LayerParameter::_internal_set_alpha(float value) {
+  _has_bits_[0] |= 0x10000000u;
   alpha_ = value;
+}
+inline void V0LayerParameter::set_alpha(float value) {
+  _internal_set_alpha(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.alpha)
 }
 
 // optional float beta = 15 [default = 0.75];
-inline bool V0LayerParameter::has_beta() const {
-  return (_has_bits_[0] & 0x20000000u) != 0;
-}
-inline void V0LayerParameter::set_has_beta() {
-  _has_bits_[0] |= 0x20000000u;
+inline bool V0LayerParameter::_internal_has_beta() const {
+  bool value = (_has_bits_[0] & 0x20000000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_beta() {
-  _has_bits_[0] &= ~0x20000000u;
+inline bool V0LayerParameter::has_beta() const {
+  return _internal_has_beta();
 }
 inline void V0LayerParameter::clear_beta() {
   beta_ = 0.75f;
-  clear_has_beta();
+  _has_bits_[0] &= ~0x20000000u;
+}
+inline float V0LayerParameter::_internal_beta() const {
+  return beta_;
 }
 inline float V0LayerParameter::beta() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.beta)
-  return beta_;
+  return _internal_beta();
 }
-inline void V0LayerParameter::set_beta(float value) {
-  set_has_beta();
+inline void V0LayerParameter::_internal_set_beta(float value) {
+  _has_bits_[0] |= 0x20000000u;
   beta_ = value;
+}
+inline void V0LayerParameter::set_beta(float value) {
+  _internal_set_beta(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.beta)
 }
 
 // optional float k = 22 [default = 1];
-inline bool V0LayerParameter::has_k() const {
-  return (_has_bits_[0] & 0x80000000u) != 0;
-}
-inline void V0LayerParameter::set_has_k() {
-  _has_bits_[0] |= 0x80000000u;
+inline bool V0LayerParameter::_internal_has_k() const {
+  bool value = (_has_bits_[0] & 0x80000000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_k() {
-  _has_bits_[0] &= ~0x80000000u;
+inline bool V0LayerParameter::has_k() const {
+  return _internal_has_k();
 }
 inline void V0LayerParameter::clear_k() {
   k_ = 1;
-  clear_has_k();
+  _has_bits_[0] &= ~0x80000000u;
+}
+inline float V0LayerParameter::_internal_k() const {
+  return k_;
 }
 inline float V0LayerParameter::k() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.k)
-  return k_;
+  return _internal_k();
 }
-inline void V0LayerParameter::set_k(float value) {
-  set_has_k();
+inline void V0LayerParameter::_internal_set_k(float value) {
+  _has_bits_[0] |= 0x80000000u;
   k_ = value;
+}
+inline void V0LayerParameter::set_k(float value) {
+  _internal_set_k(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.k)
 }
 
 // optional string source = 16;
-inline bool V0LayerParameter::has_source() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool V0LayerParameter::_internal_has_source() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void V0LayerParameter::set_has_source() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void V0LayerParameter::clear_has_source() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool V0LayerParameter::has_source() const {
+  return _internal_has_source();
 }
 inline void V0LayerParameter::clear_source() {
-  source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_source();
+  source_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& V0LayerParameter::source() const {
+inline const std::string& V0LayerParameter::source() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.source)
-  return source_.GetNoArena();
+  return _internal_source();
 }
-inline void V0LayerParameter::set_source(const ::std::string& value) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void V0LayerParameter::set_source(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.source)
 }
-#if LANG_CXX11
-inline void V0LayerParameter::set_source(::std::string&& value) {
-  set_has_source();
-  source_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.V0LayerParameter.source)
-}
-#endif
-inline void V0LayerParameter::set_source(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.V0LayerParameter.source)
-}
-inline void V0LayerParameter::set_source(const char* value, size_t size) {
-  set_has_source();
-  source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.V0LayerParameter.source)
-}
-inline ::std::string* V0LayerParameter::mutable_source() {
-  set_has_source();
+inline std::string* V0LayerParameter::mutable_source() {
+  std::string* _s = _internal_mutable_source();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.source)
-  return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& V0LayerParameter::_internal_source() const {
+  return source_.Get();
+}
+inline void V0LayerParameter::_internal_set_source(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  source_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* V0LayerParameter::_internal_mutable_source() {
+  _has_bits_[0] |= 0x00000004u;
+  return source_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* V0LayerParameter::release_source() {
+inline std::string* V0LayerParameter::release_source() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V0LayerParameter.source)
-  clear_has_source();
-  return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_source()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = source_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void V0LayerParameter::set_allocated_source(::std::string* source) {
-  if (source != NULL) {
-    set_has_source();
+inline void V0LayerParameter::set_allocated_source(std::string* source) {
+  if (source != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_source();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  source_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), source,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (source_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    source_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V0LayerParameter.source)
 }
 
 // optional float scale = 17 [default = 1];
-inline bool V0LayerParameter::has_scale() const {
-  return (_has_bits_[0] & 0x40000000u) != 0;
-}
-inline void V0LayerParameter::set_has_scale() {
-  _has_bits_[0] |= 0x40000000u;
+inline bool V0LayerParameter::_internal_has_scale() const {
+  bool value = (_has_bits_[0] & 0x40000000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_scale() {
-  _has_bits_[0] &= ~0x40000000u;
+inline bool V0LayerParameter::has_scale() const {
+  return _internal_has_scale();
 }
 inline void V0LayerParameter::clear_scale() {
   scale_ = 1;
-  clear_has_scale();
+  _has_bits_[0] &= ~0x40000000u;
+}
+inline float V0LayerParameter::_internal_scale() const {
+  return scale_;
 }
 inline float V0LayerParameter::scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.scale)
-  return scale_;
+  return _internal_scale();
 }
-inline void V0LayerParameter::set_scale(float value) {
-  set_has_scale();
+inline void V0LayerParameter::_internal_set_scale(float value) {
+  _has_bits_[0] |= 0x40000000u;
   scale_ = value;
+}
+inline void V0LayerParameter::set_scale(float value) {
+  _internal_set_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.scale)
 }
 
 // optional string meanfile = 18;
-inline bool V0LayerParameter::has_meanfile() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void V0LayerParameter::set_has_meanfile() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool V0LayerParameter::_internal_has_meanfile() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_meanfile() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool V0LayerParameter::has_meanfile() const {
+  return _internal_has_meanfile();
 }
 inline void V0LayerParameter::clear_meanfile() {
-  meanfile_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_meanfile();
+  meanfile_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::std::string& V0LayerParameter::meanfile() const {
+inline const std::string& V0LayerParameter::meanfile() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.meanfile)
-  return meanfile_.GetNoArena();
+  return _internal_meanfile();
 }
-inline void V0LayerParameter::set_meanfile(const ::std::string& value) {
-  set_has_meanfile();
-  meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void V0LayerParameter::set_meanfile(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ meanfile_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.meanfile)
 }
-#if LANG_CXX11
-inline void V0LayerParameter::set_meanfile(::std::string&& value) {
-  set_has_meanfile();
-  meanfile_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.V0LayerParameter.meanfile)
-}
-#endif
-inline void V0LayerParameter::set_meanfile(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_meanfile();
-  meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.V0LayerParameter.meanfile)
-}
-inline void V0LayerParameter::set_meanfile(const char* value, size_t size) {
-  set_has_meanfile();
-  meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.V0LayerParameter.meanfile)
-}
-inline ::std::string* V0LayerParameter::mutable_meanfile() {
-  set_has_meanfile();
+inline std::string* V0LayerParameter::mutable_meanfile() {
+  std::string* _s = _internal_mutable_meanfile();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.meanfile)
-  return meanfile_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& V0LayerParameter::_internal_meanfile() const {
+  return meanfile_.Get();
+}
+inline void V0LayerParameter::_internal_set_meanfile(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  meanfile_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* V0LayerParameter::release_meanfile() {
+inline std::string* V0LayerParameter::_internal_mutable_meanfile() {
+  _has_bits_[0] |= 0x00000008u;
+  return meanfile_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* V0LayerParameter::release_meanfile() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V0LayerParameter.meanfile)
-  clear_has_meanfile();
-  return meanfile_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_meanfile()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000008u;
+  auto* p = meanfile_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (meanfile_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    meanfile_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void V0LayerParameter::set_allocated_meanfile(::std::string* meanfile) {
-  if (meanfile != NULL) {
-    set_has_meanfile();
+inline void V0LayerParameter::set_allocated_meanfile(std::string* meanfile) {
+  if (meanfile != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_meanfile();
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  meanfile_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), meanfile,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (meanfile_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    meanfile_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  meanfile_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), meanfile);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V0LayerParameter.meanfile)
 }
 
 // optional uint32 batchsize = 19;
-inline bool V0LayerParameter::has_batchsize() const {
-  return (_has_bits_[0] & 0x00001000u) != 0;
-}
-inline void V0LayerParameter::set_has_batchsize() {
-  _has_bits_[0] |= 0x00001000u;
+inline bool V0LayerParameter::_internal_has_batchsize() const {
+  bool value = (_has_bits_[0] & 0x00001000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_batchsize() {
-  _has_bits_[0] &= ~0x00001000u;
+inline bool V0LayerParameter::has_batchsize() const {
+  return _internal_has_batchsize();
 }
 inline void V0LayerParameter::clear_batchsize() {
   batchsize_ = 0u;
-  clear_has_batchsize();
+  _has_bits_[0] &= ~0x00001000u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::batchsize() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.batchsize)
+inline uint32_t V0LayerParameter::_internal_batchsize() const {
   return batchsize_;
 }
-inline void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) {
-  set_has_batchsize();
+inline uint32_t V0LayerParameter::batchsize() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.batchsize)
+  return _internal_batchsize();
+}
+inline void V0LayerParameter::_internal_set_batchsize(uint32_t value) {
+  _has_bits_[0] |= 0x00001000u;
   batchsize_ = value;
+}
+inline void V0LayerParameter::set_batchsize(uint32_t value) {
+  _internal_set_batchsize(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.batchsize)
 }
 
 // optional uint32 cropsize = 20 [default = 0];
-inline bool V0LayerParameter::has_cropsize() const {
-  return (_has_bits_[0] & 0x00002000u) != 0;
-}
-inline void V0LayerParameter::set_has_cropsize() {
-  _has_bits_[0] |= 0x00002000u;
+inline bool V0LayerParameter::_internal_has_cropsize() const {
+  bool value = (_has_bits_[0] & 0x00002000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_cropsize() {
-  _has_bits_[0] &= ~0x00002000u;
+inline bool V0LayerParameter::has_cropsize() const {
+  return _internal_has_cropsize();
 }
 inline void V0LayerParameter::clear_cropsize() {
   cropsize_ = 0u;
-  clear_has_cropsize();
+  _has_bits_[0] &= ~0x00002000u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::cropsize() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.cropsize)
+inline uint32_t V0LayerParameter::_internal_cropsize() const {
   return cropsize_;
 }
-inline void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) {
-  set_has_cropsize();
+inline uint32_t V0LayerParameter::cropsize() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.cropsize)
+  return _internal_cropsize();
+}
+inline void V0LayerParameter::_internal_set_cropsize(uint32_t value) {
+  _has_bits_[0] |= 0x00002000u;
   cropsize_ = value;
+}
+inline void V0LayerParameter::set_cropsize(uint32_t value) {
+  _internal_set_cropsize(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.cropsize)
 }
 
 // optional bool mirror = 21 [default = false];
-inline bool V0LayerParameter::has_mirror() const {
-  return (_has_bits_[0] & 0x00008000u) != 0;
-}
-inline void V0LayerParameter::set_has_mirror() {
-  _has_bits_[0] |= 0x00008000u;
+inline bool V0LayerParameter::_internal_has_mirror() const {
+  bool value = (_has_bits_[0] & 0x00008000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_mirror() {
-  _has_bits_[0] &= ~0x00008000u;
+inline bool V0LayerParameter::has_mirror() const {
+  return _internal_has_mirror();
 }
 inline void V0LayerParameter::clear_mirror() {
   mirror_ = false;
-  clear_has_mirror();
+  _has_bits_[0] &= ~0x00008000u;
+}
+inline bool V0LayerParameter::_internal_mirror() const {
+  return mirror_;
 }
 inline bool V0LayerParameter::mirror() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.mirror)
-  return mirror_;
+  return _internal_mirror();
 }
-inline void V0LayerParameter::set_mirror(bool value) {
-  set_has_mirror();
+inline void V0LayerParameter::_internal_set_mirror(bool value) {
+  _has_bits_[0] |= 0x00008000u;
   mirror_ = value;
+}
+inline void V0LayerParameter::set_mirror(bool value) {
+  _internal_set_mirror(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.mirror)
 }
 
 // repeated .opencv_caffe.BlobProto blobs = 50;
-inline int V0LayerParameter::blobs_size() const {
+inline int V0LayerParameter::_internal_blobs_size() const {
   return blobs_.size();
 }
+inline int V0LayerParameter::blobs_size() const {
+  return _internal_blobs_size();
+}
 inline void V0LayerParameter::clear_blobs() {
   blobs_.Clear();
 }
-inline const ::opencv_caffe::BlobProto& V0LayerParameter::blobs(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.blobs)
-  return blobs_.Get(index);
-}
 inline ::opencv_caffe::BlobProto* V0LayerParameter::mutable_blobs(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.blobs)
   return blobs_.Mutable(index);
 }
-inline ::opencv_caffe::BlobProto* V0LayerParameter::add_blobs() {
-  // @@protoc_insertion_point(field_add:opencv_caffe.V0LayerParameter.blobs)
-  return blobs_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >*
 V0LayerParameter::mutable_blobs() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V0LayerParameter.blobs)
   return &blobs_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_caffe::BlobProto >&
+inline const ::opencv_caffe::BlobProto& V0LayerParameter::_internal_blobs(int index) const {
+  return blobs_.Get(index);
+}
+inline const ::opencv_caffe::BlobProto& V0LayerParameter::blobs(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.blobs)
+  return _internal_blobs(index);
+}
+inline ::opencv_caffe::BlobProto* V0LayerParameter::_internal_add_blobs() {
+  return blobs_.Add();
+}
+inline ::opencv_caffe::BlobProto* V0LayerParameter::add_blobs() {
+  ::opencv_caffe::BlobProto* _add = _internal_add_blobs();
+  // @@protoc_insertion_point(field_add:opencv_caffe.V0LayerParameter.blobs)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_caffe::BlobProto >&
 V0LayerParameter::blobs() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V0LayerParameter.blobs)
   return blobs_;
 }
 
 // repeated float blobs_lr = 51;
-inline int V0LayerParameter::blobs_lr_size() const {
+inline int V0LayerParameter::_internal_blobs_lr_size() const {
   return blobs_lr_.size();
 }
+inline int V0LayerParameter::blobs_lr_size() const {
+  return _internal_blobs_lr_size();
+}
 inline void V0LayerParameter::clear_blobs_lr() {
   blobs_lr_.Clear();
 }
+inline float V0LayerParameter::_internal_blobs_lr(int index) const {
+  return blobs_lr_.Get(index);
+}
 inline float V0LayerParameter::blobs_lr(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.blobs_lr)
-  return blobs_lr_.Get(index);
+  return _internal_blobs_lr(index);
 }
 inline void V0LayerParameter::set_blobs_lr(int index, float value) {
   blobs_lr_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.blobs_lr)
 }
-inline void V0LayerParameter::add_blobs_lr(float value) {
+inline void V0LayerParameter::_internal_add_blobs_lr(float value) {
   blobs_lr_.Add(value);
+}
+inline void V0LayerParameter::add_blobs_lr(float value) {
+  _internal_add_blobs_lr(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V0LayerParameter.blobs_lr)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+V0LayerParameter::_internal_blobs_lr() const {
+  return blobs_lr_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 V0LayerParameter::blobs_lr() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V0LayerParameter.blobs_lr)
-  return blobs_lr_;
+  return _internal_blobs_lr();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+V0LayerParameter::_internal_mutable_blobs_lr() {
+  return &blobs_lr_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 V0LayerParameter::mutable_blobs_lr() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V0LayerParameter.blobs_lr)
-  return &blobs_lr_;
+  return _internal_mutable_blobs_lr();
 }
 
 // repeated float weight_decay = 52;
-inline int V0LayerParameter::weight_decay_size() const {
+inline int V0LayerParameter::_internal_weight_decay_size() const {
   return weight_decay_.size();
 }
+inline int V0LayerParameter::weight_decay_size() const {
+  return _internal_weight_decay_size();
+}
 inline void V0LayerParameter::clear_weight_decay() {
   weight_decay_.Clear();
 }
+inline float V0LayerParameter::_internal_weight_decay(int index) const {
+  return weight_decay_.Get(index);
+}
 inline float V0LayerParameter::weight_decay(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.weight_decay)
-  return weight_decay_.Get(index);
+  return _internal_weight_decay(index);
 }
 inline void V0LayerParameter::set_weight_decay(int index, float value) {
   weight_decay_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.weight_decay)
 }
-inline void V0LayerParameter::add_weight_decay(float value) {
+inline void V0LayerParameter::_internal_add_weight_decay(float value) {
   weight_decay_.Add(value);
+}
+inline void V0LayerParameter::add_weight_decay(float value) {
+  _internal_add_weight_decay(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.V0LayerParameter.weight_decay)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+V0LayerParameter::_internal_weight_decay() const {
+  return weight_decay_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 V0LayerParameter::weight_decay() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.V0LayerParameter.weight_decay)
-  return weight_decay_;
+  return _internal_weight_decay();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+V0LayerParameter::_internal_mutable_weight_decay() {
+  return &weight_decay_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 V0LayerParameter::mutable_weight_decay() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.V0LayerParameter.weight_decay)
-  return &weight_decay_;
+  return _internal_mutable_weight_decay();
 }
 
 // optional uint32 rand_skip = 53 [default = 0];
-inline bool V0LayerParameter::has_rand_skip() const {
-  return (_has_bits_[0] & 0x00020000u) != 0;
-}
-inline void V0LayerParameter::set_has_rand_skip() {
-  _has_bits_[0] |= 0x00020000u;
+inline bool V0LayerParameter::_internal_has_rand_skip() const {
+  bool value = (_has_bits_[0] & 0x00020000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_rand_skip() {
-  _has_bits_[0] &= ~0x00020000u;
+inline bool V0LayerParameter::has_rand_skip() const {
+  return _internal_has_rand_skip();
 }
 inline void V0LayerParameter::clear_rand_skip() {
   rand_skip_ = 0u;
-  clear_has_rand_skip();
+  _has_bits_[0] &= ~0x00020000u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::rand_skip() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.rand_skip)
+inline uint32_t V0LayerParameter::_internal_rand_skip() const {
   return rand_skip_;
 }
-inline void V0LayerParameter::set_rand_skip(::google::protobuf::uint32 value) {
-  set_has_rand_skip();
+inline uint32_t V0LayerParameter::rand_skip() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.rand_skip)
+  return _internal_rand_skip();
+}
+inline void V0LayerParameter::_internal_set_rand_skip(uint32_t value) {
+  _has_bits_[0] |= 0x00020000u;
   rand_skip_ = value;
+}
+inline void V0LayerParameter::set_rand_skip(uint32_t value) {
+  _internal_set_rand_skip(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.rand_skip)
 }
 
 // optional float det_fg_threshold = 54 [default = 0.5];
-inline bool V0LayerParameter::has_det_fg_threshold() const {
-  return (_has_bits_[1] & 0x00000001u) != 0;
+inline bool V0LayerParameter::_internal_has_det_fg_threshold() const {
+  bool value = (_has_bits_[1] & 0x00000001u) != 0;
+  return value;
 }
-inline void V0LayerParameter::set_has_det_fg_threshold() {
-  _has_bits_[1] |= 0x00000001u;
-}
-inline void V0LayerParameter::clear_has_det_fg_threshold() {
-  _has_bits_[1] &= ~0x00000001u;
+inline bool V0LayerParameter::has_det_fg_threshold() const {
+  return _internal_has_det_fg_threshold();
 }
 inline void V0LayerParameter::clear_det_fg_threshold() {
   det_fg_threshold_ = 0.5f;
-  clear_has_det_fg_threshold();
+  _has_bits_[1] &= ~0x00000001u;
+}
+inline float V0LayerParameter::_internal_det_fg_threshold() const {
+  return det_fg_threshold_;
 }
 inline float V0LayerParameter::det_fg_threshold() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.det_fg_threshold)
-  return det_fg_threshold_;
+  return _internal_det_fg_threshold();
 }
-inline void V0LayerParameter::set_det_fg_threshold(float value) {
-  set_has_det_fg_threshold();
+inline void V0LayerParameter::_internal_set_det_fg_threshold(float value) {
+  _has_bits_[1] |= 0x00000001u;
   det_fg_threshold_ = value;
+}
+inline void V0LayerParameter::set_det_fg_threshold(float value) {
+  _internal_set_det_fg_threshold(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.det_fg_threshold)
 }
 
 // optional float det_bg_threshold = 55 [default = 0.5];
-inline bool V0LayerParameter::has_det_bg_threshold() const {
-  return (_has_bits_[1] & 0x00000002u) != 0;
-}
-inline void V0LayerParameter::set_has_det_bg_threshold() {
-  _has_bits_[1] |= 0x00000002u;
+inline bool V0LayerParameter::_internal_has_det_bg_threshold() const {
+  bool value = (_has_bits_[1] & 0x00000002u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_det_bg_threshold() {
-  _has_bits_[1] &= ~0x00000002u;
+inline bool V0LayerParameter::has_det_bg_threshold() const {
+  return _internal_has_det_bg_threshold();
 }
 inline void V0LayerParameter::clear_det_bg_threshold() {
   det_bg_threshold_ = 0.5f;
-  clear_has_det_bg_threshold();
+  _has_bits_[1] &= ~0x00000002u;
+}
+inline float V0LayerParameter::_internal_det_bg_threshold() const {
+  return det_bg_threshold_;
 }
 inline float V0LayerParameter::det_bg_threshold() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.det_bg_threshold)
-  return det_bg_threshold_;
+  return _internal_det_bg_threshold();
 }
-inline void V0LayerParameter::set_det_bg_threshold(float value) {
-  set_has_det_bg_threshold();
+inline void V0LayerParameter::_internal_set_det_bg_threshold(float value) {
+  _has_bits_[1] |= 0x00000002u;
   det_bg_threshold_ = value;
+}
+inline void V0LayerParameter::set_det_bg_threshold(float value) {
+  _internal_set_det_bg_threshold(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.det_bg_threshold)
 }
 
 // optional float det_fg_fraction = 56 [default = 0.25];
-inline bool V0LayerParameter::has_det_fg_fraction() const {
-  return (_has_bits_[1] & 0x00000004u) != 0;
-}
-inline void V0LayerParameter::set_has_det_fg_fraction() {
-  _has_bits_[1] |= 0x00000004u;
+inline bool V0LayerParameter::_internal_has_det_fg_fraction() const {
+  bool value = (_has_bits_[1] & 0x00000004u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_det_fg_fraction() {
-  _has_bits_[1] &= ~0x00000004u;
+inline bool V0LayerParameter::has_det_fg_fraction() const {
+  return _internal_has_det_fg_fraction();
 }
 inline void V0LayerParameter::clear_det_fg_fraction() {
   det_fg_fraction_ = 0.25f;
-  clear_has_det_fg_fraction();
+  _has_bits_[1] &= ~0x00000004u;
+}
+inline float V0LayerParameter::_internal_det_fg_fraction() const {
+  return det_fg_fraction_;
 }
 inline float V0LayerParameter::det_fg_fraction() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.det_fg_fraction)
-  return det_fg_fraction_;
+  return _internal_det_fg_fraction();
 }
-inline void V0LayerParameter::set_det_fg_fraction(float value) {
-  set_has_det_fg_fraction();
+inline void V0LayerParameter::_internal_set_det_fg_fraction(float value) {
+  _has_bits_[1] |= 0x00000004u;
   det_fg_fraction_ = value;
+}
+inline void V0LayerParameter::set_det_fg_fraction(float value) {
+  _internal_set_det_fg_fraction(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.det_fg_fraction)
 }
 
 // optional uint32 det_context_pad = 58 [default = 0];
-inline bool V0LayerParameter::has_det_context_pad() const {
-  return (_has_bits_[0] & 0x00040000u) != 0;
-}
-inline void V0LayerParameter::set_has_det_context_pad() {
-  _has_bits_[0] |= 0x00040000u;
+inline bool V0LayerParameter::_internal_has_det_context_pad() const {
+  bool value = (_has_bits_[0] & 0x00040000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_det_context_pad() {
-  _has_bits_[0] &= ~0x00040000u;
+inline bool V0LayerParameter::has_det_context_pad() const {
+  return _internal_has_det_context_pad();
 }
 inline void V0LayerParameter::clear_det_context_pad() {
   det_context_pad_ = 0u;
-  clear_has_det_context_pad();
+  _has_bits_[0] &= ~0x00040000u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::det_context_pad() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.det_context_pad)
+inline uint32_t V0LayerParameter::_internal_det_context_pad() const {
   return det_context_pad_;
 }
-inline void V0LayerParameter::set_det_context_pad(::google::protobuf::uint32 value) {
-  set_has_det_context_pad();
+inline uint32_t V0LayerParameter::det_context_pad() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.det_context_pad)
+  return _internal_det_context_pad();
+}
+inline void V0LayerParameter::_internal_set_det_context_pad(uint32_t value) {
+  _has_bits_[0] |= 0x00040000u;
   det_context_pad_ = value;
+}
+inline void V0LayerParameter::set_det_context_pad(uint32_t value) {
+  _internal_set_det_context_pad(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.det_context_pad)
 }
 
 // optional string det_crop_mode = 59 [default = "warp"];
-inline bool V0LayerParameter::has_det_crop_mode() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void V0LayerParameter::set_has_det_crop_mode() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool V0LayerParameter::_internal_has_det_crop_mode() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_det_crop_mode() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool V0LayerParameter::has_det_crop_mode() const {
+  return _internal_has_det_crop_mode();
 }
 inline void V0LayerParameter::clear_det_crop_mode() {
-  det_crop_mode_.ClearToDefaultNoArena(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get());
-  clear_has_det_crop_mode();
+  det_crop_mode_.ClearToDefault(::opencv_caffe::V0LayerParameter::_i_give_permission_to_break_this_code_default_det_crop_mode_, GetArenaForAllocation());
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline const ::std::string& V0LayerParameter::det_crop_mode() const {
+inline const std::string& V0LayerParameter::det_crop_mode() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.det_crop_mode)
-  return det_crop_mode_.GetNoArena();
-}
-inline void V0LayerParameter::set_det_crop_mode(const ::std::string& value) {
-  set_has_det_crop_mode();
-  det_crop_mode_.SetNoArena(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get(), value);
+  if (det_crop_mode_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_det_crop_mode_.get();
+  return _internal_det_crop_mode();
+}
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void V0LayerParameter::set_det_crop_mode(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000010u;
+ det_crop_mode_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.det_crop_mode)
 }
-#if LANG_CXX11
-inline void V0LayerParameter::set_det_crop_mode(::std::string&& value) {
-  set_has_det_crop_mode();
-  det_crop_mode_.SetNoArena(
-    &::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_caffe.V0LayerParameter.det_crop_mode)
-}
-#endif
-inline void V0LayerParameter::set_det_crop_mode(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_det_crop_mode();
-  det_crop_mode_.SetNoArena(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_caffe.V0LayerParameter.det_crop_mode)
-}
-inline void V0LayerParameter::set_det_crop_mode(const char* value, size_t size) {
-  set_has_det_crop_mode();
-  det_crop_mode_.SetNoArena(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_caffe.V0LayerParameter.det_crop_mode)
-}
-inline ::std::string* V0LayerParameter::mutable_det_crop_mode() {
-  set_has_det_crop_mode();
+inline std::string* V0LayerParameter::mutable_det_crop_mode() {
+  std::string* _s = _internal_mutable_det_crop_mode();
   // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.det_crop_mode)
-  return det_crop_mode_.MutableNoArena(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get());
+  return _s;
+}
+inline const std::string& V0LayerParameter::_internal_det_crop_mode() const {
+  return det_crop_mode_.Get();
+}
+inline void V0LayerParameter::_internal_set_det_crop_mode(const std::string& value) {
+  _has_bits_[0] |= 0x00000010u;
+  det_crop_mode_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* V0LayerParameter::_internal_mutable_det_crop_mode() {
+  _has_bits_[0] |= 0x00000010u;
+  return det_crop_mode_.Mutable(::opencv_caffe::V0LayerParameter::_i_give_permission_to_break_this_code_default_det_crop_mode_, GetArenaForAllocation());
 }
-inline ::std::string* V0LayerParameter::release_det_crop_mode() {
+inline std::string* V0LayerParameter::release_det_crop_mode() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V0LayerParameter.det_crop_mode)
-  clear_has_det_crop_mode();
-  return det_crop_mode_.ReleaseNoArena(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get());
+  if (!_internal_has_det_crop_mode()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000010u;
+  auto* p = det_crop_mode_.ReleaseNonDefault(nullptr, GetArenaForAllocation());
+  return p;
 }
-inline void V0LayerParameter::set_allocated_det_crop_mode(::std::string* det_crop_mode) {
-  if (det_crop_mode != NULL) {
-    set_has_det_crop_mode();
+inline void V0LayerParameter::set_allocated_det_crop_mode(std::string* det_crop_mode) {
+  if (det_crop_mode != nullptr) {
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_det_crop_mode();
+    _has_bits_[0] &= ~0x00000010u;
   }
-  det_crop_mode_.SetAllocatedNoArena(&::opencv_caffe::V0LayerParameter::_default_det_crop_mode_.get(), det_crop_mode);
+  det_crop_mode_.SetAllocated(nullptr, det_crop_mode,
+      GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V0LayerParameter.det_crop_mode)
 }
 
 // optional int32 new_num = 60 [default = 0];
-inline bool V0LayerParameter::has_new_num() const {
-  return (_has_bits_[0] & 0x00080000u) != 0;
-}
-inline void V0LayerParameter::set_has_new_num() {
-  _has_bits_[0] |= 0x00080000u;
+inline bool V0LayerParameter::_internal_has_new_num() const {
+  bool value = (_has_bits_[0] & 0x00080000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_new_num() {
-  _has_bits_[0] &= ~0x00080000u;
+inline bool V0LayerParameter::has_new_num() const {
+  return _internal_has_new_num();
 }
 inline void V0LayerParameter::clear_new_num() {
   new_num_ = 0;
-  clear_has_new_num();
+  _has_bits_[0] &= ~0x00080000u;
 }
-inline ::google::protobuf::int32 V0LayerParameter::new_num() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.new_num)
+inline int32_t V0LayerParameter::_internal_new_num() const {
   return new_num_;
 }
-inline void V0LayerParameter::set_new_num(::google::protobuf::int32 value) {
-  set_has_new_num();
+inline int32_t V0LayerParameter::new_num() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.new_num)
+  return _internal_new_num();
+}
+inline void V0LayerParameter::_internal_set_new_num(int32_t value) {
+  _has_bits_[0] |= 0x00080000u;
   new_num_ = value;
+}
+inline void V0LayerParameter::set_new_num(int32_t value) {
+  _internal_set_new_num(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.new_num)
 }
 
 // optional int32 new_channels = 61 [default = 0];
-inline bool V0LayerParameter::has_new_channels() const {
-  return (_has_bits_[0] & 0x00100000u) != 0;
-}
-inline void V0LayerParameter::set_has_new_channels() {
-  _has_bits_[0] |= 0x00100000u;
+inline bool V0LayerParameter::_internal_has_new_channels() const {
+  bool value = (_has_bits_[0] & 0x00100000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_new_channels() {
-  _has_bits_[0] &= ~0x00100000u;
+inline bool V0LayerParameter::has_new_channels() const {
+  return _internal_has_new_channels();
 }
 inline void V0LayerParameter::clear_new_channels() {
   new_channels_ = 0;
-  clear_has_new_channels();
+  _has_bits_[0] &= ~0x00100000u;
 }
-inline ::google::protobuf::int32 V0LayerParameter::new_channels() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.new_channels)
+inline int32_t V0LayerParameter::_internal_new_channels() const {
   return new_channels_;
 }
-inline void V0LayerParameter::set_new_channels(::google::protobuf::int32 value) {
-  set_has_new_channels();
+inline int32_t V0LayerParameter::new_channels() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.new_channels)
+  return _internal_new_channels();
+}
+inline void V0LayerParameter::_internal_set_new_channels(int32_t value) {
+  _has_bits_[0] |= 0x00100000u;
   new_channels_ = value;
+}
+inline void V0LayerParameter::set_new_channels(int32_t value) {
+  _internal_set_new_channels(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.new_channels)
 }
 
 // optional int32 new_height = 62 [default = 0];
-inline bool V0LayerParameter::has_new_height() const {
-  return (_has_bits_[0] & 0x00200000u) != 0;
+inline bool V0LayerParameter::_internal_has_new_height() const {
+  bool value = (_has_bits_[0] & 0x00200000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::set_has_new_height() {
-  _has_bits_[0] |= 0x00200000u;
-}
-inline void V0LayerParameter::clear_has_new_height() {
-  _has_bits_[0] &= ~0x00200000u;
+inline bool V0LayerParameter::has_new_height() const {
+  return _internal_has_new_height();
 }
 inline void V0LayerParameter::clear_new_height() {
   new_height_ = 0;
-  clear_has_new_height();
+  _has_bits_[0] &= ~0x00200000u;
 }
-inline ::google::protobuf::int32 V0LayerParameter::new_height() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.new_height)
+inline int32_t V0LayerParameter::_internal_new_height() const {
   return new_height_;
 }
-inline void V0LayerParameter::set_new_height(::google::protobuf::int32 value) {
-  set_has_new_height();
+inline int32_t V0LayerParameter::new_height() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.new_height)
+  return _internal_new_height();
+}
+inline void V0LayerParameter::_internal_set_new_height(int32_t value) {
+  _has_bits_[0] |= 0x00200000u;
   new_height_ = value;
+}
+inline void V0LayerParameter::set_new_height(int32_t value) {
+  _internal_set_new_height(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.new_height)
 }
 
 // optional int32 new_width = 63 [default = 0];
-inline bool V0LayerParameter::has_new_width() const {
-  return (_has_bits_[0] & 0x00004000u) != 0;
-}
-inline void V0LayerParameter::set_has_new_width() {
-  _has_bits_[0] |= 0x00004000u;
+inline bool V0LayerParameter::_internal_has_new_width() const {
+  bool value = (_has_bits_[0] & 0x00004000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_new_width() {
-  _has_bits_[0] &= ~0x00004000u;
+inline bool V0LayerParameter::has_new_width() const {
+  return _internal_has_new_width();
 }
 inline void V0LayerParameter::clear_new_width() {
   new_width_ = 0;
-  clear_has_new_width();
+  _has_bits_[0] &= ~0x00004000u;
 }
-inline ::google::protobuf::int32 V0LayerParameter::new_width() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.new_width)
+inline int32_t V0LayerParameter::_internal_new_width() const {
   return new_width_;
 }
-inline void V0LayerParameter::set_new_width(::google::protobuf::int32 value) {
-  set_has_new_width();
+inline int32_t V0LayerParameter::new_width() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.new_width)
+  return _internal_new_width();
+}
+inline void V0LayerParameter::_internal_set_new_width(int32_t value) {
+  _has_bits_[0] |= 0x00004000u;
   new_width_ = value;
+}
+inline void V0LayerParameter::set_new_width(int32_t value) {
+  _internal_set_new_width(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.new_width)
 }
 
 // optional bool shuffle_images = 64 [default = false];
-inline bool V0LayerParameter::has_shuffle_images() const {
-  return (_has_bits_[0] & 0x00010000u) != 0;
-}
-inline void V0LayerParameter::set_has_shuffle_images() {
-  _has_bits_[0] |= 0x00010000u;
+inline bool V0LayerParameter::_internal_has_shuffle_images() const {
+  bool value = (_has_bits_[0] & 0x00010000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_shuffle_images() {
-  _has_bits_[0] &= ~0x00010000u;
+inline bool V0LayerParameter::has_shuffle_images() const {
+  return _internal_has_shuffle_images();
 }
 inline void V0LayerParameter::clear_shuffle_images() {
   shuffle_images_ = false;
-  clear_has_shuffle_images();
+  _has_bits_[0] &= ~0x00010000u;
+}
+inline bool V0LayerParameter::_internal_shuffle_images() const {
+  return shuffle_images_;
 }
 inline bool V0LayerParameter::shuffle_images() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.shuffle_images)
-  return shuffle_images_;
+  return _internal_shuffle_images();
 }
-inline void V0LayerParameter::set_shuffle_images(bool value) {
-  set_has_shuffle_images();
+inline void V0LayerParameter::_internal_set_shuffle_images(bool value) {
+  _has_bits_[0] |= 0x00010000u;
   shuffle_images_ = value;
+}
+inline void V0LayerParameter::set_shuffle_images(bool value) {
+  _internal_set_shuffle_images(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.shuffle_images)
 }
 
 // optional uint32 concat_dim = 65 [default = 1];
-inline bool V0LayerParameter::has_concat_dim() const {
-  return (_has_bits_[0] & 0x00400000u) != 0;
-}
-inline void V0LayerParameter::set_has_concat_dim() {
-  _has_bits_[0] |= 0x00400000u;
+inline bool V0LayerParameter::_internal_has_concat_dim() const {
+  bool value = (_has_bits_[0] & 0x00400000u) != 0;
+  return value;
 }
-inline void V0LayerParameter::clear_has_concat_dim() {
-  _has_bits_[0] &= ~0x00400000u;
+inline bool V0LayerParameter::has_concat_dim() const {
+  return _internal_has_concat_dim();
 }
 inline void V0LayerParameter::clear_concat_dim() {
   concat_dim_ = 1u;
-  clear_has_concat_dim();
+  _has_bits_[0] &= ~0x00400000u;
 }
-inline ::google::protobuf::uint32 V0LayerParameter::concat_dim() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.concat_dim)
+inline uint32_t V0LayerParameter::_internal_concat_dim() const {
   return concat_dim_;
 }
-inline void V0LayerParameter::set_concat_dim(::google::protobuf::uint32 value) {
-  set_has_concat_dim();
+inline uint32_t V0LayerParameter::concat_dim() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.concat_dim)
+  return _internal_concat_dim();
+}
+inline void V0LayerParameter::_internal_set_concat_dim(uint32_t value) {
+  _has_bits_[0] |= 0x00400000u;
   concat_dim_ = value;
+}
+inline void V0LayerParameter::set_concat_dim(uint32_t value) {
+  _internal_set_concat_dim(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.V0LayerParameter.concat_dim)
 }
 
 // optional .opencv_caffe.HDF5OutputParameter hdf5_output_param = 1001;
-inline bool V0LayerParameter::has_hdf5_output_param() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
+inline bool V0LayerParameter::_internal_has_hdf5_output_param() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  PROTOBUF_ASSUME(!value || hdf5_output_param_ != nullptr);
+  return value;
 }
-inline void V0LayerParameter::set_has_hdf5_output_param() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool V0LayerParameter::has_hdf5_output_param() const {
+  return _internal_has_hdf5_output_param();
 }
-inline void V0LayerParameter::clear_has_hdf5_output_param() {
+inline void V0LayerParameter::clear_hdf5_output_param() {
+  if (hdf5_output_param_ != nullptr) hdf5_output_param_->Clear();
   _has_bits_[0] &= ~0x00000080u;
 }
-inline void V0LayerParameter::clear_hdf5_output_param() {
-  if (hdf5_output_param_ != NULL) hdf5_output_param_->Clear();
-  clear_has_hdf5_output_param();
+inline const ::opencv_caffe::HDF5OutputParameter& V0LayerParameter::_internal_hdf5_output_param() const {
+  const ::opencv_caffe::HDF5OutputParameter* p = hdf5_output_param_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::HDF5OutputParameter&>(
+      ::opencv_caffe::_HDF5OutputParameter_default_instance_);
 }
 inline const ::opencv_caffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const {
-  const ::opencv_caffe::HDF5OutputParameter* p = hdf5_output_param_;
   // @@protoc_insertion_point(field_get:opencv_caffe.V0LayerParameter.hdf5_output_param)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::HDF5OutputParameter*>(
-      &::opencv_caffe::_HDF5OutputParameter_default_instance_);
+  return _internal_hdf5_output_param();
+}
+inline void V0LayerParameter::unsafe_arena_set_allocated_hdf5_output_param(
+    ::opencv_caffe::HDF5OutputParameter* hdf5_output_param) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(hdf5_output_param_);
+  }
+  hdf5_output_param_ = hdf5_output_param;
+  if (hdf5_output_param) {
+    _has_bits_[0] |= 0x00000080u;
+  } else {
+    _has_bits_[0] &= ~0x00000080u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.V0LayerParameter.hdf5_output_param)
 }
 inline ::opencv_caffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() {
+  _has_bits_[0] &= ~0x00000080u;
+  ::opencv_caffe::HDF5OutputParameter* temp = hdf5_output_param_;
+  hdf5_output_param_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::HDF5OutputParameter* V0LayerParameter::unsafe_arena_release_hdf5_output_param() {
   // @@protoc_insertion_point(field_release:opencv_caffe.V0LayerParameter.hdf5_output_param)
-  clear_has_hdf5_output_param();
+  _has_bits_[0] &= ~0x00000080u;
   ::opencv_caffe::HDF5OutputParameter* temp = hdf5_output_param_;
-  hdf5_output_param_ = NULL;
+  hdf5_output_param_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() {
-  set_has_hdf5_output_param();
-  if (hdf5_output_param_ == NULL) {
-    hdf5_output_param_ = new ::opencv_caffe::HDF5OutputParameter;
+inline ::opencv_caffe::HDF5OutputParameter* V0LayerParameter::_internal_mutable_hdf5_output_param() {
+  _has_bits_[0] |= 0x00000080u;
+  if (hdf5_output_param_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::HDF5OutputParameter>(GetArenaForAllocation());
+    hdf5_output_param_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.hdf5_output_param)
   return hdf5_output_param_;
 }
+inline ::opencv_caffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() {
+  ::opencv_caffe::HDF5OutputParameter* _msg = _internal_mutable_hdf5_output_param();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.V0LayerParameter.hdf5_output_param)
+  return _msg;
+}
 inline void V0LayerParameter::set_allocated_hdf5_output_param(::opencv_caffe::HDF5OutputParameter* hdf5_output_param) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete hdf5_output_param_;
   }
   if (hdf5_output_param) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::HDF5OutputParameter>::GetOwningArena(hdf5_output_param);
     if (message_arena != submessage_arena) {
-      hdf5_output_param = ::google::protobuf::internal::GetOwnedMessage(
+      hdf5_output_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, hdf5_output_param, submessage_arena);
     }
-    set_has_hdf5_output_param();
+    _has_bits_[0] |= 0x00000080u;
   } else {
-    clear_has_hdf5_output_param();
+    _has_bits_[0] &= ~0x00000080u;
   }
   hdf5_output_param_ = hdf5_output_param;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.V0LayerParameter.hdf5_output_param)
@@ -31793,80 +43864,120 @@ inline void V0LayerParameter::set_allocated_hdf5_output_param(::opencv_caffe::HD
 // PReLUParameter
 
 // optional .opencv_caffe.FillerParameter filler = 1;
-inline bool PReLUParameter::has_filler() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool PReLUParameter::_internal_has_filler() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || filler_ != nullptr);
+  return value;
 }
-inline void PReLUParameter::set_has_filler() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool PReLUParameter::has_filler() const {
+  return _internal_has_filler();
 }
-inline void PReLUParameter::clear_has_filler() {
+inline void PReLUParameter::clear_filler() {
+  if (filler_ != nullptr) filler_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void PReLUParameter::clear_filler() {
-  if (filler_ != NULL) filler_->Clear();
-  clear_has_filler();
+inline const ::opencv_caffe::FillerParameter& PReLUParameter::_internal_filler() const {
+  const ::opencv_caffe::FillerParameter* p = filler_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_caffe::FillerParameter&>(
+      ::opencv_caffe::_FillerParameter_default_instance_);
 }
 inline const ::opencv_caffe::FillerParameter& PReLUParameter::filler() const {
-  const ::opencv_caffe::FillerParameter* p = filler_;
   // @@protoc_insertion_point(field_get:opencv_caffe.PReLUParameter.filler)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_caffe::FillerParameter*>(
-      &::opencv_caffe::_FillerParameter_default_instance_);
+  return _internal_filler();
+}
+inline void PReLUParameter::unsafe_arena_set_allocated_filler(
+    ::opencv_caffe::FillerParameter* filler) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(filler_);
+  }
+  filler_ = filler;
+  if (filler) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_caffe.PReLUParameter.filler)
 }
 inline ::opencv_caffe::FillerParameter* PReLUParameter::release_filler() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_caffe::FillerParameter* temp = filler_;
+  filler_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_caffe::FillerParameter* PReLUParameter::unsafe_arena_release_filler() {
   // @@protoc_insertion_point(field_release:opencv_caffe.PReLUParameter.filler)
-  clear_has_filler();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_caffe::FillerParameter* temp = filler_;
-  filler_ = NULL;
+  filler_ = nullptr;
   return temp;
 }
-inline ::opencv_caffe::FillerParameter* PReLUParameter::mutable_filler() {
-  set_has_filler();
-  if (filler_ == NULL) {
-    filler_ = new ::opencv_caffe::FillerParameter;
+inline ::opencv_caffe::FillerParameter* PReLUParameter::_internal_mutable_filler() {
+  _has_bits_[0] |= 0x00000001u;
+  if (filler_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_caffe::FillerParameter>(GetArenaForAllocation());
+    filler_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_caffe.PReLUParameter.filler)
   return filler_;
 }
+inline ::opencv_caffe::FillerParameter* PReLUParameter::mutable_filler() {
+  ::opencv_caffe::FillerParameter* _msg = _internal_mutable_filler();
+  // @@protoc_insertion_point(field_mutable:opencv_caffe.PReLUParameter.filler)
+  return _msg;
+}
 inline void PReLUParameter::set_allocated_filler(::opencv_caffe::FillerParameter* filler) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete filler_;
   }
   if (filler) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_caffe::FillerParameter>::GetOwningArena(filler);
     if (message_arena != submessage_arena) {
-      filler = ::google::protobuf::internal::GetOwnedMessage(
+      filler = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, filler, submessage_arena);
     }
-    set_has_filler();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_filler();
+    _has_bits_[0] &= ~0x00000001u;
   }
   filler_ = filler;
   // @@protoc_insertion_point(field_set_allocated:opencv_caffe.PReLUParameter.filler)
 }
 
 // optional bool channel_shared = 2 [default = false];
-inline bool PReLUParameter::has_channel_shared() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void PReLUParameter::set_has_channel_shared() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool PReLUParameter::_internal_has_channel_shared() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void PReLUParameter::clear_has_channel_shared() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool PReLUParameter::has_channel_shared() const {
+  return _internal_has_channel_shared();
 }
 inline void PReLUParameter::clear_channel_shared() {
   channel_shared_ = false;
-  clear_has_channel_shared();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline bool PReLUParameter::_internal_channel_shared() const {
+  return channel_shared_;
 }
 inline bool PReLUParameter::channel_shared() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PReLUParameter.channel_shared)
-  return channel_shared_;
+  return _internal_channel_shared();
 }
-inline void PReLUParameter::set_channel_shared(bool value) {
-  set_has_channel_shared();
+inline void PReLUParameter::_internal_set_channel_shared(bool value) {
+  _has_bits_[0] |= 0x00000002u;
   channel_shared_ = value;
+}
+inline void PReLUParameter::set_channel_shared(bool value) {
+  _internal_set_channel_shared(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PReLUParameter.channel_shared)
 }
 
@@ -31875,194 +43986,226 @@ inline void PReLUParameter::set_channel_shared(bool value) {
 // NormalizedBBox
 
 // optional float xmin = 1;
-inline bool NormalizedBBox::has_xmin() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void NormalizedBBox::set_has_xmin() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool NormalizedBBox::_internal_has_xmin() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void NormalizedBBox::clear_has_xmin() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool NormalizedBBox::has_xmin() const {
+  return _internal_has_xmin();
 }
 inline void NormalizedBBox::clear_xmin() {
   xmin_ = 0;
-  clear_has_xmin();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float NormalizedBBox::_internal_xmin() const {
+  return xmin_;
 }
 inline float NormalizedBBox::xmin() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.xmin)
-  return xmin_;
+  return _internal_xmin();
 }
-inline void NormalizedBBox::set_xmin(float value) {
-  set_has_xmin();
+inline void NormalizedBBox::_internal_set_xmin(float value) {
+  _has_bits_[0] |= 0x00000001u;
   xmin_ = value;
-  // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.xmin)
 }
-
-// optional float ymin = 2;
-inline bool NormalizedBBox::has_ymin() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline void NormalizedBBox::set_xmin(float value) {
+  _internal_set_xmin(value);
+  // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.xmin)
 }
-inline void NormalizedBBox::set_has_ymin() {
-  _has_bits_[0] |= 0x00000002u;
+
+// optional float ymin = 2;
+inline bool NormalizedBBox::_internal_has_ymin() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void NormalizedBBox::clear_has_ymin() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool NormalizedBBox::has_ymin() const {
+  return _internal_has_ymin();
 }
 inline void NormalizedBBox::clear_ymin() {
   ymin_ = 0;
-  clear_has_ymin();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline float NormalizedBBox::_internal_ymin() const {
+  return ymin_;
 }
 inline float NormalizedBBox::ymin() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.ymin)
-  return ymin_;
+  return _internal_ymin();
 }
-inline void NormalizedBBox::set_ymin(float value) {
-  set_has_ymin();
+inline void NormalizedBBox::_internal_set_ymin(float value) {
+  _has_bits_[0] |= 0x00000002u;
   ymin_ = value;
+}
+inline void NormalizedBBox::set_ymin(float value) {
+  _internal_set_ymin(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.ymin)
 }
 
 // optional float xmax = 3;
-inline bool NormalizedBBox::has_xmax() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void NormalizedBBox::set_has_xmax() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool NormalizedBBox::_internal_has_xmax() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void NormalizedBBox::clear_has_xmax() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool NormalizedBBox::has_xmax() const {
+  return _internal_has_xmax();
 }
 inline void NormalizedBBox::clear_xmax() {
   xmax_ = 0;
-  clear_has_xmax();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float NormalizedBBox::_internal_xmax() const {
+  return xmax_;
 }
 inline float NormalizedBBox::xmax() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.xmax)
-  return xmax_;
+  return _internal_xmax();
 }
-inline void NormalizedBBox::set_xmax(float value) {
-  set_has_xmax();
+inline void NormalizedBBox::_internal_set_xmax(float value) {
+  _has_bits_[0] |= 0x00000004u;
   xmax_ = value;
+}
+inline void NormalizedBBox::set_xmax(float value) {
+  _internal_set_xmax(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.xmax)
 }
 
 // optional float ymax = 4;
-inline bool NormalizedBBox::has_ymax() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void NormalizedBBox::set_has_ymax() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool NormalizedBBox::_internal_has_ymax() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void NormalizedBBox::clear_has_ymax() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool NormalizedBBox::has_ymax() const {
+  return _internal_has_ymax();
 }
 inline void NormalizedBBox::clear_ymax() {
   ymax_ = 0;
-  clear_has_ymax();
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline float NormalizedBBox::_internal_ymax() const {
+  return ymax_;
 }
 inline float NormalizedBBox::ymax() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.ymax)
-  return ymax_;
+  return _internal_ymax();
 }
-inline void NormalizedBBox::set_ymax(float value) {
-  set_has_ymax();
+inline void NormalizedBBox::_internal_set_ymax(float value) {
+  _has_bits_[0] |= 0x00000008u;
   ymax_ = value;
+}
+inline void NormalizedBBox::set_ymax(float value) {
+  _internal_set_ymax(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.ymax)
 }
 
 // optional int32 label = 5;
-inline bool NormalizedBBox::has_label() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void NormalizedBBox::set_has_label() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool NormalizedBBox::_internal_has_label() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void NormalizedBBox::clear_has_label() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool NormalizedBBox::has_label() const {
+  return _internal_has_label();
 }
 inline void NormalizedBBox::clear_label() {
   label_ = 0;
-  clear_has_label();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::int32 NormalizedBBox::label() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.label)
+inline int32_t NormalizedBBox::_internal_label() const {
   return label_;
 }
-inline void NormalizedBBox::set_label(::google::protobuf::int32 value) {
-  set_has_label();
+inline int32_t NormalizedBBox::label() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.label)
+  return _internal_label();
+}
+inline void NormalizedBBox::_internal_set_label(int32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   label_ = value;
+}
+inline void NormalizedBBox::set_label(int32_t value) {
+  _internal_set_label(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.label)
 }
 
 // optional bool difficult = 6;
-inline bool NormalizedBBox::has_difficult() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void NormalizedBBox::set_has_difficult() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool NormalizedBBox::_internal_has_difficult() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void NormalizedBBox::clear_has_difficult() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool NormalizedBBox::has_difficult() const {
+  return _internal_has_difficult();
 }
 inline void NormalizedBBox::clear_difficult() {
   difficult_ = false;
-  clear_has_difficult();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline bool NormalizedBBox::_internal_difficult() const {
+  return difficult_;
 }
 inline bool NormalizedBBox::difficult() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.difficult)
-  return difficult_;
+  return _internal_difficult();
 }
-inline void NormalizedBBox::set_difficult(bool value) {
-  set_has_difficult();
+inline void NormalizedBBox::_internal_set_difficult(bool value) {
+  _has_bits_[0] |= 0x00000020u;
   difficult_ = value;
+}
+inline void NormalizedBBox::set_difficult(bool value) {
+  _internal_set_difficult(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.difficult)
 }
 
 // optional float score = 7;
-inline bool NormalizedBBox::has_score() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
-}
-inline void NormalizedBBox::set_has_score() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool NormalizedBBox::_internal_has_score() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void NormalizedBBox::clear_has_score() {
-  _has_bits_[0] &= ~0x00000040u;
+inline bool NormalizedBBox::has_score() const {
+  return _internal_has_score();
 }
 inline void NormalizedBBox::clear_score() {
   score_ = 0;
-  clear_has_score();
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline float NormalizedBBox::_internal_score() const {
+  return score_;
 }
 inline float NormalizedBBox::score() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.score)
-  return score_;
+  return _internal_score();
 }
-inline void NormalizedBBox::set_score(float value) {
-  set_has_score();
+inline void NormalizedBBox::_internal_set_score(float value) {
+  _has_bits_[0] |= 0x00000040u;
   score_ = value;
+}
+inline void NormalizedBBox::set_score(float value) {
+  _internal_set_score(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.score)
 }
 
 // optional float size = 8;
-inline bool NormalizedBBox::has_size() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
+inline bool NormalizedBBox::_internal_has_size() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void NormalizedBBox::set_has_size() {
-  _has_bits_[0] |= 0x00000080u;
-}
-inline void NormalizedBBox::clear_has_size() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool NormalizedBBox::has_size() const {
+  return _internal_has_size();
 }
 inline void NormalizedBBox::clear_size() {
   size_ = 0;
-  clear_has_size();
+  _has_bits_[0] &= ~0x00000080u;
+}
+inline float NormalizedBBox::_internal_size() const {
+  return size_;
 }
 inline float NormalizedBBox::size() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.NormalizedBBox.size)
-  return size_;
+  return _internal_size();
 }
-inline void NormalizedBBox::set_size(float value) {
-  set_has_size();
+inline void NormalizedBBox::_internal_set_size(float value) {
+  _has_bits_[0] |= 0x00000080u;
   size_ = value;
+}
+inline void NormalizedBBox::set_size(float value) {
+  _internal_set_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.NormalizedBBox.size)
 }
 
@@ -32071,74 +44214,86 @@ inline void NormalizedBBox::set_size(float value) {
 // ROIPoolingParameter
 
 // optional uint32 pooled_h = 1 [default = 0];
-inline bool ROIPoolingParameter::has_pooled_h() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ROIPoolingParameter::set_has_pooled_h() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ROIPoolingParameter::_internal_has_pooled_h() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ROIPoolingParameter::clear_has_pooled_h() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ROIPoolingParameter::has_pooled_h() const {
+  return _internal_has_pooled_h();
 }
 inline void ROIPoolingParameter::clear_pooled_h() {
   pooled_h_ = 0u;
-  clear_has_pooled_h();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::uint32 ROIPoolingParameter::pooled_h() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ROIPoolingParameter.pooled_h)
+inline uint32_t ROIPoolingParameter::_internal_pooled_h() const {
   return pooled_h_;
 }
-inline void ROIPoolingParameter::set_pooled_h(::google::protobuf::uint32 value) {
-  set_has_pooled_h();
+inline uint32_t ROIPoolingParameter::pooled_h() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ROIPoolingParameter.pooled_h)
+  return _internal_pooled_h();
+}
+inline void ROIPoolingParameter::_internal_set_pooled_h(uint32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   pooled_h_ = value;
+}
+inline void ROIPoolingParameter::set_pooled_h(uint32_t value) {
+  _internal_set_pooled_h(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ROIPoolingParameter.pooled_h)
 }
 
 // optional uint32 pooled_w = 2 [default = 0];
-inline bool ROIPoolingParameter::has_pooled_w() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool ROIPoolingParameter::_internal_has_pooled_w() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ROIPoolingParameter::set_has_pooled_w() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void ROIPoolingParameter::clear_has_pooled_w() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ROIPoolingParameter::has_pooled_w() const {
+  return _internal_has_pooled_w();
 }
 inline void ROIPoolingParameter::clear_pooled_w() {
   pooled_w_ = 0u;
-  clear_has_pooled_w();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::uint32 ROIPoolingParameter::pooled_w() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ROIPoolingParameter.pooled_w)
+inline uint32_t ROIPoolingParameter::_internal_pooled_w() const {
   return pooled_w_;
 }
-inline void ROIPoolingParameter::set_pooled_w(::google::protobuf::uint32 value) {
-  set_has_pooled_w();
+inline uint32_t ROIPoolingParameter::pooled_w() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ROIPoolingParameter.pooled_w)
+  return _internal_pooled_w();
+}
+inline void ROIPoolingParameter::_internal_set_pooled_w(uint32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   pooled_w_ = value;
+}
+inline void ROIPoolingParameter::set_pooled_w(uint32_t value) {
+  _internal_set_pooled_w(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ROIPoolingParameter.pooled_w)
 }
 
 // optional float spatial_scale = 3 [default = 1];
-inline bool ROIPoolingParameter::has_spatial_scale() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ROIPoolingParameter::set_has_spatial_scale() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ROIPoolingParameter::_internal_has_spatial_scale() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ROIPoolingParameter::clear_has_spatial_scale() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ROIPoolingParameter::has_spatial_scale() const {
+  return _internal_has_spatial_scale();
 }
 inline void ROIPoolingParameter::clear_spatial_scale() {
   spatial_scale_ = 1;
-  clear_has_spatial_scale();
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline float ROIPoolingParameter::_internal_spatial_scale() const {
+  return spatial_scale_;
 }
 inline float ROIPoolingParameter::spatial_scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ROIPoolingParameter.spatial_scale)
-  return spatial_scale_;
+  return _internal_spatial_scale();
 }
-inline void ROIPoolingParameter::set_spatial_scale(float value) {
-  set_has_spatial_scale();
+inline void ROIPoolingParameter::_internal_set_spatial_scale(float value) {
+  _has_bits_[0] |= 0x00000004u;
   spatial_scale_ = value;
+}
+inline void ROIPoolingParameter::set_spatial_scale(float value) {
+  _internal_set_spatial_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ROIPoolingParameter.spatial_scale)
 }
 
@@ -32147,206 +44302,264 @@ inline void ROIPoolingParameter::set_spatial_scale(float value) {
 // ProposalParameter
 
 // optional uint32 feat_stride = 1 [default = 16];
-inline bool ProposalParameter::has_feat_stride() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool ProposalParameter::_internal_has_feat_stride() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ProposalParameter::set_has_feat_stride() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void ProposalParameter::clear_has_feat_stride() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ProposalParameter::has_feat_stride() const {
+  return _internal_has_feat_stride();
 }
 inline void ProposalParameter::clear_feat_stride() {
   feat_stride_ = 16u;
-  clear_has_feat_stride();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline ::google::protobuf::uint32 ProposalParameter::feat_stride() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.feat_stride)
+inline uint32_t ProposalParameter::_internal_feat_stride() const {
   return feat_stride_;
 }
-inline void ProposalParameter::set_feat_stride(::google::protobuf::uint32 value) {
-  set_has_feat_stride();
+inline uint32_t ProposalParameter::feat_stride() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.feat_stride)
+  return _internal_feat_stride();
+}
+inline void ProposalParameter::_internal_set_feat_stride(uint32_t value) {
+  _has_bits_[0] |= 0x00000001u;
   feat_stride_ = value;
+}
+inline void ProposalParameter::set_feat_stride(uint32_t value) {
+  _internal_set_feat_stride(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ProposalParameter.feat_stride)
 }
 
 // optional uint32 base_size = 2 [default = 16];
-inline bool ProposalParameter::has_base_size() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ProposalParameter::set_has_base_size() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ProposalParameter::_internal_has_base_size() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ProposalParameter::clear_has_base_size() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ProposalParameter::has_base_size() const {
+  return _internal_has_base_size();
 }
 inline void ProposalParameter::clear_base_size() {
   base_size_ = 16u;
-  clear_has_base_size();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::uint32 ProposalParameter::base_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.base_size)
+inline uint32_t ProposalParameter::_internal_base_size() const {
   return base_size_;
 }
-inline void ProposalParameter::set_base_size(::google::protobuf::uint32 value) {
-  set_has_base_size();
+inline uint32_t ProposalParameter::base_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.base_size)
+  return _internal_base_size();
+}
+inline void ProposalParameter::_internal_set_base_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   base_size_ = value;
+}
+inline void ProposalParameter::set_base_size(uint32_t value) {
+  _internal_set_base_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ProposalParameter.base_size)
 }
 
 // optional uint32 min_size = 3 [default = 16];
-inline bool ProposalParameter::has_min_size() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ProposalParameter::set_has_min_size() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ProposalParameter::_internal_has_min_size() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ProposalParameter::clear_has_min_size() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ProposalParameter::has_min_size() const {
+  return _internal_has_min_size();
 }
 inline void ProposalParameter::clear_min_size() {
   min_size_ = 16u;
-  clear_has_min_size();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::uint32 ProposalParameter::min_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.min_size)
+inline uint32_t ProposalParameter::_internal_min_size() const {
   return min_size_;
 }
-inline void ProposalParameter::set_min_size(::google::protobuf::uint32 value) {
-  set_has_min_size();
+inline uint32_t ProposalParameter::min_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.min_size)
+  return _internal_min_size();
+}
+inline void ProposalParameter::_internal_set_min_size(uint32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   min_size_ = value;
+}
+inline void ProposalParameter::set_min_size(uint32_t value) {
+  _internal_set_min_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ProposalParameter.min_size)
 }
 
 // repeated float ratio = 4;
-inline int ProposalParameter::ratio_size() const {
+inline int ProposalParameter::_internal_ratio_size() const {
   return ratio_.size();
 }
+inline int ProposalParameter::ratio_size() const {
+  return _internal_ratio_size();
+}
 inline void ProposalParameter::clear_ratio() {
   ratio_.Clear();
 }
+inline float ProposalParameter::_internal_ratio(int index) const {
+  return ratio_.Get(index);
+}
 inline float ProposalParameter::ratio(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.ratio)
-  return ratio_.Get(index);
+  return _internal_ratio(index);
 }
 inline void ProposalParameter::set_ratio(int index, float value) {
   ratio_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ProposalParameter.ratio)
 }
-inline void ProposalParameter::add_ratio(float value) {
+inline void ProposalParameter::_internal_add_ratio(float value) {
   ratio_.Add(value);
+}
+inline void ProposalParameter::add_ratio(float value) {
+  _internal_add_ratio(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.ProposalParameter.ratio)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+ProposalParameter::_internal_ratio() const {
+  return ratio_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 ProposalParameter::ratio() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.ProposalParameter.ratio)
-  return ratio_;
+  return _internal_ratio();
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+ProposalParameter::_internal_mutable_ratio() {
+  return &ratio_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 ProposalParameter::mutable_ratio() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.ProposalParameter.ratio)
-  return &ratio_;
+  return _internal_mutable_ratio();
 }
 
 // repeated float scale = 5;
-inline int ProposalParameter::scale_size() const {
+inline int ProposalParameter::_internal_scale_size() const {
   return scale_.size();
 }
+inline int ProposalParameter::scale_size() const {
+  return _internal_scale_size();
+}
 inline void ProposalParameter::clear_scale() {
   scale_.Clear();
 }
+inline float ProposalParameter::_internal_scale(int index) const {
+  return scale_.Get(index);
+}
 inline float ProposalParameter::scale(int index) const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.scale)
-  return scale_.Get(index);
+  return _internal_scale(index);
 }
 inline void ProposalParameter::set_scale(int index, float value) {
   scale_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ProposalParameter.scale)
 }
-inline void ProposalParameter::add_scale(float value) {
+inline void ProposalParameter::_internal_add_scale(float value) {
   scale_.Add(value);
+}
+inline void ProposalParameter::add_scale(float value) {
+  _internal_add_scale(value);
   // @@protoc_insertion_point(field_add:opencv_caffe.ProposalParameter.scale)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+ProposalParameter::_internal_scale() const {
+  return scale_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 ProposalParameter::scale() const {
   // @@protoc_insertion_point(field_list:opencv_caffe.ProposalParameter.scale)
-  return scale_;
+  return _internal_scale();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+ProposalParameter::_internal_mutable_scale() {
+  return &scale_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 ProposalParameter::mutable_scale() {
   // @@protoc_insertion_point(field_mutable_list:opencv_caffe.ProposalParameter.scale)
-  return &scale_;
+  return _internal_mutable_scale();
 }
 
 // optional uint32 pre_nms_topn = 6 [default = 6000];
-inline bool ProposalParameter::has_pre_nms_topn() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void ProposalParameter::set_has_pre_nms_topn() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool ProposalParameter::_internal_has_pre_nms_topn() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void ProposalParameter::clear_has_pre_nms_topn() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool ProposalParameter::has_pre_nms_topn() const {
+  return _internal_has_pre_nms_topn();
 }
 inline void ProposalParameter::clear_pre_nms_topn() {
   pre_nms_topn_ = 6000u;
-  clear_has_pre_nms_topn();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline ::google::protobuf::uint32 ProposalParameter::pre_nms_topn() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.pre_nms_topn)
+inline uint32_t ProposalParameter::_internal_pre_nms_topn() const {
   return pre_nms_topn_;
 }
-inline void ProposalParameter::set_pre_nms_topn(::google::protobuf::uint32 value) {
-  set_has_pre_nms_topn();
+inline uint32_t ProposalParameter::pre_nms_topn() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.pre_nms_topn)
+  return _internal_pre_nms_topn();
+}
+inline void ProposalParameter::_internal_set_pre_nms_topn(uint32_t value) {
+  _has_bits_[0] |= 0x00000008u;
   pre_nms_topn_ = value;
+}
+inline void ProposalParameter::set_pre_nms_topn(uint32_t value) {
+  _internal_set_pre_nms_topn(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ProposalParameter.pre_nms_topn)
 }
 
 // optional uint32 post_nms_topn = 7 [default = 300];
-inline bool ProposalParameter::has_post_nms_topn() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void ProposalParameter::set_has_post_nms_topn() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool ProposalParameter::_internal_has_post_nms_topn() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void ProposalParameter::clear_has_post_nms_topn() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool ProposalParameter::has_post_nms_topn() const {
+  return _internal_has_post_nms_topn();
 }
 inline void ProposalParameter::clear_post_nms_topn() {
   post_nms_topn_ = 300u;
-  clear_has_post_nms_topn();
+  _has_bits_[0] &= ~0x00000010u;
 }
-inline ::google::protobuf::uint32 ProposalParameter::post_nms_topn() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.post_nms_topn)
+inline uint32_t ProposalParameter::_internal_post_nms_topn() const {
   return post_nms_topn_;
 }
-inline void ProposalParameter::set_post_nms_topn(::google::protobuf::uint32 value) {
-  set_has_post_nms_topn();
+inline uint32_t ProposalParameter::post_nms_topn() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.post_nms_topn)
+  return _internal_post_nms_topn();
+}
+inline void ProposalParameter::_internal_set_post_nms_topn(uint32_t value) {
+  _has_bits_[0] |= 0x00000010u;
   post_nms_topn_ = value;
+}
+inline void ProposalParameter::set_post_nms_topn(uint32_t value) {
+  _internal_set_post_nms_topn(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ProposalParameter.post_nms_topn)
 }
 
 // optional float nms_thresh = 8 [default = 0.7];
-inline bool ProposalParameter::has_nms_thresh() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
-}
-inline void ProposalParameter::set_has_nms_thresh() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool ProposalParameter::_internal_has_nms_thresh() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void ProposalParameter::clear_has_nms_thresh() {
-  _has_bits_[0] &= ~0x00000020u;
+inline bool ProposalParameter::has_nms_thresh() const {
+  return _internal_has_nms_thresh();
 }
 inline void ProposalParameter::clear_nms_thresh() {
   nms_thresh_ = 0.7f;
-  clear_has_nms_thresh();
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline float ProposalParameter::_internal_nms_thresh() const {
+  return nms_thresh_;
 }
 inline float ProposalParameter::nms_thresh() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.ProposalParameter.nms_thresh)
-  return nms_thresh_;
+  return _internal_nms_thresh();
 }
-inline void ProposalParameter::set_nms_thresh(float value) {
-  set_has_nms_thresh();
+inline void ProposalParameter::_internal_set_nms_thresh(float value) {
+  _has_bits_[0] |= 0x00000020u;
   nms_thresh_ = value;
+}
+inline void ProposalParameter::set_nms_thresh(float value) {
+  _internal_set_nms_thresh(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.ProposalParameter.nms_thresh)
 }
 
@@ -32355,74 +44568,86 @@ inline void ProposalParameter::set_nms_thresh(float value) {
 // PSROIPoolingParameter
 
 // required float spatial_scale = 1;
-inline bool PSROIPoolingParameter::has_spatial_scale() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void PSROIPoolingParameter::set_has_spatial_scale() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool PSROIPoolingParameter::_internal_has_spatial_scale() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void PSROIPoolingParameter::clear_has_spatial_scale() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool PSROIPoolingParameter::has_spatial_scale() const {
+  return _internal_has_spatial_scale();
 }
 inline void PSROIPoolingParameter::clear_spatial_scale() {
   spatial_scale_ = 0;
-  clear_has_spatial_scale();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline float PSROIPoolingParameter::_internal_spatial_scale() const {
+  return spatial_scale_;
 }
 inline float PSROIPoolingParameter::spatial_scale() const {
   // @@protoc_insertion_point(field_get:opencv_caffe.PSROIPoolingParameter.spatial_scale)
-  return spatial_scale_;
+  return _internal_spatial_scale();
 }
-inline void PSROIPoolingParameter::set_spatial_scale(float value) {
-  set_has_spatial_scale();
+inline void PSROIPoolingParameter::_internal_set_spatial_scale(float value) {
+  _has_bits_[0] |= 0x00000001u;
   spatial_scale_ = value;
+}
+inline void PSROIPoolingParameter::set_spatial_scale(float value) {
+  _internal_set_spatial_scale(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PSROIPoolingParameter.spatial_scale)
 }
 
 // required int32 output_dim = 2;
-inline bool PSROIPoolingParameter::has_output_dim() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void PSROIPoolingParameter::set_has_output_dim() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool PSROIPoolingParameter::_internal_has_output_dim() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void PSROIPoolingParameter::clear_has_output_dim() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool PSROIPoolingParameter::has_output_dim() const {
+  return _internal_has_output_dim();
 }
 inline void PSROIPoolingParameter::clear_output_dim() {
   output_dim_ = 0;
-  clear_has_output_dim();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline ::google::protobuf::int32 PSROIPoolingParameter::output_dim() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PSROIPoolingParameter.output_dim)
+inline int32_t PSROIPoolingParameter::_internal_output_dim() const {
   return output_dim_;
 }
-inline void PSROIPoolingParameter::set_output_dim(::google::protobuf::int32 value) {
-  set_has_output_dim();
+inline int32_t PSROIPoolingParameter::output_dim() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PSROIPoolingParameter.output_dim)
+  return _internal_output_dim();
+}
+inline void PSROIPoolingParameter::_internal_set_output_dim(int32_t value) {
+  _has_bits_[0] |= 0x00000002u;
   output_dim_ = value;
+}
+inline void PSROIPoolingParameter::set_output_dim(int32_t value) {
+  _internal_set_output_dim(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PSROIPoolingParameter.output_dim)
 }
 
 // required int32 group_size = 3;
-inline bool PSROIPoolingParameter::has_group_size() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void PSROIPoolingParameter::set_has_group_size() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool PSROIPoolingParameter::_internal_has_group_size() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void PSROIPoolingParameter::clear_has_group_size() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool PSROIPoolingParameter::has_group_size() const {
+  return _internal_has_group_size();
 }
 inline void PSROIPoolingParameter::clear_group_size() {
   group_size_ = 0;
-  clear_has_group_size();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline ::google::protobuf::int32 PSROIPoolingParameter::group_size() const {
-  // @@protoc_insertion_point(field_get:opencv_caffe.PSROIPoolingParameter.group_size)
+inline int32_t PSROIPoolingParameter::_internal_group_size() const {
   return group_size_;
 }
-inline void PSROIPoolingParameter::set_group_size(::google::protobuf::int32 value) {
-  set_has_group_size();
+inline int32_t PSROIPoolingParameter::group_size() const {
+  // @@protoc_insertion_point(field_get:opencv_caffe.PSROIPoolingParameter.group_size)
+  return _internal_group_size();
+}
+inline void PSROIPoolingParameter::_internal_set_group_size(int32_t value) {
+  _has_bits_[0] |= 0x00000004u;
   group_size_ = value;
+}
+inline void PSROIPoolingParameter::set_group_size(int32_t value) {
+  _internal_set_group_size(value);
   // @@protoc_insertion_point(field_set:opencv_caffe.PSROIPoolingParameter.group_size)
 }
 
@@ -32574,148 +44799,147 @@ inline void PSROIPoolingParameter::set_group_size(::google::protobuf::int32 valu
 
 }  // namespace opencv_caffe
 
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
 
-template <> struct is_proto_enum< ::opencv_caffe::PriorBoxParameter_CodeType> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::PriorBoxParameter_CodeType> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::PriorBoxParameter_CodeType>() {
   return ::opencv_caffe::PriorBoxParameter_CodeType_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::FillerParameter_VarianceNorm> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::FillerParameter_VarianceNorm> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::FillerParameter_VarianceNorm>() {
   return ::opencv_caffe::FillerParameter_VarianceNorm_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::SolverParameter_SnapshotFormat> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::SolverParameter_SnapshotFormat> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::SolverParameter_SnapshotFormat>() {
   return ::opencv_caffe::SolverParameter_SnapshotFormat_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::SolverParameter_SolverMode> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::SolverParameter_SolverMode> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::SolverParameter_SolverMode>() {
   return ::opencv_caffe::SolverParameter_SolverMode_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::SolverParameter_SolverType> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::SolverParameter_SolverType> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::SolverParameter_SolverType>() {
   return ::opencv_caffe::SolverParameter_SolverType_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::ParamSpec_DimCheckMode> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::ParamSpec_DimCheckMode> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::ParamSpec_DimCheckMode>() {
   return ::opencv_caffe::ParamSpec_DimCheckMode_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::LossParameter_NormalizationMode> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::LossParameter_NormalizationMode> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::LossParameter_NormalizationMode>() {
   return ::opencv_caffe::LossParameter_NormalizationMode_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::ConvolutionParameter_Engine> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::ConvolutionParameter_Engine> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::ConvolutionParameter_Engine>() {
   return ::opencv_caffe::ConvolutionParameter_Engine_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::DataParameter_DB> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::DataParameter_DB> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::DataParameter_DB>() {
   return ::opencv_caffe::DataParameter_DB_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::EltwiseParameter_EltwiseOp> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::EltwiseParameter_EltwiseOp> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::EltwiseParameter_EltwiseOp>() {
   return ::opencv_caffe::EltwiseParameter_EltwiseOp_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::HingeLossParameter_Norm> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::HingeLossParameter_Norm> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::HingeLossParameter_Norm>() {
   return ::opencv_caffe::HingeLossParameter_Norm_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::LRNParameter_NormRegion> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::LRNParameter_NormRegion> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::LRNParameter_NormRegion>() {
   return ::opencv_caffe::LRNParameter_NormRegion_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::LRNParameter_Engine> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::LRNParameter_Engine> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::LRNParameter_Engine>() {
   return ::opencv_caffe::LRNParameter_Engine_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::PoolingParameter_PoolMethod> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::PoolingParameter_PoolMethod> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::PoolingParameter_PoolMethod>() {
   return ::opencv_caffe::PoolingParameter_PoolMethod_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::PoolingParameter_Engine> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::PoolingParameter_Engine> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::PoolingParameter_Engine>() {
   return ::opencv_caffe::PoolingParameter_Engine_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::ReductionParameter_ReductionOp> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::ReductionParameter_ReductionOp> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::ReductionParameter_ReductionOp>() {
   return ::opencv_caffe::ReductionParameter_ReductionOp_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::ReLUParameter_Engine> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::ReLUParameter_Engine> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::ReLUParameter_Engine>() {
   return ::opencv_caffe::ReLUParameter_Engine_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::SigmoidParameter_Engine> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::SigmoidParameter_Engine> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::SigmoidParameter_Engine>() {
   return ::opencv_caffe::SigmoidParameter_Engine_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::SoftmaxParameter_Engine> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::SoftmaxParameter_Engine> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::SoftmaxParameter_Engine>() {
   return ::opencv_caffe::SoftmaxParameter_Engine_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::TanHParameter_Engine> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::TanHParameter_Engine> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::TanHParameter_Engine>() {
   return ::opencv_caffe::TanHParameter_Engine_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::SPPParameter_PoolMethod> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::SPPParameter_PoolMethod> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::SPPParameter_PoolMethod>() {
   return ::opencv_caffe::SPPParameter_PoolMethod_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::SPPParameter_Engine> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::SPPParameter_Engine> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::SPPParameter_Engine>() {
   return ::opencv_caffe::SPPParameter_Engine_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::V1LayerParameter_LayerType> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::V1LayerParameter_LayerType> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::V1LayerParameter_LayerType>() {
   return ::opencv_caffe::V1LayerParameter_LayerType_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::V1LayerParameter_DimCheckMode> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::V1LayerParameter_DimCheckMode> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::V1LayerParameter_DimCheckMode>() {
   return ::opencv_caffe::V1LayerParameter_DimCheckMode_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::V0LayerParameter_PoolMethod> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::V0LayerParameter_PoolMethod> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::V0LayerParameter_PoolMethod>() {
   return ::opencv_caffe::V0LayerParameter_PoolMethod_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::Type> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::Type> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::Type>() {
   return ::opencv_caffe::Type_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_caffe::Phase> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_caffe::Phase> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_caffe::Phase>() {
   return ::opencv_caffe::Phase_descriptor();
 }
 
-}  // namespace protobuf
-}  // namespace google
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_opencv_2dcaffe_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_opencv_2dcaffe_2eproto
index 6d70496..44e0730 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_onnx {
-class AttributeProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<AttributeProto>
-      _instance;
-} _AttributeProto_default_instance_;
-class ValueInfoProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ValueInfoProto>
-      _instance;
-} _ValueInfoProto_default_instance_;
-class NodeProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NodeProto>
-      _instance;
-} _NodeProto_default_instance_;
-class ModelProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<ModelProto>
-      _instance;
-} _ModelProto_default_instance_;
-class StringStringEntryProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<StringStringEntryProto>
-      _instance;
-} _StringStringEntryProto_default_instance_;
-class GraphProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<GraphProto>
-      _instance;
-} _GraphProto_default_instance_;
-class TensorProto_SegmentDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TensorProto_Segment>
-      _instance;
-} _TensorProto_Segment_default_instance_;
-class TensorProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TensorProto>
-      _instance;
-} _TensorProto_default_instance_;
-class TensorShapeProto_DimensionDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TensorShapeProto_Dimension>
-      _instance;
-  ::google::protobuf::int64 dim_value_;
-  ::google::protobuf::internal::ArenaStringPtr dim_param_;
-} _TensorShapeProto_Dimension_default_instance_;
-class TensorShapeProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TensorShapeProto>
-      _instance;
-} _TensorShapeProto_default_instance_;
-class TypeProto_TensorDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TypeProto_Tensor>
-      _instance;
-} _TypeProto_Tensor_default_instance_;
-class TypeProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TypeProto>
-      _instance;
-  const ::opencv_onnx::TypeProto_Tensor* tensor_type_;
-} _TypeProto_default_instance_;
-class OperatorSetIdProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<OperatorSetIdProto>
-      _instance;
-} _OperatorSetIdProto_default_instance_;
+constexpr AttributeProto::AttributeProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : floats_()
+  , ints_()
+  , strings_()
+  , tensors_()
+  , graphs_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , s_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , doc_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , ref_attr_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , t_(nullptr)
+  , g_(nullptr)
+  , i_(int64_t{0})
+  , f_(0)
+  , type_(0)
+{}
+struct AttributeProtoDefaultTypeInternal {
+  constexpr AttributeProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~AttributeProtoDefaultTypeInternal() {}
+  union {
+    AttributeProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AttributeProtoDefaultTypeInternal _AttributeProto_default_instance_;
+constexpr ValueInfoProto::ValueInfoProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , doc_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , type_(nullptr){}
+struct ValueInfoProtoDefaultTypeInternal {
+  constexpr ValueInfoProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ValueInfoProtoDefaultTypeInternal() {}
+  union {
+    ValueInfoProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ValueInfoProtoDefaultTypeInternal _ValueInfoProto_default_instance_;
+constexpr NodeProto::NodeProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : input_()
+  , output_()
+  , attribute_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , op_type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , doc_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , domain_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct NodeProtoDefaultTypeInternal {
+  constexpr NodeProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NodeProtoDefaultTypeInternal() {}
+  union {
+    NodeProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NodeProtoDefaultTypeInternal _NodeProto_default_instance_;
+constexpr ModelProto::ModelProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : opset_import_()
+  , metadata_props_()
+  , producer_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , producer_version_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , domain_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , doc_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , graph_(nullptr)
+  , ir_version_(int64_t{0})
+  , model_version_(int64_t{0}){}
+struct ModelProtoDefaultTypeInternal {
+  constexpr ModelProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~ModelProtoDefaultTypeInternal() {}
+  union {
+    ModelProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ModelProtoDefaultTypeInternal _ModelProto_default_instance_;
+constexpr StringStringEntryProto::StringStringEntryProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : key_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , value_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct StringStringEntryProtoDefaultTypeInternal {
+  constexpr StringStringEntryProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~StringStringEntryProtoDefaultTypeInternal() {}
+  union {
+    StringStringEntryProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT StringStringEntryProtoDefaultTypeInternal _StringStringEntryProto_default_instance_;
+constexpr GraphProto::GraphProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : node_()
+  , initializer_()
+  , input_()
+  , output_()
+  , value_info_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , doc_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct GraphProtoDefaultTypeInternal {
+  constexpr GraphProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~GraphProtoDefaultTypeInternal() {}
+  union {
+    GraphProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GraphProtoDefaultTypeInternal _GraphProto_default_instance_;
+constexpr TensorProto_Segment::TensorProto_Segment(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : begin_(int64_t{0})
+  , end_(int64_t{0}){}
+struct TensorProto_SegmentDefaultTypeInternal {
+  constexpr TensorProto_SegmentDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TensorProto_SegmentDefaultTypeInternal() {}
+  union {
+    TensorProto_Segment _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorProto_SegmentDefaultTypeInternal _TensorProto_Segment_default_instance_;
+constexpr TensorProto::TensorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : dims_()
+  , float_data_()
+  , int32_data_()
+  , _int32_data_cached_byte_size_(0)
+  , string_data_()
+  , int64_data_()
+  , _int64_data_cached_byte_size_(0)
+  , double_data_()
+  , uint64_data_()
+  , _uint64_data_cached_byte_size_(0)
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , raw_data_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , doc_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , segment_(nullptr)
+  , data_type_(0)
+{}
+struct TensorProtoDefaultTypeInternal {
+  constexpr TensorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TensorProtoDefaultTypeInternal() {}
+  union {
+    TensorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorProtoDefaultTypeInternal _TensorProto_default_instance_;
+constexpr TensorShapeProto_Dimension::TensorShapeProto_Dimension(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : denotation_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , _oneof_case_{}{}
+struct TensorShapeProto_DimensionDefaultTypeInternal {
+  constexpr TensorShapeProto_DimensionDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TensorShapeProto_DimensionDefaultTypeInternal() {}
+  union {
+    TensorShapeProto_Dimension _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorShapeProto_DimensionDefaultTypeInternal _TensorShapeProto_Dimension_default_instance_;
+constexpr TensorShapeProto::TensorShapeProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : dim_(){}
+struct TensorShapeProtoDefaultTypeInternal {
+  constexpr TensorShapeProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TensorShapeProtoDefaultTypeInternal() {}
+  union {
+    TensorShapeProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorShapeProtoDefaultTypeInternal _TensorShapeProto_default_instance_;
+constexpr TypeProto_Tensor::TypeProto_Tensor(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : shape_(nullptr)
+  , elem_type_(0)
+{}
+struct TypeProto_TensorDefaultTypeInternal {
+  constexpr TypeProto_TensorDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TypeProto_TensorDefaultTypeInternal() {}
+  union {
+    TypeProto_Tensor _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TypeProto_TensorDefaultTypeInternal _TypeProto_Tensor_default_instance_;
+constexpr TypeProto::TypeProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : denotation_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , _oneof_case_{}{}
+struct TypeProtoDefaultTypeInternal {
+  constexpr TypeProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TypeProtoDefaultTypeInternal() {}
+  union {
+    TypeProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TypeProtoDefaultTypeInternal _TypeProto_default_instance_;
+constexpr OperatorSetIdProto::OperatorSetIdProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : domain_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , version_(int64_t{0}){}
+struct OperatorSetIdProtoDefaultTypeInternal {
+  constexpr OperatorSetIdProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~OperatorSetIdProtoDefaultTypeInternal() {}
+  union {
+    OperatorSetIdProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OperatorSetIdProtoDefaultTypeInternal _OperatorSetIdProto_default_instance_;
 }  // namespace opencv_onnx
-namespace protobuf_opencv_2donnx_2eproto {
-void InitDefaultsAttributeProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2donnx_2eproto::InitDefaultsTensorProto();
-  protobuf_opencv_2donnx_2eproto::InitDefaultsValueInfoProto();
-  {
-    void* ptr = &::opencv_onnx::_AttributeProto_default_instance_;
-    new (ptr) ::opencv_onnx::AttributeProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  {
-    void* ptr = &::opencv_onnx::_NodeProto_default_instance_;
-    new (ptr) ::opencv_onnx::NodeProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  {
-    void* ptr = &::opencv_onnx::_GraphProto_default_instance_;
-    new (ptr) ::opencv_onnx::GraphProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::AttributeProto::InitAsDefaultInstance();
-  ::opencv_onnx::NodeProto::InitAsDefaultInstance();
-  ::opencv_onnx::GraphProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsAttributeProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsAttributeProtoImpl);
-}
-
-void InitDefaultsValueInfoProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2donnx_2eproto::InitDefaultsTypeProto();
-  {
-    void* ptr = &::opencv_onnx::_ValueInfoProto_default_instance_;
-    new (ptr) ::opencv_onnx::ValueInfoProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::ValueInfoProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsValueInfoProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsValueInfoProtoImpl);
-}
-
-void InitDefaultsModelProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2donnx_2eproto::InitDefaultsOperatorSetIdProto();
-  protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProto();
-  protobuf_opencv_2donnx_2eproto::InitDefaultsStringStringEntryProto();
-  {
-    void* ptr = &::opencv_onnx::_ModelProto_default_instance_;
-    new (ptr) ::opencv_onnx::ModelProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::ModelProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsModelProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsModelProtoImpl);
-}
-
-void InitDefaultsStringStringEntryProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_opencv_2donnx_2eproto[13];
+static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_opencv_2donnx_2eproto[3];
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_opencv_2donnx_2eproto = nullptr;
 
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_onnx::_StringStringEntryProto_default_instance_;
-    new (ptr) ::opencv_onnx::StringStringEntryProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::StringStringEntryProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsStringStringEntryProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsStringStringEntryProtoImpl);
-}
-
-void InitDefaultsTensorProto_SegmentImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_onnx::_TensorProto_Segment_default_instance_;
-    new (ptr) ::opencv_onnx::TensorProto_Segment();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::TensorProto_Segment::InitAsDefaultInstance();
-}
-
-void InitDefaultsTensorProto_Segment() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTensorProto_SegmentImpl);
-}
-
-void InitDefaultsTensorProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2donnx_2eproto::InitDefaultsTensorProto_Segment();
-  {
-    void* ptr = &::opencv_onnx::_TensorProto_default_instance_;
-    new (ptr) ::opencv_onnx::TensorProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::TensorProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsTensorProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTensorProtoImpl);
-}
-
-void InitDefaultsTensorShapeProto_DimensionImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_onnx::_TensorShapeProto_Dimension_default_instance_;
-    new (ptr) ::opencv_onnx::TensorShapeProto_Dimension();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::TensorShapeProto_Dimension::InitAsDefaultInstance();
-}
-
-void InitDefaultsTensorShapeProto_Dimension() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTensorShapeProto_DimensionImpl);
-}
-
-void InitDefaultsTensorShapeProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2donnx_2eproto::InitDefaultsTensorShapeProto_Dimension();
-  {
-    void* ptr = &::opencv_onnx::_TensorShapeProto_default_instance_;
-    new (ptr) ::opencv_onnx::TensorShapeProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::TensorShapeProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsTensorShapeProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTensorShapeProtoImpl);
-}
-
-void InitDefaultsTypeProto_TensorImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2donnx_2eproto::InitDefaultsTensorShapeProto();
-  {
-    void* ptr = &::opencv_onnx::_TypeProto_Tensor_default_instance_;
-    new (ptr) ::opencv_onnx::TypeProto_Tensor();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::TypeProto_Tensor::InitAsDefaultInstance();
-}
-
-void InitDefaultsTypeProto_Tensor() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTypeProto_TensorImpl);
-}
-
-void InitDefaultsTypeProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_opencv_2donnx_2eproto::InitDefaultsTypeProto_Tensor();
-  {
-    void* ptr = &::opencv_onnx::_TypeProto_default_instance_;
-    new (ptr) ::opencv_onnx::TypeProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::TypeProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsTypeProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTypeProtoImpl);
-}
-
-void InitDefaultsOperatorSetIdProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_onnx::_OperatorSetIdProto_default_instance_;
-    new (ptr) ::opencv_onnx::OperatorSetIdProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_onnx::OperatorSetIdProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsOperatorSetIdProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOperatorSetIdProtoImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[13];
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[3];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, _internal_metadata_),
+const uint32_t TableStruct_opencv_2donnx_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, ref_attr_name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, doc_string_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, f_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, i_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, s_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, t_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, g_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, floats_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, ints_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, strings_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, tensors_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::AttributeProto, graphs_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, ref_attr_name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, doc_string_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, f_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, i_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, s_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, t_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, g_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, floats_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, ints_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, strings_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, tensors_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::AttributeProto, graphs_),
   0,
   3,
   2,
@@ -380,29 +271,31 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,
   ~0u,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, doc_string_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ValueInfoProto, doc_string_),
   0,
   2,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, input_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, output_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, op_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, domain_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, attribute_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::NodeProto, doc_string_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, input_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, output_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, op_type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, domain_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, attribute_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::NodeProto, doc_string_),
   ~0u,
   ~0u,
   0,
@@ -410,20 +303,21 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   3,
   ~0u,
   2,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, ir_version_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, opset_import_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, producer_name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, producer_version_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, domain_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, model_version_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, doc_string_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, graph_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::ModelProto, metadata_props_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, ir_version_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, opset_import_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, producer_name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, producer_version_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, domain_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, model_version_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, doc_string_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, graph_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::ModelProto, metadata_props_),
   5,
   ~0u,
   0,
@@ -433,27 +327,29 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   3,
   4,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::StringStringEntryProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::StringStringEntryProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::StringStringEntryProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::StringStringEntryProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::StringStringEntryProto, key_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::StringStringEntryProto, value_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::StringStringEntryProto, key_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::StringStringEntryProto, value_),
   0,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, node_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, initializer_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, doc_string_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, input_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, output_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::GraphProto, value_info_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, node_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, initializer_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, doc_string_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, input_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, output_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::GraphProto, value_info_),
   ~0u,
   0,
   ~0u,
@@ -461,32 +357,34 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,
   ~0u,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto_Segment, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto_Segment, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto_Segment, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto_Segment, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto_Segment, begin_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto_Segment, end_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto_Segment, begin_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto_Segment, end_),
   0,
   1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, dims_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, data_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, segment_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, float_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, int32_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, string_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, int64_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, doc_string_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, raw_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, double_data_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorProto, uint64_data_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, dims_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, data_type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, segment_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, float_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, int32_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, string_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, int64_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, doc_string_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, raw_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, double_data_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorProto, uint64_data_),
   ~0u,
   4,
   3,
@@ -499,194 +397,173 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   1,
   ~0u,
   ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, _internal_metadata_),
   ~0u,  // no _extensions_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, _oneof_case_[0]),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, _oneof_case_[0]),
   ~0u,  // no _weak_field_map_
-  offsetof(::opencv_onnx::TensorShapeProto_DimensionDefaultTypeInternal, dim_value_),
-  offsetof(::opencv_onnx::TensorShapeProto_DimensionDefaultTypeInternal, dim_param_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, denotation_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, value_),
+  ~0u,  // no _inlined_string_donated_
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, denotation_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorShapeProto_Dimension, value_),
   ~0u,
   ~0u,
   0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorShapeProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorShapeProto, _internal_metadata_),
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorShapeProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TensorShapeProto, dim_),
-  ~0u,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto_Tensor, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto_Tensor, _internal_metadata_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TensorShapeProto, dim_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto_Tensor, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto_Tensor, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto_Tensor, elem_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto_Tensor, shape_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto_Tensor, elem_type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto_Tensor, shape_),
   1,
   0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto, _internal_metadata_),
   ~0u,  // no _extensions_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto, _oneof_case_[0]),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto, _oneof_case_[0]),
   ~0u,  // no _weak_field_map_
-  offsetof(::opencv_onnx::TypeProtoDefaultTypeInternal, tensor_type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto, denotation_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::TypeProto, value_),
+  ~0u,  // no _inlined_string_donated_
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto, denotation_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::TypeProto, value_),
   ~0u,
   0,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::OperatorSetIdProto, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::OperatorSetIdProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::OperatorSetIdProto, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::OperatorSetIdProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::OperatorSetIdProto, domain_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_onnx::OperatorSetIdProto, version_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::OperatorSetIdProto, domain_),
+  PROTOBUF_FIELD_OFFSET(::opencv_onnx::OperatorSetIdProto, version_),
   0,
   1,
 };
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 19, sizeof(::opencv_onnx::AttributeProto)},
-  { 33, 41, sizeof(::opencv_onnx::ValueInfoProto)},
-  { 44, 56, sizeof(::opencv_onnx::NodeProto)},
-  { 63, 77, sizeof(::opencv_onnx::ModelProto)},
-  { 86, 93, sizeof(::opencv_onnx::StringStringEntryProto)},
-  { 95, 107, sizeof(::opencv_onnx::GraphProto)},
-  { 114, 121, sizeof(::opencv_onnx::TensorProto_Segment)},
-  { 123, 140, sizeof(::opencv_onnx::TensorProto)},
-  { 152, 161, sizeof(::opencv_onnx::TensorShapeProto_Dimension)},
-  { 164, 170, sizeof(::opencv_onnx::TensorShapeProto)},
-  { 171, 178, sizeof(::opencv_onnx::TypeProto_Tensor)},
-  { 180, 188, sizeof(::opencv_onnx::TypeProto)},
-  { 190, 197, sizeof(::opencv_onnx::OperatorSetIdProto)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, 20, -1, sizeof(::opencv_onnx::AttributeProto)},
+  { 34, 43, -1, sizeof(::opencv_onnx::ValueInfoProto)},
+  { 46, 59, -1, sizeof(::opencv_onnx::NodeProto)},
+  { 66, 81, -1, sizeof(::opencv_onnx::ModelProto)},
+  { 90, 98, -1, sizeof(::opencv_onnx::StringStringEntryProto)},
+  { 100, 113, -1, sizeof(::opencv_onnx::GraphProto)},
+  { 120, 128, -1, sizeof(::opencv_onnx::TensorProto_Segment)},
+  { 130, 148, -1, sizeof(::opencv_onnx::TensorProto)},
+  { 160, 170, -1, sizeof(::opencv_onnx::TensorShapeProto_Dimension)},
+  { 173, -1, -1, sizeof(::opencv_onnx::TensorShapeProto)},
+  { 180, 188, -1, sizeof(::opencv_onnx::TypeProto_Tensor)},
+  { 190, 199, -1, sizeof(::opencv_onnx::TypeProto)},
+  { 201, 209, -1, sizeof(::opencv_onnx::OperatorSetIdProto)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_AttributeProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_ValueInfoProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_NodeProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_ModelProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_StringStringEntryProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_GraphProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_TensorProto_Segment_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_TensorProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_TensorShapeProto_Dimension_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_TensorShapeProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_TypeProto_Tensor_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_TypeProto_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_onnx::_OperatorSetIdProto_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_AttributeProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_ValueInfoProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_NodeProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_ModelProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_StringStringEntryProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_GraphProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_TensorProto_Segment_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_TensorProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_TensorShapeProto_Dimension_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_TensorShapeProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_TypeProto_Tensor_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_TypeProto_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_onnx::_OperatorSetIdProto_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "opencv-onnx.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, file_level_enum_descriptors, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 13);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\021opencv-onnx.proto\022\013opencv_onnx\"\203\004\n\016Att"
-      "ributeProto\022\014\n\004name\030\001 \001(\t\022\025\n\rref_attr_na"
-      "me\030\025 \001(\t\022\022\n\ndoc_string\030\r \001(\t\0227\n\004type\030\024 \001"
-      "(\0162).opencv_onnx.AttributeProto.Attribut"
-      "eType\022\t\n\001f\030\002 \001(\002\022\t\n\001i\030\003 \001(\003\022\t\n\001s\030\004 \001(\014\022#"
-      "\n\001t\030\005 \001(\0132\030.opencv_onnx.TensorProto\022\"\n\001g"
-      "\030\006 \001(\0132\027.opencv_onnx.GraphProto\022\016\n\006float"
-      "s\030\007 \003(\002\022\014\n\004ints\030\010 \003(\003\022\017\n\007strings\030\t \003(\014\022)"
-      "\n\007tensors\030\n \003(\0132\030.opencv_onnx.TensorProt"
-      "o\022\'\n\006graphs\030\013 \003(\0132\027.opencv_onnx.GraphPro"
-      "to\"\221\001\n\rAttributeType\022\r\n\tUNDEFINED\020\000\022\t\n\005F"
-      "LOAT\020\001\022\007\n\003INT\020\002\022\n\n\006STRING\020\003\022\n\n\006TENSOR\020\004\022"
-      "\t\n\005GRAPH\020\005\022\n\n\006FLOATS\020\006\022\010\n\004INTS\020\007\022\013\n\007STRI"
-      "NGS\020\010\022\013\n\007TENSORS\020\t\022\n\n\006GRAPHS\020\n\"X\n\016ValueI"
-      "nfoProto\022\014\n\004name\030\001 \001(\t\022$\n\004type\030\002 \001(\0132\026.o"
-      "pencv_onnx.TypeProto\022\022\n\ndoc_string\030\003 \001(\t"
-      "\"\235\001\n\tNodeProto\022\r\n\005input\030\001 \003(\t\022\016\n\006output\030"
-      "\002 \003(\t\022\014\n\004name\030\003 \001(\t\022\017\n\007op_type\030\004 \001(\t\022\016\n\006"
-      "domain\030\007 \001(\t\022.\n\tattribute\030\005 \003(\0132\033.opencv"
-      "_onnx.AttributeProto\022\022\n\ndoc_string\030\006 \001(\t"
-      "\"\250\002\n\nModelProto\022\022\n\nir_version\030\001 \001(\003\0225\n\014o"
-      "pset_import\030\010 \003(\0132\037.opencv_onnx.Operator"
-      "SetIdProto\022\025\n\rproducer_name\030\002 \001(\t\022\030\n\020pro"
-      "ducer_version\030\003 \001(\t\022\016\n\006domain\030\004 \001(\t\022\025\n\rm"
-      "odel_version\030\005 \001(\003\022\022\n\ndoc_string\030\006 \001(\t\022&"
-      "\n\005graph\030\007 \001(\0132\027.opencv_onnx.GraphProto\022;"
-      "\n\016metadata_props\030\016 \003(\0132#.opencv_onnx.Str"
-      "ingStringEntryProto\"4\n\026StringStringEntry"
-      "Proto\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"\215\002\n\nGr"
-      "aphProto\022$\n\004node\030\001 \003(\0132\026.opencv_onnx.Nod"
-      "eProto\022\014\n\004name\030\002 \001(\t\022-\n\013initializer\030\005 \003("
-      "\0132\030.opencv_onnx.TensorProto\022\022\n\ndoc_strin"
-      "g\030\n \001(\t\022*\n\005input\030\013 \003(\0132\033.opencv_onnx.Val"
-      "ueInfoProto\022+\n\006output\030\014 \003(\0132\033.opencv_onn"
-      "x.ValueInfoProto\022/\n\nvalue_info\030\r \003(\0132\033.o"
-      "pencv_onnx.ValueInfoProto\"\275\004\n\013TensorProt"
-      "o\022\014\n\004dims\030\001 \003(\003\0224\n\tdata_type\030\002 \001(\0162!.ope"
-      "ncv_onnx.TensorProto.DataType\0221\n\007segment"
-      "\030\003 \001(\0132 .opencv_onnx.TensorProto.Segment"
-      "\022\026\n\nfloat_data\030\004 \003(\002B\002\020\001\022\026\n\nint32_data\030\005"
-      " \003(\005B\002\020\001\022\023\n\013string_data\030\006 \003(\014\022\026\n\nint64_d"
-      "ata\030\007 \003(\003B\002\020\001\022\014\n\004name\030\010 \001(\t\022\022\n\ndoc_strin"
-      "g\030\014 \001(\t\022\020\n\010raw_data\030\t \001(\014\022\027\n\013double_data"
-      "\030\n \003(\001B\002\020\001\022\027\n\013uint64_data\030\013 \003(\004B\002\020\001\032%\n\007S"
-      "egment\022\r\n\005begin\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\"\314\001\n\010D"
-      "ataType\022\r\n\tUNDEFINED\020\000\022\t\n\005FLOAT\020\001\022\t\n\005UIN"
-      "T8\020\002\022\010\n\004INT8\020\003\022\n\n\006UINT16\020\004\022\t\n\005INT16\020\005\022\t\n"
-      "\005INT32\020\006\022\t\n\005INT64\020\007\022\n\n\006STRING\020\010\022\010\n\004BOOL\020"
-      "\t\022\013\n\007FLOAT16\020\n\022\n\n\006DOUBLE\020\013\022\n\n\006UINT32\020\014\022\n"
-      "\n\006UINT64\020\r\022\r\n\tCOMPLEX64\020\016\022\016\n\nCOMPLEX128\020"
-      "\017\"\234\001\n\020TensorShapeProto\0224\n\003dim\030\001 \003(\0132\'.op"
-      "encv_onnx.TensorShapeProto.Dimension\032R\n\t"
-      "Dimension\022\023\n\tdim_value\030\001 \001(\003H\000\022\023\n\tdim_pa"
-      "ram\030\002 \001(\tH\000\022\022\n\ndenotation\030\003 \001(\tB\007\n\005value"
-      "\"\314\001\n\tTypeProto\0224\n\013tensor_type\030\001 \001(\0132\035.op"
-      "encv_onnx.TypeProto.TensorH\000\022\022\n\ndenotati"
-      "on\030\006 \001(\t\032l\n\006Tensor\0224\n\telem_type\030\001 \001(\0162!."
-      "opencv_onnx.TensorProto.DataType\022,\n\005shap"
-      "e\030\002 \001(\0132\035.opencv_onnx.TensorShapeProtoB\007"
-      "\n\005value\"5\n\022OperatorSetIdProto\022\016\n\006domain\030"
-      "\001 \001(\t\022\017\n\007version\030\002 \001(\003*c\n\007Version\022\022\n\016_ST"
-      "ART_VERSION\020\000\022\031\n\025IR_VERSION_2017_10_10\020\001"
-      "\022\031\n\025IR_VERSION_2017_10_30\020\002\022\016\n\nIR_VERSIO"
-      "N\020\003"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 2523);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "opencv-onnx.proto", &protobuf_RegisterTypes);
+const char descriptor_table_protodef_opencv_2donnx_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\021opencv-onnx.proto\022\013opencv_onnx\"\203\004\n\016Att"
+  "ributeProto\022\014\n\004name\030\001 \001(\t\022\025\n\rref_attr_na"
+  "me\030\025 \001(\t\022\022\n\ndoc_string\030\r \001(\t\0227\n\004type\030\024 \001"
+  "(\0162).opencv_onnx.AttributeProto.Attribut"
+  "eType\022\t\n\001f\030\002 \001(\002\022\t\n\001i\030\003 \001(\003\022\t\n\001s\030\004 \001(\014\022#"
+  "\n\001t\030\005 \001(\0132\030.opencv_onnx.TensorProto\022\"\n\001g"
+  "\030\006 \001(\0132\027.opencv_onnx.GraphProto\022\016\n\006float"
+  "s\030\007 \003(\002\022\014\n\004ints\030\010 \003(\003\022\017\n\007strings\030\t \003(\014\022)"
+  "\n\007tensors\030\n \003(\0132\030.opencv_onnx.TensorProt"
+  "o\022\'\n\006graphs\030\013 \003(\0132\027.opencv_onnx.GraphPro"
+  "to\"\221\001\n\rAttributeType\022\r\n\tUNDEFINED\020\000\022\t\n\005F"
+  "LOAT\020\001\022\007\n\003INT\020\002\022\n\n\006STRING\020\003\022\n\n\006TENSOR\020\004\022"
+  "\t\n\005GRAPH\020\005\022\n\n\006FLOATS\020\006\022\010\n\004INTS\020\007\022\013\n\007STRI"
+  "NGS\020\010\022\013\n\007TENSORS\020\t\022\n\n\006GRAPHS\020\n\"X\n\016ValueI"
+  "nfoProto\022\014\n\004name\030\001 \001(\t\022$\n\004type\030\002 \001(\0132\026.o"
+  "pencv_onnx.TypeProto\022\022\n\ndoc_string\030\003 \001(\t"
+  "\"\235\001\n\tNodeProto\022\r\n\005input\030\001 \003(\t\022\016\n\006output\030"
+  "\002 \003(\t\022\014\n\004name\030\003 \001(\t\022\017\n\007op_type\030\004 \001(\t\022\016\n\006"
+  "domain\030\007 \001(\t\022.\n\tattribute\030\005 \003(\0132\033.opencv"
+  "_onnx.AttributeProto\022\022\n\ndoc_string\030\006 \001(\t"
+  "\"\250\002\n\nModelProto\022\022\n\nir_version\030\001 \001(\003\0225\n\014o"
+  "pset_import\030\010 \003(\0132\037.opencv_onnx.Operator"
+  "SetIdProto\022\025\n\rproducer_name\030\002 \001(\t\022\030\n\020pro"
+  "ducer_version\030\003 \001(\t\022\016\n\006domain\030\004 \001(\t\022\025\n\rm"
+  "odel_version\030\005 \001(\003\022\022\n\ndoc_string\030\006 \001(\t\022&"
+  "\n\005graph\030\007 \001(\0132\027.opencv_onnx.GraphProto\022;"
+  "\n\016metadata_props\030\016 \003(\0132#.opencv_onnx.Str"
+  "ingStringEntryProto\"4\n\026StringStringEntry"
+  "Proto\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"\215\002\n\nGr"
+  "aphProto\022$\n\004node\030\001 \003(\0132\026.opencv_onnx.Nod"
+  "eProto\022\014\n\004name\030\002 \001(\t\022-\n\013initializer\030\005 \003("
+  "\0132\030.opencv_onnx.TensorProto\022\022\n\ndoc_strin"
+  "g\030\n \001(\t\022*\n\005input\030\013 \003(\0132\033.opencv_onnx.Val"
+  "ueInfoProto\022+\n\006output\030\014 \003(\0132\033.opencv_onn"
+  "x.ValueInfoProto\022/\n\nvalue_info\030\r \003(\0132\033.o"
+  "pencv_onnx.ValueInfoProto\"\275\004\n\013TensorProt"
+  "o\022\014\n\004dims\030\001 \003(\003\0224\n\tdata_type\030\002 \001(\0162!.ope"
+  "ncv_onnx.TensorProto.DataType\0221\n\007segment"
+  "\030\003 \001(\0132 .opencv_onnx.TensorProto.Segment"
+  "\022\026\n\nfloat_data\030\004 \003(\002B\002\020\001\022\026\n\nint32_data\030\005"
+  " \003(\005B\002\020\001\022\023\n\013string_data\030\006 \003(\014\022\026\n\nint64_d"
+  "ata\030\007 \003(\003B\002\020\001\022\014\n\004name\030\010 \001(\t\022\022\n\ndoc_strin"
+  "g\030\014 \001(\t\022\020\n\010raw_data\030\t \001(\014\022\027\n\013double_data"
+  "\030\n \003(\001B\002\020\001\022\027\n\013uint64_data\030\013 \003(\004B\002\020\001\032%\n\007S"
+  "egment\022\r\n\005begin\030\001 \001(\003\022\013\n\003end\030\002 \001(\003\"\314\001\n\010D"
+  "ataType\022\r\n\tUNDEFINED\020\000\022\t\n\005FLOAT\020\001\022\t\n\005UIN"
+  "T8\020\002\022\010\n\004INT8\020\003\022\n\n\006UINT16\020\004\022\t\n\005INT16\020\005\022\t\n"
+  "\005INT32\020\006\022\t\n\005INT64\020\007\022\n\n\006STRING\020\010\022\010\n\004BOOL\020"
+  "\t\022\013\n\007FLOAT16\020\n\022\n\n\006DOUBLE\020\013\022\n\n\006UINT32\020\014\022\n"
+  "\n\006UINT64\020\r\022\r\n\tCOMPLEX64\020\016\022\016\n\nCOMPLEX128\020"
+  "\017\"\234\001\n\020TensorShapeProto\0224\n\003dim\030\001 \003(\0132\'.op"
+  "encv_onnx.TensorShapeProto.Dimension\032R\n\t"
+  "Dimension\022\023\n\tdim_value\030\001 \001(\003H\000\022\023\n\tdim_pa"
+  "ram\030\002 \001(\tH\000\022\022\n\ndenotation\030\003 \001(\tB\007\n\005value"
+  "\"\314\001\n\tTypeProto\0224\n\013tensor_type\030\001 \001(\0132\035.op"
+  "encv_onnx.TypeProto.TensorH\000\022\022\n\ndenotati"
+  "on\030\006 \001(\t\032l\n\006Tensor\0224\n\telem_type\030\001 \001(\0162!."
+  "opencv_onnx.TensorProto.DataType\022,\n\005shap"
+  "e\030\002 \001(\0132\035.opencv_onnx.TensorShapeProtoB\007"
+  "\n\005value\"5\n\022OperatorSetIdProto\022\016\n\006domain\030"
+  "\001 \001(\t\022\017\n\007version\030\002 \001(\003*c\n\007Version\022\022\n\016_ST"
+  "ART_VERSION\020\000\022\031\n\025IR_VERSION_2017_10_10\020\001"
+  "\022\031\n\025IR_VERSION_2017_10_30\020\002\022\016\n\nIR_VERSIO"
+  "N\020\003"
+  ;
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_opencv_2donnx_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_opencv_2donnx_2eproto = {
+  false, false, 2523, descriptor_table_protodef_opencv_2donnx_2eproto, "opencv-onnx.proto",
+  &descriptor_table_opencv_2donnx_2eproto_once, nullptr, 0, 13,
+  schemas, file_default_instances, TableStruct_opencv_2donnx_2eproto::offsets,
+  file_level_metadata_opencv_2donnx_2eproto, file_level_enum_descriptors_opencv_2donnx_2eproto, file_level_service_descriptors_opencv_2donnx_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_opencv_2donnx_2eproto_getter() {
+  return &descriptor_table_opencv_2donnx_2eproto;
 }
 
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_opencv_2donnx_2eproto
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_opencv_2donnx_2eproto(&descriptor_table_opencv_2donnx_2eproto);
 namespace opencv_onnx {
-const ::google::protobuf::EnumDescriptor* AttributeProto_AttributeType_descriptor() {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2donnx_2eproto::file_level_enum_descriptors[0];
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* AttributeProto_AttributeType_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2donnx_2eproto);
+  return file_level_enum_descriptors_opencv_2donnx_2eproto[0];
 }
 bool AttributeProto_AttributeType_IsValid(int value) {
   switch (value) {
@@ -707,25 +584,25 @@ bool AttributeProto_AttributeType_IsValid(int value) {
   }
 }
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const AttributeProto_AttributeType AttributeProto::UNDEFINED;
-const AttributeProto_AttributeType AttributeProto::FLOAT;
-const AttributeProto_AttributeType AttributeProto::INT;
-const AttributeProto_AttributeType AttributeProto::STRING;
-const AttributeProto_AttributeType AttributeProto::TENSOR;
-const AttributeProto_AttributeType AttributeProto::GRAPH;
-const AttributeProto_AttributeType AttributeProto::FLOATS;
-const AttributeProto_AttributeType AttributeProto::INTS;
-const AttributeProto_AttributeType AttributeProto::STRINGS;
-const AttributeProto_AttributeType AttributeProto::TENSORS;
-const AttributeProto_AttributeType AttributeProto::GRAPHS;
-const AttributeProto_AttributeType AttributeProto::AttributeType_MIN;
-const AttributeProto_AttributeType AttributeProto::AttributeType_MAX;
-const int AttributeProto::AttributeType_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* TensorProto_DataType_descriptor() {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2donnx_2eproto::file_level_enum_descriptors[1];
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr AttributeProto_AttributeType AttributeProto::UNDEFINED;
+constexpr AttributeProto_AttributeType AttributeProto::FLOAT;
+constexpr AttributeProto_AttributeType AttributeProto::INT;
+constexpr AttributeProto_AttributeType AttributeProto::STRING;
+constexpr AttributeProto_AttributeType AttributeProto::TENSOR;
+constexpr AttributeProto_AttributeType AttributeProto::GRAPH;
+constexpr AttributeProto_AttributeType AttributeProto::FLOATS;
+constexpr AttributeProto_AttributeType AttributeProto::INTS;
+constexpr AttributeProto_AttributeType AttributeProto::STRINGS;
+constexpr AttributeProto_AttributeType AttributeProto::TENSORS;
+constexpr AttributeProto_AttributeType AttributeProto::GRAPHS;
+constexpr AttributeProto_AttributeType AttributeProto::AttributeType_MIN;
+constexpr AttributeProto_AttributeType AttributeProto::AttributeType_MAX;
+constexpr int AttributeProto::AttributeType_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TensorProto_DataType_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2donnx_2eproto);
+  return file_level_enum_descriptors_opencv_2donnx_2eproto[1];
 }
 bool TensorProto_DataType_IsValid(int value) {
   switch (value) {
@@ -751,30 +628,30 @@ bool TensorProto_DataType_IsValid(int value) {
   }
 }
 
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const TensorProto_DataType TensorProto::UNDEFINED;
-const TensorProto_DataType TensorProto::FLOAT;
-const TensorProto_DataType TensorProto::UINT8;
-const TensorProto_DataType TensorProto::INT8;
-const TensorProto_DataType TensorProto::UINT16;
-const TensorProto_DataType TensorProto::INT16;
-const TensorProto_DataType TensorProto::INT32;
-const TensorProto_DataType TensorProto::INT64;
-const TensorProto_DataType TensorProto::STRING;
-const TensorProto_DataType TensorProto::BOOL;
-const TensorProto_DataType TensorProto::FLOAT16;
-const TensorProto_DataType TensorProto::DOUBLE;
-const TensorProto_DataType TensorProto::UINT32;
-const TensorProto_DataType TensorProto::UINT64;
-const TensorProto_DataType TensorProto::COMPLEX64;
-const TensorProto_DataType TensorProto::COMPLEX128;
-const TensorProto_DataType TensorProto::DataType_MIN;
-const TensorProto_DataType TensorProto::DataType_MAX;
-const int TensorProto::DataType_ARRAYSIZE;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-const ::google::protobuf::EnumDescriptor* Version_descriptor() {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_opencv_2donnx_2eproto::file_level_enum_descriptors[2];
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+constexpr TensorProto_DataType TensorProto::UNDEFINED;
+constexpr TensorProto_DataType TensorProto::FLOAT;
+constexpr TensorProto_DataType TensorProto::UINT8;
+constexpr TensorProto_DataType TensorProto::INT8;
+constexpr TensorProto_DataType TensorProto::UINT16;
+constexpr TensorProto_DataType TensorProto::INT16;
+constexpr TensorProto_DataType TensorProto::INT32;
+constexpr TensorProto_DataType TensorProto::INT64;
+constexpr TensorProto_DataType TensorProto::STRING;
+constexpr TensorProto_DataType TensorProto::BOOL;
+constexpr TensorProto_DataType TensorProto::FLOAT16;
+constexpr TensorProto_DataType TensorProto::DOUBLE;
+constexpr TensorProto_DataType TensorProto::UINT32;
+constexpr TensorProto_DataType TensorProto::UINT64;
+constexpr TensorProto_DataType TensorProto::COMPLEX64;
+constexpr TensorProto_DataType TensorProto::COMPLEX128;
+constexpr TensorProto_DataType TensorProto::DataType_MIN;
+constexpr TensorProto_DataType TensorProto::DataType_MAX;
+constexpr int TensorProto::DataType_ARRAYSIZE;
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Version_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_opencv_2donnx_2eproto);
+  return file_level_enum_descriptors_opencv_2donnx_2eproto[2];
 }
 bool Version_IsValid(int value) {
   switch (value) {
@@ -791,73 +668,112 @@ bool Version_IsValid(int value) {
 
 // ===================================================================
 
-void AttributeProto::InitAsDefaultInstance() {
-  ::opencv_onnx::_AttributeProto_default_instance_._instance.get_mutable()->t_ = const_cast< ::opencv_onnx::TensorProto*>(
-      ::opencv_onnx::TensorProto::internal_default_instance());
-  ::opencv_onnx::_AttributeProto_default_instance_._instance.get_mutable()->g_ = const_cast< ::opencv_onnx::GraphProto*>(
-      ::opencv_onnx::GraphProto::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int AttributeProto::kNameFieldNumber;
-const int AttributeProto::kRefAttrNameFieldNumber;
-const int AttributeProto::kDocStringFieldNumber;
-const int AttributeProto::kTypeFieldNumber;
-const int AttributeProto::kFFieldNumber;
-const int AttributeProto::kIFieldNumber;
-const int AttributeProto::kSFieldNumber;
-const int AttributeProto::kTFieldNumber;
-const int AttributeProto::kGFieldNumber;
-const int AttributeProto::kFloatsFieldNumber;
-const int AttributeProto::kIntsFieldNumber;
-const int AttributeProto::kStringsFieldNumber;
-const int AttributeProto::kTensorsFieldNumber;
-const int AttributeProto::kGraphsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-AttributeProto::AttributeProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProto();
+class AttributeProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<AttributeProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_ref_attr_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_doc_string(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
   }
+  static void set_has_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 256u;
+  }
+  static void set_has_f(HasBits* has_bits) {
+    (*has_bits)[0] |= 128u;
+  }
+  static void set_has_i(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_s(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static const ::opencv_onnx::TensorProto& t(const AttributeProto* msg);
+  static void set_has_t(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+  static const ::opencv_onnx::GraphProto& g(const AttributeProto* msg);
+  static void set_has_g(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
+  }
+};
+
+const ::opencv_onnx::TensorProto&
+AttributeProto::_Internal::t(const AttributeProto* msg) {
+  return *msg->t_;
+}
+const ::opencv_onnx::GraphProto&
+AttributeProto::_Internal::g(const AttributeProto* msg) {
+  return *msg->g_;
+}
+AttributeProto::AttributeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  floats_(arena),
+  ints_(arena),
+  strings_(arena),
+  tensors_(arena),
+  graphs_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.AttributeProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.AttributeProto)
 }
 AttributeProto::AttributeProto(const AttributeProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       floats_(from.floats_),
       ints_(from.ints_),
       strings_(from.strings_),
       tensors_(from.tensors_),
       graphs_(from.graphs_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_s()) {
-    s_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.s_);
-  }
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_doc_string()) {
-    doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
-  }
-  ref_attr_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_ref_attr_name()) {
-    ref_attr_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ref_attr_name_);
-  }
-  if (from.has_t()) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  s_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    s_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_s()) {
+    s_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_s(),
+      GetArenaForAllocation());
+  }
+  doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_doc_string()) {
+    doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_doc_string(),
+      GetArenaForAllocation());
+  }
+  ref_attr_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    ref_attr_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_ref_attr_name()) {
+    ref_attr_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_ref_attr_name(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_t()) {
     t_ = new ::opencv_onnx::TensorProto(*from.t_);
   } else {
-    t_ = NULL;
+    t_ = nullptr;
   }
-  if (from.has_g()) {
+  if (from._internal_has_g()) {
     g_ = new ::opencv_onnx::GraphProto(*from.g_);
   } else {
-    g_ = NULL;
+    g_ = nullptr;
   }
   ::memcpy(&i_, &from.i_,
     static_cast<size_t>(reinterpret_cast<char*>(&type_) -
@@ -865,57 +781,59 @@ AttributeProto::AttributeProto(const AttributeProto& from)
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.AttributeProto)
 }
 
-void AttributeProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ref_attr_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&t_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&type_) -
-      reinterpret_cast<char*>(&t_)) + sizeof(type_));
+inline void AttributeProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+s_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  s_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ref_attr_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  ref_attr_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&t_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&type_) -
+    reinterpret_cast<char*>(&t_)) + sizeof(type_));
 }
 
 AttributeProto::~AttributeProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.AttributeProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void AttributeProto::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  s_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ref_attr_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void AttributeProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  s_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  doc_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  ref_attr_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete t_;
   if (this != internal_default_instance()) delete g_;
 }
 
-void AttributeProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void AttributeProto::ArenaDtor(void* object) {
+  AttributeProto* _this = reinterpret_cast< AttributeProto* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* AttributeProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const AttributeProto& AttributeProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProto();
-  return *internal_default_instance();
+void AttributeProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-AttributeProto* AttributeProto::New(::google::protobuf::Arena* arena) const {
-  AttributeProto* n = new AttributeProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void AttributeProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void AttributeProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.AttributeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -925,497 +843,348 @@ void AttributeProto::Clear() {
   tensors_.Clear();
   graphs_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 63u) {
+  if (cached_has_bits & 0x0000003fu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!s_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*s_.UnsafeRawStringPointer())->clear();
+      s_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!doc_string_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*doc_string_.UnsafeRawStringPointer())->clear();
+      doc_string_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!ref_attr_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*ref_attr_name_.UnsafeRawStringPointer())->clear();
+      ref_attr_name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(t_ != NULL);
+      GOOGLE_DCHECK(t_ != nullptr);
       t_->Clear();
     }
     if (cached_has_bits & 0x00000020u) {
-      GOOGLE_DCHECK(g_ != NULL);
+      GOOGLE_DCHECK(g_ != nullptr);
       g_->Clear();
     }
   }
-  if (cached_has_bits & 192u) {
+  if (cached_has_bits & 0x000000c0u) {
     ::memset(&i_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&f_) -
         reinterpret_cast<char*>(&i_)) + sizeof(f_));
   }
   type_ = 0;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool AttributeProto::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:opencv_onnx.AttributeProto)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* AttributeProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.AttributeProto.name");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.AttributeProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional float f = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_f();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &f_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
+          _Internal::set_has_f(&has_bits);
+          f_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int64 i = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          set_has_i();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &i_)));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _Internal::set_has_i(&has_bits);
+          i_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bytes s = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_s()));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_s();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_onnx.TensorProto t = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_t()));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_t(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_onnx.GraphProto g = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_g()));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ctx->ParseMessage(_internal_mutable_g(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated float floats = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 61u, input, this->mutable_floats())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_floats())));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 61)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_floats(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+            ptr += sizeof(float);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<61>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 58) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_floats(), ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int64 ints = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 1, 64u, input, this->mutable_ints())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, this->mutable_ints())));
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_ints(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<64>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 66) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_ints(), ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated bytes strings = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->add_strings()));
-        } else {
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_strings();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_onnx.TensorProto tensors = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_tensors()));
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_tensors(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_onnx.GraphProto graphs = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_graphs()));
-        } else {
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_graphs(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<90>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string doc_string = 13;
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_doc_string()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.AttributeProto.doc_string");
-        } else {
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
+          auto str = _internal_mutable_doc_string();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.AttributeProto.doc_string");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_onnx.AttributeProto.AttributeType type = 20;
-      case 20: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(160u /* 160 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_onnx::AttributeProto_AttributeType_IsValid(value)) {
-            set_type(static_cast< ::opencv_onnx::AttributeProto_AttributeType >(value));
+      case 20:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_onnx::AttributeProto_AttributeType_IsValid(val))) {
+            _internal_set_type(static_cast<::opencv_onnx::AttributeProto_AttributeType>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                20, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(20, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string ref_attr_name = 21;
-      case 21: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(170u /* 170 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_ref_attr_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->ref_attr_name().data(), static_cast<int>(this->ref_attr_name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.AttributeProto.ref_attr_name");
-        } else {
+      case 21:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
+          auto str = _internal_mutable_ref_attr_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.AttributeProto.ref_attr_name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } 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:opencv_onnx.AttributeProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.AttributeProto)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void AttributeProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.AttributeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+uint8_t* AttributeProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.AttributeProto)
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.AttributeProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional float f = 2;
   if (cached_has_bits & 0x00000080u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->f(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_f(), target);
   }
 
   // optional int64 i = 3;
   if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->i(), output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_i(), target);
   }
 
   // optional bytes s = 4;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      4, this->s(), output);
+    target = stream->WriteBytesMaybeAliased(
+        4, this->_internal_s(), target);
   }
 
   // optional .opencv_onnx.TensorProto t = 5;
   if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, *this->t_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        5, _Internal::t(this), target, stream);
   }
 
   // optional .opencv_onnx.GraphProto g = 6;
   if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, *this->g_, output);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        6, _Internal::g(this), target, stream);
   }
 
   // repeated float floats = 7;
-  for (int i = 0, n = this->floats_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      7, this->floats(i), output);
+  for (int i = 0, n = this->_internal_floats_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(7, this->_internal_floats(i), target);
   }
 
   // repeated int64 ints = 8;
-  for (int i = 0, n = this->ints_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(
-      8, this->ints(i), output);
-  }
-
-  // repeated bytes strings = 9;
-  for (int i = 0, n = this->strings_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      9, this->strings(i), output);
-  }
-
-  // repeated .opencv_onnx.TensorProto tensors = 10;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->tensors_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      10, this->tensors(static_cast<int>(i)), output);
-  }
-
-  // repeated .opencv_onnx.GraphProto graphs = 11;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->graphs_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      11, this->graphs(static_cast<int>(i)), output);
-  }
-
-  // optional string doc_string = 13;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.AttributeProto.doc_string");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      13, this->doc_string(), output);
-  }
-
-  // optional .opencv_onnx.AttributeProto.AttributeType type = 20;
-  if (cached_has_bits & 0x00000100u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      20, this->type(), output);
-  }
-
-  // optional string ref_attr_name = 21;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->ref_attr_name().data(), static_cast<int>(this->ref_attr_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.AttributeProto.ref_attr_name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      21, this->ref_attr_name(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.AttributeProto)
-}
-
-::google::protobuf::uint8* AttributeProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.AttributeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.AttributeProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
-  }
-
-  // optional float f = 2;
-  if (cached_has_bits & 0x00000080u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->f(), target);
-  }
-
-  // optional int64 i = 3;
-  if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->i(), target);
-  }
-
-  // optional bytes s = 4;
-  if (cached_has_bits & 0x00000002u) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        4, this->s(), target);
-  }
-
-  // optional .opencv_onnx.TensorProto t = 5;
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, *this->t_, deterministic, target);
-  }
-
-  // optional .opencv_onnx.GraphProto g = 6;
-  if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        6, *this->g_, deterministic, target);
+  for (int i = 0, n = this->_internal_ints_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(8, this->_internal_ints(i), target);
   }
 
-  // repeated float floats = 7;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteFloatToArray(7, this->floats_, target);
-
-  // repeated int64 ints = 8;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteInt64ToArray(8, this->ints_, target);
-
   // repeated bytes strings = 9;
-  for (int i = 0, n = this->strings_size(); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteBytesToArray(9, this->strings(i), target);
+  for (int i = 0, n = this->_internal_strings_size(); i < n; i++) {
+    const auto& s = this->_internal_strings(i);
+    target = stream->WriteBytes(9, s, target);
   }
 
   // repeated .opencv_onnx.TensorProto tensors = 10;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->tensors_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        10, this->tensors(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_tensors_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(10, this->_internal_tensors(i), target, stream);
   }
 
   // repeated .opencv_onnx.GraphProto graphs = 11;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->graphs_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        11, this->graphs(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_graphs_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(11, this->_internal_graphs(i), target, stream);
   }
 
   // optional string doc_string = 13;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_doc_string().data(), static_cast<int>(this->_internal_doc_string().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.AttributeProto.doc_string");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        13, this->doc_string(), target);
+    target = stream->WriteStringMaybeAliased(
+        13, this->_internal_doc_string(), target);
   }
 
   // optional .opencv_onnx.AttributeProto.AttributeType type = 20;
   if (cached_has_bits & 0x00000100u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      20, this->type(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      20, this->_internal_type(), target);
   }
 
   // optional string ref_attr_name = 21;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->ref_attr_name().data(), static_cast<int>(this->ref_attr_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_ref_attr_name().data(), static_cast<int>(this->_internal_ref_attr_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.AttributeProto.ref_attr_name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        21, this->ref_attr_name(), target);
+    target = stream->WriteStringMaybeAliased(
+        21, this->_internal_ref_attr_name(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.AttributeProto)
   return target;
@@ -1425,148 +1194,131 @@ size_t AttributeProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.AttributeProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated float floats = 7;
   {
-    unsigned int count = static_cast<unsigned int>(this->floats_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_floats_size());
     size_t data_size = 4UL * count;
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->floats_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_floats_size());
     total_size += data_size;
   }
 
   // repeated int64 ints = 8;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int64Size(this->ints_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->ints_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_ints_size());
     total_size += data_size;
   }
 
   // repeated bytes strings = 9;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->strings_size());
-  for (int i = 0, n = this->strings_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
-      this->strings(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(strings_.size());
+  for (int i = 0, n = strings_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+      strings_.Get(i));
   }
 
   // repeated .opencv_onnx.TensorProto tensors = 10;
-  {
-    unsigned int count = static_cast<unsigned int>(this->tensors_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->tensors(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_tensors_size();
+  for (const auto& msg : this->tensors_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_onnx.GraphProto graphs = 11;
-  {
-    unsigned int count = static_cast<unsigned int>(this->graphs_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->graphs(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_graphs_size();
+  for (const auto& msg : this->graphs_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 255u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x000000ffu) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional bytes s = 4;
-    if (has_s()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::BytesSize(
-          this->s());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+          this->_internal_s());
     }
 
     // optional string doc_string = 13;
-    if (has_doc_string()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->doc_string());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_doc_string());
     }
 
     // optional string ref_attr_name = 21;
-    if (has_ref_attr_name()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->ref_attr_name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_ref_attr_name());
     }
 
     // optional .opencv_onnx.TensorProto t = 5;
-    if (has_t()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->t_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *t_);
     }
 
     // optional .opencv_onnx.GraphProto g = 6;
-    if (has_g()) {
+    if (cached_has_bits & 0x00000020u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->g_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *g_);
     }
 
     // optional int64 i = 3;
-    if (has_i()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->i());
+    if (cached_has_bits & 0x00000040u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_i());
     }
 
     // optional float f = 2;
-    if (has_f()) {
+    if (cached_has_bits & 0x00000080u) {
       total_size += 1 + 4;
     }
 
   }
   // optional .opencv_onnx.AttributeProto.AttributeType type = 20;
-  if (has_type()) {
+  if (cached_has_bits & 0x00000100u) {
     total_size += 2 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void AttributeProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.AttributeProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const AttributeProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const AttributeProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.AttributeProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.AttributeProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData AttributeProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    AttributeProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AttributeProto::GetClassData() const { return &_class_data_; }
+
+void AttributeProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<AttributeProto *>(to)->MergeFrom(
+      static_cast<const AttributeProto &>(from));
 }
 
+
 void AttributeProto::MergeFrom(const AttributeProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.AttributeProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   floats_.MergeFrom(from.floats_);
@@ -1575,28 +1327,24 @@ void AttributeProto::MergeFrom(const AttributeProto& from) {
   tensors_.MergeFrom(from.tensors_);
   graphs_.MergeFrom(from.graphs_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 255u) {
+  if (cached_has_bits & 0x000000ffu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_s();
-      s_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.s_);
+      _internal_set_s(from._internal_s());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_doc_string();
-      doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
+      _internal_set_doc_string(from._internal_doc_string());
     }
     if (cached_has_bits & 0x00000008u) {
-      set_has_ref_attr_name();
-      ref_attr_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ref_attr_name_);
+      _internal_set_ref_attr_name(from._internal_ref_attr_name());
     }
     if (cached_has_bits & 0x00000010u) {
-      mutable_t()->::opencv_onnx::TensorProto::MergeFrom(from.t());
+      _internal_mutable_t()->::opencv_onnx::TensorProto::MergeFrom(from._internal_t());
     }
     if (cached_has_bits & 0x00000020u) {
-      mutable_g()->::opencv_onnx::GraphProto::MergeFrom(from.g());
+      _internal_mutable_g()->::opencv_onnx::GraphProto::MergeFrom(from._internal_g());
     }
     if (cached_has_bits & 0x00000040u) {
       i_ = from.i_;
@@ -1607,15 +1355,9 @@ void AttributeProto::MergeFrom(const AttributeProto& from) {
     _has_bits_[0] |= cached_has_bits;
   }
   if (cached_has_bits & 0x00000100u) {
-    set_type(from.type());
+    _internal_set_type(from._internal_type());
   }
-}
-
-void AttributeProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.AttributeProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void AttributeProto::CopyFrom(const AttributeProto& from) {
@@ -1629,299 +1371,269 @@ bool AttributeProto::IsInitialized() const {
   return true;
 }
 
-void AttributeProto::Swap(AttributeProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void AttributeProto::InternalSwap(AttributeProto* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   floats_.InternalSwap(&other->floats_);
   ints_.InternalSwap(&other->ints_);
   strings_.InternalSwap(&other->strings_);
   tensors_.InternalSwap(&other->tensors_);
   graphs_.InternalSwap(&other->graphs_);
-  name_.Swap(&other->name_);
-  s_.Swap(&other->s_);
-  doc_string_.Swap(&other->doc_string_);
-  ref_attr_name_.Swap(&other->ref_attr_name_);
-  swap(t_, other->t_);
-  swap(g_, other->g_);
-  swap(i_, other->i_);
-  swap(f_, other->f_);
-  swap(type_, other->type_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &s_, lhs_arena,
+      &other->s_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &doc_string_, lhs_arena,
+      &other->doc_string_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &ref_attr_name_, lhs_arena,
+      &other->ref_attr_name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(AttributeProto, type_)
+      + sizeof(AttributeProto::type_)
+      - PROTOBUF_FIELD_OFFSET(AttributeProto, t_)>(
+          reinterpret_cast<char*>(&t_),
+          reinterpret_cast<char*>(&other->t_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata AttributeProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[0]);
 }
 
-::google::protobuf::Metadata AttributeProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
 // ===================================================================
 
-void ValueInfoProto::InitAsDefaultInstance() {
-  ::opencv_onnx::_ValueInfoProto_default_instance_._instance.get_mutable()->type_ = const_cast< ::opencv_onnx::TypeProto*>(
-      ::opencv_onnx::TypeProto::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ValueInfoProto::kNameFieldNumber;
-const int ValueInfoProto::kTypeFieldNumber;
-const int ValueInfoProto::kDocStringFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ValueInfoProto::ValueInfoProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsValueInfoProto();
+class ValueInfoProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ValueInfoProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static const ::opencv_onnx::TypeProto& type(const ValueInfoProto* msg);
+  static void set_has_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_doc_string(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+};
+
+const ::opencv_onnx::TypeProto&
+ValueInfoProto::_Internal::type(const ValueInfoProto* msg) {
+  return *msg->type_;
+}
+ValueInfoProto::ValueInfoProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.ValueInfoProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.ValueInfoProto)
 }
 ValueInfoProto::ValueInfoProto(const ValueInfoProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_doc_string()) {
-    doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
-  }
-  if (from.has_type()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_doc_string()) {
+    doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_doc_string(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_type()) {
     type_ = new ::opencv_onnx::TypeProto(*from.type_);
   } else {
-    type_ = NULL;
+    type_ = nullptr;
   }
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.ValueInfoProto)
 }
 
-void ValueInfoProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_ = NULL;
+inline void ValueInfoProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+type_ = nullptr;
 }
 
 ValueInfoProto::~ValueInfoProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.ValueInfoProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ValueInfoProto::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void ValueInfoProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  doc_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete type_;
 }
 
-void ValueInfoProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void ValueInfoProto::ArenaDtor(void* object) {
+  ValueInfoProto* _this = reinterpret_cast< ValueInfoProto* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* ValueInfoProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const ValueInfoProto& ValueInfoProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsValueInfoProto();
-  return *internal_default_instance();
+void ValueInfoProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-ValueInfoProto* ValueInfoProto::New(::google::protobuf::Arena* arena) const {
-  ValueInfoProto* n = new ValueInfoProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ValueInfoProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void ValueInfoProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.ValueInfoProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!doc_string_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*doc_string_.UnsafeRawStringPointer())->clear();
+      doc_string_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(type_ != NULL);
+      GOOGLE_DCHECK(type_ != nullptr);
       type_->Clear();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ValueInfoProto::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:opencv_onnx.ValueInfoProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* ValueInfoProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.ValueInfoProto.name");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.ValueInfoProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_onnx.TypeProto type = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_type()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_type(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string doc_string = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_doc_string()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.ValueInfoProto.doc_string");
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_doc_string();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.ValueInfoProto.doc_string");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } 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:opencv_onnx.ValueInfoProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.ValueInfoProto)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void ValueInfoProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.ValueInfoProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.ValueInfoProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // optional .opencv_onnx.TypeProto type = 2;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->type_, output);
-  }
-
-  // optional string doc_string = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.ValueInfoProto.doc_string");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->doc_string(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.ValueInfoProto)
-}
-
-::google::protobuf::uint8* ValueInfoProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ValueInfoProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.ValueInfoProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.ValueInfoProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // optional .opencv_onnx.TypeProto type = 2;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, *this->type_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        2, _Internal::type(this), target, stream);
   }
 
   // optional string doc_string = 3;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_doc_string().data(), static_cast<int>(this->_internal_doc_string().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.ValueInfoProto.doc_string");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->doc_string(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_doc_string(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.ValueInfoProto)
   return target;
@@ -1931,84 +1643,69 @@ size_t ValueInfoProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.ValueInfoProto)
   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] & 7u) {
+  uint32_t 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 & 0x00000007u) {
     // optional string name = 1;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional string doc_string = 3;
-    if (has_doc_string()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->doc_string());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_doc_string());
     }
 
     // optional .opencv_onnx.TypeProto type = 2;
-    if (has_type()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->type_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *type_);
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ValueInfoProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.ValueInfoProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ValueInfoProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ValueInfoProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.ValueInfoProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.ValueInfoProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ValueInfoProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ValueInfoProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ValueInfoProto::GetClassData() const { return &_class_data_; }
+
+void ValueInfoProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ValueInfoProto *>(to)->MergeFrom(
+      static_cast<const ValueInfoProto &>(from));
 }
 
+
 void ValueInfoProto::MergeFrom(const ValueInfoProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.ValueInfoProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 7u) {
+  if (cached_has_bits & 0x00000007u) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_doc_string();
-      doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
+      _internal_set_doc_string(from._internal_doc_string());
     }
     if (cached_has_bits & 0x00000004u) {
-      mutable_type()->::opencv_onnx::TypeProto::MergeFrom(from.type());
+      _internal_mutable_type()->::opencv_onnx::TypeProto::MergeFrom(from._internal_type());
     }
   }
-}
-
-void ValueInfoProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.ValueInfoProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ValueInfoProto::CopyFrom(const ValueInfoProto& from) {
@@ -2022,122 +1719,151 @@ bool ValueInfoProto::IsInitialized() const {
   return true;
 }
 
-void ValueInfoProto::Swap(ValueInfoProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ValueInfoProto::InternalSwap(ValueInfoProto* other) {
   using std::swap;
-  name_.Swap(&other->name_);
-  doc_string_.Swap(&other->doc_string_);
-  swap(type_, other->type_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &doc_string_, lhs_arena,
+      &other->doc_string_, rhs_arena
+  );
+  swap(type_, other->type_);
 }
 
-::google::protobuf::Metadata ValueInfoProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata ValueInfoProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[1]);
 }
 
-
 // ===================================================================
 
-void NodeProto::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NodeProto::kInputFieldNumber;
-const int NodeProto::kOutputFieldNumber;
-const int NodeProto::kNameFieldNumber;
-const int NodeProto::kOpTypeFieldNumber;
-const int NodeProto::kDomainFieldNumber;
-const int NodeProto::kAttributeFieldNumber;
-const int NodeProto::kDocStringFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-NodeProto::NodeProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProto();
+class NodeProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<NodeProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_op_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_domain(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_doc_string(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+};
+
+NodeProto::NodeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  input_(arena),
+  output_(arena),
+  attribute_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.NodeProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.NodeProto)
 }
 NodeProto::NodeProto(const NodeProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       input_(from.input_),
       output_(from.output_),
       attribute_(from.attribute_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  op_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_op_type()) {
-    op_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op_type_);
-  }
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_doc_string()) {
-    doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
-  }
-  domain_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_domain()) {
-    domain_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.domain_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  op_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    op_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_op_type()) {
+    op_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_op_type(),
+      GetArenaForAllocation());
+  }
+  doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_doc_string()) {
+    doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_doc_string(),
+      GetArenaForAllocation());
+  }
+  domain_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_domain()) {
+    domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_domain(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.NodeProto)
 }
 
-void NodeProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  op_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  domain_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void NodeProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+op_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  op_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+domain_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 NodeProto::~NodeProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.NodeProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void NodeProto::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  op_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  domain_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void NodeProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  op_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  doc_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  domain_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void NodeProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void NodeProto::ArenaDtor(void* object) {
+  NodeProto* _this = reinterpret_cast< NodeProto* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* NodeProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void NodeProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const NodeProto& NodeProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProto();
-  return *internal_default_instance();
-}
-
-NodeProto* NodeProto::New(::google::protobuf::Arena* arena) const {
-  NodeProto* n = new NodeProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void NodeProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void NodeProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.NodeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2145,331 +1871,228 @@ void NodeProto::Clear() {
   output_.Clear();
   attribute_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!op_type_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*op_type_.UnsafeRawStringPointer())->clear();
+      op_type_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!doc_string_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*doc_string_.UnsafeRawStringPointer())->clear();
+      doc_string_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!domain_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*domain_.UnsafeRawStringPointer())->clear();
+      domain_.ClearNonDefaultToEmpty();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool NodeProto::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:opencv_onnx.NodeProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* NodeProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated string input = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_input()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->input(this->input_size() - 1).data(),
-            static_cast<int>(this->input(this->input_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.NodeProto.input");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_input();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.NodeProto.input");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated string output = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_output()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->output(this->output_size() - 1).data(),
-            static_cast<int>(this->output(this->output_size() - 1).length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.NodeProto.output");
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_output();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.NodeProto.output");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string name = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.NodeProto.name");
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.NodeProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string op_type = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_op_type()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->op_type().data(), static_cast<int>(this->op_type().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.NodeProto.op_type");
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_op_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.NodeProto.op_type");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_onnx.AttributeProto attribute = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_attribute()));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_attribute(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string doc_string = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_doc_string()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.NodeProto.doc_string");
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          auto str = _internal_mutable_doc_string();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.NodeProto.doc_string");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string domain = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_domain()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->domain().data(), static_cast<int>(this->domain().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.NodeProto.domain");
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          auto str = _internal_mutable_domain();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.NodeProto.domain");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } 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:opencv_onnx.NodeProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.NodeProto)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void NodeProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.NodeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated string input = 1;
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->input(i).data(), static_cast<int>(this->input(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.NodeProto.input");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      1, this->input(i), output);
-  }
-
-  // repeated string output = 2;
-  for (int i = 0, n = this->output_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output(i).data(), static_cast<int>(this->output(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.NodeProto.output");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      2, this->output(i), output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.NodeProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->name(), output);
-  }
-
-  // optional string op_type = 4;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->op_type().data(), static_cast<int>(this->op_type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.NodeProto.op_type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->op_type(), output);
-  }
-
-  // repeated .opencv_onnx.AttributeProto attribute = 5;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->attribute_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, this->attribute(static_cast<int>(i)), output);
-  }
-
-  // optional string doc_string = 6;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.NodeProto.doc_string");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      6, this->doc_string(), output);
-  }
-
-  // optional string domain = 7;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->domain().data(), static_cast<int>(this->domain().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.NodeProto.domain");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      7, this->domain(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.NodeProto)
-}
-
-::google::protobuf::uint8* NodeProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* NodeProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.NodeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated string input = 1;
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->input(i).data(), static_cast<int>(this->input(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_input_size(); i < n; i++) {
+    const auto& s = this->_internal_input(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.NodeProto.input");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(1, this->input(i), target);
+    target = stream->WriteString(1, s, target);
   }
 
   // repeated string output = 2;
-  for (int i = 0, n = this->output_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->output(i).data(), static_cast<int>(this->output(i).length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+  for (int i = 0, n = this->_internal_output_size(); i < n; i++) {
+    const auto& s = this->_internal_output(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.NodeProto.output");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(2, this->output(i), target);
+    target = stream->WriteString(2, s, target);
   }
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 3;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.NodeProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_name(), target);
   }
 
   // optional string op_type = 4;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->op_type().data(), static_cast<int>(this->op_type().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_op_type().data(), static_cast<int>(this->_internal_op_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.NodeProto.op_type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->op_type(), target);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_op_type(), target);
   }
 
   // repeated .opencv_onnx.AttributeProto attribute = 5;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->attribute_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, this->attribute(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_attribute_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(5, this->_internal_attribute(i), target, stream);
   }
 
   // optional string doc_string = 6;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_doc_string().data(), static_cast<int>(this->_internal_doc_string().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.NodeProto.doc_string");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        6, this->doc_string(), target);
+    target = stream->WriteStringMaybeAliased(
+        6, this->_internal_doc_string(), target);
   }
 
   // optional string domain = 7;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->domain().data(), static_cast<int>(this->domain().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_domain().data(), static_cast<int>(this->_internal_domain().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.NodeProto.domain");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        7, this->domain(), target);
+    target = stream->WriteStringMaybeAliased(
+        7, this->_internal_domain(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.NodeProto)
   return target;
@@ -2479,126 +2102,105 @@ size_t NodeProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.NodeProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated string input = 1;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->input_size());
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->input(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(input_.size());
+  for (int i = 0, n = input_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      input_.Get(i));
   }
 
   // repeated string output = 2;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->output_size());
-  for (int i = 0, n = this->output_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->output(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(output_.size());
+  for (int i = 0, n = output_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      output_.Get(i));
   }
 
   // repeated .opencv_onnx.AttributeProto attribute = 5;
-  {
-    unsigned int count = static_cast<unsigned int>(this->attribute_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->attribute(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_attribute_size();
+  for (const auto& msg : this->attribute_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 15u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
     // optional string name = 3;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional string op_type = 4;
-    if (has_op_type()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->op_type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_op_type());
     }
 
     // optional string doc_string = 6;
-    if (has_doc_string()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->doc_string());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_doc_string());
     }
 
     // optional string domain = 7;
-    if (has_domain()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->domain());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_domain());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void NodeProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.NodeProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NodeProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NodeProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.NodeProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.NodeProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NodeProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NodeProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NodeProto::GetClassData() const { return &_class_data_; }
+
+void NodeProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NodeProto *>(to)->MergeFrom(
+      static_cast<const NodeProto &>(from));
 }
 
+
 void NodeProto::MergeFrom(const NodeProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.NodeProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   input_.MergeFrom(from.input_);
   output_.MergeFrom(from.output_);
   attribute_.MergeFrom(from.attribute_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_op_type();
-      op_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op_type_);
+      _internal_set_op_type(from._internal_op_type());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_doc_string();
-      doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
+      _internal_set_doc_string(from._internal_doc_string());
     }
     if (cached_has_bits & 0x00000008u) {
-      set_has_domain();
-      domain_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.domain_);
+      _internal_set_domain(from._internal_domain());
     }
   }
-}
-
-void NodeProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.NodeProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void NodeProto::CopyFrom(const NodeProto& from) {
@@ -2612,84 +2214,129 @@ bool NodeProto::IsInitialized() const {
   return true;
 }
 
-void NodeProto::Swap(NodeProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void NodeProto::InternalSwap(NodeProto* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   input_.InternalSwap(&other->input_);
   output_.InternalSwap(&other->output_);
   attribute_.InternalSwap(&other->attribute_);
-  name_.Swap(&other->name_);
-  op_type_.Swap(&other->op_type_);
-  doc_string_.Swap(&other->doc_string_);
-  domain_.Swap(&other->domain_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata NodeProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &op_type_, lhs_arena,
+      &other->op_type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &doc_string_, lhs_arena,
+      &other->doc_string_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &domain_, lhs_arena,
+      &other->domain_, rhs_arena
+  );
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata NodeProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[2]);
 }
 
-
 // ===================================================================
 
-void ModelProto::InitAsDefaultInstance() {
-  ::opencv_onnx::_ModelProto_default_instance_._instance.get_mutable()->graph_ = const_cast< ::opencv_onnx::GraphProto*>(
-      ::opencv_onnx::GraphProto::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int ModelProto::kIrVersionFieldNumber;
-const int ModelProto::kOpsetImportFieldNumber;
-const int ModelProto::kProducerNameFieldNumber;
-const int ModelProto::kProducerVersionFieldNumber;
-const int ModelProto::kDomainFieldNumber;
-const int ModelProto::kModelVersionFieldNumber;
-const int ModelProto::kDocStringFieldNumber;
-const int ModelProto::kGraphFieldNumber;
-const int ModelProto::kMetadataPropsFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-ModelProto::ModelProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsModelProto();
+class ModelProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<ModelProto>()._has_bits_);
+  static void set_has_ir_version(HasBits* has_bits) {
+    (*has_bits)[0] |= 32u;
   }
+  static void set_has_producer_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_producer_version(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static void set_has_domain(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_model_version(HasBits* has_bits) {
+    (*has_bits)[0] |= 64u;
+  }
+  static void set_has_doc_string(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static const ::opencv_onnx::GraphProto& graph(const ModelProto* msg);
+  static void set_has_graph(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
+  }
+};
+
+const ::opencv_onnx::GraphProto&
+ModelProto::_Internal::graph(const ModelProto* msg) {
+  return *msg->graph_;
+}
+ModelProto::ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  opset_import_(arena),
+  metadata_props_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.ModelProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.ModelProto)
 }
 ModelProto::ModelProto(const ModelProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       opset_import_(from.opset_import_),
       metadata_props_(from.metadata_props_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  producer_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_producer_name()) {
-    producer_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.producer_name_);
-  }
-  producer_version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_producer_version()) {
-    producer_version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.producer_version_);
-  }
-  domain_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_domain()) {
-    domain_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.domain_);
-  }
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_doc_string()) {
-    doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
-  }
-  if (from.has_graph()) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  producer_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    producer_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_producer_name()) {
+    producer_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_producer_name(),
+      GetArenaForAllocation());
+  }
+  producer_version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    producer_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_producer_version()) {
+    producer_version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_producer_version(),
+      GetArenaForAllocation());
+  }
+  domain_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_domain()) {
+    domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_domain(),
+      GetArenaForAllocation());
+  }
+  doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_doc_string()) {
+    doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_doc_string(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_graph()) {
     graph_ = new ::opencv_onnx::GraphProto(*from.graph_);
   } else {
-    graph_ = NULL;
+    graph_ = nullptr;
   }
   ::memcpy(&ir_version_, &from.ir_version_,
     static_cast<size_t>(reinterpret_cast<char*>(&model_version_) -
@@ -2697,421 +2344,308 @@ ModelProto::ModelProto(const ModelProto& from)
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.ModelProto)
 }
 
-void ModelProto::SharedCtor() {
-  _cached_size_ = 0;
-  producer_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  producer_version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  domain_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&graph_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&model_version_) -
-      reinterpret_cast<char*>(&graph_)) + sizeof(model_version_));
+inline void ModelProto::SharedCtor() {
+producer_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  producer_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+producer_version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  producer_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+domain_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&graph_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&model_version_) -
+    reinterpret_cast<char*>(&graph_)) + sizeof(model_version_));
 }
 
 ModelProto::~ModelProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.ModelProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void ModelProto::SharedDtor() {
-  producer_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  producer_version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  domain_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void ModelProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  producer_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  producer_version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  domain_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  doc_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete graph_;
 }
 
-void ModelProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* ModelProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const ModelProto& ModelProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsModelProto();
-  return *internal_default_instance();
+void ModelProto::ArenaDtor(void* object) {
+  ModelProto* _this = reinterpret_cast< ModelProto* >(object);
+  (void)_this;
 }
-
-ModelProto* ModelProto::New(::google::protobuf::Arena* arena) const {
-  ModelProto* n = new ModelProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void ModelProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-void ModelProto::Clear() {
-// @@protoc_insertion_point(message_clear_start:opencv_onnx.ModelProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  opset_import_.Clear();
-  metadata_props_.Clear();
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 31u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!producer_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*producer_name_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!producer_version_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*producer_version_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!domain_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*domain_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(!doc_string_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*doc_string_.UnsafeRawStringPointer())->clear();
-    }
-    if (cached_has_bits & 0x00000010u) {
-      GOOGLE_DCHECK(graph_ != NULL);
-      graph_->Clear();
-    }
-  }
-  if (cached_has_bits & 96u) {
-    ::memset(&ir_version_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&model_version_) -
-        reinterpret_cast<char*>(&ir_version_)) + sizeof(model_version_));
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool ModelProto::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:opencv_onnx.ModelProto)
-  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 int64 ir_version = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_ir_version();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &ir_version_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string producer_name = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_producer_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->producer_name().data(), static_cast<int>(this->producer_name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.ModelProto.producer_name");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string producer_version = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_producer_version()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->producer_version().data(), static_cast<int>(this->producer_version().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.ModelProto.producer_version");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string domain = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_domain()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->domain().data(), static_cast<int>(this->domain().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.ModelProto.domain");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional int64 model_version = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          set_has_model_version();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &model_version_)));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string doc_string = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_doc_string()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.ModelProto.doc_string");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional .opencv_onnx.GraphProto graph = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_graph()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .opencv_onnx.OperatorSetIdProto opset_import = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_opset_import()));
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // repeated .opencv_onnx.StringStringEntryProto metadata_props = 14;
-      case 14: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_metadata_props()));
-        } 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:opencv_onnx.ModelProto)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.ModelProto)
-  return false;
-#undef DO_
+void ModelProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
-void ModelProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.ModelProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int64 ir_version = 1;
-  if (cached_has_bits & 0x00000020u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->ir_version(), output);
-  }
-
-  // optional string producer_name = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->producer_name().data(), static_cast<int>(this->producer_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.ModelProto.producer_name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->producer_name(), output);
-  }
-
-  // optional string producer_version = 3;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->producer_version().data(), static_cast<int>(this->producer_version().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.ModelProto.producer_version");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->producer_version(), output);
-  }
-
-  // optional string domain = 4;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->domain().data(), static_cast<int>(this->domain().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.ModelProto.domain");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->domain(), output);
-  }
-
-  // optional int64 model_version = 5;
-  if (cached_has_bits & 0x00000040u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->model_version(), output);
-  }
-
-  // optional string doc_string = 6;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.ModelProto.doc_string");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      6, this->doc_string(), output);
-  }
-
-  // optional .opencv_onnx.GraphProto graph = 7;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, *this->graph_, output);
-  }
-
-  // repeated .opencv_onnx.OperatorSetIdProto opset_import = 8;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->opset_import_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, this->opset_import(static_cast<int>(i)), output);
-  }
+void ModelProto::Clear() {
+// @@protoc_insertion_point(message_clear_start:opencv_onnx.ModelProto)
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
 
-  // repeated .opencv_onnx.StringStringEntryProto metadata_props = 14;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->metadata_props_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      14, this->metadata_props(static_cast<int>(i)), output);
+  opset_import_.Clear();
+  metadata_props_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000001fu) {
+    if (cached_has_bits & 0x00000001u) {
+      producer_name_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      producer_version_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000004u) {
+      domain_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000008u) {
+      doc_string_.ClearNonDefaultToEmpty();
+    }
+    if (cached_has_bits & 0x00000010u) {
+      GOOGLE_DCHECK(graph_ != nullptr);
+      graph_->Clear();
+    }
   }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
+  if (cached_has_bits & 0x00000060u) {
+    ::memset(&ir_version_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&model_version_) -
+        reinterpret_cast<char*>(&ir_version_)) + sizeof(model_version_));
   }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.ModelProto)
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* ModelProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // optional int64 ir_version = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_ir_version(&has_bits);
+          ir_version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string producer_name = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_producer_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.ModelProto.producer_name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string producer_version = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_producer_version();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.ModelProto.producer_version");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string domain = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_domain();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.ModelProto.domain");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional int64 model_version = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _Internal::set_has_model_version(&has_bits);
+          model_version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional string doc_string = 6;
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          auto str = _internal_mutable_doc_string();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.ModelProto.doc_string");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // optional .opencv_onnx.GraphProto graph = 7;
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_graph(), ptr);
+          CHK_(ptr);
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_onnx.OperatorSetIdProto opset_import = 8;
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_opset_import(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      // repeated .opencv_onnx.StringStringEntryProto metadata_props = 14;
+      case 14:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 114)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_metadata_props(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<114>(ptr));
+        } else
+          goto handle_unusual;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* ModelProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* ModelProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.ModelProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int64 ir_version = 1;
   if (cached_has_bits & 0x00000020u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->ir_version(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_ir_version(), target);
   }
 
   // optional string producer_name = 2;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->producer_name().data(), static_cast<int>(this->producer_name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_producer_name().data(), static_cast<int>(this->_internal_producer_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.ModelProto.producer_name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->producer_name(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_producer_name(), target);
   }
 
   // optional string producer_version = 3;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->producer_version().data(), static_cast<int>(this->producer_version().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_producer_version().data(), static_cast<int>(this->_internal_producer_version().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.ModelProto.producer_version");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->producer_version(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_producer_version(), target);
   }
 
   // optional string domain = 4;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->domain().data(), static_cast<int>(this->domain().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_domain().data(), static_cast<int>(this->_internal_domain().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.ModelProto.domain");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->domain(), target);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_domain(), target);
   }
 
   // optional int64 model_version = 5;
   if (cached_has_bits & 0x00000040u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->model_version(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->_internal_model_version(), target);
   }
 
   // optional string doc_string = 6;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_doc_string().data(), static_cast<int>(this->_internal_doc_string().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.ModelProto.doc_string");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        6, this->doc_string(), target);
+    target = stream->WriteStringMaybeAliased(
+        6, this->_internal_doc_string(), target);
   }
 
   // optional .opencv_onnx.GraphProto graph = 7;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, *this->graph_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        7, _Internal::graph(this), target, stream);
   }
 
   // repeated .opencv_onnx.OperatorSetIdProto opset_import = 8;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->opset_import_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, this->opset_import(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_opset_import_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(8, this->_internal_opset_import(i), target, stream);
   }
 
   // repeated .opencv_onnx.StringStringEntryProto metadata_props = 14;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->metadata_props_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        14, this->metadata_props(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_metadata_props_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(14, this->_internal_metadata_props(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.ModelProto)
   return target;
@@ -3121,135 +2655,112 @@ size_t ModelProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.ModelProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_onnx.OperatorSetIdProto opset_import = 8;
-  {
-    unsigned int count = static_cast<unsigned int>(this->opset_import_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->opset_import(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_opset_import_size();
+  for (const auto& msg : this->opset_import_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_onnx.StringStringEntryProto metadata_props = 14;
-  {
-    unsigned int count = static_cast<unsigned int>(this->metadata_props_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->metadata_props(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_metadata_props_size();
+  for (const auto& msg : this->metadata_props_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 127u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000007fu) {
     // optional string producer_name = 2;
-    if (has_producer_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->producer_name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_producer_name());
     }
 
     // optional string producer_version = 3;
-    if (has_producer_version()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->producer_version());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_producer_version());
     }
 
     // optional string domain = 4;
-    if (has_domain()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->domain());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_domain());
     }
 
     // optional string doc_string = 6;
-    if (has_doc_string()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->doc_string());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_doc_string());
     }
 
     // optional .opencv_onnx.GraphProto graph = 7;
-    if (has_graph()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->graph_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *graph_);
     }
 
     // optional int64 ir_version = 1;
-    if (has_ir_version()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->ir_version());
+    if (cached_has_bits & 0x00000020u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_ir_version());
     }
 
     // optional int64 model_version = 5;
-    if (has_model_version()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->model_version());
+    if (cached_has_bits & 0x00000040u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_model_version());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void ModelProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.ModelProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const ModelProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const ModelProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.ModelProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.ModelProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ModelProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    ModelProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ModelProto::GetClassData() const { return &_class_data_; }
+
+void ModelProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<ModelProto *>(to)->MergeFrom(
+      static_cast<const ModelProto &>(from));
 }
 
+
 void ModelProto::MergeFrom(const ModelProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.ModelProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   opset_import_.MergeFrom(from.opset_import_);
   metadata_props_.MergeFrom(from.metadata_props_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 127u) {
+  if (cached_has_bits & 0x0000007fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_producer_name();
-      producer_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.producer_name_);
+      _internal_set_producer_name(from._internal_producer_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_producer_version();
-      producer_version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.producer_version_);
+      _internal_set_producer_version(from._internal_producer_version());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_domain();
-      domain_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.domain_);
+      _internal_set_domain(from._internal_domain());
     }
     if (cached_has_bits & 0x00000008u) {
-      set_has_doc_string();
-      doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
+      _internal_set_doc_string(from._internal_doc_string());
     }
     if (cached_has_bits & 0x00000010u) {
-      mutable_graph()->::opencv_onnx::GraphProto::MergeFrom(from.graph());
+      _internal_mutable_graph()->::opencv_onnx::GraphProto::MergeFrom(from._internal_graph());
     }
     if (cached_has_bits & 0x00000020u) {
       ir_version_ = from.ir_version_;
@@ -3259,13 +2770,7 @@ void ModelProto::MergeFrom(const ModelProto& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void ModelProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.ModelProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void ModelProto::CopyFrom(const ModelProto& from) {
@@ -3279,255 +2784,231 @@ bool ModelProto::IsInitialized() const {
   return true;
 }
 
-void ModelProto::Swap(ModelProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void ModelProto::InternalSwap(ModelProto* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   opset_import_.InternalSwap(&other->opset_import_);
   metadata_props_.InternalSwap(&other->metadata_props_);
-  producer_name_.Swap(&other->producer_name_);
-  producer_version_.Swap(&other->producer_version_);
-  domain_.Swap(&other->domain_);
-  doc_string_.Swap(&other->doc_string_);
-  swap(graph_, other->graph_);
-  swap(ir_version_, other->ir_version_);
-  swap(model_version_, other->model_version_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &producer_name_, lhs_arena,
+      &other->producer_name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &producer_version_, lhs_arena,
+      &other->producer_version_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &domain_, lhs_arena,
+      &other->domain_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &doc_string_, lhs_arena,
+      &other->doc_string_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ModelProto, model_version_)
+      + sizeof(ModelProto::model_version_)
+      - PROTOBUF_FIELD_OFFSET(ModelProto, graph_)>(
+          reinterpret_cast<char*>(&graph_),
+          reinterpret_cast<char*>(&other->graph_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata ModelProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[3]);
 }
 
-::google::protobuf::Metadata ModelProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
 // ===================================================================
 
-void StringStringEntryProto::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int StringStringEntryProto::kKeyFieldNumber;
-const int StringStringEntryProto::kValueFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-StringStringEntryProto::StringStringEntryProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsStringStringEntryProto();
+class StringStringEntryProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<StringStringEntryProto>()._has_bits_);
+  static void set_has_key(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_value(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+StringStringEntryProto::StringStringEntryProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.StringStringEntryProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.StringStringEntryProto)
 }
 StringStringEntryProto::StringStringEntryProto(const StringStringEntryProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_key()) {
-    key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_);
-  }
-  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_value()) {
-    value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_key()) {
+    key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_key(),
+      GetArenaForAllocation());
+  }
+  value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_value()) {
+    value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_value(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.StringStringEntryProto)
 }
 
-void StringStringEntryProto::SharedCtor() {
-  _cached_size_ = 0;
-  key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void StringStringEntryProto::SharedCtor() {
+key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 StringStringEntryProto::~StringStringEntryProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.StringStringEntryProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void StringStringEntryProto::SharedDtor() {
-  key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void StringStringEntryProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void StringStringEntryProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* StringStringEntryProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void StringStringEntryProto::ArenaDtor(void* object) {
+  StringStringEntryProto* _this = reinterpret_cast< StringStringEntryProto* >(object);
+  (void)_this;
 }
-
-const StringStringEntryProto& StringStringEntryProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsStringStringEntryProto();
-  return *internal_default_instance();
+void StringStringEntryProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-StringStringEntryProto* StringStringEntryProto::New(::google::protobuf::Arena* arena) const {
-  StringStringEntryProto* n = new StringStringEntryProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void StringStringEntryProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void StringStringEntryProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.StringStringEntryProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!key_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*key_.UnsafeRawStringPointer())->clear();
+      key_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*value_.UnsafeRawStringPointer())->clear();
+      value_.ClearNonDefaultToEmpty();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool StringStringEntryProto::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:opencv_onnx.StringStringEntryProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* StringStringEntryProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string key = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_key()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->key().data(), static_cast<int>(this->key().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.StringStringEntryProto.key");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_key();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.StringStringEntryProto.key");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string value = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_value()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->value().data(), static_cast<int>(this->value().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.StringStringEntryProto.value");
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_value();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.StringStringEntryProto.value");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } 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:opencv_onnx.StringStringEntryProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.StringStringEntryProto)
-  return false;
-#undef DO_
-}
-
-void StringStringEntryProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.StringStringEntryProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string key = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->key().data(), static_cast<int>(this->key().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.StringStringEntryProto.key");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->key(), output);
-  }
-
-  // optional string value = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->value().data(), static_cast<int>(this->value().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.StringStringEntryProto.value");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->value(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.StringStringEntryProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* StringStringEntryProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* StringStringEntryProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.StringStringEntryProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string key = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->key().data(), static_cast<int>(this->key().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_key().data(), static_cast<int>(this->_internal_key().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.StringStringEntryProto.key");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->key(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_key(), target);
   }
 
   // optional string value = 2;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->value().data(), static_cast<int>(this->value().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_value().data(), static_cast<int>(this->_internal_value().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.StringStringEntryProto.value");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->value(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_value(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.StringStringEntryProto)
   return target;
@@ -3537,74 +3018,59 @@ size_t StringStringEntryProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.StringStringEntryProto)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional string key = 1;
-    if (has_key()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->key());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_key());
     }
 
     // optional string value = 2;
-    if (has_value()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->value());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_value());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void StringStringEntryProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.StringStringEntryProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const StringStringEntryProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const StringStringEntryProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.StringStringEntryProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.StringStringEntryProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData StringStringEntryProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    StringStringEntryProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*StringStringEntryProto::GetClassData() const { return &_class_data_; }
+
+void StringStringEntryProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<StringStringEntryProto *>(to)->MergeFrom(
+      static_cast<const StringStringEntryProto &>(from));
 }
 
+
 void StringStringEntryProto::MergeFrom(const StringStringEntryProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.StringStringEntryProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_key();
-      key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_);
+      _internal_set_key(from._internal_key());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_value();
-      value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
+      _internal_set_value(from._internal_value());
     }
   }
-}
-
-void StringStringEntryProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.StringStringEntryProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void StringStringEntryProto::CopyFrom(const StringStringEntryProto& from) {
@@ -3618,111 +3084,122 @@ bool StringStringEntryProto::IsInitialized() const {
   return true;
 }
 
-void StringStringEntryProto::Swap(StringStringEntryProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void StringStringEntryProto::InternalSwap(StringStringEntryProto* other) {
   using std::swap;
-  key_.Swap(&other->key_);
-  value_.Swap(&other->value_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &key_, lhs_arena,
+      &other->key_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &value_, lhs_arena,
+      &other->value_, rhs_arena
+  );
 }
 
-::google::protobuf::Metadata StringStringEntryProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata StringStringEntryProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[4]);
 }
 
-
 // ===================================================================
 
-void GraphProto::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int GraphProto::kNodeFieldNumber;
-const int GraphProto::kNameFieldNumber;
-const int GraphProto::kInitializerFieldNumber;
-const int GraphProto::kDocStringFieldNumber;
-const int GraphProto::kInputFieldNumber;
-const int GraphProto::kOutputFieldNumber;
-const int GraphProto::kValueInfoFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-GraphProto::GraphProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProto();
+class GraphProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<GraphProto>()._has_bits_);
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_doc_string(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+GraphProto::GraphProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  node_(arena),
+  initializer_(arena),
+  input_(arena),
+  output_(arena),
+  value_info_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.GraphProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.GraphProto)
 }
 GraphProto::GraphProto(const GraphProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       node_(from.node_),
       initializer_(from.initializer_),
       input_(from.input_),
       output_(from.output_),
       value_info_(from.value_info_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_doc_string()) {
-    doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_doc_string()) {
+    doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_doc_string(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.GraphProto)
 }
 
-void GraphProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void GraphProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 GraphProto::~GraphProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.GraphProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void GraphProto::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void GraphProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  doc_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void GraphProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void GraphProto::ArenaDtor(void* object) {
+  GraphProto* _this = reinterpret_cast< GraphProto* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* GraphProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const GraphProto& GraphProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProto();
-  return *internal_default_instance();
+void GraphProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-GraphProto* GraphProto::New(::google::protobuf::Arena* arena) const {
-  GraphProto* n = new GraphProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void GraphProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void GraphProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.GraphProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -3732,279 +3209,208 @@ void GraphProto::Clear() {
   output_.Clear();
   value_info_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!doc_string_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*doc_string_.UnsafeRawStringPointer())->clear();
+      doc_string_.ClearNonDefaultToEmpty();
     }
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool GraphProto::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:opencv_onnx.GraphProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* GraphProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .opencv_onnx.NodeProto node = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_node()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_node(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string name = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.GraphProto.name");
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.GraphProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_onnx.TensorProto initializer = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_initializer()));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_initializer(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string doc_string = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_doc_string()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.GraphProto.doc_string");
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          auto str = _internal_mutable_doc_string();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.GraphProto.doc_string");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_onnx.ValueInfoProto input = 11;
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_input()));
-        } else {
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_input(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<90>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_onnx.ValueInfoProto output = 12;
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_output()));
-        } else {
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_output(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<98>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_onnx.ValueInfoProto value_info = 13;
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_value_info()));
-        } else {
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_value_info(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<106>(ptr));
+        } 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:opencv_onnx.GraphProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.GraphProto)
-  return false;
-#undef DO_
-}
-
-void GraphProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.GraphProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_onnx.NodeProto node = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->node(static_cast<int>(i)), output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional string name = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.GraphProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->name(), output);
-  }
-
-  // repeated .opencv_onnx.TensorProto initializer = 5;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->initializer_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      5, this->initializer(static_cast<int>(i)), output);
-  }
-
-  // optional string doc_string = 10;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.GraphProto.doc_string");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      10, this->doc_string(), output);
-  }
-
-  // repeated .opencv_onnx.ValueInfoProto input = 11;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->input_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      11, this->input(static_cast<int>(i)), output);
-  }
-
-  // repeated .opencv_onnx.ValueInfoProto output = 12;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->output_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      12, this->output(static_cast<int>(i)), output);
-  }
-
-  // repeated .opencv_onnx.ValueInfoProto value_info = 13;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->value_info_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      13, this->value_info(static_cast<int>(i)), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.GraphProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* GraphProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* GraphProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.GraphProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .opencv_onnx.NodeProto node = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->node(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_node_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_node(i), target, stream);
   }
 
   cached_has_bits = _has_bits_[0];
   // optional string name = 2;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.GraphProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_name(), target);
   }
 
   // repeated .opencv_onnx.TensorProto initializer = 5;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->initializer_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        5, this->initializer(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_initializer_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(5, this->_internal_initializer(i), target, stream);
   }
 
   // optional string doc_string = 10;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_doc_string().data(), static_cast<int>(this->_internal_doc_string().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.GraphProto.doc_string");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        10, this->doc_string(), target);
+    target = stream->WriteStringMaybeAliased(
+        10, this->_internal_doc_string(), target);
   }
 
   // repeated .opencv_onnx.ValueInfoProto input = 11;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->input_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        11, this->input(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_input_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(11, this->_internal_input(i), target, stream);
   }
 
   // repeated .opencv_onnx.ValueInfoProto output = 12;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->output_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        12, this->output(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_output_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(12, this->_internal_output(i), target, stream);
   }
 
   // repeated .opencv_onnx.ValueInfoProto value_info = 13;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->value_info_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        13, this->value_info(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_value_info_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(13, this->_internal_value_info(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.GraphProto)
   return target;
@@ -4014,109 +3420,82 @@ size_t GraphProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.GraphProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_onnx.NodeProto node = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->node_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->node(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_node_size();
+  for (const auto& msg : this->node_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_onnx.TensorProto initializer = 5;
-  {
-    unsigned int count = static_cast<unsigned int>(this->initializer_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->initializer(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_initializer_size();
+  for (const auto& msg : this->initializer_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_onnx.ValueInfoProto input = 11;
-  {
-    unsigned int count = static_cast<unsigned int>(this->input_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->input(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_input_size();
+  for (const auto& msg : this->input_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_onnx.ValueInfoProto output = 12;
-  {
-    unsigned int count = static_cast<unsigned int>(this->output_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->output(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_output_size();
+  for (const auto& msg : this->output_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_onnx.ValueInfoProto value_info = 13;
-  {
-    unsigned int count = static_cast<unsigned int>(this->value_info_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->value_info(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_value_info_size();
+  for (const auto& msg : this->value_info_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  if (_has_bits_[0 / 32] & 3u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
     // optional string name = 2;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional string doc_string = 10;
-    if (has_doc_string()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->doc_string());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_doc_string());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void GraphProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.GraphProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const GraphProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const GraphProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.GraphProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.GraphProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GraphProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    GraphProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GraphProto::GetClassData() const { return &_class_data_; }
+
+void GraphProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<GraphProto *>(to)->MergeFrom(
+      static_cast<const GraphProto &>(from));
 }
 
+
 void GraphProto::MergeFrom(const GraphProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.GraphProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   node_.MergeFrom(from.node_);
@@ -4125,23 +3504,15 @@ void GraphProto::MergeFrom(const GraphProto& from) {
   output_.MergeFrom(from.output_);
   value_info_.MergeFrom(from.value_info_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_doc_string();
-      doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
+      _internal_set_doc_string(from._internal_doc_string());
     }
   }
-}
-
-void GraphProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.GraphProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void GraphProto::CopyFrom(const GraphProto& from) {
@@ -4155,216 +3526,182 @@ bool GraphProto::IsInitialized() const {
   return true;
 }
 
-void GraphProto::Swap(GraphProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void GraphProto::InternalSwap(GraphProto* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   node_.InternalSwap(&other->node_);
   initializer_.InternalSwap(&other->initializer_);
   input_.InternalSwap(&other->input_);
   output_.InternalSwap(&other->output_);
   value_info_.InternalSwap(&other->value_info_);
-  name_.Swap(&other->name_);
-  doc_string_.Swap(&other->doc_string_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &doc_string_, lhs_arena,
+      &other->doc_string_, rhs_arena
+  );
 }
 
-::google::protobuf::Metadata GraphProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata GraphProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[5]);
 }
 
-
 // ===================================================================
 
-void TensorProto_Segment::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TensorProto_Segment::kBeginFieldNumber;
-const int TensorProto_Segment::kEndFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TensorProto_Segment::TensorProto_Segment()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorProto_Segment();
+class TensorProto_Segment::_Internal {
+ public:
+  using HasBits = decltype(std::declval<TensorProto_Segment>()._has_bits_);
+  static void set_has_begin(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+  static void set_has_end(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+TensorProto_Segment::TensorProto_Segment(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.TensorProto.Segment)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.TensorProto.Segment)
 }
 TensorProto_Segment::TensorProto_Segment(const TensorProto_Segment& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&begin_, &from.begin_,
     static_cast<size_t>(reinterpret_cast<char*>(&end_) -
     reinterpret_cast<char*>(&begin_)) + sizeof(end_));
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.TensorProto.Segment)
 }
 
-void TensorProto_Segment::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&begin_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&end_) -
-      reinterpret_cast<char*>(&begin_)) + sizeof(end_));
+inline void TensorProto_Segment::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&begin_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&end_) -
+    reinterpret_cast<char*>(&begin_)) + sizeof(end_));
 }
 
 TensorProto_Segment::~TensorProto_Segment() {
   // @@protoc_insertion_point(destructor:opencv_onnx.TensorProto.Segment)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TensorProto_Segment::SharedDtor() {
+inline void TensorProto_Segment::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void TensorProto_Segment::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TensorProto_Segment::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void TensorProto_Segment::ArenaDtor(void* object) {
+  TensorProto_Segment* _this = reinterpret_cast< TensorProto_Segment* >(object);
+  (void)_this;
 }
-
-const TensorProto_Segment& TensorProto_Segment::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorProto_Segment();
-  return *internal_default_instance();
+void TensorProto_Segment::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-TensorProto_Segment* TensorProto_Segment::New(::google::protobuf::Arena* arena) const {
-  TensorProto_Segment* n = new TensorProto_Segment;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TensorProto_Segment::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TensorProto_Segment::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.TensorProto.Segment)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     ::memset(&begin_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&end_) -
         reinterpret_cast<char*>(&begin_)) + sizeof(end_));
   }
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TensorProto_Segment::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:opencv_onnx.TensorProto.Segment)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TensorProto_Segment::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional int64 begin = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          set_has_begin();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &begin_)));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _Internal::set_has_begin(&has_bits);
+          begin_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int64 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::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &end_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_end(&has_bits);
+          end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } 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:opencv_onnx.TensorProto.Segment)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.TensorProto.Segment)
-  return false;
-#undef DO_
-}
-
-void TensorProto_Segment::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.TensorProto.Segment)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional int64 begin = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->begin(), output);
-  }
-
-  // optional int64 end = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(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:opencv_onnx.TensorProto.Segment)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TensorProto_Segment::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TensorProto_Segment::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.TensorProto.Segment)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional int64 begin = 1;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->begin(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_begin(), target);
   }
 
   // optional int64 end = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->end(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_end(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.TensorProto.Segment)
   return target;
@@ -4374,58 +3711,47 @@ size_t TensorProto_Segment::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.TensorProto.Segment)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional int64 begin = 1;
-    if (has_begin()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->begin());
+    if (cached_has_bits & 0x00000001u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_begin());
     }
 
     // optional int64 end = 2;
-    if (has_end()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->end());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TensorProto_Segment::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.TensorProto.Segment)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TensorProto_Segment* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TensorProto_Segment>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.TensorProto.Segment)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.TensorProto.Segment)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TensorProto_Segment::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TensorProto_Segment::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TensorProto_Segment::GetClassData() const { return &_class_data_; }
+
+void TensorProto_Segment::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TensorProto_Segment *>(to)->MergeFrom(
+      static_cast<const TensorProto_Segment &>(from));
 }
 
+
 void TensorProto_Segment::MergeFrom(const TensorProto_Segment& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.TensorProto.Segment)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
       begin_ = from.begin_;
     }
@@ -4434,13 +3760,7 @@ void TensorProto_Segment::MergeFrom(const TensorProto_Segment& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void TensorProto_Segment::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.TensorProto.Segment)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TensorProto_Segment::CopyFrom(const TensorProto_Segment& from) {
@@ -4454,59 +3774,70 @@ bool TensorProto_Segment::IsInitialized() const {
   return true;
 }
 
-void TensorProto_Segment::Swap(TensorProto_Segment* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TensorProto_Segment::InternalSwap(TensorProto_Segment* other) {
   using std::swap;
-  swap(begin_, other->begin_);
-  swap(end_, other->end_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(TensorProto_Segment, end_)
+      + sizeof(TensorProto_Segment::end_)
+      - PROTOBUF_FIELD_OFFSET(TensorProto_Segment, begin_)>(
+          reinterpret_cast<char*>(&begin_),
+          reinterpret_cast<char*>(&other->begin_));
 }
 
-::google::protobuf::Metadata TensorProto_Segment::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TensorProto_Segment::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[6]);
 }
 
-
 // ===================================================================
 
-void TensorProto::InitAsDefaultInstance() {
-  ::opencv_onnx::_TensorProto_default_instance_._instance.get_mutable()->segment_ = const_cast< ::opencv_onnx::TensorProto_Segment*>(
-      ::opencv_onnx::TensorProto_Segment::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TensorProto::kDimsFieldNumber;
-const int TensorProto::kDataTypeFieldNumber;
-const int TensorProto::kSegmentFieldNumber;
-const int TensorProto::kFloatDataFieldNumber;
-const int TensorProto::kInt32DataFieldNumber;
-const int TensorProto::kStringDataFieldNumber;
-const int TensorProto::kInt64DataFieldNumber;
-const int TensorProto::kNameFieldNumber;
-const int TensorProto::kDocStringFieldNumber;
-const int TensorProto::kRawDataFieldNumber;
-const int TensorProto::kDoubleDataFieldNumber;
-const int TensorProto::kUint64DataFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TensorProto::TensorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorProto();
+class TensorProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<TensorProto>()._has_bits_);
+  static void set_has_data_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 16u;
   }
+  static const ::opencv_onnx::TensorProto_Segment& segment(const TensorProto* msg);
+  static void set_has_segment(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static void set_has_name(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_doc_string(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_raw_data(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+};
+
+const ::opencv_onnx::TensorProto_Segment&
+TensorProto::_Internal::segment(const TensorProto* msg) {
+  return *msg->segment_;
+}
+TensorProto::TensorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  dims_(arena),
+  float_data_(arena),
+  int32_data_(arena),
+  string_data_(arena),
+  int64_data_(arena),
+  double_data_(arena),
+  uint64_data_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.TensorProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.TensorProto)
 }
 TensorProto::TensorProto(const TensorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       _has_bits_(from._has_bits_),
-      _cached_size_(0),
       dims_(from.dims_),
       float_data_(from.float_data_),
       int32_data_(from.int32_data_),
@@ -4514,76 +3845,87 @@ TensorProto::TensorProto(const TensorProto& from)
       int64_data_(from.int64_data_),
       double_data_(from.double_data_),
       uint64_data_(from.uint64_data_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_name()) {
-    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
-  }
-  raw_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_raw_data()) {
-    raw_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.raw_data_);
-  }
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_doc_string()) {
-    doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
-  }
-  if (from.has_segment()) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_name()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  raw_data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    raw_data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_raw_data()) {
+    raw_data_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_raw_data(),
+      GetArenaForAllocation());
+  }
+  doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_doc_string()) {
+    doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_doc_string(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_segment()) {
     segment_ = new ::opencv_onnx::TensorProto_Segment(*from.segment_);
   } else {
-    segment_ = NULL;
+    segment_ = nullptr;
   }
   data_type_ = from.data_type_;
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.TensorProto)
 }
 
-void TensorProto::SharedCtor() {
-  _cached_size_ = 0;
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  raw_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&segment_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&data_type_) -
-      reinterpret_cast<char*>(&segment_)) + sizeof(data_type_));
+inline void TensorProto::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+raw_data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  raw_data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+doc_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&segment_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&data_type_) -
+    reinterpret_cast<char*>(&segment_)) + sizeof(data_type_));
 }
 
 TensorProto::~TensorProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.TensorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TensorProto::SharedDtor() {
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  raw_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  doc_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void TensorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  raw_data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  doc_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete segment_;
 }
 
-void TensorProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TensorProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void TensorProto::ArenaDtor(void* object) {
+  TensorProto* _this = reinterpret_cast< TensorProto* >(object);
+  (void)_this;
 }
-
-const TensorProto& TensorProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorProto();
-  return *internal_default_instance();
+void TensorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-TensorProto* TensorProto::New(::google::protobuf::Arena* arena) const {
-  TensorProto* n = new TensorProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TensorProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TensorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.TensorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -4595,504 +3937,296 @@ void TensorProto::Clear() {
   double_data_.Clear();
   uint64_data_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 0x0000000fu) {
     if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*name_.UnsafeRawStringPointer())->clear();
+      name_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000002u) {
-      GOOGLE_DCHECK(!raw_data_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*raw_data_.UnsafeRawStringPointer())->clear();
+      raw_data_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000004u) {
-      GOOGLE_DCHECK(!doc_string_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-      (*doc_string_.UnsafeRawStringPointer())->clear();
+      doc_string_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      GOOGLE_DCHECK(segment_ != NULL);
+      GOOGLE_DCHECK(segment_ != nullptr);
       segment_->Clear();
     }
   }
   data_type_ = 0;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TensorProto::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:opencv_onnx.TensorProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TensorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated int64 dims = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 1, 8u, input, this->mutable_dims())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, this->mutable_dims())));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            _internal_add_dims(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8>(ptr));
+        } else if (static_cast<uint8_t>(tag) == 10) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_dims(), ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_onnx.TensorProto.DataType data_type = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_onnx::TensorProto_DataType_IsValid(value)) {
-            set_data_type(static_cast< ::opencv_onnx::TensorProto_DataType >(value));
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_onnx::TensorProto_DataType_IsValid(val))) {
+            _internal_set_data_type(static_cast<::opencv_onnx::TensorProto_DataType>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                2, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_onnx.TensorProto.Segment segment = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_segment()));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_segment(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated float float_data = 4 [packed = true];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_float_data())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 34u, input, this->mutable_float_data())));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_float_data(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 37) {
+          _internal_add_float_data(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+          ptr += sizeof(float);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int32 int32_data = 5 [packed = true];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_int32_data())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 42u, input, this->mutable_int32_data())));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_int32_data(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 40) {
+          _internal_add_int32_data(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated bytes string_data = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->add_string_data()));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_string_data();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int64 int64_data = 7 [packed = true];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, this->mutable_int64_data())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 1, 58u, input, this->mutable_int64_data())));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_int64_data(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 56) {
+          _internal_add_int64_data(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string name = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.TensorProto.name");
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.TensorProto.name");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional bytes raw_data = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_raw_data()));
-        } else {
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          auto str = _internal_mutable_raw_data();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated double double_data = 10 [packed = true];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 input, this->mutable_double_data())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(81u /* 81 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 1, 82u, input, this->mutable_double_data())));
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_double_data(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 81) {
+          _internal_add_double_data(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
+          ptr += sizeof(double);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated uint64 uint64_data = 11 [packed = true];
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
-                 input, this->mutable_uint64_data())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
-                 1, 90u, input, this->mutable_uint64_data())));
-        } else {
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_uint64_data(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 88) {
+          _internal_add_uint64_data(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string doc_string = 12;
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_doc_string()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.TensorProto.doc_string");
-        } else {
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          auto str = _internal_mutable_doc_string();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.TensorProto.doc_string");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } 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:opencv_onnx.TensorProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.TensorProto)
-  return false;
-#undef DO_
-}
-
-void TensorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.TensorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated int64 dims = 1;
-  for (int i = 0, n = this->dims_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(
-      1, this->dims(i), output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_onnx.TensorProto.DataType data_type = 2;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      2, this->data_type(), output);
-  }
-
-  // optional .opencv_onnx.TensorProto.Segment segment = 3;
-  if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->segment_, output);
-  }
-
-  // repeated float float_data = 4 [packed = true];
-  if (this->float_data_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _float_data_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
-      this->float_data().data(), this->float_data_size(), output);
-  }
-
-  // repeated int32 int32_data = 5 [packed = true];
-  if (this->int32_data_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _int32_data_cached_byte_size_));
-  }
-  for (int i = 0, n = this->int32_data_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
-      this->int32_data(i), output);
-  }
-
-  // repeated bytes string_data = 6;
-  for (int i = 0, n = this->string_data_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      6, this->string_data(i), output);
-  }
-
-  // repeated int64 int64_data = 7 [packed = true];
-  if (this->int64_data_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _int64_data_cached_byte_size_));
-  }
-  for (int i = 0, n = this->int64_data_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
-      this->int64_data(i), output);
-  }
-
-  // optional string name = 8;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.TensorProto.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      8, this->name(), output);
-  }
-
-  // optional bytes raw_data = 9;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      9, this->raw_data(), output);
-  }
-
-  // repeated double double_data = 10 [packed = true];
-  if (this->double_data_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _double_data_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
-      this->double_data().data(), this->double_data_size(), output);
-  }
-
-  // repeated uint64 uint64_data = 11 [packed = true];
-  if (this->uint64_data_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _uint64_data_cached_byte_size_));
-  }
-  for (int i = 0, n = this->uint64_data_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteUInt64NoTag(
-      this->uint64_data(i), output);
-  }
-
-  // optional string doc_string = 12;
-  if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.TensorProto.doc_string");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      12, this->doc_string(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.TensorProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TensorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TensorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.TensorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated int64 dims = 1;
-  target = ::google::protobuf::internal::WireFormatLite::
-    WriteInt64ToArray(1, this->dims_, target);
+  for (int i = 0, n = this->_internal_dims_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_dims(i), target);
+  }
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_onnx.TensorProto.DataType data_type = 2;
   if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      2, this->data_type(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      2, this->_internal_data_type(), target);
   }
 
   // optional .opencv_onnx.TensorProto.Segment segment = 3;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->segment_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::segment(this), target, stream);
   }
 
   // repeated float float_data = 4 [packed = true];
-  if (this->float_data_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      4,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _float_data_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteFloatNoTagToArray(this->float_data_, target);
+  if (this->_internal_float_data_size() > 0) {
+    target = stream->WriteFixedPacked(4, _internal_float_data(), target);
   }
 
   // repeated int32 int32_data = 5 [packed = true];
-  if (this->int32_data_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      5,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _int32_data_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt32NoTagToArray(this->int32_data_, target);
+  {
+    int byte_size = _int32_data_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt32Packed(
+          5, _internal_int32_data(), byte_size, target);
+    }
   }
 
   // repeated bytes string_data = 6;
-  for (int i = 0, n = this->string_data_size(); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteBytesToArray(6, this->string_data(i), target);
+  for (int i = 0, n = this->_internal_string_data_size(); i < n; i++) {
+    const auto& s = this->_internal_string_data(i);
+    target = stream->WriteBytes(6, s, target);
   }
 
   // repeated int64 int64_data = 7 [packed = true];
-  if (this->int64_data_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      7,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _int64_data_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt64NoTagToArray(this->int64_data_, target);
+  {
+    int byte_size = _int64_data_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt64Packed(
+          7, _internal_int64_data(), byte_size, target);
+    }
   }
 
   // optional string name = 8;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.TensorProto.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        8, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        8, this->_internal_name(), target);
   }
 
   // optional bytes raw_data = 9;
   if (cached_has_bits & 0x00000002u) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        9, this->raw_data(), target);
+    target = stream->WriteBytesMaybeAliased(
+        9, this->_internal_raw_data(), target);
   }
 
   // repeated double double_data = 10 [packed = true];
-  if (this->double_data_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      10,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _double_data_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteDoubleNoTagToArray(this->double_data_, target);
+  if (this->_internal_double_data_size() > 0) {
+    target = stream->WriteFixedPacked(10, _internal_double_data(), target);
   }
 
   // repeated uint64 uint64_data = 11 [packed = true];
-  if (this->uint64_data_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      11,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _uint64_data_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteUInt64NoTagToArray(this->uint64_data_, target);
+  {
+    int byte_size = _uint64_data_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteUInt64Packed(
+          11, _internal_uint64_data(), byte_size, target);
+    }
   }
 
   // optional string doc_string = 12;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->doc_string().data(), static_cast<int>(this->doc_string().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_doc_string().data(), static_cast<int>(this->_internal_doc_string().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.TensorProto.doc_string");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        12, this->doc_string(), target);
+    target = stream->WriteStringMaybeAliased(
+        12, this->_internal_doc_string(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.TensorProto)
   return target;
@@ -5102,171 +4236,153 @@ size_t TensorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.TensorProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated int64 dims = 1;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int64Size(this->dims_);
     total_size += 1 *
-                  ::google::protobuf::internal::FromIntSize(this->dims_size());
+                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_dims_size());
     total_size += data_size;
   }
 
   // repeated float float_data = 4 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->float_data_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_float_data_size());
     size_t data_size = 4UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _float_data_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated int32 int32_data = 5 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->int32_data_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _int32_data_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _int32_data_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // repeated bytes string_data = 6;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->string_data_size());
-  for (int i = 0, n = this->string_data_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
-      this->string_data(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(string_data_.size());
+  for (int i = 0, n = string_data_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+      string_data_.Get(i));
   }
 
   // repeated int64 int64_data = 7 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int64Size(this->int64_data_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _int64_data_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _int64_data_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // repeated double double_data = 10 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->double_data_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_double_data_size());
     size_t data_size = 8UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _double_data_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated uint64 uint64_data = 11 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       UInt64Size(this->uint64_data_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _uint64_data_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _uint64_data_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
-  if (_has_bits_[0 / 32] & 31u) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x0000001fu) {
     // optional string name = 8;
-    if (has_name()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->name());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_name());
     }
 
     // optional bytes raw_data = 9;
-    if (has_raw_data()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::BytesSize(
-          this->raw_data());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+          this->_internal_raw_data());
     }
 
     // optional string doc_string = 12;
-    if (has_doc_string()) {
+    if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->doc_string());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_doc_string());
     }
 
     // optional .opencv_onnx.TensorProto.Segment segment = 3;
-    if (has_segment()) {
+    if (cached_has_bits & 0x00000008u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->segment_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *segment_);
     }
 
     // optional .opencv_onnx.TensorProto.DataType data_type = 2;
-    if (has_data_type()) {
+    if (cached_has_bits & 0x00000010u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_data_type());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TensorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.TensorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TensorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TensorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.TensorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.TensorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TensorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TensorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TensorProto::GetClassData() const { return &_class_data_; }
+
+void TensorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TensorProto *>(to)->MergeFrom(
+      static_cast<const TensorProto &>(from));
 }
 
+
 void TensorProto::MergeFrom(const TensorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.TensorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   dims_.MergeFrom(from.dims_);
@@ -5277,34 +4393,25 @@ void TensorProto::MergeFrom(const TensorProto& from) {
   double_data_.MergeFrom(from.double_data_);
   uint64_data_.MergeFrom(from.uint64_data_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 31u) {
+  if (cached_has_bits & 0x0000001fu) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_name();
-      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
+      _internal_set_name(from._internal_name());
     }
     if (cached_has_bits & 0x00000002u) {
-      set_has_raw_data();
-      raw_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.raw_data_);
+      _internal_set_raw_data(from._internal_raw_data());
     }
     if (cached_has_bits & 0x00000004u) {
-      set_has_doc_string();
-      doc_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.doc_string_);
+      _internal_set_doc_string(from._internal_doc_string());
     }
     if (cached_has_bits & 0x00000008u) {
-      mutable_segment()->::opencv_onnx::TensorProto_Segment::MergeFrom(from.segment());
+      _internal_mutable_segment()->::opencv_onnx::TensorProto_Segment::MergeFrom(from._internal_segment());
     }
     if (cached_has_bits & 0x00000010u) {
       data_type_ = from.data_type_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void TensorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.TensorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TensorProto::CopyFrom(const TensorProto& from) {
@@ -5318,12 +4425,12 @@ bool TensorProto::IsInitialized() const {
   return true;
 }
 
-void TensorProto::Swap(TensorProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TensorProto::InternalSwap(TensorProto* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
   dims_.InternalSwap(&other->dims_);
   float_data_.InternalSwap(&other->float_data_);
   int32_data_.InternalSwap(&other->int32_data_);
@@ -5331,61 +4438,74 @@ void TensorProto::InternalSwap(TensorProto* other) {
   int64_data_.InternalSwap(&other->int64_data_);
   double_data_.InternalSwap(&other->double_data_);
   uint64_data_.InternalSwap(&other->uint64_data_);
-  name_.Swap(&other->name_);
-  raw_data_.Swap(&other->raw_data_);
-  doc_string_.Swap(&other->doc_string_);
-  swap(segment_, other->segment_);
-  swap(data_type_, other->data_type_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata TensorProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &raw_data_, lhs_arena,
+      &other->raw_data_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &doc_string_, lhs_arena,
+      &other->doc_string_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(TensorProto, data_type_)
+      + sizeof(TensorProto::data_type_)
+      - PROTOBUF_FIELD_OFFSET(TensorProto, segment_)>(
+          reinterpret_cast<char*>(&segment_),
+          reinterpret_cast<char*>(&other->segment_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata TensorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[7]);
 }
 
-
 // ===================================================================
 
-void TensorShapeProto_Dimension::InitAsDefaultInstance() {
-  ::opencv_onnx::_TensorShapeProto_Dimension_default_instance_.dim_value_ = GOOGLE_LONGLONG(0);
-  ::opencv_onnx::_TensorShapeProto_Dimension_default_instance_.dim_param_.UnsafeSetDefault(
-      &::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TensorShapeProto_Dimension::kDimValueFieldNumber;
-const int TensorShapeProto_Dimension::kDimParamFieldNumber;
-const int TensorShapeProto_Dimension::kDenotationFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TensorShapeProto_Dimension::TensorShapeProto_Dimension()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorShapeProto_Dimension();
+class TensorShapeProto_Dimension::_Internal {
+ public:
+  using HasBits = decltype(std::declval<TensorShapeProto_Dimension>()._has_bits_);
+  static void set_has_denotation(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
   }
+};
+
+TensorShapeProto_Dimension::TensorShapeProto_Dimension(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.TensorShapeProto.Dimension)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.TensorShapeProto.Dimension)
 }
 TensorShapeProto_Dimension::TensorShapeProto_Dimension(const TensorShapeProto_Dimension& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  denotation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_denotation()) {
-    denotation_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.denotation_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  denotation_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    denotation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_denotation()) {
+    denotation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_denotation(),
+      GetArenaForAllocation());
   }
   clear_has_value();
   switch (from.value_case()) {
     case kDimValue: {
-      set_dim_value(from.dim_value());
+      _internal_set_dim_value(from._internal_dim_value());
       break;
     }
     case kDimParam: {
-      set_dim_param(from.dim_param());
+      _internal_set_dim_param(from._internal_dim_param());
       break;
     }
     case VALUE_NOT_SET: {
@@ -5395,45 +4515,37 @@ TensorShapeProto_Dimension::TensorShapeProto_Dimension(const TensorShapeProto_Di
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.TensorShapeProto.Dimension)
 }
 
-void TensorShapeProto_Dimension::SharedCtor() {
-  _cached_size_ = 0;
-  denotation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_value();
+inline void TensorShapeProto_Dimension::SharedCtor() {
+denotation_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  denotation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+clear_has_value();
 }
 
 TensorShapeProto_Dimension::~TensorShapeProto_Dimension() {
   // @@protoc_insertion_point(destructor:opencv_onnx.TensorShapeProto.Dimension)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TensorShapeProto_Dimension::SharedDtor() {
-  denotation_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void TensorShapeProto_Dimension::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  denotation_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (has_value()) {
     clear_value();
   }
 }
 
-void TensorShapeProto_Dimension::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void TensorShapeProto_Dimension::ArenaDtor(void* object) {
+  TensorShapeProto_Dimension* _this = reinterpret_cast< TensorShapeProto_Dimension* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* TensorShapeProto_Dimension::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const TensorShapeProto_Dimension& TensorShapeProto_Dimension::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorShapeProto_Dimension();
-  return *internal_default_instance();
+void TensorShapeProto_Dimension::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-TensorShapeProto_Dimension* TensorShapeProto_Dimension::New(::google::protobuf::Arena* arena) const {
-  TensorShapeProto_Dimension* n = new TensorShapeProto_Dimension;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TensorShapeProto_Dimension::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TensorShapeProto_Dimension::clear_value() {
@@ -5444,7 +4556,7 @@ void TensorShapeProto_Dimension::clear_value() {
       break;
     }
     case kDimParam: {
-      value_.dim_param_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+      value_.dim_param_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
       break;
     }
     case VALUE_NOT_SET: {
@@ -5457,172 +4569,119 @@ void TensorShapeProto_Dimension::clear_value() {
 
 void TensorShapeProto_Dimension::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.TensorShapeProto.Dimension)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(!denotation_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*denotation_.UnsafeRawStringPointer())->clear();
+    denotation_.ClearNonDefaultToEmpty();
   }
   clear_value();
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TensorShapeProto_Dimension::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:opencv_onnx.TensorShapeProto.Dimension)
-  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 int64 dim_value = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          clear_value();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &value_.dim_value_)));
-          set_has_dim_value();
-        } else {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TensorShapeProto_Dimension::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // int64 dim_value = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          _internal_set_dim_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
-      // optional string dim_param = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_dim_param()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->dim_param().data(), static_cast<int>(this->dim_param().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.TensorShapeProto.Dimension.dim_param");
-        } else {
+        continue;
+      // string dim_param = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_dim_param();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.TensorShapeProto.Dimension.dim_param");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string denotation = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_denotation()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->denotation().data(), static_cast<int>(this->denotation().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.TensorShapeProto.Dimension.denotation");
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          auto str = _internal_mutable_denotation();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.TensorShapeProto.Dimension.denotation");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } 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:opencv_onnx.TensorShapeProto.Dimension)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.TensorShapeProto.Dimension)
-  return false;
-#undef DO_
-}
-
-void TensorShapeProto_Dimension::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.TensorShapeProto.Dimension)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  switch (value_case()) {
-    case kDimValue:
-      ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->dim_value(), output);
-      break;
-    case kDimParam:
-      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-        this->dim_param().data(), static_cast<int>(this->dim_param().length()),
-        ::google::protobuf::internal::WireFormat::SERIALIZE,
-        "opencv_onnx.TensorShapeProto.Dimension.dim_param");
-      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-        2, this->dim_param(), output);
-      break;
-    default: ;
-  }
-  cached_has_bits = _has_bits_[0];
-  // optional string denotation = 3;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->denotation().data(), static_cast<int>(this->denotation().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.TensorShapeProto.Dimension.denotation");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      3, this->denotation(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.TensorShapeProto.Dimension)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TensorShapeProto_Dimension::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TensorShapeProto_Dimension::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.TensorShapeProto.Dimension)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   switch (value_case()) {
-    case kDimValue:
-      target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->dim_value(), target);
+    case kDimValue: {
+      target = stream->EnsureSpace(target);
+      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_dim_value(), target);
       break;
-    case kDimParam:
-      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-        this->dim_param().data(), static_cast<int>(this->dim_param().length()),
-        ::google::protobuf::internal::WireFormat::SERIALIZE,
+    }
+    case kDimParam: {
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+        this->_internal_dim_param().data(), static_cast<int>(this->_internal_dim_param().length()),
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
         "opencv_onnx.TensorShapeProto.Dimension.dim_param");
-      target =
-        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-          2, this->dim_param(), target);
+      target = stream->WriteStringMaybeAliased(
+          2, this->_internal_dim_param(), target);
       break;
+    }
     default: ;
   }
   cached_has_bits = _has_bits_[0];
   // optional string denotation = 3;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->denotation().data(), static_cast<int>(this->denotation().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_denotation().data(), static_cast<int>(this->_internal_denotation().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.TensorShapeProto.Dimension.denotation");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        3, this->denotation(), target);
+    target = stream->WriteStringMaybeAliased(
+        3, this->_internal_denotation(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.TensorShapeProto.Dimension)
   return target;
@@ -5632,90 +4691,74 @@ size_t TensorShapeProto_Dimension::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.TensorShapeProto.Dimension)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional string denotation = 3;
-  if (has_denotation()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->denotation());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_denotation());
   }
 
   switch (value_case()) {
-    // optional int64 dim_value = 1;
+    // int64 dim_value = 1;
     case kDimValue: {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->dim_value());
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_dim_value());
       break;
     }
-    // optional string dim_param = 2;
+    // string dim_param = 2;
     case kDimParam: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->dim_param());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_dim_param());
       break;
     }
     case VALUE_NOT_SET: {
       break;
     }
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TensorShapeProto_Dimension::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.TensorShapeProto.Dimension)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TensorShapeProto_Dimension* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TensorShapeProto_Dimension>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.TensorShapeProto.Dimension)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.TensorShapeProto.Dimension)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TensorShapeProto_Dimension::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TensorShapeProto_Dimension::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TensorShapeProto_Dimension::GetClassData() const { return &_class_data_; }
+
+void TensorShapeProto_Dimension::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TensorShapeProto_Dimension *>(to)->MergeFrom(
+      static_cast<const TensorShapeProto_Dimension &>(from));
 }
 
+
 void TensorShapeProto_Dimension::MergeFrom(const TensorShapeProto_Dimension& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.TensorShapeProto.Dimension)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_denotation()) {
-    set_has_denotation();
-    denotation_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.denotation_);
+  if (from._internal_has_denotation()) {
+    _internal_set_denotation(from._internal_denotation());
   }
   switch (from.value_case()) {
     case kDimValue: {
-      set_dim_value(from.dim_value());
+      _internal_set_dim_value(from._internal_dim_value());
       break;
     }
     case kDimParam: {
-      set_dim_param(from.dim_param());
+      _internal_set_dim_param(from._internal_dim_param());
       break;
     }
     case VALUE_NOT_SET: {
       break;
     }
   }
-}
-
-void TensorShapeProto_Dimension::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.TensorShapeProto.Dimension)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TensorShapeProto_Dimension::CopyFrom(const TensorShapeProto_Dimension& from) {
@@ -5729,177 +4772,143 @@ bool TensorShapeProto_Dimension::IsInitialized() const {
   return true;
 }
 
-void TensorShapeProto_Dimension::Swap(TensorShapeProto_Dimension* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TensorShapeProto_Dimension::InternalSwap(TensorShapeProto_Dimension* other) {
   using std::swap;
-  denotation_.Swap(&other->denotation_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &denotation_, lhs_arena,
+      &other->denotation_, rhs_arena
+  );
   swap(value_, other->value_);
   swap(_oneof_case_[0], other->_oneof_case_[0]);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata TensorShapeProto_Dimension::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TensorShapeProto_Dimension::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[8]);
 }
 
-
 // ===================================================================
 
-void TensorShapeProto::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TensorShapeProto::kDimFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class TensorShapeProto::_Internal {
+ public:
+};
 
-TensorShapeProto::TensorShapeProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorShapeProto();
-  }
+TensorShapeProto::TensorShapeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
+  dim_(arena) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.TensorShapeProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.TensorShapeProto)
 }
 TensorShapeProto::TensorShapeProto(const TensorShapeProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       dim_(from.dim_) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.TensorShapeProto)
 }
 
-void TensorShapeProto::SharedCtor() {
-  _cached_size_ = 0;
+inline void TensorShapeProto::SharedCtor() {
 }
 
 TensorShapeProto::~TensorShapeProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.TensorShapeProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TensorShapeProto::SharedDtor() {
+inline void TensorShapeProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void TensorShapeProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+void TensorShapeProto::ArenaDtor(void* object) {
+  TensorShapeProto* _this = reinterpret_cast< TensorShapeProto* >(object);
+  (void)_this;
 }
-const ::google::protobuf::Descriptor* TensorShapeProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void TensorShapeProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-const TensorShapeProto& TensorShapeProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorShapeProto();
-  return *internal_default_instance();
-}
-
-TensorShapeProto* TensorShapeProto::New(::google::protobuf::Arena* arena) const {
-  TensorShapeProto* n = new TensorShapeProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TensorShapeProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TensorShapeProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.TensorShapeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   dim_.Clear();
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TensorShapeProto::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:opencv_onnx.TensorShapeProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TensorShapeProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .opencv_onnx.TensorShapeProto.Dimension dim = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_dim()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_dim(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } 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:opencv_onnx.TensorShapeProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.TensorShapeProto)
-  return false;
-#undef DO_
-}
-
-void TensorShapeProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.TensorShapeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_onnx.TensorShapeProto.Dimension dim = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->dim_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->dim(static_cast<int>(i)), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.TensorShapeProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TensorShapeProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TensorShapeProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.TensorShapeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .opencv_onnx.TensorShapeProto.Dimension dim = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->dim_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->dim(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_dim_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_dim(i), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.TensorShapeProto)
   return target;
@@ -5909,59 +4918,41 @@ size_t TensorShapeProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.TensorShapeProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_onnx.TensorShapeProto.Dimension dim = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->dim_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->dim(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_dim_size();
+  for (const auto& msg : this->dim_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TensorShapeProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.TensorShapeProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TensorShapeProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TensorShapeProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.TensorShapeProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.TensorShapeProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TensorShapeProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TensorShapeProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TensorShapeProto::GetClassData() const { return &_class_data_; }
+
+void TensorShapeProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TensorShapeProto *>(to)->MergeFrom(
+      static_cast<const TensorShapeProto &>(from));
 }
 
+
 void TensorShapeProto::MergeFrom(const TensorShapeProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.TensorShapeProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   dim_.MergeFrom(from.dim_);
-}
-
-void TensorShapeProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.TensorShapeProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TensorShapeProto::CopyFrom(const TensorShapeProto& from) {
@@ -5975,225 +4966,180 @@ bool TensorShapeProto::IsInitialized() const {
   return true;
 }
 
-void TensorShapeProto::Swap(TensorShapeProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TensorShapeProto::InternalSwap(TensorShapeProto* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   dim_.InternalSwap(&other->dim_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata TensorShapeProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TensorShapeProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[9]);
 }
 
-
 // ===================================================================
 
-void TypeProto_Tensor::InitAsDefaultInstance() {
-  ::opencv_onnx::_TypeProto_Tensor_default_instance_._instance.get_mutable()->shape_ = const_cast< ::opencv_onnx::TensorShapeProto*>(
-      ::opencv_onnx::TensorShapeProto::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TypeProto_Tensor::kElemTypeFieldNumber;
-const int TypeProto_Tensor::kShapeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TypeProto_Tensor::TypeProto_Tensor()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsTypeProto_Tensor();
+class TypeProto_Tensor::_Internal {
+ public:
+  using HasBits = decltype(std::declval<TypeProto_Tensor>()._has_bits_);
+  static void set_has_elem_type(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+  static const ::opencv_onnx::TensorShapeProto& shape(const TypeProto_Tensor* msg);
+  static void set_has_shape(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+const ::opencv_onnx::TensorShapeProto&
+TypeProto_Tensor::_Internal::shape(const TypeProto_Tensor* msg) {
+  return *msg->shape_;
+}
+TypeProto_Tensor::TypeProto_Tensor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.TypeProto.Tensor)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.TypeProto.Tensor)
 }
 TypeProto_Tensor::TypeProto_Tensor(const TypeProto_Tensor& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_shape()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_shape()) {
     shape_ = new ::opencv_onnx::TensorShapeProto(*from.shape_);
   } else {
-    shape_ = NULL;
+    shape_ = nullptr;
   }
   elem_type_ = from.elem_type_;
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.TypeProto.Tensor)
 }
 
-void TypeProto_Tensor::SharedCtor() {
-  _cached_size_ = 0;
-  ::memset(&shape_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&elem_type_) -
-      reinterpret_cast<char*>(&shape_)) + sizeof(elem_type_));
+inline void TypeProto_Tensor::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&shape_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&elem_type_) -
+    reinterpret_cast<char*>(&shape_)) + sizeof(elem_type_));
 }
 
 TypeProto_Tensor::~TypeProto_Tensor() {
   // @@protoc_insertion_point(destructor:opencv_onnx.TypeProto.Tensor)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TypeProto_Tensor::SharedDtor() {
+inline void TypeProto_Tensor::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete shape_;
 }
 
-void TypeProto_Tensor::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TypeProto_Tensor::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void TypeProto_Tensor::ArenaDtor(void* object) {
+  TypeProto_Tensor* _this = reinterpret_cast< TypeProto_Tensor* >(object);
+  (void)_this;
 }
-
-const TypeProto_Tensor& TypeProto_Tensor::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsTypeProto_Tensor();
-  return *internal_default_instance();
+void TypeProto_Tensor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-TypeProto_Tensor* TypeProto_Tensor::New(::google::protobuf::Arena* arena) const {
-  TypeProto_Tensor* n = new TypeProto_Tensor;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TypeProto_Tensor::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TypeProto_Tensor::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.TypeProto.Tensor)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(shape_ != NULL);
+    GOOGLE_DCHECK(shape_ != nullptr);
     shape_->Clear();
   }
   elem_type_ = 0;
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TypeProto_Tensor::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:opencv_onnx.TypeProto.Tensor)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TypeProto_Tensor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional .opencv_onnx.TensorProto.DataType elem_type = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::opencv_onnx::TensorProto_DataType_IsValid(value)) {
-            set_elem_type(static_cast< ::opencv_onnx::TensorProto_DataType >(value));
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::opencv_onnx::TensorProto_DataType_IsValid(val))) {
+            _internal_set_elem_type(static_cast<::opencv_onnx::TensorProto_DataType>(val));
           } else {
-            mutable_unknown_fields()->AddVarint(
-                1, static_cast< ::google::protobuf::uint64>(value));
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
           }
-        } else {
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional .opencv_onnx.TensorShapeProto shape = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_shape()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_shape(), ptr);
+          CHK_(ptr);
+        } 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:opencv_onnx.TypeProto.Tensor)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.TypeProto.Tensor)
-  return false;
-#undef DO_
-}
-
-void TypeProto_Tensor::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.TypeProto.Tensor)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional .opencv_onnx.TensorProto.DataType elem_type = 1;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->elem_type(), output);
-  }
-
-  // optional .opencv_onnx.TensorShapeProto shape = 2;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->shape_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.TypeProto.Tensor)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TypeProto_Tensor::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TypeProto_Tensor::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.TypeProto.Tensor)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional .opencv_onnx.TensorProto.DataType elem_type = 1;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->elem_type(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_elem_type(), target);
   }
 
   // optional .opencv_onnx.TensorShapeProto shape = 2;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, *this->shape_, deterministic, target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        2, _Internal::shape(this), target, stream);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.TypeProto.Tensor)
   return target;
@@ -6203,72 +5149,59 @@ size_t TypeProto_Tensor::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.TypeProto.Tensor)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional .opencv_onnx.TensorShapeProto shape = 2;
-    if (has_shape()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          *this->shape_);
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+          *shape_);
     }
 
     // optional .opencv_onnx.TensorProto.DataType elem_type = 1;
-    if (has_elem_type()) {
+    if (cached_has_bits & 0x00000002u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->elem_type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_elem_type());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TypeProto_Tensor::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.TypeProto.Tensor)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TypeProto_Tensor* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TypeProto_Tensor>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.TypeProto.Tensor)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.TypeProto.Tensor)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TypeProto_Tensor::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TypeProto_Tensor::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TypeProto_Tensor::GetClassData() const { return &_class_data_; }
+
+void TypeProto_Tensor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TypeProto_Tensor *>(to)->MergeFrom(
+      static_cast<const TypeProto_Tensor &>(from));
 }
 
+
 void TypeProto_Tensor::MergeFrom(const TypeProto_Tensor& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.TypeProto.Tensor)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      mutable_shape()->::opencv_onnx::TensorShapeProto::MergeFrom(from.shape());
+      _internal_mutable_shape()->::opencv_onnx::TensorShapeProto::MergeFrom(from._internal_shape());
     }
     if (cached_has_bits & 0x00000002u) {
       elem_type_ = from.elem_type_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void TypeProto_Tensor::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.TypeProto.Tensor)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TypeProto_Tensor::CopyFrom(const TypeProto_Tensor& from) {
@@ -6282,38 +5215,47 @@ bool TypeProto_Tensor::IsInitialized() const {
   return true;
 }
 
-void TypeProto_Tensor::Swap(TypeProto_Tensor* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TypeProto_Tensor::InternalSwap(TypeProto_Tensor* other) {
   using std::swap;
-  swap(shape_, other->shape_);
-  swap(elem_type_, other->elem_type_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(TypeProto_Tensor, elem_type_)
+      + sizeof(TypeProto_Tensor::elem_type_)
+      - PROTOBUF_FIELD_OFFSET(TypeProto_Tensor, shape_)>(
+          reinterpret_cast<char*>(&shape_),
+          reinterpret_cast<char*>(&other->shape_));
 }
 
-::google::protobuf::Metadata TypeProto_Tensor::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TypeProto_Tensor::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[10]);
 }
 
-
 // ===================================================================
 
-void TypeProto::InitAsDefaultInstance() {
-  ::opencv_onnx::_TypeProto_default_instance_.tensor_type_ = const_cast< ::opencv_onnx::TypeProto_Tensor*>(
-      ::opencv_onnx::TypeProto_Tensor::internal_default_instance());
+class TypeProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<TypeProto>()._has_bits_);
+  static const ::opencv_onnx::TypeProto_Tensor& tensor_type(const TypeProto* msg);
+  static void set_has_denotation(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+const ::opencv_onnx::TypeProto_Tensor&
+TypeProto::_Internal::tensor_type(const TypeProto* msg) {
+  return *msg->value_.tensor_type_;
 }
 void TypeProto::set_allocated_tensor_type(::opencv_onnx::TypeProto_Tensor* tensor_type) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   clear_value();
   if (tensor_type) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+      ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_onnx::TypeProto_Tensor>::GetOwningArena(tensor_type);
     if (message_arena != submessage_arena) {
-      tensor_type = ::google::protobuf::internal::GetOwnedMessage(
+      tensor_type = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, tensor_type, submessage_arena);
     }
     set_has_tensor_type();
@@ -6321,33 +5263,31 @@ void TypeProto::set_allocated_tensor_type(::opencv_onnx::TypeProto_Tensor* tenso
   }
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TypeProto.tensor_type)
 }
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TypeProto::kTensorTypeFieldNumber;
-const int TypeProto::kDenotationFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TypeProto::TypeProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsTypeProto();
-  }
+TypeProto::TypeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.TypeProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.TypeProto)
 }
 TypeProto::TypeProto(const TypeProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  denotation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_denotation()) {
-    denotation_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.denotation_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  denotation_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    denotation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_denotation()) {
+    denotation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_denotation(),
+      GetArenaForAllocation());
   }
   clear_has_value();
   switch (from.value_case()) {
     case kTensorType: {
-      mutable_tensor_type()->::opencv_onnx::TypeProto_Tensor::MergeFrom(from.tensor_type());
+      _internal_mutable_tensor_type()->::opencv_onnx::TypeProto_Tensor::MergeFrom(from._internal_tensor_type());
       break;
     }
     case VALUE_NOT_SET: {
@@ -6357,52 +5297,46 @@ TypeProto::TypeProto(const TypeProto& from)
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.TypeProto)
 }
 
-void TypeProto::SharedCtor() {
-  _cached_size_ = 0;
-  denotation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_value();
+inline void TypeProto::SharedCtor() {
+denotation_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  denotation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+clear_has_value();
 }
 
 TypeProto::~TypeProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.TypeProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TypeProto::SharedDtor() {
-  denotation_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void TypeProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  denotation_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (has_value()) {
     clear_value();
   }
 }
 
-void TypeProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TypeProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void TypeProto::ArenaDtor(void* object) {
+  TypeProto* _this = reinterpret_cast< TypeProto* >(object);
+  (void)_this;
 }
-
-const TypeProto& TypeProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsTypeProto();
-  return *internal_default_instance();
+void TypeProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-TypeProto* TypeProto::New(::google::protobuf::Arena* arena) const {
-  TypeProto* n = new TypeProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void TypeProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void TypeProto::clear_value() {
 // @@protoc_insertion_point(one_of_clear_start:opencv_onnx.TypeProto)
   switch (value_case()) {
     case kTensorType: {
-      delete value_.tensor_type_;
+      if (GetArenaForAllocation() == nullptr) {
+        delete value_.tensor_type_;
+      }
       break;
     }
     case VALUE_NOT_SET: {
@@ -6415,137 +5349,98 @@ void TypeProto::clear_value() {
 
 void TypeProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.TypeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(!denotation_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*denotation_.UnsafeRawStringPointer())->clear();
+    denotation_.ClearNonDefaultToEmpty();
   }
   clear_value();
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool TypeProto::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:opencv_onnx.TypeProto)
-  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 .opencv_onnx.TypeProto.Tensor tensor_type = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_tensor_type()));
-        } else {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TypeProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // .opencv_onnx.TypeProto.Tensor tensor_type = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_tensor_type(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional string denotation = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_denotation()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->denotation().data(), static_cast<int>(this->denotation().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.TypeProto.denotation");
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          auto str = _internal_mutable_denotation();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.TypeProto.denotation");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } 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:opencv_onnx.TypeProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.TypeProto)
-  return false;
-#undef DO_
-}
-
-void TypeProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.TypeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // optional .opencv_onnx.TypeProto.Tensor tensor_type = 1;
-  if (has_tensor_type()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *value_.tensor_type_, output);
-  }
-
-  cached_has_bits = _has_bits_[0];
-  // optional string denotation = 6;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->denotation().data(), static_cast<int>(this->denotation().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.TypeProto.denotation");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      6, this->denotation(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.TypeProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TypeProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TypeProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.TypeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  // optional .opencv_onnx.TypeProto.Tensor tensor_type = 1;
-  if (has_tensor_type()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *value_.tensor_type_, deterministic, target);
+  // .opencv_onnx.TypeProto.Tensor tensor_type = 1;
+  if (_internal_has_tensor_type()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::tensor_type(this), target, stream);
   }
 
   cached_has_bits = _has_bits_[0];
   // optional string denotation = 6;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->denotation().data(), static_cast<int>(this->denotation().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_denotation().data(), static_cast<int>(this->_internal_denotation().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.TypeProto.denotation");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        6, this->denotation(), target);
+    target = stream->WriteStringMaybeAliased(
+        6, this->_internal_denotation(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.TypeProto)
   return target;
@@ -6555,23 +5450,23 @@ size_t TypeProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.TypeProto)
   size_t total_size = 0;
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // optional string denotation = 6;
-  if (has_denotation()) {
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->denotation());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_denotation());
   }
 
   switch (value_case()) {
-    // optional .opencv_onnx.TypeProto.Tensor tensor_type = 1;
+    // .opencv_onnx.TypeProto.Tensor tensor_type = 1;
     case kTensorType: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
           *value_.tensor_type_);
       break;
     }
@@ -6579,55 +5474,41 @@ size_t TypeProto::ByteSizeLong() const {
       break;
     }
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TypeProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.TypeProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TypeProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TypeProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.TypeProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.TypeProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TypeProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TypeProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TypeProto::GetClassData() const { return &_class_data_; }
+
+void TypeProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TypeProto *>(to)->MergeFrom(
+      static_cast<const TypeProto &>(from));
 }
 
+
 void TypeProto::MergeFrom(const TypeProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.TypeProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.has_denotation()) {
-    set_has_denotation();
-    denotation_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.denotation_);
+  if (from._internal_has_denotation()) {
+    _internal_set_denotation(from._internal_denotation());
   }
   switch (from.value_case()) {
     case kTensorType: {
-      mutable_tensor_type()->::opencv_onnx::TypeProto_Tensor::MergeFrom(from.tensor_type());
+      _internal_mutable_tensor_type()->::opencv_onnx::TypeProto_Tensor::MergeFrom(from._internal_tensor_type());
       break;
     }
     case VALUE_NOT_SET: {
       break;
     }
   }
-}
-
-void TypeProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.TypeProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TypeProto::CopyFrom(const TypeProto& from) {
@@ -6641,227 +5522,188 @@ bool TypeProto::IsInitialized() const {
   return true;
 }
 
-void TypeProto::Swap(TypeProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void TypeProto::InternalSwap(TypeProto* other) {
   using std::swap;
-  denotation_.Swap(&other->denotation_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &denotation_, lhs_arena,
+      &other->denotation_, rhs_arena
+  );
   swap(value_, other->value_);
   swap(_oneof_case_[0], other->_oneof_case_[0]);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata TypeProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TypeProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[11]);
 }
 
-
 // ===================================================================
 
-void OperatorSetIdProto::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int OperatorSetIdProto::kDomainFieldNumber;
-const int OperatorSetIdProto::kVersionFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-OperatorSetIdProto::OperatorSetIdProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_opencv_2donnx_2eproto::InitDefaultsOperatorSetIdProto();
+class OperatorSetIdProto::_Internal {
+ public:
+  using HasBits = decltype(std::declval<OperatorSetIdProto>()._has_bits_);
+  static void set_has_domain(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_version(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
   }
+};
+
+OperatorSetIdProto::OperatorSetIdProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_onnx.OperatorSetIdProto)
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
+  // @@protoc_insertion_point(arena_constructor:opencv_onnx.OperatorSetIdProto)
 }
 OperatorSetIdProto::OperatorSetIdProto(const OperatorSetIdProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  domain_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_domain()) {
-    domain_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.domain_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  domain_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (from._internal_has_domain()) {
+    domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_domain(),
+      GetArenaForAllocation());
   }
   version_ = from.version_;
   // @@protoc_insertion_point(copy_constructor:opencv_onnx.OperatorSetIdProto)
 }
 
-void OperatorSetIdProto::SharedCtor() {
-  _cached_size_ = 0;
-  domain_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  version_ = GOOGLE_LONGLONG(0);
+inline void OperatorSetIdProto::SharedCtor() {
+domain_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+version_ = int64_t{0};
 }
 
 OperatorSetIdProto::~OperatorSetIdProto() {
   // @@protoc_insertion_point(destructor:opencv_onnx.OperatorSetIdProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void OperatorSetIdProto::SharedDtor() {
-  domain_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void OperatorSetIdProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  domain_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
-void OperatorSetIdProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* OperatorSetIdProto::descriptor() {
-  ::protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+void OperatorSetIdProto::ArenaDtor(void* object) {
+  OperatorSetIdProto* _this = reinterpret_cast< OperatorSetIdProto* >(object);
+  (void)_this;
 }
-
-const OperatorSetIdProto& OperatorSetIdProto::default_instance() {
-  ::protobuf_opencv_2donnx_2eproto::InitDefaultsOperatorSetIdProto();
-  return *internal_default_instance();
+void OperatorSetIdProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
-
-OperatorSetIdProto* OperatorSetIdProto::New(::google::protobuf::Arena* arena) const {
-  OperatorSetIdProto* n = new OperatorSetIdProto;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
+void OperatorSetIdProto::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
 }
 
 void OperatorSetIdProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_onnx.OperatorSetIdProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t 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 & 0x00000001u) {
-    GOOGLE_DCHECK(!domain_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*domain_.UnsafeRawStringPointer())->clear();
+    domain_.ClearNonDefaultToEmpty();
   }
-  version_ = GOOGLE_LONGLONG(0);
+  version_ = int64_t{0};
   _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool OperatorSetIdProto::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:opencv_onnx.OperatorSetIdProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* OperatorSetIdProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // optional string domain = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_domain()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->domain().data(), static_cast<int>(this->domain().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "opencv_onnx.OperatorSetIdProto.domain");
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_domain();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_onnx.OperatorSetIdProto.domain");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // optional int64 version = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_version();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &version_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          _Internal::set_has_version(&has_bits);
+          version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } 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:opencv_onnx.OperatorSetIdProto)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  _has_bits_.Or(has_bits);
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_onnx.OperatorSetIdProto)
-  return false;
-#undef DO_
-}
-
-void OperatorSetIdProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_onnx.OperatorSetIdProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // optional string domain = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->domain().data(), static_cast<int>(this->domain().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "opencv_onnx.OperatorSetIdProto.domain");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->domain(), output);
-  }
-
-  // optional int64 version = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->version(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_onnx.OperatorSetIdProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* OperatorSetIdProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* OperatorSetIdProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_onnx.OperatorSetIdProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
   // optional string domain = 1;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->domain().data(), static_cast<int>(this->domain().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_domain().data(), static_cast<int>(this->_internal_domain().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
       "opencv_onnx.OperatorSetIdProto.domain");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->domain(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_domain(), target);
   }
 
   // optional int64 version = 2;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->version(), target);
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_version(), target);
   }
 
-  if (_internal_metadata_.have_unknown_fields()) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        _internal_metadata_.unknown_fields(), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_onnx.OperatorSetIdProto)
   return target;
@@ -6871,74 +5713,58 @@ size_t OperatorSetIdProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_onnx.OperatorSetIdProto)
   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) {
+  uint32_t 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 & 0x00000003u) {
     // optional string domain = 1;
-    if (has_domain()) {
+    if (cached_has_bits & 0x00000001u) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->domain());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_domain());
     }
 
     // optional int64 version = 2;
-    if (has_version()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->version());
+    if (cached_has_bits & 0x00000002u) {
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_version());
     }
 
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void OperatorSetIdProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_onnx.OperatorSetIdProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const OperatorSetIdProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const OperatorSetIdProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_onnx.OperatorSetIdProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_onnx.OperatorSetIdProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData OperatorSetIdProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    OperatorSetIdProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*OperatorSetIdProto::GetClassData() const { return &_class_data_; }
+
+void OperatorSetIdProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<OperatorSetIdProto *>(to)->MergeFrom(
+      static_cast<const OperatorSetIdProto &>(from));
 }
 
+
 void OperatorSetIdProto::MergeFrom(const OperatorSetIdProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_onnx.OperatorSetIdProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
+  if (cached_has_bits & 0x00000003u) {
     if (cached_has_bits & 0x00000001u) {
-      set_has_domain();
-      domain_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.domain_);
+      _internal_set_domain(from._internal_domain());
     }
     if (cached_has_bits & 0x00000002u) {
       version_ = from.version_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
-}
-
-void OperatorSetIdProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_onnx.OperatorSetIdProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void OperatorSetIdProto::CopyFrom(const OperatorSetIdProto& from) {
@@ -6952,26 +5778,69 @@ bool OperatorSetIdProto::IsInitialized() const {
   return true;
 }
 
-void OperatorSetIdProto::Swap(OperatorSetIdProto* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
 void OperatorSetIdProto::InternalSwap(OperatorSetIdProto* other) {
   using std::swap;
-  domain_.Swap(&other->domain_);
-  swap(version_, other->version_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &domain_, lhs_arena,
+      &other->domain_, rhs_arena
+  );
+  swap(version_, other->version_);
 }
 
-::google::protobuf::Metadata OperatorSetIdProto::GetMetadata() const {
-  protobuf_opencv_2donnx_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_opencv_2donnx_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata OperatorSetIdProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_opencv_2donnx_2eproto_getter, &descriptor_table_opencv_2donnx_2eproto_once,
+      file_level_metadata_opencv_2donnx_2eproto[12]);
 }
 
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_onnx
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_onnx::AttributeProto* Arena::CreateMaybeMessage< ::opencv_onnx::AttributeProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::AttributeProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::ValueInfoProto* Arena::CreateMaybeMessage< ::opencv_onnx::ValueInfoProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::ValueInfoProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::NodeProto* Arena::CreateMaybeMessage< ::opencv_onnx::NodeProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::NodeProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::ModelProto* Arena::CreateMaybeMessage< ::opencv_onnx::ModelProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::ModelProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::StringStringEntryProto* Arena::CreateMaybeMessage< ::opencv_onnx::StringStringEntryProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::StringStringEntryProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::GraphProto* Arena::CreateMaybeMessage< ::opencv_onnx::GraphProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::GraphProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::TensorProto_Segment* Arena::CreateMaybeMessage< ::opencv_onnx::TensorProto_Segment >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::TensorProto_Segment >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::TensorProto* Arena::CreateMaybeMessage< ::opencv_onnx::TensorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::TensorProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::TensorShapeProto_Dimension* Arena::CreateMaybeMessage< ::opencv_onnx::TensorShapeProto_Dimension >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::TensorShapeProto_Dimension >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::TensorShapeProto* Arena::CreateMaybeMessage< ::opencv_onnx::TensorShapeProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::TensorShapeProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::TypeProto_Tensor* Arena::CreateMaybeMessage< ::opencv_onnx::TypeProto_Tensor >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::TypeProto_Tensor >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::TypeProto* Arena::CreateMaybeMessage< ::opencv_onnx::TypeProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::TypeProto >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_onnx::OperatorSetIdProto* Arena::CreateMaybeMessage< ::opencv_onnx::OperatorSetIdProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_onnx::OperatorSetIdProto >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index 9959d49..06b4571 100644 (file)
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: opencv-onnx.proto
 
-#ifndef PROTOBUF_opencv_2donnx_2eproto__INCLUDED
-#define PROTOBUF_opencv_2donnx_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_opencv_2donnx_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_opencv_2donnx_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include <google/protobuf/generated_enum_reflection.h>
 #include <google/protobuf/unknown_field_set.h>
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_opencv_2donnx_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_opencv_2donnx_2eproto {
 // Internal implementation detail -- do not use these members.
-struct TableStruct {
-  static const ::google::protobuf::internal::ParseTableField entries[];
-  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  static const ::google::protobuf::internal::ParseTable schema[13];
-  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
-  static const ::google::protobuf::internal::SerializationTable serialization_table[];
-  static const ::google::protobuf::uint32 offsets[];
+struct TableStruct_opencv_2donnx_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[13]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsAttributeProtoImpl();
-void InitDefaultsAttributeProto();
-void InitDefaultsValueInfoProtoImpl();
-void InitDefaultsValueInfoProto();
-void InitDefaultsModelProtoImpl();
-void InitDefaultsModelProto();
-void InitDefaultsStringStringEntryProtoImpl();
-void InitDefaultsStringStringEntryProto();
-void InitDefaultsTensorProto_SegmentImpl();
-void InitDefaultsTensorProto_Segment();
-void InitDefaultsTensorProtoImpl();
-void InitDefaultsTensorProto();
-void InitDefaultsTensorShapeProto_DimensionImpl();
-void InitDefaultsTensorShapeProto_Dimension();
-void InitDefaultsTensorShapeProtoImpl();
-void InitDefaultsTensorShapeProto();
-void InitDefaultsTypeProto_TensorImpl();
-void InitDefaultsTypeProto_Tensor();
-void InitDefaultsTypeProtoImpl();
-void InitDefaultsTypeProto();
-void InitDefaultsOperatorSetIdProtoImpl();
-void InitDefaultsOperatorSetIdProto();
-inline void InitDefaults() {
-  InitDefaultsAttributeProto();
-  InitDefaultsValueInfoProto();
-  InitDefaultsModelProto();
-  InitDefaultsStringStringEntryProto();
-  InitDefaultsTensorProto_Segment();
-  InitDefaultsTensorProto();
-  InitDefaultsTensorShapeProto_Dimension();
-  InitDefaultsTensorShapeProto();
-  InitDefaultsTypeProto_Tensor();
-  InitDefaultsTypeProto();
-  InitDefaultsOperatorSetIdProto();
-}
-}  // namespace protobuf_opencv_2donnx_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_opencv_2donnx_2eproto;
 namespace opencv_onnx {
 class AttributeProto;
-class AttributeProtoDefaultTypeInternal;
+struct AttributeProtoDefaultTypeInternal;
 extern AttributeProtoDefaultTypeInternal _AttributeProto_default_instance_;
 class GraphProto;
-class GraphProtoDefaultTypeInternal;
+struct GraphProtoDefaultTypeInternal;
 extern GraphProtoDefaultTypeInternal _GraphProto_default_instance_;
 class ModelProto;
-class ModelProtoDefaultTypeInternal;
+struct ModelProtoDefaultTypeInternal;
 extern ModelProtoDefaultTypeInternal _ModelProto_default_instance_;
 class NodeProto;
-class NodeProtoDefaultTypeInternal;
+struct NodeProtoDefaultTypeInternal;
 extern NodeProtoDefaultTypeInternal _NodeProto_default_instance_;
 class OperatorSetIdProto;
-class OperatorSetIdProtoDefaultTypeInternal;
+struct OperatorSetIdProtoDefaultTypeInternal;
 extern OperatorSetIdProtoDefaultTypeInternal _OperatorSetIdProto_default_instance_;
 class StringStringEntryProto;
-class StringStringEntryProtoDefaultTypeInternal;
+struct StringStringEntryProtoDefaultTypeInternal;
 extern StringStringEntryProtoDefaultTypeInternal _StringStringEntryProto_default_instance_;
 class TensorProto;
-class TensorProtoDefaultTypeInternal;
+struct TensorProtoDefaultTypeInternal;
 extern TensorProtoDefaultTypeInternal _TensorProto_default_instance_;
 class TensorProto_Segment;
-class TensorProto_SegmentDefaultTypeInternal;
+struct TensorProto_SegmentDefaultTypeInternal;
 extern TensorProto_SegmentDefaultTypeInternal _TensorProto_Segment_default_instance_;
 class TensorShapeProto;
-class TensorShapeProtoDefaultTypeInternal;
+struct TensorShapeProtoDefaultTypeInternal;
 extern TensorShapeProtoDefaultTypeInternal _TensorShapeProto_default_instance_;
 class TensorShapeProto_Dimension;
-class TensorShapeProto_DimensionDefaultTypeInternal;
+struct TensorShapeProto_DimensionDefaultTypeInternal;
 extern TensorShapeProto_DimensionDefaultTypeInternal _TensorShapeProto_Dimension_default_instance_;
 class TypeProto;
-class TypeProtoDefaultTypeInternal;
+struct TypeProtoDefaultTypeInternal;
 extern TypeProtoDefaultTypeInternal _TypeProto_default_instance_;
 class TypeProto_Tensor;
-class TypeProto_TensorDefaultTypeInternal;
+struct TypeProto_TensorDefaultTypeInternal;
 extern TypeProto_TensorDefaultTypeInternal _TypeProto_Tensor_default_instance_;
 class ValueInfoProto;
-class ValueInfoProtoDefaultTypeInternal;
+struct ValueInfoProtoDefaultTypeInternal;
 extern ValueInfoProtoDefaultTypeInternal _ValueInfoProto_default_instance_;
 }  // namespace opencv_onnx
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_onnx::AttributeProto* Arena::CreateMaybeMessage<::opencv_onnx::AttributeProto>(Arena*);
+template<> ::opencv_onnx::GraphProto* Arena::CreateMaybeMessage<::opencv_onnx::GraphProto>(Arena*);
+template<> ::opencv_onnx::ModelProto* Arena::CreateMaybeMessage<::opencv_onnx::ModelProto>(Arena*);
+template<> ::opencv_onnx::NodeProto* Arena::CreateMaybeMessage<::opencv_onnx::NodeProto>(Arena*);
+template<> ::opencv_onnx::OperatorSetIdProto* Arena::CreateMaybeMessage<::opencv_onnx::OperatorSetIdProto>(Arena*);
+template<> ::opencv_onnx::StringStringEntryProto* Arena::CreateMaybeMessage<::opencv_onnx::StringStringEntryProto>(Arena*);
+template<> ::opencv_onnx::TensorProto* Arena::CreateMaybeMessage<::opencv_onnx::TensorProto>(Arena*);
+template<> ::opencv_onnx::TensorProto_Segment* Arena::CreateMaybeMessage<::opencv_onnx::TensorProto_Segment>(Arena*);
+template<> ::opencv_onnx::TensorShapeProto* Arena::CreateMaybeMessage<::opencv_onnx::TensorShapeProto>(Arena*);
+template<> ::opencv_onnx::TensorShapeProto_Dimension* Arena::CreateMaybeMessage<::opencv_onnx::TensorShapeProto_Dimension>(Arena*);
+template<> ::opencv_onnx::TypeProto* Arena::CreateMaybeMessage<::opencv_onnx::TypeProto>(Arena*);
+template<> ::opencv_onnx::TypeProto_Tensor* Arena::CreateMaybeMessage<::opencv_onnx::TypeProto_Tensor>(Arena*);
+template<> ::opencv_onnx::ValueInfoProto* Arena::CreateMaybeMessage<::opencv_onnx::ValueInfoProto>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_onnx {
 
-enum AttributeProto_AttributeType {
+enum AttributeProto_AttributeType : int {
   AttributeProto_AttributeType_UNDEFINED = 0,
   AttributeProto_AttributeType_FLOAT = 1,
   AttributeProto_AttributeType_INT = 2,
@@ -136,21 +126,25 @@ enum AttributeProto_AttributeType {
   AttributeProto_AttributeType_GRAPHS = 10
 };
 bool AttributeProto_AttributeType_IsValid(int value);
-const AttributeProto_AttributeType AttributeProto_AttributeType_AttributeType_MIN = AttributeProto_AttributeType_UNDEFINED;
-const AttributeProto_AttributeType AttributeProto_AttributeType_AttributeType_MAX = AttributeProto_AttributeType_GRAPHS;
-const int AttributeProto_AttributeType_AttributeType_ARRAYSIZE = AttributeProto_AttributeType_AttributeType_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* AttributeProto_AttributeType_descriptor();
-inline const ::std::string& AttributeProto_AttributeType_Name(AttributeProto_AttributeType value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    AttributeProto_AttributeType_descriptor(), value);
+constexpr AttributeProto_AttributeType AttributeProto_AttributeType_AttributeType_MIN = AttributeProto_AttributeType_UNDEFINED;
+constexpr AttributeProto_AttributeType AttributeProto_AttributeType_AttributeType_MAX = AttributeProto_AttributeType_GRAPHS;
+constexpr int AttributeProto_AttributeType_AttributeType_ARRAYSIZE = AttributeProto_AttributeType_AttributeType_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* AttributeProto_AttributeType_descriptor();
+template<typename T>
+inline const std::string& AttributeProto_AttributeType_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, AttributeProto_AttributeType>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function AttributeProto_AttributeType_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    AttributeProto_AttributeType_descriptor(), enum_t_value);
 }
 inline bool AttributeProto_AttributeType_Parse(
-    const ::std::string& name, AttributeProto_AttributeType* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<AttributeProto_AttributeType>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, AttributeProto_AttributeType* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<AttributeProto_AttributeType>(
     AttributeProto_AttributeType_descriptor(), name, value);
 }
-enum TensorProto_DataType {
+enum TensorProto_DataType : int {
   TensorProto_DataType_UNDEFINED = 0,
   TensorProto_DataType_FLOAT = 1,
   TensorProto_DataType_UINT8 = 2,
@@ -169,2036 +163,2782 @@ enum TensorProto_DataType {
   TensorProto_DataType_COMPLEX128 = 15
 };
 bool TensorProto_DataType_IsValid(int value);
-const TensorProto_DataType TensorProto_DataType_DataType_MIN = TensorProto_DataType_UNDEFINED;
-const TensorProto_DataType TensorProto_DataType_DataType_MAX = TensorProto_DataType_COMPLEX128;
-const int TensorProto_DataType_DataType_ARRAYSIZE = TensorProto_DataType_DataType_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* TensorProto_DataType_descriptor();
-inline const ::std::string& TensorProto_DataType_Name(TensorProto_DataType value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    TensorProto_DataType_descriptor(), value);
+constexpr TensorProto_DataType TensorProto_DataType_DataType_MIN = TensorProto_DataType_UNDEFINED;
+constexpr TensorProto_DataType TensorProto_DataType_DataType_MAX = TensorProto_DataType_COMPLEX128;
+constexpr int TensorProto_DataType_DataType_ARRAYSIZE = TensorProto_DataType_DataType_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TensorProto_DataType_descriptor();
+template<typename T>
+inline const std::string& TensorProto_DataType_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, TensorProto_DataType>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function TensorProto_DataType_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    TensorProto_DataType_descriptor(), enum_t_value);
 }
 inline bool TensorProto_DataType_Parse(
-    const ::std::string& name, TensorProto_DataType* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<TensorProto_DataType>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TensorProto_DataType* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<TensorProto_DataType>(
     TensorProto_DataType_descriptor(), name, value);
 }
-enum Version {
+enum Version : int {
   _START_VERSION = 0,
   IR_VERSION_2017_10_10 = 1,
   IR_VERSION_2017_10_30 = 2,
   IR_VERSION = 3
 };
 bool Version_IsValid(int value);
-const Version Version_MIN = _START_VERSION;
-const Version Version_MAX = IR_VERSION;
-const int Version_ARRAYSIZE = Version_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* Version_descriptor();
-inline const ::std::string& Version_Name(Version value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    Version_descriptor(), value);
+constexpr Version Version_MIN = _START_VERSION;
+constexpr Version Version_MAX = IR_VERSION;
+constexpr int Version_ARRAYSIZE = Version_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Version_descriptor();
+template<typename T>
+inline const std::string& Version_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, Version>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function Version_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    Version_descriptor(), enum_t_value);
 }
 inline bool Version_Parse(
-    const ::std::string& name, Version* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<Version>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Version* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<Version>(
     Version_descriptor(), name, value);
 }
 // ===================================================================
 
-class AttributeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.AttributeProto) */ {
+class AttributeProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.AttributeProto) */ {
  public:
-  AttributeProto();
-  virtual ~AttributeProto();
+  inline AttributeProto() : AttributeProto(nullptr) {}
+  ~AttributeProto() override;
+  explicit constexpr AttributeProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   AttributeProto(const AttributeProto& from);
-
-  inline AttributeProto& operator=(const AttributeProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   AttributeProto(AttributeProto&& from) noexcept
     : AttributeProto() {
     *this = ::std::move(from);
   }
 
+  inline AttributeProto& operator=(const AttributeProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline AttributeProto& operator=(AttributeProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const AttributeProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const AttributeProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const AttributeProto* internal_default_instance() {
     return reinterpret_cast<const AttributeProto*>(
                &_AttributeProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void Swap(AttributeProto* other);
   friend void swap(AttributeProto& a, AttributeProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(AttributeProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(AttributeProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline AttributeProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  AttributeProto* 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;
+  AttributeProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<AttributeProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const AttributeProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const AttributeProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(AttributeProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.AttributeProto";
   }
+  protected:
+  explicit AttributeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef AttributeProto_AttributeType AttributeType;
-  static const AttributeType UNDEFINED =
+  static constexpr AttributeType UNDEFINED =
     AttributeProto_AttributeType_UNDEFINED;
-  static const AttributeType FLOAT =
+  static constexpr AttributeType FLOAT =
     AttributeProto_AttributeType_FLOAT;
-  static const AttributeType INT =
+  static constexpr AttributeType INT =
     AttributeProto_AttributeType_INT;
-  static const AttributeType STRING =
+  static constexpr AttributeType STRING =
     AttributeProto_AttributeType_STRING;
-  static const AttributeType TENSOR =
+  static constexpr AttributeType TENSOR =
     AttributeProto_AttributeType_TENSOR;
-  static const AttributeType GRAPH =
+  static constexpr AttributeType GRAPH =
     AttributeProto_AttributeType_GRAPH;
-  static const AttributeType FLOATS =
+  static constexpr AttributeType FLOATS =
     AttributeProto_AttributeType_FLOATS;
-  static const AttributeType INTS =
+  static constexpr AttributeType INTS =
     AttributeProto_AttributeType_INTS;
-  static const AttributeType STRINGS =
+  static constexpr AttributeType STRINGS =
     AttributeProto_AttributeType_STRINGS;
-  static const AttributeType TENSORS =
+  static constexpr AttributeType TENSORS =
     AttributeProto_AttributeType_TENSORS;
-  static const AttributeType GRAPHS =
+  static constexpr AttributeType GRAPHS =
     AttributeProto_AttributeType_GRAPHS;
   static inline bool AttributeType_IsValid(int value) {
     return AttributeProto_AttributeType_IsValid(value);
   }
-  static const AttributeType AttributeType_MIN =
+  static constexpr AttributeType AttributeType_MIN =
     AttributeProto_AttributeType_AttributeType_MIN;
-  static const AttributeType AttributeType_MAX =
+  static constexpr AttributeType AttributeType_MAX =
     AttributeProto_AttributeType_AttributeType_MAX;
-  static const int AttributeType_ARRAYSIZE =
+  static constexpr int AttributeType_ARRAYSIZE =
     AttributeProto_AttributeType_AttributeType_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   AttributeType_descriptor() {
     return AttributeProto_AttributeType_descriptor();
   }
-  static inline const ::std::string& AttributeType_Name(AttributeType value) {
-    return AttributeProto_AttributeType_Name(value);
+  template<typename T>
+  static inline const std::string& AttributeType_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, AttributeType>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function AttributeType_Name.");
+    return AttributeProto_AttributeType_Name(enum_t_value);
   }
-  static inline bool AttributeType_Parse(const ::std::string& name,
+  static inline bool AttributeType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       AttributeType* value) {
     return AttributeProto_AttributeType_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFloatsFieldNumber = 7,
+    kIntsFieldNumber = 8,
+    kStringsFieldNumber = 9,
+    kTensorsFieldNumber = 10,
+    kGraphsFieldNumber = 11,
+    kNameFieldNumber = 1,
+    kSFieldNumber = 4,
+    kDocStringFieldNumber = 13,
+    kRefAttrNameFieldNumber = 21,
+    kTFieldNumber = 5,
+    kGFieldNumber = 6,
+    kIFieldNumber = 3,
+    kFFieldNumber = 2,
+    kTypeFieldNumber = 20,
+  };
   // repeated float floats = 7;
   int floats_size() const;
+  private:
+  int _internal_floats_size() const;
+  public:
   void clear_floats();
-  static const int kFloatsFieldNumber = 7;
+  private:
+  float _internal_floats(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_floats() const;
+  void _internal_add_floats(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_floats();
+  public:
   float floats(int index) const;
   void set_floats(int index, float value);
   void add_floats(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       floats() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_floats();
 
   // repeated int64 ints = 8;
   int ints_size() const;
+  private:
+  int _internal_ints_size() const;
+  public:
   void clear_ints();
-  static const int kIntsFieldNumber = 8;
-  ::google::protobuf::int64 ints(int index) const;
-  void set_ints(int index, ::google::protobuf::int64 value);
-  void add_ints(::google::protobuf::int64 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+  private:
+  int64_t _internal_ints(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+      _internal_ints() const;
+  void _internal_add_ints(int64_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+      _internal_mutable_ints();
+  public:
+  int64_t ints(int index) const;
+  void set_ints(int index, int64_t value);
+  void add_ints(int64_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
       ints() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
       mutable_ints();
 
   // repeated bytes strings = 9;
   int strings_size() const;
+  private:
+  int _internal_strings_size() const;
+  public:
   void clear_strings();
-  static const int kStringsFieldNumber = 9;
-  const ::std::string& strings(int index) const;
-  ::std::string* mutable_strings(int index);
-  void set_strings(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_strings(int index, ::std::string&& value);
-  #endif
+  const std::string& strings(int index) const;
+  std::string* mutable_strings(int index);
+  void set_strings(int index, const std::string& value);
+  void set_strings(int index, std::string&& value);
   void set_strings(int index, const char* value);
   void set_strings(int index, const void* value, size_t size);
-  ::std::string* add_strings();
-  void add_strings(const ::std::string& value);
-  #if LANG_CXX11
-  void add_strings(::std::string&& value);
-  #endif
+  std::string* add_strings();
+  void add_strings(const std::string& value);
+  void add_strings(std::string&& value);
   void add_strings(const char* value);
   void add_strings(const void* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& strings() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_strings();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& strings() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_strings();
+  private:
+  const std::string& _internal_strings(int index) const;
+  std::string* _internal_add_strings();
+  public:
 
   // repeated .opencv_onnx.TensorProto tensors = 10;
   int tensors_size() const;
+  private:
+  int _internal_tensors_size() const;
+  public:
   void clear_tensors();
-  static const int kTensorsFieldNumber = 10;
-  const ::opencv_onnx::TensorProto& tensors(int index) const;
   ::opencv_onnx::TensorProto* mutable_tensors(int index);
-  ::opencv_onnx::TensorProto* add_tensors();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto >*
       mutable_tensors();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto >&
+  private:
+  const ::opencv_onnx::TensorProto& _internal_tensors(int index) const;
+  ::opencv_onnx::TensorProto* _internal_add_tensors();
+  public:
+  const ::opencv_onnx::TensorProto& tensors(int index) const;
+  ::opencv_onnx::TensorProto* add_tensors();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto >&
       tensors() const;
 
   // repeated .opencv_onnx.GraphProto graphs = 11;
   int graphs_size() const;
+  private:
+  int _internal_graphs_size() const;
+  public:
   void clear_graphs();
-  static const int kGraphsFieldNumber = 11;
-  const ::opencv_onnx::GraphProto& graphs(int index) const;
   ::opencv_onnx::GraphProto* mutable_graphs(int index);
-  ::opencv_onnx::GraphProto* add_graphs();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::GraphProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::GraphProto >*
       mutable_graphs();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::GraphProto >&
+  private:
+  const ::opencv_onnx::GraphProto& _internal_graphs(int index) const;
+  ::opencv_onnx::GraphProto* _internal_add_graphs();
+  public:
+  const ::opencv_onnx::GraphProto& graphs(int index) const;
+  ::opencv_onnx::GraphProto* add_graphs();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::GraphProto >&
       graphs() const;
 
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional bytes s = 4;
   bool has_s() const;
+  private:
+  bool _internal_has_s() const;
+  public:
   void clear_s();
-  static const int kSFieldNumber = 4;
-  const ::std::string& s() const;
-  void set_s(const ::std::string& value);
-  #if LANG_CXX11
-  void set_s(::std::string&& value);
-  #endif
-  void set_s(const char* value);
-  void set_s(const void* value, size_t size);
-  ::std::string* mutable_s();
-  ::std::string* release_s();
-  void set_allocated_s(::std::string* s);
+  const std::string& s() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_s(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_s();
+  PROTOBUF_NODISCARD std::string* release_s();
+  void set_allocated_s(std::string* s);
+  private:
+  const std::string& _internal_s() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_s(const std::string& value);
+  std::string* _internal_mutable_s();
+  public:
 
   // optional string doc_string = 13;
   bool has_doc_string() const;
+  private:
+  bool _internal_has_doc_string() const;
+  public:
   void clear_doc_string();
-  static const int kDocStringFieldNumber = 13;
-  const ::std::string& doc_string() const;
-  void set_doc_string(const ::std::string& value);
-  #if LANG_CXX11
-  void set_doc_string(::std::string&& value);
-  #endif
-  void set_doc_string(const char* value);
-  void set_doc_string(const char* value, size_t size);
-  ::std::string* mutable_doc_string();
-  ::std::string* release_doc_string();
-  void set_allocated_doc_string(::std::string* doc_string);
+  const std::string& doc_string() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_doc_string(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_doc_string();
+  PROTOBUF_NODISCARD std::string* release_doc_string();
+  void set_allocated_doc_string(std::string* doc_string);
+  private:
+  const std::string& _internal_doc_string() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_doc_string(const std::string& value);
+  std::string* _internal_mutable_doc_string();
+  public:
 
   // optional string ref_attr_name = 21;
   bool has_ref_attr_name() const;
+  private:
+  bool _internal_has_ref_attr_name() const;
+  public:
   void clear_ref_attr_name();
-  static const int kRefAttrNameFieldNumber = 21;
-  const ::std::string& ref_attr_name() const;
-  void set_ref_attr_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_ref_attr_name(::std::string&& value);
-  #endif
-  void set_ref_attr_name(const char* value);
-  void set_ref_attr_name(const char* value, size_t size);
-  ::std::string* mutable_ref_attr_name();
-  ::std::string* release_ref_attr_name();
-  void set_allocated_ref_attr_name(::std::string* ref_attr_name);
+  const std::string& ref_attr_name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_ref_attr_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_ref_attr_name();
+  PROTOBUF_NODISCARD std::string* release_ref_attr_name();
+  void set_allocated_ref_attr_name(std::string* ref_attr_name);
+  private:
+  const std::string& _internal_ref_attr_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_ref_attr_name(const std::string& value);
+  std::string* _internal_mutable_ref_attr_name();
+  public:
 
   // optional .opencv_onnx.TensorProto t = 5;
   bool has_t() const;
+  private:
+  bool _internal_has_t() const;
+  public:
   void clear_t();
-  static const int kTFieldNumber = 5;
   const ::opencv_onnx::TensorProto& t() const;
-  ::opencv_onnx::TensorProto* release_t();
+  PROTOBUF_NODISCARD ::opencv_onnx::TensorProto* release_t();
   ::opencv_onnx::TensorProto* mutable_t();
   void set_allocated_t(::opencv_onnx::TensorProto* t);
+  private:
+  const ::opencv_onnx::TensorProto& _internal_t() const;
+  ::opencv_onnx::TensorProto* _internal_mutable_t();
+  public:
+  void unsafe_arena_set_allocated_t(
+      ::opencv_onnx::TensorProto* t);
+  ::opencv_onnx::TensorProto* unsafe_arena_release_t();
 
   // optional .opencv_onnx.GraphProto g = 6;
   bool has_g() const;
+  private:
+  bool _internal_has_g() const;
+  public:
   void clear_g();
-  static const int kGFieldNumber = 6;
   const ::opencv_onnx::GraphProto& g() const;
-  ::opencv_onnx::GraphProto* release_g();
+  PROTOBUF_NODISCARD ::opencv_onnx::GraphProto* release_g();
   ::opencv_onnx::GraphProto* mutable_g();
   void set_allocated_g(::opencv_onnx::GraphProto* g);
+  private:
+  const ::opencv_onnx::GraphProto& _internal_g() const;
+  ::opencv_onnx::GraphProto* _internal_mutable_g();
+  public:
+  void unsafe_arena_set_allocated_g(
+      ::opencv_onnx::GraphProto* g);
+  ::opencv_onnx::GraphProto* unsafe_arena_release_g();
 
   // optional int64 i = 3;
   bool has_i() const;
+  private:
+  bool _internal_has_i() const;
+  public:
   void clear_i();
-  static const int kIFieldNumber = 3;
-  ::google::protobuf::int64 i() const;
-  void set_i(::google::protobuf::int64 value);
+  int64_t i() const;
+  void set_i(int64_t value);
+  private:
+  int64_t _internal_i() const;
+  void _internal_set_i(int64_t value);
+  public:
 
   // optional float f = 2;
   bool has_f() const;
+  private:
+  bool _internal_has_f() const;
+  public:
   void clear_f();
-  static const int kFFieldNumber = 2;
   float f() const;
   void set_f(float value);
+  private:
+  float _internal_f() const;
+  void _internal_set_f(float value);
+  public:
 
   // optional .opencv_onnx.AttributeProto.AttributeType type = 20;
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 20;
   ::opencv_onnx::AttributeProto_AttributeType type() const;
   void set_type(::opencv_onnx::AttributeProto_AttributeType value);
+  private:
+  ::opencv_onnx::AttributeProto_AttributeType _internal_type() const;
+  void _internal_set_type(::opencv_onnx::AttributeProto_AttributeType value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.AttributeProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_ref_attr_name();
-  void clear_has_ref_attr_name();
-  void set_has_doc_string();
-  void clear_has_doc_string();
-  void set_has_type();
-  void clear_has_type();
-  void set_has_f();
-  void clear_has_f();
-  void set_has_i();
-  void clear_has_i();
-  void set_has_s();
-  void clear_has_s();
-  void set_has_t();
-  void clear_has_t();
-  void set_has_g();
-  void clear_has_g();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< float > floats_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > ints_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> strings_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto > tensors_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::GraphProto > graphs_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr s_;
-  ::google::protobuf::internal::ArenaStringPtr doc_string_;
-  ::google::protobuf::internal::ArenaStringPtr ref_attr_name_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > floats_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t > ints_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> strings_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto > tensors_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::GraphProto > graphs_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr s_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr doc_string_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr ref_attr_name_;
   ::opencv_onnx::TensorProto* t_;
   ::opencv_onnx::GraphProto* g_;
-  ::google::protobuf::int64 i_;
+  int64_t i_;
   float f_;
   int type_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProtoImpl();
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ValueInfoProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.ValueInfoProto) */ {
+class ValueInfoProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.ValueInfoProto) */ {
  public:
-  ValueInfoProto();
-  virtual ~ValueInfoProto();
+  inline ValueInfoProto() : ValueInfoProto(nullptr) {}
+  ~ValueInfoProto() override;
+  explicit constexpr ValueInfoProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ValueInfoProto(const ValueInfoProto& from);
-
-  inline ValueInfoProto& operator=(const ValueInfoProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ValueInfoProto(ValueInfoProto&& from) noexcept
     : ValueInfoProto() {
     *this = ::std::move(from);
   }
 
+  inline ValueInfoProto& operator=(const ValueInfoProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ValueInfoProto& operator=(ValueInfoProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ValueInfoProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ValueInfoProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ValueInfoProto* internal_default_instance() {
     return reinterpret_cast<const ValueInfoProto*>(
                &_ValueInfoProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     1;
 
-  void Swap(ValueInfoProto* other);
   friend void swap(ValueInfoProto& a, ValueInfoProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(ValueInfoProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ValueInfoProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ValueInfoProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ValueInfoProto* 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;
+  ValueInfoProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ValueInfoProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ValueInfoProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ValueInfoProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ValueInfoProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.ValueInfoProto";
   }
+  protected:
+  explicit ValueInfoProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 1,
+    kDocStringFieldNumber = 3,
+    kTypeFieldNumber = 2,
+  };
   // optional string name = 1;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional string doc_string = 3;
   bool has_doc_string() const;
+  private:
+  bool _internal_has_doc_string() const;
+  public:
   void clear_doc_string();
-  static const int kDocStringFieldNumber = 3;
-  const ::std::string& doc_string() const;
-  void set_doc_string(const ::std::string& value);
-  #if LANG_CXX11
-  void set_doc_string(::std::string&& value);
-  #endif
-  void set_doc_string(const char* value);
-  void set_doc_string(const char* value, size_t size);
-  ::std::string* mutable_doc_string();
-  ::std::string* release_doc_string();
-  void set_allocated_doc_string(::std::string* doc_string);
+  const std::string& doc_string() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_doc_string(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_doc_string();
+  PROTOBUF_NODISCARD std::string* release_doc_string();
+  void set_allocated_doc_string(std::string* doc_string);
+  private:
+  const std::string& _internal_doc_string() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_doc_string(const std::string& value);
+  std::string* _internal_mutable_doc_string();
+  public:
 
   // optional .opencv_onnx.TypeProto type = 2;
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 2;
   const ::opencv_onnx::TypeProto& type() const;
-  ::opencv_onnx::TypeProto* release_type();
+  PROTOBUF_NODISCARD ::opencv_onnx::TypeProto* release_type();
   ::opencv_onnx::TypeProto* mutable_type();
   void set_allocated_type(::opencv_onnx::TypeProto* type);
+  private:
+  const ::opencv_onnx::TypeProto& _internal_type() const;
+  ::opencv_onnx::TypeProto* _internal_mutable_type();
+  public:
+  void unsafe_arena_set_allocated_type(
+      ::opencv_onnx::TypeProto* type);
+  ::opencv_onnx::TypeProto* unsafe_arena_release_type();
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.ValueInfoProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_type();
-  void clear_has_type();
-  void set_has_doc_string();
-  void clear_has_doc_string();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr doc_string_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr doc_string_;
   ::opencv_onnx::TypeProto* type_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsValueInfoProtoImpl();
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NodeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.NodeProto) */ {
+class NodeProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.NodeProto) */ {
  public:
-  NodeProto();
-  virtual ~NodeProto();
+  inline NodeProto() : NodeProto(nullptr) {}
+  ~NodeProto() override;
+  explicit constexpr NodeProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NodeProto(const NodeProto& from);
-
-  inline NodeProto& operator=(const NodeProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NodeProto(NodeProto&& from) noexcept
     : NodeProto() {
     *this = ::std::move(from);
   }
 
+  inline NodeProto& operator=(const NodeProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NodeProto& operator=(NodeProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NodeProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NodeProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NodeProto* internal_default_instance() {
     return reinterpret_cast<const NodeProto*>(
                &_NodeProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     2;
 
-  void Swap(NodeProto* other);
   friend void swap(NodeProto& a, NodeProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(NodeProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NodeProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NodeProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NodeProto* 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;
+  NodeProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NodeProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NodeProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NodeProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NodeProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.NodeProto";
   }
+  protected:
+  explicit NodeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kInputFieldNumber = 1,
+    kOutputFieldNumber = 2,
+    kAttributeFieldNumber = 5,
+    kNameFieldNumber = 3,
+    kOpTypeFieldNumber = 4,
+    kDocStringFieldNumber = 6,
+    kDomainFieldNumber = 7,
+  };
   // repeated string input = 1;
   int input_size() const;
+  private:
+  int _internal_input_size() const;
+  public:
   void clear_input();
-  static const int kInputFieldNumber = 1;
-  const ::std::string& input(int index) const;
-  ::std::string* mutable_input(int index);
-  void set_input(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_input(int index, ::std::string&& value);
-  #endif
+  const std::string& input(int index) const;
+  std::string* mutable_input(int index);
+  void set_input(int index, const std::string& value);
+  void set_input(int index, std::string&& value);
   void set_input(int index, const char* value);
   void set_input(int index, const char* value, size_t size);
-  ::std::string* add_input();
-  void add_input(const ::std::string& value);
-  #if LANG_CXX11
-  void add_input(::std::string&& value);
-  #endif
+  std::string* add_input();
+  void add_input(const std::string& value);
+  void add_input(std::string&& value);
   void add_input(const char* value);
   void add_input(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& input() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_input();
+  private:
+  const std::string& _internal_input(int index) const;
+  std::string* _internal_add_input();
+  public:
 
   // repeated string output = 2;
   int output_size() const;
+  private:
+  int _internal_output_size() const;
+  public:
   void clear_output();
-  static const int kOutputFieldNumber = 2;
-  const ::std::string& output(int index) const;
-  ::std::string* mutable_output(int index);
-  void set_output(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_output(int index, ::std::string&& value);
-  #endif
+  const std::string& output(int index) const;
+  std::string* mutable_output(int index);
+  void set_output(int index, const std::string& value);
+  void set_output(int index, std::string&& value);
   void set_output(int index, const char* value);
   void set_output(int index, const char* value, size_t size);
-  ::std::string* add_output();
-  void add_output(const ::std::string& value);
-  #if LANG_CXX11
-  void add_output(::std::string&& value);
-  #endif
+  std::string* add_output();
+  void add_output(const std::string& value);
+  void add_output(std::string&& value);
   void add_output(const char* value);
   void add_output(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& output() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_output();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& output() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_output();
+  private:
+  const std::string& _internal_output(int index) const;
+  std::string* _internal_add_output();
+  public:
 
   // repeated .opencv_onnx.AttributeProto attribute = 5;
   int attribute_size() const;
+  private:
+  int _internal_attribute_size() const;
+  public:
   void clear_attribute();
-  static const int kAttributeFieldNumber = 5;
-  const ::opencv_onnx::AttributeProto& attribute(int index) const;
   ::opencv_onnx::AttributeProto* mutable_attribute(int index);
-  ::opencv_onnx::AttributeProto* add_attribute();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::AttributeProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::AttributeProto >*
       mutable_attribute();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::AttributeProto >&
+  private:
+  const ::opencv_onnx::AttributeProto& _internal_attribute(int index) const;
+  ::opencv_onnx::AttributeProto* _internal_add_attribute();
+  public:
+  const ::opencv_onnx::AttributeProto& attribute(int index) const;
+  ::opencv_onnx::AttributeProto* add_attribute();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::AttributeProto >&
       attribute() const;
 
   // optional string name = 3;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 3;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional string op_type = 4;
   bool has_op_type() const;
+  private:
+  bool _internal_has_op_type() const;
+  public:
   void clear_op_type();
-  static const int kOpTypeFieldNumber = 4;
-  const ::std::string& op_type() const;
-  void set_op_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_op_type(::std::string&& value);
-  #endif
-  void set_op_type(const char* value);
-  void set_op_type(const char* value, size_t size);
-  ::std::string* mutable_op_type();
-  ::std::string* release_op_type();
-  void set_allocated_op_type(::std::string* op_type);
+  const std::string& op_type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_op_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_op_type();
+  PROTOBUF_NODISCARD std::string* release_op_type();
+  void set_allocated_op_type(std::string* op_type);
+  private:
+  const std::string& _internal_op_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_op_type(const std::string& value);
+  std::string* _internal_mutable_op_type();
+  public:
 
   // optional string doc_string = 6;
   bool has_doc_string() const;
+  private:
+  bool _internal_has_doc_string() const;
+  public:
   void clear_doc_string();
-  static const int kDocStringFieldNumber = 6;
-  const ::std::string& doc_string() const;
-  void set_doc_string(const ::std::string& value);
-  #if LANG_CXX11
-  void set_doc_string(::std::string&& value);
-  #endif
-  void set_doc_string(const char* value);
-  void set_doc_string(const char* value, size_t size);
-  ::std::string* mutable_doc_string();
-  ::std::string* release_doc_string();
-  void set_allocated_doc_string(::std::string* doc_string);
+  const std::string& doc_string() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_doc_string(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_doc_string();
+  PROTOBUF_NODISCARD std::string* release_doc_string();
+  void set_allocated_doc_string(std::string* doc_string);
+  private:
+  const std::string& _internal_doc_string() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_doc_string(const std::string& value);
+  std::string* _internal_mutable_doc_string();
+  public:
 
   // optional string domain = 7;
   bool has_domain() const;
+  private:
+  bool _internal_has_domain() const;
+  public:
   void clear_domain();
-  static const int kDomainFieldNumber = 7;
-  const ::std::string& domain() const;
-  void set_domain(const ::std::string& value);
-  #if LANG_CXX11
-  void set_domain(::std::string&& value);
-  #endif
-  void set_domain(const char* value);
-  void set_domain(const char* value, size_t size);
-  ::std::string* mutable_domain();
-  ::std::string* release_domain();
-  void set_allocated_domain(::std::string* domain);
+  const std::string& domain() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_domain(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_domain();
+  PROTOBUF_NODISCARD std::string* release_domain();
+  void set_allocated_domain(std::string* domain);
+  private:
+  const std::string& _internal_domain() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_domain(const std::string& value);
+  std::string* _internal_mutable_domain();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.NodeProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_op_type();
-  void clear_has_op_type();
-  void set_has_domain();
-  void clear_has_domain();
-  void set_has_doc_string();
-  void clear_has_doc_string();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> input_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> output_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::AttributeProto > attribute_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr op_type_;
-  ::google::protobuf::internal::ArenaStringPtr doc_string_;
-  ::google::protobuf::internal::ArenaStringPtr domain_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProtoImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> input_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> output_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::AttributeProto > attribute_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr op_type_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr doc_string_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr domain_;
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class ModelProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.ModelProto) */ {
+class ModelProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.ModelProto) */ {
  public:
-  ModelProto();
-  virtual ~ModelProto();
+  inline ModelProto() : ModelProto(nullptr) {}
+  ~ModelProto() override;
+  explicit constexpr ModelProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ModelProto(const ModelProto& from);
-
-  inline ModelProto& operator=(const ModelProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   ModelProto(ModelProto&& from) noexcept
     : ModelProto() {
     *this = ::std::move(from);
   }
 
+  inline ModelProto& operator=(const ModelProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline ModelProto& operator=(ModelProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const ModelProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ModelProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ModelProto* internal_default_instance() {
     return reinterpret_cast<const ModelProto*>(
                &_ModelProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     3;
 
-  void Swap(ModelProto* other);
   friend void swap(ModelProto& a, ModelProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(ModelProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ModelProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline ModelProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  ModelProto* 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;
+  ModelProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ModelProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const ModelProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const ModelProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(ModelProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.ModelProto";
   }
+  protected:
+  explicit ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kOpsetImportFieldNumber = 8,
+    kMetadataPropsFieldNumber = 14,
+    kProducerNameFieldNumber = 2,
+    kProducerVersionFieldNumber = 3,
+    kDomainFieldNumber = 4,
+    kDocStringFieldNumber = 6,
+    kGraphFieldNumber = 7,
+    kIrVersionFieldNumber = 1,
+    kModelVersionFieldNumber = 5,
+  };
   // repeated .opencv_onnx.OperatorSetIdProto opset_import = 8;
   int opset_import_size() const;
+  private:
+  int _internal_opset_import_size() const;
+  public:
   void clear_opset_import();
-  static const int kOpsetImportFieldNumber = 8;
-  const ::opencv_onnx::OperatorSetIdProto& opset_import(int index) const;
   ::opencv_onnx::OperatorSetIdProto* mutable_opset_import(int index);
-  ::opencv_onnx::OperatorSetIdProto* add_opset_import();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto >*
       mutable_opset_import();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto >&
+  private:
+  const ::opencv_onnx::OperatorSetIdProto& _internal_opset_import(int index) const;
+  ::opencv_onnx::OperatorSetIdProto* _internal_add_opset_import();
+  public:
+  const ::opencv_onnx::OperatorSetIdProto& opset_import(int index) const;
+  ::opencv_onnx::OperatorSetIdProto* add_opset_import();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto >&
       opset_import() const;
 
   // repeated .opencv_onnx.StringStringEntryProto metadata_props = 14;
   int metadata_props_size() const;
+  private:
+  int _internal_metadata_props_size() const;
+  public:
   void clear_metadata_props();
-  static const int kMetadataPropsFieldNumber = 14;
-  const ::opencv_onnx::StringStringEntryProto& metadata_props(int index) const;
   ::opencv_onnx::StringStringEntryProto* mutable_metadata_props(int index);
-  ::opencv_onnx::StringStringEntryProto* add_metadata_props();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto >*
       mutable_metadata_props();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto >&
+  private:
+  const ::opencv_onnx::StringStringEntryProto& _internal_metadata_props(int index) const;
+  ::opencv_onnx::StringStringEntryProto* _internal_add_metadata_props();
+  public:
+  const ::opencv_onnx::StringStringEntryProto& metadata_props(int index) const;
+  ::opencv_onnx::StringStringEntryProto* add_metadata_props();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto >&
       metadata_props() const;
 
   // optional string producer_name = 2;
   bool has_producer_name() const;
+  private:
+  bool _internal_has_producer_name() const;
+  public:
   void clear_producer_name();
-  static const int kProducerNameFieldNumber = 2;
-  const ::std::string& producer_name() const;
-  void set_producer_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_producer_name(::std::string&& value);
-  #endif
-  void set_producer_name(const char* value);
-  void set_producer_name(const char* value, size_t size);
-  ::std::string* mutable_producer_name();
-  ::std::string* release_producer_name();
-  void set_allocated_producer_name(::std::string* producer_name);
+  const std::string& producer_name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_producer_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_producer_name();
+  PROTOBUF_NODISCARD std::string* release_producer_name();
+  void set_allocated_producer_name(std::string* producer_name);
+  private:
+  const std::string& _internal_producer_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_producer_name(const std::string& value);
+  std::string* _internal_mutable_producer_name();
+  public:
 
   // optional string producer_version = 3;
   bool has_producer_version() const;
+  private:
+  bool _internal_has_producer_version() const;
+  public:
   void clear_producer_version();
-  static const int kProducerVersionFieldNumber = 3;
-  const ::std::string& producer_version() const;
-  void set_producer_version(const ::std::string& value);
-  #if LANG_CXX11
-  void set_producer_version(::std::string&& value);
-  #endif
-  void set_producer_version(const char* value);
-  void set_producer_version(const char* value, size_t size);
-  ::std::string* mutable_producer_version();
-  ::std::string* release_producer_version();
-  void set_allocated_producer_version(::std::string* producer_version);
+  const std::string& producer_version() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_producer_version(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_producer_version();
+  PROTOBUF_NODISCARD std::string* release_producer_version();
+  void set_allocated_producer_version(std::string* producer_version);
+  private:
+  const std::string& _internal_producer_version() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_producer_version(const std::string& value);
+  std::string* _internal_mutable_producer_version();
+  public:
 
   // optional string domain = 4;
   bool has_domain() const;
+  private:
+  bool _internal_has_domain() const;
+  public:
   void clear_domain();
-  static const int kDomainFieldNumber = 4;
-  const ::std::string& domain() const;
-  void set_domain(const ::std::string& value);
-  #if LANG_CXX11
-  void set_domain(::std::string&& value);
-  #endif
-  void set_domain(const char* value);
-  void set_domain(const char* value, size_t size);
-  ::std::string* mutable_domain();
-  ::std::string* release_domain();
-  void set_allocated_domain(::std::string* domain);
+  const std::string& domain() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_domain(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_domain();
+  PROTOBUF_NODISCARD std::string* release_domain();
+  void set_allocated_domain(std::string* domain);
+  private:
+  const std::string& _internal_domain() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_domain(const std::string& value);
+  std::string* _internal_mutable_domain();
+  public:
 
   // optional string doc_string = 6;
   bool has_doc_string() const;
+  private:
+  bool _internal_has_doc_string() const;
+  public:
   void clear_doc_string();
-  static const int kDocStringFieldNumber = 6;
-  const ::std::string& doc_string() const;
-  void set_doc_string(const ::std::string& value);
-  #if LANG_CXX11
-  void set_doc_string(::std::string&& value);
-  #endif
-  void set_doc_string(const char* value);
-  void set_doc_string(const char* value, size_t size);
-  ::std::string* mutable_doc_string();
-  ::std::string* release_doc_string();
-  void set_allocated_doc_string(::std::string* doc_string);
+  const std::string& doc_string() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_doc_string(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_doc_string();
+  PROTOBUF_NODISCARD std::string* release_doc_string();
+  void set_allocated_doc_string(std::string* doc_string);
+  private:
+  const std::string& _internal_doc_string() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_doc_string(const std::string& value);
+  std::string* _internal_mutable_doc_string();
+  public:
 
   // optional .opencv_onnx.GraphProto graph = 7;
   bool has_graph() const;
+  private:
+  bool _internal_has_graph() const;
+  public:
   void clear_graph();
-  static const int kGraphFieldNumber = 7;
   const ::opencv_onnx::GraphProto& graph() const;
-  ::opencv_onnx::GraphProto* release_graph();
+  PROTOBUF_NODISCARD ::opencv_onnx::GraphProto* release_graph();
   ::opencv_onnx::GraphProto* mutable_graph();
   void set_allocated_graph(::opencv_onnx::GraphProto* graph);
+  private:
+  const ::opencv_onnx::GraphProto& _internal_graph() const;
+  ::opencv_onnx::GraphProto* _internal_mutable_graph();
+  public:
+  void unsafe_arena_set_allocated_graph(
+      ::opencv_onnx::GraphProto* graph);
+  ::opencv_onnx::GraphProto* unsafe_arena_release_graph();
 
   // optional int64 ir_version = 1;
   bool has_ir_version() const;
+  private:
+  bool _internal_has_ir_version() const;
+  public:
   void clear_ir_version();
-  static const int kIrVersionFieldNumber = 1;
-  ::google::protobuf::int64 ir_version() const;
-  void set_ir_version(::google::protobuf::int64 value);
+  int64_t ir_version() const;
+  void set_ir_version(int64_t value);
+  private:
+  int64_t _internal_ir_version() const;
+  void _internal_set_ir_version(int64_t value);
+  public:
 
   // optional int64 model_version = 5;
   bool has_model_version() const;
+  private:
+  bool _internal_has_model_version() const;
+  public:
   void clear_model_version();
-  static const int kModelVersionFieldNumber = 5;
-  ::google::protobuf::int64 model_version() const;
-  void set_model_version(::google::protobuf::int64 value);
+  int64_t model_version() const;
+  void set_model_version(int64_t value);
+  private:
+  int64_t _internal_model_version() const;
+  void _internal_set_model_version(int64_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.ModelProto)
  private:
-  void set_has_ir_version();
-  void clear_has_ir_version();
-  void set_has_producer_name();
-  void clear_has_producer_name();
-  void set_has_producer_version();
-  void clear_has_producer_version();
-  void set_has_domain();
-  void clear_has_domain();
-  void set_has_model_version();
-  void clear_has_model_version();
-  void set_has_doc_string();
-  void clear_has_doc_string();
-  void set_has_graph();
-  void clear_has_graph();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto > opset_import_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto > metadata_props_;
-  ::google::protobuf::internal::ArenaStringPtr producer_name_;
-  ::google::protobuf::internal::ArenaStringPtr producer_version_;
-  ::google::protobuf::internal::ArenaStringPtr domain_;
-  ::google::protobuf::internal::ArenaStringPtr doc_string_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto > opset_import_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto > metadata_props_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr producer_name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr producer_version_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr domain_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr doc_string_;
   ::opencv_onnx::GraphProto* graph_;
-  ::google::protobuf::int64 ir_version_;
-  ::google::protobuf::int64 model_version_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsModelProtoImpl();
+  int64_t ir_version_;
+  int64_t model_version_;
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class StringStringEntryProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.StringStringEntryProto) */ {
+class StringStringEntryProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.StringStringEntryProto) */ {
  public:
-  StringStringEntryProto();
-  virtual ~StringStringEntryProto();
+  inline StringStringEntryProto() : StringStringEntryProto(nullptr) {}
+  ~StringStringEntryProto() override;
+  explicit constexpr StringStringEntryProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   StringStringEntryProto(const StringStringEntryProto& from);
-
-  inline StringStringEntryProto& operator=(const StringStringEntryProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   StringStringEntryProto(StringStringEntryProto&& from) noexcept
     : StringStringEntryProto() {
     *this = ::std::move(from);
   }
 
+  inline StringStringEntryProto& operator=(const StringStringEntryProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline StringStringEntryProto& operator=(StringStringEntryProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const StringStringEntryProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const StringStringEntryProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const StringStringEntryProto* internal_default_instance() {
     return reinterpret_cast<const StringStringEntryProto*>(
                &_StringStringEntryProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     4;
 
-  void Swap(StringStringEntryProto* other);
   friend void swap(StringStringEntryProto& a, StringStringEntryProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(StringStringEntryProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(StringStringEntryProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline StringStringEntryProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  StringStringEntryProto* 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;
+  StringStringEntryProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<StringStringEntryProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const StringStringEntryProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const StringStringEntryProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(StringStringEntryProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.StringStringEntryProto";
   }
+  protected:
+  explicit StringStringEntryProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kKeyFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
   // optional string key = 1;
   bool has_key() const;
+  private:
+  bool _internal_has_key() const;
+  public:
   void clear_key();
-  static const int kKeyFieldNumber = 1;
-  const ::std::string& key() const;
-  void set_key(const ::std::string& value);
-  #if LANG_CXX11
-  void set_key(::std::string&& value);
-  #endif
-  void set_key(const char* value);
-  void set_key(const char* value, size_t size);
-  ::std::string* mutable_key();
-  ::std::string* release_key();
-  void set_allocated_key(::std::string* key);
+  const std::string& key() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_key(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_key();
+  PROTOBUF_NODISCARD std::string* release_key();
+  void set_allocated_key(std::string* key);
+  private:
+  const std::string& _internal_key() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_key(const std::string& value);
+  std::string* _internal_mutable_key();
+  public:
 
   // optional string value = 2;
   bool has_value() const;
+  private:
+  bool _internal_has_value() const;
+  public:
   void clear_value();
-  static const int kValueFieldNumber = 2;
-  const ::std::string& value() const;
-  void set_value(const ::std::string& value);
-  #if LANG_CXX11
-  void set_value(::std::string&& value);
-  #endif
-  void set_value(const char* value);
-  void set_value(const char* value, size_t size);
-  ::std::string* mutable_value();
-  ::std::string* release_value();
-  void set_allocated_value(::std::string* value);
+  const std::string& value() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_value(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_value();
+  PROTOBUF_NODISCARD std::string* release_value();
+  void set_allocated_value(std::string* value);
+  private:
+  const std::string& _internal_value() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_value(const std::string& value);
+  std::string* _internal_mutable_value();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.StringStringEntryProto)
  private:
-  void set_has_key();
-  void clear_has_key();
-  void set_has_value();
-  void clear_has_value();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr key_;
-  ::google::protobuf::internal::ArenaStringPtr value_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsStringStringEntryProtoImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_;
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class GraphProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.GraphProto) */ {
+class GraphProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.GraphProto) */ {
  public:
-  GraphProto();
-  virtual ~GraphProto();
+  inline GraphProto() : GraphProto(nullptr) {}
+  ~GraphProto() override;
+  explicit constexpr GraphProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   GraphProto(const GraphProto& from);
-
-  inline GraphProto& operator=(const GraphProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   GraphProto(GraphProto&& from) noexcept
     : GraphProto() {
     *this = ::std::move(from);
   }
 
+  inline GraphProto& operator=(const GraphProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline GraphProto& operator=(GraphProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const GraphProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const GraphProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const GraphProto* internal_default_instance() {
     return reinterpret_cast<const GraphProto*>(
                &_GraphProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     5;
 
-  void Swap(GraphProto* other);
   friend void swap(GraphProto& a, GraphProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(GraphProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(GraphProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline GraphProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  GraphProto* 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;
+  GraphProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<GraphProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const GraphProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const GraphProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(GraphProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.GraphProto";
   }
+  protected:
+  explicit GraphProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNodeFieldNumber = 1,
+    kInitializerFieldNumber = 5,
+    kInputFieldNumber = 11,
+    kOutputFieldNumber = 12,
+    kValueInfoFieldNumber = 13,
+    kNameFieldNumber = 2,
+    kDocStringFieldNumber = 10,
+  };
   // repeated .opencv_onnx.NodeProto node = 1;
   int node_size() const;
+  private:
+  int _internal_node_size() const;
+  public:
   void clear_node();
-  static const int kNodeFieldNumber = 1;
-  const ::opencv_onnx::NodeProto& node(int index) const;
   ::opencv_onnx::NodeProto* mutable_node(int index);
-  ::opencv_onnx::NodeProto* add_node();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::NodeProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::NodeProto >*
       mutable_node();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::NodeProto >&
+  private:
+  const ::opencv_onnx::NodeProto& _internal_node(int index) const;
+  ::opencv_onnx::NodeProto* _internal_add_node();
+  public:
+  const ::opencv_onnx::NodeProto& node(int index) const;
+  ::opencv_onnx::NodeProto* add_node();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::NodeProto >&
       node() const;
 
   // repeated .opencv_onnx.TensorProto initializer = 5;
   int initializer_size() const;
+  private:
+  int _internal_initializer_size() const;
+  public:
   void clear_initializer();
-  static const int kInitializerFieldNumber = 5;
-  const ::opencv_onnx::TensorProto& initializer(int index) const;
   ::opencv_onnx::TensorProto* mutable_initializer(int index);
-  ::opencv_onnx::TensorProto* add_initializer();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto >*
       mutable_initializer();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto >&
+  private:
+  const ::opencv_onnx::TensorProto& _internal_initializer(int index) const;
+  ::opencv_onnx::TensorProto* _internal_add_initializer();
+  public:
+  const ::opencv_onnx::TensorProto& initializer(int index) const;
+  ::opencv_onnx::TensorProto* add_initializer();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto >&
       initializer() const;
 
   // repeated .opencv_onnx.ValueInfoProto input = 11;
   int input_size() const;
+  private:
+  int _internal_input_size() const;
+  public:
   void clear_input();
-  static const int kInputFieldNumber = 11;
-  const ::opencv_onnx::ValueInfoProto& input(int index) const;
   ::opencv_onnx::ValueInfoProto* mutable_input(int index);
-  ::opencv_onnx::ValueInfoProto* add_input();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
       mutable_input();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
+  private:
+  const ::opencv_onnx::ValueInfoProto& _internal_input(int index) const;
+  ::opencv_onnx::ValueInfoProto* _internal_add_input();
+  public:
+  const ::opencv_onnx::ValueInfoProto& input(int index) const;
+  ::opencv_onnx::ValueInfoProto* add_input();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
       input() const;
 
   // repeated .opencv_onnx.ValueInfoProto output = 12;
   int output_size() const;
+  private:
+  int _internal_output_size() const;
+  public:
   void clear_output();
-  static const int kOutputFieldNumber = 12;
-  const ::opencv_onnx::ValueInfoProto& output(int index) const;
   ::opencv_onnx::ValueInfoProto* mutable_output(int index);
-  ::opencv_onnx::ValueInfoProto* add_output();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
       mutable_output();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
+  private:
+  const ::opencv_onnx::ValueInfoProto& _internal_output(int index) const;
+  ::opencv_onnx::ValueInfoProto* _internal_add_output();
+  public:
+  const ::opencv_onnx::ValueInfoProto& output(int index) const;
+  ::opencv_onnx::ValueInfoProto* add_output();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
       output() const;
 
   // repeated .opencv_onnx.ValueInfoProto value_info = 13;
   int value_info_size() const;
+  private:
+  int _internal_value_info_size() const;
+  public:
   void clear_value_info();
-  static const int kValueInfoFieldNumber = 13;
-  const ::opencv_onnx::ValueInfoProto& value_info(int index) const;
   ::opencv_onnx::ValueInfoProto* mutable_value_info(int index);
-  ::opencv_onnx::ValueInfoProto* add_value_info();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
       mutable_value_info();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
+  private:
+  const ::opencv_onnx::ValueInfoProto& _internal_value_info(int index) const;
+  ::opencv_onnx::ValueInfoProto* _internal_add_value_info();
+  public:
+  const ::opencv_onnx::ValueInfoProto& value_info(int index) const;
+  ::opencv_onnx::ValueInfoProto* add_value_info();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
       value_info() const;
 
   // optional string name = 2;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 2;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional string doc_string = 10;
   bool has_doc_string() const;
+  private:
+  bool _internal_has_doc_string() const;
+  public:
   void clear_doc_string();
-  static const int kDocStringFieldNumber = 10;
-  const ::std::string& doc_string() const;
-  void set_doc_string(const ::std::string& value);
-  #if LANG_CXX11
-  void set_doc_string(::std::string&& value);
-  #endif
-  void set_doc_string(const char* value);
-  void set_doc_string(const char* value, size_t size);
-  ::std::string* mutable_doc_string();
-  ::std::string* release_doc_string();
-  void set_allocated_doc_string(::std::string* doc_string);
+  const std::string& doc_string() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_doc_string(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_doc_string();
+  PROTOBUF_NODISCARD std::string* release_doc_string();
+  void set_allocated_doc_string(std::string* doc_string);
+  private:
+  const std::string& _internal_doc_string() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_doc_string(const std::string& value);
+  std::string* _internal_mutable_doc_string();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.GraphProto)
  private:
-  void set_has_name();
-  void clear_has_name();
-  void set_has_doc_string();
-  void clear_has_doc_string();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::NodeProto > node_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto > initializer_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto > input_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto > output_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto > value_info_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr doc_string_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsAttributeProtoImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::NodeProto > node_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto > initializer_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto > input_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto > output_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto > value_info_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr doc_string_;
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TensorProto_Segment : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TensorProto.Segment) */ {
+class TensorProto_Segment final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TensorProto.Segment) */ {
  public:
-  TensorProto_Segment();
-  virtual ~TensorProto_Segment();
+  inline TensorProto_Segment() : TensorProto_Segment(nullptr) {}
+  ~TensorProto_Segment() override;
+  explicit constexpr TensorProto_Segment(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TensorProto_Segment(const TensorProto_Segment& from);
-
-  inline TensorProto_Segment& operator=(const TensorProto_Segment& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TensorProto_Segment(TensorProto_Segment&& from) noexcept
     : TensorProto_Segment() {
     *this = ::std::move(from);
   }
 
+  inline TensorProto_Segment& operator=(const TensorProto_Segment& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TensorProto_Segment& operator=(TensorProto_Segment&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TensorProto_Segment& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TensorProto_Segment& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const TensorProto_Segment* internal_default_instance() {
     return reinterpret_cast<const TensorProto_Segment*>(
                &_TensorProto_Segment_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     6;
 
-  void Swap(TensorProto_Segment* other);
   friend void swap(TensorProto_Segment& a, TensorProto_Segment& b) {
     a.Swap(&b);
   }
+  inline void Swap(TensorProto_Segment* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TensorProto_Segment* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TensorProto_Segment* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TensorProto_Segment* 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;
+  TensorProto_Segment* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TensorProto_Segment>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TensorProto_Segment& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TensorProto_Segment& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TensorProto_Segment* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.TensorProto.Segment";
   }
+  protected:
+  explicit TensorProto_Segment(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kBeginFieldNumber = 1,
+    kEndFieldNumber = 2,
+  };
   // optional int64 begin = 1;
   bool has_begin() const;
+  private:
+  bool _internal_has_begin() const;
+  public:
   void clear_begin();
-  static const int kBeginFieldNumber = 1;
-  ::google::protobuf::int64 begin() const;
-  void set_begin(::google::protobuf::int64 value);
+  int64_t begin() const;
+  void set_begin(int64_t value);
+  private:
+  int64_t _internal_begin() const;
+  void _internal_set_begin(int64_t value);
+  public:
 
   // optional int64 end = 2;
   bool has_end() const;
+  private:
+  bool _internal_has_end() const;
+  public:
   void clear_end();
-  static const int kEndFieldNumber = 2;
-  ::google::protobuf::int64 end() const;
-  void set_end(::google::protobuf::int64 value);
+  int64_t end() const;
+  void set_end(int64_t value);
+  private:
+  int64_t _internal_end() const;
+  void _internal_set_end(int64_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.TensorProto.Segment)
  private:
-  void set_has_begin();
-  void clear_has_begin();
-  void set_has_end();
-  void clear_has_end();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::int64 begin_;
-  ::google::protobuf::int64 end_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorProto_SegmentImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  int64_t begin_;
+  int64_t end_;
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TensorProto) */ {
+class TensorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TensorProto) */ {
  public:
-  TensorProto();
-  virtual ~TensorProto();
+  inline TensorProto() : TensorProto(nullptr) {}
+  ~TensorProto() override;
+  explicit constexpr TensorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TensorProto(const TensorProto& from);
-
-  inline TensorProto& operator=(const TensorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TensorProto(TensorProto&& from) noexcept
     : TensorProto() {
     *this = ::std::move(from);
   }
 
+  inline TensorProto& operator=(const TensorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TensorProto& operator=(TensorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TensorProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TensorProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const TensorProto* internal_default_instance() {
     return reinterpret_cast<const TensorProto*>(
                &_TensorProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     7;
 
-  void Swap(TensorProto* other);
   friend void swap(TensorProto& a, TensorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(TensorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TensorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TensorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TensorProto* 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;
+  TensorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TensorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TensorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TensorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TensorProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.TensorProto";
   }
+  protected:
+  explicit TensorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   typedef TensorProto_Segment Segment;
 
   typedef TensorProto_DataType DataType;
-  static const DataType UNDEFINED =
+  static constexpr DataType UNDEFINED =
     TensorProto_DataType_UNDEFINED;
-  static const DataType FLOAT =
+  static constexpr DataType FLOAT =
     TensorProto_DataType_FLOAT;
-  static const DataType UINT8 =
+  static constexpr DataType UINT8 =
     TensorProto_DataType_UINT8;
-  static const DataType INT8 =
+  static constexpr DataType INT8 =
     TensorProto_DataType_INT8;
-  static const DataType UINT16 =
+  static constexpr DataType UINT16 =
     TensorProto_DataType_UINT16;
-  static const DataType INT16 =
+  static constexpr DataType INT16 =
     TensorProto_DataType_INT16;
-  static const DataType INT32 =
+  static constexpr DataType INT32 =
     TensorProto_DataType_INT32;
-  static const DataType INT64 =
+  static constexpr DataType INT64 =
     TensorProto_DataType_INT64;
-  static const DataType STRING =
+  static constexpr DataType STRING =
     TensorProto_DataType_STRING;
-  static const DataType BOOL =
+  static constexpr DataType BOOL =
     TensorProto_DataType_BOOL;
-  static const DataType FLOAT16 =
+  static constexpr DataType FLOAT16 =
     TensorProto_DataType_FLOAT16;
-  static const DataType DOUBLE =
+  static constexpr DataType DOUBLE =
     TensorProto_DataType_DOUBLE;
-  static const DataType UINT32 =
+  static constexpr DataType UINT32 =
     TensorProto_DataType_UINT32;
-  static const DataType UINT64 =
+  static constexpr DataType UINT64 =
     TensorProto_DataType_UINT64;
-  static const DataType COMPLEX64 =
+  static constexpr DataType COMPLEX64 =
     TensorProto_DataType_COMPLEX64;
-  static const DataType COMPLEX128 =
+  static constexpr DataType COMPLEX128 =
     TensorProto_DataType_COMPLEX128;
   static inline bool DataType_IsValid(int value) {
     return TensorProto_DataType_IsValid(value);
   }
-  static const DataType DataType_MIN =
+  static constexpr DataType DataType_MIN =
     TensorProto_DataType_DataType_MIN;
-  static const DataType DataType_MAX =
+  static constexpr DataType DataType_MAX =
     TensorProto_DataType_DataType_MAX;
-  static const int DataType_ARRAYSIZE =
+  static constexpr int DataType_ARRAYSIZE =
     TensorProto_DataType_DataType_ARRAYSIZE;
-  static inline const ::google::protobuf::EnumDescriptor*
+  static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor*
   DataType_descriptor() {
     return TensorProto_DataType_descriptor();
   }
-  static inline const ::std::string& DataType_Name(DataType value) {
-    return TensorProto_DataType_Name(value);
+  template<typename T>
+  static inline const std::string& DataType_Name(T enum_t_value) {
+    static_assert(::std::is_same<T, DataType>::value ||
+      ::std::is_integral<T>::value,
+      "Incorrect type passed to function DataType_Name.");
+    return TensorProto_DataType_Name(enum_t_value);
   }
-  static inline bool DataType_Parse(const ::std::string& name,
+  static inline bool DataType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
       DataType* value) {
     return TensorProto_DataType_Parse(name, value);
   }
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDimsFieldNumber = 1,
+    kFloatDataFieldNumber = 4,
+    kInt32DataFieldNumber = 5,
+    kStringDataFieldNumber = 6,
+    kInt64DataFieldNumber = 7,
+    kDoubleDataFieldNumber = 10,
+    kUint64DataFieldNumber = 11,
+    kNameFieldNumber = 8,
+    kRawDataFieldNumber = 9,
+    kDocStringFieldNumber = 12,
+    kSegmentFieldNumber = 3,
+    kDataTypeFieldNumber = 2,
+  };
   // repeated int64 dims = 1;
   int dims_size() const;
+  private:
+  int _internal_dims_size() const;
+  public:
   void clear_dims();
-  static const int kDimsFieldNumber = 1;
-  ::google::protobuf::int64 dims(int index) const;
-  void set_dims(int index, ::google::protobuf::int64 value);
-  void add_dims(::google::protobuf::int64 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+  private:
+  int64_t _internal_dims(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+      _internal_dims() const;
+  void _internal_add_dims(int64_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+      _internal_mutable_dims();
+  public:
+  int64_t dims(int index) const;
+  void set_dims(int index, int64_t value);
+  void add_dims(int64_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
       dims() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
       mutable_dims();
 
   // repeated float float_data = 4 [packed = true];
   int float_data_size() const;
+  private:
+  int _internal_float_data_size() const;
+  public:
   void clear_float_data();
-  static const int kFloatDataFieldNumber = 4;
+  private:
+  float _internal_float_data(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_float_data() const;
+  void _internal_add_float_data(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_float_data();
+  public:
   float float_data(int index) const;
   void set_float_data(int index, float value);
   void add_float_data(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       float_data() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_float_data();
 
   // repeated int32 int32_data = 5 [packed = true];
   int int32_data_size() const;
+  private:
+  int _internal_int32_data_size() const;
+  public:
   void clear_int32_data();
-  static const int kInt32DataFieldNumber = 5;
-  ::google::protobuf::int32 int32_data(int index) const;
-  void set_int32_data(int index, ::google::protobuf::int32 value);
-  void add_int32_data(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_int32_data(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_int32_data() const;
+  void _internal_add_int32_data(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_int32_data();
+  public:
+  int32_t int32_data(int index) const;
+  void set_int32_data(int index, int32_t value);
+  void add_int32_data(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       int32_data() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_int32_data();
 
   // repeated bytes string_data = 6;
   int string_data_size() const;
+  private:
+  int _internal_string_data_size() const;
+  public:
   void clear_string_data();
-  static const int kStringDataFieldNumber = 6;
-  const ::std::string& string_data(int index) const;
-  ::std::string* mutable_string_data(int index);
-  void set_string_data(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_string_data(int index, ::std::string&& value);
-  #endif
+  const std::string& string_data(int index) const;
+  std::string* mutable_string_data(int index);
+  void set_string_data(int index, const std::string& value);
+  void set_string_data(int index, std::string&& value);
   void set_string_data(int index, const char* value);
   void set_string_data(int index, const void* value, size_t size);
-  ::std::string* add_string_data();
-  void add_string_data(const ::std::string& value);
-  #if LANG_CXX11
-  void add_string_data(::std::string&& value);
-  #endif
+  std::string* add_string_data();
+  void add_string_data(const std::string& value);
+  void add_string_data(std::string&& value);
   void add_string_data(const char* value);
   void add_string_data(const void* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& string_data() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_string_data();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& string_data() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_string_data();
+  private:
+  const std::string& _internal_string_data(int index) const;
+  std::string* _internal_add_string_data();
+  public:
 
   // repeated int64 int64_data = 7 [packed = true];
   int int64_data_size() const;
+  private:
+  int _internal_int64_data_size() const;
+  public:
   void clear_int64_data();
-  static const int kInt64DataFieldNumber = 7;
-  ::google::protobuf::int64 int64_data(int index) const;
-  void set_int64_data(int index, ::google::protobuf::int64 value);
-  void add_int64_data(::google::protobuf::int64 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+  private:
+  int64_t _internal_int64_data(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+      _internal_int64_data() const;
+  void _internal_add_int64_data(int64_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+      _internal_mutable_int64_data();
+  public:
+  int64_t int64_data(int index) const;
+  void set_int64_data(int index, int64_t value);
+  void add_int64_data(int64_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
       int64_data() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
       mutable_int64_data();
 
   // repeated double double_data = 10 [packed = true];
   int double_data_size() const;
+  private:
+  int _internal_double_data_size() const;
+  public:
   void clear_double_data();
-  static const int kDoubleDataFieldNumber = 10;
+  private:
+  double _internal_double_data(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+      _internal_double_data() const;
+  void _internal_add_double_data(double value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+      _internal_mutable_double_data();
+  public:
   double double_data(int index) const;
   void set_double_data(int index, double value);
   void add_double_data(double value);
-  const ::google::protobuf::RepeatedField< double >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
       double_data() const;
-  ::google::protobuf::RepeatedField< double >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
       mutable_double_data();
 
   // repeated uint64 uint64_data = 11 [packed = true];
   int uint64_data_size() const;
+  private:
+  int _internal_uint64_data_size() const;
+  public:
   void clear_uint64_data();
-  static const int kUint64DataFieldNumber = 11;
-  ::google::protobuf::uint64 uint64_data(int index) const;
-  void set_uint64_data(int index, ::google::protobuf::uint64 value);
-  void add_uint64_data(::google::protobuf::uint64 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
+  private:
+  uint64_t _internal_uint64_data(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >&
+      _internal_uint64_data() const;
+  void _internal_add_uint64_data(uint64_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >*
+      _internal_mutable_uint64_data();
+  public:
+  uint64_t uint64_data(int index) const;
+  void set_uint64_data(int index, uint64_t value);
+  void add_uint64_data(uint64_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >&
       uint64_data() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >*
       mutable_uint64_data();
 
   // optional string name = 8;
   bool has_name() const;
+  private:
+  bool _internal_has_name() const;
+  public:
   void clear_name();
-  static const int kNameFieldNumber = 8;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // optional bytes raw_data = 9;
   bool has_raw_data() const;
+  private:
+  bool _internal_has_raw_data() const;
+  public:
   void clear_raw_data();
-  static const int kRawDataFieldNumber = 9;
-  const ::std::string& raw_data() const;
-  void set_raw_data(const ::std::string& value);
-  #if LANG_CXX11
-  void set_raw_data(::std::string&& value);
-  #endif
-  void set_raw_data(const char* value);
-  void set_raw_data(const void* value, size_t size);
-  ::std::string* mutable_raw_data();
-  ::std::string* release_raw_data();
-  void set_allocated_raw_data(::std::string* raw_data);
+  const std::string& raw_data() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_raw_data(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_raw_data();
+  PROTOBUF_NODISCARD std::string* release_raw_data();
+  void set_allocated_raw_data(std::string* raw_data);
+  private:
+  const std::string& _internal_raw_data() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_raw_data(const std::string& value);
+  std::string* _internal_mutable_raw_data();
+  public:
 
   // optional string doc_string = 12;
   bool has_doc_string() const;
+  private:
+  bool _internal_has_doc_string() const;
+  public:
   void clear_doc_string();
-  static const int kDocStringFieldNumber = 12;
-  const ::std::string& doc_string() const;
-  void set_doc_string(const ::std::string& value);
-  #if LANG_CXX11
-  void set_doc_string(::std::string&& value);
-  #endif
-  void set_doc_string(const char* value);
-  void set_doc_string(const char* value, size_t size);
-  ::std::string* mutable_doc_string();
-  ::std::string* release_doc_string();
-  void set_allocated_doc_string(::std::string* doc_string);
+  const std::string& doc_string() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_doc_string(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_doc_string();
+  PROTOBUF_NODISCARD std::string* release_doc_string();
+  void set_allocated_doc_string(std::string* doc_string);
+  private:
+  const std::string& _internal_doc_string() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_doc_string(const std::string& value);
+  std::string* _internal_mutable_doc_string();
+  public:
 
   // optional .opencv_onnx.TensorProto.Segment segment = 3;
   bool has_segment() const;
+  private:
+  bool _internal_has_segment() const;
+  public:
   void clear_segment();
-  static const int kSegmentFieldNumber = 3;
   const ::opencv_onnx::TensorProto_Segment& segment() const;
-  ::opencv_onnx::TensorProto_Segment* release_segment();
+  PROTOBUF_NODISCARD ::opencv_onnx::TensorProto_Segment* release_segment();
   ::opencv_onnx::TensorProto_Segment* mutable_segment();
   void set_allocated_segment(::opencv_onnx::TensorProto_Segment* segment);
+  private:
+  const ::opencv_onnx::TensorProto_Segment& _internal_segment() const;
+  ::opencv_onnx::TensorProto_Segment* _internal_mutable_segment();
+  public:
+  void unsafe_arena_set_allocated_segment(
+      ::opencv_onnx::TensorProto_Segment* segment);
+  ::opencv_onnx::TensorProto_Segment* unsafe_arena_release_segment();
 
   // optional .opencv_onnx.TensorProto.DataType data_type = 2;
   bool has_data_type() const;
+  private:
+  bool _internal_has_data_type() const;
+  public:
   void clear_data_type();
-  static const int kDataTypeFieldNumber = 2;
   ::opencv_onnx::TensorProto_DataType data_type() const;
   void set_data_type(::opencv_onnx::TensorProto_DataType value);
+  private:
+  ::opencv_onnx::TensorProto_DataType _internal_data_type() const;
+  void _internal_set_data_type(::opencv_onnx::TensorProto_DataType value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.TensorProto)
  private:
-  void set_has_data_type();
-  void clear_has_data_type();
-  void set_has_segment();
-  void clear_has_segment();
-  void set_has_name();
-  void clear_has_name();
-  void set_has_doc_string();
-  void clear_has_doc_string();
-  void set_has_raw_data();
-  void clear_has_raw_data();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dims_;
-  ::google::protobuf::RepeatedField< float > float_data_;
-  mutable int _float_data_cached_byte_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > int32_data_;
-  mutable int _int32_data_cached_byte_size_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> string_data_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > int64_data_;
-  mutable int _int64_data_cached_byte_size_;
-  ::google::protobuf::RepeatedField< double > double_data_;
-  mutable int _double_data_cached_byte_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::uint64 > uint64_data_;
-  mutable int _uint64_data_cached_byte_size_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr raw_data_;
-  ::google::protobuf::internal::ArenaStringPtr doc_string_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t > dims_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > float_data_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > int32_data_;
+  mutable std::atomic<int> _int32_data_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> string_data_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t > int64_data_;
+  mutable std::atomic<int> _int64_data_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > double_data_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > uint64_data_;
+  mutable std::atomic<int> _uint64_data_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr raw_data_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr doc_string_;
   ::opencv_onnx::TensorProto_Segment* segment_;
   int data_type_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorProtoImpl();
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TensorShapeProto_Dimension : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TensorShapeProto.Dimension) */ {
+class TensorShapeProto_Dimension final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TensorShapeProto.Dimension) */ {
  public:
-  TensorShapeProto_Dimension();
-  virtual ~TensorShapeProto_Dimension();
+  inline TensorShapeProto_Dimension() : TensorShapeProto_Dimension(nullptr) {}
+  ~TensorShapeProto_Dimension() override;
+  explicit constexpr TensorShapeProto_Dimension(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TensorShapeProto_Dimension(const TensorShapeProto_Dimension& from);
+  TensorShapeProto_Dimension(TensorShapeProto_Dimension&& from) noexcept
+    : TensorShapeProto_Dimension() {
+    *this = ::std::move(from);
+  }
 
   inline TensorShapeProto_Dimension& operator=(const TensorShapeProto_Dimension& from) {
     CopyFrom(from);
     return *this;
   }
-  #if LANG_CXX11
-  TensorShapeProto_Dimension(TensorShapeProto_Dimension&& from) noexcept
-    : TensorShapeProto_Dimension() {
-    *this = ::std::move(from);
-  }
-
   inline TensorShapeProto_Dimension& operator=(TensorShapeProto_Dimension&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TensorShapeProto_Dimension& default_instance();
-
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TensorShapeProto_Dimension& default_instance() {
+    return *internal_default_instance();
+  }
   enum ValueCase {
     kDimValue = 1,
     kDimParam = 2,
     VALUE_NOT_SET = 0,
   };
 
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const TensorShapeProto_Dimension* internal_default_instance() {
     return reinterpret_cast<const TensorShapeProto_Dimension*>(
                &_TensorShapeProto_Dimension_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     8;
 
-  void Swap(TensorShapeProto_Dimension* other);
   friend void swap(TensorShapeProto_Dimension& a, TensorShapeProto_Dimension& b) {
     a.Swap(&b);
   }
+  inline void Swap(TensorShapeProto_Dimension* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TensorShapeProto_Dimension* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TensorShapeProto_Dimension* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TensorShapeProto_Dimension* 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;
+  TensorShapeProto_Dimension* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TensorShapeProto_Dimension>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TensorShapeProto_Dimension& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TensorShapeProto_Dimension& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TensorShapeProto_Dimension* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.TensorShapeProto.Dimension";
   }
+  protected:
+  explicit TensorShapeProto_Dimension(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDenotationFieldNumber = 3,
+    kDimValueFieldNumber = 1,
+    kDimParamFieldNumber = 2,
+  };
   // optional string denotation = 3;
   bool has_denotation() const;
+  private:
+  bool _internal_has_denotation() const;
+  public:
   void clear_denotation();
-  static const int kDenotationFieldNumber = 3;
-  const ::std::string& denotation() const;
-  void set_denotation(const ::std::string& value);
-  #if LANG_CXX11
-  void set_denotation(::std::string&& value);
-  #endif
-  void set_denotation(const char* value);
-  void set_denotation(const char* value, size_t size);
-  ::std::string* mutable_denotation();
-  ::std::string* release_denotation();
-  void set_allocated_denotation(::std::string* denotation);
-
-  // optional int64 dim_value = 1;
+  const std::string& denotation() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_denotation(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_denotation();
+  PROTOBUF_NODISCARD std::string* release_denotation();
+  void set_allocated_denotation(std::string* denotation);
+  private:
+  const std::string& _internal_denotation() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_denotation(const std::string& value);
+  std::string* _internal_mutable_denotation();
+  public:
+
+  // int64 dim_value = 1;
   bool has_dim_value() const;
+  private:
+  bool _internal_has_dim_value() const;
+  public:
   void clear_dim_value();
-  static const int kDimValueFieldNumber = 1;
-  ::google::protobuf::int64 dim_value() const;
-  void set_dim_value(::google::protobuf::int64 value);
+  int64_t dim_value() const;
+  void set_dim_value(int64_t value);
+  private:
+  int64_t _internal_dim_value() const;
+  void _internal_set_dim_value(int64_t value);
+  public:
 
-  // optional string dim_param = 2;
+  // string dim_param = 2;
   bool has_dim_param() const;
+  private:
+  bool _internal_has_dim_param() const;
+  public:
   void clear_dim_param();
-  static const int kDimParamFieldNumber = 2;
-  const ::std::string& dim_param() const;
-  void set_dim_param(const ::std::string& value);
-  #if LANG_CXX11
-  void set_dim_param(::std::string&& value);
-  #endif
-  void set_dim_param(const char* value);
-  void set_dim_param(const char* value, size_t size);
-  ::std::string* mutable_dim_param();
-  ::std::string* release_dim_param();
-  void set_allocated_dim_param(::std::string* dim_param);
+  const std::string& dim_param() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_dim_param(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_dim_param();
+  PROTOBUF_NODISCARD std::string* release_dim_param();
+  void set_allocated_dim_param(std::string* dim_param);
+  private:
+  const std::string& _internal_dim_param() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_dim_param(const std::string& value);
+  std::string* _internal_mutable_dim_param();
+  public:
 
+  void clear_value();
   ValueCase value_case() const;
   // @@protoc_insertion_point(class_scope:opencv_onnx.TensorShapeProto.Dimension)
  private:
+  class _Internal;
   void set_has_dim_value();
   void set_has_dim_param();
-  void set_has_denotation();
-  void clear_has_denotation();
 
   inline bool has_value() const;
-  void clear_value();
   inline void clear_has_value();
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr denotation_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr denotation_;
   union ValueUnion {
-    ValueUnion() {}
-    ::google::protobuf::int64 dim_value_;
-    ::google::protobuf::internal::ArenaStringPtr dim_param_;
+    constexpr ValueUnion() : _constinit_{} {}
+      ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_;
+    int64_t dim_value_;
+    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dim_param_;
   } value_;
-  ::google::protobuf::uint32 _oneof_case_[1];
+  uint32_t _oneof_case_[1];
 
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorShapeProto_DimensionImpl();
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TensorShapeProto) */ {
+class TensorShapeProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TensorShapeProto) */ {
  public:
-  TensorShapeProto();
-  virtual ~TensorShapeProto();
+  inline TensorShapeProto() : TensorShapeProto(nullptr) {}
+  ~TensorShapeProto() override;
+  explicit constexpr TensorShapeProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TensorShapeProto(const TensorShapeProto& from);
-
-  inline TensorShapeProto& operator=(const TensorShapeProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TensorShapeProto(TensorShapeProto&& from) noexcept
     : TensorShapeProto() {
     *this = ::std::move(from);
   }
 
+  inline TensorShapeProto& operator=(const TensorShapeProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TensorShapeProto& operator=(TensorShapeProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TensorShapeProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TensorShapeProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const TensorShapeProto* internal_default_instance() {
     return reinterpret_cast<const TensorShapeProto*>(
                &_TensorShapeProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     9;
 
-  void Swap(TensorShapeProto* other);
   friend void swap(TensorShapeProto& a, TensorShapeProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(TensorShapeProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TensorShapeProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TensorShapeProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TensorShapeProto* 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;
+  TensorShapeProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TensorShapeProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TensorShapeProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TensorShapeProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TensorShapeProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.TensorShapeProto";
   }
+  protected:
+  explicit TensorShapeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -2206,241 +2946,346 @@ class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertio
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDimFieldNumber = 1,
+  };
   // repeated .opencv_onnx.TensorShapeProto.Dimension dim = 1;
   int dim_size() const;
+  private:
+  int _internal_dim_size() const;
+  public:
   void clear_dim();
-  static const int kDimFieldNumber = 1;
-  const ::opencv_onnx::TensorShapeProto_Dimension& dim(int index) const;
   ::opencv_onnx::TensorShapeProto_Dimension* mutable_dim(int index);
-  ::opencv_onnx::TensorShapeProto_Dimension* add_dim();
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension >*
       mutable_dim();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension >&
+  private:
+  const ::opencv_onnx::TensorShapeProto_Dimension& _internal_dim(int index) const;
+  ::opencv_onnx::TensorShapeProto_Dimension* _internal_add_dim();
+  public:
+  const ::opencv_onnx::TensorShapeProto_Dimension& dim(int index) const;
+  ::opencv_onnx::TensorShapeProto_Dimension* add_dim();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension >&
       dim() const;
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.TensorShapeProto)
  private:
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension > dim_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsTensorShapeProtoImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension > dim_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TypeProto_Tensor : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TypeProto.Tensor) */ {
+class TypeProto_Tensor final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TypeProto.Tensor) */ {
  public:
-  TypeProto_Tensor();
-  virtual ~TypeProto_Tensor();
+  inline TypeProto_Tensor() : TypeProto_Tensor(nullptr) {}
+  ~TypeProto_Tensor() override;
+  explicit constexpr TypeProto_Tensor(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TypeProto_Tensor(const TypeProto_Tensor& from);
-
-  inline TypeProto_Tensor& operator=(const TypeProto_Tensor& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TypeProto_Tensor(TypeProto_Tensor&& from) noexcept
     : TypeProto_Tensor() {
     *this = ::std::move(from);
   }
 
+  inline TypeProto_Tensor& operator=(const TypeProto_Tensor& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TypeProto_Tensor& operator=(TypeProto_Tensor&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TypeProto_Tensor& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TypeProto_Tensor& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const TypeProto_Tensor* internal_default_instance() {
     return reinterpret_cast<const TypeProto_Tensor*>(
                &_TypeProto_Tensor_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     10;
 
-  void Swap(TypeProto_Tensor* other);
   friend void swap(TypeProto_Tensor& a, TypeProto_Tensor& b) {
     a.Swap(&b);
   }
+  inline void Swap(TypeProto_Tensor* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TypeProto_Tensor* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TypeProto_Tensor* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TypeProto_Tensor* 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;
+  TypeProto_Tensor* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TypeProto_Tensor>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TypeProto_Tensor& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TypeProto_Tensor& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TypeProto_Tensor* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.TypeProto.Tensor";
   }
+  protected:
+  explicit TypeProto_Tensor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kShapeFieldNumber = 2,
+    kElemTypeFieldNumber = 1,
+  };
   // optional .opencv_onnx.TensorShapeProto shape = 2;
   bool has_shape() const;
+  private:
+  bool _internal_has_shape() const;
+  public:
   void clear_shape();
-  static const int kShapeFieldNumber = 2;
   const ::opencv_onnx::TensorShapeProto& shape() const;
-  ::opencv_onnx::TensorShapeProto* release_shape();
+  PROTOBUF_NODISCARD ::opencv_onnx::TensorShapeProto* release_shape();
   ::opencv_onnx::TensorShapeProto* mutable_shape();
   void set_allocated_shape(::opencv_onnx::TensorShapeProto* shape);
+  private:
+  const ::opencv_onnx::TensorShapeProto& _internal_shape() const;
+  ::opencv_onnx::TensorShapeProto* _internal_mutable_shape();
+  public:
+  void unsafe_arena_set_allocated_shape(
+      ::opencv_onnx::TensorShapeProto* shape);
+  ::opencv_onnx::TensorShapeProto* unsafe_arena_release_shape();
 
   // optional .opencv_onnx.TensorProto.DataType elem_type = 1;
   bool has_elem_type() const;
+  private:
+  bool _internal_has_elem_type() const;
+  public:
   void clear_elem_type();
-  static const int kElemTypeFieldNumber = 1;
   ::opencv_onnx::TensorProto_DataType elem_type() const;
   void set_elem_type(::opencv_onnx::TensorProto_DataType value);
+  private:
+  ::opencv_onnx::TensorProto_DataType _internal_elem_type() const;
+  void _internal_set_elem_type(::opencv_onnx::TensorProto_DataType value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.TypeProto.Tensor)
  private:
-  void set_has_elem_type();
-  void clear_has_elem_type();
-  void set_has_shape();
-  void clear_has_shape();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::opencv_onnx::TensorShapeProto* shape_;
   int elem_type_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsTypeProto_TensorImpl();
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TypeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TypeProto) */ {
+class TypeProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.TypeProto) */ {
  public:
-  TypeProto();
-  virtual ~TypeProto();
+  inline TypeProto() : TypeProto(nullptr) {}
+  ~TypeProto() override;
+  explicit constexpr TypeProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TypeProto(const TypeProto& from);
-
-  inline TypeProto& operator=(const TypeProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TypeProto(TypeProto&& from) noexcept
     : TypeProto() {
     *this = ::std::move(from);
   }
 
+  inline TypeProto& operator=(const TypeProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TypeProto& operator=(TypeProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TypeProto& default_instance();
-
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TypeProto& default_instance() {
+    return *internal_default_instance();
+  }
   enum ValueCase {
     kTensorType = 1,
     VALUE_NOT_SET = 0,
   };
 
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const TypeProto* internal_default_instance() {
     return reinterpret_cast<const TypeProto*>(
                &_TypeProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     11;
 
-  void Swap(TypeProto* other);
   friend void swap(TypeProto& a, TypeProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(TypeProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TypeProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TypeProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TypeProto* 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;
+  TypeProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TypeProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TypeProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TypeProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TypeProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.TypeProto";
   }
+  protected:
+  explicit TypeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -2448,181 +3293,248 @@ class TypeProto : public ::google::protobuf::Message /* @@protoc_insertion_point
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDenotationFieldNumber = 6,
+    kTensorTypeFieldNumber = 1,
+  };
   // optional string denotation = 6;
   bool has_denotation() const;
+  private:
+  bool _internal_has_denotation() const;
+  public:
   void clear_denotation();
-  static const int kDenotationFieldNumber = 6;
-  const ::std::string& denotation() const;
-  void set_denotation(const ::std::string& value);
-  #if LANG_CXX11
-  void set_denotation(::std::string&& value);
-  #endif
-  void set_denotation(const char* value);
-  void set_denotation(const char* value, size_t size);
-  ::std::string* mutable_denotation();
-  ::std::string* release_denotation();
-  void set_allocated_denotation(::std::string* denotation);
-
-  // optional .opencv_onnx.TypeProto.Tensor tensor_type = 1;
+  const std::string& denotation() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_denotation(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_denotation();
+  PROTOBUF_NODISCARD std::string* release_denotation();
+  void set_allocated_denotation(std::string* denotation);
+  private:
+  const std::string& _internal_denotation() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_denotation(const std::string& value);
+  std::string* _internal_mutable_denotation();
+  public:
+
+  // .opencv_onnx.TypeProto.Tensor tensor_type = 1;
   bool has_tensor_type() const;
+  private:
+  bool _internal_has_tensor_type() const;
+  public:
   void clear_tensor_type();
-  static const int kTensorTypeFieldNumber = 1;
   const ::opencv_onnx::TypeProto_Tensor& tensor_type() const;
-  ::opencv_onnx::TypeProto_Tensor* release_tensor_type();
+  PROTOBUF_NODISCARD ::opencv_onnx::TypeProto_Tensor* release_tensor_type();
   ::opencv_onnx::TypeProto_Tensor* mutable_tensor_type();
   void set_allocated_tensor_type(::opencv_onnx::TypeProto_Tensor* tensor_type);
+  private:
+  const ::opencv_onnx::TypeProto_Tensor& _internal_tensor_type() const;
+  ::opencv_onnx::TypeProto_Tensor* _internal_mutable_tensor_type();
+  public:
+  void unsafe_arena_set_allocated_tensor_type(
+      ::opencv_onnx::TypeProto_Tensor* tensor_type);
+  ::opencv_onnx::TypeProto_Tensor* unsafe_arena_release_tensor_type();
 
+  void clear_value();
   ValueCase value_case() const;
   // @@protoc_insertion_point(class_scope:opencv_onnx.TypeProto)
  private:
+  class _Internal;
   void set_has_tensor_type();
-  void set_has_denotation();
-  void clear_has_denotation();
 
   inline bool has_value() const;
-  void clear_value();
   inline void clear_has_value();
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr denotation_;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr denotation_;
   union ValueUnion {
-    ValueUnion() {}
+    constexpr ValueUnion() : _constinit_{} {}
+      ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_;
     ::opencv_onnx::TypeProto_Tensor* tensor_type_;
   } value_;
-  ::google::protobuf::uint32 _oneof_case_[1];
+  uint32_t _oneof_case_[1];
 
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsTypeProtoImpl();
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // -------------------------------------------------------------------
 
-class OperatorSetIdProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.OperatorSetIdProto) */ {
+class OperatorSetIdProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_onnx.OperatorSetIdProto) */ {
  public:
-  OperatorSetIdProto();
-  virtual ~OperatorSetIdProto();
+  inline OperatorSetIdProto() : OperatorSetIdProto(nullptr) {}
+  ~OperatorSetIdProto() override;
+  explicit constexpr OperatorSetIdProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   OperatorSetIdProto(const OperatorSetIdProto& from);
-
-  inline OperatorSetIdProto& operator=(const OperatorSetIdProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   OperatorSetIdProto(OperatorSetIdProto&& from) noexcept
     : OperatorSetIdProto() {
     *this = ::std::move(from);
   }
 
+  inline OperatorSetIdProto& operator=(const OperatorSetIdProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline OperatorSetIdProto& operator=(OperatorSetIdProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
-    return _internal_metadata_.unknown_fields();
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
   }
-  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
-    return _internal_metadata_.mutable_unknown_fields();
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
   }
 
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const OperatorSetIdProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const OperatorSetIdProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const OperatorSetIdProto* internal_default_instance() {
     return reinterpret_cast<const OperatorSetIdProto*>(
                &_OperatorSetIdProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     12;
 
-  void Swap(OperatorSetIdProto* other);
   friend void swap(OperatorSetIdProto& a, OperatorSetIdProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(OperatorSetIdProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(OperatorSetIdProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline OperatorSetIdProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  OperatorSetIdProto* 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;
+  OperatorSetIdProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<OperatorSetIdProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const OperatorSetIdProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const OperatorSetIdProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(OperatorSetIdProto* other);
+
   private:
-  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
-    return NULL;
-  }
-  inline void* MaybeArenaPtr() const {
-    return NULL;
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_onnx.OperatorSetIdProto";
   }
+  protected:
+  explicit OperatorSetIdProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDomainFieldNumber = 1,
+    kVersionFieldNumber = 2,
+  };
   // optional string domain = 1;
   bool has_domain() const;
+  private:
+  bool _internal_has_domain() const;
+  public:
   void clear_domain();
-  static const int kDomainFieldNumber = 1;
-  const ::std::string& domain() const;
-  void set_domain(const ::std::string& value);
-  #if LANG_CXX11
-  void set_domain(::std::string&& value);
-  #endif
-  void set_domain(const char* value);
-  void set_domain(const char* value, size_t size);
-  ::std::string* mutable_domain();
-  ::std::string* release_domain();
-  void set_allocated_domain(::std::string* domain);
+  const std::string& domain() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_domain(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_domain();
+  PROTOBUF_NODISCARD std::string* release_domain();
+  void set_allocated_domain(std::string* domain);
+  private:
+  const std::string& _internal_domain() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_domain(const std::string& value);
+  std::string* _internal_mutable_domain();
+  public:
 
   // optional int64 version = 2;
   bool has_version() const;
+  private:
+  bool _internal_has_version() const;
+  public:
   void clear_version();
-  static const int kVersionFieldNumber = 2;
-  ::google::protobuf::int64 version() const;
-  void set_version(::google::protobuf::int64 value);
+  int64_t version() const;
+  void set_version(int64_t value);
+  private:
+  int64_t _internal_version() const;
+  void _internal_set_version(int64_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_onnx.OperatorSetIdProto)
  private:
-  void set_has_domain();
-  void clear_has_domain();
-  void set_has_version();
-  void clear_has_version();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr domain_;
-  ::google::protobuf::int64 version_;
-  friend struct ::protobuf_opencv_2donnx_2eproto::TableStruct;
-  friend void ::protobuf_opencv_2donnx_2eproto::InitDefaultsOperatorSetIdProtoImpl();
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr domain_;
+  int64_t version_;
+  friend struct ::TableStruct_opencv_2donnx_2eproto;
 };
 // ===================================================================
 
@@ -2636,525 +3548,676 @@ class OperatorSetIdProto : public ::google::protobuf::Message /* @@protoc_insert
 // AttributeProto
 
 // optional string name = 1;
-inline bool AttributeProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void AttributeProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool AttributeProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void AttributeProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool AttributeProto::has_name() const {
+  return _internal_has_name();
 }
 inline void AttributeProto::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& AttributeProto::name() const {
+inline const std::string& AttributeProto::name() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void AttributeProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void AttributeProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.name)
 }
-#if LANG_CXX11
-inline void AttributeProto::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.AttributeProto.name)
-}
-#endif
-inline void AttributeProto::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:opencv_onnx.AttributeProto.name)
-}
-inline void AttributeProto::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:opencv_onnx.AttributeProto.name)
-}
-inline ::std::string* AttributeProto::mutable_name() {
-  set_has_name();
+inline std::string* AttributeProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& AttributeProto::_internal_name() const {
+  return name_.Get();
+}
+inline void AttributeProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* AttributeProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* AttributeProto::release_name() {
+inline std::string* AttributeProto::release_name() {
   // @@protoc_insertion_point(field_release:opencv_onnx.AttributeProto.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void AttributeProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void AttributeProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.AttributeProto.name)
 }
 
 // optional string ref_attr_name = 21;
-inline bool AttributeProto::has_ref_attr_name() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool AttributeProto::_internal_has_ref_attr_name() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void AttributeProto::set_has_ref_attr_name() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void AttributeProto::clear_has_ref_attr_name() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool AttributeProto::has_ref_attr_name() const {
+  return _internal_has_ref_attr_name();
 }
 inline void AttributeProto::clear_ref_attr_name() {
-  ref_attr_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_ref_attr_name();
+  ref_attr_name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::std::string& AttributeProto::ref_attr_name() const {
+inline const std::string& AttributeProto::ref_attr_name() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.ref_attr_name)
-  return ref_attr_name_.GetNoArena();
+  return _internal_ref_attr_name();
 }
-inline void AttributeProto::set_ref_attr_name(const ::std::string& value) {
-  set_has_ref_attr_name();
-  ref_attr_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void AttributeProto::set_ref_attr_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ ref_attr_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.ref_attr_name)
 }
-#if LANG_CXX11
-inline void AttributeProto::set_ref_attr_name(::std::string&& value) {
-  set_has_ref_attr_name();
-  ref_attr_name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.AttributeProto.ref_attr_name)
-}
-#endif
-inline void AttributeProto::set_ref_attr_name(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_ref_attr_name();
-  ref_attr_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.AttributeProto.ref_attr_name)
-}
-inline void AttributeProto::set_ref_attr_name(const char* value, size_t size) {
-  set_has_ref_attr_name();
-  ref_attr_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.AttributeProto.ref_attr_name)
-}
-inline ::std::string* AttributeProto::mutable_ref_attr_name() {
-  set_has_ref_attr_name();
+inline std::string* AttributeProto::mutable_ref_attr_name() {
+  std::string* _s = _internal_mutable_ref_attr_name();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.ref_attr_name)
-  return ref_attr_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& AttributeProto::_internal_ref_attr_name() const {
+  return ref_attr_name_.Get();
 }
-inline ::std::string* AttributeProto::release_ref_attr_name() {
+inline void AttributeProto::_internal_set_ref_attr_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  ref_attr_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* AttributeProto::_internal_mutable_ref_attr_name() {
+  _has_bits_[0] |= 0x00000008u;
+  return ref_attr_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* AttributeProto::release_ref_attr_name() {
   // @@protoc_insertion_point(field_release:opencv_onnx.AttributeProto.ref_attr_name)
-  clear_has_ref_attr_name();
-  return ref_attr_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_ref_attr_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000008u;
+  auto* p = ref_attr_name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (ref_attr_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    ref_attr_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void AttributeProto::set_allocated_ref_attr_name(::std::string* ref_attr_name) {
-  if (ref_attr_name != NULL) {
-    set_has_ref_attr_name();
+inline void AttributeProto::set_allocated_ref_attr_name(std::string* ref_attr_name) {
+  if (ref_attr_name != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_ref_attr_name();
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  ref_attr_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ref_attr_name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (ref_attr_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    ref_attr_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  ref_attr_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ref_attr_name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.AttributeProto.ref_attr_name)
 }
 
 // optional string doc_string = 13;
-inline bool AttributeProto::has_doc_string() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void AttributeProto::set_has_doc_string() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool AttributeProto::_internal_has_doc_string() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void AttributeProto::clear_has_doc_string() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool AttributeProto::has_doc_string() const {
+  return _internal_has_doc_string();
 }
 inline void AttributeProto::clear_doc_string() {
-  doc_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_doc_string();
+  doc_string_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& AttributeProto::doc_string() const {
+inline const std::string& AttributeProto::doc_string() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.doc_string)
-  return doc_string_.GetNoArena();
+  return _internal_doc_string();
 }
-inline void AttributeProto::set_doc_string(const ::std::string& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void AttributeProto::set_doc_string(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.doc_string)
 }
-#if LANG_CXX11
-inline void AttributeProto::set_doc_string(::std::string&& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.AttributeProto.doc_string)
-}
-#endif
-inline void AttributeProto::set_doc_string(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.AttributeProto.doc_string)
-}
-inline void AttributeProto::set_doc_string(const char* value, size_t size) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.AttributeProto.doc_string)
-}
-inline ::std::string* AttributeProto::mutable_doc_string() {
-  set_has_doc_string();
+inline std::string* AttributeProto::mutable_doc_string() {
+  std::string* _s = _internal_mutable_doc_string();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.doc_string)
-  return doc_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* AttributeProto::release_doc_string() {
+inline const std::string& AttributeProto::_internal_doc_string() const {
+  return doc_string_.Get();
+}
+inline void AttributeProto::_internal_set_doc_string(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* AttributeProto::_internal_mutable_doc_string() {
+  _has_bits_[0] |= 0x00000004u;
+  return doc_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* AttributeProto::release_doc_string() {
   // @@protoc_insertion_point(field_release:opencv_onnx.AttributeProto.doc_string)
-  clear_has_doc_string();
-  return doc_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_doc_string()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = doc_string_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void AttributeProto::set_allocated_doc_string(::std::string* doc_string) {
-  if (doc_string != NULL) {
-    set_has_doc_string();
+inline void AttributeProto::set_allocated_doc_string(std::string* doc_string) {
+  if (doc_string != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_doc_string();
+    _has_bits_[0] &= ~0x00000004u;
   }
-  doc_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), doc_string);
+  doc_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), doc_string,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.AttributeProto.doc_string)
 }
 
 // optional .opencv_onnx.AttributeProto.AttributeType type = 20;
-inline bool AttributeProto::has_type() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
-}
-inline void AttributeProto::set_has_type() {
-  _has_bits_[0] |= 0x00000100u;
+inline bool AttributeProto::_internal_has_type() const {
+  bool value = (_has_bits_[0] & 0x00000100u) != 0;
+  return value;
 }
-inline void AttributeProto::clear_has_type() {
-  _has_bits_[0] &= ~0x00000100u;
+inline bool AttributeProto::has_type() const {
+  return _internal_has_type();
 }
 inline void AttributeProto::clear_type() {
   type_ = 0;
-  clear_has_type();
+  _has_bits_[0] &= ~0x00000100u;
 }
-inline ::opencv_onnx::AttributeProto_AttributeType AttributeProto::type() const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.type)
+inline ::opencv_onnx::AttributeProto_AttributeType AttributeProto::_internal_type() const {
   return static_cast< ::opencv_onnx::AttributeProto_AttributeType >(type_);
 }
-inline void AttributeProto::set_type(::opencv_onnx::AttributeProto_AttributeType value) {
+inline ::opencv_onnx::AttributeProto_AttributeType AttributeProto::type() const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.type)
+  return _internal_type();
+}
+inline void AttributeProto::_internal_set_type(::opencv_onnx::AttributeProto_AttributeType value) {
   assert(::opencv_onnx::AttributeProto_AttributeType_IsValid(value));
-  set_has_type();
+  _has_bits_[0] |= 0x00000100u;
   type_ = value;
+}
+inline void AttributeProto::set_type(::opencv_onnx::AttributeProto_AttributeType value) {
+  _internal_set_type(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.type)
 }
 
 // optional float f = 2;
-inline bool AttributeProto::has_f() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
-}
-inline void AttributeProto::set_has_f() {
-  _has_bits_[0] |= 0x00000080u;
+inline bool AttributeProto::_internal_has_f() const {
+  bool value = (_has_bits_[0] & 0x00000080u) != 0;
+  return value;
 }
-inline void AttributeProto::clear_has_f() {
-  _has_bits_[0] &= ~0x00000080u;
+inline bool AttributeProto::has_f() const {
+  return _internal_has_f();
 }
 inline void AttributeProto::clear_f() {
   f_ = 0;
-  clear_has_f();
+  _has_bits_[0] &= ~0x00000080u;
+}
+inline float AttributeProto::_internal_f() const {
+  return f_;
 }
 inline float AttributeProto::f() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.f)
-  return f_;
+  return _internal_f();
 }
-inline void AttributeProto::set_f(float value) {
-  set_has_f();
+inline void AttributeProto::_internal_set_f(float value) {
+  _has_bits_[0] |= 0x00000080u;
   f_ = value;
+}
+inline void AttributeProto::set_f(float value) {
+  _internal_set_f(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.f)
 }
 
 // optional int64 i = 3;
-inline bool AttributeProto::has_i() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+inline bool AttributeProto::_internal_has_i() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void AttributeProto::set_has_i() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool AttributeProto::has_i() const {
+  return _internal_has_i();
 }
-inline void AttributeProto::clear_has_i() {
+inline void AttributeProto::clear_i() {
+  i_ = int64_t{0};
   _has_bits_[0] &= ~0x00000040u;
 }
-inline void AttributeProto::clear_i() {
-  i_ = GOOGLE_LONGLONG(0);
-  clear_has_i();
+inline int64_t AttributeProto::_internal_i() const {
+  return i_;
 }
-inline ::google::protobuf::int64 AttributeProto::i() const {
+inline int64_t AttributeProto::i() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.i)
-  return i_;
+  return _internal_i();
 }
-inline void AttributeProto::set_i(::google::protobuf::int64 value) {
-  set_has_i();
+inline void AttributeProto::_internal_set_i(int64_t value) {
+  _has_bits_[0] |= 0x00000040u;
   i_ = value;
+}
+inline void AttributeProto::set_i(int64_t value) {
+  _internal_set_i(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.i)
 }
 
 // optional bytes s = 4;
-inline bool AttributeProto::has_s() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void AttributeProto::set_has_s() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool AttributeProto::_internal_has_s() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void AttributeProto::clear_has_s() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool AttributeProto::has_s() const {
+  return _internal_has_s();
 }
 inline void AttributeProto::clear_s() {
-  s_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_s();
+  s_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& AttributeProto::s() const {
+inline const std::string& AttributeProto::s() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.s)
-  return s_.GetNoArena();
+  return _internal_s();
 }
-inline void AttributeProto::set_s(const ::std::string& value) {
-  set_has_s();
-  s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void AttributeProto::set_s(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ s_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.s)
 }
-#if LANG_CXX11
-inline void AttributeProto::set_s(::std::string&& value) {
-  set_has_s();
-  s_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.AttributeProto.s)
-}
-#endif
-inline void AttributeProto::set_s(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_s();
-  s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.AttributeProto.s)
-}
-inline void AttributeProto::set_s(const void* value, size_t size) {
-  set_has_s();
-  s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.AttributeProto.s)
-}
-inline ::std::string* AttributeProto::mutable_s() {
-  set_has_s();
+inline std::string* AttributeProto::mutable_s() {
+  std::string* _s = _internal_mutable_s();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.s)
-  return s_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& AttributeProto::_internal_s() const {
+  return s_.Get();
+}
+inline void AttributeProto::_internal_set_s(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  s_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* AttributeProto::_internal_mutable_s() {
+  _has_bits_[0] |= 0x00000002u;
+  return s_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* AttributeProto::release_s() {
+inline std::string* AttributeProto::release_s() {
   // @@protoc_insertion_point(field_release:opencv_onnx.AttributeProto.s)
-  clear_has_s();
-  return s_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_s()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = s_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (s_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    s_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void AttributeProto::set_allocated_s(::std::string* s) {
-  if (s != NULL) {
-    set_has_s();
+inline void AttributeProto::set_allocated_s(std::string* s) {
+  if (s != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_s();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  s_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s);
+  s_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), s,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (s_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    s_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.AttributeProto.s)
 }
 
 // optional .opencv_onnx.TensorProto t = 5;
-inline bool AttributeProto::has_t() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+inline bool AttributeProto::_internal_has_t() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  PROTOBUF_ASSUME(!value || t_ != nullptr);
+  return value;
 }
-inline void AttributeProto::set_has_t() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool AttributeProto::has_t() const {
+  return _internal_has_t();
 }
-inline void AttributeProto::clear_has_t() {
+inline void AttributeProto::clear_t() {
+  if (t_ != nullptr) t_->Clear();
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void AttributeProto::clear_t() {
-  if (t_ != NULL) t_->Clear();
-  clear_has_t();
+inline const ::opencv_onnx::TensorProto& AttributeProto::_internal_t() const {
+  const ::opencv_onnx::TensorProto* p = t_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_onnx::TensorProto&>(
+      ::opencv_onnx::_TensorProto_default_instance_);
 }
 inline const ::opencv_onnx::TensorProto& AttributeProto::t() const {
-  const ::opencv_onnx::TensorProto* p = t_;
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.t)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_onnx::TensorProto*>(
-      &::opencv_onnx::_TensorProto_default_instance_);
+  return _internal_t();
+}
+inline void AttributeProto::unsafe_arena_set_allocated_t(
+    ::opencv_onnx::TensorProto* t) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(t_);
+  }
+  t_ = t;
+  if (t) {
+    _has_bits_[0] |= 0x00000010u;
+  } else {
+    _has_bits_[0] &= ~0x00000010u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_onnx.AttributeProto.t)
 }
 inline ::opencv_onnx::TensorProto* AttributeProto::release_t() {
+  _has_bits_[0] &= ~0x00000010u;
+  ::opencv_onnx::TensorProto* temp = t_;
+  t_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_onnx::TensorProto* AttributeProto::unsafe_arena_release_t() {
   // @@protoc_insertion_point(field_release:opencv_onnx.AttributeProto.t)
-  clear_has_t();
+  _has_bits_[0] &= ~0x00000010u;
   ::opencv_onnx::TensorProto* temp = t_;
-  t_ = NULL;
+  t_ = nullptr;
   return temp;
 }
-inline ::opencv_onnx::TensorProto* AttributeProto::mutable_t() {
-  set_has_t();
-  if (t_ == NULL) {
-    t_ = new ::opencv_onnx::TensorProto;
+inline ::opencv_onnx::TensorProto* AttributeProto::_internal_mutable_t() {
+  _has_bits_[0] |= 0x00000010u;
+  if (t_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_onnx::TensorProto>(GetArenaForAllocation());
+    t_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.t)
   return t_;
 }
+inline ::opencv_onnx::TensorProto* AttributeProto::mutable_t() {
+  ::opencv_onnx::TensorProto* _msg = _internal_mutable_t();
+  // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.t)
+  return _msg;
+}
 inline void AttributeProto::set_allocated_t(::opencv_onnx::TensorProto* t) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete t_;
   }
   if (t) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_onnx::TensorProto>::GetOwningArena(t);
     if (message_arena != submessage_arena) {
-      t = ::google::protobuf::internal::GetOwnedMessage(
+      t = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, t, submessage_arena);
     }
-    set_has_t();
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_t();
+    _has_bits_[0] &= ~0x00000010u;
   }
   t_ = t;
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.AttributeProto.t)
 }
 
 // optional .opencv_onnx.GraphProto g = 6;
-inline bool AttributeProto::has_g() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool AttributeProto::_internal_has_g() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  PROTOBUF_ASSUME(!value || g_ != nullptr);
+  return value;
 }
-inline void AttributeProto::set_has_g() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool AttributeProto::has_g() const {
+  return _internal_has_g();
 }
-inline void AttributeProto::clear_has_g() {
+inline void AttributeProto::clear_g() {
+  if (g_ != nullptr) g_->Clear();
   _has_bits_[0] &= ~0x00000020u;
 }
-inline void AttributeProto::clear_g() {
-  if (g_ != NULL) g_->Clear();
-  clear_has_g();
+inline const ::opencv_onnx::GraphProto& AttributeProto::_internal_g() const {
+  const ::opencv_onnx::GraphProto* p = g_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_onnx::GraphProto&>(
+      ::opencv_onnx::_GraphProto_default_instance_);
 }
 inline const ::opencv_onnx::GraphProto& AttributeProto::g() const {
-  const ::opencv_onnx::GraphProto* p = g_;
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.g)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_onnx::GraphProto*>(
-      &::opencv_onnx::_GraphProto_default_instance_);
+  return _internal_g();
+}
+inline void AttributeProto::unsafe_arena_set_allocated_g(
+    ::opencv_onnx::GraphProto* g) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(g_);
+  }
+  g_ = g;
+  if (g) {
+    _has_bits_[0] |= 0x00000020u;
+  } else {
+    _has_bits_[0] &= ~0x00000020u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_onnx.AttributeProto.g)
 }
 inline ::opencv_onnx::GraphProto* AttributeProto::release_g() {
+  _has_bits_[0] &= ~0x00000020u;
+  ::opencv_onnx::GraphProto* temp = g_;
+  g_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_onnx::GraphProto* AttributeProto::unsafe_arena_release_g() {
   // @@protoc_insertion_point(field_release:opencv_onnx.AttributeProto.g)
-  clear_has_g();
+  _has_bits_[0] &= ~0x00000020u;
   ::opencv_onnx::GraphProto* temp = g_;
-  g_ = NULL;
+  g_ = nullptr;
   return temp;
 }
-inline ::opencv_onnx::GraphProto* AttributeProto::mutable_g() {
-  set_has_g();
-  if (g_ == NULL) {
-    g_ = new ::opencv_onnx::GraphProto;
+inline ::opencv_onnx::GraphProto* AttributeProto::_internal_mutable_g() {
+  _has_bits_[0] |= 0x00000020u;
+  if (g_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_onnx::GraphProto>(GetArenaForAllocation());
+    g_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.g)
   return g_;
 }
+inline ::opencv_onnx::GraphProto* AttributeProto::mutable_g() {
+  ::opencv_onnx::GraphProto* _msg = _internal_mutable_g();
+  // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.g)
+  return _msg;
+}
 inline void AttributeProto::set_allocated_g(::opencv_onnx::GraphProto* g) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete g_;
   }
   if (g) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_onnx::GraphProto>::GetOwningArena(g);
     if (message_arena != submessage_arena) {
-      g = ::google::protobuf::internal::GetOwnedMessage(
+      g = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, g, submessage_arena);
     }
-    set_has_g();
+    _has_bits_[0] |= 0x00000020u;
   } else {
-    clear_has_g();
+    _has_bits_[0] &= ~0x00000020u;
   }
   g_ = g;
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.AttributeProto.g)
 }
 
 // repeated float floats = 7;
-inline int AttributeProto::floats_size() const {
+inline int AttributeProto::_internal_floats_size() const {
   return floats_.size();
 }
+inline int AttributeProto::floats_size() const {
+  return _internal_floats_size();
+}
 inline void AttributeProto::clear_floats() {
   floats_.Clear();
 }
+inline float AttributeProto::_internal_floats(int index) const {
+  return floats_.Get(index);
+}
 inline float AttributeProto::floats(int index) const {
   // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.floats)
-  return floats_.Get(index);
+  return _internal_floats(index);
 }
 inline void AttributeProto::set_floats(int index, float value) {
   floats_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.floats)
 }
-inline void AttributeProto::add_floats(float value) {
+inline void AttributeProto::_internal_add_floats(float value) {
   floats_.Add(value);
+}
+inline void AttributeProto::add_floats(float value) {
+  _internal_add_floats(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.AttributeProto.floats)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+AttributeProto::_internal_floats() const {
+  return floats_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 AttributeProto::floats() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.AttributeProto.floats)
-  return floats_;
+  return _internal_floats();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+AttributeProto::_internal_mutable_floats() {
+  return &floats_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 AttributeProto::mutable_floats() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.AttributeProto.floats)
-  return &floats_;
+  return _internal_mutable_floats();
 }
 
 // repeated int64 ints = 8;
-inline int AttributeProto::ints_size() const {
+inline int AttributeProto::_internal_ints_size() const {
   return ints_.size();
 }
+inline int AttributeProto::ints_size() const {
+  return _internal_ints_size();
+}
 inline void AttributeProto::clear_ints() {
   ints_.Clear();
 }
-inline ::google::protobuf::int64 AttributeProto::ints(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.ints)
+inline int64_t AttributeProto::_internal_ints(int index) const {
   return ints_.Get(index);
 }
-inline void AttributeProto::set_ints(int index, ::google::protobuf::int64 value) {
+inline int64_t AttributeProto::ints(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.ints)
+  return _internal_ints(index);
+}
+inline void AttributeProto::set_ints(int index, int64_t value) {
   ints_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.ints)
 }
-inline void AttributeProto::add_ints(::google::protobuf::int64 value) {
+inline void AttributeProto::_internal_add_ints(int64_t value) {
   ints_.Add(value);
+}
+inline void AttributeProto::add_ints(int64_t value) {
+  _internal_add_ints(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.AttributeProto.ints)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+AttributeProto::_internal_ints() const {
+  return ints_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
 AttributeProto::ints() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.AttributeProto.ints)
-  return ints_;
+  return _internal_ints();
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+AttributeProto::_internal_mutable_ints() {
+  return &ints_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
 AttributeProto::mutable_ints() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.AttributeProto.ints)
-  return &ints_;
+  return _internal_mutable_ints();
 }
 
 // repeated bytes strings = 9;
-inline int AttributeProto::strings_size() const {
+inline int AttributeProto::_internal_strings_size() const {
   return strings_.size();
 }
+inline int AttributeProto::strings_size() const {
+  return _internal_strings_size();
+}
 inline void AttributeProto::clear_strings() {
   strings_.Clear();
 }
-inline const ::std::string& AttributeProto::strings(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.strings)
+inline std::string* AttributeProto::add_strings() {
+  std::string* _s = _internal_add_strings();
+  // @@protoc_insertion_point(field_add_mutable:opencv_onnx.AttributeProto.strings)
+  return _s;
+}
+inline const std::string& AttributeProto::_internal_strings(int index) const {
   return strings_.Get(index);
 }
-inline ::std::string* AttributeProto::mutable_strings(int index) {
+inline const std::string& AttributeProto::strings(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.strings)
+  return _internal_strings(index);
+}
+inline std::string* AttributeProto::mutable_strings(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.strings)
   return strings_.Mutable(index);
 }
-inline void AttributeProto::set_strings(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.strings)
+inline void AttributeProto::set_strings(int index, const std::string& value) {
   strings_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void AttributeProto::set_strings(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.strings)
+}
+inline void AttributeProto::set_strings(int index, std::string&& value) {
   strings_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_onnx.AttributeProto.strings)
 }
-#endif
 inline void AttributeProto::set_strings(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   strings_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_onnx.AttributeProto.strings)
 }
@@ -3163,22 +4226,19 @@ inline void AttributeProto::set_strings(int index, const void* value, size_t siz
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_onnx.AttributeProto.strings)
 }
-inline ::std::string* AttributeProto::add_strings() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_onnx.AttributeProto.strings)
+inline std::string* AttributeProto::_internal_add_strings() {
   return strings_.Add();
 }
-inline void AttributeProto::add_strings(const ::std::string& value) {
+inline void AttributeProto::add_strings(const std::string& value) {
   strings_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.AttributeProto.strings)
 }
-#if LANG_CXX11
-inline void AttributeProto::add_strings(::std::string&& value) {
+inline void AttributeProto::add_strings(std::string&& value) {
   strings_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_onnx.AttributeProto.strings)
 }
-#endif
 inline void AttributeProto::add_strings(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   strings_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_onnx.AttributeProto.strings)
 }
@@ -3186,72 +4246,92 @@ inline void AttributeProto::add_strings(const void* value, size_t size) {
   strings_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_onnx.AttributeProto.strings)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 AttributeProto::strings() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.AttributeProto.strings)
   return strings_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 AttributeProto::mutable_strings() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.AttributeProto.strings)
   return &strings_;
 }
 
 // repeated .opencv_onnx.TensorProto tensors = 10;
-inline int AttributeProto::tensors_size() const {
+inline int AttributeProto::_internal_tensors_size() const {
   return tensors_.size();
 }
+inline int AttributeProto::tensors_size() const {
+  return _internal_tensors_size();
+}
 inline void AttributeProto::clear_tensors() {
   tensors_.Clear();
 }
-inline const ::opencv_onnx::TensorProto& AttributeProto::tensors(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.tensors)
-  return tensors_.Get(index);
-}
 inline ::opencv_onnx::TensorProto* AttributeProto::mutable_tensors(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.tensors)
   return tensors_.Mutable(index);
 }
-inline ::opencv_onnx::TensorProto* AttributeProto::add_tensors() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.AttributeProto.tensors)
-  return tensors_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto >*
 AttributeProto::mutable_tensors() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.AttributeProto.tensors)
   return &tensors_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto >&
+inline const ::opencv_onnx::TensorProto& AttributeProto::_internal_tensors(int index) const {
+  return tensors_.Get(index);
+}
+inline const ::opencv_onnx::TensorProto& AttributeProto::tensors(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.tensors)
+  return _internal_tensors(index);
+}
+inline ::opencv_onnx::TensorProto* AttributeProto::_internal_add_tensors() {
+  return tensors_.Add();
+}
+inline ::opencv_onnx::TensorProto* AttributeProto::add_tensors() {
+  ::opencv_onnx::TensorProto* _add = _internal_add_tensors();
+  // @@protoc_insertion_point(field_add:opencv_onnx.AttributeProto.tensors)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto >&
 AttributeProto::tensors() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.AttributeProto.tensors)
   return tensors_;
 }
 
 // repeated .opencv_onnx.GraphProto graphs = 11;
-inline int AttributeProto::graphs_size() const {
+inline int AttributeProto::_internal_graphs_size() const {
   return graphs_.size();
 }
+inline int AttributeProto::graphs_size() const {
+  return _internal_graphs_size();
+}
 inline void AttributeProto::clear_graphs() {
   graphs_.Clear();
 }
-inline const ::opencv_onnx::GraphProto& AttributeProto::graphs(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.graphs)
-  return graphs_.Get(index);
-}
 inline ::opencv_onnx::GraphProto* AttributeProto::mutable_graphs(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.AttributeProto.graphs)
   return graphs_.Mutable(index);
 }
-inline ::opencv_onnx::GraphProto* AttributeProto::add_graphs() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.AttributeProto.graphs)
-  return graphs_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::GraphProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::GraphProto >*
 AttributeProto::mutable_graphs() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.AttributeProto.graphs)
   return &graphs_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::GraphProto >&
+inline const ::opencv_onnx::GraphProto& AttributeProto::_internal_graphs(int index) const {
+  return graphs_.Get(index);
+}
+inline const ::opencv_onnx::GraphProto& AttributeProto::graphs(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.AttributeProto.graphs)
+  return _internal_graphs(index);
+}
+inline ::opencv_onnx::GraphProto* AttributeProto::_internal_add_graphs() {
+  return graphs_.Add();
+}
+inline ::opencv_onnx::GraphProto* AttributeProto::add_graphs() {
+  ::opencv_onnx::GraphProto* _add = _internal_add_graphs();
+  // @@protoc_insertion_point(field_add:opencv_onnx.AttributeProto.graphs)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::GraphProto >&
 AttributeProto::graphs() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.AttributeProto.graphs)
   return graphs_;
@@ -3262,182 +4342,230 @@ AttributeProto::graphs() const {
 // ValueInfoProto
 
 // optional string name = 1;
-inline bool ValueInfoProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void ValueInfoProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool ValueInfoProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ValueInfoProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ValueInfoProto::has_name() const {
+  return _internal_has_name();
 }
 inline void ValueInfoProto::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& ValueInfoProto::name() const {
+inline const std::string& ValueInfoProto::name() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.ValueInfoProto.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void ValueInfoProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ValueInfoProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.ValueInfoProto.name)
 }
-#if LANG_CXX11
-inline void ValueInfoProto::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.ValueInfoProto.name)
-}
-#endif
-inline void ValueInfoProto::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:opencv_onnx.ValueInfoProto.name)
-}
-inline void ValueInfoProto::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:opencv_onnx.ValueInfoProto.name)
-}
-inline ::std::string* ValueInfoProto::mutable_name() {
-  set_has_name();
+inline std::string* ValueInfoProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.ValueInfoProto.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& ValueInfoProto::_internal_name() const {
+  return name_.Get();
+}
+inline void ValueInfoProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* ValueInfoProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* ValueInfoProto::release_name() {
+inline std::string* ValueInfoProto::release_name() {
   // @@protoc_insertion_point(field_release:opencv_onnx.ValueInfoProto.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ValueInfoProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void ValueInfoProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.ValueInfoProto.name)
 }
 
 // optional .opencv_onnx.TypeProto type = 2;
-inline bool ValueInfoProto::has_type() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool ValueInfoProto::_internal_has_type() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  PROTOBUF_ASSUME(!value || type_ != nullptr);
+  return value;
 }
-inline void ValueInfoProto::set_has_type() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ValueInfoProto::has_type() const {
+  return _internal_has_type();
 }
-inline void ValueInfoProto::clear_has_type() {
+inline void ValueInfoProto::clear_type() {
+  if (type_ != nullptr) type_->Clear();
   _has_bits_[0] &= ~0x00000004u;
 }
-inline void ValueInfoProto::clear_type() {
-  if (type_ != NULL) type_->Clear();
-  clear_has_type();
+inline const ::opencv_onnx::TypeProto& ValueInfoProto::_internal_type() const {
+  const ::opencv_onnx::TypeProto* p = type_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_onnx::TypeProto&>(
+      ::opencv_onnx::_TypeProto_default_instance_);
 }
 inline const ::opencv_onnx::TypeProto& ValueInfoProto::type() const {
-  const ::opencv_onnx::TypeProto* p = type_;
   // @@protoc_insertion_point(field_get:opencv_onnx.ValueInfoProto.type)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_onnx::TypeProto*>(
-      &::opencv_onnx::_TypeProto_default_instance_);
+  return _internal_type();
+}
+inline void ValueInfoProto::unsafe_arena_set_allocated_type(
+    ::opencv_onnx::TypeProto* type) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(type_);
+  }
+  type_ = type;
+  if (type) {
+    _has_bits_[0] |= 0x00000004u;
+  } else {
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_onnx.ValueInfoProto.type)
 }
 inline ::opencv_onnx::TypeProto* ValueInfoProto::release_type() {
+  _has_bits_[0] &= ~0x00000004u;
+  ::opencv_onnx::TypeProto* temp = type_;
+  type_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_onnx::TypeProto* ValueInfoProto::unsafe_arena_release_type() {
   // @@protoc_insertion_point(field_release:opencv_onnx.ValueInfoProto.type)
-  clear_has_type();
+  _has_bits_[0] &= ~0x00000004u;
   ::opencv_onnx::TypeProto* temp = type_;
-  type_ = NULL;
+  type_ = nullptr;
   return temp;
 }
-inline ::opencv_onnx::TypeProto* ValueInfoProto::mutable_type() {
-  set_has_type();
-  if (type_ == NULL) {
-    type_ = new ::opencv_onnx::TypeProto;
+inline ::opencv_onnx::TypeProto* ValueInfoProto::_internal_mutable_type() {
+  _has_bits_[0] |= 0x00000004u;
+  if (type_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_onnx::TypeProto>(GetArenaForAllocation());
+    type_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_onnx.ValueInfoProto.type)
   return type_;
 }
+inline ::opencv_onnx::TypeProto* ValueInfoProto::mutable_type() {
+  ::opencv_onnx::TypeProto* _msg = _internal_mutable_type();
+  // @@protoc_insertion_point(field_mutable:opencv_onnx.ValueInfoProto.type)
+  return _msg;
+}
 inline void ValueInfoProto::set_allocated_type(::opencv_onnx::TypeProto* type) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete type_;
   }
   if (type) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_onnx::TypeProto>::GetOwningArena(type);
     if (message_arena != submessage_arena) {
-      type = ::google::protobuf::internal::GetOwnedMessage(
+      type = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, type, submessage_arena);
     }
-    set_has_type();
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_type();
+    _has_bits_[0] &= ~0x00000004u;
   }
   type_ = type;
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.ValueInfoProto.type)
 }
 
 // optional string doc_string = 3;
-inline bool ValueInfoProto::has_doc_string() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ValueInfoProto::set_has_doc_string() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ValueInfoProto::_internal_has_doc_string() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ValueInfoProto::clear_has_doc_string() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ValueInfoProto::has_doc_string() const {
+  return _internal_has_doc_string();
 }
 inline void ValueInfoProto::clear_doc_string() {
-  doc_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_doc_string();
+  doc_string_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& ValueInfoProto::doc_string() const {
+inline const std::string& ValueInfoProto::doc_string() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.ValueInfoProto.doc_string)
-  return doc_string_.GetNoArena();
+  return _internal_doc_string();
 }
-inline void ValueInfoProto::set_doc_string(const ::std::string& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ValueInfoProto::set_doc_string(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.ValueInfoProto.doc_string)
 }
-#if LANG_CXX11
-inline void ValueInfoProto::set_doc_string(::std::string&& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.ValueInfoProto.doc_string)
-}
-#endif
-inline void ValueInfoProto::set_doc_string(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.ValueInfoProto.doc_string)
-}
-inline void ValueInfoProto::set_doc_string(const char* value, size_t size) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.ValueInfoProto.doc_string)
-}
-inline ::std::string* ValueInfoProto::mutable_doc_string() {
-  set_has_doc_string();
+inline std::string* ValueInfoProto::mutable_doc_string() {
+  std::string* _s = _internal_mutable_doc_string();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.ValueInfoProto.doc_string)
-  return doc_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& ValueInfoProto::_internal_doc_string() const {
+  return doc_string_.Get();
+}
+inline void ValueInfoProto::_internal_set_doc_string(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* ValueInfoProto::release_doc_string() {
+inline std::string* ValueInfoProto::_internal_mutable_doc_string() {
+  _has_bits_[0] |= 0x00000002u;
+  return doc_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* ValueInfoProto::release_doc_string() {
   // @@protoc_insertion_point(field_release:opencv_onnx.ValueInfoProto.doc_string)
-  clear_has_doc_string();
-  return doc_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_doc_string()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = doc_string_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ValueInfoProto::set_allocated_doc_string(::std::string* doc_string) {
-  if (doc_string != NULL) {
-    set_has_doc_string();
+inline void ValueInfoProto::set_allocated_doc_string(std::string* doc_string) {
+  if (doc_string != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_doc_string();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  doc_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), doc_string,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  doc_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), doc_string);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.ValueInfoProto.doc_string)
 }
 
@@ -3446,32 +4574,41 @@ inline void ValueInfoProto::set_allocated_doc_string(::std::string* doc_string)
 // NodeProto
 
 // repeated string input = 1;
-inline int NodeProto::input_size() const {
+inline int NodeProto::_internal_input_size() const {
   return input_.size();
 }
+inline int NodeProto::input_size() const {
+  return _internal_input_size();
+}
 inline void NodeProto::clear_input() {
   input_.Clear();
 }
-inline const ::std::string& NodeProto::input(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.input)
+inline std::string* NodeProto::add_input() {
+  std::string* _s = _internal_add_input();
+  // @@protoc_insertion_point(field_add_mutable:opencv_onnx.NodeProto.input)
+  return _s;
+}
+inline const std::string& NodeProto::_internal_input(int index) const {
   return input_.Get(index);
 }
-inline ::std::string* NodeProto::mutable_input(int index) {
+inline const std::string& NodeProto::input(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.input)
+  return _internal_input(index);
+}
+inline std::string* NodeProto::mutable_input(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.NodeProto.input)
   return input_.Mutable(index);
 }
-inline void NodeProto::set_input(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.input)
+inline void NodeProto::set_input(int index, const std::string& value) {
   input_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void NodeProto::set_input(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.input)
+}
+inline void NodeProto::set_input(int index, std::string&& value) {
   input_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.input)
 }
-#endif
 inline void NodeProto::set_input(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   input_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_onnx.NodeProto.input)
 }
@@ -3480,22 +4617,19 @@ inline void NodeProto::set_input(int index, const char* value, size_t size) {
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_onnx.NodeProto.input)
 }
-inline ::std::string* NodeProto::add_input() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_onnx.NodeProto.input)
+inline std::string* NodeProto::_internal_add_input() {
   return input_.Add();
 }
-inline void NodeProto::add_input(const ::std::string& value) {
+inline void NodeProto::add_input(const std::string& value) {
   input_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.NodeProto.input)
 }
-#if LANG_CXX11
-inline void NodeProto::add_input(::std::string&& value) {
+inline void NodeProto::add_input(std::string&& value) {
   input_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_onnx.NodeProto.input)
 }
-#endif
 inline void NodeProto::add_input(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   input_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_onnx.NodeProto.input)
 }
@@ -3503,44 +4637,53 @@ inline void NodeProto::add_input(const char* value, size_t size) {
   input_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_onnx.NodeProto.input)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 NodeProto::input() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.NodeProto.input)
   return input_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 NodeProto::mutable_input() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.NodeProto.input)
   return &input_;
 }
 
 // repeated string output = 2;
-inline int NodeProto::output_size() const {
+inline int NodeProto::_internal_output_size() const {
   return output_.size();
 }
+inline int NodeProto::output_size() const {
+  return _internal_output_size();
+}
 inline void NodeProto::clear_output() {
   output_.Clear();
 }
-inline const ::std::string& NodeProto::output(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.output)
+inline std::string* NodeProto::add_output() {
+  std::string* _s = _internal_add_output();
+  // @@protoc_insertion_point(field_add_mutable:opencv_onnx.NodeProto.output)
+  return _s;
+}
+inline const std::string& NodeProto::_internal_output(int index) const {
   return output_.Get(index);
 }
-inline ::std::string* NodeProto::mutable_output(int index) {
+inline const std::string& NodeProto::output(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.output)
+  return _internal_output(index);
+}
+inline std::string* NodeProto::mutable_output(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.NodeProto.output)
   return output_.Mutable(index);
 }
-inline void NodeProto::set_output(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.output)
+inline void NodeProto::set_output(int index, const std::string& value) {
   output_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void NodeProto::set_output(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.output)
+}
+inline void NodeProto::set_output(int index, std::string&& value) {
   output_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.output)
 }
-#endif
 inline void NodeProto::set_output(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   output_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_onnx.NodeProto.output)
 }
@@ -3549,22 +4692,19 @@ inline void NodeProto::set_output(int index, const char* value, size_t size) {
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_onnx.NodeProto.output)
 }
-inline ::std::string* NodeProto::add_output() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_onnx.NodeProto.output)
+inline std::string* NodeProto::_internal_add_output() {
   return output_.Add();
 }
-inline void NodeProto::add_output(const ::std::string& value) {
+inline void NodeProto::add_output(const std::string& value) {
   output_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.NodeProto.output)
 }
-#if LANG_CXX11
-inline void NodeProto::add_output(::std::string&& value) {
+inline void NodeProto::add_output(std::string&& value) {
   output_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_onnx.NodeProto.output)
 }
-#endif
 inline void NodeProto::add_output(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   output_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_onnx.NodeProto.output)
 }
@@ -3572,296 +4712,330 @@ inline void NodeProto::add_output(const char* value, size_t size) {
   output_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_onnx.NodeProto.output)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 NodeProto::output() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.NodeProto.output)
   return output_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 NodeProto::mutable_output() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.NodeProto.output)
   return &output_;
 }
 
 // optional string name = 3;
-inline bool NodeProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool NodeProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void NodeProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void NodeProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool NodeProto::has_name() const {
+  return _internal_has_name();
 }
 inline void NodeProto::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& NodeProto::name() const {
+inline const std::string& NodeProto::name() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void NodeProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NodeProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.name)
 }
-#if LANG_CXX11
-inline void NodeProto::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.NodeProto.name)
-}
-#endif
-inline void NodeProto::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:opencv_onnx.NodeProto.name)
-}
-inline void NodeProto::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:opencv_onnx.NodeProto.name)
-}
-inline ::std::string* NodeProto::mutable_name() {
-  set_has_name();
+inline std::string* NodeProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.NodeProto.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& NodeProto::_internal_name() const {
+  return name_.Get();
+}
+inline void NodeProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* NodeProto::release_name() {
+inline std::string* NodeProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* NodeProto::release_name() {
   // @@protoc_insertion_point(field_release:opencv_onnx.NodeProto.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void NodeProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void NodeProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.NodeProto.name)
 }
 
 // optional string op_type = 4;
-inline bool NodeProto::has_op_type() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void NodeProto::set_has_op_type() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool NodeProto::_internal_has_op_type() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void NodeProto::clear_has_op_type() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool NodeProto::has_op_type() const {
+  return _internal_has_op_type();
 }
 inline void NodeProto::clear_op_type() {
-  op_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_op_type();
+  op_type_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& NodeProto::op_type() const {
+inline const std::string& NodeProto::op_type() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.op_type)
-  return op_type_.GetNoArena();
+  return _internal_op_type();
 }
-inline void NodeProto::set_op_type(const ::std::string& value) {
-  set_has_op_type();
-  op_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NodeProto::set_op_type(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ op_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.op_type)
 }
-#if LANG_CXX11
-inline void NodeProto::set_op_type(::std::string&& value) {
-  set_has_op_type();
-  op_type_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.NodeProto.op_type)
-}
-#endif
-inline void NodeProto::set_op_type(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_op_type();
-  op_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.NodeProto.op_type)
-}
-inline void NodeProto::set_op_type(const char* value, size_t size) {
-  set_has_op_type();
-  op_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.NodeProto.op_type)
-}
-inline ::std::string* NodeProto::mutable_op_type() {
-  set_has_op_type();
+inline std::string* NodeProto::mutable_op_type() {
+  std::string* _s = _internal_mutable_op_type();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.NodeProto.op_type)
-  return op_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& NodeProto::_internal_op_type() const {
+  return op_type_.Get();
 }
-inline ::std::string* NodeProto::release_op_type() {
+inline void NodeProto::_internal_set_op_type(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  op_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* NodeProto::_internal_mutable_op_type() {
+  _has_bits_[0] |= 0x00000002u;
+  return op_type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* NodeProto::release_op_type() {
   // @@protoc_insertion_point(field_release:opencv_onnx.NodeProto.op_type)
-  clear_has_op_type();
-  return op_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_op_type()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = op_type_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (op_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    op_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void NodeProto::set_allocated_op_type(::std::string* op_type) {
-  if (op_type != NULL) {
-    set_has_op_type();
+inline void NodeProto::set_allocated_op_type(std::string* op_type) {
+  if (op_type != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_op_type();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  op_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op_type);
+  op_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), op_type,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (op_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    op_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.NodeProto.op_type)
 }
 
 // optional string domain = 7;
-inline bool NodeProto::has_domain() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool NodeProto::_internal_has_domain() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void NodeProto::set_has_domain() {
-  _has_bits_[0] |= 0x00000008u;
-}
-inline void NodeProto::clear_has_domain() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool NodeProto::has_domain() const {
+  return _internal_has_domain();
 }
 inline void NodeProto::clear_domain() {
-  domain_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_domain();
+  domain_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::std::string& NodeProto::domain() const {
+inline const std::string& NodeProto::domain() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.domain)
-  return domain_.GetNoArena();
+  return _internal_domain();
 }
-inline void NodeProto::set_domain(const ::std::string& value) {
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NodeProto::set_domain(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.domain)
 }
-#if LANG_CXX11
-inline void NodeProto::set_domain(::std::string&& value) {
-  set_has_domain();
-  domain_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.NodeProto.domain)
-}
-#endif
-inline void NodeProto::set_domain(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.NodeProto.domain)
-}
-inline void NodeProto::set_domain(const char* value, size_t size) {
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.NodeProto.domain)
-}
-inline ::std::string* NodeProto::mutable_domain() {
-  set_has_domain();
+inline std::string* NodeProto::mutable_domain() {
+  std::string* _s = _internal_mutable_domain();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.NodeProto.domain)
-  return domain_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* NodeProto::release_domain() {
+inline const std::string& NodeProto::_internal_domain() const {
+  return domain_.Get();
+}
+inline void NodeProto::_internal_set_domain(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* NodeProto::_internal_mutable_domain() {
+  _has_bits_[0] |= 0x00000008u;
+  return domain_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* NodeProto::release_domain() {
   // @@protoc_insertion_point(field_release:opencv_onnx.NodeProto.domain)
-  clear_has_domain();
-  return domain_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_domain()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000008u;
+  auto* p = domain_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (domain_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void NodeProto::set_allocated_domain(::std::string* domain) {
-  if (domain != NULL) {
-    set_has_domain();
+inline void NodeProto::set_allocated_domain(std::string* domain) {
+  if (domain != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_domain();
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  domain_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), domain,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (domain_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  domain_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), domain);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.NodeProto.domain)
 }
 
 // repeated .opencv_onnx.AttributeProto attribute = 5;
-inline int NodeProto::attribute_size() const {
+inline int NodeProto::_internal_attribute_size() const {
   return attribute_.size();
 }
+inline int NodeProto::attribute_size() const {
+  return _internal_attribute_size();
+}
 inline void NodeProto::clear_attribute() {
   attribute_.Clear();
 }
-inline const ::opencv_onnx::AttributeProto& NodeProto::attribute(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.attribute)
-  return attribute_.Get(index);
-}
 inline ::opencv_onnx::AttributeProto* NodeProto::mutable_attribute(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.NodeProto.attribute)
   return attribute_.Mutable(index);
 }
-inline ::opencv_onnx::AttributeProto* NodeProto::add_attribute() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.NodeProto.attribute)
-  return attribute_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::AttributeProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::AttributeProto >*
 NodeProto::mutable_attribute() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.NodeProto.attribute)
   return &attribute_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::AttributeProto >&
+inline const ::opencv_onnx::AttributeProto& NodeProto::_internal_attribute(int index) const {
+  return attribute_.Get(index);
+}
+inline const ::opencv_onnx::AttributeProto& NodeProto::attribute(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.attribute)
+  return _internal_attribute(index);
+}
+inline ::opencv_onnx::AttributeProto* NodeProto::_internal_add_attribute() {
+  return attribute_.Add();
+}
+inline ::opencv_onnx::AttributeProto* NodeProto::add_attribute() {
+  ::opencv_onnx::AttributeProto* _add = _internal_add_attribute();
+  // @@protoc_insertion_point(field_add:opencv_onnx.NodeProto.attribute)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::AttributeProto >&
 NodeProto::attribute() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.NodeProto.attribute)
   return attribute_;
 }
 
 // optional string doc_string = 6;
-inline bool NodeProto::has_doc_string() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+inline bool NodeProto::_internal_has_doc_string() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void NodeProto::set_has_doc_string() {
-  _has_bits_[0] |= 0x00000004u;
-}
-inline void NodeProto::clear_has_doc_string() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool NodeProto::has_doc_string() const {
+  return _internal_has_doc_string();
 }
 inline void NodeProto::clear_doc_string() {
-  doc_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_doc_string();
+  doc_string_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& NodeProto::doc_string() const {
+inline const std::string& NodeProto::doc_string() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.NodeProto.doc_string)
-  return doc_string_.GetNoArena();
+  return _internal_doc_string();
 }
-inline void NodeProto::set_doc_string(const ::std::string& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NodeProto::set_doc_string(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.NodeProto.doc_string)
 }
-#if LANG_CXX11
-inline void NodeProto::set_doc_string(::std::string&& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.NodeProto.doc_string)
-}
-#endif
-inline void NodeProto::set_doc_string(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.NodeProto.doc_string)
-}
-inline void NodeProto::set_doc_string(const char* value, size_t size) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.NodeProto.doc_string)
-}
-inline ::std::string* NodeProto::mutable_doc_string() {
-  set_has_doc_string();
+inline std::string* NodeProto::mutable_doc_string() {
+  std::string* _s = _internal_mutable_doc_string();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.NodeProto.doc_string)
-  return doc_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* NodeProto::release_doc_string() {
+inline const std::string& NodeProto::_internal_doc_string() const {
+  return doc_string_.Get();
+}
+inline void NodeProto::_internal_set_doc_string(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* NodeProto::_internal_mutable_doc_string() {
+  _has_bits_[0] |= 0x00000004u;
+  return doc_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* NodeProto::release_doc_string() {
   // @@protoc_insertion_point(field_release:opencv_onnx.NodeProto.doc_string)
-  clear_has_doc_string();
-  return doc_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_doc_string()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = doc_string_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void NodeProto::set_allocated_doc_string(::std::string* doc_string) {
-  if (doc_string != NULL) {
-    set_has_doc_string();
+inline void NodeProto::set_allocated_doc_string(std::string* doc_string) {
+  if (doc_string != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_doc_string();
+    _has_bits_[0] &= ~0x00000004u;
   }
-  doc_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), doc_string);
+  doc_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), doc_string,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.NodeProto.doc_string)
 }
 
@@ -3870,414 +5044,502 @@ inline void NodeProto::set_allocated_doc_string(::std::string* doc_string) {
 // ModelProto
 
 // optional int64 ir_version = 1;
-inline bool ModelProto::has_ir_version() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+inline bool ModelProto::_internal_has_ir_version() const {
+  bool value = (_has_bits_[0] & 0x00000020u) != 0;
+  return value;
 }
-inline void ModelProto::set_has_ir_version() {
-  _has_bits_[0] |= 0x00000020u;
+inline bool ModelProto::has_ir_version() const {
+  return _internal_has_ir_version();
 }
-inline void ModelProto::clear_has_ir_version() {
+inline void ModelProto::clear_ir_version() {
+  ir_version_ = int64_t{0};
   _has_bits_[0] &= ~0x00000020u;
 }
-inline void ModelProto::clear_ir_version() {
-  ir_version_ = GOOGLE_LONGLONG(0);
-  clear_has_ir_version();
+inline int64_t ModelProto::_internal_ir_version() const {
+  return ir_version_;
 }
-inline ::google::protobuf::int64 ModelProto::ir_version() const {
+inline int64_t ModelProto::ir_version() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.ir_version)
-  return ir_version_;
+  return _internal_ir_version();
 }
-inline void ModelProto::set_ir_version(::google::protobuf::int64 value) {
-  set_has_ir_version();
+inline void ModelProto::_internal_set_ir_version(int64_t value) {
+  _has_bits_[0] |= 0x00000020u;
   ir_version_ = value;
+}
+inline void ModelProto::set_ir_version(int64_t value) {
+  _internal_set_ir_version(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.ModelProto.ir_version)
 }
 
 // repeated .opencv_onnx.OperatorSetIdProto opset_import = 8;
-inline int ModelProto::opset_import_size() const {
+inline int ModelProto::_internal_opset_import_size() const {
   return opset_import_.size();
 }
+inline int ModelProto::opset_import_size() const {
+  return _internal_opset_import_size();
+}
 inline void ModelProto::clear_opset_import() {
   opset_import_.Clear();
 }
-inline const ::opencv_onnx::OperatorSetIdProto& ModelProto::opset_import(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.opset_import)
-  return opset_import_.Get(index);
-}
 inline ::opencv_onnx::OperatorSetIdProto* ModelProto::mutable_opset_import(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.ModelProto.opset_import)
   return opset_import_.Mutable(index);
 }
-inline ::opencv_onnx::OperatorSetIdProto* ModelProto::add_opset_import() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.ModelProto.opset_import)
-  return opset_import_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto >*
 ModelProto::mutable_opset_import() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.ModelProto.opset_import)
   return &opset_import_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto >&
+inline const ::opencv_onnx::OperatorSetIdProto& ModelProto::_internal_opset_import(int index) const {
+  return opset_import_.Get(index);
+}
+inline const ::opencv_onnx::OperatorSetIdProto& ModelProto::opset_import(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.opset_import)
+  return _internal_opset_import(index);
+}
+inline ::opencv_onnx::OperatorSetIdProto* ModelProto::_internal_add_opset_import() {
+  return opset_import_.Add();
+}
+inline ::opencv_onnx::OperatorSetIdProto* ModelProto::add_opset_import() {
+  ::opencv_onnx::OperatorSetIdProto* _add = _internal_add_opset_import();
+  // @@protoc_insertion_point(field_add:opencv_onnx.ModelProto.opset_import)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::OperatorSetIdProto >&
 ModelProto::opset_import() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.ModelProto.opset_import)
   return opset_import_;
 }
 
 // optional string producer_name = 2;
-inline bool ModelProto::has_producer_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool ModelProto::_internal_has_producer_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void ModelProto::set_has_producer_name() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void ModelProto::clear_has_producer_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool ModelProto::has_producer_name() const {
+  return _internal_has_producer_name();
 }
 inline void ModelProto::clear_producer_name() {
-  producer_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_producer_name();
+  producer_name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& ModelProto::producer_name() const {
+inline const std::string& ModelProto::producer_name() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.producer_name)
-  return producer_name_.GetNoArena();
+  return _internal_producer_name();
 }
-inline void ModelProto::set_producer_name(const ::std::string& value) {
-  set_has_producer_name();
-  producer_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ModelProto::set_producer_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ producer_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.ModelProto.producer_name)
 }
-#if LANG_CXX11
-inline void ModelProto::set_producer_name(::std::string&& value) {
-  set_has_producer_name();
-  producer_name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.ModelProto.producer_name)
-}
-#endif
-inline void ModelProto::set_producer_name(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_producer_name();
-  producer_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.ModelProto.producer_name)
-}
-inline void ModelProto::set_producer_name(const char* value, size_t size) {
-  set_has_producer_name();
-  producer_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.ModelProto.producer_name)
-}
-inline ::std::string* ModelProto::mutable_producer_name() {
-  set_has_producer_name();
+inline std::string* ModelProto::mutable_producer_name() {
+  std::string* _s = _internal_mutable_producer_name();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.ModelProto.producer_name)
-  return producer_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& ModelProto::_internal_producer_name() const {
+  return producer_name_.Get();
+}
+inline void ModelProto::_internal_set_producer_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  producer_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* ModelProto::_internal_mutable_producer_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return producer_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* ModelProto::release_producer_name() {
+inline std::string* ModelProto::release_producer_name() {
   // @@protoc_insertion_point(field_release:opencv_onnx.ModelProto.producer_name)
-  clear_has_producer_name();
-  return producer_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_producer_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = producer_name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (producer_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    producer_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ModelProto::set_allocated_producer_name(::std::string* producer_name) {
-  if (producer_name != NULL) {
-    set_has_producer_name();
+inline void ModelProto::set_allocated_producer_name(std::string* producer_name) {
+  if (producer_name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_producer_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  producer_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), producer_name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (producer_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    producer_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  producer_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), producer_name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.ModelProto.producer_name)
 }
 
 // optional string producer_version = 3;
-inline bool ModelProto::has_producer_version() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void ModelProto::set_has_producer_version() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool ModelProto::_internal_has_producer_version() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void ModelProto::clear_has_producer_version() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool ModelProto::has_producer_version() const {
+  return _internal_has_producer_version();
 }
 inline void ModelProto::clear_producer_version() {
-  producer_version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_producer_version();
+  producer_version_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& ModelProto::producer_version() const {
+inline const std::string& ModelProto::producer_version() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.producer_version)
-  return producer_version_.GetNoArena();
+  return _internal_producer_version();
 }
-inline void ModelProto::set_producer_version(const ::std::string& value) {
-  set_has_producer_version();
-  producer_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ModelProto::set_producer_version(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ producer_version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.ModelProto.producer_version)
 }
-#if LANG_CXX11
-inline void ModelProto::set_producer_version(::std::string&& value) {
-  set_has_producer_version();
-  producer_version_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.ModelProto.producer_version)
-}
-#endif
-inline void ModelProto::set_producer_version(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_producer_version();
-  producer_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.ModelProto.producer_version)
-}
-inline void ModelProto::set_producer_version(const char* value, size_t size) {
-  set_has_producer_version();
-  producer_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.ModelProto.producer_version)
-}
-inline ::std::string* ModelProto::mutable_producer_version() {
-  set_has_producer_version();
+inline std::string* ModelProto::mutable_producer_version() {
+  std::string* _s = _internal_mutable_producer_version();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.ModelProto.producer_version)
-  return producer_version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& ModelProto::_internal_producer_version() const {
+  return producer_version_.Get();
+}
+inline void ModelProto::_internal_set_producer_version(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  producer_version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* ModelProto::release_producer_version() {
+inline std::string* ModelProto::_internal_mutable_producer_version() {
+  _has_bits_[0] |= 0x00000002u;
+  return producer_version_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* ModelProto::release_producer_version() {
   // @@protoc_insertion_point(field_release:opencv_onnx.ModelProto.producer_version)
-  clear_has_producer_version();
-  return producer_version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_producer_version()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = producer_version_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (producer_version_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    producer_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ModelProto::set_allocated_producer_version(::std::string* producer_version) {
-  if (producer_version != NULL) {
-    set_has_producer_version();
+inline void ModelProto::set_allocated_producer_version(std::string* producer_version) {
+  if (producer_version != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_producer_version();
+    _has_bits_[0] &= ~0x00000002u;
   }
-  producer_version_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), producer_version);
+  producer_version_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), producer_version,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (producer_version_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    producer_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.ModelProto.producer_version)
 }
 
 // optional string domain = 4;
-inline bool ModelProto::has_domain() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void ModelProto::set_has_domain() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool ModelProto::_internal_has_domain() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void ModelProto::clear_has_domain() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool ModelProto::has_domain() const {
+  return _internal_has_domain();
 }
 inline void ModelProto::clear_domain() {
-  domain_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_domain();
+  domain_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& ModelProto::domain() const {
+inline const std::string& ModelProto::domain() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.domain)
-  return domain_.GetNoArena();
+  return _internal_domain();
 }
-inline void ModelProto::set_domain(const ::std::string& value) {
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ModelProto::set_domain(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.ModelProto.domain)
 }
-#if LANG_CXX11
-inline void ModelProto::set_domain(::std::string&& value) {
-  set_has_domain();
-  domain_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.ModelProto.domain)
-}
-#endif
-inline void ModelProto::set_domain(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.ModelProto.domain)
-}
-inline void ModelProto::set_domain(const char* value, size_t size) {
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.ModelProto.domain)
-}
-inline ::std::string* ModelProto::mutable_domain() {
-  set_has_domain();
+inline std::string* ModelProto::mutable_domain() {
+  std::string* _s = _internal_mutable_domain();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.ModelProto.domain)
-  return domain_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* ModelProto::release_domain() {
+inline const std::string& ModelProto::_internal_domain() const {
+  return domain_.Get();
+}
+inline void ModelProto::_internal_set_domain(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* ModelProto::_internal_mutable_domain() {
+  _has_bits_[0] |= 0x00000004u;
+  return domain_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* ModelProto::release_domain() {
   // @@protoc_insertion_point(field_release:opencv_onnx.ModelProto.domain)
-  clear_has_domain();
-  return domain_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_domain()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = domain_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (domain_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ModelProto::set_allocated_domain(::std::string* domain) {
-  if (domain != NULL) {
-    set_has_domain();
+inline void ModelProto::set_allocated_domain(std::string* domain) {
+  if (domain != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_domain();
+    _has_bits_[0] &= ~0x00000004u;
+  }
+  domain_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), domain,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (domain_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  domain_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), domain);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.ModelProto.domain)
 }
 
 // optional int64 model_version = 5;
-inline bool ModelProto::has_model_version() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+inline bool ModelProto::_internal_has_model_version() const {
+  bool value = (_has_bits_[0] & 0x00000040u) != 0;
+  return value;
 }
-inline void ModelProto::set_has_model_version() {
-  _has_bits_[0] |= 0x00000040u;
+inline bool ModelProto::has_model_version() const {
+  return _internal_has_model_version();
 }
-inline void ModelProto::clear_has_model_version() {
+inline void ModelProto::clear_model_version() {
+  model_version_ = int64_t{0};
   _has_bits_[0] &= ~0x00000040u;
 }
-inline void ModelProto::clear_model_version() {
-  model_version_ = GOOGLE_LONGLONG(0);
-  clear_has_model_version();
+inline int64_t ModelProto::_internal_model_version() const {
+  return model_version_;
 }
-inline ::google::protobuf::int64 ModelProto::model_version() const {
+inline int64_t ModelProto::model_version() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.model_version)
-  return model_version_;
+  return _internal_model_version();
 }
-inline void ModelProto::set_model_version(::google::protobuf::int64 value) {
-  set_has_model_version();
+inline void ModelProto::_internal_set_model_version(int64_t value) {
+  _has_bits_[0] |= 0x00000040u;
   model_version_ = value;
+}
+inline void ModelProto::set_model_version(int64_t value) {
+  _internal_set_model_version(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.ModelProto.model_version)
 }
 
 // optional string doc_string = 6;
-inline bool ModelProto::has_doc_string() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
-}
-inline void ModelProto::set_has_doc_string() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool ModelProto::_internal_has_doc_string() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
 }
-inline void ModelProto::clear_has_doc_string() {
-  _has_bits_[0] &= ~0x00000008u;
+inline bool ModelProto::has_doc_string() const {
+  return _internal_has_doc_string();
 }
 inline void ModelProto::clear_doc_string() {
-  doc_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_doc_string();
+  doc_string_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::std::string& ModelProto::doc_string() const {
+inline const std::string& ModelProto::doc_string() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.doc_string)
-  return doc_string_.GetNoArena();
+  return _internal_doc_string();
 }
-inline void ModelProto::set_doc_string(const ::std::string& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ModelProto::set_doc_string(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.ModelProto.doc_string)
 }
-#if LANG_CXX11
-inline void ModelProto::set_doc_string(::std::string&& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.ModelProto.doc_string)
-}
-#endif
-inline void ModelProto::set_doc_string(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.ModelProto.doc_string)
-}
-inline void ModelProto::set_doc_string(const char* value, size_t size) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.ModelProto.doc_string)
-}
-inline ::std::string* ModelProto::mutable_doc_string() {
-  set_has_doc_string();
+inline std::string* ModelProto::mutable_doc_string() {
+  std::string* _s = _internal_mutable_doc_string();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.ModelProto.doc_string)
-  return doc_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& ModelProto::_internal_doc_string() const {
+  return doc_string_.Get();
+}
+inline void ModelProto::_internal_set_doc_string(const std::string& value) {
+  _has_bits_[0] |= 0x00000008u;
+  doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* ModelProto::_internal_mutable_doc_string() {
+  _has_bits_[0] |= 0x00000008u;
+  return doc_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* ModelProto::release_doc_string() {
+inline std::string* ModelProto::release_doc_string() {
   // @@protoc_insertion_point(field_release:opencv_onnx.ModelProto.doc_string)
-  clear_has_doc_string();
-  return doc_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_doc_string()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000008u;
+  auto* p = doc_string_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void ModelProto::set_allocated_doc_string(::std::string* doc_string) {
-  if (doc_string != NULL) {
-    set_has_doc_string();
+inline void ModelProto::set_allocated_doc_string(std::string* doc_string) {
+  if (doc_string != nullptr) {
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_doc_string();
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  doc_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), doc_string,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  doc_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), doc_string);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.ModelProto.doc_string)
 }
 
 // optional .opencv_onnx.GraphProto graph = 7;
-inline bool ModelProto::has_graph() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+inline bool ModelProto::_internal_has_graph() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  PROTOBUF_ASSUME(!value || graph_ != nullptr);
+  return value;
 }
-inline void ModelProto::set_has_graph() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool ModelProto::has_graph() const {
+  return _internal_has_graph();
 }
-inline void ModelProto::clear_has_graph() {
+inline void ModelProto::clear_graph() {
+  if (graph_ != nullptr) graph_->Clear();
   _has_bits_[0] &= ~0x00000010u;
 }
-inline void ModelProto::clear_graph() {
-  if (graph_ != NULL) graph_->Clear();
-  clear_has_graph();
+inline const ::opencv_onnx::GraphProto& ModelProto::_internal_graph() const {
+  const ::opencv_onnx::GraphProto* p = graph_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_onnx::GraphProto&>(
+      ::opencv_onnx::_GraphProto_default_instance_);
 }
 inline const ::opencv_onnx::GraphProto& ModelProto::graph() const {
-  const ::opencv_onnx::GraphProto* p = graph_;
   // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.graph)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_onnx::GraphProto*>(
-      &::opencv_onnx::_GraphProto_default_instance_);
+  return _internal_graph();
+}
+inline void ModelProto::unsafe_arena_set_allocated_graph(
+    ::opencv_onnx::GraphProto* graph) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(graph_);
+  }
+  graph_ = graph;
+  if (graph) {
+    _has_bits_[0] |= 0x00000010u;
+  } else {
+    _has_bits_[0] &= ~0x00000010u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_onnx.ModelProto.graph)
 }
 inline ::opencv_onnx::GraphProto* ModelProto::release_graph() {
+  _has_bits_[0] &= ~0x00000010u;
+  ::opencv_onnx::GraphProto* temp = graph_;
+  graph_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_onnx::GraphProto* ModelProto::unsafe_arena_release_graph() {
   // @@protoc_insertion_point(field_release:opencv_onnx.ModelProto.graph)
-  clear_has_graph();
+  _has_bits_[0] &= ~0x00000010u;
   ::opencv_onnx::GraphProto* temp = graph_;
-  graph_ = NULL;
+  graph_ = nullptr;
   return temp;
 }
-inline ::opencv_onnx::GraphProto* ModelProto::mutable_graph() {
-  set_has_graph();
-  if (graph_ == NULL) {
-    graph_ = new ::opencv_onnx::GraphProto;
+inline ::opencv_onnx::GraphProto* ModelProto::_internal_mutable_graph() {
+  _has_bits_[0] |= 0x00000010u;
+  if (graph_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_onnx::GraphProto>(GetArenaForAllocation());
+    graph_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_onnx.ModelProto.graph)
   return graph_;
 }
+inline ::opencv_onnx::GraphProto* ModelProto::mutable_graph() {
+  ::opencv_onnx::GraphProto* _msg = _internal_mutable_graph();
+  // @@protoc_insertion_point(field_mutable:opencv_onnx.ModelProto.graph)
+  return _msg;
+}
 inline void ModelProto::set_allocated_graph(::opencv_onnx::GraphProto* graph) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete graph_;
   }
   if (graph) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_onnx::GraphProto>::GetOwningArena(graph);
     if (message_arena != submessage_arena) {
-      graph = ::google::protobuf::internal::GetOwnedMessage(
+      graph = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, graph, submessage_arena);
     }
-    set_has_graph();
+    _has_bits_[0] |= 0x00000010u;
   } else {
-    clear_has_graph();
+    _has_bits_[0] &= ~0x00000010u;
   }
   graph_ = graph;
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.ModelProto.graph)
 }
 
 // repeated .opencv_onnx.StringStringEntryProto metadata_props = 14;
-inline int ModelProto::metadata_props_size() const {
+inline int ModelProto::_internal_metadata_props_size() const {
   return metadata_props_.size();
 }
+inline int ModelProto::metadata_props_size() const {
+  return _internal_metadata_props_size();
+}
 inline void ModelProto::clear_metadata_props() {
   metadata_props_.Clear();
 }
-inline const ::opencv_onnx::StringStringEntryProto& ModelProto::metadata_props(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.metadata_props)
-  return metadata_props_.Get(index);
-}
 inline ::opencv_onnx::StringStringEntryProto* ModelProto::mutable_metadata_props(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.ModelProto.metadata_props)
   return metadata_props_.Mutable(index);
 }
-inline ::opencv_onnx::StringStringEntryProto* ModelProto::add_metadata_props() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.ModelProto.metadata_props)
-  return metadata_props_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto >*
 ModelProto::mutable_metadata_props() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.ModelProto.metadata_props)
   return &metadata_props_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto >&
+inline const ::opencv_onnx::StringStringEntryProto& ModelProto::_internal_metadata_props(int index) const {
+  return metadata_props_.Get(index);
+}
+inline const ::opencv_onnx::StringStringEntryProto& ModelProto::metadata_props(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.ModelProto.metadata_props)
+  return _internal_metadata_props(index);
+}
+inline ::opencv_onnx::StringStringEntryProto* ModelProto::_internal_add_metadata_props() {
+  return metadata_props_.Add();
+}
+inline ::opencv_onnx::StringStringEntryProto* ModelProto::add_metadata_props() {
+  ::opencv_onnx::StringStringEntryProto* _add = _internal_add_metadata_props();
+  // @@protoc_insertion_point(field_add:opencv_onnx.ModelProto.metadata_props)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::StringStringEntryProto >&
 ModelProto::metadata_props() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.ModelProto.metadata_props)
   return metadata_props_;
@@ -4288,128 +5550,140 @@ ModelProto::metadata_props() const {
 // StringStringEntryProto
 
 // optional string key = 1;
-inline bool StringStringEntryProto::has_key() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void StringStringEntryProto::set_has_key() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool StringStringEntryProto::_internal_has_key() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void StringStringEntryProto::clear_has_key() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool StringStringEntryProto::has_key() const {
+  return _internal_has_key();
 }
 inline void StringStringEntryProto::clear_key() {
-  key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_key();
+  key_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& StringStringEntryProto::key() const {
+inline const std::string& StringStringEntryProto::key() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.StringStringEntryProto.key)
-  return key_.GetNoArena();
+  return _internal_key();
 }
-inline void StringStringEntryProto::set_key(const ::std::string& value) {
-  set_has_key();
-  key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void StringStringEntryProto::set_key(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.StringStringEntryProto.key)
 }
-#if LANG_CXX11
-inline void StringStringEntryProto::set_key(::std::string&& value) {
-  set_has_key();
-  key_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.StringStringEntryProto.key)
-}
-#endif
-inline void StringStringEntryProto::set_key(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_key();
-  key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.StringStringEntryProto.key)
-}
-inline void StringStringEntryProto::set_key(const char* value, size_t size) {
-  set_has_key();
-  key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.StringStringEntryProto.key)
-}
-inline ::std::string* StringStringEntryProto::mutable_key() {
-  set_has_key();
+inline std::string* StringStringEntryProto::mutable_key() {
+  std::string* _s = _internal_mutable_key();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.StringStringEntryProto.key)
-  return key_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
 }
-inline ::std::string* StringStringEntryProto::release_key() {
+inline const std::string& StringStringEntryProto::_internal_key() const {
+  return key_.Get();
+}
+inline void StringStringEntryProto::_internal_set_key(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* StringStringEntryProto::_internal_mutable_key() {
+  _has_bits_[0] |= 0x00000001u;
+  return key_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* StringStringEntryProto::release_key() {
   // @@protoc_insertion_point(field_release:opencv_onnx.StringStringEntryProto.key)
-  clear_has_key();
-  return key_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_key()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = key_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (key_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void StringStringEntryProto::set_allocated_key(::std::string* key) {
-  if (key != NULL) {
-    set_has_key();
+inline void StringStringEntryProto::set_allocated_key(std::string* key) {
+  if (key != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_key();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  key_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (key_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  key_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), key);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.StringStringEntryProto.key)
 }
 
 // optional string value = 2;
-inline bool StringStringEntryProto::has_value() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void StringStringEntryProto::set_has_value() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool StringStringEntryProto::_internal_has_value() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void StringStringEntryProto::clear_has_value() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool StringStringEntryProto::has_value() const {
+  return _internal_has_value();
 }
 inline void StringStringEntryProto::clear_value() {
-  value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_value();
+  value_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& StringStringEntryProto::value() const {
+inline const std::string& StringStringEntryProto::value() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.StringStringEntryProto.value)
-  return value_.GetNoArena();
+  return _internal_value();
 }
-inline void StringStringEntryProto::set_value(const ::std::string& value) {
-  set_has_value();
-  value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void StringStringEntryProto::set_value(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.StringStringEntryProto.value)
 }
-#if LANG_CXX11
-inline void StringStringEntryProto::set_value(::std::string&& value) {
-  set_has_value();
-  value_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.StringStringEntryProto.value)
-}
-#endif
-inline void StringStringEntryProto::set_value(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_value();
-  value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.StringStringEntryProto.value)
-}
-inline void StringStringEntryProto::set_value(const char* value, size_t size) {
-  set_has_value();
-  value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.StringStringEntryProto.value)
-}
-inline ::std::string* StringStringEntryProto::mutable_value() {
-  set_has_value();
+inline std::string* StringStringEntryProto::mutable_value() {
+  std::string* _s = _internal_mutable_value();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.StringStringEntryProto.value)
-  return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& StringStringEntryProto::_internal_value() const {
+  return value_.Get();
+}
+inline void StringStringEntryProto::_internal_set_value(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* StringStringEntryProto::_internal_mutable_value() {
+  _has_bits_[0] |= 0x00000002u;
+  return value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* StringStringEntryProto::release_value() {
+inline std::string* StringStringEntryProto::release_value() {
   // @@protoc_insertion_point(field_release:opencv_onnx.StringStringEntryProto.value)
-  clear_has_value();
-  return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_value()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void StringStringEntryProto::set_allocated_value(::std::string* value) {
-  if (value != NULL) {
-    set_has_value();
+inline void StringStringEntryProto::set_allocated_value(std::string* value) {
+  if (value != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_value();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.StringStringEntryProto.value)
 }
 
@@ -4418,276 +5692,338 @@ inline void StringStringEntryProto::set_allocated_value(::std::string* value) {
 // GraphProto
 
 // repeated .opencv_onnx.NodeProto node = 1;
-inline int GraphProto::node_size() const {
+inline int GraphProto::_internal_node_size() const {
   return node_.size();
 }
+inline int GraphProto::node_size() const {
+  return _internal_node_size();
+}
 inline void GraphProto::clear_node() {
   node_.Clear();
 }
-inline const ::opencv_onnx::NodeProto& GraphProto::node(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.node)
-  return node_.Get(index);
-}
 inline ::opencv_onnx::NodeProto* GraphProto::mutable_node(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.GraphProto.node)
   return node_.Mutable(index);
 }
-inline ::opencv_onnx::NodeProto* GraphProto::add_node() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.node)
-  return node_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::NodeProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::NodeProto >*
 GraphProto::mutable_node() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.GraphProto.node)
   return &node_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::NodeProto >&
+inline const ::opencv_onnx::NodeProto& GraphProto::_internal_node(int index) const {
+  return node_.Get(index);
+}
+inline const ::opencv_onnx::NodeProto& GraphProto::node(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.node)
+  return _internal_node(index);
+}
+inline ::opencv_onnx::NodeProto* GraphProto::_internal_add_node() {
+  return node_.Add();
+}
+inline ::opencv_onnx::NodeProto* GraphProto::add_node() {
+  ::opencv_onnx::NodeProto* _add = _internal_add_node();
+  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.node)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::NodeProto >&
 GraphProto::node() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.GraphProto.node)
   return node_;
 }
 
 // optional string name = 2;
-inline bool GraphProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool GraphProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void GraphProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void GraphProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool GraphProto::has_name() const {
+  return _internal_has_name();
 }
 inline void GraphProto::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& GraphProto::name() const {
+inline const std::string& GraphProto::name() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void GraphProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void GraphProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.GraphProto.name)
 }
-#if LANG_CXX11
-inline void GraphProto::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.GraphProto.name)
-}
-#endif
-inline void GraphProto::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:opencv_onnx.GraphProto.name)
-}
-inline void GraphProto::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:opencv_onnx.GraphProto.name)
-}
-inline ::std::string* GraphProto::mutable_name() {
-  set_has_name();
+inline std::string* GraphProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.GraphProto.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& GraphProto::_internal_name() const {
+  return name_.Get();
+}
+inline void GraphProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* GraphProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* GraphProto::release_name() {
+inline std::string* GraphProto::release_name() {
   // @@protoc_insertion_point(field_release:opencv_onnx.GraphProto.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void GraphProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void GraphProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.GraphProto.name)
 }
 
 // repeated .opencv_onnx.TensorProto initializer = 5;
-inline int GraphProto::initializer_size() const {
+inline int GraphProto::_internal_initializer_size() const {
   return initializer_.size();
 }
+inline int GraphProto::initializer_size() const {
+  return _internal_initializer_size();
+}
 inline void GraphProto::clear_initializer() {
   initializer_.Clear();
 }
-inline const ::opencv_onnx::TensorProto& GraphProto::initializer(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.initializer)
-  return initializer_.Get(index);
-}
 inline ::opencv_onnx::TensorProto* GraphProto::mutable_initializer(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.GraphProto.initializer)
   return initializer_.Mutable(index);
 }
-inline ::opencv_onnx::TensorProto* GraphProto::add_initializer() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.initializer)
-  return initializer_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto >*
 GraphProto::mutable_initializer() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.GraphProto.initializer)
   return &initializer_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorProto >&
+inline const ::opencv_onnx::TensorProto& GraphProto::_internal_initializer(int index) const {
+  return initializer_.Get(index);
+}
+inline const ::opencv_onnx::TensorProto& GraphProto::initializer(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.initializer)
+  return _internal_initializer(index);
+}
+inline ::opencv_onnx::TensorProto* GraphProto::_internal_add_initializer() {
+  return initializer_.Add();
+}
+inline ::opencv_onnx::TensorProto* GraphProto::add_initializer() {
+  ::opencv_onnx::TensorProto* _add = _internal_add_initializer();
+  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.initializer)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorProto >&
 GraphProto::initializer() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.GraphProto.initializer)
   return initializer_;
 }
 
 // optional string doc_string = 10;
-inline bool GraphProto::has_doc_string() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void GraphProto::set_has_doc_string() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool GraphProto::_internal_has_doc_string() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void GraphProto::clear_has_doc_string() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool GraphProto::has_doc_string() const {
+  return _internal_has_doc_string();
 }
 inline void GraphProto::clear_doc_string() {
-  doc_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_doc_string();
+  doc_string_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& GraphProto::doc_string() const {
+inline const std::string& GraphProto::doc_string() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.doc_string)
-  return doc_string_.GetNoArena();
+  return _internal_doc_string();
 }
-inline void GraphProto::set_doc_string(const ::std::string& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void GraphProto::set_doc_string(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.GraphProto.doc_string)
 }
-#if LANG_CXX11
-inline void GraphProto::set_doc_string(::std::string&& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.GraphProto.doc_string)
-}
-#endif
-inline void GraphProto::set_doc_string(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.GraphProto.doc_string)
-}
-inline void GraphProto::set_doc_string(const char* value, size_t size) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.GraphProto.doc_string)
-}
-inline ::std::string* GraphProto::mutable_doc_string() {
-  set_has_doc_string();
+inline std::string* GraphProto::mutable_doc_string() {
+  std::string* _s = _internal_mutable_doc_string();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.GraphProto.doc_string)
-  return doc_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& GraphProto::_internal_doc_string() const {
+  return doc_string_.Get();
+}
+inline void GraphProto::_internal_set_doc_string(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* GraphProto::release_doc_string() {
+inline std::string* GraphProto::_internal_mutable_doc_string() {
+  _has_bits_[0] |= 0x00000002u;
+  return doc_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* GraphProto::release_doc_string() {
   // @@protoc_insertion_point(field_release:opencv_onnx.GraphProto.doc_string)
-  clear_has_doc_string();
-  return doc_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_doc_string()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = doc_string_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void GraphProto::set_allocated_doc_string(::std::string* doc_string) {
-  if (doc_string != NULL) {
-    set_has_doc_string();
+inline void GraphProto::set_allocated_doc_string(std::string* doc_string) {
+  if (doc_string != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_doc_string();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  doc_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), doc_string,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  doc_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), doc_string);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.GraphProto.doc_string)
 }
 
 // repeated .opencv_onnx.ValueInfoProto input = 11;
-inline int GraphProto::input_size() const {
+inline int GraphProto::_internal_input_size() const {
   return input_.size();
 }
+inline int GraphProto::input_size() const {
+  return _internal_input_size();
+}
 inline void GraphProto::clear_input() {
   input_.Clear();
 }
-inline const ::opencv_onnx::ValueInfoProto& GraphProto::input(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.input)
-  return input_.Get(index);
-}
 inline ::opencv_onnx::ValueInfoProto* GraphProto::mutable_input(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.GraphProto.input)
   return input_.Mutable(index);
 }
-inline ::opencv_onnx::ValueInfoProto* GraphProto::add_input() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.input)
-  return input_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
 GraphProto::mutable_input() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.GraphProto.input)
   return &input_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
+inline const ::opencv_onnx::ValueInfoProto& GraphProto::_internal_input(int index) const {
+  return input_.Get(index);
+}
+inline const ::opencv_onnx::ValueInfoProto& GraphProto::input(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.input)
+  return _internal_input(index);
+}
+inline ::opencv_onnx::ValueInfoProto* GraphProto::_internal_add_input() {
+  return input_.Add();
+}
+inline ::opencv_onnx::ValueInfoProto* GraphProto::add_input() {
+  ::opencv_onnx::ValueInfoProto* _add = _internal_add_input();
+  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.input)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
 GraphProto::input() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.GraphProto.input)
   return input_;
 }
 
 // repeated .opencv_onnx.ValueInfoProto output = 12;
-inline int GraphProto::output_size() const {
+inline int GraphProto::_internal_output_size() const {
   return output_.size();
 }
+inline int GraphProto::output_size() const {
+  return _internal_output_size();
+}
 inline void GraphProto::clear_output() {
   output_.Clear();
 }
-inline const ::opencv_onnx::ValueInfoProto& GraphProto::output(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.output)
-  return output_.Get(index);
-}
 inline ::opencv_onnx::ValueInfoProto* GraphProto::mutable_output(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.GraphProto.output)
   return output_.Mutable(index);
 }
-inline ::opencv_onnx::ValueInfoProto* GraphProto::add_output() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.output)
-  return output_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
 GraphProto::mutable_output() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.GraphProto.output)
   return &output_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
+inline const ::opencv_onnx::ValueInfoProto& GraphProto::_internal_output(int index) const {
+  return output_.Get(index);
+}
+inline const ::opencv_onnx::ValueInfoProto& GraphProto::output(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.output)
+  return _internal_output(index);
+}
+inline ::opencv_onnx::ValueInfoProto* GraphProto::_internal_add_output() {
+  return output_.Add();
+}
+inline ::opencv_onnx::ValueInfoProto* GraphProto::add_output() {
+  ::opencv_onnx::ValueInfoProto* _add = _internal_add_output();
+  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.output)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
 GraphProto::output() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.GraphProto.output)
   return output_;
 }
 
 // repeated .opencv_onnx.ValueInfoProto value_info = 13;
-inline int GraphProto::value_info_size() const {
+inline int GraphProto::_internal_value_info_size() const {
   return value_info_.size();
 }
+inline int GraphProto::value_info_size() const {
+  return _internal_value_info_size();
+}
 inline void GraphProto::clear_value_info() {
   value_info_.Clear();
 }
-inline const ::opencv_onnx::ValueInfoProto& GraphProto::value_info(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.value_info)
-  return value_info_.Get(index);
-}
 inline ::opencv_onnx::ValueInfoProto* GraphProto::mutable_value_info(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.GraphProto.value_info)
   return value_info_.Mutable(index);
 }
-inline ::opencv_onnx::ValueInfoProto* GraphProto::add_value_info() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.value_info)
-  return value_info_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >*
 GraphProto::mutable_value_info() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.GraphProto.value_info)
   return &value_info_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
+inline const ::opencv_onnx::ValueInfoProto& GraphProto::_internal_value_info(int index) const {
+  return value_info_.Get(index);
+}
+inline const ::opencv_onnx::ValueInfoProto& GraphProto::value_info(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.GraphProto.value_info)
+  return _internal_value_info(index);
+}
+inline ::opencv_onnx::ValueInfoProto* GraphProto::_internal_add_value_info() {
+  return value_info_.Add();
+}
+inline ::opencv_onnx::ValueInfoProto* GraphProto::add_value_info() {
+  ::opencv_onnx::ValueInfoProto* _add = _internal_add_value_info();
+  // @@protoc_insertion_point(field_add:opencv_onnx.GraphProto.value_info)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::ValueInfoProto >&
 GraphProto::value_info() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.GraphProto.value_info)
   return value_info_;
@@ -4698,50 +6034,58 @@ GraphProto::value_info() const {
 // TensorProto_Segment
 
 // optional int64 begin = 1;
-inline bool TensorProto_Segment::has_begin() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool TensorProto_Segment::_internal_has_begin() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void TensorProto_Segment::set_has_begin() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool TensorProto_Segment::has_begin() const {
+  return _internal_has_begin();
 }
-inline void TensorProto_Segment::clear_has_begin() {
+inline void TensorProto_Segment::clear_begin() {
+  begin_ = int64_t{0};
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void TensorProto_Segment::clear_begin() {
-  begin_ = GOOGLE_LONGLONG(0);
-  clear_has_begin();
+inline int64_t TensorProto_Segment::_internal_begin() const {
+  return begin_;
 }
-inline ::google::protobuf::int64 TensorProto_Segment::begin() const {
+inline int64_t TensorProto_Segment::begin() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.Segment.begin)
-  return begin_;
+  return _internal_begin();
 }
-inline void TensorProto_Segment::set_begin(::google::protobuf::int64 value) {
-  set_has_begin();
+inline void TensorProto_Segment::_internal_set_begin(int64_t value) {
+  _has_bits_[0] |= 0x00000001u;
   begin_ = value;
+}
+inline void TensorProto_Segment::set_begin(int64_t value) {
+  _internal_set_begin(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.Segment.begin)
 }
 
 // optional int64 end = 2;
-inline bool TensorProto_Segment::has_end() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool TensorProto_Segment::_internal_has_end() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void TensorProto_Segment::set_has_end() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool TensorProto_Segment::has_end() const {
+  return _internal_has_end();
 }
-inline void TensorProto_Segment::clear_has_end() {
+inline void TensorProto_Segment::clear_end() {
+  end_ = int64_t{0};
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void TensorProto_Segment::clear_end() {
-  end_ = GOOGLE_LONGLONG(0);
-  clear_has_end();
+inline int64_t TensorProto_Segment::_internal_end() const {
+  return end_;
 }
-inline ::google::protobuf::int64 TensorProto_Segment::end() const {
+inline int64_t TensorProto_Segment::end() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.Segment.end)
-  return end_;
+  return _internal_end();
 }
-inline void TensorProto_Segment::set_end(::google::protobuf::int64 value) {
-  set_has_end();
+inline void TensorProto_Segment::_internal_set_end(int64_t value) {
+  _has_bits_[0] |= 0x00000002u;
   end_ = value;
+}
+inline void TensorProto_Segment::set_end(int64_t value) {
+  _internal_set_end(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.Segment.end)
 }
 
@@ -4750,201 +6094,301 @@ inline void TensorProto_Segment::set_end(::google::protobuf::int64 value) {
 // TensorProto
 
 // repeated int64 dims = 1;
-inline int TensorProto::dims_size() const {
+inline int TensorProto::_internal_dims_size() const {
   return dims_.size();
 }
+inline int TensorProto::dims_size() const {
+  return _internal_dims_size();
+}
 inline void TensorProto::clear_dims() {
   dims_.Clear();
 }
-inline ::google::protobuf::int64 TensorProto::dims(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.dims)
+inline int64_t TensorProto::_internal_dims(int index) const {
   return dims_.Get(index);
 }
-inline void TensorProto::set_dims(int index, ::google::protobuf::int64 value) {
+inline int64_t TensorProto::dims(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.dims)
+  return _internal_dims(index);
+}
+inline void TensorProto::set_dims(int index, int64_t value) {
   dims_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.dims)
 }
-inline void TensorProto::add_dims(::google::protobuf::int64 value) {
+inline void TensorProto::_internal_add_dims(int64_t value) {
   dims_.Add(value);
+}
+inline void TensorProto::add_dims(int64_t value) {
+  _internal_add_dims(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.TensorProto.dims)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+TensorProto::_internal_dims() const {
+  return dims_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
 TensorProto::dims() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.TensorProto.dims)
-  return dims_;
+  return _internal_dims();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+TensorProto::_internal_mutable_dims() {
+  return &dims_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
 TensorProto::mutable_dims() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.TensorProto.dims)
-  return &dims_;
+  return _internal_mutable_dims();
 }
 
 // optional .opencv_onnx.TensorProto.DataType data_type = 2;
-inline bool TensorProto::has_data_type() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
-}
-inline void TensorProto::set_has_data_type() {
-  _has_bits_[0] |= 0x00000010u;
+inline bool TensorProto::_internal_has_data_type() const {
+  bool value = (_has_bits_[0] & 0x00000010u) != 0;
+  return value;
 }
-inline void TensorProto::clear_has_data_type() {
-  _has_bits_[0] &= ~0x00000010u;
+inline bool TensorProto::has_data_type() const {
+  return _internal_has_data_type();
 }
 inline void TensorProto::clear_data_type() {
   data_type_ = 0;
-  clear_has_data_type();
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline ::opencv_onnx::TensorProto_DataType TensorProto::_internal_data_type() const {
+  return static_cast< ::opencv_onnx::TensorProto_DataType >(data_type_);
 }
 inline ::opencv_onnx::TensorProto_DataType TensorProto::data_type() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.data_type)
-  return static_cast< ::opencv_onnx::TensorProto_DataType >(data_type_);
+  return _internal_data_type();
 }
-inline void TensorProto::set_data_type(::opencv_onnx::TensorProto_DataType value) {
+inline void TensorProto::_internal_set_data_type(::opencv_onnx::TensorProto_DataType value) {
   assert(::opencv_onnx::TensorProto_DataType_IsValid(value));
-  set_has_data_type();
+  _has_bits_[0] |= 0x00000010u;
   data_type_ = value;
+}
+inline void TensorProto::set_data_type(::opencv_onnx::TensorProto_DataType value) {
+  _internal_set_data_type(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.data_type)
 }
 
 // optional .opencv_onnx.TensorProto.Segment segment = 3;
-inline bool TensorProto::has_segment() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+inline bool TensorProto::_internal_has_segment() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  PROTOBUF_ASSUME(!value || segment_ != nullptr);
+  return value;
 }
-inline void TensorProto::set_has_segment() {
-  _has_bits_[0] |= 0x00000008u;
+inline bool TensorProto::has_segment() const {
+  return _internal_has_segment();
 }
-inline void TensorProto::clear_has_segment() {
+inline void TensorProto::clear_segment() {
+  if (segment_ != nullptr) segment_->Clear();
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void TensorProto::clear_segment() {
-  if (segment_ != NULL) segment_->Clear();
-  clear_has_segment();
+inline const ::opencv_onnx::TensorProto_Segment& TensorProto::_internal_segment() const {
+  const ::opencv_onnx::TensorProto_Segment* p = segment_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_onnx::TensorProto_Segment&>(
+      ::opencv_onnx::_TensorProto_Segment_default_instance_);
 }
 inline const ::opencv_onnx::TensorProto_Segment& TensorProto::segment() const {
-  const ::opencv_onnx::TensorProto_Segment* p = segment_;
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.segment)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_onnx::TensorProto_Segment*>(
-      &::opencv_onnx::_TensorProto_Segment_default_instance_);
+  return _internal_segment();
+}
+inline void TensorProto::unsafe_arena_set_allocated_segment(
+    ::opencv_onnx::TensorProto_Segment* segment) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(segment_);
+  }
+  segment_ = segment;
+  if (segment) {
+    _has_bits_[0] |= 0x00000008u;
+  } else {
+    _has_bits_[0] &= ~0x00000008u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_onnx.TensorProto.segment)
 }
 inline ::opencv_onnx::TensorProto_Segment* TensorProto::release_segment() {
+  _has_bits_[0] &= ~0x00000008u;
+  ::opencv_onnx::TensorProto_Segment* temp = segment_;
+  segment_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_onnx::TensorProto_Segment* TensorProto::unsafe_arena_release_segment() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TensorProto.segment)
-  clear_has_segment();
+  _has_bits_[0] &= ~0x00000008u;
   ::opencv_onnx::TensorProto_Segment* temp = segment_;
-  segment_ = NULL;
+  segment_ = nullptr;
   return temp;
 }
-inline ::opencv_onnx::TensorProto_Segment* TensorProto::mutable_segment() {
-  set_has_segment();
-  if (segment_ == NULL) {
-    segment_ = new ::opencv_onnx::TensorProto_Segment;
+inline ::opencv_onnx::TensorProto_Segment* TensorProto::_internal_mutable_segment() {
+  _has_bits_[0] |= 0x00000008u;
+  if (segment_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_onnx::TensorProto_Segment>(GetArenaForAllocation());
+    segment_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorProto.segment)
   return segment_;
 }
+inline ::opencv_onnx::TensorProto_Segment* TensorProto::mutable_segment() {
+  ::opencv_onnx::TensorProto_Segment* _msg = _internal_mutable_segment();
+  // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorProto.segment)
+  return _msg;
+}
 inline void TensorProto::set_allocated_segment(::opencv_onnx::TensorProto_Segment* segment) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete segment_;
   }
   if (segment) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_onnx::TensorProto_Segment>::GetOwningArena(segment);
     if (message_arena != submessage_arena) {
-      segment = ::google::protobuf::internal::GetOwnedMessage(
+      segment = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, segment, submessage_arena);
     }
-    set_has_segment();
+    _has_bits_[0] |= 0x00000008u;
   } else {
-    clear_has_segment();
+    _has_bits_[0] &= ~0x00000008u;
   }
   segment_ = segment;
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TensorProto.segment)
 }
 
 // repeated float float_data = 4 [packed = true];
-inline int TensorProto::float_data_size() const {
+inline int TensorProto::_internal_float_data_size() const {
   return float_data_.size();
 }
+inline int TensorProto::float_data_size() const {
+  return _internal_float_data_size();
+}
 inline void TensorProto::clear_float_data() {
   float_data_.Clear();
 }
+inline float TensorProto::_internal_float_data(int index) const {
+  return float_data_.Get(index);
+}
 inline float TensorProto::float_data(int index) const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.float_data)
-  return float_data_.Get(index);
+  return _internal_float_data(index);
 }
 inline void TensorProto::set_float_data(int index, float value) {
   float_data_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.float_data)
 }
-inline void TensorProto::add_float_data(float value) {
+inline void TensorProto::_internal_add_float_data(float value) {
   float_data_.Add(value);
+}
+inline void TensorProto::add_float_data(float value) {
+  _internal_add_float_data(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.TensorProto.float_data)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+TensorProto::_internal_float_data() const {
+  return float_data_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 TensorProto::float_data() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.TensorProto.float_data)
-  return float_data_;
+  return _internal_float_data();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+TensorProto::_internal_mutable_float_data() {
+  return &float_data_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 TensorProto::mutable_float_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.TensorProto.float_data)
-  return &float_data_;
+  return _internal_mutable_float_data();
 }
 
 // repeated int32 int32_data = 5 [packed = true];
-inline int TensorProto::int32_data_size() const {
+inline int TensorProto::_internal_int32_data_size() const {
   return int32_data_.size();
 }
+inline int TensorProto::int32_data_size() const {
+  return _internal_int32_data_size();
+}
 inline void TensorProto::clear_int32_data() {
   int32_data_.Clear();
 }
-inline ::google::protobuf::int32 TensorProto::int32_data(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.int32_data)
+inline int32_t TensorProto::_internal_int32_data(int index) const {
   return int32_data_.Get(index);
 }
-inline void TensorProto::set_int32_data(int index, ::google::protobuf::int32 value) {
+inline int32_t TensorProto::int32_data(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.int32_data)
+  return _internal_int32_data(index);
+}
+inline void TensorProto::set_int32_data(int index, int32_t value) {
   int32_data_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.int32_data)
 }
-inline void TensorProto::add_int32_data(::google::protobuf::int32 value) {
+inline void TensorProto::_internal_add_int32_data(int32_t value) {
   int32_data_.Add(value);
+}
+inline void TensorProto::add_int32_data(int32_t value) {
+  _internal_add_int32_data(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.TensorProto.int32_data)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+TensorProto::_internal_int32_data() const {
+  return int32_data_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 TensorProto::int32_data() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.TensorProto.int32_data)
-  return int32_data_;
+  return _internal_int32_data();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+TensorProto::_internal_mutable_int32_data() {
+  return &int32_data_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 TensorProto::mutable_int32_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.TensorProto.int32_data)
-  return &int32_data_;
+  return _internal_mutable_int32_data();
 }
 
 // repeated bytes string_data = 6;
-inline int TensorProto::string_data_size() const {
+inline int TensorProto::_internal_string_data_size() const {
   return string_data_.size();
 }
+inline int TensorProto::string_data_size() const {
+  return _internal_string_data_size();
+}
 inline void TensorProto::clear_string_data() {
   string_data_.Clear();
 }
-inline const ::std::string& TensorProto::string_data(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.string_data)
+inline std::string* TensorProto::add_string_data() {
+  std::string* _s = _internal_add_string_data();
+  // @@protoc_insertion_point(field_add_mutable:opencv_onnx.TensorProto.string_data)
+  return _s;
+}
+inline const std::string& TensorProto::_internal_string_data(int index) const {
   return string_data_.Get(index);
 }
-inline ::std::string* TensorProto::mutable_string_data(int index) {
+inline const std::string& TensorProto::string_data(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.string_data)
+  return _internal_string_data(index);
+}
+inline std::string* TensorProto::mutable_string_data(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorProto.string_data)
   return string_data_.Mutable(index);
 }
-inline void TensorProto::set_string_data(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.string_data)
+inline void TensorProto::set_string_data(int index, const std::string& value) {
   string_data_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void TensorProto::set_string_data(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.string_data)
+}
+inline void TensorProto::set_string_data(int index, std::string&& value) {
   string_data_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.string_data)
 }
-#endif
 inline void TensorProto::set_string_data(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   string_data_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_onnx.TensorProto.string_data)
 }
@@ -4953,22 +6397,19 @@ inline void TensorProto::set_string_data(int index, const void* value, size_t si
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_onnx.TensorProto.string_data)
 }
-inline ::std::string* TensorProto::add_string_data() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_onnx.TensorProto.string_data)
+inline std::string* TensorProto::_internal_add_string_data() {
   return string_data_.Add();
 }
-inline void TensorProto::add_string_data(const ::std::string& value) {
+inline void TensorProto::add_string_data(const std::string& value) {
   string_data_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.TensorProto.string_data)
 }
-#if LANG_CXX11
-inline void TensorProto::add_string_data(::std::string&& value) {
+inline void TensorProto::add_string_data(std::string&& value) {
   string_data_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_onnx.TensorProto.string_data)
 }
-#endif
 inline void TensorProto::add_string_data(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   string_data_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_onnx.TensorProto.string_data)
 }
@@ -4976,484 +6417,555 @@ inline void TensorProto::add_string_data(const void* value, size_t size) {
   string_data_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_onnx.TensorProto.string_data)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 TensorProto::string_data() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.TensorProto.string_data)
   return string_data_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 TensorProto::mutable_string_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.TensorProto.string_data)
   return &string_data_;
 }
 
 // repeated int64 int64_data = 7 [packed = true];
-inline int TensorProto::int64_data_size() const {
+inline int TensorProto::_internal_int64_data_size() const {
   return int64_data_.size();
 }
+inline int TensorProto::int64_data_size() const {
+  return _internal_int64_data_size();
+}
 inline void TensorProto::clear_int64_data() {
   int64_data_.Clear();
 }
-inline ::google::protobuf::int64 TensorProto::int64_data(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.int64_data)
+inline int64_t TensorProto::_internal_int64_data(int index) const {
   return int64_data_.Get(index);
 }
-inline void TensorProto::set_int64_data(int index, ::google::protobuf::int64 value) {
+inline int64_t TensorProto::int64_data(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.int64_data)
+  return _internal_int64_data(index);
+}
+inline void TensorProto::set_int64_data(int index, int64_t value) {
   int64_data_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.int64_data)
 }
-inline void TensorProto::add_int64_data(::google::protobuf::int64 value) {
+inline void TensorProto::_internal_add_int64_data(int64_t value) {
   int64_data_.Add(value);
+}
+inline void TensorProto::add_int64_data(int64_t value) {
+  _internal_add_int64_data(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.TensorProto.int64_data)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+TensorProto::_internal_int64_data() const {
+  return int64_data_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
 TensorProto::int64_data() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.TensorProto.int64_data)
-  return int64_data_;
+  return _internal_int64_data();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+TensorProto::_internal_mutable_int64_data() {
+  return &int64_data_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
 TensorProto::mutable_int64_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.TensorProto.int64_data)
-  return &int64_data_;
+  return _internal_mutable_int64_data();
 }
 
 // optional string name = 8;
-inline bool TensorProto::has_name() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void TensorProto::set_has_name() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool TensorProto::_internal_has_name() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void TensorProto::clear_has_name() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool TensorProto::has_name() const {
+  return _internal_has_name();
 }
 inline void TensorProto::clear_name() {
-  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_name();
+  name_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& TensorProto::name() const {
+inline const std::string& TensorProto::name() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.name)
-  return name_.GetNoArena();
+  return _internal_name();
 }
-inline void TensorProto::set_name(const ::std::string& value) {
-  set_has_name();
-  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TensorProto::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.name)
 }
-#if LANG_CXX11
-inline void TensorProto::set_name(::std::string&& value) {
-  set_has_name();
-  name_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.TensorProto.name)
-}
-#endif
-inline void TensorProto::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:opencv_onnx.TensorProto.name)
-}
-inline void TensorProto::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:opencv_onnx.TensorProto.name)
-}
-inline ::std::string* TensorProto::mutable_name() {
-  set_has_name();
+inline std::string* TensorProto::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorProto.name)
-  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& TensorProto::_internal_name() const {
+  return name_.Get();
+}
+inline void TensorProto::_internal_set_name(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* TensorProto::release_name() {
+inline std::string* TensorProto::_internal_mutable_name() {
+  _has_bits_[0] |= 0x00000001u;
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* TensorProto::release_name() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TensorProto.name)
-  clear_has_name();
-  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_name()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void TensorProto::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
-    set_has_name();
+inline void TensorProto::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_name();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TensorProto.name)
 }
 
 // optional string doc_string = 12;
-inline bool TensorProto::has_doc_string() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
-}
-inline void TensorProto::set_has_doc_string() {
-  _has_bits_[0] |= 0x00000004u;
+inline bool TensorProto::_internal_has_doc_string() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
 }
-inline void TensorProto::clear_has_doc_string() {
-  _has_bits_[0] &= ~0x00000004u;
+inline bool TensorProto::has_doc_string() const {
+  return _internal_has_doc_string();
 }
 inline void TensorProto::clear_doc_string() {
-  doc_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_doc_string();
+  doc_string_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000004u;
 }
-inline const ::std::string& TensorProto::doc_string() const {
+inline const std::string& TensorProto::doc_string() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.doc_string)
-  return doc_string_.GetNoArena();
+  return _internal_doc_string();
 }
-inline void TensorProto::set_doc_string(const ::std::string& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TensorProto::set_doc_string(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.doc_string)
 }
-#if LANG_CXX11
-inline void TensorProto::set_doc_string(::std::string&& value) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.TensorProto.doc_string)
-}
-#endif
-inline void TensorProto::set_doc_string(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.TensorProto.doc_string)
-}
-inline void TensorProto::set_doc_string(const char* value, size_t size) {
-  set_has_doc_string();
-  doc_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.TensorProto.doc_string)
-}
-inline ::std::string* TensorProto::mutable_doc_string() {
-  set_has_doc_string();
+inline std::string* TensorProto::mutable_doc_string() {
+  std::string* _s = _internal_mutable_doc_string();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorProto.doc_string)
-  return doc_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& TensorProto::_internal_doc_string() const {
+  return doc_string_.Get();
+}
+inline void TensorProto::_internal_set_doc_string(const std::string& value) {
+  _has_bits_[0] |= 0x00000004u;
+  doc_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* TensorProto::_internal_mutable_doc_string() {
+  _has_bits_[0] |= 0x00000004u;
+  return doc_string_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* TensorProto::release_doc_string() {
+inline std::string* TensorProto::release_doc_string() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TensorProto.doc_string)
-  clear_has_doc_string();
-  return doc_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_doc_string()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000004u;
+  auto* p = doc_string_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void TensorProto::set_allocated_doc_string(::std::string* doc_string) {
-  if (doc_string != NULL) {
-    set_has_doc_string();
+inline void TensorProto::set_allocated_doc_string(std::string* doc_string) {
+  if (doc_string != nullptr) {
+    _has_bits_[0] |= 0x00000004u;
   } else {
-    clear_has_doc_string();
+    _has_bits_[0] &= ~0x00000004u;
   }
-  doc_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), doc_string);
+  doc_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), doc_string,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (doc_string_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    doc_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TensorProto.doc_string)
 }
 
 // optional bytes raw_data = 9;
-inline bool TensorProto::has_raw_data() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool TensorProto::_internal_has_raw_data() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void TensorProto::set_has_raw_data() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void TensorProto::clear_has_raw_data() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool TensorProto::has_raw_data() const {
+  return _internal_has_raw_data();
 }
 inline void TensorProto::clear_raw_data() {
-  raw_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_raw_data();
+  raw_data_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::std::string& TensorProto::raw_data() const {
+inline const std::string& TensorProto::raw_data() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.raw_data)
-  return raw_data_.GetNoArena();
+  return _internal_raw_data();
 }
-inline void TensorProto::set_raw_data(const ::std::string& value) {
-  set_has_raw_data();
-  raw_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TensorProto::set_raw_data(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ raw_data_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.raw_data)
 }
-#if LANG_CXX11
-inline void TensorProto::set_raw_data(::std::string&& value) {
-  set_has_raw_data();
-  raw_data_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.TensorProto.raw_data)
-}
-#endif
-inline void TensorProto::set_raw_data(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_raw_data();
-  raw_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.TensorProto.raw_data)
-}
-inline void TensorProto::set_raw_data(const void* value, size_t size) {
-  set_has_raw_data();
-  raw_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.TensorProto.raw_data)
-}
-inline ::std::string* TensorProto::mutable_raw_data() {
-  set_has_raw_data();
+inline std::string* TensorProto::mutable_raw_data() {
+  std::string* _s = _internal_mutable_raw_data();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorProto.raw_data)
-  return raw_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& TensorProto::_internal_raw_data() const {
+  return raw_data_.Get();
 }
-inline ::std::string* TensorProto::release_raw_data() {
+inline void TensorProto::_internal_set_raw_data(const std::string& value) {
+  _has_bits_[0] |= 0x00000002u;
+  raw_data_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* TensorProto::_internal_mutable_raw_data() {
+  _has_bits_[0] |= 0x00000002u;
+  return raw_data_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* TensorProto::release_raw_data() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TensorProto.raw_data)
-  clear_has_raw_data();
-  return raw_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_raw_data()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000002u;
+  auto* p = raw_data_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (raw_data_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    raw_data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void TensorProto::set_allocated_raw_data(::std::string* raw_data) {
-  if (raw_data != NULL) {
-    set_has_raw_data();
+inline void TensorProto::set_allocated_raw_data(std::string* raw_data) {
+  if (raw_data != nullptr) {
+    _has_bits_[0] |= 0x00000002u;
   } else {
-    clear_has_raw_data();
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  raw_data_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), raw_data,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (raw_data_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    raw_data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  raw_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), raw_data);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TensorProto.raw_data)
 }
 
 // repeated double double_data = 10 [packed = true];
-inline int TensorProto::double_data_size() const {
+inline int TensorProto::_internal_double_data_size() const {
   return double_data_.size();
 }
+inline int TensorProto::double_data_size() const {
+  return _internal_double_data_size();
+}
 inline void TensorProto::clear_double_data() {
   double_data_.Clear();
 }
+inline double TensorProto::_internal_double_data(int index) const {
+  return double_data_.Get(index);
+}
 inline double TensorProto::double_data(int index) const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.double_data)
-  return double_data_.Get(index);
+  return _internal_double_data(index);
 }
 inline void TensorProto::set_double_data(int index, double value) {
   double_data_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.double_data)
 }
-inline void TensorProto::add_double_data(double value) {
+inline void TensorProto::_internal_add_double_data(double value) {
   double_data_.Add(value);
+}
+inline void TensorProto::add_double_data(double value) {
+  _internal_add_double_data(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.TensorProto.double_data)
 }
-inline const ::google::protobuf::RepeatedField< double >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+TensorProto::_internal_double_data() const {
+  return double_data_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
 TensorProto::double_data() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.TensorProto.double_data)
-  return double_data_;
+  return _internal_double_data();
 }
-inline ::google::protobuf::RepeatedField< double >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+TensorProto::_internal_mutable_double_data() {
+  return &double_data_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
 TensorProto::mutable_double_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.TensorProto.double_data)
-  return &double_data_;
+  return _internal_mutable_double_data();
 }
 
 // repeated uint64 uint64_data = 11 [packed = true];
-inline int TensorProto::uint64_data_size() const {
+inline int TensorProto::_internal_uint64_data_size() const {
   return uint64_data_.size();
 }
+inline int TensorProto::uint64_data_size() const {
+  return _internal_uint64_data_size();
+}
 inline void TensorProto::clear_uint64_data() {
   uint64_data_.Clear();
 }
-inline ::google::protobuf::uint64 TensorProto::uint64_data(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.uint64_data)
+inline uint64_t TensorProto::_internal_uint64_data(int index) const {
   return uint64_data_.Get(index);
 }
-inline void TensorProto::set_uint64_data(int index, ::google::protobuf::uint64 value) {
+inline uint64_t TensorProto::uint64_data(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.TensorProto.uint64_data)
+  return _internal_uint64_data(index);
+}
+inline void TensorProto::set_uint64_data(int index, uint64_t value) {
   uint64_data_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorProto.uint64_data)
 }
-inline void TensorProto::add_uint64_data(::google::protobuf::uint64 value) {
+inline void TensorProto::_internal_add_uint64_data(uint64_t value) {
   uint64_data_.Add(value);
+}
+inline void TensorProto::add_uint64_data(uint64_t value) {
+  _internal_add_uint64_data(value);
   // @@protoc_insertion_point(field_add:opencv_onnx.TensorProto.uint64_data)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >&
+TensorProto::_internal_uint64_data() const {
+  return uint64_data_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >&
 TensorProto::uint64_data() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.TensorProto.uint64_data)
-  return uint64_data_;
+  return _internal_uint64_data();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >*
+TensorProto::_internal_mutable_uint64_data() {
+  return &uint64_data_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >*
 TensorProto::mutable_uint64_data() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.TensorProto.uint64_data)
-  return &uint64_data_;
+  return _internal_mutable_uint64_data();
 }
 
 // -------------------------------------------------------------------
 
 // TensorShapeProto_Dimension
 
-// optional int64 dim_value = 1;
-inline bool TensorShapeProto_Dimension::has_dim_value() const {
+// int64 dim_value = 1;
+inline bool TensorShapeProto_Dimension::_internal_has_dim_value() const {
   return value_case() == kDimValue;
 }
+inline bool TensorShapeProto_Dimension::has_dim_value() const {
+  return _internal_has_dim_value();
+}
 inline void TensorShapeProto_Dimension::set_has_dim_value() {
   _oneof_case_[0] = kDimValue;
 }
 inline void TensorShapeProto_Dimension::clear_dim_value() {
-  if (has_dim_value()) {
-    value_.dim_value_ = GOOGLE_LONGLONG(0);
+  if (_internal_has_dim_value()) {
+    value_.dim_value_ = int64_t{0};
     clear_has_value();
   }
 }
-inline ::google::protobuf::int64 TensorShapeProto_Dimension::dim_value() const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.TensorShapeProto.Dimension.dim_value)
-  if (has_dim_value()) {
+inline int64_t TensorShapeProto_Dimension::_internal_dim_value() const {
+  if (_internal_has_dim_value()) {
     return value_.dim_value_;
   }
-  return GOOGLE_LONGLONG(0);
+  return int64_t{0};
 }
-inline void TensorShapeProto_Dimension::set_dim_value(::google::protobuf::int64 value) {
-  if (!has_dim_value()) {
+inline void TensorShapeProto_Dimension::_internal_set_dim_value(int64_t value) {
+  if (!_internal_has_dim_value()) {
     clear_value();
     set_has_dim_value();
   }
   value_.dim_value_ = value;
+}
+inline int64_t TensorShapeProto_Dimension::dim_value() const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.TensorShapeProto.Dimension.dim_value)
+  return _internal_dim_value();
+}
+inline void TensorShapeProto_Dimension::set_dim_value(int64_t value) {
+  _internal_set_dim_value(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorShapeProto.Dimension.dim_value)
 }
 
-// optional string dim_param = 2;
-inline bool TensorShapeProto_Dimension::has_dim_param() const {
+// string dim_param = 2;
+inline bool TensorShapeProto_Dimension::_internal_has_dim_param() const {
   return value_case() == kDimParam;
 }
+inline bool TensorShapeProto_Dimension::has_dim_param() const {
+  return _internal_has_dim_param();
+}
 inline void TensorShapeProto_Dimension::set_has_dim_param() {
   _oneof_case_[0] = kDimParam;
 }
 inline void TensorShapeProto_Dimension::clear_dim_param() {
-  if (has_dim_param()) {
-    value_.dim_param_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (_internal_has_dim_param()) {
+    value_.dim_param_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
     clear_has_value();
   }
 }
-inline const ::std::string& TensorShapeProto_Dimension::dim_param() const {
+inline const std::string& TensorShapeProto_Dimension::dim_param() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorShapeProto.Dimension.dim_param)
-  if (has_dim_param()) {
-    return value_.dim_param_.GetNoArena();
-  }
-  return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
+  return _internal_dim_param();
 }
-inline void TensorShapeProto_Dimension::set_dim_param(const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_onnx.TensorShapeProto.Dimension.dim_param)
-  if (!has_dim_param()) {
+template <typename ArgT0, typename... ArgT>
+inline void TensorShapeProto_Dimension::set_dim_param(ArgT0&& arg0, ArgT... args) {
+  if (!_internal_has_dim_param()) {
     clear_value();
     set_has_dim_param();
-    value_.dim_param_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.dim_param_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  value_.dim_param_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  value_.dim_param_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorShapeProto.Dimension.dim_param)
 }
-#if LANG_CXX11
-inline void TensorShapeProto_Dimension::set_dim_param(::std::string&& value) {
-  // @@protoc_insertion_point(field_set:opencv_onnx.TensorShapeProto.Dimension.dim_param)
-  if (!has_dim_param()) {
-    clear_value();
-    set_has_dim_param();
-    value_.dim_param_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  }
-  value_.dim_param_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.TensorShapeProto.Dimension.dim_param)
+inline std::string* TensorShapeProto_Dimension::mutable_dim_param() {
+  std::string* _s = _internal_mutable_dim_param();
+  // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorShapeProto.Dimension.dim_param)
+  return _s;
 }
-#endif
-inline void TensorShapeProto_Dimension::set_dim_param(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  if (!has_dim_param()) {
-    clear_value();
-    set_has_dim_param();
-    value_.dim_param_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline const std::string& TensorShapeProto_Dimension::_internal_dim_param() const {
+  if (_internal_has_dim_param()) {
+    return value_.dim_param_.Get();
   }
-  value_.dim_param_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.TensorShapeProto.Dimension.dim_param)
+  return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited();
 }
-inline void TensorShapeProto_Dimension::set_dim_param(const char* value, size_t size) {
-  if (!has_dim_param()) {
+inline void TensorShapeProto_Dimension::_internal_set_dim_param(const std::string& value) {
+  if (!_internal_has_dim_param()) {
     clear_value();
     set_has_dim_param();
-    value_.dim_param_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.dim_param_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  value_.dim_param_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.TensorShapeProto.Dimension.dim_param)
+  value_.dim_param_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* TensorShapeProto_Dimension::mutable_dim_param() {
-  if (!has_dim_param()) {
+inline std::string* TensorShapeProto_Dimension::_internal_mutable_dim_param() {
+  if (!_internal_has_dim_param()) {
     clear_value();
     set_has_dim_param();
-    value_.dim_param_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.dim_param_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorShapeProto.Dimension.dim_param)
-  return value_.dim_param_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return value_.dim_param_.Mutable(
+      ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* TensorShapeProto_Dimension::release_dim_param() {
+inline std::string* TensorShapeProto_Dimension::release_dim_param() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TensorShapeProto.Dimension.dim_param)
-  if (has_dim_param()) {
+  if (_internal_has_dim_param()) {
     clear_has_value();
-    return value_.dim_param_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    return value_.dim_param_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
   } else {
-    return NULL;
+    return nullptr;
   }
 }
-inline void TensorShapeProto_Dimension::set_allocated_dim_param(::std::string* dim_param) {
-  if (!has_dim_param()) {
-    value_.dim_param_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void TensorShapeProto_Dimension::set_allocated_dim_param(std::string* dim_param) {
+  if (has_value()) {
+    clear_value();
   }
-  clear_value();
-  if (dim_param != NULL) {
+  if (dim_param != nullptr) {
     set_has_dim_param();
-    value_.dim_param_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-        dim_param);
+    value_.dim_param_.UnsafeSetDefault(dim_param);
+    ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaForAllocation();
+    if (arena != nullptr) {
+      arena->Own(dim_param);
+    }
   }
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TensorShapeProto.Dimension.dim_param)
 }
 
 // optional string denotation = 3;
-inline bool TensorShapeProto_Dimension::has_denotation() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void TensorShapeProto_Dimension::set_has_denotation() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool TensorShapeProto_Dimension::_internal_has_denotation() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void TensorShapeProto_Dimension::clear_has_denotation() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool TensorShapeProto_Dimension::has_denotation() const {
+  return _internal_has_denotation();
 }
 inline void TensorShapeProto_Dimension::clear_denotation() {
-  denotation_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_denotation();
+  denotation_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& TensorShapeProto_Dimension::denotation() const {
+inline const std::string& TensorShapeProto_Dimension::denotation() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TensorShapeProto.Dimension.denotation)
-  return denotation_.GetNoArena();
+  return _internal_denotation();
 }
-inline void TensorShapeProto_Dimension::set_denotation(const ::std::string& value) {
-  set_has_denotation();
-  denotation_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TensorShapeProto_Dimension::set_denotation(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ denotation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.TensorShapeProto.Dimension.denotation)
 }
-#if LANG_CXX11
-inline void TensorShapeProto_Dimension::set_denotation(::std::string&& value) {
-  set_has_denotation();
-  denotation_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.TensorShapeProto.Dimension.denotation)
-}
-#endif
-inline void TensorShapeProto_Dimension::set_denotation(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_denotation();
-  denotation_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.TensorShapeProto.Dimension.denotation)
-}
-inline void TensorShapeProto_Dimension::set_denotation(const char* value, size_t size) {
-  set_has_denotation();
-  denotation_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.TensorShapeProto.Dimension.denotation)
-}
-inline ::std::string* TensorShapeProto_Dimension::mutable_denotation() {
-  set_has_denotation();
+inline std::string* TensorShapeProto_Dimension::mutable_denotation() {
+  std::string* _s = _internal_mutable_denotation();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorShapeProto.Dimension.denotation)
-  return denotation_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& TensorShapeProto_Dimension::_internal_denotation() const {
+  return denotation_.Get();
+}
+inline void TensorShapeProto_Dimension::_internal_set_denotation(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  denotation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* TensorShapeProto_Dimension::_internal_mutable_denotation() {
+  _has_bits_[0] |= 0x00000001u;
+  return denotation_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* TensorShapeProto_Dimension::release_denotation() {
+inline std::string* TensorShapeProto_Dimension::release_denotation() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TensorShapeProto.Dimension.denotation)
-  clear_has_denotation();
-  return denotation_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_denotation()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = denotation_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (denotation_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    denotation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void TensorShapeProto_Dimension::set_allocated_denotation(::std::string* denotation) {
-  if (denotation != NULL) {
-    set_has_denotation();
+inline void TensorShapeProto_Dimension::set_allocated_denotation(std::string* denotation) {
+  if (denotation != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_denotation();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  denotation_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), denotation);
+  denotation_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), denotation,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (denotation_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    denotation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TensorShapeProto.Dimension.denotation)
 }
 
@@ -5471,30 +6983,40 @@ inline TensorShapeProto_Dimension::ValueCase TensorShapeProto_Dimension::value_c
 // TensorShapeProto
 
 // repeated .opencv_onnx.TensorShapeProto.Dimension dim = 1;
-inline int TensorShapeProto::dim_size() const {
+inline int TensorShapeProto::_internal_dim_size() const {
   return dim_.size();
 }
+inline int TensorShapeProto::dim_size() const {
+  return _internal_dim_size();
+}
 inline void TensorShapeProto::clear_dim() {
   dim_.Clear();
 }
-inline const ::opencv_onnx::TensorShapeProto_Dimension& TensorShapeProto::dim(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_onnx.TensorShapeProto.dim)
-  return dim_.Get(index);
-}
 inline ::opencv_onnx::TensorShapeProto_Dimension* TensorShapeProto::mutable_dim(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_onnx.TensorShapeProto.dim)
   return dim_.Mutable(index);
 }
-inline ::opencv_onnx::TensorShapeProto_Dimension* TensorShapeProto::add_dim() {
-  // @@protoc_insertion_point(field_add:opencv_onnx.TensorShapeProto.dim)
-  return dim_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension >*
 TensorShapeProto::mutable_dim() {
   // @@protoc_insertion_point(field_mutable_list:opencv_onnx.TensorShapeProto.dim)
   return &dim_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension >&
+inline const ::opencv_onnx::TensorShapeProto_Dimension& TensorShapeProto::_internal_dim(int index) const {
+  return dim_.Get(index);
+}
+inline const ::opencv_onnx::TensorShapeProto_Dimension& TensorShapeProto::dim(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_onnx.TensorShapeProto.dim)
+  return _internal_dim(index);
+}
+inline ::opencv_onnx::TensorShapeProto_Dimension* TensorShapeProto::_internal_add_dim() {
+  return dim_.Add();
+}
+inline ::opencv_onnx::TensorShapeProto_Dimension* TensorShapeProto::add_dim() {
+  ::opencv_onnx::TensorShapeProto_Dimension* _add = _internal_add_dim();
+  // @@protoc_insertion_point(field_add:opencv_onnx.TensorShapeProto.dim)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_onnx::TensorShapeProto_Dimension >&
 TensorShapeProto::dim() const {
   // @@protoc_insertion_point(field_list:opencv_onnx.TensorShapeProto.dim)
   return dim_;
@@ -5505,79 +7027,119 @@ TensorShapeProto::dim() const {
 // TypeProto_Tensor
 
 // optional .opencv_onnx.TensorProto.DataType elem_type = 1;
-inline bool TypeProto_Tensor::has_elem_type() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void TypeProto_Tensor::set_has_elem_type() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool TypeProto_Tensor::_internal_has_elem_type() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void TypeProto_Tensor::clear_has_elem_type() {
-  _has_bits_[0] &= ~0x00000002u;
+inline bool TypeProto_Tensor::has_elem_type() const {
+  return _internal_has_elem_type();
 }
 inline void TypeProto_Tensor::clear_elem_type() {
   elem_type_ = 0;
-  clear_has_elem_type();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::opencv_onnx::TensorProto_DataType TypeProto_Tensor::_internal_elem_type() const {
+  return static_cast< ::opencv_onnx::TensorProto_DataType >(elem_type_);
 }
 inline ::opencv_onnx::TensorProto_DataType TypeProto_Tensor::elem_type() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TypeProto.Tensor.elem_type)
-  return static_cast< ::opencv_onnx::TensorProto_DataType >(elem_type_);
+  return _internal_elem_type();
 }
-inline void TypeProto_Tensor::set_elem_type(::opencv_onnx::TensorProto_DataType value) {
+inline void TypeProto_Tensor::_internal_set_elem_type(::opencv_onnx::TensorProto_DataType value) {
   assert(::opencv_onnx::TensorProto_DataType_IsValid(value));
-  set_has_elem_type();
+  _has_bits_[0] |= 0x00000002u;
   elem_type_ = value;
+}
+inline void TypeProto_Tensor::set_elem_type(::opencv_onnx::TensorProto_DataType value) {
+  _internal_set_elem_type(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.TypeProto.Tensor.elem_type)
 }
 
 // optional .opencv_onnx.TensorShapeProto shape = 2;
-inline bool TypeProto_Tensor::has_shape() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+inline bool TypeProto_Tensor::_internal_has_shape() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || shape_ != nullptr);
+  return value;
 }
-inline void TypeProto_Tensor::set_has_shape() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool TypeProto_Tensor::has_shape() const {
+  return _internal_has_shape();
 }
-inline void TypeProto_Tensor::clear_has_shape() {
+inline void TypeProto_Tensor::clear_shape() {
+  if (shape_ != nullptr) shape_->Clear();
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void TypeProto_Tensor::clear_shape() {
-  if (shape_ != NULL) shape_->Clear();
-  clear_has_shape();
+inline const ::opencv_onnx::TensorShapeProto& TypeProto_Tensor::_internal_shape() const {
+  const ::opencv_onnx::TensorShapeProto* p = shape_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_onnx::TensorShapeProto&>(
+      ::opencv_onnx::_TensorShapeProto_default_instance_);
 }
 inline const ::opencv_onnx::TensorShapeProto& TypeProto_Tensor::shape() const {
-  const ::opencv_onnx::TensorShapeProto* p = shape_;
   // @@protoc_insertion_point(field_get:opencv_onnx.TypeProto.Tensor.shape)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_onnx::TensorShapeProto*>(
-      &::opencv_onnx::_TensorShapeProto_default_instance_);
+  return _internal_shape();
+}
+inline void TypeProto_Tensor::unsafe_arena_set_allocated_shape(
+    ::opencv_onnx::TensorShapeProto* shape) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(shape_);
+  }
+  shape_ = shape;
+  if (shape) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_onnx.TypeProto.Tensor.shape)
 }
 inline ::opencv_onnx::TensorShapeProto* TypeProto_Tensor::release_shape() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::opencv_onnx::TensorShapeProto* temp = shape_;
+  shape_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
+  return temp;
+}
+inline ::opencv_onnx::TensorShapeProto* TypeProto_Tensor::unsafe_arena_release_shape() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TypeProto.Tensor.shape)
-  clear_has_shape();
+  _has_bits_[0] &= ~0x00000001u;
   ::opencv_onnx::TensorShapeProto* temp = shape_;
-  shape_ = NULL;
+  shape_ = nullptr;
   return temp;
 }
-inline ::opencv_onnx::TensorShapeProto* TypeProto_Tensor::mutable_shape() {
-  set_has_shape();
-  if (shape_ == NULL) {
-    shape_ = new ::opencv_onnx::TensorShapeProto;
+inline ::opencv_onnx::TensorShapeProto* TypeProto_Tensor::_internal_mutable_shape() {
+  _has_bits_[0] |= 0x00000001u;
+  if (shape_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_onnx::TensorShapeProto>(GetArenaForAllocation());
+    shape_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_onnx.TypeProto.Tensor.shape)
   return shape_;
 }
+inline ::opencv_onnx::TensorShapeProto* TypeProto_Tensor::mutable_shape() {
+  ::opencv_onnx::TensorShapeProto* _msg = _internal_mutable_shape();
+  // @@protoc_insertion_point(field_mutable:opencv_onnx.TypeProto.Tensor.shape)
+  return _msg;
+}
 inline void TypeProto_Tensor::set_allocated_shape(::opencv_onnx::TensorShapeProto* shape) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete shape_;
   }
   if (shape) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_onnx::TensorShapeProto>::GetOwningArena(shape);
     if (message_arena != submessage_arena) {
-      shape = ::google::protobuf::internal::GetOwnedMessage(
+      shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, shape, submessage_arena);
     }
-    set_has_shape();
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_shape();
+    _has_bits_[0] &= ~0x00000001u;
   }
   shape_ = shape;
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TypeProto.Tensor.shape)
@@ -5587,106 +7149,146 @@ inline void TypeProto_Tensor::set_allocated_shape(::opencv_onnx::TensorShapeProt
 
 // TypeProto
 
-// optional .opencv_onnx.TypeProto.Tensor tensor_type = 1;
-inline bool TypeProto::has_tensor_type() const {
+// .opencv_onnx.TypeProto.Tensor tensor_type = 1;
+inline bool TypeProto::_internal_has_tensor_type() const {
   return value_case() == kTensorType;
 }
+inline bool TypeProto::has_tensor_type() const {
+  return _internal_has_tensor_type();
+}
 inline void TypeProto::set_has_tensor_type() {
   _oneof_case_[0] = kTensorType;
 }
 inline void TypeProto::clear_tensor_type() {
-  if (has_tensor_type()) {
-    delete value_.tensor_type_;
+  if (_internal_has_tensor_type()) {
+    if (GetArenaForAllocation() == nullptr) {
+      delete value_.tensor_type_;
+    }
     clear_has_value();
   }
 }
 inline ::opencv_onnx::TypeProto_Tensor* TypeProto::release_tensor_type() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TypeProto.tensor_type)
-  if (has_tensor_type()) {
+  if (_internal_has_tensor_type()) {
     clear_has_value();
       ::opencv_onnx::TypeProto_Tensor* temp = value_.tensor_type_;
-    value_.tensor_type_ = NULL;
+    if (GetArenaForAllocation() != nullptr) {
+      temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+    }
+    value_.tensor_type_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
+inline const ::opencv_onnx::TypeProto_Tensor& TypeProto::_internal_tensor_type() const {
+  return _internal_has_tensor_type()
+      ? *value_.tensor_type_
+      : reinterpret_cast< ::opencv_onnx::TypeProto_Tensor&>(::opencv_onnx::_TypeProto_Tensor_default_instance_);
+}
 inline const ::opencv_onnx::TypeProto_Tensor& TypeProto::tensor_type() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TypeProto.tensor_type)
-  return has_tensor_type()
-      ? *value_.tensor_type_
-      : *reinterpret_cast< ::opencv_onnx::TypeProto_Tensor*>(&::opencv_onnx::_TypeProto_Tensor_default_instance_);
+  return _internal_tensor_type();
 }
-inline ::opencv_onnx::TypeProto_Tensor* TypeProto::mutable_tensor_type() {
-  if (!has_tensor_type()) {
+inline ::opencv_onnx::TypeProto_Tensor* TypeProto::unsafe_arena_release_tensor_type() {
+  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_onnx.TypeProto.tensor_type)
+  if (_internal_has_tensor_type()) {
+    clear_has_value();
+    ::opencv_onnx::TypeProto_Tensor* temp = value_.tensor_type_;
+    value_.tensor_type_ = nullptr;
+    return temp;
+  } else {
+    return nullptr;
+  }
+}
+inline void TypeProto::unsafe_arena_set_allocated_tensor_type(::opencv_onnx::TypeProto_Tensor* tensor_type) {
+  clear_value();
+  if (tensor_type) {
+    set_has_tensor_type();
+    value_.tensor_type_ = tensor_type;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_onnx.TypeProto.tensor_type)
+}
+inline ::opencv_onnx::TypeProto_Tensor* TypeProto::_internal_mutable_tensor_type() {
+  if (!_internal_has_tensor_type()) {
     clear_value();
     set_has_tensor_type();
-    value_.tensor_type_ = new ::opencv_onnx::TypeProto_Tensor;
+    value_.tensor_type_ = CreateMaybeMessage< ::opencv_onnx::TypeProto_Tensor >(GetArenaForAllocation());
   }
-  // @@protoc_insertion_point(field_mutable:opencv_onnx.TypeProto.tensor_type)
   return value_.tensor_type_;
 }
+inline ::opencv_onnx::TypeProto_Tensor* TypeProto::mutable_tensor_type() {
+  ::opencv_onnx::TypeProto_Tensor* _msg = _internal_mutable_tensor_type();
+  // @@protoc_insertion_point(field_mutable:opencv_onnx.TypeProto.tensor_type)
+  return _msg;
+}
 
 // optional string denotation = 6;
-inline bool TypeProto::has_denotation() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void TypeProto::set_has_denotation() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool TypeProto::_internal_has_denotation() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void TypeProto::clear_has_denotation() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool TypeProto::has_denotation() const {
+  return _internal_has_denotation();
 }
 inline void TypeProto::clear_denotation() {
-  denotation_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_denotation();
+  denotation_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& TypeProto::denotation() const {
+inline const std::string& TypeProto::denotation() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.TypeProto.denotation)
-  return denotation_.GetNoArena();
+  return _internal_denotation();
 }
-inline void TypeProto::set_denotation(const ::std::string& value) {
-  set_has_denotation();
-  denotation_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TypeProto::set_denotation(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ denotation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.TypeProto.denotation)
 }
-#if LANG_CXX11
-inline void TypeProto::set_denotation(::std::string&& value) {
-  set_has_denotation();
-  denotation_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.TypeProto.denotation)
-}
-#endif
-inline void TypeProto::set_denotation(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_denotation();
-  denotation_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.TypeProto.denotation)
-}
-inline void TypeProto::set_denotation(const char* value, size_t size) {
-  set_has_denotation();
-  denotation_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.TypeProto.denotation)
-}
-inline ::std::string* TypeProto::mutable_denotation() {
-  set_has_denotation();
+inline std::string* TypeProto::mutable_denotation() {
+  std::string* _s = _internal_mutable_denotation();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.TypeProto.denotation)
-  return denotation_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& TypeProto::_internal_denotation() const {
+  return denotation_.Get();
+}
+inline void TypeProto::_internal_set_denotation(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  denotation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* TypeProto::release_denotation() {
+inline std::string* TypeProto::_internal_mutable_denotation() {
+  _has_bits_[0] |= 0x00000001u;
+  return denotation_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
+}
+inline std::string* TypeProto::release_denotation() {
   // @@protoc_insertion_point(field_release:opencv_onnx.TypeProto.denotation)
-  clear_has_denotation();
-  return denotation_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_denotation()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = denotation_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (denotation_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    denotation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void TypeProto::set_allocated_denotation(::std::string* denotation) {
-  if (denotation != NULL) {
-    set_has_denotation();
+inline void TypeProto::set_allocated_denotation(std::string* denotation) {
+  if (denotation != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_denotation();
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  denotation_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), denotation,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (denotation_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    denotation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  denotation_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), denotation);
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.TypeProto.denotation)
 }
 
@@ -5704,89 +7306,99 @@ inline TypeProto::ValueCase TypeProto::value_case() const {
 // OperatorSetIdProto
 
 // optional string domain = 1;
-inline bool OperatorSetIdProto::has_domain() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void OperatorSetIdProto::set_has_domain() {
-  _has_bits_[0] |= 0x00000001u;
+inline bool OperatorSetIdProto::_internal_has_domain() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
 }
-inline void OperatorSetIdProto::clear_has_domain() {
-  _has_bits_[0] &= ~0x00000001u;
+inline bool OperatorSetIdProto::has_domain() const {
+  return _internal_has_domain();
 }
 inline void OperatorSetIdProto::clear_domain() {
-  domain_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_domain();
+  domain_.ClearToEmpty();
+  _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::std::string& OperatorSetIdProto::domain() const {
+inline const std::string& OperatorSetIdProto::domain() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.OperatorSetIdProto.domain)
-  return domain_.GetNoArena();
+  return _internal_domain();
 }
-inline void OperatorSetIdProto::set_domain(const ::std::string& value) {
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OperatorSetIdProto::set_domain(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_onnx.OperatorSetIdProto.domain)
 }
-#if LANG_CXX11
-inline void OperatorSetIdProto::set_domain(::std::string&& value) {
-  set_has_domain();
-  domain_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:opencv_onnx.OperatorSetIdProto.domain)
-}
-#endif
-inline void OperatorSetIdProto::set_domain(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:opencv_onnx.OperatorSetIdProto.domain)
-}
-inline void OperatorSetIdProto::set_domain(const char* value, size_t size) {
-  set_has_domain();
-  domain_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:opencv_onnx.OperatorSetIdProto.domain)
-}
-inline ::std::string* OperatorSetIdProto::mutable_domain() {
-  set_has_domain();
+inline std::string* OperatorSetIdProto::mutable_domain() {
+  std::string* _s = _internal_mutable_domain();
   // @@protoc_insertion_point(field_mutable:opencv_onnx.OperatorSetIdProto.domain)
-  return domain_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return _s;
+}
+inline const std::string& OperatorSetIdProto::_internal_domain() const {
+  return domain_.Get();
+}
+inline void OperatorSetIdProto::_internal_set_domain(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  domain_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
+}
+inline std::string* OperatorSetIdProto::_internal_mutable_domain() {
+  _has_bits_[0] |= 0x00000001u;
+  return domain_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OperatorSetIdProto::release_domain() {
+inline std::string* OperatorSetIdProto::release_domain() {
   // @@protoc_insertion_point(field_release:opencv_onnx.OperatorSetIdProto.domain)
-  clear_has_domain();
-  return domain_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (!_internal_has_domain()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  auto* p = domain_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (domain_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
-inline void OperatorSetIdProto::set_allocated_domain(::std::string* domain) {
-  if (domain != NULL) {
-    set_has_domain();
+inline void OperatorSetIdProto::set_allocated_domain(std::string* domain) {
+  if (domain != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
   } else {
-    clear_has_domain();
+    _has_bits_[0] &= ~0x00000001u;
   }
-  domain_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), domain);
+  domain_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), domain,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (domain_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    domain_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:opencv_onnx.OperatorSetIdProto.domain)
 }
 
 // optional int64 version = 2;
-inline bool OperatorSetIdProto::has_version() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+inline bool OperatorSetIdProto::_internal_has_version() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
 }
-inline void OperatorSetIdProto::set_has_version() {
-  _has_bits_[0] |= 0x00000002u;
+inline bool OperatorSetIdProto::has_version() const {
+  return _internal_has_version();
 }
-inline void OperatorSetIdProto::clear_has_version() {
+inline void OperatorSetIdProto::clear_version() {
+  version_ = int64_t{0};
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void OperatorSetIdProto::clear_version() {
-  version_ = GOOGLE_LONGLONG(0);
-  clear_has_version();
+inline int64_t OperatorSetIdProto::_internal_version() const {
+  return version_;
 }
-inline ::google::protobuf::int64 OperatorSetIdProto::version() const {
+inline int64_t OperatorSetIdProto::version() const {
   // @@protoc_insertion_point(field_get:opencv_onnx.OperatorSetIdProto.version)
-  return version_;
+  return _internal_version();
 }
-inline void OperatorSetIdProto::set_version(::google::protobuf::int64 value) {
-  set_has_version();
+inline void OperatorSetIdProto::_internal_set_version(int64_t value) {
+  _has_bits_[0] |= 0x00000002u;
   version_ = value;
+}
+inline void OperatorSetIdProto::set_version(int64_t value) {
+  _internal_set_version(value);
   // @@protoc_insertion_point(field_set:opencv_onnx.OperatorSetIdProto.version)
 }
 
@@ -5822,28 +7434,27 @@ inline void OperatorSetIdProto::set_version(::google::protobuf::int64 value) {
 
 }  // namespace opencv_onnx
 
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
 
-template <> struct is_proto_enum< ::opencv_onnx::AttributeProto_AttributeType> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_onnx::AttributeProto_AttributeType> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_onnx::AttributeProto_AttributeType>() {
   return ::opencv_onnx::AttributeProto_AttributeType_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_onnx::TensorProto_DataType> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_onnx::TensorProto_DataType> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_onnx::TensorProto_DataType>() {
   return ::opencv_onnx::TensorProto_DataType_descriptor();
 }
-template <> struct is_proto_enum< ::opencv_onnx::Version> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_onnx::Version> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_onnx::Version>() {
   return ::opencv_onnx::Version_descriptor();
 }
 
-}  // namespace protobuf
-}  // namespace google
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_opencv_2donnx_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_opencv_2donnx_2eproto
index 9986099..8e8e9b6 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_tensorflow {
-class AttrValue_ListValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<AttrValue_ListValue>
-      _instance;
-} _AttrValue_ListValue_default_instance_;
-class AttrValueDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<AttrValue>
-      _instance;
-  ::google::protobuf::internal::ArenaStringPtr s_;
-  ::google::protobuf::int64 i_;
-  float f_;
-  bool b_;
-  int type_;
-  const ::opencv_tensorflow::TensorShapeProto* shape_;
-  const ::opencv_tensorflow::TensorProto* tensor_;
-  const ::opencv_tensorflow::AttrValue_ListValue* list_;
-  const ::opencv_tensorflow::NameAttrList* func_;
-  ::google::protobuf::internal::ArenaStringPtr placeholder_;
-} _AttrValue_default_instance_;
-class NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NameAttrList_AttrEntry_DoNotUse>
-      _instance;
-} _NameAttrList_AttrEntry_DoNotUse_default_instance_;
-class NameAttrListDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NameAttrList>
-      _instance;
-} _NameAttrList_default_instance_;
+constexpr AttrValue_ListValue::AttrValue_ListValue(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : s_()
+  , i_()
+  , _i_cached_byte_size_(0)
+  , f_()
+  , b_()
+  , type_()
+  , _type_cached_byte_size_(0)
+  , shape_()
+  , tensor_(){}
+struct AttrValue_ListValueDefaultTypeInternal {
+  constexpr AttrValue_ListValueDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~AttrValue_ListValueDefaultTypeInternal() {}
+  union {
+    AttrValue_ListValue _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AttrValue_ListValueDefaultTypeInternal _AttrValue_ListValue_default_instance_;
+constexpr AttrValue::AttrValue(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : _oneof_case_{}{}
+struct AttrValueDefaultTypeInternal {
+  constexpr AttrValueDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~AttrValueDefaultTypeInternal() {}
+  union {
+    AttrValue _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AttrValueDefaultTypeInternal _AttrValue_default_instance_;
+constexpr NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){}
+struct NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal {
+  constexpr NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal() {}
+  union {
+    NameAttrList_AttrEntry_DoNotUse _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal _NameAttrList_AttrEntry_DoNotUse_default_instance_;
+constexpr NameAttrList::NameAttrList(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : attr_(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{})
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct NameAttrListDefaultTypeInternal {
+  constexpr NameAttrListDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NameAttrListDefaultTypeInternal() {}
+  union {
+    NameAttrList _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NameAttrListDefaultTypeInternal _NameAttrList_default_instance_;
 }  // namespace opencv_tensorflow
-namespace protobuf_attr_5fvalue_2eproto {
-void InitDefaultsAttrValue_ListValueImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
-  protobuf_tensor_2eproto::InitDefaultsTensorProto();
-  {
-    void* ptr = &::opencv_tensorflow::_AttrValue_ListValue_default_instance_;
-    new (ptr) ::opencv_tensorflow::AttrValue_ListValue();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::AttrValue_ListValue::InitAsDefaultInstance();
-}
-
-void InitDefaultsAttrValue_ListValue() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsAttrValue_ListValueImpl);
-}
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_attr_5fvalue_2eproto[4];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_attr_5fvalue_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_attr_5fvalue_2eproto = nullptr;
 
-void InitDefaultsAttrValueImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
-  protobuf_tensor_2eproto::InitDefaultsTensorProto();
-  protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue_ListValue();
-  {
-    void* ptr = &::opencv_tensorflow::_AttrValue_default_instance_;
-    new (ptr) ::opencv_tensorflow::AttrValue();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  {
-    void* ptr = &::opencv_tensorflow::_NameAttrList_AttrEntry_DoNotUse_default_instance_;
-    new (ptr) ::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse();
-  }
-  {
-    void* ptr = &::opencv_tensorflow::_NameAttrList_default_instance_;
-    new (ptr) ::opencv_tensorflow::NameAttrList();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::AttrValue::InitAsDefaultInstance();
-  ::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse::InitAsDefaultInstance();
-  ::opencv_tensorflow::NameAttrList::InitAsDefaultInstance();
-}
-
-void InitDefaultsAttrValue() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsAttrValueImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[4];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+const uint32_t TableStruct_attr_5fvalue_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, s_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, i_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, f_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, b_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, shape_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, tensor_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, s_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, i_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, f_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, b_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, shape_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue_ListValue, tensor_),
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue, _internal_metadata_),
   ~0u,  // no _extensions_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue, _oneof_case_[0]),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue, _oneof_case_[0]),
   ~0u,  // no _weak_field_map_
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, s_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, i_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, f_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, b_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, type_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, shape_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, tensor_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, list_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, func_),
-  offsetof(::opencv_tensorflow::AttrValueDefaultTypeInternal, placeholder_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::AttrValue, value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse, _internal_metadata_),
+  ~0u,  // no _inlined_string_donated_
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag,
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::AttrValue, value_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse, key_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse, value_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse, key_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse, value_),
   0,
   1,
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NameAttrList, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NameAttrList, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NameAttrList, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NameAttrList, attr_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NameAttrList, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NameAttrList, attr_),
 };
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, -1, sizeof(::opencv_tensorflow::AttrValue_ListValue)},
-  { 12, -1, sizeof(::opencv_tensorflow::AttrValue)},
-  { 28, 35, sizeof(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse)},
-  { 37, -1, sizeof(::opencv_tensorflow::NameAttrList)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::opencv_tensorflow::AttrValue_ListValue)},
+  { 13, -1, -1, sizeof(::opencv_tensorflow::AttrValue)},
+  { 30, 38, -1, sizeof(::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse)},
+  { 40, -1, -1, sizeof(::opencv_tensorflow::NameAttrList)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_AttrValue_ListValue_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_AttrValue_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_NameAttrList_AttrEntry_DoNotUse_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_NameAttrList_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_AttrValue_ListValue_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_AttrValue_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_NameAttrList_AttrEntry_DoNotUse_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_NameAttrList_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "attr_value.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\020attr_value.proto\022\021opencv_tensorflow\032\014t"
-      "ensor.proto\032\022tensor_shape.proto\032\013types.p"
-      "roto\"\266\004\n\tAttrValue\022\013\n\001s\030\002 \001(\014H\000\022\013\n\001i\030\003 \001"
-      "(\003H\000\022\013\n\001f\030\004 \001(\002H\000\022\013\n\001b\030\005 \001(\010H\000\022+\n\004type\030\006"
-      " \001(\0162\033.opencv_tensorflow.DataTypeH\000\0224\n\005s"
-      "hape\030\007 \001(\0132#.opencv_tensorflow.TensorSha"
-      "peProtoH\000\0220\n\006tensor\030\010 \001(\0132\036.opencv_tenso"
-      "rflow.TensorProtoH\000\0226\n\004list\030\001 \001(\0132&.open"
-      "cv_tensorflow.AttrValue.ListValueH\000\022/\n\004f"
-      "unc\030\n \001(\0132\037.opencv_tensorflow.NameAttrLi"
-      "stH\000\022\025\n\013placeholder\030\t \001(\tH\000\032\326\001\n\tListValu"
-      "e\022\t\n\001s\030\002 \003(\014\022\r\n\001i\030\003 \003(\003B\002\020\001\022\r\n\001f\030\004 \003(\002B\002"
-      "\020\001\022\r\n\001b\030\005 \003(\010B\002\020\001\022-\n\004type\030\006 \003(\0162\033.opencv"
-      "_tensorflow.DataTypeB\002\020\001\0222\n\005shape\030\007 \003(\0132"
-      "#.opencv_tensorflow.TensorShapeProto\022.\n\006"
-      "tensor\030\010 \003(\0132\036.opencv_tensorflow.TensorP"
-      "rotoB\007\n\005value\"\240\001\n\014NameAttrList\022\014\n\004name\030\001"
-      " \001(\t\0227\n\004attr\030\002 \003(\0132).opencv_tensorflow.N"
-      "ameAttrList.AttrEntry\032I\n\tAttrEntry\022\013\n\003ke"
-      "y\030\001 \001(\t\022+\n\005value\030\002 \001(\0132\034.opencv_tensorfl"
-      "ow.AttrValue:\0028\001B0\n\030org.tensorflow.frame"
-      "workB\017AttrValueProtosP\001\370\001\001b\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 874);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "attr_value.proto", &protobuf_RegisterTypes);
-  ::protobuf_tensor_2eproto::AddDescriptors();
-  ::protobuf_tensor_5fshape_2eproto::AddDescriptors();
-  ::protobuf_types_2eproto::AddDescriptors();
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_attr_5fvalue_2eproto
+const char descriptor_table_protodef_attr_5fvalue_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\020attr_value.proto\022\021opencv_tensorflow\032\014t"
+  "ensor.proto\032\022tensor_shape.proto\032\013types.p"
+  "roto\"\266\004\n\tAttrValue\022\013\n\001s\030\002 \001(\014H\000\022\013\n\001i\030\003 \001"
+  "(\003H\000\022\013\n\001f\030\004 \001(\002H\000\022\013\n\001b\030\005 \001(\010H\000\022+\n\004type\030\006"
+  " \001(\0162\033.opencv_tensorflow.DataTypeH\000\0224\n\005s"
+  "hape\030\007 \001(\0132#.opencv_tensorflow.TensorSha"
+  "peProtoH\000\0220\n\006tensor\030\010 \001(\0132\036.opencv_tenso"
+  "rflow.TensorProtoH\000\0226\n\004list\030\001 \001(\0132&.open"
+  "cv_tensorflow.AttrValue.ListValueH\000\022/\n\004f"
+  "unc\030\n \001(\0132\037.opencv_tensorflow.NameAttrLi"
+  "stH\000\022\025\n\013placeholder\030\t \001(\tH\000\032\326\001\n\tListValu"
+  "e\022\t\n\001s\030\002 \003(\014\022\r\n\001i\030\003 \003(\003B\002\020\001\022\r\n\001f\030\004 \003(\002B\002"
+  "\020\001\022\r\n\001b\030\005 \003(\010B\002\020\001\022-\n\004type\030\006 \003(\0162\033.opencv"
+  "_tensorflow.DataTypeB\002\020\001\0222\n\005shape\030\007 \003(\0132"
+  "#.opencv_tensorflow.TensorShapeProto\022.\n\006"
+  "tensor\030\010 \003(\0132\036.opencv_tensorflow.TensorP"
+  "rotoB\007\n\005value\"\240\001\n\014NameAttrList\022\014\n\004name\030\001"
+  " \001(\t\0227\n\004attr\030\002 \003(\0132).opencv_tensorflow.N"
+  "ameAttrList.AttrEntry\032I\n\tAttrEntry\022\013\n\003ke"
+  "y\030\001 \001(\t\022+\n\005value\030\002 \001(\0132\034.opencv_tensorfl"
+  "ow.AttrValue:\0028\001B0\n\030org.tensorflow.frame"
+  "workB\017AttrValueProtosP\001\370\001\001b\006proto3"
+  ;
+static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_attr_5fvalue_2eproto_deps[3] = {
+  &::descriptor_table_tensor_2eproto,
+  &::descriptor_table_tensor_5fshape_2eproto,
+  &::descriptor_table_types_2eproto,
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_attr_5fvalue_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_attr_5fvalue_2eproto = {
+  false, false, 874, descriptor_table_protodef_attr_5fvalue_2eproto, "attr_value.proto",
+  &descriptor_table_attr_5fvalue_2eproto_once, descriptor_table_attr_5fvalue_2eproto_deps, 3, 4,
+  schemas, file_default_instances, TableStruct_attr_5fvalue_2eproto::offsets,
+  file_level_metadata_attr_5fvalue_2eproto, file_level_enum_descriptors_attr_5fvalue_2eproto, file_level_service_descriptors_attr_5fvalue_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_attr_5fvalue_2eproto_getter() {
+  return &descriptor_table_attr_5fvalue_2eproto;
+}
+
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_attr_5fvalue_2eproto(&descriptor_table_attr_5fvalue_2eproto);
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-void AttrValue_ListValue::InitAsDefaultInstance() {
-}
+class AttrValue_ListValue::_Internal {
+ public:
+};
+
 void AttrValue_ListValue::clear_shape() {
   shape_.Clear();
 }
 void AttrValue_ListValue::clear_tensor() {
   tensor_.Clear();
 }
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int AttrValue_ListValue::kSFieldNumber;
-const int AttrValue_ListValue::kIFieldNumber;
-const int AttrValue_ListValue::kFFieldNumber;
-const int AttrValue_ListValue::kBFieldNumber;
-const int AttrValue_ListValue::kTypeFieldNumber;
-const int AttrValue_ListValue::kShapeFieldNumber;
-const int AttrValue_ListValue::kTensorFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-AttrValue_ListValue::AttrValue_ListValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue_ListValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.AttrValue.ListValue)
-}
-AttrValue_ListValue::AttrValue_ListValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+AttrValue_ListValue::AttrValue_ListValue(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   s_(arena),
   i_(arena),
   f_(arena),
@@ -277,67 +208,52 @@ AttrValue_ListValue::AttrValue_ListValue(::google::protobuf::Arena* arena)
   type_(arena),
   shape_(arena),
   tensor_(arena) {
-  ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue_ListValue();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.AttrValue.ListValue)
 }
 AttrValue_ListValue::AttrValue_ListValue(const AttrValue_ListValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       s_(from.s_),
       i_(from.i_),
       f_(from.f_),
       b_(from.b_),
       type_(from.type_),
       shape_(from.shape_),
-      tensor_(from.tensor_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+      tensor_(from.tensor_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.AttrValue.ListValue)
 }
 
-void AttrValue_ListValue::SharedCtor() {
-  _cached_size_ = 0;
+inline void AttrValue_ListValue::SharedCtor() {
 }
 
 AttrValue_ListValue::~AttrValue_ListValue() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.AttrValue.ListValue)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void AttrValue_ListValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void AttrValue_ListValue::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void AttrValue_ListValue::ArenaDtor(void* object) {
   AttrValue_ListValue* _this = reinterpret_cast< AttrValue_ListValue* >(object);
   (void)_this;
 }
-void AttrValue_ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void AttrValue_ListValue::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void AttrValue_ListValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* AttrValue_ListValue::descriptor() {
-  ::protobuf_attr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_attr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const AttrValue_ListValue& AttrValue_ListValue::default_instance() {
-  ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue_ListValue();
-  return *internal_default_instance();
-}
-
-AttrValue_ListValue* AttrValue_ListValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<AttrValue_ListValue>(arena);
+  _cached_size_.Set(size);
 }
 
 void AttrValue_ListValue::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.AttrValue.ListValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -348,318 +264,182 @@ void AttrValue_ListValue::Clear() {
   type_.Clear();
   shape_.Clear();
   tensor_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool AttrValue_ListValue::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:opencv_tensorflow.AttrValue.ListValue)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* AttrValue_ListValue::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated bytes s = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->add_s()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_s();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int64 i = 3 [packed = true];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, this->mutable_i())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 1, 26u, input, this->mutable_i())));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_i(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 24) {
+          _internal_add_i(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated float f = 4 [packed = true];
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_f())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 34u, input, this->mutable_f())));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_f(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 37) {
+          _internal_add_f(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+          ptr += sizeof(float);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated bool b = 5 [packed = true];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, this->mutable_b())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 1, 42u, input, this->mutable_b())));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_b(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 40) {
+          _internal_add_b(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_tensorflow.DataType type = 6 [packed = true];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          ::google::protobuf::uint32 length;
-          DO_(input->ReadVarint32(&length));
-          ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
-          while (input->BytesUntilLimit() > 0) {
-            int value;
-            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-            add_type(static_cast< ::opencv_tensorflow::DataType >(value));
-          }
-          input->PopLimit(limit);
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          add_type(static_cast< ::opencv_tensorflow::DataType >(value));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_type(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 48) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          _internal_add_type(static_cast<::opencv_tensorflow::DataType>(val));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_tensorflow.TensorShapeProto shape = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_shape()));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_shape(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_tensorflow.TensorProto tensor = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_tensor()));
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_tensor(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
+        } 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:opencv_tensorflow.AttrValue.ListValue)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.AttrValue.ListValue)
-  return false;
-#undef DO_
-}
-
-void AttrValue_ListValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.AttrValue.ListValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated bytes s = 2;
-  for (int i = 0, n = this->s_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      2, this->s(i), output);
-  }
-
-  // repeated int64 i = 3 [packed = true];
-  if (this->i_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _i_cached_byte_size_));
-  }
-  for (int i = 0, n = this->i_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
-      this->i(i), output);
-  }
-
-  // repeated float f = 4 [packed = true];
-  if (this->f_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _f_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
-      this->f().data(), this->f_size(), output);
-  }
-
-  // repeated bool b = 5 [packed = true];
-  if (this->b_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _b_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteBoolArray(
-      this->b().data(), this->b_size(), output);
-  }
-
-  // repeated .opencv_tensorflow.DataType type = 6 [packed = true];
-  if (this->type_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(
-      6,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      output);
-    output->WriteVarint32(
-        static_cast< ::google::protobuf::uint32>(_type_cached_byte_size_));
-  }
-  for (int i = 0, n = this->type_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
-      this->type(i), output);
-  }
-
-  // repeated .opencv_tensorflow.TensorShapeProto shape = 7;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->shape_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, this->shape(static_cast<int>(i)), output);
-  }
-
-  // repeated .opencv_tensorflow.TensorProto tensor = 8;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->tensor_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, this->tensor(static_cast<int>(i)), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.AttrValue.ListValue)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* AttrValue_ListValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* AttrValue_ListValue::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.AttrValue.ListValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated bytes s = 2;
-  for (int i = 0, n = this->s_size(); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteBytesToArray(2, this->s(i), target);
+  for (int i = 0, n = this->_internal_s_size(); i < n; i++) {
+    const auto& s = this->_internal_s(i);
+    target = stream->WriteBytes(2, s, target);
   }
 
   // repeated int64 i = 3 [packed = true];
-  if (this->i_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      3,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _i_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt64NoTagToArray(this->i_, target);
+  {
+    int byte_size = _i_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt64Packed(
+          3, _internal_i(), byte_size, target);
+    }
   }
 
   // repeated float f = 4 [packed = true];
-  if (this->f_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      4,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _f_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteFloatNoTagToArray(this->f_, target);
+  if (this->_internal_f_size() > 0) {
+    target = stream->WriteFixedPacked(4, _internal_f(), target);
   }
 
   // repeated bool b = 5 [packed = true];
-  if (this->b_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      5,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _b_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteBoolNoTagToArray(this->b_, target);
+  if (this->_internal_b_size() > 0) {
+    target = stream->WriteFixedPacked(5, _internal_b(), target);
   }
 
   // repeated .opencv_tensorflow.DataType type = 6 [packed = true];
-  if (this->type_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      6,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(      static_cast< ::google::protobuf::uint32>(
-            _type_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
-      this->type_, target);
+  {
+    int byte_size = _type_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteEnumPacked(
+          6, type_, byte_size, target);
+    }
   }
 
   // repeated .opencv_tensorflow.TensorShapeProto shape = 7;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->shape_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, this->shape(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_shape_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(7, this->_internal_shape(i), target, stream);
   }
 
   // repeated .opencv_tensorflow.TensorProto tensor = 8;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->tensor_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, this->tensor(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_tensor_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(8, this->_internal_tensor(i), target, stream);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.AttrValue.ListValue)
   return target;
@@ -669,135 +449,109 @@ size_t AttrValue_ListValue::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.AttrValue.ListValue)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated bytes s = 2;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->s_size());
-  for (int i = 0, n = this->s_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
-      this->s(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(s_.size());
+  for (int i = 0, n = s_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+      s_.Get(i));
   }
 
   // repeated int64 i = 3 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int64Size(this->i_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _i_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _i_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // repeated float f = 4 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->f_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_f_size());
     size_t data_size = 4UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _f_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated bool b = 5 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->b_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_b_size());
     size_t data_size = 1UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _b_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated .opencv_tensorflow.DataType type = 6 [packed = true];
   {
     size_t data_size = 0;
-    unsigned int count = static_cast<unsigned int>(this->type_size());for (unsigned int i = 0; i < count; i++) {
-      data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
-        this->type(static_cast<int>(i)));
+    unsigned int count = static_cast<unsigned int>(this->_internal_type_size());for (unsigned int i = 0; i < count; i++) {
+      data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(
+        this->_internal_type(static_cast<int>(i)));
     }
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _type_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _type_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // repeated .opencv_tensorflow.TensorShapeProto shape = 7;
-  {
-    unsigned int count = static_cast<unsigned int>(this->shape_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->shape(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_shape_size();
+  for (const auto& msg : this->shape_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_tensorflow.TensorProto tensor = 8;
-  {
-    unsigned int count = static_cast<unsigned int>(this->tensor_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->tensor(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_tensor_size();
+  for (const auto& msg : this->tensor_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void AttrValue_ListValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.AttrValue.ListValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const AttrValue_ListValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const AttrValue_ListValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.AttrValue.ListValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.AttrValue.ListValue)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData AttrValue_ListValue::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    AttrValue_ListValue::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AttrValue_ListValue::GetClassData() const { return &_class_data_; }
+
+void AttrValue_ListValue::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<AttrValue_ListValue *>(to)->MergeFrom(
+      static_cast<const AttrValue_ListValue &>(from));
 }
 
+
 void AttrValue_ListValue::MergeFrom(const AttrValue_ListValue& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.AttrValue.ListValue)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   s_.MergeFrom(from.s_);
@@ -807,13 +561,7 @@ void AttrValue_ListValue::MergeFrom(const AttrValue_ListValue& from) {
   type_.MergeFrom(from.type_);
   shape_.MergeFrom(from.shape_);
   tensor_.MergeFrom(from.tensor_);
-}
-
-void AttrValue_ListValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.AttrValue.ListValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void AttrValue_ListValue::CopyFrom(const AttrValue_ListValue& from) {
@@ -827,27 +575,9 @@ bool AttrValue_ListValue::IsInitialized() const {
   return true;
 }
 
-void AttrValue_ListValue::Swap(AttrValue_ListValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    AttrValue_ListValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void AttrValue_ListValue::UnsafeArenaSwap(AttrValue_ListValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void AttrValue_ListValue::InternalSwap(AttrValue_ListValue* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   s_.InternalSwap(&other->s_);
   i_.InternalSwap(&other->i_);
   f_.InternalSwap(&other->f_);
@@ -855,44 +585,50 @@ void AttrValue_ListValue::InternalSwap(AttrValue_ListValue* other) {
   type_.InternalSwap(&other->type_);
   shape_.InternalSwap(&other->shape_);
   tensor_.InternalSwap(&other->tensor_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata AttrValue_ListValue::GetMetadata() const {
-  protobuf_attr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_attr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata AttrValue_ListValue::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_attr_5fvalue_2eproto_getter, &descriptor_table_attr_5fvalue_2eproto_once,
+      file_level_metadata_attr_5fvalue_2eproto[0]);
 }
 
-
 // ===================================================================
 
-void AttrValue::InitAsDefaultInstance() {
-  ::opencv_tensorflow::_AttrValue_default_instance_.s_.UnsafeSetDefault(
-      &::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::opencv_tensorflow::_AttrValue_default_instance_.i_ = GOOGLE_LONGLONG(0);
-  ::opencv_tensorflow::_AttrValue_default_instance_.f_ = 0;
-  ::opencv_tensorflow::_AttrValue_default_instance_.b_ = false;
-  ::opencv_tensorflow::_AttrValue_default_instance_.type_ = 0;
-  ::opencv_tensorflow::_AttrValue_default_instance_.shape_ = const_cast< ::opencv_tensorflow::TensorShapeProto*>(
-      ::opencv_tensorflow::TensorShapeProto::internal_default_instance());
-  ::opencv_tensorflow::_AttrValue_default_instance_.tensor_ = const_cast< ::opencv_tensorflow::TensorProto*>(
-      ::opencv_tensorflow::TensorProto::internal_default_instance());
-  ::opencv_tensorflow::_AttrValue_default_instance_.list_ = const_cast< ::opencv_tensorflow::AttrValue_ListValue*>(
-      ::opencv_tensorflow::AttrValue_ListValue::internal_default_instance());
-  ::opencv_tensorflow::_AttrValue_default_instance_.func_ = const_cast< ::opencv_tensorflow::NameAttrList*>(
-      ::opencv_tensorflow::NameAttrList::internal_default_instance());
-  ::opencv_tensorflow::_AttrValue_default_instance_.placeholder_.UnsafeSetDefault(
-      &::google::protobuf::internal::GetEmptyStringAlreadyInited());
+class AttrValue::_Internal {
+ public:
+  static const ::opencv_tensorflow::TensorShapeProto& shape(const AttrValue* msg);
+  static const ::opencv_tensorflow::TensorProto& tensor(const AttrValue* msg);
+  static const ::opencv_tensorflow::AttrValue_ListValue& list(const AttrValue* msg);
+  static const ::opencv_tensorflow::NameAttrList& func(const AttrValue* msg);
+};
+
+const ::opencv_tensorflow::TensorShapeProto&
+AttrValue::_Internal::shape(const AttrValue* msg) {
+  return *msg->value_.shape_;
+}
+const ::opencv_tensorflow::TensorProto&
+AttrValue::_Internal::tensor(const AttrValue* msg) {
+  return *msg->value_.tensor_;
+}
+const ::opencv_tensorflow::AttrValue_ListValue&
+AttrValue::_Internal::list(const AttrValue* msg) {
+  return *msg->value_.list_;
+}
+const ::opencv_tensorflow::NameAttrList&
+AttrValue::_Internal::func(const AttrValue* msg) {
+  return *msg->value_.func_;
 }
 void AttrValue::set_allocated_shape(::opencv_tensorflow::TensorShapeProto* shape) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   clear_value();
   if (shape) {
-    ::google::protobuf::Arena* submessage_arena =
-      reinterpret_cast< ::google::protobuf::MessageLite*>(shape)->GetArena();
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<
+            ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena(
+                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(shape));
     if (message_arena != submessage_arena) {
-      shape = ::google::protobuf::internal::GetOwnedMessage(
+      shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, shape, submessage_arena);
     }
     set_has_shape();
@@ -901,21 +637,23 @@ void AttrValue::set_allocated_shape(::opencv_tensorflow::TensorShapeProto* shape
   // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.AttrValue.shape)
 }
 void AttrValue::clear_shape() {
-  if (has_shape()) {
-    if (GetArenaNoVirtual() == NULL) {
+  if (_internal_has_shape()) {
+    if (GetArenaForAllocation() == nullptr) {
       delete value_.shape_;
     }
     clear_has_value();
   }
 }
 void AttrValue::set_allocated_tensor(::opencv_tensorflow::TensorProto* tensor) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   clear_value();
   if (tensor) {
-    ::google::protobuf::Arena* submessage_arena =
-      reinterpret_cast< ::google::protobuf::MessageLite*>(tensor)->GetArena();
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<
+            ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena(
+                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(tensor));
     if (message_arena != submessage_arena) {
-      tensor = ::google::protobuf::internal::GetOwnedMessage(
+      tensor = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, tensor, submessage_arena);
     }
     set_has_tensor();
@@ -924,21 +662,21 @@ void AttrValue::set_allocated_tensor(::opencv_tensorflow::TensorProto* tensor) {
   // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.AttrValue.tensor)
 }
 void AttrValue::clear_tensor() {
-  if (has_tensor()) {
-    if (GetArenaNoVirtual() == NULL) {
+  if (_internal_has_tensor()) {
+    if (GetArenaForAllocation() == nullptr) {
       delete value_.tensor_;
     }
     clear_has_value();
   }
 }
 void AttrValue::set_allocated_list(::opencv_tensorflow::AttrValue_ListValue* list) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   clear_value();
   if (list) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(list);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+      ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_tensorflow::AttrValue_ListValue>::GetOwningArena(list);
     if (message_arena != submessage_arena) {
-      list = ::google::protobuf::internal::GetOwnedMessage(
+      list = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, list, submessage_arena);
     }
     set_has_list();
@@ -947,13 +685,13 @@ void AttrValue::set_allocated_list(::opencv_tensorflow::AttrValue_ListValue* lis
   // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.AttrValue.list)
 }
 void AttrValue::set_allocated_func(::opencv_tensorflow::NameAttrList* func) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   clear_value();
   if (func) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(func);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+      ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_tensorflow::NameAttrList>::GetOwningArena(func);
     if (message_arena != submessage_arena) {
-      func = ::google::protobuf::internal::GetOwnedMessage(
+      func = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, func, submessage_arena);
     }
     set_has_func();
@@ -961,80 +699,58 @@ void AttrValue::set_allocated_func(::opencv_tensorflow::NameAttrList* func) {
   }
   // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.AttrValue.func)
 }
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int AttrValue::kSFieldNumber;
-const int AttrValue::kIFieldNumber;
-const int AttrValue::kFFieldNumber;
-const int AttrValue::kBFieldNumber;
-const int AttrValue::kTypeFieldNumber;
-const int AttrValue::kShapeFieldNumber;
-const int AttrValue::kTensorFieldNumber;
-const int AttrValue::kListFieldNumber;
-const int AttrValue::kFuncFieldNumber;
-const int AttrValue::kPlaceholderFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-AttrValue::AttrValue()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
-  }
+AttrValue::AttrValue(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.AttrValue)
-}
-AttrValue::AttrValue(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
-  SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.AttrValue)
 }
 AttrValue::AttrValue(const AttrValue& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message() {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   clear_has_value();
   switch (from.value_case()) {
     case kS: {
-      set_s(from.s());
+      _internal_set_s(from._internal_s());
       break;
     }
     case kI: {
-      set_i(from.i());
+      _internal_set_i(from._internal_i());
       break;
     }
     case kF: {
-      set_f(from.f());
+      _internal_set_f(from._internal_f());
       break;
     }
     case kB: {
-      set_b(from.b());
+      _internal_set_b(from._internal_b());
       break;
     }
     case kType: {
-      set_type(from.type());
+      _internal_set_type(from._internal_type());
       break;
     }
     case kShape: {
-      mutable_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from.shape());
+      _internal_mutable_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from._internal_shape());
       break;
     }
     case kTensor: {
-      mutable_tensor()->::opencv_tensorflow::TensorProto::MergeFrom(from.tensor());
+      _internal_mutable_tensor()->::opencv_tensorflow::TensorProto::MergeFrom(from._internal_tensor());
       break;
     }
     case kList: {
-      mutable_list()->::opencv_tensorflow::AttrValue_ListValue::MergeFrom(from.list());
+      _internal_mutable_list()->::opencv_tensorflow::AttrValue_ListValue::MergeFrom(from._internal_list());
       break;
     }
     case kFunc: {
-      mutable_func()->::opencv_tensorflow::NameAttrList::MergeFrom(from.func());
+      _internal_mutable_func()->::opencv_tensorflow::NameAttrList::MergeFrom(from._internal_func());
       break;
     }
     case kPlaceholder: {
-      set_placeholder(from.placeholder());
+      _internal_set_placeholder(from._internal_placeholder());
       break;
     }
     case VALUE_NOT_SET: {
@@ -1044,18 +760,19 @@ AttrValue::AttrValue(const AttrValue& from)
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.AttrValue)
 }
 
-void AttrValue::SharedCtor() {
-  clear_has_value();
-  _cached_size_ = 0;
+inline void AttrValue::SharedCtor() {
+clear_has_value();
 }
 
 AttrValue::~AttrValue() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.AttrValue)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void AttrValue::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void AttrValue::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (has_value()) {
     clear_value();
   }
@@ -1065,33 +782,17 @@ void AttrValue::ArenaDtor(void* object) {
   AttrValue* _this = reinterpret_cast< AttrValue* >(object);
   (void)_this;
 }
-void AttrValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void AttrValue::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void AttrValue::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* AttrValue::descriptor() {
-  ::protobuf_attr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_attr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const AttrValue& AttrValue::default_instance() {
-  ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
-  return *internal_default_instance();
-}
-
-AttrValue* AttrValue::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<AttrValue>(arena);
+  _cached_size_.Set(size);
 }
 
 void AttrValue::clear_value() {
 // @@protoc_insertion_point(one_of_clear_start:opencv_tensorflow.AttrValue)
   switch (value_case()) {
     case kS: {
-      value_.s_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-          GetArenaNoVirtual());
+      value_.s_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
       break;
     }
     case kI: {
@@ -1111,32 +812,31 @@ void AttrValue::clear_value() {
       break;
     }
     case kShape: {
-      if (GetArenaNoVirtual() == NULL) {
+      if (GetArenaForAllocation() == nullptr) {
         delete value_.shape_;
       }
       break;
     }
     case kTensor: {
-      if (GetArenaNoVirtual() == NULL) {
+      if (GetArenaForAllocation() == nullptr) {
         delete value_.tensor_;
       }
       break;
     }
     case kList: {
-      if (GetArenaNoVirtual() == NULL) {
+      if (GetArenaForAllocation() == nullptr) {
         delete value_.list_;
       }
       break;
     }
     case kFunc: {
-      if (GetArenaNoVirtual() == NULL) {
+      if (GetArenaForAllocation() == nullptr) {
         delete value_.func_;
       }
       break;
     }
     case kPlaceholder: {
-      value_.placeholder_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-          GetArenaNoVirtual());
+      value_.placeholder_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
       break;
     }
     case VALUE_NOT_SET: {
@@ -1149,331 +849,209 @@ void AttrValue::clear_value() {
 
 void AttrValue::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.AttrValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   clear_value();
-  _internal_metadata_.Clear();
-}
-
-bool AttrValue::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:opencv_tensorflow.AttrValue)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* AttrValue::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // .opencv_tensorflow.AttrValue.ListValue list = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_list()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_list(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bytes s = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_s()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_s();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // int64 i = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          clear_value();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &value_.i_)));
-          set_has_i();
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          _internal_set_i(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // float f = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          clear_value();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &value_.f_)));
-          set_has_f();
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 37)) {
+          _internal_set_f(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+          ptr += sizeof(float);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bool b = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-          clear_value();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &value_.b_)));
-          set_has_b();
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          _internal_set_b(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.DataType type = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_type(static_cast< ::opencv_tensorflow::DataType >(value));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          _internal_set_type(static_cast<::opencv_tensorflow::DataType>(val));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.TensorShapeProto shape = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_shape()));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_shape(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.TensorProto tensor = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_tensor()));
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ctx->ParseMessage(_internal_mutable_tensor(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string placeholder = 9;
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_placeholder()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->placeholder().data(), static_cast<int>(this->placeholder().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.AttrValue.placeholder"));
-        } else {
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          auto str = _internal_mutable_placeholder();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.AttrValue.placeholder"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.NameAttrList func = 10;
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_func()));
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr = ctx->ParseMessage(_internal_mutable_func(), ptr);
+          CHK_(ptr);
+        } 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:opencv_tensorflow.AttrValue)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.AttrValue)
-  return false;
-#undef DO_
-}
-
-void AttrValue::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.AttrValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // .opencv_tensorflow.AttrValue.ListValue list = 1;
-  if (has_list()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *value_.list_, output);
-  }
-
-  // bytes s = 2;
-  if (has_s()) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      2, this->s(), output);
-  }
-
-  // int64 i = 3;
-  if (has_i()) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->i(), output);
-  }
-
-  // float f = 4;
-  if (has_f()) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->f(), output);
-  }
-
-  // bool b = 5;
-  if (has_b()) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->b(), output);
-  }
-
-  // .opencv_tensorflow.DataType type = 6;
-  if (has_type()) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      6, this->type(), output);
-  }
-
-  // .opencv_tensorflow.TensorShapeProto shape = 7;
-  if (has_shape()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, *value_.shape_, output);
-  }
-
-  // .opencv_tensorflow.TensorProto tensor = 8;
-  if (has_tensor()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, *value_.tensor_, output);
-  }
-
-  // string placeholder = 9;
-  if (has_placeholder()) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->placeholder().data(), static_cast<int>(this->placeholder().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.AttrValue.placeholder");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      9, this->placeholder(), output);
-  }
-
-  // .opencv_tensorflow.NameAttrList func = 10;
-  if (has_func()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      10, *value_.func_, output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.AttrValue)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* AttrValue::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* AttrValue::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.AttrValue)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // .opencv_tensorflow.AttrValue.ListValue list = 1;
-  if (has_list()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *value_.list_, deterministic, target);
+  if (_internal_has_list()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::list(this), target, stream);
   }
 
   // bytes s = 2;
-  if (has_s()) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        2, this->s(), target);
+  if (_internal_has_s()) {
+    target = stream->WriteBytesMaybeAliased(
+        2, this->_internal_s(), target);
   }
 
   // int64 i = 3;
-  if (has_i()) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->i(), target);
+  if (_internal_has_i()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_i(), target);
   }
 
   // float f = 4;
-  if (has_f()) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->f(), target);
+  if (_internal_has_f()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_f(), target);
   }
 
   // bool b = 5;
-  if (has_b()) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->b(), target);
+  if (_internal_has_b()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_b(), target);
   }
 
   // .opencv_tensorflow.DataType type = 6;
-  if (has_type()) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      6, this->type(), target);
+  if (_internal_has_type()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      6, this->_internal_type(), target);
   }
 
   // .opencv_tensorflow.TensorShapeProto shape = 7;
-  if (has_shape()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, *value_.shape_, deterministic, target);
+  if (_internal_has_shape()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        7, _Internal::shape(this), target, stream);
   }
 
   // .opencv_tensorflow.TensorProto tensor = 8;
-  if (has_tensor()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, *value_.tensor_, deterministic, target);
+  if (_internal_has_tensor()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        8, _Internal::tensor(this), target, stream);
   }
 
   // string placeholder = 9;
-  if (has_placeholder()) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->placeholder().data(), static_cast<int>(this->placeholder().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (_internal_has_placeholder()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_placeholder().data(), static_cast<int>(this->_internal_placeholder().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.AttrValue.placeholder");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        9, this->placeholder(), target);
+    target = stream->WriteStringMaybeAliased(
+        9, this->_internal_placeholder(), target);
   }
 
   // .opencv_tensorflow.NameAttrList func = 10;
-  if (has_func()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        10, *value_.func_, deterministic, target);
+  if (_internal_has_func()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        10, _Internal::func(this), target, stream);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.AttrValue)
   return target;
@@ -1483,24 +1061,21 @@ size_t AttrValue::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.AttrValue)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   switch (value_case()) {
     // bytes s = 2;
     case kS: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::BytesSize(
-          this->s());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+          this->_internal_s());
       break;
     }
     // int64 i = 3;
     case kI: {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->i());
+      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_i());
       break;
     }
     // float f = 4;
@@ -1516,129 +1091,116 @@ size_t AttrValue::ByteSizeLong() const {
     // .opencv_tensorflow.DataType type = 6;
     case kType: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
       break;
     }
     // .opencv_tensorflow.TensorShapeProto shape = 7;
     case kShape: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
           *value_.shape_);
       break;
     }
     // .opencv_tensorflow.TensorProto tensor = 8;
     case kTensor: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
           *value_.tensor_);
       break;
     }
     // .opencv_tensorflow.AttrValue.ListValue list = 1;
     case kList: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
           *value_.list_);
       break;
     }
     // .opencv_tensorflow.NameAttrList func = 10;
     case kFunc: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
           *value_.func_);
       break;
     }
     // string placeholder = 9;
     case kPlaceholder: {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::StringSize(
-          this->placeholder());
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+          this->_internal_placeholder());
       break;
     }
     case VALUE_NOT_SET: {
       break;
     }
   }
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void AttrValue::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.AttrValue)
-  GOOGLE_DCHECK_NE(&from, this);
-  const AttrValue* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const AttrValue>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.AttrValue)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.AttrValue)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData AttrValue::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    AttrValue::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*AttrValue::GetClassData() const { return &_class_data_; }
+
+void AttrValue::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<AttrValue *>(to)->MergeFrom(
+      static_cast<const AttrValue &>(from));
 }
 
+
 void AttrValue::MergeFrom(const AttrValue& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.AttrValue)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   switch (from.value_case()) {
     case kS: {
-      set_s(from.s());
+      _internal_set_s(from._internal_s());
       break;
     }
     case kI: {
-      set_i(from.i());
+      _internal_set_i(from._internal_i());
       break;
     }
     case kF: {
-      set_f(from.f());
+      _internal_set_f(from._internal_f());
       break;
     }
     case kB: {
-      set_b(from.b());
+      _internal_set_b(from._internal_b());
       break;
     }
     case kType: {
-      set_type(from.type());
+      _internal_set_type(from._internal_type());
       break;
     }
     case kShape: {
-      mutable_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from.shape());
+      _internal_mutable_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from._internal_shape());
       break;
     }
     case kTensor: {
-      mutable_tensor()->::opencv_tensorflow::TensorProto::MergeFrom(from.tensor());
+      _internal_mutable_tensor()->::opencv_tensorflow::TensorProto::MergeFrom(from._internal_tensor());
       break;
     }
     case kList: {
-      mutable_list()->::opencv_tensorflow::AttrValue_ListValue::MergeFrom(from.list());
+      _internal_mutable_list()->::opencv_tensorflow::AttrValue_ListValue::MergeFrom(from._internal_list());
       break;
     }
     case kFunc: {
-      mutable_func()->::opencv_tensorflow::NameAttrList::MergeFrom(from.func());
+      _internal_mutable_func()->::opencv_tensorflow::NameAttrList::MergeFrom(from._internal_func());
       break;
     }
     case kPlaceholder: {
-      set_placeholder(from.placeholder());
+      _internal_set_placeholder(from._internal_placeholder());
       break;
     }
     case VALUE_NOT_SET: {
       break;
     }
   }
-}
-
-void AttrValue::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.AttrValue)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void AttrValue::CopyFrom(const AttrValue& from) {
@@ -1652,374 +1214,221 @@ bool AttrValue::IsInitialized() const {
   return true;
 }
 
-void AttrValue::Swap(AttrValue* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    AttrValue* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void AttrValue::UnsafeArenaSwap(AttrValue* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void AttrValue::InternalSwap(AttrValue* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(value_, other->value_);
   swap(_oneof_case_[0], other->_oneof_case_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata AttrValue::GetMetadata() const {
-  protobuf_attr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_attr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata AttrValue::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_attr_5fvalue_2eproto_getter, &descriptor_table_attr_5fvalue_2eproto_once,
+      file_level_metadata_attr_5fvalue_2eproto[1]);
 }
 
-
 // ===================================================================
 
 NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse() {}
-NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {}
+NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
+    : SuperType(arena) {}
 void NameAttrList_AttrEntry_DoNotUse::MergeFrom(const NameAttrList_AttrEntry_DoNotUse& other) {
   MergeFromInternal(other);
 }
-::google::protobuf::Metadata NameAttrList_AttrEntry_DoNotUse::GetMetadata() const {
-  ::protobuf_attr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_attr_5fvalue_2eproto::file_level_metadata[2];
+::PROTOBUF_NAMESPACE_ID::Metadata NameAttrList_AttrEntry_DoNotUse::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_attr_5fvalue_2eproto_getter, &descriptor_table_attr_5fvalue_2eproto_once,
+      file_level_metadata_attr_5fvalue_2eproto[2]);
 }
-void NameAttrList_AttrEntry_DoNotUse::MergeFrom(
-    const ::google::protobuf::Message& other) {
-  ::google::protobuf::Message::MergeFrom(other);
-}
-
 
 // ===================================================================
 
-void NameAttrList::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NameAttrList::kNameFieldNumber;
-const int NameAttrList::kAttrFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class NameAttrList::_Internal {
+ public:
+};
 
-NameAttrList::NameAttrList()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.NameAttrList)
-}
-NameAttrList::NameAttrList(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+NameAttrList::NameAttrList(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   attr_(arena) {
-  ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.NameAttrList)
 }
 NameAttrList::NameAttrList(const NameAttrList& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message() {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   attr_.MergeFrom(from.attr_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_name().empty()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.NameAttrList)
 }
 
-void NameAttrList::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
+inline void NameAttrList::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 NameAttrList::~NameAttrList() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.NameAttrList)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void NameAttrList::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void NameAttrList::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void NameAttrList::ArenaDtor(void* object) {
   NameAttrList* _this = reinterpret_cast< NameAttrList* >(object);
   (void)_this;
+  _this->attr_. ~MapField();
 }
-void NameAttrList::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+inline void NameAttrList::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena) {
+  if (arena != nullptr) {
+    arena->OwnCustomDestructor(this, &NameAttrList::ArenaDtor);
+  }
 }
 void NameAttrList::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* NameAttrList::descriptor() {
-  ::protobuf_attr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_attr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const NameAttrList& NameAttrList::default_instance() {
-  ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
-  return *internal_default_instance();
-}
-
-NameAttrList* NameAttrList::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<NameAttrList>(arena);
+  _cached_size_.Set(size);
 }
 
 void NameAttrList::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.NameAttrList)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   attr_.Clear();
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  _internal_metadata_.Clear();
-}
-
-bool NameAttrList::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:opencv_tensorflow.NameAttrList)
-  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)) {
+  name_.ClearToEmpty();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* NameAttrList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.NameAttrList.name"));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.NameAttrList.name"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // map<string, .opencv_tensorflow.AttrValue> attr = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          NameAttrList_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
-              NameAttrList_AttrEntry_DoNotUse,
-              ::std::string, ::opencv_tensorflow::AttrValue,
-              ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-              ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-              0 >,
-            ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue > > parser(&attr_);
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
-              input, &parser));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            parser.key().data(), static_cast<int>(parser.key().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.NameAttrList.AttrEntry.key"));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(&attr_, ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } 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:opencv_tensorflow.NameAttrList)
-  return true;
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.NameAttrList)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void NameAttrList::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.NameAttrList)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.NameAttrList.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // map<string, .opencv_tensorflow.AttrValue> attr = 2;
-  if (!this->attr().empty()) {
-    typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
-        ConstPtr;
-    typedef ConstPtr SortItem;
-    typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
-    struct Utf8Check {
-      static void Check(ConstPtr p) {
-        ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-          p->first.data(), static_cast<int>(p->first.length()),
-          ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-          "opencv_tensorflow.NameAttrList.AttrEntry.key");
-      }
-    };
-
-    if (output->IsSerializationDeterministic() &&
-        this->attr().size() > 1) {
-      ::google::protobuf::scoped_array<SortItem> items(
-          new SortItem[this->attr().size()]);
-      typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
-      size_type n = 0;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it, ++n) {
-        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
-      }
-      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
-      ::google::protobuf::scoped_ptr<NameAttrList_AttrEntry_DoNotUse> entry;
-      for (size_type i = 0; i < n; i++) {
-        entry.reset(attr_.NewEntryWrapper(
-            items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
-        ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-            2, *entry, output);
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
-      }
-    } else {
-      ::google::protobuf::scoped_ptr<NameAttrList_AttrEntry_DoNotUse> entry;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it) {
-        entry.reset(attr_.NewEntryWrapper(
-            it->first, it->second));
-        ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-            2, *entry, output);
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(&*it);
-      }
-    }
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.NameAttrList)
-}
-
-::google::protobuf::uint8* NameAttrList::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* NameAttrList::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.NameAttrList)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_name().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.NameAttrList.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // map<string, .opencv_tensorflow.AttrValue> attr = 2;
-  if (!this->attr().empty()) {
-    typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
+  if (!this->_internal_attr().empty()) {
+    typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_pointer
         ConstPtr;
     typedef ConstPtr SortItem;
-    typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
+    typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
     struct Utf8Check {
       static void Check(ConstPtr p) {
-        ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+        (void)p;
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
           p->first.data(), static_cast<int>(p->first.length()),
-          ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+          ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
           "opencv_tensorflow.NameAttrList.AttrEntry.key");
       }
     };
 
-    if (deterministic &&
-        this->attr().size() > 1) {
-      ::google::protobuf::scoped_array<SortItem> items(
-          new SortItem[this->attr().size()]);
-      typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
+    if (stream->IsSerializationDeterministic() &&
+        this->_internal_attr().size() > 1) {
+      ::std::unique_ptr<SortItem[]> items(
+          new SortItem[this->_internal_attr().size()]);
+      typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
       size_type n = 0;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it, ++n) {
+      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+          it = this->_internal_attr().begin();
+          it != this->_internal_attr().end(); ++it, ++n) {
         items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
       }
       ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
-      ::google::protobuf::scoped_ptr<NameAttrList_AttrEntry_DoNotUse> entry;
       for (size_type i = 0; i < n; i++) {
-        entry.reset(attr_.NewEntryWrapper(
-            items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
-        target = ::google::protobuf::internal::WireFormatLite::
-                   InternalWriteMessageNoVirtualToArray(
-                       2, *entry, deterministic, target);
-;
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
+        target = NameAttrList_AttrEntry_DoNotUse::Funcs::InternalSerialize(2, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target, stream);
+        Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
       }
     } else {
-      ::google::protobuf::scoped_ptr<NameAttrList_AttrEntry_DoNotUse> entry;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it) {
-        entry.reset(attr_.NewEntryWrapper(
-            it->first, it->second));
-        target = ::google::protobuf::internal::WireFormatLite::
-                   InternalWriteMessageNoVirtualToArray(
-                       2, *entry, deterministic, target);
-;
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(&*it);
+      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+          it = this->_internal_attr().begin();
+          it != this->_internal_attr().end(); ++it) {
+        target = NameAttrList_AttrEntry_DoNotUse::Funcs::InternalSerialize(2, it->first, it->second, target, stream);
+        Utf8Check::Check(&(*it));
       }
     }
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.NameAttrList)
   return target;
@@ -2029,78 +1438,53 @@ size_t NameAttrList::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.NameAttrList)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // map<string, .opencv_tensorflow.AttrValue> attr = 2;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->attr_size());
-  {
-    ::google::protobuf::scoped_ptr<NameAttrList_AttrEntry_DoNotUse> entry;
-    for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-        it = this->attr().begin();
-        it != this->attr().end(); ++it) {
-      if (entry.get() != NULL && entry->GetArena() != NULL) {
-        entry.release();
-      }
-      entry.reset(attr_.NewEntryWrapper(it->first, it->second));
-      total_size += ::google::protobuf::internal::WireFormatLite::
-          MessageSizeNoVirtual(*entry);
-    }
-    if (entry.get() != NULL && entry->GetArena() != NULL) {
-      entry.release();
-    }
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_attr_size());
+  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+      it = this->_internal_attr().begin();
+      it != this->_internal_attr().end(); ++it) {
+    total_size += NameAttrList_AttrEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
   }
 
   // string name = 1;
-  if (this->name().size() > 0) {
+  if (!this->_internal_name().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_name());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void NameAttrList::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.NameAttrList)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NameAttrList* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NameAttrList>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.NameAttrList)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.NameAttrList)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NameAttrList::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NameAttrList::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NameAttrList::GetClassData() const { return &_class_data_; }
+
+void NameAttrList::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NameAttrList *>(to)->MergeFrom(
+      static_cast<const NameAttrList &>(from));
 }
 
+
 void NameAttrList::MergeFrom(const NameAttrList& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.NameAttrList)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   attr_.MergeFrom(from.attr_);
-  if (from.name().size() > 0) {
-    set_name(from.name());
+  if (!from._internal_name().empty()) {
+    _internal_set_name(from._internal_name());
   }
-}
-
-void NameAttrList::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.NameAttrList)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void NameAttrList::CopyFrom(const NameAttrList& from) {
@@ -2114,40 +1498,41 @@ bool NameAttrList::IsInitialized() const {
   return true;
 }
 
-void NameAttrList::Swap(NameAttrList* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    NameAttrList* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void NameAttrList::UnsafeArenaSwap(NameAttrList* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void NameAttrList::InternalSwap(NameAttrList* other) {
   using std::swap;
-  attr_.Swap(&other->attr_);
-  name_.Swap(&other->name_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  attr_.InternalSwap(&other->attr_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
 }
 
-::google::protobuf::Metadata NameAttrList::GetMetadata() const {
-  protobuf_attr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_attr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata NameAttrList::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_attr_5fvalue_2eproto_getter, &descriptor_table_attr_5fvalue_2eproto_once,
+      file_level_metadata_attr_5fvalue_2eproto[3]);
 }
 
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::AttrValue_ListValue* Arena::CreateMaybeMessage< ::opencv_tensorflow::AttrValue_ListValue >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::AttrValue_ListValue >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::AttrValue* Arena::CreateMaybeMessage< ::opencv_tensorflow::AttrValue >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::AttrValue >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse* Arena::CreateMaybeMessage< ::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::NameAttrList* Arena::CreateMaybeMessage< ::opencv_tensorflow::NameAttrList >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::NameAttrList >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index 40ded9c..66c1772 100644 (file)
@@ -1,30 +1,32 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: attr_value.proto
 
-#ifndef PROTOBUF_attr_5fvalue_2eproto__INCLUDED
-#define PROTOBUF_attr_5fvalue_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_attr_5fvalue_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_attr_5fvalue_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include "tensor_shape.pb.h"
 #include "types.pb.h"
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_attr_5fvalue_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_attr_5fvalue_2eproto {
 // Internal implementation detail -- do not use these members.
-struct 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[];
+struct TableStruct_attr_5fvalue_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsAttrValue_ListValueImpl();
-void InitDefaultsAttrValue_ListValue();
-void InitDefaultsAttrValueImpl();
-void InitDefaultsAttrValue();
-inline void InitDefaults() {
-  InitDefaultsAttrValue_ListValue();
-  InitDefaultsAttrValue();
-}
-}  // namespace protobuf_attr_5fvalue_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_attr_5fvalue_2eproto;
 namespace opencv_tensorflow {
 class AttrValue;
-class AttrValueDefaultTypeInternal;
+struct AttrValueDefaultTypeInternal;
 extern AttrValueDefaultTypeInternal _AttrValue_default_instance_;
 class AttrValue_ListValue;
-class AttrValue_ListValueDefaultTypeInternal;
+struct AttrValue_ListValueDefaultTypeInternal;
 extern AttrValue_ListValueDefaultTypeInternal _AttrValue_ListValue_default_instance_;
 class NameAttrList;
-class NameAttrListDefaultTypeInternal;
+struct NameAttrListDefaultTypeInternal;
 extern NameAttrListDefaultTypeInternal _NameAttrList_default_instance_;
 class NameAttrList_AttrEntry_DoNotUse;
-class NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal;
+struct NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal;
 extern NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal _NameAttrList_AttrEntry_DoNotUse_default_instance_;
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_tensorflow::AttrValue* Arena::CreateMaybeMessage<::opencv_tensorflow::AttrValue>(Arena*);
+template<> ::opencv_tensorflow::AttrValue_ListValue* Arena::CreateMaybeMessage<::opencv_tensorflow::AttrValue_ListValue>(Arena*);
+template<> ::opencv_tensorflow::NameAttrList* Arena::CreateMaybeMessage<::opencv_tensorflow::NameAttrList>(Arena*);
+template<> ::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse* Arena::CreateMaybeMessage<::opencv_tensorflow::NameAttrList_AttrEntry_DoNotUse>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-class AttrValue_ListValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.AttrValue.ListValue) */ {
+class AttrValue_ListValue final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.AttrValue.ListValue) */ {
  public:
-  AttrValue_ListValue();
-  virtual ~AttrValue_ListValue();
+  inline AttrValue_ListValue() : AttrValue_ListValue(nullptr) {}
+  ~AttrValue_ListValue() override;
+  explicit constexpr AttrValue_ListValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   AttrValue_ListValue(const AttrValue_ListValue& from);
-
-  inline AttrValue_ListValue& operator=(const AttrValue_ListValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   AttrValue_ListValue(AttrValue_ListValue&& from) noexcept
     : AttrValue_ListValue() {
     *this = ::std::move(from);
   }
 
+  inline AttrValue_ListValue& operator=(const AttrValue_ListValue& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline AttrValue_ListValue& operator=(AttrValue_ListValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const AttrValue_ListValue& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const AttrValue_ListValue& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const AttrValue_ListValue* internal_default_instance() {
     return reinterpret_cast<const AttrValue_ListValue*>(
                &_AttrValue_ListValue_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void UnsafeArenaSwap(AttrValue_ListValue* other);
-  void Swap(AttrValue_ListValue* other);
   friend void swap(AttrValue_ListValue& a, AttrValue_ListValue& b) {
     a.Swap(&b);
   }
+  inline void Swap(AttrValue_ListValue* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(AttrValue_ListValue* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline AttrValue_ListValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  AttrValue_ListValue* 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;
+  AttrValue_ListValue* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<AttrValue_ListValue>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const AttrValue_ListValue& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const AttrValue_ListValue& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(AttrValue_ListValue* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.AttrValue.ListValue";
+  }
   protected:
-  explicit AttrValue_ListValue(::google::protobuf::Arena* arena);
+  explicit AttrValue_ListValue(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSFieldNumber = 2,
+    kIFieldNumber = 3,
+    kFFieldNumber = 4,
+    kBFieldNumber = 5,
+    kTypeFieldNumber = 6,
+    kShapeFieldNumber = 7,
+    kTensorFieldNumber = 8,
+  };
   // repeated bytes s = 2;
   int s_size() const;
+  private:
+  int _internal_s_size() const;
+  public:
   void clear_s();
-  static const int kSFieldNumber = 2;
-  const ::std::string& s(int index) const;
-  ::std::string* mutable_s(int index);
-  void set_s(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_s(int index, ::std::string&& value);
-  #endif
+  const std::string& s(int index) const;
+  std::string* mutable_s(int index);
+  void set_s(int index, const std::string& value);
+  void set_s(int index, std::string&& value);
   void set_s(int index, const char* value);
   void set_s(int index, const void* value, size_t size);
-  ::std::string* add_s();
-  void add_s(const ::std::string& value);
-  #if LANG_CXX11
-  void add_s(::std::string&& value);
-  #endif
+  std::string* add_s();
+  void add_s(const std::string& value);
+  void add_s(std::string&& value);
   void add_s(const char* value);
   void add_s(const void* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& s() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_s();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& s() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_s();
+  private:
+  const std::string& _internal_s(int index) const;
+  std::string* _internal_add_s();
+  public:
 
   // repeated int64 i = 3 [packed = true];
   int i_size() const;
+  private:
+  int _internal_i_size() const;
+  public:
   void clear_i();
-  static const int kIFieldNumber = 3;
-  ::google::protobuf::int64 i(int index) const;
-  void set_i(int index, ::google::protobuf::int64 value);
-  void add_i(::google::protobuf::int64 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+  private:
+  int64_t _internal_i(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+      _internal_i() const;
+  void _internal_add_i(int64_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+      _internal_mutable_i();
+  public:
+  int64_t i(int index) const;
+  void set_i(int index, int64_t value);
+  void add_i(int64_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
       i() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
       mutable_i();
 
   // repeated float f = 4 [packed = true];
   int f_size() const;
+  private:
+  int _internal_f_size() const;
+  public:
   void clear_f();
-  static const int kFFieldNumber = 4;
+  private:
+  float _internal_f(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_f() const;
+  void _internal_add_f(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_f();
+  public:
   float f(int index) const;
   void set_f(int index, float value);
   void add_f(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       f() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_f();
 
   // repeated bool b = 5 [packed = true];
   int b_size() const;
+  private:
+  int _internal_b_size() const;
+  public:
   void clear_b();
-  static const int kBFieldNumber = 5;
+  private:
+  bool _internal_b(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
+      _internal_b() const;
+  void _internal_add_b(bool value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
+      _internal_mutable_b();
+  public:
   bool b(int index) const;
   void set_b(int index, bool value);
   void add_b(bool value);
-  const ::google::protobuf::RepeatedField< bool >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
       b() const;
-  ::google::protobuf::RepeatedField< bool >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
       mutable_b();
 
   // repeated .opencv_tensorflow.DataType type = 6 [packed = true];
   int type_size() const;
+  private:
+  int _internal_type_size() const;
+  public:
   void clear_type();
-  static const int kTypeFieldNumber = 6;
+  private:
+  ::opencv_tensorflow::DataType _internal_type(int index) const;
+  void _internal_add_type(::opencv_tensorflow::DataType value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>* _internal_mutable_type();
+  public:
   ::opencv_tensorflow::DataType type(int index) const;
   void set_type(int index, ::opencv_tensorflow::DataType value);
   void add_type(::opencv_tensorflow::DataType value);
-  const ::google::protobuf::RepeatedField<int>& type() const;
-  ::google::protobuf::RepeatedField<int>* mutable_type();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>& type() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>* mutable_type();
 
   // repeated .opencv_tensorflow.TensorShapeProto shape = 7;
   int shape_size() const;
+  private:
+  int _internal_shape_size() const;
+  public:
   void clear_shape();
-  static const int kShapeFieldNumber = 7;
-  const ::opencv_tensorflow::TensorShapeProto& shape(int index) const;
   ::opencv_tensorflow::TensorShapeProto* mutable_shape(int index);
-  ::opencv_tensorflow::TensorShapeProto* add_shape();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto >*
       mutable_shape();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto >&
+  private:
+  const ::opencv_tensorflow::TensorShapeProto& _internal_shape(int index) const;
+  ::opencv_tensorflow::TensorShapeProto* _internal_add_shape();
+  public:
+  const ::opencv_tensorflow::TensorShapeProto& shape(int index) const;
+  ::opencv_tensorflow::TensorShapeProto* add_shape();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto >&
       shape() const;
 
   // repeated .opencv_tensorflow.TensorProto tensor = 8;
   int tensor_size() const;
+  private:
+  int _internal_tensor_size() const;
+  public:
   void clear_tensor();
-  static const int kTensorFieldNumber = 8;
-  const ::opencv_tensorflow::TensorProto& tensor(int index) const;
   ::opencv_tensorflow::TensorProto* mutable_tensor(int index);
-  ::opencv_tensorflow::TensorProto* add_tensor();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorProto >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorProto >*
       mutable_tensor();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorProto >&
+  private:
+  const ::opencv_tensorflow::TensorProto& _internal_tensor(int index) const;
+  ::opencv_tensorflow::TensorProto* _internal_add_tensor();
+  public:
+  const ::opencv_tensorflow::TensorProto& tensor(int index) const;
+  ::opencv_tensorflow::TensorProto* add_tensor();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorProto >&
       tensor() const;
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.AttrValue.ListValue)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> s_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > i_;
-  mutable int _i_cached_byte_size_;
-  ::google::protobuf::RepeatedField< float > f_;
-  mutable int _f_cached_byte_size_;
-  ::google::protobuf::RepeatedField< bool > b_;
-  mutable int _b_cached_byte_size_;
-  ::google::protobuf::RepeatedField<int> type_;
-  mutable int _type_cached_byte_size_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto > shape_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorProto > tensor_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_attr_5fvalue_2eproto::TableStruct;
-  friend void ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue_ListValueImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> s_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t > i_;
+  mutable std::atomic<int> _i_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > f_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool > b_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int> type_;
+  mutable std::atomic<int> _type_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto > shape_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorProto > tensor_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_attr_5fvalue_2eproto;
 };
 // -------------------------------------------------------------------
 
-class AttrValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.AttrValue) */ {
+class AttrValue final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.AttrValue) */ {
  public:
-  AttrValue();
-  virtual ~AttrValue();
+  inline AttrValue() : AttrValue(nullptr) {}
+  ~AttrValue() override;
+  explicit constexpr AttrValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   AttrValue(const AttrValue& from);
-
-  inline AttrValue& operator=(const AttrValue& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   AttrValue(AttrValue&& from) noexcept
     : AttrValue() {
     *this = ::std::move(from);
   }
 
+  inline AttrValue& operator=(const AttrValue& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline AttrValue& operator=(AttrValue&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const AttrValue& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const AttrValue& default_instance();
-
   enum ValueCase {
     kS = 2,
     kI = 3,
@@ -334,60 +434,79 @@ class AttrValue : public ::google::protobuf::Message /* @@protoc_insertion_point
     VALUE_NOT_SET = 0,
   };
 
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const AttrValue* internal_default_instance() {
     return reinterpret_cast<const AttrValue*>(
                &_AttrValue_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     1;
 
-  void UnsafeArenaSwap(AttrValue* other);
-  void Swap(AttrValue* other);
   friend void swap(AttrValue& a, AttrValue& b) {
     a.Swap(&b);
   }
+  inline void Swap(AttrValue* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(AttrValue* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline AttrValue* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  AttrValue* 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;
+  AttrValue* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<AttrValue>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const AttrValue& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const AttrValue& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(AttrValue* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.AttrValue";
+  }
   protected:
-  explicit AttrValue(::google::protobuf::Arena* arena);
+  explicit AttrValue(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -395,157 +514,183 @@ class AttrValue : public ::google::protobuf::Message /* @@protoc_insertion_point
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kSFieldNumber = 2,
+    kIFieldNumber = 3,
+    kFFieldNumber = 4,
+    kBFieldNumber = 5,
+    kTypeFieldNumber = 6,
+    kShapeFieldNumber = 7,
+    kTensorFieldNumber = 8,
+    kListFieldNumber = 1,
+    kFuncFieldNumber = 10,
+    kPlaceholderFieldNumber = 9,
+  };
   // bytes s = 2;
-  private:
   bool has_s() const;
+  private:
+  bool _internal_has_s() const;
   public:
   void clear_s();
-  static const int kSFieldNumber = 2;
-  const ::std::string& s() const;
-  void set_s(const ::std::string& value);
-  #if LANG_CXX11
-  void set_s(::std::string&& value);
-  #endif
-  void set_s(const char* value);
-  void set_s(const void* value, size_t size);
-  ::std::string* mutable_s();
-  ::std::string* release_s();
-  void set_allocated_s(::std::string* s);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_s();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_s(
-      ::std::string* s);
+  const std::string& s() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_s(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_s();
+  PROTOBUF_NODISCARD std::string* release_s();
+  void set_allocated_s(std::string* s);
+  private:
+  const std::string& _internal_s() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_s(const std::string& value);
+  std::string* _internal_mutable_s();
+  public:
 
   // int64 i = 3;
-  private:
   bool has_i() const;
+  private:
+  bool _internal_has_i() const;
   public:
   void clear_i();
-  static const int kIFieldNumber = 3;
-  ::google::protobuf::int64 i() const;
-  void set_i(::google::protobuf::int64 value);
+  int64_t i() const;
+  void set_i(int64_t value);
+  private:
+  int64_t _internal_i() const;
+  void _internal_set_i(int64_t value);
+  public:
 
   // float f = 4;
-  private:
   bool has_f() const;
+  private:
+  bool _internal_has_f() const;
   public:
   void clear_f();
-  static const int kFFieldNumber = 4;
   float f() const;
   void set_f(float value);
+  private:
+  float _internal_f() const;
+  void _internal_set_f(float value);
+  public:
 
   // bool b = 5;
-  private:
   bool has_b() const;
+  private:
+  bool _internal_has_b() const;
   public:
   void clear_b();
-  static const int kBFieldNumber = 5;
   bool b() const;
   void set_b(bool value);
+  private:
+  bool _internal_b() const;
+  void _internal_set_b(bool value);
+  public:
 
   // .opencv_tensorflow.DataType type = 6;
-  private:
   bool has_type() const;
+  private:
+  bool _internal_has_type() const;
   public:
   void clear_type();
-  static const int kTypeFieldNumber = 6;
   ::opencv_tensorflow::DataType type() const;
   void set_type(::opencv_tensorflow::DataType value);
+  private:
+  ::opencv_tensorflow::DataType _internal_type() const;
+  void _internal_set_type(::opencv_tensorflow::DataType value);
+  public:
 
   // .opencv_tensorflow.TensorShapeProto shape = 7;
   bool has_shape() const;
-  void clear_shape();
-  static const int kShapeFieldNumber = 7;
   private:
-  void _slow_mutable_shape();
+  bool _internal_has_shape() const;
   public:
+  void clear_shape();
   const ::opencv_tensorflow::TensorShapeProto& shape() const;
-  ::opencv_tensorflow::TensorShapeProto* release_shape();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::TensorShapeProto* release_shape();
   ::opencv_tensorflow::TensorShapeProto* mutable_shape();
   void set_allocated_shape(::opencv_tensorflow::TensorShapeProto* shape);
+  private:
+  const ::opencv_tensorflow::TensorShapeProto& _internal_shape() const;
+  ::opencv_tensorflow::TensorShapeProto* _internal_mutable_shape();
+  public:
   void unsafe_arena_set_allocated_shape(
       ::opencv_tensorflow::TensorShapeProto* shape);
   ::opencv_tensorflow::TensorShapeProto* unsafe_arena_release_shape();
 
   // .opencv_tensorflow.TensorProto tensor = 8;
   bool has_tensor() const;
-  void clear_tensor();
-  static const int kTensorFieldNumber = 8;
   private:
-  void _slow_mutable_tensor();
+  bool _internal_has_tensor() const;
   public:
+  void clear_tensor();
   const ::opencv_tensorflow::TensorProto& tensor() const;
-  ::opencv_tensorflow::TensorProto* release_tensor();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::TensorProto* release_tensor();
   ::opencv_tensorflow::TensorProto* mutable_tensor();
   void set_allocated_tensor(::opencv_tensorflow::TensorProto* tensor);
+  private:
+  const ::opencv_tensorflow::TensorProto& _internal_tensor() const;
+  ::opencv_tensorflow::TensorProto* _internal_mutable_tensor();
+  public:
   void unsafe_arena_set_allocated_tensor(
       ::opencv_tensorflow::TensorProto* tensor);
   ::opencv_tensorflow::TensorProto* unsafe_arena_release_tensor();
 
   // .opencv_tensorflow.AttrValue.ListValue list = 1;
   bool has_list() const;
-  void clear_list();
-  static const int kListFieldNumber = 1;
   private:
-  void _slow_mutable_list();
+  bool _internal_has_list() const;
   public:
+  void clear_list();
   const ::opencv_tensorflow::AttrValue_ListValue& list() const;
-  ::opencv_tensorflow::AttrValue_ListValue* release_list();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::AttrValue_ListValue* release_list();
   ::opencv_tensorflow::AttrValue_ListValue* mutable_list();
   void set_allocated_list(::opencv_tensorflow::AttrValue_ListValue* list);
+  private:
+  const ::opencv_tensorflow::AttrValue_ListValue& _internal_list() const;
+  ::opencv_tensorflow::AttrValue_ListValue* _internal_mutable_list();
+  public:
   void unsafe_arena_set_allocated_list(
       ::opencv_tensorflow::AttrValue_ListValue* list);
   ::opencv_tensorflow::AttrValue_ListValue* unsafe_arena_release_list();
 
   // .opencv_tensorflow.NameAttrList func = 10;
   bool has_func() const;
-  void clear_func();
-  static const int kFuncFieldNumber = 10;
   private:
-  void _slow_mutable_func();
+  bool _internal_has_func() const;
   public:
+  void clear_func();
   const ::opencv_tensorflow::NameAttrList& func() const;
-  ::opencv_tensorflow::NameAttrList* release_func();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::NameAttrList* release_func();
   ::opencv_tensorflow::NameAttrList* mutable_func();
   void set_allocated_func(::opencv_tensorflow::NameAttrList* func);
+  private:
+  const ::opencv_tensorflow::NameAttrList& _internal_func() const;
+  ::opencv_tensorflow::NameAttrList* _internal_mutable_func();
+  public:
   void unsafe_arena_set_allocated_func(
       ::opencv_tensorflow::NameAttrList* func);
   ::opencv_tensorflow::NameAttrList* unsafe_arena_release_func();
 
   // string placeholder = 9;
-  private:
   bool has_placeholder() const;
+  private:
+  bool _internal_has_placeholder() const;
   public:
   void clear_placeholder();
-  static const int kPlaceholderFieldNumber = 9;
-  const ::std::string& placeholder() const;
-  void set_placeholder(const ::std::string& value);
-  #if LANG_CXX11
-  void set_placeholder(::std::string&& value);
-  #endif
-  void set_placeholder(const char* value);
-  void set_placeholder(const char* value, size_t size);
-  ::std::string* mutable_placeholder();
-  ::std::string* release_placeholder();
-  void set_allocated_placeholder(::std::string* placeholder);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_placeholder();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_placeholder(
-      ::std::string* placeholder);
+  const std::string& placeholder() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_placeholder(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_placeholder();
+  PROTOBUF_NODISCARD std::string* release_placeholder();
+  void set_allocated_placeholder(std::string* placeholder);
+  private:
+  const std::string& _internal_placeholder() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_placeholder(const std::string& value);
+  std::string* _internal_mutable_placeholder();
+  public:
 
+  void clear_value();
   ValueCase value_case() const;
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.AttrValue)
  private:
+  class _Internal;
   void set_has_s();
   void set_has_i();
   void set_has_f();
@@ -558,17 +703,16 @@ class AttrValue : public ::google::protobuf::Message /* @@protoc_insertion_point
   void set_has_placeholder();
 
   inline bool has_value() const;
-  void clear_value();
   inline void clear_has_value();
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
   union ValueUnion {
-    ValueUnion() {}
-    ::google::protobuf::internal::ArenaStringPtr s_;
-    ::google::protobuf::int64 i_;
+    constexpr ValueUnion() : _constinit_{} {}
+      ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_;
+    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr s_;
+    int64_t i_;
     float f_;
     bool b_;
     int type_;
@@ -576,181 +720,212 @@ class AttrValue : public ::google::protobuf::Message /* @@protoc_insertion_point
     ::opencv_tensorflow::TensorProto* tensor_;
     ::opencv_tensorflow::AttrValue_ListValue* list_;
     ::opencv_tensorflow::NameAttrList* func_;
-    ::google::protobuf::internal::ArenaStringPtr placeholder_;
+    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr placeholder_;
   } value_;
-  mutable int _cached_size_;
-  ::google::protobuf::uint32 _oneof_case_[1];
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  uint32_t _oneof_case_[1];
 
-  friend struct ::protobuf_attr_5fvalue_2eproto::TableStruct;
-  friend void ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValueImpl();
+  friend struct ::TableStruct_attr_5fvalue_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NameAttrList_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry<NameAttrList_AttrEntry_DoNotUse,
-    ::std::string, ::opencv_tensorflow::AttrValue,
-    ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-    ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-    0 > {
+class NameAttrList_AttrEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<NameAttrList_AttrEntry_DoNotUse,
+    std::string, ::opencv_tensorflow::AttrValue,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> {
 public:
-  typedef ::google::protobuf::internal::MapEntry<NameAttrList_AttrEntry_DoNotUse,
-    ::std::string, ::opencv_tensorflow::AttrValue,
-    ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-    ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-    0 > SuperType;
+  typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<NameAttrList_AttrEntry_DoNotUse,
+    std::string, ::opencv_tensorflow::AttrValue,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> SuperType;
   NameAttrList_AttrEntry_DoNotUse();
-  NameAttrList_AttrEntry_DoNotUse(::google::protobuf::Arena* arena);
+  explicit constexpr NameAttrList_AttrEntry_DoNotUse(
+      ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
+  explicit NameAttrList_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   void MergeFrom(const NameAttrList_AttrEntry_DoNotUse& other);
   static const NameAttrList_AttrEntry_DoNotUse* internal_default_instance() { return reinterpret_cast<const NameAttrList_AttrEntry_DoNotUse*>(&_NameAttrList_AttrEntry_DoNotUse_default_instance_); }
-  void MergeFrom(const ::google::protobuf::Message& other) PROTOBUF_FINAL;
-  ::google::protobuf::Metadata GetMetadata() const;
+  static bool ValidateKey(std::string* s) {
+    return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast<int>(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "opencv_tensorflow.NameAttrList.AttrEntry.key");
+ }
+  static bool ValidateValue(void*) { return true; }
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 };
 
 // -------------------------------------------------------------------
 
-class NameAttrList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.NameAttrList) */ {
+class NameAttrList final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.NameAttrList) */ {
  public:
-  NameAttrList();
-  virtual ~NameAttrList();
+  inline NameAttrList() : NameAttrList(nullptr) {}
+  ~NameAttrList() override;
+  explicit constexpr NameAttrList(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NameAttrList(const NameAttrList& from);
-
-  inline NameAttrList& operator=(const NameAttrList& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NameAttrList(NameAttrList&& from) noexcept
     : NameAttrList() {
     *this = ::std::move(from);
   }
 
+  inline NameAttrList& operator=(const NameAttrList& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NameAttrList& operator=(NameAttrList&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NameAttrList& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NameAttrList& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const NameAttrList* internal_default_instance() {
     return reinterpret_cast<const NameAttrList*>(
                &_NameAttrList_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     3;
 
-  void UnsafeArenaSwap(NameAttrList* other);
-  void Swap(NameAttrList* other);
   friend void swap(NameAttrList& a, NameAttrList& b) {
     a.Swap(&b);
   }
+  inline void Swap(NameAttrList* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NameAttrList* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NameAttrList* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NameAttrList* 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;
+  NameAttrList* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NameAttrList>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NameAttrList& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NameAttrList& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NameAttrList* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.NameAttrList";
+  }
   protected:
-  explicit NameAttrList(::google::protobuf::Arena* arena);
+  explicit NameAttrList(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kAttrFieldNumber = 2,
+    kNameFieldNumber = 1,
+  };
   // map<string, .opencv_tensorflow.AttrValue> attr = 2;
   int attr_size() const;
+  private:
+  int _internal_attr_size() const;
+  public:
   void clear_attr();
-  static const int kAttrFieldNumber = 2;
-  const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
+      _internal_attr() const;
+  ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
+      _internal_mutable_attr();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
       attr() const;
-  ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
+  ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
       mutable_attr();
 
   // string name = 1;
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.NameAttrList)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::internal::MapField<
+  ::PROTOBUF_NAMESPACE_ID::internal::MapField<
       NameAttrList_AttrEntry_DoNotUse,
-      ::std::string, ::opencv_tensorflow::AttrValue,
-      ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-      ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-      0 > attr_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_attr_5fvalue_2eproto::TableStruct;
-  friend void ::protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValueImpl();
+      std::string, ::opencv_tensorflow::AttrValue,
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> attr_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_attr_5fvalue_2eproto;
 };
 // ===================================================================
 
@@ -764,32 +939,41 @@ class NameAttrList : public ::google::protobuf::Message /* @@protoc_insertion_po
 // AttrValue_ListValue
 
 // repeated bytes s = 2;
-inline int AttrValue_ListValue::s_size() const {
+inline int AttrValue_ListValue::_internal_s_size() const {
   return s_.size();
 }
+inline int AttrValue_ListValue::s_size() const {
+  return _internal_s_size();
+}
 inline void AttrValue_ListValue::clear_s() {
   s_.Clear();
 }
-inline const ::std::string& AttrValue_ListValue::s(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.s)
+inline std::string* AttrValue_ListValue::add_s() {
+  std::string* _s = _internal_add_s();
+  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.AttrValue.ListValue.s)
+  return _s;
+}
+inline const std::string& AttrValue_ListValue::_internal_s(int index) const {
   return s_.Get(index);
 }
-inline ::std::string* AttrValue_ListValue::mutable_s(int index) {
+inline const std::string& AttrValue_ListValue::s(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.s)
+  return _internal_s(index);
+}
+inline std::string* AttrValue_ListValue::mutable_s(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.ListValue.s)
   return s_.Mutable(index);
 }
-inline void AttrValue_ListValue::set_s(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.ListValue.s)
+inline void AttrValue_ListValue::set_s(int index, const std::string& value) {
   s_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void AttrValue_ListValue::set_s(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.ListValue.s)
+}
+inline void AttrValue_ListValue::set_s(int index, std::string&& value) {
   s_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.ListValue.s)
 }
-#endif
 inline void AttrValue_ListValue::set_s(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   s_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_tensorflow.AttrValue.ListValue.s)
 }
@@ -798,22 +982,19 @@ inline void AttrValue_ListValue::set_s(int index, const void* value, size_t size
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.AttrValue.ListValue.s)
 }
-inline ::std::string* AttrValue_ListValue::add_s() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.AttrValue.ListValue.s)
+inline std::string* AttrValue_ListValue::_internal_add_s() {
   return s_.Add();
 }
-inline void AttrValue_ListValue::add_s(const ::std::string& value) {
+inline void AttrValue_ListValue::add_s(const std::string& value) {
   s_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.s)
 }
-#if LANG_CXX11
-inline void AttrValue_ListValue::add_s(::std::string&& value) {
+inline void AttrValue_ListValue::add_s(std::string&& value) {
   s_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.s)
 }
-#endif
 inline void AttrValue_ListValue::add_s(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   s_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_tensorflow.AttrValue.ListValue.s)
 }
@@ -821,186 +1002,270 @@ inline void AttrValue_ListValue::add_s(const void* value, size_t size) {
   s_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.AttrValue.ListValue.s)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 AttrValue_ListValue::s() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.AttrValue.ListValue.s)
   return s_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 AttrValue_ListValue::mutable_s() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.AttrValue.ListValue.s)
   return &s_;
 }
 
 // repeated int64 i = 3 [packed = true];
-inline int AttrValue_ListValue::i_size() const {
+inline int AttrValue_ListValue::_internal_i_size() const {
   return i_.size();
 }
+inline int AttrValue_ListValue::i_size() const {
+  return _internal_i_size();
+}
 inline void AttrValue_ListValue::clear_i() {
   i_.Clear();
 }
-inline ::google::protobuf::int64 AttrValue_ListValue::i(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.i)
+inline int64_t AttrValue_ListValue::_internal_i(int index) const {
   return i_.Get(index);
 }
-inline void AttrValue_ListValue::set_i(int index, ::google::protobuf::int64 value) {
+inline int64_t AttrValue_ListValue::i(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.i)
+  return _internal_i(index);
+}
+inline void AttrValue_ListValue::set_i(int index, int64_t value) {
   i_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.ListValue.i)
 }
-inline void AttrValue_ListValue::add_i(::google::protobuf::int64 value) {
+inline void AttrValue_ListValue::_internal_add_i(int64_t value) {
   i_.Add(value);
+}
+inline void AttrValue_ListValue::add_i(int64_t value) {
+  _internal_add_i(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.i)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+AttrValue_ListValue::_internal_i() const {
+  return i_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
 AttrValue_ListValue::i() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.AttrValue.ListValue.i)
-  return i_;
+  return _internal_i();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+AttrValue_ListValue::_internal_mutable_i() {
+  return &i_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
 AttrValue_ListValue::mutable_i() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.AttrValue.ListValue.i)
-  return &i_;
+  return _internal_mutable_i();
 }
 
 // repeated float f = 4 [packed = true];
-inline int AttrValue_ListValue::f_size() const {
+inline int AttrValue_ListValue::_internal_f_size() const {
   return f_.size();
 }
+inline int AttrValue_ListValue::f_size() const {
+  return _internal_f_size();
+}
 inline void AttrValue_ListValue::clear_f() {
   f_.Clear();
 }
+inline float AttrValue_ListValue::_internal_f(int index) const {
+  return f_.Get(index);
+}
 inline float AttrValue_ListValue::f(int index) const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.f)
-  return f_.Get(index);
+  return _internal_f(index);
 }
 inline void AttrValue_ListValue::set_f(int index, float value) {
   f_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.ListValue.f)
 }
-inline void AttrValue_ListValue::add_f(float value) {
+inline void AttrValue_ListValue::_internal_add_f(float value) {
   f_.Add(value);
+}
+inline void AttrValue_ListValue::add_f(float value) {
+  _internal_add_f(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.f)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+AttrValue_ListValue::_internal_f() const {
+  return f_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 AttrValue_ListValue::f() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.AttrValue.ListValue.f)
-  return f_;
+  return _internal_f();
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+AttrValue_ListValue::_internal_mutable_f() {
+  return &f_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 AttrValue_ListValue::mutable_f() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.AttrValue.ListValue.f)
-  return &f_;
+  return _internal_mutable_f();
 }
 
 // repeated bool b = 5 [packed = true];
-inline int AttrValue_ListValue::b_size() const {
+inline int AttrValue_ListValue::_internal_b_size() const {
   return b_.size();
 }
+inline int AttrValue_ListValue::b_size() const {
+  return _internal_b_size();
+}
 inline void AttrValue_ListValue::clear_b() {
   b_.Clear();
 }
+inline bool AttrValue_ListValue::_internal_b(int index) const {
+  return b_.Get(index);
+}
 inline bool AttrValue_ListValue::b(int index) const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.b)
-  return b_.Get(index);
+  return _internal_b(index);
 }
 inline void AttrValue_ListValue::set_b(int index, bool value) {
   b_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.ListValue.b)
 }
-inline void AttrValue_ListValue::add_b(bool value) {
+inline void AttrValue_ListValue::_internal_add_b(bool value) {
   b_.Add(value);
+}
+inline void AttrValue_ListValue::add_b(bool value) {
+  _internal_add_b(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.b)
 }
-inline const ::google::protobuf::RepeatedField< bool >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
+AttrValue_ListValue::_internal_b() const {
+  return b_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
 AttrValue_ListValue::b() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.AttrValue.ListValue.b)
-  return b_;
+  return _internal_b();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
+AttrValue_ListValue::_internal_mutable_b() {
+  return &b_;
 }
-inline ::google::protobuf::RepeatedField< bool >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
 AttrValue_ListValue::mutable_b() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.AttrValue.ListValue.b)
-  return &b_;
+  return _internal_mutable_b();
 }
 
 // repeated .opencv_tensorflow.DataType type = 6 [packed = true];
-inline int AttrValue_ListValue::type_size() const {
+inline int AttrValue_ListValue::_internal_type_size() const {
   return type_.size();
 }
+inline int AttrValue_ListValue::type_size() const {
+  return _internal_type_size();
+}
 inline void AttrValue_ListValue::clear_type() {
   type_.Clear();
 }
+inline ::opencv_tensorflow::DataType AttrValue_ListValue::_internal_type(int index) const {
+  return static_cast< ::opencv_tensorflow::DataType >(type_.Get(index));
+}
 inline ::opencv_tensorflow::DataType AttrValue_ListValue::type(int index) const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.type)
-  return static_cast< ::opencv_tensorflow::DataType >(type_.Get(index));
+  return _internal_type(index);
 }
 inline void AttrValue_ListValue::set_type(int index, ::opencv_tensorflow::DataType value) {
   type_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.ListValue.type)
 }
-inline void AttrValue_ListValue::add_type(::opencv_tensorflow::DataType value) {
+inline void AttrValue_ListValue::_internal_add_type(::opencv_tensorflow::DataType value) {
   type_.Add(value);
+}
+inline void AttrValue_ListValue::add_type(::opencv_tensorflow::DataType value) {
+  _internal_add_type(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.type)
 }
-inline const ::google::protobuf::RepeatedField<int>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>&
 AttrValue_ListValue::type() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.AttrValue.ListValue.type)
   return type_;
 }
-inline ::google::protobuf::RepeatedField<int>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>*
+AttrValue_ListValue::_internal_mutable_type() {
+  return &type_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>*
 AttrValue_ListValue::mutable_type() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.AttrValue.ListValue.type)
-  return &type_;
+  return _internal_mutable_type();
 }
 
 // repeated .opencv_tensorflow.TensorShapeProto shape = 7;
-inline int AttrValue_ListValue::shape_size() const {
+inline int AttrValue_ListValue::_internal_shape_size() const {
   return shape_.size();
 }
-inline const ::opencv_tensorflow::TensorShapeProto& AttrValue_ListValue::shape(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.shape)
-  return shape_.Get(index);
+inline int AttrValue_ListValue::shape_size() const {
+  return _internal_shape_size();
 }
 inline ::opencv_tensorflow::TensorShapeProto* AttrValue_ListValue::mutable_shape(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.ListValue.shape)
   return shape_.Mutable(index);
 }
-inline ::opencv_tensorflow::TensorShapeProto* AttrValue_ListValue::add_shape() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.shape)
-  return shape_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto >*
 AttrValue_ListValue::mutable_shape() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.AttrValue.ListValue.shape)
   return &shape_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto >&
+inline const ::opencv_tensorflow::TensorShapeProto& AttrValue_ListValue::_internal_shape(int index) const {
+  return shape_.Get(index);
+}
+inline const ::opencv_tensorflow::TensorShapeProto& AttrValue_ListValue::shape(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.shape)
+  return _internal_shape(index);
+}
+inline ::opencv_tensorflow::TensorShapeProto* AttrValue_ListValue::_internal_add_shape() {
+  return shape_.Add();
+}
+inline ::opencv_tensorflow::TensorShapeProto* AttrValue_ListValue::add_shape() {
+  ::opencv_tensorflow::TensorShapeProto* _add = _internal_add_shape();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.shape)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto >&
 AttrValue_ListValue::shape() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.AttrValue.ListValue.shape)
   return shape_;
 }
 
 // repeated .opencv_tensorflow.TensorProto tensor = 8;
-inline int AttrValue_ListValue::tensor_size() const {
+inline int AttrValue_ListValue::_internal_tensor_size() const {
   return tensor_.size();
 }
-inline const ::opencv_tensorflow::TensorProto& AttrValue_ListValue::tensor(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.tensor)
-  return tensor_.Get(index);
+inline int AttrValue_ListValue::tensor_size() const {
+  return _internal_tensor_size();
 }
 inline ::opencv_tensorflow::TensorProto* AttrValue_ListValue::mutable_tensor(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.ListValue.tensor)
   return tensor_.Mutable(index);
 }
-inline ::opencv_tensorflow::TensorProto* AttrValue_ListValue::add_tensor() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.tensor)
-  return tensor_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorProto >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorProto >*
 AttrValue_ListValue::mutable_tensor() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.AttrValue.ListValue.tensor)
   return &tensor_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorProto >&
+inline const ::opencv_tensorflow::TensorProto& AttrValue_ListValue::_internal_tensor(int index) const {
+  return tensor_.Get(index);
+}
+inline const ::opencv_tensorflow::TensorProto& AttrValue_ListValue::tensor(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.ListValue.tensor)
+  return _internal_tensor(index);
+}
+inline ::opencv_tensorflow::TensorProto* AttrValue_ListValue::_internal_add_tensor() {
+  return tensor_.Add();
+}
+inline ::opencv_tensorflow::TensorProto* AttrValue_ListValue::add_tensor() {
+  ::opencv_tensorflow::TensorProto* _add = _internal_add_tensor();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.AttrValue.ListValue.tensor)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorProto >&
 AttrValue_ListValue::tensor() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.AttrValue.ListValue.tensor)
   return tensor_;
@@ -1011,281 +1276,281 @@ AttrValue_ListValue::tensor() const {
 // AttrValue
 
 // bytes s = 2;
-inline bool AttrValue::has_s() const {
+inline bool AttrValue::_internal_has_s() const {
   return value_case() == kS;
 }
+inline bool AttrValue::has_s() const {
+  return _internal_has_s();
+}
 inline void AttrValue::set_has_s() {
   _oneof_case_[0] = kS;
 }
 inline void AttrValue::clear_s() {
-  if (has_s()) {
-    value_.s_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-        GetArenaNoVirtual());
+  if (_internal_has_s()) {
+    value_.s_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
     clear_has_value();
   }
 }
-inline const ::std::string& AttrValue::s() const {
+inline const std::string& AttrValue::s() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.s)
-  if (has_s()) {
-    return value_.s_.Get();
-  }
-  return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
+  return _internal_s();
 }
-inline void AttrValue::set_s(const ::std::string& value) {
-  if (!has_s()) {
+template <typename ArgT0, typename... ArgT>
+inline void AttrValue::set_s(ArgT0&& arg0, ArgT... args) {
+  if (!_internal_has_s()) {
     clear_value();
     set_has_s();
-    value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.s_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
-      GetArenaNoVirtual());
+  value_.s_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.s)
 }
-#if LANG_CXX11
-inline void AttrValue::set_s(::std::string&& value) {
-  // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.s)
-  if (!has_s()) {
-    clear_value();
-    set_has_s();
-    value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  }
-  value_.s_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.AttrValue.s)
+inline std::string* AttrValue::mutable_s() {
+  std::string* _s = _internal_mutable_s();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.s)
+  return _s;
 }
-#endif
-inline void AttrValue::set_s(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  if (!has_s()) {
-    clear_value();
-    set_has_s();
-    value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline const std::string& AttrValue::_internal_s() const {
+  if (_internal_has_s()) {
+    return value_.s_.Get();
   }
-  value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.AttrValue.s)
+  return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited();
 }
-inline void AttrValue::set_s(const void* value,
-                             size_t size) {
-  if (!has_s()) {
+inline void AttrValue::_internal_set_s(const std::string& value) {
+  if (!_internal_has_s()) {
     clear_value();
     set_has_s();
-    value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.s_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  value_.s_.Set(
-      &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size),
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.AttrValue.s)
+  value_.s_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* AttrValue::mutable_s() {
-  if (!has_s()) {
+inline std::string* AttrValue::_internal_mutable_s() {
+  if (!_internal_has_s()) {
     clear_value();
     set_has_s();
-    value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.s_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  return value_.s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.s)
+  return value_.s_.Mutable(
+      ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* AttrValue::release_s() {
+inline std::string* AttrValue::release_s() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.AttrValue.s)
-  if (has_s()) {
+  if (_internal_has_s()) {
     clear_has_value();
-    return value_.s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-        GetArenaNoVirtual());
+    return value_.s_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
   } else {
-    return NULL;
+    return nullptr;
   }
 }
-inline void AttrValue::set_allocated_s(::std::string* s) {
-  if (!has_s()) {
-    value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void AttrValue::set_allocated_s(std::string* s) {
+  if (has_value()) {
+    clear_value();
   }
-  clear_value();
-  if (s != NULL) {
+  if (s != nullptr) {
     set_has_s();
-    value_.s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s,
-        GetArenaNoVirtual());
+    value_.s_.UnsafeSetDefault(s);
+    ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaForAllocation();
+    if (arena != nullptr) {
+      arena->Own(s);
+    }
   }
   // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.AttrValue.s)
 }
-inline ::std::string* AttrValue::unsafe_arena_release_s() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.AttrValue.s)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (has_s()) {
-    clear_has_value();
-    return value_.s_.UnsafeArenaRelease(
-        &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  } else {
-    return NULL;
-  }
-}
-inline void AttrValue::unsafe_arena_set_allocated_s(::std::string* s) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (!has_s()) {
-    value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  }
-  clear_value();
-  if (s) {
-    set_has_s();
-    value_.s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s, GetArenaNoVirtual());
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.AttrValue.s)
-}
 
 // int64 i = 3;
-inline bool AttrValue::has_i() const {
+inline bool AttrValue::_internal_has_i() const {
   return value_case() == kI;
 }
+inline bool AttrValue::has_i() const {
+  return _internal_has_i();
+}
 inline void AttrValue::set_has_i() {
   _oneof_case_[0] = kI;
 }
 inline void AttrValue::clear_i() {
-  if (has_i()) {
-    value_.i_ = GOOGLE_LONGLONG(0);
+  if (_internal_has_i()) {
+    value_.i_ = int64_t{0};
     clear_has_value();
   }
 }
-inline ::google::protobuf::int64 AttrValue::i() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.i)
-  if (has_i()) {
+inline int64_t AttrValue::_internal_i() const {
+  if (_internal_has_i()) {
     return value_.i_;
   }
-  return GOOGLE_LONGLONG(0);
+  return int64_t{0};
 }
-inline void AttrValue::set_i(::google::protobuf::int64 value) {
-  if (!has_i()) {
+inline void AttrValue::_internal_set_i(int64_t value) {
+  if (!_internal_has_i()) {
     clear_value();
     set_has_i();
   }
   value_.i_ = value;
+}
+inline int64_t AttrValue::i() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.i)
+  return _internal_i();
+}
+inline void AttrValue::set_i(int64_t value) {
+  _internal_set_i(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.i)
 }
 
 // float f = 4;
-inline bool AttrValue::has_f() const {
+inline bool AttrValue::_internal_has_f() const {
   return value_case() == kF;
 }
+inline bool AttrValue::has_f() const {
+  return _internal_has_f();
+}
 inline void AttrValue::set_has_f() {
   _oneof_case_[0] = kF;
 }
 inline void AttrValue::clear_f() {
-  if (has_f()) {
+  if (_internal_has_f()) {
     value_.f_ = 0;
     clear_has_value();
   }
 }
-inline float AttrValue::f() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.f)
-  if (has_f()) {
+inline float AttrValue::_internal_f() const {
+  if (_internal_has_f()) {
     return value_.f_;
   }
   return 0;
 }
-inline void AttrValue::set_f(float value) {
-  if (!has_f()) {
+inline void AttrValue::_internal_set_f(float value) {
+  if (!_internal_has_f()) {
     clear_value();
     set_has_f();
   }
   value_.f_ = value;
+}
+inline float AttrValue::f() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.f)
+  return _internal_f();
+}
+inline void AttrValue::set_f(float value) {
+  _internal_set_f(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.f)
 }
 
 // bool b = 5;
-inline bool AttrValue::has_b() const {
+inline bool AttrValue::_internal_has_b() const {
   return value_case() == kB;
 }
+inline bool AttrValue::has_b() const {
+  return _internal_has_b();
+}
 inline void AttrValue::set_has_b() {
   _oneof_case_[0] = kB;
 }
 inline void AttrValue::clear_b() {
-  if (has_b()) {
+  if (_internal_has_b()) {
     value_.b_ = false;
     clear_has_value();
   }
 }
-inline bool AttrValue::b() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.b)
-  if (has_b()) {
+inline bool AttrValue::_internal_b() const {
+  if (_internal_has_b()) {
     return value_.b_;
   }
   return false;
 }
-inline void AttrValue::set_b(bool value) {
-  if (!has_b()) {
+inline void AttrValue::_internal_set_b(bool value) {
+  if (!_internal_has_b()) {
     clear_value();
     set_has_b();
   }
   value_.b_ = value;
+}
+inline bool AttrValue::b() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.b)
+  return _internal_b();
+}
+inline void AttrValue::set_b(bool value) {
+  _internal_set_b(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.b)
 }
 
 // .opencv_tensorflow.DataType type = 6;
-inline bool AttrValue::has_type() const {
+inline bool AttrValue::_internal_has_type() const {
   return value_case() == kType;
 }
+inline bool AttrValue::has_type() const {
+  return _internal_has_type();
+}
 inline void AttrValue::set_has_type() {
   _oneof_case_[0] = kType;
 }
 inline void AttrValue::clear_type() {
-  if (has_type()) {
+  if (_internal_has_type()) {
     value_.type_ = 0;
     clear_has_value();
   }
 }
-inline ::opencv_tensorflow::DataType AttrValue::type() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.type)
-  if (has_type()) {
+inline ::opencv_tensorflow::DataType AttrValue::_internal_type() const {
+  if (_internal_has_type()) {
     return static_cast< ::opencv_tensorflow::DataType >(value_.type_);
   }
   return static_cast< ::opencv_tensorflow::DataType >(0);
 }
-inline void AttrValue::set_type(::opencv_tensorflow::DataType value) {
-  if (!has_type()) {
+inline ::opencv_tensorflow::DataType AttrValue::type() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.type)
+  return _internal_type();
+}
+inline void AttrValue::_internal_set_type(::opencv_tensorflow::DataType value) {
+  if (!_internal_has_type()) {
     clear_value();
     set_has_type();
   }
   value_.type_ = value;
+}
+inline void AttrValue::set_type(::opencv_tensorflow::DataType value) {
+  _internal_set_type(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.type)
 }
 
 // .opencv_tensorflow.TensorShapeProto shape = 7;
-inline bool AttrValue::has_shape() const {
+inline bool AttrValue::_internal_has_shape() const {
   return value_case() == kShape;
 }
+inline bool AttrValue::has_shape() const {
+  return _internal_has_shape();
+}
 inline void AttrValue::set_has_shape() {
   _oneof_case_[0] = kShape;
 }
 inline ::opencv_tensorflow::TensorShapeProto* AttrValue::release_shape() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.AttrValue.shape)
-  if (has_shape()) {
+  if (_internal_has_shape()) {
     clear_has_value();
       ::opencv_tensorflow::TensorShapeProto* temp = value_.shape_;
-    if (GetArenaNoVirtual() != NULL) {
-      temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+    if (GetArenaForAllocation() != nullptr) {
+      temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
     }
-    value_.shape_ = NULL;
+    value_.shape_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
+inline const ::opencv_tensorflow::TensorShapeProto& AttrValue::_internal_shape() const {
+  return _internal_has_shape()
+      ? *value_.shape_
+      : reinterpret_cast< ::opencv_tensorflow::TensorShapeProto&>(::opencv_tensorflow::_TensorShapeProto_default_instance_);
+}
 inline const ::opencv_tensorflow::TensorShapeProto& AttrValue::shape() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.shape)
-  return has_shape()
-      ? *value_.shape_
-      : *reinterpret_cast< ::opencv_tensorflow::TensorShapeProto*>(&::opencv_tensorflow::_TensorShapeProto_default_instance_);
+  return _internal_shape();
 }
 inline ::opencv_tensorflow::TensorShapeProto* AttrValue::unsafe_arena_release_shape() {
   // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.AttrValue.shape)
-  if (has_shape()) {
+  if (_internal_has_shape()) {
     clear_has_value();
     ::opencv_tensorflow::TensorShapeProto* temp = value_.shape_;
-    value_.shape_ = NULL;
+    value_.shape_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
 inline void AttrValue::unsafe_arena_set_allocated_shape(::opencv_tensorflow::TensorShapeProto* shape) {
@@ -1296,54 +1561,62 @@ inline void AttrValue::unsafe_arena_set_allocated_shape(::opencv_tensorflow::Ten
   }
   // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.AttrValue.shape)
 }
-inline ::opencv_tensorflow::TensorShapeProto* AttrValue::mutable_shape() {
-  if (!has_shape()) {
+inline ::opencv_tensorflow::TensorShapeProto* AttrValue::_internal_mutable_shape() {
+  if (!_internal_has_shape()) {
     clear_value();
     set_has_shape();
-    value_.shape_ =
-      ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::TensorShapeProto >(
-      GetArenaNoVirtual());
+    value_.shape_ = CreateMaybeMessage< ::opencv_tensorflow::TensorShapeProto >(GetArenaForAllocation());
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.shape)
   return value_.shape_;
 }
+inline ::opencv_tensorflow::TensorShapeProto* AttrValue::mutable_shape() {
+  ::opencv_tensorflow::TensorShapeProto* _msg = _internal_mutable_shape();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.shape)
+  return _msg;
+}
 
 // .opencv_tensorflow.TensorProto tensor = 8;
-inline bool AttrValue::has_tensor() const {
+inline bool AttrValue::_internal_has_tensor() const {
   return value_case() == kTensor;
 }
+inline bool AttrValue::has_tensor() const {
+  return _internal_has_tensor();
+}
 inline void AttrValue::set_has_tensor() {
   _oneof_case_[0] = kTensor;
 }
 inline ::opencv_tensorflow::TensorProto* AttrValue::release_tensor() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.AttrValue.tensor)
-  if (has_tensor()) {
+  if (_internal_has_tensor()) {
     clear_has_value();
       ::opencv_tensorflow::TensorProto* temp = value_.tensor_;
-    if (GetArenaNoVirtual() != NULL) {
-      temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+    if (GetArenaForAllocation() != nullptr) {
+      temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
     }
-    value_.tensor_ = NULL;
+    value_.tensor_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
+inline const ::opencv_tensorflow::TensorProto& AttrValue::_internal_tensor() const {
+  return _internal_has_tensor()
+      ? *value_.tensor_
+      : reinterpret_cast< ::opencv_tensorflow::TensorProto&>(::opencv_tensorflow::_TensorProto_default_instance_);
+}
 inline const ::opencv_tensorflow::TensorProto& AttrValue::tensor() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.tensor)
-  return has_tensor()
-      ? *value_.tensor_
-      : *reinterpret_cast< ::opencv_tensorflow::TensorProto*>(&::opencv_tensorflow::_TensorProto_default_instance_);
+  return _internal_tensor();
 }
 inline ::opencv_tensorflow::TensorProto* AttrValue::unsafe_arena_release_tensor() {
   // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.AttrValue.tensor)
-  if (has_tensor()) {
+  if (_internal_has_tensor()) {
     clear_has_value();
     ::opencv_tensorflow::TensorProto* temp = value_.tensor_;
-    value_.tensor_ = NULL;
+    value_.tensor_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
 inline void AttrValue::unsafe_arena_set_allocated_tensor(::opencv_tensorflow::TensorProto* tensor) {
@@ -1354,28 +1627,33 @@ inline void AttrValue::unsafe_arena_set_allocated_tensor(::opencv_tensorflow::Te
   }
   // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.AttrValue.tensor)
 }
-inline ::opencv_tensorflow::TensorProto* AttrValue::mutable_tensor() {
-  if (!has_tensor()) {
+inline ::opencv_tensorflow::TensorProto* AttrValue::_internal_mutable_tensor() {
+  if (!_internal_has_tensor()) {
     clear_value();
     set_has_tensor();
-    value_.tensor_ =
-      ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::TensorProto >(
-      GetArenaNoVirtual());
+    value_.tensor_ = CreateMaybeMessage< ::opencv_tensorflow::TensorProto >(GetArenaForAllocation());
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.tensor)
   return value_.tensor_;
 }
+inline ::opencv_tensorflow::TensorProto* AttrValue::mutable_tensor() {
+  ::opencv_tensorflow::TensorProto* _msg = _internal_mutable_tensor();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.tensor)
+  return _msg;
+}
 
 // .opencv_tensorflow.AttrValue.ListValue list = 1;
-inline bool AttrValue::has_list() const {
+inline bool AttrValue::_internal_has_list() const {
   return value_case() == kList;
 }
+inline bool AttrValue::has_list() const {
+  return _internal_has_list();
+}
 inline void AttrValue::set_has_list() {
   _oneof_case_[0] = kList;
 }
 inline void AttrValue::clear_list() {
-  if (has_list()) {
-    if (GetArenaNoVirtual() == NULL) {
+  if (_internal_has_list()) {
+    if (GetArenaForAllocation() == nullptr) {
       delete value_.list_;
     }
     clear_has_value();
@@ -1383,33 +1661,36 @@ inline void AttrValue::clear_list() {
 }
 inline ::opencv_tensorflow::AttrValue_ListValue* AttrValue::release_list() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.AttrValue.list)
-  if (has_list()) {
+  if (_internal_has_list()) {
     clear_has_value();
       ::opencv_tensorflow::AttrValue_ListValue* temp = value_.list_;
-    if (GetArenaNoVirtual() != NULL) {
-      temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+    if (GetArenaForAllocation() != nullptr) {
+      temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
     }
-    value_.list_ = NULL;
+    value_.list_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
+inline const ::opencv_tensorflow::AttrValue_ListValue& AttrValue::_internal_list() const {
+  return _internal_has_list()
+      ? *value_.list_
+      : reinterpret_cast< ::opencv_tensorflow::AttrValue_ListValue&>(::opencv_tensorflow::_AttrValue_ListValue_default_instance_);
+}
 inline const ::opencv_tensorflow::AttrValue_ListValue& AttrValue::list() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.list)
-  return has_list()
-      ? *value_.list_
-      : *reinterpret_cast< ::opencv_tensorflow::AttrValue_ListValue*>(&::opencv_tensorflow::_AttrValue_ListValue_default_instance_);
+  return _internal_list();
 }
 inline ::opencv_tensorflow::AttrValue_ListValue* AttrValue::unsafe_arena_release_list() {
   // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.AttrValue.list)
-  if (has_list()) {
+  if (_internal_has_list()) {
     clear_has_value();
     ::opencv_tensorflow::AttrValue_ListValue* temp = value_.list_;
-    value_.list_ = NULL;
+    value_.list_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
 inline void AttrValue::unsafe_arena_set_allocated_list(::opencv_tensorflow::AttrValue_ListValue* list) {
@@ -1420,28 +1701,33 @@ inline void AttrValue::unsafe_arena_set_allocated_list(::opencv_tensorflow::Attr
   }
   // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.AttrValue.list)
 }
-inline ::opencv_tensorflow::AttrValue_ListValue* AttrValue::mutable_list() {
-  if (!has_list()) {
+inline ::opencv_tensorflow::AttrValue_ListValue* AttrValue::_internal_mutable_list() {
+  if (!_internal_has_list()) {
     clear_value();
     set_has_list();
-    value_.list_ =
-      ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::AttrValue_ListValue >(
-      GetArenaNoVirtual());
+    value_.list_ = CreateMaybeMessage< ::opencv_tensorflow::AttrValue_ListValue >(GetArenaForAllocation());
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.list)
   return value_.list_;
 }
+inline ::opencv_tensorflow::AttrValue_ListValue* AttrValue::mutable_list() {
+  ::opencv_tensorflow::AttrValue_ListValue* _msg = _internal_mutable_list();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.list)
+  return _msg;
+}
 
 // .opencv_tensorflow.NameAttrList func = 10;
-inline bool AttrValue::has_func() const {
+inline bool AttrValue::_internal_has_func() const {
   return value_case() == kFunc;
 }
+inline bool AttrValue::has_func() const {
+  return _internal_has_func();
+}
 inline void AttrValue::set_has_func() {
   _oneof_case_[0] = kFunc;
 }
 inline void AttrValue::clear_func() {
-  if (has_func()) {
-    if (GetArenaNoVirtual() == NULL) {
+  if (_internal_has_func()) {
+    if (GetArenaForAllocation() == nullptr) {
       delete value_.func_;
     }
     clear_has_value();
@@ -1449,33 +1735,36 @@ inline void AttrValue::clear_func() {
 }
 inline ::opencv_tensorflow::NameAttrList* AttrValue::release_func() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.AttrValue.func)
-  if (has_func()) {
+  if (_internal_has_func()) {
     clear_has_value();
       ::opencv_tensorflow::NameAttrList* temp = value_.func_;
-    if (GetArenaNoVirtual() != NULL) {
-      temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+    if (GetArenaForAllocation() != nullptr) {
+      temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
     }
-    value_.func_ = NULL;
+    value_.func_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
+inline const ::opencv_tensorflow::NameAttrList& AttrValue::_internal_func() const {
+  return _internal_has_func()
+      ? *value_.func_
+      : reinterpret_cast< ::opencv_tensorflow::NameAttrList&>(::opencv_tensorflow::_NameAttrList_default_instance_);
+}
 inline const ::opencv_tensorflow::NameAttrList& AttrValue::func() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.func)
-  return has_func()
-      ? *value_.func_
-      : *reinterpret_cast< ::opencv_tensorflow::NameAttrList*>(&::opencv_tensorflow::_NameAttrList_default_instance_);
+  return _internal_func();
 }
 inline ::opencv_tensorflow::NameAttrList* AttrValue::unsafe_arena_release_func() {
   // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.AttrValue.func)
-  if (has_func()) {
+  if (_internal_has_func()) {
     clear_has_value();
     ::opencv_tensorflow::NameAttrList* temp = value_.func_;
-    value_.func_ = NULL;
+    value_.func_ = nullptr;
     return temp;
   } else {
-    return NULL;
+    return nullptr;
   }
 }
 inline void AttrValue::unsafe_arena_set_allocated_func(::opencv_tensorflow::NameAttrList* func) {
@@ -1486,141 +1775,101 @@ inline void AttrValue::unsafe_arena_set_allocated_func(::opencv_tensorflow::Name
   }
   // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.AttrValue.func)
 }
-inline ::opencv_tensorflow::NameAttrList* AttrValue::mutable_func() {
-  if (!has_func()) {
+inline ::opencv_tensorflow::NameAttrList* AttrValue::_internal_mutable_func() {
+  if (!_internal_has_func()) {
     clear_value();
     set_has_func();
-    value_.func_ =
-      ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::NameAttrList >(
-      GetArenaNoVirtual());
+    value_.func_ = CreateMaybeMessage< ::opencv_tensorflow::NameAttrList >(GetArenaForAllocation());
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.func)
   return value_.func_;
 }
+inline ::opencv_tensorflow::NameAttrList* AttrValue::mutable_func() {
+  ::opencv_tensorflow::NameAttrList* _msg = _internal_mutable_func();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.func)
+  return _msg;
+}
 
 // string placeholder = 9;
-inline bool AttrValue::has_placeholder() const {
+inline bool AttrValue::_internal_has_placeholder() const {
   return value_case() == kPlaceholder;
 }
+inline bool AttrValue::has_placeholder() const {
+  return _internal_has_placeholder();
+}
 inline void AttrValue::set_has_placeholder() {
   _oneof_case_[0] = kPlaceholder;
 }
 inline void AttrValue::clear_placeholder() {
-  if (has_placeholder()) {
-    value_.placeholder_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-        GetArenaNoVirtual());
+  if (_internal_has_placeholder()) {
+    value_.placeholder_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
     clear_has_value();
   }
 }
-inline const ::std::string& AttrValue::placeholder() const {
+inline const std::string& AttrValue::placeholder() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.AttrValue.placeholder)
-  if (has_placeholder()) {
-    return value_.placeholder_.Get();
-  }
-  return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
+  return _internal_placeholder();
 }
-inline void AttrValue::set_placeholder(const ::std::string& value) {
-  if (!has_placeholder()) {
+template <typename ArgT0, typename... ArgT>
+inline void AttrValue::set_placeholder(ArgT0&& arg0, ArgT... args) {
+  if (!_internal_has_placeholder()) {
     clear_value();
     set_has_placeholder();
-    value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.placeholder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
-      GetArenaNoVirtual());
+  value_.placeholder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.placeholder)
 }
-#if LANG_CXX11
-inline void AttrValue::set_placeholder(::std::string&& value) {
-  // @@protoc_insertion_point(field_set:opencv_tensorflow.AttrValue.placeholder)
-  if (!has_placeholder()) {
-    clear_value();
-    set_has_placeholder();
-    value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  }
-  value_.placeholder_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.AttrValue.placeholder)
+inline std::string* AttrValue::mutable_placeholder() {
+  std::string* _s = _internal_mutable_placeholder();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.placeholder)
+  return _s;
 }
-#endif
-inline void AttrValue::set_placeholder(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  if (!has_placeholder()) {
-    clear_value();
-    set_has_placeholder();
-    value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline const std::string& AttrValue::_internal_placeholder() const {
+  if (_internal_has_placeholder()) {
+    return value_.placeholder_.Get();
   }
-  value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.AttrValue.placeholder)
+  return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited();
 }
-inline void AttrValue::set_placeholder(const char* value,
-                             size_t size) {
-  if (!has_placeholder()) {
+inline void AttrValue::_internal_set_placeholder(const std::string& value) {
+  if (!_internal_has_placeholder()) {
     clear_value();
     set_has_placeholder();
-    value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.placeholder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  value_.placeholder_.Set(
-      &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size),
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.AttrValue.placeholder)
+  value_.placeholder_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* AttrValue::mutable_placeholder() {
-  if (!has_placeholder()) {
+inline std::string* AttrValue::_internal_mutable_placeholder() {
+  if (!_internal_has_placeholder()) {
     clear_value();
     set_has_placeholder();
-    value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    value_.placeholder_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   }
-  return value_.placeholder_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.AttrValue.placeholder)
+  return value_.placeholder_.Mutable(
+      ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* AttrValue::release_placeholder() {
+inline std::string* AttrValue::release_placeholder() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.AttrValue.placeholder)
-  if (has_placeholder()) {
+  if (_internal_has_placeholder()) {
     clear_has_value();
-    return value_.placeholder_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-        GetArenaNoVirtual());
+    return value_.placeholder_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
   } else {
-    return NULL;
+    return nullptr;
   }
 }
-inline void AttrValue::set_allocated_placeholder(::std::string* placeholder) {
-  if (!has_placeholder()) {
-    value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void AttrValue::set_allocated_placeholder(std::string* placeholder) {
+  if (has_value()) {
+    clear_value();
   }
-  clear_value();
-  if (placeholder != NULL) {
+  if (placeholder != nullptr) {
     set_has_placeholder();
-    value_.placeholder_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placeholder,
-        GetArenaNoVirtual());
+    value_.placeholder_.UnsafeSetDefault(placeholder);
+    ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaForAllocation();
+    if (arena != nullptr) {
+      arena->Own(placeholder);
+    }
   }
   // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.AttrValue.placeholder)
 }
-inline ::std::string* AttrValue::unsafe_arena_release_placeholder() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.AttrValue.placeholder)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (has_placeholder()) {
-    clear_has_value();
-    return value_.placeholder_.UnsafeArenaRelease(
-        &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  } else {
-    return NULL;
-  }
-}
-inline void AttrValue::unsafe_arena_set_allocated_placeholder(::std::string* placeholder) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (!has_placeholder()) {
-    value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  }
-  clear_value();
-  if (placeholder) {
-    set_has_placeholder();
-    value_.placeholder_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placeholder, GetArenaNoVirtual());
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.AttrValue.placeholder)
-}
 
 inline bool AttrValue::has_value() const {
   return value_case() != VALUE_NOT_SET;
@@ -1639,95 +1888,82 @@ inline AttrValue::ValueCase AttrValue::value_case() const {
 
 // string name = 1;
 inline void NameAttrList::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  name_.ClearToEmpty();
 }
-inline const ::std::string& NameAttrList::name() const {
+inline const std::string& NameAttrList::name() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.NameAttrList.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void NameAttrList::set_name(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NameAttrList::set_name(ArgT0&& arg0, ArgT... args) {
 
 name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.NameAttrList.name)
 }
-#if LANG_CXX11
-inline void NameAttrList::set_name(::std::string&& value) {
-
-  name_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.NameAttrList.name)
+inline std::string* NameAttrList::mutable_name() {
+  std::string* _s = _internal_mutable_name();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NameAttrList.name)
+  return _s;
 }
-#endif
-inline void NameAttrList::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:opencv_tensorflow.NameAttrList.name)
+inline const std::string& NameAttrList::_internal_name() const {
+  return name_.Get();
 }
-inline void NameAttrList::set_name(const char* value,
-    size_t size) {
+inline void NameAttrList::_internal_set_name(const std::string& value) {
 
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NameAttrList.name)
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* NameAttrList::mutable_name() {
+inline std::string* NameAttrList::_internal_mutable_name() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NameAttrList.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* NameAttrList::release_name() {
+inline std::string* NameAttrList::release_name() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.NameAttrList.name)
-
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void NameAttrList::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
+inline void NameAttrList::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
 
   } else {
 
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NameAttrList.name)
-}
-inline ::std::string* NameAttrList::unsafe_arena_release_name() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.NameAttrList.name)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void NameAttrList::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-
-  } else {
-
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.NameAttrList.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NameAttrList.name)
 }
 
 // map<string, .opencv_tensorflow.AttrValue> attr = 2;
-inline int NameAttrList::attr_size() const {
+inline int NameAttrList::_internal_attr_size() const {
   return attr_.size();
 }
+inline int NameAttrList::attr_size() const {
+  return _internal_attr_size();
+}
 inline void NameAttrList::clear_attr() {
   attr_.Clear();
 }
-inline const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
+inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
+NameAttrList::_internal_attr() const {
+  return attr_.GetMap();
+}
+inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
 NameAttrList::attr() const {
   // @@protoc_insertion_point(field_map:opencv_tensorflow.NameAttrList.attr)
-  return attr_.GetMap();
+  return _internal_attr();
 }
-inline ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
+inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
+NameAttrList::_internal_mutable_attr() {
+  return attr_.MutableMap();
+}
+inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
 NameAttrList::mutable_attr() {
   // @@protoc_insertion_point(field_mutable_map:opencv_tensorflow.NameAttrList.attr)
-  return attr_.MutableMap();
+  return _internal_mutable_attr();
 }
 
 #ifdef __GNUC__
@@ -1746,4 +1982,5 @@ NameAttrList::mutable_attr() {
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_attr_5fvalue_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_attr_5fvalue_2eproto
index 6691c12..5a519e0 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_tensorflow {
-class FunctionDefLibraryDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FunctionDefLibrary>
-      _instance;
-} _FunctionDefLibrary_default_instance_;
-class FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FunctionDef_Node_AttrEntry_DoNotUse>
-      _instance;
-} _FunctionDef_Node_AttrEntry_DoNotUse_default_instance_;
-class FunctionDef_NodeDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FunctionDef_Node>
-      _instance;
-} _FunctionDef_Node_default_instance_;
-class FunctionDefDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<FunctionDef>
-      _instance;
-} _FunctionDef_default_instance_;
-class GradientDefDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<GradientDef>
-      _instance;
-} _GradientDef_default_instance_;
+constexpr FunctionDefLibrary::FunctionDefLibrary(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : function_()
+  , gradient_(){}
+struct FunctionDefLibraryDefaultTypeInternal {
+  constexpr FunctionDefLibraryDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FunctionDefLibraryDefaultTypeInternal() {}
+  union {
+    FunctionDefLibrary _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FunctionDefLibraryDefaultTypeInternal _FunctionDefLibrary_default_instance_;
+constexpr FunctionDef_Node_AttrEntry_DoNotUse::FunctionDef_Node_AttrEntry_DoNotUse(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){}
+struct FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal {
+  constexpr FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal() {}
+  union {
+    FunctionDef_Node_AttrEntry_DoNotUse _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal _FunctionDef_Node_AttrEntry_DoNotUse_default_instance_;
+constexpr FunctionDef_Node::FunctionDef_Node(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : ret_()
+  , arg_()
+  , dep_()
+  , attr_(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{})
+  , op_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct FunctionDef_NodeDefaultTypeInternal {
+  constexpr FunctionDef_NodeDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FunctionDef_NodeDefaultTypeInternal() {}
+  union {
+    FunctionDef_Node _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FunctionDef_NodeDefaultTypeInternal _FunctionDef_Node_default_instance_;
+constexpr FunctionDef::FunctionDef(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : node_()
+  , signature_(nullptr){}
+struct FunctionDefDefaultTypeInternal {
+  constexpr FunctionDefDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~FunctionDefDefaultTypeInternal() {}
+  union {
+    FunctionDef _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT FunctionDefDefaultTypeInternal _FunctionDef_default_instance_;
+constexpr GradientDef::GradientDef(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : function_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , gradient_func_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct GradientDefDefaultTypeInternal {
+  constexpr GradientDefDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~GradientDefDefaultTypeInternal() {}
+  union {
+    GradientDef _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GradientDefDefaultTypeInternal _GradientDef_default_instance_;
 }  // namespace opencv_tensorflow
-namespace protobuf_function_2eproto {
-void InitDefaultsFunctionDefLibraryImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_function_2eproto::InitDefaultsFunctionDef();
-  protobuf_function_2eproto::InitDefaultsGradientDef();
-  {
-    void* ptr = &::opencv_tensorflow::_FunctionDefLibrary_default_instance_;
-    new (ptr) ::opencv_tensorflow::FunctionDefLibrary();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::FunctionDefLibrary::InitAsDefaultInstance();
-}
-
-void InitDefaultsFunctionDefLibrary() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFunctionDefLibraryImpl);
-}
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_function_2eproto[5];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_function_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_function_2eproto = nullptr;
 
-void InitDefaultsFunctionDef_Node_AttrEntry_DoNotUseImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
-  {
-    void* ptr = &::opencv_tensorflow::_FunctionDef_Node_AttrEntry_DoNotUse_default_instance_;
-    new (ptr) ::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse();
-  }
-  ::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse::InitAsDefaultInstance();
-}
-
-void InitDefaultsFunctionDef_Node_AttrEntry_DoNotUse() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFunctionDef_Node_AttrEntry_DoNotUseImpl);
-}
-
-void InitDefaultsFunctionDef_NodeImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_function_2eproto::InitDefaultsFunctionDef_Node_AttrEntry_DoNotUse();
-  {
-    void* ptr = &::opencv_tensorflow::_FunctionDef_Node_default_instance_;
-    new (ptr) ::opencv_tensorflow::FunctionDef_Node();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::FunctionDef_Node::InitAsDefaultInstance();
-}
-
-void InitDefaultsFunctionDef_Node() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFunctionDef_NodeImpl);
-}
-
-void InitDefaultsFunctionDefImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_op_5fdef_2eproto::InitDefaultsOpDef();
-  protobuf_function_2eproto::InitDefaultsFunctionDef_Node();
-  {
-    void* ptr = &::opencv_tensorflow::_FunctionDef_default_instance_;
-    new (ptr) ::opencv_tensorflow::FunctionDef();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::FunctionDef::InitAsDefaultInstance();
-}
-
-void InitDefaultsFunctionDef() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFunctionDefImpl);
-}
-
-void InitDefaultsGradientDefImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_tensorflow::_GradientDef_default_instance_;
-    new (ptr) ::opencv_tensorflow::GradientDef();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::GradientDef::InitAsDefaultInstance();
-}
-
-void InitDefaultsGradientDef() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsGradientDefImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[5];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+const uint32_t TableStruct_function_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDefLibrary, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDefLibrary, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDefLibrary, function_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDefLibrary, gradient_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse, _internal_metadata_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDefLibrary, function_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDefLibrary, gradient_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse, key_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse, value_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse, key_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse, value_),
   0,
   1,
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, ret_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, op_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, arg_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, dep_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, attr_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, ret_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, op_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, arg_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, dep_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef_Node, attr_),
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef, signature_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::FunctionDef, node_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef, signature_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::FunctionDef, node_),
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GradientDef, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::GradientDef, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GradientDef, function_name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GradientDef, gradient_func_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::GradientDef, function_name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::GradientDef, gradient_func_),
 };
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, -1, sizeof(::opencv_tensorflow::FunctionDefLibrary)},
-  { 7, 14, sizeof(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse)},
-  { 16, -1, sizeof(::opencv_tensorflow::FunctionDef_Node)},
-  { 26, -1, sizeof(::opencv_tensorflow::FunctionDef)},
-  { 33, -1, sizeof(::opencv_tensorflow::GradientDef)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::opencv_tensorflow::FunctionDefLibrary)},
+  { 8, 16, -1, sizeof(::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse)},
+  { 18, -1, -1, sizeof(::opencv_tensorflow::FunctionDef_Node)},
+  { 29, -1, -1, sizeof(::opencv_tensorflow::FunctionDef)},
+  { 37, -1, -1, sizeof(::opencv_tensorflow::GradientDef)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_FunctionDefLibrary_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_FunctionDef_Node_AttrEntry_DoNotUse_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_FunctionDef_Node_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_FunctionDef_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_GradientDef_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_FunctionDefLibrary_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_FunctionDef_Node_AttrEntry_DoNotUse_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_FunctionDef_Node_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_FunctionDef_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_GradientDef_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "function.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\016function.proto\022\021opencv_tensorflow\032\020att"
-      "r_value.proto\032\014op_def.proto\"x\n\022FunctionD"
-      "efLibrary\0220\n\010function\030\001 \003(\0132\036.opencv_ten"
-      "sorflow.FunctionDef\0220\n\010gradient\030\002 \003(\0132\036."
-      "opencv_tensorflow.GradientDef\"\261\002\n\013Functi"
-      "onDef\022+\n\tsignature\030\001 \001(\0132\030.opencv_tensor"
-      "flow.OpDef\0221\n\004node\030\002 \003(\0132#.opencv_tensor"
-      "flow.FunctionDef.Node\032\301\001\n\004Node\022\013\n\003ret\030\001 "
-      "\003(\t\022\n\n\002op\030\002 \001(\t\022\013\n\003arg\030\003 \003(\t\022\013\n\003dep\030\004 \003("
-      "\t\022;\n\004attr\030\005 \003(\0132-.opencv_tensorflow.Func"
-      "tionDef.Node.AttrEntry\032I\n\tAttrEntry\022\013\n\003k"
-      "ey\030\001 \001(\t\022+\n\005value\030\002 \001(\0132\034.opencv_tensorf"
-      "low.AttrValue:\0028\001\";\n\013GradientDef\022\025\n\rfunc"
-      "tion_name\030\001 \001(\t\022\025\n\rgradient_func\030\002 \001(\tB/"
-      "\n\030org.tensorflow.frameworkB\016FunctionProt"
-      "osP\001\370\001\001b\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 615);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "function.proto", &protobuf_RegisterTypes);
-  ::protobuf_attr_5fvalue_2eproto::AddDescriptors();
-  ::protobuf_op_5fdef_2eproto::AddDescriptors();
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_function_2eproto
+const char descriptor_table_protodef_function_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\016function.proto\022\021opencv_tensorflow\032\020att"
+  "r_value.proto\032\014op_def.proto\"x\n\022FunctionD"
+  "efLibrary\0220\n\010function\030\001 \003(\0132\036.opencv_ten"
+  "sorflow.FunctionDef\0220\n\010gradient\030\002 \003(\0132\036."
+  "opencv_tensorflow.GradientDef\"\261\002\n\013Functi"
+  "onDef\022+\n\tsignature\030\001 \001(\0132\030.opencv_tensor"
+  "flow.OpDef\0221\n\004node\030\002 \003(\0132#.opencv_tensor"
+  "flow.FunctionDef.Node\032\301\001\n\004Node\022\013\n\003ret\030\001 "
+  "\003(\t\022\n\n\002op\030\002 \001(\t\022\013\n\003arg\030\003 \003(\t\022\013\n\003dep\030\004 \003("
+  "\t\022;\n\004attr\030\005 \003(\0132-.opencv_tensorflow.Func"
+  "tionDef.Node.AttrEntry\032I\n\tAttrEntry\022\013\n\003k"
+  "ey\030\001 \001(\t\022+\n\005value\030\002 \001(\0132\034.opencv_tensorf"
+  "low.AttrValue:\0028\001\";\n\013GradientDef\022\025\n\rfunc"
+  "tion_name\030\001 \001(\t\022\025\n\rgradient_func\030\002 \001(\tB/"
+  "\n\030org.tensorflow.frameworkB\016FunctionProt"
+  "osP\001\370\001\001b\006proto3"
+  ;
+static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_function_2eproto_deps[2] = {
+  &::descriptor_table_attr_5fvalue_2eproto,
+  &::descriptor_table_op_5fdef_2eproto,
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_function_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_function_2eproto = {
+  false, false, 615, descriptor_table_protodef_function_2eproto, "function.proto",
+  &descriptor_table_function_2eproto_once, descriptor_table_function_2eproto_deps, 2, 5,
+  schemas, file_default_instances, TableStruct_function_2eproto::offsets,
+  file_level_metadata_function_2eproto, file_level_enum_descriptors_function_2eproto, file_level_service_descriptors_function_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_function_2eproto_getter() {
+  return &descriptor_table_function_2eproto;
+}
+
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_function_2eproto(&descriptor_table_function_2eproto);
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-void FunctionDefLibrary::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FunctionDefLibrary::kFunctionFieldNumber;
-const int FunctionDefLibrary::kGradientFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class FunctionDefLibrary::_Internal {
+ public:
+};
 
-FunctionDefLibrary::FunctionDefLibrary()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_function_2eproto::InitDefaultsFunctionDefLibrary();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.FunctionDefLibrary)
-}
-FunctionDefLibrary::FunctionDefLibrary(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+FunctionDefLibrary::FunctionDefLibrary(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   function_(arena),
   gradient_(arena) {
-  ::protobuf_function_2eproto::InitDefaultsFunctionDefLibrary();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.FunctionDefLibrary)
 }
 FunctionDefLibrary::FunctionDefLibrary(const FunctionDefLibrary& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       function_(from.function_),
-      gradient_(from.gradient_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+      gradient_(from.gradient_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.FunctionDefLibrary)
 }
 
-void FunctionDefLibrary::SharedCtor() {
-  _cached_size_ = 0;
+inline void FunctionDefLibrary::SharedCtor() {
 }
 
 FunctionDefLibrary::~FunctionDefLibrary() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.FunctionDefLibrary)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FunctionDefLibrary::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void FunctionDefLibrary::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void FunctionDefLibrary::ArenaDtor(void* object) {
   FunctionDefLibrary* _this = reinterpret_cast< FunctionDefLibrary* >(object);
   (void)_this;
 }
-void FunctionDefLibrary::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void FunctionDefLibrary::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void FunctionDefLibrary::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* FunctionDefLibrary::descriptor() {
-  ::protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const FunctionDefLibrary& FunctionDefLibrary::default_instance() {
-  ::protobuf_function_2eproto::InitDefaultsFunctionDefLibrary();
-  return *internal_default_instance();
-}
-
-FunctionDefLibrary* FunctionDefLibrary::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FunctionDefLibrary>(arena);
+  _cached_size_.Set(size);
 }
 
 void FunctionDefLibrary::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.FunctionDefLibrary)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   function_.Clear();
   gradient_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool FunctionDefLibrary::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:opencv_tensorflow.FunctionDefLibrary)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* FunctionDefLibrary::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .opencv_tensorflow.FunctionDef function = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_function()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_function(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_tensorflow.GradientDef gradient = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_gradient()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_gradient(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.FunctionDefLibrary)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.FunctionDefLibrary)
-  return false;
-#undef DO_
-}
-
-void FunctionDefLibrary::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.FunctionDefLibrary)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_tensorflow.FunctionDef function = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->function_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->function(static_cast<int>(i)), output);
-  }
-
-  // repeated .opencv_tensorflow.GradientDef gradient = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->gradient_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->gradient(static_cast<int>(i)), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.FunctionDefLibrary)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* FunctionDefLibrary::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* FunctionDefLibrary::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.FunctionDefLibrary)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .opencv_tensorflow.FunctionDef function = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->function_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->function(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_function_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_function(i), target, stream);
   }
 
   // repeated .opencv_tensorflow.GradientDef gradient = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->gradient_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->gradient(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_gradient_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_gradient(i), target, stream);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.FunctionDefLibrary)
   return target;
@@ -477,71 +337,49 @@ size_t FunctionDefLibrary::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.FunctionDefLibrary)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_tensorflow.FunctionDef function = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->function_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->function(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_function_size();
+  for (const auto& msg : this->function_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_tensorflow.GradientDef gradient = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->gradient_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->gradient(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_gradient_size();
+  for (const auto& msg : this->gradient_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FunctionDefLibrary::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.FunctionDefLibrary)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FunctionDefLibrary* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FunctionDefLibrary>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.FunctionDefLibrary)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.FunctionDefLibrary)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FunctionDefLibrary::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FunctionDefLibrary::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FunctionDefLibrary::GetClassData() const { return &_class_data_; }
+
+void FunctionDefLibrary::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FunctionDefLibrary *>(to)->MergeFrom(
+      static_cast<const FunctionDefLibrary &>(from));
 }
 
+
 void FunctionDefLibrary::MergeFrom(const FunctionDefLibrary& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.FunctionDefLibrary)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   function_.MergeFrom(from.function_);
   gradient_.MergeFrom(from.gradient_);
-}
-
-void FunctionDefLibrary::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.FunctionDefLibrary)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FunctionDefLibrary::CopyFrom(const FunctionDefLibrary& from) {
@@ -555,151 +393,109 @@ bool FunctionDefLibrary::IsInitialized() const {
   return true;
 }
 
-void FunctionDefLibrary::Swap(FunctionDefLibrary* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    FunctionDefLibrary* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void FunctionDefLibrary::UnsafeArenaSwap(FunctionDefLibrary* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void FunctionDefLibrary::InternalSwap(FunctionDefLibrary* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   function_.InternalSwap(&other->function_);
   gradient_.InternalSwap(&other->gradient_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata FunctionDefLibrary::GetMetadata() const {
-  protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FunctionDefLibrary::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_function_2eproto_getter, &descriptor_table_function_2eproto_once,
+      file_level_metadata_function_2eproto[0]);
 }
 
-
 // ===================================================================
 
 FunctionDef_Node_AttrEntry_DoNotUse::FunctionDef_Node_AttrEntry_DoNotUse() {}
-FunctionDef_Node_AttrEntry_DoNotUse::FunctionDef_Node_AttrEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {}
+FunctionDef_Node_AttrEntry_DoNotUse::FunctionDef_Node_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
+    : SuperType(arena) {}
 void FunctionDef_Node_AttrEntry_DoNotUse::MergeFrom(const FunctionDef_Node_AttrEntry_DoNotUse& other) {
   MergeFromInternal(other);
 }
-::google::protobuf::Metadata FunctionDef_Node_AttrEntry_DoNotUse::GetMetadata() const {
-  ::protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[1];
-}
-void FunctionDef_Node_AttrEntry_DoNotUse::MergeFrom(
-    const ::google::protobuf::Message& other) {
-  ::google::protobuf::Message::MergeFrom(other);
+::PROTOBUF_NAMESPACE_ID::Metadata FunctionDef_Node_AttrEntry_DoNotUse::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_function_2eproto_getter, &descriptor_table_function_2eproto_once,
+      file_level_metadata_function_2eproto[1]);
 }
 
-
 // ===================================================================
 
-void FunctionDef_Node::InitAsDefaultInstance() {
-}
+class FunctionDef_Node::_Internal {
+ public:
+};
+
 void FunctionDef_Node::clear_attr() {
   attr_.Clear();
 }
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FunctionDef_Node::kRetFieldNumber;
-const int FunctionDef_Node::kOpFieldNumber;
-const int FunctionDef_Node::kArgFieldNumber;
-const int FunctionDef_Node::kDepFieldNumber;
-const int FunctionDef_Node::kAttrFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FunctionDef_Node::FunctionDef_Node()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_function_2eproto::InitDefaultsFunctionDef_Node();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.FunctionDef.Node)
-}
-FunctionDef_Node::FunctionDef_Node(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+FunctionDef_Node::FunctionDef_Node(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   ret_(arena),
   arg_(arena),
   dep_(arena),
   attr_(arena) {
-  ::protobuf_function_2eproto::InitDefaultsFunctionDef_Node();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.FunctionDef.Node)
 }
 FunctionDef_Node::FunctionDef_Node(const FunctionDef_Node& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       ret_(from.ret_),
       arg_(from.arg_),
-      dep_(from.dep_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+      dep_(from.dep_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   attr_.MergeFrom(from.attr_);
-  op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.op().size() > 0) {
-    op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op(),
-      GetArenaNoVirtual());
+  op_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    op_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_op().empty()) {
+    op_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_op(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.FunctionDef.Node)
 }
 
-void FunctionDef_Node::SharedCtor() {
-  op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
+inline void FunctionDef_Node::SharedCtor() {
+op_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  op_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 FunctionDef_Node::~FunctionDef_Node() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.FunctionDef.Node)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FunctionDef_Node::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  op_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void FunctionDef_Node::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  op_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void FunctionDef_Node::ArenaDtor(void* object) {
   FunctionDef_Node* _this = reinterpret_cast< FunctionDef_Node* >(object);
   (void)_this;
+  _this->attr_. ~MapField();
 }
-void FunctionDef_Node::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+inline void FunctionDef_Node::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena) {
+  if (arena != nullptr) {
+    arena->OwnCustomDestructor(this, &FunctionDef_Node::ArenaDtor);
+  }
 }
 void FunctionDef_Node::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* FunctionDef_Node::descriptor() {
-  ::protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const FunctionDef_Node& FunctionDef_Node::default_instance() {
-  ::protobuf_function_2eproto::InitDefaultsFunctionDef_Node();
-  return *internal_default_instance();
-}
-
-FunctionDef_Node* FunctionDef_Node::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FunctionDef_Node>(arena);
+  _cached_size_.Set(size);
 }
 
 void FunctionDef_Node::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.FunctionDef.Node)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -707,348 +503,198 @@ void FunctionDef_Node::Clear() {
   arg_.Clear();
   dep_.Clear();
   attr_.Clear();
-  op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  _internal_metadata_.Clear();
-}
-
-bool FunctionDef_Node::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:opencv_tensorflow.FunctionDef.Node)
-  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)) {
+  op_.ClearToEmpty();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* FunctionDef_Node::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated string ret = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_ret()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->ret(this->ret_size() - 1).data(),
-            static_cast<int>(this->ret(this->ret_size() - 1).length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.FunctionDef.Node.ret"));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_ret();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.FunctionDef.Node.ret"));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string op = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_op()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->op().data(), static_cast<int>(this->op().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.FunctionDef.Node.op"));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_op();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.FunctionDef.Node.op"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated string arg = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_arg()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->arg(this->arg_size() - 1).data(),
-            static_cast<int>(this->arg(this->arg_size() - 1).length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.FunctionDef.Node.arg"));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_arg();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.FunctionDef.Node.arg"));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated string dep = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_dep()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->dep(this->dep_size() - 1).data(),
-            static_cast<int>(this->dep(this->dep_size() - 1).length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.FunctionDef.Node.dep"));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_dep();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.FunctionDef.Node.dep"));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // map<string, .opencv_tensorflow.AttrValue> attr = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          FunctionDef_Node_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
-              FunctionDef_Node_AttrEntry_DoNotUse,
-              ::std::string, ::opencv_tensorflow::AttrValue,
-              ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-              ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-              0 >,
-            ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue > > parser(&attr_);
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
-              input, &parser));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            parser.key().data(), static_cast<int>(parser.key().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.FunctionDef.Node.AttrEntry.key"));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(&attr_, ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.FunctionDef.Node)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.FunctionDef.Node)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void FunctionDef_Node::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.FunctionDef.Node)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated string ret = 1;
-  for (int i = 0, n = this->ret_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->ret(i).data(), static_cast<int>(this->ret(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.FunctionDef.Node.ret");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      1, this->ret(i), output);
-  }
-
-  // string op = 2;
-  if (this->op().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->op().data(), static_cast<int>(this->op().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.FunctionDef.Node.op");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->op(), output);
-  }
-
-  // repeated string arg = 3;
-  for (int i = 0, n = this->arg_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->arg(i).data(), static_cast<int>(this->arg(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.FunctionDef.Node.arg");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      3, this->arg(i), output);
-  }
-
-  // repeated string dep = 4;
-  for (int i = 0, n = this->dep_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->dep(i).data(), static_cast<int>(this->dep(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.FunctionDef.Node.dep");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      4, this->dep(i), output);
-  }
-
-  // map<string, .opencv_tensorflow.AttrValue> attr = 5;
-  if (!this->attr().empty()) {
-    typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
-        ConstPtr;
-    typedef ConstPtr SortItem;
-    typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
-    struct Utf8Check {
-      static void Check(ConstPtr p) {
-        ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-          p->first.data(), static_cast<int>(p->first.length()),
-          ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-          "opencv_tensorflow.FunctionDef.Node.AttrEntry.key");
-      }
-    };
-
-    if (output->IsSerializationDeterministic() &&
-        this->attr().size() > 1) {
-      ::google::protobuf::scoped_array<SortItem> items(
-          new SortItem[this->attr().size()]);
-      typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
-      size_type n = 0;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it, ++n) {
-        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
-      }
-      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
-      ::google::protobuf::scoped_ptr<FunctionDef_Node_AttrEntry_DoNotUse> entry;
-      for (size_type i = 0; i < n; i++) {
-        entry.reset(attr_.NewEntryWrapper(
-            items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
-        ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-            5, *entry, output);
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
-      }
-    } else {
-      ::google::protobuf::scoped_ptr<FunctionDef_Node_AttrEntry_DoNotUse> entry;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it) {
-        entry.reset(attr_.NewEntryWrapper(
-            it->first, it->second));
-        ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-            5, *entry, output);
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(&*it);
-      }
-    }
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.FunctionDef.Node)
-}
-
-::google::protobuf::uint8* FunctionDef_Node::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* FunctionDef_Node::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.FunctionDef.Node)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated string ret = 1;
-  for (int i = 0, n = this->ret_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->ret(i).data(), static_cast<int>(this->ret(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  for (int i = 0, n = this->_internal_ret_size(); i < n; i++) {
+    const auto& s = this->_internal_ret(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.FunctionDef.Node.ret");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(1, this->ret(i), target);
+    target = stream->WriteString(1, s, target);
   }
 
   // string op = 2;
-  if (this->op().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->op().data(), static_cast<int>(this->op().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_op().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_op().data(), static_cast<int>(this->_internal_op().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.FunctionDef.Node.op");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->op(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_op(), target);
   }
 
   // repeated string arg = 3;
-  for (int i = 0, n = this->arg_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->arg(i).data(), static_cast<int>(this->arg(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  for (int i = 0, n = this->_internal_arg_size(); i < n; i++) {
+    const auto& s = this->_internal_arg(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.FunctionDef.Node.arg");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(3, this->arg(i), target);
+    target = stream->WriteString(3, s, target);
   }
 
   // repeated string dep = 4;
-  for (int i = 0, n = this->dep_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->dep(i).data(), static_cast<int>(this->dep(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  for (int i = 0, n = this->_internal_dep_size(); i < n; i++) {
+    const auto& s = this->_internal_dep(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.FunctionDef.Node.dep");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(4, this->dep(i), target);
+    target = stream->WriteString(4, s, target);
   }
 
   // map<string, .opencv_tensorflow.AttrValue> attr = 5;
-  if (!this->attr().empty()) {
-    typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
+  if (!this->_internal_attr().empty()) {
+    typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_pointer
         ConstPtr;
     typedef ConstPtr SortItem;
-    typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
+    typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
     struct Utf8Check {
       static void Check(ConstPtr p) {
-        ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+        (void)p;
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
           p->first.data(), static_cast<int>(p->first.length()),
-          ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+          ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
           "opencv_tensorflow.FunctionDef.Node.AttrEntry.key");
       }
     };
 
-    if (deterministic &&
-        this->attr().size() > 1) {
-      ::google::protobuf::scoped_array<SortItem> items(
-          new SortItem[this->attr().size()]);
-      typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
+    if (stream->IsSerializationDeterministic() &&
+        this->_internal_attr().size() > 1) {
+      ::std::unique_ptr<SortItem[]> items(
+          new SortItem[this->_internal_attr().size()]);
+      typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
       size_type n = 0;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it, ++n) {
+      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+          it = this->_internal_attr().begin();
+          it != this->_internal_attr().end(); ++it, ++n) {
         items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
       }
       ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
-      ::google::protobuf::scoped_ptr<FunctionDef_Node_AttrEntry_DoNotUse> entry;
       for (size_type i = 0; i < n; i++) {
-        entry.reset(attr_.NewEntryWrapper(
-            items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
-        target = ::google::protobuf::internal::WireFormatLite::
-                   InternalWriteMessageNoVirtualToArray(
-                       5, *entry, deterministic, target);
-;
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
+        target = FunctionDef_Node_AttrEntry_DoNotUse::Funcs::InternalSerialize(5, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target, stream);
+        Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
       }
     } else {
-      ::google::protobuf::scoped_ptr<FunctionDef_Node_AttrEntry_DoNotUse> entry;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it) {
-        entry.reset(attr_.NewEntryWrapper(
-            it->first, it->second));
-        target = ::google::protobuf::internal::WireFormatLite::
-                   InternalWriteMessageNoVirtualToArray(
-                       5, *entry, deterministic, target);
-;
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(&*it);
+      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+          it = this->_internal_attr().begin();
+          it != this->_internal_attr().end(); ++it) {
+        target = FunctionDef_Node_AttrEntry_DoNotUse::Funcs::InternalSerialize(5, it->first, it->second, target, stream);
+        Utf8Check::Check(&(*it));
       }
     }
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.FunctionDef.Node)
   return target;
@@ -1058,105 +704,80 @@ size_t FunctionDef_Node::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.FunctionDef.Node)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated string ret = 1;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->ret_size());
-  for (int i = 0, n = this->ret_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->ret(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(ret_.size());
+  for (int i = 0, n = ret_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      ret_.Get(i));
   }
 
   // repeated string arg = 3;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->arg_size());
-  for (int i = 0, n = this->arg_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->arg(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(arg_.size());
+  for (int i = 0, n = arg_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      arg_.Get(i));
   }
 
   // repeated string dep = 4;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->dep_size());
-  for (int i = 0, n = this->dep_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->dep(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(dep_.size());
+  for (int i = 0, n = dep_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      dep_.Get(i));
   }
 
   // map<string, .opencv_tensorflow.AttrValue> attr = 5;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->attr_size());
-  {
-    ::google::protobuf::scoped_ptr<FunctionDef_Node_AttrEntry_DoNotUse> entry;
-    for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-        it = this->attr().begin();
-        it != this->attr().end(); ++it) {
-      if (entry.get() != NULL && entry->GetArena() != NULL) {
-        entry.release();
-      }
-      entry.reset(attr_.NewEntryWrapper(it->first, it->second));
-      total_size += ::google::protobuf::internal::WireFormatLite::
-          MessageSizeNoVirtual(*entry);
-    }
-    if (entry.get() != NULL && entry->GetArena() != NULL) {
-      entry.release();
-    }
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_attr_size());
+  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+      it = this->_internal_attr().begin();
+      it != this->_internal_attr().end(); ++it) {
+    total_size += FunctionDef_Node_AttrEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
   }
 
   // string op = 2;
-  if (this->op().size() > 0) {
+  if (!this->_internal_op().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->op());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_op());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FunctionDef_Node::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.FunctionDef.Node)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FunctionDef_Node* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FunctionDef_Node>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.FunctionDef.Node)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.FunctionDef.Node)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FunctionDef_Node::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FunctionDef_Node::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FunctionDef_Node::GetClassData() const { return &_class_data_; }
+
+void FunctionDef_Node::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FunctionDef_Node *>(to)->MergeFrom(
+      static_cast<const FunctionDef_Node &>(from));
 }
 
+
 void FunctionDef_Node::MergeFrom(const FunctionDef_Node& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.FunctionDef.Node)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   ret_.MergeFrom(from.ret_);
   arg_.MergeFrom(from.arg_);
   dep_.MergeFrom(from.dep_);
   attr_.MergeFrom(from.attr_);
-  if (from.op().size() > 0) {
-    set_op(from.op());
+  if (!from._internal_op().empty()) {
+    _internal_set_op(from._internal_op());
   }
-}
-
-void FunctionDef_Node::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.FunctionDef.Node)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FunctionDef_Node::CopyFrom(const FunctionDef_Node& from) {
@@ -1170,119 +791,80 @@ bool FunctionDef_Node::IsInitialized() const {
   return true;
 }
 
-void FunctionDef_Node::Swap(FunctionDef_Node* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    FunctionDef_Node* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void FunctionDef_Node::UnsafeArenaSwap(FunctionDef_Node* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void FunctionDef_Node::InternalSwap(FunctionDef_Node* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   ret_.InternalSwap(&other->ret_);
   arg_.InternalSwap(&other->arg_);
   dep_.InternalSwap(&other->dep_);
-  attr_.Swap(&other->attr_);
-  op_.Swap(&other->op_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  attr_.InternalSwap(&other->attr_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &op_, lhs_arena,
+      &other->op_, rhs_arena
+  );
 }
 
-::google::protobuf::Metadata FunctionDef_Node::GetMetadata() const {
-  protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FunctionDef_Node::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_function_2eproto_getter, &descriptor_table_function_2eproto_once,
+      file_level_metadata_function_2eproto[2]);
 }
 
-
 // ===================================================================
 
-void FunctionDef::InitAsDefaultInstance() {
-  ::opencv_tensorflow::_FunctionDef_default_instance_._instance.get_mutable()->signature_ = const_cast< ::opencv_tensorflow::OpDef*>(
-      ::opencv_tensorflow::OpDef::internal_default_instance());
-}
-void FunctionDef::_slow_mutable_signature() {
-  signature_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::OpDef >(
-      GetArenaNoVirtual());
-}
-void FunctionDef::unsafe_arena_set_allocated_signature(
-    ::opencv_tensorflow::OpDef* signature) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete signature_;
-  }
-  signature_ = signature;
-  if (signature) {
-
-  } else {
+class FunctionDef::_Internal {
+ public:
+  static const ::opencv_tensorflow::OpDef& signature(const FunctionDef* msg);
+};
 
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.FunctionDef.signature)
+const ::opencv_tensorflow::OpDef&
+FunctionDef::_Internal::signature(const FunctionDef* msg) {
+  return *msg->signature_;
 }
 void FunctionDef::clear_signature() {
-  if (GetArenaNoVirtual() == NULL && signature_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && signature_ != nullptr) {
     delete signature_;
   }
-  signature_ = NULL;
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int FunctionDef::kSignatureFieldNumber;
-const int FunctionDef::kNodeFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-FunctionDef::FunctionDef()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_function_2eproto::InitDefaultsFunctionDef();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.FunctionDef)
+  signature_ = nullptr;
 }
-FunctionDef::FunctionDef(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+FunctionDef::FunctionDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   node_(arena) {
-  ::protobuf_function_2eproto::InitDefaultsFunctionDef();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.FunctionDef)
 }
 FunctionDef::FunctionDef(const FunctionDef& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      node_(from.node_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_signature()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      node_(from.node_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_signature()) {
     signature_ = new ::opencv_tensorflow::OpDef(*from.signature_);
   } else {
-    signature_ = NULL;
+    signature_ = nullptr;
   }
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.FunctionDef)
 }
 
-void FunctionDef::SharedCtor() {
-  signature_ = NULL;
-  _cached_size_ = 0;
+inline void FunctionDef::SharedCtor() {
+signature_ = nullptr;
 }
 
 FunctionDef::~FunctionDef() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.FunctionDef)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void FunctionDef::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void FunctionDef::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete signature_;
 }
 
@@ -1290,145 +872,101 @@ void FunctionDef::ArenaDtor(void* object) {
   FunctionDef* _this = reinterpret_cast< FunctionDef* >(object);
   (void)_this;
 }
-void FunctionDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void FunctionDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void FunctionDef::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* FunctionDef::descriptor() {
-  ::protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const FunctionDef& FunctionDef::default_instance() {
-  ::protobuf_function_2eproto::InitDefaultsFunctionDef();
-  return *internal_default_instance();
-}
-
-FunctionDef* FunctionDef::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<FunctionDef>(arena);
+  _cached_size_.Set(size);
 }
 
 void FunctionDef::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.FunctionDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   node_.Clear();
-  if (GetArenaNoVirtual() == NULL && signature_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && signature_ != nullptr) {
     delete signature_;
   }
-  signature_ = NULL;
-  _internal_metadata_.Clear();
-}
-
-bool FunctionDef::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:opencv_tensorflow.FunctionDef)
-  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)) {
+  signature_ = nullptr;
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* FunctionDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // .opencv_tensorflow.OpDef signature = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_signature()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_signature(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_tensorflow.FunctionDef.Node node = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_node()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_node(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.FunctionDef)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.FunctionDef)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void FunctionDef::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.FunctionDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // .opencv_tensorflow.OpDef signature = 1;
-  if (this->has_signature()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->signature_, output);
-  }
-
-  // repeated .opencv_tensorflow.FunctionDef.Node node = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->node(static_cast<int>(i)), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.FunctionDef)
-}
-
-::google::protobuf::uint8* FunctionDef::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* FunctionDef::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.FunctionDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // .opencv_tensorflow.OpDef signature = 1;
-  if (this->has_signature()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *this->signature_, deterministic, target);
+  if (this->_internal_has_signature()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::signature(this), target, stream);
   }
 
   // repeated .opencv_tensorflow.FunctionDef.Node node = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->node(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_node_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_node(i), target, stream);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.FunctionDef)
   return target;
@@ -1438,69 +976,51 @@ size_t FunctionDef::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.FunctionDef)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_tensorflow.FunctionDef.Node node = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->node_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->node(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_node_size();
+  for (const auto& msg : this->node_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // .opencv_tensorflow.OpDef signature = 1;
-  if (this->has_signature()) {
+  if (this->_internal_has_signature()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->signature_);
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *signature_);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void FunctionDef::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.FunctionDef)
-  GOOGLE_DCHECK_NE(&from, this);
-  const FunctionDef* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const FunctionDef>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.FunctionDef)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.FunctionDef)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FunctionDef::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    FunctionDef::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FunctionDef::GetClassData() const { return &_class_data_; }
+
+void FunctionDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<FunctionDef *>(to)->MergeFrom(
+      static_cast<const FunctionDef &>(from));
 }
 
+
 void FunctionDef::MergeFrom(const FunctionDef& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.FunctionDef)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   node_.MergeFrom(from.node_);
-  if (from.has_signature()) {
-    mutable_signature()->::opencv_tensorflow::OpDef::MergeFrom(from.signature());
+  if (from._internal_has_signature()) {
+    _internal_mutable_signature()->::opencv_tensorflow::OpDef::MergeFrom(from._internal_signature());
   }
-}
-
-void FunctionDef::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.FunctionDef)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void FunctionDef::CopyFrom(const FunctionDef& from) {
@@ -1514,262 +1034,179 @@ bool FunctionDef::IsInitialized() const {
   return true;
 }
 
-void FunctionDef::Swap(FunctionDef* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    FunctionDef* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void FunctionDef::UnsafeArenaSwap(FunctionDef* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void FunctionDef::InternalSwap(FunctionDef* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   node_.InternalSwap(&other->node_);
   swap(signature_, other->signature_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata FunctionDef::GetMetadata() const {
-  protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata FunctionDef::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_function_2eproto_getter, &descriptor_table_function_2eproto_once,
+      file_level_metadata_function_2eproto[3]);
 }
 
-
 // ===================================================================
 
-void GradientDef::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int GradientDef::kFunctionNameFieldNumber;
-const int GradientDef::kGradientFuncFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class GradientDef::_Internal {
+ public:
+};
 
-GradientDef::GradientDef()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_function_2eproto::InitDefaultsGradientDef();
-  }
+GradientDef::GradientDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.GradientDef)
-}
-GradientDef::GradientDef(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_function_2eproto::InitDefaultsGradientDef();
-  SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.GradientDef)
 }
 GradientDef::GradientDef(const GradientDef& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  function_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.function_name().size() > 0) {
-    function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.function_name(),
-      GetArenaNoVirtual());
-  }
-  gradient_func_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.gradient_func().size() > 0) {
-    gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.gradient_func(),
-      GetArenaNoVirtual());
+  : ::PROTOBUF_NAMESPACE_ID::Message() {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  function_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    function_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_function_name().empty()) {
+    function_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_function_name(),
+      GetArenaForAllocation());
+  }
+  gradient_func_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    gradient_func_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_gradient_func().empty()) {
+    gradient_func_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_gradient_func(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.GradientDef)
 }
 
-void GradientDef::SharedCtor() {
-  function_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  gradient_func_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
+inline void GradientDef::SharedCtor() {
+function_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  function_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+gradient_func_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  gradient_func_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 GradientDef::~GradientDef() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.GradientDef)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void GradientDef::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  function_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  gradient_func_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void GradientDef::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  function_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  gradient_func_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void GradientDef::ArenaDtor(void* object) {
   GradientDef* _this = reinterpret_cast< GradientDef* >(object);
   (void)_this;
 }
-void GradientDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void GradientDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void GradientDef::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* GradientDef::descriptor() {
-  ::protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const GradientDef& GradientDef::default_instance() {
-  ::protobuf_function_2eproto::InitDefaultsGradientDef();
-  return *internal_default_instance();
-}
-
-GradientDef* GradientDef::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<GradientDef>(arena);
+  _cached_size_.Set(size);
 }
 
 void GradientDef::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.GradientDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  function_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  gradient_func_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  _internal_metadata_.Clear();
-}
-
-bool GradientDef::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:opencv_tensorflow.GradientDef)
-  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)) {
+  function_name_.ClearToEmpty();
+  gradient_func_.ClearToEmpty();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* GradientDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // string function_name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_function_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->function_name().data(), static_cast<int>(this->function_name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.GradientDef.function_name"));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_function_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.GradientDef.function_name"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string gradient_func = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_gradient_func()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->gradient_func().data(), static_cast<int>(this->gradient_func().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.GradientDef.gradient_func"));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_gradient_func();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.GradientDef.gradient_func"));
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.GradientDef)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.GradientDef)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void GradientDef::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.GradientDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string function_name = 1;
-  if (this->function_name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->function_name().data(), static_cast<int>(this->function_name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.GradientDef.function_name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->function_name(), output);
-  }
-
-  // string gradient_func = 2;
-  if (this->gradient_func().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->gradient_func().data(), static_cast<int>(this->gradient_func().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.GradientDef.gradient_func");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->gradient_func(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.GradientDef)
-}
-
-::google::protobuf::uint8* GradientDef::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* GradientDef::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.GradientDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // string function_name = 1;
-  if (this->function_name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->function_name().data(), static_cast<int>(this->function_name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_function_name().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_function_name().data(), static_cast<int>(this->_internal_function_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.GradientDef.function_name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->function_name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_function_name(), target);
   }
 
   // string gradient_func = 2;
-  if (this->gradient_func().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->gradient_func().data(), static_cast<int>(this->gradient_func().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_gradient_func().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_gradient_func().data(), static_cast<int>(this->_internal_gradient_func().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.GradientDef.gradient_func");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->gradient_func(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_gradient_func(), target);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.GradientDef)
   return target;
@@ -1779,67 +1216,53 @@ size_t GradientDef::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.GradientDef)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // string function_name = 1;
-  if (this->function_name().size() > 0) {
+  if (!this->_internal_function_name().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->function_name());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_function_name());
   }
 
   // string gradient_func = 2;
-  if (this->gradient_func().size() > 0) {
+  if (!this->_internal_gradient_func().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->gradient_func());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_gradient_func());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void GradientDef::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.GradientDef)
-  GOOGLE_DCHECK_NE(&from, this);
-  const GradientDef* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const GradientDef>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.GradientDef)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.GradientDef)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GradientDef::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    GradientDef::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GradientDef::GetClassData() const { return &_class_data_; }
+
+void GradientDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<GradientDef *>(to)->MergeFrom(
+      static_cast<const GradientDef &>(from));
 }
 
+
 void GradientDef::MergeFrom(const GradientDef& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.GradientDef)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.function_name().size() > 0) {
-    set_function_name(from.function_name());
+  if (!from._internal_function_name().empty()) {
+    _internal_set_function_name(from._internal_function_name());
   }
-  if (from.gradient_func().size() > 0) {
-    set_gradient_func(from.gradient_func());
+  if (!from._internal_gradient_func().empty()) {
+    _internal_set_gradient_func(from._internal_gradient_func());
   }
-}
-
-void GradientDef::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.GradientDef)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void GradientDef::CopyFrom(const GradientDef& from) {
@@ -1853,40 +1276,48 @@ bool GradientDef::IsInitialized() const {
   return true;
 }
 
-void GradientDef::Swap(GradientDef* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    GradientDef* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void GradientDef::UnsafeArenaSwap(GradientDef* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void GradientDef::InternalSwap(GradientDef* other) {
   using std::swap;
-  function_name_.Swap(&other->function_name_);
-  gradient_func_.Swap(&other->gradient_func_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &function_name_, lhs_arena,
+      &other->function_name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &gradient_func_, lhs_arena,
+      &other->gradient_func_, rhs_arena
+  );
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata GradientDef::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_function_2eproto_getter, &descriptor_table_function_2eproto_once,
+      file_level_metadata_function_2eproto[4]);
 }
 
-::google::protobuf::Metadata GradientDef::GetMetadata() const {
-  protobuf_function_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_function_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::FunctionDefLibrary* Arena::CreateMaybeMessage< ::opencv_tensorflow::FunctionDefLibrary >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::FunctionDefLibrary >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse* Arena::CreateMaybeMessage< ::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::FunctionDef_Node* Arena::CreateMaybeMessage< ::opencv_tensorflow::FunctionDef_Node >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::FunctionDef_Node >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::FunctionDef* Arena::CreateMaybeMessage< ::opencv_tensorflow::FunctionDef >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::FunctionDef >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::GradientDef* Arena::CreateMaybeMessage< ::opencv_tensorflow::GradientDef >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::GradientDef >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index a4be8aa..99796aa 100644 (file)
@@ -1,30 +1,32 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: function.proto
 
-#ifndef PROTOBUF_function_2eproto__INCLUDED
-#define PROTOBUF_function_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_function_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_function_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include "attr_value.pb.h"
 #include "op_def.pb.h"
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_function_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_function_2eproto {
 // Internal implementation detail -- do not use these members.
-struct 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[];
+struct TableStruct_function_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[5]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsFunctionDefLibraryImpl();
-void InitDefaultsFunctionDefLibrary();
-void InitDefaultsFunctionDef_Node_AttrEntry_DoNotUseImpl();
-void InitDefaultsFunctionDef_Node_AttrEntry_DoNotUse();
-void InitDefaultsFunctionDef_NodeImpl();
-void InitDefaultsFunctionDef_Node();
-void InitDefaultsFunctionDefImpl();
-void InitDefaultsFunctionDef();
-void InitDefaultsGradientDefImpl();
-void InitDefaultsGradientDef();
-inline void InitDefaults() {
-  InitDefaultsFunctionDefLibrary();
-  InitDefaultsFunctionDef_Node_AttrEntry_DoNotUse();
-  InitDefaultsFunctionDef_Node();
-  InitDefaultsFunctionDef();
-  InitDefaultsGradientDef();
-}
-}  // namespace protobuf_function_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_function_2eproto;
 namespace opencv_tensorflow {
 class FunctionDef;
-class FunctionDefDefaultTypeInternal;
+struct FunctionDefDefaultTypeInternal;
 extern FunctionDefDefaultTypeInternal _FunctionDef_default_instance_;
 class FunctionDefLibrary;
-class FunctionDefLibraryDefaultTypeInternal;
+struct FunctionDefLibraryDefaultTypeInternal;
 extern FunctionDefLibraryDefaultTypeInternal _FunctionDefLibrary_default_instance_;
 class FunctionDef_Node;
-class FunctionDef_NodeDefaultTypeInternal;
+struct FunctionDef_NodeDefaultTypeInternal;
 extern FunctionDef_NodeDefaultTypeInternal _FunctionDef_Node_default_instance_;
 class FunctionDef_Node_AttrEntry_DoNotUse;
-class FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal;
+struct FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal;
 extern FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal _FunctionDef_Node_AttrEntry_DoNotUse_default_instance_;
 class GradientDef;
-class GradientDefDefaultTypeInternal;
+struct GradientDefDefaultTypeInternal;
 extern GradientDefDefaultTypeInternal _GradientDef_default_instance_;
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_tensorflow::FunctionDef* Arena::CreateMaybeMessage<::opencv_tensorflow::FunctionDef>(Arena*);
+template<> ::opencv_tensorflow::FunctionDefLibrary* Arena::CreateMaybeMessage<::opencv_tensorflow::FunctionDefLibrary>(Arena*);
+template<> ::opencv_tensorflow::FunctionDef_Node* Arena::CreateMaybeMessage<::opencv_tensorflow::FunctionDef_Node>(Arena*);
+template<> ::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse* Arena::CreateMaybeMessage<::opencv_tensorflow::FunctionDef_Node_AttrEntry_DoNotUse>(Arena*);
+template<> ::opencv_tensorflow::GradientDef* Arena::CreateMaybeMessage<::opencv_tensorflow::GradientDef>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-class FunctionDefLibrary : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDefLibrary) */ {
+class FunctionDefLibrary final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDefLibrary) */ {
  public:
-  FunctionDefLibrary();
-  virtual ~FunctionDefLibrary();
+  inline FunctionDefLibrary() : FunctionDefLibrary(nullptr) {}
+  ~FunctionDefLibrary() override;
+  explicit constexpr FunctionDefLibrary(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FunctionDefLibrary(const FunctionDefLibrary& from);
-
-  inline FunctionDefLibrary& operator=(const FunctionDefLibrary& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FunctionDefLibrary(FunctionDefLibrary&& from) noexcept
     : FunctionDefLibrary() {
     *this = ::std::move(from);
   }
 
+  inline FunctionDefLibrary& operator=(const FunctionDefLibrary& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FunctionDefLibrary& operator=(FunctionDefLibrary&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FunctionDefLibrary& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const FunctionDefLibrary& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const FunctionDefLibrary* internal_default_instance() {
     return reinterpret_cast<const FunctionDefLibrary*>(
                &_FunctionDefLibrary_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void UnsafeArenaSwap(FunctionDefLibrary* other);
-  void Swap(FunctionDefLibrary* other);
   friend void swap(FunctionDefLibrary& a, FunctionDefLibrary& b) {
     a.Swap(&b);
   }
+  inline void Swap(FunctionDefLibrary* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FunctionDefLibrary* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FunctionDefLibrary* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FunctionDefLibrary* 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;
+  FunctionDefLibrary* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FunctionDefLibrary>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FunctionDefLibrary& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FunctionDefLibrary& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FunctionDefLibrary* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.FunctionDefLibrary";
+  }
   protected:
-  explicit FunctionDefLibrary(::google::protobuf::Arena* arena);
+  explicit FunctionDefLibrary(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFunctionFieldNumber = 1,
+    kGradientFieldNumber = 2,
+  };
   // repeated .opencv_tensorflow.FunctionDef function = 1;
   int function_size() const;
+  private:
+  int _internal_function_size() const;
+  public:
   void clear_function();
-  static const int kFunctionFieldNumber = 1;
-  const ::opencv_tensorflow::FunctionDef& function(int index) const;
   ::opencv_tensorflow::FunctionDef* mutable_function(int index);
-  ::opencv_tensorflow::FunctionDef* add_function();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >*
       mutable_function();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >&
+  private:
+  const ::opencv_tensorflow::FunctionDef& _internal_function(int index) const;
+  ::opencv_tensorflow::FunctionDef* _internal_add_function();
+  public:
+  const ::opencv_tensorflow::FunctionDef& function(int index) const;
+  ::opencv_tensorflow::FunctionDef* add_function();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >&
       function() const;
 
   // repeated .opencv_tensorflow.GradientDef gradient = 2;
   int gradient_size() const;
+  private:
+  int _internal_gradient_size() const;
+  public:
   void clear_gradient();
-  static const int kGradientFieldNumber = 2;
-  const ::opencv_tensorflow::GradientDef& gradient(int index) const;
   ::opencv_tensorflow::GradientDef* mutable_gradient(int index);
-  ::opencv_tensorflow::GradientDef* add_gradient();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::GradientDef >*
       mutable_gradient();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef >&
+  private:
+  const ::opencv_tensorflow::GradientDef& _internal_gradient(int index) const;
+  ::opencv_tensorflow::GradientDef* _internal_add_gradient();
+  public:
+  const ::opencv_tensorflow::GradientDef& gradient(int index) const;
+  ::opencv_tensorflow::GradientDef* add_gradient();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::GradientDef >&
       gradient() const;
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.FunctionDefLibrary)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef > function_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef > gradient_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_function_2eproto::TableStruct;
-  friend void ::protobuf_function_2eproto::InitDefaultsFunctionDefLibraryImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef > function_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::GradientDef > gradient_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_function_2eproto;
 };
 // -------------------------------------------------------------------
 
-class FunctionDef_Node_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry<FunctionDef_Node_AttrEntry_DoNotUse,
-    ::std::string, ::opencv_tensorflow::AttrValue,
-    ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-    ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-    0 > {
+class FunctionDef_Node_AttrEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<FunctionDef_Node_AttrEntry_DoNotUse,
+    std::string, ::opencv_tensorflow::AttrValue,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> {
 public:
-  typedef ::google::protobuf::internal::MapEntry<FunctionDef_Node_AttrEntry_DoNotUse,
-    ::std::string, ::opencv_tensorflow::AttrValue,
-    ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-    ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-    0 > SuperType;
+  typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<FunctionDef_Node_AttrEntry_DoNotUse,
+    std::string, ::opencv_tensorflow::AttrValue,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> SuperType;
   FunctionDef_Node_AttrEntry_DoNotUse();
-  FunctionDef_Node_AttrEntry_DoNotUse(::google::protobuf::Arena* arena);
+  explicit constexpr FunctionDef_Node_AttrEntry_DoNotUse(
+      ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
+  explicit FunctionDef_Node_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   void MergeFrom(const FunctionDef_Node_AttrEntry_DoNotUse& other);
   static const FunctionDef_Node_AttrEntry_DoNotUse* internal_default_instance() { return reinterpret_cast<const FunctionDef_Node_AttrEntry_DoNotUse*>(&_FunctionDef_Node_AttrEntry_DoNotUse_default_instance_); }
-  void MergeFrom(const ::google::protobuf::Message& other) PROTOBUF_FINAL;
-  ::google::protobuf::Metadata GetMetadata() const;
+  static bool ValidateKey(std::string* s) {
+    return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast<int>(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "opencv_tensorflow.FunctionDef.Node.AttrEntry.key");
+ }
+  static bool ValidateValue(void*) { return true; }
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 };
 
 // -------------------------------------------------------------------
 
-class FunctionDef_Node : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDef.Node) */ {
+class FunctionDef_Node final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDef.Node) */ {
  public:
-  FunctionDef_Node();
-  virtual ~FunctionDef_Node();
+  inline FunctionDef_Node() : FunctionDef_Node(nullptr) {}
+  ~FunctionDef_Node() override;
+  explicit constexpr FunctionDef_Node(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FunctionDef_Node(const FunctionDef_Node& from);
-
-  inline FunctionDef_Node& operator=(const FunctionDef_Node& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FunctionDef_Node(FunctionDef_Node&& from) noexcept
     : FunctionDef_Node() {
     *this = ::std::move(from);
   }
 
+  inline FunctionDef_Node& operator=(const FunctionDef_Node& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FunctionDef_Node& operator=(FunctionDef_Node&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FunctionDef_Node& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const FunctionDef_Node& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const FunctionDef_Node* internal_default_instance() {
     return reinterpret_cast<const FunctionDef_Node*>(
                &_FunctionDef_Node_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     2;
 
-  void UnsafeArenaSwap(FunctionDef_Node* other);
-  void Swap(FunctionDef_Node* other);
   friend void swap(FunctionDef_Node& a, FunctionDef_Node& b) {
     a.Swap(&b);
   }
+  inline void Swap(FunctionDef_Node* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FunctionDef_Node* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FunctionDef_Node* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FunctionDef_Node* 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;
+  FunctionDef_Node* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FunctionDef_Node>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FunctionDef_Node& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FunctionDef_Node& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FunctionDef_Node* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.FunctionDef.Node";
+  }
   protected:
-  explicit FunctionDef_Node(::google::protobuf::Arena* arena);
+  explicit FunctionDef_Node(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kRetFieldNumber = 1,
+    kArgFieldNumber = 3,
+    kDepFieldNumber = 4,
+    kAttrFieldNumber = 5,
+    kOpFieldNumber = 2,
+  };
   // repeated string ret = 1;
   int ret_size() const;
+  private:
+  int _internal_ret_size() const;
+  public:
   void clear_ret();
-  static const int kRetFieldNumber = 1;
-  const ::std::string& ret(int index) const;
-  ::std::string* mutable_ret(int index);
-  void set_ret(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_ret(int index, ::std::string&& value);
-  #endif
+  const std::string& ret(int index) const;
+  std::string* mutable_ret(int index);
+  void set_ret(int index, const std::string& value);
+  void set_ret(int index, std::string&& value);
   void set_ret(int index, const char* value);
   void set_ret(int index, const char* value, size_t size);
-  ::std::string* add_ret();
-  void add_ret(const ::std::string& value);
-  #if LANG_CXX11
-  void add_ret(::std::string&& value);
-  #endif
+  std::string* add_ret();
+  void add_ret(const std::string& value);
+  void add_ret(std::string&& value);
   void add_ret(const char* value);
   void add_ret(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& ret() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_ret();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& ret() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_ret();
+  private:
+  const std::string& _internal_ret(int index) const;
+  std::string* _internal_add_ret();
+  public:
 
   // repeated string arg = 3;
   int arg_size() const;
+  private:
+  int _internal_arg_size() const;
+  public:
   void clear_arg();
-  static const int kArgFieldNumber = 3;
-  const ::std::string& arg(int index) const;
-  ::std::string* mutable_arg(int index);
-  void set_arg(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_arg(int index, ::std::string&& value);
-  #endif
+  const std::string& arg(int index) const;
+  std::string* mutable_arg(int index);
+  void set_arg(int index, const std::string& value);
+  void set_arg(int index, std::string&& value);
   void set_arg(int index, const char* value);
   void set_arg(int index, const char* value, size_t size);
-  ::std::string* add_arg();
-  void add_arg(const ::std::string& value);
-  #if LANG_CXX11
-  void add_arg(::std::string&& value);
-  #endif
+  std::string* add_arg();
+  void add_arg(const std::string& value);
+  void add_arg(std::string&& value);
   void add_arg(const char* value);
   void add_arg(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& arg() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_arg();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& arg() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_arg();
+  private:
+  const std::string& _internal_arg(int index) const;
+  std::string* _internal_add_arg();
+  public:
 
   // repeated string dep = 4;
   int dep_size() const;
+  private:
+  int _internal_dep_size() const;
+  public:
   void clear_dep();
-  static const int kDepFieldNumber = 4;
-  const ::std::string& dep(int index) const;
-  ::std::string* mutable_dep(int index);
-  void set_dep(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_dep(int index, ::std::string&& value);
-  #endif
+  const std::string& dep(int index) const;
+  std::string* mutable_dep(int index);
+  void set_dep(int index, const std::string& value);
+  void set_dep(int index, std::string&& value);
   void set_dep(int index, const char* value);
   void set_dep(int index, const char* value, size_t size);
-  ::std::string* add_dep();
-  void add_dep(const ::std::string& value);
-  #if LANG_CXX11
-  void add_dep(::std::string&& value);
-  #endif
+  std::string* add_dep();
+  void add_dep(const std::string& value);
+  void add_dep(std::string&& value);
   void add_dep(const char* value);
   void add_dep(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& dep() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_dep();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& dep() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_dep();
+  private:
+  const std::string& _internal_dep(int index) const;
+  std::string* _internal_add_dep();
+  public:
 
   // map<string, .opencv_tensorflow.AttrValue> attr = 5;
   int attr_size() const;
+  private:
+  int _internal_attr_size() const;
+  public:
   void clear_attr();
-  static const int kAttrFieldNumber = 5;
-  const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
+      _internal_attr() const;
+  ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
+      _internal_mutable_attr();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
       attr() const;
-  ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
+  ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
       mutable_attr();
 
   // string op = 2;
   void clear_op();
-  static const int kOpFieldNumber = 2;
-  const ::std::string& op() const;
-  void set_op(const ::std::string& value);
-  #if LANG_CXX11
-  void set_op(::std::string&& value);
-  #endif
-  void set_op(const char* value);
-  void set_op(const char* value, size_t size);
-  ::std::string* mutable_op();
-  ::std::string* release_op();
-  void set_allocated_op(::std::string* op);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_op();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_op(
-      ::std::string* op);
+  const std::string& op() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_op(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_op();
+  PROTOBUF_NODISCARD std::string* release_op();
+  void set_allocated_op(std::string* op);
+  private:
+  const std::string& _internal_op() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_op(const std::string& value);
+  std::string* _internal_mutable_op();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.FunctionDef.Node)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> ret_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> arg_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> dep_;
-  ::google::protobuf::internal::MapField<
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> ret_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> arg_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> dep_;
+  ::PROTOBUF_NAMESPACE_ID::internal::MapField<
       FunctionDef_Node_AttrEntry_DoNotUse,
-      ::std::string, ::opencv_tensorflow::AttrValue,
-      ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-      ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-      0 > attr_;
-  ::google::protobuf::internal::ArenaStringPtr op_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_function_2eproto::TableStruct;
-  friend void ::protobuf_function_2eproto::InitDefaultsFunctionDef_NodeImpl();
+      std::string, ::opencv_tensorflow::AttrValue,
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> attr_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr op_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_function_2eproto;
 };
 // -------------------------------------------------------------------
 
-class FunctionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDef) */ {
+class FunctionDef final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDef) */ {
  public:
-  FunctionDef();
-  virtual ~FunctionDef();
+  inline FunctionDef() : FunctionDef(nullptr) {}
+  ~FunctionDef() override;
+  explicit constexpr FunctionDef(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   FunctionDef(const FunctionDef& from);
-
-  inline FunctionDef& operator=(const FunctionDef& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   FunctionDef(FunctionDef&& from) noexcept
     : FunctionDef() {
     *this = ::std::move(from);
   }
 
+  inline FunctionDef& operator=(const FunctionDef& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline FunctionDef& operator=(FunctionDef&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const FunctionDef& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const FunctionDef& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const FunctionDef* internal_default_instance() {
     return reinterpret_cast<const FunctionDef*>(
                &_FunctionDef_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     3;
 
-  void UnsafeArenaSwap(FunctionDef* other);
-  void Swap(FunctionDef* other);
   friend void swap(FunctionDef& a, FunctionDef& b) {
     a.Swap(&b);
   }
+  inline void Swap(FunctionDef* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(FunctionDef* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline FunctionDef* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  FunctionDef* 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;
+  FunctionDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<FunctionDef>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const FunctionDef& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const FunctionDef& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(FunctionDef* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.FunctionDef";
+  }
   protected:
-  explicit FunctionDef(::google::protobuf::Arena* arena);
+  explicit FunctionDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -552,200 +662,224 @@ class FunctionDef : public ::google::protobuf::Message /* @@protoc_insertion_poi
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNodeFieldNumber = 2,
+    kSignatureFieldNumber = 1,
+  };
   // repeated .opencv_tensorflow.FunctionDef.Node node = 2;
   int node_size() const;
+  private:
+  int _internal_node_size() const;
+  public:
   void clear_node();
-  static const int kNodeFieldNumber = 2;
-  const ::opencv_tensorflow::FunctionDef_Node& node(int index) const;
   ::opencv_tensorflow::FunctionDef_Node* mutable_node(int index);
-  ::opencv_tensorflow::FunctionDef_Node* add_node();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >*
       mutable_node();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >&
+  private:
+  const ::opencv_tensorflow::FunctionDef_Node& _internal_node(int index) const;
+  ::opencv_tensorflow::FunctionDef_Node* _internal_add_node();
+  public:
+  const ::opencv_tensorflow::FunctionDef_Node& node(int index) const;
+  ::opencv_tensorflow::FunctionDef_Node* add_node();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >&
       node() const;
 
   // .opencv_tensorflow.OpDef signature = 1;
   bool has_signature() const;
-  void clear_signature();
-  static const int kSignatureFieldNumber = 1;
   private:
-  void _slow_mutable_signature();
+  bool _internal_has_signature() const;
   public:
+  void clear_signature();
   const ::opencv_tensorflow::OpDef& signature() const;
-  ::opencv_tensorflow::OpDef* release_signature();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::OpDef* release_signature();
   ::opencv_tensorflow::OpDef* mutable_signature();
   void set_allocated_signature(::opencv_tensorflow::OpDef* signature);
+  private:
+  const ::opencv_tensorflow::OpDef& _internal_signature() const;
+  ::opencv_tensorflow::OpDef* _internal_mutable_signature();
+  public:
   void unsafe_arena_set_allocated_signature(
       ::opencv_tensorflow::OpDef* signature);
   ::opencv_tensorflow::OpDef* unsafe_arena_release_signature();
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.FunctionDef)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node > node_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node > node_;
   ::opencv_tensorflow::OpDef* signature_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_function_2eproto::TableStruct;
-  friend void ::protobuf_function_2eproto::InitDefaultsFunctionDefImpl();
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_function_2eproto;
 };
 // -------------------------------------------------------------------
 
-class GradientDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.GradientDef) */ {
+class GradientDef final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.GradientDef) */ {
  public:
-  GradientDef();
-  virtual ~GradientDef();
+  inline GradientDef() : GradientDef(nullptr) {}
+  ~GradientDef() override;
+  explicit constexpr GradientDef(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   GradientDef(const GradientDef& from);
-
-  inline GradientDef& operator=(const GradientDef& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   GradientDef(GradientDef&& from) noexcept
     : GradientDef() {
     *this = ::std::move(from);
   }
 
+  inline GradientDef& operator=(const GradientDef& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline GradientDef& operator=(GradientDef&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const GradientDef& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const GradientDef& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const GradientDef* internal_default_instance() {
     return reinterpret_cast<const GradientDef*>(
                &_GradientDef_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     4;
 
-  void UnsafeArenaSwap(GradientDef* other);
-  void Swap(GradientDef* other);
   friend void swap(GradientDef& a, GradientDef& b) {
     a.Swap(&b);
   }
+  inline void Swap(GradientDef* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(GradientDef* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline GradientDef* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  GradientDef* 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;
+  GradientDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<GradientDef>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const GradientDef& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const GradientDef& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(GradientDef* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.GradientDef";
+  }
   protected:
-  explicit GradientDef(::google::protobuf::Arena* arena);
+  explicit GradientDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFunctionNameFieldNumber = 1,
+    kGradientFuncFieldNumber = 2,
+  };
   // string function_name = 1;
   void clear_function_name();
-  static const int kFunctionNameFieldNumber = 1;
-  const ::std::string& function_name() const;
-  void set_function_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_function_name(::std::string&& value);
-  #endif
-  void set_function_name(const char* value);
-  void set_function_name(const char* value, size_t size);
-  ::std::string* mutable_function_name();
-  ::std::string* release_function_name();
-  void set_allocated_function_name(::std::string* function_name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_function_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_function_name(
-      ::std::string* function_name);
+  const std::string& function_name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_function_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_function_name();
+  PROTOBUF_NODISCARD std::string* release_function_name();
+  void set_allocated_function_name(std::string* function_name);
+  private:
+  const std::string& _internal_function_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_function_name(const std::string& value);
+  std::string* _internal_mutable_function_name();
+  public:
 
   // string gradient_func = 2;
   void clear_gradient_func();
-  static const int kGradientFuncFieldNumber = 2;
-  const ::std::string& gradient_func() const;
-  void set_gradient_func(const ::std::string& value);
-  #if LANG_CXX11
-  void set_gradient_func(::std::string&& value);
-  #endif
-  void set_gradient_func(const char* value);
-  void set_gradient_func(const char* value, size_t size);
-  ::std::string* mutable_gradient_func();
-  ::std::string* release_gradient_func();
-  void set_allocated_gradient_func(::std::string* gradient_func);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_gradient_func();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_gradient_func(
-      ::std::string* gradient_func);
+  const std::string& gradient_func() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_gradient_func(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_gradient_func();
+  PROTOBUF_NODISCARD std::string* release_gradient_func();
+  void set_allocated_gradient_func(std::string* gradient_func);
+  private:
+  const std::string& _internal_gradient_func() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_gradient_func(const std::string& value);
+  std::string* _internal_mutable_gradient_func();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.GradientDef)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::internal::ArenaStringPtr function_name_;
-  ::google::protobuf::internal::ArenaStringPtr gradient_func_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_function_2eproto::TableStruct;
-  friend void ::protobuf_function_2eproto::InitDefaultsGradientDefImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr function_name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr gradient_func_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_function_2eproto;
 };
 // ===================================================================
 
@@ -759,60 +893,80 @@ class GradientDef : public ::google::protobuf::Message /* @@protoc_insertion_poi
 // FunctionDefLibrary
 
 // repeated .opencv_tensorflow.FunctionDef function = 1;
-inline int FunctionDefLibrary::function_size() const {
+inline int FunctionDefLibrary::_internal_function_size() const {
   return function_.size();
 }
+inline int FunctionDefLibrary::function_size() const {
+  return _internal_function_size();
+}
 inline void FunctionDefLibrary::clear_function() {
   function_.Clear();
 }
-inline const ::opencv_tensorflow::FunctionDef& FunctionDefLibrary::function(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDefLibrary.function)
-  return function_.Get(index);
-}
 inline ::opencv_tensorflow::FunctionDef* FunctionDefLibrary::mutable_function(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDefLibrary.function)
   return function_.Mutable(index);
 }
-inline ::opencv_tensorflow::FunctionDef* FunctionDefLibrary::add_function() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDefLibrary.function)
-  return function_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >*
 FunctionDefLibrary::mutable_function() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDefLibrary.function)
   return &function_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >&
+inline const ::opencv_tensorflow::FunctionDef& FunctionDefLibrary::_internal_function(int index) const {
+  return function_.Get(index);
+}
+inline const ::opencv_tensorflow::FunctionDef& FunctionDefLibrary::function(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDefLibrary.function)
+  return _internal_function(index);
+}
+inline ::opencv_tensorflow::FunctionDef* FunctionDefLibrary::_internal_add_function() {
+  return function_.Add();
+}
+inline ::opencv_tensorflow::FunctionDef* FunctionDefLibrary::add_function() {
+  ::opencv_tensorflow::FunctionDef* _add = _internal_add_function();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDefLibrary.function)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >&
 FunctionDefLibrary::function() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDefLibrary.function)
   return function_;
 }
 
 // repeated .opencv_tensorflow.GradientDef gradient = 2;
-inline int FunctionDefLibrary::gradient_size() const {
+inline int FunctionDefLibrary::_internal_gradient_size() const {
   return gradient_.size();
 }
+inline int FunctionDefLibrary::gradient_size() const {
+  return _internal_gradient_size();
+}
 inline void FunctionDefLibrary::clear_gradient() {
   gradient_.Clear();
 }
-inline const ::opencv_tensorflow::GradientDef& FunctionDefLibrary::gradient(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDefLibrary.gradient)
-  return gradient_.Get(index);
-}
 inline ::opencv_tensorflow::GradientDef* FunctionDefLibrary::mutable_gradient(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDefLibrary.gradient)
   return gradient_.Mutable(index);
 }
-inline ::opencv_tensorflow::GradientDef* FunctionDefLibrary::add_gradient() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDefLibrary.gradient)
-  return gradient_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::GradientDef >*
 FunctionDefLibrary::mutable_gradient() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDefLibrary.gradient)
   return &gradient_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef >&
+inline const ::opencv_tensorflow::GradientDef& FunctionDefLibrary::_internal_gradient(int index) const {
+  return gradient_.Get(index);
+}
+inline const ::opencv_tensorflow::GradientDef& FunctionDefLibrary::gradient(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDefLibrary.gradient)
+  return _internal_gradient(index);
+}
+inline ::opencv_tensorflow::GradientDef* FunctionDefLibrary::_internal_add_gradient() {
+  return gradient_.Add();
+}
+inline ::opencv_tensorflow::GradientDef* FunctionDefLibrary::add_gradient() {
+  ::opencv_tensorflow::GradientDef* _add = _internal_add_gradient();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDefLibrary.gradient)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::GradientDef >&
 FunctionDefLibrary::gradient() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDefLibrary.gradient)
   return gradient_;
@@ -825,32 +979,41 @@ FunctionDefLibrary::gradient() const {
 // FunctionDef_Node
 
 // repeated string ret = 1;
-inline int FunctionDef_Node::ret_size() const {
+inline int FunctionDef_Node::_internal_ret_size() const {
   return ret_.size();
 }
+inline int FunctionDef_Node::ret_size() const {
+  return _internal_ret_size();
+}
 inline void FunctionDef_Node::clear_ret() {
   ret_.Clear();
 }
-inline const ::std::string& FunctionDef_Node::ret(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.ret)
+inline std::string* FunctionDef_Node::add_ret() {
+  std::string* _s = _internal_add_ret();
+  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.ret)
+  return _s;
+}
+inline const std::string& FunctionDef_Node::_internal_ret(int index) const {
   return ret_.Get(index);
 }
-inline ::std::string* FunctionDef_Node::mutable_ret(int index) {
+inline const std::string& FunctionDef_Node::ret(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.ret)
+  return _internal_ret(index);
+}
+inline std::string* FunctionDef_Node::mutable_ret(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.ret)
   return ret_.Mutable(index);
 }
-inline void FunctionDef_Node::set_ret(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.ret)
+inline void FunctionDef_Node::set_ret(int index, const std::string& value) {
   ret_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void FunctionDef_Node::set_ret(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.ret)
+}
+inline void FunctionDef_Node::set_ret(int index, std::string&& value) {
   ret_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.ret)
 }
-#endif
 inline void FunctionDef_Node::set_ret(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   ret_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_tensorflow.FunctionDef.Node.ret)
 }
@@ -859,22 +1022,19 @@ inline void FunctionDef_Node::set_ret(int index, const char* value, size_t size)
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.FunctionDef.Node.ret)
 }
-inline ::std::string* FunctionDef_Node::add_ret() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.ret)
+inline std::string* FunctionDef_Node::_internal_add_ret() {
   return ret_.Add();
 }
-inline void FunctionDef_Node::add_ret(const ::std::string& value) {
+inline void FunctionDef_Node::add_ret(const std::string& value) {
   ret_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.ret)
 }
-#if LANG_CXX11
-inline void FunctionDef_Node::add_ret(::std::string&& value) {
+inline void FunctionDef_Node::add_ret(std::string&& value) {
   ret_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.ret)
 }
-#endif
 inline void FunctionDef_Node::add_ret(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   ret_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_tensorflow.FunctionDef.Node.ret)
 }
@@ -882,12 +1042,12 @@ inline void FunctionDef_Node::add_ret(const char* value, size_t size) {
   ret_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.FunctionDef.Node.ret)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 FunctionDef_Node::ret() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDef.Node.ret)
   return ret_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 FunctionDef_Node::mutable_ret() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDef.Node.ret)
   return &ret_;
@@ -895,106 +1055,91 @@ FunctionDef_Node::mutable_ret() {
 
 // string op = 2;
 inline void FunctionDef_Node::clear_op() {
-  op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  op_.ClearToEmpty();
 }
-inline const ::std::string& FunctionDef_Node::op() const {
+inline const std::string& FunctionDef_Node::op() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.op)
-  return op_.Get();
+  return _internal_op();
 }
-inline void FunctionDef_Node::set_op(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void FunctionDef_Node::set_op(ArgT0&& arg0, ArgT... args) {
 
 op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
op_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.op)
 }
-#if LANG_CXX11
-inline void FunctionDef_Node::set_op(::std::string&& value) {
-
-  op_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.FunctionDef.Node.op)
+inline std::string* FunctionDef_Node::mutable_op() {
+  std::string* _s = _internal_mutable_op();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.op)
+  return _s;
 }
-#endif
-inline void FunctionDef_Node::set_op(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.FunctionDef.Node.op)
+inline const std::string& FunctionDef_Node::_internal_op() const {
+  return op_.Get();
 }
-inline void FunctionDef_Node::set_op(const char* value,
-    size_t size) {
+inline void FunctionDef_Node::_internal_set_op(const std::string& value) {
 
-  op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.FunctionDef.Node.op)
+  op_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* FunctionDef_Node::mutable_op() {
+inline std::string* FunctionDef_Node::_internal_mutable_op() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.op)
-  return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return op_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* FunctionDef_Node::release_op() {
+inline std::string* FunctionDef_Node::release_op() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.FunctionDef.Node.op)
-
-  return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return op_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void FunctionDef_Node::set_allocated_op(::std::string* op) {
-  if (op != NULL) {
+inline void FunctionDef_Node::set_allocated_op(std::string* op) {
+  if (op != nullptr) {
 
   } else {
 
   }
-  op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.FunctionDef.Node.op)
-}
-inline ::std::string* FunctionDef_Node::unsafe_arena_release_op() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.FunctionDef.Node.op)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void FunctionDef_Node::unsafe_arena_set_allocated_op(
-    ::std::string* op) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (op != NULL) {
-
-  } else {
-
+  op_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), op,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (op_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    op_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      op, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.FunctionDef.Node.op)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.FunctionDef.Node.op)
 }
 
 // repeated string arg = 3;
-inline int FunctionDef_Node::arg_size() const {
+inline int FunctionDef_Node::_internal_arg_size() const {
   return arg_.size();
 }
+inline int FunctionDef_Node::arg_size() const {
+  return _internal_arg_size();
+}
 inline void FunctionDef_Node::clear_arg() {
   arg_.Clear();
 }
-inline const ::std::string& FunctionDef_Node::arg(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.arg)
+inline std::string* FunctionDef_Node::add_arg() {
+  std::string* _s = _internal_add_arg();
+  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.arg)
+  return _s;
+}
+inline const std::string& FunctionDef_Node::_internal_arg(int index) const {
   return arg_.Get(index);
 }
-inline ::std::string* FunctionDef_Node::mutable_arg(int index) {
+inline const std::string& FunctionDef_Node::arg(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.arg)
+  return _internal_arg(index);
+}
+inline std::string* FunctionDef_Node::mutable_arg(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.arg)
   return arg_.Mutable(index);
 }
-inline void FunctionDef_Node::set_arg(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.arg)
+inline void FunctionDef_Node::set_arg(int index, const std::string& value) {
   arg_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void FunctionDef_Node::set_arg(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.arg)
+}
+inline void FunctionDef_Node::set_arg(int index, std::string&& value) {
   arg_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.arg)
 }
-#endif
 inline void FunctionDef_Node::set_arg(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   arg_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_tensorflow.FunctionDef.Node.arg)
 }
@@ -1003,22 +1148,19 @@ inline void FunctionDef_Node::set_arg(int index, const char* value, size_t size)
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.FunctionDef.Node.arg)
 }
-inline ::std::string* FunctionDef_Node::add_arg() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.arg)
+inline std::string* FunctionDef_Node::_internal_add_arg() {
   return arg_.Add();
 }
-inline void FunctionDef_Node::add_arg(const ::std::string& value) {
+inline void FunctionDef_Node::add_arg(const std::string& value) {
   arg_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.arg)
 }
-#if LANG_CXX11
-inline void FunctionDef_Node::add_arg(::std::string&& value) {
+inline void FunctionDef_Node::add_arg(std::string&& value) {
   arg_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.arg)
 }
-#endif
 inline void FunctionDef_Node::add_arg(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   arg_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_tensorflow.FunctionDef.Node.arg)
 }
@@ -1026,44 +1168,53 @@ inline void FunctionDef_Node::add_arg(const char* value, size_t size) {
   arg_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.FunctionDef.Node.arg)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 FunctionDef_Node::arg() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDef.Node.arg)
   return arg_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 FunctionDef_Node::mutable_arg() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDef.Node.arg)
   return &arg_;
 }
 
 // repeated string dep = 4;
-inline int FunctionDef_Node::dep_size() const {
+inline int FunctionDef_Node::_internal_dep_size() const {
   return dep_.size();
 }
+inline int FunctionDef_Node::dep_size() const {
+  return _internal_dep_size();
+}
 inline void FunctionDef_Node::clear_dep() {
   dep_.Clear();
 }
-inline const ::std::string& FunctionDef_Node::dep(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.dep)
+inline std::string* FunctionDef_Node::add_dep() {
+  std::string* _s = _internal_add_dep();
+  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.dep)
+  return _s;
+}
+inline const std::string& FunctionDef_Node::_internal_dep(int index) const {
   return dep_.Get(index);
 }
-inline ::std::string* FunctionDef_Node::mutable_dep(int index) {
+inline const std::string& FunctionDef_Node::dep(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.dep)
+  return _internal_dep(index);
+}
+inline std::string* FunctionDef_Node::mutable_dep(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.dep)
   return dep_.Mutable(index);
 }
-inline void FunctionDef_Node::set_dep(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.dep)
+inline void FunctionDef_Node::set_dep(int index, const std::string& value) {
   dep_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void FunctionDef_Node::set_dep(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.dep)
+}
+inline void FunctionDef_Node::set_dep(int index, std::string&& value) {
   dep_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.dep)
 }
-#endif
 inline void FunctionDef_Node::set_dep(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   dep_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_tensorflow.FunctionDef.Node.dep)
 }
@@ -1072,22 +1223,19 @@ inline void FunctionDef_Node::set_dep(int index, const char* value, size_t size)
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.FunctionDef.Node.dep)
 }
-inline ::std::string* FunctionDef_Node::add_dep() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.dep)
+inline std::string* FunctionDef_Node::_internal_add_dep() {
   return dep_.Add();
 }
-inline void FunctionDef_Node::add_dep(const ::std::string& value) {
+inline void FunctionDef_Node::add_dep(const std::string& value) {
   dep_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.dep)
 }
-#if LANG_CXX11
-inline void FunctionDef_Node::add_dep(::std::string&& value) {
+inline void FunctionDef_Node::add_dep(std::string&& value) {
   dep_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.dep)
 }
-#endif
 inline void FunctionDef_Node::add_dep(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   dep_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_tensorflow.FunctionDef.Node.dep)
 }
@@ -1095,30 +1243,41 @@ inline void FunctionDef_Node::add_dep(const char* value, size_t size) {
   dep_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.FunctionDef.Node.dep)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 FunctionDef_Node::dep() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDef.Node.dep)
   return dep_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 FunctionDef_Node::mutable_dep() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDef.Node.dep)
   return &dep_;
 }
 
 // map<string, .opencv_tensorflow.AttrValue> attr = 5;
-inline int FunctionDef_Node::attr_size() const {
+inline int FunctionDef_Node::_internal_attr_size() const {
   return attr_.size();
 }
-inline const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
+inline int FunctionDef_Node::attr_size() const {
+  return _internal_attr_size();
+}
+inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
+FunctionDef_Node::_internal_attr() const {
+  return attr_.GetMap();
+}
+inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
 FunctionDef_Node::attr() const {
   // @@protoc_insertion_point(field_map:opencv_tensorflow.FunctionDef.Node.attr)
-  return attr_.GetMap();
+  return _internal_attr();
+}
+inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
+FunctionDef_Node::_internal_mutable_attr() {
+  return attr_.MutableMap();
 }
-inline ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
+inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
 FunctionDef_Node::mutable_attr() {
   // @@protoc_insertion_point(field_mutable_map:opencv_tensorflow.FunctionDef.Node.attr)
-  return attr_.MutableMap();
+  return _internal_mutable_attr();
 }
 
 // -------------------------------------------------------------------
@@ -1126,50 +1285,81 @@ FunctionDef_Node::mutable_attr() {
 // FunctionDef
 
 // .opencv_tensorflow.OpDef signature = 1;
+inline bool FunctionDef::_internal_has_signature() const {
+  return this != internal_default_instance() && signature_ != nullptr;
+}
 inline bool FunctionDef::has_signature() const {
-  return this != internal_default_instance() && signature_ != NULL;
+  return _internal_has_signature();
 }
-inline const ::opencv_tensorflow::OpDef& FunctionDef::signature() const {
+inline const ::opencv_tensorflow::OpDef& FunctionDef::_internal_signature() const {
   const ::opencv_tensorflow::OpDef* p = signature_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_tensorflow::OpDef&>(
+      ::opencv_tensorflow::_OpDef_default_instance_);
+}
+inline const ::opencv_tensorflow::OpDef& FunctionDef::signature() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.signature)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::OpDef*>(
-      &::opencv_tensorflow::_OpDef_default_instance_);
+  return _internal_signature();
+}
+inline void FunctionDef::unsafe_arena_set_allocated_signature(
+    ::opencv_tensorflow::OpDef* signature) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(signature_);
+  }
+  signature_ = signature;
+  if (signature) {
+
+  } else {
+
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.FunctionDef.signature)
 }
 inline ::opencv_tensorflow::OpDef* FunctionDef::release_signature() {
-  // @@protoc_insertion_point(field_release:opencv_tensorflow.FunctionDef.signature)
 
   ::opencv_tensorflow::OpDef* temp = signature_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+  signature_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
   }
-  signature_ = NULL;
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::opencv_tensorflow::OpDef* FunctionDef::unsafe_arena_release_signature() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.FunctionDef.signature)
+  // @@protoc_insertion_point(field_release:opencv_tensorflow.FunctionDef.signature)
 
   ::opencv_tensorflow::OpDef* temp = signature_;
-  signature_ = NULL;
+  signature_ = nullptr;
   return temp;
 }
-inline ::opencv_tensorflow::OpDef* FunctionDef::mutable_signature() {
+inline ::opencv_tensorflow::OpDef* FunctionDef::_internal_mutable_signature() {
 
-  if (signature_ == NULL) {
-    _slow_mutable_signature();
+  if (signature_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_tensorflow::OpDef>(GetArenaForAllocation());
+    signature_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.signature)
   return signature_;
 }
+inline ::opencv_tensorflow::OpDef* FunctionDef::mutable_signature() {
+  ::opencv_tensorflow::OpDef* _msg = _internal_mutable_signature();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.signature)
+  return _msg;
+}
 inline void FunctionDef::set_allocated_signature(::opencv_tensorflow::OpDef* signature) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(signature_);
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(signature_);
   }
   if (signature) {
-    ::google::protobuf::Arena* submessage_arena =
-      reinterpret_cast< ::google::protobuf::MessageLite*>(signature)->GetArena();
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<
+            ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena(
+                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(signature));
     if (message_arena != submessage_arena) {
-      signature = ::google::protobuf::internal::GetOwnedMessage(
+      signature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, signature, submessage_arena);
     }
 
@@ -1181,30 +1371,40 @@ inline void FunctionDef::set_allocated_signature(::opencv_tensorflow::OpDef* sig
 }
 
 // repeated .opencv_tensorflow.FunctionDef.Node node = 2;
-inline int FunctionDef::node_size() const {
+inline int FunctionDef::_internal_node_size() const {
   return node_.size();
 }
+inline int FunctionDef::node_size() const {
+  return _internal_node_size();
+}
 inline void FunctionDef::clear_node() {
   node_.Clear();
 }
-inline const ::opencv_tensorflow::FunctionDef_Node& FunctionDef::node(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.node)
-  return node_.Get(index);
-}
 inline ::opencv_tensorflow::FunctionDef_Node* FunctionDef::mutable_node(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.node)
   return node_.Mutable(index);
 }
-inline ::opencv_tensorflow::FunctionDef_Node* FunctionDef::add_node() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.node)
-  return node_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >*
 FunctionDef::mutable_node() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDef.node)
   return &node_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >&
+inline const ::opencv_tensorflow::FunctionDef_Node& FunctionDef::_internal_node(int index) const {
+  return node_.Get(index);
+}
+inline const ::opencv_tensorflow::FunctionDef_Node& FunctionDef::node(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.node)
+  return _internal_node(index);
+}
+inline ::opencv_tensorflow::FunctionDef_Node* FunctionDef::_internal_add_node() {
+  return node_.Add();
+}
+inline ::opencv_tensorflow::FunctionDef_Node* FunctionDef::add_node() {
+  ::opencv_tensorflow::FunctionDef_Node* _add = _internal_add_node();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.node)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >&
 FunctionDef::node() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDef.node)
   return node_;
@@ -1216,152 +1416,104 @@ FunctionDef::node() const {
 
 // string function_name = 1;
 inline void GradientDef::clear_function_name() {
-  function_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  function_name_.ClearToEmpty();
 }
-inline const ::std::string& GradientDef::function_name() const {
+inline const std::string& GradientDef::function_name() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.GradientDef.function_name)
-  return function_name_.Get();
+  return _internal_function_name();
 }
-inline void GradientDef::set_function_name(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void GradientDef::set_function_name(ArgT0&& arg0, ArgT... args) {
 
 function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
function_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.GradientDef.function_name)
 }
-#if LANG_CXX11
-inline void GradientDef::set_function_name(::std::string&& value) {
-
-  function_name_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.GradientDef.function_name)
+inline std::string* GradientDef::mutable_function_name() {
+  std::string* _s = _internal_mutable_function_name();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GradientDef.function_name)
+  return _s;
 }
-#endif
-inline void GradientDef::set_function_name(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.GradientDef.function_name)
+inline const std::string& GradientDef::_internal_function_name() const {
+  return function_name_.Get();
 }
-inline void GradientDef::set_function_name(const char* value,
-    size_t size) {
+inline void GradientDef::_internal_set_function_name(const std::string& value) {
 
-  function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.GradientDef.function_name)
+  function_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* GradientDef::mutable_function_name() {
+inline std::string* GradientDef::_internal_mutable_function_name() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GradientDef.function_name)
-  return function_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return function_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* GradientDef::release_function_name() {
+inline std::string* GradientDef::release_function_name() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.GradientDef.function_name)
-
-  return function_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return function_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void GradientDef::set_allocated_function_name(::std::string* function_name) {
-  if (function_name != NULL) {
+inline void GradientDef::set_allocated_function_name(std::string* function_name) {
+  if (function_name != nullptr) {
 
   } else {
 
   }
-  function_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), function_name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.GradientDef.function_name)
-}
-inline ::std::string* GradientDef::unsafe_arena_release_function_name() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.GradientDef.function_name)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return function_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void GradientDef::unsafe_arena_set_allocated_function_name(
-    ::std::string* function_name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (function_name != NULL) {
-
-  } else {
-
+  function_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), function_name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (function_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    function_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  function_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      function_name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GradientDef.function_name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.GradientDef.function_name)
 }
 
 // string gradient_func = 2;
 inline void GradientDef::clear_gradient_func() {
-  gradient_func_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  gradient_func_.ClearToEmpty();
 }
-inline const ::std::string& GradientDef::gradient_func() const {
+inline const std::string& GradientDef::gradient_func() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.GradientDef.gradient_func)
-  return gradient_func_.Get();
+  return _internal_gradient_func();
 }
-inline void GradientDef::set_gradient_func(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void GradientDef::set_gradient_func(ArgT0&& arg0, ArgT... args) {
 
 gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
gradient_func_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.GradientDef.gradient_func)
 }
-#if LANG_CXX11
-inline void GradientDef::set_gradient_func(::std::string&& value) {
-
-  gradient_func_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.GradientDef.gradient_func)
+inline std::string* GradientDef::mutable_gradient_func() {
+  std::string* _s = _internal_mutable_gradient_func();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GradientDef.gradient_func)
+  return _s;
 }
-#endif
-inline void GradientDef::set_gradient_func(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.GradientDef.gradient_func)
+inline const std::string& GradientDef::_internal_gradient_func() const {
+  return gradient_func_.Get();
 }
-inline void GradientDef::set_gradient_func(const char* value,
-    size_t size) {
+inline void GradientDef::_internal_set_gradient_func(const std::string& value) {
 
-  gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.GradientDef.gradient_func)
+  gradient_func_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* GradientDef::mutable_gradient_func() {
+inline std::string* GradientDef::_internal_mutable_gradient_func() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GradientDef.gradient_func)
-  return gradient_func_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return gradient_func_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* GradientDef::release_gradient_func() {
+inline std::string* GradientDef::release_gradient_func() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.GradientDef.gradient_func)
-
-  return gradient_func_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return gradient_func_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void GradientDef::set_allocated_gradient_func(::std::string* gradient_func) {
-  if (gradient_func != NULL) {
+inline void GradientDef::set_allocated_gradient_func(std::string* gradient_func) {
+  if (gradient_func != nullptr) {
 
   } else {
 
   }
-  gradient_func_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), gradient_func,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.GradientDef.gradient_func)
-}
-inline ::std::string* GradientDef::unsafe_arena_release_gradient_func() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.GradientDef.gradient_func)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return gradient_func_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void GradientDef::unsafe_arena_set_allocated_gradient_func(
-    ::std::string* gradient_func) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (gradient_func != NULL) {
-
-  } else {
-
+  gradient_func_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), gradient_func,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (gradient_func_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    gradient_func_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  gradient_func_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      gradient_func, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GradientDef.gradient_func)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.GradientDef.gradient_func)
 }
 
 #ifdef __GNUC__
@@ -1382,4 +1534,5 @@ inline void GradientDef::unsafe_arena_set_allocated_gradient_func(
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_function_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_function_2eproto
index 31c7b63..45a87de 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_tensorflow {
-class GraphDefDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<GraphDef>
-      _instance;
-} _GraphDef_default_instance_;
-class NodeDef_AttrEntry_DoNotUseDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NodeDef_AttrEntry_DoNotUse>
-      _instance;
-} _NodeDef_AttrEntry_DoNotUse_default_instance_;
-class NodeDefDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<NodeDef>
-      _instance;
-} _NodeDef_default_instance_;
+constexpr GraphDef::GraphDef(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : node_()
+  , library_(nullptr)
+  , versions_(nullptr)
+  , version_(0){}
+struct GraphDefDefaultTypeInternal {
+  constexpr GraphDefDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~GraphDefDefaultTypeInternal() {}
+  union {
+    GraphDef _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GraphDefDefaultTypeInternal _GraphDef_default_instance_;
+constexpr NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){}
+struct NodeDef_AttrEntry_DoNotUseDefaultTypeInternal {
+  constexpr NodeDef_AttrEntry_DoNotUseDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NodeDef_AttrEntry_DoNotUseDefaultTypeInternal() {}
+  union {
+    NodeDef_AttrEntry_DoNotUse _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NodeDef_AttrEntry_DoNotUseDefaultTypeInternal _NodeDef_AttrEntry_DoNotUse_default_instance_;
+constexpr NodeDef::NodeDef(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : input_()
+  , attr_(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{})
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , op_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , device_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
+struct NodeDefDefaultTypeInternal {
+  constexpr NodeDefDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~NodeDefDefaultTypeInternal() {}
+  union {
+    NodeDef _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NodeDefDefaultTypeInternal _NodeDef_default_instance_;
 }  // namespace opencv_tensorflow
-namespace protobuf_graph_2eproto {
-void InitDefaultsGraphDefImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_graph_2eproto::InitDefaultsNodeDef();
-  protobuf_versions_2eproto::InitDefaultsVersionDef();
-  protobuf_function_2eproto::InitDefaultsFunctionDefLibrary();
-  {
-    void* ptr = &::opencv_tensorflow::_GraphDef_default_instance_;
-    new (ptr) ::opencv_tensorflow::GraphDef();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::GraphDef::InitAsDefaultInstance();
-}
-
-void InitDefaultsGraphDef() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsGraphDefImpl);
-}
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_graph_2eproto[3];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_graph_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_graph_2eproto = nullptr;
 
-void InitDefaultsNodeDef_AttrEntry_DoNotUseImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
-  {
-    void* ptr = &::opencv_tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_;
-    new (ptr) ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse();
-  }
-  ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse::InitAsDefaultInstance();
-}
-
-void InitDefaultsNodeDef_AttrEntry_DoNotUse() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNodeDef_AttrEntry_DoNotUseImpl);
-}
-
-void InitDefaultsNodeDefImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_graph_2eproto::InitDefaultsNodeDef_AttrEntry_DoNotUse();
-  {
-    void* ptr = &::opencv_tensorflow::_NodeDef_default_instance_;
-    new (ptr) ::opencv_tensorflow::NodeDef();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::NodeDef::InitAsDefaultInstance();
-}
-
-void InitDefaultsNodeDef() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNodeDefImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[3];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+const uint32_t TableStruct_graph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::GraphDef, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, node_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, versions_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, version_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, library_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, _internal_metadata_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::GraphDef, node_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::GraphDef, versions_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::GraphDef, version_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::GraphDef, library_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, key_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, value_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, key_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, value_),
   0,
   1,
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, op_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, input_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, device_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, attr_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef, op_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef, input_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef, device_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::NodeDef, attr_),
 };
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, -1, sizeof(::opencv_tensorflow::GraphDef)},
-  { 9, 16, sizeof(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse)},
-  { 18, -1, sizeof(::opencv_tensorflow::NodeDef)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::opencv_tensorflow::GraphDef)},
+  { 10, 18, -1, sizeof(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse)},
+  { 20, -1, -1, sizeof(::opencv_tensorflow::NodeDef)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_GraphDef_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_NodeDef_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_GraphDef_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_NodeDef_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "graph.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\013graph.proto\022\021opencv_tensorflow\032\020attr_v"
-      "alue.proto\032\016function.proto\032\016versions.pro"
-      "to\"\262\001\n\010GraphDef\022(\n\004node\030\001 \003(\0132\032.opencv_t"
-      "ensorflow.NodeDef\022/\n\010versions\030\004 \001(\0132\035.op"
-      "encv_tensorflow.VersionDef\022\023\n\007version\030\003 "
-      "\001(\005B\002\030\001\0226\n\007library\030\002 \001(\0132%.opencv_tensor"
-      "flow.FunctionDefLibrary\"\301\001\n\007NodeDef\022\014\n\004n"
-      "ame\030\001 \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005input\030\003 \003(\t\022\016\n\006"
-      "device\030\004 \001(\t\0222\n\004attr\030\005 \003(\0132$.opencv_tens"
-      "orflow.NodeDef.AttrEntry\032I\n\tAttrEntry\022\013\n"
-      "\003key\030\001 \001(\t\022+\n\005value\030\002 \001(\0132\034.opencv_tenso"
-      "rflow.AttrValue:\0028\001B,\n\030org.tensorflow.fr"
-      "ameworkB\013GraphProtosP\001\370\001\001b\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 513);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "graph.proto", &protobuf_RegisterTypes);
-  ::protobuf_attr_5fvalue_2eproto::AddDescriptors();
-  ::protobuf_function_2eproto::AddDescriptors();
-  ::protobuf_versions_2eproto::AddDescriptors();
+const char descriptor_table_protodef_graph_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\013graph.proto\022\021opencv_tensorflow\032\020attr_v"
+  "alue.proto\032\016function.proto\032\016versions.pro"
+  "to\"\262\001\n\010GraphDef\022(\n\004node\030\001 \003(\0132\032.opencv_t"
+  "ensorflow.NodeDef\022/\n\010versions\030\004 \001(\0132\035.op"
+  "encv_tensorflow.VersionDef\022\023\n\007version\030\003 "
+  "\001(\005B\002\030\001\0226\n\007library\030\002 \001(\0132%.opencv_tensor"
+  "flow.FunctionDefLibrary\"\301\001\n\007NodeDef\022\014\n\004n"
+  "ame\030\001 \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005input\030\003 \003(\t\022\016\n\006"
+  "device\030\004 \001(\t\0222\n\004attr\030\005 \003(\0132$.opencv_tens"
+  "orflow.NodeDef.AttrEntry\032I\n\tAttrEntry\022\013\n"
+  "\003key\030\001 \001(\t\022+\n\005value\030\002 \001(\0132\034.opencv_tenso"
+  "rflow.AttrValue:\0028\001B,\n\030org.tensorflow.fr"
+  "ameworkB\013GraphProtosP\001\370\001\001b\006proto3"
+  ;
+static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_graph_2eproto_deps[3] = {
+  &::descriptor_table_attr_5fvalue_2eproto,
+  &::descriptor_table_function_2eproto,
+  &::descriptor_table_versions_2eproto,
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_graph_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto = {
+  false, false, 513, descriptor_table_protodef_graph_2eproto, "graph.proto",
+  &descriptor_table_graph_2eproto_once, descriptor_table_graph_2eproto_deps, 3, 3,
+  schemas, file_default_instances, TableStruct_graph_2eproto::offsets,
+  file_level_metadata_graph_2eproto, file_level_enum_descriptors_graph_2eproto, file_level_service_descriptors_graph_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_graph_2eproto_getter() {
+  return &descriptor_table_graph_2eproto;
 }
 
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_graph_2eproto
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_graph_2eproto(&descriptor_table_graph_2eproto);
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-void GraphDef::InitAsDefaultInstance() {
-  ::opencv_tensorflow::_GraphDef_default_instance_._instance.get_mutable()->versions_ = const_cast< ::opencv_tensorflow::VersionDef*>(
-      ::opencv_tensorflow::VersionDef::internal_default_instance());
-  ::opencv_tensorflow::_GraphDef_default_instance_._instance.get_mutable()->library_ = const_cast< ::opencv_tensorflow::FunctionDefLibrary*>(
-      ::opencv_tensorflow::FunctionDefLibrary::internal_default_instance());
-}
-void GraphDef::_slow_mutable_versions() {
-  versions_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::VersionDef >(
-      GetArenaNoVirtual());
-}
-void GraphDef::unsafe_arena_set_allocated_versions(
-    ::opencv_tensorflow::VersionDef* versions) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete versions_;
-  }
-  versions_ = versions;
-  if (versions) {
-
-  } else {
+class GraphDef::_Internal {
+ public:
+  static const ::opencv_tensorflow::VersionDef& versions(const GraphDef* msg);
+  static const ::opencv_tensorflow::FunctionDefLibrary& library(const GraphDef* msg);
+};
 
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GraphDef.versions)
+const ::opencv_tensorflow::VersionDef&
+GraphDef::_Internal::versions(const GraphDef* msg) {
+  return *msg->versions_;
+}
+const ::opencv_tensorflow::FunctionDefLibrary&
+GraphDef::_Internal::library(const GraphDef* msg) {
+  return *msg->library_;
 }
 void GraphDef::clear_versions() {
-  if (GetArenaNoVirtual() == NULL && versions_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && versions_ != nullptr) {
     delete versions_;
   }
-  versions_ = NULL;
-}
-void GraphDef::_slow_mutable_library() {
-  library_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::FunctionDefLibrary >(
-      GetArenaNoVirtual());
-}
-void GraphDef::unsafe_arena_set_allocated_library(
-    ::opencv_tensorflow::FunctionDefLibrary* library) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete library_;
-  }
-  library_ = library;
-  if (library) {
-
-  } else {
-
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GraphDef.library)
+  versions_ = nullptr;
 }
 void GraphDef::clear_library() {
-  if (GetArenaNoVirtual() == NULL && library_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && library_ != nullptr) {
     delete library_;
   }
-  library_ = NULL;
+  library_ = nullptr;
 }
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int GraphDef::kNodeFieldNumber;
-const int GraphDef::kVersionsFieldNumber;
-const int GraphDef::kVersionFieldNumber;
-const int GraphDef::kLibraryFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-GraphDef::GraphDef()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_graph_2eproto::InitDefaultsGraphDef();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.GraphDef)
-}
-GraphDef::GraphDef(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+GraphDef::GraphDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   node_(arena) {
-  ::protobuf_graph_2eproto::InitDefaultsGraphDef();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.GraphDef)
 }
 GraphDef::GraphDef(const GraphDef& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      node_(from.node_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_library()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      node_(from.node_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_library()) {
     library_ = new ::opencv_tensorflow::FunctionDefLibrary(*from.library_);
   } else {
-    library_ = NULL;
+    library_ = nullptr;
   }
-  if (from.has_versions()) {
+  if (from._internal_has_versions()) {
     versions_ = new ::opencv_tensorflow::VersionDef(*from.versions_);
   } else {
-    versions_ = NULL;
+    versions_ = nullptr;
   }
   version_ = from.version_;
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.GraphDef)
 }
 
-void GraphDef::SharedCtor() {
-  ::memset(&library_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&version_) -
-      reinterpret_cast<char*>(&library_)) + sizeof(version_));
-  _cached_size_ = 0;
+inline void GraphDef::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&library_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&version_) -
+    reinterpret_cast<char*>(&library_)) + sizeof(version_));
 }
 
 GraphDef::~GraphDef() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.GraphDef)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void GraphDef::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void GraphDef::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete library_;
   if (this != internal_default_instance()) delete versions_;
 }
@@ -326,199 +224,136 @@ void GraphDef::ArenaDtor(void* object) {
   GraphDef* _this = reinterpret_cast< GraphDef* >(object);
   (void)_this;
 }
-void GraphDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void GraphDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void GraphDef::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* GraphDef::descriptor() {
-  ::protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_graph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const GraphDef& GraphDef::default_instance() {
-  ::protobuf_graph_2eproto::InitDefaultsGraphDef();
-  return *internal_default_instance();
-}
-
-GraphDef* GraphDef::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<GraphDef>(arena);
+  _cached_size_.Set(size);
 }
 
 void GraphDef::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.GraphDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   node_.Clear();
-  if (GetArenaNoVirtual() == NULL && library_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && library_ != nullptr) {
     delete library_;
   }
-  library_ = NULL;
-  if (GetArenaNoVirtual() == NULL && versions_ != NULL) {
+  library_ = nullptr;
+  if (GetArenaForAllocation() == nullptr && versions_ != nullptr) {
     delete versions_;
   }
-  versions_ = NULL;
+  versions_ = nullptr;
   version_ = 0;
-  _internal_metadata_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-bool GraphDef::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:opencv_tensorflow.GraphDef)
-  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)) {
+const char* GraphDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .opencv_tensorflow.NodeDef node = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_node()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_node(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.FunctionDefLibrary library = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_library()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_library(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // int32 version = 3 [deprecated = true];
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &version_)));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.VersionDef versions = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_versions()));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_versions(), ptr);
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.GraphDef)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.GraphDef)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void GraphDef::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.GraphDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_tensorflow.NodeDef node = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->node(static_cast<int>(i)), output);
-  }
-
-  // .opencv_tensorflow.FunctionDefLibrary library = 2;
-  if (this->has_library()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->library_, output);
-  }
-
-  // int32 version = 3 [deprecated = true];
-  if (this->version() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version(), output);
-  }
-
-  // .opencv_tensorflow.VersionDef versions = 4;
-  if (this->has_versions()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, *this->versions_, output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.GraphDef)
-}
-
-::google::protobuf::uint8* GraphDef::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* GraphDef::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.GraphDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .opencv_tensorflow.NodeDef node = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->node(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_node_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_node(i), target, stream);
   }
 
   // .opencv_tensorflow.FunctionDefLibrary library = 2;
-  if (this->has_library()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, *this->library_, deterministic, target);
+  if (this->_internal_has_library()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        2, _Internal::library(this), target, stream);
   }
 
   // int32 version = 3 [deprecated = true];
-  if (this->version() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version(), target);
+  if (this->_internal_version() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_version(), target);
   }
 
   // .opencv_tensorflow.VersionDef versions = 4;
-  if (this->has_versions()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, *this->versions_, deterministic, target);
+  if (this->_internal_has_versions()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        4, _Internal::versions(this), target, stream);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.GraphDef)
   return target;
@@ -528,89 +363,69 @@ size_t GraphDef::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.GraphDef)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_tensorflow.NodeDef node = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->node_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->node(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_node_size();
+  for (const auto& msg : this->node_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // .opencv_tensorflow.FunctionDefLibrary library = 2;
-  if (this->has_library()) {
+  if (this->_internal_has_library()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->library_);
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *library_);
   }
 
   // .opencv_tensorflow.VersionDef versions = 4;
-  if (this->has_versions()) {
+  if (this->_internal_has_versions()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->versions_);
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *versions_);
   }
 
   // int32 version = 3 [deprecated = true];
-  if (this->version() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->version());
+  if (this->_internal_version() != 0) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_version());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void GraphDef::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.GraphDef)
-  GOOGLE_DCHECK_NE(&from, this);
-  const GraphDef* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const GraphDef>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.GraphDef)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.GraphDef)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GraphDef::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    GraphDef::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GraphDef::GetClassData() const { return &_class_data_; }
+
+void GraphDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<GraphDef *>(to)->MergeFrom(
+      static_cast<const GraphDef &>(from));
 }
 
+
 void GraphDef::MergeFrom(const GraphDef& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.GraphDef)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   node_.MergeFrom(from.node_);
-  if (from.has_library()) {
-    mutable_library()->::opencv_tensorflow::FunctionDefLibrary::MergeFrom(from.library());
+  if (from._internal_has_library()) {
+    _internal_mutable_library()->::opencv_tensorflow::FunctionDefLibrary::MergeFrom(from._internal_library());
   }
-  if (from.has_versions()) {
-    mutable_versions()->::opencv_tensorflow::VersionDef::MergeFrom(from.versions());
+  if (from._internal_has_versions()) {
+    _internal_mutable_versions()->::opencv_tensorflow::VersionDef::MergeFrom(from._internal_versions());
   }
-  if (from.version() != 0) {
-    set_version(from.version());
+  if (from._internal_version() != 0) {
+    _internal_set_version(from._internal_version());
   }
-}
-
-void GraphDef::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.GraphDef)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void GraphDef::CopyFrom(const GraphDef& from) {
@@ -624,512 +439,325 @@ bool GraphDef::IsInitialized() const {
   return true;
 }
 
-void GraphDef::Swap(GraphDef* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    GraphDef* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void GraphDef::UnsafeArenaSwap(GraphDef* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void GraphDef::InternalSwap(GraphDef* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   node_.InternalSwap(&other->node_);
-  swap(library_, other->library_);
-  swap(versions_, other->versions_);
-  swap(version_, other->version_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(GraphDef, version_)
+      + sizeof(GraphDef::version_)
+      - PROTOBUF_FIELD_OFFSET(GraphDef, library_)>(
+          reinterpret_cast<char*>(&library_),
+          reinterpret_cast<char*>(&other->library_));
 }
 
-::google::protobuf::Metadata GraphDef::GetMetadata() const {
-  protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_graph_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata GraphDef::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once,
+      file_level_metadata_graph_2eproto[0]);
 }
 
-
 // ===================================================================
 
 NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse() {}
-NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {}
+NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
+    : SuperType(arena) {}
 void NodeDef_AttrEntry_DoNotUse::MergeFrom(const NodeDef_AttrEntry_DoNotUse& other) {
   MergeFromInternal(other);
 }
-::google::protobuf::Metadata NodeDef_AttrEntry_DoNotUse::GetMetadata() const {
-  ::protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_graph_2eproto::file_level_metadata[1];
-}
-void NodeDef_AttrEntry_DoNotUse::MergeFrom(
-    const ::google::protobuf::Message& other) {
-  ::google::protobuf::Message::MergeFrom(other);
+::PROTOBUF_NAMESPACE_ID::Metadata NodeDef_AttrEntry_DoNotUse::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once,
+      file_level_metadata_graph_2eproto[1]);
 }
 
-
 // ===================================================================
 
-void NodeDef::InitAsDefaultInstance() {
-}
+class NodeDef::_Internal {
+ public:
+};
+
 void NodeDef::clear_attr() {
   attr_.Clear();
 }
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int NodeDef::kNameFieldNumber;
-const int NodeDef::kOpFieldNumber;
-const int NodeDef::kInputFieldNumber;
-const int NodeDef::kDeviceFieldNumber;
-const int NodeDef::kAttrFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-NodeDef::NodeDef()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_graph_2eproto::InitDefaultsNodeDef();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.NodeDef)
-}
-NodeDef::NodeDef(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+NodeDef::NodeDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   input_(arena),
   attr_(arena) {
-  ::protobuf_graph_2eproto::InitDefaultsNodeDef();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.NodeDef)
 }
 NodeDef::NodeDef(const NodeDef& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      input_(from.input_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      input_(from.input_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   attr_.MergeFrom(from.attr_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.op().size() > 0) {
-    op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op(),
-      GetArenaNoVirtual());
-  }
-  device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.device().size() > 0) {
-    device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device(),
-      GetArenaNoVirtual());
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_name().empty()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  op_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    op_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_op().empty()) {
+    op_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_op(),
+      GetArenaForAllocation());
+  }
+  device_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    device_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_device().empty()) {
+    device_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_device(),
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.NodeDef)
 }
 
-void NodeDef::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  _cached_size_ = 0;
+inline void NodeDef::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+op_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  op_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+device_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  device_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 NodeDef::~NodeDef() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.NodeDef)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void NodeDef::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  op_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  device_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void NodeDef::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  op_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  device_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void NodeDef::ArenaDtor(void* object) {
   NodeDef* _this = reinterpret_cast< NodeDef* >(object);
   (void)_this;
+  _this->attr_. ~MapField();
 }
-void NodeDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+inline void NodeDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena) {
+  if (arena != nullptr) {
+    arena->OwnCustomDestructor(this, &NodeDef::ArenaDtor);
+  }
 }
 void NodeDef::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* NodeDef::descriptor() {
-  ::protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_graph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const NodeDef& NodeDef::default_instance() {
-  ::protobuf_graph_2eproto::InitDefaultsNodeDef();
-  return *internal_default_instance();
-}
-
-NodeDef* NodeDef::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<NodeDef>(arena);
+  _cached_size_.Set(size);
 }
 
 void NodeDef::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.NodeDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   input_.Clear();
   attr_.Clear();
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  _internal_metadata_.Clear();
-}
-
-bool NodeDef::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:opencv_tensorflow.NodeDef)
-  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)) {
+  name_.ClearToEmpty();
+  op_.ClearToEmpty();
+  device_.ClearToEmpty();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* NodeDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.NodeDef.name"));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.NodeDef.name"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string op = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_op()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->op().data(), static_cast<int>(this->op().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.NodeDef.op"));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_op();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.NodeDef.op"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated string input = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->add_input()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->input(this->input_size() - 1).data(),
-            static_cast<int>(this->input(this->input_size() - 1).length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.NodeDef.input"));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_input();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.NodeDef.input"));
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string device = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_device()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->device().data(), static_cast<int>(this->device().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.NodeDef.device"));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_device();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.NodeDef.device"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // map<string, .opencv_tensorflow.AttrValue> attr = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          NodeDef_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
-              NodeDef_AttrEntry_DoNotUse,
-              ::std::string, ::opencv_tensorflow::AttrValue,
-              ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-              ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-              0 >,
-            ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue > > parser(&attr_);
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
-              input, &parser));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            parser.key().data(), static_cast<int>(parser.key().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.NodeDef.AttrEntry.key"));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(&attr_, ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.NodeDef)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.NodeDef)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void NodeDef::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.NodeDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.NodeDef.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // string op = 2;
-  if (this->op().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->op().data(), static_cast<int>(this->op().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.NodeDef.op");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->op(), output);
-  }
-
-  // repeated string input = 3;
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->input(i).data(), static_cast<int>(this->input(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.NodeDef.input");
-    ::google::protobuf::internal::WireFormatLite::WriteString(
-      3, this->input(i), output);
-  }
-
-  // string device = 4;
-  if (this->device().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->device().data(), static_cast<int>(this->device().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.NodeDef.device");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->device(), output);
-  }
-
-  // map<string, .opencv_tensorflow.AttrValue> attr = 5;
-  if (!this->attr().empty()) {
-    typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
-        ConstPtr;
-    typedef ConstPtr SortItem;
-    typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
-    struct Utf8Check {
-      static void Check(ConstPtr p) {
-        ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-          p->first.data(), static_cast<int>(p->first.length()),
-          ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-          "opencv_tensorflow.NodeDef.AttrEntry.key");
-      }
-    };
-
-    if (output->IsSerializationDeterministic() &&
-        this->attr().size() > 1) {
-      ::google::protobuf::scoped_array<SortItem> items(
-          new SortItem[this->attr().size()]);
-      typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
-      size_type n = 0;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it, ++n) {
-        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
-      }
-      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
-      ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
-      for (size_type i = 0; i < n; i++) {
-        entry.reset(attr_.NewEntryWrapper(
-            items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
-        ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-            5, *entry, output);
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
-      }
-    } else {
-      ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it) {
-        entry.reset(attr_.NewEntryWrapper(
-            it->first, it->second));
-        ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-            5, *entry, output);
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(&*it);
-      }
-    }
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.NodeDef)
-}
-
-::google::protobuf::uint8* NodeDef::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* NodeDef::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.NodeDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_name().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.NodeDef.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // string op = 2;
-  if (this->op().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->op().data(), static_cast<int>(this->op().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_op().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_op().data(), static_cast<int>(this->_internal_op().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.NodeDef.op");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->op(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_op(), target);
   }
 
   // repeated string input = 3;
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->input(i).data(), static_cast<int>(this->input(i).length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  for (int i = 0, n = this->_internal_input_size(); i < n; i++) {
+    const auto& s = this->_internal_input(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.NodeDef.input");
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteStringToArray(3, this->input(i), target);
+    target = stream->WriteString(3, s, target);
   }
 
   // string device = 4;
-  if (this->device().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->device().data(), static_cast<int>(this->device().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_device().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_device().data(), static_cast<int>(this->_internal_device().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.NodeDef.device");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->device(), target);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_device(), target);
   }
 
   // map<string, .opencv_tensorflow.AttrValue> attr = 5;
-  if (!this->attr().empty()) {
-    typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
+  if (!this->_internal_attr().empty()) {
+    typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_pointer
         ConstPtr;
     typedef ConstPtr SortItem;
-    typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
+    typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
     struct Utf8Check {
       static void Check(ConstPtr p) {
-        ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+        (void)p;
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
           p->first.data(), static_cast<int>(p->first.length()),
-          ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+          ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
           "opencv_tensorflow.NodeDef.AttrEntry.key");
       }
     };
 
-    if (deterministic &&
-        this->attr().size() > 1) {
-      ::google::protobuf::scoped_array<SortItem> items(
-          new SortItem[this->attr().size()]);
-      typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
+    if (stream->IsSerializationDeterministic() &&
+        this->_internal_attr().size() > 1) {
+      ::std::unique_ptr<SortItem[]> items(
+          new SortItem[this->_internal_attr().size()]);
+      typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
       size_type n = 0;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it, ++n) {
+      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+          it = this->_internal_attr().begin();
+          it != this->_internal_attr().end(); ++it, ++n) {
         items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
       }
       ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
-      ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
       for (size_type i = 0; i < n; i++) {
-        entry.reset(attr_.NewEntryWrapper(
-            items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
-        target = ::google::protobuf::internal::WireFormatLite::
-                   InternalWriteMessageNoVirtualToArray(
-                       5, *entry, deterministic, target);
-;
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
+        target = NodeDef_AttrEntry_DoNotUse::Funcs::InternalSerialize(5, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target, stream);
+        Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
       }
     } else {
-      ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
-      for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-          it = this->attr().begin();
-          it != this->attr().end(); ++it) {
-        entry.reset(attr_.NewEntryWrapper(
-            it->first, it->second));
-        target = ::google::protobuf::internal::WireFormatLite::
-                   InternalWriteMessageNoVirtualToArray(
-                       5, *entry, deterministic, target);
-;
-        if (entry->GetArena() != NULL) {
-          entry.release();
-        }
-        Utf8Check::Check(&*it);
+      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+          it = this->_internal_attr().begin();
+          it != this->_internal_attr().end(); ++it) {
+        target = NodeDef_AttrEntry_DoNotUse::Funcs::InternalSerialize(5, it->first, it->second, target, stream);
+        Utf8Check::Check(&(*it));
       }
     }
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.NodeDef)
   return target;
@@ -1139,107 +767,82 @@ size_t NodeDef::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.NodeDef)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated string input = 3;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->input_size());
-  for (int i = 0, n = this->input_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
-      this->input(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(input_.size());
+  for (int i = 0, n = input_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      input_.Get(i));
   }
 
   // map<string, .opencv_tensorflow.AttrValue> attr = 5;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->attr_size());
-  {
-    ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
-    for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
-        it = this->attr().begin();
-        it != this->attr().end(); ++it) {
-      if (entry.get() != NULL && entry->GetArena() != NULL) {
-        entry.release();
-      }
-      entry.reset(attr_.NewEntryWrapper(it->first, it->second));
-      total_size += ::google::protobuf::internal::WireFormatLite::
-          MessageSizeNoVirtual(*entry);
-    }
-    if (entry.get() != NULL && entry->GetArena() != NULL) {
-      entry.release();
-    }
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_attr_size());
+  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >::const_iterator
+      it = this->_internal_attr().begin();
+      it != this->_internal_attr().end(); ++it) {
+    total_size += NodeDef_AttrEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
   }
 
   // string name = 1;
-  if (this->name().size() > 0) {
+  if (!this->_internal_name().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_name());
   }
 
   // string op = 2;
-  if (this->op().size() > 0) {
+  if (!this->_internal_op().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->op());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_op());
   }
 
   // string device = 4;
-  if (this->device().size() > 0) {
+  if (!this->_internal_device().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->device());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_device());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void NodeDef::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.NodeDef)
-  GOOGLE_DCHECK_NE(&from, this);
-  const NodeDef* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const NodeDef>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.NodeDef)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.NodeDef)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NodeDef::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    NodeDef::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NodeDef::GetClassData() const { return &_class_data_; }
+
+void NodeDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<NodeDef *>(to)->MergeFrom(
+      static_cast<const NodeDef &>(from));
 }
 
+
 void NodeDef::MergeFrom(const NodeDef& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.NodeDef)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   input_.MergeFrom(from.input_);
   attr_.MergeFrom(from.attr_);
-  if (from.name().size() > 0) {
-    set_name(from.name());
+  if (!from._internal_name().empty()) {
+    _internal_set_name(from._internal_name());
   }
-  if (from.op().size() > 0) {
-    set_op(from.op());
+  if (!from._internal_op().empty()) {
+    _internal_set_op(from._internal_op());
   }
-  if (from.device().size() > 0) {
-    set_device(from.device());
+  if (!from._internal_device().empty()) {
+    _internal_set_device(from._internal_device());
   }
-}
-
-void NodeDef::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.NodeDef)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void NodeDef::CopyFrom(const NodeDef& from) {
@@ -1253,43 +856,49 @@ bool NodeDef::IsInitialized() const {
   return true;
 }
 
-void NodeDef::Swap(NodeDef* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    NodeDef* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void NodeDef::UnsafeArenaSwap(NodeDef* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void NodeDef::InternalSwap(NodeDef* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   input_.InternalSwap(&other->input_);
-  attr_.Swap(&other->attr_);
-  name_.Swap(&other->name_);
-  op_.Swap(&other->op_);
-  device_.Swap(&other->device_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  attr_.InternalSwap(&other->attr_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &op_, lhs_arena,
+      &other->op_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &device_, lhs_arena,
+      &other->device_, rhs_arena
+  );
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata NodeDef::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once,
+      file_level_metadata_graph_2eproto[2]);
 }
 
-::google::protobuf::Metadata NodeDef::GetMetadata() const {
-  protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_graph_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::GraphDef* Arena::CreateMaybeMessage< ::opencv_tensorflow::GraphDef >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::GraphDef >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse* Arena::CreateMaybeMessage< ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::NodeDef* Arena::CreateMaybeMessage< ::opencv_tensorflow::NodeDef >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::NodeDef >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index 0f1dc80..94ba5a5 100644 (file)
@@ -1,30 +1,32 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: graph.proto
 
-#ifndef PROTOBUF_graph_2eproto__INCLUDED
-#define PROTOBUF_graph_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_graph_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_graph_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include "function.pb.h"
 #include "versions.pb.h"
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_graph_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_graph_2eproto {
 // Internal implementation detail -- do not use these members.
-struct 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[];
+struct TableStruct_graph_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsGraphDefImpl();
-void InitDefaultsGraphDef();
-void InitDefaultsNodeDef_AttrEntry_DoNotUseImpl();
-void InitDefaultsNodeDef_AttrEntry_DoNotUse();
-void InitDefaultsNodeDefImpl();
-void InitDefaultsNodeDef();
-inline void InitDefaults() {
-  InitDefaultsGraphDef();
-  InitDefaultsNodeDef_AttrEntry_DoNotUse();
-  InitDefaultsNodeDef();
-}
-}  // namespace protobuf_graph_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto;
 namespace opencv_tensorflow {
 class GraphDef;
-class GraphDefDefaultTypeInternal;
+struct GraphDefDefaultTypeInternal;
 extern GraphDefDefaultTypeInternal _GraphDef_default_instance_;
 class NodeDef;
-class NodeDefDefaultTypeInternal;
+struct NodeDefDefaultTypeInternal;
 extern NodeDefDefaultTypeInternal _NodeDef_default_instance_;
 class NodeDef_AttrEntry_DoNotUse;
-class NodeDef_AttrEntry_DoNotUseDefaultTypeInternal;
+struct NodeDef_AttrEntry_DoNotUseDefaultTypeInternal;
 extern NodeDef_AttrEntry_DoNotUseDefaultTypeInternal _NodeDef_AttrEntry_DoNotUse_default_instance_;
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_tensorflow::GraphDef* Arena::CreateMaybeMessage<::opencv_tensorflow::GraphDef>(Arena*);
+template<> ::opencv_tensorflow::NodeDef* Arena::CreateMaybeMessage<::opencv_tensorflow::NodeDef>(Arena*);
+template<> ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse* Arena::CreateMaybeMessage<::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-class GraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.GraphDef) */ {
+class GraphDef final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.GraphDef) */ {
  public:
-  GraphDef();
-  virtual ~GraphDef();
+  inline GraphDef() : GraphDef(nullptr) {}
+  ~GraphDef() override;
+  explicit constexpr GraphDef(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   GraphDef(const GraphDef& from);
-
-  inline GraphDef& operator=(const GraphDef& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   GraphDef(GraphDef&& from) noexcept
     : GraphDef() {
     *this = ::std::move(from);
   }
 
+  inline GraphDef& operator=(const GraphDef& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline GraphDef& operator=(GraphDef&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const GraphDef& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const GraphDef& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const GraphDef* internal_default_instance() {
     return reinterpret_cast<const GraphDef*>(
                &_GraphDef_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void UnsafeArenaSwap(GraphDef* other);
-  void Swap(GraphDef* other);
   friend void swap(GraphDef& a, GraphDef& b) {
     a.Swap(&b);
   }
+  inline void Swap(GraphDef* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(GraphDef* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline GraphDef* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  GraphDef* 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;
+  GraphDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<GraphDef>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const GraphDef& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const GraphDef& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(GraphDef* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.GraphDef";
+  }
   protected:
-  explicit GraphDef(::google::protobuf::Arena* arena);
+  explicit GraphDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNodeFieldNumber = 1,
+    kLibraryFieldNumber = 2,
+    kVersionsFieldNumber = 4,
+    kVersionFieldNumber = 3,
+  };
   // repeated .opencv_tensorflow.NodeDef node = 1;
   int node_size() const;
+  private:
+  int _internal_node_size() const;
+  public:
   void clear_node();
-  static const int kNodeFieldNumber = 1;
-  const ::opencv_tensorflow::NodeDef& node(int index) const;
   ::opencv_tensorflow::NodeDef* mutable_node(int index);
-  ::opencv_tensorflow::NodeDef* add_node();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::NodeDef >*
       mutable_node();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef >&
+  private:
+  const ::opencv_tensorflow::NodeDef& _internal_node(int index) const;
+  ::opencv_tensorflow::NodeDef* _internal_add_node();
+  public:
+  const ::opencv_tensorflow::NodeDef& node(int index) const;
+  ::opencv_tensorflow::NodeDef* add_node();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::NodeDef >&
       node() const;
 
   // .opencv_tensorflow.FunctionDefLibrary library = 2;
   bool has_library() const;
-  void clear_library();
-  static const int kLibraryFieldNumber = 2;
   private:
-  void _slow_mutable_library();
+  bool _internal_has_library() const;
   public:
+  void clear_library();
   const ::opencv_tensorflow::FunctionDefLibrary& library() const;
-  ::opencv_tensorflow::FunctionDefLibrary* release_library();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::FunctionDefLibrary* release_library();
   ::opencv_tensorflow::FunctionDefLibrary* mutable_library();
   void set_allocated_library(::opencv_tensorflow::FunctionDefLibrary* library);
+  private:
+  const ::opencv_tensorflow::FunctionDefLibrary& _internal_library() const;
+  ::opencv_tensorflow::FunctionDefLibrary* _internal_mutable_library();
+  public:
   void unsafe_arena_set_allocated_library(
       ::opencv_tensorflow::FunctionDefLibrary* library);
   ::opencv_tensorflow::FunctionDefLibrary* unsafe_arena_release_library();
 
   // .opencv_tensorflow.VersionDef versions = 4;
   bool has_versions() const;
-  void clear_versions();
-  static const int kVersionsFieldNumber = 4;
   private:
-  void _slow_mutable_versions();
+  bool _internal_has_versions() const;
   public:
+  void clear_versions();
   const ::opencv_tensorflow::VersionDef& versions() const;
-  ::opencv_tensorflow::VersionDef* release_versions();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::VersionDef* release_versions();
   ::opencv_tensorflow::VersionDef* mutable_versions();
   void set_allocated_versions(::opencv_tensorflow::VersionDef* versions);
+  private:
+  const ::opencv_tensorflow::VersionDef& _internal_versions() const;
+  ::opencv_tensorflow::VersionDef* _internal_mutable_versions();
+  public:
   void unsafe_arena_set_allocated_versions(
       ::opencv_tensorflow::VersionDef* versions);
   ::opencv_tensorflow::VersionDef* unsafe_arena_release_versions();
 
   // int32 version = 3 [deprecated = true];
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_version();
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kVersionFieldNumber = 3;
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int32 version() const;
-  GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_version(::google::protobuf::int32 value);
+  PROTOBUF_DEPRECATED void clear_version();
+  PROTOBUF_DEPRECATED int32_t version() const;
+  PROTOBUF_DEPRECATED void set_version(int32_t value);
+  private:
+  int32_t _internal_version() const;
+  void _internal_set_version(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.GraphDef)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef > node_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::NodeDef > node_;
   ::opencv_tensorflow::FunctionDefLibrary* library_;
   ::opencv_tensorflow::VersionDef* versions_;
-  ::google::protobuf::int32 version_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_graph_2eproto::TableStruct;
-  friend void ::protobuf_graph_2eproto::InitDefaultsGraphDefImpl();
+  int32_t version_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_graph_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NodeDef_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry<NodeDef_AttrEntry_DoNotUse,
-    ::std::string, ::opencv_tensorflow::AttrValue,
-    ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-    ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-    0 > {
+class NodeDef_AttrEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<NodeDef_AttrEntry_DoNotUse,
+    std::string, ::opencv_tensorflow::AttrValue,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> {
 public:
-  typedef ::google::protobuf::internal::MapEntry<NodeDef_AttrEntry_DoNotUse,
-    ::std::string, ::opencv_tensorflow::AttrValue,
-    ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-    ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-    0 > SuperType;
+  typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<NodeDef_AttrEntry_DoNotUse,
+    std::string, ::opencv_tensorflow::AttrValue,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> SuperType;
   NodeDef_AttrEntry_DoNotUse();
-  NodeDef_AttrEntry_DoNotUse(::google::protobuf::Arena* arena);
+  explicit constexpr NodeDef_AttrEntry_DoNotUse(
+      ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
+  explicit NodeDef_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   void MergeFrom(const NodeDef_AttrEntry_DoNotUse& other);
   static const NodeDef_AttrEntry_DoNotUse* internal_default_instance() { return reinterpret_cast<const NodeDef_AttrEntry_DoNotUse*>(&_NodeDef_AttrEntry_DoNotUse_default_instance_); }
-  void MergeFrom(const ::google::protobuf::Message& other) PROTOBUF_FINAL;
-  ::google::protobuf::Metadata GetMetadata() const;
+  static bool ValidateKey(std::string* s) {
+    return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast<int>(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "opencv_tensorflow.NodeDef.AttrEntry.key");
+ }
+  static bool ValidateValue(void*) { return true; }
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 };
 
 // -------------------------------------------------------------------
 
-class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.NodeDef) */ {
+class NodeDef final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.NodeDef) */ {
  public:
-  NodeDef();
-  virtual ~NodeDef();
+  inline NodeDef() : NodeDef(nullptr) {}
+  ~NodeDef() override;
+  explicit constexpr NodeDef(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NodeDef(const NodeDef& from);
-
-  inline NodeDef& operator=(const NodeDef& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   NodeDef(NodeDef&& from) noexcept
     : NodeDef() {
     *this = ::std::move(from);
   }
 
+  inline NodeDef& operator=(const NodeDef& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline NodeDef& operator=(NodeDef&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const NodeDef& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const NodeDef& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const NodeDef* internal_default_instance() {
     return reinterpret_cast<const NodeDef*>(
                &_NodeDef_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     2;
 
-  void UnsafeArenaSwap(NodeDef* other);
-  void Swap(NodeDef* other);
   friend void swap(NodeDef& a, NodeDef& b) {
     a.Swap(&b);
   }
+  inline void Swap(NodeDef* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(NodeDef* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline NodeDef* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  NodeDef* 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;
+  NodeDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<NodeDef>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const NodeDef& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const NodeDef& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(NodeDef* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.NodeDef";
+  }
   protected:
-  explicit NodeDef(::google::protobuf::Arena* arena);
+  explicit NodeDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kInputFieldNumber = 3,
+    kAttrFieldNumber = 5,
+    kNameFieldNumber = 1,
+    kOpFieldNumber = 2,
+    kDeviceFieldNumber = 4,
+  };
   // repeated string input = 3;
   int input_size() const;
+  private:
+  int _internal_input_size() const;
+  public:
   void clear_input();
-  static const int kInputFieldNumber = 3;
-  const ::std::string& input(int index) const;
-  ::std::string* mutable_input(int index);
-  void set_input(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_input(int index, ::std::string&& value);
-  #endif
+  const std::string& input(int index) const;
+  std::string* mutable_input(int index);
+  void set_input(int index, const std::string& value);
+  void set_input(int index, std::string&& value);
   void set_input(int index, const char* value);
   void set_input(int index, const char* value, size_t size);
-  ::std::string* add_input();
-  void add_input(const ::std::string& value);
-  #if LANG_CXX11
-  void add_input(::std::string&& value);
-  #endif
+  std::string* add_input();
+  void add_input(const std::string& value);
+  void add_input(std::string&& value);
   void add_input(const char* value);
   void add_input(const char* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& input() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_input();
+  private:
+  const std::string& _internal_input(int index) const;
+  std::string* _internal_add_input();
+  public:
 
   // map<string, .opencv_tensorflow.AttrValue> attr = 5;
   int attr_size() const;
+  private:
+  int _internal_attr_size() const;
+  public:
   void clear_attr();
-  static const int kAttrFieldNumber = 5;
-  const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
+  private:
+  const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
+      _internal_attr() const;
+  ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
+      _internal_mutable_attr();
+  public:
+  const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
       attr() const;
-  ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
+  ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
       mutable_attr();
 
   // string name = 1;
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // string op = 2;
   void clear_op();
-  static const int kOpFieldNumber = 2;
-  const ::std::string& op() const;
-  void set_op(const ::std::string& value);
-  #if LANG_CXX11
-  void set_op(::std::string&& value);
-  #endif
-  void set_op(const char* value);
-  void set_op(const char* value, size_t size);
-  ::std::string* mutable_op();
-  ::std::string* release_op();
-  void set_allocated_op(::std::string* op);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_op();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_op(
-      ::std::string* op);
+  const std::string& op() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_op(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_op();
+  PROTOBUF_NODISCARD std::string* release_op();
+  void set_allocated_op(std::string* op);
+  private:
+  const std::string& _internal_op() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_op(const std::string& value);
+  std::string* _internal_mutable_op();
+  public:
 
   // string device = 4;
   void clear_device();
-  static const int kDeviceFieldNumber = 4;
-  const ::std::string& device() const;
-  void set_device(const ::std::string& value);
-  #if LANG_CXX11
-  void set_device(::std::string&& value);
-  #endif
-  void set_device(const char* value);
-  void set_device(const char* value, size_t size);
-  ::std::string* mutable_device();
-  ::std::string* release_device();
-  void set_allocated_device(::std::string* device);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_device();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_device(
-      ::std::string* device);
+  const std::string& device() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_device(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_device();
+  PROTOBUF_NODISCARD std::string* release_device();
+  void set_allocated_device(std::string* device);
+  private:
+  const std::string& _internal_device() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_device(const std::string& value);
+  std::string* _internal_mutable_device();
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.NodeDef)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> input_;
-  ::google::protobuf::internal::MapField<
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> input_;
+  ::PROTOBUF_NAMESPACE_ID::internal::MapField<
       NodeDef_AttrEntry_DoNotUse,
-      ::std::string, ::opencv_tensorflow::AttrValue,
-      ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
-      ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
-      0 > attr_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr op_;
-  ::google::protobuf::internal::ArenaStringPtr device_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_graph_2eproto::TableStruct;
-  friend void ::protobuf_graph_2eproto::InitDefaultsNodeDefImpl();
+      std::string, ::opencv_tensorflow::AttrValue,
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> attr_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr op_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr device_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_graph_2eproto;
 };
 // ===================================================================
 
@@ -483,80 +553,121 @@ class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(c
 // GraphDef
 
 // repeated .opencv_tensorflow.NodeDef node = 1;
-inline int GraphDef::node_size() const {
+inline int GraphDef::_internal_node_size() const {
   return node_.size();
 }
+inline int GraphDef::node_size() const {
+  return _internal_node_size();
+}
 inline void GraphDef::clear_node() {
   node_.Clear();
 }
-inline const ::opencv_tensorflow::NodeDef& GraphDef::node(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.node)
-  return node_.Get(index);
-}
 inline ::opencv_tensorflow::NodeDef* GraphDef::mutable_node(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GraphDef.node)
   return node_.Mutable(index);
 }
-inline ::opencv_tensorflow::NodeDef* GraphDef::add_node() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.GraphDef.node)
-  return node_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::NodeDef >*
 GraphDef::mutable_node() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.GraphDef.node)
   return &node_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef >&
+inline const ::opencv_tensorflow::NodeDef& GraphDef::_internal_node(int index) const {
+  return node_.Get(index);
+}
+inline const ::opencv_tensorflow::NodeDef& GraphDef::node(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.node)
+  return _internal_node(index);
+}
+inline ::opencv_tensorflow::NodeDef* GraphDef::_internal_add_node() {
+  return node_.Add();
+}
+inline ::opencv_tensorflow::NodeDef* GraphDef::add_node() {
+  ::opencv_tensorflow::NodeDef* _add = _internal_add_node();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.GraphDef.node)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::NodeDef >&
 GraphDef::node() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.GraphDef.node)
   return node_;
 }
 
 // .opencv_tensorflow.VersionDef versions = 4;
+inline bool GraphDef::_internal_has_versions() const {
+  return this != internal_default_instance() && versions_ != nullptr;
+}
 inline bool GraphDef::has_versions() const {
-  return this != internal_default_instance() && versions_ != NULL;
+  return _internal_has_versions();
 }
-inline const ::opencv_tensorflow::VersionDef& GraphDef::versions() const {
+inline const ::opencv_tensorflow::VersionDef& GraphDef::_internal_versions() const {
   const ::opencv_tensorflow::VersionDef* p = versions_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_tensorflow::VersionDef&>(
+      ::opencv_tensorflow::_VersionDef_default_instance_);
+}
+inline const ::opencv_tensorflow::VersionDef& GraphDef::versions() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.versions)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::VersionDef*>(
-      &::opencv_tensorflow::_VersionDef_default_instance_);
+  return _internal_versions();
+}
+inline void GraphDef::unsafe_arena_set_allocated_versions(
+    ::opencv_tensorflow::VersionDef* versions) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(versions_);
+  }
+  versions_ = versions;
+  if (versions) {
+
+  } else {
+
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GraphDef.versions)
 }
 inline ::opencv_tensorflow::VersionDef* GraphDef::release_versions() {
-  // @@protoc_insertion_point(field_release:opencv_tensorflow.GraphDef.versions)
 
   ::opencv_tensorflow::VersionDef* temp = versions_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+  versions_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
   }
-  versions_ = NULL;
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::opencv_tensorflow::VersionDef* GraphDef::unsafe_arena_release_versions() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.GraphDef.versions)
+  // @@protoc_insertion_point(field_release:opencv_tensorflow.GraphDef.versions)
 
   ::opencv_tensorflow::VersionDef* temp = versions_;
-  versions_ = NULL;
+  versions_ = nullptr;
   return temp;
 }
-inline ::opencv_tensorflow::VersionDef* GraphDef::mutable_versions() {
+inline ::opencv_tensorflow::VersionDef* GraphDef::_internal_mutable_versions() {
 
-  if (versions_ == NULL) {
-    _slow_mutable_versions();
+  if (versions_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_tensorflow::VersionDef>(GetArenaForAllocation());
+    versions_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GraphDef.versions)
   return versions_;
 }
+inline ::opencv_tensorflow::VersionDef* GraphDef::mutable_versions() {
+  ::opencv_tensorflow::VersionDef* _msg = _internal_mutable_versions();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GraphDef.versions)
+  return _msg;
+}
 inline void GraphDef::set_allocated_versions(::opencv_tensorflow::VersionDef* versions) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(versions_);
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(versions_);
   }
   if (versions) {
-    ::google::protobuf::Arena* submessage_arena =
-      reinterpret_cast< ::google::protobuf::MessageLite*>(versions)->GetArena();
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<
+            ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena(
+                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(versions));
     if (message_arena != submessage_arena) {
-      versions = ::google::protobuf::internal::GetOwnedMessage(
+      versions = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, versions, submessage_arena);
     }
 
@@ -571,61 +682,98 @@ inline void GraphDef::set_allocated_versions(::opencv_tensorflow::VersionDef* ve
 inline void GraphDef::clear_version() {
   version_ = 0;
 }
-inline ::google::protobuf::int32 GraphDef::version() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.version)
+inline int32_t GraphDef::_internal_version() const {
   return version_;
 }
-inline void GraphDef::set_version(::google::protobuf::int32 value) {
+inline int32_t GraphDef::version() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.version)
+  return _internal_version();
+}
+inline void GraphDef::_internal_set_version(int32_t value) {
 
   version_ = value;
+}
+inline void GraphDef::set_version(int32_t value) {
+  _internal_set_version(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.GraphDef.version)
 }
 
 // .opencv_tensorflow.FunctionDefLibrary library = 2;
+inline bool GraphDef::_internal_has_library() const {
+  return this != internal_default_instance() && library_ != nullptr;
+}
 inline bool GraphDef::has_library() const {
-  return this != internal_default_instance() && library_ != NULL;
+  return _internal_has_library();
 }
-inline const ::opencv_tensorflow::FunctionDefLibrary& GraphDef::library() const {
+inline const ::opencv_tensorflow::FunctionDefLibrary& GraphDef::_internal_library() const {
   const ::opencv_tensorflow::FunctionDefLibrary* p = library_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_tensorflow::FunctionDefLibrary&>(
+      ::opencv_tensorflow::_FunctionDefLibrary_default_instance_);
+}
+inline const ::opencv_tensorflow::FunctionDefLibrary& GraphDef::library() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.library)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::FunctionDefLibrary*>(
-      &::opencv_tensorflow::_FunctionDefLibrary_default_instance_);
+  return _internal_library();
+}
+inline void GraphDef::unsafe_arena_set_allocated_library(
+    ::opencv_tensorflow::FunctionDefLibrary* library) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(library_);
+  }
+  library_ = library;
+  if (library) {
+
+  } else {
+
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GraphDef.library)
 }
 inline ::opencv_tensorflow::FunctionDefLibrary* GraphDef::release_library() {
-  // @@protoc_insertion_point(field_release:opencv_tensorflow.GraphDef.library)
 
   ::opencv_tensorflow::FunctionDefLibrary* temp = library_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+  library_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
   }
-  library_ = NULL;
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::opencv_tensorflow::FunctionDefLibrary* GraphDef::unsafe_arena_release_library() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.GraphDef.library)
+  // @@protoc_insertion_point(field_release:opencv_tensorflow.GraphDef.library)
 
   ::opencv_tensorflow::FunctionDefLibrary* temp = library_;
-  library_ = NULL;
+  library_ = nullptr;
   return temp;
 }
-inline ::opencv_tensorflow::FunctionDefLibrary* GraphDef::mutable_library() {
+inline ::opencv_tensorflow::FunctionDefLibrary* GraphDef::_internal_mutable_library() {
 
-  if (library_ == NULL) {
-    _slow_mutable_library();
+  if (library_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_tensorflow::FunctionDefLibrary>(GetArenaForAllocation());
+    library_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GraphDef.library)
   return library_;
 }
+inline ::opencv_tensorflow::FunctionDefLibrary* GraphDef::mutable_library() {
+  ::opencv_tensorflow::FunctionDefLibrary* _msg = _internal_mutable_library();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.GraphDef.library)
+  return _msg;
+}
 inline void GraphDef::set_allocated_library(::opencv_tensorflow::FunctionDefLibrary* library) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(library_);
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(library_);
   }
   if (library) {
-    ::google::protobuf::Arena* submessage_arena =
-      reinterpret_cast< ::google::protobuf::MessageLite*>(library)->GetArena();
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<
+            ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena(
+                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(library));
     if (message_arena != submessage_arena) {
-      library = ::google::protobuf::internal::GetOwnedMessage(
+      library = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, library, submessage_arena);
     }
 
@@ -644,181 +792,142 @@ inline void GraphDef::set_allocated_library(::opencv_tensorflow::FunctionDefLibr
 
 // string name = 1;
 inline void NodeDef::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  name_.ClearToEmpty();
 }
-inline const ::std::string& NodeDef::name() const {
+inline const std::string& NodeDef::name() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void NodeDef::set_name(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NodeDef::set_name(ArgT0&& arg0, ArgT... args) {
 
 name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.name)
 }
-#if LANG_CXX11
-inline void NodeDef::set_name(::std::string&& value) {
-
-  name_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.NodeDef.name)
+inline std::string* NodeDef::mutable_name() {
+  std::string* _s = _internal_mutable_name();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.name)
+  return _s;
 }
-#endif
-inline void NodeDef::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:opencv_tensorflow.NodeDef.name)
+inline const std::string& NodeDef::_internal_name() const {
+  return name_.Get();
 }
-inline void NodeDef::set_name(const char* value,
-    size_t size) {
+inline void NodeDef::_internal_set_name(const std::string& value) {
 
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NodeDef.name)
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* NodeDef::mutable_name() {
+inline std::string* NodeDef::_internal_mutable_name() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* NodeDef::release_name() {
+inline std::string* NodeDef::release_name() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.NodeDef.name)
-
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void NodeDef::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
+inline void NodeDef::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
 
   } else {
 
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.name)
-}
-inline ::std::string* NodeDef::unsafe_arena_release_name() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.NodeDef.name)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void NodeDef::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-
-  } else {
-
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.NodeDef.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.name)
 }
 
 // string op = 2;
 inline void NodeDef::clear_op() {
-  op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  op_.ClearToEmpty();
 }
-inline const ::std::string& NodeDef::op() const {
+inline const std::string& NodeDef::op() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.op)
-  return op_.Get();
+  return _internal_op();
 }
-inline void NodeDef::set_op(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NodeDef::set_op(ArgT0&& arg0, ArgT... args) {
 
 op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
op_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.op)
 }
-#if LANG_CXX11
-inline void NodeDef::set_op(::std::string&& value) {
-
-  op_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.NodeDef.op)
+inline std::string* NodeDef::mutable_op() {
+  std::string* _s = _internal_mutable_op();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.op)
+  return _s;
 }
-#endif
-inline void NodeDef::set_op(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.NodeDef.op)
+inline const std::string& NodeDef::_internal_op() const {
+  return op_.Get();
 }
-inline void NodeDef::set_op(const char* value,
-    size_t size) {
+inline void NodeDef::_internal_set_op(const std::string& value) {
 
-  op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NodeDef.op)
+  op_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* NodeDef::mutable_op() {
+inline std::string* NodeDef::_internal_mutable_op() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.op)
-  return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return op_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* NodeDef::release_op() {
+inline std::string* NodeDef::release_op() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.NodeDef.op)
-
-  return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return op_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void NodeDef::set_allocated_op(::std::string* op) {
-  if (op != NULL) {
+inline void NodeDef::set_allocated_op(std::string* op) {
+  if (op != nullptr) {
 
   } else {
 
   }
-  op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.op)
-}
-inline ::std::string* NodeDef::unsafe_arena_release_op() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.NodeDef.op)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void NodeDef::unsafe_arena_set_allocated_op(
-    ::std::string* op) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (op != NULL) {
-
-  } else {
-
+  op_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), op,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (op_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    op_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      op, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.NodeDef.op)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.op)
 }
 
 // repeated string input = 3;
-inline int NodeDef::input_size() const {
+inline int NodeDef::_internal_input_size() const {
   return input_.size();
 }
+inline int NodeDef::input_size() const {
+  return _internal_input_size();
+}
 inline void NodeDef::clear_input() {
   input_.Clear();
 }
-inline const ::std::string& NodeDef::input(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.input)
+inline std::string* NodeDef::add_input() {
+  std::string* _s = _internal_add_input();
+  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.NodeDef.input)
+  return _s;
+}
+inline const std::string& NodeDef::_internal_input(int index) const {
   return input_.Get(index);
 }
-inline ::std::string* NodeDef::mutable_input(int index) {
+inline const std::string& NodeDef::input(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.input)
+  return _internal_input(index);
+}
+inline std::string* NodeDef::mutable_input(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.input)
   return input_.Mutable(index);
 }
-inline void NodeDef::set_input(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.input)
+inline void NodeDef::set_input(int index, const std::string& value) {
   input_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void NodeDef::set_input(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.input)
+}
+inline void NodeDef::set_input(int index, std::string&& value) {
   input_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.input)
 }
-#endif
 inline void NodeDef::set_input(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   input_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_tensorflow.NodeDef.input)
 }
@@ -827,22 +936,19 @@ inline void NodeDef::set_input(int index, const char* value, size_t size) {
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NodeDef.input)
 }
-inline ::std::string* NodeDef::add_input() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.NodeDef.input)
+inline std::string* NodeDef::_internal_add_input() {
   return input_.Add();
 }
-inline void NodeDef::add_input(const ::std::string& value) {
+inline void NodeDef::add_input(const std::string& value) {
   input_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.NodeDef.input)
 }
-#if LANG_CXX11
-inline void NodeDef::add_input(::std::string&& value) {
+inline void NodeDef::add_input(std::string&& value) {
   input_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_tensorflow.NodeDef.input)
 }
-#endif
 inline void NodeDef::add_input(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   input_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_tensorflow.NodeDef.input)
 }
@@ -850,12 +956,12 @@ inline void NodeDef::add_input(const char* value, size_t size) {
   input_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.NodeDef.input)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 NodeDef::input() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.NodeDef.input)
   return input_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 NodeDef::mutable_input() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.NodeDef.input)
   return &input_;
@@ -863,92 +969,79 @@ NodeDef::mutable_input() {
 
 // string device = 4;
 inline void NodeDef::clear_device() {
-  device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  device_.ClearToEmpty();
 }
-inline const ::std::string& NodeDef::device() const {
+inline const std::string& NodeDef::device() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.device)
-  return device_.Get();
+  return _internal_device();
 }
-inline void NodeDef::set_device(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NodeDef::set_device(ArgT0&& arg0, ArgT... args) {
 
 device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
device_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.device)
 }
-#if LANG_CXX11
-inline void NodeDef::set_device(::std::string&& value) {
-
-  device_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.NodeDef.device)
+inline std::string* NodeDef::mutable_device() {
+  std::string* _s = _internal_mutable_device();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.device)
+  return _s;
 }
-#endif
-inline void NodeDef::set_device(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.NodeDef.device)
+inline const std::string& NodeDef::_internal_device() const {
+  return device_.Get();
 }
-inline void NodeDef::set_device(const char* value,
-    size_t size) {
+inline void NodeDef::_internal_set_device(const std::string& value) {
 
-  device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NodeDef.device)
+  device_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* NodeDef::mutable_device() {
+inline std::string* NodeDef::_internal_mutable_device() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.device)
-  return device_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return device_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* NodeDef::release_device() {
+inline std::string* NodeDef::release_device() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.NodeDef.device)
-
-  return device_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return device_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void NodeDef::set_allocated_device(::std::string* device) {
-  if (device != NULL) {
+inline void NodeDef::set_allocated_device(std::string* device) {
+  if (device != nullptr) {
 
   } else {
 
   }
-  device_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.device)
-}
-inline ::std::string* NodeDef::unsafe_arena_release_device() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.NodeDef.device)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return device_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void NodeDef::unsafe_arena_set_allocated_device(
-    ::std::string* device) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (device != NULL) {
-
-  } else {
-
+  device_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), device,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (device_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    device_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  device_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      device, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.NodeDef.device)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.device)
 }
 
 // map<string, .opencv_tensorflow.AttrValue> attr = 5;
-inline int NodeDef::attr_size() const {
+inline int NodeDef::_internal_attr_size() const {
   return attr_.size();
 }
-inline const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
+inline int NodeDef::attr_size() const {
+  return _internal_attr_size();
+}
+inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
+NodeDef::_internal_attr() const {
+  return attr_.GetMap();
+}
+inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >&
 NodeDef::attr() const {
   // @@protoc_insertion_point(field_map:opencv_tensorflow.NodeDef.attr)
-  return attr_.GetMap();
+  return _internal_attr();
 }
-inline ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
+inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
+NodeDef::_internal_mutable_attr() {
+  return attr_.MutableMap();
+}
+inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::opencv_tensorflow::AttrValue >*
 NodeDef::mutable_attr() {
   // @@protoc_insertion_point(field_mutable_map:opencv_tensorflow.NodeDef.attr)
-  return attr_.MutableMap();
+  return _internal_mutable_attr();
 }
 
 #ifdef __GNUC__
@@ -965,4 +1058,5 @@ NodeDef::mutable_attr() {
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_graph_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_graph_2eproto
index 7ffd40a..a73f319 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_tensorflow {
-class OpDef_ArgDefDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<OpDef_ArgDef>
-      _instance;
-} _OpDef_ArgDef_default_instance_;
-class OpDef_AttrDefDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<OpDef_AttrDef>
-      _instance;
-} _OpDef_AttrDef_default_instance_;
-class OpDefDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<OpDef>
-      _instance;
-} _OpDef_default_instance_;
-class OpDeprecationDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<OpDeprecation>
-      _instance;
-} _OpDeprecation_default_instance_;
-class OpListDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<OpList>
-      _instance;
-} _OpList_default_instance_;
+constexpr OpDef_ArgDef::OpDef_ArgDef(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , description_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , type_attr_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , number_attr_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , type_list_attr_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , type_(0)
+
+  , is_ref_(false){}
+struct OpDef_ArgDefDefaultTypeInternal {
+  constexpr OpDef_ArgDefDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~OpDef_ArgDefDefaultTypeInternal() {}
+  union {
+    OpDef_ArgDef _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OpDef_ArgDefDefaultTypeInternal _OpDef_ArgDef_default_instance_;
+constexpr OpDef_AttrDef::OpDef_AttrDef(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , type_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , description_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , default_value_(nullptr)
+  , allowed_values_(nullptr)
+  , minimum_(int64_t{0})
+  , has_minimum_(false){}
+struct OpDef_AttrDefDefaultTypeInternal {
+  constexpr OpDef_AttrDefDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~OpDef_AttrDefDefaultTypeInternal() {}
+  union {
+    OpDef_AttrDef _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OpDef_AttrDefDefaultTypeInternal _OpDef_AttrDef_default_instance_;
+constexpr OpDef::OpDef(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : input_arg_()
+  , output_arg_()
+  , attr_()
+  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , summary_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , description_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , deprecation_(nullptr)
+  , is_commutative_(false)
+  , is_aggregate_(false)
+  , is_stateful_(false)
+  , allows_uninitialized_input_(false){}
+struct OpDefDefaultTypeInternal {
+  constexpr OpDefDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~OpDefDefaultTypeInternal() {}
+  union {
+    OpDef _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OpDefDefaultTypeInternal _OpDef_default_instance_;
+constexpr OpDeprecation::OpDeprecation(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : explanation_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , version_(0){}
+struct OpDeprecationDefaultTypeInternal {
+  constexpr OpDeprecationDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~OpDeprecationDefaultTypeInternal() {}
+  union {
+    OpDeprecation _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OpDeprecationDefaultTypeInternal _OpDeprecation_default_instance_;
+constexpr OpList::OpList(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : op_(){}
+struct OpListDefaultTypeInternal {
+  constexpr OpListDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~OpListDefaultTypeInternal() {}
+  union {
+    OpList _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT OpListDefaultTypeInternal _OpList_default_instance_;
 }  // namespace opencv_tensorflow
-namespace protobuf_op_5fdef_2eproto {
-void InitDefaultsOpDef_ArgDefImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_tensorflow::_OpDef_ArgDef_default_instance_;
-    new (ptr) ::opencv_tensorflow::OpDef_ArgDef();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::OpDef_ArgDef::InitAsDefaultInstance();
-}
-
-void InitDefaultsOpDef_ArgDef() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOpDef_ArgDefImpl);
-}
-
-void InitDefaultsOpDef_AttrDefImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
-  {
-    void* ptr = &::opencv_tensorflow::_OpDef_AttrDef_default_instance_;
-    new (ptr) ::opencv_tensorflow::OpDef_AttrDef();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::OpDef_AttrDef::InitAsDefaultInstance();
-}
-
-void InitDefaultsOpDef_AttrDef() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOpDef_AttrDefImpl);
-}
-
-void InitDefaultsOpDefImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_op_5fdef_2eproto[5];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_op_5fdef_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_op_5fdef_2eproto = nullptr;
 
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_op_5fdef_2eproto::InitDefaultsOpDef_ArgDef();
-  protobuf_op_5fdef_2eproto::InitDefaultsOpDef_AttrDef();
-  protobuf_op_5fdef_2eproto::InitDefaultsOpDeprecation();
-  {
-    void* ptr = &::opencv_tensorflow::_OpDef_default_instance_;
-    new (ptr) ::opencv_tensorflow::OpDef();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::OpDef::InitAsDefaultInstance();
-}
-
-void InitDefaultsOpDef() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOpDefImpl);
-}
-
-void InitDefaultsOpDeprecationImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_tensorflow::_OpDeprecation_default_instance_;
-    new (ptr) ::opencv_tensorflow::OpDeprecation();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::OpDeprecation::InitAsDefaultInstance();
-}
-
-void InitDefaultsOpDeprecation() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOpDeprecationImpl);
-}
-
-void InitDefaultsOpListImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_op_5fdef_2eproto::InitDefaultsOpDef();
-  {
-    void* ptr = &::opencv_tensorflow::_OpList_default_instance_;
-    new (ptr) ::opencv_tensorflow::OpList();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::OpList::InitAsDefaultInstance();
-}
-
-void InitDefaultsOpList() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOpListImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[5];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+const uint32_t TableStruct_op_5fdef_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, description_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, type_attr_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, number_attr_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, type_list_attr_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, is_ref_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, description_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, type_attr_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, number_attr_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, type_list_attr_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_ArgDef, is_ref_),
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, type_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, default_value_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, description_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, has_minimum_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, minimum_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, allowed_values_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, type_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, default_value_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, description_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, has_minimum_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, minimum_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef_AttrDef, allowed_values_),
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, name_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, input_arg_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, output_arg_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, attr_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, deprecation_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, summary_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, description_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, is_commutative_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, is_aggregate_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, is_stateful_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDef, allows_uninitialized_input_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, name_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, input_arg_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, output_arg_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, attr_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, deprecation_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, summary_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, description_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, is_commutative_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, is_aggregate_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, is_stateful_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDef, allows_uninitialized_input_),
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDeprecation, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDeprecation, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDeprecation, version_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpDeprecation, explanation_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDeprecation, version_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpDeprecation, explanation_),
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpList, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpList, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::OpList, op_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::OpList, op_),
 };
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, -1, sizeof(::opencv_tensorflow::OpDef_ArgDef)},
-  { 12, -1, sizeof(::opencv_tensorflow::OpDef_AttrDef)},
-  { 24, -1, sizeof(::opencv_tensorflow::OpDef)},
-  { 40, -1, sizeof(::opencv_tensorflow::OpDeprecation)},
-  { 47, -1, sizeof(::opencv_tensorflow::OpList)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::opencv_tensorflow::OpDef_ArgDef)},
+  { 13, -1, -1, sizeof(::opencv_tensorflow::OpDef_AttrDef)},
+  { 26, -1, -1, sizeof(::opencv_tensorflow::OpDef)},
+  { 43, -1, -1, sizeof(::opencv_tensorflow::OpDeprecation)},
+  { 51, -1, -1, sizeof(::opencv_tensorflow::OpList)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_OpDef_ArgDef_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_OpDef_AttrDef_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_OpDef_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_OpDeprecation_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_OpList_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_OpDef_ArgDef_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_OpDef_AttrDef_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_OpDef_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_OpDeprecation_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_OpList_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "op_def.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\014op_def.proto\022\021opencv_tensorflow\032\020attr_"
-      "value.proto\032\013types.proto\"\351\005\n\005OpDef\022\014\n\004na"
-      "me\030\001 \001(\t\0222\n\tinput_arg\030\002 \003(\0132\037.opencv_ten"
-      "sorflow.OpDef.ArgDef\0223\n\noutput_arg\030\003 \003(\013"
-      "2\037.opencv_tensorflow.OpDef.ArgDef\022.\n\004att"
-      "r\030\004 \003(\0132 .opencv_tensorflow.OpDef.AttrDe"
-      "f\0225\n\013deprecation\030\010 \001(\0132 .opencv_tensorfl"
-      "ow.OpDeprecation\022\017\n\007summary\030\005 \001(\t\022\023\n\013des"
-      "cription\030\006 \001(\t\022\026\n\016is_commutative\030\022 \001(\010\022\024"
-      "\n\014is_aggregate\030\020 \001(\010\022\023\n\013is_stateful\030\021 \001("
-      "\010\022\"\n\032allows_uninitialized_input\030\023 \001(\010\032\246\001"
-      "\n\006ArgDef\022\014\n\004name\030\001 \001(\t\022\023\n\013description\030\002 "
-      "\001(\t\022)\n\004type\030\003 \001(\0162\033.opencv_tensorflow.Da"
-      "taType\022\021\n\ttype_attr\030\004 \001(\t\022\023\n\013number_attr"
-      "\030\005 \001(\t\022\026\n\016type_list_attr\030\006 \001(\t\022\016\n\006is_ref"
-      "\030\020 \001(\010\032\313\001\n\007AttrDef\022\014\n\004name\030\001 \001(\t\022\014\n\004type"
-      "\030\002 \001(\t\0223\n\rdefault_value\030\003 \001(\0132\034.opencv_t"
-      "ensorflow.AttrValue\022\023\n\013description\030\004 \001(\t"
-      "\022\023\n\013has_minimum\030\005 \001(\010\022\017\n\007minimum\030\006 \001(\003\0224"
-      "\n\016allowed_values\030\007 \001(\0132\034.opencv_tensorfl"
-      "ow.AttrValue\"5\n\rOpDeprecation\022\017\n\007version"
-      "\030\001 \001(\005\022\023\n\013explanation\030\002 \001(\t\".\n\006OpList\022$\n"
-      "\002op\030\001 \003(\0132\030.opencv_tensorflow.OpDefB,\n\030o"
-      "rg.tensorflow.frameworkB\013OpDefProtosP\001\370\001"
-      "\001b\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 969);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "op_def.proto", &protobuf_RegisterTypes);
-  ::protobuf_attr_5fvalue_2eproto::AddDescriptors();
-  ::protobuf_types_2eproto::AddDescriptors();
+const char descriptor_table_protodef_op_5fdef_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\014op_def.proto\022\021opencv_tensorflow\032\020attr_"
+  "value.proto\032\013types.proto\"\351\005\n\005OpDef\022\014\n\004na"
+  "me\030\001 \001(\t\0222\n\tinput_arg\030\002 \003(\0132\037.opencv_ten"
+  "sorflow.OpDef.ArgDef\0223\n\noutput_arg\030\003 \003(\013"
+  "2\037.opencv_tensorflow.OpDef.ArgDef\022.\n\004att"
+  "r\030\004 \003(\0132 .opencv_tensorflow.OpDef.AttrDe"
+  "f\0225\n\013deprecation\030\010 \001(\0132 .opencv_tensorfl"
+  "ow.OpDeprecation\022\017\n\007summary\030\005 \001(\t\022\023\n\013des"
+  "cription\030\006 \001(\t\022\026\n\016is_commutative\030\022 \001(\010\022\024"
+  "\n\014is_aggregate\030\020 \001(\010\022\023\n\013is_stateful\030\021 \001("
+  "\010\022\"\n\032allows_uninitialized_input\030\023 \001(\010\032\246\001"
+  "\n\006ArgDef\022\014\n\004name\030\001 \001(\t\022\023\n\013description\030\002 "
+  "\001(\t\022)\n\004type\030\003 \001(\0162\033.opencv_tensorflow.Da"
+  "taType\022\021\n\ttype_attr\030\004 \001(\t\022\023\n\013number_attr"
+  "\030\005 \001(\t\022\026\n\016type_list_attr\030\006 \001(\t\022\016\n\006is_ref"
+  "\030\020 \001(\010\032\313\001\n\007AttrDef\022\014\n\004name\030\001 \001(\t\022\014\n\004type"
+  "\030\002 \001(\t\0223\n\rdefault_value\030\003 \001(\0132\034.opencv_t"
+  "ensorflow.AttrValue\022\023\n\013description\030\004 \001(\t"
+  "\022\023\n\013has_minimum\030\005 \001(\010\022\017\n\007minimum\030\006 \001(\003\0224"
+  "\n\016allowed_values\030\007 \001(\0132\034.opencv_tensorfl"
+  "ow.AttrValue\"5\n\rOpDeprecation\022\017\n\007version"
+  "\030\001 \001(\005\022\023\n\013explanation\030\002 \001(\t\".\n\006OpList\022$\n"
+  "\002op\030\001 \003(\0132\030.opencv_tensorflow.OpDefB,\n\030o"
+  "rg.tensorflow.frameworkB\013OpDefProtosP\001\370\001"
+  "\001b\006proto3"
+  ;
+static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_op_5fdef_2eproto_deps[2] = {
+  &::descriptor_table_attr_5fvalue_2eproto,
+  &::descriptor_table_types_2eproto,
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_op_5fdef_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_op_5fdef_2eproto = {
+  false, false, 969, descriptor_table_protodef_op_5fdef_2eproto, "op_def.proto",
+  &descriptor_table_op_5fdef_2eproto_once, descriptor_table_op_5fdef_2eproto_deps, 2, 5,
+  schemas, file_default_instances, TableStruct_op_5fdef_2eproto::offsets,
+  file_level_metadata_op_5fdef_2eproto, file_level_enum_descriptors_op_5fdef_2eproto, file_level_service_descriptors_op_5fdef_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_op_5fdef_2eproto_getter() {
+  return &descriptor_table_op_5fdef_2eproto;
 }
 
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_op_5fdef_2eproto
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_op_5fdef_2eproto(&descriptor_table_op_5fdef_2eproto);
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-void OpDef_ArgDef::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int OpDef_ArgDef::kNameFieldNumber;
-const int OpDef_ArgDef::kDescriptionFieldNumber;
-const int OpDef_ArgDef::kTypeFieldNumber;
-const int OpDef_ArgDef::kTypeAttrFieldNumber;
-const int OpDef_ArgDef::kNumberAttrFieldNumber;
-const int OpDef_ArgDef::kTypeListAttrFieldNumber;
-const int OpDef_ArgDef::kIsRefFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class OpDef_ArgDef::_Internal {
+ public:
+};
 
-OpDef_ArgDef::OpDef_ArgDef()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef_ArgDef();
-  }
+OpDef_ArgDef::OpDef_ArgDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.OpDef.ArgDef)
-}
-OpDef_ArgDef::OpDef_ArgDef(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef_ArgDef();
-  SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.OpDef.ArgDef)
 }
 OpDef_ArgDef::OpDef_ArgDef(const OpDef_ArgDef& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.description().size() > 0) {
-    description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(),
-      GetArenaNoVirtual());
-  }
-  type_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.type_attr().size() > 0) {
-    type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_attr(),
-      GetArenaNoVirtual());
-  }
-  number_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.number_attr().size() > 0) {
-    number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.number_attr(),
-      GetArenaNoVirtual());
-  }
-  type_list_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.type_list_attr().size() > 0) {
-    type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_list_attr(),
-      GetArenaNoVirtual());
+  : ::PROTOBUF_NAMESPACE_ID::Message() {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_name().empty()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_description().empty()) {
+    description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_description(),
+      GetArenaForAllocation());
+  }
+  type_attr_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    type_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_type_attr().empty()) {
+    type_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type_attr(),
+      GetArenaForAllocation());
+  }
+  number_attr_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    number_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_number_attr().empty()) {
+    number_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_number_attr(),
+      GetArenaForAllocation());
+  }
+  type_list_attr_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    type_list_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_type_list_attr().empty()) {
+    type_list_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type_list_attr(),
+      GetArenaForAllocation());
   }
   ::memcpy(&type_, &from.type_,
     static_cast<size_t>(reinterpret_cast<char*>(&is_ref_) -
@@ -365,363 +292,244 @@ OpDef_ArgDef::OpDef_ArgDef(const OpDef_ArgDef& from)
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.OpDef.ArgDef)
 }
 
-void OpDef_ArgDef::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  number_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_list_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&type_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&is_ref_) -
-      reinterpret_cast<char*>(&type_)) + sizeof(is_ref_));
-  _cached_size_ = 0;
+inline void OpDef_ArgDef::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+type_attr_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  type_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+number_attr_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  number_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+type_list_attr_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  type_list_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&type_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&is_ref_) -
+    reinterpret_cast<char*>(&type_)) + sizeof(is_ref_));
 }
 
 OpDef_ArgDef::~OpDef_ArgDef() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.OpDef.ArgDef)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void OpDef_ArgDef::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_attr_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  number_attr_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_list_attr_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void OpDef_ArgDef::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  description_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  type_attr_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  number_attr_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  type_list_attr_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void OpDef_ArgDef::ArenaDtor(void* object) {
   OpDef_ArgDef* _this = reinterpret_cast< OpDef_ArgDef* >(object);
   (void)_this;
 }
-void OpDef_ArgDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void OpDef_ArgDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void OpDef_ArgDef::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* OpDef_ArgDef::descriptor() {
-  ::protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const OpDef_ArgDef& OpDef_ArgDef::default_instance() {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef_ArgDef();
-  return *internal_default_instance();
-}
-
-OpDef_ArgDef* OpDef_ArgDef::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<OpDef_ArgDef>(arena);
+  _cached_size_.Set(size);
 }
 
 void OpDef_ArgDef::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.OpDef.ArgDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  type_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  number_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  type_list_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  name_.ClearToEmpty();
+  description_.ClearToEmpty();
+  type_attr_.ClearToEmpty();
+  number_attr_.ClearToEmpty();
+  type_list_attr_.ClearToEmpty();
   ::memset(&type_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&is_ref_) -
       reinterpret_cast<char*>(&type_)) + sizeof(is_ref_));
-  _internal_metadata_.Clear();
-}
-
-bool OpDef_ArgDef::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:opencv_tensorflow.OpDef.ArgDef)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* OpDef_ArgDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.ArgDef.name"));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.ArgDef.name"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string description = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_description()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->description().data(), static_cast<int>(this->description().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.ArgDef.description"));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_description();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.ArgDef.description"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.DataType type = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_type(static_cast< ::opencv_tensorflow::DataType >(value));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          _internal_set_type(static_cast<::opencv_tensorflow::DataType>(val));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string type_attr = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type_attr()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->type_attr().data(), static_cast<int>(this->type_attr().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.ArgDef.type_attr"));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_type_attr();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.ArgDef.type_attr"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string number_attr = 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->mutable_number_attr()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->number_attr().data(), static_cast<int>(this->number_attr().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.ArgDef.number_attr"));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          auto str = _internal_mutable_number_attr();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.ArgDef.number_attr"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string type_list_attr = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type_list_attr()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->type_list_attr().data(), static_cast<int>(this->type_list_attr().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.ArgDef.type_list_attr"));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          auto str = _internal_mutable_type_list_attr();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.ArgDef.type_list_attr"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bool is_ref = 16;
-      case 16: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &is_ref_)));
-        } else {
+      case 16:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
+          is_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.OpDef.ArgDef)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.OpDef.ArgDef)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void OpDef_ArgDef::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.OpDef.ArgDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.ArgDef.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // string description = 2;
-  if (this->description().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->description().data(), static_cast<int>(this->description().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.ArgDef.description");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->description(), output);
-  }
-
-  // .opencv_tensorflow.DataType type = 3;
-  if (this->type() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      3, this->type(), output);
-  }
-
-  // string type_attr = 4;
-  if (this->type_attr().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type_attr().data(), static_cast<int>(this->type_attr().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.ArgDef.type_attr");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->type_attr(), output);
-  }
-
-  // string number_attr = 5;
-  if (this->number_attr().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->number_attr().data(), static_cast<int>(this->number_attr().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.ArgDef.number_attr");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      5, this->number_attr(), output);
-  }
-
-  // string type_list_attr = 6;
-  if (this->type_list_attr().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type_list_attr().data(), static_cast<int>(this->type_list_attr().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.ArgDef.type_list_attr");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      6, this->type_list_attr(), output);
-  }
-
-  // bool is_ref = 16;
-  if (this->is_ref() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->is_ref(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.OpDef.ArgDef)
-}
-
-::google::protobuf::uint8* OpDef_ArgDef::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* OpDef_ArgDef::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.OpDef.ArgDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_name().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.ArgDef.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // string description = 2;
-  if (this->description().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->description().data(), static_cast<int>(this->description().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_description().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_description().data(), static_cast<int>(this->_internal_description().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.ArgDef.description");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->description(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_description(), target);
   }
 
   // .opencv_tensorflow.DataType type = 3;
-  if (this->type() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      3, this->type(), target);
+  if (this->_internal_type() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      3, this->_internal_type(), target);
   }
 
   // string type_attr = 4;
-  if (this->type_attr().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type_attr().data(), static_cast<int>(this->type_attr().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_type_attr().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_type_attr().data(), static_cast<int>(this->_internal_type_attr().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.ArgDef.type_attr");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->type_attr(), target);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_type_attr(), target);
   }
 
   // string number_attr = 5;
-  if (this->number_attr().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->number_attr().data(), static_cast<int>(this->number_attr().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_number_attr().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_number_attr().data(), static_cast<int>(this->_internal_number_attr().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.ArgDef.number_attr");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        5, this->number_attr(), target);
+    target = stream->WriteStringMaybeAliased(
+        5, this->_internal_number_attr(), target);
   }
 
   // string type_list_attr = 6;
-  if (this->type_list_attr().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type_list_attr().data(), static_cast<int>(this->type_list_attr().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_type_list_attr().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_type_list_attr().data(), static_cast<int>(this->_internal_type_list_attr().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.ArgDef.type_list_attr");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        6, this->type_list_attr(), target);
+    target = stream->WriteStringMaybeAliased(
+        6, this->_internal_type_list_attr(), target);
   }
 
   // bool is_ref = 16;
-  if (this->is_ref() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->is_ref(), target);
+  if (this->_internal_is_ref() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(16, this->_internal_is_ref(), target);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.OpDef.ArgDef)
   return target;
@@ -731,114 +539,100 @@ size_t OpDef_ArgDef::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.OpDef.ArgDef)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // string name = 1;
-  if (this->name().size() > 0) {
+  if (!this->_internal_name().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_name());
   }
 
   // string description = 2;
-  if (this->description().size() > 0) {
+  if (!this->_internal_description().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->description());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_description());
   }
 
   // string type_attr = 4;
-  if (this->type_attr().size() > 0) {
+  if (!this->_internal_type_attr().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->type_attr());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_type_attr());
   }
 
   // string number_attr = 5;
-  if (this->number_attr().size() > 0) {
+  if (!this->_internal_number_attr().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->number_attr());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_number_attr());
   }
 
   // string type_list_attr = 6;
-  if (this->type_list_attr().size() > 0) {
+  if (!this->_internal_type_list_attr().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->type_list_attr());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_type_list_attr());
   }
 
   // .opencv_tensorflow.DataType type = 3;
-  if (this->type() != 0) {
+  if (this->_internal_type() != 0) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
   }
 
   // bool is_ref = 16;
-  if (this->is_ref() != 0) {
+  if (this->_internal_is_ref() != 0) {
     total_size += 2 + 1;
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void OpDef_ArgDef::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.OpDef.ArgDef)
-  GOOGLE_DCHECK_NE(&from, this);
-  const OpDef_ArgDef* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const OpDef_ArgDef>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.OpDef.ArgDef)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.OpDef.ArgDef)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData OpDef_ArgDef::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    OpDef_ArgDef::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*OpDef_ArgDef::GetClassData() const { return &_class_data_; }
+
+void OpDef_ArgDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<OpDef_ArgDef *>(to)->MergeFrom(
+      static_cast<const OpDef_ArgDef &>(from));
 }
 
+
 void OpDef_ArgDef::MergeFrom(const OpDef_ArgDef& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.OpDef.ArgDef)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.name().size() > 0) {
-    set_name(from.name());
+  if (!from._internal_name().empty()) {
+    _internal_set_name(from._internal_name());
   }
-  if (from.description().size() > 0) {
-    set_description(from.description());
+  if (!from._internal_description().empty()) {
+    _internal_set_description(from._internal_description());
   }
-  if (from.type_attr().size() > 0) {
-    set_type_attr(from.type_attr());
+  if (!from._internal_type_attr().empty()) {
+    _internal_set_type_attr(from._internal_type_attr());
   }
-  if (from.number_attr().size() > 0) {
-    set_number_attr(from.number_attr());
+  if (!from._internal_number_attr().empty()) {
+    _internal_set_number_attr(from._internal_number_attr());
   }
-  if (from.type_list_attr().size() > 0) {
-    set_type_list_attr(from.type_list_attr());
+  if (!from._internal_type_list_attr().empty()) {
+    _internal_set_type_list_attr(from._internal_type_list_attr());
   }
-  if (from.type() != 0) {
-    set_type(from.type());
+  if (from._internal_type() != 0) {
+    _internal_set_type(from._internal_type());
   }
-  if (from.is_ref() != 0) {
-    set_is_ref(from.is_ref());
+  if (from._internal_is_ref() != 0) {
+    _internal_set_is_ref(from._internal_is_ref());
   }
-}
-
-void OpDef_ArgDef::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.OpDef.ArgDef)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void OpDef_ArgDef::CopyFrom(const OpDef_ArgDef& from) {
@@ -852,153 +646,123 @@ bool OpDef_ArgDef::IsInitialized() const {
   return true;
 }
 
-void OpDef_ArgDef::Swap(OpDef_ArgDef* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    OpDef_ArgDef* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void OpDef_ArgDef::UnsafeArenaSwap(OpDef_ArgDef* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void OpDef_ArgDef::InternalSwap(OpDef_ArgDef* other) {
   using std::swap;
-  name_.Swap(&other->name_);
-  description_.Swap(&other->description_);
-  type_attr_.Swap(&other->type_attr_);
-  number_attr_.Swap(&other->number_attr_);
-  type_list_attr_.Swap(&other->type_list_attr_);
-  swap(type_, other->type_);
-  swap(is_ref_, other->is_ref_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata OpDef_ArgDef::GetMetadata() const {
-  protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages];
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &description_, lhs_arena,
+      &other->description_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &type_attr_, lhs_arena,
+      &other->type_attr_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &number_attr_, lhs_arena,
+      &other->number_attr_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &type_list_attr_, lhs_arena,
+      &other->type_list_attr_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(OpDef_ArgDef, is_ref_)
+      + sizeof(OpDef_ArgDef::is_ref_)
+      - PROTOBUF_FIELD_OFFSET(OpDef_ArgDef, type_)>(
+          reinterpret_cast<char*>(&type_),
+          reinterpret_cast<char*>(&other->type_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata OpDef_ArgDef::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_op_5fdef_2eproto_getter, &descriptor_table_op_5fdef_2eproto_once,
+      file_level_metadata_op_5fdef_2eproto[0]);
 }
 
-
 // ===================================================================
 
-void OpDef_AttrDef::InitAsDefaultInstance() {
-  ::opencv_tensorflow::_OpDef_AttrDef_default_instance_._instance.get_mutable()->default_value_ = const_cast< ::opencv_tensorflow::AttrValue*>(
-      ::opencv_tensorflow::AttrValue::internal_default_instance());
-  ::opencv_tensorflow::_OpDef_AttrDef_default_instance_._instance.get_mutable()->allowed_values_ = const_cast< ::opencv_tensorflow::AttrValue*>(
-      ::opencv_tensorflow::AttrValue::internal_default_instance());
-}
-void OpDef_AttrDef::_slow_mutable_default_value() {
-  default_value_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::AttrValue >(
-      GetArenaNoVirtual());
-}
-void OpDef_AttrDef::unsafe_arena_set_allocated_default_value(
-    ::opencv_tensorflow::AttrValue* default_value) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete default_value_;
-  }
-  default_value_ = default_value;
-  if (default_value) {
-
-  } else {
+class OpDef_AttrDef::_Internal {
+ public:
+  static const ::opencv_tensorflow::AttrValue& default_value(const OpDef_AttrDef* msg);
+  static const ::opencv_tensorflow::AttrValue& allowed_values(const OpDef_AttrDef* msg);
+};
 
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.AttrDef.default_value)
+const ::opencv_tensorflow::AttrValue&
+OpDef_AttrDef::_Internal::default_value(const OpDef_AttrDef* msg) {
+  return *msg->default_value_;
+}
+const ::opencv_tensorflow::AttrValue&
+OpDef_AttrDef::_Internal::allowed_values(const OpDef_AttrDef* msg) {
+  return *msg->allowed_values_;
 }
 void OpDef_AttrDef::clear_default_value() {
-  if (GetArenaNoVirtual() == NULL && default_value_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && default_value_ != nullptr) {
     delete default_value_;
   }
-  default_value_ = NULL;
-}
-void OpDef_AttrDef::_slow_mutable_allowed_values() {
-  allowed_values_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::AttrValue >(
-      GetArenaNoVirtual());
-}
-void OpDef_AttrDef::unsafe_arena_set_allocated_allowed_values(
-    ::opencv_tensorflow::AttrValue* allowed_values) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete allowed_values_;
-  }
-  allowed_values_ = allowed_values;
-  if (allowed_values) {
-
-  } else {
-
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.AttrDef.allowed_values)
+  default_value_ = nullptr;
 }
 void OpDef_AttrDef::clear_allowed_values() {
-  if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && allowed_values_ != nullptr) {
     delete allowed_values_;
   }
-  allowed_values_ = NULL;
+  allowed_values_ = nullptr;
 }
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int OpDef_AttrDef::kNameFieldNumber;
-const int OpDef_AttrDef::kTypeFieldNumber;
-const int OpDef_AttrDef::kDefaultValueFieldNumber;
-const int OpDef_AttrDef::kDescriptionFieldNumber;
-const int OpDef_AttrDef::kHasMinimumFieldNumber;
-const int OpDef_AttrDef::kMinimumFieldNumber;
-const int OpDef_AttrDef::kAllowedValuesFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-OpDef_AttrDef::OpDef_AttrDef()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef_AttrDef();
-  }
+OpDef_AttrDef::OpDef_AttrDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.OpDef.AttrDef)
-}
-OpDef_AttrDef::OpDef_AttrDef(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef_AttrDef();
-  SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.OpDef.AttrDef)
 }
 OpDef_AttrDef::OpDef_AttrDef(const OpDef_AttrDef& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.type().size() > 0) {
-    type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type(),
-      GetArenaNoVirtual());
-  }
-  description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.description().size() > 0) {
-    description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_default_value()) {
+  : ::PROTOBUF_NAMESPACE_ID::Message() {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_name().empty()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_type().empty()) {
+    type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type(),
+      GetArenaForAllocation());
+  }
+  description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_description().empty()) {
+    description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_description(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_default_value()) {
     default_value_ = new ::opencv_tensorflow::AttrValue(*from.default_value_);
   } else {
-    default_value_ = NULL;
+    default_value_ = nullptr;
   }
-  if (from.has_allowed_values()) {
+  if (from._internal_has_allowed_values()) {
     allowed_values_ = new ::opencv_tensorflow::AttrValue(*from.allowed_values_);
   } else {
-    allowed_values_ = NULL;
+    allowed_values_ = nullptr;
   }
   ::memcpy(&minimum_, &from.minimum_,
     static_cast<size_t>(reinterpret_cast<char*>(&has_minimum_) -
@@ -1006,26 +770,37 @@ OpDef_AttrDef::OpDef_AttrDef(const OpDef_AttrDef& from)
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.OpDef.AttrDef)
 }
 
-void OpDef_AttrDef::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&default_value_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&has_minimum_) -
-      reinterpret_cast<char*>(&default_value_)) + sizeof(has_minimum_));
-  _cached_size_ = 0;
+inline void OpDef_AttrDef::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&default_value_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&has_minimum_) -
+    reinterpret_cast<char*>(&default_value_)) + sizeof(has_minimum_));
 }
 
 OpDef_AttrDef::~OpDef_AttrDef() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.OpDef.AttrDef)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void OpDef_AttrDef::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void OpDef_AttrDef::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  description_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete default_value_;
   if (this != internal_default_instance()) delete allowed_values_;
 }
@@ -1034,312 +809,193 @@ void OpDef_AttrDef::ArenaDtor(void* object) {
   OpDef_AttrDef* _this = reinterpret_cast< OpDef_AttrDef* >(object);
   (void)_this;
 }
-void OpDef_AttrDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void OpDef_AttrDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void OpDef_AttrDef::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* OpDef_AttrDef::descriptor() {
-  ::protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const OpDef_AttrDef& OpDef_AttrDef::default_instance() {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef_AttrDef();
-  return *internal_default_instance();
-}
-
-OpDef_AttrDef* OpDef_AttrDef::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<OpDef_AttrDef>(arena);
+  _cached_size_.Set(size);
 }
 
 void OpDef_AttrDef::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.OpDef.AttrDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  if (GetArenaNoVirtual() == NULL && default_value_ != NULL) {
+  name_.ClearToEmpty();
+  type_.ClearToEmpty();
+  description_.ClearToEmpty();
+  if (GetArenaForAllocation() == nullptr && default_value_ != nullptr) {
     delete default_value_;
   }
-  default_value_ = NULL;
-  if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) {
+  default_value_ = nullptr;
+  if (GetArenaForAllocation() == nullptr && allowed_values_ != nullptr) {
     delete allowed_values_;
   }
-  allowed_values_ = NULL;
+  allowed_values_ = nullptr;
   ::memset(&minimum_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&has_minimum_) -
       reinterpret_cast<char*>(&minimum_)) + sizeof(has_minimum_));
-  _internal_metadata_.Clear();
-}
-
-bool OpDef_AttrDef::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:opencv_tensorflow.OpDef.AttrDef)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* OpDef_AttrDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.AttrDef.name"));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.AttrDef.name"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string type = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_type()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->type().data(), static_cast<int>(this->type().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.AttrDef.type"));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_type();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.AttrDef.type"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.AttrValue default_value = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_default_value()));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ctx->ParseMessage(_internal_mutable_default_value(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string description = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_description()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->description().data(), static_cast<int>(this->description().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.AttrDef.description"));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_description();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.AttrDef.description"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bool has_minimum = 5;
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &has_minimum_)));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
+          has_minimum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // int64 minimum = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &minimum_)));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+          minimum_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.AttrValue allowed_values = 7;
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_allowed_values()));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ctx->ParseMessage(_internal_mutable_allowed_values(), ptr);
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.OpDef.AttrDef)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.OpDef.AttrDef)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void OpDef_AttrDef::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.OpDef.AttrDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.AttrDef.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // string type = 2;
-  if (this->type().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.AttrDef.type");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->type(), output);
-  }
-
-  // .opencv_tensorflow.AttrValue default_value = 3;
-  if (this->has_default_value()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, *this->default_value_, output);
-  }
-
-  // string description = 4;
-  if (this->description().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->description().data(), static_cast<int>(this->description().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.AttrDef.description");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      4, this->description(), output);
-  }
-
-  // bool has_minimum = 5;
-  if (this->has_minimum() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->has_minimum(), output);
-  }
-
-  // int64 minimum = 6;
-  if (this->minimum() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->minimum(), output);
-  }
-
-  // .opencv_tensorflow.AttrValue allowed_values = 7;
-  if (this->has_allowed_values()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      7, *this->allowed_values_, output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.OpDef.AttrDef)
-}
-
-::google::protobuf::uint8* OpDef_AttrDef::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* OpDef_AttrDef::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.OpDef.AttrDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_name().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.AttrDef.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // string type = 2;
-  if (this->type().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->type().data(), static_cast<int>(this->type().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_type().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_type().data(), static_cast<int>(this->_internal_type().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.AttrDef.type");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->type(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_type(), target);
   }
 
   // .opencv_tensorflow.AttrValue default_value = 3;
-  if (this->has_default_value()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, *this->default_value_, deterministic, target);
+  if (this->_internal_has_default_value()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        3, _Internal::default_value(this), target, stream);
   }
 
   // string description = 4;
-  if (this->description().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->description().data(), static_cast<int>(this->description().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_description().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_description().data(), static_cast<int>(this->_internal_description().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.AttrDef.description");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        4, this->description(), target);
+    target = stream->WriteStringMaybeAliased(
+        4, this->_internal_description(), target);
   }
 
   // bool has_minimum = 5;
-  if (this->has_minimum() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->has_minimum(), target);
+  if (this->_internal_has_minimum() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_has_minimum(), target);
   }
 
   // int64 minimum = 6;
-  if (this->minimum() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->minimum(), target);
+  if (this->_internal_minimum() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->_internal_minimum(), target);
   }
 
   // .opencv_tensorflow.AttrValue allowed_values = 7;
-  if (this->has_allowed_values()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        7, *this->allowed_values_, deterministic, target);
+  if (this->_internal_has_allowed_values()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        7, _Internal::allowed_values(this), target, stream);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.OpDef.AttrDef)
   return target;
@@ -1349,115 +1005,99 @@ size_t OpDef_AttrDef::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.OpDef.AttrDef)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // string name = 1;
-  if (this->name().size() > 0) {
+  if (!this->_internal_name().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_name());
   }
 
   // string type = 2;
-  if (this->type().size() > 0) {
+  if (!this->_internal_type().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->type());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_type());
   }
 
   // string description = 4;
-  if (this->description().size() > 0) {
+  if (!this->_internal_description().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->description());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_description());
   }
 
   // .opencv_tensorflow.AttrValue default_value = 3;
-  if (this->has_default_value()) {
+  if (this->_internal_has_default_value()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->default_value_);
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *default_value_);
   }
 
   // .opencv_tensorflow.AttrValue allowed_values = 7;
-  if (this->has_allowed_values()) {
+  if (this->_internal_has_allowed_values()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->allowed_values_);
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *allowed_values_);
   }
 
   // int64 minimum = 6;
-  if (this->minimum() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->minimum());
+  if (this->_internal_minimum() != 0) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_minimum());
   }
 
   // bool has_minimum = 5;
-  if (this->has_minimum() != 0) {
+  if (this->_internal_has_minimum() != 0) {
     total_size += 1 + 1;
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void OpDef_AttrDef::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.OpDef.AttrDef)
-  GOOGLE_DCHECK_NE(&from, this);
-  const OpDef_AttrDef* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const OpDef_AttrDef>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.OpDef.AttrDef)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.OpDef.AttrDef)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData OpDef_AttrDef::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    OpDef_AttrDef::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*OpDef_AttrDef::GetClassData() const { return &_class_data_; }
+
+void OpDef_AttrDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<OpDef_AttrDef *>(to)->MergeFrom(
+      static_cast<const OpDef_AttrDef &>(from));
 }
 
+
 void OpDef_AttrDef::MergeFrom(const OpDef_AttrDef& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.OpDef.AttrDef)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.name().size() > 0) {
-    set_name(from.name());
+  if (!from._internal_name().empty()) {
+    _internal_set_name(from._internal_name());
   }
-  if (from.type().size() > 0) {
-    set_type(from.type());
+  if (!from._internal_type().empty()) {
+    _internal_set_type(from._internal_type());
   }
-  if (from.description().size() > 0) {
-    set_description(from.description());
+  if (!from._internal_description().empty()) {
+    _internal_set_description(from._internal_description());
   }
-  if (from.has_default_value()) {
-    mutable_default_value()->::opencv_tensorflow::AttrValue::MergeFrom(from.default_value());
+  if (from._internal_has_default_value()) {
+    _internal_mutable_default_value()->::opencv_tensorflow::AttrValue::MergeFrom(from._internal_default_value());
   }
-  if (from.has_allowed_values()) {
-    mutable_allowed_values()->::opencv_tensorflow::AttrValue::MergeFrom(from.allowed_values());
+  if (from._internal_has_allowed_values()) {
+    _internal_mutable_allowed_values()->::opencv_tensorflow::AttrValue::MergeFrom(from._internal_allowed_values());
   }
-  if (from.minimum() != 0) {
-    set_minimum(from.minimum());
+  if (from._internal_minimum() != 0) {
+    _internal_set_minimum(from._internal_minimum());
   }
-  if (from.has_minimum() != 0) {
-    set_has_minimum(from.has_minimum());
+  if (from._internal_has_minimum() != 0) {
+    _internal_set_has_minimum(from._internal_has_minimum());
   }
-}
-
-void OpDef_AttrDef::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.OpDef.AttrDef)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void OpDef_AttrDef::CopyFrom(const OpDef_AttrDef& from) {
@@ -1471,127 +1111,97 @@ bool OpDef_AttrDef::IsInitialized() const {
   return true;
 }
 
-void OpDef_AttrDef::Swap(OpDef_AttrDef* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    OpDef_AttrDef* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void OpDef_AttrDef::UnsafeArenaSwap(OpDef_AttrDef* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void OpDef_AttrDef::InternalSwap(OpDef_AttrDef* other) {
   using std::swap;
-  name_.Swap(&other->name_);
-  type_.Swap(&other->type_);
-  description_.Swap(&other->description_);
-  swap(default_value_, other->default_value_);
-  swap(allowed_values_, other->allowed_values_);
-  swap(minimum_, other->minimum_);
-  swap(has_minimum_, other->has_minimum_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata OpDef_AttrDef::GetMetadata() const {
-  protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages];
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &type_, lhs_arena,
+      &other->type_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &description_, lhs_arena,
+      &other->description_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(OpDef_AttrDef, has_minimum_)
+      + sizeof(OpDef_AttrDef::has_minimum_)
+      - PROTOBUF_FIELD_OFFSET(OpDef_AttrDef, default_value_)>(
+          reinterpret_cast<char*>(&default_value_),
+          reinterpret_cast<char*>(&other->default_value_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata OpDef_AttrDef::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_op_5fdef_2eproto_getter, &descriptor_table_op_5fdef_2eproto_once,
+      file_level_metadata_op_5fdef_2eproto[1]);
 }
 
-
 // ===================================================================
 
-void OpDef::InitAsDefaultInstance() {
-  ::opencv_tensorflow::_OpDef_default_instance_._instance.get_mutable()->deprecation_ = const_cast< ::opencv_tensorflow::OpDeprecation*>(
-      ::opencv_tensorflow::OpDeprecation::internal_default_instance());
-}
-void OpDef::_slow_mutable_deprecation() {
-  deprecation_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::OpDeprecation >(
-      GetArenaNoVirtual());
-}
-void OpDef::unsafe_arena_set_allocated_deprecation(
-    ::opencv_tensorflow::OpDeprecation* deprecation) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete deprecation_;
-  }
-  deprecation_ = deprecation;
-  if (deprecation) {
-
-  } else {
-
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.deprecation)
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int OpDef::kNameFieldNumber;
-const int OpDef::kInputArgFieldNumber;
-const int OpDef::kOutputArgFieldNumber;
-const int OpDef::kAttrFieldNumber;
-const int OpDef::kDeprecationFieldNumber;
-const int OpDef::kSummaryFieldNumber;
-const int OpDef::kDescriptionFieldNumber;
-const int OpDef::kIsCommutativeFieldNumber;
-const int OpDef::kIsAggregateFieldNumber;
-const int OpDef::kIsStatefulFieldNumber;
-const int OpDef::kAllowsUninitializedInputFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class OpDef::_Internal {
+ public:
+  static const ::opencv_tensorflow::OpDeprecation& deprecation(const OpDef* msg);
+};
 
-OpDef::OpDef()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.OpDef)
+const ::opencv_tensorflow::OpDeprecation&
+OpDef::_Internal::deprecation(const OpDef* msg) {
+  return *msg->deprecation_;
 }
-OpDef::OpDef(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+OpDef::OpDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   input_arg_(arena),
   output_arg_(arena),
   attr_(arena) {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.OpDef)
 }
 OpDef::OpDef(const OpDef& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       input_arg_(from.input_arg_),
       output_arg_(from.output_arg_),
-      attr_(from.attr_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
-  }
-  summary_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.summary().size() > 0) {
-    summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.summary(),
-      GetArenaNoVirtual());
-  }
-  description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.description().size() > 0) {
-    description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_deprecation()) {
+      attr_(from.attr_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_name().empty()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
+  }
+  summary_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    summary_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_summary().empty()) {
+    summary_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_summary(),
+      GetArenaForAllocation());
+  }
+  description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_description().empty()) {
+    description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_description(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_deprecation()) {
     deprecation_ = new ::opencv_tensorflow::OpDeprecation(*from.deprecation_);
   } else {
-    deprecation_ = NULL;
+    deprecation_ = nullptr;
   }
   ::memcpy(&is_commutative_, &from.is_commutative_,
     static_cast<size_t>(reinterpret_cast<char*>(&allows_uninitialized_input_) -
@@ -1599,26 +1209,37 @@ OpDef::OpDef(const OpDef& from)
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.OpDef)
 }
 
-void OpDef::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  summary_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&deprecation_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&allows_uninitialized_input_) -
-      reinterpret_cast<char*>(&deprecation_)) + sizeof(allows_uninitialized_input_));
-  _cached_size_ = 0;
+inline void OpDef::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+summary_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  summary_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&deprecation_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&allows_uninitialized_input_) -
+    reinterpret_cast<char*>(&deprecation_)) + sizeof(allows_uninitialized_input_));
 }
 
 OpDef::~OpDef() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.OpDef)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void OpDef::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  summary_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void OpDef::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  summary_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  description_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete deprecation_;
 }
 
@@ -1626,412 +1247,267 @@ void OpDef::ArenaDtor(void* object) {
   OpDef* _this = reinterpret_cast< OpDef* >(object);
   (void)_this;
 }
-void OpDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void OpDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void OpDef::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* OpDef::descriptor() {
-  ::protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const OpDef& OpDef::default_instance() {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef();
-  return *internal_default_instance();
-}
-
-OpDef* OpDef::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<OpDef>(arena);
+  _cached_size_.Set(size);
 }
 
 void OpDef::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.OpDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   input_arg_.Clear();
   output_arg_.Clear();
   attr_.Clear();
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  if (GetArenaNoVirtual() == NULL && deprecation_ != NULL) {
+  name_.ClearToEmpty();
+  summary_.ClearToEmpty();
+  description_.ClearToEmpty();
+  if (GetArenaForAllocation() == nullptr && deprecation_ != nullptr) {
     delete deprecation_;
   }
-  deprecation_ = NULL;
+  deprecation_ = nullptr;
   ::memset(&is_commutative_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&allows_uninitialized_input_) -
       reinterpret_cast<char*>(&is_commutative_)) + sizeof(allows_uninitialized_input_));
-  _internal_metadata_.Clear();
-}
-
-bool OpDef::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:opencv_tensorflow.OpDef)
-  for (;;) {
-    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
-    tag = p.first;
-    if (!p.second) goto handle_unusual;
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* OpDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // string name = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.name"));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.name"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_tensorflow.OpDef.ArgDef input_arg = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_input_arg()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_input_arg(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_tensorflow.OpDef.ArgDef output_arg = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_output_arg()));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_output_arg(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated .opencv_tensorflow.OpDef.AttrDef attr = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_attr()));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_attr(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string summary = 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->mutable_summary()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->summary().data(), static_cast<int>(this->summary().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.summary"));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          auto str = _internal_mutable_summary();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.summary"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string description = 6;
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_description()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->description().data(), static_cast<int>(this->description().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDef.description"));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          auto str = _internal_mutable_description();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDef.description"));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.OpDeprecation deprecation = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_deprecation()));
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr = ctx->ParseMessage(_internal_mutable_deprecation(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bool is_aggregate = 16;
-      case 16: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &is_aggregate_)));
-        } else {
+      case 16:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
+          is_aggregate_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bool is_stateful = 17;
-      case 17: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &is_stateful_)));
-        } else {
+      case 17:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
+          is_stateful_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bool is_commutative = 18;
-      case 18: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(144u /* 144 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &is_commutative_)));
-        } else {
+      case 18:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
+          is_commutative_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bool allows_uninitialized_input = 19;
-      case 19: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(152u /* 152 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &allows_uninitialized_input_)));
-        } else {
+      case 19:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
+          allows_uninitialized_input_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.OpDef)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.OpDef)
-  return false;
-#undef DO_
-}
-
-void OpDef::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.OpDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->name(), output);
-  }
-
-  // repeated .opencv_tensorflow.OpDef.ArgDef input_arg = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->input_arg_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->input_arg(static_cast<int>(i)), output);
-  }
-
-  // repeated .opencv_tensorflow.OpDef.ArgDef output_arg = 3;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->output_arg_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      3, this->output_arg(static_cast<int>(i)), output);
-  }
-
-  // repeated .opencv_tensorflow.OpDef.AttrDef attr = 4;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->attr_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      4, this->attr(static_cast<int>(i)), output);
-  }
-
-  // string summary = 5;
-  if (this->summary().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->summary().data(), static_cast<int>(this->summary().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.summary");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      5, this->summary(), output);
-  }
-
-  // string description = 6;
-  if (this->description().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->description().data(), static_cast<int>(this->description().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDef.description");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      6, this->description(), output);
-  }
-
-  // .opencv_tensorflow.OpDeprecation deprecation = 8;
-  if (this->has_deprecation()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      8, *this->deprecation_, output);
-  }
-
-  // bool is_aggregate = 16;
-  if (this->is_aggregate() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->is_aggregate(), output);
-  }
-
-  // bool is_stateful = 17;
-  if (this->is_stateful() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->is_stateful(), output);
-  }
-
-  // bool is_commutative = 18;
-  if (this->is_commutative() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->is_commutative(), output);
-  }
-
-  // bool allows_uninitialized_input = 19;
-  if (this->allows_uninitialized_input() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(19, this->allows_uninitialized_input(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.OpDef)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* OpDef::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* OpDef::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.OpDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // string name = 1;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_name().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_name(), target);
   }
 
   // repeated .opencv_tensorflow.OpDef.ArgDef input_arg = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->input_arg_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->input_arg(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_input_arg_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_input_arg(i), target, stream);
   }
 
   // repeated .opencv_tensorflow.OpDef.ArgDef output_arg = 3;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->output_arg_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        3, this->output_arg(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_output_arg_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(3, this->_internal_output_arg(i), target, stream);
   }
 
   // repeated .opencv_tensorflow.OpDef.AttrDef attr = 4;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->attr_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        4, this->attr(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_attr_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(4, this->_internal_attr(i), target, stream);
   }
 
   // string summary = 5;
-  if (this->summary().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->summary().data(), static_cast<int>(this->summary().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_summary().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_summary().data(), static_cast<int>(this->_internal_summary().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.summary");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        5, this->summary(), target);
+    target = stream->WriteStringMaybeAliased(
+        5, this->_internal_summary(), target);
   }
 
   // string description = 6;
-  if (this->description().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->description().data(), static_cast<int>(this->description().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_description().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_description().data(), static_cast<int>(this->_internal_description().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDef.description");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        6, this->description(), target);
+    target = stream->WriteStringMaybeAliased(
+        6, this->_internal_description(), target);
   }
 
   // .opencv_tensorflow.OpDeprecation deprecation = 8;
-  if (this->has_deprecation()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        8, *this->deprecation_, deterministic, target);
+  if (this->_internal_has_deprecation()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        8, _Internal::deprecation(this), target, stream);
   }
 
   // bool is_aggregate = 16;
-  if (this->is_aggregate() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->is_aggregate(), target);
+  if (this->_internal_is_aggregate() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(16, this->_internal_is_aggregate(), target);
   }
 
   // bool is_stateful = 17;
-  if (this->is_stateful() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->is_stateful(), target);
+  if (this->_internal_is_stateful() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(17, this->_internal_is_stateful(), target);
   }
 
   // bool is_commutative = 18;
-  if (this->is_commutative() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->is_commutative(), target);
+  if (this->_internal_is_commutative() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(18, this->_internal_is_commutative(), target);
   }
 
   // bool allows_uninitialized_input = 19;
-  if (this->allows_uninitialized_input() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(19, this->allows_uninitialized_input(), target);
+  if (this->_internal_allows_uninitialized_input() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(19, this->_internal_allows_uninitialized_input(), target);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.OpDef)
   return target;
@@ -2041,155 +1517,129 @@ size_t OpDef::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.OpDef)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_tensorflow.OpDef.ArgDef input_arg = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->input_arg_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->input_arg(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_input_arg_size();
+  for (const auto& msg : this->input_arg_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_tensorflow.OpDef.ArgDef output_arg = 3;
-  {
-    unsigned int count = static_cast<unsigned int>(this->output_arg_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->output_arg(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_output_arg_size();
+  for (const auto& msg : this->output_arg_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // repeated .opencv_tensorflow.OpDef.AttrDef attr = 4;
-  {
-    unsigned int count = static_cast<unsigned int>(this->attr_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->attr(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_attr_size();
+  for (const auto& msg : this->attr_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // string name = 1;
-  if (this->name().size() > 0) {
+  if (!this->_internal_name().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_name());
   }
 
   // string summary = 5;
-  if (this->summary().size() > 0) {
+  if (!this->_internal_summary().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->summary());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_summary());
   }
 
   // string description = 6;
-  if (this->description().size() > 0) {
+  if (!this->_internal_description().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->description());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_description());
   }
 
   // .opencv_tensorflow.OpDeprecation deprecation = 8;
-  if (this->has_deprecation()) {
+  if (this->_internal_has_deprecation()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->deprecation_);
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *deprecation_);
   }
 
   // bool is_commutative = 18;
-  if (this->is_commutative() != 0) {
+  if (this->_internal_is_commutative() != 0) {
     total_size += 2 + 1;
   }
 
   // bool is_aggregate = 16;
-  if (this->is_aggregate() != 0) {
+  if (this->_internal_is_aggregate() != 0) {
     total_size += 2 + 1;
   }
 
   // bool is_stateful = 17;
-  if (this->is_stateful() != 0) {
+  if (this->_internal_is_stateful() != 0) {
     total_size += 2 + 1;
   }
 
   // bool allows_uninitialized_input = 19;
-  if (this->allows_uninitialized_input() != 0) {
+  if (this->_internal_allows_uninitialized_input() != 0) {
     total_size += 2 + 1;
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void OpDef::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.OpDef)
-  GOOGLE_DCHECK_NE(&from, this);
-  const OpDef* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const OpDef>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.OpDef)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.OpDef)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData OpDef::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    OpDef::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*OpDef::GetClassData() const { return &_class_data_; }
+
+void OpDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<OpDef *>(to)->MergeFrom(
+      static_cast<const OpDef &>(from));
 }
 
+
 void OpDef::MergeFrom(const OpDef& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.OpDef)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   input_arg_.MergeFrom(from.input_arg_);
   output_arg_.MergeFrom(from.output_arg_);
   attr_.MergeFrom(from.attr_);
-  if (from.name().size() > 0) {
-    set_name(from.name());
+  if (!from._internal_name().empty()) {
+    _internal_set_name(from._internal_name());
   }
-  if (from.summary().size() > 0) {
-    set_summary(from.summary());
+  if (!from._internal_summary().empty()) {
+    _internal_set_summary(from._internal_summary());
   }
-  if (from.description().size() > 0) {
-    set_description(from.description());
+  if (!from._internal_description().empty()) {
+    _internal_set_description(from._internal_description());
   }
-  if (from.has_deprecation()) {
-    mutable_deprecation()->::opencv_tensorflow::OpDeprecation::MergeFrom(from.deprecation());
+  if (from._internal_has_deprecation()) {
+    _internal_mutable_deprecation()->::opencv_tensorflow::OpDeprecation::MergeFrom(from._internal_deprecation());
   }
-  if (from.is_commutative() != 0) {
-    set_is_commutative(from.is_commutative());
+  if (from._internal_is_commutative() != 0) {
+    _internal_set_is_commutative(from._internal_is_commutative());
   }
-  if (from.is_aggregate() != 0) {
-    set_is_aggregate(from.is_aggregate());
+  if (from._internal_is_aggregate() != 0) {
+    _internal_set_is_aggregate(from._internal_is_aggregate());
   }
-  if (from.is_stateful() != 0) {
-    set_is_stateful(from.is_stateful());
+  if (from._internal_is_stateful() != 0) {
+    _internal_set_is_stateful(from._internal_is_stateful());
   }
-  if (from.allows_uninitialized_input() != 0) {
-    set_allows_uninitialized_input(from.allows_uninitialized_input());
+  if (from._internal_allows_uninitialized_input() != 0) {
+    _internal_set_allows_uninitialized_input(from._internal_allows_uninitialized_input());
   }
-}
-
-void OpDef::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.OpDef)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void OpDef::CopyFrom(const OpDef& from) {
@@ -2203,253 +1653,186 @@ bool OpDef::IsInitialized() const {
   return true;
 }
 
-void OpDef::Swap(OpDef* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    OpDef* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void OpDef::UnsafeArenaSwap(OpDef* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void OpDef::InternalSwap(OpDef* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   input_arg_.InternalSwap(&other->input_arg_);
   output_arg_.InternalSwap(&other->output_arg_);
   attr_.InternalSwap(&other->attr_);
-  name_.Swap(&other->name_);
-  summary_.Swap(&other->summary_);
-  description_.Swap(&other->description_);
-  swap(deprecation_, other->deprecation_);
-  swap(is_commutative_, other->is_commutative_);
-  swap(is_aggregate_, other->is_aggregate_);
-  swap(is_stateful_, other->is_stateful_);
-  swap(allows_uninitialized_input_, other->allows_uninitialized_input_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &summary_, lhs_arena,
+      &other->summary_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &description_, lhs_arena,
+      &other->description_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(OpDef, allows_uninitialized_input_)
+      + sizeof(OpDef::allows_uninitialized_input_)
+      - PROTOBUF_FIELD_OFFSET(OpDef, deprecation_)>(
+          reinterpret_cast<char*>(&deprecation_),
+          reinterpret_cast<char*>(&other->deprecation_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata OpDef::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_op_5fdef_2eproto_getter, &descriptor_table_op_5fdef_2eproto_once,
+      file_level_metadata_op_5fdef_2eproto[2]);
 }
 
-::google::protobuf::Metadata OpDef::GetMetadata() const {
-  protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
 // ===================================================================
 
-void OpDeprecation::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int OpDeprecation::kVersionFieldNumber;
-const int OpDeprecation::kExplanationFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class OpDeprecation::_Internal {
+ public:
+};
 
-OpDeprecation::OpDeprecation()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_op_5fdef_2eproto::InitDefaultsOpDeprecation();
-  }
+OpDeprecation::OpDeprecation(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.OpDeprecation)
-}
-OpDeprecation::OpDeprecation(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpDeprecation();
-  SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.OpDeprecation)
 }
 OpDeprecation::OpDeprecation(const OpDeprecation& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  explanation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.explanation().size() > 0) {
-    explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.explanation(),
-      GetArenaNoVirtual());
+  : ::PROTOBUF_NAMESPACE_ID::Message() {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  explanation_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    explanation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_explanation().empty()) {
+    explanation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_explanation(),
+      GetArenaForAllocation());
   }
   version_ = from.version_;
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.OpDeprecation)
 }
 
-void OpDeprecation::SharedCtor() {
-  explanation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  version_ = 0;
-  _cached_size_ = 0;
+inline void OpDeprecation::SharedCtor() {
+explanation_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  explanation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+version_ = 0;
 }
 
 OpDeprecation::~OpDeprecation() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.OpDeprecation)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void OpDeprecation::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  explanation_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void OpDeprecation::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  explanation_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void OpDeprecation::ArenaDtor(void* object) {
   OpDeprecation* _this = reinterpret_cast< OpDeprecation* >(object);
   (void)_this;
 }
-void OpDeprecation::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void OpDeprecation::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void OpDeprecation::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* OpDeprecation::descriptor() {
-  ::protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const OpDeprecation& OpDeprecation::default_instance() {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpDeprecation();
-  return *internal_default_instance();
-}
-
-OpDeprecation* OpDeprecation::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<OpDeprecation>(arena);
+  _cached_size_.Set(size);
 }
 
 void OpDeprecation::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.OpDeprecation)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  explanation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  explanation_.ClearToEmpty();
   version_ = 0;
-  _internal_metadata_.Clear();
-}
-
-bool OpDeprecation::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:opencv_tensorflow.OpDeprecation)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* OpDeprecation::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // int32 version = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &version_)));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string explanation = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_explanation()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->explanation().data(), static_cast<int>(this->explanation().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.OpDeprecation.explanation"));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_explanation();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.OpDeprecation.explanation"));
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.OpDeprecation)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.OpDeprecation)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void OpDeprecation::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.OpDeprecation)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int32 version = 1;
-  if (this->version() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->version(), output);
-  }
-
-  // string explanation = 2;
-  if (this->explanation().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->explanation().data(), static_cast<int>(this->explanation().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.OpDeprecation.explanation");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->explanation(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.OpDeprecation)
-}
-
-::google::protobuf::uint8* OpDeprecation::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* OpDeprecation::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.OpDeprecation)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // int32 version = 1;
-  if (this->version() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->version(), target);
+  if (this->_internal_version() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_version(), target);
   }
 
   // string explanation = 2;
-  if (this->explanation().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->explanation().data(), static_cast<int>(this->explanation().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_explanation().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_explanation().data(), static_cast<int>(this->_internal_explanation().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.OpDeprecation.explanation");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->explanation(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_explanation(), target);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.OpDeprecation)
   return target;
@@ -2459,67 +1842,51 @@ size_t OpDeprecation::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.OpDeprecation)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // string explanation = 2;
-  if (this->explanation().size() > 0) {
+  if (!this->_internal_explanation().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->explanation());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_explanation());
   }
 
   // int32 version = 1;
-  if (this->version() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->version());
+  if (this->_internal_version() != 0) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_version());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void OpDeprecation::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.OpDeprecation)
-  GOOGLE_DCHECK_NE(&from, this);
-  const OpDeprecation* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const OpDeprecation>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.OpDeprecation)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.OpDeprecation)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData OpDeprecation::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    OpDeprecation::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*OpDeprecation::GetClassData() const { return &_class_data_; }
+
+void OpDeprecation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<OpDeprecation *>(to)->MergeFrom(
+      static_cast<const OpDeprecation &>(from));
 }
 
+
 void OpDeprecation::MergeFrom(const OpDeprecation& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.OpDeprecation)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.explanation().size() > 0) {
-    set_explanation(from.explanation());
+  if (!from._internal_explanation().empty()) {
+    _internal_set_explanation(from._internal_explanation());
   }
-  if (from.version() != 0) {
-    set_version(from.version());
+  if (from._internal_version() != 0) {
+    _internal_set_version(from._internal_version());
   }
-}
-
-void OpDeprecation::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.OpDeprecation)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void OpDeprecation::CopyFrom(const OpDeprecation& from) {
@@ -2533,200 +1900,141 @@ bool OpDeprecation::IsInitialized() const {
   return true;
 }
 
-void OpDeprecation::Swap(OpDeprecation* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    OpDeprecation* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void OpDeprecation::UnsafeArenaSwap(OpDeprecation* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void OpDeprecation::InternalSwap(OpDeprecation* other) {
   using std::swap;
-  explanation_.Swap(&other->explanation_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &explanation_, lhs_arena,
+      &other->explanation_, rhs_arena
+  );
   swap(version_, other->version_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata OpDeprecation::GetMetadata() const {
-  protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata OpDeprecation::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_op_5fdef_2eproto_getter, &descriptor_table_op_5fdef_2eproto_once,
+      file_level_metadata_op_5fdef_2eproto[3]);
 }
 
-
 // ===================================================================
 
-void OpList::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int OpList::kOpFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class OpList::_Internal {
+ public:
+};
 
-OpList::OpList()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_op_5fdef_2eproto::InitDefaultsOpList();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.OpList)
-}
-OpList::OpList(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+OpList::OpList(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   op_(arena) {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpList();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.OpList)
 }
 OpList::OpList(const OpList& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      op_(from.op_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      op_(from.op_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.OpList)
 }
 
-void OpList::SharedCtor() {
-  _cached_size_ = 0;
+inline void OpList::SharedCtor() {
 }
 
 OpList::~OpList() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.OpList)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void OpList::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void OpList::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void OpList::ArenaDtor(void* object) {
   OpList* _this = reinterpret_cast< OpList* >(object);
   (void)_this;
 }
-void OpList::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void OpList::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void OpList::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* OpList::descriptor() {
-  ::protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const OpList& OpList::default_instance() {
-  ::protobuf_op_5fdef_2eproto::InitDefaultsOpList();
-  return *internal_default_instance();
-}
-
-OpList* OpList::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<OpList>(arena);
+  _cached_size_.Set(size);
 }
 
 void OpList::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.OpList)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   op_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool OpList::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:opencv_tensorflow.OpList)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* OpList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .opencv_tensorflow.OpDef op = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_op()));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_op(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.OpList)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.OpList)
-  return false;
-#undef DO_
-}
-
-void OpList::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.OpList)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_tensorflow.OpDef op = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->op_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, this->op(static_cast<int>(i)), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.OpList)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* OpList::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* OpList::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.OpList)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .opencv_tensorflow.OpDef op = 1;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->op_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, this->op(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_op_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(1, this->_internal_op(i), target, stream);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.OpList)
   return target;
@@ -2736,59 +2044,41 @@ size_t OpList::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.OpList)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_tensorflow.OpDef op = 1;
-  {
-    unsigned int count = static_cast<unsigned int>(this->op_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->op(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_op_size();
+  for (const auto& msg : this->op_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void OpList::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.OpList)
-  GOOGLE_DCHECK_NE(&from, this);
-  const OpList* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const OpList>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.OpList)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.OpList)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData OpList::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    OpList::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*OpList::GetClassData() const { return &_class_data_; }
+
+void OpList::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<OpList *>(to)->MergeFrom(
+      static_cast<const OpList &>(from));
 }
 
+
 void OpList::MergeFrom(const OpList& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.OpList)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   op_.MergeFrom(from.op_);
-}
-
-void OpList::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.OpList)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void OpList::CopyFrom(const OpList& from) {
@@ -2802,39 +2092,37 @@ bool OpList::IsInitialized() const {
   return true;
 }
 
-void OpList::Swap(OpList* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    OpList* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void OpList::UnsafeArenaSwap(OpList* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void OpList::InternalSwap(OpList* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   op_.InternalSwap(&other->op_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata OpList::GetMetadata() const {
-  protobuf_op_5fdef_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_op_5fdef_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata OpList::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_op_5fdef_2eproto_getter, &descriptor_table_op_5fdef_2eproto_once,
+      file_level_metadata_op_5fdef_2eproto[4]);
 }
 
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::OpDef_ArgDef* Arena::CreateMaybeMessage< ::opencv_tensorflow::OpDef_ArgDef >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::OpDef_ArgDef >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::OpDef_AttrDef* Arena::CreateMaybeMessage< ::opencv_tensorflow::OpDef_AttrDef >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::OpDef_AttrDef >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::OpDef* Arena::CreateMaybeMessage< ::opencv_tensorflow::OpDef >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::OpDef >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::OpDeprecation* Arena::CreateMaybeMessage< ::opencv_tensorflow::OpDeprecation >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::OpDeprecation >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::OpList* Arena::CreateMaybeMessage< ::opencv_tensorflow::OpList >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::OpList >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index a69c6ad..59a67ad 100644 (file)
@@ -1,30 +1,32 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: op_def.proto
 
-#ifndef PROTOBUF_op_5fdef_2eproto__INCLUDED
-#define PROTOBUF_op_5fdef_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_op_5fdef_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_op_5fdef_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include "attr_value.pb.h"
 #include "types.pb.h"
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_op_5fdef_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_op_5fdef_2eproto {
 // Internal implementation detail -- do not use these members.
-struct 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[];
+struct TableStruct_op_5fdef_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[5]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsOpDef_ArgDefImpl();
-void InitDefaultsOpDef_ArgDef();
-void InitDefaultsOpDef_AttrDefImpl();
-void InitDefaultsOpDef_AttrDef();
-void InitDefaultsOpDefImpl();
-void InitDefaultsOpDef();
-void InitDefaultsOpDeprecationImpl();
-void InitDefaultsOpDeprecation();
-void InitDefaultsOpListImpl();
-void InitDefaultsOpList();
-inline void InitDefaults() {
-  InitDefaultsOpDef_ArgDef();
-  InitDefaultsOpDef_AttrDef();
-  InitDefaultsOpDef();
-  InitDefaultsOpDeprecation();
-  InitDefaultsOpList();
-}
-}  // namespace protobuf_op_5fdef_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_op_5fdef_2eproto;
 namespace opencv_tensorflow {
 class OpDef;
-class OpDefDefaultTypeInternal;
+struct OpDefDefaultTypeInternal;
 extern OpDefDefaultTypeInternal _OpDef_default_instance_;
 class OpDef_ArgDef;
-class OpDef_ArgDefDefaultTypeInternal;
+struct OpDef_ArgDefDefaultTypeInternal;
 extern OpDef_ArgDefDefaultTypeInternal _OpDef_ArgDef_default_instance_;
 class OpDef_AttrDef;
-class OpDef_AttrDefDefaultTypeInternal;
+struct OpDef_AttrDefDefaultTypeInternal;
 extern OpDef_AttrDefDefaultTypeInternal _OpDef_AttrDef_default_instance_;
 class OpDeprecation;
-class OpDeprecationDefaultTypeInternal;
+struct OpDeprecationDefaultTypeInternal;
 extern OpDeprecationDefaultTypeInternal _OpDeprecation_default_instance_;
 class OpList;
-class OpListDefaultTypeInternal;
+struct OpListDefaultTypeInternal;
 extern OpListDefaultTypeInternal _OpList_default_instance_;
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_tensorflow::OpDef* Arena::CreateMaybeMessage<::opencv_tensorflow::OpDef>(Arena*);
+template<> ::opencv_tensorflow::OpDef_ArgDef* Arena::CreateMaybeMessage<::opencv_tensorflow::OpDef_ArgDef>(Arena*);
+template<> ::opencv_tensorflow::OpDef_AttrDef* Arena::CreateMaybeMessage<::opencv_tensorflow::OpDef_AttrDef>(Arena*);
+template<> ::opencv_tensorflow::OpDeprecation* Arena::CreateMaybeMessage<::opencv_tensorflow::OpDeprecation>(Arena*);
+template<> ::opencv_tensorflow::OpList* Arena::CreateMaybeMessage<::opencv_tensorflow::OpList>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-class OpDef_ArgDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpDef.ArgDef) */ {
+class OpDef_ArgDef final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpDef.ArgDef) */ {
  public:
-  OpDef_ArgDef();
-  virtual ~OpDef_ArgDef();
+  inline OpDef_ArgDef() : OpDef_ArgDef(nullptr) {}
+  ~OpDef_ArgDef() override;
+  explicit constexpr OpDef_ArgDef(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   OpDef_ArgDef(const OpDef_ArgDef& from);
-
-  inline OpDef_ArgDef& operator=(const OpDef_ArgDef& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   OpDef_ArgDef(OpDef_ArgDef&& from) noexcept
     : OpDef_ArgDef() {
     *this = ::std::move(from);
   }
 
+  inline OpDef_ArgDef& operator=(const OpDef_ArgDef& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline OpDef_ArgDef& operator=(OpDef_ArgDef&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const OpDef_ArgDef& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const OpDef_ArgDef& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const OpDef_ArgDef* internal_default_instance() {
     return reinterpret_cast<const OpDef_ArgDef*>(
                &_OpDef_ArgDef_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void UnsafeArenaSwap(OpDef_ArgDef* other);
-  void Swap(OpDef_ArgDef* other);
   friend void swap(OpDef_ArgDef& a, OpDef_ArgDef& b) {
     a.Swap(&b);
   }
+  inline void Swap(OpDef_ArgDef* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(OpDef_ArgDef* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline OpDef_ArgDef* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  OpDef_ArgDef* 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;
+  OpDef_ArgDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<OpDef_ArgDef>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const OpDef_ArgDef& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const OpDef_ArgDef& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(OpDef_ArgDef* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.OpDef.ArgDef";
+  }
   protected:
-  explicit OpDef_ArgDef(::google::protobuf::Arena* arena);
+  explicit OpDef_ArgDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 1,
+    kDescriptionFieldNumber = 2,
+    kTypeAttrFieldNumber = 4,
+    kNumberAttrFieldNumber = 5,
+    kTypeListAttrFieldNumber = 6,
+    kTypeFieldNumber = 3,
+    kIsRefFieldNumber = 16,
+  };
   // string name = 1;
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // string description = 2;
   void clear_description();
-  static const int kDescriptionFieldNumber = 2;
-  const ::std::string& description() const;
-  void set_description(const ::std::string& value);
-  #if LANG_CXX11
-  void set_description(::std::string&& value);
-  #endif
-  void set_description(const char* value);
-  void set_description(const char* value, size_t size);
-  ::std::string* mutable_description();
-  ::std::string* release_description();
-  void set_allocated_description(::std::string* description);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_description();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_description(
-      ::std::string* description);
+  const std::string& description() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_description(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_description();
+  PROTOBUF_NODISCARD std::string* release_description();
+  void set_allocated_description(std::string* description);
+  private:
+  const std::string& _internal_description() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_description(const std::string& value);
+  std::string* _internal_mutable_description();
+  public:
 
   // string type_attr = 4;
   void clear_type_attr();
-  static const int kTypeAttrFieldNumber = 4;
-  const ::std::string& type_attr() const;
-  void set_type_attr(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type_attr(::std::string&& value);
-  #endif
-  void set_type_attr(const char* value);
-  void set_type_attr(const char* value, size_t size);
-  ::std::string* mutable_type_attr();
-  ::std::string* release_type_attr();
-  void set_allocated_type_attr(::std::string* type_attr);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_type_attr();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_type_attr(
-      ::std::string* type_attr);
+  const std::string& type_attr() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_type_attr(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_type_attr();
+  PROTOBUF_NODISCARD std::string* release_type_attr();
+  void set_allocated_type_attr(std::string* type_attr);
+  private:
+  const std::string& _internal_type_attr() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_type_attr(const std::string& value);
+  std::string* _internal_mutable_type_attr();
+  public:
 
   // string number_attr = 5;
   void clear_number_attr();
-  static const int kNumberAttrFieldNumber = 5;
-  const ::std::string& number_attr() const;
-  void set_number_attr(const ::std::string& value);
-  #if LANG_CXX11
-  void set_number_attr(::std::string&& value);
-  #endif
-  void set_number_attr(const char* value);
-  void set_number_attr(const char* value, size_t size);
-  ::std::string* mutable_number_attr();
-  ::std::string* release_number_attr();
-  void set_allocated_number_attr(::std::string* number_attr);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_number_attr();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_number_attr(
-      ::std::string* number_attr);
+  const std::string& number_attr() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_number_attr(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_number_attr();
+  PROTOBUF_NODISCARD std::string* release_number_attr();
+  void set_allocated_number_attr(std::string* number_attr);
+  private:
+  const std::string& _internal_number_attr() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_number_attr(const std::string& value);
+  std::string* _internal_mutable_number_attr();
+  public:
 
   // string type_list_attr = 6;
   void clear_type_list_attr();
-  static const int kTypeListAttrFieldNumber = 6;
-  const ::std::string& type_list_attr() const;
-  void set_type_list_attr(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type_list_attr(::std::string&& value);
-  #endif
-  void set_type_list_attr(const char* value);
-  void set_type_list_attr(const char* value, size_t size);
-  ::std::string* mutable_type_list_attr();
-  ::std::string* release_type_list_attr();
-  void set_allocated_type_list_attr(::std::string* type_list_attr);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_type_list_attr();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_type_list_attr(
-      ::std::string* type_list_attr);
+  const std::string& type_list_attr() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_type_list_attr(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_type_list_attr();
+  PROTOBUF_NODISCARD std::string* release_type_list_attr();
+  void set_allocated_type_list_attr(std::string* type_list_attr);
+  private:
+  const std::string& _internal_type_list_attr() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_type_list_attr(const std::string& value);
+  std::string* _internal_mutable_type_list_attr();
+  public:
 
   // .opencv_tensorflow.DataType type = 3;
   void clear_type();
-  static const int kTypeFieldNumber = 3;
   ::opencv_tensorflow::DataType type() const;
   void set_type(::opencv_tensorflow::DataType value);
+  private:
+  ::opencv_tensorflow::DataType _internal_type() const;
+  void _internal_set_type(::opencv_tensorflow::DataType value);
+  public:
 
   // bool is_ref = 16;
   void clear_is_ref();
-  static const int kIsRefFieldNumber = 16;
   bool is_ref() const;
   void set_is_ref(bool value);
+  private:
+  bool _internal_is_ref() const;
+  void _internal_set_is_ref(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.OpDef.ArgDef)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr description_;
-  ::google::protobuf::internal::ArenaStringPtr type_attr_;
-  ::google::protobuf::internal::ArenaStringPtr number_attr_;
-  ::google::protobuf::internal::ArenaStringPtr type_list_attr_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr description_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_attr_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr number_attr_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_list_attr_;
   int type_;
   bool is_ref_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_op_5fdef_2eproto::TableStruct;
-  friend void ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef_ArgDefImpl();
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_op_5fdef_2eproto;
 };
 // -------------------------------------------------------------------
 
-class OpDef_AttrDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpDef.AttrDef) */ {
+class OpDef_AttrDef final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpDef.AttrDef) */ {
  public:
-  OpDef_AttrDef();
-  virtual ~OpDef_AttrDef();
+  inline OpDef_AttrDef() : OpDef_AttrDef(nullptr) {}
+  ~OpDef_AttrDef() override;
+  explicit constexpr OpDef_AttrDef(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   OpDef_AttrDef(const OpDef_AttrDef& from);
-
-  inline OpDef_AttrDef& operator=(const OpDef_AttrDef& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   OpDef_AttrDef(OpDef_AttrDef&& from) noexcept
     : OpDef_AttrDef() {
     *this = ::std::move(from);
   }
 
+  inline OpDef_AttrDef& operator=(const OpDef_AttrDef& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline OpDef_AttrDef& operator=(OpDef_AttrDef&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const OpDef_AttrDef& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const OpDef_AttrDef& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const OpDef_AttrDef* internal_default_instance() {
     return reinterpret_cast<const OpDef_AttrDef*>(
                &_OpDef_AttrDef_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     1;
 
-  void UnsafeArenaSwap(OpDef_AttrDef* other);
-  void Swap(OpDef_AttrDef* other);
   friend void swap(OpDef_AttrDef& a, OpDef_AttrDef& b) {
     a.Swap(&b);
   }
+  inline void Swap(OpDef_AttrDef* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(OpDef_AttrDef* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline OpDef_AttrDef* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  OpDef_AttrDef* 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;
+  OpDef_AttrDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<OpDef_AttrDef>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const OpDef_AttrDef& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const OpDef_AttrDef& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(OpDef_AttrDef* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.OpDef.AttrDef";
+  }
   protected:
-  explicit OpDef_AttrDef(::google::protobuf::Arena* arena);
+  explicit OpDef_AttrDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 1,
+    kTypeFieldNumber = 2,
+    kDescriptionFieldNumber = 4,
+    kDefaultValueFieldNumber = 3,
+    kAllowedValuesFieldNumber = 7,
+    kMinimumFieldNumber = 6,
+    kHasMinimumFieldNumber = 5,
+  };
   // string name = 1;
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // string type = 2;
   void clear_type();
-  static const int kTypeFieldNumber = 2;
-  const ::std::string& type() const;
-  void set_type(const ::std::string& value);
-  #if LANG_CXX11
-  void set_type(::std::string&& value);
-  #endif
-  void set_type(const char* value);
-  void set_type(const char* value, size_t size);
-  ::std::string* mutable_type();
-  ::std::string* release_type();
-  void set_allocated_type(::std::string* type);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_type();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_type(
-      ::std::string* type);
+  const std::string& type() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_type(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_type();
+  PROTOBUF_NODISCARD std::string* release_type();
+  void set_allocated_type(std::string* type);
+  private:
+  const std::string& _internal_type() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_type(const std::string& value);
+  std::string* _internal_mutable_type();
+  public:
 
   // string description = 4;
   void clear_description();
-  static const int kDescriptionFieldNumber = 4;
-  const ::std::string& description() const;
-  void set_description(const ::std::string& value);
-  #if LANG_CXX11
-  void set_description(::std::string&& value);
-  #endif
-  void set_description(const char* value);
-  void set_description(const char* value, size_t size);
-  ::std::string* mutable_description();
-  ::std::string* release_description();
-  void set_allocated_description(::std::string* description);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_description();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_description(
-      ::std::string* description);
+  const std::string& description() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_description(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_description();
+  PROTOBUF_NODISCARD std::string* release_description();
+  void set_allocated_description(std::string* description);
+  private:
+  const std::string& _internal_description() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_description(const std::string& value);
+  std::string* _internal_mutable_description();
+  public:
 
   // .opencv_tensorflow.AttrValue default_value = 3;
   bool has_default_value() const;
-  void clear_default_value();
-  static const int kDefaultValueFieldNumber = 3;
   private:
-  void _slow_mutable_default_value();
+  bool _internal_has_default_value() const;
   public:
+  void clear_default_value();
   const ::opencv_tensorflow::AttrValue& default_value() const;
-  ::opencv_tensorflow::AttrValue* release_default_value();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::AttrValue* release_default_value();
   ::opencv_tensorflow::AttrValue* mutable_default_value();
   void set_allocated_default_value(::opencv_tensorflow::AttrValue* default_value);
+  private:
+  const ::opencv_tensorflow::AttrValue& _internal_default_value() const;
+  ::opencv_tensorflow::AttrValue* _internal_mutable_default_value();
+  public:
   void unsafe_arena_set_allocated_default_value(
       ::opencv_tensorflow::AttrValue* default_value);
   ::opencv_tensorflow::AttrValue* unsafe_arena_release_default_value();
 
   // .opencv_tensorflow.AttrValue allowed_values = 7;
   bool has_allowed_values() const;
-  void clear_allowed_values();
-  static const int kAllowedValuesFieldNumber = 7;
   private:
-  void _slow_mutable_allowed_values();
+  bool _internal_has_allowed_values() const;
   public:
+  void clear_allowed_values();
   const ::opencv_tensorflow::AttrValue& allowed_values() const;
-  ::opencv_tensorflow::AttrValue* release_allowed_values();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::AttrValue* release_allowed_values();
   ::opencv_tensorflow::AttrValue* mutable_allowed_values();
   void set_allocated_allowed_values(::opencv_tensorflow::AttrValue* allowed_values);
+  private:
+  const ::opencv_tensorflow::AttrValue& _internal_allowed_values() const;
+  ::opencv_tensorflow::AttrValue* _internal_mutable_allowed_values();
+  public:
   void unsafe_arena_set_allocated_allowed_values(
       ::opencv_tensorflow::AttrValue* allowed_values);
   ::opencv_tensorflow::AttrValue* unsafe_arena_release_allowed_values();
 
   // int64 minimum = 6;
   void clear_minimum();
-  static const int kMinimumFieldNumber = 6;
-  ::google::protobuf::int64 minimum() const;
-  void set_minimum(::google::protobuf::int64 value);
+  int64_t minimum() const;
+  void set_minimum(int64_t value);
+  private:
+  int64_t _internal_minimum() const;
+  void _internal_set_minimum(int64_t value);
+  public:
 
   // bool has_minimum = 5;
   void clear_has_minimum();
-  static const int kHasMinimumFieldNumber = 5;
   bool has_minimum() const;
   void set_has_minimum(bool value);
+  private:
+  bool _internal_has_minimum() const;
+  void _internal_set_has_minimum(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.OpDef.AttrDef)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr type_;
-  ::google::protobuf::internal::ArenaStringPtr description_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr description_;
   ::opencv_tensorflow::AttrValue* default_value_;
   ::opencv_tensorflow::AttrValue* allowed_values_;
-  ::google::protobuf::int64 minimum_;
+  int64_t minimum_;
   bool has_minimum_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_op_5fdef_2eproto::TableStruct;
-  friend void ::protobuf_op_5fdef_2eproto::InitDefaultsOpDef_AttrDefImpl();
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_op_5fdef_2eproto;
 };
 // -------------------------------------------------------------------
 
-class OpDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpDef) */ {
+class OpDef final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpDef) */ {
  public:
-  OpDef();
-  virtual ~OpDef();
+  inline OpDef() : OpDef(nullptr) {}
+  ~OpDef() override;
+  explicit constexpr OpDef(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   OpDef(const OpDef& from);
-
-  inline OpDef& operator=(const OpDef& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   OpDef(OpDef&& from) noexcept
     : OpDef() {
     *this = ::std::move(from);
   }
 
+  inline OpDef& operator=(const OpDef& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline OpDef& operator=(OpDef&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const OpDef& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const OpDef& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const OpDef* internal_default_instance() {
     return reinterpret_cast<const OpDef*>(
                &_OpDef_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     2;
 
-  void UnsafeArenaSwap(OpDef* other);
-  void Swap(OpDef* other);
   friend void swap(OpDef& a, OpDef& b) {
     a.Swap(&b);
   }
+  inline void Swap(OpDef* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(OpDef* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline OpDef* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  OpDef* 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;
+  OpDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<OpDef>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const OpDef& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const OpDef& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(OpDef* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.OpDef";
+  }
   protected:
-  explicit OpDef(::google::protobuf::Arena* arena);
+  explicit OpDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -646,429 +689,506 @@ class OpDef : public ::google::protobuf::Message /* @@protoc_insertion_point(cla
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kInputArgFieldNumber = 2,
+    kOutputArgFieldNumber = 3,
+    kAttrFieldNumber = 4,
+    kNameFieldNumber = 1,
+    kSummaryFieldNumber = 5,
+    kDescriptionFieldNumber = 6,
+    kDeprecationFieldNumber = 8,
+    kIsCommutativeFieldNumber = 18,
+    kIsAggregateFieldNumber = 16,
+    kIsStatefulFieldNumber = 17,
+    kAllowsUninitializedInputFieldNumber = 19,
+  };
   // repeated .opencv_tensorflow.OpDef.ArgDef input_arg = 2;
   int input_arg_size() const;
+  private:
+  int _internal_input_arg_size() const;
+  public:
   void clear_input_arg();
-  static const int kInputArgFieldNumber = 2;
-  const ::opencv_tensorflow::OpDef_ArgDef& input_arg(int index) const;
   ::opencv_tensorflow::OpDef_ArgDef* mutable_input_arg(int index);
-  ::opencv_tensorflow::OpDef_ArgDef* add_input_arg();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >*
       mutable_input_arg();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >&
+  private:
+  const ::opencv_tensorflow::OpDef_ArgDef& _internal_input_arg(int index) const;
+  ::opencv_tensorflow::OpDef_ArgDef* _internal_add_input_arg();
+  public:
+  const ::opencv_tensorflow::OpDef_ArgDef& input_arg(int index) const;
+  ::opencv_tensorflow::OpDef_ArgDef* add_input_arg();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >&
       input_arg() const;
 
   // repeated .opencv_tensorflow.OpDef.ArgDef output_arg = 3;
   int output_arg_size() const;
+  private:
+  int _internal_output_arg_size() const;
+  public:
   void clear_output_arg();
-  static const int kOutputArgFieldNumber = 3;
-  const ::opencv_tensorflow::OpDef_ArgDef& output_arg(int index) const;
   ::opencv_tensorflow::OpDef_ArgDef* mutable_output_arg(int index);
-  ::opencv_tensorflow::OpDef_ArgDef* add_output_arg();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >*
       mutable_output_arg();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >&
+  private:
+  const ::opencv_tensorflow::OpDef_ArgDef& _internal_output_arg(int index) const;
+  ::opencv_tensorflow::OpDef_ArgDef* _internal_add_output_arg();
+  public:
+  const ::opencv_tensorflow::OpDef_ArgDef& output_arg(int index) const;
+  ::opencv_tensorflow::OpDef_ArgDef* add_output_arg();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >&
       output_arg() const;
 
   // repeated .opencv_tensorflow.OpDef.AttrDef attr = 4;
   int attr_size() const;
+  private:
+  int _internal_attr_size() const;
+  public:
   void clear_attr();
-  static const int kAttrFieldNumber = 4;
-  const ::opencv_tensorflow::OpDef_AttrDef& attr(int index) const;
   ::opencv_tensorflow::OpDef_AttrDef* mutable_attr(int index);
-  ::opencv_tensorflow::OpDef_AttrDef* add_attr();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef >*
       mutable_attr();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef >&
+  private:
+  const ::opencv_tensorflow::OpDef_AttrDef& _internal_attr(int index) const;
+  ::opencv_tensorflow::OpDef_AttrDef* _internal_add_attr();
+  public:
+  const ::opencv_tensorflow::OpDef_AttrDef& attr(int index) const;
+  ::opencv_tensorflow::OpDef_AttrDef* add_attr();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef >&
       attr() const;
 
   // string name = 1;
   void clear_name();
-  static const int kNameFieldNumber = 1;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // string summary = 5;
   void clear_summary();
-  static const int kSummaryFieldNumber = 5;
-  const ::std::string& summary() const;
-  void set_summary(const ::std::string& value);
-  #if LANG_CXX11
-  void set_summary(::std::string&& value);
-  #endif
-  void set_summary(const char* value);
-  void set_summary(const char* value, size_t size);
-  ::std::string* mutable_summary();
-  ::std::string* release_summary();
-  void set_allocated_summary(::std::string* summary);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_summary();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_summary(
-      ::std::string* summary);
+  const std::string& summary() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_summary(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_summary();
+  PROTOBUF_NODISCARD std::string* release_summary();
+  void set_allocated_summary(std::string* summary);
+  private:
+  const std::string& _internal_summary() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_summary(const std::string& value);
+  std::string* _internal_mutable_summary();
+  public:
 
   // string description = 6;
   void clear_description();
-  static const int kDescriptionFieldNumber = 6;
-  const ::std::string& description() const;
-  void set_description(const ::std::string& value);
-  #if LANG_CXX11
-  void set_description(::std::string&& value);
-  #endif
-  void set_description(const char* value);
-  void set_description(const char* value, size_t size);
-  ::std::string* mutable_description();
-  ::std::string* release_description();
-  void set_allocated_description(::std::string* description);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_description();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_description(
-      ::std::string* description);
+  const std::string& description() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_description(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_description();
+  PROTOBUF_NODISCARD std::string* release_description();
+  void set_allocated_description(std::string* description);
+  private:
+  const std::string& _internal_description() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_description(const std::string& value);
+  std::string* _internal_mutable_description();
+  public:
 
   // .opencv_tensorflow.OpDeprecation deprecation = 8;
   bool has_deprecation() const;
-  void clear_deprecation();
-  static const int kDeprecationFieldNumber = 8;
   private:
-  void _slow_mutable_deprecation();
+  bool _internal_has_deprecation() const;
   public:
+  void clear_deprecation();
   const ::opencv_tensorflow::OpDeprecation& deprecation() const;
-  ::opencv_tensorflow::OpDeprecation* release_deprecation();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::OpDeprecation* release_deprecation();
   ::opencv_tensorflow::OpDeprecation* mutable_deprecation();
   void set_allocated_deprecation(::opencv_tensorflow::OpDeprecation* deprecation);
+  private:
+  const ::opencv_tensorflow::OpDeprecation& _internal_deprecation() const;
+  ::opencv_tensorflow::OpDeprecation* _internal_mutable_deprecation();
+  public:
   void unsafe_arena_set_allocated_deprecation(
       ::opencv_tensorflow::OpDeprecation* deprecation);
   ::opencv_tensorflow::OpDeprecation* unsafe_arena_release_deprecation();
 
   // bool is_commutative = 18;
   void clear_is_commutative();
-  static const int kIsCommutativeFieldNumber = 18;
   bool is_commutative() const;
   void set_is_commutative(bool value);
+  private:
+  bool _internal_is_commutative() const;
+  void _internal_set_is_commutative(bool value);
+  public:
 
   // bool is_aggregate = 16;
   void clear_is_aggregate();
-  static const int kIsAggregateFieldNumber = 16;
   bool is_aggregate() const;
   void set_is_aggregate(bool value);
+  private:
+  bool _internal_is_aggregate() const;
+  void _internal_set_is_aggregate(bool value);
+  public:
 
   // bool is_stateful = 17;
   void clear_is_stateful();
-  static const int kIsStatefulFieldNumber = 17;
   bool is_stateful() const;
   void set_is_stateful(bool value);
+  private:
+  bool _internal_is_stateful() const;
+  void _internal_set_is_stateful(bool value);
+  public:
 
   // bool allows_uninitialized_input = 19;
   void clear_allows_uninitialized_input();
-  static const int kAllowsUninitializedInputFieldNumber = 19;
   bool allows_uninitialized_input() const;
   void set_allows_uninitialized_input(bool value);
+  private:
+  bool _internal_allows_uninitialized_input() const;
+  void _internal_set_allows_uninitialized_input(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.OpDef)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef > input_arg_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef > output_arg_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef > attr_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::internal::ArenaStringPtr summary_;
-  ::google::protobuf::internal::ArenaStringPtr description_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef > input_arg_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef > output_arg_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef > attr_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr summary_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr description_;
   ::opencv_tensorflow::OpDeprecation* deprecation_;
   bool is_commutative_;
   bool is_aggregate_;
   bool is_stateful_;
   bool allows_uninitialized_input_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_op_5fdef_2eproto::TableStruct;
-  friend void ::protobuf_op_5fdef_2eproto::InitDefaultsOpDefImpl();
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_op_5fdef_2eproto;
 };
 // -------------------------------------------------------------------
 
-class OpDeprecation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpDeprecation) */ {
+class OpDeprecation final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpDeprecation) */ {
  public:
-  OpDeprecation();
-  virtual ~OpDeprecation();
+  inline OpDeprecation() : OpDeprecation(nullptr) {}
+  ~OpDeprecation() override;
+  explicit constexpr OpDeprecation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   OpDeprecation(const OpDeprecation& from);
-
-  inline OpDeprecation& operator=(const OpDeprecation& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   OpDeprecation(OpDeprecation&& from) noexcept
     : OpDeprecation() {
     *this = ::std::move(from);
   }
 
+  inline OpDeprecation& operator=(const OpDeprecation& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline OpDeprecation& operator=(OpDeprecation&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const OpDeprecation& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const OpDeprecation& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const OpDeprecation* internal_default_instance() {
     return reinterpret_cast<const OpDeprecation*>(
                &_OpDeprecation_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     3;
 
-  void UnsafeArenaSwap(OpDeprecation* other);
-  void Swap(OpDeprecation* other);
   friend void swap(OpDeprecation& a, OpDeprecation& b) {
     a.Swap(&b);
   }
+  inline void Swap(OpDeprecation* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(OpDeprecation* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline OpDeprecation* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  OpDeprecation* 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;
+  OpDeprecation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<OpDeprecation>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const OpDeprecation& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const OpDeprecation& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(OpDeprecation* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.OpDeprecation";
+  }
   protected:
-  explicit OpDeprecation(::google::protobuf::Arena* arena);
+  explicit OpDeprecation(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kExplanationFieldNumber = 2,
+    kVersionFieldNumber = 1,
+  };
   // string explanation = 2;
   void clear_explanation();
-  static const int kExplanationFieldNumber = 2;
-  const ::std::string& explanation() const;
-  void set_explanation(const ::std::string& value);
-  #if LANG_CXX11
-  void set_explanation(::std::string&& value);
-  #endif
-  void set_explanation(const char* value);
-  void set_explanation(const char* value, size_t size);
-  ::std::string* mutable_explanation();
-  ::std::string* release_explanation();
-  void set_allocated_explanation(::std::string* explanation);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_explanation();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_explanation(
-      ::std::string* explanation);
+  const std::string& explanation() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_explanation(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_explanation();
+  PROTOBUF_NODISCARD std::string* release_explanation();
+  void set_allocated_explanation(std::string* explanation);
+  private:
+  const std::string& _internal_explanation() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_explanation(const std::string& value);
+  std::string* _internal_mutable_explanation();
+  public:
 
   // int32 version = 1;
   void clear_version();
-  static const int kVersionFieldNumber = 1;
-  ::google::protobuf::int32 version() const;
-  void set_version(::google::protobuf::int32 value);
+  int32_t version() const;
+  void set_version(int32_t value);
+  private:
+  int32_t _internal_version() const;
+  void _internal_set_version(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.OpDeprecation)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::internal::ArenaStringPtr explanation_;
-  ::google::protobuf::int32 version_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_op_5fdef_2eproto::TableStruct;
-  friend void ::protobuf_op_5fdef_2eproto::InitDefaultsOpDeprecationImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr explanation_;
+  int32_t version_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_op_5fdef_2eproto;
 };
 // -------------------------------------------------------------------
 
-class OpList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpList) */ {
+class OpList final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.OpList) */ {
  public:
-  OpList();
-  virtual ~OpList();
+  inline OpList() : OpList(nullptr) {}
+  ~OpList() override;
+  explicit constexpr OpList(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   OpList(const OpList& from);
-
-  inline OpList& operator=(const OpList& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   OpList(OpList&& from) noexcept
     : OpList() {
     *this = ::std::move(from);
   }
 
+  inline OpList& operator=(const OpList& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline OpList& operator=(OpList&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const OpList& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const OpList& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const OpList* internal_default_instance() {
     return reinterpret_cast<const OpList*>(
                &_OpList_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     4;
 
-  void UnsafeArenaSwap(OpList* other);
-  void Swap(OpList* other);
   friend void swap(OpList& a, OpList& b) {
     a.Swap(&b);
   }
+  inline void Swap(OpList* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(OpList* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline OpList* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  OpList* 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;
+  OpList* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<OpList>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const OpList& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const OpList& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(OpList* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.OpList";
+  }
   protected:
-  explicit OpList(::google::protobuf::Arena* arena);
+  explicit OpList(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kOpFieldNumber = 1,
+  };
   // repeated .opencv_tensorflow.OpDef op = 1;
   int op_size() const;
+  private:
+  int _internal_op_size() const;
+  public:
   void clear_op();
-  static const int kOpFieldNumber = 1;
-  const ::opencv_tensorflow::OpDef& op(int index) const;
   ::opencv_tensorflow::OpDef* mutable_op(int index);
-  ::opencv_tensorflow::OpDef* add_op();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef >*
       mutable_op();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef >&
+  private:
+  const ::opencv_tensorflow::OpDef& _internal_op(int index) const;
+  ::opencv_tensorflow::OpDef* _internal_add_op();
+  public:
+  const ::opencv_tensorflow::OpDef& op(int index) const;
+  ::opencv_tensorflow::OpDef* add_op();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef >&
       op() const;
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.OpList)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef > op_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_op_5fdef_2eproto::TableStruct;
-  friend void ::protobuf_op_5fdef_2eproto::InitDefaultsOpListImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef > op_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_op_5fdef_2eproto;
 };
 // ===================================================================
 
@@ -1083,404 +1203,296 @@ class OpList : public ::google::protobuf::Message /* @@protoc_insertion_point(cl
 
 // string name = 1;
 inline void OpDef_ArgDef::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  name_.ClearToEmpty();
 }
-inline const ::std::string& OpDef_ArgDef::name() const {
+inline const std::string& OpDef_ArgDef::name() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.ArgDef.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void OpDef_ArgDef::set_name(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef_ArgDef::set_name(ArgT0&& arg0, ArgT... args) {
 
 name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.ArgDef.name)
 }
-#if LANG_CXX11
-inline void OpDef_ArgDef::set_name(::std::string&& value) {
-
-  name_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.ArgDef.name)
+inline std::string* OpDef_ArgDef::mutable_name() {
+  std::string* _s = _internal_mutable_name();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.name)
+  return _s;
 }
-#endif
-inline void OpDef_ArgDef::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:opencv_tensorflow.OpDef.ArgDef.name)
+inline const std::string& OpDef_ArgDef::_internal_name() const {
+  return name_.Get();
 }
-inline void OpDef_ArgDef::set_name(const char* value,
-    size_t size) {
+inline void OpDef_ArgDef::_internal_set_name(const std::string& value) {
 
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.ArgDef.name)
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::mutable_name() {
+inline std::string* OpDef_ArgDef::_internal_mutable_name() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::release_name() {
+inline std::string* OpDef_ArgDef::release_name() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.ArgDef.name)
-
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef_ArgDef::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
+inline void OpDef_ArgDef::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
 
   } else {
 
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.name)
-}
-inline ::std::string* OpDef_ArgDef::unsafe_arena_release_name() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.ArgDef.name)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef_ArgDef::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-
-  } else {
-
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.ArgDef.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.name)
 }
 
 // string description = 2;
 inline void OpDef_ArgDef::clear_description() {
-  description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  description_.ClearToEmpty();
 }
-inline const ::std::string& OpDef_ArgDef::description() const {
+inline const std::string& OpDef_ArgDef::description() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.ArgDef.description)
-  return description_.Get();
+  return _internal_description();
 }
-inline void OpDef_ArgDef::set_description(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef_ArgDef::set_description(ArgT0&& arg0, ArgT... args) {
 
 description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.ArgDef.description)
 }
-#if LANG_CXX11
-inline void OpDef_ArgDef::set_description(::std::string&& value) {
-
-  description_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.ArgDef.description)
+inline std::string* OpDef_ArgDef::mutable_description() {
+  std::string* _s = _internal_mutable_description();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.description)
+  return _s;
 }
-#endif
-inline void OpDef_ArgDef::set_description(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDef.ArgDef.description)
+inline const std::string& OpDef_ArgDef::_internal_description() const {
+  return description_.Get();
 }
-inline void OpDef_ArgDef::set_description(const char* value,
-    size_t size) {
+inline void OpDef_ArgDef::_internal_set_description(const std::string& value) {
 
-  description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.ArgDef.description)
+  description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::mutable_description() {
+inline std::string* OpDef_ArgDef::_internal_mutable_description() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.description)
-  return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return description_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::release_description() {
+inline std::string* OpDef_ArgDef::release_description() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.ArgDef.description)
-
-  return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return description_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef_ArgDef::set_allocated_description(::std::string* description) {
-  if (description != NULL) {
+inline void OpDef_ArgDef::set_allocated_description(std::string* description) {
+  if (description != nullptr) {
 
   } else {
 
   }
-  description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.description)
-}
-inline ::std::string* OpDef_ArgDef::unsafe_arena_release_description() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.ArgDef.description)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef_ArgDef::unsafe_arena_set_allocated_description(
-    ::std::string* description) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (description != NULL) {
-
-  } else {
-
+  description_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), description,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (description_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      description, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.ArgDef.description)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.description)
 }
 
 // .opencv_tensorflow.DataType type = 3;
 inline void OpDef_ArgDef::clear_type() {
   type_ = 0;
 }
+inline ::opencv_tensorflow::DataType OpDef_ArgDef::_internal_type() const {
+  return static_cast< ::opencv_tensorflow::DataType >(type_);
+}
 inline ::opencv_tensorflow::DataType OpDef_ArgDef::type() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.ArgDef.type)
-  return static_cast< ::opencv_tensorflow::DataType >(type_);
+  return _internal_type();
 }
-inline void OpDef_ArgDef::set_type(::opencv_tensorflow::DataType value) {
+inline void OpDef_ArgDef::_internal_set_type(::opencv_tensorflow::DataType value) {
 
   type_ = value;
+}
+inline void OpDef_ArgDef::set_type(::opencv_tensorflow::DataType value) {
+  _internal_set_type(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.ArgDef.type)
 }
 
 // string type_attr = 4;
 inline void OpDef_ArgDef::clear_type_attr() {
-  type_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  type_attr_.ClearToEmpty();
 }
-inline const ::std::string& OpDef_ArgDef::type_attr() const {
+inline const std::string& OpDef_ArgDef::type_attr() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.ArgDef.type_attr)
-  return type_attr_.Get();
+  return _internal_type_attr();
 }
-inline void OpDef_ArgDef::set_type_attr(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef_ArgDef::set_type_attr(ArgT0&& arg0, ArgT... args) {
 
 type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
type_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.ArgDef.type_attr)
 }
-#if LANG_CXX11
-inline void OpDef_ArgDef::set_type_attr(::std::string&& value) {
-
-  type_attr_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.ArgDef.type_attr)
+inline std::string* OpDef_ArgDef::mutable_type_attr() {
+  std::string* _s = _internal_mutable_type_attr();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.type_attr)
+  return _s;
 }
-#endif
-inline void OpDef_ArgDef::set_type_attr(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDef.ArgDef.type_attr)
+inline const std::string& OpDef_ArgDef::_internal_type_attr() const {
+  return type_attr_.Get();
 }
-inline void OpDef_ArgDef::set_type_attr(const char* value,
-    size_t size) {
+inline void OpDef_ArgDef::_internal_set_type_attr(const std::string& value) {
 
-  type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.ArgDef.type_attr)
+  type_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::mutable_type_attr() {
+inline std::string* OpDef_ArgDef::_internal_mutable_type_attr() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.type_attr)
-  return type_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return type_attr_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::release_type_attr() {
+inline std::string* OpDef_ArgDef::release_type_attr() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.ArgDef.type_attr)
-
-  return type_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return type_attr_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef_ArgDef::set_allocated_type_attr(::std::string* type_attr) {
-  if (type_attr != NULL) {
+inline void OpDef_ArgDef::set_allocated_type_attr(std::string* type_attr) {
+  if (type_attr != nullptr) {
 
   } else {
 
   }
-  type_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_attr,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.type_attr)
-}
-inline ::std::string* OpDef_ArgDef::unsafe_arena_release_type_attr() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.ArgDef.type_attr)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return type_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef_ArgDef::unsafe_arena_set_allocated_type_attr(
-    ::std::string* type_attr) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (type_attr != NULL) {
-
-  } else {
-
+  type_attr_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type_attr,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_attr_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  type_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      type_attr, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.ArgDef.type_attr)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.type_attr)
 }
 
 // string number_attr = 5;
 inline void OpDef_ArgDef::clear_number_attr() {
-  number_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  number_attr_.ClearToEmpty();
 }
-inline const ::std::string& OpDef_ArgDef::number_attr() const {
+inline const std::string& OpDef_ArgDef::number_attr() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.ArgDef.number_attr)
-  return number_attr_.Get();
+  return _internal_number_attr();
 }
-inline void OpDef_ArgDef::set_number_attr(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef_ArgDef::set_number_attr(ArgT0&& arg0, ArgT... args) {
 
 number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
number_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.ArgDef.number_attr)
 }
-#if LANG_CXX11
-inline void OpDef_ArgDef::set_number_attr(::std::string&& value) {
-
-  number_attr_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.ArgDef.number_attr)
+inline std::string* OpDef_ArgDef::mutable_number_attr() {
+  std::string* _s = _internal_mutable_number_attr();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.number_attr)
+  return _s;
 }
-#endif
-inline void OpDef_ArgDef::set_number_attr(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDef.ArgDef.number_attr)
+inline const std::string& OpDef_ArgDef::_internal_number_attr() const {
+  return number_attr_.Get();
 }
-inline void OpDef_ArgDef::set_number_attr(const char* value,
-    size_t size) {
+inline void OpDef_ArgDef::_internal_set_number_attr(const std::string& value) {
 
-  number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.ArgDef.number_attr)
+  number_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::mutable_number_attr() {
+inline std::string* OpDef_ArgDef::_internal_mutable_number_attr() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.number_attr)
-  return number_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return number_attr_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::release_number_attr() {
+inline std::string* OpDef_ArgDef::release_number_attr() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.ArgDef.number_attr)
-
-  return number_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return number_attr_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef_ArgDef::set_allocated_number_attr(::std::string* number_attr) {
-  if (number_attr != NULL) {
+inline void OpDef_ArgDef::set_allocated_number_attr(std::string* number_attr) {
+  if (number_attr != nullptr) {
 
   } else {
 
   }
-  number_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), number_attr,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.number_attr)
-}
-inline ::std::string* OpDef_ArgDef::unsafe_arena_release_number_attr() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.ArgDef.number_attr)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return number_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef_ArgDef::unsafe_arena_set_allocated_number_attr(
-    ::std::string* number_attr) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (number_attr != NULL) {
-
-  } else {
-
+  number_attr_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), number_attr,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (number_attr_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    number_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  number_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      number_attr, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.ArgDef.number_attr)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.number_attr)
 }
 
 // string type_list_attr = 6;
 inline void OpDef_ArgDef::clear_type_list_attr() {
-  type_list_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  type_list_attr_.ClearToEmpty();
 }
-inline const ::std::string& OpDef_ArgDef::type_list_attr() const {
+inline const std::string& OpDef_ArgDef::type_list_attr() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
-  return type_list_attr_.Get();
+  return _internal_type_list_attr();
 }
-inline void OpDef_ArgDef::set_type_list_attr(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef_ArgDef::set_type_list_attr(ArgT0&& arg0, ArgT... args) {
 
 type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
type_list_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
 }
-#if LANG_CXX11
-inline void OpDef_ArgDef::set_type_list_attr(::std::string&& value) {
-
-  type_list_attr_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
+inline std::string* OpDef_ArgDef::mutable_type_list_attr() {
+  std::string* _s = _internal_mutable_type_list_attr();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
+  return _s;
 }
-#endif
-inline void OpDef_ArgDef::set_type_list_attr(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
+inline const std::string& OpDef_ArgDef::_internal_type_list_attr() const {
+  return type_list_attr_.Get();
 }
-inline void OpDef_ArgDef::set_type_list_attr(const char* value,
-    size_t size) {
+inline void OpDef_ArgDef::_internal_set_type_list_attr(const std::string& value) {
 
-  type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
+  type_list_attr_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::mutable_type_list_attr() {
+inline std::string* OpDef_ArgDef::_internal_mutable_type_list_attr() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
-  return type_list_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return type_list_attr_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_ArgDef::release_type_list_attr() {
+inline std::string* OpDef_ArgDef::release_type_list_attr() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
-
-  return type_list_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return type_list_attr_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef_ArgDef::set_allocated_type_list_attr(::std::string* type_list_attr) {
-  if (type_list_attr != NULL) {
+inline void OpDef_ArgDef::set_allocated_type_list_attr(std::string* type_list_attr) {
+  if (type_list_attr != nullptr) {
 
   } else {
 
   }
-  type_list_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_list_attr,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
-}
-inline ::std::string* OpDef_ArgDef::unsafe_arena_release_type_list_attr() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return type_list_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef_ArgDef::unsafe_arena_set_allocated_type_list_attr(
-    ::std::string* type_list_attr) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (type_list_attr != NULL) {
-
-  } else {
-
+  type_list_attr_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type_list_attr,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_list_attr_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_list_attr_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  type_list_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      type_list_attr, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.ArgDef.type_list_attr)
 }
 
 // bool is_ref = 16;
 inline void OpDef_ArgDef::clear_is_ref() {
   is_ref_ = false;
 }
+inline bool OpDef_ArgDef::_internal_is_ref() const {
+  return is_ref_;
+}
 inline bool OpDef_ArgDef::is_ref() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.ArgDef.is_ref)
-  return is_ref_;
+  return _internal_is_ref();
 }
-inline void OpDef_ArgDef::set_is_ref(bool value) {
+inline void OpDef_ArgDef::_internal_set_is_ref(bool value) {
 
   is_ref_ = value;
+}
+inline void OpDef_ArgDef::set_is_ref(bool value) {
+  _internal_set_is_ref(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.ArgDef.is_ref)
 }
 
@@ -1490,199 +1502,182 @@ inline void OpDef_ArgDef::set_is_ref(bool value) {
 
 // string name = 1;
 inline void OpDef_AttrDef::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  name_.ClearToEmpty();
 }
-inline const ::std::string& OpDef_AttrDef::name() const {
+inline const std::string& OpDef_AttrDef::name() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.AttrDef.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void OpDef_AttrDef::set_name(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef_AttrDef::set_name(ArgT0&& arg0, ArgT... args) {
 
 name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.AttrDef.name)
 }
-#if LANG_CXX11
-inline void OpDef_AttrDef::set_name(::std::string&& value) {
-
-  name_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.AttrDef.name)
+inline std::string* OpDef_AttrDef::mutable_name() {
+  std::string* _s = _internal_mutable_name();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.name)
+  return _s;
 }
-#endif
-inline void OpDef_AttrDef::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:opencv_tensorflow.OpDef.AttrDef.name)
+inline const std::string& OpDef_AttrDef::_internal_name() const {
+  return name_.Get();
 }
-inline void OpDef_AttrDef::set_name(const char* value,
-    size_t size) {
+inline void OpDef_AttrDef::_internal_set_name(const std::string& value) {
 
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.AttrDef.name)
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_AttrDef::mutable_name() {
+inline std::string* OpDef_AttrDef::_internal_mutable_name() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_AttrDef::release_name() {
+inline std::string* OpDef_AttrDef::release_name() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.AttrDef.name)
-
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef_AttrDef::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
+inline void OpDef_AttrDef::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
 
   } else {
 
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.AttrDef.name)
-}
-inline ::std::string* OpDef_AttrDef::unsafe_arena_release_name() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.AttrDef.name)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef_AttrDef::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-
-  } else {
-
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.AttrDef.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.AttrDef.name)
 }
 
 // string type = 2;
 inline void OpDef_AttrDef::clear_type() {
-  type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  type_.ClearToEmpty();
 }
-inline const ::std::string& OpDef_AttrDef::type() const {
+inline const std::string& OpDef_AttrDef::type() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.AttrDef.type)
-  return type_.Get();
+  return _internal_type();
 }
-inline void OpDef_AttrDef::set_type(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef_AttrDef::set_type(ArgT0&& arg0, ArgT... args) {
 
 type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.AttrDef.type)
 }
-#if LANG_CXX11
-inline void OpDef_AttrDef::set_type(::std::string&& value) {
-
-  type_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.AttrDef.type)
+inline std::string* OpDef_AttrDef::mutable_type() {
+  std::string* _s = _internal_mutable_type();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.type)
+  return _s;
 }
-#endif
-inline void OpDef_AttrDef::set_type(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDef.AttrDef.type)
+inline const std::string& OpDef_AttrDef::_internal_type() const {
+  return type_.Get();
 }
-inline void OpDef_AttrDef::set_type(const char* value,
-    size_t size) {
+inline void OpDef_AttrDef::_internal_set_type(const std::string& value) {
 
-  type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.AttrDef.type)
+  type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_AttrDef::mutable_type() {
+inline std::string* OpDef_AttrDef::_internal_mutable_type() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.type)
-  return type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_AttrDef::release_type() {
+inline std::string* OpDef_AttrDef::release_type() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.AttrDef.type)
-
-  return type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef_AttrDef::set_allocated_type(::std::string* type) {
-  if (type != NULL) {
+inline void OpDef_AttrDef::set_allocated_type(std::string* type) {
+  if (type != nullptr) {
 
   } else {
 
   }
-  type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.AttrDef.type)
-}
-inline ::std::string* OpDef_AttrDef::unsafe_arena_release_type() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.AttrDef.type)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef_AttrDef::unsafe_arena_set_allocated_type(
-    ::std::string* type) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (type != NULL) {
-
-  } else {
-
+  type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      type, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.AttrDef.type)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.AttrDef.type)
 }
 
 // .opencv_tensorflow.AttrValue default_value = 3;
+inline bool OpDef_AttrDef::_internal_has_default_value() const {
+  return this != internal_default_instance() && default_value_ != nullptr;
+}
 inline bool OpDef_AttrDef::has_default_value() const {
-  return this != internal_default_instance() && default_value_ != NULL;
+  return _internal_has_default_value();
 }
-inline const ::opencv_tensorflow::AttrValue& OpDef_AttrDef::default_value() const {
+inline const ::opencv_tensorflow::AttrValue& OpDef_AttrDef::_internal_default_value() const {
   const ::opencv_tensorflow::AttrValue* p = default_value_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_tensorflow::AttrValue&>(
+      ::opencv_tensorflow::_AttrValue_default_instance_);
+}
+inline const ::opencv_tensorflow::AttrValue& OpDef_AttrDef::default_value() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.AttrDef.default_value)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::AttrValue*>(
-      &::opencv_tensorflow::_AttrValue_default_instance_);
+  return _internal_default_value();
+}
+inline void OpDef_AttrDef::unsafe_arena_set_allocated_default_value(
+    ::opencv_tensorflow::AttrValue* default_value) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(default_value_);
+  }
+  default_value_ = default_value;
+  if (default_value) {
+
+  } else {
+
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.AttrDef.default_value)
 }
 inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::release_default_value() {
-  // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.AttrDef.default_value)
 
   ::opencv_tensorflow::AttrValue* temp = default_value_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
-  }
-  default_value_ = NULL;
+  default_value_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::unsafe_arena_release_default_value() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.AttrDef.default_value)
+  // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.AttrDef.default_value)
 
   ::opencv_tensorflow::AttrValue* temp = default_value_;
-  default_value_ = NULL;
+  default_value_ = nullptr;
   return temp;
 }
-inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::mutable_default_value() {
+inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::_internal_mutable_default_value() {
 
-  if (default_value_ == NULL) {
-    _slow_mutable_default_value();
+  if (default_value_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_tensorflow::AttrValue>(GetArenaForAllocation());
+    default_value_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.default_value)
   return default_value_;
 }
+inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::mutable_default_value() {
+  ::opencv_tensorflow::AttrValue* _msg = _internal_mutable_default_value();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.default_value)
+  return _msg;
+}
 inline void OpDef_AttrDef::set_allocated_default_value(::opencv_tensorflow::AttrValue* default_value) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(default_value_);
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(default_value_);
   }
   if (default_value) {
-    ::google::protobuf::Arena* submessage_arena =
-      reinterpret_cast< ::google::protobuf::MessageLite*>(default_value)->GetArena();
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<
+            ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena(
+                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(default_value));
     if (message_arena != submessage_arena) {
-      default_value = ::google::protobuf::internal::GetOwnedMessage(
+      default_value = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, default_value, submessage_arena);
     }
 
@@ -1695,152 +1690,171 @@ inline void OpDef_AttrDef::set_allocated_default_value(::opencv_tensorflow::Attr
 
 // string description = 4;
 inline void OpDef_AttrDef::clear_description() {
-  description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  description_.ClearToEmpty();
 }
-inline const ::std::string& OpDef_AttrDef::description() const {
+inline const std::string& OpDef_AttrDef::description() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.AttrDef.description)
-  return description_.Get();
+  return _internal_description();
 }
-inline void OpDef_AttrDef::set_description(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef_AttrDef::set_description(ArgT0&& arg0, ArgT... args) {
 
 description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.AttrDef.description)
 }
-#if LANG_CXX11
-inline void OpDef_AttrDef::set_description(::std::string&& value) {
-
-  description_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.AttrDef.description)
+inline std::string* OpDef_AttrDef::mutable_description() {
+  std::string* _s = _internal_mutable_description();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.description)
+  return _s;
 }
-#endif
-inline void OpDef_AttrDef::set_description(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDef.AttrDef.description)
+inline const std::string& OpDef_AttrDef::_internal_description() const {
+  return description_.Get();
 }
-inline void OpDef_AttrDef::set_description(const char* value,
-    size_t size) {
+inline void OpDef_AttrDef::_internal_set_description(const std::string& value) {
 
-  description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.AttrDef.description)
+  description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_AttrDef::mutable_description() {
+inline std::string* OpDef_AttrDef::_internal_mutable_description() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.description)
-  return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return description_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef_AttrDef::release_description() {
+inline std::string* OpDef_AttrDef::release_description() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.AttrDef.description)
-
-  return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return description_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef_AttrDef::set_allocated_description(::std::string* description) {
-  if (description != NULL) {
+inline void OpDef_AttrDef::set_allocated_description(std::string* description) {
+  if (description != nullptr) {
 
   } else {
 
   }
-  description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.AttrDef.description)
-}
-inline ::std::string* OpDef_AttrDef::unsafe_arena_release_description() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.AttrDef.description)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef_AttrDef::unsafe_arena_set_allocated_description(
-    ::std::string* description) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (description != NULL) {
-
-  } else {
-
+  description_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), description,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (description_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      description, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.AttrDef.description)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.AttrDef.description)
 }
 
 // bool has_minimum = 5;
 inline void OpDef_AttrDef::clear_has_minimum() {
   has_minimum_ = false;
 }
+inline bool OpDef_AttrDef::_internal_has_minimum() const {
+  return has_minimum_;
+}
 inline bool OpDef_AttrDef::has_minimum() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.AttrDef.has_minimum)
-  return has_minimum_;
+  return _internal_has_minimum();
 }
-inline void OpDef_AttrDef::set_has_minimum(bool value) {
+inline void OpDef_AttrDef::_internal_set_has_minimum(bool value) {
 
   has_minimum_ = value;
+}
+inline void OpDef_AttrDef::set_has_minimum(bool value) {
+  _internal_set_has_minimum(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.AttrDef.has_minimum)
 }
 
 // int64 minimum = 6;
 inline void OpDef_AttrDef::clear_minimum() {
-  minimum_ = GOOGLE_LONGLONG(0);
+  minimum_ = int64_t{0};
 }
-inline ::google::protobuf::int64 OpDef_AttrDef::minimum() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.AttrDef.minimum)
+inline int64_t OpDef_AttrDef::_internal_minimum() const {
   return minimum_;
 }
-inline void OpDef_AttrDef::set_minimum(::google::protobuf::int64 value) {
+inline int64_t OpDef_AttrDef::minimum() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.AttrDef.minimum)
+  return _internal_minimum();
+}
+inline void OpDef_AttrDef::_internal_set_minimum(int64_t value) {
 
   minimum_ = value;
+}
+inline void OpDef_AttrDef::set_minimum(int64_t value) {
+  _internal_set_minimum(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.AttrDef.minimum)
 }
 
 // .opencv_tensorflow.AttrValue allowed_values = 7;
+inline bool OpDef_AttrDef::_internal_has_allowed_values() const {
+  return this != internal_default_instance() && allowed_values_ != nullptr;
+}
 inline bool OpDef_AttrDef::has_allowed_values() const {
-  return this != internal_default_instance() && allowed_values_ != NULL;
+  return _internal_has_allowed_values();
 }
-inline const ::opencv_tensorflow::AttrValue& OpDef_AttrDef::allowed_values() const {
+inline const ::opencv_tensorflow::AttrValue& OpDef_AttrDef::_internal_allowed_values() const {
   const ::opencv_tensorflow::AttrValue* p = allowed_values_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_tensorflow::AttrValue&>(
+      ::opencv_tensorflow::_AttrValue_default_instance_);
+}
+inline const ::opencv_tensorflow::AttrValue& OpDef_AttrDef::allowed_values() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.AttrDef.allowed_values)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::AttrValue*>(
-      &::opencv_tensorflow::_AttrValue_default_instance_);
+  return _internal_allowed_values();
+}
+inline void OpDef_AttrDef::unsafe_arena_set_allocated_allowed_values(
+    ::opencv_tensorflow::AttrValue* allowed_values) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(allowed_values_);
+  }
+  allowed_values_ = allowed_values;
+  if (allowed_values) {
+
+  } else {
+
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.AttrDef.allowed_values)
 }
 inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::release_allowed_values() {
-  // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.AttrDef.allowed_values)
 
   ::opencv_tensorflow::AttrValue* temp = allowed_values_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
-  }
-  allowed_values_ = NULL;
+  allowed_values_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::unsafe_arena_release_allowed_values() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.AttrDef.allowed_values)
+  // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.AttrDef.allowed_values)
 
   ::opencv_tensorflow::AttrValue* temp = allowed_values_;
-  allowed_values_ = NULL;
+  allowed_values_ = nullptr;
   return temp;
 }
-inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::mutable_allowed_values() {
+inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::_internal_mutable_allowed_values() {
 
-  if (allowed_values_ == NULL) {
-    _slow_mutable_allowed_values();
+  if (allowed_values_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_tensorflow::AttrValue>(GetArenaForAllocation());
+    allowed_values_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.allowed_values)
   return allowed_values_;
 }
+inline ::opencv_tensorflow::AttrValue* OpDef_AttrDef::mutable_allowed_values() {
+  ::opencv_tensorflow::AttrValue* _msg = _internal_mutable_allowed_values();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.AttrDef.allowed_values)
+  return _msg;
+}
 inline void OpDef_AttrDef::set_allocated_allowed_values(::opencv_tensorflow::AttrValue* allowed_values) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(allowed_values_);
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(allowed_values_);
   }
   if (allowed_values) {
-    ::google::protobuf::Arena* submessage_arena =
-      reinterpret_cast< ::google::protobuf::MessageLite*>(allowed_values)->GetArena();
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<
+            ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena(
+                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(allowed_values));
     if (message_arena != submessage_arena) {
-      allowed_values = ::google::protobuf::internal::GetOwnedMessage(
+      allowed_values = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, allowed_values, submessage_arena);
     }
 
@@ -1857,220 +1871,255 @@ inline void OpDef_AttrDef::set_allocated_allowed_values(::opencv_tensorflow::Att
 
 // string name = 1;
 inline void OpDef::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  name_.ClearToEmpty();
 }
-inline const ::std::string& OpDef::name() const {
+inline const std::string& OpDef::name() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void OpDef::set_name(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef::set_name(ArgT0&& arg0, ArgT... args) {
 
 name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.name)
 }
-#if LANG_CXX11
-inline void OpDef::set_name(::std::string&& value) {
-
-  name_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.name)
+inline std::string* OpDef::mutable_name() {
+  std::string* _s = _internal_mutable_name();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.name)
+  return _s;
 }
-#endif
-inline void OpDef::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:opencv_tensorflow.OpDef.name)
+inline const std::string& OpDef::_internal_name() const {
+  return name_.Get();
 }
-inline void OpDef::set_name(const char* value,
-    size_t size) {
+inline void OpDef::_internal_set_name(const std::string& value) {
 
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.name)
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef::mutable_name() {
+inline std::string* OpDef::_internal_mutable_name() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef::release_name() {
+inline std::string* OpDef::release_name() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.name)
-
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
+inline void OpDef::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
 
   } else {
 
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.name)
-}
-inline ::std::string* OpDef::unsafe_arena_release_name() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.name)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-
-  } else {
-
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.name)
 }
 
 // repeated .opencv_tensorflow.OpDef.ArgDef input_arg = 2;
-inline int OpDef::input_arg_size() const {
+inline int OpDef::_internal_input_arg_size() const {
   return input_arg_.size();
 }
+inline int OpDef::input_arg_size() const {
+  return _internal_input_arg_size();
+}
 inline void OpDef::clear_input_arg() {
   input_arg_.Clear();
 }
-inline const ::opencv_tensorflow::OpDef_ArgDef& OpDef::input_arg(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.input_arg)
-  return input_arg_.Get(index);
-}
 inline ::opencv_tensorflow::OpDef_ArgDef* OpDef::mutable_input_arg(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.input_arg)
   return input_arg_.Mutable(index);
 }
-inline ::opencv_tensorflow::OpDef_ArgDef* OpDef::add_input_arg() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.OpDef.input_arg)
-  return input_arg_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >*
 OpDef::mutable_input_arg() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.OpDef.input_arg)
   return &input_arg_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >&
+inline const ::opencv_tensorflow::OpDef_ArgDef& OpDef::_internal_input_arg(int index) const {
+  return input_arg_.Get(index);
+}
+inline const ::opencv_tensorflow::OpDef_ArgDef& OpDef::input_arg(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.input_arg)
+  return _internal_input_arg(index);
+}
+inline ::opencv_tensorflow::OpDef_ArgDef* OpDef::_internal_add_input_arg() {
+  return input_arg_.Add();
+}
+inline ::opencv_tensorflow::OpDef_ArgDef* OpDef::add_input_arg() {
+  ::opencv_tensorflow::OpDef_ArgDef* _add = _internal_add_input_arg();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.OpDef.input_arg)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >&
 OpDef::input_arg() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.OpDef.input_arg)
   return input_arg_;
 }
 
 // repeated .opencv_tensorflow.OpDef.ArgDef output_arg = 3;
-inline int OpDef::output_arg_size() const {
+inline int OpDef::_internal_output_arg_size() const {
   return output_arg_.size();
 }
+inline int OpDef::output_arg_size() const {
+  return _internal_output_arg_size();
+}
 inline void OpDef::clear_output_arg() {
   output_arg_.Clear();
 }
-inline const ::opencv_tensorflow::OpDef_ArgDef& OpDef::output_arg(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.output_arg)
-  return output_arg_.Get(index);
-}
 inline ::opencv_tensorflow::OpDef_ArgDef* OpDef::mutable_output_arg(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.output_arg)
   return output_arg_.Mutable(index);
 }
-inline ::opencv_tensorflow::OpDef_ArgDef* OpDef::add_output_arg() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.OpDef.output_arg)
-  return output_arg_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >*
 OpDef::mutable_output_arg() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.OpDef.output_arg)
   return &output_arg_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >&
+inline const ::opencv_tensorflow::OpDef_ArgDef& OpDef::_internal_output_arg(int index) const {
+  return output_arg_.Get(index);
+}
+inline const ::opencv_tensorflow::OpDef_ArgDef& OpDef::output_arg(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.output_arg)
+  return _internal_output_arg(index);
+}
+inline ::opencv_tensorflow::OpDef_ArgDef* OpDef::_internal_add_output_arg() {
+  return output_arg_.Add();
+}
+inline ::opencv_tensorflow::OpDef_ArgDef* OpDef::add_output_arg() {
+  ::opencv_tensorflow::OpDef_ArgDef* _add = _internal_add_output_arg();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.OpDef.output_arg)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_ArgDef >&
 OpDef::output_arg() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.OpDef.output_arg)
   return output_arg_;
 }
 
 // repeated .opencv_tensorflow.OpDef.AttrDef attr = 4;
-inline int OpDef::attr_size() const {
+inline int OpDef::_internal_attr_size() const {
   return attr_.size();
 }
+inline int OpDef::attr_size() const {
+  return _internal_attr_size();
+}
 inline void OpDef::clear_attr() {
   attr_.Clear();
 }
-inline const ::opencv_tensorflow::OpDef_AttrDef& OpDef::attr(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.attr)
-  return attr_.Get(index);
-}
 inline ::opencv_tensorflow::OpDef_AttrDef* OpDef::mutable_attr(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.attr)
   return attr_.Mutable(index);
 }
-inline ::opencv_tensorflow::OpDef_AttrDef* OpDef::add_attr() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.OpDef.attr)
-  return attr_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef >*
 OpDef::mutable_attr() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.OpDef.attr)
   return &attr_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef >&
+inline const ::opencv_tensorflow::OpDef_AttrDef& OpDef::_internal_attr(int index) const {
+  return attr_.Get(index);
+}
+inline const ::opencv_tensorflow::OpDef_AttrDef& OpDef::attr(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.attr)
+  return _internal_attr(index);
+}
+inline ::opencv_tensorflow::OpDef_AttrDef* OpDef::_internal_add_attr() {
+  return attr_.Add();
+}
+inline ::opencv_tensorflow::OpDef_AttrDef* OpDef::add_attr() {
+  ::opencv_tensorflow::OpDef_AttrDef* _add = _internal_add_attr();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.OpDef.attr)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef_AttrDef >&
 OpDef::attr() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.OpDef.attr)
   return attr_;
 }
 
 // .opencv_tensorflow.OpDeprecation deprecation = 8;
+inline bool OpDef::_internal_has_deprecation() const {
+  return this != internal_default_instance() && deprecation_ != nullptr;
+}
 inline bool OpDef::has_deprecation() const {
-  return this != internal_default_instance() && deprecation_ != NULL;
+  return _internal_has_deprecation();
 }
 inline void OpDef::clear_deprecation() {
-  if (GetArenaNoVirtual() == NULL && deprecation_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && deprecation_ != nullptr) {
     delete deprecation_;
   }
-  deprecation_ = NULL;
+  deprecation_ = nullptr;
 }
-inline const ::opencv_tensorflow::OpDeprecation& OpDef::deprecation() const {
+inline const ::opencv_tensorflow::OpDeprecation& OpDef::_internal_deprecation() const {
   const ::opencv_tensorflow::OpDeprecation* p = deprecation_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_tensorflow::OpDeprecation&>(
+      ::opencv_tensorflow::_OpDeprecation_default_instance_);
+}
+inline const ::opencv_tensorflow::OpDeprecation& OpDef::deprecation() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.deprecation)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::OpDeprecation*>(
-      &::opencv_tensorflow::_OpDeprecation_default_instance_);
+  return _internal_deprecation();
+}
+inline void OpDef::unsafe_arena_set_allocated_deprecation(
+    ::opencv_tensorflow::OpDeprecation* deprecation) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(deprecation_);
+  }
+  deprecation_ = deprecation;
+  if (deprecation) {
+
+  } else {
+
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.deprecation)
 }
 inline ::opencv_tensorflow::OpDeprecation* OpDef::release_deprecation() {
-  // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.deprecation)
 
   ::opencv_tensorflow::OpDeprecation* temp = deprecation_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
-  }
-  deprecation_ = NULL;
+  deprecation_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::opencv_tensorflow::OpDeprecation* OpDef::unsafe_arena_release_deprecation() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.deprecation)
+  // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.deprecation)
 
   ::opencv_tensorflow::OpDeprecation* temp = deprecation_;
-  deprecation_ = NULL;
+  deprecation_ = nullptr;
   return temp;
 }
-inline ::opencv_tensorflow::OpDeprecation* OpDef::mutable_deprecation() {
+inline ::opencv_tensorflow::OpDeprecation* OpDef::_internal_mutable_deprecation() {
 
-  if (deprecation_ == NULL) {
-    _slow_mutable_deprecation();
+  if (deprecation_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_tensorflow::OpDeprecation>(GetArenaForAllocation());
+    deprecation_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.deprecation)
   return deprecation_;
 }
+inline ::opencv_tensorflow::OpDeprecation* OpDef::mutable_deprecation() {
+  ::opencv_tensorflow::OpDeprecation* _msg = _internal_mutable_deprecation();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.deprecation)
+  return _msg;
+}
 inline void OpDef::set_allocated_deprecation(::opencv_tensorflow::OpDeprecation* deprecation) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
     delete deprecation_;
   }
   if (deprecation) {
-    ::google::protobuf::Arena* submessage_arena =
-      ::google::protobuf::Arena::GetArena(deprecation);
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::opencv_tensorflow::OpDeprecation>::GetOwningArena(deprecation);
     if (message_arena != submessage_arena) {
-      deprecation = ::google::protobuf::internal::GetOwnedMessage(
+      deprecation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, deprecation, submessage_arena);
     }
 
@@ -2083,165 +2132,123 @@ inline void OpDef::set_allocated_deprecation(::opencv_tensorflow::OpDeprecation*
 
 // string summary = 5;
 inline void OpDef::clear_summary() {
-  summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  summary_.ClearToEmpty();
 }
-inline const ::std::string& OpDef::summary() const {
+inline const std::string& OpDef::summary() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.summary)
-  return summary_.Get();
+  return _internal_summary();
 }
-inline void OpDef::set_summary(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef::set_summary(ArgT0&& arg0, ArgT... args) {
 
 summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
summary_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.summary)
 }
-#if LANG_CXX11
-inline void OpDef::set_summary(::std::string&& value) {
-
-  summary_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.summary)
+inline std::string* OpDef::mutable_summary() {
+  std::string* _s = _internal_mutable_summary();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.summary)
+  return _s;
 }
-#endif
-inline void OpDef::set_summary(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDef.summary)
+inline const std::string& OpDef::_internal_summary() const {
+  return summary_.Get();
 }
-inline void OpDef::set_summary(const char* value,
-    size_t size) {
+inline void OpDef::_internal_set_summary(const std::string& value) {
 
-  summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.summary)
+  summary_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef::mutable_summary() {
+inline std::string* OpDef::_internal_mutable_summary() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.summary)
-  return summary_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return summary_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef::release_summary() {
+inline std::string* OpDef::release_summary() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.summary)
-
-  return summary_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return summary_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef::set_allocated_summary(::std::string* summary) {
-  if (summary != NULL) {
+inline void OpDef::set_allocated_summary(std::string* summary) {
+  if (summary != nullptr) {
 
   } else {
 
   }
-  summary_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), summary,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.summary)
-}
-inline ::std::string* OpDef::unsafe_arena_release_summary() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.summary)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return summary_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef::unsafe_arena_set_allocated_summary(
-    ::std::string* summary) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (summary != NULL) {
-
-  } else {
-
+  summary_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), summary,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (summary_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    summary_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  summary_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      summary, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.summary)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.summary)
 }
 
 // string description = 6;
 inline void OpDef::clear_description() {
-  description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  description_.ClearToEmpty();
 }
-inline const ::std::string& OpDef::description() const {
+inline const std::string& OpDef::description() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.description)
-  return description_.Get();
+  return _internal_description();
 }
-inline void OpDef::set_description(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDef::set_description(ArgT0&& arg0, ArgT... args) {
 
 description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.description)
 }
-#if LANG_CXX11
-inline void OpDef::set_description(::std::string&& value) {
-
-  description_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDef.description)
+inline std::string* OpDef::mutable_description() {
+  std::string* _s = _internal_mutable_description();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.description)
+  return _s;
 }
-#endif
-inline void OpDef::set_description(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDef.description)
+inline const std::string& OpDef::_internal_description() const {
+  return description_.Get();
 }
-inline void OpDef::set_description(const char* value,
-    size_t size) {
+inline void OpDef::_internal_set_description(const std::string& value) {
 
-  description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDef.description)
+  description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDef::mutable_description() {
+inline std::string* OpDef::_internal_mutable_description() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDef.description)
-  return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return description_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDef::release_description() {
+inline std::string* OpDef::release_description() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDef.description)
-
-  return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return description_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDef::set_allocated_description(::std::string* description) {
-  if (description != NULL) {
+inline void OpDef::set_allocated_description(std::string* description) {
+  if (description != nullptr) {
 
   } else {
 
   }
-  description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.description)
-}
-inline ::std::string* OpDef::unsafe_arena_release_description() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDef.description)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDef::unsafe_arena_set_allocated_description(
-    ::std::string* description) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (description != NULL) {
-
-  } else {
-
+  description_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), description,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (description_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      description, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDef.description)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDef.description)
 }
 
 // bool is_commutative = 18;
 inline void OpDef::clear_is_commutative() {
   is_commutative_ = false;
 }
+inline bool OpDef::_internal_is_commutative() const {
+  return is_commutative_;
+}
 inline bool OpDef::is_commutative() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.is_commutative)
-  return is_commutative_;
+  return _internal_is_commutative();
 }
-inline void OpDef::set_is_commutative(bool value) {
+inline void OpDef::_internal_set_is_commutative(bool value) {
 
   is_commutative_ = value;
+}
+inline void OpDef::set_is_commutative(bool value) {
+  _internal_set_is_commutative(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.is_commutative)
 }
 
@@ -2249,13 +2256,19 @@ inline void OpDef::set_is_commutative(bool value) {
 inline void OpDef::clear_is_aggregate() {
   is_aggregate_ = false;
 }
+inline bool OpDef::_internal_is_aggregate() const {
+  return is_aggregate_;
+}
 inline bool OpDef::is_aggregate() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.is_aggregate)
-  return is_aggregate_;
+  return _internal_is_aggregate();
 }
-inline void OpDef::set_is_aggregate(bool value) {
+inline void OpDef::_internal_set_is_aggregate(bool value) {
 
   is_aggregate_ = value;
+}
+inline void OpDef::set_is_aggregate(bool value) {
+  _internal_set_is_aggregate(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.is_aggregate)
 }
 
@@ -2263,13 +2276,19 @@ inline void OpDef::set_is_aggregate(bool value) {
 inline void OpDef::clear_is_stateful() {
   is_stateful_ = false;
 }
+inline bool OpDef::_internal_is_stateful() const {
+  return is_stateful_;
+}
 inline bool OpDef::is_stateful() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.is_stateful)
-  return is_stateful_;
+  return _internal_is_stateful();
 }
-inline void OpDef::set_is_stateful(bool value) {
+inline void OpDef::_internal_set_is_stateful(bool value) {
 
   is_stateful_ = value;
+}
+inline void OpDef::set_is_stateful(bool value) {
+  _internal_set_is_stateful(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.is_stateful)
 }
 
@@ -2277,13 +2296,19 @@ inline void OpDef::set_is_stateful(bool value) {
 inline void OpDef::clear_allows_uninitialized_input() {
   allows_uninitialized_input_ = false;
 }
+inline bool OpDef::_internal_allows_uninitialized_input() const {
+  return allows_uninitialized_input_;
+}
 inline bool OpDef::allows_uninitialized_input() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDef.allows_uninitialized_input)
-  return allows_uninitialized_input_;
+  return _internal_allows_uninitialized_input();
 }
-inline void OpDef::set_allows_uninitialized_input(bool value) {
+inline void OpDef::_internal_set_allows_uninitialized_input(bool value) {
 
   allows_uninitialized_input_ = value;
+}
+inline void OpDef::set_allows_uninitialized_input(bool value) {
+  _internal_set_allows_uninitialized_input(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDef.allows_uninitialized_input)
 }
 
@@ -2295,89 +2320,71 @@ inline void OpDef::set_allows_uninitialized_input(bool value) {
 inline void OpDeprecation::clear_version() {
   version_ = 0;
 }
-inline ::google::protobuf::int32 OpDeprecation::version() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDeprecation.version)
+inline int32_t OpDeprecation::_internal_version() const {
   return version_;
 }
-inline void OpDeprecation::set_version(::google::protobuf::int32 value) {
+inline int32_t OpDeprecation::version() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDeprecation.version)
+  return _internal_version();
+}
+inline void OpDeprecation::_internal_set_version(int32_t value) {
 
   version_ = value;
+}
+inline void OpDeprecation::set_version(int32_t value) {
+  _internal_set_version(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDeprecation.version)
 }
 
 // string explanation = 2;
 inline void OpDeprecation::clear_explanation() {
-  explanation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  explanation_.ClearToEmpty();
 }
-inline const ::std::string& OpDeprecation::explanation() const {
+inline const std::string& OpDeprecation::explanation() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.OpDeprecation.explanation)
-  return explanation_.Get();
+  return _internal_explanation();
 }
-inline void OpDeprecation::set_explanation(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void OpDeprecation::set_explanation(ArgT0&& arg0, ArgT... args) {
 
 explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
explanation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.OpDeprecation.explanation)
 }
-#if LANG_CXX11
-inline void OpDeprecation::set_explanation(::std::string&& value) {
-
-  explanation_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.OpDeprecation.explanation)
+inline std::string* OpDeprecation::mutable_explanation() {
+  std::string* _s = _internal_mutable_explanation();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDeprecation.explanation)
+  return _s;
 }
-#endif
-inline void OpDeprecation::set_explanation(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.OpDeprecation.explanation)
+inline const std::string& OpDeprecation::_internal_explanation() const {
+  return explanation_.Get();
 }
-inline void OpDeprecation::set_explanation(const char* value,
-    size_t size) {
+inline void OpDeprecation::_internal_set_explanation(const std::string& value) {
 
-  explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.OpDeprecation.explanation)
+  explanation_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* OpDeprecation::mutable_explanation() {
+inline std::string* OpDeprecation::_internal_mutable_explanation() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpDeprecation.explanation)
-  return explanation_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return explanation_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* OpDeprecation::release_explanation() {
+inline std::string* OpDeprecation::release_explanation() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.OpDeprecation.explanation)
-
-  return explanation_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return explanation_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void OpDeprecation::set_allocated_explanation(::std::string* explanation) {
-  if (explanation != NULL) {
+inline void OpDeprecation::set_allocated_explanation(std::string* explanation) {
+  if (explanation != nullptr) {
 
   } else {
 
   }
-  explanation_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), explanation,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDeprecation.explanation)
-}
-inline ::std::string* OpDeprecation::unsafe_arena_release_explanation() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.OpDeprecation.explanation)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return explanation_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void OpDeprecation::unsafe_arena_set_allocated_explanation(
-    ::std::string* explanation) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (explanation != NULL) {
-
-  } else {
-
+  explanation_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), explanation,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (explanation_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    explanation_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  explanation_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      explanation, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.OpDeprecation.explanation)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.OpDeprecation.explanation)
 }
 
 // -------------------------------------------------------------------
@@ -2385,30 +2392,40 @@ inline void OpDeprecation::unsafe_arena_set_allocated_explanation(
 // OpList
 
 // repeated .opencv_tensorflow.OpDef op = 1;
-inline int OpList::op_size() const {
+inline int OpList::_internal_op_size() const {
   return op_.size();
 }
+inline int OpList::op_size() const {
+  return _internal_op_size();
+}
 inline void OpList::clear_op() {
   op_.Clear();
 }
-inline const ::opencv_tensorflow::OpDef& OpList::op(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpList.op)
-  return op_.Get(index);
-}
 inline ::opencv_tensorflow::OpDef* OpList::mutable_op(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.OpList.op)
   return op_.Mutable(index);
 }
-inline ::opencv_tensorflow::OpDef* OpList::add_op() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.OpList.op)
-  return op_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef >*
 OpList::mutable_op() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.OpList.op)
   return &op_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::OpDef >&
+inline const ::opencv_tensorflow::OpDef& OpList::_internal_op(int index) const {
+  return op_.Get(index);
+}
+inline const ::opencv_tensorflow::OpDef& OpList::op(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.OpList.op)
+  return _internal_op(index);
+}
+inline ::opencv_tensorflow::OpDef* OpList::_internal_add_op() {
+  return op_.Add();
+}
+inline ::opencv_tensorflow::OpDef* OpList::add_op() {
+  ::opencv_tensorflow::OpDef* _add = _internal_add_op();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.OpList.op)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::OpDef >&
 OpList::op() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.OpList.op)
   return op_;
@@ -2432,4 +2449,5 @@ OpList::op() const {
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_op_5fdef_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_op_5fdef_2eproto
index 25f3a80..abf57f8 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_tensorflow {
-class TensorProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TensorProto>
-      _instance;
-} _TensorProto_default_instance_;
+constexpr TensorProto::TensorProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : float_val_()
+  , double_val_()
+  , int_val_()
+  , _int_val_cached_byte_size_(0)
+  , string_val_()
+  , scomplex_val_()
+  , int64_val_()
+  , _int64_val_cached_byte_size_(0)
+  , bool_val_()
+  , dcomplex_val_()
+  , half_val_()
+  , _half_val_cached_byte_size_(0)
+  , tensor_content_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , tensor_shape_(nullptr)
+  , dtype_(0)
+
+  , version_number_(0){}
+struct TensorProtoDefaultTypeInternal {
+  constexpr TensorProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TensorProtoDefaultTypeInternal() {}
+  union {
+    TensorProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorProtoDefaultTypeInternal _TensorProto_default_instance_;
 }  // namespace opencv_tensorflow
-namespace protobuf_tensor_2eproto {
-void InitDefaultsTensorProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensor_2eproto[1];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensor_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensor_2eproto = nullptr;
 
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
-  {
-    void* ptr = &::opencv_tensorflow::_TensorProto_default_instance_;
-    new (ptr) ::opencv_tensorflow::TensorProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::TensorProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsTensorProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTensorProtoImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[1];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+const uint32_t TableStruct_tensor_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dtype_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_shape_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, version_number_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_content_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, half_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, float_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, double_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, string_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, scomplex_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int64_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, bool_val_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dcomplex_val_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dtype_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_shape_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, version_number_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_content_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, half_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, float_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, double_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, string_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, scomplex_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int64_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, bool_val_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dcomplex_val_),
 };
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, -1, sizeof(::opencv_tensorflow::TensorProto)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::opencv_tensorflow::TensorProto)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_TensorProto_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_TensorProto_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "tensor.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\014tensor.proto\022\021opencv_tensorflow\032\022tenso"
-      "r_shape.proto\032\013types.proto\"\363\002\n\013TensorPro"
-      "to\022*\n\005dtype\030\001 \001(\0162\033.opencv_tensorflow.Da"
-      "taType\0229\n\014tensor_shape\030\002 \001(\0132#.opencv_te"
-      "nsorflow.TensorShapeProto\022\026\n\016version_num"
-      "ber\030\003 \001(\005\022\026\n\016tensor_content\030\004 \001(\014\022\024\n\010hal"
-      "f_val\030\r \003(\005B\002\020\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026"
-      "\n\ndouble_val\030\006 \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B"
-      "\002\020\001\022\022\n\nstring_val\030\010 \003(\014\022\030\n\014scomplex_val\030"
-      "\t \003(\002B\002\020\001\022\025\n\tint64_val\030\n \003(\003B\002\020\001\022\024\n\010bool"
-      "_val\030\013 \003(\010B\002\020\001\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001"
-      "B-\n\030org.tensorflow.frameworkB\014TensorProt"
-      "osP\001\370\001\001b\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 495);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "tensor.proto", &protobuf_RegisterTypes);
-  ::protobuf_tensor_5fshape_2eproto::AddDescriptors();
-  ::protobuf_types_2eproto::AddDescriptors();
+const char descriptor_table_protodef_tensor_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\014tensor.proto\022\021opencv_tensorflow\032\022tenso"
+  "r_shape.proto\032\013types.proto\"\363\002\n\013TensorPro"
+  "to\022*\n\005dtype\030\001 \001(\0162\033.opencv_tensorflow.Da"
+  "taType\0229\n\014tensor_shape\030\002 \001(\0132#.opencv_te"
+  "nsorflow.TensorShapeProto\022\026\n\016version_num"
+  "ber\030\003 \001(\005\022\026\n\016tensor_content\030\004 \001(\014\022\024\n\010hal"
+  "f_val\030\r \003(\005B\002\020\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026"
+  "\n\ndouble_val\030\006 \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B"
+  "\002\020\001\022\022\n\nstring_val\030\010 \003(\014\022\030\n\014scomplex_val\030"
+  "\t \003(\002B\002\020\001\022\025\n\tint64_val\030\n \003(\003B\002\020\001\022\024\n\010bool"
+  "_val\030\013 \003(\010B\002\020\001\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001"
+  "B-\n\030org.tensorflow.frameworkB\014TensorProt"
+  "osP\001\370\001\001b\006proto3"
+  ;
+static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensor_2eproto_deps[2] = {
+  &::descriptor_table_tensor_5fshape_2eproto,
+  &::descriptor_table_types_2eproto,
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensor_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensor_2eproto = {
+  false, false, 495, descriptor_table_protodef_tensor_2eproto, "tensor.proto",
+  &descriptor_table_tensor_2eproto_once, descriptor_table_tensor_2eproto_deps, 2, 1,
+  schemas, file_default_instances, TableStruct_tensor_2eproto::offsets,
+  file_level_metadata_tensor_2eproto, file_level_enum_descriptors_tensor_2eproto, file_level_service_descriptors_tensor_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_tensor_2eproto_getter() {
+  return &descriptor_table_tensor_2eproto;
 }
 
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_tensor_2eproto
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_tensor_2eproto(&descriptor_table_tensor_2eproto);
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-void TensorProto::InitAsDefaultInstance() {
-  ::opencv_tensorflow::_TensorProto_default_instance_._instance.get_mutable()->tensor_shape_ = const_cast< ::opencv_tensorflow::TensorShapeProto*>(
-      ::opencv_tensorflow::TensorShapeProto::internal_default_instance());
-}
-void TensorProto::_slow_mutable_tensor_shape() {
-  tensor_shape_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::TensorShapeProto >(
-      GetArenaNoVirtual());
-}
-void TensorProto::unsafe_arena_set_allocated_tensor_shape(
-    ::opencv_tensorflow::TensorShapeProto* tensor_shape) {
-  if (GetArenaNoVirtual() == NULL) {
-    delete tensor_shape_;
-  }
-  tensor_shape_ = tensor_shape;
-  if (tensor_shape) {
-
-  } else {
+class TensorProto::_Internal {
+ public:
+  static const ::opencv_tensorflow::TensorShapeProto& tensor_shape(const TensorProto* msg);
+};
 
-  }
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.TensorProto.tensor_shape)
+const ::opencv_tensorflow::TensorShapeProto&
+TensorProto::_Internal::tensor_shape(const TensorProto* msg) {
+  return *msg->tensor_shape_;
 }
 void TensorProto::clear_tensor_shape() {
-  if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) {
+  if (GetArenaForAllocation() == nullptr && tensor_shape_ != nullptr) {
     delete tensor_shape_;
   }
-  tensor_shape_ = NULL;
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TensorProto::kDtypeFieldNumber;
-const int TensorProto::kTensorShapeFieldNumber;
-const int TensorProto::kVersionNumberFieldNumber;
-const int TensorProto::kTensorContentFieldNumber;
-const int TensorProto::kHalfValFieldNumber;
-const int TensorProto::kFloatValFieldNumber;
-const int TensorProto::kDoubleValFieldNumber;
-const int TensorProto::kIntValFieldNumber;
-const int TensorProto::kStringValFieldNumber;
-const int TensorProto::kScomplexValFieldNumber;
-const int TensorProto::kInt64ValFieldNumber;
-const int TensorProto::kBoolValFieldNumber;
-const int TensorProto::kDcomplexValFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-TensorProto::TensorProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_tensor_2eproto::InitDefaultsTensorProto();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.TensorProto)
+  tensor_shape_ = nullptr;
 }
-TensorProto::TensorProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+TensorProto::TensorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   float_val_(arena),
   double_val_(arena),
   int_val_(arena),
@@ -201,14 +142,14 @@ TensorProto::TensorProto(::google::protobuf::Arena* arena)
   bool_val_(arena),
   dcomplex_val_(arena),
   half_val_(arena) {
-  ::protobuf_tensor_2eproto::InitDefaultsTensorProto();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.TensorProto)
 }
 TensorProto::TensorProto(const TensorProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
       float_val_(from.float_val_),
       double_val_(from.double_val_),
       int_val_(from.int_val_),
@@ -217,18 +158,20 @@ TensorProto::TensorProto(const TensorProto& from)
       int64_val_(from.int64_val_),
       bool_val_(from.bool_val_),
       dcomplex_val_(from.dcomplex_val_),
-      half_val_(from.half_val_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  tensor_content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.tensor_content().size() > 0) {
-    tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_content(),
-      GetArenaNoVirtual());
-  }
-  if (from.has_tensor_shape()) {
+      half_val_(from.half_val_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  tensor_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    tensor_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_tensor_content().empty()) {
+    tensor_content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_tensor_content(),
+      GetArenaForAllocation());
+  }
+  if (from._internal_has_tensor_shape()) {
     tensor_shape_ = new ::opencv_tensorflow::TensorShapeProto(*from.tensor_shape_);
   } else {
-    tensor_shape_ = NULL;
+    tensor_shape_ = nullptr;
   }
   ::memcpy(&dtype_, &from.dtype_,
     static_cast<size_t>(reinterpret_cast<char*>(&version_number_) -
@@ -236,22 +179,27 @@ TensorProto::TensorProto(const TensorProto& from)
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.TensorProto)
 }
 
-void TensorProto::SharedCtor() {
-  tensor_content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  ::memset(&tensor_shape_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&version_number_) -
-      reinterpret_cast<char*>(&tensor_shape_)) + sizeof(version_number_));
-  _cached_size_ = 0;
+inline void TensorProto::SharedCtor() {
+tensor_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  tensor_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&tensor_shape_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&version_number_) -
+    reinterpret_cast<char*>(&tensor_shape_)) + sizeof(version_number_));
 }
 
 TensorProto::~TensorProto() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.TensorProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TensorProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  tensor_content_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void TensorProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  tensor_content_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
   if (this != internal_default_instance()) delete tensor_shape_;
 }
 
@@ -259,30 +207,15 @@ void TensorProto::ArenaDtor(void* object) {
   TensorProto* _this = reinterpret_cast< TensorProto* >(object);
   (void)_this;
 }
-void TensorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void TensorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void TensorProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TensorProto::descriptor() {
-  ::protobuf_tensor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_tensor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const TensorProto& TensorProto::default_instance() {
-  ::protobuf_tensor_2eproto::InitDefaultsTensorProto();
-  return *internal_default_instance();
-}
-
-TensorProto* TensorProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<TensorProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void TensorProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.TensorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -295,529 +228,276 @@ void TensorProto::Clear() {
   bool_val_.Clear();
   dcomplex_val_.Clear();
   half_val_.Clear();
-  tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) {
+  tensor_content_.ClearToEmpty();
+  if (GetArenaForAllocation() == nullptr && tensor_shape_ != nullptr) {
     delete tensor_shape_;
   }
-  tensor_shape_ = NULL;
+  tensor_shape_ = nullptr;
   ::memset(&dtype_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&version_number_) -
       reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_));
-  _internal_metadata_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-bool TensorProto::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:opencv_tensorflow.TensorProto)
-  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)) {
+const char* TensorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // .opencv_tensorflow.DataType dtype = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          set_dtype(static_cast< ::opencv_tensorflow::DataType >(value));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          _internal_set_dtype(static_cast<::opencv_tensorflow::DataType>(val));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_tensor_shape()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr = ctx->ParseMessage(_internal_mutable_tensor_shape(), ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // int32 version_number = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &version_number_)));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          version_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bytes tensor_content = 4;
-      case 4: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_tensor_content()));
-        } else {
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
+          auto str = _internal_mutable_tensor_content();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated float float_val = 5 [packed = true];
-      case 5: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_float_val())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 42u, input, this->mutable_float_val())));
-        } else {
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_float_val(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 45) {
+          _internal_add_float_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+          ptr += sizeof(float);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated double double_val = 6 [packed = true];
-      case 6: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 input, this->mutable_double_val())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(49u /* 49 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 1, 50u, input, this->mutable_double_val())));
-        } else {
+      case 6:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_double_val(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 49) {
+          _internal_add_double_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
+          ptr += sizeof(double);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int32 int_val = 7 [packed = true];
-      case 7: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_int_val())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 58u, input, this->mutable_int_val())));
-        } else {
+      case 7:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_int_val(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 56) {
+          _internal_add_int_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated bytes string_val = 8;
-      case 8: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->add_string_val()));
-        } else {
+      case 8:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_string_val();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated float scomplex_val = 9 [packed = true];
-      case 9: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_scomplex_val())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 74u, input, this->mutable_scomplex_val())));
-        } else {
+      case 9:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_scomplex_val(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 77) {
+          _internal_add_scomplex_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
+          ptr += sizeof(float);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int64 int64_val = 10 [packed = true];
-      case 10: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, this->mutable_int64_val())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 1, 82u, input, this->mutable_int64_val())));
-        } else {
+      case 10:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_int64_val(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 80) {
+          _internal_add_int64_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated bool bool_val = 11 [packed = true];
-      case 11: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, this->mutable_bool_val())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 1, 90u, input, this->mutable_bool_val())));
-        } else {
+      case 11:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_bool_val(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 88) {
+          _internal_add_bool_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated double dcomplex_val = 12 [packed = true];
-      case 12: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 input, this->mutable_dcomplex_val())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(97u /* 97 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
-                 1, 98u, input, this->mutable_dcomplex_val())));
-        } else {
+      case 12:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_dcomplex_val(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 97) {
+          _internal_add_dcomplex_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
+          ptr += sizeof(double);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int32 half_val = 13 [packed = true];
-      case 13: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_half_val())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 106u, input, this->mutable_half_val())));
-        } else {
+      case 13:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_half_val(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 104) {
+          _internal_add_half_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.TensorProto)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.TensorProto)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void TensorProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.TensorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // .opencv_tensorflow.DataType dtype = 1;
-  if (this->dtype() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->dtype(), output);
-  }
-
-  // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
-  if (this->has_tensor_shape()) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, *this->tensor_shape_, output);
-  }
-
-  // int32 version_number = 3;
-  if (this->version_number() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version_number(), output);
-  }
-
-  // bytes tensor_content = 4;
-  if (this->tensor_content().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
-      4, this->tensor_content(), output);
-  }
-
-  // repeated float float_val = 5 [packed = true];
-  if (this->float_val_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _float_val_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
-      this->float_val().data(), this->float_val_size(), output);
-  }
-
-  // repeated double double_val = 6 [packed = true];
-  if (this->double_val_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _double_val_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
-      this->double_val().data(), this->double_val_size(), output);
-  }
-
-  // repeated int32 int_val = 7 [packed = true];
-  if (this->int_val_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _int_val_cached_byte_size_));
-  }
-  for (int i = 0, n = this->int_val_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
-      this->int_val(i), output);
-  }
-
-  // repeated bytes string_val = 8;
-  for (int i = 0, n = this->string_val_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      8, this->string_val(i), output);
-  }
-
-  // repeated float scomplex_val = 9 [packed = true];
-  if (this->scomplex_val_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _scomplex_val_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
-      this->scomplex_val().data(), this->scomplex_val_size(), output);
-  }
-
-  // repeated int64 int64_val = 10 [packed = true];
-  if (this->int64_val_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _int64_val_cached_byte_size_));
-  }
-  for (int i = 0, n = this->int64_val_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
-      this->int64_val(i), output);
-  }
-
-  // repeated bool bool_val = 11 [packed = true];
-  if (this->bool_val_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _bool_val_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteBoolArray(
-      this->bool_val().data(), this->bool_val_size(), output);
-  }
-
-  // repeated double dcomplex_val = 12 [packed = true];
-  if (this->dcomplex_val_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(12, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _dcomplex_val_cached_byte_size_));
-    ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
-      this->dcomplex_val().data(), this->dcomplex_val_size(), output);
-  }
-
-  // repeated int32 half_val = 13 [packed = true];
-  if (this->half_val_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(13, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _half_val_cached_byte_size_));
-  }
-  for (int i = 0, n = this->half_val_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
-      this->half_val(i), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.TensorProto)
-}
-
-::google::protobuf::uint8* TensorProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TensorProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.TensorProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // .opencv_tensorflow.DataType dtype = 1;
-  if (this->dtype() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
-      1, this->dtype(), target);
+  if (this->_internal_dtype() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      1, this->_internal_dtype(), target);
   }
 
   // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
-  if (this->has_tensor_shape()) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, *this->tensor_shape_, deterministic, target);
+  if (this->_internal_has_tensor_shape()) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        2, _Internal::tensor_shape(this), target, stream);
   }
 
   // int32 version_number = 3;
-  if (this->version_number() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version_number(), target);
+  if (this->_internal_version_number() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_version_number(), target);
   }
 
   // bytes tensor_content = 4;
-  if (this->tensor_content().size() > 0) {
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
-        4, this->tensor_content(), target);
+  if (!this->_internal_tensor_content().empty()) {
+    target = stream->WriteBytesMaybeAliased(
+        4, this->_internal_tensor_content(), target);
   }
 
   // repeated float float_val = 5 [packed = true];
-  if (this->float_val_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      5,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _float_val_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteFloatNoTagToArray(this->float_val_, target);
+  if (this->_internal_float_val_size() > 0) {
+    target = stream->WriteFixedPacked(5, _internal_float_val(), target);
   }
 
   // repeated double double_val = 6 [packed = true];
-  if (this->double_val_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      6,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _double_val_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteDoubleNoTagToArray(this->double_val_, target);
+  if (this->_internal_double_val_size() > 0) {
+    target = stream->WriteFixedPacked(6, _internal_double_val(), target);
   }
 
   // repeated int32 int_val = 7 [packed = true];
-  if (this->int_val_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      7,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _int_val_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt32NoTagToArray(this->int_val_, target);
+  {
+    int byte_size = _int_val_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt32Packed(
+          7, _internal_int_val(), byte_size, target);
+    }
   }
 
   // repeated bytes string_val = 8;
-  for (int i = 0, n = this->string_val_size(); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteBytesToArray(8, this->string_val(i), target);
+  for (int i = 0, n = this->_internal_string_val_size(); i < n; i++) {
+    const auto& s = this->_internal_string_val(i);
+    target = stream->WriteBytes(8, s, target);
   }
 
   // repeated float scomplex_val = 9 [packed = true];
-  if (this->scomplex_val_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      9,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _scomplex_val_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteFloatNoTagToArray(this->scomplex_val_, target);
+  if (this->_internal_scomplex_val_size() > 0) {
+    target = stream->WriteFixedPacked(9, _internal_scomplex_val(), target);
   }
 
   // repeated int64 int64_val = 10 [packed = true];
-  if (this->int64_val_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      10,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _int64_val_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt64NoTagToArray(this->int64_val_, target);
+  {
+    int byte_size = _int64_val_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt64Packed(
+          10, _internal_int64_val(), byte_size, target);
+    }
   }
 
   // repeated bool bool_val = 11 [packed = true];
-  if (this->bool_val_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      11,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _bool_val_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteBoolNoTagToArray(this->bool_val_, target);
+  if (this->_internal_bool_val_size() > 0) {
+    target = stream->WriteFixedPacked(11, _internal_bool_val(), target);
   }
 
   // repeated double dcomplex_val = 12 [packed = true];
-  if (this->dcomplex_val_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      12,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _dcomplex_val_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteDoubleNoTagToArray(this->dcomplex_val_, target);
+  if (this->_internal_dcomplex_val_size() > 0) {
+    target = stream->WriteFixedPacked(12, _internal_dcomplex_val(), target);
   }
 
   // repeated int32 half_val = 13 [packed = true];
-  if (this->half_val_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      13,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _half_val_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt32NoTagToArray(this->half_val_, target);
+  {
+    int byte_size = _half_val_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt32Packed(
+          13, _internal_half_val(), byte_size, target);
+    }
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.TensorProto)
   return target;
@@ -827,201 +507,168 @@ size_t TensorProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.TensorProto)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated float float_val = 5 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->float_val_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_float_val_size());
     size_t data_size = 4UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _float_val_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated double double_val = 6 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->double_val_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_double_val_size());
     size_t data_size = 8UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _double_val_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated int32 int_val = 7 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->int_val_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _int_val_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _int_val_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // repeated bytes string_val = 8;
   total_size += 1 *
-      ::google::protobuf::internal::FromIntSize(this->string_val_size());
-  for (int i = 0, n = this->string_val_size(); i < n; i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
-      this->string_val(i));
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(string_val_.size());
+  for (int i = 0, n = string_val_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+      string_val_.Get(i));
   }
 
   // repeated float scomplex_val = 9 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->scomplex_val_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_scomplex_val_size());
     size_t data_size = 4UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _scomplex_val_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated int64 int64_val = 10 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int64Size(this->int64_val_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _int64_val_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _int64_val_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // repeated bool bool_val = 11 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->bool_val_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_bool_val_size());
     size_t data_size = 1UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _bool_val_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated double dcomplex_val = 12 [packed = true];
   {
-    unsigned int count = static_cast<unsigned int>(this->dcomplex_val_size());
+    unsigned int count = static_cast<unsigned int>(this->_internal_dcomplex_val_size());
     size_t data_size = 8UL * count;
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _dcomplex_val_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
     total_size += data_size;
   }
 
   // repeated int32 half_val = 13 [packed = true];
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->half_val_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _half_val_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _half_val_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // bytes tensor_content = 4;
-  if (this->tensor_content().size() > 0) {
+  if (!this->_internal_tensor_content().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::BytesSize(
-        this->tensor_content());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
+        this->_internal_tensor_content());
   }
 
   // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
-  if (this->has_tensor_shape()) {
+  if (this->_internal_has_tensor_shape()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->tensor_shape_);
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *tensor_shape_);
   }
 
   // .opencv_tensorflow.DataType dtype = 1;
-  if (this->dtype() != 0) {
+  if (this->_internal_dtype() != 0) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_dtype());
   }
 
   // int32 version_number = 3;
-  if (this->version_number() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->version_number());
+  if (this->_internal_version_number() != 0) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_version_number());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TensorProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.TensorProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TensorProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TensorProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.TensorProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.TensorProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TensorProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TensorProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TensorProto::GetClassData() const { return &_class_data_; }
+
+void TensorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TensorProto *>(to)->MergeFrom(
+      static_cast<const TensorProto &>(from));
 }
 
+
 void TensorProto::MergeFrom(const TensorProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.TensorProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   float_val_.MergeFrom(from.float_val_);
@@ -1033,25 +680,19 @@ void TensorProto::MergeFrom(const TensorProto& from) {
   bool_val_.MergeFrom(from.bool_val_);
   dcomplex_val_.MergeFrom(from.dcomplex_val_);
   half_val_.MergeFrom(from.half_val_);
-  if (from.tensor_content().size() > 0) {
-    set_tensor_content(from.tensor_content());
+  if (!from._internal_tensor_content().empty()) {
+    _internal_set_tensor_content(from._internal_tensor_content());
   }
-  if (from.has_tensor_shape()) {
-    mutable_tensor_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape());
+  if (from._internal_has_tensor_shape()) {
+    _internal_mutable_tensor_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from._internal_tensor_shape());
   }
-  if (from.dtype() != 0) {
-    set_dtype(from.dtype());
+  if (from._internal_dtype() != 0) {
+    _internal_set_dtype(from._internal_dtype());
   }
-  if (from.version_number() != 0) {
-    set_version_number(from.version_number());
+  if (from._internal_version_number() != 0) {
+    _internal_set_version_number(from._internal_version_number());
   }
-}
-
-void TensorProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.TensorProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TensorProto::CopyFrom(const TensorProto& from) {
@@ -1065,27 +706,11 @@ bool TensorProto::IsInitialized() const {
   return true;
 }
 
-void TensorProto::Swap(TensorProto* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    TensorProto* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void TensorProto::UnsafeArenaSwap(TensorProto* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void TensorProto::InternalSwap(TensorProto* other) {
   using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   float_val_.InternalSwap(&other->float_val_);
   double_val_.InternalSwap(&other->double_val_);
   int_val_.InternalSwap(&other->int_val_);
@@ -1095,21 +720,32 @@ void TensorProto::InternalSwap(TensorProto* other) {
   bool_val_.InternalSwap(&other->bool_val_);
   dcomplex_val_.InternalSwap(&other->dcomplex_val_);
   half_val_.InternalSwap(&other->half_val_);
-  tensor_content_.Swap(&other->tensor_content_);
-  swap(tensor_shape_, other->tensor_shape_);
-  swap(dtype_, other->dtype_);
-  swap(version_number_, other->version_number_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &tensor_content_, lhs_arena,
+      &other->tensor_content_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(TensorProto, version_number_)
+      + sizeof(TensorProto::version_number_)
+      - PROTOBUF_FIELD_OFFSET(TensorProto, tensor_shape_)>(
+          reinterpret_cast<char*>(&tensor_shape_),
+          reinterpret_cast<char*>(&other->tensor_shape_));
 }
 
-::google::protobuf::Metadata TensorProto::GetMetadata() const {
-  protobuf_tensor_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_tensor_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TensorProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_tensor_2eproto_getter, &descriptor_table_tensor_2eproto_once,
+      file_level_metadata_tensor_2eproto[0]);
 }
 
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::TensorProto* Arena::CreateMaybeMessage< ::opencv_tensorflow::TensorProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::TensorProto >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index 1a0c12c..b691e7f 100644 (file)
@@ -1,30 +1,32 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensor.proto
 
-#ifndef PROTOBUF_tensor_2eproto__INCLUDED
-#define PROTOBUF_tensor_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_tensor_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_tensor_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include "tensor_shape.pb.h"
 #include "types.pb.h"
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_tensor_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_tensor_2eproto {
 // Internal implementation detail -- do not use these members.
-struct TableStruct {
-  static const ::google::protobuf::internal::ParseTableField entries[];
-  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  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 const ::google::protobuf::uint32 offsets[];
+struct TableStruct_tensor_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsTensorProtoImpl();
-void InitDefaultsTensorProto();
-inline void InitDefaults() {
-  InitDefaultsTensorProto();
-}
-}  // namespace protobuf_tensor_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensor_2eproto;
 namespace opencv_tensorflow {
 class TensorProto;
-class TensorProtoDefaultTypeInternal;
+struct TensorProtoDefaultTypeInternal;
 extern TensorProtoDefaultTypeInternal _TensorProto_default_instance_;
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_tensorflow::TensorProto* Arena::CreateMaybeMessage<::opencv_tensorflow::TensorProto>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorProto) */ {
+class TensorProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorProto) */ {
  public:
-  TensorProto();
-  virtual ~TensorProto();
+  inline TensorProto() : TensorProto(nullptr) {}
+  ~TensorProto() override;
+  explicit constexpr TensorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TensorProto(const TensorProto& from);
-
-  inline TensorProto& operator=(const TensorProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TensorProto(TensorProto&& from) noexcept
     : TensorProto() {
     *this = ::std::move(from);
   }
 
+  inline TensorProto& operator=(const TensorProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TensorProto& operator=(TensorProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TensorProto& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TensorProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const TensorProto* internal_default_instance() {
     return reinterpret_cast<const TensorProto*>(
                &_TensorProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void UnsafeArenaSwap(TensorProto* other);
-  void Swap(TensorProto* other);
   friend void swap(TensorProto& a, TensorProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(TensorProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TensorProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TensorProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TensorProto* 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;
+  TensorProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TensorProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TensorProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TensorProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TensorProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.TensorProto";
+  }
   protected:
-  explicit TensorProto(::google::protobuf::Arena* arena);
+  explicit TensorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kFloatValFieldNumber = 5,
+    kDoubleValFieldNumber = 6,
+    kIntValFieldNumber = 7,
+    kStringValFieldNumber = 8,
+    kScomplexValFieldNumber = 9,
+    kInt64ValFieldNumber = 10,
+    kBoolValFieldNumber = 11,
+    kDcomplexValFieldNumber = 12,
+    kHalfValFieldNumber = 13,
+    kTensorContentFieldNumber = 4,
+    kTensorShapeFieldNumber = 2,
+    kDtypeFieldNumber = 1,
+    kVersionNumberFieldNumber = 3,
+  };
   // repeated float float_val = 5 [packed = true];
   int float_val_size() const;
+  private:
+  int _internal_float_val_size() const;
+  public:
   void clear_float_val();
-  static const int kFloatValFieldNumber = 5;
+  private:
+  float _internal_float_val(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_float_val() const;
+  void _internal_add_float_val(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_float_val();
+  public:
   float float_val(int index) const;
   void set_float_val(int index, float value);
   void add_float_val(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       float_val() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_float_val();
 
   // repeated double double_val = 6 [packed = true];
   int double_val_size() const;
+  private:
+  int _internal_double_val_size() const;
+  public:
   void clear_double_val();
-  static const int kDoubleValFieldNumber = 6;
+  private:
+  double _internal_double_val(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+      _internal_double_val() const;
+  void _internal_add_double_val(double value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+      _internal_mutable_double_val();
+  public:
   double double_val(int index) const;
   void set_double_val(int index, double value);
   void add_double_val(double value);
-  const ::google::protobuf::RepeatedField< double >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
       double_val() const;
-  ::google::protobuf::RepeatedField< double >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
       mutable_double_val();
 
   // repeated int32 int_val = 7 [packed = true];
   int int_val_size() const;
+  private:
+  int _internal_int_val_size() const;
+  public:
   void clear_int_val();
-  static const int kIntValFieldNumber = 7;
-  ::google::protobuf::int32 int_val(int index) const;
-  void set_int_val(int index, ::google::protobuf::int32 value);
-  void add_int_val(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_int_val(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_int_val() const;
+  void _internal_add_int_val(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_int_val();
+  public:
+  int32_t int_val(int index) const;
+  void set_int_val(int index, int32_t value);
+  void add_int_val(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       int_val() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_int_val();
 
   // repeated bytes string_val = 8;
   int string_val_size() const;
+  private:
+  int _internal_string_val_size() const;
+  public:
   void clear_string_val();
-  static const int kStringValFieldNumber = 8;
-  const ::std::string& string_val(int index) const;
-  ::std::string* mutable_string_val(int index);
-  void set_string_val(int index, const ::std::string& value);
-  #if LANG_CXX11
-  void set_string_val(int index, ::std::string&& value);
-  #endif
+  const std::string& string_val(int index) const;
+  std::string* mutable_string_val(int index);
+  void set_string_val(int index, const std::string& value);
+  void set_string_val(int index, std::string&& value);
   void set_string_val(int index, const char* value);
   void set_string_val(int index, const void* value, size_t size);
-  ::std::string* add_string_val();
-  void add_string_val(const ::std::string& value);
-  #if LANG_CXX11
-  void add_string_val(::std::string&& value);
-  #endif
+  std::string* add_string_val();
+  void add_string_val(const std::string& value);
+  void add_string_val(std::string&& value);
   void add_string_val(const char* value);
   void add_string_val(const void* value, size_t size);
-  const ::google::protobuf::RepeatedPtrField< ::std::string>& string_val() const;
-  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_string_val();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& string_val() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_string_val();
+  private:
+  const std::string& _internal_string_val(int index) const;
+  std::string* _internal_add_string_val();
+  public:
 
   // repeated float scomplex_val = 9 [packed = true];
   int scomplex_val_size() const;
+  private:
+  int _internal_scomplex_val_size() const;
+  public:
   void clear_scomplex_val();
-  static const int kScomplexValFieldNumber = 9;
+  private:
+  float _internal_scomplex_val(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+      _internal_scomplex_val() const;
+  void _internal_add_scomplex_val(float value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+      _internal_mutable_scomplex_val();
+  public:
   float scomplex_val(int index) const;
   void set_scomplex_val(int index, float value);
   void add_scomplex_val(float value);
-  const ::google::protobuf::RepeatedField< float >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
       scomplex_val() const;
-  ::google::protobuf::RepeatedField< float >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
       mutable_scomplex_val();
 
   // repeated int64 int64_val = 10 [packed = true];
   int int64_val_size() const;
+  private:
+  int _internal_int64_val_size() const;
+  public:
   void clear_int64_val();
-  static const int kInt64ValFieldNumber = 10;
-  ::google::protobuf::int64 int64_val(int index) const;
-  void set_int64_val(int index, ::google::protobuf::int64 value);
-  void add_int64_val(::google::protobuf::int64 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+  private:
+  int64_t _internal_int64_val(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+      _internal_int64_val() const;
+  void _internal_add_int64_val(int64_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+      _internal_mutable_int64_val();
+  public:
+  int64_t int64_val(int index) const;
+  void set_int64_val(int index, int64_t value);
+  void add_int64_val(int64_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
       int64_val() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
       mutable_int64_val();
 
   // repeated bool bool_val = 11 [packed = true];
   int bool_val_size() const;
+  private:
+  int _internal_bool_val_size() const;
+  public:
   void clear_bool_val();
-  static const int kBoolValFieldNumber = 11;
+  private:
+  bool _internal_bool_val(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
+      _internal_bool_val() const;
+  void _internal_add_bool_val(bool value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
+      _internal_mutable_bool_val();
+  public:
   bool bool_val(int index) const;
   void set_bool_val(int index, bool value);
   void add_bool_val(bool value);
-  const ::google::protobuf::RepeatedField< bool >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
       bool_val() const;
-  ::google::protobuf::RepeatedField< bool >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
       mutable_bool_val();
 
   // repeated double dcomplex_val = 12 [packed = true];
   int dcomplex_val_size() const;
+  private:
+  int _internal_dcomplex_val_size() const;
+  public:
   void clear_dcomplex_val();
-  static const int kDcomplexValFieldNumber = 12;
+  private:
+  double _internal_dcomplex_val(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+      _internal_dcomplex_val() const;
+  void _internal_add_dcomplex_val(double value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+      _internal_mutable_dcomplex_val();
+  public:
   double dcomplex_val(int index) const;
   void set_dcomplex_val(int index, double value);
   void add_dcomplex_val(double value);
-  const ::google::protobuf::RepeatedField< double >&
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
       dcomplex_val() const;
-  ::google::protobuf::RepeatedField< double >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
       mutable_dcomplex_val();
 
   // repeated int32 half_val = 13 [packed = true];
   int half_val_size() const;
+  private:
+  int _internal_half_val_size() const;
+  public:
   void clear_half_val();
-  static const int kHalfValFieldNumber = 13;
-  ::google::protobuf::int32 half_val(int index) const;
-  void set_half_val(int index, ::google::protobuf::int32 value);
-  void add_half_val(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_half_val(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_half_val() const;
+  void _internal_add_half_val(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_half_val();
+  public:
+  int32_t half_val(int index) const;
+  void set_half_val(int index, int32_t value);
+  void add_half_val(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       half_val() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_half_val();
 
   // bytes tensor_content = 4;
   void clear_tensor_content();
-  static const int kTensorContentFieldNumber = 4;
-  const ::std::string& tensor_content() const;
-  void set_tensor_content(const ::std::string& value);
-  #if LANG_CXX11
-  void set_tensor_content(::std::string&& value);
-  #endif
-  void set_tensor_content(const char* value);
-  void set_tensor_content(const void* value, size_t size);
-  ::std::string* mutable_tensor_content();
-  ::std::string* release_tensor_content();
-  void set_allocated_tensor_content(::std::string* tensor_content);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_tensor_content();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_tensor_content(
-      ::std::string* tensor_content);
+  const std::string& tensor_content() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_tensor_content(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_tensor_content();
+  PROTOBUF_NODISCARD std::string* release_tensor_content();
+  void set_allocated_tensor_content(std::string* tensor_content);
+  private:
+  const std::string& _internal_tensor_content() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_tensor_content(const std::string& value);
+  std::string* _internal_mutable_tensor_content();
+  public:
 
   // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
   bool has_tensor_shape() const;
-  void clear_tensor_shape();
-  static const int kTensorShapeFieldNumber = 2;
   private:
-  void _slow_mutable_tensor_shape();
+  bool _internal_has_tensor_shape() const;
   public:
+  void clear_tensor_shape();
   const ::opencv_tensorflow::TensorShapeProto& tensor_shape() const;
-  ::opencv_tensorflow::TensorShapeProto* release_tensor_shape();
+  PROTOBUF_NODISCARD ::opencv_tensorflow::TensorShapeProto* release_tensor_shape();
   ::opencv_tensorflow::TensorShapeProto* mutable_tensor_shape();
   void set_allocated_tensor_shape(::opencv_tensorflow::TensorShapeProto* tensor_shape);
+  private:
+  const ::opencv_tensorflow::TensorShapeProto& _internal_tensor_shape() const;
+  ::opencv_tensorflow::TensorShapeProto* _internal_mutable_tensor_shape();
+  public:
   void unsafe_arena_set_allocated_tensor_shape(
       ::opencv_tensorflow::TensorShapeProto* tensor_shape);
   ::opencv_tensorflow::TensorShapeProto* unsafe_arena_release_tensor_shape();
 
   // .opencv_tensorflow.DataType dtype = 1;
   void clear_dtype();
-  static const int kDtypeFieldNumber = 1;
   ::opencv_tensorflow::DataType dtype() const;
   void set_dtype(::opencv_tensorflow::DataType value);
+  private:
+  ::opencv_tensorflow::DataType _internal_dtype() const;
+  void _internal_set_dtype(::opencv_tensorflow::DataType value);
+  public:
 
   // int32 version_number = 3;
   void clear_version_number();
-  static const int kVersionNumberFieldNumber = 3;
-  ::google::protobuf::int32 version_number() const;
-  void set_version_number(::google::protobuf::int32 value);
+  int32_t version_number() const;
+  void set_version_number(int32_t value);
+  private:
+  int32_t _internal_version_number() const;
+  void _internal_set_version_number(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.TensorProto)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedField< float > float_val_;
-  mutable int _float_val_cached_byte_size_;
-  ::google::protobuf::RepeatedField< double > double_val_;
-  mutable int _double_val_cached_byte_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > int_val_;
-  mutable int _int_val_cached_byte_size_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> string_val_;
-  ::google::protobuf::RepeatedField< float > scomplex_val_;
-  mutable int _scomplex_val_cached_byte_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > int64_val_;
-  mutable int _int64_val_cached_byte_size_;
-  ::google::protobuf::RepeatedField< bool > bool_val_;
-  mutable int _bool_val_cached_byte_size_;
-  ::google::protobuf::RepeatedField< double > dcomplex_val_;
-  mutable int _dcomplex_val_cached_byte_size_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > half_val_;
-  mutable int _half_val_cached_byte_size_;
-  ::google::protobuf::internal::ArenaStringPtr tensor_content_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > float_val_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > double_val_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > int_val_;
+  mutable std::atomic<int> _int_val_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> string_val_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > scomplex_val_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t > int64_val_;
+  mutable std::atomic<int> _int64_val_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool > bool_val_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > dcomplex_val_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > half_val_;
+  mutable std::atomic<int> _half_val_cached_byte_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr tensor_content_;
   ::opencv_tensorflow::TensorShapeProto* tensor_shape_;
   int dtype_;
-  ::google::protobuf::int32 version_number_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_tensor_2eproto::TableStruct;
-  friend void ::protobuf_tensor_2eproto::InitDefaultsTensorProtoImpl();
+  int32_t version_number_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_tensor_2eproto;
 };
 // ===================================================================
 
@@ -368,61 +494,98 @@ class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_poi
 inline void TensorProto::clear_dtype() {
   dtype_ = 0;
 }
+inline ::opencv_tensorflow::DataType TensorProto::_internal_dtype() const {
+  return static_cast< ::opencv_tensorflow::DataType >(dtype_);
+}
 inline ::opencv_tensorflow::DataType TensorProto::dtype() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.dtype)
-  return static_cast< ::opencv_tensorflow::DataType >(dtype_);
+  return _internal_dtype();
 }
-inline void TensorProto::set_dtype(::opencv_tensorflow::DataType value) {
+inline void TensorProto::_internal_set_dtype(::opencv_tensorflow::DataType value) {
 
   dtype_ = value;
+}
+inline void TensorProto::set_dtype(::opencv_tensorflow::DataType value) {
+  _internal_set_dtype(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.dtype)
 }
 
 // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
+inline bool TensorProto::_internal_has_tensor_shape() const {
+  return this != internal_default_instance() && tensor_shape_ != nullptr;
+}
 inline bool TensorProto::has_tensor_shape() const {
-  return this != internal_default_instance() && tensor_shape_ != NULL;
+  return _internal_has_tensor_shape();
 }
-inline const ::opencv_tensorflow::TensorShapeProto& TensorProto::tensor_shape() const {
+inline const ::opencv_tensorflow::TensorShapeProto& TensorProto::_internal_tensor_shape() const {
   const ::opencv_tensorflow::TensorShapeProto* p = tensor_shape_;
+  return p != nullptr ? *p : reinterpret_cast<const ::opencv_tensorflow::TensorShapeProto&>(
+      ::opencv_tensorflow::_TensorShapeProto_default_instance_);
+}
+inline const ::opencv_tensorflow::TensorShapeProto& TensorProto::tensor_shape() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.tensor_shape)
-  return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::TensorShapeProto*>(
-      &::opencv_tensorflow::_TensorShapeProto_default_instance_);
+  return _internal_tensor_shape();
+}
+inline void TensorProto::unsafe_arena_set_allocated_tensor_shape(
+    ::opencv_tensorflow::TensorShapeProto* tensor_shape) {
+  if (GetArenaForAllocation() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(tensor_shape_);
+  }
+  tensor_shape_ = tensor_shape;
+  if (tensor_shape) {
+
+  } else {
+
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.TensorProto.tensor_shape)
 }
 inline ::opencv_tensorflow::TensorShapeProto* TensorProto::release_tensor_shape() {
-  // @@protoc_insertion_point(field_release:opencv_tensorflow.TensorProto.tensor_shape)
 
   ::opencv_tensorflow::TensorShapeProto* temp = tensor_shape_;
-  if (GetArenaNoVirtual() != NULL) {
-    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
+  tensor_shape_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
   }
-  tensor_shape_ = NULL;
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::opencv_tensorflow::TensorShapeProto* TensorProto::unsafe_arena_release_tensor_shape() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.TensorProto.tensor_shape)
+  // @@protoc_insertion_point(field_release:opencv_tensorflow.TensorProto.tensor_shape)
 
   ::opencv_tensorflow::TensorShapeProto* temp = tensor_shape_;
-  tensor_shape_ = NULL;
+  tensor_shape_ = nullptr;
   return temp;
 }
-inline ::opencv_tensorflow::TensorShapeProto* TensorProto::mutable_tensor_shape() {
+inline ::opencv_tensorflow::TensorShapeProto* TensorProto::_internal_mutable_tensor_shape() {
 
-  if (tensor_shape_ == NULL) {
-    _slow_mutable_tensor_shape();
+  if (tensor_shape_ == nullptr) {
+    auto* p = CreateMaybeMessage<::opencv_tensorflow::TensorShapeProto>(GetArenaForAllocation());
+    tensor_shape_ = p;
   }
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorProto.tensor_shape)
   return tensor_shape_;
 }
+inline ::opencv_tensorflow::TensorShapeProto* TensorProto::mutable_tensor_shape() {
+  ::opencv_tensorflow::TensorShapeProto* _msg = _internal_mutable_tensor_shape();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorProto.tensor_shape)
+  return _msg;
+}
 inline void TensorProto::set_allocated_tensor_shape(::opencv_tensorflow::TensorShapeProto* tensor_shape) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_shape_);
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(tensor_shape_);
   }
   if (tensor_shape) {
-    ::google::protobuf::Arena* submessage_arena =
-      reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_shape)->GetArena();
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<
+            ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena(
+                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(tensor_shape));
     if (message_arena != submessage_arena) {
-      tensor_shape = ::google::protobuf::internal::GetOwnedMessage(
+      tensor_shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, tensor_shape, submessage_arena);
     }
 
@@ -437,238 +600,297 @@ inline void TensorProto::set_allocated_tensor_shape(::opencv_tensorflow::TensorS
 inline void TensorProto::clear_version_number() {
   version_number_ = 0;
 }
-inline ::google::protobuf::int32 TensorProto::version_number() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.version_number)
+inline int32_t TensorProto::_internal_version_number() const {
   return version_number_;
 }
-inline void TensorProto::set_version_number(::google::protobuf::int32 value) {
+inline int32_t TensorProto::version_number() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.version_number)
+  return _internal_version_number();
+}
+inline void TensorProto::_internal_set_version_number(int32_t value) {
 
   version_number_ = value;
+}
+inline void TensorProto::set_version_number(int32_t value) {
+  _internal_set_version_number(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.version_number)
 }
 
 // bytes tensor_content = 4;
 inline void TensorProto::clear_tensor_content() {
-  tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  tensor_content_.ClearToEmpty();
 }
-inline const ::std::string& TensorProto::tensor_content() const {
+inline const std::string& TensorProto::tensor_content() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.tensor_content)
-  return tensor_content_.Get();
+  return _internal_tensor_content();
 }
-inline void TensorProto::set_tensor_content(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TensorProto::set_tensor_content(ArgT0&& arg0, ArgT... args) {
 
 tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
tensor_content_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.tensor_content)
 }
-#if LANG_CXX11
-inline void TensorProto::set_tensor_content(::std::string&& value) {
-
-  tensor_content_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.TensorProto.tensor_content)
+inline std::string* TensorProto::mutable_tensor_content() {
+  std::string* _s = _internal_mutable_tensor_content();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorProto.tensor_content)
+  return _s;
 }
-#endif
-inline void TensorProto::set_tensor_content(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-
-  tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
-              GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_char:opencv_tensorflow.TensorProto.tensor_content)
+inline const std::string& TensorProto::_internal_tensor_content() const {
+  return tensor_content_.Get();
 }
-inline void TensorProto::set_tensor_content(const void* value,
-    size_t size) {
+inline void TensorProto::_internal_set_tensor_content(const std::string& value) {
 
-  tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.TensorProto.tensor_content)
+  tensor_content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* TensorProto::mutable_tensor_content() {
+inline std::string* TensorProto::_internal_mutable_tensor_content() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorProto.tensor_content)
-  return tensor_content_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return tensor_content_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* TensorProto::release_tensor_content() {
+inline std::string* TensorProto::release_tensor_content() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.TensorProto.tensor_content)
-
-  return tensor_content_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return tensor_content_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void TensorProto::set_allocated_tensor_content(::std::string* tensor_content) {
-  if (tensor_content != NULL) {
+inline void TensorProto::set_allocated_tensor_content(std::string* tensor_content) {
+  if (tensor_content != nullptr) {
 
   } else {
 
   }
-  tensor_content_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_content,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.TensorProto.tensor_content)
-}
-inline ::std::string* TensorProto::unsafe_arena_release_tensor_content() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.TensorProto.tensor_content)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return tensor_content_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void TensorProto::unsafe_arena_set_allocated_tensor_content(
-    ::std::string* tensor_content) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (tensor_content != NULL) {
-
-  } else {
-
+  tensor_content_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), tensor_content,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (tensor_content_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    tensor_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  tensor_content_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      tensor_content, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.TensorProto.tensor_content)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.TensorProto.tensor_content)
 }
 
 // repeated int32 half_val = 13 [packed = true];
-inline int TensorProto::half_val_size() const {
+inline int TensorProto::_internal_half_val_size() const {
   return half_val_.size();
 }
+inline int TensorProto::half_val_size() const {
+  return _internal_half_val_size();
+}
 inline void TensorProto::clear_half_val() {
   half_val_.Clear();
 }
-inline ::google::protobuf::int32 TensorProto::half_val(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.half_val)
+inline int32_t TensorProto::_internal_half_val(int index) const {
   return half_val_.Get(index);
 }
-inline void TensorProto::set_half_val(int index, ::google::protobuf::int32 value) {
+inline int32_t TensorProto::half_val(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.half_val)
+  return _internal_half_val(index);
+}
+inline void TensorProto::set_half_val(int index, int32_t value) {
   half_val_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.half_val)
 }
-inline void TensorProto::add_half_val(::google::protobuf::int32 value) {
+inline void TensorProto::_internal_add_half_val(int32_t value) {
   half_val_.Add(value);
+}
+inline void TensorProto::add_half_val(int32_t value) {
+  _internal_add_half_val(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.half_val)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+TensorProto::_internal_half_val() const {
+  return half_val_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 TensorProto::half_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.half_val)
-  return half_val_;
+  return _internal_half_val();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+TensorProto::_internal_mutable_half_val() {
+  return &half_val_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 TensorProto::mutable_half_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.half_val)
-  return &half_val_;
+  return _internal_mutable_half_val();
 }
 
 // repeated float float_val = 5 [packed = true];
-inline int TensorProto::float_val_size() const {
+inline int TensorProto::_internal_float_val_size() const {
   return float_val_.size();
 }
+inline int TensorProto::float_val_size() const {
+  return _internal_float_val_size();
+}
 inline void TensorProto::clear_float_val() {
   float_val_.Clear();
 }
+inline float TensorProto::_internal_float_val(int index) const {
+  return float_val_.Get(index);
+}
 inline float TensorProto::float_val(int index) const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.float_val)
-  return float_val_.Get(index);
+  return _internal_float_val(index);
 }
 inline void TensorProto::set_float_val(int index, float value) {
   float_val_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.float_val)
 }
-inline void TensorProto::add_float_val(float value) {
+inline void TensorProto::_internal_add_float_val(float value) {
   float_val_.Add(value);
+}
+inline void TensorProto::add_float_val(float value) {
+  _internal_add_float_val(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.float_val)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+TensorProto::_internal_float_val() const {
+  return float_val_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 TensorProto::float_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.float_val)
-  return float_val_;
+  return _internal_float_val();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+TensorProto::_internal_mutable_float_val() {
+  return &float_val_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 TensorProto::mutable_float_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.float_val)
-  return &float_val_;
+  return _internal_mutable_float_val();
 }
 
 // repeated double double_val = 6 [packed = true];
-inline int TensorProto::double_val_size() const {
+inline int TensorProto::_internal_double_val_size() const {
   return double_val_.size();
 }
+inline int TensorProto::double_val_size() const {
+  return _internal_double_val_size();
+}
 inline void TensorProto::clear_double_val() {
   double_val_.Clear();
 }
+inline double TensorProto::_internal_double_val(int index) const {
+  return double_val_.Get(index);
+}
 inline double TensorProto::double_val(int index) const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.double_val)
-  return double_val_.Get(index);
+  return _internal_double_val(index);
 }
 inline void TensorProto::set_double_val(int index, double value) {
   double_val_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.double_val)
 }
-inline void TensorProto::add_double_val(double value) {
+inline void TensorProto::_internal_add_double_val(double value) {
   double_val_.Add(value);
+}
+inline void TensorProto::add_double_val(double value) {
+  _internal_add_double_val(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.double_val)
 }
-inline const ::google::protobuf::RepeatedField< double >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+TensorProto::_internal_double_val() const {
+  return double_val_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
 TensorProto::double_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.double_val)
-  return double_val_;
+  return _internal_double_val();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+TensorProto::_internal_mutable_double_val() {
+  return &double_val_;
 }
-inline ::google::protobuf::RepeatedField< double >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
 TensorProto::mutable_double_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.double_val)
-  return &double_val_;
+  return _internal_mutable_double_val();
 }
 
 // repeated int32 int_val = 7 [packed = true];
-inline int TensorProto::int_val_size() const {
+inline int TensorProto::_internal_int_val_size() const {
   return int_val_.size();
 }
+inline int TensorProto::int_val_size() const {
+  return _internal_int_val_size();
+}
 inline void TensorProto::clear_int_val() {
   int_val_.Clear();
 }
-inline ::google::protobuf::int32 TensorProto::int_val(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.int_val)
+inline int32_t TensorProto::_internal_int_val(int index) const {
   return int_val_.Get(index);
 }
-inline void TensorProto::set_int_val(int index, ::google::protobuf::int32 value) {
+inline int32_t TensorProto::int_val(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.int_val)
+  return _internal_int_val(index);
+}
+inline void TensorProto::set_int_val(int index, int32_t value) {
   int_val_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.int_val)
 }
-inline void TensorProto::add_int_val(::google::protobuf::int32 value) {
+inline void TensorProto::_internal_add_int_val(int32_t value) {
   int_val_.Add(value);
+}
+inline void TensorProto::add_int_val(int32_t value) {
+  _internal_add_int_val(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.int_val)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+TensorProto::_internal_int_val() const {
+  return int_val_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 TensorProto::int_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.int_val)
-  return int_val_;
+  return _internal_int_val();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+TensorProto::_internal_mutable_int_val() {
+  return &int_val_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 TensorProto::mutable_int_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.int_val)
-  return &int_val_;
+  return _internal_mutable_int_val();
 }
 
 // repeated bytes string_val = 8;
-inline int TensorProto::string_val_size() const {
+inline int TensorProto::_internal_string_val_size() const {
   return string_val_.size();
 }
+inline int TensorProto::string_val_size() const {
+  return _internal_string_val_size();
+}
 inline void TensorProto::clear_string_val() {
   string_val_.Clear();
 }
-inline const ::std::string& TensorProto::string_val(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.string_val)
+inline std::string* TensorProto::add_string_val() {
+  std::string* _s = _internal_add_string_val();
+  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.TensorProto.string_val)
+  return _s;
+}
+inline const std::string& TensorProto::_internal_string_val(int index) const {
   return string_val_.Get(index);
 }
-inline ::std::string* TensorProto::mutable_string_val(int index) {
+inline const std::string& TensorProto::string_val(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.string_val)
+  return _internal_string_val(index);
+}
+inline std::string* TensorProto::mutable_string_val(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorProto.string_val)
   return string_val_.Mutable(index);
 }
-inline void TensorProto::set_string_val(int index, const ::std::string& value) {
-  // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.string_val)
+inline void TensorProto::set_string_val(int index, const std::string& value) {
   string_val_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-inline void TensorProto::set_string_val(int index, ::std::string&& value) {
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.string_val)
+}
+inline void TensorProto::set_string_val(int index, std::string&& value) {
   string_val_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.string_val)
 }
-#endif
 inline void TensorProto::set_string_val(int index, const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   string_val_.Mutable(index)->assign(value);
   // @@protoc_insertion_point(field_set_char:opencv_tensorflow.TensorProto.string_val)
 }
@@ -677,22 +899,19 @@ inline void TensorProto::set_string_val(int index, const void* value, size_t siz
     reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.TensorProto.string_val)
 }
-inline ::std::string* TensorProto::add_string_val() {
-  // @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.TensorProto.string_val)
+inline std::string* TensorProto::_internal_add_string_val() {
   return string_val_.Add();
 }
-inline void TensorProto::add_string_val(const ::std::string& value) {
+inline void TensorProto::add_string_val(const std::string& value) {
   string_val_.Add()->assign(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.string_val)
 }
-#if LANG_CXX11
-inline void TensorProto::add_string_val(::std::string&& value) {
+inline void TensorProto::add_string_val(std::string&& value) {
   string_val_.Add(std::move(value));
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.string_val)
 }
-#endif
 inline void TensorProto::add_string_val(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
+  GOOGLE_DCHECK(value != nullptr);
   string_val_.Add()->assign(value);
   // @@protoc_insertion_point(field_add_char:opencv_tensorflow.TensorProto.string_val)
 }
@@ -700,135 +919,203 @@ inline void TensorProto::add_string_val(const void* value, size_t size) {
   string_val_.Add()->assign(reinterpret_cast<const char*>(value), size);
   // @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.TensorProto.string_val)
 }
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
 TensorProto::string_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.string_val)
   return string_val_;
 }
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
 TensorProto::mutable_string_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.string_val)
   return &string_val_;
 }
 
 // repeated float scomplex_val = 9 [packed = true];
-inline int TensorProto::scomplex_val_size() const {
+inline int TensorProto::_internal_scomplex_val_size() const {
   return scomplex_val_.size();
 }
+inline int TensorProto::scomplex_val_size() const {
+  return _internal_scomplex_val_size();
+}
 inline void TensorProto::clear_scomplex_val() {
   scomplex_val_.Clear();
 }
+inline float TensorProto::_internal_scomplex_val(int index) const {
+  return scomplex_val_.Get(index);
+}
 inline float TensorProto::scomplex_val(int index) const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.scomplex_val)
-  return scomplex_val_.Get(index);
+  return _internal_scomplex_val(index);
 }
 inline void TensorProto::set_scomplex_val(int index, float value) {
   scomplex_val_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.scomplex_val)
 }
-inline void TensorProto::add_scomplex_val(float value) {
+inline void TensorProto::_internal_add_scomplex_val(float value) {
   scomplex_val_.Add(value);
+}
+inline void TensorProto::add_scomplex_val(float value) {
+  _internal_add_scomplex_val(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.scomplex_val)
 }
-inline const ::google::protobuf::RepeatedField< float >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
+TensorProto::_internal_scomplex_val() const {
+  return scomplex_val_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >&
 TensorProto::scomplex_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.scomplex_val)
-  return scomplex_val_;
+  return _internal_scomplex_val();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
+TensorProto::_internal_mutable_scomplex_val() {
+  return &scomplex_val_;
 }
-inline ::google::protobuf::RepeatedField< float >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >*
 TensorProto::mutable_scomplex_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.scomplex_val)
-  return &scomplex_val_;
+  return _internal_mutable_scomplex_val();
 }
 
 // repeated int64 int64_val = 10 [packed = true];
-inline int TensorProto::int64_val_size() const {
+inline int TensorProto::_internal_int64_val_size() const {
   return int64_val_.size();
 }
+inline int TensorProto::int64_val_size() const {
+  return _internal_int64_val_size();
+}
 inline void TensorProto::clear_int64_val() {
   int64_val_.Clear();
 }
-inline ::google::protobuf::int64 TensorProto::int64_val(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.int64_val)
+inline int64_t TensorProto::_internal_int64_val(int index) const {
   return int64_val_.Get(index);
 }
-inline void TensorProto::set_int64_val(int index, ::google::protobuf::int64 value) {
+inline int64_t TensorProto::int64_val(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.int64_val)
+  return _internal_int64_val(index);
+}
+inline void TensorProto::set_int64_val(int index, int64_t value) {
   int64_val_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.int64_val)
 }
-inline void TensorProto::add_int64_val(::google::protobuf::int64 value) {
+inline void TensorProto::_internal_add_int64_val(int64_t value) {
   int64_val_.Add(value);
+}
+inline void TensorProto::add_int64_val(int64_t value) {
+  _internal_add_int64_val(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.int64_val)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
+TensorProto::_internal_int64_val() const {
+  return int64_val_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >&
 TensorProto::int64_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.int64_val)
-  return int64_val_;
+  return _internal_int64_val();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
+TensorProto::_internal_mutable_int64_val() {
+  return &int64_val_;
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >*
 TensorProto::mutable_int64_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.int64_val)
-  return &int64_val_;
+  return _internal_mutable_int64_val();
 }
 
 // repeated bool bool_val = 11 [packed = true];
-inline int TensorProto::bool_val_size() const {
+inline int TensorProto::_internal_bool_val_size() const {
   return bool_val_.size();
 }
+inline int TensorProto::bool_val_size() const {
+  return _internal_bool_val_size();
+}
 inline void TensorProto::clear_bool_val() {
   bool_val_.Clear();
 }
+inline bool TensorProto::_internal_bool_val(int index) const {
+  return bool_val_.Get(index);
+}
 inline bool TensorProto::bool_val(int index) const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.bool_val)
-  return bool_val_.Get(index);
+  return _internal_bool_val(index);
 }
 inline void TensorProto::set_bool_val(int index, bool value) {
   bool_val_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.bool_val)
 }
-inline void TensorProto::add_bool_val(bool value) {
+inline void TensorProto::_internal_add_bool_val(bool value) {
   bool_val_.Add(value);
+}
+inline void TensorProto::add_bool_val(bool value) {
+  _internal_add_bool_val(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.bool_val)
 }
-inline const ::google::protobuf::RepeatedField< bool >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
+TensorProto::_internal_bool_val() const {
+  return bool_val_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >&
 TensorProto::bool_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.bool_val)
-  return bool_val_;
+  return _internal_bool_val();
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
+TensorProto::_internal_mutable_bool_val() {
+  return &bool_val_;
 }
-inline ::google::protobuf::RepeatedField< bool >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >*
 TensorProto::mutable_bool_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.bool_val)
-  return &bool_val_;
+  return _internal_mutable_bool_val();
 }
 
 // repeated double dcomplex_val = 12 [packed = true];
-inline int TensorProto::dcomplex_val_size() const {
+inline int TensorProto::_internal_dcomplex_val_size() const {
   return dcomplex_val_.size();
 }
+inline int TensorProto::dcomplex_val_size() const {
+  return _internal_dcomplex_val_size();
+}
 inline void TensorProto::clear_dcomplex_val() {
   dcomplex_val_.Clear();
 }
+inline double TensorProto::_internal_dcomplex_val(int index) const {
+  return dcomplex_val_.Get(index);
+}
 inline double TensorProto::dcomplex_val(int index) const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.dcomplex_val)
-  return dcomplex_val_.Get(index);
+  return _internal_dcomplex_val(index);
 }
 inline void TensorProto::set_dcomplex_val(int index, double value) {
   dcomplex_val_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.dcomplex_val)
 }
-inline void TensorProto::add_dcomplex_val(double value) {
+inline void TensorProto::_internal_add_dcomplex_val(double value) {
   dcomplex_val_.Add(value);
+}
+inline void TensorProto::add_dcomplex_val(double value) {
+  _internal_add_dcomplex_val(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.dcomplex_val)
 }
-inline const ::google::protobuf::RepeatedField< double >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
+TensorProto::_internal_dcomplex_val() const {
+  return dcomplex_val_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >&
 TensorProto::dcomplex_val() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.dcomplex_val)
-  return dcomplex_val_;
+  return _internal_dcomplex_val();
 }
-inline ::google::protobuf::RepeatedField< double >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
+TensorProto::_internal_mutable_dcomplex_val() {
+  return &dcomplex_val_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >*
 TensorProto::mutable_dcomplex_val() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.dcomplex_val)
-  return &dcomplex_val_;
+  return _internal_mutable_dcomplex_val();
 }
 
 #ifdef __GNUC__
@@ -841,4 +1128,5 @@ TensorProto::mutable_dcomplex_val() {
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_tensor_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_tensor_2eproto
index c55c202..2934613 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_tensorflow {
-class TensorShapeProto_DimDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TensorShapeProto_Dim>
-      _instance;
-} _TensorShapeProto_Dim_default_instance_;
-class TensorShapeProtoDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<TensorShapeProto>
-      _instance;
-} _TensorShapeProto_default_instance_;
+constexpr TensorShapeProto_Dim::TensorShapeProto_Dim(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
+  , size_(int64_t{0}){}
+struct TensorShapeProto_DimDefaultTypeInternal {
+  constexpr TensorShapeProto_DimDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TensorShapeProto_DimDefaultTypeInternal() {}
+  union {
+    TensorShapeProto_Dim _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorShapeProto_DimDefaultTypeInternal _TensorShapeProto_Dim_default_instance_;
+constexpr TensorShapeProto::TensorShapeProto(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : dim_()
+  , unknown_rank_(false){}
+struct TensorShapeProtoDefaultTypeInternal {
+  constexpr TensorShapeProtoDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~TensorShapeProtoDefaultTypeInternal() {}
+  union {
+    TensorShapeProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorShapeProtoDefaultTypeInternal _TensorShapeProto_default_instance_;
 }  // namespace opencv_tensorflow
-namespace protobuf_tensor_5fshape_2eproto {
-void InitDefaultsTensorShapeProto_DimImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_tensorflow::_TensorShapeProto_Dim_default_instance_;
-    new (ptr) ::opencv_tensorflow::TensorShapeProto_Dim();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::TensorShapeProto_Dim::InitAsDefaultInstance();
-}
-
-void InitDefaultsTensorShapeProto_Dim() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTensorShapeProto_DimImpl);
-}
-
-void InitDefaultsTensorShapeProtoImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto_Dim();
-  {
-    void* ptr = &::opencv_tensorflow::_TensorShapeProto_default_instance_;
-    new (ptr) ::opencv_tensorflow::TensorShapeProto();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::TensorShapeProto::InitAsDefaultInstance();
-}
-
-void InitDefaultsTensorShapeProto() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTensorShapeProtoImpl);
-}
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensor_5fshape_2eproto[2];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensor_5fshape_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensor_5fshape_2eproto = nullptr;
 
-::google::protobuf::Metadata file_level_metadata[2];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+const uint32_t TableStruct_tensor_5fshape_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, size_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, name_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, size_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, name_),
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, dim_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, unknown_rank_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, dim_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, unknown_rank_),
 };
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, -1, sizeof(::opencv_tensorflow::TensorShapeProto_Dim)},
-  { 7, -1, sizeof(::opencv_tensorflow::TensorShapeProto)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::opencv_tensorflow::TensorShapeProto_Dim)},
+  { 8, -1, -1, sizeof(::opencv_tensorflow::TensorShapeProto)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_TensorShapeProto_Dim_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_TensorShapeProto_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_TensorShapeProto_Dim_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_TensorShapeProto_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "tensor_shape.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\022tensor_shape.proto\022\021opencv_tensorflow\""
-      "\201\001\n\020TensorShapeProto\0224\n\003dim\030\002 \003(\0132\'.open"
-      "cv_tensorflow.TensorShapeProto.Dim\022\024\n\014un"
-      "known_rank\030\003 \001(\010\032!\n\003Dim\022\014\n\004size\030\001 \001(\003\022\014\n"
-      "\004name\030\002 \001(\tB2\n\030org.tensorflow.frameworkB"
-      "\021TensorShapeProtosP\001\370\001\001b\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 231);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "tensor_shape.proto", &protobuf_RegisterTypes);
+const char descriptor_table_protodef_tensor_5fshape_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\022tensor_shape.proto\022\021opencv_tensorflow\""
+  "\201\001\n\020TensorShapeProto\0224\n\003dim\030\002 \003(\0132\'.open"
+  "cv_tensorflow.TensorShapeProto.Dim\022\024\n\014un"
+  "known_rank\030\003 \001(\010\032!\n\003Dim\022\014\n\004size\030\001 \001(\003\022\014\n"
+  "\004name\030\002 \001(\tB2\n\030org.tensorflow.frameworkB"
+  "\021TensorShapeProtosP\001\370\001\001b\006proto3"
+  ;
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensor_5fshape_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensor_5fshape_2eproto = {
+  false, false, 231, descriptor_table_protodef_tensor_5fshape_2eproto, "tensor_shape.proto",
+  &descriptor_table_tensor_5fshape_2eproto_once, nullptr, 0, 2,
+  schemas, file_default_instances, TableStruct_tensor_5fshape_2eproto::offsets,
+  file_level_metadata_tensor_5fshape_2eproto, file_level_enum_descriptors_tensor_5fshape_2eproto, file_level_service_descriptors_tensor_5fshape_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_tensor_5fshape_2eproto_getter() {
+  return &descriptor_table_tensor_5fshape_2eproto;
 }
 
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_tensor_5fshape_2eproto
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_tensor_5fshape_2eproto(&descriptor_table_tensor_5fshape_2eproto);
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-void TensorShapeProto_Dim::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TensorShapeProto_Dim::kSizeFieldNumber;
-const int TensorShapeProto_Dim::kNameFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class TensorShapeProto_Dim::_Internal {
+ public:
+};
 
-TensorShapeProto_Dim::TensorShapeProto_Dim()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto_Dim();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.TensorShapeProto.Dim)
-}
-TensorShapeProto_Dim::TensorShapeProto_Dim(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena) {
-  ::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto_Dim();
+TensorShapeProto_Dim::TensorShapeProto_Dim(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.TensorShapeProto.Dim)
 }
 TensorShapeProto_Dim::TensorShapeProto_Dim(const TensorShapeProto_Dim& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.name().size() > 0) {
-    name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
-      GetArenaNoVirtual());
+  : ::PROTOBUF_NAMESPACE_ID::Message() {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_name().empty()) {
+    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
+      GetArenaForAllocation());
   }
   size_ = from.size_;
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.TensorShapeProto.Dim)
 }
 
-void TensorShapeProto_Dim::SharedCtor() {
-  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  size_ = GOOGLE_LONGLONG(0);
-  _cached_size_ = 0;
+inline void TensorShapeProto_Dim::SharedCtor() {
+name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+size_ = int64_t{0};
 }
 
 TensorShapeProto_Dim::~TensorShapeProto_Dim() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.TensorShapeProto.Dim)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TensorShapeProto_Dim::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
-  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline void TensorShapeProto_Dim::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
 }
 
 void TensorShapeProto_Dim::ArenaDtor(void* object) {
   TensorShapeProto_Dim* _this = reinterpret_cast< TensorShapeProto_Dim* >(object);
   (void)_this;
 }
-void TensorShapeProto_Dim::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void TensorShapeProto_Dim::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void TensorShapeProto_Dim::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TensorShapeProto_Dim::descriptor() {
-  ::protobuf_tensor_5fshape_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_tensor_5fshape_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const TensorShapeProto_Dim& TensorShapeProto_Dim::default_instance() {
-  ::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto_Dim();
-  return *internal_default_instance();
-}
-
-TensorShapeProto_Dim* TensorShapeProto_Dim::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<TensorShapeProto_Dim>(arena);
+  _cached_size_.Set(size);
 }
 
 void TensorShapeProto_Dim::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.TensorShapeProto.Dim)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-  size_ = GOOGLE_LONGLONG(0);
-  _internal_metadata_.Clear();
-}
-
-bool TensorShapeProto_Dim::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:opencv_tensorflow.TensorShapeProto.Dim)
-  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)) {
+  name_.ClearToEmpty();
+  size_ = int64_t{0};
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TensorShapeProto_Dim::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // int64 size = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &size_)));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // string name = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_name()));
-          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->name().data(), static_cast<int>(this->name().length()),
-            ::google::protobuf::internal::WireFormatLite::PARSE,
-            "opencv_tensorflow.TensorShapeProto.Dim.name"));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          auto str = _internal_mutable_name();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "opencv_tensorflow.TensorShapeProto.Dim.name"));
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.TensorShapeProto.Dim)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.TensorShapeProto.Dim)
-  return false;
-#undef DO_
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-void TensorShapeProto_Dim::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.TensorShapeProto.Dim)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int64 size = 1;
-  if (this->size() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->size(), output);
-  }
-
-  // string name = 2;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "opencv_tensorflow.TensorShapeProto.Dim.name");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      2, this->name(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.TensorShapeProto.Dim)
-}
-
-::google::protobuf::uint8* TensorShapeProto_Dim::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TensorShapeProto_Dim::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.TensorShapeProto.Dim)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // int64 size = 1;
-  if (this->size() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->size(), target);
+  if (this->_internal_size() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_size(), target);
   }
 
   // string name = 2;
-  if (this->name().size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->name().data(), static_cast<int>(this->name().length()),
-      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+  if (!this->_internal_name().empty()) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
       "opencv_tensorflow.TensorShapeProto.Dim.name");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        2, this->name(), target);
+    target = stream->WriteStringMaybeAliased(
+        2, this->_internal_name(), target);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.TensorShapeProto.Dim)
   return target;
@@ -365,67 +251,51 @@ size_t TensorShapeProto_Dim::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.TensorShapeProto.Dim)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // string name = 2;
-  if (this->name().size() > 0) {
+  if (!this->_internal_name().empty()) {
     total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->name());
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_name());
   }
 
   // int64 size = 1;
-  if (this->size() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int64Size(
-        this->size());
+  if (this->_internal_size() != 0) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_size());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TensorShapeProto_Dim::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.TensorShapeProto.Dim)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TensorShapeProto_Dim* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TensorShapeProto_Dim>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.TensorShapeProto.Dim)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.TensorShapeProto.Dim)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TensorShapeProto_Dim::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TensorShapeProto_Dim::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TensorShapeProto_Dim::GetClassData() const { return &_class_data_; }
+
+void TensorShapeProto_Dim::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TensorShapeProto_Dim *>(to)->MergeFrom(
+      static_cast<const TensorShapeProto_Dim &>(from));
 }
 
+
 void TensorShapeProto_Dim::MergeFrom(const TensorShapeProto_Dim& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.TensorShapeProto.Dim)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
-  if (from.name().size() > 0) {
-    set_name(from.name());
+  if (!from._internal_name().empty()) {
+    _internal_set_name(from._internal_name());
   }
-  if (from.size() != 0) {
-    set_size(from.size());
+  if (from._internal_size() != 0) {
+    _internal_set_size(from._internal_size());
   }
-}
-
-void TensorShapeProto_Dim::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.TensorShapeProto.Dim)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TensorShapeProto_Dim::CopyFrom(const TensorShapeProto_Dim& from) {
@@ -439,228 +309,158 @@ bool TensorShapeProto_Dim::IsInitialized() const {
   return true;
 }
 
-void TensorShapeProto_Dim::Swap(TensorShapeProto_Dim* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    TensorShapeProto_Dim* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void TensorShapeProto_Dim::UnsafeArenaSwap(TensorShapeProto_Dim* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void TensorShapeProto_Dim::InternalSwap(TensorShapeProto_Dim* other) {
   using std::swap;
-  name_.Swap(&other->name_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
   swap(size_, other->size_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata TensorShapeProto_Dim::GetMetadata() const {
-  protobuf_tensor_5fshape_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_tensor_5fshape_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TensorShapeProto_Dim::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_tensor_5fshape_2eproto_getter, &descriptor_table_tensor_5fshape_2eproto_once,
+      file_level_metadata_tensor_5fshape_2eproto[0]);
 }
 
-
 // ===================================================================
 
-void TensorShapeProto::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int TensorShapeProto::kDimFieldNumber;
-const int TensorShapeProto::kUnknownRankFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+class TensorShapeProto::_Internal {
+ public:
+};
 
-TensorShapeProto::TensorShapeProto()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.TensorShapeProto)
-}
-TensorShapeProto::TensorShapeProto(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+TensorShapeProto::TensorShapeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   dim_(arena) {
-  ::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.TensorShapeProto)
 }
 TensorShapeProto::TensorShapeProto(const TensorShapeProto& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      dim_(from.dim_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      dim_(from.dim_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   unknown_rank_ = from.unknown_rank_;
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.TensorShapeProto)
 }
 
-void TensorShapeProto::SharedCtor() {
-  unknown_rank_ = false;
-  _cached_size_ = 0;
+inline void TensorShapeProto::SharedCtor() {
+unknown_rank_ = false;
 }
 
 TensorShapeProto::~TensorShapeProto() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.TensorShapeProto)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void TensorShapeProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void TensorShapeProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void TensorShapeProto::ArenaDtor(void* object) {
   TensorShapeProto* _this = reinterpret_cast< TensorShapeProto* >(object);
   (void)_this;
 }
-void TensorShapeProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void TensorShapeProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void TensorShapeProto::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* TensorShapeProto::descriptor() {
-  ::protobuf_tensor_5fshape_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_tensor_5fshape_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const TensorShapeProto& TensorShapeProto::default_instance() {
-  ::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
-  return *internal_default_instance();
-}
-
-TensorShapeProto* TensorShapeProto::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<TensorShapeProto>(arena);
+  _cached_size_.Set(size);
 }
 
 void TensorShapeProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.TensorShapeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
   dim_.Clear();
   unknown_rank_ = false;
-  _internal_metadata_.Clear();
-}
-
-bool TensorShapeProto::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:opencv_tensorflow.TensorShapeProto)
-  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)) {
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* TensorShapeProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_dim()));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ptr = ctx->ParseMessage(_internal_add_dim(), ptr);
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // bool unknown_rank = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &unknown_rank_)));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          unknown_rank_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.TensorShapeProto)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.TensorShapeProto)
-  return false;
-#undef DO_
-}
-
-void TensorShapeProto::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.TensorShapeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->dim_size()); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      2, this->dim(static_cast<int>(i)), output);
-  }
-
-  // bool unknown_rank = 3;
-  if (this->unknown_rank() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->unknown_rank(), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.TensorShapeProto)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* TensorShapeProto::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* TensorShapeProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.TensorShapeProto)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
   for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->dim_size()); i < n; i++) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        2, this->dim(static_cast<int>(i)), deterministic, target);
+      n = static_cast<unsigned int>(this->_internal_dim_size()); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(2, this->_internal_dim(i), target, stream);
   }
 
   // bool unknown_rank = 3;
-  if (this->unknown_rank() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->unknown_rank(), target);
+  if (this->_internal_unknown_rank() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_unknown_rank(), target);
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.TensorShapeProto)
   return target;
@@ -670,67 +470,49 @@ size_t TensorShapeProto::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.TensorShapeProto)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
-  {
-    unsigned int count = static_cast<unsigned int>(this->dim_size());
-    total_size += 1UL * count;
-    for (unsigned int i = 0; i < count; i++) {
-      total_size +=
-        ::google::protobuf::internal::WireFormatLite::MessageSize(
-          this->dim(static_cast<int>(i)));
-    }
+  total_size += 1UL * this->_internal_dim_size();
+  for (const auto& msg : this->dim_) {
+    total_size +=
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
   }
 
   // bool unknown_rank = 3;
-  if (this->unknown_rank() != 0) {
+  if (this->_internal_unknown_rank() != 0) {
     total_size += 1 + 1;
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void TensorShapeProto::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.TensorShapeProto)
-  GOOGLE_DCHECK_NE(&from, this);
-  const TensorShapeProto* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const TensorShapeProto>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.TensorShapeProto)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.TensorShapeProto)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TensorShapeProto::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    TensorShapeProto::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TensorShapeProto::GetClassData() const { return &_class_data_; }
+
+void TensorShapeProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<TensorShapeProto *>(to)->MergeFrom(
+      static_cast<const TensorShapeProto &>(from));
 }
 
+
 void TensorShapeProto::MergeFrom(const TensorShapeProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.TensorShapeProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   dim_.MergeFrom(from.dim_);
-  if (from.unknown_rank() != 0) {
-    set_unknown_rank(from.unknown_rank());
+  if (from._internal_unknown_rank() != 0) {
+    _internal_set_unknown_rank(from._internal_unknown_rank());
   }
-}
-
-void TensorShapeProto::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.TensorShapeProto)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void TensorShapeProto::CopyFrom(const TensorShapeProto& from) {
@@ -744,40 +526,29 @@ bool TensorShapeProto::IsInitialized() const {
   return true;
 }
 
-void TensorShapeProto::Swap(TensorShapeProto* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    TensorShapeProto* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void TensorShapeProto::UnsafeArenaSwap(TensorShapeProto* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void TensorShapeProto::InternalSwap(TensorShapeProto* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   dim_.InternalSwap(&other->dim_);
   swap(unknown_rank_, other->unknown_rank_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
 }
 
-::google::protobuf::Metadata TensorShapeProto::GetMetadata() const {
-  protobuf_tensor_5fshape_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_tensor_5fshape_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata TensorShapeProto::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_tensor_5fshape_2eproto_getter, &descriptor_table_tensor_5fshape_2eproto_once,
+      file_level_metadata_tensor_5fshape_2eproto[1]);
 }
 
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::TensorShapeProto_Dim* Arena::CreateMaybeMessage< ::opencv_tensorflow::TensorShapeProto_Dim >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::TensorShapeProto_Dim >(arena);
+}
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::TensorShapeProto* Arena::CreateMaybeMessage< ::opencv_tensorflow::TensorShapeProto >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::TensorShapeProto >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index eb9b58a..d7010fa 100644 (file)
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensor_shape.proto
 
-#ifndef PROTOBUF_tensor_5fshape_2eproto__INCLUDED
-#define PROTOBUF_tensor_5fshape_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_tensor_5fshape_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_tensor_5fshape_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include <google/protobuf/unknown_field_set.h>
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_tensor_5fshape_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_tensor_5fshape_2eproto {
 // Internal implementation detail -- do not use these members.
-struct TableStruct {
-  static const ::google::protobuf::internal::ParseTableField entries[];
-  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  static const ::google::protobuf::internal::ParseTable schema[2];
-  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
-  static const ::google::protobuf::internal::SerializationTable serialization_table[];
-  static const ::google::protobuf::uint32 offsets[];
+struct TableStruct_tensor_5fshape_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[2]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsTensorShapeProto_DimImpl();
-void InitDefaultsTensorShapeProto_Dim();
-void InitDefaultsTensorShapeProtoImpl();
-void InitDefaultsTensorShapeProto();
-inline void InitDefaults() {
-  InitDefaultsTensorShapeProto_Dim();
-  InitDefaultsTensorShapeProto();
-}
-}  // namespace protobuf_tensor_5fshape_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensor_5fshape_2eproto;
 namespace opencv_tensorflow {
 class TensorShapeProto;
-class TensorShapeProtoDefaultTypeInternal;
+struct TensorShapeProtoDefaultTypeInternal;
 extern TensorShapeProtoDefaultTypeInternal _TensorShapeProto_default_instance_;
 class TensorShapeProto_Dim;
-class TensorShapeProto_DimDefaultTypeInternal;
+struct TensorShapeProto_DimDefaultTypeInternal;
 extern TensorShapeProto_DimDefaultTypeInternal _TensorShapeProto_Dim_default_instance_;
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_tensorflow::TensorShapeProto* Arena::CreateMaybeMessage<::opencv_tensorflow::TensorShapeProto>(Arena*);
+template<> ::opencv_tensorflow::TensorShapeProto_Dim* Arena::CreateMaybeMessage<::opencv_tensorflow::TensorShapeProto_Dim>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-class TensorShapeProto_Dim : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorShapeProto.Dim) */ {
+class TensorShapeProto_Dim final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorShapeProto.Dim) */ {
  public:
-  TensorShapeProto_Dim();
-  virtual ~TensorShapeProto_Dim();
+  inline TensorShapeProto_Dim() : TensorShapeProto_Dim(nullptr) {}
+  ~TensorShapeProto_Dim() override;
+  explicit constexpr TensorShapeProto_Dim(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TensorShapeProto_Dim(const TensorShapeProto_Dim& from);
-
-  inline TensorShapeProto_Dim& operator=(const TensorShapeProto_Dim& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TensorShapeProto_Dim(TensorShapeProto_Dim&& from) noexcept
     : TensorShapeProto_Dim() {
     *this = ::std::move(from);
   }
 
+  inline TensorShapeProto_Dim& operator=(const TensorShapeProto_Dim& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TensorShapeProto_Dim& operator=(TensorShapeProto_Dim&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TensorShapeProto_Dim& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TensorShapeProto_Dim& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const TensorShapeProto_Dim* internal_default_instance() {
     return reinterpret_cast<const TensorShapeProto_Dim*>(
                &_TensorShapeProto_Dim_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void UnsafeArenaSwap(TensorShapeProto_Dim* other);
-  void Swap(TensorShapeProto_Dim* other);
   friend void swap(TensorShapeProto_Dim& a, TensorShapeProto_Dim& b) {
     a.Swap(&b);
   }
+  inline void Swap(TensorShapeProto_Dim* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TensorShapeProto_Dim* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TensorShapeProto_Dim* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TensorShapeProto_Dim* 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;
+  TensorShapeProto_Dim* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TensorShapeProto_Dim>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TensorShapeProto_Dim& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TensorShapeProto_Dim& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TensorShapeProto_Dim* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.TensorShapeProto.Dim";
+  }
   protected:
-  explicit TensorShapeProto_Dim(::google::protobuf::Arena* arena);
+  explicit TensorShapeProto_Dim(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kNameFieldNumber = 2,
+    kSizeFieldNumber = 1,
+  };
   // string name = 2;
   void clear_name();
-  static const int kNameFieldNumber = 2;
-  const ::std::string& name() const;
-  void set_name(const ::std::string& value);
-  #if LANG_CXX11
-  void set_name(::std::string&& value);
-  #endif
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
-  ::std::string* mutable_name();
-  ::std::string* release_name();
-  void set_allocated_name(::std::string* name);
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  ::std::string* unsafe_arena_release_name();
-  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
-  "    string fields are deprecated and will be removed in a"
-  "    future release.")
-  void unsafe_arena_set_allocated_name(
-      ::std::string* name);
+  const std::string& name() const;
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
+  std::string* mutable_name();
+  PROTOBUF_NODISCARD std::string* release_name();
+  void set_allocated_name(std::string* name);
+  private:
+  const std::string& _internal_name() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
+  std::string* _internal_mutable_name();
+  public:
 
   // int64 size = 1;
   void clear_size();
-  static const int kSizeFieldNumber = 1;
-  ::google::protobuf::int64 size() const;
-  void set_size(::google::protobuf::int64 value);
+  int64_t size() const;
+  void set_size(int64_t value);
+  private:
+  int64_t _internal_size() const;
+  void _internal_set_size(int64_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.TensorShapeProto.Dim)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::internal::ArenaStringPtr name_;
-  ::google::protobuf::int64 size_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_tensor_5fshape_2eproto::TableStruct;
-  friend void ::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto_DimImpl();
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+  int64_t size_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_tensor_5fshape_2eproto;
 };
 // -------------------------------------------------------------------
 
-class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorShapeProto) */ {
+class TensorShapeProto final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorShapeProto) */ {
  public:
-  TensorShapeProto();
-  virtual ~TensorShapeProto();
+  inline TensorShapeProto() : TensorShapeProto(nullptr) {}
+  ~TensorShapeProto() override;
+  explicit constexpr TensorShapeProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TensorShapeProto(const TensorShapeProto& from);
-
-  inline TensorShapeProto& operator=(const TensorShapeProto& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   TensorShapeProto(TensorShapeProto&& from) noexcept
     : TensorShapeProto() {
     *this = ::std::move(from);
   }
 
+  inline TensorShapeProto& operator=(const TensorShapeProto& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline TensorShapeProto& operator=(TensorShapeProto&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const TensorShapeProto& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const TensorShapeProto& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const TensorShapeProto* internal_default_instance() {
     return reinterpret_cast<const TensorShapeProto*>(
                &_TensorShapeProto_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     1;
 
-  void UnsafeArenaSwap(TensorShapeProto* other);
-  void Swap(TensorShapeProto* other);
   friend void swap(TensorShapeProto& a, TensorShapeProto& b) {
     a.Swap(&b);
   }
+  inline void Swap(TensorShapeProto* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(TensorShapeProto* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline TensorShapeProto* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  TensorShapeProto* 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;
+  TensorShapeProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<TensorShapeProto>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const TensorShapeProto& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const TensorShapeProto& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(TensorShapeProto* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.TensorShapeProto";
+  }
   protected:
-  explicit TensorShapeProto(::google::protobuf::Arena* arena);
+  explicit TensorShapeProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
@@ -297,36 +354,48 @@ class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertio
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kDimFieldNumber = 2,
+    kUnknownRankFieldNumber = 3,
+  };
   // repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
   int dim_size() const;
+  private:
+  int _internal_dim_size() const;
+  public:
   void clear_dim();
-  static const int kDimFieldNumber = 2;
-  const ::opencv_tensorflow::TensorShapeProto_Dim& dim(int index) const;
   ::opencv_tensorflow::TensorShapeProto_Dim* mutable_dim(int index);
-  ::opencv_tensorflow::TensorShapeProto_Dim* add_dim();
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >*
       mutable_dim();
-  const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >&
+  private:
+  const ::opencv_tensorflow::TensorShapeProto_Dim& _internal_dim(int index) const;
+  ::opencv_tensorflow::TensorShapeProto_Dim* _internal_add_dim();
+  public:
+  const ::opencv_tensorflow::TensorShapeProto_Dim& dim(int index) const;
+  ::opencv_tensorflow::TensorShapeProto_Dim* add_dim();
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >&
       dim() const;
 
   // bool unknown_rank = 3;
   void clear_unknown_rank();
-  static const int kUnknownRankFieldNumber = 3;
   bool unknown_rank() const;
   void set_unknown_rank(bool value);
+  private:
+  bool _internal_unknown_rank() const;
+  void _internal_set_unknown_rank(bool value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.TensorShapeProto)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim > dim_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim > dim_;
   bool unknown_rank_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_tensor_5fshape_2eproto::TableStruct;
-  friend void ::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProtoImpl();
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_tensor_5fshape_2eproto;
 };
 // ===================================================================
 
@@ -341,91 +410,73 @@ class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertio
 
 // int64 size = 1;
 inline void TensorShapeProto_Dim::clear_size() {
-  size_ = GOOGLE_LONGLONG(0);
+  size_ = int64_t{0};
 }
-inline ::google::protobuf::int64 TensorShapeProto_Dim::size() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.Dim.size)
+inline int64_t TensorShapeProto_Dim::_internal_size() const {
   return size_;
 }
-inline void TensorShapeProto_Dim::set_size(::google::protobuf::int64 value) {
+inline int64_t TensorShapeProto_Dim::size() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.Dim.size)
+  return _internal_size();
+}
+inline void TensorShapeProto_Dim::_internal_set_size(int64_t value) {
 
   size_ = value;
+}
+inline void TensorShapeProto_Dim::set_size(int64_t value) {
+  _internal_set_size(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorShapeProto.Dim.size)
 }
 
 // string name = 2;
 inline void TensorShapeProto_Dim::clear_name() {
-  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  name_.ClearToEmpty();
 }
-inline const ::std::string& TensorShapeProto_Dim::name() const {
+inline const std::string& TensorShapeProto_Dim::name() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.Dim.name)
-  return name_.Get();
+  return _internal_name();
 }
-inline void TensorShapeProto_Dim::set_name(const ::std::string& value) {
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TensorShapeProto_Dim::set_name(ArgT0&& arg0, ArgT... args) {
 
 name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorShapeProto.Dim.name)
 }
-#if LANG_CXX11
-inline void TensorShapeProto_Dim::set_name(::std::string&& value) {
-
-  name_.Set(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.TensorShapeProto.Dim.name)
+inline std::string* TensorShapeProto_Dim::mutable_name() {
+  std::string* _s = _internal_mutable_name();
+  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorShapeProto.Dim.name)
+  return _s;
 }
-#endif
-inline void TensorShapeProto_Dim::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:opencv_tensorflow.TensorShapeProto.Dim.name)
+inline const std::string& TensorShapeProto_Dim::_internal_name() const {
+  return name_.Get();
 }
-inline void TensorShapeProto_Dim::set_name(const char* value,
-    size_t size) {
+inline void TensorShapeProto_Dim::_internal_set_name(const std::string& value) {
 
-  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.TensorShapeProto.Dim.name)
+  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
 }
-inline ::std::string* TensorShapeProto_Dim::mutable_name() {
+inline std::string* TensorShapeProto_Dim::_internal_mutable_name() {
 
-  // @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorShapeProto.Dim.name)
-  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
 }
-inline ::std::string* TensorShapeProto_Dim::release_name() {
+inline std::string* TensorShapeProto_Dim::release_name() {
   // @@protoc_insertion_point(field_release:opencv_tensorflow.TensorShapeProto.Dim.name)
-
-  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
+  return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
 }
-inline void TensorShapeProto_Dim::set_allocated_name(::std::string* name) {
-  if (name != NULL) {
+inline void TensorShapeProto_Dim::set_allocated_name(std::string* name) {
+  if (name != nullptr) {
 
   } else {
 
   }
-  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
-      GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.TensorShapeProto.Dim.name)
-}
-inline ::std::string* TensorShapeProto_Dim::unsafe_arena_release_name() {
-  // @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.TensorShapeProto.Dim.name)
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
-  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      GetArenaNoVirtual());
-}
-inline void TensorShapeProto_Dim::unsafe_arena_set_allocated_name(
-    ::std::string* name) {
-  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-  if (name != NULL) {
-
-  } else {
-
+  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
+      GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) {
+    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
   }
-  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      name, GetArenaNoVirtual());
-  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.TensorShapeProto.Dim.name)
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.TensorShapeProto.Dim.name)
 }
 
 // -------------------------------------------------------------------
@@ -433,30 +484,40 @@ inline void TensorShapeProto_Dim::unsafe_arena_set_allocated_name(
 // TensorShapeProto
 
 // repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
-inline int TensorShapeProto::dim_size() const {
+inline int TensorShapeProto::_internal_dim_size() const {
   return dim_.size();
 }
+inline int TensorShapeProto::dim_size() const {
+  return _internal_dim_size();
+}
 inline void TensorShapeProto::clear_dim() {
   dim_.Clear();
 }
-inline const ::opencv_tensorflow::TensorShapeProto_Dim& TensorShapeProto::dim(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.dim)
-  return dim_.Get(index);
-}
 inline ::opencv_tensorflow::TensorShapeProto_Dim* TensorShapeProto::mutable_dim(int index) {
   // @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorShapeProto.dim)
   return dim_.Mutable(index);
 }
-inline ::opencv_tensorflow::TensorShapeProto_Dim* TensorShapeProto::add_dim() {
-  // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorShapeProto.dim)
-  return dim_.Add();
-}
-inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >*
 TensorShapeProto::mutable_dim() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorShapeProto.dim)
   return &dim_;
 }
-inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >&
+inline const ::opencv_tensorflow::TensorShapeProto_Dim& TensorShapeProto::_internal_dim(int index) const {
+  return dim_.Get(index);
+}
+inline const ::opencv_tensorflow::TensorShapeProto_Dim& TensorShapeProto::dim(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.dim)
+  return _internal_dim(index);
+}
+inline ::opencv_tensorflow::TensorShapeProto_Dim* TensorShapeProto::_internal_add_dim() {
+  return dim_.Add();
+}
+inline ::opencv_tensorflow::TensorShapeProto_Dim* TensorShapeProto::add_dim() {
+  ::opencv_tensorflow::TensorShapeProto_Dim* _add = _internal_add_dim();
+  // @@protoc_insertion_point(field_add:opencv_tensorflow.TensorShapeProto.dim)
+  return _add;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >&
 TensorShapeProto::dim() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.TensorShapeProto.dim)
   return dim_;
@@ -466,13 +527,19 @@ TensorShapeProto::dim() const {
 inline void TensorShapeProto::clear_unknown_rank() {
   unknown_rank_ = false;
 }
+inline bool TensorShapeProto::_internal_unknown_rank() const {
+  return unknown_rank_;
+}
 inline bool TensorShapeProto::unknown_rank() const {
   // @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.unknown_rank)
-  return unknown_rank_;
+  return _internal_unknown_rank();
 }
-inline void TensorShapeProto::set_unknown_rank(bool value) {
+inline void TensorShapeProto::_internal_set_unknown_rank(bool value) {
 
   unknown_rank_ = value;
+}
+inline void TensorShapeProto::set_unknown_rank(bool value) {
+  _internal_set_unknown_rank(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.TensorShapeProto.unknown_rank)
 }
 
@@ -488,4 +555,5 @@ inline void TensorShapeProto::set_unknown_rank(bool value) {
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_tensor_5fshape_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_tensor_5fshape_2eproto
index e5fa4ca..98e6c0e 100644 (file)
@@ -5,90 +5,63 @@
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_tensorflow {
 }  // namespace opencv_tensorflow
-namespace protobuf_types_2eproto {
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
-const ::google::protobuf::uint32 TableStruct::offsets[1] = {};
-static const ::google::protobuf::internal::MigrationSchema* schemas = NULL;
-static const ::google::protobuf::Message* const* file_default_instances = NULL;
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "types.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      NULL, file_level_enum_descriptors, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
+static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_types_2eproto[1];
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_types_2eproto = nullptr;
+const uint32_t TableStruct_types_2eproto::offsets[1] = {};
+static constexpr ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema* schemas = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::Message* const* file_default_instances = nullptr;
 
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
+const char descriptor_table_protodef_types_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\013types.proto\022\021opencv_tensorflow*\234\005\n\010Dat"
+  "aType\022\016\n\nDT_INVALID\020\000\022\014\n\010DT_FLOAT\020\001\022\r\n\tD"
+  "T_DOUBLE\020\002\022\014\n\010DT_INT32\020\003\022\014\n\010DT_UINT8\020\004\022\014"
+  "\n\010DT_INT16\020\005\022\013\n\007DT_INT8\020\006\022\r\n\tDT_STRING\020\007"
+  "\022\020\n\014DT_COMPLEX64\020\010\022\014\n\010DT_INT64\020\t\022\013\n\007DT_B"
+  "OOL\020\n\022\014\n\010DT_QINT8\020\013\022\r\n\tDT_QUINT8\020\014\022\r\n\tDT"
+  "_QINT32\020\r\022\017\n\013DT_BFLOAT16\020\016\022\r\n\tDT_QINT16\020"
+  "\017\022\016\n\nDT_QUINT16\020\020\022\r\n\tDT_UINT16\020\021\022\021\n\rDT_C"
+  "OMPLEX128\020\022\022\013\n\007DT_HALF\020\023\022\020\n\014DT_FLOAT_REF"
+  "\020e\022\021\n\rDT_DOUBLE_REF\020f\022\020\n\014DT_INT32_REF\020g\022"
+  "\020\n\014DT_UINT8_REF\020h\022\020\n\014DT_INT16_REF\020i\022\017\n\013D"
+  "T_INT8_REF\020j\022\021\n\rDT_STRING_REF\020k\022\024\n\020DT_CO"
+  "MPLEX64_REF\020l\022\020\n\014DT_INT64_REF\020m\022\017\n\013DT_BO"
+  "OL_REF\020n\022\020\n\014DT_QINT8_REF\020o\022\021\n\rDT_QUINT8_"
+  "REF\020p\022\021\n\rDT_QINT32_REF\020q\022\023\n\017DT_BFLOAT16_"
+  "REF\020r\022\021\n\rDT_QINT16_REF\020s\022\022\n\016DT_QUINT16_R"
+  "EF\020t\022\021\n\rDT_UINT16_REF\020u\022\025\n\021DT_COMPLEX128"
+  "_REF\020v\022\017\n\013DT_HALF_REF\020wB,\n\030org.tensorflo"
+  "w.frameworkB\013TypesProtosP\001\370\001\001b\006proto3"
+  ;
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_types_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_types_2eproto = {
+  false, false, 757, descriptor_table_protodef_types_2eproto, "types.proto",
+  &descriptor_table_types_2eproto_once, nullptr, 0, 0,
+  schemas, file_default_instances, TableStruct_types_2eproto::offsets,
+  nullptr, file_level_enum_descriptors_types_2eproto, file_level_service_descriptors_types_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_types_2eproto_getter() {
+  return &descriptor_table_types_2eproto;
 }
 
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\013types.proto\022\021opencv_tensorflow*\234\005\n\010Dat"
-      "aType\022\016\n\nDT_INVALID\020\000\022\014\n\010DT_FLOAT\020\001\022\r\n\tD"
-      "T_DOUBLE\020\002\022\014\n\010DT_INT32\020\003\022\014\n\010DT_UINT8\020\004\022\014"
-      "\n\010DT_INT16\020\005\022\013\n\007DT_INT8\020\006\022\r\n\tDT_STRING\020\007"
-      "\022\020\n\014DT_COMPLEX64\020\010\022\014\n\010DT_INT64\020\t\022\013\n\007DT_B"
-      "OOL\020\n\022\014\n\010DT_QINT8\020\013\022\r\n\tDT_QUINT8\020\014\022\r\n\tDT"
-      "_QINT32\020\r\022\017\n\013DT_BFLOAT16\020\016\022\r\n\tDT_QINT16\020"
-      "\017\022\016\n\nDT_QUINT16\020\020\022\r\n\tDT_UINT16\020\021\022\021\n\rDT_C"
-      "OMPLEX128\020\022\022\013\n\007DT_HALF\020\023\022\020\n\014DT_FLOAT_REF"
-      "\020e\022\021\n\rDT_DOUBLE_REF\020f\022\020\n\014DT_INT32_REF\020g\022"
-      "\020\n\014DT_UINT8_REF\020h\022\020\n\014DT_INT16_REF\020i\022\017\n\013D"
-      "T_INT8_REF\020j\022\021\n\rDT_STRING_REF\020k\022\024\n\020DT_CO"
-      "MPLEX64_REF\020l\022\020\n\014DT_INT64_REF\020m\022\017\n\013DT_BO"
-      "OL_REF\020n\022\020\n\014DT_QINT8_REF\020o\022\021\n\rDT_QUINT8_"
-      "REF\020p\022\021\n\rDT_QINT32_REF\020q\022\023\n\017DT_BFLOAT16_"
-      "REF\020r\022\021\n\rDT_QINT16_REF\020s\022\022\n\016DT_QUINT16_R"
-      "EF\020t\022\021\n\rDT_UINT16_REF\020u\022\025\n\021DT_COMPLEX128"
-      "_REF\020v\022\017\n\013DT_HALF_REF\020wB,\n\030org.tensorflo"
-      "w.frameworkB\013TypesProtosP\001\370\001\001b\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 757);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "types.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_types_2eproto
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_types_2eproto(&descriptor_table_types_2eproto);
 namespace opencv_tensorflow {
-const ::google::protobuf::EnumDescriptor* DataType_descriptor() {
-  protobuf_types_2eproto::protobuf_AssignDescriptorsOnce();
-  return protobuf_types_2eproto::file_level_enum_descriptors[0];
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataType_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_types_2eproto);
+  return file_level_enum_descriptors_types_2eproto[0];
 }
 bool DataType_IsValid(int value) {
   switch (value) {
@@ -140,5 +113,8 @@ bool DataType_IsValid(int value) {
 
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index 1af1261..3515a5c 100644 (file)
@@ -1,54 +1,62 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: types.proto
 
-#ifndef PROTOBUF_types_2eproto__INCLUDED
-#define PROTOBUF_types_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_types_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_types_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include <google/protobuf/generated_enum_reflection.h>
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_types_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_types_2eproto {
 // Internal implementation detail -- do not use these members.
-struct TableStruct {
-  static const ::google::protobuf::internal::ParseTableField entries[];
-  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  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 const ::google::protobuf::uint32 offsets[];
+struct TableStruct_types_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-inline void InitDefaults() {
-}
-}  // namespace protobuf_types_2eproto
-namespace opencv_tensorflow {
-}  // namespace opencv_tensorflow
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_types_2eproto;
+PROTOBUF_NAMESPACE_OPEN
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_tensorflow {
 
-enum DataType {
+enum DataType : int {
   DT_INVALID = 0,
   DT_FLOAT = 1,
   DT_DOUBLE = 2,
@@ -88,22 +96,26 @@ enum DataType {
   DT_UINT16_REF = 117,
   DT_COMPLEX128_REF = 118,
   DT_HALF_REF = 119,
-  DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
-  DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
+  DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(),
+  DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::max()
 };
 bool DataType_IsValid(int value);
-const DataType DataType_MIN = DT_INVALID;
-const DataType DataType_MAX = DT_HALF_REF;
-const int DataType_ARRAYSIZE = DataType_MAX + 1;
-
-const ::google::protobuf::EnumDescriptor* DataType_descriptor();
-inline const ::std::string& DataType_Name(DataType value) {
-  return ::google::protobuf::internal::NameOfEnum(
-    DataType_descriptor(), value);
+constexpr DataType DataType_MIN = DT_INVALID;
+constexpr DataType DataType_MAX = DT_HALF_REF;
+constexpr int DataType_ARRAYSIZE = DataType_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataType_descriptor();
+template<typename T>
+inline const std::string& DataType_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, DataType>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function DataType_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    DataType_descriptor(), enum_t_value);
 }
 inline bool DataType_Parse(
-    const ::std::string& name, DataType* value) {
-  return ::google::protobuf::internal::ParseNamedEnum<DataType>(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataType* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<DataType>(
     DataType_descriptor(), name, value);
 }
 // ===================================================================
@@ -126,18 +138,17 @@ inline bool DataType_Parse(
 
 }  // namespace opencv_tensorflow
 
-namespace google {
-namespace protobuf {
+PROTOBUF_NAMESPACE_OPEN
 
-template <> struct is_proto_enum< ::opencv_tensorflow::DataType> : ::google::protobuf::internal::true_type {};
+template <> struct is_proto_enum< ::opencv_tensorflow::DataType> : ::std::true_type {};
 template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::opencv_tensorflow::DataType>() {
   return ::opencv_tensorflow::DataType_descriptor();
 }
 
-}  // namespace protobuf
-}  // namespace google
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_types_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_types_2eproto
index 08ae2aa..8f31313 100644 (file)
 
 #include <algorithm>
 
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+
+PROTOBUF_PRAGMA_INIT_SEG
 namespace opencv_tensorflow {
-class VersionDefDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<VersionDef>
-      _instance;
-} _VersionDef_default_instance_;
+constexpr VersionDef::VersionDef(
+  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
+  : bad_consumers_()
+  , _bad_consumers_cached_byte_size_(0)
+  , producer_(0)
+  , min_consumer_(0){}
+struct VersionDefDefaultTypeInternal {
+  constexpr VersionDefDefaultTypeInternal()
+    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
+  ~VersionDefDefaultTypeInternal() {}
+  union {
+    VersionDef _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT VersionDefDefaultTypeInternal _VersionDef_default_instance_;
 }  // namespace opencv_tensorflow
-namespace protobuf_versions_2eproto {
-void InitDefaultsVersionDefImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  {
-    void* ptr = &::opencv_tensorflow::_VersionDef_default_instance_;
-    new (ptr) ::opencv_tensorflow::VersionDef();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::opencv_tensorflow::VersionDef::InitAsDefaultInstance();
-}
-
-void InitDefaultsVersionDef() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsVersionDefImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[1];
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_versions_2eproto[1];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_versions_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_versions_2eproto = nullptr;
 
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+const uint32_t TableStruct_versions_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   ~0u,  // no _has_bits_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::VersionDef, _internal_metadata_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::VersionDef, _internal_metadata_),
   ~0u,  // no _extensions_
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::VersionDef, producer_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::VersionDef, min_consumer_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::VersionDef, bad_consumers_),
+  ~0u,  // no _inlined_string_donated_
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::VersionDef, producer_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::VersionDef, min_consumer_),
+  PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::VersionDef, bad_consumers_),
 };
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, -1, sizeof(::opencv_tensorflow::VersionDef)},
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, -1, -1, sizeof(::opencv_tensorflow::VersionDef)},
 };
 
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_VersionDef_default_instance_),
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_VersionDef_default_instance_),
 };
 
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "versions.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
-void protobuf_RegisterTypes(const ::std::string&) {
-  protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\016versions.proto\022\021opencv_tensorflow\"K\n\nV"
-      "ersionDef\022\020\n\010producer\030\001 \001(\005\022\024\n\014min_consu"
-      "mer\030\002 \001(\005\022\025\n\rbad_consumers\030\003 \003(\005B/\n\030org."
-      "tensorflow.frameworkB\016VersionsProtosP\001\370\001"
-      "\001b\006proto3"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 169);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "versions.proto", &protobuf_RegisterTypes);
+const char descriptor_table_protodef_versions_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\016versions.proto\022\021opencv_tensorflow\"K\n\nV"
+  "ersionDef\022\020\n\010producer\030\001 \001(\005\022\024\n\014min_consu"
+  "mer\030\002 \001(\005\022\025\n\rbad_consumers\030\003 \003(\005B/\n\030org."
+  "tensorflow.frameworkB\016VersionsProtosP\001\370\001"
+  "\001b\006proto3"
+  ;
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_versions_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_versions_2eproto = {
+  false, false, 169, descriptor_table_protodef_versions_2eproto, "versions.proto",
+  &descriptor_table_versions_2eproto_once, nullptr, 0, 1,
+  schemas, file_default_instances, TableStruct_versions_2eproto::offsets,
+  file_level_metadata_versions_2eproto, file_level_enum_descriptors_versions_2eproto, file_level_service_descriptors_versions_2eproto,
+};
+PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_versions_2eproto_getter() {
+  return &descriptor_table_versions_2eproto;
 }
 
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_versions_2eproto
+// Force running AddDescriptors() at dynamic initialization time.
+PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_versions_2eproto(&descriptor_table_versions_2eproto);
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-void VersionDef::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int VersionDef::kProducerFieldNumber;
-const int VersionDef::kMinConsumerFieldNumber;
-const int VersionDef::kBadConsumersFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-VersionDef::VersionDef()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_versions_2eproto::InitDefaultsVersionDef();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:opencv_tensorflow.VersionDef)
-}
-VersionDef::VersionDef(::google::protobuf::Arena* arena)
-  : ::google::protobuf::Message(),
-  _internal_metadata_(arena),
+class VersionDef::_Internal {
+ public:
+};
+
+VersionDef::VersionDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
   bad_consumers_(arena) {
-  ::protobuf_versions_2eproto::InitDefaultsVersionDef();
   SharedCtor();
-  RegisterArenaDtor(arena);
+  if (!is_message_owned) {
+    RegisterArenaDtor(arena);
+  }
   // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.VersionDef)
 }
 VersionDef::VersionDef(const VersionDef& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      bad_consumers_(from.bad_consumers_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      bad_consumers_(from.bad_consumers_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
   ::memcpy(&producer_, &from.producer_,
     static_cast<size_t>(reinterpret_cast<char*>(&min_consumer_) -
     reinterpret_cast<char*>(&producer_)) + sizeof(min_consumer_));
   // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.VersionDef)
 }
 
-void VersionDef::SharedCtor() {
-  ::memset(&producer_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&min_consumer_) -
-      reinterpret_cast<char*>(&producer_)) + sizeof(min_consumer_));
-  _cached_size_ = 0;
+inline void VersionDef::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&producer_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&min_consumer_) -
+    reinterpret_cast<char*>(&producer_)) + sizeof(min_consumer_));
 }
 
 VersionDef::~VersionDef() {
   // @@protoc_insertion_point(destructor:opencv_tensorflow.VersionDef)
+  if (GetArenaForAllocation() != nullptr) return;
   SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-void VersionDef::SharedDtor() {
-  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
+inline void VersionDef::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
 void VersionDef::ArenaDtor(void* object) {
   VersionDef* _this = reinterpret_cast< VersionDef* >(object);
   (void)_this;
 }
-void VersionDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
+void VersionDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
 }
 void VersionDef::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* VersionDef::descriptor() {
-  ::protobuf_versions_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_versions_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const VersionDef& VersionDef::default_instance() {
-  ::protobuf_versions_2eproto::InitDefaultsVersionDef();
-  return *internal_default_instance();
-}
-
-VersionDef* VersionDef::New(::google::protobuf::Arena* arena) const {
-  return ::google::protobuf::Arena::CreateMessage<VersionDef>(arena);
+  _cached_size_.Set(size);
 }
 
 void VersionDef::Clear() {
 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.VersionDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -205,153 +142,95 @@ void VersionDef::Clear() {
   ::memset(&producer_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&min_consumer_) -
       reinterpret_cast<char*>(&producer_)) + sizeof(min_consumer_));
-  _internal_metadata_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
 
-bool VersionDef::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:opencv_tensorflow.VersionDef)
-  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)) {
+const char* VersionDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    uint32_t tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
       // int32 producer = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &producer_)));
-        } else {
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+          producer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // int32 min_consumer = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &min_consumer_)));
-        } else {
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+          min_consumer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else
           goto handle_unusual;
-        }
-        break;
-      }
-
+        continue;
       // repeated int32 bad_consumers = 3;
-      case 3: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_bad_consumers())));
-        } else if (
-            static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 26u, input, this->mutable_bad_consumers())));
-        } else {
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_bad_consumers(), ptr, ctx);
+          CHK_(ptr);
+        } else if (static_cast<uint8_t>(tag) == 24) {
+          _internal_add_bad_consumers(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
+          CHK_(ptr);
+        } 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;
-      }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
     }
-  }
-success:
-  // @@protoc_insertion_point(parse_success:opencv_tensorflow.VersionDef)
-  return true;
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
 failure:
-  // @@protoc_insertion_point(parse_failure:opencv_tensorflow.VersionDef)
-  return false;
-#undef DO_
-}
-
-void VersionDef::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:opencv_tensorflow.VersionDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  // int32 producer = 1;
-  if (this->producer() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->producer(), output);
-  }
-
-  // int32 min_consumer = 2;
-  if (this->min_consumer() != 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->min_consumer(), output);
-  }
-
-  // repeated int32 bad_consumers = 3;
-  if (this->bad_consumers_size() > 0) {
-    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
-    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
-        _bad_consumers_cached_byte_size_));
-  }
-  for (int i = 0, n = this->bad_consumers_size(); i < n; i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
-      this->bad_consumers(i), output);
-  }
-
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
-  }
-  // @@protoc_insertion_point(serialize_end:opencv_tensorflow.VersionDef)
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
 }
 
-::google::protobuf::uint8* VersionDef::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
+uint8_t* VersionDef::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.VersionDef)
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // int32 producer = 1;
-  if (this->producer() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->producer(), target);
+  if (this->_internal_producer() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_producer(), target);
   }
 
   // int32 min_consumer = 2;
-  if (this->min_consumer() != 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->min_consumer(), target);
+  if (this->_internal_min_consumer() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_min_consumer(), target);
   }
 
   // repeated int32 bad_consumers = 3;
-  if (this->bad_consumers_size() > 0) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
-      3,
-      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
-      target);
-    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
-        static_cast< ::google::protobuf::int32>(
-            _bad_consumers_cached_byte_size_), target);
-    target = ::google::protobuf::internal::WireFormatLite::
-      WriteInt32NoTagToArray(this->bad_consumers_, target);
+  {
+    int byte_size = _bad_consumers_cached_byte_size_.load(std::memory_order_relaxed);
+    if (byte_size > 0) {
+      target = stream->WriteInt32Packed(
+          3, _internal_bad_consumers(), byte_size, target);
+    }
   }
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
   }
   // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.VersionDef)
   return target;
@@ -361,84 +240,65 @@ size_t VersionDef::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.VersionDef)
   size_t total_size = 0;
 
-  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
-  }
+  uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
   // repeated int32 bad_consumers = 3;
   {
-    size_t data_size = ::google::protobuf::internal::WireFormatLite::
+    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
       Int32Size(this->bad_consumers_);
     if (data_size > 0) {
       total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-            static_cast< ::google::protobuf::int32>(data_size));
+        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+            static_cast<int32_t>(data_size));
     }
-    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
-    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-    _bad_consumers_cached_byte_size_ = cached_size;
-    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
+    _bad_consumers_cached_byte_size_.store(cached_size,
+                                    std::memory_order_relaxed);
     total_size += data_size;
   }
 
   // int32 producer = 1;
-  if (this->producer() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->producer());
+  if (this->_internal_producer() != 0) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_producer());
   }
 
   // int32 min_consumer = 2;
-  if (this->min_consumer() != 0) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->min_consumer());
+  if (this->_internal_min_consumer() != 0) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_min_consumer());
   }
 
-  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;
+  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
 }
 
-void VersionDef::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.VersionDef)
-  GOOGLE_DCHECK_NE(&from, this);
-  const VersionDef* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const VersionDef>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.VersionDef)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.VersionDef)
-    MergeFrom(*source);
-  }
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData VersionDef::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
+    VersionDef::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*VersionDef::GetClassData() const { return &_class_data_; }
+
+void VersionDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
+                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+  static_cast<VersionDef *>(to)->MergeFrom(
+      static_cast<const VersionDef &>(from));
 }
 
+
 void VersionDef::MergeFrom(const VersionDef& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.VersionDef)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   bad_consumers_.MergeFrom(from.bad_consumers_);
-  if (from.producer() != 0) {
-    set_producer(from.producer());
+  if (from._internal_producer() != 0) {
+    _internal_set_producer(from._internal_producer());
   }
-  if (from.min_consumer() != 0) {
-    set_min_consumer(from.min_consumer());
+  if (from._internal_min_consumer() != 0) {
+    _internal_set_min_consumer(from._internal_min_consumer());
   }
-}
-
-void VersionDef::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.VersionDef)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
 }
 
 void VersionDef::CopyFrom(const VersionDef& from) {
@@ -452,41 +312,31 @@ bool VersionDef::IsInitialized() const {
   return true;
 }
 
-void VersionDef::Swap(VersionDef* other) {
-  if (other == this) return;
-  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
-    InternalSwap(other);
-  } else {
-    VersionDef* temp = New(GetArenaNoVirtual());
-    temp->MergeFrom(*other);
-    other->CopyFrom(*this);
-    InternalSwap(temp);
-    if (GetArenaNoVirtual() == NULL) {
-      delete temp;
-    }
-  }
-}
-void VersionDef::UnsafeArenaSwap(VersionDef* other) {
-  if (other == this) return;
-  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
-  InternalSwap(other);
-}
 void VersionDef::InternalSwap(VersionDef* other) {
   using std::swap;
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   bad_consumers_.InternalSwap(&other->bad_consumers_);
-  swap(producer_, other->producer_);
-  swap(min_consumer_, other->min_consumer_);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(VersionDef, min_consumer_)
+      + sizeof(VersionDef::min_consumer_)
+      - PROTOBUF_FIELD_OFFSET(VersionDef, producer_)>(
+          reinterpret_cast<char*>(&producer_),
+          reinterpret_cast<char*>(&other->producer_));
 }
 
-::google::protobuf::Metadata VersionDef::GetMetadata() const {
-  protobuf_versions_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_versions_2eproto::file_level_metadata[kIndexInFileMessages];
+::PROTOBUF_NAMESPACE_ID::Metadata VersionDef::GetMetadata() const {
+  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
+      &descriptor_table_versions_2eproto_getter, &descriptor_table_versions_2eproto_once,
+      file_level_metadata_versions_2eproto[0]);
 }
 
-
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::opencv_tensorflow::VersionDef* Arena::CreateMaybeMessage< ::opencv_tensorflow::VersionDef >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::opencv_tensorflow::VersionDef >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
 
 // @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>
index 193081d..3b5adf3 100644 (file)
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: versions.proto
 
-#ifndef PROTOBUF_versions_2eproto__INCLUDED
-#define PROTOBUF_versions_2eproto__INCLUDED
+#ifndef GOOGLE_PROTOBUF_INCLUDED_versions_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_versions_2eproto
 
+#include <limits>
 #include <string>
 
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3019000
 #error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
+#error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
+#error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
 #endif
 
+#include <google/protobuf/port_undef.inc>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
 #include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
 #include <google/protobuf/message.h>
 #include <google/protobuf/repeated_field.h>  // IWYU pragma: export
 #include <google/protobuf/extension_set.h>  // IWYU pragma: export
 #include <google/protobuf/unknown_field_set.h>
 // @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_versions_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
 
-namespace protobuf_versions_2eproto {
 // Internal implementation detail -- do not use these members.
-struct TableStruct {
-  static const ::google::protobuf::internal::ParseTableField entries[];
-  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  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 const ::google::protobuf::uint32 offsets[];
+struct TableStruct_versions_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const uint32_t offsets[];
 };
-void AddDescriptors();
-void InitDefaultsVersionDefImpl();
-void InitDefaultsVersionDef();
-inline void InitDefaults() {
-  InitDefaultsVersionDef();
-}
-}  // namespace protobuf_versions_2eproto
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_versions_2eproto;
 namespace opencv_tensorflow {
 class VersionDef;
-class VersionDefDefaultTypeInternal;
+struct VersionDefDefaultTypeInternal;
 extern VersionDefDefaultTypeInternal _VersionDef_default_instance_;
 }  // namespace opencv_tensorflow
+PROTOBUF_NAMESPACE_OPEN
+template<> ::opencv_tensorflow::VersionDef* Arena::CreateMaybeMessage<::opencv_tensorflow::VersionDef>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
 namespace opencv_tensorflow {
 
 // ===================================================================
 
-class VersionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.VersionDef) */ {
+class VersionDef final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.VersionDef) */ {
  public:
-  VersionDef();
-  virtual ~VersionDef();
+  inline VersionDef() : VersionDef(nullptr) {}
+  ~VersionDef() override;
+  explicit constexpr VersionDef(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   VersionDef(const VersionDef& from);
-
-  inline VersionDef& operator=(const VersionDef& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
   VersionDef(VersionDef&& from) noexcept
     : VersionDef() {
     *this = ::std::move(from);
   }
 
+  inline VersionDef& operator=(const VersionDef& from) {
+    CopyFrom(from);
+    return *this;
+  }
   inline VersionDef& operator=(VersionDef&& from) noexcept {
-    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
     return *this;
   }
-  #endif
-  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
-    return GetArenaNoVirtual();
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return default_instance().GetMetadata().descriptor;
   }
-  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
-    return MaybeArenaPtr();
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const VersionDef& default_instance() {
+    return *internal_default_instance();
   }
-  static const ::google::protobuf::Descriptor* descriptor();
-  static const VersionDef& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
   static inline const VersionDef* internal_default_instance() {
     return reinterpret_cast<const VersionDef*>(
                &_VersionDef_default_instance_);
   }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+  static constexpr int kIndexInFileMessages =
     0;
 
-  void UnsafeArenaSwap(VersionDef* other);
-  void Swap(VersionDef* other);
   friend void swap(VersionDef& a, VersionDef& b) {
     a.Swap(&b);
   }
+  inline void Swap(VersionDef* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(VersionDef* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
 
   // implements Message ----------------------------------------------
 
-  inline VersionDef* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  VersionDef* 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;
+  VersionDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<VersionDef>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
   void CopyFrom(const VersionDef& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
   void MergeFrom(const VersionDef& 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:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);
+  public:
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void SetCachedSize(int size) const final;
   void InternalSwap(VersionDef* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "opencv_tensorflow.VersionDef";
+  }
   protected:
-  explicit VersionDef(::google::protobuf::Arena* arena);
+  explicit VersionDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   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();
-  }
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
   public:
 
-  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
 
   // nested types ----------------------------------------------------
 
   // accessors -------------------------------------------------------
 
+  enum : int {
+    kBadConsumersFieldNumber = 3,
+    kProducerFieldNumber = 1,
+    kMinConsumerFieldNumber = 2,
+  };
   // repeated int32 bad_consumers = 3;
   int bad_consumers_size() const;
+  private:
+  int _internal_bad_consumers_size() const;
+  public:
   void clear_bad_consumers();
-  static const int kBadConsumersFieldNumber = 3;
-  ::google::protobuf::int32 bad_consumers(int index) const;
-  void set_bad_consumers(int index, ::google::protobuf::int32 value);
-  void add_bad_consumers(::google::protobuf::int32 value);
-  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+  private:
+  int32_t _internal_bad_consumers(int index) const;
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+      _internal_bad_consumers() const;
+  void _internal_add_bad_consumers(int32_t value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+      _internal_mutable_bad_consumers();
+  public:
+  int32_t bad_consumers(int index) const;
+  void set_bad_consumers(int index, int32_t value);
+  void add_bad_consumers(int32_t value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
       bad_consumers() const;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
       mutable_bad_consumers();
 
   // int32 producer = 1;
   void clear_producer();
-  static const int kProducerFieldNumber = 1;
-  ::google::protobuf::int32 producer() const;
-  void set_producer(::google::protobuf::int32 value);
+  int32_t producer() const;
+  void set_producer(int32_t value);
+  private:
+  int32_t _internal_producer() const;
+  void _internal_set_producer(int32_t value);
+  public:
 
   // int32 min_consumer = 2;
   void clear_min_consumer();
-  static const int kMinConsumerFieldNumber = 2;
-  ::google::protobuf::int32 min_consumer() const;
-  void set_min_consumer(::google::protobuf::int32 value);
+  int32_t min_consumer() const;
+  void set_min_consumer(int32_t value);
+  private:
+  int32_t _internal_min_consumer() const;
+  void _internal_set_min_consumer(int32_t value);
+  public:
 
   // @@protoc_insertion_point(class_scope:opencv_tensorflow.VersionDef)
  private:
+  class _Internal;
 
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > bad_consumers_;
-  mutable int _bad_consumers_cached_byte_size_;
-  ::google::protobuf::int32 producer_;
-  ::google::protobuf::int32 min_consumer_;
-  mutable int _cached_size_;
-  friend struct ::protobuf_versions_2eproto::TableStruct;
-  friend void ::protobuf_versions_2eproto::InitDefaultsVersionDefImpl();
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > bad_consumers_;
+  mutable std::atomic<int> _bad_consumers_cached_byte_size_;
+  int32_t producer_;
+  int32_t min_consumer_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_versions_2eproto;
 };
 // ===================================================================
 
@@ -205,13 +260,19 @@ class VersionDef : public ::google::protobuf::Message /* @@protoc_insertion_poin
 inline void VersionDef::clear_producer() {
   producer_ = 0;
 }
-inline ::google::protobuf::int32 VersionDef::producer() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.producer)
+inline int32_t VersionDef::_internal_producer() const {
   return producer_;
 }
-inline void VersionDef::set_producer(::google::protobuf::int32 value) {
+inline int32_t VersionDef::producer() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.producer)
+  return _internal_producer();
+}
+inline void VersionDef::_internal_set_producer(int32_t value) {
 
   producer_ = value;
+}
+inline void VersionDef::set_producer(int32_t value) {
+  _internal_set_producer(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.VersionDef.producer)
 }
 
@@ -219,44 +280,67 @@ inline void VersionDef::set_producer(::google::protobuf::int32 value) {
 inline void VersionDef::clear_min_consumer() {
   min_consumer_ = 0;
 }
-inline ::google::protobuf::int32 VersionDef::min_consumer() const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.min_consumer)
+inline int32_t VersionDef::_internal_min_consumer() const {
   return min_consumer_;
 }
-inline void VersionDef::set_min_consumer(::google::protobuf::int32 value) {
+inline int32_t VersionDef::min_consumer() const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.min_consumer)
+  return _internal_min_consumer();
+}
+inline void VersionDef::_internal_set_min_consumer(int32_t value) {
 
   min_consumer_ = value;
+}
+inline void VersionDef::set_min_consumer(int32_t value) {
+  _internal_set_min_consumer(value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.VersionDef.min_consumer)
 }
 
 // repeated int32 bad_consumers = 3;
-inline int VersionDef::bad_consumers_size() const {
+inline int VersionDef::_internal_bad_consumers_size() const {
   return bad_consumers_.size();
 }
+inline int VersionDef::bad_consumers_size() const {
+  return _internal_bad_consumers_size();
+}
 inline void VersionDef::clear_bad_consumers() {
   bad_consumers_.Clear();
 }
-inline ::google::protobuf::int32 VersionDef::bad_consumers(int index) const {
-  // @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.bad_consumers)
+inline int32_t VersionDef::_internal_bad_consumers(int index) const {
   return bad_consumers_.Get(index);
 }
-inline void VersionDef::set_bad_consumers(int index, ::google::protobuf::int32 value) {
+inline int32_t VersionDef::bad_consumers(int index) const {
+  // @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.bad_consumers)
+  return _internal_bad_consumers(index);
+}
+inline void VersionDef::set_bad_consumers(int index, int32_t value) {
   bad_consumers_.Set(index, value);
   // @@protoc_insertion_point(field_set:opencv_tensorflow.VersionDef.bad_consumers)
 }
-inline void VersionDef::add_bad_consumers(::google::protobuf::int32 value) {
+inline void VersionDef::_internal_add_bad_consumers(int32_t value) {
   bad_consumers_.Add(value);
+}
+inline void VersionDef::add_bad_consumers(int32_t value) {
+  _internal_add_bad_consumers(value);
   // @@protoc_insertion_point(field_add:opencv_tensorflow.VersionDef.bad_consumers)
 }
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
+VersionDef::_internal_bad_consumers() const {
+  return bad_consumers_;
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >&
 VersionDef::bad_consumers() const {
   // @@protoc_insertion_point(field_list:opencv_tensorflow.VersionDef.bad_consumers)
-  return bad_consumers_;
+  return _internal_bad_consumers();
 }
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
+VersionDef::_internal_mutable_bad_consumers() {
+  return &bad_consumers_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >*
 VersionDef::mutable_bad_consumers() {
   // @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.VersionDef.bad_consumers)
-  return &bad_consumers_;
+  return _internal_mutable_bad_consumers();
 }
 
 #ifdef __GNUC__
@@ -269,4 +353,5 @@ VersionDef::mutable_bad_consumers() {
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_versions_2eproto__INCLUDED
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_versions_2eproto